From b01a9931ba9d5798934ffe4f54b8acd95a9e65ab Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 11 May 2022 11:33:00 -0400 Subject: [PATCH 0001/1127] Added simpler logger with colored messages --- flowsa/flowsa_log.py | 73 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 flowsa/flowsa_log.py diff --git a/flowsa/flowsa_log.py b/flowsa/flowsa_log.py new file mode 100644 index 000000000..48936fb42 --- /dev/null +++ b/flowsa/flowsa_log.py @@ -0,0 +1,73 @@ +import logging +import sys +from .settings import logoutputpath + +try: + from colorama import init, Fore, Style +except ModuleNotFoundError: + print('Install colorama for colored log output') + console_formatter = logging.Formatter( + '%(asctime)s %(levelname)-8s %(message)s', + datefmt='%Y-%m-%d %H:%M:%S') +else: + init() + + class ColoredFormatter(logging.Formatter): + FORMATS = { + logging.DEBUG: logging.Formatter('%(asctime)s ' + Fore.CYAN + + '%(levelname)-8s' + Fore.RESET + + ' %(message)s', + datefmt='%Y-%m-%d %H:%M:%S'), + logging.INFO: logging.Formatter('%(asctime)s ' + Fore.GREEN + + '%(levelname)-8s' + Fore.RESET + + ' %(message)s', + datefmt='%Y-%m-%d %H:%M:%S'), + logging.WARNING: logging.Formatter('%(asctime)s ' + Fore.YELLOW + + '%(levelname)-8s' + Fore.RESET + + ' %(message)s', + datefmt='%Y-%m-%d %H:%M:%S'), + logging.ERROR: logging.Formatter('%(asctime)s ' + Fore.RED + + '%(levelname)-8s' + Fore.RESET + + ' %(message)s', + datefmt='%Y-%m-%d %H:%M:%S'), + logging.CRITICAL: logging.Formatter('%(asctime)s ' + Fore.RED + + Style.BRIGHT + + '%(levelname)-8s' + + Style.RESET_ALL + + ' %(message)s', + datefmt='%Y-%m-%d %H:%M:%S') + } + + def format(self, record): + return self.FORMATS.get(record.levelno).format(record) + + console_formatter = ColoredFormatter() + +file_formatter = logging.Formatter('%(asctime)s %(levelname)-8s %(message)s', + datefmt='%Y-%m-%d %H:%M:%S') + +log_file_handler = logging.FileHandler( + logoutputpath + 'flowsa.log', + mode='w', encoding='utf-8') +log_file_handler.setLevel(logging.DEBUG) +log_file_handler.setFormatter(file_formatter) + +validation_file_handler = logging.FileHandler( + logoutputpath + 'flowsa_validation.log', + mode='w', encoding='utf-8') +validation_file_handler.setLevel(logging.DEBUG) +validation_file_handler.setFormatter(file_formatter) + +console_handler = logging.StreamHandler(sys.stdout) +console_handler.setLevel(logging.INFO) +console_handler.setFormatter(console_formatter) + +log = logging.getLogger('flowsa') +log.setLevel(logging.DEBUG) +log.addHandler(console_handler) +log.addHandler(log_file_handler) +log.propagate = False + +vlog = logging.getLogger('flowsa.validation') +vlog.setLevel(logging.DEBUG) +vlog.addHandler(validation_file_handler) From 68914d611e5c2c8385f9a7e6286368c5a2045597 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 11 May 2022 11:33:52 -0400 Subject: [PATCH 0002/1127] Fixed typo --- flowsa/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/__init__.py b/flowsa/__init__.py index f004184a4..fbcdd50b3 100644 --- a/flowsa/__init__.py +++ b/flowsa/__init__.py @@ -214,7 +214,7 @@ def seeAvailableFlowByModels(flowbytype, print_method=True): def generateFBSplot(method_dict, plottype, sector_length_display=None, - sectors_to_include=None, plot_title=None): + sectors_to_include=None, plot_title=None): """ Plot the results of FBS models. Graphic can either be a faceted scatterplot or a method comparison From 1e4aa551720ebcea3d9fb6ac0838b2fe668f7b51 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 11 May 2022 11:34:40 -0400 Subject: [PATCH 0003/1127] Added new flowby and flowby_config --- .gitignore | 3 +- flowsa/data/flowby_config.yaml | 151 ++++++++++++ flowsa/flowby.py | 427 +++++++++++++++++++++++++++++++++ 3 files changed, 580 insertions(+), 1 deletion(-) create mode 100644 flowsa/data/flowby_config.yaml create mode 100644 flowsa/flowby.py diff --git a/.gitignore b/.gitignore index ee0b3dada..0b1addeb6 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ venv *__pycache__ *.egg* *.cache -**/data/fbs_diff/* \ No newline at end of file +**/data/fbs_diff/* +flowby-old.py \ No newline at end of file diff --git a/flowsa/data/flowby_config.yaml b/flowsa/data/flowby_config.yaml new file mode 100644 index 000000000..fce67501e --- /dev/null +++ b/flowsa/data/flowby_config.yaml @@ -0,0 +1,151 @@ +flow_by_activity_fields: &fba_fields + ActivityConsumedBy: string + ActivityProducedBy: string + Class: string + Compartment: string + DataCollection: float + DataReliability: float + Description: string + DistributionType: string + FlowAmount: float + FlowName: string + FlowType: string + Location: string + LocationSystem: string + Max: float + MeasureofSpread: string + Min: float + SourceName: string + Spread: float + Unit: string + Year: int + +_mapped_fields: &mapped_fields + Context: string + FlowUUID: string + Flowable: string + +_sector_fields: §or_fields + ConsumedBySectorType: string + ProducedBySectorType: string + SectorConsumedBy: string + SectorProducedBy: string + SectorSourceName: string + +flow_by_activity_mapped_fields: + <<: [*fba_fields, *mapped_fields] + +flow_by_activity_mapped_wsec_fields: + <<: [*fba_fields, *mapped_fields, *sector_fields] + +flow_by_activity_wsec_fields: + <<: [*fba_fields, *sector_fields] + +fba_column_order: + - Class + - SourceName + - FlowName + - Flowable + - FlowAmount + - Unit + - FlowType + - ActivityProducedBy + - ActivityConsumedBy + - Compartment + - Context + - Location + - LocationSystem + - Year + - MeasureofSpread + - Spread + - DistributionType + - Min + - Max + - DataReliability + - DataCollection + - Description + - FlowUUID + - SectorProducedBy + - SectorConsumedBy + - SectorSourceName + - ProducedBySectorType + - ConsumedBySectorType + +_flow_by_sector_base_fields: &fbs_base_fields + Class: string + Context: string + DataCollection: float + DataReliability: float + DistributionType: string + FlowAmount: float + FlowType: string + FlowUUID: string + Flowable: string + GeographicalCorrelation: float + Location: string + LocationSystem: string + Max: float + MeasureofSpread: string + MetaSources: string + Min: float + SectorSourceName: string + Spread: float + TechnologicalCorrelation: float + TemporalCorrelation: float + Unit: string + Year: int + +_collapsed_fields: &collapsed_fields + Sector: string + +_activity_fields: &activity_fields + ActivityConsumedBy: string + ActivityProducedBy: string + +flow_by_sector_fields: &fbs_fields + <<: *fbs_base_fields + SectorConsumedBy: string + SectorProducedBy: string + +flow_by_sector_fields_w_activity: + <<: [*fbs_fields, *activity_fields] + +flow_by_sector_collapsed_fields: + <<: [*fbs_base_fields, *collapsed_fields] + +fbs_column_order: + - Flowable + - Class + - Sector + - SectorProducedBy + - SectorConsumedBy + - SectorSourceName + - Context + - Location + - LocationSystem + - flowAmount + - Unit + - FlowType + - Year + - MeasureofSpread + - Spread + - DistributionType + - Min + - Max + - DataReliability + - TemporalCorrelation + - GeographicalCorrelation + - TechnologicalCorrelation + - DataCollection + - MetaSources + - FlowUUID + - ActivityProducedBy + - ActivityConsumedBy + +activity_fields: + ProducedBy: + flowbyactivity: ActivityProducedBy + flowbysector: SectorProducedBy + ConsumedBy: + flowbyactivity: ActivityConsumedBy + flowbysector: SectorConsumedBy diff --git a/flowsa/flowby.py b/flowsa/flowby.py new file mode 100644 index 000000000..c9f872fc9 --- /dev/null +++ b/flowsa/flowby.py @@ -0,0 +1,427 @@ +from typing import Callable, List, Literal, TypeVar +import pandas as pd +import numpy as np +from functools import partial +from . import (common, settings, location, dataclean, metadata, sectormapping, + literature_values, flowbyactivity, flowbysector, flowsa_yaml, + validation) +from .flowsa_log import log, vlog +import esupy.processed_data_mgmt +import esupy.dqi + +FB = TypeVar('FB', bound='_FlowBy') + +with open(settings.datapath + 'flowby_config.yaml') as f: + flowby_config = flowsa_yaml.load(f) + + +class _FlowBy(pd.DataFrame): + def __init__( + self, + data: pd.DataFrame or '_FlowBy' = None, + *args, + fields: dict = None, + column_order: List[str] = None, + string_null: str or pd.NA = None, + **kwargs + ) -> None: + if isinstance(data, pd.DataFrame) and fields is not None: + fill_na_dict = { + field: 0 if dtype in ['int', 'float'] else pd.NA + for field, dtype in fields.items() + } + if string_null is not None: + self.string_null = string_null + if not hasattr(self, 'string_null'): + self.string_null = getattr(data, 'string_null', pd.NA) + na_string_dict = { + field: {null: self.string_null + for null in ['nan', 'None', '', np.nan, pd.NA, None]} + for field, dtype in fields.items() if dtype == 'string' + } + data = (data + .assign(**{field: None + for field in fields if field not in data.columns}) + .fillna(fill_na_dict) + .replace(na_string_dict) + .astype(fields)) + if isinstance(data, pd.DataFrame) and column_order is not None: + data = data[[c for c in column_order if c in data.columns] + + [c for c in data.columns if c not in column_order]] + super().__init__(data, *args, **kwargs) + + _metadata = ['string_null'] + + @property + def _constructor(self) -> '_FlowBy': + return _FlowBy + + @property + def _constructor_sliced(self) -> '_FlowBySeries': + return _FlowBySeries + + @classmethod + def _getFlowBy( + cls, + file_metadata: esupy.processed_data_mgmt.FileMeta, + download_ok: bool, + flowby_generator: partial, + output_path: str + ) -> '_FlowBy': + for attempt in ['import local', 'download', 'generate']: + log.info( + 'Attempting to %s %s %s', + attempt, file_metadata.name_data, file_metadata.category + ) + if attempt == 'download' and download_ok: + esupy.processed_data_mgmt.download_from_remote( + file_metadata, + settings.paths + ) + if attempt == 'generate': + flowby_generator() + df = esupy.processed_data_mgmt.load_preprocessed_output( + file_metadata, + settings.paths + ) + if df is None: + log.info( + '%s %s not found in %s', + file_metadata.name_data, + file_metadata.category, + output_path + ) + else: + log.info( + 'Successfully loaded %s %s from %s', + file_metadata.name_data, + file_metadata.category, + output_path + ) + break + else: + log.error( + '%s %s could not be found locally, downloaded, or generated', + file_metadata.name_data, file_metadata.category + ) + fb = cls(df) + return fb + + # TODO: Should this, or some variation thereof, be run during __init__()? + def clean_fb( + self: FB, + fields: dict, + column_order: list = None, + keep_description: bool = False + ) -> FB: + ''' + Ensures that the given columns are all present and their datatypes + are correct. Also ensure that columns are in the given order, with + any columns whose order is not specified coming at the end. + :param fields: dict, indicates columns that should be present and their + datatypes. Generally an entry from flowby_config.yaml + :param column_order: list, gives the order columns should appear in + :param keep_description: bool, default = False. Whether the Description + column should be retained if present + ''' + fill_na_dict = {field: 0 if field_config['dtype'] in ['int', 'float'] + else None + for field, field_config in fields.items()} + + fb = (self + .assign(**{field: None + for field in fields if field not in self.columns}) + .astype({field: field_config['dtype'] + for field, field_config in fields.items()}) + .fillna(fill_na_dict) + .replace( + {field: {null: None for null in ['nan', 'None', np.nan, '']} + for field, field_config in fields.items() + if field_config['dtype'] == 'str'}) + .reset_index(drop=True)) + + if not keep_description: + fb = fb.drop(columns='Description', errors='ignore') + + if column_order is not None: + fb = fb[[c for c in column_order if c in fb.columns] + + [c for c in fb.columns if c not in column_order]] + + return fb + + def conditional_pipe( + self: FB, + condition: bool, + function: Callable, + *args, **kwargs + ) -> FB: + ''' + Similar to pandas .pipe() method, but first checks if the given + condition is true. If it is not, then the object that called + conditional_pipe is returned unchanged. Additional args and kwargs + are passed to function + :param condition: bool, condition under which the given function should + be called + :param function: Callable, function that expects a DataFrame or _FlowBy + as the first argument + :return: function(self, *args, **kwargs) if condition is True, + else self + ''' + if condition: + return function(self, *args, **kwargs) + else: + return self + + def conditional_method( + self: FB, + condition: bool, + method: str, + *args, **kwargs + ) -> FB: + ''' + Conditionally calls the specified method of the calling FlowBy. + Additional args and kwargs are passed to the method + :param condition: bool, condition under which the given method should + be called + :param function: str, name of FlowBy or DataFrame method + :return: self.method(*args, **kwargs) if condition is True, else self + ''' + if condition: + return getattr(self, method)(*args, **kwargs) + else: + return self + + +class FlowByActivity(_FlowBy): + def __init__( + self, + data: pd.DataFrame or '_FlowBy' = None, + *args, + mapped: bool = False, + w_sector: bool = False, + **kwargs + ) -> None: + if isinstance(data, pd.DataFrame): + self.mapped = mapped or any( + [c in data.columns for c in flowby_config['_mapped_fields']] + ) + self.w_sector = w_sector or any( + [c in data.columns for c in flowby_config['_sector_fields']] + ) + + if self.mapped and self.w_sector: + fields = flowby_config['flow_by_activity_mapped_wsec_fields'] + elif self.mapped: + fields = flowby_config['flow_by_activity_mapped_fields'] + elif self.w_sector: + fields = flowby_config['flow_by_activity_wsec_fields'] + else: + fields = flowby_config['flow_by_activity_fields'] + + column_order = flowby_config['fba_column_order'] + else: + fields = None + column_order = None + + super().__init__(data, + fields=fields, + column_order=column_order, + *args, **kwargs) + + _metadata = [*_FlowBy()._metadata, 'mapped', 'w_sector'] + + @property + def _constructor(self) -> 'FlowByActivity': + return FlowByActivity + + @property + def _constructor_sliced(self) -> '_FBASeries': + return _FBASeries + + @classmethod + def getFlowByActivity( + cls, + source: str, + year: int = None, + download_ok: bool = settings.DEFAULT_DOWNLOAD_IF_MISSING + ) -> 'FlowByActivity': + """ + Loads stored data in the FlowByActivity format. If it is not + available, tries to download it from EPA's remote server (if + download_ok is True), or generate it. + :param datasource: str, the code of the datasource. + :param year: int, a year, e.g. 2012 + :param download_ok: bool, if True will attempt to load from + EPA remote server prior to generating + :return: a FlowByActivity dataframe + """ + file_metadata = metadata.set_fb_meta( + source if year is None else f'{source}_{year}', + 'FlowByActivity' + ) + flowby_generator = partial( + flowbyactivity.main, + source=source, + year=year + ) + fb = super()._getFlowBy( + file_metadata=file_metadata, + download_ok=download_ok, + flowby_generator=flowby_generator, + output_path=settings.fbaoutputpath + ) + fba = cls(fb) + return fba + + # def clean_fb( + # self: FB, + # fields: Literal[ + # 'flow_by_activity_fields', + # 'flow_by_activity_mapped_fields', + # 'flow_by_activity_wsec_fields', + # 'flow_by_activity_mapped_wsec_fields' + # ] = 'flow_by_activity_fields', + # keep_description: bool = False + # ) -> 'FlowByActivity': + # return super().clean_fb(flowby_config[fields], + # flowby_config['fba_column_order'], + # keep_description) + + +class FlowBySector(_FlowBy): + def __init__( + self, + data: pd.DataFrame or '_FlowBy' = None, + *args, + collapsed: bool = False, + w_activity: bool = False, + **kwargs + ) -> None: + if isinstance(data, pd.DataFrame): + self.collapsed = collapsed or any( + [c in data.columns for c in flowby_config['_collapsed_fields']] + ) + self.w_activity = w_activity or any( + [c in data.columns for c in flowby_config['_activity_fields']] + ) + + if self.collapsed: + fields = flowby_config['flow_by_sector_collapsed_fields'] + elif self.w_activity: + fields = flowby_config['flow_by_sector_fields_w_activity'] + else: + fields = flowby_config['flow_by_sector_fields'] + + column_order = flowby_config['fbs_column_order'] + else: + fields = None + column_order = None + + super().__init__(data, + fields=fields, + column_order=column_order, + *args, **kwargs) + + _metadata = [*_FlowBy()._metadata, 'collapsed', 'w_activity'] + + @property + def _constructor(self) -> 'FlowBySector': + return FlowBySector + + @property + def _constructor_sliced(self) -> '_FBSSeries': + return _FBSSeries + + @classmethod + def getFlowBySector( + cls, + method: str, + external_config_path: str = None, + download_sources_ok: bool = settings.DEFAULT_DOWNLOAD_IF_MISSING, + download_fbs_ok: bool = settings.DEFAULT_DOWNLOAD_IF_MISSING + ) -> 'FlowBySector': + """ + Loads stored FlowBySector output. If it is not + available, tries to download it from EPA's remote server (if + download_ok is True), or generate it. + :param method: string, name of the FBS attribution method file to use + :param external_config_path: str, path to the FBS method file if + loading a file from outside the flowsa repository + :param download_fba_ok: bool, if True will attempt to load FBAs + used in generating the FBS from EPA's remote server rather than + generating (if not found locally) + :param download_FBS_if_missing: bool, if True will attempt to load the + the FBS from EPA's remote server rather than generating it + (if not found locally) + :return: FlowBySector dataframe + """ + file_metadata = metadata.set_fb_meta(method, 'FlowBySector') + flowby_generator = partial( + flowbysector.main, + method=method, + fbsconfigpath=external_config_path, + download_FBAs_if_missing=download_sources_ok + ) + fb = super()._getFlowBy( + file_metadata=file_metadata, + download_ok=download_fbs_ok, + flowby_generator=flowby_generator, + output_path=settings.fbsoutputpath + ) + fbs = cls(fb) + return fbs + + # def clean_fb( + # self, + # fields: Literal[ + # 'flow_by_sector_fields', + # 'flow_by_sector_fields_w_activity', + # 'flow_by_sector_collapsed_fields' + # ] = 'flow_by_sector_fields', + # keep_description: bool = False + # ) -> '_FlowBy': + # return super().clean_fb(flowby_config[fields], + # flowby_config['fbs_column_order'], + # keep_description) + +# The three classes extending pd.Series, together with the _constructor... +# methods of each class, are required for allowing pandas methods called on +# objects of these classes to return objects of these classes, as desired. +# For more information, see +# https://pandas.pydata.org/docs/development/extending.html + + +class _FlowBySeries(pd.Series): + _metadata = [*_FlowBy()._metadata] + + @property + def _constructor(self) -> '_FlowBySeries': + return _FlowBySeries + + @property + def _constructor_expanddim(self) -> '_FlowBy': + return _FlowBy + + +class _FBASeries(pd.Series): + _metadata = [*FlowByActivity()._metadata] + + @property + def _constructor(self) -> '_FBASeries': + return _FBASeries + + @property + def _constructor_expanddim(self) -> 'FlowByActivity': + return FlowByActivity + + +class _FBSSeries(pd.Series): + _metadata = [*FlowBySector()._metadata] + + @property + def _constructor(self) -> '_FBSSeries': + return _FBSSeries + + @property + def _constructor_expanddim(self) -> 'FlowBySector': + return FlowBySector From 63c9350d6f9ffbd1694420617523c917e6f734ba Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 11 May 2022 11:44:34 -0400 Subject: [PATCH 0004/1127] Removed clean_fb methods --- flowsa/flowby.py | 69 ------------------------------------------------ 1 file changed, 69 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index c9f872fc9..983e0c7a0 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -107,48 +107,6 @@ def _getFlowBy( fb = cls(df) return fb - # TODO: Should this, or some variation thereof, be run during __init__()? - def clean_fb( - self: FB, - fields: dict, - column_order: list = None, - keep_description: bool = False - ) -> FB: - ''' - Ensures that the given columns are all present and their datatypes - are correct. Also ensure that columns are in the given order, with - any columns whose order is not specified coming at the end. - :param fields: dict, indicates columns that should be present and their - datatypes. Generally an entry from flowby_config.yaml - :param column_order: list, gives the order columns should appear in - :param keep_description: bool, default = False. Whether the Description - column should be retained if present - ''' - fill_na_dict = {field: 0 if field_config['dtype'] in ['int', 'float'] - else None - for field, field_config in fields.items()} - - fb = (self - .assign(**{field: None - for field in fields if field not in self.columns}) - .astype({field: field_config['dtype'] - for field, field_config in fields.items()}) - .fillna(fill_na_dict) - .replace( - {field: {null: None for null in ['nan', 'None', np.nan, '']} - for field, field_config in fields.items() - if field_config['dtype'] == 'str'}) - .reset_index(drop=True)) - - if not keep_description: - fb = fb.drop(columns='Description', errors='ignore') - - if column_order is not None: - fb = fb[[c for c in column_order if c in fb.columns] - + [c for c in fb.columns if c not in column_order]] - - return fb - def conditional_pipe( self: FB, condition: bool, @@ -273,20 +231,6 @@ def getFlowByActivity( fba = cls(fb) return fba - # def clean_fb( - # self: FB, - # fields: Literal[ - # 'flow_by_activity_fields', - # 'flow_by_activity_mapped_fields', - # 'flow_by_activity_wsec_fields', - # 'flow_by_activity_mapped_wsec_fields' - # ] = 'flow_by_activity_fields', - # keep_description: bool = False - # ) -> 'FlowByActivity': - # return super().clean_fb(flowby_config[fields], - # flowby_config['fba_column_order'], - # keep_description) - class FlowBySector(_FlowBy): def __init__( @@ -371,18 +315,6 @@ def getFlowBySector( fbs = cls(fb) return fbs - # def clean_fb( - # self, - # fields: Literal[ - # 'flow_by_sector_fields', - # 'flow_by_sector_fields_w_activity', - # 'flow_by_sector_collapsed_fields' - # ] = 'flow_by_sector_fields', - # keep_description: bool = False - # ) -> '_FlowBy': - # return super().clean_fb(flowby_config[fields], - # flowby_config['fbs_column_order'], - # keep_description) # The three classes extending pd.Series, together with the _constructor... # methods of each class, are required for allowing pandas methods called on @@ -390,7 +322,6 @@ def getFlowBySector( # For more information, see # https://pandas.pydata.org/docs/development/extending.html - class _FlowBySeries(pd.Series): _metadata = [*_FlowBy()._metadata] From 3d8ae505393898811713f355111709f2325e894c Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 11 May 2022 12:21:14 -0400 Subject: [PATCH 0005/1127] Removed custom attributes since unnecessary --- flowsa/flowby.py | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 983e0c7a0..4bf6a19a0 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -22,7 +22,6 @@ def __init__( *args, fields: dict = None, column_order: List[str] = None, - string_null: str or pd.NA = None, **kwargs ) -> None: if isinstance(data, pd.DataFrame) and fields is not None: @@ -30,12 +29,8 @@ def __init__( field: 0 if dtype in ['int', 'float'] else pd.NA for field, dtype in fields.items() } - if string_null is not None: - self.string_null = string_null - if not hasattr(self, 'string_null'): - self.string_null = getattr(data, 'string_null', pd.NA) na_string_dict = { - field: {null: self.string_null + field: {null: pd.NA for null in ['nan', 'None', '', np.nan, pd.NA, None]} for field, dtype in fields.items() if dtype == 'string' } @@ -50,7 +45,7 @@ def __init__( + [c for c in data.columns if c not in column_order]] super().__init__(data, *args, **kwargs) - _metadata = ['string_null'] + _metadata = [] @property def _constructor(self) -> '_FlowBy': @@ -160,18 +155,18 @@ def __init__( **kwargs ) -> None: if isinstance(data, pd.DataFrame): - self.mapped = mapped or any( + mapped = mapped or any( [c in data.columns for c in flowby_config['_mapped_fields']] ) - self.w_sector = w_sector or any( + w_sector = w_sector or any( [c in data.columns for c in flowby_config['_sector_fields']] ) - if self.mapped and self.w_sector: + if mapped and w_sector: fields = flowby_config['flow_by_activity_mapped_wsec_fields'] - elif self.mapped: + elif mapped: fields = flowby_config['flow_by_activity_mapped_fields'] - elif self.w_sector: + elif w_sector: fields = flowby_config['flow_by_activity_wsec_fields'] else: fields = flowby_config['flow_by_activity_fields'] @@ -186,7 +181,7 @@ def __init__( column_order=column_order, *args, **kwargs) - _metadata = [*_FlowBy()._metadata, 'mapped', 'w_sector'] + _metadata = [*_FlowBy()._metadata] @property def _constructor(self) -> 'FlowByActivity': @@ -242,16 +237,16 @@ def __init__( **kwargs ) -> None: if isinstance(data, pd.DataFrame): - self.collapsed = collapsed or any( + collapsed = collapsed or any( [c in data.columns for c in flowby_config['_collapsed_fields']] ) - self.w_activity = w_activity or any( + w_activity = w_activity or any( [c in data.columns for c in flowby_config['_activity_fields']] ) - if self.collapsed: + if collapsed: fields = flowby_config['flow_by_sector_collapsed_fields'] - elif self.w_activity: + elif w_activity: fields = flowby_config['flow_by_sector_fields_w_activity'] else: fields = flowby_config['flow_by_sector_fields'] @@ -266,7 +261,7 @@ def __init__( column_order=column_order, *args, **kwargs) - _metadata = [*_FlowBy()._metadata, 'collapsed', 'w_activity'] + _metadata = [*_FlowBy()._metadata] @property def _constructor(self) -> 'FlowBySector': From ffe236b08591d7be62c10c15b1aac8c9a1d88557 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 11 May 2022 12:59:26 -0400 Subject: [PATCH 0006/1127] Shortened/simplified names --- flowsa/data/flowby_config.yaml | 16 ++++++++-------- flowsa/flowby.py | 14 +++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/flowsa/data/flowby_config.yaml b/flowsa/data/flowby_config.yaml index fce67501e..7405522ca 100644 --- a/flowsa/data/flowby_config.yaml +++ b/flowsa/data/flowby_config.yaml @@ -1,4 +1,4 @@ -flow_by_activity_fields: &fba_fields +fba_fields: &fba_fields ActivityConsumedBy: string ActivityProducedBy: string Class: string @@ -32,13 +32,13 @@ _sector_fields: §or_fields SectorProducedBy: string SectorSourceName: string -flow_by_activity_mapped_fields: +fba_mapped_fields: <<: [*fba_fields, *mapped_fields] -flow_by_activity_mapped_wsec_fields: +fba_mapped_w_sector_fields: <<: [*fba_fields, *mapped_fields, *sector_fields] -flow_by_activity_wsec_fields: +fba_w_sector_fields: <<: [*fba_fields, *sector_fields] fba_column_order: @@ -71,7 +71,7 @@ fba_column_order: - ProducedBySectorType - ConsumedBySectorType -_flow_by_sector_base_fields: &fbs_base_fields +_fbs_base_fields: &fbs_base_fields Class: string Context: string DataCollection: float @@ -102,15 +102,15 @@ _activity_fields: &activity_fields ActivityConsumedBy: string ActivityProducedBy: string -flow_by_sector_fields: &fbs_fields +fbs_fields: &fbs_fields <<: *fbs_base_fields SectorConsumedBy: string SectorProducedBy: string -flow_by_sector_fields_w_activity: +fbs_w_activity_fields: <<: [*fbs_fields, *activity_fields] -flow_by_sector_collapsed_fields: +fbs_collapsed_fields: <<: [*fbs_base_fields, *collapsed_fields] fbs_column_order: diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 4bf6a19a0..71b0cd931 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -163,13 +163,13 @@ def __init__( ) if mapped and w_sector: - fields = flowby_config['flow_by_activity_mapped_wsec_fields'] + fields = flowby_config['fba_mapped_w_sector_fields'] elif mapped: - fields = flowby_config['flow_by_activity_mapped_fields'] + fields = flowby_config['fba_mapped_fields'] elif w_sector: - fields = flowby_config['flow_by_activity_wsec_fields'] + fields = flowby_config['fba_w_sector_fields'] else: - fields = flowby_config['flow_by_activity_fields'] + fields = flowby_config['fba_fields'] column_order = flowby_config['fba_column_order'] else: @@ -245,11 +245,11 @@ def __init__( ) if collapsed: - fields = flowby_config['flow_by_sector_collapsed_fields'] + fields = flowby_config['fbs_collapsed_fields'] elif w_activity: - fields = flowby_config['flow_by_sector_fields_w_activity'] + fields = flowby_config['fbs_w_activity_fields'] else: - fields = flowby_config['flow_by_sector_fields'] + fields = flowby_config['fbs_fields'] column_order = flowby_config['fbs_column_order'] else: From 303f3f032c4d9eaa01e10c5a1204683b75d26589 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 11 May 2022 13:04:17 -0400 Subject: [PATCH 0007/1127] get... functions in __init__.py -> FB methods --- flowsa/__init__.py | 103 ++------------------------------------------- 1 file changed, 3 insertions(+), 100 deletions(-) diff --git a/flowsa/__init__.py b/flowsa/__init__.py index fbcdd50b3..265bb2679 100644 --- a/flowsa/__init__.py +++ b/flowsa/__init__.py @@ -31,107 +31,10 @@ import flowsa.flowbysector from flowsa.bibliography import generate_fbs_bibliography from flowsa.datavisualization import plotFBSresults +from .flowby import FlowByActivity, FlowBySector - -def getFlowByActivity(datasource, year, flowclass=None, geographic_level=None, - download_FBA_if_missing=DEFAULT_DOWNLOAD_IF_MISSING): - """ - Retrieves stored data in the FlowByActivity format - :param datasource: str, the code of the datasource. - :param year: int, a year, e.g. 2012 - :param flowclass: str, a 'Class' of the flow. Optional. E.g. 'Water' - :param geographic_level: str, a geographic level of the data. - Optional. E.g. 'national', 'state', 'county'. - :param download_FBA_if_missing: bool, if True will attempt to load from - remote server prior to generating if file not found locally - :return: a pandas DataFrame in FlowByActivity format - """ - # Set fba metadata - name = flowsa.flowbyactivity.set_fba_name(datasource, year) - fba_meta = set_fb_meta(name, "FlowByActivity") - - # Try to load a local version of FBA - fba = load_preprocessed_output(fba_meta, paths) - # If that didn't work, try to download a remote version of FBA - if fba is None and download_FBA_if_missing: - log.info('%s %s not found in %s, downloading from remote source', - datasource, str(year), fbaoutputpath) - download_from_remote(fba_meta, paths) - fba = load_preprocessed_output(fba_meta, paths) - # If that didn't work or wasn't allowed, try to construct the FBA - if fba is None: - log.info('%s %s not found in %s, running functions to generate FBA', - datasource, str(year), fbaoutputpath) - # Generate the fba - flowsa.flowbyactivity.main(year=year, source=datasource) - # Now load the fba - fba = load_preprocessed_output(fba_meta, paths) - # If none of the above worked, log an error message - if fba is None: - log.error('getFlowByActivity failed, FBA not found') - # Otherwise (that is, if one of the above methods successfuly loaded the - # FBA), log it. - else: - log.info('Loaded %s %s from %s', datasource, str(year), fbaoutputpath) - - # Address optional parameters - if flowclass is not None: - fba = fba[fba['Class'] == flowclass] - # if geographic level specified, only load rows in geo level - if geographic_level is not None: - fba = filter_by_geoscale(fba, geographic_level) - return fba - - -def getFlowBySector(methodname, fbsconfigpath=None, - download_FBAs_if_missing=DEFAULT_DOWNLOAD_IF_MISSING, - download_FBS_if_missing=DEFAULT_DOWNLOAD_IF_MISSING): - """ - Loads stored FlowBySector output or generates it if it doesn't exist, - then loads - :param methodname: string, Name of an available method for the given class - :param fbsconfigpath: str, path to the FBS method file if loading a file - from outside the flowsa repository - :param download_FBAs_if_missing: bool, if True will attempt to load FBAS - used in generating the FBS from remote server prior to generating if - file not found locally - :param download_FBS_if_missing: bool, if True will attempt to load from - remote server prior to generating if file not found locally - :return: dataframe in flow by sector format - """ - fbs_meta = set_fb_meta(methodname, "FlowBySector") - # Try to load a local version of the FBS - fbs = load_preprocessed_output(fbs_meta, paths) - # If that didn't work, try to download a remote version of FBS - if fbs is None and download_FBS_if_missing: - log.info('%s not found in %s, downloading from remote source', - methodname, fbsoutputpath) - # download and load the FBS parquet - subdirectory_dict = {'.log': 'Log'} - download_from_remote(fbs_meta, paths, - subdirectory_dict=subdirectory_dict) - fbs = load_preprocessed_output(fbs_meta, paths) - # If that didn't work or wasn't allowed, try to construct the FBS - if fbs is None: - log.info('%s not found in %s, running functions to generate FBS', - methodname, fbsoutputpath) - # Generate the fbs, with option to download any required FBAs from - # Data Commons - flowsa.flowbysector.main( - method=methodname, - fbsconfigpath=fbsconfigpath, - download_FBAs_if_missing=download_FBAs_if_missing - ) - # Now load the fbs - fbs = load_preprocessed_output(fbs_meta, paths) - # If none of the above worked, log an error message - if fbs is None: - log.error('getFlowBySector failed, FBS not found') - # Otherwise (that is, if one of the above methods successfuly loaded the - # FBS), log it. - else: - log.info('Loaded %s from %s', methodname, fbsoutputpath) - return fbs +getFlowByActivity = FlowByActivity.getFlowByActivity +getFlowBySector = FlowBySector.getFlowBySector def collapse_FlowBySector(methodname, fbsconfigpath=None, From d4ca3c0e0107ec3f4ee18c7fbbdc5ce87361c39f Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 11 May 2022 13:22:06 -0400 Subject: [PATCH 0008/1127] Modified __init__.py get... methods to use FB --- flowsa/__init__.py | 99 ++++++---------------------------------------- 1 file changed, 13 insertions(+), 86 deletions(-) diff --git a/flowsa/__init__.py b/flowsa/__init__.py index fbcdd50b3..1465463d4 100644 --- a/flowsa/__init__.py +++ b/flowsa/__init__.py @@ -31,52 +31,18 @@ import flowsa.flowbysector from flowsa.bibliography import generate_fbs_bibliography from flowsa.datavisualization import plotFBSresults +from .flowby import FlowByActivity, FlowBySector def getFlowByActivity(datasource, year, flowclass=None, geographic_level=None, download_FBA_if_missing=DEFAULT_DOWNLOAD_IF_MISSING): - """ - Retrieves stored data in the FlowByActivity format - :param datasource: str, the code of the datasource. - :param year: int, a year, e.g. 2012 - :param flowclass: str, a 'Class' of the flow. Optional. E.g. 'Water' - :param geographic_level: str, a geographic level of the data. - Optional. E.g. 'national', 'state', 'county'. - :param download_FBA_if_missing: bool, if True will attempt to load from - remote server prior to generating if file not found locally - :return: a pandas DataFrame in FlowByActivity format - """ - # Set fba metadata - name = flowsa.flowbyactivity.set_fba_name(datasource, year) - fba_meta = set_fb_meta(name, "FlowByActivity") - - # Try to load a local version of FBA - fba = load_preprocessed_output(fba_meta, paths) - # If that didn't work, try to download a remote version of FBA - if fba is None and download_FBA_if_missing: - log.info('%s %s not found in %s, downloading from remote source', - datasource, str(year), fbaoutputpath) - download_from_remote(fba_meta, paths) - fba = load_preprocessed_output(fba_meta, paths) - # If that didn't work or wasn't allowed, try to construct the FBA - if fba is None: - log.info('%s %s not found in %s, running functions to generate FBA', - datasource, str(year), fbaoutputpath) - # Generate the fba - flowsa.flowbyactivity.main(year=year, source=datasource) - # Now load the fba - fba = load_preprocessed_output(fba_meta, paths) - # If none of the above worked, log an error message - if fba is None: - log.error('getFlowByActivity failed, FBA not found') - # Otherwise (that is, if one of the above methods successfuly loaded the - # FBA), log it. - else: - log.info('Loaded %s %s from %s', datasource, str(year), fbaoutputpath) - - # Address optional parameters + fba = FlowByActivity.getFlowByActivity( + source=datasource, + year=int(year), + download_ok=download_FBA_if_missing + ) if flowclass is not None: - fba = fba[fba['Class'] == flowclass] + fba = fba.query('Class == @flowclass') # if geographic level specified, only load rows in geo level if geographic_level is not None: fba = filter_by_geoscale(fba, geographic_level) @@ -86,51 +52,12 @@ def getFlowByActivity(datasource, year, flowclass=None, geographic_level=None, def getFlowBySector(methodname, fbsconfigpath=None, download_FBAs_if_missing=DEFAULT_DOWNLOAD_IF_MISSING, download_FBS_if_missing=DEFAULT_DOWNLOAD_IF_MISSING): - """ - Loads stored FlowBySector output or generates it if it doesn't exist, - then loads - :param methodname: string, Name of an available method for the given class - :param fbsconfigpath: str, path to the FBS method file if loading a file - from outside the flowsa repository - :param download_FBAs_if_missing: bool, if True will attempt to load FBAS - used in generating the FBS from remote server prior to generating if - file not found locally - :param download_FBS_if_missing: bool, if True will attempt to load from - remote server prior to generating if file not found locally - :return: dataframe in flow by sector format - """ - fbs_meta = set_fb_meta(methodname, "FlowBySector") - # Try to load a local version of the FBS - fbs = load_preprocessed_output(fbs_meta, paths) - # If that didn't work, try to download a remote version of FBS - if fbs is None and download_FBS_if_missing: - log.info('%s not found in %s, downloading from remote source', - methodname, fbsoutputpath) - # download and load the FBS parquet - subdirectory_dict = {'.log': 'Log'} - download_from_remote(fbs_meta, paths, - subdirectory_dict=subdirectory_dict) - fbs = load_preprocessed_output(fbs_meta, paths) - # If that didn't work or wasn't allowed, try to construct the FBS - if fbs is None: - log.info('%s not found in %s, running functions to generate FBS', - methodname, fbsoutputpath) - # Generate the fbs, with option to download any required FBAs from - # Data Commons - flowsa.flowbysector.main( - method=methodname, - fbsconfigpath=fbsconfigpath, - download_FBAs_if_missing=download_FBAs_if_missing - ) - # Now load the fbs - fbs = load_preprocessed_output(fbs_meta, paths) - # If none of the above worked, log an error message - if fbs is None: - log.error('getFlowBySector failed, FBS not found') - # Otherwise (that is, if one of the above methods successfuly loaded the - # FBS), log it. - else: - log.info('Loaded %s from %s', methodname, fbsoutputpath) + fbs = FlowBySector.getFlowBySector( + method=methodname, + external_config_path=fbsconfigpath, + download_sources_ok=download_FBAs_if_missing, + download_fbs_ok=download_FBS_if_missing + ) return fbs From 30df1f1132fa3a76d1cfa3bf3e4fa2594dbb8c8c Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 11 May 2022 15:55:54 -0400 Subject: [PATCH 0009/1127] added string_null option to _FlowBy init --- flowsa/flowby.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 71b0cd931..918c21a3f 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1,4 +1,4 @@ -from typing import Callable, List, Literal, TypeVar +from typing import Callable, List, Union, Literal, TypeVar import pandas as pd import numpy as np from functools import partial @@ -22,6 +22,7 @@ def __init__( *args, fields: dict = None, column_order: List[str] = None, + string_null: Union[None, pd.NA] = pd.NA, **kwargs ) -> None: if isinstance(data, pd.DataFrame) and fields is not None: @@ -30,8 +31,9 @@ def __init__( for field, dtype in fields.items() } na_string_dict = { - field: {null: pd.NA - for null in ['nan', 'None', '', np.nan, pd.NA, None]} + field: {null: string_null + for null in ['nan', '', 'None', '', + np.nan, pd.NA, None]} for field, dtype in fields.items() if dtype == 'string' } data = (data From b01db450557999d51c8f3ab15a8ce4221b4df955 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 11 May 2022 17:30:09 -0400 Subject: [PATCH 0010/1127] Added SEEA method to flowsa --- .../flowbysectormethods/SEEA_2017_v1.yaml | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml new file mode 100644 index 000000000..b22dd9ebf --- /dev/null +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -0,0 +1,145 @@ +%YAML 1.1 + +--- +# m2 for the GHG national replicates the method used in the National GHG Industry Attribution Model +#(https://doi.org/10.23719/1517571), except that sector attribution is to 6-digit NAICS, +# rather than the BEA 2012 IO schema + +!include:BEA_summary_target.yaml +target_geoscale: national + +_ghgi_parameters: &ghgi_parameters + data_format: 'FBA' + class: Chemicals + geoscale_to_use: national + year: 2017 + fedefl_mapping: 'GHGI' + +_allocation_types: + _direct_allocation: &direct_allocation + allocation_method: direct + allocation_source: None + allocation_from_scale: national + _use_allocation: &use_allocation + # names: + # - "Liming" # Need to specify an activity name + allocation_method: proportional + allocation_source: "BEA_Use_Detail_PRO_BeforeRedef" + activity_to_sector_mapping: "BEA_2012_Detail" + allocation_source_class: "Money" + allocation_source_year: 2012 + allocation_flow: + - "USD2012" + allocation_compartment: None + allocation_from_scale: national + clean_allocation_fba: !script_function:BEA subset_BEA_table + # clean_parameter: {"327400": 'ActivityProducedBy'} # Need to specify + helper_source: "BLS_QCEW" + helper_method: proportional + helper_source_class: "Employment" + helper_source_year: 2012 + helper_flow: + - "Number of employees" + helper_from_scale: national + clean_helper_fba: !script_function:BLS_QCEW clean_bls_qcew_fba + clean_helper_fba_wsec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec + _pasture_allocation: &pasture_allocation # allocated based on USDA Animal operation land (acres) + allocation_method: proportional + allocation_source: "USDA_CoA_Cropland_NAICS" + allocation_source_class: "Land" + allocation_source_year: 2017 + allocation_flow: + - "FARM OPERATIONS" + allocation_compartment: None + allocation_from_scale: national + _cropland_allocation: &cropland_allocation # allocated based on USDA land area harvested + allocation_source: "USDA_CoA_Cropland" + allocation_method: proportional + allocation_source_class: "Land" + allocation_source_year: 2017 + allocation_flow: + - "AREA HARVESTED" + - "AREA BEARING & NON-BEARING" # Orchards + - "AREA GROWN" # Berry totals + - "AREA IN PRODUCTION" # Vegetable totals + allocation_compartment: None + allocation_from_scale: national + clean_allocation_fba: !script_function:USDA_CoA_Cropland coa_irrigated_cropland_fba_cleanup + clean_allocation_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics + +source_names: + stewiFBS: + data_format: FBS_outside_flowsa + FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector + inventory_dict: {'NEI': '2017', 'TRI': '2017'} + local_inventory_name: NEI_TRI_air_2017 + compartments: + - air + functions: + - drop_GHGs + reassign_process_to_sectors: + - airplane_emissions + +## Agriculture + # "EPA_GHGI_T_5_29": #CH4, N2O, CO and NOx from field burning of residues + # <<: *ghgi_parameters + # activity_sets: + # activity_set_1: + # <<: *direct_allocation + # names: + # - "Chickpeas" + # - "Cotton" + # - "Maize" + # - "Rice" + # - "Soybeans" + # - "Wheat" + # "EPA_GHGI_T_5_3": &animals #CH4 from Enteric Fermentation + # <<: *ghgi_parameters + # activity_sets: + # activity_set_1: + # <<: *direct_allocation + # names: + # - "American Bison" + # - "Beef Cattle" + # - "Dairy Cattle" + # - "Goats" + # - "Horses" + # - "Mules and Asses" + # - "Sheep" + # - "Swine" + # - "Poultry" + # "EPA_GHGI_T_5_7": *animals #CH4 and N2O from manure, mimics enteric fermentation + + # "EPA_GHGI_T_5_18": #Direct N2O emissions from agricultural soils + # <<: *ghgi_parameters + # activity_sets: + # activity_set_1: # allocated based on fertilizer use + # <<: *use_allocation + # names: + # - "Organic Amendment Cropland" + # - "Residue N Cropland" + # - "Synthetic Fertilizer Cropland" + # clean_parameter: {"325310": 'ActivityProducedBy'} # Fertilizers + # activity_set_2: + # <<: *cropland_allocation + # names: + # - "Mineralization and Asymbiotic Fixation Cropland" + # - "Drained Organic Soils Cropland" + # activity_set_3: + # <<: *pasture_allocation + # names: + # - "All activities Grassland" + + # "EPA_GHGI_T_5_19": #Indirect N2O emissions from agricultural soils + # <<: *ghgi_parameters + # activity_sets: + # activity_set_1: # allocated based on fertilizer use + # <<: *use_allocation + # names: + # - "Volatilization & Atm. Deposition Cropland" + # - "Surface Leaching & Run-Off Cropland" + # clean_parameter: {"325310": 'ActivityProducedBy'} # Fertilizers + # activity_set_2: + # <<: *pasture_allocation + # names: + # - "All activities Grassland" From 0e4607c9287938466446b3dadf8943a3ac332968 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 11 May 2022 17:31:44 -0400 Subject: [PATCH 0011/1127] Added unit standardization, revert to object dtype --- flowsa/data/flowby_config.yaml | 76 +++++++-------- flowsa/flowby.py | 170 ++++++++++++++++++++++++++++++++- 2 files changed, 205 insertions(+), 41 deletions(-) diff --git a/flowsa/data/flowby_config.yaml b/flowsa/data/flowby_config.yaml index 7405522ca..80a2ae884 100644 --- a/flowsa/data/flowby_config.yaml +++ b/flowsa/data/flowby_config.yaml @@ -1,36 +1,36 @@ fba_fields: &fba_fields - ActivityConsumedBy: string - ActivityProducedBy: string - Class: string - Compartment: string + ActivityConsumedBy: object + ActivityProducedBy: object + Class: object + Compartment: object DataCollection: float DataReliability: float - Description: string - DistributionType: string + Description: object + DistributionType: object FlowAmount: float - FlowName: string - FlowType: string - Location: string - LocationSystem: string + FlowName: object + FlowType: object + Location: object + LocationSystem: object Max: float - MeasureofSpread: string + MeasureofSpread: object Min: float - SourceName: string + SourceName: object Spread: float - Unit: string + Unit: object Year: int _mapped_fields: &mapped_fields - Context: string - FlowUUID: string - Flowable: string + Context: object + FlowUUID: object + Flowable: object _sector_fields: §or_fields - ConsumedBySectorType: string - ProducedBySectorType: string - SectorConsumedBy: string - SectorProducedBy: string - SectorSourceName: string + ConsumedBySectorType: object + ProducedBySectorType: object + SectorConsumedBy: object + SectorProducedBy: object + SectorSourceName: object fba_mapped_fields: <<: [*fba_fields, *mapped_fields] @@ -72,40 +72,40 @@ fba_column_order: - ConsumedBySectorType _fbs_base_fields: &fbs_base_fields - Class: string - Context: string + Class: object + Context: object DataCollection: float DataReliability: float - DistributionType: string + DistributionType: object FlowAmount: float - FlowType: string - FlowUUID: string - Flowable: string + FlowType: object + FlowUUID: object + Flowable: object GeographicalCorrelation: float - Location: string - LocationSystem: string + Location: object + LocationSystem: object Max: float - MeasureofSpread: string - MetaSources: string + MeasureofSpread: object + MetaSources: object Min: float - SectorSourceName: string + SectorSourceName: object Spread: float TechnologicalCorrelation: float TemporalCorrelation: float - Unit: string + Unit: object Year: int _collapsed_fields: &collapsed_fields - Sector: string + Sector: object _activity_fields: &activity_fields - ActivityConsumedBy: string - ActivityProducedBy: string + ActivityConsumedBy: object + ActivityProducedBy: object fbs_fields: &fbs_fields <<: *fbs_base_fields - SectorConsumedBy: string - SectorProducedBy: string + SectorConsumedBy: object + SectorProducedBy: object fbs_w_activity_fields: <<: [*fbs_fields, *activity_fields] diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 918c21a3f..6623fb851 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1,4 +1,4 @@ -from typing import Callable, List, Union, Literal, TypeVar +from typing import Callable, List, Optional, Union, Literal, TypeVar import pandas as pd import numpy as np from functools import partial @@ -22,7 +22,7 @@ def __init__( *args, fields: dict = None, column_order: List[str] = None, - string_null: Union[None, pd.NA] = pd.NA, + string_null: 'np.nan' or None = np.nan, **kwargs ) -> None: if isinstance(data, pd.DataFrame) and fields is not None: @@ -34,7 +34,7 @@ def __init__( field: {null: string_null for null in ['nan', '', 'None', '', np.nan, pd.NA, None]} - for field, dtype in fields.items() if dtype == 'string' + for field, dtype in fields.items() if dtype == 'object' } data = (data .assign(**{field: None @@ -42,6 +42,7 @@ def __init__( .fillna(fill_na_dict) .replace(na_string_dict) .astype(fields)) + data = self._standardize_units(data) if isinstance(data, pd.DataFrame) and column_order is not None: data = data[[c for c in column_order if c in data.columns] + [c for c in data.columns if c not in column_order]] @@ -104,6 +105,91 @@ def _getFlowBy( fb = cls(df) return fb + @staticmethod + def _standardize_units(fb: pd.DataFrame) -> pd.DataFrame: + days_in_year = 365 + ft2_to_m2 = 0.092903 + # rounded to match USGS_NWIS_WU mapping file on FEDEFL + gallon_water_to_kg = 3.79 + ac_ft_water_to_kg = 1233481.84 + acre_to_m2 = 4046.8564224 + mj_in_btu = .0010550559 + m3_to_gal = 264.172 + ton_to_kg = 907.185 + lb_to_kg = 0.45359 + exchange_rate = float( + literature_values + .get_Canadian_to_USD_exchange_rate(str(fb.Year.unique()[0])) + ) + + fb = fb.assign(Unit=fb.Unit.str.strip()) + + standardized = ( + fb + .assign( + FlowAmount=( + fb.FlowAmount + .mask(fb.Unit.isin(['ACRES', 'Acres']), + fb.FlowAmount * acre_to_m2) + .mask(fb.Unit.isin(['million sq ft', + 'million square feet']), + fb.FlowAmount * 10**6 * ft2_to_m2) + .mask(fb.Unit.isin(['square feet']), + fb.FlowAmount * ft2_to_m2) + .mask(fb.Unit.isin(['Canadian Dollar']), + fb.FlowAmount / exchange_rate) + .mask(fb.Unit.isin(['gallons/animal/day']), + fb.FlowAmount * gallon_water_to_kg * days_in_year) + .mask(fb.Unit.isin(['ACRE FEET / ACRE']), + fb.FlowAmount / acre_to_m2 * ac_ft_water_to_kg) + .mask(fb.Unit.isin(['Mgal']), + fb.FlowAmount * 10**6 * gallon_water_to_kg) + .mask(fb.Unit.isin(['gal', 'gal/USD']), + fb.FlowAmount * gallon_water_to_kg) + .mask(fb.Unit.isin(['Bgal/d']), + fb.FlowAmount + * 10**9 * gallon_water_to_kg * days_in_year) + .mask(fb.Unit.isin(['Mgal/d']), + fb.FlowAmount + * 10**6 * gallon_water_to_kg * days_in_year) + .mask(fb.Unit.isin(['Quadrillion Btu']), + fb.FlowAmount * 10**15 * mj_in_btu) + .mask(fb.Unit.isin(['Trillion Btu', 'TBtu']), + fb.FlowAmount * 10**12 * mj_in_btu) + .mask(fb.Unit.isin(['million Cubic metres/year']), + fb.FlowAmount + * 10**6 * m3_to_gal * gallon_water_to_kg) + .mask(fb.Unit.isin(['TON']), + fb.FlowAmount * ton_to_kg) + .mask(fb.Unit.isin(['LB']), + fb.FlowAmount * lb_to_kg) + ), + Unit=( + fb.Unit + .mask(fb.Unit.isin(['ACRES', 'Acres', 'million sq ft', + 'million square feet', + 'square feet']), + 'm2') + .mask(fb.Unit.isin(['Canadian Dollar']), + 'USD') + .mask(fb.Unit.isin(['gallons/animal/day', 'Mgal', 'gal', + 'Bgal/d', 'Mgal/d', + 'million Cubic metres/year', + 'TON', 'LB']), + 'kg') + .mask(fb.Unit.isin(['ACRE FEET / ACRE']), + 'kg/m2') + .mask(fb.Unit.isin(['gal/USD']), + 'kg/USD') + .mask(fb.Unit.isin(['Quadrillion Btu', + 'Trillion Btu', 'TBtu']), + 'MJ') + ) + ) + ) + + return standardized + def conditional_pipe( self: FB, condition: bool, @@ -146,6 +232,34 @@ def conditional_method( else: return self + def standardize_units(self: FB) -> FB: + """ + Standardizes units. Timeframe is annual. + :return: FlowBy dataframe, with standarized units + """ + return self._standardize_units(self) + + def update_fips_to_geoscale( + self: FB, + to_geoscale: str, + ) -> FB: + """ + Sets FIPS codes to 5 digits by zero-padding FIPS codes at the specified + geoscale on the right (county geocodes are unmodified, state codes are + generally padded with 3 zeros, and the "national" FIPS code is set to + 00000, the value in flowsa.location.US_FIPS) + :param to_geoscale: str, target geoscale + :return: FlowBy dataset with 5 digit fips + """ + if to_geoscale == 'national': + return self.assign(Location=location.US_FIPS) + elif to_geoscale == 'state': + return (self + .assign(Location=self.Location.apply( + lambda x: str(x)[:2].ljust(5, '0')))) + else: + return self + class FlowByActivity(_FlowBy): def __init__( @@ -312,6 +426,56 @@ def getFlowBySector( fbs = cls(fb) return fbs + @classmethod + def generateFlowBySector( + cls, + method: str, + external_config_path: str = None, + download_sources_ok: bool = settings.DEFAULT_DOWNLOAD_IF_MISSING, + ) -> 'FlowBySector': + ''' + Generates a FlowBySector dataset. + :param method: str, name of FlowBySector method .yaml file to use. + :param external_config_path: str, optional. If given, tells flowsa + where to look for the method yaml specified above. + :param download_fba_ok: bool, optional. Whether to attempt to download + source data FlowByActivity files from EPA server rather than + generating them. + ''' + log.info('Beginning FlowBySector generation for %s', method) + method_config = common.load_yaml_dict(method, 'FBS', + external_config_path) + sources = method_config['source_names'] + + component_fbs_list = [] + for source_name, source_config in sources.items(): + if source_config['data_format'] in ['FBS', 'FBS_outside_flowsa']: + if source_config['data_format'] == 'FBS_outside_flowsa': + source_data = FlowBySector( + source_config['FBS_datapull_fxn'](source_config, + method_config, + external_config_path) + ) + + else: # TODO: Test this section. + source_data = FlowBySector.getFlowBySector( + source=source_name, + external_config_path=external_config_path, + download_sources_ok=download_sources_ok, + download_fbs_ok=download_sources_ok + ) + + fbs = (source_data + .conditional_pipe( + 'clean_fbs_df_fxn' in source_config, + source_config.get('clean_fbs_df_fxn')) + .update_fips_to_geoscale( + method_config['target_geoscale'])) + log.info('Appending %s to FBS list', source_name) + component_fbs_list.append(fbs) + + return component_fbs_list + # The three classes extending pd.Series, together with the _constructor... # methods of each class, are required for allowing pandas methods called on From e17eb5c1acb19ed4562c7f73d20326561f2232cd Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 11 May 2022 19:07:38 -0400 Subject: [PATCH 0012/1127] Read yaml files using utf-8 encoding --- flowsa/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/common.py b/flowsa/common.py index 2a0fa9b90..73ceca7d6 100644 --- a/flowsa/common.py +++ b/flowsa/common.py @@ -129,7 +129,7 @@ def load_yaml_dict(filename, flowbytype=None, filepath=None): yaml_path = folder + filename + '.yaml' try: - with open(yaml_path, 'r') as f: + with open(yaml_path, 'r', encoding='utf-8') as f: config = flowsa_yaml.load(f, filepath) except IOError: log.error(f'{flowbytype} method file not found') From c598411a640b0c1cd06771ddaa8ade03601d3c46 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 11 May 2022 19:08:28 -0400 Subject: [PATCH 0013/1127] Get only PM 2.5 from stewi --- flowsa/flowby.py | 16 +++++++++------- flowsa/methods/flowbysectormethods/README.md | 12 +++++++----- .../flowbysectormethods/SEEA_2017_v1.yaml | 4 +++- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 6623fb851..ac2d08d8b 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -456,7 +456,6 @@ def generateFlowBySector( method_config, external_config_path) ) - else: # TODO: Test this section. source_data = FlowBySector.getFlowBySector( source=source_name, @@ -465,12 +464,15 @@ def generateFlowBySector( download_fbs_ok=download_sources_ok ) - fbs = (source_data - .conditional_pipe( - 'clean_fbs_df_fxn' in source_config, - source_config.get('clean_fbs_df_fxn')) - .update_fips_to_geoscale( - method_config['target_geoscale'])) + fbs = ( + source_data + .conditional_pipe('clean_fbs_df_fxn' in source_config, + source_config.get('clean_fbs_df_fxn')) + .update_fips_to_geoscale(method_config['target_geoscale']) + .conditional_method( + source_config.get('source_flows'), 'query', + f'Flowable in {source_config.get("source_flows")}') + ) log.info('Appending %s to FBS list', source_name) component_fbs_list.append(fbs) diff --git a/flowsa/methods/flowbysectormethods/README.md b/flowsa/methods/flowbysectormethods/README.md index b1d3d5092..cda43cf9e 100644 --- a/flowsa/methods/flowbysectormethods/README.md +++ b/flowsa/methods/flowbysectormethods/README.md @@ -21,16 +21,18 @@ Description of parameters in flowbysectormethods yamls. All values are strings u (national, state, or county) 5. _year_: year of available dataset (ex. 2015) 6. _activity_to_sector_mapping_: (optional) name of activity to sector mapping file, if not provided will use the source name -7. _apply_urban_rural_: Assign flow quantities as urban or rural based on population density by FIPS. +7. _source_flows_: (list, optional, only usable with flowsa.flowby.FlowBySector.getFlowBySector()). Specifies the 'Flowable'(s) from the FBS to use. + If not provided, all flows are used. +8. _apply_urban_rural_: Assign flow quantities as urban or rural based on population density by FIPS. 8. _clean_fba_before_mapping_df_fxn_: (optional) calls on function in the source.py file to clean up/modify the FBA data prior to mapping flows. -9. _clean_fba_df_fxn_: (optional) calls on function in the source.py file to clean up/modify +10. _clean_fba_df_fxn_: (optional) calls on function in the source.py file to clean up/modify the FBA data prior to allocating data to sectors. -10. _clean_fba_w_sec_df_fxn_: (optional) calls on function in the source.py file to clean up/modify the +11. _clean_fba_w_sec_df_fxn_: (optional) calls on function in the source.py file to clean up/modify the FBA dataframe, after sector columns are added but prior to allocating data to sectors. -11. _fedefl_mapping_: (optional) name of mapping file in FEDEFL. If not supplied will use +12. _fedefl_mapping_: (optional) name of mapping file in FEDEFL. If not supplied will use the source_names -12. _mfl_mapping_: (optional, should not be used if fedefl_mapping is used) name of mapping file for Material Flow List. +13. _mfl_mapping_: (optional, should not be used if fedefl_mapping is used) name of mapping file for Material Flow List. ### Activity set specifications 1. _activity_sets_: A subset of the FBA dataset and the method and allocation datasets used to create a FBS diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index b22dd9ebf..7aac18950 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -71,8 +71,10 @@ source_names: stewiFBS: data_format: FBS_outside_flowsa FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector - inventory_dict: {'NEI': '2017', 'TRI': '2017'} + inventory_dict: {'NEI': '2017'} local_inventory_name: NEI_TRI_air_2017 + source_flows: + - Particulate matter, ≤ 2.5μm compartments: - air functions: From 481d78ec542361fcd6dcfd76e1fc6f588ba6cb46 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 11 May 2022 21:24:07 -0400 Subject: [PATCH 0014/1127] Added a to-do item to EPA_NEI.py --- flowsa/data_source_scripts/EPA_NEI.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flowsa/data_source_scripts/EPA_NEI.py b/flowsa/data_source_scripts/EPA_NEI.py index a5e01edab..eb3238f8e 100644 --- a/flowsa/data_source_scripts/EPA_NEI.py +++ b/flowsa/data_source_scripts/EPA_NEI.py @@ -208,6 +208,8 @@ def remove_duplicate_NEI_flows(df): return df +# TODO: This is only used with stewi data. Modify it to serve as a +# clean_fbs_df_fxn, and remove the current corresponding code from stewFBS.py def drop_GHGs(df): """ GHGs are included in some NEI datasets. If these data are not From ac42e410c431d407105e5d6734f7792c927255d6 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 12 May 2022 10:38:41 -0400 Subject: [PATCH 0015/1127] Added comment re no GHGs from NEI --- flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index 7aac18950..1ef8a5e27 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -73,7 +73,7 @@ source_names: FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector inventory_dict: {'NEI': '2017'} local_inventory_name: NEI_TRI_air_2017 - source_flows: + source_flows: # Remember GHGs should not be drawn from NEI - Particulate matter, ≤ 2.5μm compartments: - air From 2db5ea7510e46ae26dd071e1f2f577d5c7c8734a Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 12 May 2022 13:24:59 -0400 Subject: [PATCH 0016/1127] Implemented source_flows as mapping to new names --- flowsa/flowby.py | 7 ++++++- flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index ac2d08d8b..bc1fd7e20 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -471,7 +471,12 @@ def generateFlowBySector( .update_fips_to_geoscale(method_config['target_geoscale']) .conditional_method( source_config.get('source_flows'), 'query', - f'Flowable in {source_config.get("source_flows")}') + f'Flowable in ' + f'{list(source_config.get("source_flows", []))}') + .conditional_method( + isinstance(source_config.get('source_flows'), dict), + 'replace', + {'Flowable': source_config.get('source_flows')}) ) log.info('Appending %s to FBS list', source_name) component_fbs_list.append(fbs) diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index 1ef8a5e27..8a6582c5c 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -74,7 +74,7 @@ source_names: inventory_dict: {'NEI': '2017'} local_inventory_name: NEI_TRI_air_2017 source_flows: # Remember GHGs should not be drawn from NEI - - Particulate matter, ≤ 2.5μm + Particulate matter, ≤ 2.5μm: PM 2.5 compartments: - air functions: From eb4b3481e497bc8d7a8684746a08571c6c15710f Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 12 May 2022 14:15:58 -0400 Subject: [PATCH 0017/1127] More graceful implementation of source_flow dict --- flowsa/flowby.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index bc1fd7e20..91cbc11c3 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -469,15 +469,15 @@ def generateFlowBySector( .conditional_pipe('clean_fbs_df_fxn' in source_config, source_config.get('clean_fbs_df_fxn')) .update_fips_to_geoscale(method_config['target_geoscale']) - .conditional_method( - source_config.get('source_flows'), 'query', - f'Flowable in ' - f'{list(source_config.get("source_flows", []))}') - .conditional_method( - isinstance(source_config.get('source_flows'), dict), - 'replace', - {'Flowable': source_config.get('source_flows')}) ) + + if source_config.get('source_flows'): + source_flows = source_config['source_flows'] + fbs = (fbs + .query('Flowable in @source_flows') + .conditional_method(isinstance(source_flows, dict), + 'replace', + {'Flowable': source_flows})) log.info('Appending %s to FBS list', source_name) component_fbs_list.append(fbs) From 7d8aba22aa496052715d2ef9dc57b4ddb682e8cd Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 12 May 2022 14:18:15 -0400 Subject: [PATCH 0018/1127] Fixed typo --- flowsa/data/flowby_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/data/flowby_config.yaml b/flowsa/data/flowby_config.yaml index 80a2ae884..fbf3df2ff 100644 --- a/flowsa/data/flowby_config.yaml +++ b/flowsa/data/flowby_config.yaml @@ -123,7 +123,7 @@ fbs_column_order: - Context - Location - LocationSystem - - flowAmount + - FlowAmount - Unit - FlowType - Year From e5fa457385c9511a686327c7f37af04a7b57aa40 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 12 May 2022 14:20:50 -0400 Subject: [PATCH 0019/1127] Styling --- flowsa/flowby.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 91cbc11c3..cd426af55 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -464,12 +464,12 @@ def generateFlowBySector( download_fbs_ok=download_sources_ok ) - fbs = ( - source_data - .conditional_pipe('clean_fbs_df_fxn' in source_config, - source_config.get('clean_fbs_df_fxn')) - .update_fips_to_geoscale(method_config['target_geoscale']) - ) + fbs = (source_data + .conditional_pipe( + 'clean_fbs_df_fxn' in source_config, + source_config.get('clean_fbs_df_fxn')) + .update_fips_to_geoscale( + method_config['target_geoscale'])) if source_config.get('source_flows'): source_flows = source_config['source_flows'] From a4b74768eacc5a318c064b7fbc348f262b3672b2 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 12 May 2022 14:34:39 -0400 Subject: [PATCH 0020/1127] Removed drop_GHGs from seea method --- flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index 8a6582c5c..41625054f 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -77,8 +77,6 @@ source_names: Particulate matter, ≤ 2.5μm: PM 2.5 compartments: - air - functions: - - drop_GHGs reassign_process_to_sectors: - airplane_emissions From 4458839737fde93708dfc9af6e8b05ce2111facf Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 12 May 2022 15:34:33 -0400 Subject: [PATCH 0021/1127] Fixed bug in finding EPA GHGI yaml --- flowsa/flowbyactivity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index aa6f70694..4ca83760d 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -187,7 +187,7 @@ def main(**kwargs): # filename if run into error try: config = load_yaml_dict(source, flowbytype='FBA') - except UnboundLocalError: + except (UnboundLocalError, FileNotFoundError): log.info(f'Could not find Flow-By-Activity config file for {source}') source = get_flowsa_base_name(sourceconfigpath, source, "yaml") log.info(f'Generating FBA for {source}') From 1a5db2e4372d5bf09d325a82d7056c8b4b827f1e Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 13 May 2022 09:43:03 -0400 Subject: [PATCH 0022/1127] Fixed FB.init to consistently use string_null --- flowsa/flowby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index cd426af55..455b6b0e8 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -27,7 +27,7 @@ def __init__( ) -> None: if isinstance(data, pd.DataFrame) and fields is not None: fill_na_dict = { - field: 0 if dtype in ['int', 'float'] else pd.NA + field: 0 if dtype in ['int', 'float'] else string_null for field, dtype in fields.items() } na_string_dict = { From 1672eaddc1cde5965ed8f7be3d30fa67cf75af16 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 13 May 2022 09:44:50 -0400 Subject: [PATCH 0023/1127] Added warning message when units not standardized --- flowsa/flowby.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 455b6b0e8..6f1c86d72 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -188,6 +188,16 @@ def _standardize_units(fb: pd.DataFrame) -> pd.DataFrame: ) ) + standardized_units = ['m2', 'USD', 'kg', 'kg/m2', 'kg/USD', 'MJ'] + + if any(~standardized.Unit.isin(standardized_units)): + log.warning('The following units may not have been standardized ' + 'on import: %s. This may not be a problem, if they ' + 'will be standardized later, e.g. by mapping to the ' + 'federal elementary flow list', + [unit for unit in standardized.Unit.unique() + if unit not in standardized_units]) + return standardized def conditional_pipe( From e04cdbd4f0a2ad943070a07a9c5c6272db74662f Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 13 May 2022 14:32:02 -0400 Subject: [PATCH 0024/1127] + fedelemflow mapping, - redundancy in FBx.get... --- flowsa/flowby.py | 146 ++++++++++++++++-- .../flowbysectormethods/SEEA_2017_v1.yaml | 48 +++--- 2 files changed, 159 insertions(+), 35 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 6f1c86d72..e0ae0fd95 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -8,6 +8,7 @@ from .flowsa_log import log, vlog import esupy.processed_data_mgmt import esupy.dqi +import fedelemflowlist FB = TypeVar('FB', bound='_FlowBy') @@ -191,10 +192,9 @@ def _standardize_units(fb: pd.DataFrame) -> pd.DataFrame: standardized_units = ['m2', 'USD', 'kg', 'kg/m2', 'kg/USD', 'MJ'] if any(~standardized.Unit.isin(standardized_units)): - log.warning('The following units may not have been standardized ' - 'on import: %s. This may not be a problem, if they ' - 'will be standardized later, e.g. by mapping to the ' - 'federal elementary flow list', + log.warning('Some units not standardized on import: %s. May not ' + 'be a problem, if they will be standardized later, ' + 'e.g. by mapping to the federal elementary flow list', [unit for unit in standardized.Unit.unique() if unit not in standardized_units]) @@ -343,14 +343,116 @@ def getFlowByActivity( source=source, year=year ) - fb = super()._getFlowBy( + return super()._getFlowBy( file_metadata=file_metadata, download_ok=download_ok, flowby_generator=flowby_generator, output_path=settings.fbaoutputpath ) - fba = cls(fb) - return fba + + # TODO: probably only slight modification is needed to allow for material + # flow list mapping using this function as well. + def map_to_fedefl_list( + self, + source_name: str, + source_config: dict, + drop_fba_columns: bool = False, + drop_unmapped_rows: bool = False + ) -> 'FlowByActivity': + log.info('Mapping flows in %s to federal elementary flow list', + source_name) + + fba_merge_keys = [ + 'SourceName', + 'Flowable', + 'Unit', + 'Context' + ] + mapping_subset = source_config.get('fedefl_mapping', source_name) + mapping_fields = [ + 'SourceListName', + 'SourceFlowName', + 'SourceFlowContext', + 'SourceUnit', + 'ConversionFactor', + 'TargetFlowName', + 'TargetFlowContext', + 'TargetUnit', + 'TargetFlowUUID' + ] + mapping_merge_keys = [ + 'SourceListName', + 'SourceFlowName', + 'SourceUnit', + 'SourceFlowContext' + ] + merge_type = 'inner' if drop_unmapped_rows else 'left' + if 'fedefl_mapping' in source_config: + fba_merge_keys.remove('SourceName') + mapping_merge_keys.remove('SourceListName') + + fba = (self + .assign(Flowable=self.FlowName, + Context=self.Compartment, + FlowAmount=self.FlowAmount.mask( + self.Unit.str.contains('/d'), + self.FlowAmount * 365), + Unit=self.Unit.str.replace('/d', '')) + .conditional_method(drop_fba_columns, 'drop', + columns=['FlowName', 'Compartment']) + .fillna({field: '' for field in fba_merge_keys})) + + if any(self.Unit.str.contains('/d')): + log.info('Converting daily flows %s to annual', + [unit for unit in self.Unit.unique() if '/d' in unit]) + + mapping = (fedelemflowlist + .get_flowmapping(mapping_subset)[mapping_fields]) + + if mapping.empty: + log.warning('Elementary flow list entries for %s not found', + mapping_subset) + return FlowByActivity(self, mapped=True) + + mapping = (mapping + .assign(ConversionFactor=mapping.ConversionFactor.fillna(1)) + .fillna({field: '' for field in mapping_merge_keys})) + + mapped_fba = fba.merge(mapping, + how=merge_type, + left_on=fba_merge_keys, + right_on=mapping_merge_keys, + indicator='mapped') + + mapped_fba = (mapped_fba + .assign( + Flowable=mapped_fba.Flowable.mask( + mapped_fba.TargetFlowName.notnull(), + mapped_fba.TargetFlowName), + Context=mapped_fba.Context.mask( + mapped_fba.TargetFlowName.notnull(), + mapped_fba.TargetFlowContext), + Unit=mapped_fba.Unit.mask( + mapped_fba.TargetFlowName.notnull(), + mapped_fba.TargetUnit), + FlowAmount=mapped_fba.FlowAmount.mask( + mapped_fba.TargetFlowName.notnull(), + mapped_fba.FlowAmount + * mapped_fba.ConversionFactor), + FlowUUID=mapped_fba.TargetFlowUUID + ) + .drop(columns=mapping_fields)) + + if any(mapped_fba.mapped == 'both'): + log.info('Units standardized to %s by mapping to federal ' + 'elementary flow list', list(mapping.TargetUnit.unique())) + if any(mapped_fba.mapped == 'left_only'): + log.warning('Some units not standardized by mapping to federal ' + 'elementary flows list: %s', + list(mapped_fba + .query('mapped == "left_only"').Unit.unique())) + + return mapped_fba.drop(columns='mapped') class FlowBySector(_FlowBy): @@ -427,14 +529,12 @@ def getFlowBySector( fbsconfigpath=external_config_path, download_FBAs_if_missing=download_sources_ok ) - fb = super()._getFlowBy( + return super()._getFlowBy( file_metadata=file_metadata, download_ok=download_fbs_ok, flowby_generator=flowby_generator, output_path=settings.fbsoutputpath ) - fbs = cls(fb) - return fbs @classmethod def generateFlowBySector( @@ -481,7 +581,7 @@ def generateFlowBySector( .update_fips_to_geoscale( method_config['target_geoscale'])) - if source_config.get('source_flows'): + if 'source_flows' in source_config: source_flows = source_config['source_flows'] fbs = (fbs .query('Flowable in @source_flows') @@ -491,6 +591,30 @@ def generateFlowBySector( log.info('Appending %s to FBS list', source_name) component_fbs_list.append(fbs) + if source_config['data_format'] == 'FBA': + source_data = FlowByActivity.getFlowByActivity( + source=source_name, + year=source_config['year'], + download_ok=download_sources_ok + ) + + fba = (source_data + .query(f'Class == \'{source_config["class"]}\'') + # TODO: source_config keys not currently handled: + # TODO: 'source_fba_load_scale', 'apply_urban_rural', + .conditional_pipe( + 'clean_fba_before_mapping_df_fxn' in source_config, + source_config.get('clean_fba_before_mapping_df_fxn') + ) + .map_to_fedefl_list(source_name, source_config) + .conditional_pipe( + 'clean_fba_df_fxn' in source_config, + source_config.get('clean_fba_df_fxn')) + ) + + log.info('Appending %s to FBS list', source_name) + component_fbs_list.append(fba) + return component_fbs_list diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index 41625054f..ab78ed406 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -12,7 +12,7 @@ _ghgi_parameters: &ghgi_parameters data_format: 'FBA' class: Chemicals geoscale_to_use: national - year: 2017 + year: 2016 fedefl_mapping: 'GHGI' _allocation_types: @@ -68,31 +68,31 @@ _allocation_types: clean_allocation_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics source_names: - stewiFBS: - data_format: FBS_outside_flowsa - FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector - inventory_dict: {'NEI': '2017'} - local_inventory_name: NEI_TRI_air_2017 - source_flows: # Remember GHGs should not be drawn from NEI - Particulate matter, ≤ 2.5μm: PM 2.5 - compartments: - - air - reassign_process_to_sectors: - - airplane_emissions + # stewiFBS: + # data_format: FBS_outside_flowsa + # FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector + # inventory_dict: {'NEI': '2017'} + # local_inventory_name: NEI_TRI_air_2017 + # source_flows: # Remember GHGs should not be drawn from NEI + # Particulate matter, ≤ 2.5μm: PM 2.5 + # compartments: + # - air + # reassign_process_to_sectors: + # - airplane_emissions ## Agriculture - # "EPA_GHGI_T_5_29": #CH4, N2O, CO and NOx from field burning of residues - # <<: *ghgi_parameters - # activity_sets: - # activity_set_1: - # <<: *direct_allocation - # names: - # - "Chickpeas" - # - "Cotton" - # - "Maize" - # - "Rice" - # - "Soybeans" - # - "Wheat" + EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues + <<: *ghgi_parameters + activity_sets: + activity_set_1: + <<: *direct_allocation + names: + - Chickpeas + - Cotton + - Maize + - Rice + - Soybeans + - Wheat # "EPA_GHGI_T_5_3": &animals #CH4 from Enteric Fermentation # <<: *ghgi_parameters # activity_sets: From ac4d6112e3baec48f7b8c50b7269e06e3632c9ce Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 13 May 2022 15:25:20 -0400 Subject: [PATCH 0025/1127] Added get_catalog_info to common.py --- flowsa/common.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/flowsa/common.py b/flowsa/common.py index 73ceca7d6..84d47eb33 100644 --- a/flowsa/common.py +++ b/flowsa/common.py @@ -324,6 +324,23 @@ def return_true_source_catalog_name(sourcename): return sourcename +def get_catalog_info(source_name: str) -> dict: + """ + Drop any extensions on source name until find the name in source catalog, + then load info from source catalog and return resulting dictionary + """ + catalog = load_yaml_dict('source_catalog') + source_base_name = source_name + while source_base_name not in catalog: + if '_' in source_base_name: + source_base_name, _ = source_base_name.rsplit('_', 1) + else: + log.error('%s or %s not found in %ssource_catalog.yaml', + source_name, source_base_name, datapath) + + return catalog[source_base_name] + + def check_activities_sector_like(sourcename_load): """ Check if the activities in a df are sector-like, From a3ff681f9a6824083642e687dfcf1d348cd767f6 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 13 May 2022 15:53:07 -0400 Subject: [PATCH 0026/1127] Removed get_catalog_info from common.py --- flowsa/common.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/flowsa/common.py b/flowsa/common.py index 84d47eb33..73ceca7d6 100644 --- a/flowsa/common.py +++ b/flowsa/common.py @@ -324,23 +324,6 @@ def return_true_source_catalog_name(sourcename): return sourcename -def get_catalog_info(source_name: str) -> dict: - """ - Drop any extensions on source name until find the name in source catalog, - then load info from source catalog and return resulting dictionary - """ - catalog = load_yaml_dict('source_catalog') - source_base_name = source_name - while source_base_name not in catalog: - if '_' in source_base_name: - source_base_name, _ = source_base_name.rsplit('_', 1) - else: - log.error('%s or %s not found in %ssource_catalog.yaml', - source_name, source_base_name, datapath) - - return catalog[source_base_name] - - def check_activities_sector_like(sourcename_load): """ Check if the activities in a df are sector-like, From 0664e7d537e53b8e256e1812210a162965b0d11e Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 13 May 2022 17:00:37 -0400 Subject: [PATCH 0027/1127] Merged source catalog info to source_config --- flowsa/flowby.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index e0ae0fd95..b3143b4a4 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -556,9 +556,15 @@ def generateFlowBySector( method_config = common.load_yaml_dict(method, 'FBS', external_config_path) sources = method_config['source_names'] + source_catalog = common.load_yaml_dict('source_catalog') component_fbs_list = [] for source_name, source_config in sources.items(): + source_config.update( + {k: v for k, v in source_catalog.get( + common.return_true_source_catalog_name(source_name)) + .items() if k not in source_config}) + if source_config['data_format'] in ['FBS', 'FBS_outside_flowsa']: if source_config['data_format'] == 'FBS_outside_flowsa': source_data = FlowBySector( @@ -609,8 +615,7 @@ def generateFlowBySector( .map_to_fedefl_list(source_name, source_config) .conditional_pipe( 'clean_fba_df_fxn' in source_config, - source_config.get('clean_fba_df_fxn')) - ) + source_config.get('clean_fba_df_fxn'))) log.info('Appending %s to FBS list', source_name) component_fbs_list.append(fba) From 2d800d8253fa6f0c757395cada953df7afd71fe6 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 16 May 2022 08:53:03 -0400 Subject: [PATCH 0028/1127] Beginning work on activity sets --- flowsa/flowby.py | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index b3143b4a4..c9760b813 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -617,8 +617,44 @@ def generateFlowBySector( 'clean_fba_df_fxn' in source_config, source_config.get('clean_fba_df_fxn'))) - log.info('Appending %s to FBS list', source_name) - component_fbs_list.append(fba) + activities = source_config['activity_sets'] + completed_names = [] + + for activity_set, activity_config in activities.items(): + log.info('Preparing to process %s in %s', + activity_set, source_name) + + names = activity_config['names'] + + fba_subset = ( + fba + .query('ActivityProducedBy not in @completed_names' + '& ActivityConsumedBy not in @completed_names') + .query('ActivityProducedBy in @names' + '| ActivityConsumedBy in @names') + .conditional_method( + 'source_flows' in activity_config, + 'query', + f'FlowName in ' + f'{activity_config.get("source_flows")}') + .reset_index(drop=True) + ) + + if fba_subset.empty: + log.error('No data for flows in %s', activity_set) + continue + if (fba_subset.FlowAmount == 0).all(): + log.warning('All flows for %s are 0', activity_set) + continue + + # TODO: source_catalog key not currently handled: + # TODO: 'sector-like_activities' + + completed_names.extend(names) + + log.info('Appending %s from %s to FBS list', + activity_set, source_name) + component_fbs_list.append(fba_subset) return component_fbs_list From ea6a2def5eb824c20158872def71ce3cc8df746d Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 16 May 2022 09:51:10 -0400 Subject: [PATCH 0029/1127] Added source_name and source_config metadata --- flowsa/flowby.py | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index c9760b813..3f07d97f6 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -26,12 +26,20 @@ def __init__( string_null: 'np.nan' or None = np.nan, **kwargs ) -> None: + for attribute in self._metadata: + if not hasattr(self, attribute): + if hasattr(data, attribute): + print(getattr(data, attribute)) + super().__setattr__(attribute, getattr(data, attribute)) + else: + self.source_name = '' + self.source_config = {} if isinstance(data, pd.DataFrame) and fields is not None: fill_na_dict = { field: 0 if dtype in ['int', 'float'] else string_null for field, dtype in fields.items() } - na_string_dict = { + null_string_dict = { field: {null: string_null for null in ['nan', '', 'None', '', np.nan, pd.NA, None]} @@ -41,7 +49,7 @@ def __init__( .assign(**{field: None for field in fields if field not in data.columns}) .fillna(fill_na_dict) - .replace(na_string_dict) + .replace(null_string_dict) .astype(fields)) data = self._standardize_units(data) if isinstance(data, pd.DataFrame) and column_order is not None: @@ -49,7 +57,7 @@ def __init__( + [c for c in data.columns if c not in column_order]] super().__init__(data, *args, **kwargs) - _metadata = [] + _metadata = ['source_name', 'source_config'] @property def _constructor(self) -> '_FlowBy': @@ -59,6 +67,23 @@ def _constructor(self) -> '_FlowBy': def _constructor_sliced(self) -> '_FlowBySeries': return _FlowBySeries + def __finalize__(self, other, method=None, **kwargs): + ''' + Determines how metadata is propagated when using DataFrame methods. + super().__finalize__() takes care of methods involving only one FlowBy + object. Additional code below specifies how to propagate metadata under + other circumstances, such as merging. + + merge: use metadata of left dataframe + ''' + self = super().__finalize__(other, method=method, **kwargs) + + # merge operation: using metadata of the left object + if method == "merge": + for name in self._metadata: + object.__setattr__(self, name, getattr(other.left, name, None)) + return self + @classmethod def _getFlowBy( cls, @@ -562,7 +587,7 @@ def generateFlowBySector( for source_name, source_config in sources.items(): source_config.update( {k: v for k, v in source_catalog.get( - common.return_true_source_catalog_name(source_name)) + common.return_true_source_catalog_name(source_name), {}) .items() if k not in source_config}) if source_config['data_format'] in ['FBS', 'FBS_outside_flowsa']: @@ -580,6 +605,9 @@ def generateFlowBySector( download_fbs_ok=download_sources_ok ) + source_data.source_name = source_name + source_data.source_config = source_config + fbs = (source_data .conditional_pipe( 'clean_fbs_df_fxn' in source_config, @@ -604,6 +632,9 @@ def generateFlowBySector( download_ok=download_sources_ok ) + source_data.source_name = source_name + source_data.source_config = source_config + fba = (source_data .query(f'Class == \'{source_config["class"]}\'') # TODO: source_config keys not currently handled: From 70a1db6fbafdff6483f082ef77030e9ff805a2db Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 16 May 2022 12:26:50 -0400 Subject: [PATCH 0030/1127] source_name and source_config as args to getFB() --- flowsa/__init__.py | 2 +- flowsa/flowby.py | 61 ++++++++++++++++++++++++++++------------------ 2 files changed, 38 insertions(+), 25 deletions(-) diff --git a/flowsa/__init__.py b/flowsa/__init__.py index 1465463d4..0f4cb78cf 100644 --- a/flowsa/__init__.py +++ b/flowsa/__init__.py @@ -37,7 +37,7 @@ def getFlowByActivity(datasource, year, flowclass=None, geographic_level=None, download_FBA_if_missing=DEFAULT_DOWNLOAD_IF_MISSING): fba = FlowByActivity.getFlowByActivity( - source=datasource, + source_name=datasource, year=int(year), download_ok=download_FBA_if_missing ) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 3f07d97f6..cd6915a33 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -21,6 +21,8 @@ def __init__( self, data: pd.DataFrame or '_FlowBy' = None, *args, + source_name: str = None, + source_config: dict = None, fields: dict = None, column_order: List[str] = None, string_null: 'np.nan' or None = np.nan, @@ -32,8 +34,8 @@ def __init__( print(getattr(data, attribute)) super().__setattr__(attribute, getattr(data, attribute)) else: - self.source_name = '' - self.source_config = {} + self.source_name = source_name or '' + self.source_config = source_config or {} if isinstance(data, pd.DataFrame) and fields is not None: fill_na_dict = { field: 0 if dtype in ['int', 'float'] else string_null @@ -90,7 +92,10 @@ def _getFlowBy( file_metadata: esupy.processed_data_mgmt.FileMeta, download_ok: bool, flowby_generator: partial, - output_path: str + output_path: str, + *, + source_name: str = None, + source_config: dict = None, ) -> '_FlowBy': for attempt in ['import local', 'download', 'generate']: log.info( @@ -128,7 +133,7 @@ def _getFlowBy( '%s %s could not be found locally, downloaded, or generated', file_metadata.name_data, file_metadata.category ) - fb = cls(df) + fb = cls(df, source_name=source_name, source_config=source_config) return fb @staticmethod @@ -345,9 +350,10 @@ def _constructor_sliced(self) -> '_FBASeries': @classmethod def getFlowByActivity( cls, - source: str, + source_name: str, year: int = None, - download_ok: bool = settings.DEFAULT_DOWNLOAD_IF_MISSING + download_ok: bool = settings.DEFAULT_DOWNLOAD_IF_MISSING, + **kwargs ) -> 'FlowByActivity': """ Loads stored data in the FlowByActivity format. If it is not @@ -357,22 +363,26 @@ def getFlowByActivity( :param year: int, a year, e.g. 2012 :param download_ok: bool, if True will attempt to load from EPA remote server prior to generating + :kwargs: keyword arguments to pass to _getFlowBy(). Possible kwargs + include source_config. :return: a FlowByActivity dataframe """ file_metadata = metadata.set_fb_meta( - source if year is None else f'{source}_{year}', + source_name if year is None else f'{source_name}_{year}', 'FlowByActivity' ) flowby_generator = partial( flowbyactivity.main, - source=source, + source=source_name, year=year ) return super()._getFlowBy( file_metadata=file_metadata, download_ok=download_ok, flowby_generator=flowby_generator, - output_path=settings.fbaoutputpath + output_path=settings.fbaoutputpath, + source_name=source_name, + **kwargs ) # TODO: probably only slight modification is needed to allow for material @@ -530,7 +540,8 @@ def getFlowBySector( method: str, external_config_path: str = None, download_sources_ok: bool = settings.DEFAULT_DOWNLOAD_IF_MISSING, - download_fbs_ok: bool = settings.DEFAULT_DOWNLOAD_IF_MISSING + download_fbs_ok: bool = settings.DEFAULT_DOWNLOAD_IF_MISSING, + **kwargs ) -> 'FlowBySector': """ Loads stored FlowBySector output. If it is not @@ -545,6 +556,8 @@ def getFlowBySector( :param download_FBS_if_missing: bool, if True will attempt to load the the FBS from EPA's remote server rather than generating it (if not found locally) + :kwargs: keyword arguments to pass to _getFlowBy(). Possible kwargs + include source_name and source_config. :return: FlowBySector dataframe """ file_metadata = metadata.set_fb_meta(method, 'FlowBySector') @@ -558,7 +571,8 @@ def getFlowBySector( file_metadata=file_metadata, download_ok=download_fbs_ok, flowby_generator=flowby_generator, - output_path=settings.fbsoutputpath + output_path=settings.fbsoutputpath, + **kwargs ) @classmethod @@ -593,21 +607,22 @@ def generateFlowBySector( if source_config['data_format'] in ['FBS', 'FBS_outside_flowsa']: if source_config['data_format'] == 'FBS_outside_flowsa': source_data = FlowBySector( - source_config['FBS_datapull_fxn'](source_config, - method_config, - external_config_path) + source_config['FBS_datapull_fxn']( + source_config, method_config, external_config_path + ), + source_name=source_name, + source_config=source_config ) else: # TODO: Test this section. source_data = FlowBySector.getFlowBySector( - source=source_name, + method=source_name, external_config_path=external_config_path, download_sources_ok=download_sources_ok, - download_fbs_ok=download_sources_ok + download_fbs_ok=download_sources_ok, + source_name=source_name, + source_config=source_config ) - source_data.source_name = source_name - source_data.source_config = source_config - fbs = (source_data .conditional_pipe( 'clean_fbs_df_fxn' in source_config, @@ -627,14 +642,12 @@ def generateFlowBySector( if source_config['data_format'] == 'FBA': source_data = FlowByActivity.getFlowByActivity( - source=source_name, + source_name=source_name, year=source_config['year'], - download_ok=download_sources_ok + download_ok=download_sources_ok, + source_config=source_config ) - source_data.source_name = source_name - source_data.source_config = source_config - fba = (source_data .query(f'Class == \'{source_config["class"]}\'') # TODO: source_config keys not currently handled: From 8ca2c6f6b9ebabe7bf19b35dd84091fa79e63ba7 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 16 May 2022 12:47:35 -0400 Subject: [PATCH 0031/1127] modified map_to_fedefl_list for new attributes --- flowsa/flowby.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index cd6915a33..33cc85ba0 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -389,13 +389,11 @@ def getFlowByActivity( # flow list mapping using this function as well. def map_to_fedefl_list( self, - source_name: str, - source_config: dict, drop_fba_columns: bool = False, drop_unmapped_rows: bool = False ) -> 'FlowByActivity': log.info('Mapping flows in %s to federal elementary flow list', - source_name) + self.source_name) fba_merge_keys = [ 'SourceName', @@ -403,7 +401,8 @@ def map_to_fedefl_list( 'Unit', 'Context' ] - mapping_subset = source_config.get('fedefl_mapping', source_name) + mapping_subset = self.source_config.get('fedefl_mapping', + self.source_name) mapping_fields = [ 'SourceListName', 'SourceFlowName', @@ -422,7 +421,7 @@ def map_to_fedefl_list( 'SourceFlowContext' ] merge_type = 'inner' if drop_unmapped_rows else 'left' - if 'fedefl_mapping' in source_config: + if 'fedefl_mapping' in self.source_config: fba_merge_keys.remove('SourceName') mapping_merge_keys.remove('SourceListName') @@ -656,7 +655,7 @@ def generateFlowBySector( 'clean_fba_before_mapping_df_fxn' in source_config, source_config.get('clean_fba_before_mapping_df_fxn') ) - .map_to_fedefl_list(source_name, source_config) + .map_to_fedefl_list() .conditional_pipe( 'clean_fba_df_fxn' in source_config, source_config.get('clean_fba_df_fxn'))) From cc64d18c91a796bd6eab9a56dd47e94e423f259e Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 17 May 2022 16:03:21 -0400 Subject: [PATCH 0032/1127] allocate census regions to states for EIA MECS --- flowsa/data_source_scripts/EIA_MECS.py | 59 ++++++++++++++++++++++++-- flowsa/flowbyfunctions.py | 4 +- 2 files changed, 59 insertions(+), 4 deletions(-) diff --git a/flowsa/data_source_scripts/EIA_MECS.py b/flowsa/data_source_scripts/EIA_MECS.py index 40086e9d2..801b02a80 100644 --- a/flowsa/data_source_scripts/EIA_MECS.py +++ b/flowsa/data_source_scripts/EIA_MECS.py @@ -11,10 +11,12 @@ import io import pandas as pd import numpy as np -from flowsa.location import US_FIPS +import flowsa +from flowsa.location import US_FIPS, get_region_and_division_codes from flowsa.common import WITHDRAWN_KEYWORD -from flowsa.settings import vLogDetailed -from flowsa.flowbyfunctions import assign_fips_location_system +from flowsa.settings import vLogDetailed, log +from flowsa.flowbyfunctions import assign_fips_location_system,\ + load_fba_w_standardized_units from flowsa.dataclean import replace_strings_with_NoneType, \ replace_NoneType_with_empty_cells from flowsa.data_source_scripts.EIA_CBECS_Land import \ @@ -410,6 +412,57 @@ def mecs_energy_fba_cleanup(fba, attr, **kwargs): return fba +def mecs_energy_fba_cleanup_to_states(fba, attr, **kwargs): + fba = mecs_energy_fba_cleanup(fba, attr) + fba = update_regions_to_states(fba, attr) + return fba + + +def update_regions_to_states(fba_load, attr, **_): + """ + Propogates regions to all states to enable for use in state methods. + clean_allocation_fba fxn + """ + log.info('Updating census regions to states') + region_map = get_region_and_division_codes() + region_map = region_map[['Region','State_FIPS']].drop_duplicates() + region_map.loc[:, 'State_FIPS'] = ( + region_map['State_FIPS'].apply(lambda x: + x.ljust(3 + len(x), '0') + if len(x) < 5 else x)) + + # Allocate MECS based on employment FBS + year = 2017 + hlp = flowsa.getFlowBySector(methodname=f'Employment_state_{year}') + + # # Allocate MECS flows to states based on helper source + # hlp = load_fba_w_standardized_units(datasource=attr['helper_source'], + # year=attr['helper_source_year'], + # flowclass=attr['helper_source_class'], + # geographic_level=attr['helper_from_scale']) + # hlp = hlp[hlp['ActivityProducedBy'].str.len() == 2] + + hlp = hlp.groupby( + ['Year', 'Location']).agg({'FlowAmount':'sum'}).reset_index() + + hlp = hlp.merge(region_map, how = 'left', left_on = 'Location', + right_on = 'State_FIPS') + hlp['Allocation'] = hlp['FlowAmount']/hlp.groupby( + ['Region']).FlowAmount.transform('sum') + + fba = pd.merge(fba_load.rename(columns={'Location':'Region'}), + hlp[['Region','Location','Allocation']], + how='left', on='Region') + fba['FlowAmount'] = fba['FlowAmount'] * fba['Allocation'] + fba = fba.drop(columns=['Allocation','Region']) + + if (abs(1-(sum(fba['FlowAmount']) / + sum(fba_load['FlowAmount'])))) > 0.0005: + log.warning('Data loss upon census region mapping') + + return fba + + def eia_mecs_energy_clean_allocation_fba_w_sec( df_w_sec, attr, method, **kwargs): """ diff --git a/flowsa/flowbyfunctions.py b/flowsa/flowbyfunctions.py index 1282c9c8f..5adcce064 100644 --- a/flowsa/flowbyfunctions.py +++ b/flowsa/flowbyfunctions.py @@ -527,7 +527,7 @@ def subset_df_by_geoscale(df, activity_from_scale, activity_to_scale): cols_to_keep = flow_by_activity_fields # method of subset dependent on LocationSystem - if df['LocationSystem'].str.contains('FIPS').any(): + if df['LocationSystem'].str.contains('FIPS').all(): df = df[df['LocationSystem'].str.contains( 'FIPS')].reset_index(drop=True) # determine 'activity_from_scale' for use in df @@ -576,6 +576,8 @@ def subset_df_by_geoscale(df, activity_from_scale, activity_to_scale): # right now, the only other location system is for Statistics Canada data else: + df = df[~df['LocationSystem'].str.contains('FIPS')].reset_index(drop=True) + return df From b99618ea64ff63980fab9ca9f233965af2ea47ec Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 17 May 2022 19:44:54 -0400 Subject: [PATCH 0033/1127] revise `update_regions_to_state()` to act after adding sectors so that allocation across states can be done for individual sectors --- flowsa/data_source_scripts/EIA_MECS.py | 42 ++++++++++++++------------ 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/flowsa/data_source_scripts/EIA_MECS.py b/flowsa/data_source_scripts/EIA_MECS.py index 801b02a80..5ef1002b0 100644 --- a/flowsa/data_source_scripts/EIA_MECS.py +++ b/flowsa/data_source_scripts/EIA_MECS.py @@ -16,7 +16,7 @@ from flowsa.common import WITHDRAWN_KEYWORD from flowsa.settings import vLogDetailed, log from flowsa.flowbyfunctions import assign_fips_location_system,\ - load_fba_w_standardized_units + load_fba_w_standardized_units, sector_aggregation from flowsa.dataclean import replace_strings_with_NoneType, \ replace_NoneType_with_empty_cells from flowsa.data_source_scripts.EIA_CBECS_Land import \ @@ -412,16 +412,23 @@ def mecs_energy_fba_cleanup(fba, attr, **kwargs): return fba -def mecs_energy_fba_cleanup_to_states(fba, attr, **kwargs): - fba = mecs_energy_fba_cleanup(fba, attr) - fba = update_regions_to_states(fba, attr) - return fba +def eia_mecs_energy_clean_allocation_fba_w_sec_to_state( + df_w_sec, attr, method, **kwargs): + """clean_fba_w_sec fxn that replicates + eia_mecs_energy_clean_allocation_fba_w_sec but also updates regions to + states for state models""" + df_w_sec = eia_mecs_energy_clean_allocation_fba_w_sec( + df_w_sec, attr, method, **kwargs) + df_w_sec = update_regions_to_states(df_w_sec, attr) + + return df_w_sec def update_regions_to_states(fba_load, attr, **_): """ Propogates regions to all states to enable for use in state methods. - clean_allocation_fba fxn + Allocates sectors across states based on employment. + clean_allocation_fba_w_sec fxn """ log.info('Updating census regions to states') region_map = get_region_and_division_codes() @@ -432,30 +439,27 @@ def update_regions_to_states(fba_load, attr, **_): if len(x) < 5 else x)) # Allocate MECS based on employment FBS - year = 2017 + year = 2017 #TODO update when more FBS available hlp = flowsa.getFlowBySector(methodname=f'Employment_state_{year}') - # # Allocate MECS flows to states based on helper source - # hlp = load_fba_w_standardized_units(datasource=attr['helper_source'], - # year=attr['helper_source_year'], - # flowclass=attr['helper_source_class'], - # geographic_level=attr['helper_from_scale']) - # hlp = hlp[hlp['ActivityProducedBy'].str.len() == 2] - - hlp = hlp.groupby( - ['Year', 'Location']).agg({'FlowAmount':'sum'}).reset_index() + # To match the various sector resolution of MECS, generate employment + # dataset for all NAICS resolution by aggregating + hlp = sector_aggregation(hlp) + # For each region, generate ratios across states for a given sector hlp = hlp.merge(region_map, how = 'left', left_on = 'Location', right_on = 'State_FIPS') hlp['Allocation'] = hlp['FlowAmount']/hlp.groupby( - ['Region']).FlowAmount.transform('sum') + ['Region', 'SectorProducedBy']).FlowAmount.transform('sum') fba = pd.merge(fba_load.rename(columns={'Location':'Region'}), - hlp[['Region','Location','Allocation']], - how='left', on='Region') + (hlp[['Region','Location','SectorProducedBy','Allocation']] + .rename(columns={'SectorProducedBy':'SectorConsumedBy'})), + how='left', on=['Region','SectorConsumedBy']) fba['FlowAmount'] = fba['FlowAmount'] * fba['Allocation'] fba = fba.drop(columns=['Allocation','Region']) + # Check for data loss if (abs(1-(sum(fba['FlowAmount']) / sum(fba_load['FlowAmount'])))) > 0.0005: log.warning('Data loss upon census region mapping') From c2531320e24f37fdece90acdd67ccb6582d606a5 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 19 May 2022 13:52:56 -0400 Subject: [PATCH 0034/1127] Added geo.py (with enum) --- flowsa/flowby.py | 2 +- flowsa/geo.py | 83 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 flowsa/geo.py diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 33cc85ba0..3a33be850 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -4,7 +4,7 @@ from functools import partial from . import (common, settings, location, dataclean, metadata, sectormapping, literature_values, flowbyactivity, flowbysector, flowsa_yaml, - validation) + validation, geo) from .flowsa_log import log, vlog import esupy.processed_data_mgmt import esupy.dqi diff --git a/flowsa/geo.py b/flowsa/geo.py new file mode 100644 index 000000000..4a3b63b96 --- /dev/null +++ b/flowsa/geo.py @@ -0,0 +1,83 @@ +from typing import Literal +import enum +from functools import total_ordering +import pandas as pd +import numpy as np +from . import settings +from .flowsa_log import log + + +@total_ordering +class scale(enum.Enum): + ''' + Enables the representation of geoscales as constants which can + be compared using <, >, max(), min(), etc. Note that "larger" implies + more aggregated. + ''' + NATIONAL = 5, True + CENSUS_REGION = 4, False + CENSUS_DIVISION = 3, False + STATE = 2, True + COUNTY = 1, True + + def __init__(self, aggregation_level: int, has_fips_level: bool) -> None: + self.aggregation_level = aggregation_level + self.has_fips_level = has_fips_level + + def __lt__(self, other): + if other.__class__ is self.__class__: + return self.aggregation_level < other.aggregation_level + else: + return NotImplemented + + @classmethod + def from_string( + cls, + geoscale: Literal['national', 'census_region', 'census_division', + 'state', 'county'] + ) -> 'scale': + if geoscale == 'national': + return cls.NATIONAL + elif geoscale == 'census_region': + return cls.CENSUS_REGION + elif geoscale == 'census_division': + return cls.CENSUS_DIVISION + elif geoscale == 'state': + return cls.STATE + elif geoscale == 'county': + return cls.COUNTY + else: + raise ValueError(f'No geo.scale level corresponds to {geoscale}') + + +def get_all_fips(year: Literal[2010, 2013, 2015] = 2015) -> pd.DataFrame: + """ + Read fips based on year specified, year defaults to 2015 + :param year: int, one of 2010, 2013, or 2015, default year is 2015 + because most recent year of FIPS available + :return: df, FIPS for specified year + """ + return (pd + .read_csv(settings.datapath + 'FIPS_Crosswalk.csv', + header=0, dtype=object) + [['State', f'FIPS_{year}', f'County_{year}']] + .rename(columns={f'FIPS_{year}': 'FIPS', + f'County_{year}': 'County'}) + .sort_values('FIPS') + .reset_index(drop=True)) + + +def get_fips_list( + geoscale: Literal['national', 'state', 'county'] or scale, + year: Literal[2010, 2013, 2015] = 2015 +) -> pd.DataFrame: + if geoscale == 'national' or geoscale == scale.NATIONAL: + return (list(get_all_fips(year).query('State.isnull()').FIPS)) + elif geoscale == 'state' or geoscale == scale.STATE: + return (list(get_all_fips(year) + .query('State.notnull() & County.isnull()').FIPS)) + elif geoscale == 'county' or geoscale == scale.COUNTY: + return (list(get_all_fips(year).query('County.notnull()').FIPS)) + else: + log.error('No FIPS list exists for the given geoscale: %s', geoscale) + raise ValueError(geoscale) From df66320f5195ac604d62128b2179fa2cf993061e Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 19 May 2022 17:38:26 -0400 Subject: [PATCH 0035/1127] Implemented aggregate_flowby --- flowsa/flowby.py | 69 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 64 insertions(+), 5 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 3a33be850..bd839db6e 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -280,7 +280,8 @@ def standardize_units(self: FB) -> FB: return self._standardize_units(self) def update_fips_to_geoscale( - self: FB, + self: Literal['national', 'state', 'county', + geo.scale.NATIONAL, geo.scale.STATE, geo.scale.COUNTY], to_geoscale: str, ) -> FB: """ @@ -291,14 +292,72 @@ def update_fips_to_geoscale( :param to_geoscale: str, target geoscale :return: FlowBy dataset with 5 digit fips """ - if to_geoscale == 'national': - return self.assign(Location=location.US_FIPS) - elif to_geoscale == 'state': + if to_geoscale == 'national' or to_geoscale == geo.scale.NATIONAL: + return (self + .assign(Location=geo.filtered_fips_list('national')[0])) + elif to_geoscale == 'state' or to_geoscale == geo.scale.STATE: return (self .assign(Location=self.Location.apply( lambda x: str(x)[:2].ljust(5, '0')))) - else: + elif to_geoscale == 'county' or to_geoscale == geo.scale.COUNTY: return self + else: + log.error('No FIPS level corresponds to the given geoscale: %s', + to_geoscale) + + # TODO: Make it so column names are retained (or added back in) after + # aggregation + def aggregate_flowby( + self: FB, + columns_to_group_by: List[str] = None, + columns_to_average: List[str] = None + ) -> FB: + """ + Aggregates FlowBy 'FlowAmount' column based on group_by_columns and + generates weighted average values based on FlowAmount values + for certain other columns + :return: FlowBy, with aggregated columns + """ + if columns_to_group_by is None: + columns_to_group_by = [ + x for x in self.columns + if self[x].dtype != 'float' and x != 'Description' + ] + if columns_to_average is None: + columns_to_average = [ + x for x in self.columns + if self[x].dtype == 'float' and x != 'FlowAmount' + ] + fb = self.query('FlowAmount != 0') + aggregated = ( + fb + .assign( + **{f'_{c}_weighted': fb[c] * fb.FlowAmount + for c in columns_to_average}, + **{f'_{c}_weights': fb.FlowAmount * fb[c].notnull() + for c in columns_to_average} + ) + .groupby(columns_to_group_by, dropna=False) + .agg({c: 'sum' for c in ( + ['FlowAmount'] + + columns_to_average + + [f'_{c}_weighted' for c in columns_to_average] + + [f'_{c}_weights' for c in columns_to_average])}) + .reset_index() + ) + aggregated = ( + aggregated + .assign( + **{c: (aggregated[f'_{c}_weighted'] + / aggregated[f'_{c}_weights']) + for c in columns_to_average} + ) + .drop( + columns=([f'_{c}_weighted' for c in columns_to_average] + + [f'_{c}_weights' for c in columns_to_average]) + ) + ) + return aggregated class FlowByActivity(_FlowBy): From 09aa0b5f6442fac3438f65463da3080d591fd554 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 19 May 2022 17:39:15 -0400 Subject: [PATCH 0036/1127] Added todos and type hints --- flowsa/geo.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/flowsa/geo.py b/flowsa/geo.py index 4a3b63b96..66e3e9181 100644 --- a/flowsa/geo.py +++ b/flowsa/geo.py @@ -7,6 +7,9 @@ from .flowsa_log import log +# TODO: Evaluate whether an UNKNOWN entry should be included, with np.nan +# TODO: as the aggregation_level. Doing so will also require implementing +# TODO: __gt__(), __le__(), and __ge__() to return the proper comparisons. @total_ordering class scale(enum.Enum): ''' @@ -67,8 +70,9 @@ def get_all_fips(year: Literal[2010, 2013, 2015] = 2015) -> pd.DataFrame: .reset_index(drop=True)) -def get_fips_list( - geoscale: Literal['national', 'state', 'county'] or scale, +def filtered_fips_list( + geoscale: Literal['national', 'state', 'county', + scale.NATIONAL, scale.STATE, scale.COUNTY], year: Literal[2010, 2013, 2015] = 2015 ) -> pd.DataFrame: if geoscale == 'national' or geoscale == scale.NATIONAL: From 42183c68e1ad5fd42978e9fd8dc6f2952a6c5f62 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Sat, 21 May 2022 10:43:08 -0400 Subject: [PATCH 0037/1127] Tiny flowby tweaks (caused by geo adjustments) --- flowsa/flowby.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index bd839db6e..a44790526 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -294,7 +294,8 @@ def update_fips_to_geoscale( """ if to_geoscale == 'national' or to_geoscale == geo.scale.NATIONAL: return (self - .assign(Location=geo.filtered_fips_list('national')[0])) + .assign(Location=(geo.filtered_fips('national') + .FIPS.values[0]))) elif to_geoscale == 'state' or to_geoscale == geo.scale.STATE: return (self .assign(Location=self.Location.apply( @@ -305,8 +306,6 @@ def update_fips_to_geoscale( log.error('No FIPS level corresponds to the given geoscale: %s', to_geoscale) - # TODO: Make it so column names are retained (or added back in) after - # aggregation def aggregate_flowby( self: FB, columns_to_group_by: List[str] = None, @@ -340,7 +339,6 @@ def aggregate_flowby( .groupby(columns_to_group_by, dropna=False) .agg({c: 'sum' for c in ( ['FlowAmount'] - + columns_to_average + [f'_{c}_weighted' for c in columns_to_average] + [f'_{c}_weights' for c in columns_to_average])}) .reset_index() From dc693c788ec7fb8180befec6d549457766773b16 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Sat, 21 May 2022 10:45:38 -0400 Subject: [PATCH 0038/1127] geo filtered_fips now returns df, not list --- flowsa/geo.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/flowsa/geo.py b/flowsa/geo.py index 66e3e9181..7e9df5bfe 100644 --- a/flowsa/geo.py +++ b/flowsa/geo.py @@ -70,18 +70,17 @@ def get_all_fips(year: Literal[2010, 2013, 2015] = 2015) -> pd.DataFrame: .reset_index(drop=True)) -def filtered_fips_list( +def filtered_fips( geoscale: Literal['national', 'state', 'county', scale.NATIONAL, scale.STATE, scale.COUNTY], year: Literal[2010, 2013, 2015] = 2015 ) -> pd.DataFrame: if geoscale == 'national' or geoscale == scale.NATIONAL: - return (list(get_all_fips(year).query('State.isnull()').FIPS)) + return (get_all_fips(year).query('State.isnull()')) elif geoscale == 'state' or geoscale == scale.STATE: - return (list(get_all_fips(year) - .query('State.notnull() & County.isnull()').FIPS)) + return (get_all_fips(year).query('State.notnull() & County.isnull()')) elif geoscale == 'county' or geoscale == scale.COUNTY: - return (list(get_all_fips(year).query('County.notnull()').FIPS)) + return (get_all_fips(year).query('County.notnull()')) else: log.error('No FIPS list exists for the given geoscale: %s', geoscale) raise ValueError(geoscale) From 87d0e76854c35d4d61441f705d9db756449783fa Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Sat, 21 May 2022 10:46:27 -0400 Subject: [PATCH 0039/1127] geo.scale.from_string case-insensitive + docstring --- flowsa/geo.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/flowsa/geo.py b/flowsa/geo.py index 7e9df5bfe..d5ae96fa9 100644 --- a/flowsa/geo.py +++ b/flowsa/geo.py @@ -39,6 +39,13 @@ def from_string( geoscale: Literal['national', 'census_region', 'census_division', 'state', 'county'] ) -> 'scale': + ''' + Return the appropriate geo.scale constant given a (non-case-sensitive) + string + :param geoscale: str + :return: geo.scale constant + ''' + geoscale = geoscale.lower() if geoscale == 'national': return cls.NATIONAL elif geoscale == 'census_region': From a62b99735cd8c8600ef5ada0b565600de495e172 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Sat, 21 May 2022 10:47:39 -0400 Subject: [PATCH 0040/1127] get_all_fips docstring --- flowsa/geo.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/flowsa/geo.py b/flowsa/geo.py index d5ae96fa9..569d04c7d 100644 --- a/flowsa/geo.py +++ b/flowsa/geo.py @@ -61,12 +61,14 @@ def from_string( def get_all_fips(year: Literal[2010, 2013, 2015] = 2015) -> pd.DataFrame: - """ + ''' Read fips based on year specified, year defaults to 2015 :param year: int, one of 2010, 2013, or 2015, default year is 2015 because most recent year of FIPS available - :return: df, FIPS for specified year - """ + :return: df, with columns=['State', 'FIPS', 'County'] for specified year. + 'State' is NaN for national level FIPS ('00000'), and 'County' + is Nan for national and each state level FIPS. + ''' return (pd .read_csv(settings.datapath + 'FIPS_Crosswalk.csv', header=0, dtype=object) From 07b67a469035bb88350f57fb73043c0e2b512f99 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Sat, 21 May 2022 10:49:55 -0400 Subject: [PATCH 0041/1127] geo.scale now works with pd.max(dropna=True) --- flowsa/geo.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/flowsa/geo.py b/flowsa/geo.py index 569d04c7d..e3644d21f 100644 --- a/flowsa/geo.py +++ b/flowsa/geo.py @@ -7,9 +7,6 @@ from .flowsa_log import log -# TODO: Evaluate whether an UNKNOWN entry should be included, with np.nan -# TODO: as the aggregation_level. Doing so will also require implementing -# TODO: __gt__(), __le__(), and __ge__() to return the proper comparisons. @total_ordering class scale(enum.Enum): ''' @@ -30,6 +27,11 @@ def __init__(self, aggregation_level: int, has_fips_level: bool) -> None: def __lt__(self, other): if other.__class__ is self.__class__: return self.aggregation_level < other.aggregation_level + elif other in [float('inf'), float('-inf')]: + # ^^^ Add np.nan to list if such comparison is needed. + return self.aggregation_level < other + # ^^^ Enables pandas max and min functions to work even if + # there are missing values (with dropna=True) else: return NotImplemented From eb88dd89d09d657fc323e98daeab93347b40e6ac Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Sat, 21 May 2022 11:31:34 -0400 Subject: [PATCH 0042/1127] Added convert_to_geoscale to flowby --- flowsa/flowby.py | 103 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 101 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index a44790526..71560d376 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1,7 +1,7 @@ from typing import Callable, List, Optional, Union, Literal, TypeVar import pandas as pd import numpy as np -from functools import partial +from functools import partial, reduce from . import (common, settings, location, dataclean, metadata, sectormapping, literature_values, flowbyactivity, flowbysector, flowsa_yaml, validation, geo) @@ -445,7 +445,7 @@ def getFlowByActivity( # TODO: probably only slight modification is needed to allow for material # flow list mapping using this function as well. def map_to_fedefl_list( - self, + self: 'FlowByActivity', drop_fba_columns: bool = False, drop_unmapped_rows: bool = False ) -> 'FlowByActivity': @@ -545,6 +545,105 @@ def map_to_fedefl_list( return mapped_fba.drop(columns='mapped') + def convert_to_geoscale( + self: 'FlowByActivity', + target_geoscale: Literal['national', 'state', 'county', + geo.scale.NATIONAL, geo.scale.STATE, + geo.scale.COUNTY] + ) -> 'FlowByActivity': + ''' + Converts, by subsetting/selecting or aggregating (or both), the + given dataset to the target geoscale. + + Rows from the calling FlowBy that correspond to a higher level (more + aggregated) geoscale than the target are dropped. Then, for each + combination of 'ActivityProducedBy' and 'ActivityConsumedBy', and for + each level at or below (less aggregated than) the target geoscale, + determine the highest level at which data is reported for each unit at + that scale (so if the level is 'state', find the highest level at which + data is reported for each state, for each activity combination). + Finally, use this information to identify the correct source scale + for each activity combination and regional unit (details below), then + aggregate or filter (or both) to convert the dataset so all rows are + at the target geoscale. + + For any region and activity combination, the correct source geoscale + is the highest (most aggregated) geoscale at or below the target + geoscale, for which data covering that region and activity combination + is reported. For example, if the target geoscale is 'national', + national level data should be used if available. If not, state level + data should be aggregated up if available. However, if some states + report county level data AND NOT state level data, then for those + states (and only those states) county level data should be aggregated + up. County level data from states that also report state level data + should, in this example, be ignored. + ''' + if type(target_geoscale) == str: + target_geoscale = geo.scale.from_string(target_geoscale) + + geoscale_by_fips = pd.concat([ + (geo.filtered_fips(scale) + .assign(geoscale=scale, National='USA') + # ^^^ Need to have a column for each relevant scale + # (only FIPS for now) + .rename(columns={'FIPS': 'Location'})) + for scale in [s for s in geo.scale if s.has_fips_level] + ]) + + geoscale_name_columns = [s.name.title() for s in geo.scale + if s.has_fips_level] + + highest_reporting_level_by_geoscale = [ + (self + .merge(geoscale_by_fips, how='inner') + .query('geoscale <= @scale') + .groupby(['ActivityProducedBy', 'ActivityConsumedBy'] + + [s.name.title() for s in geo.scale + if s.has_fips_level and s >= scale], + dropna=False) + .agg({'geoscale': 'max'}) + .reset_index() + .rename(columns={ + 'geoscale': f'highest_reporting_level_by_{scale.name.title()}' + })) + for scale in geo.scale + if scale.has_fips_level and scale <= target_geoscale + ] + + fba_with_reporting_levels = reduce( + lambda x, y: x.merge(y, how='left'), + [self, geoscale_by_fips, *highest_reporting_level_by_geoscale] + ) + + reporting_level_columns = [ + f'highest_reporting_level_by_{s.name.title()}' + for s in geo.scale if s.has_fips_level and s <= target_geoscale + ] + + fba_at_source_geoscale = ( + fba_with_reporting_levels + .assign(source_geoscale=( + fba_with_reporting_levels[reporting_level_columns] + .max(axis='columns'))) + .query('geoscale == source_geoscale') + .drop(columns=(['geoscale', + *geoscale_name_columns, + *reporting_level_columns])) + ) + + if len(fba_at_source_geoscale.source_geoscale.unique()) > 1: + log.warning('FlowBy dataset has multiple source geoscales: " %s', + list(fba_at_source_geoscale.source_geoscale.unique())) + + fba_at_target_geoscale = ( + fba_at_source_geoscale + .drop(columns='source_geoscale') + .update_fips_to_geoscale(target_geoscale) + .aggregate_flowby() + ) + + return fba_at_target_geoscale + class FlowBySector(_FlowBy): def __init__( From 9c68b24f1386fe6bc775efd517e847f488770609 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 23 May 2022 09:00:13 -0400 Subject: [PATCH 0043/1127] minor tweaks, mostly to documentation --- flowsa/flowby.py | 43 +++++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 71560d376..704b1571e 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -280,9 +280,10 @@ def standardize_units(self: FB) -> FB: return self._standardize_units(self) def update_fips_to_geoscale( - self: Literal['national', 'state', 'county', - geo.scale.NATIONAL, geo.scale.STATE, geo.scale.COUNTY], - to_geoscale: str, + self: FB, + to_geoscale: Literal['national', 'state', 'county', + geo.scale.NATIONAL, geo.scale.STATE, + geo.scale.COUNTY], ) -> FB: """ Sets FIPS codes to 5 digits by zero-padding FIPS codes at the specified @@ -292,15 +293,18 @@ def update_fips_to_geoscale( :param to_geoscale: str, target geoscale :return: FlowBy dataset with 5 digit fips """ - if to_geoscale == 'national' or to_geoscale == geo.scale.NATIONAL: + if type(to_geoscale) == str: + to_geoscale = geo.scale.from_string(to_geoscale) + + if to_geoscale == geo.scale.NATIONAL: return (self .assign(Location=(geo.filtered_fips('national') .FIPS.values[0]))) - elif to_geoscale == 'state' or to_geoscale == geo.scale.STATE: + elif to_geoscale == geo.scale.STATE: return (self .assign(Location=self.Location.apply( lambda x: str(x)[:2].ljust(5, '0')))) - elif to_geoscale == 'county' or to_geoscale == geo.scale.COUNTY: + elif to_geoscale == geo.scale.COUNTY: return self else: log.error('No FIPS level corresponds to the given geoscale: %s', @@ -312,9 +316,15 @@ def aggregate_flowby( columns_to_average: List[str] = None ) -> FB: """ - Aggregates FlowBy 'FlowAmount' column based on group_by_columns and - generates weighted average values based on FlowAmount values - for certain other columns + Aggregates (sums) FlowBy 'FlowAmount' column based on group_by_columns + and generates weighted average values based on FlowAmount values + for other columns + :param columns_to_group_by: list, names of columns to group by. If not + provided, all columns not of 'float' data type will be used, except + 'Description'. + :param columns_to_average: list, names of columns for which an average, + weighted by 'FlowAmount', should be calculated. If not provided, + all columns of 'float' data type will be used, except 'FlowAmount'. :return: FlowBy, with aggregated columns """ if columns_to_group_by is None: @@ -327,7 +337,9 @@ def aggregate_flowby( x for x in self.columns if self[x].dtype == 'float' and x != 'FlowAmount' ] + fb = self.query('FlowAmount != 0') + aggregated = ( fb .assign( @@ -552,8 +564,8 @@ def convert_to_geoscale( geo.scale.COUNTY] ) -> 'FlowByActivity': ''' - Converts, by subsetting/selecting or aggregating (or both), the - given dataset to the target geoscale. + Converts, by filtering or aggregating (or both), the given dataset to + the target geoscale. Rows from the calling FlowBy that correspond to a higher level (more aggregated) geoscale than the target are dropped. Then, for each @@ -564,7 +576,7 @@ def convert_to_geoscale( data is reported for each state, for each activity combination). Finally, use this information to identify the correct source scale for each activity combination and regional unit (details below), then - aggregate or filter (or both) to convert the dataset so all rows are + filter or aggregate (or both) to convert the dataset so all rows are at the target geoscale. For any region and activity combination, the correct source geoscale @@ -577,6 +589,13 @@ def convert_to_geoscale( states (and only those states) county level data should be aggregated up. County level data from states that also report state level data should, in this example, be ignored. + + :param target_geoscale: str or geo.scale constant, the geoscale to + convert the calling FlowBy data set to. Currently, this needs to be + one which corresponds to a FIPS level (that is, one of national, + state, or county) + :return: FlowBy data set, with rows filtered or aggregated to the + target geoscale. ''' if type(target_geoscale) == str: target_geoscale = geo.scale.from_string(target_geoscale) From 10ebc109a42cdb998daf8b90eb1b629068e32f57 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 23 May 2022 09:48:37 -0400 Subject: [PATCH 0044/1127] Added some logging to convert_to_geoscale --- flowsa/flowby.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 704b1571e..2e023439d 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -600,6 +600,8 @@ def convert_to_geoscale( if type(target_geoscale) == str: target_geoscale = geo.scale.from_string(target_geoscale) + log.info('Converting FBA to %s geoscale', target_geoscale.name.lower()) + geoscale_by_fips = pd.concat([ (geo.filtered_fips(scale) .assign(geoscale=scale, National='USA') @@ -651,8 +653,14 @@ def convert_to_geoscale( ) if len(fba_at_source_geoscale.source_geoscale.unique()) > 1: - log.warning('FlowBy dataset has multiple source geoscales: " %s', - list(fba_at_source_geoscale.source_geoscale.unique())) + log.warning('FBA has multiple source geoscales: %s', + ', '.join([s.name.lower() for s in + fba_at_source_geoscale + .source_geoscale.unique()])) + else: + log.info('FBA source geoscale is %s', + fba_at_source_geoscale + .source_geoscale.unique()[0].name.lower()) fba_at_target_geoscale = ( fba_at_source_geoscale From f0a88fcf53449a90c0e3d126010357ed21e7b1ea Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 23 May 2022 12:44:32 -0400 Subject: [PATCH 0045/1127] aggregate_flowby() now preserves metadata --- flowsa/flowby.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 2e023439d..bc499d01f 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -338,7 +338,14 @@ def aggregate_flowby( if self[x].dtype == 'float' and x != 'FlowAmount' ] - fb = self.query('FlowAmount != 0') + fb = ( + self + .query('FlowAmount != 0') + .drop(columns=[c for c in self.columns + if c not in ['FlowAmount', + *columns_to_average, + *columns_to_group_by]]) + ) aggregated = ( fb @@ -349,10 +356,7 @@ def aggregate_flowby( for c in columns_to_average} ) .groupby(columns_to_group_by, dropna=False) - .agg({c: 'sum' for c in ( - ['FlowAmount'] - + [f'_{c}_weighted' for c in columns_to_average] - + [f'_{c}_weights' for c in columns_to_average])}) + .agg(sum) .reset_index() ) aggregated = ( @@ -363,8 +367,8 @@ def aggregate_flowby( for c in columns_to_average} ) .drop( - columns=([f'_{c}_weighted' for c in columns_to_average] - + [f'_{c}_weights' for c in columns_to_average]) + columns=([*[f'_{c}_weighted' for c in columns_to_average], + *[f'_{c}_weights' for c in columns_to_average]]) ) ) return aggregated From b7f016fc94d627b3cee1cc854ef51bc0850686b4 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 23 May 2022 12:47:26 -0400 Subject: [PATCH 0046/1127] generateFBS += convert_to_geoscale & validation --- flowsa/flowby.py | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index bc499d01f..bc92db72b 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -729,7 +729,7 @@ def getFlowBySector( download_fbs_ok: bool = settings.DEFAULT_DOWNLOAD_IF_MISSING, **kwargs ) -> 'FlowBySector': - """ + ''' Loads stored FlowBySector output. If it is not available, tries to download it from EPA's remote server (if download_ok is True), or generate it. @@ -745,7 +745,7 @@ def getFlowBySector( :kwargs: keyword arguments to pass to _getFlowBy(). Possible kwargs include source_name and source_config. :return: FlowBySector dataframe - """ + ''' file_metadata = metadata.set_fb_meta(method, 'FlowBySector') flowby_generator = partial( flowbysector.main, @@ -880,6 +880,31 @@ def generateFlowBySector( # TODO: source_catalog key not currently handled: # TODO: 'sector-like_activities' + fba_subset = ( + fba_subset + .convert_to_geoscale( + max(geo.scale.from_string( + source_config['geoscale_to_use']), + geo.scale.from_string( + activity_config['allocation_from_scale']))) + ) + + if activity_config['allocation_from_scale'] != 'national': + validation.compare_geographic_totals( + fba_subset, + fba.query( + 'ActivityProducedBy not in @completed_names' + '& ActivityConsumedBy not in @completed_names' + ), + # ^^^ Not sure if this is really the spot this + # data set for comparison needs to come from, + # but it matches what's used in flowbysector.py + source_name, + activity_config, + activity_set, + names + ) + completed_names.extend(names) log.info('Appending %s from %s to FBS list', From cd380c47ff14442d2c2112d4ded25545d2024b29 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 23 May 2022 12:57:23 -0400 Subject: [PATCH 0047/1127] Renamed for clarity --- flowsa/flowby.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index bc92db72b..f7e92a868 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -856,7 +856,7 @@ def generateFlowBySector( names = activity_config['names'] - fba_subset = ( + activity_set_fba = ( fba .query('ActivityProducedBy not in @completed_names' '& ActivityConsumedBy not in @completed_names') @@ -870,18 +870,18 @@ def generateFlowBySector( .reset_index(drop=True) ) - if fba_subset.empty: + if activity_set_fba.empty: log.error('No data for flows in %s', activity_set) continue - if (fba_subset.FlowAmount == 0).all(): + if (activity_set_fba.FlowAmount == 0).all(): log.warning('All flows for %s are 0', activity_set) continue # TODO: source_catalog key not currently handled: # TODO: 'sector-like_activities' - fba_subset = ( - fba_subset + activity_set_fba = ( + activity_set_fba .convert_to_geoscale( max(geo.scale.from_string( source_config['geoscale_to_use']), @@ -891,7 +891,7 @@ def generateFlowBySector( if activity_config['allocation_from_scale'] != 'national': validation.compare_geographic_totals( - fba_subset, + activity_set_fba, fba.query( 'ActivityProducedBy not in @completed_names' '& ActivityConsumedBy not in @completed_names' @@ -909,7 +909,7 @@ def generateFlowBySector( log.info('Appending %s from %s to FBS list', activity_set, source_name) - component_fbs_list.append(fba_subset) + component_fbs_list.append(activity_set_fba) return component_fbs_list From 1766eabdd06183f14a87fcc99f0474c832551670 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 24 May 2022 09:22:56 -0400 Subject: [PATCH 0048/1127] generateFBS += map_to_sectors. + GHGI_NAICS xwalk. --- .../NAICS_Crosswalk_EPA_GHGI.csv | 540 ++++++++++++++++++ flowsa/flowby.py | 134 ++++- 2 files changed, 670 insertions(+), 4 deletions(-) create mode 100644 flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv new file mode 100644 index 000000000..b9bbce301 --- /dev/null +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv @@ -0,0 +1,540 @@ +ActivitySourceName,Activity,SectorSourceName,Sector,SectorType,Notes,Table +EPA_GHGI,Iron and Steel Production & Metallurgical Coke Production,NAICS_2012_Code,3311,,331110,EPA_GHGI_T_2_1 +EPA_GHGI,Cement Production,NAICS_2012_Code,32731,,327310,EPA_GHGI_T_2_1 +EPA_GHGI,Lime Production,NAICS_2012_Code,3274,,327400,EPA_GHGI_T_2_1 +EPA_GHGI,Ammonia Production,NAICS_2012_Code,32531,,325310,EPA_GHGI_T_2_1 +EPA_GHGI,Incineration of Waste,NAICS_2012_Code,562,,562000,EPA_GHGI_T_2_1 +EPA_GHGI,Aluminum Production,NAICS_2012_Code,331313,,331313,"EPA_GHGI_T_2_1, EPA_GHGI_T_4_80" +EPA_GHGI,Soda Ash Production,NAICS_2012_Code,32519,,325190,EPA_GHGI_T_2_1 +EPA_GHGI,Ferroalloy Production,NAICS_2012_Code,3311,,331110,EPA_GHGI_T_2_1 +EPA_GHGI,Titanium Dioxide Production,NAICS_2012_Code,32519,,325190,EPA_GHGI_T_2_1 +EPA_GHGI,Zinc Production,NAICS_2012_Code,33142,,331420,EPA_GHGI_T_2_1 +EPA_GHGI,Phosphoric Acid Production,NAICS_2012_Code,32531,,325310,EPA_GHGI_T_2_1 +EPA_GHGI,Glass Production,NAICS_2012_Code,3272,,327200,EPA_GHGI_T_2_1 +EPA_GHGI,Carbide Production and Consumption,NAICS_2012_Code,32518,,325180,EPA_GHGI_T_2_1 +EPA_GHGI,Landfills,NAICS_2012_Code,562,,562000,EPA_GHGI_T_2_1 +EPA_GHGI,Urea Consumption for Non-Agricultural Purposes,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_2_1 +EPA_GHGI,Urea Consumption for Non-Agricultural Purposes,NAICS_2012_Code,32,,,EPA_GHGI_T_2_1 +EPA_GHGI,Urea Consumption for Non-Agricultural Purposes,NAICS_2012_Code,33,,,EPA_GHGI_T_2_1 +EPA_GHGI,Other Process Uses of Carbonates,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_2_1 +EPA_GHGI,Other Process Uses of Carbonates,NAICS_2012_Code,32,,,EPA_GHGI_T_2_1 +EPA_GHGI,Other Process Uses of Carbonates,NAICS_2012_Code,33,,,EPA_GHGI_T_2_1 +EPA_GHGI,Lead Production,NAICS_2012_Code,331410,,"331410, 331490",EPA_GHGI_T_2_1 +EPA_GHGI,Lead Production,NAICS_2012_Code,33149,,,EPA_GHGI_T_2_1 +EPA_GHGI,Coal Mining,NAICS_2012_Code,2121,,212100,EPA_GHGI_T_2_1 +EPA_GHGI,Wastewater Treatment,NAICS_2012_Code,2213,,221300,EPA_GHGI_T_2_1 +EPA_GHGI,Abandoned Oil and Gas Wells,NAICS_2012_Code,211,,211000,EPA_GHGI_T_2_1 +EPA_GHGI,Abandoned Underground Coal Mines,NAICS_2012_Code,2121,,212100,EPA_GHGI_T_2_1 +EPA_GHGI,Composting,NAICS_2012_Code,562,,562000,EPA_GHGI_T_2_1 +EPA_GHGI,Nitric Acid Production,NAICS_2012_Code,32531,,325310,EPA_GHGI_T_2_1 +EPA_GHGI,Adipic Acid Production,NAICS_2012_Code,32519,,325190,EPA_GHGI_T_2_1 +EPA_GHGI,N2O from Product Uses,NAICS_2012_Code,621,,"621, 622, 623",EPA_GHGI_T_2_1 +EPA_GHGI,N2O from Product Uses,NAICS_2012_Code,622,,,EPA_GHGI_T_2_1 +EPA_GHGI,N2O from Product Uses,NAICS_2012_Code,623,,,EPA_GHGI_T_2_1 +EPA_GHGI,"Caprolactam, Glyoxal, and Glyoxylic Acid Production",NAICS_2012_Code,32519,,325190,EPA_GHGI_T_2_1 +EPA_GHGI,Electronics Industry,NAICS_2012_Code,334413,,"334413, name change from Semiconductor Manufacture",EPA_GHGI_T_2_1 +EPA_GHGI,Electrical Transmission and Distribution,NAICS_2012_Code,2211,,221100,EPA_GHGI_T_2_1 +EPA_GHGI,Electric Power,NAICS_2012_Code,2211,,"Commodity: 221100 (or I: 221100, S00101, S00202)",EPA_GHGI_T_2_1 +EPA_GHGI,Electric Power,NAICS_2012_Code,S00101,,,EPA_GHGI_T_2_1 +EPA_GHGI,Electric Power,NAICS_2012_Code,S00202,,,EPA_GHGI_T_2_1 +EPA_GHGI,Liming,NAICS_2012_Code,111,,"111, 112",EPA_GHGI_T_2_1 +EPA_GHGI,Liming,NAICS_2012_Code,112,,,EPA_GHGI_T_2_1 +EPA_GHGI,Urea Fertilization,NAICS_2012_Code,111,,"111, 112",EPA_GHGI_T_2_1 +EPA_GHGI,Urea Fertilization,NAICS_2012_Code,112,,,EPA_GHGI_T_2_1 +EPA_GHGI,Rice Cultivation,NAICS_2012_Code,11116,,1111B0,EPA_GHGI_T_2_1 +EPA_GHGI,Anaerobic Digestion at Biogas Facilities,NAICS_2012_Code,562,,new in GHGI since 2018,EPA_GHGI_T_2_1 +EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,111,,"111, 112, 113, 114","EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,112,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,113,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,114,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,485,,"485000, 486000, 48A000, 492000","EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,486,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,487,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,488,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,492,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Construction/Mining Equipment Non-Road,NAICS_2012_Code,211,,"211000, 212100, 2122A0, 212230, 212310, 2123AO, 213111","EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Construction/Mining Equipment Non-Road,NAICS_2012_Code,212,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Construction/Mining Equipment Non-Road,NAICS_2012_Code,213111,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,484,,484000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,485,,"485000, 48A000, 492000, 532100, 532400, 621900, 713900, 811100, 811300","EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,487,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,488,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,492,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,5321,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,5324,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,6219,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,7139,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,8111,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,8113,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Passenger Cars Gasoline On-Road,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Aircraft Non-Road,NAICS_2012_Code,481,,481000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Rail Non-Road,NAICS_2012_Code,482,,482000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Ships and Boats Non-Road,NAICS_2012_Code,483,,483000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Exploration,NAICS_2012_Code,211111,,211000,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42, EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" +EPA_GHGI,Production,NAICS_2012_Code,211111,,211000,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42, EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" +EPA_GHGI,Crude Oil Transportation,NAICS_2012_Code,486110,,not mapped,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42" +EPA_GHGI,Refining,NAICS_2012_Code,324110,,324110,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42" +EPA_GHGI,Distribution,NAICS_2012_Code,221210,,221200,"EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" +EPA_GHGI,Processing,NAICS_2012_Code,211111,,211000,"EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" +EPA_GHGI,Transmission and Storage,NAICS_2012_Code,486210,,486000,"EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" +EPA_GHGI,Chickpeas,NAICS_2012_Code,11113,,1111B0,EPA_GHGI_T_5_29 +EPA_GHGI,Cotton,NAICS_2012_Code,11192,,111900,EPA_GHGI_T_5_29 +EPA_GHGI,Maize,NAICS_2012_Code,11115,,1111B0,EPA_GHGI_T_5_29 +EPA_GHGI,Rice,NAICS_2012_Code,11116,,1111B0,EPA_GHGI_T_5_29 +EPA_GHGI,Soybeans,NAICS_2012_Code,11111,,1111A0,EPA_GHGI_T_5_29 +EPA_GHGI,Wheat,NAICS_2012_Code,11114,,1111B0,EPA_GHGI_T_5_29 +EPA_GHGI,American Bison,NAICS_2012_Code,11299,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Beef Cattle,NAICS_2012_Code,11211,,1121A0,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Dairy Cattle,NAICS_2012_Code,11212,,112120,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Goats,NAICS_2012_Code,11242,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Horses,NAICS_2012_Code,11292,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Mules and Asses,NAICS_2012_Code,11292,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Sheep,NAICS_2012_Code,11241,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Swine,NAICS_2012_Code,1122,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Poultry,NAICS_2012_Code,1123,,112300,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Acrylonitrile,NAICS_2012_Code,325199,,325411 (incorrect in original?),EPA_GHGI_T_4_46 +EPA_GHGI,Carbon Black,NAICS_2012_Code,325180,,3252A0 (incorrect in original?),EPA_GHGI_T_4_46 +EPA_GHGI,Ethylene,NAICS_2012_Code,324110,,324110,EPA_GHGI_T_4_46 +EPA_GHGI,Ethylene Dichloride,NAICS_2012_Code,325120,,not mapped,EPA_GHGI_T_4_46 +EPA_GHGI,Ethylene Oxide,NAICS_2012_Code,325199,,325411 (incorrect in original?),EPA_GHGI_T_4_46 +EPA_GHGI,Methanol,NAICS_2012_Code,325199,,325411 (incorrect in original?),EPA_GHGI_T_4_46 +EPA_GHGI,Industry Industrial Coking Coal,NAICS_2012_Code,212210,,2122A0 (incorrect in original?),EPA_GHGI_T_3_22 +EPA_GHGI,Industry Industrial Other Coal,NAICS_2012_Code,212210,,2122A0 (incorrect in original?),EPA_GHGI_T_3_22 +EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_3_22 +EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_3_22 +EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry LPG,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_3_22 +EPA_GHGI,Industry LPG,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry LPG,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry LPG,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry LPG,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry LPG,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry LPG,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Lubricants,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Lubricants,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Lubricants,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Lubricants,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Lubricants,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Lubricants,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Lubricants,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Still Gas,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Still Gas,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Still Gas,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Still Gas,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Still Gas,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Still Gas,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Still Gas,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Waxes,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Waxes,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Waxes,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Waxes,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Waxes,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Waxes,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Waxes,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Natural Gas to Chemical Plants,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Natural Gas to Chemical Plants,NAICS_2012_Code,32,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Natural Gas to Chemical Plants,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,48,,"48, 491, 492, S00500, S00600, GSLGO, S00201, S00203, F01000",EPA_GHGI_T_3_22 +EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,491,,,EPA_GHGI_T_3_22 +EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,492,,,EPA_GHGI_T_3_22 +EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,92,,,EPA_GHGI_T_3_22 +EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,F01000,,,EPA_GHGI_T_3_22 +EPA_GHGI,Coal Electric Power,NAICS_2012_Code,2211,,"Commodity: 221100 (or I: 221100, S00101, S00202)","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Electric Power,NAICS_2012_Code,2211,,"Commodity: 221100 (or I: 221100, S00101, S00202)","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Electric Power,NAICS_2012_Code,2211,,"Commodity: 221100 (or I: 221100, S00101, S00202)",EPA_GHGI_T_3_8 +EPA_GHGI,Natural Gas Electric Power,NAICS_2012_Code,2211,,,EPA_GHGI_T_3_9 +EPA_GHGI,Wood Electric Power,NAICS_2012_Code,2211,,"Commodity: 221100 (or I: 221100, S00101, S00202)","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Electric Power,NAICS_2012_Code,S00101,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Electric Power,NAICS_2012_Code,S00101,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Electric Power,NAICS_2012_Code,S00101,,,EPA_GHGI_T_3_8 +EPA_GHGI,Natural Gas Electric Power,NAICS_2012_Code,S00101,,,EPA_GHGI_T_3_9 +EPA_GHGI,Wood Electric Power,NAICS_2012_Code,S00101,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Electric Power,NAICS_2012_Code,S00202,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Electric Power,NAICS_2012_Code,S00202,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Electric Power,NAICS_2012_Code,S00202,,,EPA_GHGI_T_3_8 +EPA_GHGI,Natural Gas Electric Power,NAICS_2012_Code,S00202,,,EPA_GHGI_T_3_9 +EPA_GHGI,Wood Electric Power,NAICS_2012_Code,S00202,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Residential,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural Gas Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23, 31, 32, 33","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Industrial,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Industrial - Manufacturing,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Industrial - Manufacturing,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Industrial - Manufacturing,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Industrial,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Industrial,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Industrial,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Industrial,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,2213,,"2213, 42, 44, 45, 493, 5, 6, 7, 8, S00102, GSLGE, GSLGH","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,493,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,2213,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,493,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,2213,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,493,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,2213,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,493,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Drained Organic Soils Cropland,NAICS_2012_Code,1111,,"111, excl. 1114",EPA_GHGI_T_5_18 +EPA_GHGI,Drained Organic Soils Cropland,NAICS_2012_Code,1112,,,EPA_GHGI_T_5_18 +EPA_GHGI,Drained Organic Soils Cropland,NAICS_2012_Code,1113,,,EPA_GHGI_T_5_18 +EPA_GHGI,Drained Organic Soils Cropland,NAICS_2012_Code,1119,,,EPA_GHGI_T_5_18 +EPA_GHGI,Mineralization and Asymbiotic Fixation Cropland,NAICS_2012_Code,1111,,"111, excl. 1114",EPA_GHGI_T_5_18 +EPA_GHGI,Mineralization and Asymbiotic Fixation Cropland,NAICS_2012_Code,1112,,,EPA_GHGI_T_5_18 +EPA_GHGI,Mineralization and Asymbiotic Fixation Cropland,NAICS_2012_Code,1113,,,EPA_GHGI_T_5_18 +EPA_GHGI,Mineralization and Asymbiotic Fixation Cropland,NAICS_2012_Code,1119,,,EPA_GHGI_T_5_18 +EPA_GHGI,Organic Amendment Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_18 +EPA_GHGI,Residue N Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_18 +EPA_GHGI,Synthetic Fertilizer Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_18 +EPA_GHGI,All activities Grassland,NAICS_2012_Code,112,,112,"EPA_GHGI_T_5_18, EPA_GHGI_T_5_19" +EPA_GHGI,Volatilization & Atm. Deposition Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_19 +EPA_GHGI,Surface Leaching & Run-Off Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_19 +EPA_GHGI,Natural Gas Transportation,NAICS_2012_Code,48,,"48, 491, 492, S00500, S00600, GSLGO, S00201, S00203, F01000",EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 +EPA_GHGI,Aviation Gasoline Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 +EPA_GHGI,Aviation Gasoline Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 +EPA_GHGI,Aviation Gasoline Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 +EPA_GHGI,Aviation Gasoline Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 +EPA_GHGI,Aviation Gasoline Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 +EPA_GHGI,Jet Fuel Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 +EPA_GHGI,Jet Fuel Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 +EPA_GHGI,Jet Fuel Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 +EPA_GHGI,Jet Fuel Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 +EPA_GHGI,Jet Fuel Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 +EPA_GHGI,LPG (Propane) Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 +EPA_GHGI,LPG (Propane) Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 +EPA_GHGI,LPG (Propane) Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 +EPA_GHGI,LPG (Propane) Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 +EPA_GHGI,LPG (Propane) Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 +EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 +EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 +EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 +EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 +EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 +EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23",EPA_GHGI_T_A_14 +EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,21,,,EPA_GHGI_T_A_14 +EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,2212,,,EPA_GHGI_T_A_14 +EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,23,,,EPA_GHGI_T_A_14 +EPA_GHGI,Industrial Other Coal Industrial - Manufacturing,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_A_14 +EPA_GHGI,Industrial Other Coal Industrial - Manufacturing,NAICS_2012_Code,32,,,EPA_GHGI_T_A_14 +EPA_GHGI,Industrial Other Coal Industrial - Manufacturing,NAICS_2012_Code,33,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23",EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,21,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,2212,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,23,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Industrial - Manufacturing,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Industrial - Manufacturing,NAICS_2012_Code,32,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Industrial - Manufacturing,NAICS_2012_Code,33,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23, 31, 32, 33",EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,21,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,2212,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,23,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,31,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,32,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,33,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,2213,,"2213, 42, 44, 45, 493, 5, 6, 7, 8, S00102, GSLGE, GSLGH",EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,42,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,44,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,45,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,493,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,51,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,52,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,53,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,54,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,55,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,56,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,61,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,62,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,71,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,72,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,81,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,2213,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,42,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,44,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,45,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,493,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,51,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,52,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,53,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,54,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,55,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,56,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,61,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,62,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,71,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,72,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,81,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,2213,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,42,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,44,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,45,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,493,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,51,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,52,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,53,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,54,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,55,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,56,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,61,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,62,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,71,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,72,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,81,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total (All Fuels) Residential,NAICS_2012_Code,F01000,,F0100,EPA_GHGI_T_A_14 +EPA_GHGI,HCFC-22 Production,NAICS_2012_Code,325120,,325120,EPA_GHGI_T_4_50 +EPA_GHGI,Electronics Production,NAICS_2012_Code,334413,,334413,EPA_GHGI_T_4_94 +EPA_GHGI,Magnesium Production and Processing,NAICS_2012_Code,331410,,"331410, 331490, 331520",EPA_GHGI_T_4_84 +EPA_GHGI,Magnesium Production and Processing,NAICS_2012_Code,33149,,,EPA_GHGI_T_4_84 +EPA_GHGI,Magnesium Production and Processing,NAICS_2012_Code,33152,,,EPA_GHGI_T_4_84 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,11,,"All sectors, excluding transport",EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,21,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,22,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,23,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,31,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,32,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,33,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,42,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,44,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,45,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,49,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,51,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,52,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,53,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,54,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,55,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,56,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,61,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,62,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,71,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,72,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,81,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,92,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,F01000,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning - Households,NAICS_2012_Code,F01000,,Exclusive household portion,EPA_GHGI_T_4_101 +EPA_GHGI,Aerosols,,,,excluded,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,11,,All sectors,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,21,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,22,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,23,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,31,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,32,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,33,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,42,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,44,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,45,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,48,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,49,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,51,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,52,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,53,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,54,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,55,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,56,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,61,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,62,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,71,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,72,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,81,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,92,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,F01000,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,11,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,21,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,22,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,23,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,31,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,32,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,33,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,42,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,44,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,45,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,48,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,49,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,51,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,52,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,53,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,54,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,55,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,56,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,61,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,62,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,71,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,72,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,81,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,92,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,F01000,,,EPA_GHGI_T_4_101 +EPA_GHGI,Solvents,,,,excluded,EPA_GHGI_T_4_101 +EPA_GHGI,Fire Protection,,,,excluded,EPA_GHGI_T_4_101 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,484,,484000,EPA_GHGI_T_A_103 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_A_103, EPA_GHGI_T_A_79" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,484,,484000,"EPA_GHGI_T_A_103, EPA_GHGI_T_A_79" +EPA_GHGI,Passenger Cars,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_A_103, EPA_GHGI_T_A_79" +EPA_GHGI,Rail,NAICS_2012_Code,482,,482000,"EPA_GHGI_T_A_103, EPA_GHGI_T_A_79" +EPA_GHGI,School and Tour Buses,NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_103 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,483,,483000,EPA_GHGI_T_A_103 +EPA_GHGI,Transit Buses,,,,excluded,EPA_GHGI_T_A_103 +EPA_GHGI,Buses,NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_79 +EPA_GHGI,Buses - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_79 +EPA_GHGI,Buses - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,487,,48A000,EPA_GHGI_T_A_79 +EPA_GHGI,Buses - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,488,,,EPA_GHGI_T_A_79 +EPA_GHGI,Buses - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,S00201,,S00201,EPA_GHGI_T_A_79 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,481,,481000,EPA_GHGI_T_A_79 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,481,,481000,EPA_GHGI_T_A_79 +EPA_GHGI,Military Aircraft,NAICS_2012_Code,928110,,S00500,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks - Gasoline,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks - Gasoline,NAICS_2012_Code,492,,492000,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,484,,484000,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,92212,,S00203,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,92214,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,92216,,,EPA_GHGI_T_A_79 +EPA_GHGI,Motorcycles,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 +EPA_GHGI,Passenger Cars - Gasoline,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 +EPA_GHGI,Passenger Cars - Gasoline,NAICS_2012_Code,92,,S00600,EPA_GHGI_T_A_79 +EPA_GHGI,Passenger Cars - Gasoline,NAICS_2012_Code,491,,491000,EPA_GHGI_T_A_79 +EPA_GHGI,Passenger Cars - Gasoline,NAICS_2012_Code,92,,GSLGO,EPA_GHGI_T_A_79 +EPA_GHGI,Pipelines,NAICS_2012_Code,486,,486000,EPA_GHGI_T_A_79 +EPA_GHGI,Recreational Boats,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,4831,,483000,EPA_GHGI_T_A_79 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,4832,,4-digit to avoid data loss in BLS_QCEW,EPA_GHGI_T_A_79 +EPA_GHGI,Ships and Non-Recreational Boats,NAICS_2012_Code,483,,483000,EPA_GHGI_T_A_79 \ No newline at end of file diff --git a/flowsa/flowby.py b/flowsa/flowby.py index f7e92a868..5dfdde266 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -23,6 +23,8 @@ def __init__( *args, source_name: str = None, source_config: dict = None, + activity_set: str = None, + activity_config: dict = None, fields: dict = None, column_order: List[str] = None, string_null: 'np.nan' or None = np.nan, @@ -31,11 +33,12 @@ def __init__( for attribute in self._metadata: if not hasattr(self, attribute): if hasattr(data, attribute): - print(getattr(data, attribute)) super().__setattr__(attribute, getattr(data, attribute)) else: self.source_name = source_name or '' self.source_config = source_config or {} + self.activity_set = activity_set or '' + self.activity_config = activity_config or {} if isinstance(data, pd.DataFrame) and fields is not None: fill_na_dict = { field: 0 if dtype in ['int', 'float'] else string_null @@ -59,7 +62,8 @@ def __init__( + [c for c in data.columns if c not in column_order]] super().__init__(data, *args, **kwargs) - _metadata = ['source_name', 'source_config'] + _metadata = ['source_name', 'source_config', + 'activity_set', 'activity_config'] @property def _constructor(self) -> '_FlowBy': @@ -673,7 +677,107 @@ def convert_to_geoscale( .aggregate_flowby() ) - return fba_at_target_geoscale + return ( + fba_at_target_geoscale + .astype({c: t for c, t + in flowby_config['fba_mapped_w_sector_fields'].items() + if c in fba_at_target_geoscale.columns}) + # ^^^ Need to convert back to correct dtypes after aggregating; + # otherwise, columns of NaN will become float dtype. + ) + + def map_to_sectors( + self: 'FlowByActivity', + sector_level: Literal['aggregated', 'disaggregated'] = None, + sector_source_name: str = common.SECTOR_SOURCE_NAME, + activity_to_sector_mapping: str = None, + external_config_path: str = None + ) -> 'FlowByActivity': + ''' + Maps the activities in the calling dataframe to sectors, but does + not yet perform any attribution. This method relies on the + source_config and activity_config attributes (dictionaries) of the + calling FBA. + + :param sector_level: str, one of 'aggregated' or 'disaggregated'. + If not provided, will be inferred from the calling FBA. + :param sector_source_name: str, which NAICS list to use. + :param activity_to_sector_mapping: str, which crosswalk from activities + to NAICS codes to use. + :param external_config_path: str, an external path to search for a + crosswalk. + ''' + sector_level = ( + sector_level + or ('disaggregated' + if self.activity_config.get('allocationmethod') == 'direct' + else False) + or self.source_config['sector_aggregation_level'] + ) + if self.source_config['sector-like_activities']: + crosswalk = ( + pd.read_csv( + f'{settings.datapath}NAICS_Crosswalk_TimeSeries.csv', + dtype='object') + [[common.SECTOR_SOURCE_NAME]] + # ^^^ TODO: Figure out how this interacts with the replace_ + # naics_w_naics_...() function below. There may be a better + # way to do this. + .drop_duplicates() + .rename(columns={common.SECTOR_SOURCE_NAME: 'Sector'}) + .assign(Activity=lambda x: x.Sector, + ActivitySourceName=self.source_name, + SectorType=np.nan) + .reset_index(drop=True)) + else: + crosswalk = ( + sectormapping.get_activitytosector_mapping( + # ^^^ TODO: Replace or streamline get_...() function + (activity_to_sector_mapping + or self.source_config.get('activity_to_sector_mapping') + or self.source_name), + fbsconfigpath=external_config_path) + .query('SectorSourceName == @sector_source_name') + .drop(columns='SectorSourceName') + .reset_index(drop=True) + ) + + if sector_level == 'aggregated': + crosswalk = sectormapping.expand_naics_list(crosswalk, + sector_source_name) + # ^^^ TODO: Replace or streamline expand_...(). I believe it does + # nothing when applied to the crosswalk resulting from + # 'sector-like_activities', above, except possibly when + # sector_source_name != common.SECTOR_SOURCE_NAME. + + for direction in ['ProducedBy', 'ConsumedBy']: + temp_crosswalk = ( + crosswalk + .rename(columns={ + 'Activity': f'Activity{direction}', + 'Sector': f'Sector{direction}', + 'SectorType': f'{direction}SectorType' + }) + .drop(columns='ActivitySourceName', errors='ignore') + .astype('object') + ) + self = self.merge(temp_crosswalk, + how='left', on=f'Activity{direction}') + # ^^^ Critical this is a left merge + fba_w_sector = ( + self + .assign(SectorSourceName=sector_source_name) + # ^^^ TODO: 99% sure this could be assigned if + # sector-like_activities and not dropped else, above. + .conditional_pipe( + self.source_config['sector-like_activities'], + validation.replace_naics_w_naics_from_another_year, + # ^^^ TODO: Replace or streamline with other validation fxns + sector_source_name + ) + ) + + return fba_w_sector class FlowBySector(_FlowBy): @@ -870,6 +974,10 @@ def generateFlowBySector( .reset_index(drop=True) ) + assert isinstance(activity_set_fba, FlowByActivity) + activity_set_fba.activity_set = activity_set + activity_set_fba.activity_config = activity_config + if activity_set_fba.empty: log.error('No data for flows in %s', activity_set) continue @@ -903,13 +1011,31 @@ def generateFlowBySector( activity_config, activity_set, names + # ^^^ TODO: Rewrite validation to use fb metadata ) + activity_set_fba_w_sectors = ( + activity_set_fba + .map_to_sectors( + sector_source_name=method_config[ + 'target_sector_source'], + external_config_path=external_config_path + ) + .conditional_pipe( + 'clean_fba_w_sec_df-fxn' in source_config, + source_config.get('clean_fba_w_sec_df_fxn'), + attr=activity_config, + method=method_config + ) + .rename(columns={'SourceName': 'MetaSources'}) + .drop(columns=['FlowName', 'Compartment']) + ) + completed_names.extend(names) log.info('Appending %s from %s to FBS list', activity_set, source_name) - component_fbs_list.append(activity_set_fba) + component_fbs_list.append(activity_set_fba_w_sectors) return component_fbs_list From 2fa42b3a0d84a5d9d12bb79635b33d6f74f95738 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 24 May 2022 11:33:36 -0400 Subject: [PATCH 0049/1127] updating _FB.init. In process, but works. --- flowsa/flowby.py | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 5dfdde266..1e0496d2f 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1,4 +1,4 @@ -from typing import Callable, List, Optional, Union, Literal, TypeVar +from typing import get_type_hints, Callable, List, Literal, TypeVar import pandas as pd import numpy as np from functools import partial, reduce @@ -17,6 +17,14 @@ class _FlowBy(pd.DataFrame): + _metadata = ['source_name', 'source_config', + 'activity_set', 'activity_config'] + + source_name: str + source_config: dict + activity_set: str + activity_config: dict + def __init__( self, data: pd.DataFrame or '_FlowBy' = None, @@ -35,10 +43,15 @@ def __init__( if hasattr(data, attribute): super().__setattr__(attribute, getattr(data, attribute)) else: - self.source_name = source_name or '' - self.source_config = source_config or {} - self.activity_set = activity_set or '' - self.activity_config = activity_config or {} + super().__setattr__( + attribute, + locals().pop(attribute, False) or + self.__annotations__[attribute]() + ) + # self.source_name = source_name or '' + # self.source_config = source_config or {} + # self.activity_set = activity_set or '' + # self.activity_config = activity_config or {} if isinstance(data, pd.DataFrame) and fields is not None: fill_na_dict = { field: 0 if dtype in ['int', 'float'] else string_null @@ -62,9 +75,6 @@ def __init__( + [c for c in data.columns if c not in column_order]] super().__init__(data, *args, **kwargs) - _metadata = ['source_name', 'source_config', - 'activity_set', 'activity_config'] - @property def _constructor(self) -> '_FlowBy': return _FlowBy From 4e0b5416643a877603f7554a070c3b32b97cd221 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 24 May 2022 11:57:34 -0400 Subject: [PATCH 0050/1127] _FB.init updated to handle metadata better --- flowsa/flowby.py | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 1e0496d2f..551d9b89c 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -29,29 +29,24 @@ def __init__( self, data: pd.DataFrame or '_FlowBy' = None, *args, - source_name: str = None, - source_config: dict = None, - activity_set: str = None, - activity_config: dict = None, fields: dict = None, column_order: List[str] = None, string_null: 'np.nan' or None = np.nan, **kwargs ) -> None: + # Assign values to metadata attributes, checking the following sources, + # in order: self, data, kwargs; then defaulting to an empty version of + # the type specified in the type hints, or None. for attribute in self._metadata: if not hasattr(self, attribute): - if hasattr(data, attribute): - super().__setattr__(attribute, getattr(data, attribute)) - else: - super().__setattr__( - attribute, - locals().pop(attribute, False) or - self.__annotations__[attribute]() - ) - # self.source_name = source_name or '' - # self.source_config = source_config or {} - # self.activity_set = activity_set or '' - # self.activity_config = activity_config or {} + super().__setattr__( + attribute, + getattr(data, attribute, + kwargs.pop(attribute, + self.__annotations__.get(attribute, + None)())) + ) + if isinstance(data, pd.DataFrame) and fields is not None: fill_na_dict = { field: 0 if dtype in ['int', 'float'] else string_null @@ -389,6 +384,8 @@ def aggregate_flowby( class FlowByActivity(_FlowBy): + _metadata = [*_FlowBy()._metadata] + def __init__( self, data: pd.DataFrame or '_FlowBy' = None, @@ -424,8 +421,6 @@ def __init__( column_order=column_order, *args, **kwargs) - _metadata = [*_FlowBy()._metadata] - @property def _constructor(self) -> 'FlowByActivity': return FlowByActivity @@ -791,6 +786,8 @@ def map_to_sectors( class FlowBySector(_FlowBy): + _metadata = [*_FlowBy()._metadata] + def __init__( self, data: pd.DataFrame or '_FlowBy' = None, @@ -824,8 +821,6 @@ def __init__( column_order=column_order, *args, **kwargs) - _metadata = [*_FlowBy()._metadata] - @property def _constructor(self) -> 'FlowBySector': return FlowBySector From 6da31801e7cf0bfff76781495b9b095fef1940ef Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 24 May 2022 12:59:56 -0400 Subject: [PATCH 0051/1127] replaced completed_activities list --- flowsa/flowby.py | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 551d9b89c..f9b21fe8d 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -957,7 +957,6 @@ def generateFlowBySector( source_config.get('clean_fba_df_fxn'))) activities = source_config['activity_sets'] - completed_names = [] for activity_set, activity_config in activities.items(): log.info('Preparing to process %s in %s', @@ -967,8 +966,6 @@ def generateFlowBySector( activity_set_fba = ( fba - .query('ActivityProducedBy not in @completed_names' - '& ActivityConsumedBy not in @completed_names') .query('ActivityProducedBy in @names' '| ActivityConsumedBy in @names') .conditional_method( @@ -979,7 +976,6 @@ def generateFlowBySector( .reset_index(drop=True) ) - assert isinstance(activity_set_fba, FlowByActivity) activity_set_fba.activity_set = activity_set activity_set_fba.activity_config = activity_config @@ -1004,18 +1000,8 @@ def generateFlowBySector( if activity_config['allocation_from_scale'] != 'national': validation.compare_geographic_totals( - activity_set_fba, - fba.query( - 'ActivityProducedBy not in @completed_names' - '& ActivityConsumedBy not in @completed_names' - ), - # ^^^ Not sure if this is really the spot this - # data set for comparison needs to come from, - # but it matches what's used in flowbysector.py - source_name, - activity_config, - activity_set, - names + activity_set_fba, fba, source_name, + activity_config, activity_set, names # ^^^ TODO: Rewrite validation to use fb metadata ) @@ -1036,7 +1022,8 @@ def generateFlowBySector( .drop(columns=['FlowName', 'Compartment']) ) - completed_names.extend(names) + fba = fba.query('ActivityProducedBy not in @names' + '& ActivityConsumedBy not in @names') log.info('Appending %s from %s to FBS list', activity_set, source_name) From b7e7d465db709d68286e09d0280507f7c9794f09 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 25 May 2022 16:24:50 -0400 Subject: [PATCH 0052/1127] Fixed map_to_sectors --- flowsa/flowby.py | 69 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 48 insertions(+), 21 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index f9b21fe8d..2b8c58028 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -4,11 +4,12 @@ from functools import partial, reduce from . import (common, settings, location, dataclean, metadata, sectormapping, literature_values, flowbyactivity, flowbysector, flowsa_yaml, - validation, geo) + validation, geo, fbs_allocation) from .flowsa_log import log, vlog import esupy.processed_data_mgmt import esupy.dqi import fedelemflowlist +import seea_scratch as scratch FB = TypeVar('FB', bound='_FlowBy') @@ -693,7 +694,7 @@ def convert_to_geoscale( def map_to_sectors( self: 'FlowByActivity', - sector_level: Literal['aggregated', 'disaggregated'] = None, + aggregation_status: Literal['aggregated', 'disaggregated'] = None, sector_source_name: str = common.SECTOR_SOURCE_NAME, activity_to_sector_mapping: str = None, external_config_path: str = None @@ -712,13 +713,6 @@ def map_to_sectors( :param external_config_path: str, an external path to search for a crosswalk. ''' - sector_level = ( - sector_level - or ('disaggregated' - if self.activity_config.get('allocationmethod') == 'direct' - else False) - or self.source_config['sector_aggregation_level'] - ) if self.source_config['sector-like_activities']: crosswalk = ( pd.read_csv( @@ -747,7 +741,10 @@ def map_to_sectors( .reset_index(drop=True) ) - if sector_level == 'aggregated': + if (aggregation_status == 'aggregated' + or (self.source_config['sector_aggregation_level'] == 'aggregated' + and self.activity_config.get( + 'allocation_method') != 'direct')): crosswalk = sectormapping.expand_naics_list(crosswalk, sector_source_name) # ^^^ TODO: Replace or streamline expand_...(). I believe it does @@ -892,7 +889,7 @@ def generateFlowBySector( sources = method_config['source_names'] source_catalog = common.load_yaml_dict('source_catalog') - component_fbs_list = [] + source_fbs_list = [] for source_name, source_config in sources.items(): source_config.update( {k: v for k, v in source_catalog.get( @@ -933,7 +930,7 @@ def generateFlowBySector( 'replace', {'Flowable': source_flows})) log.info('Appending %s to FBS list', source_name) - component_fbs_list.append(fbs) + source_fbs_list.append(fbs) if source_config['data_format'] == 'FBA': source_data = FlowByActivity.getFlowByActivity( @@ -962,12 +959,12 @@ def generateFlowBySector( log.info('Preparing to process %s in %s', activity_set, source_name) - names = activity_config['names'] + activity_names = activity_config['names'] activity_set_fba = ( fba - .query('ActivityProducedBy in @names' - '| ActivityConsumedBy in @names') + .query('ActivityProducedBy in @activity_names' + '| ActivityConsumedBy in @activity_names') .conditional_method( 'source_flows' in activity_config, 'query', @@ -1001,11 +998,11 @@ def generateFlowBySector( if activity_config['allocation_from_scale'] != 'national': validation.compare_geographic_totals( activity_set_fba, fba, source_name, - activity_config, activity_set, names + activity_config, activity_set, activity_names # ^^^ TODO: Rewrite validation to use fb metadata ) - activity_set_fba_w_sectors = ( + activity_set_fba = ( activity_set_fba .map_to_sectors( sector_source_name=method_config[ @@ -1022,14 +1019,44 @@ def generateFlowBySector( .drop(columns=['FlowName', 'Compartment']) ) - fba = fba.query('ActivityProducedBy not in @names' - '& ActivityConsumedBy not in @names') + assert isinstance(activity_set_fba, FlowByActivity) + + if activity_config['allocation_method'] == 'direct': + log.info('Attributing flows in %s using direct ' + 'attribution method', activity_set) + fbs = fbs_allocation.direct_allocation_method( + activity_set_fba, + source_name, + activity_names, + method_config + ) + # activity_fbs_list = [] + # for name in activity_names: + # log.info('Attributing to %s', name) + # activity_fbs = ( + # activity_set_fba + # .query('ActivityProducedBy == @name' + # '| ActivityConsumedBy == @name') + # .reset_index(drop=True) + # ) + + # elif (activity_config['allocation_method'] + # == 'allocation_function'): + # pass + # elif (activity_config['allocation_method'] + # == 'proportional'): + # pass + + fba = fba.query( + 'ActivityProducedBy not in @activity_names' + '& ActivityConsumedBy not in @activity_names' + ) log.info('Appending %s from %s to FBS list', activity_set, source_name) - component_fbs_list.append(activity_set_fba_w_sectors) + source_fbs_list.append(fbs) - return component_fbs_list + return source_fbs_list # The three classes extending pd.Series, together with the _constructor... From d712bae0c3674e607e5471bd2e9b78f26725533c Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 26 May 2022 14:20:07 -0400 Subject: [PATCH 0053/1127] Added industries.py, with fxn to make naics key --- flowsa/industries.py | 104 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 flowsa/industries.py diff --git a/flowsa/industries.py b/flowsa/industries.py new file mode 100644 index 000000000..51e0ef554 --- /dev/null +++ b/flowsa/industries.py @@ -0,0 +1,104 @@ +from typing import Literal +import pandas as pd +from .settings import datapath + +naics_crosswalk = pd.read_csv(f'{datapath}NAICS_Crosswalk_TimeSeries.csv', + dtype='object') + + +def naics_key_from_industry_spec( + industry_spec: dict, + year: Literal[2002, 2007, 2012, 2017] = 2012 +) -> pd.DataFrame: + ''' + Provides a key for mapping any set of NAICS codes to a given industry + breakdown, specified in industry_spec. The key is a DataFrame with columns + 'source_naics' and 'target_naics'; it is 1-to-many for any NAICS codes + shorter than the relevant level given in industry-spec, and many-to-1 for + any NAICS codes longer than the relevant level. + + The industry_spec is a (possibly nested) dictionary formatted as in this + example: + + industry_spec = {'default': 'NAICS_3', + '112': {'default': 'NAICS_4', + '1129': {'default': 'NAICS_6'}}, + '113': {'default': 'NAICS_4'}} + + This example specification would map any set of NAICS codes to the 3-digit + level, except that codes in 112 and 113 would be mapped to the 4-digit + level, with codes in 1129 being mapped to the 6 digits level. + + Some important points in formatting an industry specification: + 1. Every dictionary in the spec must have a 'default' key, whose value is + used for any relevant codes not specifically named in the dictionary. + 2. Each non-default key in a dictionary must be at the length given + by the default value for the dictionary (so if 'default': 'NAICS_3', + then any non-default keys must be NAICS codes with exactly 3 digits). + 3. Each dictionary is applied only to those codes matching its parent + key (with the root dictionary being applied to all codes). + ''' + naics_list = (naics_crosswalk + [[f'NAICS_{year}_Code']] + .rename(columns={f'NAICS_{year}_Code': 'source_naics'})) + + # Find target NAICS by truncating any source_naics longer than the target + # _naics_level unless industry_spec specifies a longer level for it, in + # which case send it (recursively) into this function to be truncated to + # the correct length. + def _truncate( + _naics_list: pd.DataFrame, + _industry_spec: dict + ) -> pd.DataFrame: + _naics_level = int(_industry_spec['default'][-1:]) + return pd.concat([ + (_naics_list + .query('source_naics.str.len() >= @_naics_level' + '& source_naics.str.slice(stop=@_naics_level) ' + 'not in @_industry_spec') + .assign(target_naics=lambda x: x.source_naics.str[:_naics_level]) + ), + *[ + _truncate( + (_naics_list + .query('source_naics.str.startswith(@naics)')), + _industry_spec[naics] + ) + for naics in _industry_spec if naics != 'default' + ] + ]) + + truncated_naics_list = _truncate(naics_list, industry_spec) + + naics_list = naics_list.merge(truncated_naics_list, how='left') + + naics_key = pd.concat([ + naics_list.query('target_naics.notna()'), + *[ + (naics_list + .query('target_naics.isna()' + '& source_naics.str.len() == @length') + .drop(columns='target_naics') + .merge( + truncated_naics_list + .assign( + merge_key=truncated_naics_list.target_naics.str[:length]) + [['merge_key', 'target_naics']], + how='left', + left_on='source_naics', + right_on='merge_key') + .drop(columns='merge_key') + ) + for length in (naics_list.query('target_naics.isna()') + .source_naics.str.len().unique()) + ] + ]) + + naics_key = ( + naics_key + .drop_duplicates() + .sort_values(by=['source_naics', 'target_naics']) + .reset_index(drop=True) + ) + + return naics_key From fd3b124e6028321d874d9bc98c934585a48a0653 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 26 May 2022 17:54:01 -0400 Subject: [PATCH 0054/1127] Added new map_to_sectors --- flowsa/flowby.py | 163 +++++++++++++++++++++++++------------------ flowsa/industries.py | 7 +- 2 files changed, 99 insertions(+), 71 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 2b8c58028..830806831 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1,10 +1,10 @@ -from typing import get_type_hints, Callable, List, Literal, TypeVar +from typing import Callable, List, Literal, TypeVar import pandas as pd import numpy as np from functools import partial, reduce from . import (common, settings, location, dataclean, metadata, sectormapping, literature_values, flowbyactivity, flowbysector, flowsa_yaml, - validation, geo, fbs_allocation) + validation, geo, industries, fbs_allocation) from .flowsa_log import log, vlog import esupy.processed_data_mgmt import esupy.dqi @@ -694,92 +694,119 @@ def convert_to_geoscale( def map_to_sectors( self: 'FlowByActivity', - aggregation_status: Literal['aggregated', 'disaggregated'] = None, - sector_source_name: str = common.SECTOR_SOURCE_NAME, - activity_to_sector_mapping: str = None, + industry_spec: dict, + target_year: Literal[2002, 2007, 2012, 2017] = None, external_config_path: str = None ) -> 'FlowByActivity': ''' Maps the activities in the calling dataframe to sectors, but does - not yet perform any attribution. This method relies on the + not perform any attribution. This method relies on the source_config and activity_config attributes (dictionaries) of the calling FBA. - :param sector_level: str, one of 'aggregated' or 'disaggregated'. - If not provided, will be inferred from the calling FBA. - :param sector_source_name: str, which NAICS list to use. - :param activity_to_sector_mapping: str, which crosswalk from activities - to NAICS codes to use. + :param industry_spec: dict, formatted as in documentation for + industries.naics_key_from_industry_spec. Gives the desired + industry/sector aggregation level. + :param target_year: int, which NAICS year to use. :param external_config_path: str, an external path to search for a crosswalk. ''' - if self.source_config['sector-like_activities']: - crosswalk = ( - pd.read_csv( - f'{settings.datapath}NAICS_Crosswalk_TimeSeries.csv', - dtype='object') - [[common.SECTOR_SOURCE_NAME]] - # ^^^ TODO: Figure out how this interacts with the replace_ - # naics_w_naics_...() function below. There may be a better - # way to do this. - .drop_duplicates() - .rename(columns={common.SECTOR_SOURCE_NAME: 'Sector'}) - .assign(Activity=lambda x: x.Sector, - ActivitySourceName=self.source_name, - SectorType=np.nan) - .reset_index(drop=True)) - else: - crosswalk = ( + if not self.source_config['sector-like_activities']: + activity_to_source_naics_crosswalk = ( sectormapping.get_activitytosector_mapping( # ^^^ TODO: Replace or streamline get_...() function - (activity_to_sector_mapping - or self.source_config.get('activity_to_sector_mapping') + (self.source_config.get('activity_to_sector_mapping') or self.source_name), fbsconfigpath=external_config_path) - .query('SectorSourceName == @sector_source_name') - .drop(columns='SectorSourceName') - .reset_index(drop=True) + .astype('object') + ) + + source_years = list( + (activity_to_source_naics_crosswalk.SectorSourceName + .str.removeprefix('NAICS_') + .str.removesuffix('_Code') + .astype('int').unique()) + ) + source_year = (2012 if 2012 in source_years + else max(source_years) if source_years + else 2012) + if source_years: + activity_to_source_naics_crosswalk = ( + activity_to_source_naics_crosswalk + .query(f'SectorSourceName == "NAICS_{source_year}_Code"') + .reset_index(drop=True) + ) + else: + log.warning('No NAICS year/sector source name (e.g. ' + '"NAICS_2012_Code") provided in crosswalk for %s', + self.source_name) + + fba_w_source_naics = self + for direction in ['ProducedBy', 'ConsumedBy']: + fba_w_source_naics = ( + fba_w_source_naics + .merge(activity_to_source_naics_crosswalk, + how='left', + left_on=f'Activity{direction}', right_on='Activity') + .rename(columns={'Sector': f'Sector{direction}', + 'SectorType': f'{direction}SectorType'}) + .drop(columns='ActivitySourceName', errors='ignore') + ) + else: + try: + source_year = int(self.source_config + .get('activity_schema')[6:10]) + except ValueError: + source_year = 2012 + + fba_w_source_naics = ( + self + .assign(SectorProducedBy=self.ActivityProducedBy, + SectorConsumedBy=self.ActivityConsumedBy, + ActivitySourceName=self.source_name, + SectorType=np.nan, + SectorSourceName=f'NAICS_{source_year}_Code') ) - if (aggregation_status == 'aggregated' - or (self.source_config['sector_aggregation_level'] == 'aggregated' - and self.activity_config.get( - 'allocation_method') != 'direct')): - crosswalk = sectormapping.expand_naics_list(crosswalk, - sector_source_name) - # ^^^ TODO: Replace or streamline expand_...(). I believe it does - # nothing when applied to the crosswalk resulting from - # 'sector-like_activities', above, except possibly when - # sector_source_name != common.SECTOR_SOURCE_NAME. + if source_year != target_year: + source_naics_year_to_year_crosswalk = ( + pd.read_csv( + f'{settings.datapath}NAICS_Crosswalk_TimeSeries.csv', + dtype='object' + ) + .assign(Sector=lambda x: x[f'NAICS_{source_year}_Code'], + NewSector=lambda x: x[f'NAICS_{target_year}_Code']) + [['Sector', 'NewSector']] + .drop_duplicates() + .reset_index(drop=True) + ) + for direction in ['ProducedBy', 'ConsumedBy']: + fba_w_source_naics = ( + fba_w_source_naics + .merge(source_naics_year_to_year_crosswalk, + how='left', + left_on=f'Sector{direction}', right_on='Sector') + .assign(**{ + f'Sector{direction}': lambda x: x['NewSector'], + 'SectorSourceName': f'NAICS_{target_year}_Code' + }) + .drop(columns='NewSector') + ) + source_naics_to_target_naics_crosswalk = ( + industries.naics_key_from_industry_spec(industry_spec)) + fba_w_target_naics = fba_w_source_naics for direction in ['ProducedBy', 'ConsumedBy']: - temp_crosswalk = ( - crosswalk - .rename(columns={ - 'Activity': f'Activity{direction}', - 'Sector': f'Sector{direction}', - 'SectorType': f'{direction}SectorType' - }) - .drop(columns='ActivitySourceName', errors='ignore') - .astype('object') + fba_w_target_naics = ( + fba_w_target_naics + .merge(source_naics_to_target_naics_crosswalk, + how='left', + left_on=f'Sector{direction}', right_on='source_naics') + .assign(**{f'Sector{direction}': lambda x: x['target_naics']}) + .drop(columns='target_naics') ) - self = self.merge(temp_crosswalk, - how='left', on=f'Activity{direction}') - # ^^^ Critical this is a left merge - fba_w_sector = ( - self - .assign(SectorSourceName=sector_source_name) - # ^^^ TODO: 99% sure this could be assigned if - # sector-like_activities and not dropped else, above. - .conditional_pipe( - self.source_config['sector-like_activities'], - validation.replace_naics_w_naics_from_another_year, - # ^^^ TODO: Replace or streamline with other validation fxns - sector_source_name - ) - ) - return fba_w_sector + return fba_w_target_naics class FlowBySector(_FlowBy): diff --git a/flowsa/industries.py b/flowsa/industries.py index 51e0ef554..bccd4bc83 100644 --- a/flowsa/industries.py +++ b/flowsa/industries.py @@ -1,9 +1,10 @@ from typing import Literal import pandas as pd -from .settings import datapath +from . import settings -naics_crosswalk = pd.read_csv(f'{datapath}NAICS_Crosswalk_TimeSeries.csv', - dtype='object') +naics_crosswalk = pd.read_csv( + f'{settings.datapath}NAICS_Crosswalk_TimeSeries.csv', dtype='object' +) def naics_key_from_industry_spec( From 556922de016b328ef24eb43656301fa6386cfefc Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 27 May 2022 12:30:27 -0400 Subject: [PATCH 0055/1127] Added _truncate docstring --- flowsa/industries.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/flowsa/industries.py b/flowsa/industries.py index bccd4bc83..a25801682 100644 --- a/flowsa/industries.py +++ b/flowsa/industries.py @@ -43,14 +43,16 @@ def naics_key_from_industry_spec( [[f'NAICS_{year}_Code']] .rename(columns={f'NAICS_{year}_Code': 'source_naics'})) - # Find target NAICS by truncating any source_naics longer than the target - # _naics_level unless industry_spec specifies a longer level for it, in - # which case send it (recursively) into this function to be truncated to - # the correct length. def _truncate( _naics_list: pd.DataFrame, _industry_spec: dict ) -> pd.DataFrame: + ''' + Find target NAICS by truncating any source_naics longer than the target + _naics_level unless industry_spec specifies a longer level for it, in + which case send it (recursively) into this function to be truncated to + the correct length. + ''' _naics_level = int(_industry_spec['default'][-1:]) return pd.concat([ (_naics_list From e822eae412ac26d0fd2287347b7e0c80eda30d5b Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 27 May 2022 12:33:11 -0400 Subject: [PATCH 0056/1127] Fixed map_to_sectors(), added info to SEEA_...yaml --- flowsa/flowby.py | 84 +++++++++++-------- .../flowbysectormethods/SEEA_2017_v1.yaml | 5 ++ 2 files changed, 56 insertions(+), 33 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 830806831..887040726 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -699,10 +699,19 @@ def map_to_sectors( external_config_path: str = None ) -> 'FlowByActivity': ''' - Maps the activities in the calling dataframe to sectors, but does - not perform any attribution. This method relies on the - source_config and activity_config attributes (dictionaries) of the - calling FBA. + Maps the activities in the calling dataframe to industries/sectors, but + does not perform any attribution. Columns for SectorProducedBy and + SectorConsumedBy are added to the FBA. Each activity may be matched + with many industries/sectors, and each industry/sector may have several + activities matched to it. + + The set of industries/sectors that activities are mapped to is + determined by the industry_spec parameter. Currently, this is only + able to be set in terms of NAICS codes, and specifies the desired + default level of NAICS aggregation as well as different levels for + specific groups of NAICS codes. See documentation for + industries.naics_key_from_industry_spec for details on formatting + the industry_spec dict. :param industry_spec: dict, formatted as in documentation for industries.naics_key_from_industry_spec. Gives the desired @@ -711,7 +720,22 @@ def map_to_sectors( :param external_config_path: str, an external path to search for a crosswalk. ''' - if not self.source_config['sector-like_activities']: + if self.source_config['sector-like_activities']: + try: + source_year = int(self.source_config + .get('activity_schema', '')[6:10]) + except ValueError: + source_year = 2012 + + fba_w_source_naics = ( + self + .assign(SectorProducedBy=self.ActivityProducedBy, + SectorConsumedBy=self.ActivityConsumedBy, + ActivitySourceName=self.source_name, + SectorType=np.nan) + ) + + else: activity_to_source_naics_crosswalk = ( sectormapping.get_activitytosector_mapping( # ^^^ TODO: Replace or streamline get_...() function @@ -719,12 +743,14 @@ def map_to_sectors( or self.source_name), fbsconfigpath=external_config_path) .astype('object') + [['Activity', 'Sector', 'SectorType', 'SectorSourceName']] ) source_years = list( (activity_to_source_naics_crosswalk.SectorSourceName .str.removeprefix('NAICS_') .str.removesuffix('_Code') + .dropna() .astype('int').unique()) ) source_year = (2012 if 2012 in source_years @@ -738,10 +764,12 @@ def map_to_sectors( ) else: log.warning('No NAICS year/sector source name (e.g. ' - '"NAICS_2012_Code") provided in crosswalk for %s', + '"NAICS_2012_Code") provided in crosswalk for %s.' + '2012 being used as default.', self.source_name) fba_w_source_naics = self + print(fba_w_source_naics.columns) for direction in ['ProducedBy', 'ConsumedBy']: fba_w_source_naics = ( fba_w_source_naics @@ -750,24 +778,12 @@ def map_to_sectors( left_on=f'Activity{direction}', right_on='Activity') .rename(columns={'Sector': f'Sector{direction}', 'SectorType': f'{direction}SectorType'}) - .drop(columns='ActivitySourceName', errors='ignore') + .drop(columns=['ActivitySourceName', + 'SectorSourceName', + 'Activity'], + errors='ignore') ) - else: - try: - source_year = int(self.source_config - .get('activity_schema')[6:10]) - except ValueError: - source_year = 2012 - - fba_w_source_naics = ( - self - .assign(SectorProducedBy=self.ActivityProducedBy, - SectorConsumedBy=self.ActivityConsumedBy, - ActivitySourceName=self.source_name, - SectorType=np.nan, - SectorSourceName=f'NAICS_{source_year}_Code') - ) - + print(fba_w_source_naics.columns) if source_year != target_year: source_naics_year_to_year_crosswalk = ( pd.read_csv( @@ -786,13 +802,11 @@ def map_to_sectors( .merge(source_naics_year_to_year_crosswalk, how='left', left_on=f'Sector{direction}', right_on='Sector') - .assign(**{ - f'Sector{direction}': lambda x: x['NewSector'], - 'SectorSourceName': f'NAICS_{target_year}_Code' - }) - .drop(columns='NewSector') + .assign(**{f'Sector{direction}': lambda x: x['NewSector']}) + .drop(columns=['Sector', 'NewSector']) ) + print(fba_w_source_naics.columns) source_naics_to_target_naics_crosswalk = ( industries.naics_key_from_industry_spec(industry_spec)) fba_w_target_naics = fba_w_source_naics @@ -803,10 +817,13 @@ def map_to_sectors( how='left', left_on=f'Sector{direction}', right_on='source_naics') .assign(**{f'Sector{direction}': lambda x: x['target_naics']}) - .drop(columns='target_naics') + .drop(columns=['source_naics', 'target_naics']) ) - return fba_w_target_naics + return ( + fba_w_target_naics + .assign(SectorSourceName=f'NAICS_{target_year}_Code') + ) class FlowBySector(_FlowBy): @@ -1032,8 +1049,9 @@ def generateFlowBySector( activity_set_fba = ( activity_set_fba .map_to_sectors( - sector_source_name=method_config[ - 'target_sector_source'], + industry_spec=method_config[ + 'target_industry_spec'], + target_year=method_config['target_naics_year'], external_config_path=external_config_path ) .conditional_pipe( @@ -1081,7 +1099,7 @@ def generateFlowBySector( log.info('Appending %s from %s to FBS list', activity_set, source_name) - source_fbs_list.append(fbs) + source_fbs_list.append(activity_set_fba) return source_fbs_list diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index ab78ed406..9b2c9898b 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -6,6 +6,11 @@ # rather than the BEA 2012 IO schema !include:BEA_summary_target.yaml +target_industry_spec: + default: NAICS_3 + '336': {default: NAICS_4} + '541': {default: NAICS_4} +target_naics_year: 2012 target_geoscale: national _ghgi_parameters: &ghgi_parameters From b4f31b5e82d3e88d2fae6cf8f9707f1a03ed0f17 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 27 May 2022 12:35:18 -0400 Subject: [PATCH 0057/1127] Removed debugging print statements --- flowsa/flowby.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 887040726..e10e4f3b0 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -769,7 +769,6 @@ def map_to_sectors( self.source_name) fba_w_source_naics = self - print(fba_w_source_naics.columns) for direction in ['ProducedBy', 'ConsumedBy']: fba_w_source_naics = ( fba_w_source_naics @@ -783,7 +782,6 @@ def map_to_sectors( 'Activity'], errors='ignore') ) - print(fba_w_source_naics.columns) if source_year != target_year: source_naics_year_to_year_crosswalk = ( pd.read_csv( @@ -806,7 +804,6 @@ def map_to_sectors( .drop(columns=['Sector', 'NewSector']) ) - print(fba_w_source_naics.columns) source_naics_to_target_naics_crosswalk = ( industries.naics_key_from_industry_spec(industry_spec)) fba_w_target_naics = fba_w_source_naics From b3d36484f012fa277cb4d8ca5773f7410516cad3 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Sat, 28 May 2022 17:47:09 -0400 Subject: [PATCH 0058/1127] flowby += add_single_sector_column method --- flowsa/flowby.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index e10e4f3b0..a6955951c 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -12,6 +12,7 @@ import seea_scratch as scratch FB = TypeVar('FB', bound='_FlowBy') +S = TypeVar('S', bound='_FlowBySeries') with open(settings.datapath + 'flowby_config.yaml') as f: flowby_config = flowsa_yaml.load(f) @@ -383,6 +384,42 @@ def aggregate_flowby( ) return aggregated + def add_single_sector_column(self: FB) -> FB: + ''' + This function adds to the calling dataframe a single 'Sector' column + based on the 'SectorProducedBy' and 'SectorConsumedBy' columns, and + logic based on the type of flow. The original dataset is returned + unchanged if it lacks 'SectorProducedBy' or 'SectorConsumedBy' + columns, or if a 'Sector' column is already present. + + :return: FlowBy dataset, with single 'Sector' column added if possible; + otherwise, the unmodified caling FlowBy dataset. + ''' + if 'SectorProducedBy' not in self or 'SectorConsumedBy' not in self: + log.error('Cannot add Sector column, since SectorProducedBy ' + 'and/or SectorConsumedBy columns are missing.') + return self + elif 'Sector' in self: + log.warning('Attempted to add single Sector columns, but Sector ' + 'column is already present.') + return self + else: + log.info('Adding single Sector column from SectorProducedBy and ' + 'SectorConsumedBy columns.') + return self.assign( + Sector=self.SectorProducedBy.mask( + self.FlowType == 'TECHNOSPHERE_FLOW' + or self.SectorProducedBy.isna() + or (self.SectorProducedBy.isin( + ['22', '221', '2213', '22131', '221310'] + ) + and self.SectorConsumedBy.isin( + ['F010', 'F0100', 'F01000'] + )), + self.SectorConsumedBy + ) + ) + class FlowByActivity(_FlowBy): _metadata = [*_FlowBy()._metadata] @@ -571,6 +608,7 @@ def map_to_fedefl_list( return mapped_fba.drop(columns='mapped') + # TODO: Can this be generalized to a _FlowBy method? def convert_to_geoscale( self: 'FlowByActivity', target_geoscale: Literal['national', 'state', 'county', From 0a99e6a152eb6d640fdfc94a6139cc5b7369e380 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Sat, 28 May 2022 21:28:08 -0400 Subject: [PATCH 0059/1127] Instead, add_primary_secondary_sector_columns --- flowsa/flowby.py | 66 ++++++++++++++++++++++++++++++------------------ 1 file changed, 42 insertions(+), 24 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index a6955951c..8930b2070 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -9,7 +9,6 @@ import esupy.processed_data_mgmt import esupy.dqi import fedelemflowlist -import seea_scratch as scratch FB = TypeVar('FB', bound='_FlowBy') S = TypeVar('S', bound='_FlowBySeries') @@ -384,42 +383,61 @@ def aggregate_flowby( ) return aggregated - def add_single_sector_column(self: FB) -> FB: + def add_primary_secondary_sectors(self: FB) -> FB: ''' - This function adds to the calling dataframe a single 'Sector' column - based on the 'SectorProducedBy' and 'SectorConsumedBy' columns, and - logic based on the type of flow. The original dataset is returned - unchanged if it lacks 'SectorProducedBy' or 'SectorConsumedBy' - columns, or if a 'Sector' column is already present. - - :return: FlowBy dataset, with single 'Sector' column added if possible; - otherwise, the unmodified caling FlowBy dataset. + This function adds to the calling dataframe 'PrimarySector' and + 'SecondarySector' columns based on the 'SectorProducedBy' and + 'SectorConsumedBy' columns, and logic based on the type of flow. The + original dataset is returned unchanged if it lacks 'SectorProducedBy' + or 'SectorConsumedBy' columns. + + If the flow type is TECHNOSPHERE_FLOW, the primary sector is + SectorConsumedBy. Otherwise, it is SectorProducedBy unless only + SectorConsumedBy is given, or if both are given and SectorProducedBy + is one of 22, 221, 2213, 22131, or 221310 AND SectorConsumedBy is one + of F010, F0100, or F01000. + + In all cases, the secondary sector is the "other" sector if both are + given. In many cases, only one of SectorProducedBy or SectorConsumedBy + is given, and therefore SecondarySector is null. + + :return: FlowBy dataset, with 'PrimarySector' and 'SecondarySector' + columns added, if possible; otherwise, the unmodified caling FlowBy + dataset. ''' if 'SectorProducedBy' not in self or 'SectorConsumedBy' not in self: - log.error('Cannot add Sector column, since SectorProducedBy ' - 'and/or SectorConsumedBy columns are missing.') - return self - elif 'Sector' in self: - log.warning('Attempted to add single Sector columns, but Sector ' - 'column is already present.') + log.error('Cannot add PrimarySector or SecondarySector columns, ' + 'since SectorProducedBy and/or SectorConsumedBy columns ' + 'are missing.') return self else: - log.info('Adding single Sector column from SectorProducedBy and ' - 'SectorConsumedBy columns.') - return self.assign( - Sector=self.SectorProducedBy.mask( - self.FlowType == 'TECHNOSPHERE_FLOW' - or self.SectorProducedBy.isna() - or (self.SectorProducedBy.isin( + log.info('Adding PrimarySector and SecondarySector columns from' + 'SectorProducedBy and SectorConsumedBy columns.') + fb = self.assign( + PrimarySector=self.SectorProducedBy.mask( + (self.FlowType == 'TECHNOSPHERE_FLOW') + | (self.SectorProducedBy.isna()) + | (self.SectorProducedBy.isin( ['22', '221', '2213', '22131', '221310'] ) - and self.SectorConsumedBy.isin( + & self.SectorConsumedBy.isin( ['F010', 'F0100', 'F01000'] )), self.SectorConsumedBy ) ) + def _identify_secondary_sector(row: _FlowBySeries) -> str: + sectors = [row.SectorProducedBy, row.SectorConsumedBy] + sectors.remove(row.PrimarySector) + return sectors[0] + + fb = fb.assign(SecondarySector=fb.apply( + _identify_secondary_sector, axis='columns')) + # ^^^ Applying with axis='columns' means applying TO each row. + + return fb + class FlowByActivity(_FlowBy): _metadata = [*_FlowBy()._metadata] From 4fe949fd4e0c64ab93045eefddf7e7f6a9d952fc Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 31 May 2022 11:38:52 -0400 Subject: [PATCH 0060/1127] flowby.FBA += equal_attribution() --- flowsa/flowby.py | 84 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 66 insertions(+), 18 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 8930b2070..ceb31dfe9 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -411,7 +411,7 @@ def add_primary_secondary_sectors(self: FB) -> FB: 'are missing.') return self else: - log.info('Adding PrimarySector and SecondarySector columns from' + log.info('Adding PrimarySector and SecondarySector columns from ' 'SectorProducedBy and SectorConsumedBy columns.') fb = self.assign( PrimarySector=self.SectorProducedBy.mask( @@ -878,6 +878,69 @@ def map_to_sectors( .assign(SectorSourceName=f'NAICS_{target_year}_Code') ) + def equal_attribution(self: 'FlowByActivity') -> 'FlowByActivity': + ''' + This function takes a FlowByActivity dataset with SectorProducedBy and + SectorConsumedBy columns already added and attributes flows from any + activity which is mapped to multiple industries/sectors equally across + those industries/sectors, by NAICS level. In other words, if an + activity is mapped to multiple industries/sectors, the flow amount is + equally divided across the relevant 2-digit NAICS industries. Then, + within each 2-digit industry the flow amount for that industry is + equally divided across the relevant 3-digit NAICS industries; within + each of those, the flow amount is equally divided across relevant + 4-digit NAICS industries, and so on. + + For example: + Suppose that activity A has a flow amount of 12 and is mapped to + industries 111210, 111220, and 213110, a flow amount of 3 will be + attributed to 111210, a flow amount of 3 to 111220, and a flow amount + of 6 to 213110. + + Attribution happens according to the primary sector first (see + documentation for + flowby.FlowByActivity.add_primary_secondary_sector_columns() for + details on how the primary sector is determined; in most cases, the + primary sector is the (only) non-null value out of SectorProducedBy or + SectorConsumedBy). If necessary, flow amounts are further (equally) + subdivided based on the secondary sector. + ''' + fba = self.add_primary_secondary_sectors() + groupby_cols = [c for c in fba.columns if fba[c].dtype == 'object' + and c not in ['SectorProducedBy', 'SectorConsumedBy', + 'PrimarySector', 'SecondarySector', + 'Description']] + + for rank in ['Primary', 'Secondary']: + fba = ( + fba + .assign( + **{f'_naics_{n}': lambda x, i=n: x[f'{rank}Sector'].str[:i] + for n in range(2, 8)}, + **{f'_unique_naics_{n}_by_group': lambda x, i=n: ( + x + .groupby(groupby_cols if i == 2 + else [*groupby_cols, f'_naics_{i-1}'], + dropna=False) + [[f'_naics_{i}']] + .transform('nunique', dropna=False) + ) + for n in range(2, 8)}, + FlowAmount=lambda x: reduce( + lambda x, y: x / y, + [x.FlowAmount, *[x[f'_unique_naics_{n}_by_group'] + for n in range(2, 8)]] + ) + ) + ) + groupby_cols.append('PrimarySector') + + return fba.drop( + columns=['PrimarySector', 'SecondarySector', + *[f'_naics_{n}' for n in range(2, 8)], + *[f'_unique_naics_{n}_by_group' for n in range(2, 8)]] + ) + class FlowBySector(_FlowBy): _metadata = [*_FlowBy()._metadata] @@ -1122,22 +1185,7 @@ def generateFlowBySector( if activity_config['allocation_method'] == 'direct': log.info('Attributing flows in %s using direct ' 'attribution method', activity_set) - fbs = fbs_allocation.direct_allocation_method( - activity_set_fba, - source_name, - activity_names, - method_config - ) - # activity_fbs_list = [] - # for name in activity_names: - # log.info('Attributing to %s', name) - # activity_fbs = ( - # activity_set_fba - # .query('ActivityProducedBy == @name' - # '| ActivityConsumedBy == @name') - # .reset_index(drop=True) - # ) - + fbs = activity_set_fba.equal_attribution() # elif (activity_config['allocation_method'] # == 'allocation_function'): # pass @@ -1152,7 +1200,7 @@ def generateFlowBySector( log.info('Appending %s from %s to FBS list', activity_set, source_name) - source_fbs_list.append(activity_set_fba) + source_fbs_list.append(fbs) return source_fbs_list From e603eeff4e7d41efdfb43d12470bca7fa36982c2 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 31 May 2022 11:40:36 -0400 Subject: [PATCH 0061/1127] flowby.FBA += 'allocation_function' --- flowsa/flowby.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index ceb31dfe9..53dff4764 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1186,9 +1186,13 @@ def generateFlowBySector( log.info('Attributing flows in %s using direct ' 'attribution method', activity_set) fbs = activity_set_fba.equal_attribution() - # elif (activity_config['allocation_method'] - # == 'allocation_function'): - # pass + elif (activity_config['allocation_method'] + == 'allocation_function'): + fbs = activity_config['allocation_source']( + activity_set_fba, + activity_config, + source_fbs_list + ) # elif (activity_config['allocation_method'] # == 'proportional'): # pass From 29ad43f1e2bab0fd1537e517f1528ca50165b236 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 31 May 2022 12:00:05 -0400 Subject: [PATCH 0062/1127] Better logging for 'allocation_function' --- flowsa/flowby.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 53dff4764..a8d02746a 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1188,6 +1188,12 @@ def generateFlowBySector( fbs = activity_set_fba.equal_attribution() elif (activity_config['allocation_method'] == 'allocation_function'): + log.info( + 'Attributing flows in %s using function: %s.%s', + activity_set, + activity_config['allocation_source'].__module__, + activity_config['allocation_source'].__name__ + ) fbs = activity_config['allocation_source']( activity_set_fba, activity_config, From 8e06ee9ccc02455baec0416dea505f08c3bd0b68 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 31 May 2022 12:02:04 -0400 Subject: [PATCH 0063/1127] Better logging for attribution code --- flowsa/flowby.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index a8d02746a..308e4d573 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1183,13 +1183,14 @@ def generateFlowBySector( assert isinstance(activity_set_fba, FlowByActivity) if activity_config['allocation_method'] == 'direct': - log.info('Attributing flows in %s using direct ' - 'attribution method', activity_set) + log.info('Attributing flows in %s to sectors using ' + 'direct attribution method', activity_set) fbs = activity_set_fba.equal_attribution() elif (activity_config['allocation_method'] == 'allocation_function'): log.info( - 'Attributing flows in %s using function: %s.%s', + 'Attributing flows in %s to sectors using ' + 'function: %s.%s', activity_set, activity_config['allocation_source'].__module__, activity_config['allocation_source'].__name__ From 3d3f52a2b2e06e54f9e76a29cee4bf2a570241f2 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 6 Jun 2022 13:52:59 -0400 Subject: [PATCH 0064/1127] Fixed map_to_sectors() --- flowsa/flowby.py | 99 ++++++++++++++++++++++++++++++------------------ 1 file changed, 62 insertions(+), 37 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 308e4d573..01f63698c 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -432,9 +432,12 @@ def _identify_secondary_sector(row: _FlowBySeries) -> str: sectors.remove(row.PrimarySector) return sectors[0] - fb = fb.assign(SecondarySector=fb.apply( - _identify_secondary_sector, axis='columns')) - # ^^^ Applying with axis='columns' means applying TO each row. + fb = fb.assign( + SecondarySector=( + fb.apply(_identify_secondary_sector, axis='columns') + # ^^^ Applying with axis='columns' applies TO each row. + .astype('object')) + ) return fb @@ -758,7 +761,7 @@ def map_to_sectors( Maps the activities in the calling dataframe to industries/sectors, but does not perform any attribution. Columns for SectorProducedBy and SectorConsumedBy are added to the FBA. Each activity may be matched - with many industries/sectors, and each industry/sector may have several + with many industries/sectors, and each industry/sector may have many activities matched to it. The set of industries/sectors that activities are mapped to is @@ -777,21 +780,40 @@ def map_to_sectors( crosswalk. ''' if self.source_config['sector-like_activities']: + log.info('Activities in %s are NAICS codes.', + self.source_name) try: source_year = int(self.source_config .get('activity_schema', '')[6:10]) except ValueError: source_year = 2012 - - fba_w_source_naics = ( - self - .assign(SectorProducedBy=self.ActivityProducedBy, - SectorConsumedBy=self.ActivityConsumedBy, - ActivitySourceName=self.source_name, - SectorType=np.nan) + log.warning('No NAICS year given for NAICS activities in %s. ' + '2012 used as default.', self.source_name) + else: + log.info('NAICS Activities in %s use NAICS year %s.', + self.source_name, source_year) + + log.info('Converting NAICS codes to desired industry/sector ' + 'aggregation structure.') + fba_w_naics = self.assign( + ActivitySourceName=self.source_name, + SectorType=np.nan ) + for direction in ['ProducedBy', 'ConsumedBy']: + fba_w_naics = ( + fba_w_naics + .merge( + industries.naics_key_from_industry_spec(industry_spec), + how='left', + left_on=f'Activity{direction}', + right_on='source_naics') + .rename(columns={'target_naics': f'Sector{direction}'}) + .drop(columns='source_naics') + ) else: + log.info('Getting crosswalk between activities in %s and ' + 'NAICS codes.', self.source_name) activity_to_source_naics_crosswalk = ( sectormapping.get_activitytosector_mapping( # ^^^ TODO: Replace or streamline get_...() function @@ -820,15 +842,28 @@ def map_to_sectors( ) else: log.warning('No NAICS year/sector source name (e.g. ' - '"NAICS_2012_Code") provided in crosswalk for %s.' + '"NAICS_2012_Code") provided in crosswalk for %s. ' '2012 being used as default.', self.source_name) - fba_w_source_naics = self + log.info('Converting NAICS codes in crosswalk to desired ' + 'industry/sector aggregation structure.') + activity_to_target_naics_crosswalk = ( + activity_to_source_naics_crosswalk + .merge(industries.naics_key_from_industry_spec(industry_spec), + how='left', left_on='Sector', right_on='source_naics') + .assign(Sector=lambda x: x.source_naics) + .drop(columns=['source_naics', 'target_naics']) + .drop_duplicates() + ) + + log.info('Mapping activities in %s to NAICS codes using crosswalk', + self.source_name) + fba_w_naics = self for direction in ['ProducedBy', 'ConsumedBy']: - fba_w_source_naics = ( - fba_w_source_naics - .merge(activity_to_source_naics_crosswalk, + fba_w_naics = ( + fba_w_naics + .merge(activity_to_target_naics_crosswalk, how='left', left_on=f'Activity{direction}', right_on='Activity') .rename(columns={'Sector': f'Sector{direction}', @@ -838,8 +873,12 @@ def map_to_sectors( 'Activity'], errors='ignore') ) + if source_year != target_year: - source_naics_year_to_year_crosswalk = ( + log.info('Using NAICS time series/crosswalk to map NAICS codes ' + 'from NAICS year %s to NAICS year %s.', + source_year, target_year) + naics_year_to_year_crosswalk = ( pd.read_csv( f'{settings.datapath}NAICS_Crosswalk_TimeSeries.csv', dtype='object' @@ -851,32 +890,16 @@ def map_to_sectors( .reset_index(drop=True) ) for direction in ['ProducedBy', 'ConsumedBy']: - fba_w_source_naics = ( - fba_w_source_naics - .merge(source_naics_year_to_year_crosswalk, + fba_w_naics = ( + fba_w_naics + .merge(naics_year_to_year_crosswalk, how='left', left_on=f'Sector{direction}', right_on='Sector') .assign(**{f'Sector{direction}': lambda x: x['NewSector']}) .drop(columns=['Sector', 'NewSector']) ) - source_naics_to_target_naics_crosswalk = ( - industries.naics_key_from_industry_spec(industry_spec)) - fba_w_target_naics = fba_w_source_naics - for direction in ['ProducedBy', 'ConsumedBy']: - fba_w_target_naics = ( - fba_w_target_naics - .merge(source_naics_to_target_naics_crosswalk, - how='left', - left_on=f'Sector{direction}', right_on='source_naics') - .assign(**{f'Sector{direction}': lambda x: x['target_naics']}) - .drop(columns=['source_naics', 'target_naics']) - ) - - return ( - fba_w_target_naics - .assign(SectorSourceName=f'NAICS_{target_year}_Code') - ) + return fba_w_naics.assign(SectorSourceName=f'NAICS_{target_year}_Code') def equal_attribution(self: 'FlowByActivity') -> 'FlowByActivity': ''' @@ -1162,6 +1185,8 @@ def generateFlowBySector( # ^^^ TODO: Rewrite validation to use fb metadata ) + assert isinstance(activity_set_fba, FlowByActivity) + activity_set_fba = ( activity_set_fba .map_to_sectors( From a0bf2a8014f673adcaed085e781f090e72b270c0 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 6 Jun 2022 16:39:45 -0400 Subject: [PATCH 0065/1127] Tweaked map_to_fedefl_list --- flowsa/flowby.py | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 01f63698c..c3ff3e9b4 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -566,33 +566,30 @@ def map_to_fedefl_list( fba_merge_keys.remove('SourceName') mapping_merge_keys.remove('SourceListName') - fba = (self - .assign(Flowable=self.FlowName, - Context=self.Compartment, - FlowAmount=self.FlowAmount.mask( - self.Unit.str.contains('/d'), - self.FlowAmount * 365), - Unit=self.Unit.str.replace('/d', '')) - .conditional_method(drop_fba_columns, 'drop', - columns=['FlowName', 'Compartment']) - .fillna({field: '' for field in fba_merge_keys})) - if any(self.Unit.str.contains('/d')): log.info('Converting daily flows %s to annual', [unit for unit in self.Unit.unique() if '/d' in unit]) + fba = ( + self + .assign(Flowable=self.FlowName, + Context=self.Compartment, + FlowAmount=self.FlowAmount.mask( + self.Unit.str.contains('/d'), + self.FlowAmount * 365), + Unit=self.Unit.str.replace('/d', '')) + .conditional_method(drop_fba_columns, 'drop', + columns=['FlowName', 'Compartment']) + ) - mapping = (fedelemflowlist - .get_flowmapping(mapping_subset)[mapping_fields]) - + mapping = ( + fedelemflowlist.get_flowmapping(mapping_subset)[mapping_fields] + .assign(ConversionFactor=lambda x: x.ConversionFactor.fillna(1)) + ) if mapping.empty: log.warning('Elementary flow list entries for %s not found', mapping_subset) return FlowByActivity(self, mapped=True) - mapping = (mapping - .assign(ConversionFactor=mapping.ConversionFactor.fillna(1)) - .fillna({field: '' for field in mapping_merge_keys})) - mapped_fba = fba.merge(mapping, how=merge_type, left_on=fba_merge_keys, From be8063e7f579aacd166d9ae2aaabd7a9ce6b0ece Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 6 Jun 2022 16:41:38 -0400 Subject: [PATCH 0066/1127] Activity source_flow handling + minor tweaks --- flowsa/flowby.py | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index c3ff3e9b4..55075d3bf 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -896,7 +896,11 @@ def map_to_sectors( .drop(columns=['Sector', 'NewSector']) ) - return fba_w_naics.assign(SectorSourceName=f'NAICS_{target_year}_Code') + return ( + fba_w_naics + .assign(SectorSourceName=f'NAICS_{target_year}_Code') + .reset_index(drop=True) + ) def equal_attribution(self: 'FlowByActivity') -> 'FlowByActivity': ''' @@ -1071,10 +1075,11 @@ def generateFlowBySector( source_fbs_list = [] for source_name, source_config in sources.items(): - source_config.update( - {k: v for k, v in source_catalog.get( - common.return_true_source_catalog_name(source_name), {}) - .items() if k not in source_config}) + source_config = { + **source_catalog.get( + common.return_true_source_catalog_name(source_name), {}), + **source_config + } if source_config['data_format'] in ['FBS', 'FBS_outside_flowsa']: if source_config['data_format'] == 'FBS_outside_flowsa': @@ -1108,7 +1113,8 @@ def generateFlowBySector( .query('Flowable in @source_flows') .conditional_method(isinstance(source_flows, dict), 'replace', - {'Flowable': source_flows})) + {'Flowable': source_flows}) + .reset_index(drop=True)) log.info('Appending %s to FBS list', source_name) source_fbs_list.append(fbs) @@ -1145,17 +1151,23 @@ def generateFlowBySector( fba .query('ActivityProducedBy in @activity_names' '| ActivityConsumedBy in @activity_names') - .conditional_method( - 'source_flows' in activity_config, - 'query', - f'FlowName in ' - f'{activity_config.get("source_flows")}') .reset_index(drop=True) ) activity_set_fba.activity_set = activity_set activity_set_fba.activity_config = activity_config + if 'source_flows' in activity_config: + source_flows = activity_config['source_flows'] + activity_set_fba = ( + activity_set_fba + .query('FlowName in @source_flows') + .conditional_method(isinstance(source_flows, dict), + 'replace', + {'FlowName': source_flows}) + .reset_index(drop=True) + ) + if activity_set_fba.empty: log.error('No data for flows in %s', activity_set) continue @@ -1166,6 +1178,8 @@ def generateFlowBySector( # TODO: source_catalog key not currently handled: # TODO: 'sector-like_activities' + assert isinstance(activity_set_fba, FlowByActivity) + activity_set_fba = ( activity_set_fba .convert_to_geoscale( From abff514a4521e11b12a4c0fe27928c928a6dd1fb Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 7 Jun 2022 14:31:12 -0400 Subject: [PATCH 0067/1127] _FB += groupby_cols and flow_col properties --- flowsa/flowby.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 55075d3bf..277f3c1be 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -96,6 +96,14 @@ def __finalize__(self, other, method=None, **kwargs): object.__setattr__(self, name, getattr(other.left, name, None)) return self + @property + def flow_col(self) -> str: + return 'Flowable' if 'Flowable' in self else 'FlowName' + + @property + def groupby_cols(self) -> List[str]: + return [x for x in self if self[x].dtype in ['int', 'object']] + @classmethod def _getFlowBy( cls, @@ -1236,9 +1244,9 @@ def generateFlowBySector( activity_config, source_fbs_list ) - # elif (activity_config['allocation_method'] - # == 'proportional'): - # pass + elif (activity_config['allocation_method'] + == 'proportional'): + pass fba = fba.query( 'ActivityProducedBy not in @activity_names' From 5d4439c2349f7dd9ee60aeaa0b4da69527731372 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 7 Jun 2022 14:35:30 -0400 Subject: [PATCH 0068/1127] Reorganized flowby_config for consistency --- flowsa/data/flowby_config.yaml | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/flowsa/data/flowby_config.yaml b/flowsa/data/flowby_config.yaml index fbf3df2ff..0d8846b26 100644 --- a/flowsa/data/flowby_config.yaml +++ b/flowsa/data/flowby_config.yaml @@ -1,14 +1,12 @@ -fba_fields: &fba_fields +_fba_base_fields: &fba_base_fields ActivityConsumedBy: object ActivityProducedBy: object Class: object - Compartment: object DataCollection: float DataReliability: float Description: object DistributionType: object FlowAmount: float - FlowName: object FlowType: object Location: object LocationSystem: object @@ -20,26 +18,33 @@ fba_fields: &fba_fields Unit: object Year: int +_unmapped_fields: &unmapped_fields + FlowName: object + Compartment: object + _mapped_fields: &mapped_fields Context: object FlowUUID: object Flowable: object -_sector_fields: §or_fields +_sector_fields: &fba_sector_fields ConsumedBySectorType: object ProducedBySectorType: object SectorConsumedBy: object SectorProducedBy: object SectorSourceName: object -fba_mapped_fields: - <<: [*fba_fields, *mapped_fields] +fba_fields: &fba_fields + <<: [*fba_base_fields, *unmapped_fields] + +fba_mapped_fields: &fba_mapped_fields + <<: [*fba_base_fields, *mapped_fields] fba_mapped_w_sector_fields: - <<: [*fba_fields, *mapped_fields, *sector_fields] + <<: [*fba_mapped_fields, *fba_sector_fields] fba_w_sector_fields: - <<: [*fba_fields, *sector_fields] + <<: [*fba_fields, *fba_sector_fields] fba_column_order: - Class @@ -95,6 +100,10 @@ _fbs_base_fields: &fbs_base_fields Unit: object Year: int +_sector_fields: &fbs_sector_fields + SectorConsumedBy: object + SectorProducedBy: object + _collapsed_fields: &collapsed_fields Sector: object @@ -103,9 +112,7 @@ _activity_fields: &activity_fields ActivityProducedBy: object fbs_fields: &fbs_fields - <<: *fbs_base_fields - SectorConsumedBy: object - SectorProducedBy: object + <<: [*fbs_base_fields, *fbs_sector_fields] fbs_w_activity_fields: <<: [*fbs_fields, *activity_fields] From 783c39417f041a2b329f72b7683ab23ad61475af Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 7 Jun 2022 15:03:24 -0400 Subject: [PATCH 0069/1127] Coorected serious error in map_to_sectors --- flowsa/flowby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 277f3c1be..34ebc6341 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -857,7 +857,7 @@ def map_to_sectors( activity_to_source_naics_crosswalk .merge(industries.naics_key_from_industry_spec(industry_spec), how='left', left_on='Sector', right_on='source_naics') - .assign(Sector=lambda x: x.source_naics) + .assign(Sector=lambda x: x.target_naics) .drop(columns=['source_naics', 'target_naics']) .drop_duplicates() ) From 1acf8a541cd1cbc9c6c2ebcba6ebd3f9880fdbc5 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 7 Jun 2022 15:24:04 -0400 Subject: [PATCH 0070/1127] flowby_config += all_..._fields entries --- flowsa/data/flowby_config.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flowsa/data/flowby_config.yaml b/flowsa/data/flowby_config.yaml index 0d8846b26..790ee1bca 100644 --- a/flowsa/data/flowby_config.yaml +++ b/flowsa/data/flowby_config.yaml @@ -46,6 +46,9 @@ fba_mapped_w_sector_fields: fba_w_sector_fields: <<: [*fba_fields, *fba_sector_fields] +all_fba_fields: + <<: [*fba_base_fields, *unmapped_fields, *mapped_fields, *fba_sector_fields] + fba_column_order: - Class - SourceName @@ -120,6 +123,9 @@ fbs_w_activity_fields: fbs_collapsed_fields: <<: [*fbs_base_fields, *collapsed_fields] +all_fbs_fields: + <<: [*fbs_base_fields, *fbs_sector_fields, *activity_fields, *collapsed_fields] + fbs_column_order: - Flowable - Class From 26953281637a7238bec258940060988d09606404 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 7 Jun 2022 15:27:03 -0400 Subject: [PATCH 0071/1127] Tweaks --- flowsa/flowby.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 34ebc6341..10a071194 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -747,15 +747,17 @@ def convert_to_geoscale( .aggregate_flowby() ) - return ( + fba_at_target_geoscale = ( fba_at_target_geoscale .astype({c: t for c, t - in flowby_config['fba_mapped_w_sector_fields'].items() + in flowby_config['all_fba_fields'].items() if c in fba_at_target_geoscale.columns}) # ^^^ Need to convert back to correct dtypes after aggregating; # otherwise, columns of NaN will become float dtype. ) + return fba_at_target_geoscale + def map_to_sectors( self: 'FlowByActivity', industry_spec: dict, @@ -787,6 +789,7 @@ def map_to_sectors( if self.source_config['sector-like_activities']: log.info('Activities in %s are NAICS codes.', self.source_name) + try: source_year = int(self.source_config .get('activity_schema', '')[6:10]) @@ -910,7 +913,7 @@ def map_to_sectors( .reset_index(drop=True) ) - def equal_attribution(self: 'FlowByActivity') -> 'FlowByActivity': + def equally_attribute(self: 'FlowByActivity') -> 'FlowByActivity': ''' This function takes a FlowByActivity dataset with SectorProducedBy and SectorConsumedBy columns already added and attributes flows from any @@ -1229,7 +1232,7 @@ def generateFlowBySector( if activity_config['allocation_method'] == 'direct': log.info('Attributing flows in %s to sectors using ' 'direct attribution method', activity_set) - fbs = activity_set_fba.equal_attribution() + fbs = activity_set_fba.equally_attribute() elif (activity_config['allocation_method'] == 'allocation_function'): log.info( From e18ac69c5dcdc8c8c6134e8b181b16f9d18c356c Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 7 Jun 2022 15:36:48 -0400 Subject: [PATCH 0072/1127] Shifted geo validation to convert_to_geoscale --- flowsa/flowby.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 10a071194..44e74d5ab 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -756,6 +756,14 @@ def convert_to_geoscale( # otherwise, columns of NaN will become float dtype. ) + if target_geoscale != geo.scale.NATIONAL: + validation.compare_geographic_totals( + fba_at_target_geoscale, self, + self.source_name, self.activity_config, + self.activity_set, self.activity_config['names'] + # ^^^ TODO: Rewrite validation to use fb metadata + ) + return fba_at_target_geoscale def map_to_sectors( @@ -1200,13 +1208,6 @@ def generateFlowBySector( activity_config['allocation_from_scale']))) ) - if activity_config['allocation_from_scale'] != 'national': - validation.compare_geographic_totals( - activity_set_fba, fba, source_name, - activity_config, activity_set, activity_names - # ^^^ TODO: Rewrite validation to use fb metadata - ) - assert isinstance(activity_set_fba, FlowByActivity) activity_set_fba = ( From e90232f776d8139219b0583f3c514a520003f3ff Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 7 Jun 2022 16:36:33 -0400 Subject: [PATCH 0073/1127] aggregate_flowby converts dtypes after aggregating --- flowsa/flowby.py | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 44e74d5ab..a29c86463 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -379,16 +379,20 @@ def aggregate_flowby( ) aggregated = ( aggregated - .assign( - **{c: (aggregated[f'_{c}_weighted'] - / aggregated[f'_{c}_weights']) - for c in columns_to_average} - ) - .drop( - columns=([*[f'_{c}_weighted' for c in columns_to_average], - *[f'_{c}_weights' for c in columns_to_average]]) - ) + .assign(**{c: (aggregated[f'_{c}_weighted'] + / aggregated[f'_{c}_weights']) + for c in columns_to_average}) + .drop(columns=([*[f'_{c}_weighted' for c in columns_to_average], + *[f'_{c}_weights' for c in columns_to_average]])) ) + aggregated = aggregated.astype( + {column: type for column, type + in set([*flowby_config['all_fba_fields'].items(), + *flowby_config['all_fbs_fields'].items()]) + if column in aggregated} + ) + # ^^^ Need to convert back to correct dtypes after aggregating; + # otherwise, columns of NaN will become float dtype. return aggregated def add_primary_secondary_sectors(self: FB) -> FB: @@ -747,15 +751,6 @@ def convert_to_geoscale( .aggregate_flowby() ) - fba_at_target_geoscale = ( - fba_at_target_geoscale - .astype({c: t for c, t - in flowby_config['all_fba_fields'].items() - if c in fba_at_target_geoscale.columns}) - # ^^^ Need to convert back to correct dtypes after aggregating; - # otherwise, columns of NaN will become float dtype. - ) - if target_geoscale != geo.scale.NATIONAL: validation.compare_geographic_totals( fba_at_target_geoscale, self, From 71cca8f4446bafa719efa358a4f8ff2b30c2e5c9 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 7 Jun 2022 16:37:46 -0400 Subject: [PATCH 0074/1127] FlowName -> Flowable in activity fba filtering --- flowsa/flowby.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index a29c86463..002e7e287 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1175,10 +1175,10 @@ def generateFlowBySector( source_flows = activity_config['source_flows'] activity_set_fba = ( activity_set_fba - .query('FlowName in @source_flows') + .query('Flowable in @source_flows') .conditional_method(isinstance(source_flows, dict), 'replace', - {'FlowName': source_flows}) + {'Flowable': source_flows}) .reset_index(drop=True) ) From 8e89b3970058ca3d4239df28d80c8c7edaae6a45 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 7 Jun 2022 16:41:25 -0400 Subject: [PATCH 0075/1127] Adapted gen_FBS conv_to_geoscale for prev. changes --- flowsa/flowby.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 002e7e287..e6fe92920 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1194,14 +1194,13 @@ def generateFlowBySector( assert isinstance(activity_set_fba, FlowByActivity) - activity_set_fba = ( - activity_set_fba - .convert_to_geoscale( - max(geo.scale.from_string( - source_config['geoscale_to_use']), - geo.scale.from_string( - activity_config['allocation_from_scale']))) + target_geoscale = max( + source_config['geoscale_to_use'], + activity_config['allocation_from_scale'], + key=geo.scale.from_string ) + activity_set_fba = (activity_set_fba + .convert_to_geoscale(target_geoscale)) assert isinstance(activity_set_fba, FlowByActivity) From 590f69e34001792591a3d09be6c362c0553775ad Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 7 Jun 2022 16:51:12 -0400 Subject: [PATCH 0076/1127] Tweaks to aggregate_flowby() --- flowsa/flowby.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index e6fe92920..e1040df13 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -102,7 +102,8 @@ def flow_col(self) -> str: @property def groupby_cols(self) -> List[str]: - return [x for x in self if self[x].dtype in ['int', 'object']] + return [x for x in self + if self[x].dtype in ['int', 'object'] and x != 'Description'] @classmethod def _getFlowBy( @@ -346,10 +347,7 @@ def aggregate_flowby( :return: FlowBy, with aggregated columns """ if columns_to_group_by is None: - columns_to_group_by = [ - x for x in self.columns - if self[x].dtype != 'float' and x != 'Description' - ] + columns_to_group_by = self.groupby_cols if columns_to_average is None: columns_to_average = [ x for x in self.columns @@ -367,12 +365,10 @@ def aggregate_flowby( aggregated = ( fb - .assign( - **{f'_{c}_weighted': fb[c] * fb.FlowAmount - for c in columns_to_average}, - **{f'_{c}_weights': fb.FlowAmount * fb[c].notnull() - for c in columns_to_average} - ) + .assign(**{f'_{c}_weighted': fb[c] * fb.FlowAmount + for c in columns_to_average}, + **{f'_{c}_weights': fb.FlowAmount * fb[c].notnull() + for c in columns_to_average}) .groupby(columns_to_group_by, dropna=False) .agg(sum) .reset_index() From e444208e972dde145ac18fc8ea2f242e4e915560 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 8 Jun 2022 08:50:49 -0400 Subject: [PATCH 0077/1127] _FB += select_flows(). Also tweaks elsewhere. --- flowsa/flowby.py | 96 +++++++++++++++++++++++++++--------------------- 1 file changed, 54 insertions(+), 42 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index e1040df13..851575eac 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -294,7 +294,7 @@ def conditional_method( def standardize_units(self: FB) -> FB: """ Standardizes units. Timeframe is annual. - :return: FlowBy dataframe, with standarized units + :return: FlowBy dataframe, with standardized units """ return self._standardize_units(self) @@ -329,6 +329,28 @@ def update_fips_to_geoscale( log.error('No FIPS level corresponds to the given geoscale: %s', to_geoscale) + def select_flows(self: FB, source_flows: list or dict) -> FB: + ''' + Filters the FlowBy dataset to the flows named in source_flows. If + source_flows is a dict, selects flows according to the keys and + renames them to the associated values. + + :param flows: list or dict. Either a list of flows to select, or a dict + whose keys are the flows to select and whose values are the new + names to assign to those flows. + :return: FlowBy dataset, filtered to the given flows, and with those + flows possibly renamed. + ''' + selected_fb = ( + self + .query(f'{self.flow_col} in @source_flows') + .conditional_method(isinstance(source_flows, dict), + 'replace', + {self.flow_col: source_flows}) + .reset_index(drop=True) + ) + return selected_fb + def aggregate_flowby( self: FB, columns_to_group_by: List[str] = None, @@ -594,8 +616,8 @@ def map_to_fedefl_list( .assign(ConversionFactor=lambda x: x.ConversionFactor.fillna(1)) ) if mapping.empty: - log.warning('Elementary flow list entries for %s not found', - mapping_subset) + log.error('Elementary flow list entries for %s not found', + mapping_subset) return FlowByActivity(self, mapped=True) mapped_fba = fba.merge(mapping, @@ -604,24 +626,23 @@ def map_to_fedefl_list( right_on=mapping_merge_keys, indicator='mapped') - mapped_fba = (mapped_fba - .assign( - Flowable=mapped_fba.Flowable.mask( - mapped_fba.TargetFlowName.notnull(), - mapped_fba.TargetFlowName), - Context=mapped_fba.Context.mask( - mapped_fba.TargetFlowName.notnull(), - mapped_fba.TargetFlowContext), - Unit=mapped_fba.Unit.mask( - mapped_fba.TargetFlowName.notnull(), - mapped_fba.TargetUnit), - FlowAmount=mapped_fba.FlowAmount.mask( - mapped_fba.TargetFlowName.notnull(), - mapped_fba.FlowAmount - * mapped_fba.ConversionFactor), - FlowUUID=mapped_fba.TargetFlowUUID - ) - .drop(columns=mapping_fields)) + is_mappable = mapped_fba.TargetFlowName.notnull() + mapped_fba = ( + mapped_fba + .assign( + Flowable=mapped_fba.Flowable.mask( + is_mappable, mapped_fba.TargetFlowName), + Context=mapped_fba.Context.mask( + is_mappable, mapped_fba.TargetFlowContext), + Unit=mapped_fba.Unit.mask( + is_mappable, mapped_fba.TargetUnit), + FlowAmount=mapped_fba.FlowAmount.mask( + is_mappable, + mapped_fba.FlowAmount * mapped_fba.ConversionFactor), + FlowUUID=mapped_fba.TargetFlowUUID + ) + .drop(columns=mapping_fields) + ) if any(mapped_fba.mapped == 'both'): log.info('Units standardized to %s by mapping to federal ' @@ -724,6 +745,7 @@ def convert_to_geoscale( .assign(source_geoscale=( fba_with_reporting_levels[reporting_level_columns] .max(axis='columns'))) + # ^^^ max() with axis='columns' takes max along rows .query('geoscale == source_geoscale') .drop(columns=(['geoscale', *geoscale_name_columns, @@ -1110,21 +1132,16 @@ def generateFlowBySector( source_config=source_config ) - fbs = (source_data - .conditional_pipe( - 'clean_fbs_df_fxn' in source_config, - source_config.get('clean_fbs_df_fxn')) - .update_fips_to_geoscale( - method_config['target_geoscale'])) - - if 'source_flows' in source_config: - source_flows = source_config['source_flows'] - fbs = (fbs - .query('Flowable in @source_flows') - .conditional_method(isinstance(source_flows, dict), - 'replace', - {'Flowable': source_flows}) - .reset_index(drop=True)) + fbs = ( + source_data + .conditional_pipe('clean_fbs_df_fxn' in source_config, + source_config.get('clean_fbs_df_fxn')) + .conditional_method('source_flows' in source_config, + 'select_flows', + source_config.get('source_flows')) + .update_fips_to_geoscale(method_config['target_geoscale']) + ) + log.info('Appending %s to FBS list', source_name) source_fbs_list.append(fbs) @@ -1168,14 +1185,9 @@ def generateFlowBySector( activity_set_fba.activity_config = activity_config if 'source_flows' in activity_config: - source_flows = activity_config['source_flows'] activity_set_fba = ( activity_set_fba - .query('Flowable in @source_flows') - .conditional_method(isinstance(source_flows, dict), - 'replace', - {'Flowable': source_flows}) - .reset_index(drop=True) + .select_flows(activity_config['source_flows']) ) if activity_set_fba.empty: From 56b8355efd851c14b8fd2b02bc190b0be5dfd7f9 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 8 Jun 2022 11:55:20 -0400 Subject: [PATCH 0078/1127] Refactored industries.py, added naics_year_key --- flowsa/{industries.py => naics.py} | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) rename flowsa/{industries.py => naics.py} (81%) diff --git a/flowsa/industries.py b/flowsa/naics.py similarity index 81% rename from flowsa/industries.py rename to flowsa/naics.py index a25801682..518abd500 100644 --- a/flowsa/industries.py +++ b/flowsa/naics.py @@ -7,7 +7,7 @@ ) -def naics_key_from_industry_spec( +def industry_spec_key( industry_spec: dict, year: Literal[2002, 2007, 2012, 2017] = 2012 ) -> pd.DataFrame: @@ -105,3 +105,26 @@ def _truncate( ) return naics_key + + +def naics_year_key( + source_year: Literal[2002, 2007, 2012, 2017], + target_year: Literal[2002, 2007, 2012, 2017] +) -> pd.DataFrame: + ''' + Provides a key for switching between years of the NAICS specification. + + :param source_year: int, one of 2002, 2007, 2012, or 2017. + :param target_year: int, one of 2002, 2007, 2012, or 2017. + :return: pd.DataFrame with columns 'source_naics' and 'target_naics', + corresponding to NAICS codes for the source and target specifications. + ''' + return ( + pd.read_csv(f'{settings.datapath}NAICS_Crosswalk_TimeSeries.csv', + dtype='object') + .assign(source_naics=lambda x: x[f'NAICS_{source_year}_Code'], + target_naics=lambda x: x[f'NAICS_{target_year}_Code']) + [['source_naics', 'target_naics']] + .drop_duplicates() + .reset_index(drop=True) + ) From a522fffe2edb977d234934064a524873ab53cc52 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 8 Jun 2022 11:55:42 -0400 Subject: [PATCH 0079/1127] Incorporated industries.py refactor --- flowsa/flowby.py | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 851575eac..ad5edfe2f 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -4,7 +4,7 @@ from functools import partial, reduce from . import (common, settings, location, dataclean, metadata, sectormapping, literature_values, flowbyactivity, flowbysector, flowsa_yaml, - validation, geo, industries, fbs_allocation) + validation, geo, naics, fbs_allocation) from .flowsa_log import log, vlog import esupy.processed_data_mgmt import esupy.dqi @@ -832,7 +832,7 @@ def map_to_sectors( fba_w_naics = ( fba_w_naics .merge( - industries.naics_key_from_industry_spec(industry_spec), + naics.industry_spec_key(industry_spec), how='left', left_on=f'Activity{direction}', right_on='source_naics') @@ -853,12 +853,10 @@ def map_to_sectors( [['Activity', 'Sector', 'SectorType', 'SectorSourceName']] ) - source_years = list( - (activity_to_source_naics_crosswalk.SectorSourceName - .str.removeprefix('NAICS_') - .str.removesuffix('_Code') - .dropna() - .astype('int').unique()) + source_years = set( + activity_to_source_naics_crosswalk.SectorSourceName + .str.removeprefix('NAICS_').str.removesuffix('_Code') + .dropna().astype('int') ) source_year = (2012 if 2012 in source_years else max(source_years) if source_years @@ -879,7 +877,7 @@ def map_to_sectors( 'industry/sector aggregation structure.') activity_to_target_naics_crosswalk = ( activity_to_source_naics_crosswalk - .merge(industries.naics_key_from_industry_spec(industry_spec), + .merge(naics.industry_spec_key(industry_spec), how='left', left_on='Sector', right_on='source_naics') .assign(Sector=lambda x: x.target_naics) .drop(columns=['source_naics', 'target_naics']) @@ -907,25 +905,15 @@ def map_to_sectors( log.info('Using NAICS time series/crosswalk to map NAICS codes ' 'from NAICS year %s to NAICS year %s.', source_year, target_year) - naics_year_to_year_crosswalk = ( - pd.read_csv( - f'{settings.datapath}NAICS_Crosswalk_TimeSeries.csv', - dtype='object' - ) - .assign(Sector=lambda x: x[f'NAICS_{source_year}_Code'], - NewSector=lambda x: x[f'NAICS_{target_year}_Code']) - [['Sector', 'NewSector']] - .drop_duplicates() - .reset_index(drop=True) - ) for direction in ['ProducedBy', 'ConsumedBy']: fba_w_naics = ( fba_w_naics - .merge(naics_year_to_year_crosswalk, + .merge(naics.naics_year_key(source_year, target_year), how='left', - left_on=f'Sector{direction}', right_on='Sector') - .assign(**{f'Sector{direction}': lambda x: x['NewSector']}) - .drop(columns=['Sector', 'NewSector']) + left_on=f'Sector{direction}', + right_on='source_naics') + .assign(**{f'Sector{direction}': lambda x: x.target_naics}) + .drop(columns=['source_naics', 'target_naics']) ) return ( From b35bade353501fcd55d597e60fea47409cc50f43 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 8 Jun 2022 12:14:47 -0400 Subject: [PATCH 0080/1127] Minor followup refactor of naics.py --- flowsa/flowby.py | 2 +- flowsa/naics.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index ad5edfe2f..ff32e1697 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -908,7 +908,7 @@ def map_to_sectors( for direction in ['ProducedBy', 'ConsumedBy']: fba_w_naics = ( fba_w_naics - .merge(naics.naics_year_key(source_year, target_year), + .merge(naics.year_crosswalk(source_year, target_year), how='left', left_on=f'Sector{direction}', right_on='source_naics') diff --git a/flowsa/naics.py b/flowsa/naics.py index 518abd500..714f50b83 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -107,7 +107,7 @@ def _truncate( return naics_key -def naics_year_key( +def year_crosswalk( source_year: Literal[2002, 2007, 2012, 2017], target_year: Literal[2002, 2007, 2012, 2017] ) -> pd.DataFrame: From 95add79a20c7ddd9f025cc1650b1c937c8b917ca Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 9 Jun 2022 12:42:04 -0400 Subject: [PATCH 0081/1127] Fixed typo --- flowsa/flowby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index ff32e1697..8192297ab 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1209,7 +1209,7 @@ def generateFlowBySector( external_config_path=external_config_path ) .conditional_pipe( - 'clean_fba_w_sec_df-fxn' in source_config, + 'clean_fba_w_sec_df_fxn' in source_config, source_config.get('clean_fba_w_sec_df_fxn'), attr=activity_config, method=method_config From 0121a73f04994823b8f79e1fa5410a1902fd1988 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 9 Jun 2022 14:16:16 -0400 Subject: [PATCH 0082/1127] Merged source_config, activity_config (I think) --- flowsa/flowby.py | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 8192297ab..342d1ea06 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -18,13 +18,11 @@ class _FlowBy(pd.DataFrame): - _metadata = ['source_name', 'source_config', - 'activity_set', 'activity_config'] + _metadata = ['source_name', 'config', 'activity_set'] source_name: str - source_config: dict + config: dict activity_set: str - activity_config: dict def __init__( self, @@ -114,7 +112,7 @@ def _getFlowBy( output_path: str, *, source_name: str = None, - source_config: dict = None, + config: dict = None, ) -> '_FlowBy': for attempt in ['import local', 'download', 'generate']: log.info( @@ -152,7 +150,7 @@ def _getFlowBy( '%s %s could not be found locally, downloaded, or generated', file_metadata.name_data, file_metadata.category ) - fb = cls(df, source_name=source_name, source_config=source_config) + fb = cls(df, source_name=source_name, config=config) return fb @staticmethod @@ -535,7 +533,7 @@ def getFlowByActivity( :param download_ok: bool, if True will attempt to load from EPA remote server prior to generating :kwargs: keyword arguments to pass to _getFlowBy(). Possible kwargs - include source_config. + include config. :return: a FlowByActivity dataframe """ file_metadata = metadata.set_fb_meta( @@ -572,8 +570,7 @@ def map_to_fedefl_list( 'Unit', 'Context' ] - mapping_subset = self.source_config.get('fedefl_mapping', - self.source_name) + mapping_subset = self.config.get('fedefl_mapping', self.source_name) mapping_fields = [ 'SourceListName', 'SourceFlowName', @@ -592,7 +589,7 @@ def map_to_fedefl_list( 'SourceFlowContext' ] merge_type = 'inner' if drop_unmapped_rows else 'left' - if 'fedefl_mapping' in self.source_config: + if 'fedefl_mapping' in self.config: fba_merge_keys.remove('SourceName') mapping_merge_keys.remove('SourceListName') @@ -772,8 +769,8 @@ def convert_to_geoscale( if target_geoscale != geo.scale.NATIONAL: validation.compare_geographic_totals( fba_at_target_geoscale, self, - self.source_name, self.activity_config, - self.activity_set, self.activity_config['names'] + self.source_name, self.config, + self.activity_set, self.config['names'] # ^^^ TODO: Rewrite validation to use fb metadata ) @@ -807,12 +804,12 @@ def map_to_sectors( :param external_config_path: str, an external path to search for a crosswalk. ''' - if self.source_config['sector-like_activities']: + if self.config['sector-like_activities']: log.info('Activities in %s are NAICS codes.', self.source_name) try: - source_year = int(self.source_config + source_year = int(self.config .get('activity_schema', '')[6:10]) except ValueError: source_year = 2012 @@ -846,7 +843,7 @@ def map_to_sectors( activity_to_source_naics_crosswalk = ( sectormapping.get_activitytosector_mapping( # ^^^ TODO: Replace or streamline get_...() function - (self.source_config.get('activity_to_sector_mapping') + (self.config.get('activity_to_sector_mapping') or self.source_name), fbsconfigpath=external_config_path) .astype('object') @@ -1053,7 +1050,7 @@ def getFlowBySector( the FBS from EPA's remote server rather than generating it (if not found locally) :kwargs: keyword arguments to pass to _getFlowBy(). Possible kwargs - include source_name and source_config. + include source_name and config. :return: FlowBySector dataframe ''' file_metadata = metadata.set_fb_meta(method, 'FlowBySector') @@ -1108,7 +1105,7 @@ def generateFlowBySector( source_config, method_config, external_config_path ), source_name=source_name, - source_config=source_config + config=source_config ) else: # TODO: Test this section. source_data = FlowBySector.getFlowBySector( @@ -1117,7 +1114,7 @@ def generateFlowBySector( download_sources_ok=download_sources_ok, download_fbs_ok=download_sources_ok, source_name=source_name, - source_config=source_config + config=source_config ) fbs = ( @@ -1138,7 +1135,7 @@ def generateFlowBySector( source_name=source_name, year=source_config['year'], download_ok=download_sources_ok, - source_config=source_config + config=source_config ) fba = (source_data @@ -1170,7 +1167,8 @@ def generateFlowBySector( ) activity_set_fba.activity_set = activity_set - activity_set_fba.activity_config = activity_config + activity_set_fba.config = {**source_config, + **activity_config} if 'source_flows' in activity_config: activity_set_fba = ( From 81a08f60569683ff8379d89e3304bb5ce955d592 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 13 Jun 2022 08:52:27 -0400 Subject: [PATCH 0083/1127] Partial, unstable implementation of recursion --- flowsa/__init__.py | 2 +- flowsa/flowby.py | 538 ++++++++++++++++++++++++++------------------- 2 files changed, 318 insertions(+), 222 deletions(-) diff --git a/flowsa/__init__.py b/flowsa/__init__.py index 0f4cb78cf..db6d1768f 100644 --- a/flowsa/__init__.py +++ b/flowsa/__init__.py @@ -37,7 +37,7 @@ def getFlowByActivity(datasource, year, flowclass=None, geographic_level=None, download_FBA_if_missing=DEFAULT_DOWNLOAD_IF_MISSING): fba = FlowByActivity.getFlowByActivity( - source_name=datasource, + full_name=datasource, year=int(year), download_ok=download_FBA_if_missing ) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 342d1ea06..84daaa0a9 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -18,11 +18,10 @@ class _FlowBy(pd.DataFrame): - _metadata = ['source_name', 'config', 'activity_set'] + _metadata = ['full_name', 'config'] - source_name: str + full_name: str config: dict - activity_set: str def __init__( self, @@ -90,10 +89,15 @@ def __finalize__(self, other, method=None, **kwargs): # merge operation: using metadata of the left object if method == "merge": - for name in self._metadata: - object.__setattr__(self, name, getattr(other.left, name, None)) + for attribute in self._metadata: + object.__setattr__(self, attribute, + getattr(other.left, attribute, None)) return self + @property + def source_name(self) -> str: + return self.full_name.split('.', maxsplit=1)[0] + @property def flow_col(self) -> str: return 'Flowable' if 'Flowable' in self else 'FlowName' @@ -111,7 +115,7 @@ def _getFlowBy( flowby_generator: partial, output_path: str, *, - source_name: str = None, + full_name: str = None, config: dict = None, ) -> '_FlowBy': for attempt in ['import local', 'download', 'generate']: @@ -150,7 +154,7 @@ def _getFlowBy( '%s %s could not be found locally, downloaded, or generated', file_metadata.name_data, file_metadata.category ) - fb = cls(df, source_name=source_name, config=config) + fb = cls(df, full_name=full_name, config=config) return fb @staticmethod @@ -289,6 +293,12 @@ def conditional_method( else: return self + def function_socket(self: FB, function_name: str, *args, **kwargs) -> FB: + if function_name in self.config: + return self.config[function_name](self, *args, **kwargs) + else: + return self + def standardize_units(self: FB) -> FB: """ Standardizes units. Timeframe is annual. @@ -335,19 +345,80 @@ def select_flows(self: FB, source_flows: list or dict) -> FB: :param flows: list or dict. Either a list of flows to select, or a dict whose keys are the flows to select and whose values are the new - names to assign to those flows. + names to assign to those flows. Or None, in which case no + filtering is performed. :return: FlowBy dataset, filtered to the given flows, and with those flows possibly renamed. ''' - selected_fb = ( - self - .query(f'{self.flow_col} in @source_flows') - .conditional_method(isinstance(source_flows, dict), - 'replace', - {self.flow_col: source_flows}) - .reset_index(drop=True) - ) - return selected_fb + if source_flows is not None: + return ( + self + .query(f'{self.flow_col} in @source_flows') + .conditional_method(isinstance(source_flows, dict), + 'replace', + {self.flow_col: source_flows}) + .reset_index(drop=True) + ) + else: + return self + + def select_by_fields(self: FB) -> FB: + ''' + Filter the calling FlowBy dataset according to the 'selection_fields' + dictionary from the calling datasets config dictionary. If such a + dictionary is not given, the calling dataset is returned unchanged. + + The selection_fields dictionary should associate FBA or FBS + fields/column names with lists of the values to be selected from + each column. For example: + + selection_fields: + FlowName: + - CO2 + - CH4 + + Alternatively, instead of a list of values, a dictionary may be + given which associates the values to select with a replacement value: + + selection_fields: + FlowName: + CO2: Carbon Dioxide + CH4: Methane + + Finally, if the selection_fields dictionary contains the keys + 'Activity' or 'Sector', rows which contain the given values in either + the relevant ...ProducedBy or ...ConsumedBy columns will be selected. + ''' + if 'selection_fields' not in self.config: + return self + + selection_fields = { + k: v for k, v in self.config['selection_fields'].items() + if k not in ['Activity', 'Sector'] + } + activity_sector_fields = { + k: v for k, v in self.config['selection_fields'].items() + if k in ['Activity', 'Sector'] + } + + filtered_fb = self + for field, values in selection_fields.items(): + filtered_fb = filtered_fb.query(f'{field} in @values') + for field, values in activity_sector_fields.items(): + filtered_fb = filtered_fb.query(f'{field}ProducedBy in @values ' + f'| {field}ConsumedBy in @values') + + replace_dict = { + **{k: v for k, v in selection_fields.items() + if isinstance(v, dict)}, + **{f'{k}ProducedBy': v for k, v in activity_sector_fields.items() + if isinstance(v, dict)}, + **{f'{k}ConsumedBy': v for k, v in activity_sector_fields.items() + if isinstance(v, dict)} + } + + replaced_fb = filtered_fb.replace(replace_dict) + return replaced_fb def aggregate_flowby( self: FB, @@ -411,60 +482,70 @@ def aggregate_flowby( # otherwise, columns of NaN will become float dtype. return aggregated - def add_primary_secondary_sectors(self: FB) -> FB: + def add_primary_secondary_columns( + self: FB, + col_type: Literal['Activity', 'Sector'] + ) -> FB: ''' - This function adds to the calling dataframe 'PrimarySector' and - 'SecondarySector' columns based on the 'SectorProducedBy' and - 'SectorConsumedBy' columns, and logic based on the type of flow. The - original dataset is returned unchanged if it lacks 'SectorProducedBy' - or 'SectorConsumedBy' columns. - - If the flow type is TECHNOSPHERE_FLOW, the primary sector is - SectorConsumedBy. Otherwise, it is SectorProducedBy unless only - SectorConsumedBy is given, or if both are given and SectorProducedBy - is one of 22, 221, 2213, 22131, or 221310 AND SectorConsumedBy is one + This function adds to the calling dataframe 'Primary...' and + 'Secondary...' columns (where ... is specified by col_type, as either + 'Activity' or 'Sector') based on the '...ProducedBy' and + '...ConsumedBy' columns, and logic based on the type of flow. The + original dataset is returned unchanged if it lacks '...ProducedBy' + or '...ConsumedBy' columns. + + If the flow type is TECHNOSPHERE_FLOW, the primary sector or activity + is ...ConsumedBy. Otherwise, it is ...ProducedBy unless only + ...ConsumedBy is given, or if both are given and ...ProducedBy + is one of 22, 221, 2213, 22131, or 221310 AND ...ConsumedBy is one of F010, F0100, or F01000. - In all cases, the secondary sector is the "other" sector if both are - given. In many cases, only one of SectorProducedBy or SectorConsumedBy - is given, and therefore SecondarySector is null. + In all cases, the secondary sector or activity is the other one if both + are given. In many cases, only one of ...ProducedBy or ...ConsumedBy + is given, and therefore Secondary... is null. - :return: FlowBy dataset, with 'PrimarySector' and 'SecondarySector' + :param col_type: str, one of 'Activity' or 'Sector', specifies whether + primary and secondary activities or primary and secondary sectors + should be added. + :return: FlowBy dataset, with 'Primary...' and 'Secondary...' columns added, if possible; otherwise, the unmodified caling FlowBy dataset. ''' - if 'SectorProducedBy' not in self or 'SectorConsumedBy' not in self: - log.error('Cannot add PrimarySector or SecondarySector columns, ' - 'since SectorProducedBy and/or SectorConsumedBy columns ' - 'are missing.') + if (f'{col_type}ProducedBy' not in self + or f'{col_type}ConsumedBy' not in self): + log.error(f'Cannot add Primary{col_type} or Secondary{col_type} ' + f'columns, since {col_type}ProducedBy and/or ' + f'{col_type}ConsumedBy columns are missing.') return self else: - log.info('Adding PrimarySector and SecondarySector columns from ' - 'SectorProducedBy and SectorConsumedBy columns.') + log.info(f'Adding Primary{col_type} and Secondary{col_type} ' + f'columns from {col_type}ProducedBy and ' + f'{col_type}ConsumedBy columns.') fb = self.assign( - PrimarySector=self.SectorProducedBy.mask( + **{f'Primary{col_type}': self[f'{col_type}ProducedBy'].mask( (self.FlowType == 'TECHNOSPHERE_FLOW') - | (self.SectorProducedBy.isna()) - | (self.SectorProducedBy.isin( + | (self[f'{col_type}ProducedBy'].isna()) + | (self[f'{col_type}ProducedBy'].isin( ['22', '221', '2213', '22131', '221310'] ) - & self.SectorConsumedBy.isin( + & self[f'{col_type}ConsumedBy'].isin( ['F010', 'F0100', 'F01000'] )), - self.SectorConsumedBy - ) + self[f'{col_type}ConsumedBy'] + )} ) - def _identify_secondary_sector(row: _FlowBySeries) -> str: - sectors = [row.SectorProducedBy, row.SectorConsumedBy] - sectors.remove(row.PrimarySector) + def _identify_secondary(row: _FlowBySeries) -> str: + sectors = [row[f'{col_type}ProducedBy'], + row[f'{col_type}ConsumedBy']] + sectors.remove(row[f'Primary{col_type}']) return sectors[0] fb = fb.assign( - SecondarySector=( - fb.apply(_identify_secondary_sector, axis='columns') + **{f'Secondary{col_type}': ( + fb.apply(_identify_secondary, axis='columns') # ^^^ Applying with axis='columns' applies TO each row. - .astype('object')) + .astype('object'))} ) return fb @@ -519,8 +600,9 @@ def _constructor_sliced(self) -> '_FBASeries': @classmethod def getFlowByActivity( cls, - source_name: str, + full_name: str, year: int = None, + config: dict = None, download_ok: bool = settings.DEFAULT_DOWNLOAD_IF_MISSING, **kwargs ) -> 'FlowByActivity': @@ -536,13 +618,16 @@ def getFlowByActivity( include config. :return: a FlowByActivity dataframe """ + if year is None and isinstance(config, dict): + year = config.get('year') + file_metadata = metadata.set_fb_meta( - source_name if year is None else f'{source_name}_{year}', + full_name if year is None else f'{full_name}_{year}', 'FlowByActivity' ) flowby_generator = partial( flowbyactivity.main, - source=source_name, + source=full_name, year=year ) return super()._getFlowBy( @@ -550,8 +635,8 @@ def getFlowByActivity( download_ok=download_ok, flowby_generator=flowby_generator, output_path=settings.fbaoutputpath, - source_name=source_name, - **kwargs + full_name=full_name, + config=config ) # TODO: probably only slight modification is needed to allow for material @@ -776,10 +861,49 @@ def convert_to_geoscale( return fba_at_target_geoscale - def map_to_sectors( + def attribute_flows_to_sectors( self: 'FlowByActivity', industry_spec: dict, - target_year: Literal[2002, 2007, 2012, 2017] = None, + target_year: Literal[2002, 2007, 2012, 2017] = 2012, + external_config_path: str = None + ) -> 'FlowByActivity': + ''' + The calling FBA has its activities mapped to sectors, then its flows + attributed to those sectors, by the methods specified in the calling + FBA's configuration dictionary. + ''' + mapped_fba = ( + self + .map_to_sectors(industry_spec, target_year, external_config_path) + .conditional_pipe('clean_fba_w_sec_df_fxn' in self.config, + self.config.get('clean_fba_w_sec_df_fxn'), + attr=self.config, + method=self.config) + .rename(columns={'SourceName': 'MetaSources'}) + .drop(columns=['FlowName', 'Compartment']) + ) + + allocation_method = mapped_fba.config.get('allocation_method') + if allocation_method == 'proportional': + attributed_fba = mapped_fba.proportionally_attribute( + FlowByActivity.getFlowByActivity( + mapped_fba.config['allocation_source']) + .convert_to_fbs() + ) + elif allocation_method == 'proportional-flagged': + attributed_fba = mapped_fba.flagged_proportionally_attribute() + else: + attributed_fba = mapped_fba.equally_attribute() + + aggregated_fba = attributed_fba.aggregate_flowby() + + # TODO: Insert validation here. + + return aggregated_fba + + def map_to_sectors( + self: 'FlowByActivity', + target_year: Literal[2002, 2007, 2012, 2017] = 2012, external_config_path: str = None ) -> 'FlowByActivity': ''' @@ -829,7 +953,7 @@ def map_to_sectors( fba_w_naics = ( fba_w_naics .merge( - naics.industry_spec_key(industry_spec), + naics.industry_spec_key(self.config['industry_spec']), how='left', left_on=f'Activity{direction}', right_on='source_naics') @@ -874,7 +998,7 @@ def map_to_sectors( 'industry/sector aggregation structure.') activity_to_target_naics_crosswalk = ( activity_to_source_naics_crosswalk - .merge(naics.industry_spec_key(industry_spec), + .merge(naics.industry_spec_key(self.config['industry_spec']), how='left', left_on='Sector', right_on='source_naics') .assign(Sector=lambda x: x.target_naics) .drop(columns=['source_naics', 'target_naics']) @@ -982,6 +1106,81 @@ def equally_attribute(self: 'FlowByActivity') -> 'FlowByActivity': *[f'_unique_naics_{n}_by_group' for n in range(2, 8)]] ) + def proportionally_attribute(self: 'FlowByActivity'): + raise NotImplementedError + + def flagged_proportionally_attribute(self: 'FlowByActivity'): + raise NotImplementedError + + def convert_to_fbs(self: 'FlowByActivity') -> 'FlowBySector': + if 'activity_sets' in self.config: + return pd.concat([fba.convert_to_fbs() + for fba in self.activity_sets]) + + return ( + self + .conditional_pipe( + 'clean_fba_before_mapping_df_fxn' in self.config, + self.config.get('clean_fba_before_mapping_df_fxn')) + .filter_by_fields() + .standardize_units_and_flows() + .conditional_pipe('clean_fba_df_fxn' in self.config, + self.config.get('clean_fba_df_fxn')) + .convert_to_geoscale() + .attribute_flows_to_sectors() # recursive call to convert_to_fbs + ) + + @property + def activity_sets(self) -> List['FlowByActivity']: + ''' + This function breaks up an FBA datset into its activity sets, if its + config dictionary specifies activity sets, and returns a list of the + resulting FBAs. Otherwise, it returns a list containing the calling + FBA. + + First, the primary activity is determined (for the underlying logic, + see documentation for add_primary_secondary_columns()), then the + partitioning is done based on the primary activity. This ensures that + the order activity sets are listed in cannot change the partitioning. + An error is logged if any names are in multiple activity sets. + ''' + if 'activity_sets' in self.config: + activities = self.config['activity_sets'] + parent_config = {k: v for k, v in self.config.items() + if k != 'activity_sets' and not k.startswith('_')} + parent_fba = self.add_primary_secondary_columns('Activity') + + child_fba_list = [] + assigned_names = set() + for activity_set, activity_config in activities.items(): + activity_names = set(activity_config['names']) + + if activity_names & assigned_names: + log.error('Some names in multiple activity sets. This ' + 'will lead to double-counting: %s', + activity_names & assigned_names) + + child_fba = ( + parent_fba + .query('PrimaryActivity in @activity_names') + .drop(columns=['PrimaryActivity', 'SecondaryActivity']) + .reset_index(drop=True) + ) + child_fba.name += f'.{activity_set}' + child_fba.config = {**parent_config, **activity_config} + + child_fba_list.append(child_fba) + assigned_names.update(activity_names) + + return child_fba_list + else: + return [self] + + def standardize_units_and_flows( + self: 'FlowByActivity' + ) -> 'FlowByActivity': + raise NotImplementedError + class FlowBySector(_FlowBy): _metadata = [*_FlowBy()._metadata] @@ -1085,171 +1284,68 @@ def generateFlowBySector( generating them. ''' log.info('Beginning FlowBySector generation for %s', method) + source_catalog = common.load_yaml_dict('source_catalog') method_config = common.load_yaml_dict(method, 'FBS', external_config_path) - sources = method_config['source_names'] - source_catalog = common.load_yaml_dict('source_catalog') - - source_fbs_list = [] - for source_name, source_config in sources.items(): - source_config = { - **source_catalog.get( - common.return_true_source_catalog_name(source_name), {}), - **source_config - } - - if source_config['data_format'] in ['FBS', 'FBS_outside_flowsa']: - if source_config['data_format'] == 'FBS_outside_flowsa': - source_data = FlowBySector( - source_config['FBS_datapull_fxn']( - source_config, method_config, external_config_path - ), - source_name=source_name, - config=source_config - ) - else: # TODO: Test this section. - source_data = FlowBySector.getFlowBySector( - method=source_name, - external_config_path=external_config_path, - download_sources_ok=download_sources_ok, - download_fbs_ok=download_sources_ok, - source_name=source_name, - config=source_config - ) - - fbs = ( - source_data - .conditional_pipe('clean_fbs_df_fxn' in source_config, - source_config.get('clean_fbs_df_fxn')) - .conditional_method('source_flows' in source_config, - 'select_flows', - source_config.get('source_flows')) - .update_fips_to_geoscale(method_config['target_geoscale']) - ) - - log.info('Appending %s to FBS list', source_name) - source_fbs_list.append(fbs) - - if source_config['data_format'] == 'FBA': - source_data = FlowByActivity.getFlowByActivity( - source_name=source_name, - year=source_config['year'], - download_ok=download_sources_ok, - config=source_config - ) - - fba = (source_data - .query(f'Class == \'{source_config["class"]}\'') - # TODO: source_config keys not currently handled: - # TODO: 'source_fba_load_scale', 'apply_urban_rural', - .conditional_pipe( - 'clean_fba_before_mapping_df_fxn' in source_config, - source_config.get('clean_fba_before_mapping_df_fxn') - ) - .map_to_fedefl_list() - .conditional_pipe( - 'clean_fba_df_fxn' in source_config, - source_config.get('clean_fba_df_fxn'))) - - activities = source_config['activity_sets'] - - for activity_set, activity_config in activities.items(): - log.info('Preparing to process %s in %s', - activity_set, source_name) - - activity_names = activity_config['names'] - - activity_set_fba = ( - fba - .query('ActivityProducedBy in @activity_names' - '| ActivityConsumedBy in @activity_names') - .reset_index(drop=True) - ) - - activity_set_fba.activity_set = activity_set - activity_set_fba.config = {**source_config, - **activity_config} - - if 'source_flows' in activity_config: - activity_set_fba = ( - activity_set_fba - .select_flows(activity_config['source_flows']) - ) - - if activity_set_fba.empty: - log.error('No data for flows in %s', activity_set) - continue - if (activity_set_fba.FlowAmount == 0).all(): - log.warning('All flows for %s are 0', activity_set) - continue - - # TODO: source_catalog key not currently handled: - # TODO: 'sector-like_activities' - - assert isinstance(activity_set_fba, FlowByActivity) - - target_geoscale = max( - source_config['geoscale_to_use'], - activity_config['allocation_from_scale'], - key=geo.scale.from_string - ) - activity_set_fba = (activity_set_fba - .convert_to_geoscale(target_geoscale)) - - assert isinstance(activity_set_fba, FlowByActivity) - - activity_set_fba = ( - activity_set_fba - .map_to_sectors( - industry_spec=method_config[ - 'target_industry_spec'], - target_year=method_config['target_naics_year'], - external_config_path=external_config_path - ) - .conditional_pipe( - 'clean_fba_w_sec_df_fxn' in source_config, - source_config.get('clean_fba_w_sec_df_fxn'), - attr=activity_config, - method=method_config - ) - .rename(columns={'SourceName': 'MetaSources'}) - .drop(columns=['FlowName', 'Compartment']) - ) - - assert isinstance(activity_set_fba, FlowByActivity) - - if activity_config['allocation_method'] == 'direct': - log.info('Attributing flows in %s to sectors using ' - 'direct attribution method', activity_set) - fbs = activity_set_fba.equally_attribute() - elif (activity_config['allocation_method'] - == 'allocation_function'): - log.info( - 'Attributing flows in %s to sectors using ' - 'function: %s.%s', - activity_set, - activity_config['allocation_source'].__module__, - activity_config['allocation_source'].__name__ - ) - fbs = activity_config['allocation_source']( - activity_set_fba, - activity_config, - source_fbs_list - ) - elif (activity_config['allocation_method'] - == 'proportional'): - pass - - fba = fba.query( - 'ActivityProducedBy not in @activity_names' - '& ActivityConsumedBy not in @activity_names' - ) - - log.info('Appending %s from %s to FBS list', - activity_set, source_name) - source_fbs_list.append(fbs) + sources = method_config.pop('source_names') + + source_fba_list = [ + FlowByActivity.getFlowByActivity( + full_name=source_name, + config={ + **method_config, + 'fbs_method_config_keys': method_config.keys(), + **source_catalog.get( + common.return_true_source_catalog_name(source_name), + {}), + **config + }, + download_ok=download_sources_ok + ) + .select_by_fields() + .map_to_fedefl_list() + # .convert_to_geoscale(method_config['target_geoscale']) + for source_name, config in sources.items() + if config['data_format'] == 'FBA' + ] + source_fbs_list = [ + FlowBySector.getFlowBySector( + method=source_name, + name=source_name, + config={ + **method_config, + 'fbs_method_config_keys': method_config.keys(), + **source_catalog.get( + common.return_true_source_catalog_name(source_name), + {}), + **config + }, + external_config_path=external_config_path, + download_sources_ok=download_sources_ok, + download_fbs_ok=download_sources_ok, + ) + .function_socket('clean_fbs_df_fxn') + .select_flows(config.get('source_flows')) + .update_fips_to_geoscale(method_config['target_geoscale']) + for source_name, config in sources.items() + if config['data_format'] == 'FBS' + ] + source_external_fbs_list = [ + FlowBySector( + config['FBS_datapull_fxn']( + config, method_config, external_config_path + ), + full_name=source_name, + config=config + ) + .function_socket('clean_fbs_df_fxn') + .select_by_fields() + .update_fips_to_geoscale(method_config['target_geoscale']) + for source_name, config in sources.items() + if config['data_format'] == 'FBS_outside_flowsa' + ] - return source_fbs_list + return source_fba_list[0] # The three classes extending pd.Series, together with the _constructor... From e8a6ca7f59582bd6ef4c6613832487404ff2e735 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 13 Jun 2022 08:53:23 -0400 Subject: [PATCH 0084/1127] Recursion partially implemented(still in progress) --- flowsa/data/source_catalog.yaml | 4 +- .../CAP_HAP_national_2017.yaml | 78 ++++++++++--------- .../flowbysectormethods/SEEA_2017_v1.yaml | 39 ++++++---- 3 files changed, 69 insertions(+), 52 deletions(-) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index bfe15eedb..9281c0bbc 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -122,11 +122,13 @@ EPA_GHGI: activity_schema: sector_aggregation_level: "aggregated" EPA_NEI_Nonpoint: + data_format: FBA class: - Chemicals sector-like_activities: False activity_schema: SCC - sector_aggregation_level: "aggregated" + fedefl_mapping: NEI + # sector_aggregation_level: "aggregated" EPA_NEI_Nonroad: class: - Chemicals diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index 3a11a3bc2..60bc0c962 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -4,25 +4,26 @@ target_geoscale: national _allocation_types: _mecs_allocation: &mecs_allocation - # names: # override this - allocation_source: "EIA_MECS_Energy" allocation_method: proportional - allocation_source_class: "Energy" - allocation_source_year: 2014 - # allocation_flow: # override this - # - "Coal" - allocation_compartment: None - allocation_from_scale: national - clean_allocation_fba: !script_function:EIA_MECS mecs_energy_fba_cleanup - clean_allocation_fba_w_sec: !script_function:EIA_MECS eia_mecs_energy_clean_allocation_fba_w_sec - helper_source: "BLS_QCEW" - helper_method: proportional-flagged - helper_source_class: "Employment" - helper_source_year: 2014 - helper_flow: None - helper_from_scale: national - clean_helper_fba: !script_function:BLS_QCEW clean_bls_qcew_fba - clean_helper_fba_wsec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec + allocation_source: + EIA_MECS_Energy: + class: Energy + year: 2014 + geoscale: national + # flows: + # - Coal # override this. However, can't override inside nested as easily with my set up. Ponder on this. + allocation_compartment: None + clean_fba_df_fxn: !script_function:EIA_MECS mecs_energy_fba_cleanup + clean_fba_w_sec_df_fxn: !script_function:EIA_MECS eia_mecs_energy_clean_allocation_fba_w_sec + allocation_method: proportional-flagged + allocation_source: + BLS_QCEW: + class: Employment + year: 2014 + geoscale: national + flows: None # Verify what this does + clean_fba_df_fxn: !script_function:BLS_QCEW clean_bls_qcew_fba + clean_fba_wsec_df_fxn: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec _use_allocation: &use_allocation # names: # override this @@ -49,37 +50,42 @@ _allocation_types: source_names: - "EPA_NEI_Nonpoint": - data_format: 'FBA' + EPA_NEI_Nonpoint: + # data_format: 'FBA' class: Chemicals - geoscale_to_use: state + geoscale: state year: 2017 activity_to_sector_mapping: 'SCC' clean_fba_df_fxn: !script_function:EPA_NEI clean_NEI_fba_no_pesticides - fedefl_mapping: 'NEI' + # fedefl_mapping: 'NEI' activity_sets: direct_allocation: names: !from_index:NEI_Nonpoint_2017_asets.csv direct_allocation - allocation_method: direct - allocation_source: None - allocation_from_scale: national + # ^^^ "names" defines how the partitioning occurs + attribution_method: direct + # allocation_source: None + # allocation_from_scale: national # Not sure how to integrate this. cropland: names: !from_index:NEI_Nonpoint_2017_asets.csv cropland - allocation_source: "USDA_CoA_Cropland" - allocation_method: proportional - allocation_source_class: "Land" - allocation_source_year: 2017 - allocation_flow: - - "AREA HARVESTED" - allocation_compartment: None - allocation_from_scale: state - clean_allocation_fba: !script_function:USDA_CoA_Cropland coa_irrigated_cropland_fba_cleanup - clean_allocation_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland: + class: Land + year: 2017 + flows: + - AREA HARVESTED + allocation_compartment: None + geoscale: state + clean_fba_df_fxn: !script_function:USDA_CoA_Cropland coa_irrigated_cropland_fba_cleanup + clean_fba_w_sec_df_fxn: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics + # OR + attribution_method: function + attribution function: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics # wrapped in an appropriate aggregation industry_combustion_coal: #only allocating to 3digits <<: *mecs_allocation names: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_coal allocation_flow: - - "Coal" + - Coal industry_combustion_coke: #only allocating to 3digits <<: *mecs_allocation names: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_coke diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index 9b2c9898b..fd872b1c5 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -23,8 +23,6 @@ _ghgi_parameters: &ghgi_parameters _allocation_types: _direct_allocation: &direct_allocation allocation_method: direct - allocation_source: None - allocation_from_scale: national _use_allocation: &use_allocation # names: # - "Liming" # Need to specify an activity name @@ -78,8 +76,9 @@ source_names: # FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector # inventory_dict: {'NEI': '2017'} # local_inventory_name: NEI_TRI_air_2017 - # source_flows: # Remember GHGs should not be drawn from NEI - # Particulate matter, ≤ 2.5μm: PM 2.5 + # selection_fields: # Remember GHGs should not be drawn from NEI + # Flowable: + # Particulate matter, ≤ 2.5μm: PM 2.5 # compartments: # - air # reassign_process_to_sectors: @@ -87,17 +86,27 @@ source_names: ## Agriculture EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues - <<: *ghgi_parameters - activity_sets: - activity_set_1: - <<: *direct_allocation - names: - - Chickpeas - - Cotton - - Maize - - Rice - - Soybeans - - Wheat + <<: [*ghgi_parameters, *direct_allocation] + selection_fields: + Activity: + - Chickpeas + - Cotton + - Maize + - Rice + - Soybeans + - Wheat + # EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues + # <<: *ghgi_parameters + # activity_sets: + # activity_set_1: + # <<: *direct_allocation + # names: + # - Chickpeas + # - Cotton + # - Maize + # - Rice + # - Soybeans + # - Wheat # "EPA_GHGI_T_5_3": &animals #CH4 from Enteric Fermentation # <<: *ghgi_parameters # activity_sets: From 7951b53cac9f4b948ba3f04846abbdec8f6d50bc Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 13 Jun 2022 09:13:16 -0400 Subject: [PATCH 0085/1127] opt. arg for convert_to_geoscale, select_by_fields --- flowsa/flowby.py | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 84daaa0a9..d0155c7de 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -362,7 +362,7 @@ def select_flows(self: FB, source_flows: list or dict) -> FB: else: return self - def select_by_fields(self: FB) -> FB: + def select_by_fields(self: FB, selection_fields: dict = None) -> FB: ''' Filter the calling FlowBy dataset according to the 'selection_fields' dictionary from the calling datasets config dictionary. If such a @@ -389,31 +389,33 @@ def select_by_fields(self: FB) -> FB: 'Activity' or 'Sector', rows which contain the given values in either the relevant ...ProducedBy or ...ConsumedBy columns will be selected. ''' - if 'selection_fields' not in self.config: + selection_fields = (selection_fields + or self.config.get('selection_fields')) + if 'selection_fields' is None: return self - selection_fields = { - k: v for k, v in self.config['selection_fields'].items() - if k not in ['Activity', 'Sector'] - } activity_sector_fields = { - k: v for k, v in self.config['selection_fields'].items() + k: v for k, v in selection_fields.items() if k in ['Activity', 'Sector'] } + other_fields = { + k: v for k, v in selection_fields.items() + if k not in ['Activity', 'Sector'] + } filtered_fb = self - for field, values in selection_fields.items(): - filtered_fb = filtered_fb.query(f'{field} in @values') for field, values in activity_sector_fields.items(): filtered_fb = filtered_fb.query(f'{field}ProducedBy in @values ' f'| {field}ConsumedBy in @values') + for field, values in other_fields.items(): + filtered_fb = filtered_fb.query(f'{field} in @values') replace_dict = { - **{k: v for k, v in selection_fields.items() - if isinstance(v, dict)}, **{f'{k}ProducedBy': v for k, v in activity_sector_fields.items() if isinstance(v, dict)}, **{f'{k}ConsumedBy': v for k, v in activity_sector_fields.items() + if isinstance(v, dict)}, + **{k: v for k, v in other_fields.items() if isinstance(v, dict)} } @@ -742,7 +744,7 @@ def convert_to_geoscale( self: 'FlowByActivity', target_geoscale: Literal['national', 'state', 'county', geo.scale.NATIONAL, geo.scale.STATE, - geo.scale.COUNTY] + geo.scale.COUNTY] = None ) -> 'FlowByActivity': ''' Converts, by filtering or aggregating (or both), the given dataset to @@ -778,6 +780,7 @@ def convert_to_geoscale( :return: FlowBy data set, with rows filtered or aggregated to the target geoscale. ''' + target_geoscale = target_geoscale or self.config.get('target_geoscale') if type(target_geoscale) == str: target_geoscale = geo.scale.from_string(target_geoscale) @@ -1119,18 +1122,14 @@ def convert_to_fbs(self: 'FlowByActivity') -> 'FlowBySector': return ( self - .conditional_pipe( - 'clean_fba_before_mapping_df_fxn' in self.config, - self.config.get('clean_fba_before_mapping_df_fxn')) - .filter_by_fields() + .function_socket('clean_fba_before_mapping_df_fxn') + .select_by_fields() .standardize_units_and_flows() - .conditional_pipe('clean_fba_df_fxn' in self.config, - self.config.get('clean_fba_df_fxn')) + .function_socket('clean_fba_df_fxn') .convert_to_geoscale() .attribute_flows_to_sectors() # recursive call to convert_to_fbs ) - @property def activity_sets(self) -> List['FlowByActivity']: ''' This function breaks up an FBA datset into its activity sets, if its @@ -1304,7 +1303,7 @@ def generateFlowBySector( ) .select_by_fields() .map_to_fedefl_list() - # .convert_to_geoscale(method_config['target_geoscale']) + .convert_to_geoscale() for source_name, config in sources.items() if config['data_format'] == 'FBA' ] From e3b19e72eda5539da8e9492db673ae7fe4ede0fc Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 13 Jun 2022 09:42:15 -0400 Subject: [PATCH 0086/1127] map_to_fedefl_list has default mapping_subset arg --- flowsa/flowby.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index d0155c7de..8ea1ce45c 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -391,7 +391,7 @@ def select_by_fields(self: FB, selection_fields: dict = None) -> FB: ''' selection_fields = (selection_fields or self.config.get('selection_fields')) - if 'selection_fields' is None: + if selection_fields is None: return self activity_sector_fields = { @@ -645,19 +645,16 @@ def getFlowByActivity( # flow list mapping using this function as well. def map_to_fedefl_list( self: 'FlowByActivity', + mapping_subset: str = None, drop_fba_columns: bool = False, drop_unmapped_rows: bool = False ) -> 'FlowByActivity': - log.info('Mapping flows in %s to federal elementary flow list', - self.source_name) - fba_merge_keys = [ 'SourceName', 'Flowable', 'Unit', 'Context' ] - mapping_subset = self.config.get('fedefl_mapping', self.source_name) mapping_fields = [ 'SourceListName', 'SourceFlowName', @@ -676,9 +673,16 @@ def map_to_fedefl_list( 'SourceFlowContext' ] merge_type = 'inner' if drop_unmapped_rows else 'left' - if 'fedefl_mapping' in self.config: + + if mapping_subset is not None or 'fedefl_mapping' in self.config: fba_merge_keys.remove('SourceName') mapping_merge_keys.remove('SourceListName') + mapping_subset = (mapping_subset + or self.config.get('fedefl_mapping') + or self.source_names) + + log.info('Mapping flows in %s to federal elementary flow list', + self.source_name) if any(self.Unit.str.contains('/d')): log.info('Converting daily flows %s to annual', From 207a8f93d077bb0b9fc6b97f23b419bdf322c614 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 13 Jun 2022 10:21:15 -0400 Subject: [PATCH 0087/1127] Fix attribute_flows_to_sectors() --- flowsa/flowby.py | 55 +++++++++++++------ .../flowbysectormethods/SEEA_2017_v1.yaml | 2 +- 2 files changed, 40 insertions(+), 17 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 8ea1ce45c..d0841e277 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -870,8 +870,6 @@ def convert_to_geoscale( def attribute_flows_to_sectors( self: 'FlowByActivity', - industry_spec: dict, - target_year: Literal[2002, 2007, 2012, 2017] = 2012, external_config_path: str = None ) -> 'FlowByActivity': ''' @@ -879,30 +877,54 @@ def attribute_flows_to_sectors( attributed to those sectors, by the methods specified in the calling FBA's configuration dictionary. ''' - mapped_fba = ( + fba: 'FlowByActivity' = ( self - .map_to_sectors(industry_spec, target_year, external_config_path) - .conditional_pipe('clean_fba_w_sec_df_fxn' in self.config, - self.config.get('clean_fba_w_sec_df_fxn'), - attr=self.config, - method=self.config) + .map_to_sectors(external_config_path=external_config_path) + .function_socket('clean_fba_w_sec_df_fxn', + attr=self.config, + method=self.config) .rename(columns={'SourceName': 'MetaSources'}) .drop(columns=['FlowName', 'Compartment']) ) - allocation_method = mapped_fba.config.get('allocation_method') + allocation_method = fba.config.get('allocation_method') if allocation_method == 'proportional': - attributed_fba = mapped_fba.proportionally_attribute( - FlowByActivity.getFlowByActivity( - mapped_fba.config['allocation_source']) - .convert_to_fbs() + allocation_source = fba.config['allocation_source'] + attributed_fba = ( + fba + .proportionally_attribute( + FlowByActivity.getFlowByActivity( + allocation_source, + config={ + **{k: v for k, v in fba.config.items() + if k in fba.config['fbs_method_config_keys']}, + **fba.config['allocation_source'] + } + ) + .convert_to_fbs() + ) ) elif allocation_method == 'proportional-flagged': - attributed_fba = mapped_fba.flagged_proportionally_attribute() + allocation_source = fba.config['allocation_source'] + attributed_fba = ( + fba + .flagged_proportionally_attribute( + FlowByActivity.getFlowByActivity( + allocation_source, + config={ + **{k: v for k, v in fba.config.items() + if k in fba.config['fbs_method_config_keys']}, + **fba.config['allocation_source'] + } + ) + .convert_to_fbs() + ) + ) else: - attributed_fba = mapped_fba.equally_attribute() + attributed_fba = fba.equally_attribute() aggregated_fba = attributed_fba.aggregate_flowby() + # ^^^ TODO: move to convert_to_fbs(), after dropping Activity cols? # TODO: Insert validation here. @@ -1077,7 +1099,7 @@ def equally_attribute(self: 'FlowByActivity') -> 'FlowByActivity': SectorConsumedBy). If necessary, flow amounts are further (equally) subdivided based on the secondary sector. ''' - fba = self.add_primary_secondary_sectors() + fba = self.add_primary_secondary_columns('Sector') groupby_cols = [c for c in fba.columns if fba[c].dtype == 'object' and c not in ['SectorProducedBy', 'SectorConsumedBy', 'PrimarySector', 'SecondarySector', @@ -1308,6 +1330,7 @@ def generateFlowBySector( .select_by_fields() .map_to_fedefl_list() .convert_to_geoscale() + .attribute_flows_to_sectors() for source_name, config in sources.items() if config['data_format'] == 'FBA' ] diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index fd872b1c5..f03673d4d 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -6,7 +6,7 @@ # rather than the BEA 2012 IO schema !include:BEA_summary_target.yaml -target_industry_spec: +industry_spec: default: NAICS_3 '336': {default: NAICS_4} '541': {default: NAICS_4} From 77b2ec88f2cc642f8e7b7476e2b004e010e82348 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 13 Jun 2022 10:51:26 -0400 Subject: [PATCH 0088/1127] Tweaks --- flowsa/flowby.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index d0841e277..23b75a77e 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1100,10 +1100,10 @@ def equally_attribute(self: 'FlowByActivity') -> 'FlowByActivity': subdivided based on the secondary sector. ''' fba = self.add_primary_secondary_columns('Sector') - groupby_cols = [c for c in fba.columns if fba[c].dtype == 'object' - and c not in ['SectorProducedBy', 'SectorConsumedBy', - 'PrimarySector', 'SecondarySector', - 'Description']] + groupby_cols = [c for c in fba.groupby_cols + if c not in ['SectorProducedBy', 'SectorConsumedBy', + 'PrimarySector', 'SecondarySector', + 'Description']] for rank in ['Primary', 'Secondary']: fba = ( @@ -1144,7 +1144,7 @@ def flagged_proportionally_attribute(self: 'FlowByActivity'): def convert_to_fbs(self: 'FlowByActivity') -> 'FlowBySector': if 'activity_sets' in self.config: return pd.concat([fba.convert_to_fbs() - for fba in self.activity_sets]) + for fba in self.activity_sets()]) return ( self @@ -1327,10 +1327,7 @@ def generateFlowBySector( }, download_ok=download_sources_ok ) - .select_by_fields() - .map_to_fedefl_list() - .convert_to_geoscale() - .attribute_flows_to_sectors() + .convert_to_fbs() for source_name, config in sources.items() if config['data_format'] == 'FBA' ] From d0d597d7a78db86ad03a7d4fdbfe7f85ad0be20a Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 13 Jun 2022 12:45:06 -0400 Subject: [PATCH 0089/1127] Moved unit conversion to a csv --- flowsa/data/unit_conversion.csv | 19 ++++ flowsa/flowby.py | 174 ++++---------------------------- 2 files changed, 39 insertions(+), 154 deletions(-) create mode 100644 flowsa/data/unit_conversion.csv diff --git a/flowsa/data/unit_conversion.csv b/flowsa/data/unit_conversion.csv new file mode 100644 index 000000000..65871e9f5 --- /dev/null +++ b/flowsa/data/unit_conversion.csv @@ -0,0 +1,19 @@ +old_unit,new_unit,conversion_factor +ACRES,m2,4046.856422 +Acres,m2,4046.856422 +million sq ft,m2,92903 +million square feet,m2,92903 +square feet,m2,0.092903 +gallons/animal/day,kg,1383.35 +Mgal,kg,3790000 +gal,kg,3.79 +Bgal/d,kg,1383350000000 +Mgal/d,kg,1383350000 +million Cubic metres/year,kg,1000000000 +TON,kg,907.185 +LB,kg,0.45359 +ACRE FEET / ACRE,kg/m2,304.8000006 +gal/USD,kg/USD,3.79 +Quadrillion Btu,MJ,1055055900000 +Trillion Btu,MJ,1055055900 +Tbtu,MJ,1055055900 diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 23b75a77e..07bc30e32 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -62,7 +62,6 @@ def __init__( .fillna(fill_na_dict) .replace(null_string_dict) .astype(fields)) - data = self._standardize_units(data) if isinstance(data, pd.DataFrame) and column_order is not None: data = data[[c for c in column_order if c in data.columns] + [c for c in data.columns if c not in column_order]] @@ -157,155 +156,47 @@ def _getFlowBy( fb = cls(df, full_name=full_name, config=config) return fb - @staticmethod - def _standardize_units(fb: pd.DataFrame) -> pd.DataFrame: - days_in_year = 365 - ft2_to_m2 = 0.092903 - # rounded to match USGS_NWIS_WU mapping file on FEDEFL - gallon_water_to_kg = 3.79 - ac_ft_water_to_kg = 1233481.84 - acre_to_m2 = 4046.8564224 - mj_in_btu = .0010550559 - m3_to_gal = 264.172 - ton_to_kg = 907.185 - lb_to_kg = 0.45359 + def standardize_units(fb: pd.DataFrame) -> pd.DataFrame: exchange_rate = float( literature_values .get_Canadian_to_USD_exchange_rate(str(fb.Year.unique()[0])) ) - - fb = fb.assign(Unit=fb.Unit.str.strip()) + conversion_table = pd.concat([ + pd.read_csv(f'{settings.datapath}unit_conversion.csv'), + pd.Series({'old_unit': 'Canadian Dollar', + 'new_unit': 'USD', + 'conversion_factor': 1 / exchange_rate}).to_frame().T + ]) standardized = ( fb - .assign( - FlowAmount=( - fb.FlowAmount - .mask(fb.Unit.isin(['ACRES', 'Acres']), - fb.FlowAmount * acre_to_m2) - .mask(fb.Unit.isin(['million sq ft', - 'million square feet']), - fb.FlowAmount * 10**6 * ft2_to_m2) - .mask(fb.Unit.isin(['square feet']), - fb.FlowAmount * ft2_to_m2) - .mask(fb.Unit.isin(['Canadian Dollar']), - fb.FlowAmount / exchange_rate) - .mask(fb.Unit.isin(['gallons/animal/day']), - fb.FlowAmount * gallon_water_to_kg * days_in_year) - .mask(fb.Unit.isin(['ACRE FEET / ACRE']), - fb.FlowAmount / acre_to_m2 * ac_ft_water_to_kg) - .mask(fb.Unit.isin(['Mgal']), - fb.FlowAmount * 10**6 * gallon_water_to_kg) - .mask(fb.Unit.isin(['gal', 'gal/USD']), - fb.FlowAmount * gallon_water_to_kg) - .mask(fb.Unit.isin(['Bgal/d']), - fb.FlowAmount - * 10**9 * gallon_water_to_kg * days_in_year) - .mask(fb.Unit.isin(['Mgal/d']), - fb.FlowAmount - * 10**6 * gallon_water_to_kg * days_in_year) - .mask(fb.Unit.isin(['Quadrillion Btu']), - fb.FlowAmount * 10**15 * mj_in_btu) - .mask(fb.Unit.isin(['Trillion Btu', 'TBtu']), - fb.FlowAmount * 10**12 * mj_in_btu) - .mask(fb.Unit.isin(['million Cubic metres/year']), - fb.FlowAmount - * 10**6 * m3_to_gal * gallon_water_to_kg) - .mask(fb.Unit.isin(['TON']), - fb.FlowAmount * ton_to_kg) - .mask(fb.Unit.isin(['LB']), - fb.FlowAmount * lb_to_kg) - ), - Unit=( - fb.Unit - .mask(fb.Unit.isin(['ACRES', 'Acres', 'million sq ft', - 'million square feet', - 'square feet']), - 'm2') - .mask(fb.Unit.isin(['Canadian Dollar']), - 'USD') - .mask(fb.Unit.isin(['gallons/animal/day', 'Mgal', 'gal', - 'Bgal/d', 'Mgal/d', - 'million Cubic metres/year', - 'TON', 'LB']), - 'kg') - .mask(fb.Unit.isin(['ACRE FEET / ACRE']), - 'kg/m2') - .mask(fb.Unit.isin(['gal/USD']), - 'kg/USD') - .mask(fb.Unit.isin(['Quadrillion Btu', - 'Trillion Btu', 'TBtu']), - 'MJ') - ) - ) + .assign(Unit=fb.Unit.str.strip()) + .merge(conversion_table, how='left', + left_on='Unit', right_on='old_unit') + .assign(Unit=lambda x: x.new_unit.mask(x.new_unit.isna(), x.Unit), + conversion_factor=lambda x: x.conversion_factor.fillna(1), + FlowAmount=lambda x: x.FlowAmount * x.conversion_factor) + .drop(columns=['old_unit', 'new_unit', 'conversion_factor']) ) - standardized_units = ['m2', 'USD', 'kg', 'kg/m2', 'kg/USD', 'MJ'] + standardized_units = list(conversion_table.new_unit.unique()) if any(~standardized.Unit.isin(standardized_units)): - log.warning('Some units not standardized on import: %s. May not ' - 'be a problem, if they will be standardized later, ' - 'e.g. by mapping to the federal elementary flow list', + log.warning('Some units not standardized by standardize_units(): ' + '%s. May not be a problem, if they will be ' + 'standardized later, e.g. by mapping to the federal ' + 'elementary flow list', [unit for unit in standardized.Unit.unique() if unit not in standardized_units]) return standardized - def conditional_pipe( - self: FB, - condition: bool, - function: Callable, - *args, **kwargs - ) -> FB: - ''' - Similar to pandas .pipe() method, but first checks if the given - condition is true. If it is not, then the object that called - conditional_pipe is returned unchanged. Additional args and kwargs - are passed to function - :param condition: bool, condition under which the given function should - be called - :param function: Callable, function that expects a DataFrame or _FlowBy - as the first argument - :return: function(self, *args, **kwargs) if condition is True, - else self - ''' - if condition: - return function(self, *args, **kwargs) - else: - return self - - def conditional_method( - self: FB, - condition: bool, - method: str, - *args, **kwargs - ) -> FB: - ''' - Conditionally calls the specified method of the calling FlowBy. - Additional args and kwargs are passed to the method - :param condition: bool, condition under which the given method should - be called - :param function: str, name of FlowBy or DataFrame method - :return: self.method(*args, **kwargs) if condition is True, else self - ''' - if condition: - return getattr(self, method)(*args, **kwargs) - else: - return self - def function_socket(self: FB, function_name: str, *args, **kwargs) -> FB: if function_name in self.config: return self.config[function_name](self, *args, **kwargs) else: return self - def standardize_units(self: FB) -> FB: - """ - Standardizes units. Timeframe is annual. - :return: FlowBy dataframe, with standardized units - """ - return self._standardize_units(self) - def update_fips_to_geoscale( self: FB, to_geoscale: Literal['national', 'state', 'county', @@ -316,7 +207,7 @@ def update_fips_to_geoscale( Sets FIPS codes to 5 digits by zero-padding FIPS codes at the specified geoscale on the right (county geocodes are unmodified, state codes are generally padded with 3 zeros, and the "national" FIPS code is set to - 00000, the value in flowsa.location.US_FIPS) + 00000) :param to_geoscale: str, target geoscale :return: FlowBy dataset with 5 digit fips """ @@ -337,31 +228,6 @@ def update_fips_to_geoscale( log.error('No FIPS level corresponds to the given geoscale: %s', to_geoscale) - def select_flows(self: FB, source_flows: list or dict) -> FB: - ''' - Filters the FlowBy dataset to the flows named in source_flows. If - source_flows is a dict, selects flows according to the keys and - renames them to the associated values. - - :param flows: list or dict. Either a list of flows to select, or a dict - whose keys are the flows to select and whose values are the new - names to assign to those flows. Or None, in which case no - filtering is performed. - :return: FlowBy dataset, filtered to the given flows, and with those - flows possibly renamed. - ''' - if source_flows is not None: - return ( - self - .query(f'{self.flow_col} in @source_flows') - .conditional_method(isinstance(source_flows, dict), - 'replace', - {self.flow_col: source_flows}) - .reset_index(drop=True) - ) - else: - return self - def select_by_fields(self: FB, selection_fields: dict = None) -> FB: ''' Filter the calling FlowBy dataset according to the 'selection_fields' From de02a7ee1f43f96602739e6b9b70272a34f63493 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 13 Jun 2022 15:00:58 -0400 Subject: [PATCH 0090/1127] Modified unit standardization --- flowsa/data/unit_conversion.csv | 5 ++-- flowsa/flowby.py | 49 ++++++++++++++++++++++++++------- 2 files changed, 41 insertions(+), 13 deletions(-) diff --git a/flowsa/data/unit_conversion.csv b/flowsa/data/unit_conversion.csv index 65871e9f5..edb589425 100644 --- a/flowsa/data/unit_conversion.csv +++ b/flowsa/data/unit_conversion.csv @@ -6,14 +6,13 @@ million square feet,m2,92903 square feet,m2,0.092903 gallons/animal/day,kg,1383.35 Mgal,kg,3790000 +Bgal,kg,3790000000 gal,kg,3.79 -Bgal/d,kg,1383350000000 -Mgal/d,kg,1383350000 million Cubic metres/year,kg,1000000000 TON,kg,907.185 LB,kg,0.45359 ACRE FEET / ACRE,kg/m2,304.8000006 gal/USD,kg/USD,3.79 -Quadrillion Btu,MJ,1055055900000 +Quadrillion Btu,MJ,1.05506E+12 Trillion Btu,MJ,1055055900 Tbtu,MJ,1055055900 diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 07bc30e32..a316e0ef9 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -156,10 +156,10 @@ def _getFlowBy( fb = cls(df, full_name=full_name, config=config) return fb - def standardize_units(fb: pd.DataFrame) -> pd.DataFrame: + def standardize_units(self: FB) -> FB: exchange_rate = float( literature_values - .get_Canadian_to_USD_exchange_rate(str(fb.Year.unique()[0])) + .get_Canadian_to_USD_exchange_rate(str(self.Year.unique()[0])) ) conversion_table = pd.concat([ pd.read_csv(f'{settings.datapath}unit_conversion.csv'), @@ -168,9 +168,16 @@ def standardize_units(fb: pd.DataFrame) -> pd.DataFrame: 'conversion_factor': 1 / exchange_rate}).to_frame().T ]) + if any(self.Unit.str.contains('/d')): + log.info('Converting daily flows %s to annual', + [unit for unit in self.Unit.unique() if '/d' in unit]) + standardized = ( - fb - .assign(Unit=fb.Unit.str.strip()) + self + .assign(Unit=self.Unit.str.strip()) + .assign(FlowAmount=self.FlowAmount.mask( + self.Unit.str.contains('/d'), self.FlowAmount * 365), + Unit=self.Unit.str.replace('/d', '')) .merge(conversion_table, how='left', left_on='Unit', right_on='old_unit') .assign(Unit=lambda x: x.new_unit.mask(x.new_unit.isna(), x.Unit), @@ -197,6 +204,25 @@ def function_socket(self: FB, function_name: str, *args, **kwargs) -> FB: else: return self + def conditional_method( + self: FB, + condition: bool, + method: str, + *args, **kwargs + ) -> FB: + ''' + Conditionally calls the specified method of the calling FlowBy. + Additional args and kwargs are passed to the method + :param condition: bool, condition under which the given method should + be called + :param function: str, name of FlowBy or DataFrame method + :return: self.method(*args, **kwargs) if condition is True, else self + ''' + if condition: + return getattr(self, method)(*args, **kwargs) + else: + return self + def update_fips_to_geoscale( self: FB, to_geoscale: Literal['national', 'state', 'county', @@ -511,7 +537,6 @@ def getFlowByActivity( # flow list mapping using this function as well. def map_to_fedefl_list( self: 'FlowByActivity', - mapping_subset: str = None, drop_fba_columns: bool = False, drop_unmapped_rows: bool = False ) -> 'FlowByActivity': @@ -540,12 +565,12 @@ def map_to_fedefl_list( ] merge_type = 'inner' if drop_unmapped_rows else 'left' - if mapping_subset is not None or 'fedefl_mapping' in self.config: + if self.config.get('fedefl_mapping') is True: + mapping_subset = self.source_name + else: + mapping_subset = self.config.get('fedefl_mapping') fba_merge_keys.remove('SourceName') mapping_merge_keys.remove('SourceListName') - mapping_subset = (mapping_subset - or self.config.get('fedefl_mapping') - or self.source_names) log.info('Mapping flows in %s to federal elementary flow list', self.source_name) @@ -1070,7 +1095,11 @@ def activity_sets(self) -> List['FlowByActivity']: def standardize_units_and_flows( self: 'FlowByActivity' ) -> 'FlowByActivity': - raise NotImplementedError + standardized = self.standardize_units() + if self.config.get('fedefl_mapping'): + return standardized.map_to_fedefl_list() + else: + return standardized class FlowBySector(_FlowBy): From 7daa93bd2ca84d8db27003c8e5017296be1f42c7 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 13 Jun 2022 16:13:11 -0400 Subject: [PATCH 0091/1127] _FB.select_by_fields can now select on Primary... --- flowsa/flowby.py | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index a316e0ef9..cb9a74c45 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -280,13 +280,23 @@ def select_by_fields(self: FB, selection_fields: dict = None) -> FB: Finally, if the selection_fields dictionary contains the keys 'Activity' or 'Sector', rows which contain the given values in either the relevant ...ProducedBy or ...ConsumedBy columns will be selected. + Alternatively, if the selection_fields dictionary contains the keys + 'PrimaryActivity' or 'PrimarySector', the relevant column(s) will be + added using _FlowBy.add_primary_secondary_columns(), and the selection + made based on 'PrimaryActivity' or 'PrimarySector', as specified. + Selecting on secondary activities or sectors is not supported. ''' selection_fields = (selection_fields or self.config.get('selection_fields')) if selection_fields is None: return self - activity_sector_fields = { + if 'PrimaryActivity' in selection_fields: + self = self.add_primary_secondary_columns('Activity') + if 'PrimarySector' in selection_fields: + self = self.add_primary_secondary_columns('Sector') + + special_fields = { k: v for k, v in selection_fields.items() if k in ['Activity', 'Sector'] } @@ -296,16 +306,23 @@ def select_by_fields(self: FB, selection_fields: dict = None) -> FB: } filtered_fb = self - for field, values in activity_sector_fields.items(): + for field, values in special_fields.items(): filtered_fb = filtered_fb.query(f'{field}ProducedBy in @values ' f'| {field}ConsumedBy in @values') for field, values in other_fields.items(): filtered_fb = filtered_fb.query(f'{field} in @values') + for k in ['Activity', 'Sector']: + if isinstance(other_fields.get(f'Primary{k}'), dict): + if isinstance(special_fields.get(k), dict): + special_fields[k].update(other_fields.pop(f'Primary{k}')) + else: + special_fields[k] = other_fields.pop(f'Primary{k}') + replace_dict = { - **{f'{k}ProducedBy': v for k, v in activity_sector_fields.items() + **{f'{k}ProducedBy': v for k, v in special_fields.items() if isinstance(v, dict)}, - **{f'{k}ConsumedBy': v for k, v in activity_sector_fields.items() + **{f'{k}ConsumedBy': v for k, v in special_fields.items() if isinstance(v, dict)}, **{k: v for k, v in other_fields.items() if isinstance(v, dict)} From 87aec870a5fe188ebf657988054d495bcf7c7c37 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 13 Jun 2022 16:43:11 -0400 Subject: [PATCH 0092/1127] Updated activity_sets() --- flowsa/flowby.py | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index cb9a74c45..6791cdee5 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -292,9 +292,13 @@ def select_by_fields(self: FB, selection_fields: dict = None) -> FB: return self if 'PrimaryActivity' in selection_fields: - self = self.add_primary_secondary_columns('Activity') + self = (self + .add_primary_secondary_columns('Activity') + .drop(columns='SecondaryActivity')) if 'PrimarySector' in selection_fields: - self = self.add_primary_secondary_columns('Sector') + self = (self + .add_primary_secondary_columns('Sector') + .drop(columns='SecondarySector')) special_fields = { k: v for k, v in selection_fields.items() @@ -329,7 +333,8 @@ def select_by_fields(self: FB, selection_fields: dict = None) -> FB: } replaced_fb = filtered_fb.replace(replace_dict) - return replaced_fb + return replaced_fb.drop(columns=['PrimaryActivity', 'PrimarySector'], + errors='ignore') def aggregate_flowby( self: FB, @@ -1081,29 +1086,26 @@ def activity_sets(self) -> List['FlowByActivity']: activities = self.config['activity_sets'] parent_config = {k: v for k, v in self.config.items() if k != 'activity_sets' and not k.startswith('_')} - parent_fba = self.add_primary_secondary_columns('Activity') + parent_fba: 'FlowByActivity' = self.reset_index() child_fba_list = [] - assigned_names = set() + assigned_rows = set() for activity_set, activity_config in activities.items(): - activity_names = set(activity_config['names']) - - if activity_names & assigned_names: - log.error('Some names in multiple activity sets. This ' - 'will lead to double-counting: %s', - activity_names & assigned_names) - - child_fba = ( - parent_fba - .query('PrimaryActivity in @activity_names') - .drop(columns=['PrimaryActivity', 'SecondaryActivity']) - .reset_index(drop=True) + child_fba = parent_fba.select_by_fields( + selection_fields=activity_config['selection_fields'] ) - child_fba.name += f'.{activity_set}' + child_fba.full_name += f'.{activity_set}' child_fba.config = {**parent_config, **activity_config} + if set(child_fba.index) & assigned_rows: + log.error( + 'Some rows in multiple activity sets. This will lead ' + 'to double-counting:\n%s', + child_fba.iloc[list(set(child_fba.index) + & assigned_rows)]) + child_fba_list.append(child_fba) - assigned_names.update(activity_names) + assigned_rows.update(child_fba.index) return child_fba_list else: From ba0a99e38d606c1649d85eae4d36444a0f9af0ab Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 14 Jun 2022 09:50:12 -0400 Subject: [PATCH 0093/1127] map_to_sectors bug fix + tweaks --- flowsa/flowby.py | 76 ++++++++++++------- .../flowbysectormethods/SEEA_2017_v1.yaml | 2 +- 2 files changed, 48 insertions(+), 30 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 6791cdee5..9a27ed709 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -332,9 +332,14 @@ def select_by_fields(self: FB, selection_fields: dict = None) -> FB: if isinstance(v, dict)} } - replaced_fb = filtered_fb.replace(replace_dict) - return replaced_fb.drop(columns=['PrimaryActivity', 'PrimarySector'], - errors='ignore') + replaced_fb = ( + filtered_fb + .replace(replace_dict) + .drop(columns=['PrimaryActivity', 'PrimarySector'], + errors='ignore') + .reset_index(drop=True) + ) + return replaced_fb def aggregate_flowby( self: FB, @@ -918,24 +923,25 @@ def map_to_sectors( source_years = set( activity_to_source_naics_crosswalk.SectorSourceName - .str.removeprefix('NAICS_').str.removesuffix('_Code') + .str.removeprefix('NAICS_') + .str.removesuffix('_Code') .dropna().astype('int') ) source_year = (2012 if 2012 in source_years else max(source_years) if source_years else 2012) - if source_years: - activity_to_source_naics_crosswalk = ( - activity_to_source_naics_crosswalk - .query(f'SectorSourceName == "NAICS_{source_year}_Code"') - .reset_index(drop=True) - ) - else: + if not source_years: log.warning('No NAICS year/sector source name (e.g. ' '"NAICS_2012_Code") provided in crosswalk for %s. ' '2012 being used as default.', self.source_name) + activity_to_source_naics_crosswalk = ( + activity_to_source_naics_crosswalk + .query(f'SectorSourceName == "NAICS_{source_year}_Code"') + .reset_index(drop=True) + ) + log.info('Converting NAICS codes in crosswalk to desired ' 'industry/sector aggregation structure.') activity_to_target_naics_crosswalk = ( @@ -1015,8 +1021,7 @@ def equally_attribute(self: 'FlowByActivity') -> 'FlowByActivity': fba = self.add_primary_secondary_columns('Sector') groupby_cols = [c for c in fba.groupby_cols if c not in ['SectorProducedBy', 'SectorConsumedBy', - 'PrimarySector', 'SecondarySector', - 'Description']] + 'PrimarySector', 'SecondarySector']] for rank in ['Primary', 'Secondary']: fba = ( @@ -1048,7 +1053,10 @@ def equally_attribute(self: 'FlowByActivity') -> 'FlowByActivity': *[f'_unique_naics_{n}_by_group' for n in range(2, 8)]] ) - def proportionally_attribute(self: 'FlowByActivity'): + def proportionally_attribute( + self: 'FlowByActivity', + other: 'FlowBySector' + ) -> 'FlowByActivity': raise NotImplementedError def flagged_proportionally_attribute(self: 'FlowByActivity'): @@ -1056,10 +1064,13 @@ def flagged_proportionally_attribute(self: 'FlowByActivity'): def convert_to_fbs(self: 'FlowByActivity') -> 'FlowBySector': if 'activity_sets' in self.config: - return pd.concat([fba.convert_to_fbs() - for fba in self.activity_sets()]) + return ( + pd.concat([fba.convert_to_fbs() + for fba in self.activity_sets()]) + .reset_index(drop=True) + ) - return ( + return FlowBySector( self .function_socket('clean_fba_before_mapping_df_fxn') .select_by_fields() @@ -1076,36 +1087,37 @@ def activity_sets(self) -> List['FlowByActivity']: resulting FBAs. Otherwise, it returns a list containing the calling FBA. - First, the primary activity is determined (for the underlying logic, - see documentation for add_primary_secondary_columns()), then the - partitioning is done based on the primary activity. This ensures that - the order activity sets are listed in cannot change the partitioning. - An error is logged if any names are in multiple activity sets. + Activity sets are determined by the selection_field key under each + activity set name. An error will be logged if any rows from the calling + FBA are assigned to multiple activity sets. ''' + log.info('Splitting %s into activity sets', self.full_name) if 'activity_sets' in self.config: activities = self.config['activity_sets'] parent_config = {k: v for k, v in self.config.items() if k != 'activity_sets' and not k.startswith('_')} - parent_fba: 'FlowByActivity' = self.reset_index() + parent_fba = self.reset_index().rename(columns={'index': 'row'}) child_fba_list = [] assigned_rows = set() for activity_set, activity_config in activities.items(): + log.info('Creating FlowByActivity for %s', activity_set) child_fba = parent_fba.select_by_fields( selection_fields=activity_config['selection_fields'] ) child_fba.full_name += f'.{activity_set}' child_fba.config = {**parent_config, **activity_config} - if set(child_fba.index) & assigned_rows: + if set(child_fba.row) & assigned_rows: log.error( 'Some rows in multiple activity sets. This will lead ' 'to double-counting:\n%s', - child_fba.iloc[list(set(child_fba.index) + child_fba.iloc[list(set(child_fba.row) & assigned_rows)]) + raise ValueError('Some rows in multiple activity sets') - child_fba_list.append(child_fba) - assigned_rows.update(child_fba.index) + assigned_rows.update(child_fba.row) + child_fba_list.append(child_fba.drop(columns='row')) return child_fba_list else: @@ -1262,7 +1274,7 @@ def generateFlowBySector( download_fbs_ok=download_sources_ok, ) .function_socket('clean_fbs_df_fxn') - .select_flows(config.get('source_flows')) + .select_by_fields() .update_fips_to_geoscale(method_config['target_geoscale']) for source_name, config in sources.items() if config['data_format'] == 'FBS' @@ -1282,7 +1294,13 @@ def generateFlowBySector( if config['data_format'] == 'FBS_outside_flowsa' ] - return source_fba_list[0] + fbs = pd.concat([ + *source_fba_list, + *source_fbs_list, + *source_external_fbs_list + ]) + + return fbs # The three classes extending pd.Series, together with the _constructor... diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index f03673d4d..23f53909d 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -88,7 +88,7 @@ source_names: EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues <<: [*ghgi_parameters, *direct_allocation] selection_fields: - Activity: + PrimaryActivity: - Chickpeas - Cotton - Maize From 4f3e08d2d56d2b181567e69b8ef25fe9465033da Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 14 Jun 2022 10:12:50 -0400 Subject: [PATCH 0094/1127] Generalized convert_fips_to_geoscale column --- flowsa/flowby.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 9a27ed709..d3ef4866e 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -223,11 +223,12 @@ def conditional_method( else: return self - def update_fips_to_geoscale( + def convert_fips_to_geoscale( self: FB, to_geoscale: Literal['national', 'state', 'county', geo.scale.NATIONAL, geo.scale.STATE, geo.scale.COUNTY], + column: str = 'Location' ) -> FB: """ Sets FIPS codes to 5 digits by zero-padding FIPS codes at the specified @@ -235,19 +236,21 @@ def update_fips_to_geoscale( generally padded with 3 zeros, and the "national" FIPS code is set to 00000) :param to_geoscale: str, target geoscale + :param column: str, column of FIPS codes to convert. + Default = 'Location' :return: FlowBy dataset with 5 digit fips """ if type(to_geoscale) == str: to_geoscale = geo.scale.from_string(to_geoscale) if to_geoscale == geo.scale.NATIONAL: - return (self - .assign(Location=(geo.filtered_fips('national') - .FIPS.values[0]))) + return self.assign( + {column: geo.filtered_fips('national').FIPS.values[0]} + ) elif to_geoscale == geo.scale.STATE: - return (self - .assign(Location=self.Location.apply( - lambda x: str(x)[:2].ljust(5, '0')))) + return self.assign( + {column: self[column].str.slice_replace(start=2, repl='000')} + ) elif to_geoscale == geo.scale.COUNTY: return self else: @@ -1275,7 +1278,7 @@ def generateFlowBySector( ) .function_socket('clean_fbs_df_fxn') .select_by_fields() - .update_fips_to_geoscale(method_config['target_geoscale']) + .convert_fips_to_geoscale(method_config['target_geoscale']) for source_name, config in sources.items() if config['data_format'] == 'FBS' ] @@ -1289,7 +1292,7 @@ def generateFlowBySector( ) .function_socket('clean_fbs_df_fxn') .select_by_fields() - .update_fips_to_geoscale(method_config['target_geoscale']) + .convert_fips_to_geoscale(method_config['target_geoscale']) for source_name, config in sources.items() if config['data_format'] == 'FBS_outside_flowsa' ] From 5bd628d222f4c6f0184fa030813f00c2636e6be1 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 14 Jun 2022 10:15:04 -0400 Subject: [PATCH 0095/1127] missed a refactor --- flowsa/flowby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index d3ef4866e..06e0a0080 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -775,7 +775,7 @@ def convert_to_geoscale( fba_at_target_geoscale = ( fba_at_source_geoscale .drop(columns='source_geoscale') - .update_fips_to_geoscale(target_geoscale) + .convert_fips_to_geoscale(target_geoscale) .aggregate_flowby() ) From 818fea7a1e6646a74129e1c2dcce48bc5cd71422 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 15 Jun 2022 16:09:17 -0400 Subject: [PATCH 0096/1127] __finalize__ now handles concat --- flowsa/flowby.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 06e0a0080..aff0dbffd 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -91,6 +91,30 @@ def __finalize__(self, other, method=None, **kwargs): for attribute in self._metadata: object.__setattr__(self, attribute, getattr(other.left, attribute, None)) + + # When concatenating, use shared portion of full_name or config. For + # other attributes, use metadata from the first FlowBy + if method == 'concat': + _full_name = ( + NAME_SEP_CHAR.join( + n for n in (getattr(other.objs[0], 'full_name', '') + .split(NAME_SEP_CHAR)) + if all(n in (getattr(x, 'full_name', '') + .split(NAME_SEP_CHAR)) + for x in other.objs[1:]) + ) + ) + _config = { + k: v for k, v in getattr(other.objs[0], 'config', {}).items() + if all(v == getattr(x, 'config', {}).get(k) + for x in other.objs[1:]) + } + object.__setattr__(self, 'full_name', _full_name) + object.__setattr__(self, 'config', _config) + for attribute in [x for x in self._metadata + if x not in ['full_name', 'config']]: + object.__setattr__(self, attribute, + getattr(other.objs[0], attribute, None)) return self @property From 095022aedbee06ff2bc4113da35423d923298d59 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 15 Jun 2022 16:37:23 -0400 Subject: [PATCH 0097/1127] Updated __finalize__ handling full_name in concat --- flowsa/flowby.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index aff0dbffd..a16b993b3 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -95,15 +95,16 @@ def __finalize__(self, other, method=None, **kwargs): # When concatenating, use shared portion of full_name or config. For # other attributes, use metadata from the first FlowBy if method == 'concat': - _full_name = ( - NAME_SEP_CHAR.join( - n for n in (getattr(other.objs[0], 'full_name', '') - .split(NAME_SEP_CHAR)) - if all(n in (getattr(x, 'full_name', '') - .split(NAME_SEP_CHAR)) - for x in other.objs[1:]) - ) - ) + _name_list = [] + for i, n in enumerate(getattr(other.objs[0], 'full_name', '') + .split(NAME_SEP_CHAR)): + if all(n == getattr(x, 'full_name', '').split(NAME_SEP_CHAR)[i] + for x in other.objs[1:]): + _name_list.append(n) + else: + break + _full_name = NAME_SEP_CHAR.join(_name_list) + _config = { k: v for k, v in getattr(other.objs[0], 'config', {}).items() if all(v == getattr(x, 'config', {}).get(k) From 1c39857e5815c436b3f9608c175305083ded3c4d Mon Sep 17 00:00:00 2001 From: Eric Bell Date: Wed, 15 Jun 2022 17:27:45 -0400 Subject: [PATCH 0098/1127] add clean_fba_before_mapping_df_fxn to disaggregate emissions associated with ODS substitutes --- flowsa/data_source_scripts/EPA_SIT.py | 58 ++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/flowsa/data_source_scripts/EPA_SIT.py b/flowsa/data_source_scripts/EPA_SIT.py index 969b60bbd..1e17d88aa 100644 --- a/flowsa/data_source_scripts/EPA_SIT.py +++ b/flowsa/data_source_scripts/EPA_SIT.py @@ -9,8 +9,10 @@ import pandas as pd import os from flowsa.settings import externaldatapath, log -from flowsa.flowbyfunctions import assign_fips_location_system +from flowsa.flowbyfunctions import assign_fips_location_system, \ + load_fba_w_standardized_units from flowsa.location import apply_county_FIPS +from flowsa.schema import flow_by_activity_fields def epa_sit_parse(*, source, year, config, **_): @@ -115,6 +117,60 @@ def epa_sit_parse(*, source, year, config, **_): return df0 +def disaggregate_emissions(fba, source_dict, **_): + """ + clean_fba_before_mapping_df_fxn to assign specific flow names to flows + that are an amalgamation of multiple different GHGs + (e.g., "HFC, PFC, SF6, and NF3 emissions") + + """ + + # dictionary of activities where GHG emissions need to be disaggregated + activity_dict = source_dict['clean_activity_dict'] + + # for all activities included in the dictionary... + for activity_name, activity_properties in activity_dict.items(): + disaggregation_method = activity_properties.get('disaggregation_method') + + # if emissions need to be split across multiple species, + # allocate emissions proportionally based per the table listed + if disaggregation_method == 'table': + # name of table to be used for proportional split + table_name = activity_properties.get('disaggregation_data_source') + # load percentages to be used for proportional split + splits = load_fba_w_standardized_units(datasource=table_name, + year=source_dict['year']) + drop_rows = activity_properties.get('drop_rows') + # there are certain circumstances where one or more rows need to be + # excluded from the table + if drop_rows is not None: + splits = splits[~splits['FlowName'].isin(drop_rows)] + splits['pct'] = splits['FlowAmount'] / splits['FlowAmount'].sum() + splits = splits[['FlowName', 'pct']] + # split fba dataframe to include only those items matching the activity + fba_activity = fba[fba['ActivityProducedBy'] == activity_name] + fba_main = fba[fba['ActivityProducedBy'] != activity_name] + # apply proportional split to activity data + speciated_df = fba_activity.apply(lambda x: [p * x['FlowAmount'] for p in splits['pct']], + axis=1, result_type='expand') + speciated_df.columns = splits['FlowName'] + speciated_df = pd.concat([fba_activity, speciated_df], axis=1) + speciated_df = speciated_df.melt(id_vars=flow_by_activity_fields.keys(), + var_name='Flow') + speciated_df['FlowName'] = speciated_df['Flow'] + speciated_df['FlowAmount'] = speciated_df['value'] + speciated_df.drop(columns=['Flow', 'value'], inplace=True) + # merge split dataframes back together + fba = pd.concat([fba_main, speciated_df], axis=0, join='inner') + + # if emissions are attributable to only one species, + # allocate emissions directly to single species listed + elif disaggregation_method == 'direct': + species_name = activity_properties.get('disaggregation_data_source') + fba.loc[fba.ActivityProducedBy == activity_name, 'FlowName'] = species_name + + return fba + if __name__ == '__main__': import flowsa flowsa.flowbyactivity.main(source='EPA_SIT', year='2017') From 82144782895b962e489d50839e625190adfe7a67 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 15 Jun 2022 17:50:25 -0400 Subject: [PATCH 0099/1127] Implemented proportional attribution --- flowsa/flowby.py | 135 ++++++++++++++++-- .../flowbysectormethods/SEEA_2017_v1.yaml | 2 +- 2 files changed, 121 insertions(+), 16 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index a16b993b3..3453769fb 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -12,6 +12,8 @@ FB = TypeVar('FB', bound='_FlowBy') S = TypeVar('S', bound='_FlowBySeries') +NAME_SEP_CHAR = '.' +# ^^^ Used to separate source/activity set names as part of 'full_name' attr with open(settings.datapath + 'flowby_config.yaml') as f: flowby_config = flowsa_yaml.load(f) @@ -82,12 +84,12 @@ def __finalize__(self, other, method=None, **kwargs): object. Additional code below specifies how to propagate metadata under other circumstances, such as merging. - merge: use metadata of left dataframe + merge: use metadata of left FlowBy ''' self = super().__finalize__(other, method=method, **kwargs) - # merge operation: using metadata of the left object - if method == "merge": + # When merging, use metadata from left FlowBy + if method == 'merge': for attribute in self._metadata: object.__setattr__(self, attribute, getattr(other.left, attribute, None)) @@ -730,7 +732,7 @@ def convert_to_geoscale( :return: FlowBy data set, with rows filtered or aggregated to the target geoscale. ''' - target_geoscale = target_geoscale or self.config.get('target_geoscale') + target_geoscale = target_geoscale or self.config.get('geoscale') if type(target_geoscale) == str: target_geoscale = geo.scale.from_string(target_geoscale) @@ -823,24 +825,28 @@ def attribute_flows_to_sectors( attributed to those sectors, by the methods specified in the calling FBA's configuration dictionary. ''' - fba: 'FlowByActivity' = ( + grouped: 'FlowByActivity' = ( self + .reset_index(drop=True).reset_index() + .rename(columns={'index': 'group_id'}) + .assign(group_total=self.FlowAmount) + ) + fba: 'FlowByActivity' = ( + grouped .map_to_sectors(external_config_path=external_config_path) .function_socket('clean_fba_w_sec_df_fxn', attr=self.config, method=self.config) .rename(columns={'SourceName': 'MetaSources'}) - .drop(columns=['FlowName', 'Compartment']) ) allocation_method = fba.config.get('allocation_method') if allocation_method == 'proportional': - allocation_source = fba.config['allocation_source'] attributed_fba = ( fba .proportionally_attribute( FlowByActivity.getFlowByActivity( - allocation_source, + fba.config['allocation_source'], config={ **{k: v for k, v in fba.config.items() if k in fba.config['fbs_method_config_keys']}, @@ -851,12 +857,11 @@ def attribute_flows_to_sectors( ) ) elif allocation_method == 'proportional-flagged': - allocation_source = fba.config['allocation_source'] attributed_fba = ( fba .flagged_proportionally_attribute( FlowByActivity.getFlowByActivity( - allocation_source, + fba.config['allocation_source'], config={ **{k: v for k, v in fba.config.items() if k in fba.config['fbs_method_config_keys']}, @@ -869,7 +874,11 @@ def attribute_flows_to_sectors( else: attributed_fba = fba.equally_attribute() - aggregated_fba = attributed_fba.aggregate_flowby() + aggregated_fba = ( + attributed_fba + .drop(columns=['group_id', 'group_total']) + .aggregate_flowby() + ) # ^^^ TODO: move to convert_to_fbs(), after dropping Activity cols? # TODO: Insert validation here. @@ -1085,7 +1094,103 @@ def proportionally_attribute( self: 'FlowByActivity', other: 'FlowBySector' ) -> 'FlowByActivity': - raise NotImplementedError + fba_geoscale = geo.scale.from_string(self.config['geoscale']) + other_geoscale = geo.scale.from_string(other.config['geoscale']) + + if other_geoscale < fba_geoscale: + other = ( + other + .convert_fips_to_geoscale(fba_geoscale) + .aggregate_flowby() + ) + elif other_geoscale > fba_geoscale: + self = ( + self + .assign(temp_location=self.Location) + .convert_fips_to_geoscale(other_geoscale, + column='temp_location') + ) + + fba = self.add_primary_secondary_columns('Sector') + other = ( + other + .add_primary_secondary_columns('Sector') + [['PrimarySector', 'Location', 'FlowAmount']] + ) + + groupby_cols = ['group_id'] + for rank in ['Primary', 'Secondary']: + counted = fba.assign(group_count=(fba.groupby(groupby_cols) + ['group_id'] + .transform('count'))) + directly_attributed = ( + counted + .query('group_count == 1') + .drop(columns='group_count') + ) + needs_attribution = ( + counted + .query('group_count > 1') + .drop(columns='group_count') + ) + + merged = ( + needs_attribution + .merge(other, + how='left', + left_on=[f'{rank}Sector', + 'temp_location' + if 'temp_location' in needs_attribution + else 'Location'], + right_on=['PrimarySector', 'Location'], + suffixes=[None, '_other']) + .fillna({'FlowAmount_other': 0}) + ) + + denominator_flag = ~merged.duplicated(subset=[*groupby_cols, + f'{rank}Sector']) + with_denominator = ( + merged + .assign(denominator=( + merged + .assign(FlowAmount_other=(merged.FlowAmount_other + * denominator_flag)) + .groupby(groupby_cols) + ['FlowAmount_other'] + .transform('sum'))) + ) + + non_zero_denominator = with_denominator.query(f'denominator != 0 ') + unattributable = with_denominator.query(f'denominator == 0 ') + + if not unattributable.empty: + log.error( + 'Could not attribute activities %s in %s due to lack of ' + 'flows in attribution source %s for mapped %s sectors %s', + set(zip(unattributable.ActivityProducedBy, + unattributable.ActivityConsumedBy)), + unattributable.full_name, + other.full_name, + rank, + set(unattributable[f'{rank}Sector']) + ) + + proportionally_attributed = ( + non_zero_denominator + .assign(FlowAmount=lambda x: (x.FlowAmount + * x.FlowAmount_other + / x.denominator)) + .drop(columns=['PrimarySector_other', 'Location_other', + 'FlowAmount_other', 'denominator'], + errors='ignore') + ) + fba = pd.concat([directly_attributed, proportionally_attributed]) + groupby_cols.append(f'{rank}Sector') + + return fba.drop( + columns=['PrimarySector', 'SecondarySector', 'temp_location'], + errors='ignore' + ) def flagged_proportionally_attribute(self: 'FlowByActivity'): raise NotImplementedError @@ -1133,7 +1238,7 @@ def activity_sets(self) -> List['FlowByActivity']: child_fba = parent_fba.select_by_fields( selection_fields=activity_config['selection_fields'] ) - child_fba.full_name += f'.{activity_set}' + child_fba.full_name += f'{NAME_SEP_CHAR}{activity_set}' child_fba.config = {**parent_config, **activity_config} if set(child_fba.row) & assigned_rows: @@ -1303,7 +1408,7 @@ def generateFlowBySector( ) .function_socket('clean_fbs_df_fxn') .select_by_fields() - .convert_fips_to_geoscale(method_config['target_geoscale']) + .convert_fips_to_geoscale(method_config['geoscale']) for source_name, config in sources.items() if config['data_format'] == 'FBS' ] @@ -1317,7 +1422,7 @@ def generateFlowBySector( ) .function_socket('clean_fbs_df_fxn') .select_by_fields() - .convert_fips_to_geoscale(method_config['target_geoscale']) + .convert_fips_to_geoscale(method_config['geoscale']) for source_name, config in sources.items() if config['data_format'] == 'FBS_outside_flowsa' ] diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index 23f53909d..29c642813 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -11,7 +11,7 @@ industry_spec: '336': {default: NAICS_4} '541': {default: NAICS_4} target_naics_year: 2012 -target_geoscale: national +geoscale: national _ghgi_parameters: &ghgi_parameters data_format: 'FBA' From d1d6c0561695170b11628e3d44b37e0946b691cc Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 15 Jun 2022 18:24:41 -0400 Subject: [PATCH 0100/1127] Fixed bug in proportionally_attribute() --- flowsa/flowby.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 3453769fb..49ba009e3 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1116,6 +1116,9 @@ def proportionally_attribute( other .add_primary_secondary_columns('Sector') [['PrimarySector', 'Location', 'FlowAmount']] + .groupby(['PrimarySector', 'Location']) + .agg('sum') + .reset_index() ) groupby_cols = ['group_id'] From ac6b92da2078aafe7518255eaa4d0f4a7b50be42 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 16 Jun 2022 09:13:46 -0400 Subject: [PATCH 0101/1127] Added validation to attribute_flows_to_sectors() --- flowsa/flowby.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 49ba009e3..320da6a06 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -874,16 +874,20 @@ def attribute_flows_to_sectors( else: attributed_fba = fba.equally_attribute() - aggregated_fba = ( - attributed_fba - .drop(columns=['group_id', 'group_total']) - .aggregate_flowby() + validation_fba = attributed_fba.assign( + validation_total=(attributed_fba.groupby('group_id') + ['FlowAmount'].transform('sum')) ) - # ^^^ TODO: move to convert_to_fbs(), after dropping Activity cols? - - # TODO: Insert validation here. - - return aggregated_fba + if any(validation_fba.validation_total != validation_fba.group_total): + errors = (validation_fba + .query('validation_total != group_total') + [['ActivityProducedBy', 'ActivityConsumedBy', + 'SectorProducedBy', 'SectorConsumedBy', + 'FlowAmount', 'group_total']]) + log.error('Errors in attributing flows from %s:\n%s', + self.full_name, errors) + + return attributed_fba.drop(columns=['group_id', 'group_total']) def map_to_sectors( self: 'FlowByActivity', From 7c2279e26e0b18f88210c48bf65234f242605cca Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 16 Jun 2022 09:38:22 -0400 Subject: [PATCH 0102/1127] Incorporate group_id into equally_attribute() --- flowsa/flowby.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 320da6a06..0815e6a83 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1060,21 +1060,18 @@ def equally_attribute(self: 'FlowByActivity') -> 'FlowByActivity': subdivided based on the secondary sector. ''' fba = self.add_primary_secondary_columns('Sector') - groupby_cols = [c for c in fba.groupby_cols - if c not in ['SectorProducedBy', 'SectorConsumedBy', - 'PrimarySector', 'SecondarySector']] + groupby_cols = ['group_id'] for rank in ['Primary', 'Secondary']: fba = ( fba .assign( - **{f'_naics_{n}': lambda x, i=n: x[f'{rank}Sector'].str[:i] + **{f'_naics_{n}': fba[f'{rank}Sector'].str.slice(stop=n) for n in range(2, 8)}, **{f'_unique_naics_{n}_by_group': lambda x, i=n: ( - x - .groupby(groupby_cols if i == 2 - else [*groupby_cols, f'_naics_{i-1}'], - dropna=False) + x.groupby(groupby_cols if i == 2 + else [*groupby_cols, f'_naics_{i-1}'], + dropna=False) [[f'_naics_{i}']] .transform('nunique', dropna=False) ) @@ -1086,7 +1083,7 @@ def equally_attribute(self: 'FlowByActivity') -> 'FlowByActivity': ) ) ) - groupby_cols.append('PrimarySector') + groupby_cols.append(f'{rank}Sector') return fba.drop( columns=['PrimarySector', 'SecondarySector', From 3767cf0dc78a0a86cc1eff76a3a96393ca9fca94 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 16 Jun 2022 09:43:50 -0400 Subject: [PATCH 0103/1127] Tweaks and docstring --- flowsa/flowby.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 0815e6a83..8a218c58d 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1095,6 +1095,11 @@ def proportionally_attribute( self: 'FlowByActivity', other: 'FlowBySector' ) -> 'FlowByActivity': + ''' + This method takes flows from the calling FBA which are mapped to + multiple sectors and attributes them to those sectors proportionally to + flows from other (an FBS). + ''' fba_geoscale = geo.scale.from_string(self.config['geoscale']) other_geoscale = geo.scale.from_string(other.config['geoscale']) From a4836a379f79778799a0037fb032e1592a12f007 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 16 Jun 2022 10:14:24 -0400 Subject: [PATCH 0104/1127] Fixed bug in convert_to_geoscale() --- flowsa/flowby.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 8a218c58d..288eddf07 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -272,7 +272,7 @@ def convert_fips_to_geoscale( if to_geoscale == geo.scale.NATIONAL: return self.assign( - {column: geo.filtered_fips('national').FIPS.values[0]} + **{column: geo.filtered_fips('national').FIPS.values[0]} ) elif to_geoscale == geo.scale.STATE: return self.assign( @@ -1196,9 +1196,12 @@ def proportionally_attribute( fba = pd.concat([directly_attributed, proportionally_attributed]) groupby_cols.append(f'{rank}Sector') - return fba.drop( - columns=['PrimarySector', 'SecondarySector', 'temp_location'], - errors='ignore' + return ( + fba + .drop(columns=['PrimarySector', 'SecondarySector', + 'temp_location'], + errors='ignore') + .reset_index(drop=True) ) def flagged_proportionally_attribute(self: 'FlowByActivity'): @@ -1220,6 +1223,8 @@ def convert_to_fbs(self: 'FlowByActivity') -> 'FlowBySector': .function_socket('clean_fba_df_fxn') .convert_to_geoscale() .attribute_flows_to_sectors() # recursive call to convert_to_fbs + .drop(columns=['ActivityProducedBy', 'ActivityConsumedBy']) + .aggregate_flowby() ) def activity_sets(self) -> List['FlowByActivity']: From 4fbaa2e525bf0991f98f31228caee5d10bb08be7 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 16 Jun 2022 10:38:20 -0400 Subject: [PATCH 0105/1127] logging + 'allocation' -> 'attribution' in attribute_... --- flowsa/flowby.py | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 288eddf07..4a7bd160c 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -216,8 +216,8 @@ def standardize_units(self: FB) -> FB: standardized_units = list(conversion_table.new_unit.unique()) if any(~standardized.Unit.isin(standardized_units)): - log.warning('Some units not standardized by standardize_units(): ' - '%s. May not be a problem, if they will be ' + log.warning('Units not standardized by standardize_units(): ' + '%s. Not a problem if they will be ' 'standardized later, e.g. by mapping to the federal ' 'elementary flow list', [unit for unit in standardized.Unit.unique() @@ -840,38 +840,46 @@ def attribute_flows_to_sectors( .rename(columns={'SourceName': 'MetaSources'}) ) - allocation_method = fba.config.get('allocation_method') - if allocation_method == 'proportional': + attribution_method = fba.config.get('attribution_method') + if attribution_method == 'proportional': attributed_fba = ( fba .proportionally_attribute( FlowByActivity.getFlowByActivity( - fba.config['allocation_source'], + fba.config['attribution_source'], config={ **{k: v for k, v in fba.config.items() if k in fba.config['fbs_method_config_keys']}, - **fba.config['allocation_source'] + **fba.config['attribution_source'] } ) .convert_to_fbs() ) ) - elif allocation_method == 'proportional-flagged': + elif attribution_method == 'proportional-flagged': attributed_fba = ( fba .flagged_proportionally_attribute( FlowByActivity.getFlowByActivity( - fba.config['allocation_source'], + fba.config['attribution_source'], config={ **{k: v for k, v in fba.config.items() if k in fba.config['fbs_method_config_keys']}, - **fba.config['allocation_source'] + **fba.config['attribution_source'] } ) .convert_to_fbs() ) ) else: + if attribution_method != 'direct': + log.error('Attribution method for %s not recognized: %s', + fba.full_name, attribution_method) + raise ValueError('Attribution method not recognized') + elif attribution_method is None: + log.warning('No attribution method specified for %s. ' + 'Using equal attribution as default.', + fba.full_name) attributed_fba = fba.equally_attribute() validation_fba = attributed_fba.assign( @@ -1223,7 +1231,8 @@ def convert_to_fbs(self: 'FlowByActivity') -> 'FlowBySector': .function_socket('clean_fba_df_fxn') .convert_to_geoscale() .attribute_flows_to_sectors() # recursive call to convert_to_fbs - .drop(columns=['ActivityProducedBy', 'ActivityConsumedBy']) + .drop(columns=['ActivityProducedBy', 'ActivityConsumedBy', + 'FlowName', 'Compartment']) .aggregate_flowby() ) From f8e3b6bdda62c2c190c8f8c95ec8b1527cf05a3f Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 16 Jun 2022 12:09:53 -0400 Subject: [PATCH 0106/1127] Fixed FBA calls in proportionally_attribute() --- flowsa/flowby.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 4a7bd160c..34130c7dd 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -842,37 +842,38 @@ def attribute_flows_to_sectors( attribution_method = fba.config.get('attribution_method') if attribution_method == 'proportional': + (source, config), = fba.config['attribution_source'].items() attributed_fba = ( fba .proportionally_attribute( FlowByActivity.getFlowByActivity( - fba.config['attribution_source'], - config={ - **{k: v for k, v in fba.config.items() - if k in fba.config['fbs_method_config_keys']}, - **fba.config['attribution_source'] - } + source, + config={**{k: v for k, v in fba.config.items() + if k in fba.config['method_config_keys'] + or k == 'method_config_keys'}, + **config} ) .convert_to_fbs() ) ) elif attribution_method == 'proportional-flagged': + (source, config), = fba.config['attribution_source'].items() attributed_fba = ( fba .flagged_proportionally_attribute( FlowByActivity.getFlowByActivity( - fba.config['attribution_source'], - config={ - **{k: v for k, v in fba.config.items() - if k in fba.config['fbs_method_config_keys']}, - **fba.config['attribution_source'] - } + source, + config={**{k: v for k, v in fba.config.items() + if k in fba.config['method_config_keys'] + or k == 'method_config_keys'}, + **config} ) .convert_to_fbs() ) ) else: - if attribution_method != 'direct': + if (attribution_method is not None + and attribution_method != 'direct'): log.error('Attribution method for %s not recognized: %s', fba.full_name, attribution_method) raise ValueError('Attribution method not recognized') @@ -1401,7 +1402,7 @@ def generateFlowBySector( full_name=source_name, config={ **method_config, - 'fbs_method_config_keys': method_config.keys(), + 'method_config_keys': method_config.keys(), **source_catalog.get( common.return_true_source_catalog_name(source_name), {}), @@ -1419,7 +1420,7 @@ def generateFlowBySector( name=source_name, config={ **method_config, - 'fbs_method_config_keys': method_config.keys(), + 'method_config_keys': method_config.keys(), **source_catalog.get( common.return_true_source_catalog_name(source_name), {}), From 9b0f951586195d44962038eb13ecc9a5c96a1933 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 21 Jun 2022 11:21:14 -0400 Subject: [PATCH 0107/1127] validation, config fixes, etc. --- .../temp_data_source_functions.py | 57 +++++ flowsa/flowby.py | 77 ++++--- .../flowbysectormethods/SEEA_2017_v1.yaml | 213 ++++++++---------- 3 files changed, 197 insertions(+), 150 deletions(-) create mode 100644 flowsa/data_source_scripts/temp_data_source_functions.py diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py new file mode 100644 index 000000000..db3cc447c --- /dev/null +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -0,0 +1,57 @@ +from flowsa import naics +from flowsa.flowsa_log import log +import pandas as pd + + +def clean_qcew(fba, **kwargs): + if fba.config.get('geoscale') == 'national': + fba = fba.query('Location == "00000"') + + totals = ( + fba + .query('ActivityProducedBy.str.len() == 3') + [['Location', 'ActivityProducedBy', 'FlowAmount']] + .assign(ActivityProducedBy=lambda x: (x.ActivityProducedBy + .str.slice(stop=2))) + .groupby(['Location', 'ActivityProducedBy']).agg('sum') + .reset_index() + .rename(columns={'FlowAmount': 'new_total'}) + ) + + merged = fba.merge(totals, how='left') + + fixed = ( + merged + .assign(FlowAmount=merged.FlowAmount.mask( + (merged.ActivityProducedBy.str.len() == 2) + & (merged.FlowAmount == 0), + merged.new_total + )) + .drop(columns='new_total') + .reset_index(drop=True) + ) + + target_naics = set(naics.industry_spec_key(fba.config['industry_spec']) + .target_naics) + filtered = fixed.query('ActivityProducedBy in @target_naics') + + return filtered + + +def clean_usda_cropland_naics(fba, **kwargs): + if fba.config['industry_spec']['default'] == 'NAICS_2': + naics_2 = ( + fba + .query('ActivityProducedBy.str.len() == 3') + .assign(ActivityProducedBy=lambda x: (x.ActivityProducedBy + .str.slice(stop=2))) + .groupby(fba.groupby_cols).agg('sum') + .reset_index() + ) + fba = pd.concat([naics_2, fba]).reset_index(drop=True) + + target_naics = set(naics.industry_spec_key(fba.config['industry_spec']) + .target_naics) + filtered = fba.query('ActivityProducedBy in @target_naics') + + return filtered diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 34130c7dd..d7409ccdb 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -15,10 +15,18 @@ NAME_SEP_CHAR = '.' # ^^^ Used to separate source/activity set names as part of 'full_name' attr + with open(settings.datapath + 'flowby_config.yaml') as f: flowby_config = flowsa_yaml.load(f) +# TODO: Move this to common.py +def get_catalog_info(source_name: str) -> dict: + source_catalog = common.load_yaml_dict('source_catalog') + source_name = common.return_true_source_catalog_name(source_name) + return source_catalog.get(source_name, {}) + + class _FlowBy(pd.DataFrame): _metadata = ['full_name', 'config'] @@ -834,42 +842,42 @@ def attribute_flows_to_sectors( fba: 'FlowByActivity' = ( grouped .map_to_sectors(external_config_path=external_config_path) - .function_socket('clean_fba_w_sec_df_fxn', + .function_socket('clean_fba_w_sec', attr=self.config, method=self.config) .rename(columns={'SourceName': 'MetaSources'}) ) + if all(fba.groupby('group_id')['group_id'].agg('count') == 1): + log.info('No attribution needed for %s at the given industry ' + 'aggregation level', fba.full_name) + return fba.drop(columns=['group_id', 'group_total']) + attribution_method = fba.config.get('attribution_method') + if attribution_method == 'proportional': (source, config), = fba.config['attribution_source'].items() - attributed_fba = ( - fba - .proportionally_attribute( - FlowByActivity.getFlowByActivity( - source, - config={**{k: v for k, v in fba.config.items() - if k in fba.config['method_config_keys'] - or k == 'method_config_keys'}, - **config} - ) - .convert_to_fbs() - ) + attributed_fba = fba.proportionally_attribute( + FlowByActivity.getFlowByActivity( + full_name=source, + config={**{k: v for k, v in fba.config.items() + if k in fba.config['method_config_keys'] + or k == 'method_config_keys'}, + **get_catalog_info(source), + **config} + ).convert_to_fbs() ) elif attribution_method == 'proportional-flagged': (source, config), = fba.config['attribution_source'].items() - attributed_fba = ( - fba - .flagged_proportionally_attribute( - FlowByActivity.getFlowByActivity( - source, - config={**{k: v for k, v in fba.config.items() - if k in fba.config['method_config_keys'] - or k == 'method_config_keys'}, - **config} - ) - .convert_to_fbs() - ) + attributed_fba = fba.flagged_proportionally_attribute( + FlowByActivity.getFlowByActivity( + full_name=source, + config={**{k: v for k, v in fba.config.items() + if k in fba.config['method_config_keys'] + or k == 'method_config_keys'}, + **get_catalog_info(source), + **config} + ).convert_to_fbs() ) else: if (attribution_method is not None @@ -887,12 +895,13 @@ def attribute_flows_to_sectors( validation_total=(attributed_fba.groupby('group_id') ['FlowAmount'].transform('sum')) ) - if any(validation_fba.validation_total != validation_fba.group_total): + if not np.allclose(validation_fba.group_total, + validation_fba.validation_total): errors = (validation_fba .query('validation_total != group_total') - [['ActivityProducedBy', 'ActivityConsumedBy', + [['group_id', 'ActivityProducedBy', 'ActivityConsumedBy', 'SectorProducedBy', 'SectorConsumedBy', - 'FlowAmount', 'group_total']]) + 'FlowAmount', 'group_total', 'validation_total']]) log.error('Errors in attributing flows from %s:\n%s', self.full_name, errors) @@ -1226,10 +1235,10 @@ def convert_to_fbs(self: 'FlowByActivity') -> 'FlowBySector': return FlowBySector( self - .function_socket('clean_fba_before_mapping_df_fxn') + .function_socket('clean_fba_before_mapping') .select_by_fields() .standardize_units_and_flows() - .function_socket('clean_fba_df_fxn') + .function_socket('clean_fba') .convert_to_geoscale() .attribute_flows_to_sectors() # recursive call to convert_to_fbs .drop(columns=['ActivityProducedBy', 'ActivityConsumedBy', @@ -1403,9 +1412,7 @@ def generateFlowBySector( config={ **method_config, 'method_config_keys': method_config.keys(), - **source_catalog.get( - common.return_true_source_catalog_name(source_name), - {}), + **get_catalog_info(source_name), **config }, download_ok=download_sources_ok @@ -1421,9 +1428,7 @@ def generateFlowBySector( config={ **method_config, 'method_config_keys': method_config.keys(), - **source_catalog.get( - common.return_true_source_catalog_name(source_name), - {}), + **get_catalog_info(source_name), **config }, external_config_path=external_config_path, diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index 29c642813..24b0813a1 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -5,70 +5,55 @@ #(https://doi.org/10.23719/1517571), except that sector attribution is to 6-digit NAICS, # rather than the BEA 2012 IO schema -!include:BEA_summary_target.yaml +# !include:BEA_summary_target.yaml industry_spec: default: NAICS_3 '336': {default: NAICS_4} '541': {default: NAICS_4} +# industry_spec: +# default: NAICS_4 target_naics_year: 2012 geoscale: national _ghgi_parameters: &ghgi_parameters data_format: 'FBA' - class: Chemicals - geoscale_to_use: national - year: 2016 + # class: Chemicals + geoscale: national + year: 2017 fedefl_mapping: 'GHGI' -_allocation_types: - _direct_allocation: &direct_allocation - allocation_method: direct - _use_allocation: &use_allocation - # names: - # - "Liming" # Need to specify an activity name - allocation_method: proportional - allocation_source: "BEA_Use_Detail_PRO_BeforeRedef" - activity_to_sector_mapping: "BEA_2012_Detail" - allocation_source_class: "Money" - allocation_source_year: 2012 - allocation_flow: - - "USD2012" - allocation_compartment: None - allocation_from_scale: national - clean_allocation_fba: !script_function:BEA subset_BEA_table - # clean_parameter: {"327400": 'ActivityProducedBy'} # Need to specify - helper_source: "BLS_QCEW" - helper_method: proportional - helper_source_class: "Employment" - helper_source_year: 2012 - helper_flow: - - "Number of employees" - helper_from_scale: national - clean_helper_fba: !script_function:BLS_QCEW clean_bls_qcew_fba - clean_helper_fba_wsec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec - _pasture_allocation: &pasture_allocation # allocated based on USDA Animal operation land (acres) - allocation_method: proportional - allocation_source: "USDA_CoA_Cropland_NAICS" - allocation_source_class: "Land" - allocation_source_year: 2017 - allocation_flow: - - "FARM OPERATIONS" - allocation_compartment: None - allocation_from_scale: national - _cropland_allocation: &cropland_allocation # allocated based on USDA land area harvested - allocation_source: "USDA_CoA_Cropland" - allocation_method: proportional - allocation_source_class: "Land" - allocation_source_year: 2017 - allocation_flow: - - "AREA HARVESTED" - - "AREA BEARING & NON-BEARING" # Orchards - - "AREA GROWN" # Berry totals - - "AREA IN PRODUCTION" # Vegetable totals - allocation_compartment: None - allocation_from_scale: national - clean_allocation_fba: !script_function:USDA_CoA_Cropland coa_irrigated_cropland_fba_cleanup - clean_allocation_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics +_attribution_sources: + BEA_Use_Detail_PRO_BeforeRedef: &bea_use + activity_to_sector_mapping: BEA_2012_Detail + year: 2012 + # selection_fields: # Need to provide + # ActivityProducedBy: + # - '327400' + attribution_method: proportional + attribution_source: + BLS_QCEW: + year: 2012 + clean_fba: !script_function:temp_data_source_functions clean_qcew + USDA_CoA_Cropland_NAICS: &usda_pasture # allocated based on USDA Animal operation land (acres) + selection_fields: + Class: + - Land + FlowName: + - FARM OPERATIONS + year: 2017 + clean_fba: !script_function:temp_data_source_functions clean_usda_cropland_naics + USDA_CoA_Cropland: &usda_cropland + selection_fields: + Class: + - Land + FlowName: + - AREA HARVESTED + - AREA BEARING & NON-BEARING # Orchards + - AREA GROWN # Berry totals + - AREA IN PRODUCTION # Vegetable totals + year: 2017 + clean_fba: !script_function:USDA_CoA_Cropland coa_irrigated_cropland_fba_cleanup + clean_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics source_names: # stewiFBS: @@ -86,7 +71,8 @@ source_names: ## Agriculture EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues - <<: [*ghgi_parameters, *direct_allocation] + <<: *ghgi_parameters + attribution_method: direct selection_fields: PrimaryActivity: - Chickpeas @@ -95,65 +81,64 @@ source_names: - Rice - Soybeans - Wheat - # EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues - # <<: *ghgi_parameters - # activity_sets: - # activity_set_1: - # <<: *direct_allocation - # names: - # - Chickpeas - # - Cotton - # - Maize - # - Rice - # - Soybeans - # - Wheat - # "EPA_GHGI_T_5_3": &animals #CH4 from Enteric Fermentation - # <<: *ghgi_parameters - # activity_sets: - # activity_set_1: - # <<: *direct_allocation - # names: - # - "American Bison" - # - "Beef Cattle" - # - "Dairy Cattle" - # - "Goats" - # - "Horses" - # - "Mules and Asses" - # - "Sheep" - # - "Swine" - # - "Poultry" - # "EPA_GHGI_T_5_7": *animals #CH4 and N2O from manure, mimics enteric fermentation + EPA_GHGI_T_5_3: &animals #CH4 from Enteric Fermentation + <<: *ghgi_parameters + attribution_method: direct + selection_fields: + PrimaryActivity: + - American Bison + - Beef Cattle + - Dairy Cattle + - Goats + - Horses + - Mules and Asses + - Sheep + - Swine + - Poultry + EPA_GHGI_T_5_7: *animals #CH4 and N2O from manure, mimics enteric fermentation - # "EPA_GHGI_T_5_18": #Direct N2O emissions from agricultural soils - # <<: *ghgi_parameters - # activity_sets: - # activity_set_1: # allocated based on fertilizer use - # <<: *use_allocation - # names: - # - "Organic Amendment Cropland" - # - "Residue N Cropland" - # - "Synthetic Fertilizer Cropland" - # clean_parameter: {"325310": 'ActivityProducedBy'} # Fertilizers - # activity_set_2: - # <<: *cropland_allocation - # names: - # - "Mineralization and Asymbiotic Fixation Cropland" - # - "Drained Organic Soils Cropland" - # activity_set_3: - # <<: *pasture_allocation - # names: - # - "All activities Grassland" + EPA_GHGI_T_5_18: #Direct N2O emissions from agricultural soils + <<: *ghgi_parameters + activity_sets: + fertilizer_use: &fertilizer # allocated based on fertilizer use + selection_fields: + PrimaryActivity: + - Organic Amendment Cropland + - Residue N Cropland + - Synthetic Fertilizer Cropland + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: + - '325310' + cropland: + selection_fields: + PrimaryActivity: + - Mineralization and Asymbiotic Fixation Cropland + - Drained Organic Soils Cropland + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland: + <<: *usda_cropland + pasture: &pasture + selection_fields: + PrimaryActivity: + - All activities Grassland + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + <<: *usda_pasture - # "EPA_GHGI_T_5_19": #Indirect N2O emissions from agricultural soils - # <<: *ghgi_parameters - # activity_sets: - # activity_set_1: # allocated based on fertilizer use - # <<: *use_allocation - # names: - # - "Volatilization & Atm. Deposition Cropland" - # - "Surface Leaching & Run-Off Cropland" - # clean_parameter: {"325310": 'ActivityProducedBy'} # Fertilizers - # activity_set_2: - # <<: *pasture_allocation - # names: - # - "All activities Grassland" + "EPA_GHGI_T_5_19": #Indirect N2O emissions from agricultural soils + <<: *ghgi_parameters + activity_sets: + fertilizer_use: # allocated based on fertilizer use + <<: *fertilizer + selection_fields: + PrimaryActivity: + - Volatilization & Atm. Deposition Cropland + - Surface Leaching & Run-Off Cropland + pasture: + <<: *pasture From c939ef47037a501360c0266c620b1c65a47b944c Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 21 Jun 2022 11:30:00 -0400 Subject: [PATCH 0108/1127] validation equal_nan=True --- flowsa/flowby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index d7409ccdb..762d4499d 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -896,7 +896,7 @@ def attribute_flows_to_sectors( ['FlowAmount'].transform('sum')) ) if not np.allclose(validation_fba.group_total, - validation_fba.validation_total): + validation_fba.validation_total, equal_nan=True): errors = (validation_fba .query('validation_total != group_total') [['group_id', 'ActivityProducedBy', 'ActivityConsumedBy', From 0f54453f0a0a9ccf522eac5dbd10c472fdb54457 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 21 Jun 2022 17:19:38 -0400 Subject: [PATCH 0109/1127] Removed unecessary source_catalog variable --- flowsa/flowby.py | 1 - 1 file changed, 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 762d4499d..facc004b9 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1401,7 +1401,6 @@ def generateFlowBySector( generating them. ''' log.info('Beginning FlowBySector generation for %s', method) - source_catalog = common.load_yaml_dict('source_catalog') method_config = common.load_yaml_dict(method, 'FBS', external_config_path) sources = method_config.pop('source_names') From 69d8a8624b47b5c01f158b846b3da59ca76552ae Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 21 Jun 2022 17:22:39 -0400 Subject: [PATCH 0110/1127] Added electricity from GHGI --- .../NAICS_Crosswalk_EPA_GHGI_m2.csv | 536 ++++++++++++++++++ .../flowbysectormethods/SEEA_2017_v1.yaml | 22 +- 2 files changed, 557 insertions(+), 1 deletion(-) create mode 100644 flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_m2.csv diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_m2.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_m2.csv new file mode 100644 index 000000000..3a1e77add --- /dev/null +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_m2.csv @@ -0,0 +1,536 @@ +ActivitySourceName,Activity,SectorSourceName,Sector,SectorType,Notes,Table +EPA_GHGI,Iron and Steel Production & Metallurgical Coke Production,NAICS_2012_Code,3311,,331110,EPA_GHGI_T_2_1 +EPA_GHGI,Cement Production,NAICS_2012_Code,32731,,327310,EPA_GHGI_T_2_1 +EPA_GHGI,Lime Production,NAICS_2012_Code,3274,,327400,EPA_GHGI_T_2_1 +EPA_GHGI,Ammonia Production,NAICS_2012_Code,32531,,325310,EPA_GHGI_T_2_1 +EPA_GHGI,Incineration of Waste,NAICS_2012_Code,562,,562000,EPA_GHGI_T_2_1 +EPA_GHGI,Aluminum Production,NAICS_2012_Code,331313,,331313,"EPA_GHGI_T_2_1, EPA_GHGI_T_4_80" +EPA_GHGI,Soda Ash Production,NAICS_2012_Code,32519,,325190,EPA_GHGI_T_2_1 +EPA_GHGI,Ferroalloy Production,NAICS_2012_Code,3311,,331110,EPA_GHGI_T_2_1 +EPA_GHGI,Titanium Dioxide Production,NAICS_2012_Code,32519,,325190,EPA_GHGI_T_2_1 +EPA_GHGI,Zinc Production,NAICS_2012_Code,33142,,331420,EPA_GHGI_T_2_1 +EPA_GHGI,Phosphoric Acid Production,NAICS_2012_Code,32531,,325310,EPA_GHGI_T_2_1 +EPA_GHGI,Glass Production,NAICS_2012_Code,3272,,327200,EPA_GHGI_T_2_1 +EPA_GHGI,Carbide Production and Consumption,NAICS_2012_Code,32518,,325180,EPA_GHGI_T_2_1 +EPA_GHGI,Landfills,NAICS_2012_Code,562,,562000,EPA_GHGI_T_2_1 +EPA_GHGI,Urea Consumption for Non-Agricultural Purposes,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_2_1 +EPA_GHGI,Urea Consumption for Non-Agricultural Purposes,NAICS_2012_Code,32,,,EPA_GHGI_T_2_1 +EPA_GHGI,Urea Consumption for Non-Agricultural Purposes,NAICS_2012_Code,33,,,EPA_GHGI_T_2_1 +EPA_GHGI,Other Process Uses of Carbonates,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_2_1 +EPA_GHGI,Other Process Uses of Carbonates,NAICS_2012_Code,32,,,EPA_GHGI_T_2_1 +EPA_GHGI,Other Process Uses of Carbonates,NAICS_2012_Code,33,,,EPA_GHGI_T_2_1 +EPA_GHGI,Lead Production,NAICS_2012_Code,331410,,"331410, 331490",EPA_GHGI_T_2_1 +EPA_GHGI,Lead Production,NAICS_2012_Code,33149,,,EPA_GHGI_T_2_1 +EPA_GHGI,Coal Mining,NAICS_2012_Code,2121,,212100,EPA_GHGI_T_2_1 +EPA_GHGI,Wastewater Treatment,NAICS_2012_Code,2213,,221300,EPA_GHGI_T_2_1 +EPA_GHGI,Abandoned Oil and Gas Wells,NAICS_2012_Code,211,,211000,EPA_GHGI_T_2_1 +EPA_GHGI,Abandoned Underground Coal Mines,NAICS_2012_Code,2121,,212100,EPA_GHGI_T_2_1 +EPA_GHGI,Composting,NAICS_2012_Code,562,,562000,EPA_GHGI_T_2_1 +EPA_GHGI,Nitric Acid Production,NAICS_2012_Code,32531,,325310,EPA_GHGI_T_2_1 +EPA_GHGI,Adipic Acid Production,NAICS_2012_Code,32519,,325190,EPA_GHGI_T_2_1 +EPA_GHGI,N2O from Product Uses,NAICS_2012_Code,621,,"621, 622, 623",EPA_GHGI_T_2_1 +EPA_GHGI,N2O from Product Uses,NAICS_2012_Code,622,,,EPA_GHGI_T_2_1 +EPA_GHGI,N2O from Product Uses,NAICS_2012_Code,623,,,EPA_GHGI_T_2_1 +EPA_GHGI,"Caprolactam, Glyoxal, and Glyoxylic Acid Production",NAICS_2012_Code,32519,,325190,EPA_GHGI_T_2_1 +EPA_GHGI,Electronics Industry,NAICS_2012_Code,334413,,"334413, name change from Semiconductor Manufacture",EPA_GHGI_T_2_1 +EPA_GHGI,Electrical Transmission and Distribution,NAICS_2012_Code,2211,,221100,EPA_GHGI_T_2_1 +EPA_GHGI,Electric Power,NAICS_2012_Code,2211,,"Commodity: 221100 (or I: 221100, S00101, S00202)",EPA_GHGI_T_2_1 +EPA_GHGI,Electric Power,NAICS_2012_Code,S00101,,,EPA_GHGI_T_2_1 +EPA_GHGI,Electric Power,NAICS_2012_Code,S00202,,,EPA_GHGI_T_2_1 +EPA_GHGI,Liming,NAICS_2012_Code,111,,"111, 112",EPA_GHGI_T_2_1 +EPA_GHGI,Liming,NAICS_2012_Code,112,,,EPA_GHGI_T_2_1 +EPA_GHGI,Urea Fertilization,NAICS_2012_Code,111,,"111, 112",EPA_GHGI_T_2_1 +EPA_GHGI,Urea Fertilization,NAICS_2012_Code,112,,,EPA_GHGI_T_2_1 +EPA_GHGI,Rice Cultivation,NAICS_2012_Code,11116,,1111B0,EPA_GHGI_T_2_1 +EPA_GHGI,Anaerobic Digestion at Biogas Facilities,NAICS_2012_Code,562,,new in GHGI since 2018,EPA_GHGI_T_2_1 +EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,111,,"111, 112, 113, 114","EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,112,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,113,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,114,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,485,,"485000, 486000, 48A000, 492000","EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,486,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,487,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,488,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,492,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Construction/Mining Equipment Non-Road,NAICS_2012_Code,211,,"211000, 212100, 2122A0, 212230, 212310, 2123AO, 213111","EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Construction/Mining Equipment Non-Road,NAICS_2012_Code,212,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Construction/Mining Equipment Non-Road,NAICS_2012_Code,213111,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,484,,484000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,485,,"485000, 48A000, 492000, 532100, 532400, 621900, 713900, 811100, 811300","EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,487,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,488,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,492,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,5321,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,5324,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,6219,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,7139,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,8111,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,8113,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Passenger Cars Gasoline On-Road,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Aircraft Non-Road,NAICS_2012_Code,481,,481000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Rail Non-Road,NAICS_2012_Code,482,,482000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Ships and Boats Non-Road,NAICS_2012_Code,483,,483000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Exploration,NAICS_2012_Code,211111,,211000,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42, EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" +EPA_GHGI,Production,NAICS_2012_Code,211111,,211000,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42, EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" +EPA_GHGI,Crude Oil Transportation,NAICS_2012_Code,486110,,not mapped,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42" +EPA_GHGI,Refining,NAICS_2012_Code,324110,,324110,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42" +EPA_GHGI,Distribution,NAICS_2012_Code,221210,,221200,"EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" +EPA_GHGI,Processing,NAICS_2012_Code,211111,,211000,"EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" +EPA_GHGI,Transmission and Storage,NAICS_2012_Code,486210,,486000,"EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" +EPA_GHGI,Chickpeas,NAICS_2012_Code,11113,,1111B0,EPA_GHGI_T_5_29 +EPA_GHGI,Cotton,NAICS_2012_Code,11192,,111900,EPA_GHGI_T_5_29 +EPA_GHGI,Maize,NAICS_2012_Code,11115,,1111B0,EPA_GHGI_T_5_29 +EPA_GHGI,Rice,NAICS_2012_Code,11116,,1111B0,EPA_GHGI_T_5_29 +EPA_GHGI,Soybeans,NAICS_2012_Code,11111,,1111A0,EPA_GHGI_T_5_29 +EPA_GHGI,Wheat,NAICS_2012_Code,11114,,1111B0,EPA_GHGI_T_5_29 +EPA_GHGI,American Bison,NAICS_2012_Code,11299,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Beef Cattle,NAICS_2012_Code,11211,,1121A0,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Dairy Cattle,NAICS_2012_Code,11212,,112120,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Goats,NAICS_2012_Code,11242,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Horses,NAICS_2012_Code,11292,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Mules and Asses,NAICS_2012_Code,11292,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Sheep,NAICS_2012_Code,11241,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Swine,NAICS_2012_Code,1122,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Poultry,NAICS_2012_Code,1123,,112300,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Acrylonitrile,NAICS_2012_Code,325199,,325411 (incorrect in original?),EPA_GHGI_T_4_46 +EPA_GHGI,Carbon Black,NAICS_2012_Code,325180,,3252A0 (incorrect in original?),EPA_GHGI_T_4_46 +EPA_GHGI,Ethylene,NAICS_2012_Code,324110,,324110,EPA_GHGI_T_4_46 +EPA_GHGI,Ethylene Dichloride,NAICS_2012_Code,325120,,not mapped,EPA_GHGI_T_4_46 +EPA_GHGI,Ethylene Oxide,NAICS_2012_Code,325199,,325411 (incorrect in original?),EPA_GHGI_T_4_46 +EPA_GHGI,Methanol,NAICS_2012_Code,325199,,325411 (incorrect in original?),EPA_GHGI_T_4_46 +EPA_GHGI,Industry Industrial Coking Coal,NAICS_2012_Code,212210,,2122A0 (incorrect in original?),EPA_GHGI_T_3_22 +EPA_GHGI,Industry Industrial Other Coal,NAICS_2012_Code,212210,,2122A0 (incorrect in original?),EPA_GHGI_T_3_22 +EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_3_22 +EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_3_22 +EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry LPG,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_3_22 +EPA_GHGI,Industry LPG,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry LPG,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry LPG,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry LPG,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry LPG,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry LPG,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Lubricants,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Lubricants,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Lubricants,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Lubricants,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Lubricants,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Lubricants,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Lubricants,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Still Gas,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Still Gas,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Still Gas,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Still Gas,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Still Gas,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Still Gas,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Still Gas,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Waxes,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Waxes,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Waxes,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Waxes,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Waxes,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Waxes,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Waxes,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Natural Gas to Chemical Plants,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Natural Gas to Chemical Plants,NAICS_2012_Code,32,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Natural Gas to Chemical Plants,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,48,,"48, 491, 492, S00500, S00600, GSLGO, S00201, S00203, F01000",EPA_GHGI_T_3_22 +EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,491,,,EPA_GHGI_T_3_22 +EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,492,,,EPA_GHGI_T_3_22 +EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,92,,,EPA_GHGI_T_3_22 +EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,F01000,,,EPA_GHGI_T_3_22 +EPA_GHGI,Coal Electric Power,NAICS_2012_Code,221112A,,"Commodity: 221100 (or I: 221100, S00101, S00202)","EPA_GHGI_T_3_7, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Electric Power,NAICS_2012_Code,221112C,,"Commodity: 221100 (or I: 221100, S00101, S00202)","EPA_GHGI_T_3_7, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Electric Power,NAICS_2012_Code,221112B,,"Commodity: 221100 (or I: 221100, S00101, S00202)",EPA_GHGI_T_3_8 +EPA_GHGI,Natural Gas Electric Power,NAICS_2012_Code,221112B,,,"EPA_GHGI_T_3_7, EPA_GHGI_T_3_9" +EPA_GHGI,Geothermal Electric Power,NAICS_2012_Code,221116,,,EPA_GHGI_T_3_7 +EPA_GHGI,Wood Electric Power,NAICS_2012_Code,221117,,"Commodity: 221100 (or I: 221100, S00101, S00202)","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Residential,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural Gas Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23, 31, 32, 33","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Industrial,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Industrial - Manufacturing,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Industrial - Manufacturing,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Industrial - Manufacturing,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Industrial,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Industrial,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Industrial,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Industrial,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,2213,,"2213, 42, 44, 45, 493, 5, 6, 7, 8, S00102, GSLGE, GSLGH","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,493,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,2213,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,493,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,2213,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,493,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,2213,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,493,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Drained Organic Soils Cropland,NAICS_2012_Code,1111,,"111, excl. 1114",EPA_GHGI_T_5_18 +EPA_GHGI,Drained Organic Soils Cropland,NAICS_2012_Code,1112,,,EPA_GHGI_T_5_18 +EPA_GHGI,Drained Organic Soils Cropland,NAICS_2012_Code,1113,,,EPA_GHGI_T_5_18 +EPA_GHGI,Drained Organic Soils Cropland,NAICS_2012_Code,1119,,,EPA_GHGI_T_5_18 +EPA_GHGI,Mineralization and Asymbiotic Fixation Cropland,NAICS_2012_Code,1111,,"111, excl. 1114",EPA_GHGI_T_5_18 +EPA_GHGI,Mineralization and Asymbiotic Fixation Cropland,NAICS_2012_Code,1112,,,EPA_GHGI_T_5_18 +EPA_GHGI,Mineralization and Asymbiotic Fixation Cropland,NAICS_2012_Code,1113,,,EPA_GHGI_T_5_18 +EPA_GHGI,Mineralization and Asymbiotic Fixation Cropland,NAICS_2012_Code,1119,,,EPA_GHGI_T_5_18 +EPA_GHGI,Organic Amendment Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_18 +EPA_GHGI,Residue N Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_18 +EPA_GHGI,Synthetic Fertilizer Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_18 +EPA_GHGI,All activities Grassland,NAICS_2012_Code,112,,112,"EPA_GHGI_T_5_18, EPA_GHGI_T_5_19" +EPA_GHGI,Volatilization & Atm. Deposition Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_19 +EPA_GHGI,Surface Leaching & Run-Off Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_19 +EPA_GHGI,Natural Gas Transportation,NAICS_2012_Code,48,,"48, 491, 492, S00500, S00600, GSLGO, S00201, S00203, F01000",EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 +EPA_GHGI,Aviation Gasoline Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 +EPA_GHGI,Aviation Gasoline Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 +EPA_GHGI,Aviation Gasoline Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 +EPA_GHGI,Aviation Gasoline Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 +EPA_GHGI,Aviation Gasoline Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 +EPA_GHGI,Jet Fuel Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 +EPA_GHGI,Jet Fuel Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 +EPA_GHGI,Jet Fuel Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 +EPA_GHGI,Jet Fuel Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 +EPA_GHGI,Jet Fuel Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 +EPA_GHGI,LPG (Propane) Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 +EPA_GHGI,LPG (Propane) Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 +EPA_GHGI,LPG (Propane) Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 +EPA_GHGI,LPG (Propane) Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 +EPA_GHGI,LPG (Propane) Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 +EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 +EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 +EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 +EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 +EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 +EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23",EPA_GHGI_T_A_14 +EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,21,,,EPA_GHGI_T_A_14 +EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,2212,,,EPA_GHGI_T_A_14 +EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,23,,,EPA_GHGI_T_A_14 +EPA_GHGI,Industrial Other Coal Industrial - Manufacturing,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_A_14 +EPA_GHGI,Industrial Other Coal Industrial - Manufacturing,NAICS_2012_Code,32,,,EPA_GHGI_T_A_14 +EPA_GHGI,Industrial Other Coal Industrial - Manufacturing,NAICS_2012_Code,33,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23",EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,21,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,2212,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,23,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Industrial - Manufacturing,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Industrial - Manufacturing,NAICS_2012_Code,32,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Industrial - Manufacturing,NAICS_2012_Code,33,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23, 31, 32, 33",EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,21,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,2212,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,23,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,31,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,32,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,33,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,2213,,"2213, 42, 44, 45, 493, 5, 6, 7, 8, S00102, GSLGE, GSLGH",EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,42,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,44,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,45,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,493,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,51,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,52,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,53,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,54,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,55,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,56,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,61,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,62,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,71,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,72,,,EPA_GHGI_T_A_14 +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,81,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,2213,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,42,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,44,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,45,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,493,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,51,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,52,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,53,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,54,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,55,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,56,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,61,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,62,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,71,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,72,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,81,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,2213,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,42,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,44,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,45,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,493,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,51,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,52,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,53,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,54,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,55,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,56,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,61,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,62,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,71,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,72,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,81,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total (All Fuels) Residential,NAICS_2012_Code,F01000,,F0100,EPA_GHGI_T_A_14 +EPA_GHGI,HCFC-22 Production,NAICS_2012_Code,325120,,325120,EPA_GHGI_T_4_50 +EPA_GHGI,Electronics Production,NAICS_2012_Code,334413,,334413,EPA_GHGI_T_4_94 +EPA_GHGI,Magnesium Production and Processing,NAICS_2012_Code,331410,,"331410, 331490, 331520",EPA_GHGI_T_4_84 +EPA_GHGI,Magnesium Production and Processing,NAICS_2012_Code,33149,,,EPA_GHGI_T_4_84 +EPA_GHGI,Magnesium Production and Processing,NAICS_2012_Code,33152,,,EPA_GHGI_T_4_84 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,11,,"All sectors, excluding transport",EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,21,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,22,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,23,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,31,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,32,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,33,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,42,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,44,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,45,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,49,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,51,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,52,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,53,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,54,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,55,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,56,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,61,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,62,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,71,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,72,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,81,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,92,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,F01000,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning - Households,NAICS_2012_Code,F01000,,Exclusive household portion,EPA_GHGI_T_4_101 +EPA_GHGI,Aerosols,,,,excluded,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,11,,All sectors,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,21,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,22,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,23,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,31,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,32,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,33,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,42,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,44,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,45,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,48,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,49,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,51,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,52,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,53,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,54,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,55,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,56,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,61,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,62,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,71,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,72,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,81,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,92,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,F01000,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,11,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,21,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,22,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,23,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,31,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,32,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,33,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,42,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,44,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,45,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,48,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,49,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,51,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,52,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,53,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,54,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,55,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,56,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,61,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,62,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,71,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,72,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,81,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,92,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,F01000,,,EPA_GHGI_T_4_101 +EPA_GHGI,Solvents,,,,excluded,EPA_GHGI_T_4_101 +EPA_GHGI,Fire Protection,,,,excluded,EPA_GHGI_T_4_101 +EPA_GHGI,Mobile AC - Heavy-Duty Vehicles,NAICS_2012_Code,484,,484000,EPA_GHGI_T_A_103 +EPA_GHGI,Mobile AC - Light-Duty Trucks,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_103 +EPA_GHGI,Refrigerated Transport - Medium- and Heavy-Duty Trucks,NAICS_2012_Code,484,,484000,EPA_GHGI_T_A_103 +EPA_GHGI,Mobile AC - Passenger Cars,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_103 +EPA_GHGI,Comfort Cooling for Trains and Buses - Rail,NAICS_2012_Code,482,,482000,EPA_GHGI_T_A_103 +EPA_GHGI,Refrigerated Transport - Rail,NAICS_2012_Code,482,,482000,EPA_GHGI_T_A_103 +EPA_GHGI,Comfort Cooling for Trains and Buses - School and Tour Buses,NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_103 +EPA_GHGI,Refrigerated Transport - Ships and Boats,NAICS_2012_Code,483,,483000,EPA_GHGI_T_A_103 +EPA_GHGI,Comfort Cooling for Trains and Buses - Transit Buses,,,,excluded,EPA_GHGI_T_A_103 +EPA_GHGI,Buses,NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_79 +EPA_GHGI,Buses - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_79 +EPA_GHGI,Buses - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,487,,48A000,EPA_GHGI_T_A_79 +EPA_GHGI,Buses - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,488,,,EPA_GHGI_T_A_79 +EPA_GHGI,Buses - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,S00201,,S00201,EPA_GHGI_T_A_79 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,481,,481000,EPA_GHGI_T_A_79 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,481,,481000,EPA_GHGI_T_A_79 +EPA_GHGI,Military Aircraft,NAICS_2012_Code,928110,,S00500,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks - Gasoline,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks - Gasoline,NAICS_2012_Code,492,,492000,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,484,,484000,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,484,,484000,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,92212,,S00203,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,92214,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,92216,,,EPA_GHGI_T_A_79 +EPA_GHGI,Motorcycles,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 +EPA_GHGI,Passenger Cars,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 +EPA_GHGI,Passenger Cars - Gasoline,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 +EPA_GHGI,Passenger Cars - Gasoline,NAICS_2012_Code,92,,S00600,EPA_GHGI_T_A_79 +EPA_GHGI,Passenger Cars - Gasoline,NAICS_2012_Code,491,,491000,EPA_GHGI_T_A_79 +EPA_GHGI,Passenger Cars - Gasoline,NAICS_2012_Code,92,,GSLGO,EPA_GHGI_T_A_79 +EPA_GHGI,Pipelines,NAICS_2012_Code,486,,486000,EPA_GHGI_T_A_79 +EPA_GHGI,Rail,NAICS_2012_Code,482,,482000,EPA_GHGI_T_A_79 +EPA_GHGI,Recreational Boats,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,4831,,483000,EPA_GHGI_T_A_79 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,4832,,4-digit to avoid data loss in BLS_QCEW,EPA_GHGI_T_A_79 +EPA_GHGI,Ships and Non-Recreational Boats,NAICS_2012_Code,483,,483000,EPA_GHGI_T_A_79 diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index 24b0813a1..44ec55cb4 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -69,6 +69,26 @@ source_names: # reassign_process_to_sectors: # - airplane_emissions +## Stationary Combustion for Electric Power + EPA_GHGI_T_3_7: &stationary_electric # CO2 emissions from stationary combustion (electricity only) + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: + - Coal Electric Power + - Natural Gas Electric Power + - Natural gas Electric Power # note lower case + - Fuel Oil Electric Power + - Geothermal Electric Power + - Wood Electric Power + activity_to_sector_mapping: EPA_GHGI_m2 + attribution_method: direct + + EPA_GHGI_T_3_8: # CH4 emissions from stationary combustion + <<: *stationary_electric + + EPA_GHGI_T_3_9: # N2O emissions from stationary combustion + <<: *stationary_electric + ## Agriculture EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues <<: *ghgi_parameters @@ -131,7 +151,7 @@ source_names: USDA_CoA_Cropland_NAICS: <<: *usda_pasture - "EPA_GHGI_T_5_19": #Indirect N2O emissions from agricultural soils + EPA_GHGI_T_5_19: #Indirect N2O emissions from agricultural soils <<: *ghgi_parameters activity_sets: fertilizer_use: # allocated based on fertilizer use From ca8219b6bbc71fa8232ec5ddfa261737fde0613c Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 22 Jun 2022 08:38:37 -0400 Subject: [PATCH 0111/1127] standardize_units_and_flows() now standardizes column names as well --- flowsa/flowby.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index facc004b9..fefbb9ccd 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -602,7 +602,6 @@ def getFlowByActivity( # flow list mapping using this function as well. def map_to_fedefl_list( self: 'FlowByActivity', - drop_fba_columns: bool = False, drop_unmapped_rows: bool = False ) -> 'FlowByActivity': fba_merge_keys = [ @@ -651,8 +650,7 @@ def map_to_fedefl_list( self.Unit.str.contains('/d'), self.FlowAmount * 365), Unit=self.Unit.str.replace('/d', '')) - .conditional_method(drop_fba_columns, 'drop', - columns=['FlowName', 'Compartment']) + .drop(columns=['FlowName', 'Compartment']) ) mapping = ( @@ -1241,8 +1239,7 @@ def convert_to_fbs(self: 'FlowByActivity') -> 'FlowBySector': .function_socket('clean_fba') .convert_to_geoscale() .attribute_flows_to_sectors() # recursive call to convert_to_fbs - .drop(columns=['ActivityProducedBy', 'ActivityConsumedBy', - 'FlowName', 'Compartment']) + .drop(columns=['ActivityProducedBy', 'ActivityConsumedBy']) .aggregate_flowby() ) @@ -1296,7 +1293,8 @@ def standardize_units_and_flows( if self.config.get('fedefl_mapping'): return standardized.map_to_fedefl_list() else: - return standardized + return standardized.rename(columns={'FlowName': 'Flowable', + 'Compartment': 'Context'}) class FlowBySector(_FlowBy): From ab387e1a570ff3711c5d1f3e2a22dbe66dc944a0 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 22 Jun 2022 08:59:38 -0400 Subject: [PATCH 0112/1127] Allow string scalar values in selection_fields --- flowsa/flowby.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index fefbb9ccd..0862d1edc 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -307,6 +307,12 @@ def select_by_fields(self: FB, selection_fields: dict = None) -> FB: - CO2 - CH4 + If only a single value is to be selected from a given column, it may + be given as a string scalar value instead of a single-element list: + + selection_fields: + FlowName: CO2 + Alternatively, instead of a list of values, a dictionary may be given which associates the values to select with a replacement value: @@ -329,6 +335,9 @@ def select_by_fields(self: FB, selection_fields: dict = None) -> FB: if selection_fields is None: return self + selection_fields = {k: [v] if isinstance(v, str) else v + for k, v in selection_fields.items()} + if 'PrimaryActivity' in selection_fields: self = (self .add_primary_secondary_columns('Activity') From 2b24e9cdee8849879dd80474ab0a4db4b4e556ab Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 22 Jun 2022 09:00:24 -0400 Subject: [PATCH 0113/1127] Added conversion from MT CO2e to MMT CO2e --- flowsa/data/unit_conversion.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/data/unit_conversion.csv b/flowsa/data/unit_conversion.csv index edb589425..cb42a18ec 100644 --- a/flowsa/data/unit_conversion.csv +++ b/flowsa/data/unit_conversion.csv @@ -16,3 +16,4 @@ gal/USD,kg/USD,3.79 Quadrillion Btu,MJ,1.05506E+12 Trillion Btu,MJ,1055055900 Tbtu,MJ,1055055900 +MT CO2e,MMT CO2e,0.000001 From 71e3665330e31e798c2020f574dff9afb1995e63 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 22 Jun 2022 09:07:31 -0400 Subject: [PATCH 0114/1127] Updated import statements --- flowsa/flowby.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 0862d1edc..da5e2d975 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1,11 +1,11 @@ -from typing import Callable, List, Literal, TypeVar +from typing import List, Literal, TypeVar import pandas as pd import numpy as np from functools import partial, reduce -from . import (common, settings, location, dataclean, metadata, sectormapping, +from . import (common, settings, metadata, sectormapping, literature_values, flowbyactivity, flowbysector, flowsa_yaml, - validation, geo, naics, fbs_allocation) -from .flowsa_log import log, vlog + validation, geo, naics) +from .flowsa_log import log import esupy.processed_data_mgmt import esupy.dqi import fedelemflowlist From de16b619163667397c9d9f5ee5f1859d2a529cbf Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 22 Jun 2022 11:48:46 -0400 Subject: [PATCH 0115/1127] SEEA method in-progress --- .../flowbysectormethods/SEEA_2017_v1.yaml | 360 +++++++++++++----- 1 file changed, 273 insertions(+), 87 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index 44ec55cb4..67d4cae36 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -16,11 +16,10 @@ target_naics_year: 2012 geoscale: national _ghgi_parameters: &ghgi_parameters - data_format: 'FBA' - # class: Chemicals + data_format: FBA geoscale: national year: 2017 - fedefl_mapping: 'GHGI' + fedefl_mapping: GHGI _attribution_sources: BEA_Use_Detail_PRO_BeforeRedef: &bea_use @@ -32,6 +31,8 @@ _attribution_sources: attribution_method: proportional attribution_source: BLS_QCEW: + selection_fields: + Class: Employment year: 2012 clean_fba: !script_function:temp_data_source_functions clean_qcew USDA_CoA_Cropland_NAICS: &usda_pasture # allocated based on USDA Animal operation land (acres) @@ -69,96 +70,281 @@ source_names: # reassign_process_to_sectors: # - airplane_emissions -## Stationary Combustion for Electric Power - EPA_GHGI_T_3_7: &stationary_electric # CO2 emissions from stationary combustion (electricity only) - <<: *ghgi_parameters - selection_fields: - PrimaryActivity: - - Coal Electric Power - - Natural Gas Electric Power - - Natural gas Electric Power # note lower case - - Fuel Oil Electric Power - - Geothermal Electric Power - - Wood Electric Power - activity_to_sector_mapping: EPA_GHGI_m2 - attribution_method: direct - - EPA_GHGI_T_3_8: # CH4 emissions from stationary combustion - <<: *stationary_electric - - EPA_GHGI_T_3_9: # N2O emissions from stationary combustion - <<: *stationary_electric - -## Agriculture - EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues - <<: *ghgi_parameters - attribution_method: direct - selection_fields: - PrimaryActivity: - - Chickpeas - - Cotton - - Maize - - Rice - - Soybeans - - Wheat - EPA_GHGI_T_5_3: &animals #CH4 from Enteric Fermentation - <<: *ghgi_parameters - attribution_method: direct - selection_fields: - PrimaryActivity: - - American Bison - - Beef Cattle - - Dairy Cattle - - Goats - - Horses - - Mules and Asses - - Sheep - - Swine - - Poultry - EPA_GHGI_T_5_7: *animals #CH4 and N2O from manure, mimics enteric fermentation - - EPA_GHGI_T_5_18: #Direct N2O emissions from agricultural soils + # EPA_GHGI_T_2_1: #U.S. GHG emissions + # <<: *ghgi_parameters + # activity_sets: + # direct_attribution: + # selection_fields: + # PrimaryActivity: + # - Iron and Steel Production & Metallurgical Coke Production #CO2, CH4 + # - Cement Production #CO2 + # - Lime Production #CO2 + # - Ammonia Production #CO2 + # - Incineration of Waste #CO2, #N2O + # - Aluminum Production #CO2 + # - Soda Ash Production #CO2 + # - Ferroalloy Production #CO2, CH4 + # - Titanium Dioxide Production #CO2 + # - Zinc Production #CO2 + # - Phosphoric Acid Production #CO2 + # - Glass Production #CO2 + # - Carbide Production and Consumption #CO2, CH4 + # - Landfills #CH4 + # - Coal Mining #CH4 + # - Wastewater Treatment #CH4, N2O + # - Rice Cultivation #CH4 + # - Abandoned Oil and Gas Wells #CH4 + # - Abandoned Underground Coal Mines #CH4 + # - Anaerobic Digestion at Biogas Facilities #CH4 new activity + # - Composting #CH4, N2O + # - Nitric Acid Production #N2O + # - Adipic Acid Production #N2O + # - Caprolactam, Glyoxal, and Glyoxylic Acid Production #CH4 + # - Electronics Industry #N2O + # FlowName: # HFCs and other flows are attributed elsewhere + # - CO2 + # - CH4 + # - N2O + # attribution_method: direct + + # electric_distribution: + # selection_fields: + # PrimaryActivity: Electrical Transmission and Distribution #SF6 + # FlowName: SF6 + # attribution_method: direct + + # liming: + # selection_fields: + # PrimaryActivity: Liming #CO2 + # attribution_method: proportional + # attribution_source: + # BEA_Use_Detail_PRO_BeforeRedef: + # <<: *bea_use + # selection_fields: + # ActivityProducedBy: '327400' + + # urea: + # selection_fields: + # PrimaryActivity: + # - Urea Fertilization #CO2 + # - Urea Consumption for Non-Agricultural Purposes #CO2 + # attribution_method: proportional + # attribution_source: + # BEA_Use_Detail_PRO_BeforeRedef: + # <<: *bea_use + # selection_fields: + # ActivityProducedBy: '325310' # Fertilizers + + # carbonate_use: + # selection_fields: + # PrimaryActivity: Other Process Uses of Carbonates #CO2 + # attribution_method: proportional + # attribution_source: + # BEA_Use_Detail_PRO_BeforeRedef: + # <<: *bea_use + # selection_fields: + # ActivityProducedBy: '325180' # Other Basic Inorganic Chemicals + + # lead_production: + # selection_fields: + # PrimaryActivity: Lead Production #CO2 + # attribution_method: proportional + # attribution_source: + # USGS_MYB_Lead: + # year: 2016 + # selection_fields: + # ActivityProducedBy: + # - Primary lead, refined content, domestic ores and base bullion + # - Secondary lead, lead content + + # nitrous_oxide_use: + # selection_fields: + # PrimaryActivity: N2O from Product Uses #N2O + # attribution_method: proportional + # attribution_source: + # BEA_Use_Detail_PRO_BeforeRedef: + # <<: *bea_use + # selection_fields: + # ActivityProducedBy: '325120' # Industrial gases + +# ## Stationary Combustion for Electric Power +# EPA_GHGI_T_3_7: &stationary_electric # CO2 emissions from stationary combustion (electricity only) +# <<: *ghgi_parameters +# selection_fields: +# PrimaryActivity: +# - Coal Electric Power +# - Natural Gas Electric Power +# - Natural gas Electric Power # note lower case +# - Fuel Oil Electric Power +# - Geothermal Electric Power +# - Wood Electric Power +# activity_to_sector_mapping: EPA_GHGI_m2 +# attribution_method: direct +# EPA_GHGI_T_3_8: *stationary_electric # CH4 emissions from stationary combustion +# EPA_GHGI_T_3_9: *stationary_electric # N2O emissions from stationary combustion + +# ## Fossil Fuels +# EPA_GHGI_T_3_63: &natgas #CH4 from Natural Gas Systems +# <<: *ghgi_parameters +# selection_fields: +# PrimaryActivity: +# - Distribution +# - Exploration +# - Processing +# - Production +# - Transmission and Storage +# attribution_method: direct +# EPA_GHGI_T_3_65: *natgas #CO2 from Natural Gas Systems mimics CH4 +# EPA_GHGI_T_3_67: *natgas #N2O from Natural Gas Systems, not used in original method, mimics CH4 + +# EPA_GHGI_T_3_38: &petroleum #CH4 from Petroleum Systems +# <<: *ghgi_parameters +# selection_fields: +# PrimaryActivity: +# - Crude Oil Transportation +# - Exploration +# - Production +# - Refining +# attribution_method: direct +# EPA_GHGI_T_3_40: *petroleum #CO2 from Petroleum Systems mimics CH4 +# EPA_GHGI_T_3_42: *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 + +# ## Agriculture +# EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues +# <<: *ghgi_parameters +# attribution_method: direct +# selection_fields: +# PrimaryActivity: +# - Chickpeas +# - Cotton +# - Maize +# - Rice +# - Soybeans +# - Wheat + +# EPA_GHGI_T_5_3: &animals #CH4 from Enteric Fermentation +# <<: *ghgi_parameters +# attribution_method: direct +# selection_fields: +# PrimaryActivity: +# - American Bison +# - Beef Cattle +# - Dairy Cattle +# - Goats +# - Horses +# - Mules and Asses +# - Sheep +# - Swine +# - Poultry +# EPA_GHGI_T_5_7: *animals #CH4 and N2O from manure, mimics enteric fermentation + +# EPA_GHGI_T_5_18: #Direct N2O emissions from agricultural soils +# <<: *ghgi_parameters +# activity_sets: +# fertilizer_use: &fertilizer # allocated based on fertilizer use +# selection_fields: +# PrimaryActivity: +# - Organic Amendment Cropland +# - Residue N Cropland +# - Synthetic Fertilizer Cropland +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea_use +# selection_fields: +# ActivityProducedBy: +# - '325310' +# cropland: +# selection_fields: +# PrimaryActivity: +# - Mineralization and Asymbiotic Fixation Cropland +# - Drained Organic Soils Cropland +# attribution_method: proportional +# attribution_source: +# USDA_CoA_Cropland: +# <<: *usda_cropland +# pasture: &pasture +# selection_fields: +# PrimaryActivity: +# - All activities Grassland +# attribution_method: proportional +# attribution_source: +# USDA_CoA_Cropland_NAICS: +# <<: *usda_pasture +# EPA_GHGI_T_5_19: #Indirect N2O emissions from agricultural soils +# <<: *ghgi_parameters +# activity_sets: +# fertilizer_use: # allocated based on fertilizer use +# <<: *fertilizer +# selection_fields: +# PrimaryActivity: +# - Volatilization & Atm. Deposition Cropland +# - Surface Leaching & Run-Off Cropland +# pasture: +# <<: *pasture + +## Mobile Sources (N20 and CH4) + EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion <<: *ghgi_parameters activity_sets: - fertilizer_use: &fertilizer # allocated based on fertilizer use - selection_fields: - PrimaryActivity: - - Organic Amendment Cropland - - Residue N Cropland - - Synthetic Fertilizer Cropland - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: - - '325310' - cropland: + direct_attribution: # Some of these need to be separated and attributed differently selection_fields: PrimaryActivity: - - Mineralization and Asymbiotic Fixation Cropland - - Drained Organic Soils Cropland - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland: - <<: *usda_cropland - pasture: &pasture + - Passenger Cars Gasoline On-Road + # - Light-Duty Trucks Gasoline On-Road + - Rail Non-Road + - Ships and Boats Non-Road + - Aircraft Non-Road + # - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road + attribution_method: direct + + trucking: selection_fields: PrimaryActivity: - - All activities Grassland + - Light-Duty Trucks Gasoline On-Road + - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road attribution_method: proportional attribution_source: - USDA_CoA_Cropland_NAICS: - <<: *usda_pasture + BTS_TSA - EPA_GHGI_T_5_19: #Indirect N2O emissions from agricultural soils - <<: *ghgi_parameters - activity_sets: - fertilizer_use: # allocated based on fertilizer use - <<: *fertilizer - selection_fields: - PrimaryActivity: - - Volatilization & Atm. Deposition Cropland - - Surface Leaching & Run-Off Cropland - pasture: - <<: *pasture + # construction_and_mining: + # selection_fields: + # PrimaryActivity: Construction/Mining Equipment Non-Road + # attribution_method: proportional + # attribution_source: + # BEA_Use_Detail_PRO_BeforeRedef: + # <<: *bea_use + # selection_fields: + # ActivityProducedBy: '333120' # purchases of construction/mining equipment + + # farm_non_road: + # selection_fields: + # PrimaryActivity: Agricultural Equipment Non-Road + # attribution_method: proportional + # attribution_source: + # BEA_Use_Detail_PRO_BeforeRedef: + # <<: *bea_use + # selection_fields: + # ActivityProducedBy: '333111' # purchases of farm machinery + + # other_non_road: # attributed by purchases of petroleum refinery products + # selection_fields: + # PrimaryActivity: Other Non-Road + # attribution_method: proportional + # attribution_source: + # BEA_Use_Detail_PRO_BeforeRedef: + # <<: *bea_use + # selection_fields: + # ActivityProducedBy: '324110' # purchases of refinery products + + # alt_fuel_on_road: # assumes natural gas is primary alternate fuel + # selection_fields: + # PrimaryActivity: Alternative Fuel On-Road + # attribution_method: proportional + # attribution_source: + # BEA_Use_Detail_PRO_BeforeRedef: + # <<: *bea_use + # selection_fields: + # ActivityProducedBy: '221200' # purchases of natural gas + + # "EPA_GHGI_T_3_15": *mobile #N2O from mobile combustion duplicates method for CH4 From d997d50eea2ddda4806e85072e4913e3c6a81c20 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 23 Jun 2022 12:30:47 -0400 Subject: [PATCH 0116/1127] Now renames p to employees when standardizing units --- flowsa/data/unit_conversion.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/data/unit_conversion.csv b/flowsa/data/unit_conversion.csv index cb42a18ec..b5ea767cc 100644 --- a/flowsa/data/unit_conversion.csv +++ b/flowsa/data/unit_conversion.csv @@ -17,3 +17,4 @@ Quadrillion Btu,MJ,1.05506E+12 Trillion Btu,MJ,1055055900 Tbtu,MJ,1055055900 MT CO2e,MMT CO2e,0.000001 +p,employees,1 From 7bc437accf9412f9402b2659996504e342a6f753 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 23 Jun 2022 13:53:55 -0400 Subject: [PATCH 0117/1127] Tweaks to logging --- flowsa/flowby.py | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index da5e2d975..c245185b0 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -363,6 +363,9 @@ def select_by_fields(self: FB, selection_fields: dict = None) -> FB: for field, values in other_fields.items(): filtered_fb = filtered_fb.query(f'{field} in @values') + if filtered_fb.empty: + log.warning('%s FBA is empty', filtered_fb.full_name) + for k in ['Activity', 'Sector']: if isinstance(other_fields.get(f'Primary{k}'), dict): if isinstance(special_fields.get(k), dict): @@ -486,9 +489,6 @@ def add_primary_secondary_columns( f'{col_type}ConsumedBy columns are missing.') return self else: - log.info(f'Adding Primary{col_type} and Secondary{col_type} ' - f'columns from {col_type}ProducedBy and ' - f'{col_type}ConsumedBy columns.') fb = self.assign( **{f'Primary{col_type}': self[f'{col_type}ProducedBy'].mask( (self.FlowType == 'TECHNOSPHERE_FLOW') @@ -646,7 +646,7 @@ def map_to_fedefl_list( mapping_merge_keys.remove('SourceListName') log.info('Mapping flows in %s to federal elementary flow list', - self.source_name) + self.full_name) if any(self.Unit.str.contains('/d')): log.info('Converting daily flows %s to annual', @@ -751,8 +751,6 @@ def convert_to_geoscale( if type(target_geoscale) == str: target_geoscale = geo.scale.from_string(target_geoscale) - log.info('Converting FBA to %s geoscale', target_geoscale.name.lower()) - geoscale_by_fips = pd.concat([ (geo.filtered_fips(scale) .assign(geoscale=scale, National='USA') @@ -765,6 +763,11 @@ def convert_to_geoscale( geoscale_name_columns = [s.name.title() for s in geo.scale if s.has_fips_level] + log.info('Determining appropriate source geoscale for %s; ' + 'target geoscale is %s', + self.full_name, + target_geoscale.name.lower()) + highest_reporting_level_by_geoscale = [ (self .merge(geoscale_by_fips, how='inner') @@ -805,12 +808,14 @@ def convert_to_geoscale( ) if len(fba_at_source_geoscale.source_geoscale.unique()) > 1: - log.warning('FBA has multiple source geoscales: %s', + log.warning('%s has multiple source geoscales: %s', + fba_at_source_geoscale.full_name, ', '.join([s.name.lower() for s in fba_at_source_geoscale .source_geoscale.unique()])) else: - log.info('FBA source geoscale is %s', + log.info('%s source geoscale is %s', + fba_at_source_geoscale.full_name, fba_at_source_geoscale .source_geoscale.unique()[0].name.lower()) @@ -943,7 +948,7 @@ def map_to_sectors( ''' if self.config['sector-like_activities']: log.info('Activities in %s are NAICS codes.', - self.source_name) + self.full_name) try: source_year = int(self.config @@ -951,10 +956,10 @@ def map_to_sectors( except ValueError: source_year = 2012 log.warning('No NAICS year given for NAICS activities in %s. ' - '2012 used as default.', self.source_name) + '2012 used as default.', self.full_name) else: log.info('NAICS Activities in %s use NAICS year %s.', - self.source_name, source_year) + self.full_name, source_year) log.info('Converting NAICS codes to desired industry/sector ' 'aggregation structure.') @@ -976,7 +981,7 @@ def map_to_sectors( else: log.info('Getting crosswalk between activities in %s and ' - 'NAICS codes.', self.source_name) + 'NAICS codes.', self.full_name) activity_to_source_naics_crosswalk = ( sectormapping.get_activitytosector_mapping( # ^^^ TODO: Replace or streamline get_...() function @@ -1000,7 +1005,7 @@ def map_to_sectors( log.warning('No NAICS year/sector source name (e.g. ' '"NAICS_2012_Code") provided in crosswalk for %s. ' '2012 being used as default.', - self.source_name) + self.full_name) activity_to_source_naics_crosswalk = ( activity_to_source_naics_crosswalk @@ -1020,7 +1025,7 @@ def map_to_sectors( ) log.info('Mapping activities in %s to NAICS codes using crosswalk', - self.source_name) + self.full_name) fba_w_naics = self for direction in ['ProducedBy', 'ConsumedBy']: fba_w_naics = ( @@ -1282,8 +1287,9 @@ def activity_sets(self) -> List['FlowByActivity']: if set(child_fba.row) & assigned_rows: log.error( - 'Some rows in multiple activity sets. This will lead ' - 'to double-counting:\n%s', + 'Some rows from %s assigned to multiple activity ' + 'sets. This will lead to double-counting:\n%s', + parent_fba.full_name, child_fba.iloc[list(set(child_fba.row) & assigned_rows)]) raise ValueError('Some rows in multiple activity sets') @@ -1291,6 +1297,10 @@ def activity_sets(self) -> List['FlowByActivity']: assigned_rows.update(child_fba.row) child_fba_list.append(child_fba.drop(columns='row')) + if set(parent_fba.row) - assigned_rows: + log.warning('Some rows from %s not assigned to an activity ' + 'set. Is this intentional?', parent_fba.full_name) + return child_fba_list else: return [self] From ec86bb62b5535d04fd5174d0536b68612aef2383 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 23 Jun 2022 13:55:25 -0400 Subject: [PATCH 0118/1127] Fixed bug in getFlowByActivity() --- flowsa/flowby.py | 72 +++++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 34 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index c245185b0..69e5fa625 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -188,7 +188,7 @@ def _getFlowBy( '%s %s could not be found locally, downloaded, or generated', file_metadata.name_data, file_metadata.category ) - fb = cls(df, full_name=full_name, config=config) + fb = cls(df, full_name=full_name, config=config or {}) return fb def standardize_units(self: FB) -> FB: @@ -604,7 +604,7 @@ def getFlowByActivity( flowby_generator=flowby_generator, output_path=settings.fbaoutputpath, full_name=full_name, - config=config + config=config or {} ) # TODO: probably only slight modification is needed to allow for material @@ -1268,42 +1268,46 @@ def activity_sets(self) -> List['FlowByActivity']: activity set name. An error will be logged if any rows from the calling FBA are assigned to multiple activity sets. ''' + if 'activity_sets' not in self.config: + return [self] + log.info('Splitting %s into activity sets', self.full_name) - if 'activity_sets' in self.config: - activities = self.config['activity_sets'] - parent_config = {k: v for k, v in self.config.items() - if k != 'activity_sets' and not k.startswith('_')} - parent_fba = self.reset_index().rename(columns={'index': 'row'}) - - child_fba_list = [] - assigned_rows = set() - for activity_set, activity_config in activities.items(): - log.info('Creating FlowByActivity for %s', activity_set) - child_fba = parent_fba.select_by_fields( - selection_fields=activity_config['selection_fields'] - ) - child_fba.full_name += f'{NAME_SEP_CHAR}{activity_set}' - child_fba.config = {**parent_config, **activity_config} - - if set(child_fba.row) & assigned_rows: - log.error( - 'Some rows from %s assigned to multiple activity ' - 'sets. This will lead to double-counting:\n%s', - parent_fba.full_name, - child_fba.iloc[list(set(child_fba.row) - & assigned_rows)]) - raise ValueError('Some rows in multiple activity sets') - - assigned_rows.update(child_fba.row) + activities = self.config['activity_sets'] + parent_config = {k: v for k, v in self.config.items() + if k != 'activity_sets' and not k.startswith('_')} + parent_fba = self.reset_index().rename(columns={'index': 'row'}) + + child_fba_list = [] + assigned_rows = set() + for activity_set, activity_config in activities.items(): + log.info('Creating FlowByActivity for %s', activity_set) + child_fba = parent_fba.select_by_fields( + selection_fields=activity_config['selection_fields'] + ) + child_fba.full_name += f'{NAME_SEP_CHAR}{activity_set}' + child_fba.config = {**parent_config, **activity_config} + + if set(child_fba.row) & assigned_rows: + log.error( + 'Some rows from %s assigned to multiple activity ' + 'sets. This will lead to double-counting:\n%s', + parent_fba.full_name, + child_fba.iloc[list(set(child_fba.row) + & assigned_rows)]) + raise ValueError('Some rows in multiple activity sets') + + assigned_rows.update(child_fba.row) + if not child_fba.empty: child_fba_list.append(child_fba.drop(columns='row')) + else: + log.error('Activity set %s is empty. Check activity set ' + 'definition!', child_fba.full_name) - if set(parent_fba.row) - assigned_rows: - log.warning('Some rows from %s not assigned to an activity ' - 'set. Is this intentional?', parent_fba.full_name) + if set(parent_fba.row) - assigned_rows: + log.warning('Some rows from %s not assigned to an activity ' + 'set. Is this intentional?', parent_fba.full_name) - return child_fba_list - else: - return [self] + return child_fba_list def standardize_units_and_flows( self: 'FlowByActivity' From 09dd60003e257624f7a28239984bd596152534d2 Mon Sep 17 00:00:00 2001 From: Eric Bell Date: Thu, 23 Jun 2022 15:39:38 -0400 Subject: [PATCH 0119/1127] Update EPA_SIT flowbyactivity .yaml to account for changes in the most recent release of the SIT tool (March 2022). --- .../flowbyactivitymethods/EPA_SIT.yaml | 47 +++++++++++++++---- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/flowsa/methods/flowbyactivitymethods/EPA_SIT.yaml b/flowsa/methods/flowbyactivitymethods/EPA_SIT.yaml index 36a3f2fee..ac690d1b4 100644 --- a/flowsa/methods/flowbyactivitymethods/EPA_SIT.yaml +++ b/flowsa/methods/flowbyactivitymethods/EPA_SIT.yaml @@ -8,6 +8,8 @@ parse_response_fxn: !script_function:EPA_SIT epa_sit_parse state: 'ME' file: 'Synthesis Tool.xlsm' years: +- 2019 +- 2018 - 2017 - 2016 - 2015 @@ -40,7 +42,7 @@ years: sheet_dict: 'CO2FFC': - nrows: 32 + nrows: 33 unit: MMTCO2e flow: CO2 headers: @@ -51,6 +53,7 @@ sheet_dict: - Electric Utilities - International Bunker Fuels - TOTAL + - Additional CO2 Emissions 'IndirectCO2': nrows: 45 @@ -62,6 +65,7 @@ sheet_dict: - Industrial - Transportation - TOTAL + - Additional CO2 Emissions subsubheaders: - Conventional Boiler Use - CHP and/or Cogeneration Process @@ -69,7 +73,7 @@ sheet_dict: - Process Cooling and Refrigeration - Machine Drive - Electro-Chemical Processes - - Other Process use + - Other Process Use - Facility HVAC - Facility Lighting - Other Facility Support @@ -77,13 +81,15 @@ sheet_dict: - Other Nonprocess Use 'Stationary': - nrows: 15 + nrows: 17 unit: MMTCO2e headers: - Residential - Commercial - Industrial - Electric Utilities + - Additional N2O Emissions + - Additional CH4 Emissions - TOTAL skiprowstart: 13 skiprowend: 15 @@ -92,7 +98,7 @@ sheet_dict: 'Mobile Combustion CH4': sheetname: Mobile Combustion header: 55 - nrows: 21 + nrows: 22 flow: CH4 unit: MTCO2e headers: @@ -100,12 +106,13 @@ sheet_dict: - Diesel Highway - Non-Highway - Alternative Fuel Vehicles + - Additional CH4 Emissions - Total 'Mobile Combustion N2O': sheetname: Mobile Combustion header: 82 - nrows: 21 + nrows: 22 flow: N2O unit: MTCO2e headers: @@ -113,16 +120,18 @@ sheet_dict: - Diesel Highway - Non-Highway - Alternative Fuel Vehicles + - Additional N2O Emissions - Total 'Coal': header: 3 - nrows: 5 + nrows: 6 unit: MTCO2e flow: CH4 headers: - Coal Mining - Abandoned Coal Mines + - Additional Emissions Source 'Gas and Oil': header: 17 @@ -143,12 +152,15 @@ sheet_dict: - Natural Gas Flaring 'IP': - nrows: 20 + nrows: 23 unit: MTCO2e headers: - Carbon Dioxide Emissions - Nitrous Oxide Emissions - HFC, PFC, SF6 and NF3 Emissions + - Additional Carbon Dioxide Emissions + - Additional Nitrous Oxide Emissions + - Additional HFC, PFC, SF6, and NF3 Emissions - Total Emissions subgroup: 'activitybyflow' @@ -181,7 +193,7 @@ sheet_dict: 'Land-Use Change and Forest Emissions and Sequestration': sheetname: Forest Management header: 8 - nrows: 19 + nrows: 37 unit: MMTCO2E flow: CO2E headers: @@ -191,6 +203,21 @@ sheet_dict: - Forest Fires - N2O from Settlement Soils - Agricultural Soil Carbon Flux + - Additional Carbon Dioxide Emissions + - Additional Methane Emissions + - Additional Nitrous Oxide Emissions + - Total + subsubheaders: + - Aboveground Biomass + - Belowground Biomass + - Deadwood + - Litter + - Soil (Mineral) + - Soil (Organic) + - Drained Organic Soil + - Total wood products and landfills + skiprowstart: 10 + skiprowend: 18 'Emissions from Landfills': sheetname: Waste @@ -221,11 +248,13 @@ sheet_dict: 'Wastewater': header: 3 - nrows: 8 + nrows: 10 unit: MMTCO2e headers: - Municipal CH4 - Municipal N2O - Industrial CH4 + - Additional Nitrous Oxide Emissions + - Additional Methan Emissions - Total Emissions subgroup: 'activitybyflow' \ No newline at end of file From c149ff1b660856c516f81a0da858cfc4b2f5dfe3 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 24 Jun 2022 10:22:47 -0400 Subject: [PATCH 0120/1127] Fixed bug which could make PrimarySector null when SecondarySector was not --- flowsa/flowby.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 69e5fa625..354fa39ed 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -491,14 +491,14 @@ def add_primary_secondary_columns( else: fb = self.assign( **{f'Primary{col_type}': self[f'{col_type}ProducedBy'].mask( - (self.FlowType == 'TECHNOSPHERE_FLOW') - | (self[f'{col_type}ProducedBy'].isna()) - | (self[f'{col_type}ProducedBy'].isin( - ['22', '221', '2213', '22131', '221310'] - ) - & self[f'{col_type}ConsumedBy'].isin( - ['F010', 'F0100', 'F01000'] - )), + ((self.FlowType == 'TECHNOSPHERE_FLOW') + | (self[f'{col_type}ProducedBy'].isna()) + | (self[f'{col_type}ProducedBy'].isin( + ['22', '221', '2213', '22131', '221310'] + ) + & self[f'{col_type}ConsumedBy'].isin( + ['F010', 'F0100', 'F01000'] + ))) & self[f'{col_type}ConsumedBy'].notna(), self[f'{col_type}ConsumedBy'] )} ) From e8d3bc734a04702c271661dac645dbb97211f219 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 24 Jun 2022 10:24:05 -0400 Subject: [PATCH 0121/1127] Added BTS_TSA to source_catalog --- flowsa/data/source_catalog.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 9281c0bbc..1e51671fa 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -48,6 +48,8 @@ BLS_QCEW: sector-like_activities: True activity_schema: NAICS_2012_Code sector_aggregation_level: "disaggregated" +BTS_TSA: + sector-like_activities: False CalRecycle_WasteCharacterization: class: - Other From 8c4559997c9e8c131c9f24c5a95d96236c87ed7e Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 24 Jun 2022 10:26:24 -0400 Subject: [PATCH 0122/1127] Added crosswalks for trucking and BTS_TSA --- .../NAICS_Crosswalk_BTS_TSA.csv | 2393 +++++++++++++++++ .../NAICS_Crosswalk_EPA_GHGI_trucking.csv | 132 + 2 files changed, 2525 insertions(+) create mode 100644 flowsa/data/activitytosectormapping/NAICS_Crosswalk_BTS_TSA.csv create mode 100644 flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_trucking.csv diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_BTS_TSA.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_BTS_TSA.csv new file mode 100644 index 000000000..9cfcb82c8 --- /dev/null +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_BTS_TSA.csv @@ -0,0 +1,2393 @@ +ActivitySourceName,Activity,SectorSourceName,Sector,SectorType,Notes +BTS_TSA,111CA,NAICS_2012_Code,11,, +BTS_TSA,113FF,NAICS_2012_Code,11,, +BTS_TSA,111CA,NAICS_2012_Code,111,, +BTS_TSA,111CA,NAICS_2012_Code,1111,, +BTS_TSA,111CA,NAICS_2012_Code,11111,, +BTS_TSA,111CA,NAICS_2012_Code,111110,, +BTS_TSA,111CA,NAICS_2012_Code,11112,, +BTS_TSA,111CA,NAICS_2012_Code,111120,, +BTS_TSA,111CA,NAICS_2012_Code,11113,, +BTS_TSA,111CA,NAICS_2012_Code,111130,, +BTS_TSA,111CA,NAICS_2012_Code,11114,, +BTS_TSA,111CA,NAICS_2012_Code,111140,, +BTS_TSA,111CA,NAICS_2012_Code,11115,, +BTS_TSA,111CA,NAICS_2012_Code,111150,, +BTS_TSA,111CA,NAICS_2012_Code,11116,, +BTS_TSA,111CA,NAICS_2012_Code,111160,, +BTS_TSA,111CA,NAICS_2012_Code,11119,, +BTS_TSA,111CA,NAICS_2012_Code,111191,, +BTS_TSA,111CA,NAICS_2012_Code,111199,, +BTS_TSA,111CA,NAICS_2012_Code,1112,, +BTS_TSA,111CA,NAICS_2012_Code,11121,, +BTS_TSA,111CA,NAICS_2012_Code,111211,, +BTS_TSA,111CA,NAICS_2012_Code,111219,, +BTS_TSA,111CA,NAICS_2012_Code,1113,, +BTS_TSA,111CA,NAICS_2012_Code,11131,, +BTS_TSA,111CA,NAICS_2012_Code,111310,, +BTS_TSA,111CA,NAICS_2012_Code,11132,, +BTS_TSA,111CA,NAICS_2012_Code,111320,, +BTS_TSA,111CA,NAICS_2012_Code,11133,, +BTS_TSA,111CA,NAICS_2012_Code,111331,, +BTS_TSA,111CA,NAICS_2012_Code,111332,, +BTS_TSA,111CA,NAICS_2012_Code,111333,, +BTS_TSA,111CA,NAICS_2012_Code,111334,, +BTS_TSA,111CA,NAICS_2012_Code,111335,, +BTS_TSA,111CA,NAICS_2012_Code,111336,, +BTS_TSA,111CA,NAICS_2012_Code,111339,, +BTS_TSA,111CA,NAICS_2012_Code,1114,, +BTS_TSA,111CA,NAICS_2012_Code,11141,, +BTS_TSA,111CA,NAICS_2012_Code,111411,, +BTS_TSA,111CA,NAICS_2012_Code,111419,, +BTS_TSA,111CA,NAICS_2012_Code,11142,, +BTS_TSA,111CA,NAICS_2012_Code,111421,, +BTS_TSA,111CA,NAICS_2012_Code,111422,, +BTS_TSA,111CA,NAICS_2012_Code,1119,, +BTS_TSA,111CA,NAICS_2012_Code,11191,, +BTS_TSA,111CA,NAICS_2012_Code,111910,, +BTS_TSA,111CA,NAICS_2012_Code,11192,, +BTS_TSA,111CA,NAICS_2012_Code,111920,, +BTS_TSA,111CA,NAICS_2012_Code,11193,, +BTS_TSA,111CA,NAICS_2012_Code,111930,, +BTS_TSA,111CA,NAICS_2012_Code,11194,, +BTS_TSA,111CA,NAICS_2012_Code,111940,, +BTS_TSA,111CA,NAICS_2012_Code,11199,, +BTS_TSA,111CA,NAICS_2012_Code,111991,, +BTS_TSA,111CA,NAICS_2012_Code,111992,, +BTS_TSA,111CA,NAICS_2012_Code,111998,, +BTS_TSA,111CA,NAICS_2012_Code,112,, +BTS_TSA,111CA,NAICS_2012_Code,1121,, +BTS_TSA,111CA,NAICS_2012_Code,11211,, +BTS_TSA,111CA,NAICS_2012_Code,112111,, +BTS_TSA,111CA,NAICS_2012_Code,112112,, +BTS_TSA,111CA,NAICS_2012_Code,11212,, +BTS_TSA,111CA,NAICS_2012_Code,112120,, +BTS_TSA,111CA,NAICS_2012_Code,11213,, +BTS_TSA,111CA,NAICS_2012_Code,112130,, +BTS_TSA,111CA,NAICS_2012_Code,1122,, +BTS_TSA,111CA,NAICS_2012_Code,11221,, +BTS_TSA,111CA,NAICS_2012_Code,112210,, +BTS_TSA,111CA,NAICS_2012_Code,1123,, +BTS_TSA,111CA,NAICS_2012_Code,11231,, +BTS_TSA,111CA,NAICS_2012_Code,112310,, +BTS_TSA,111CA,NAICS_2012_Code,11232,, +BTS_TSA,111CA,NAICS_2012_Code,112320,, +BTS_TSA,111CA,NAICS_2012_Code,11233,, +BTS_TSA,111CA,NAICS_2012_Code,112330,, +BTS_TSA,111CA,NAICS_2012_Code,11234,, +BTS_TSA,111CA,NAICS_2012_Code,112340,, +BTS_TSA,111CA,NAICS_2012_Code,11239,, +BTS_TSA,111CA,NAICS_2012_Code,112390,, +BTS_TSA,111CA,NAICS_2012_Code,1124,, +BTS_TSA,111CA,NAICS_2012_Code,11241,, +BTS_TSA,111CA,NAICS_2012_Code,112410,, +BTS_TSA,111CA,NAICS_2012_Code,11242,, +BTS_TSA,111CA,NAICS_2012_Code,112420,, +BTS_TSA,111CA,NAICS_2012_Code,1125,, +BTS_TSA,111CA,NAICS_2012_Code,11251,, +BTS_TSA,111CA,NAICS_2012_Code,112511,, +BTS_TSA,111CA,NAICS_2012_Code,112512,, +BTS_TSA,111CA,NAICS_2012_Code,112519,, +BTS_TSA,111CA,NAICS_2012_Code,1129,, +BTS_TSA,111CA,NAICS_2012_Code,11291,, +BTS_TSA,111CA,NAICS_2012_Code,112910,, +BTS_TSA,111CA,NAICS_2012_Code,11292,, +BTS_TSA,111CA,NAICS_2012_Code,112920,, +BTS_TSA,111CA,NAICS_2012_Code,11293,, +BTS_TSA,111CA,NAICS_2012_Code,112930,, +BTS_TSA,111CA,NAICS_2012_Code,11299,, +BTS_TSA,111CA,NAICS_2012_Code,112990,, +BTS_TSA,113FF,NAICS_2012_Code,113,, +BTS_TSA,113FF,NAICS_2012_Code,1131,, +BTS_TSA,113FF,NAICS_2012_Code,11311,, +BTS_TSA,113FF,NAICS_2012_Code,113110,, +BTS_TSA,113FF,NAICS_2012_Code,1132,, +BTS_TSA,113FF,NAICS_2012_Code,11321,, +BTS_TSA,113FF,NAICS_2012_Code,113210,, +BTS_TSA,113FF,NAICS_2012_Code,1133,, +BTS_TSA,113FF,NAICS_2012_Code,11331,, +BTS_TSA,113FF,NAICS_2012_Code,113310,, +BTS_TSA,113FF,NAICS_2012_Code,114,, +BTS_TSA,113FF,NAICS_2012_Code,1141,, +BTS_TSA,113FF,NAICS_2012_Code,11411,, +BTS_TSA,113FF,NAICS_2012_Code,114111,, +BTS_TSA,113FF,NAICS_2012_Code,114112,, +BTS_TSA,113FF,NAICS_2012_Code,114119,, +BTS_TSA,113FF,NAICS_2012_Code,1142,, +BTS_TSA,113FF,NAICS_2012_Code,11421,, +BTS_TSA,113FF,NAICS_2012_Code,114210,, +BTS_TSA,113FF,NAICS_2012_Code,115,, +BTS_TSA,113FF,NAICS_2012_Code,1151,, +BTS_TSA,113FF,NAICS_2012_Code,11511,, +BTS_TSA,113FF,NAICS_2012_Code,115111,, +BTS_TSA,113FF,NAICS_2012_Code,115112,, +BTS_TSA,113FF,NAICS_2012_Code,115113,, +BTS_TSA,113FF,NAICS_2012_Code,115114,, +BTS_TSA,113FF,NAICS_2012_Code,115115,, +BTS_TSA,113FF,NAICS_2012_Code,115116,, +BTS_TSA,113FF,NAICS_2012_Code,1152,, +BTS_TSA,113FF,NAICS_2012_Code,11521,, +BTS_TSA,113FF,NAICS_2012_Code,115210,, +BTS_TSA,113FF,NAICS_2012_Code,1153,, +BTS_TSA,113FF,NAICS_2012_Code,11531,, +BTS_TSA,113FF,NAICS_2012_Code,115310,, +BTS_TSA,211,NAICS_2012_Code,21,, +BTS_TSA,212,NAICS_2012_Code,21,, +BTS_TSA,213,NAICS_2012_Code,21,, +BTS_TSA,211,NAICS_2012_Code,211,, +BTS_TSA,211,NAICS_2012_Code,2111,, +BTS_TSA,211,NAICS_2012_Code,21111,, +BTS_TSA,211,NAICS_2012_Code,211111,, +BTS_TSA,211,NAICS_2012_Code,211112,, +BTS_TSA,212,NAICS_2012_Code,212,, +BTS_TSA,212,NAICS_2012_Code,2121,, +BTS_TSA,212,NAICS_2012_Code,21211,, +BTS_TSA,212,NAICS_2012_Code,212111,, +BTS_TSA,212,NAICS_2012_Code,212112,, +BTS_TSA,212,NAICS_2012_Code,212113,, +BTS_TSA,212,NAICS_2012_Code,2122,, +BTS_TSA,212,NAICS_2012_Code,21221,, +BTS_TSA,212,NAICS_2012_Code,212210,, +BTS_TSA,212,NAICS_2012_Code,21222,, +BTS_TSA,212,NAICS_2012_Code,212221,, +BTS_TSA,212,NAICS_2012_Code,212222,, +BTS_TSA,212,NAICS_2012_Code,21223,, +BTS_TSA,212,NAICS_2012_Code,212231,, +BTS_TSA,212,NAICS_2012_Code,212234,, +BTS_TSA,212,NAICS_2012_Code,21229,, +BTS_TSA,212,NAICS_2012_Code,212291,, +BTS_TSA,212,NAICS_2012_Code,212299,, +BTS_TSA,212,NAICS_2012_Code,2123,, +BTS_TSA,212,NAICS_2012_Code,21231,, +BTS_TSA,212,NAICS_2012_Code,212311,, +BTS_TSA,212,NAICS_2012_Code,212312,, +BTS_TSA,212,NAICS_2012_Code,212313,, +BTS_TSA,212,NAICS_2012_Code,212319,, +BTS_TSA,212,NAICS_2012_Code,21232,, +BTS_TSA,212,NAICS_2012_Code,212321,, +BTS_TSA,212,NAICS_2012_Code,212322,, +BTS_TSA,212,NAICS_2012_Code,212324,, +BTS_TSA,212,NAICS_2012_Code,212325,, +BTS_TSA,212,NAICS_2012_Code,21239,, +BTS_TSA,212,NAICS_2012_Code,212391,, +BTS_TSA,212,NAICS_2012_Code,212392,, +BTS_TSA,212,NAICS_2012_Code,212393,, +BTS_TSA,212,NAICS_2012_Code,212399,, +BTS_TSA,213,NAICS_2012_Code,213,, +BTS_TSA,213,NAICS_2012_Code,2131,, +BTS_TSA,213,NAICS_2012_Code,21311,, +BTS_TSA,213,NAICS_2012_Code,213111,, +BTS_TSA,213,NAICS_2012_Code,213112,, +BTS_TSA,213,NAICS_2012_Code,213113,, +BTS_TSA,213,NAICS_2012_Code,213114,, +BTS_TSA,213,NAICS_2012_Code,213115,, +BTS_TSA,22,NAICS_2012_Code,22,, +BTS_TSA,22,NAICS_2012_Code,221,, +BTS_TSA,22,NAICS_2012_Code,2211,, +BTS_TSA,22,NAICS_2012_Code,22111,, +BTS_TSA,22,NAICS_2012_Code,221111,, +BTS_TSA,22,NAICS_2012_Code,221112,, +BTS_TSA,22,NAICS_2012_Code,221113,, +BTS_TSA,22,NAICS_2012_Code,221114,, +BTS_TSA,22,NAICS_2012_Code,221115,, +BTS_TSA,22,NAICS_2012_Code,221116,, +BTS_TSA,22,NAICS_2012_Code,221117,, +BTS_TSA,22,NAICS_2012_Code,221118,, +BTS_TSA,22,NAICS_2012_Code,22112,, +BTS_TSA,22,NAICS_2012_Code,221121,, +BTS_TSA,22,NAICS_2012_Code,221122,, +BTS_TSA,22,NAICS_2012_Code,2212,, +BTS_TSA,22,NAICS_2012_Code,22121,, +BTS_TSA,22,NAICS_2012_Code,221210,, +BTS_TSA,22,NAICS_2012_Code,2213,, +BTS_TSA,22,NAICS_2012_Code,22131,, +BTS_TSA,22,NAICS_2012_Code,221310,, +BTS_TSA,22,NAICS_2012_Code,22132,, +BTS_TSA,22,NAICS_2012_Code,221320,, +BTS_TSA,22,NAICS_2012_Code,22133,, +BTS_TSA,22,NAICS_2012_Code,221330,, +BTS_TSA,23,NAICS_2012_Code,23,, +BTS_TSA,23,NAICS_2012_Code,236,, +BTS_TSA,23,NAICS_2012_Code,2361,, +BTS_TSA,23,NAICS_2012_Code,23611,, +BTS_TSA,23,NAICS_2012_Code,236115,, +BTS_TSA,23,NAICS_2012_Code,236116,, +BTS_TSA,23,NAICS_2012_Code,236117,, +BTS_TSA,23,NAICS_2012_Code,236118,, +BTS_TSA,23,NAICS_2012_Code,2362,, +BTS_TSA,23,NAICS_2012_Code,23621,, +BTS_TSA,23,NAICS_2012_Code,236210,, +BTS_TSA,23,NAICS_2012_Code,23622,, +BTS_TSA,23,NAICS_2012_Code,236220,, +BTS_TSA,23,NAICS_2012_Code,237,, +BTS_TSA,23,NAICS_2012_Code,2371,, +BTS_TSA,23,NAICS_2012_Code,23711,, +BTS_TSA,23,NAICS_2012_Code,237110,, +BTS_TSA,23,NAICS_2012_Code,23712,, +BTS_TSA,23,NAICS_2012_Code,237120,, +BTS_TSA,23,NAICS_2012_Code,23713,, +BTS_TSA,23,NAICS_2012_Code,237130,, +BTS_TSA,23,NAICS_2012_Code,2372,, +BTS_TSA,23,NAICS_2012_Code,23721,, +BTS_TSA,23,NAICS_2012_Code,237210,, +BTS_TSA,23,NAICS_2012_Code,2373,, +BTS_TSA,23,NAICS_2012_Code,23731,, +BTS_TSA,23,NAICS_2012_Code,237310,, +BTS_TSA,23,NAICS_2012_Code,2379,, +BTS_TSA,23,NAICS_2012_Code,23799,, +BTS_TSA,23,NAICS_2012_Code,237990,, +BTS_TSA,23,NAICS_2012_Code,238,, +BTS_TSA,23,NAICS_2012_Code,2381,, +BTS_TSA,23,NAICS_2012_Code,23811,, +BTS_TSA,23,NAICS_2012_Code,238110,, +BTS_TSA,23,NAICS_2012_Code,23812,, +BTS_TSA,23,NAICS_2012_Code,238120,, +BTS_TSA,23,NAICS_2012_Code,23813,, +BTS_TSA,23,NAICS_2012_Code,238130,, +BTS_TSA,23,NAICS_2012_Code,23814,, +BTS_TSA,23,NAICS_2012_Code,238140,, +BTS_TSA,23,NAICS_2012_Code,23815,, +BTS_TSA,23,NAICS_2012_Code,238150,, +BTS_TSA,23,NAICS_2012_Code,23816,, +BTS_TSA,23,NAICS_2012_Code,238160,, +BTS_TSA,23,NAICS_2012_Code,23817,, +BTS_TSA,23,NAICS_2012_Code,238170,, +BTS_TSA,23,NAICS_2012_Code,23819,, +BTS_TSA,23,NAICS_2012_Code,238190,, +BTS_TSA,23,NAICS_2012_Code,2382,, +BTS_TSA,23,NAICS_2012_Code,23821,, +BTS_TSA,23,NAICS_2012_Code,238210,, +BTS_TSA,23,NAICS_2012_Code,23822,, +BTS_TSA,23,NAICS_2012_Code,238220,, +BTS_TSA,23,NAICS_2012_Code,23829,, +BTS_TSA,23,NAICS_2012_Code,238290,, +BTS_TSA,23,NAICS_2012_Code,2383,, +BTS_TSA,23,NAICS_2012_Code,23831,, +BTS_TSA,23,NAICS_2012_Code,238310,, +BTS_TSA,23,NAICS_2012_Code,23832,, +BTS_TSA,23,NAICS_2012_Code,238320,, +BTS_TSA,23,NAICS_2012_Code,23833,, +BTS_TSA,23,NAICS_2012_Code,238330,, +BTS_TSA,23,NAICS_2012_Code,23834,, +BTS_TSA,23,NAICS_2012_Code,238340,, +BTS_TSA,23,NAICS_2012_Code,23835,, +BTS_TSA,23,NAICS_2012_Code,238350,, +BTS_TSA,23,NAICS_2012_Code,23839,, +BTS_TSA,23,NAICS_2012_Code,238390,, +BTS_TSA,23,NAICS_2012_Code,2389,, +BTS_TSA,23,NAICS_2012_Code,23891,, +BTS_TSA,23,NAICS_2012_Code,238910,, +BTS_TSA,23,NAICS_2012_Code,23899,, +BTS_TSA,23,NAICS_2012_Code,238990,, +BTS_TSA,311FT,NAICS_2012_Code,31,, +BTS_TSA,313TT,NAICS_2012_Code,31,, +BTS_TSA,315AL,NAICS_2012_Code,31,, +BTS_TSA,311FT,NAICS_2012_Code,311,, +BTS_TSA,311FT,NAICS_2012_Code,3111,, +BTS_TSA,311FT,NAICS_2012_Code,31111,, +BTS_TSA,311FT,NAICS_2012_Code,311111,, +BTS_TSA,311FT,NAICS_2012_Code,311119,, +BTS_TSA,311FT,NAICS_2012_Code,3112,, +BTS_TSA,311FT,NAICS_2012_Code,31121,, +BTS_TSA,311FT,NAICS_2012_Code,311211,, +BTS_TSA,311FT,NAICS_2012_Code,311212,, +BTS_TSA,311FT,NAICS_2012_Code,311213,, +BTS_TSA,311FT,NAICS_2012_Code,31122,, +BTS_TSA,311FT,NAICS_2012_Code,311221,, +BTS_TSA,311FT,NAICS_2012_Code,311224,, +BTS_TSA,311FT,NAICS_2012_Code,311225,, +BTS_TSA,311FT,NAICS_2012_Code,31123,, +BTS_TSA,311FT,NAICS_2012_Code,311230,, +BTS_TSA,311FT,NAICS_2012_Code,3113,, +BTS_TSA,311FT,NAICS_2012_Code,31131,, +BTS_TSA,311FT,NAICS_2012_Code,311313,, +BTS_TSA,311FT,NAICS_2012_Code,311314,, +BTS_TSA,311FT,NAICS_2012_Code,31134,, +BTS_TSA,311FT,NAICS_2012_Code,311340,, +BTS_TSA,311FT,NAICS_2012_Code,31135,, +BTS_TSA,311FT,NAICS_2012_Code,311351,, +BTS_TSA,311FT,NAICS_2012_Code,311352,, +BTS_TSA,311FT,NAICS_2012_Code,3114,, +BTS_TSA,311FT,NAICS_2012_Code,31141,, +BTS_TSA,311FT,NAICS_2012_Code,311411,, +BTS_TSA,311FT,NAICS_2012_Code,311412,, +BTS_TSA,311FT,NAICS_2012_Code,31142,, +BTS_TSA,311FT,NAICS_2012_Code,311421,, +BTS_TSA,311FT,NAICS_2012_Code,311422,, +BTS_TSA,311FT,NAICS_2012_Code,311423,, +BTS_TSA,311FT,NAICS_2012_Code,3115,, +BTS_TSA,311FT,NAICS_2012_Code,31151,, +BTS_TSA,311FT,NAICS_2012_Code,311511,, +BTS_TSA,311FT,NAICS_2012_Code,311512,, +BTS_TSA,311FT,NAICS_2012_Code,311513,, +BTS_TSA,311FT,NAICS_2012_Code,311514,, +BTS_TSA,311FT,NAICS_2012_Code,31152,, +BTS_TSA,311FT,NAICS_2012_Code,311520,, +BTS_TSA,311FT,NAICS_2012_Code,3116,, +BTS_TSA,311FT,NAICS_2012_Code,31161,, +BTS_TSA,311FT,NAICS_2012_Code,311611,, +BTS_TSA,311FT,NAICS_2012_Code,311612,, +BTS_TSA,311FT,NAICS_2012_Code,311613,, +BTS_TSA,311FT,NAICS_2012_Code,311615,, +BTS_TSA,311FT,NAICS_2012_Code,3117,, +BTS_TSA,311FT,NAICS_2012_Code,31171,, +BTS_TSA,311FT,NAICS_2012_Code,311710,, +BTS_TSA,311FT,NAICS_2012_Code,3118,, +BTS_TSA,311FT,NAICS_2012_Code,31181,, +BTS_TSA,311FT,NAICS_2012_Code,311811,, +BTS_TSA,311FT,NAICS_2012_Code,311812,, +BTS_TSA,311FT,NAICS_2012_Code,311813,, +BTS_TSA,311FT,NAICS_2012_Code,31182,, +BTS_TSA,311FT,NAICS_2012_Code,311821,, +BTS_TSA,311FT,NAICS_2012_Code,311824,, +BTS_TSA,311FT,NAICS_2012_Code,31183,, +BTS_TSA,311FT,NAICS_2012_Code,311830,, +BTS_TSA,311FT,NAICS_2012_Code,3119,, +BTS_TSA,311FT,NAICS_2012_Code,31191,, +BTS_TSA,311FT,NAICS_2012_Code,311911,, +BTS_TSA,311FT,NAICS_2012_Code,311919,, +BTS_TSA,311FT,NAICS_2012_Code,31192,, +BTS_TSA,311FT,NAICS_2012_Code,311920,, +BTS_TSA,311FT,NAICS_2012_Code,31193,, +BTS_TSA,311FT,NAICS_2012_Code,311930,, +BTS_TSA,311FT,NAICS_2012_Code,31194,, +BTS_TSA,311FT,NAICS_2012_Code,311941,, +BTS_TSA,311FT,NAICS_2012_Code,311942,, +BTS_TSA,311FT,NAICS_2012_Code,31199,, +BTS_TSA,311FT,NAICS_2012_Code,311991,, +BTS_TSA,311FT,NAICS_2012_Code,311999,, +BTS_TSA,311FT,NAICS_2012_Code,312,, +BTS_TSA,311FT,NAICS_2012_Code,3121,, +BTS_TSA,311FT,NAICS_2012_Code,31211,, +BTS_TSA,311FT,NAICS_2012_Code,312111,, +BTS_TSA,311FT,NAICS_2012_Code,312112,, +BTS_TSA,311FT,NAICS_2012_Code,312113,, +BTS_TSA,311FT,NAICS_2012_Code,31212,, +BTS_TSA,311FT,NAICS_2012_Code,312120,, +BTS_TSA,311FT,NAICS_2012_Code,31213,, +BTS_TSA,311FT,NAICS_2012_Code,312130,, +BTS_TSA,311FT,NAICS_2012_Code,31214,, +BTS_TSA,311FT,NAICS_2012_Code,312140,, +BTS_TSA,311FT,NAICS_2012_Code,3122,, +BTS_TSA,311FT,NAICS_2012_Code,31223,, +BTS_TSA,311FT,NAICS_2012_Code,312230,, +BTS_TSA,313TT,NAICS_2012_Code,313,, +BTS_TSA,313TT,NAICS_2012_Code,3131,, +BTS_TSA,313TT,NAICS_2012_Code,31311,, +BTS_TSA,313TT,NAICS_2012_Code,313110,, +BTS_TSA,313TT,NAICS_2012_Code,3132,, +BTS_TSA,313TT,NAICS_2012_Code,31321,, +BTS_TSA,313TT,NAICS_2012_Code,313210,, +BTS_TSA,313TT,NAICS_2012_Code,31322,, +BTS_TSA,313TT,NAICS_2012_Code,313220,, +BTS_TSA,313TT,NAICS_2012_Code,31323,, +BTS_TSA,313TT,NAICS_2012_Code,313230,, +BTS_TSA,313TT,NAICS_2012_Code,31324,, +BTS_TSA,313TT,NAICS_2012_Code,313240,, +BTS_TSA,313TT,NAICS_2012_Code,3133,, +BTS_TSA,313TT,NAICS_2012_Code,31331,, +BTS_TSA,313TT,NAICS_2012_Code,313310,, +BTS_TSA,313TT,NAICS_2012_Code,31332,, +BTS_TSA,313TT,NAICS_2012_Code,313320,, +BTS_TSA,313TT,NAICS_2012_Code,314,, +BTS_TSA,313TT,NAICS_2012_Code,3141,, +BTS_TSA,313TT,NAICS_2012_Code,31411,, +BTS_TSA,313TT,NAICS_2012_Code,314110,, +BTS_TSA,313TT,NAICS_2012_Code,31412,, +BTS_TSA,313TT,NAICS_2012_Code,314120,, +BTS_TSA,313TT,NAICS_2012_Code,3149,, +BTS_TSA,313TT,NAICS_2012_Code,31491,, +BTS_TSA,313TT,NAICS_2012_Code,314910,, +BTS_TSA,313TT,NAICS_2012_Code,31499,, +BTS_TSA,313TT,NAICS_2012_Code,314994,, +BTS_TSA,313TT,NAICS_2012_Code,314999,, +BTS_TSA,315AL,NAICS_2012_Code,315,, +BTS_TSA,315AL,NAICS_2012_Code,3151,, +BTS_TSA,315AL,NAICS_2012_Code,31511,, +BTS_TSA,315AL,NAICS_2012_Code,315110,, +BTS_TSA,315AL,NAICS_2012_Code,31519,, +BTS_TSA,315AL,NAICS_2012_Code,315190,, +BTS_TSA,315AL,NAICS_2012_Code,3152,, +BTS_TSA,315AL,NAICS_2012_Code,31521,, +BTS_TSA,315AL,NAICS_2012_Code,315210,, +BTS_TSA,315AL,NAICS_2012_Code,31522,, +BTS_TSA,315AL,NAICS_2012_Code,315220,, +BTS_TSA,315AL,NAICS_2012_Code,31524,, +BTS_TSA,315AL,NAICS_2012_Code,315240,, +BTS_TSA,315AL,NAICS_2012_Code,31528,, +BTS_TSA,315AL,NAICS_2012_Code,315280,, +BTS_TSA,315AL,NAICS_2012_Code,3159,, +BTS_TSA,315AL,NAICS_2012_Code,31599,, +BTS_TSA,315AL,NAICS_2012_Code,315990,, +BTS_TSA,315AL,NAICS_2012_Code,316,, +BTS_TSA,315AL,NAICS_2012_Code,3161,, +BTS_TSA,315AL,NAICS_2012_Code,31611,, +BTS_TSA,315AL,NAICS_2012_Code,316110,, +BTS_TSA,315AL,NAICS_2012_Code,3162,, +BTS_TSA,315AL,NAICS_2012_Code,31621,, +BTS_TSA,315AL,NAICS_2012_Code,316210,, +BTS_TSA,315AL,NAICS_2012_Code,3169,, +BTS_TSA,315AL,NAICS_2012_Code,31699,, +BTS_TSA,315AL,NAICS_2012_Code,316992,, +BTS_TSA,315AL,NAICS_2012_Code,316998,, +BTS_TSA,321,NAICS_2012_Code,32,, +BTS_TSA,322,NAICS_2012_Code,32,, +BTS_TSA,323,NAICS_2012_Code,32,, +BTS_TSA,324,NAICS_2012_Code,32,, +BTS_TSA,325,NAICS_2012_Code,32,, +BTS_TSA,326,NAICS_2012_Code,32,, +BTS_TSA,327,NAICS_2012_Code,32,, +BTS_TSA,321,NAICS_2012_Code,321,, +BTS_TSA,321,NAICS_2012_Code,3211,, +BTS_TSA,321,NAICS_2012_Code,32111,, +BTS_TSA,321,NAICS_2012_Code,321113,, +BTS_TSA,321,NAICS_2012_Code,321114,, +BTS_TSA,321,NAICS_2012_Code,3212,, +BTS_TSA,321,NAICS_2012_Code,32121,, +BTS_TSA,321,NAICS_2012_Code,321211,, +BTS_TSA,321,NAICS_2012_Code,321212,, +BTS_TSA,321,NAICS_2012_Code,321213,, +BTS_TSA,321,NAICS_2012_Code,321214,, +BTS_TSA,321,NAICS_2012_Code,321219,, +BTS_TSA,321,NAICS_2012_Code,3219,, +BTS_TSA,321,NAICS_2012_Code,32191,, +BTS_TSA,321,NAICS_2012_Code,321911,, +BTS_TSA,321,NAICS_2012_Code,321912,, +BTS_TSA,321,NAICS_2012_Code,321918,, +BTS_TSA,321,NAICS_2012_Code,32192,, +BTS_TSA,321,NAICS_2012_Code,321920,, +BTS_TSA,321,NAICS_2012_Code,32199,, +BTS_TSA,321,NAICS_2012_Code,321991,, +BTS_TSA,321,NAICS_2012_Code,321992,, +BTS_TSA,321,NAICS_2012_Code,321999,, +BTS_TSA,322,NAICS_2012_Code,322,, +BTS_TSA,322,NAICS_2012_Code,3221,, +BTS_TSA,322,NAICS_2012_Code,32211,, +BTS_TSA,322,NAICS_2012_Code,322110,, +BTS_TSA,322,NAICS_2012_Code,32212,, +BTS_TSA,322,NAICS_2012_Code,322121,, +BTS_TSA,322,NAICS_2012_Code,322122,, +BTS_TSA,322,NAICS_2012_Code,32213,, +BTS_TSA,322,NAICS_2012_Code,322130,, +BTS_TSA,322,NAICS_2012_Code,3222,, +BTS_TSA,322,NAICS_2012_Code,32221,, +BTS_TSA,322,NAICS_2012_Code,322211,, +BTS_TSA,322,NAICS_2012_Code,322212,, +BTS_TSA,322,NAICS_2012_Code,322219,, +BTS_TSA,322,NAICS_2012_Code,32222,, +BTS_TSA,322,NAICS_2012_Code,322220,, +BTS_TSA,322,NAICS_2012_Code,32223,, +BTS_TSA,322,NAICS_2012_Code,322230,, +BTS_TSA,322,NAICS_2012_Code,32229,, +BTS_TSA,322,NAICS_2012_Code,322291,, +BTS_TSA,322,NAICS_2012_Code,322299,, +BTS_TSA,323,NAICS_2012_Code,323,, +BTS_TSA,323,NAICS_2012_Code,3231,, +BTS_TSA,323,NAICS_2012_Code,32311,, +BTS_TSA,323,NAICS_2012_Code,323111,, +BTS_TSA,323,NAICS_2012_Code,323113,, +BTS_TSA,323,NAICS_2012_Code,323117,, +BTS_TSA,323,NAICS_2012_Code,32312,, +BTS_TSA,323,NAICS_2012_Code,323120,, +BTS_TSA,324,NAICS_2012_Code,324,, +BTS_TSA,324,NAICS_2012_Code,3241,, +BTS_TSA,324,NAICS_2012_Code,32411,, +BTS_TSA,324,NAICS_2012_Code,324110,, +BTS_TSA,324,NAICS_2012_Code,32412,, +BTS_TSA,324,NAICS_2012_Code,324121,, +BTS_TSA,324,NAICS_2012_Code,324122,, +BTS_TSA,324,NAICS_2012_Code,32419,, +BTS_TSA,324,NAICS_2012_Code,324191,, +BTS_TSA,324,NAICS_2012_Code,324199,, +BTS_TSA,325,NAICS_2012_Code,325,, +BTS_TSA,325,NAICS_2012_Code,3251,, +BTS_TSA,325,NAICS_2012_Code,32511,, +BTS_TSA,325,NAICS_2012_Code,325110,, +BTS_TSA,325,NAICS_2012_Code,32512,, +BTS_TSA,325,NAICS_2012_Code,325120,, +BTS_TSA,325,NAICS_2012_Code,32513,, +BTS_TSA,325,NAICS_2012_Code,325130,, +BTS_TSA,325,NAICS_2012_Code,32518,, +BTS_TSA,325,NAICS_2012_Code,325180,, +BTS_TSA,325,NAICS_2012_Code,32519,, +BTS_TSA,325,NAICS_2012_Code,325193,, +BTS_TSA,325,NAICS_2012_Code,325194,, +BTS_TSA,325,NAICS_2012_Code,325199,, +BTS_TSA,325,NAICS_2012_Code,3252,, +BTS_TSA,325,NAICS_2012_Code,32521,, +BTS_TSA,325,NAICS_2012_Code,325211,, +BTS_TSA,325,NAICS_2012_Code,325212,, +BTS_TSA,325,NAICS_2012_Code,32522,, +BTS_TSA,325,NAICS_2012_Code,325220,, +BTS_TSA,325,NAICS_2012_Code,3253,, +BTS_TSA,325,NAICS_2012_Code,32531,, +BTS_TSA,325,NAICS_2012_Code,325311,, +BTS_TSA,325,NAICS_2012_Code,325312,, +BTS_TSA,325,NAICS_2012_Code,325314,, +BTS_TSA,325,NAICS_2012_Code,32532,, +BTS_TSA,325,NAICS_2012_Code,325320,, +BTS_TSA,325,NAICS_2012_Code,3254,, +BTS_TSA,325,NAICS_2012_Code,32541,, +BTS_TSA,325,NAICS_2012_Code,325411,, +BTS_TSA,325,NAICS_2012_Code,325412,, +BTS_TSA,325,NAICS_2012_Code,325413,, +BTS_TSA,325,NAICS_2012_Code,325414,, +BTS_TSA,325,NAICS_2012_Code,3255,, +BTS_TSA,325,NAICS_2012_Code,32551,, +BTS_TSA,325,NAICS_2012_Code,325510,, +BTS_TSA,325,NAICS_2012_Code,32552,, +BTS_TSA,325,NAICS_2012_Code,325520,, +BTS_TSA,325,NAICS_2012_Code,3256,, +BTS_TSA,325,NAICS_2012_Code,32561,, +BTS_TSA,325,NAICS_2012_Code,325611,, +BTS_TSA,325,NAICS_2012_Code,325612,, +BTS_TSA,325,NAICS_2012_Code,325613,, +BTS_TSA,325,NAICS_2012_Code,32562,, +BTS_TSA,325,NAICS_2012_Code,325620,, +BTS_TSA,325,NAICS_2012_Code,3259,, +BTS_TSA,325,NAICS_2012_Code,32591,, +BTS_TSA,325,NAICS_2012_Code,325910,, +BTS_TSA,325,NAICS_2012_Code,32592,, +BTS_TSA,325,NAICS_2012_Code,325920,, +BTS_TSA,325,NAICS_2012_Code,32599,, +BTS_TSA,325,NAICS_2012_Code,325991,, +BTS_TSA,325,NAICS_2012_Code,325992,, +BTS_TSA,325,NAICS_2012_Code,325998,, +BTS_TSA,326,NAICS_2012_Code,326,, +BTS_TSA,326,NAICS_2012_Code,3261,, +BTS_TSA,326,NAICS_2012_Code,32611,, +BTS_TSA,326,NAICS_2012_Code,326111,, +BTS_TSA,326,NAICS_2012_Code,326112,, +BTS_TSA,326,NAICS_2012_Code,326113,, +BTS_TSA,326,NAICS_2012_Code,32612,, +BTS_TSA,326,NAICS_2012_Code,326121,, +BTS_TSA,326,NAICS_2012_Code,326122,, +BTS_TSA,326,NAICS_2012_Code,32613,, +BTS_TSA,326,NAICS_2012_Code,326130,, +BTS_TSA,326,NAICS_2012_Code,32614,, +BTS_TSA,326,NAICS_2012_Code,326140,, +BTS_TSA,326,NAICS_2012_Code,32615,, +BTS_TSA,326,NAICS_2012_Code,326150,, +BTS_TSA,326,NAICS_2012_Code,32616,, +BTS_TSA,326,NAICS_2012_Code,326160,, +BTS_TSA,326,NAICS_2012_Code,32619,, +BTS_TSA,326,NAICS_2012_Code,326191,, +BTS_TSA,326,NAICS_2012_Code,326199,, +BTS_TSA,326,NAICS_2012_Code,3262,, +BTS_TSA,326,NAICS_2012_Code,32621,, +BTS_TSA,326,NAICS_2012_Code,326211,, +BTS_TSA,326,NAICS_2012_Code,326212,, +BTS_TSA,326,NAICS_2012_Code,32622,, +BTS_TSA,326,NAICS_2012_Code,326220,, +BTS_TSA,326,NAICS_2012_Code,32629,, +BTS_TSA,326,NAICS_2012_Code,326291,, +BTS_TSA,326,NAICS_2012_Code,326299,, +BTS_TSA,327,NAICS_2012_Code,327,, +BTS_TSA,327,NAICS_2012_Code,3271,, +BTS_TSA,327,NAICS_2012_Code,32711,, +BTS_TSA,327,NAICS_2012_Code,327110,, +BTS_TSA,327,NAICS_2012_Code,32712,, +BTS_TSA,327,NAICS_2012_Code,327120,, +BTS_TSA,327,NAICS_2012_Code,3272,, +BTS_TSA,327,NAICS_2012_Code,32721,, +BTS_TSA,327,NAICS_2012_Code,327211,, +BTS_TSA,327,NAICS_2012_Code,327212,, +BTS_TSA,327,NAICS_2012_Code,327213,, +BTS_TSA,327,NAICS_2012_Code,327215,, +BTS_TSA,327,NAICS_2012_Code,3273,, +BTS_TSA,327,NAICS_2012_Code,32731,, +BTS_TSA,327,NAICS_2012_Code,327310,, +BTS_TSA,327,NAICS_2012_Code,32732,, +BTS_TSA,327,NAICS_2012_Code,327320,, +BTS_TSA,327,NAICS_2012_Code,32733,, +BTS_TSA,327,NAICS_2012_Code,327331,, +BTS_TSA,327,NAICS_2012_Code,327332,, +BTS_TSA,327,NAICS_2012_Code,32739,, +BTS_TSA,327,NAICS_2012_Code,327390,, +BTS_TSA,327,NAICS_2012_Code,3274,, +BTS_TSA,327,NAICS_2012_Code,32741,, +BTS_TSA,327,NAICS_2012_Code,327410,, +BTS_TSA,327,NAICS_2012_Code,32742,, +BTS_TSA,327,NAICS_2012_Code,327420,, +BTS_TSA,327,NAICS_2012_Code,3279,, +BTS_TSA,327,NAICS_2012_Code,32791,, +BTS_TSA,327,NAICS_2012_Code,327910,, +BTS_TSA,327,NAICS_2012_Code,32799,, +BTS_TSA,327,NAICS_2012_Code,327991,, +BTS_TSA,327,NAICS_2012_Code,327992,, +BTS_TSA,327,NAICS_2012_Code,327993,, +BTS_TSA,327,NAICS_2012_Code,327999,, +BTS_TSA,331,NAICS_2012_Code,33,, +BTS_TSA,332,NAICS_2012_Code,33,, +BTS_TSA,333,NAICS_2012_Code,33,, +BTS_TSA,334,NAICS_2012_Code,33,, +BTS_TSA,335,NAICS_2012_Code,33,, +BTS_TSA,3361MV,NAICS_2012_Code,33,, +BTS_TSA,3364OT,NAICS_2012_Code,33,, +BTS_TSA,337,NAICS_2012_Code,33,, +BTS_TSA,339,NAICS_2012_Code,33,, +BTS_TSA,331,NAICS_2012_Code,331,, +BTS_TSA,331,NAICS_2012_Code,3311,, +BTS_TSA,331,NAICS_2012_Code,33111,, +BTS_TSA,331,NAICS_2012_Code,331110,, +BTS_TSA,331,NAICS_2012_Code,3312,, +BTS_TSA,331,NAICS_2012_Code,33121,, +BTS_TSA,331,NAICS_2012_Code,331210,, +BTS_TSA,331,NAICS_2012_Code,33122,, +BTS_TSA,331,NAICS_2012_Code,331221,, +BTS_TSA,331,NAICS_2012_Code,331222,, +BTS_TSA,331,NAICS_2012_Code,3313,, +BTS_TSA,331,NAICS_2012_Code,33131,, +BTS_TSA,331,NAICS_2012_Code,331313,, +BTS_TSA,331,NAICS_2012_Code,331314,, +BTS_TSA,331,NAICS_2012_Code,331315,, +BTS_TSA,331,NAICS_2012_Code,331318,, +BTS_TSA,331,NAICS_2012_Code,3314,, +BTS_TSA,331,NAICS_2012_Code,33141,, +BTS_TSA,331,NAICS_2012_Code,331410,, +BTS_TSA,331,NAICS_2012_Code,33142,, +BTS_TSA,331,NAICS_2012_Code,331420,, +BTS_TSA,331,NAICS_2012_Code,33149,, +BTS_TSA,331,NAICS_2012_Code,331491,, +BTS_TSA,331,NAICS_2012_Code,331492,, +BTS_TSA,331,NAICS_2012_Code,3315,, +BTS_TSA,331,NAICS_2012_Code,33151,, +BTS_TSA,331,NAICS_2012_Code,331511,, +BTS_TSA,331,NAICS_2012_Code,331512,, +BTS_TSA,331,NAICS_2012_Code,331513,, +BTS_TSA,331,NAICS_2012_Code,33152,, +BTS_TSA,331,NAICS_2012_Code,331523,, +BTS_TSA,331,NAICS_2012_Code,331524,, +BTS_TSA,331,NAICS_2012_Code,331529,, +BTS_TSA,332,NAICS_2012_Code,332,, +BTS_TSA,332,NAICS_2012_Code,3321,, +BTS_TSA,332,NAICS_2012_Code,33211,, +BTS_TSA,332,NAICS_2012_Code,332111,, +BTS_TSA,332,NAICS_2012_Code,332112,, +BTS_TSA,332,NAICS_2012_Code,332114,, +BTS_TSA,332,NAICS_2012_Code,332117,, +BTS_TSA,332,NAICS_2012_Code,332119,, +BTS_TSA,332,NAICS_2012_Code,3322,, +BTS_TSA,332,NAICS_2012_Code,33221,, +BTS_TSA,332,NAICS_2012_Code,332215,, +BTS_TSA,332,NAICS_2012_Code,332216,, +BTS_TSA,332,NAICS_2012_Code,3323,, +BTS_TSA,332,NAICS_2012_Code,33231,, +BTS_TSA,332,NAICS_2012_Code,332311,, +BTS_TSA,332,NAICS_2012_Code,332312,, +BTS_TSA,332,NAICS_2012_Code,332313,, +BTS_TSA,332,NAICS_2012_Code,33232,, +BTS_TSA,332,NAICS_2012_Code,332321,, +BTS_TSA,332,NAICS_2012_Code,332322,, +BTS_TSA,332,NAICS_2012_Code,332323,, +BTS_TSA,332,NAICS_2012_Code,3324,, +BTS_TSA,332,NAICS_2012_Code,33241,, +BTS_TSA,332,NAICS_2012_Code,332410,, +BTS_TSA,332,NAICS_2012_Code,33242,, +BTS_TSA,332,NAICS_2012_Code,332420,, +BTS_TSA,332,NAICS_2012_Code,33243,, +BTS_TSA,332,NAICS_2012_Code,332431,, +BTS_TSA,332,NAICS_2012_Code,332439,, +BTS_TSA,332,NAICS_2012_Code,3325,, +BTS_TSA,332,NAICS_2012_Code,33251,, +BTS_TSA,332,NAICS_2012_Code,332510,, +BTS_TSA,332,NAICS_2012_Code,3326,, +BTS_TSA,332,NAICS_2012_Code,33261,, +BTS_TSA,332,NAICS_2012_Code,332613,, +BTS_TSA,332,NAICS_2012_Code,332618,, +BTS_TSA,332,NAICS_2012_Code,3327,, +BTS_TSA,332,NAICS_2012_Code,33271,, +BTS_TSA,332,NAICS_2012_Code,332710,, +BTS_TSA,332,NAICS_2012_Code,33272,, +BTS_TSA,332,NAICS_2012_Code,332721,, +BTS_TSA,332,NAICS_2012_Code,332722,, +BTS_TSA,332,NAICS_2012_Code,3328,, +BTS_TSA,332,NAICS_2012_Code,33281,, +BTS_TSA,332,NAICS_2012_Code,332811,, +BTS_TSA,332,NAICS_2012_Code,332812,, +BTS_TSA,332,NAICS_2012_Code,332813,, +BTS_TSA,332,NAICS_2012_Code,3329,, +BTS_TSA,332,NAICS_2012_Code,33291,, +BTS_TSA,332,NAICS_2012_Code,332911,, +BTS_TSA,332,NAICS_2012_Code,332912,, +BTS_TSA,332,NAICS_2012_Code,332913,, +BTS_TSA,332,NAICS_2012_Code,332919,, +BTS_TSA,332,NAICS_2012_Code,33299,, +BTS_TSA,332,NAICS_2012_Code,332991,, +BTS_TSA,332,NAICS_2012_Code,332992,, +BTS_TSA,332,NAICS_2012_Code,332993,, +BTS_TSA,332,NAICS_2012_Code,332994,, +BTS_TSA,332,NAICS_2012_Code,332996,, +BTS_TSA,332,NAICS_2012_Code,332999,, +BTS_TSA,333,NAICS_2012_Code,333,, +BTS_TSA,333,NAICS_2012_Code,3331,, +BTS_TSA,333,NAICS_2012_Code,33311,, +BTS_TSA,333,NAICS_2012_Code,333111,, +BTS_TSA,333,NAICS_2012_Code,333112,, +BTS_TSA,333,NAICS_2012_Code,33312,, +BTS_TSA,333,NAICS_2012_Code,333120,, +BTS_TSA,333,NAICS_2012_Code,33313,, +BTS_TSA,333,NAICS_2012_Code,333131,, +BTS_TSA,333,NAICS_2012_Code,333132,, +BTS_TSA,333,NAICS_2012_Code,3332,, +BTS_TSA,333,NAICS_2012_Code,33324,, +BTS_TSA,333,NAICS_2012_Code,333241,, +BTS_TSA,333,NAICS_2012_Code,333242,, +BTS_TSA,333,NAICS_2012_Code,333243,, +BTS_TSA,333,NAICS_2012_Code,333244,, +BTS_TSA,333,NAICS_2012_Code,333249,, +BTS_TSA,333,NAICS_2012_Code,3333,, +BTS_TSA,333,NAICS_2012_Code,33331,, +BTS_TSA,333,NAICS_2012_Code,333314,, +BTS_TSA,333,NAICS_2012_Code,333316,, +BTS_TSA,333,NAICS_2012_Code,333318,, +BTS_TSA,333,NAICS_2012_Code,3334,, +BTS_TSA,333,NAICS_2012_Code,33341,, +BTS_TSA,333,NAICS_2012_Code,333413,, +BTS_TSA,333,NAICS_2012_Code,333414,, +BTS_TSA,333,NAICS_2012_Code,333415,, +BTS_TSA,333,NAICS_2012_Code,3335,, +BTS_TSA,333,NAICS_2012_Code,33351,, +BTS_TSA,333,NAICS_2012_Code,333511,, +BTS_TSA,333,NAICS_2012_Code,333514,, +BTS_TSA,333,NAICS_2012_Code,333515,, +BTS_TSA,333,NAICS_2012_Code,333517,, +BTS_TSA,333,NAICS_2012_Code,333519,, +BTS_TSA,333,NAICS_2012_Code,3336,, +BTS_TSA,333,NAICS_2012_Code,33361,, +BTS_TSA,333,NAICS_2012_Code,333611,, +BTS_TSA,333,NAICS_2012_Code,333612,, +BTS_TSA,333,NAICS_2012_Code,333613,, +BTS_TSA,333,NAICS_2012_Code,333618,, +BTS_TSA,333,NAICS_2012_Code,3339,, +BTS_TSA,333,NAICS_2012_Code,33391,, +BTS_TSA,333,NAICS_2012_Code,333911,, +BTS_TSA,333,NAICS_2012_Code,333912,, +BTS_TSA,333,NAICS_2012_Code,333913,, +BTS_TSA,333,NAICS_2012_Code,33392,, +BTS_TSA,333,NAICS_2012_Code,333921,, +BTS_TSA,333,NAICS_2012_Code,333922,, +BTS_TSA,333,NAICS_2012_Code,333923,, +BTS_TSA,333,NAICS_2012_Code,333924,, +BTS_TSA,333,NAICS_2012_Code,33399,, +BTS_TSA,333,NAICS_2012_Code,333991,, +BTS_TSA,333,NAICS_2012_Code,333992,, +BTS_TSA,333,NAICS_2012_Code,333993,, +BTS_TSA,333,NAICS_2012_Code,333994,, +BTS_TSA,333,NAICS_2012_Code,333995,, +BTS_TSA,333,NAICS_2012_Code,333996,, +BTS_TSA,333,NAICS_2012_Code,333997,, +BTS_TSA,333,NAICS_2012_Code,333999,, +BTS_TSA,334,NAICS_2012_Code,334,, +BTS_TSA,334,NAICS_2012_Code,3341,, +BTS_TSA,334,NAICS_2012_Code,33411,, +BTS_TSA,334,NAICS_2012_Code,334111,, +BTS_TSA,334,NAICS_2012_Code,334112,, +BTS_TSA,334,NAICS_2012_Code,334118,, +BTS_TSA,334,NAICS_2012_Code,3342,, +BTS_TSA,334,NAICS_2012_Code,33421,, +BTS_TSA,334,NAICS_2012_Code,334210,, +BTS_TSA,334,NAICS_2012_Code,33422,, +BTS_TSA,334,NAICS_2012_Code,334220,, +BTS_TSA,334,NAICS_2012_Code,33429,, +BTS_TSA,334,NAICS_2012_Code,334290,, +BTS_TSA,334,NAICS_2012_Code,3343,, +BTS_TSA,334,NAICS_2012_Code,33431,, +BTS_TSA,334,NAICS_2012_Code,334310,, +BTS_TSA,334,NAICS_2012_Code,3344,, +BTS_TSA,334,NAICS_2012_Code,33441,, +BTS_TSA,334,NAICS_2012_Code,334412,, +BTS_TSA,334,NAICS_2012_Code,334413,, +BTS_TSA,334,NAICS_2012_Code,334416,, +BTS_TSA,334,NAICS_2012_Code,334417,, +BTS_TSA,334,NAICS_2012_Code,334418,, +BTS_TSA,334,NAICS_2012_Code,334419,, +BTS_TSA,334,NAICS_2012_Code,3345,, +BTS_TSA,334,NAICS_2012_Code,33451,, +BTS_TSA,334,NAICS_2012_Code,334510,, +BTS_TSA,334,NAICS_2012_Code,334511,, +BTS_TSA,334,NAICS_2012_Code,334512,, +BTS_TSA,334,NAICS_2012_Code,334513,, +BTS_TSA,334,NAICS_2012_Code,334514,, +BTS_TSA,334,NAICS_2012_Code,334515,, +BTS_TSA,334,NAICS_2012_Code,334516,, +BTS_TSA,334,NAICS_2012_Code,334517,, +BTS_TSA,334,NAICS_2012_Code,334519,, +BTS_TSA,334,NAICS_2012_Code,3346,, +BTS_TSA,334,NAICS_2012_Code,33461,, +BTS_TSA,334,NAICS_2012_Code,334613,, +BTS_TSA,334,NAICS_2012_Code,334614,, +BTS_TSA,335,NAICS_2012_Code,335,, +BTS_TSA,335,NAICS_2012_Code,3351,, +BTS_TSA,335,NAICS_2012_Code,33511,, +BTS_TSA,335,NAICS_2012_Code,335110,, +BTS_TSA,335,NAICS_2012_Code,33512,, +BTS_TSA,335,NAICS_2012_Code,335121,, +BTS_TSA,335,NAICS_2012_Code,335122,, +BTS_TSA,335,NAICS_2012_Code,335129,, +BTS_TSA,335,NAICS_2012_Code,3352,, +BTS_TSA,335,NAICS_2012_Code,33521,, +BTS_TSA,335,NAICS_2012_Code,335210,, +BTS_TSA,335,NAICS_2012_Code,33522,, +BTS_TSA,335,NAICS_2012_Code,335221,, +BTS_TSA,335,NAICS_2012_Code,335222,, +BTS_TSA,335,NAICS_2012_Code,335224,, +BTS_TSA,335,NAICS_2012_Code,335228,, +BTS_TSA,335,NAICS_2012_Code,3353,, +BTS_TSA,335,NAICS_2012_Code,33531,, +BTS_TSA,335,NAICS_2012_Code,335311,, +BTS_TSA,335,NAICS_2012_Code,335312,, +BTS_TSA,335,NAICS_2012_Code,335313,, +BTS_TSA,335,NAICS_2012_Code,335314,, +BTS_TSA,335,NAICS_2012_Code,3359,, +BTS_TSA,335,NAICS_2012_Code,33591,, +BTS_TSA,335,NAICS_2012_Code,335911,, +BTS_TSA,335,NAICS_2012_Code,335912,, +BTS_TSA,335,NAICS_2012_Code,33592,, +BTS_TSA,335,NAICS_2012_Code,335921,, +BTS_TSA,335,NAICS_2012_Code,335929,, +BTS_TSA,335,NAICS_2012_Code,33593,, +BTS_TSA,335,NAICS_2012_Code,335931,, +BTS_TSA,335,NAICS_2012_Code,335932,, +BTS_TSA,335,NAICS_2012_Code,33599,, +BTS_TSA,335,NAICS_2012_Code,335991,, +BTS_TSA,335,NAICS_2012_Code,335999,, +BTS_TSA,3361MV,NAICS_2012_Code,336,, +BTS_TSA,3364OT,NAICS_2012_Code,336,, +BTS_TSA,3361MV,NAICS_2012_Code,3361,, +BTS_TSA,3361MV,NAICS_2012_Code,33611,, +BTS_TSA,3361MV,NAICS_2012_Code,336111,, +BTS_TSA,3361MV,NAICS_2012_Code,336112,, +BTS_TSA,3361MV,NAICS_2012_Code,33612,, +BTS_TSA,3361MV,NAICS_2012_Code,336120,, +BTS_TSA,3361MV,NAICS_2012_Code,3362,, +BTS_TSA,3361MV,NAICS_2012_Code,33621,, +BTS_TSA,3361MV,NAICS_2012_Code,336211,, +BTS_TSA,3361MV,NAICS_2012_Code,336212,, +BTS_TSA,3361MV,NAICS_2012_Code,336213,, +BTS_TSA,3361MV,NAICS_2012_Code,336214,, +BTS_TSA,3361MV,NAICS_2012_Code,3363,, +BTS_TSA,3361MV,NAICS_2012_Code,33631,, +BTS_TSA,3361MV,NAICS_2012_Code,336310,, +BTS_TSA,3361MV,NAICS_2012_Code,33632,, +BTS_TSA,3361MV,NAICS_2012_Code,336320,, +BTS_TSA,3361MV,NAICS_2012_Code,33633,, +BTS_TSA,3361MV,NAICS_2012_Code,336330,, +BTS_TSA,3361MV,NAICS_2012_Code,33634,, +BTS_TSA,3361MV,NAICS_2012_Code,336340,, +BTS_TSA,3361MV,NAICS_2012_Code,33635,, +BTS_TSA,3361MV,NAICS_2012_Code,336350,, +BTS_TSA,3361MV,NAICS_2012_Code,33636,, +BTS_TSA,3361MV,NAICS_2012_Code,336360,, +BTS_TSA,3361MV,NAICS_2012_Code,33637,, +BTS_TSA,3361MV,NAICS_2012_Code,336370,, +BTS_TSA,3361MV,NAICS_2012_Code,33639,, +BTS_TSA,3361MV,NAICS_2012_Code,336390,, +BTS_TSA,3364OT,NAICS_2012_Code,3364,, +BTS_TSA,3364OT,NAICS_2012_Code,33641,, +BTS_TSA,3364OT,NAICS_2012_Code,336411,, +BTS_TSA,3364OT,NAICS_2012_Code,336412,, +BTS_TSA,3364OT,NAICS_2012_Code,336413,, +BTS_TSA,3364OT,NAICS_2012_Code,336414,, +BTS_TSA,3364OT,NAICS_2012_Code,336415,, +BTS_TSA,3364OT,NAICS_2012_Code,336419,, +BTS_TSA,3364OT,NAICS_2012_Code,3365,, +BTS_TSA,3364OT,NAICS_2012_Code,33651,, +BTS_TSA,3364OT,NAICS_2012_Code,336510,, +BTS_TSA,3364OT,NAICS_2012_Code,3366,, +BTS_TSA,3364OT,NAICS_2012_Code,33661,, +BTS_TSA,3364OT,NAICS_2012_Code,336611,, +BTS_TSA,3364OT,NAICS_2012_Code,336612,, +BTS_TSA,3364OT,NAICS_2012_Code,3369,, +BTS_TSA,3364OT,NAICS_2012_Code,33699,, +BTS_TSA,3364OT,NAICS_2012_Code,336991,, +BTS_TSA,3364OT,NAICS_2012_Code,336992,, +BTS_TSA,3364OT,NAICS_2012_Code,336999,, +BTS_TSA,337,NAICS_2012_Code,337,, +BTS_TSA,337,NAICS_2012_Code,3371,, +BTS_TSA,337,NAICS_2012_Code,33711,, +BTS_TSA,337,NAICS_2012_Code,337110,, +BTS_TSA,337,NAICS_2012_Code,33712,, +BTS_TSA,337,NAICS_2012_Code,337121,, +BTS_TSA,337,NAICS_2012_Code,337122,, +BTS_TSA,337,NAICS_2012_Code,337124,, +BTS_TSA,337,NAICS_2012_Code,337125,, +BTS_TSA,337,NAICS_2012_Code,337127,, +BTS_TSA,337,NAICS_2012_Code,3372,, +BTS_TSA,337,NAICS_2012_Code,33721,, +BTS_TSA,337,NAICS_2012_Code,337211,, +BTS_TSA,337,NAICS_2012_Code,337212,, +BTS_TSA,337,NAICS_2012_Code,337214,, +BTS_TSA,337,NAICS_2012_Code,337215,, +BTS_TSA,337,NAICS_2012_Code,3379,, +BTS_TSA,337,NAICS_2012_Code,33791,, +BTS_TSA,337,NAICS_2012_Code,337910,, +BTS_TSA,337,NAICS_2012_Code,33792,, +BTS_TSA,337,NAICS_2012_Code,337920,, +BTS_TSA,339,NAICS_2012_Code,339,, +BTS_TSA,339,NAICS_2012_Code,3391,, +BTS_TSA,339,NAICS_2012_Code,33911,, +BTS_TSA,339,NAICS_2012_Code,339112,, +BTS_TSA,339,NAICS_2012_Code,339113,, +BTS_TSA,339,NAICS_2012_Code,339114,, +BTS_TSA,339,NAICS_2012_Code,339115,, +BTS_TSA,339,NAICS_2012_Code,339116,, +BTS_TSA,339,NAICS_2012_Code,3399,, +BTS_TSA,339,NAICS_2012_Code,33991,, +BTS_TSA,339,NAICS_2012_Code,339910,, +BTS_TSA,339,NAICS_2012_Code,33992,, +BTS_TSA,339,NAICS_2012_Code,339920,, +BTS_TSA,339,NAICS_2012_Code,33993,, +BTS_TSA,339,NAICS_2012_Code,339930,, +BTS_TSA,339,NAICS_2012_Code,33994,, +BTS_TSA,339,NAICS_2012_Code,339940,, +BTS_TSA,339,NAICS_2012_Code,33995,, +BTS_TSA,339,NAICS_2012_Code,339950,, +BTS_TSA,339,NAICS_2012_Code,33999,, +BTS_TSA,339,NAICS_2012_Code,339991,, +BTS_TSA,339,NAICS_2012_Code,339992,, +BTS_TSA,339,NAICS_2012_Code,339993,, +BTS_TSA,339,NAICS_2012_Code,339994,, +BTS_TSA,339,NAICS_2012_Code,339995,, +BTS_TSA,339,NAICS_2012_Code,339999,, +BTS_TSA,42,NAICS_2012_Code,42,, +BTS_TSA,42,NAICS_2012_Code,423,, +BTS_TSA,42,NAICS_2012_Code,4231,, +BTS_TSA,42,NAICS_2012_Code,42311,, +BTS_TSA,42,NAICS_2012_Code,423110,, +BTS_TSA,42,NAICS_2012_Code,42312,, +BTS_TSA,42,NAICS_2012_Code,423120,, +BTS_TSA,42,NAICS_2012_Code,42313,, +BTS_TSA,42,NAICS_2012_Code,423130,, +BTS_TSA,42,NAICS_2012_Code,42314,, +BTS_TSA,42,NAICS_2012_Code,423140,, +BTS_TSA,42,NAICS_2012_Code,4232,, +BTS_TSA,42,NAICS_2012_Code,42321,, +BTS_TSA,42,NAICS_2012_Code,423210,, +BTS_TSA,42,NAICS_2012_Code,42322,, +BTS_TSA,42,NAICS_2012_Code,423220,, +BTS_TSA,42,NAICS_2012_Code,4233,, +BTS_TSA,42,NAICS_2012_Code,42331,, +BTS_TSA,42,NAICS_2012_Code,423310,, +BTS_TSA,42,NAICS_2012_Code,42332,, +BTS_TSA,42,NAICS_2012_Code,423320,, +BTS_TSA,42,NAICS_2012_Code,42333,, +BTS_TSA,42,NAICS_2012_Code,423330,, +BTS_TSA,42,NAICS_2012_Code,42339,, +BTS_TSA,42,NAICS_2012_Code,423390,, +BTS_TSA,42,NAICS_2012_Code,4234,, +BTS_TSA,42,NAICS_2012_Code,42341,, +BTS_TSA,42,NAICS_2012_Code,423410,, +BTS_TSA,42,NAICS_2012_Code,42342,, +BTS_TSA,42,NAICS_2012_Code,423420,, +BTS_TSA,42,NAICS_2012_Code,42343,, +BTS_TSA,42,NAICS_2012_Code,423430,, +BTS_TSA,42,NAICS_2012_Code,42344,, +BTS_TSA,42,NAICS_2012_Code,423440,, +BTS_TSA,42,NAICS_2012_Code,42345,, +BTS_TSA,42,NAICS_2012_Code,423450,, +BTS_TSA,42,NAICS_2012_Code,42346,, +BTS_TSA,42,NAICS_2012_Code,423460,, +BTS_TSA,42,NAICS_2012_Code,42349,, +BTS_TSA,42,NAICS_2012_Code,423490,, +BTS_TSA,42,NAICS_2012_Code,4235,, +BTS_TSA,42,NAICS_2012_Code,42351,, +BTS_TSA,42,NAICS_2012_Code,423510,, +BTS_TSA,42,NAICS_2012_Code,42352,, +BTS_TSA,42,NAICS_2012_Code,423520,, +BTS_TSA,42,NAICS_2012_Code,4236,, +BTS_TSA,42,NAICS_2012_Code,42361,, +BTS_TSA,42,NAICS_2012_Code,423610,, +BTS_TSA,42,NAICS_2012_Code,42362,, +BTS_TSA,42,NAICS_2012_Code,423620,, +BTS_TSA,42,NAICS_2012_Code,42369,, +BTS_TSA,42,NAICS_2012_Code,423690,, +BTS_TSA,42,NAICS_2012_Code,4237,, +BTS_TSA,42,NAICS_2012_Code,42371,, +BTS_TSA,42,NAICS_2012_Code,423710,, +BTS_TSA,42,NAICS_2012_Code,42372,, +BTS_TSA,42,NAICS_2012_Code,423720,, +BTS_TSA,42,NAICS_2012_Code,42373,, +BTS_TSA,42,NAICS_2012_Code,423730,, +BTS_TSA,42,NAICS_2012_Code,42374,, +BTS_TSA,42,NAICS_2012_Code,423740,, +BTS_TSA,42,NAICS_2012_Code,4238,, +BTS_TSA,42,NAICS_2012_Code,42381,, +BTS_TSA,42,NAICS_2012_Code,423810,, +BTS_TSA,42,NAICS_2012_Code,42382,, +BTS_TSA,42,NAICS_2012_Code,423820,, +BTS_TSA,42,NAICS_2012_Code,42383,, +BTS_TSA,42,NAICS_2012_Code,423830,, +BTS_TSA,42,NAICS_2012_Code,42384,, +BTS_TSA,42,NAICS_2012_Code,423840,, +BTS_TSA,42,NAICS_2012_Code,42385,, +BTS_TSA,42,NAICS_2012_Code,423850,, +BTS_TSA,42,NAICS_2012_Code,42386,, +BTS_TSA,42,NAICS_2012_Code,423860,, +BTS_TSA,42,NAICS_2012_Code,4239,, +BTS_TSA,42,NAICS_2012_Code,42391,, +BTS_TSA,42,NAICS_2012_Code,423910,, +BTS_TSA,42,NAICS_2012_Code,42392,, +BTS_TSA,42,NAICS_2012_Code,423920,, +BTS_TSA,42,NAICS_2012_Code,42393,, +BTS_TSA,42,NAICS_2012_Code,423930,, +BTS_TSA,42,NAICS_2012_Code,42394,, +BTS_TSA,42,NAICS_2012_Code,423940,, +BTS_TSA,42,NAICS_2012_Code,42399,, +BTS_TSA,42,NAICS_2012_Code,423990,, +BTS_TSA,42,NAICS_2012_Code,424,, +BTS_TSA,42,NAICS_2012_Code,4241,, +BTS_TSA,42,NAICS_2012_Code,42411,, +BTS_TSA,42,NAICS_2012_Code,424110,, +BTS_TSA,42,NAICS_2012_Code,42412,, +BTS_TSA,42,NAICS_2012_Code,424120,, +BTS_TSA,42,NAICS_2012_Code,42413,, +BTS_TSA,42,NAICS_2012_Code,424130,, +BTS_TSA,42,NAICS_2012_Code,4242,, +BTS_TSA,42,NAICS_2012_Code,42421,, +BTS_TSA,42,NAICS_2012_Code,424210,, +BTS_TSA,42,NAICS_2012_Code,4243,, +BTS_TSA,42,NAICS_2012_Code,42431,, +BTS_TSA,42,NAICS_2012_Code,424310,, +BTS_TSA,42,NAICS_2012_Code,42432,, +BTS_TSA,42,NAICS_2012_Code,424320,, +BTS_TSA,42,NAICS_2012_Code,42433,, +BTS_TSA,42,NAICS_2012_Code,424330,, +BTS_TSA,42,NAICS_2012_Code,42434,, +BTS_TSA,42,NAICS_2012_Code,424340,, +BTS_TSA,42,NAICS_2012_Code,4244,, +BTS_TSA,42,NAICS_2012_Code,42441,, +BTS_TSA,42,NAICS_2012_Code,424410,, +BTS_TSA,42,NAICS_2012_Code,42442,, +BTS_TSA,42,NAICS_2012_Code,424420,, +BTS_TSA,42,NAICS_2012_Code,42443,, +BTS_TSA,42,NAICS_2012_Code,424430,, +BTS_TSA,42,NAICS_2012_Code,42444,, +BTS_TSA,42,NAICS_2012_Code,424440,, +BTS_TSA,42,NAICS_2012_Code,42445,, +BTS_TSA,42,NAICS_2012_Code,424450,, +BTS_TSA,42,NAICS_2012_Code,42446,, +BTS_TSA,42,NAICS_2012_Code,424460,, +BTS_TSA,42,NAICS_2012_Code,42447,, +BTS_TSA,42,NAICS_2012_Code,424470,, +BTS_TSA,42,NAICS_2012_Code,42448,, +BTS_TSA,42,NAICS_2012_Code,424480,, +BTS_TSA,42,NAICS_2012_Code,42449,, +BTS_TSA,42,NAICS_2012_Code,424490,, +BTS_TSA,42,NAICS_2012_Code,4245,, +BTS_TSA,42,NAICS_2012_Code,42451,, +BTS_TSA,42,NAICS_2012_Code,424510,, +BTS_TSA,42,NAICS_2012_Code,42452,, +BTS_TSA,42,NAICS_2012_Code,424520,, +BTS_TSA,42,NAICS_2012_Code,42459,, +BTS_TSA,42,NAICS_2012_Code,424590,, +BTS_TSA,42,NAICS_2012_Code,4246,, +BTS_TSA,42,NAICS_2012_Code,42461,, +BTS_TSA,42,NAICS_2012_Code,424610,, +BTS_TSA,42,NAICS_2012_Code,42469,, +BTS_TSA,42,NAICS_2012_Code,424690,, +BTS_TSA,42,NAICS_2012_Code,4247,, +BTS_TSA,42,NAICS_2012_Code,42471,, +BTS_TSA,42,NAICS_2012_Code,424710,, +BTS_TSA,42,NAICS_2012_Code,42472,, +BTS_TSA,42,NAICS_2012_Code,424720,, +BTS_TSA,42,NAICS_2012_Code,4248,, +BTS_TSA,42,NAICS_2012_Code,42481,, +BTS_TSA,42,NAICS_2012_Code,424810,, +BTS_TSA,42,NAICS_2012_Code,42482,, +BTS_TSA,42,NAICS_2012_Code,424820,, +BTS_TSA,42,NAICS_2012_Code,4249,, +BTS_TSA,42,NAICS_2012_Code,42491,, +BTS_TSA,42,NAICS_2012_Code,424910,, +BTS_TSA,42,NAICS_2012_Code,42492,, +BTS_TSA,42,NAICS_2012_Code,424920,, +BTS_TSA,42,NAICS_2012_Code,42493,, +BTS_TSA,42,NAICS_2012_Code,424930,, +BTS_TSA,42,NAICS_2012_Code,42494,, +BTS_TSA,42,NAICS_2012_Code,424940,, +BTS_TSA,42,NAICS_2012_Code,42495,, +BTS_TSA,42,NAICS_2012_Code,424950,, +BTS_TSA,42,NAICS_2012_Code,42499,, +BTS_TSA,42,NAICS_2012_Code,424990,, +BTS_TSA,42,NAICS_2012_Code,425,, +BTS_TSA,42,NAICS_2012_Code,4251,, +BTS_TSA,42,NAICS_2012_Code,42511,, +BTS_TSA,42,NAICS_2012_Code,425110,, +BTS_TSA,42,NAICS_2012_Code,42512,, +BTS_TSA,42,NAICS_2012_Code,425120,, +BTS_TSA,441,NAICS_2012_Code,44,, +BTS_TSA,4A0,NAICS_2012_Code,44,, +BTS_TSA,445,NAICS_2012_Code,44,, +BTS_TSA,441,NAICS_2012_Code,441,, +BTS_TSA,441,NAICS_2012_Code,4411,, +BTS_TSA,441,NAICS_2012_Code,44111,, +BTS_TSA,441,NAICS_2012_Code,441110,, +BTS_TSA,441,NAICS_2012_Code,44112,, +BTS_TSA,441,NAICS_2012_Code,441120,, +BTS_TSA,441,NAICS_2012_Code,4412,, +BTS_TSA,441,NAICS_2012_Code,44121,, +BTS_TSA,441,NAICS_2012_Code,441210,, +BTS_TSA,441,NAICS_2012_Code,44122,, +BTS_TSA,441,NAICS_2012_Code,441222,, +BTS_TSA,441,NAICS_2012_Code,441228,, +BTS_TSA,441,NAICS_2012_Code,4413,, +BTS_TSA,441,NAICS_2012_Code,44131,, +BTS_TSA,441,NAICS_2012_Code,441310,, +BTS_TSA,441,NAICS_2012_Code,44132,, +BTS_TSA,441,NAICS_2012_Code,441320,, +BTS_TSA,4A0,NAICS_2012_Code,442,, +BTS_TSA,4A0,NAICS_2012_Code,4421,, +BTS_TSA,4A0,NAICS_2012_Code,44211,, +BTS_TSA,4A0,NAICS_2012_Code,442110,, +BTS_TSA,4A0,NAICS_2012_Code,4422,, +BTS_TSA,4A0,NAICS_2012_Code,44221,, +BTS_TSA,4A0,NAICS_2012_Code,442210,, +BTS_TSA,4A0,NAICS_2012_Code,44229,, +BTS_TSA,4A0,NAICS_2012_Code,442291,, +BTS_TSA,4A0,NAICS_2012_Code,442299,, +BTS_TSA,4A0,NAICS_2012_Code,443,, +BTS_TSA,4A0,NAICS_2012_Code,4431,, +BTS_TSA,4A0,NAICS_2012_Code,44314,, +BTS_TSA,4A0,NAICS_2012_Code,443141,, +BTS_TSA,4A0,NAICS_2012_Code,443142,, +BTS_TSA,4A0,NAICS_2012_Code,444,, +BTS_TSA,4A0,NAICS_2012_Code,4441,, +BTS_TSA,4A0,NAICS_2012_Code,44411,, +BTS_TSA,4A0,NAICS_2012_Code,444110,, +BTS_TSA,4A0,NAICS_2012_Code,44412,, +BTS_TSA,4A0,NAICS_2012_Code,444120,, +BTS_TSA,4A0,NAICS_2012_Code,44413,, +BTS_TSA,4A0,NAICS_2012_Code,444130,, +BTS_TSA,4A0,NAICS_2012_Code,44419,, +BTS_TSA,4A0,NAICS_2012_Code,444190,, +BTS_TSA,4A0,NAICS_2012_Code,4442,, +BTS_TSA,4A0,NAICS_2012_Code,44421,, +BTS_TSA,4A0,NAICS_2012_Code,444210,, +BTS_TSA,4A0,NAICS_2012_Code,44422,, +BTS_TSA,4A0,NAICS_2012_Code,444220,, +BTS_TSA,445,NAICS_2012_Code,445,, +BTS_TSA,445,NAICS_2012_Code,4451,, +BTS_TSA,445,NAICS_2012_Code,44511,, +BTS_TSA,445,NAICS_2012_Code,445110,, +BTS_TSA,445,NAICS_2012_Code,44512,, +BTS_TSA,445,NAICS_2012_Code,445120,, +BTS_TSA,445,NAICS_2012_Code,4452,, +BTS_TSA,445,NAICS_2012_Code,44521,, +BTS_TSA,445,NAICS_2012_Code,445210,, +BTS_TSA,445,NAICS_2012_Code,44522,, +BTS_TSA,445,NAICS_2012_Code,445220,, +BTS_TSA,445,NAICS_2012_Code,44523,, +BTS_TSA,445,NAICS_2012_Code,445230,, +BTS_TSA,445,NAICS_2012_Code,44529,, +BTS_TSA,445,NAICS_2012_Code,445291,, +BTS_TSA,445,NAICS_2012_Code,445292,, +BTS_TSA,445,NAICS_2012_Code,445299,, +BTS_TSA,445,NAICS_2012_Code,4453,, +BTS_TSA,445,NAICS_2012_Code,44531,, +BTS_TSA,445,NAICS_2012_Code,445310,, +BTS_TSA,4A0,NAICS_2012_Code,446,, +BTS_TSA,4A0,NAICS_2012_Code,4461,, +BTS_TSA,4A0,NAICS_2012_Code,44611,, +BTS_TSA,4A0,NAICS_2012_Code,446110,, +BTS_TSA,4A0,NAICS_2012_Code,44612,, +BTS_TSA,4A0,NAICS_2012_Code,446120,, +BTS_TSA,4A0,NAICS_2012_Code,44613,, +BTS_TSA,4A0,NAICS_2012_Code,446130,, +BTS_TSA,4A0,NAICS_2012_Code,44619,, +BTS_TSA,4A0,NAICS_2012_Code,446191,, +BTS_TSA,4A0,NAICS_2012_Code,446199,, +BTS_TSA,4A0,NAICS_2012_Code,447,, +BTS_TSA,4A0,NAICS_2012_Code,4471,, +BTS_TSA,4A0,NAICS_2012_Code,44711,, +BTS_TSA,4A0,NAICS_2012_Code,447110,, +BTS_TSA,4A0,NAICS_2012_Code,44719,, +BTS_TSA,4A0,NAICS_2012_Code,447190,, +BTS_TSA,4A0,NAICS_2012_Code,448,, +BTS_TSA,4A0,NAICS_2012_Code,4481,, +BTS_TSA,4A0,NAICS_2012_Code,44811,, +BTS_TSA,4A0,NAICS_2012_Code,448110,, +BTS_TSA,4A0,NAICS_2012_Code,44812,, +BTS_TSA,4A0,NAICS_2012_Code,448120,, +BTS_TSA,4A0,NAICS_2012_Code,44813,, +BTS_TSA,4A0,NAICS_2012_Code,448130,, +BTS_TSA,4A0,NAICS_2012_Code,44814,, +BTS_TSA,4A0,NAICS_2012_Code,448140,, +BTS_TSA,4A0,NAICS_2012_Code,44815,, +BTS_TSA,4A0,NAICS_2012_Code,448150,, +BTS_TSA,4A0,NAICS_2012_Code,44819,, +BTS_TSA,4A0,NAICS_2012_Code,448190,, +BTS_TSA,4A0,NAICS_2012_Code,4482,, +BTS_TSA,4A0,NAICS_2012_Code,44821,, +BTS_TSA,4A0,NAICS_2012_Code,448210,, +BTS_TSA,4A0,NAICS_2012_Code,4483,, +BTS_TSA,4A0,NAICS_2012_Code,44831,, +BTS_TSA,4A0,NAICS_2012_Code,448310,, +BTS_TSA,4A0,NAICS_2012_Code,44832,, +BTS_TSA,4A0,NAICS_2012_Code,448320,, +BTS_TSA,452,NAICS_2012_Code,45,, +BTS_TSA,4A0,NAICS_2012_Code,45,, +BTS_TSA,4A0,NAICS_2012_Code,451,, +BTS_TSA,4A0,NAICS_2012_Code,4511,, +BTS_TSA,4A0,NAICS_2012_Code,45111,, +BTS_TSA,4A0,NAICS_2012_Code,451110,, +BTS_TSA,4A0,NAICS_2012_Code,45112,, +BTS_TSA,4A0,NAICS_2012_Code,451120,, +BTS_TSA,4A0,NAICS_2012_Code,45113,, +BTS_TSA,4A0,NAICS_2012_Code,451130,, +BTS_TSA,4A0,NAICS_2012_Code,45114,, +BTS_TSA,4A0,NAICS_2012_Code,451140,, +BTS_TSA,4A0,NAICS_2012_Code,4512,, +BTS_TSA,4A0,NAICS_2012_Code,45121,, +BTS_TSA,4A0,NAICS_2012_Code,451211,, +BTS_TSA,4A0,NAICS_2012_Code,451212,, +BTS_TSA,452,NAICS_2012_Code,452,, +BTS_TSA,452,NAICS_2012_Code,4521,, +BTS_TSA,452,NAICS_2012_Code,45211,, +BTS_TSA,452,NAICS_2012_Code,452111,, +BTS_TSA,452,NAICS_2012_Code,452112,, +BTS_TSA,452,NAICS_2012_Code,4529,, +BTS_TSA,452,NAICS_2012_Code,45291,, +BTS_TSA,452,NAICS_2012_Code,452910,, +BTS_TSA,452,NAICS_2012_Code,45299,, +BTS_TSA,452,NAICS_2012_Code,452990,, +BTS_TSA,4A0,NAICS_2012_Code,453,, +BTS_TSA,4A0,NAICS_2012_Code,4531,, +BTS_TSA,4A0,NAICS_2012_Code,45311,, +BTS_TSA,4A0,NAICS_2012_Code,453110,, +BTS_TSA,4A0,NAICS_2012_Code,4532,, +BTS_TSA,4A0,NAICS_2012_Code,45321,, +BTS_TSA,4A0,NAICS_2012_Code,453210,, +BTS_TSA,4A0,NAICS_2012_Code,45322,, +BTS_TSA,4A0,NAICS_2012_Code,453220,, +BTS_TSA,4A0,NAICS_2012_Code,4533,, +BTS_TSA,4A0,NAICS_2012_Code,45331,, +BTS_TSA,4A0,NAICS_2012_Code,453310,, +BTS_TSA,4A0,NAICS_2012_Code,4539,, +BTS_TSA,4A0,NAICS_2012_Code,45391,, +BTS_TSA,4A0,NAICS_2012_Code,453910,, +BTS_TSA,4A0,NAICS_2012_Code,45392,, +BTS_TSA,4A0,NAICS_2012_Code,453920,, +BTS_TSA,4A0,NAICS_2012_Code,45393,, +BTS_TSA,4A0,NAICS_2012_Code,453930,, +BTS_TSA,4A0,NAICS_2012_Code,45399,, +BTS_TSA,4A0,NAICS_2012_Code,453991,, +BTS_TSA,4A0,NAICS_2012_Code,453998,, +BTS_TSA,4A0,NAICS_2012_Code,454,, +BTS_TSA,4A0,NAICS_2012_Code,4541,, +BTS_TSA,4A0,NAICS_2012_Code,45411,, +BTS_TSA,4A0,NAICS_2012_Code,454111,, +BTS_TSA,4A0,NAICS_2012_Code,454112,, +BTS_TSA,4A0,NAICS_2012_Code,454113,, +BTS_TSA,4A0,NAICS_2012_Code,4542,, +BTS_TSA,4A0,NAICS_2012_Code,45421,, +BTS_TSA,4A0,NAICS_2012_Code,454210,, +BTS_TSA,4A0,NAICS_2012_Code,4543,, +BTS_TSA,4A0,NAICS_2012_Code,45431,, +BTS_TSA,4A0,NAICS_2012_Code,454310,, +BTS_TSA,4A0,NAICS_2012_Code,45439,, +BTS_TSA,4A0,NAICS_2012_Code,454390,, +BTS_TSA,481,NAICS_2012_Code,48,, +BTS_TSA,482,NAICS_2012_Code,48,, +BTS_TSA,483,NAICS_2012_Code,48,, +BTS_TSA,484,NAICS_2012_Code,48,, +BTS_TSA,485,NAICS_2012_Code,48,, +BTS_TSA,486,NAICS_2012_Code,48,, +BTS_TSA,487OS,NAICS_2012_Code,48,, +BTS_TSA,481,NAICS_2012_Code,481,, +BTS_TSA,481,NAICS_2012_Code,4811,, +BTS_TSA,481,NAICS_2012_Code,48111,, +BTS_TSA,481,NAICS_2012_Code,481111,, +BTS_TSA,481,NAICS_2012_Code,481112,, +BTS_TSA,481,NAICS_2012_Code,4812,, +BTS_TSA,481,NAICS_2012_Code,48121,, +BTS_TSA,481,NAICS_2012_Code,481211,, +BTS_TSA,481,NAICS_2012_Code,481212,, +BTS_TSA,481,NAICS_2012_Code,481219,, +BTS_TSA,482,NAICS_2012_Code,482,, +BTS_TSA,482,NAICS_2012_Code,4821,, +BTS_TSA,482,NAICS_2012_Code,48211,, +BTS_TSA,482,NAICS_2012_Code,482111,, +BTS_TSA,482,NAICS_2012_Code,482112,, +BTS_TSA,483,NAICS_2012_Code,483,, +BTS_TSA,483,NAICS_2012_Code,4831,, +BTS_TSA,483,NAICS_2012_Code,48311,, +BTS_TSA,483,NAICS_2012_Code,483111,, +BTS_TSA,483,NAICS_2012_Code,483112,, +BTS_TSA,483,NAICS_2012_Code,483113,, +BTS_TSA,483,NAICS_2012_Code,483114,, +BTS_TSA,483,NAICS_2012_Code,4832,, +BTS_TSA,483,NAICS_2012_Code,48321,, +BTS_TSA,483,NAICS_2012_Code,483211,, +BTS_TSA,483,NAICS_2012_Code,483212,, +BTS_TSA,484,NAICS_2012_Code,484,, +BTS_TSA,484,NAICS_2012_Code,4841,, +BTS_TSA,484,NAICS_2012_Code,48411,, +BTS_TSA,484,NAICS_2012_Code,484110,, +BTS_TSA,484,NAICS_2012_Code,48412,, +BTS_TSA,484,NAICS_2012_Code,484121,, +BTS_TSA,484,NAICS_2012_Code,484122,, +BTS_TSA,484,NAICS_2012_Code,4842,, +BTS_TSA,484,NAICS_2012_Code,48421,, +BTS_TSA,484,NAICS_2012_Code,484210,, +BTS_TSA,484,NAICS_2012_Code,48422,, +BTS_TSA,484,NAICS_2012_Code,484220,, +BTS_TSA,484,NAICS_2012_Code,48423,, +BTS_TSA,484,NAICS_2012_Code,484230,, +BTS_TSA,485,NAICS_2012_Code,485,, +BTS_TSA,485,NAICS_2012_Code,4851,, +BTS_TSA,485,NAICS_2012_Code,48511,, +BTS_TSA,485,NAICS_2012_Code,485111,, +BTS_TSA,485,NAICS_2012_Code,485112,, +BTS_TSA,485,NAICS_2012_Code,485113,, +BTS_TSA,485,NAICS_2012_Code,485119,, +BTS_TSA,485,NAICS_2012_Code,4852,, +BTS_TSA,485,NAICS_2012_Code,48521,, +BTS_TSA,485,NAICS_2012_Code,485210,, +BTS_TSA,485,NAICS_2012_Code,4853,, +BTS_TSA,485,NAICS_2012_Code,48531,, +BTS_TSA,485,NAICS_2012_Code,485310,, +BTS_TSA,485,NAICS_2012_Code,48532,, +BTS_TSA,485,NAICS_2012_Code,485320,, +BTS_TSA,485,NAICS_2012_Code,4854,, +BTS_TSA,485,NAICS_2012_Code,48541,, +BTS_TSA,485,NAICS_2012_Code,485410,, +BTS_TSA,485,NAICS_2012_Code,4855,, +BTS_TSA,485,NAICS_2012_Code,48551,, +BTS_TSA,485,NAICS_2012_Code,485510,, +BTS_TSA,485,NAICS_2012_Code,4859,, +BTS_TSA,485,NAICS_2012_Code,48599,, +BTS_TSA,485,NAICS_2012_Code,485991,, +BTS_TSA,485,NAICS_2012_Code,485999,, +BTS_TSA,486,NAICS_2012_Code,486,, +BTS_TSA,486,NAICS_2012_Code,4861,, +BTS_TSA,486,NAICS_2012_Code,48611,, +BTS_TSA,486,NAICS_2012_Code,486110,, +BTS_TSA,486,NAICS_2012_Code,4862,, +BTS_TSA,486,NAICS_2012_Code,48621,, +BTS_TSA,486,NAICS_2012_Code,486210,, +BTS_TSA,486,NAICS_2012_Code,4869,, +BTS_TSA,486,NAICS_2012_Code,48691,, +BTS_TSA,486,NAICS_2012_Code,486910,, +BTS_TSA,486,NAICS_2012_Code,48699,, +BTS_TSA,486,NAICS_2012_Code,486990,, +BTS_TSA,487OS,NAICS_2012_Code,487,, +BTS_TSA,487OS,NAICS_2012_Code,4871,, +BTS_TSA,487OS,NAICS_2012_Code,48711,, +BTS_TSA,487OS,NAICS_2012_Code,487110,, +BTS_TSA,487OS,NAICS_2012_Code,4872,, +BTS_TSA,487OS,NAICS_2012_Code,48721,, +BTS_TSA,487OS,NAICS_2012_Code,487210,, +BTS_TSA,487OS,NAICS_2012_Code,4879,, +BTS_TSA,487OS,NAICS_2012_Code,48799,, +BTS_TSA,487OS,NAICS_2012_Code,487990,, +BTS_TSA,487OS,NAICS_2012_Code,488,, +BTS_TSA,487OS,NAICS_2012_Code,4881,, +BTS_TSA,487OS,NAICS_2012_Code,48811,, +BTS_TSA,487OS,NAICS_2012_Code,488111,, +BTS_TSA,487OS,NAICS_2012_Code,488119,, +BTS_TSA,487OS,NAICS_2012_Code,48819,, +BTS_TSA,487OS,NAICS_2012_Code,488190,, +BTS_TSA,487OS,NAICS_2012_Code,4882,, +BTS_TSA,487OS,NAICS_2012_Code,48821,, +BTS_TSA,487OS,NAICS_2012_Code,488210,, +BTS_TSA,487OS,NAICS_2012_Code,4883,, +BTS_TSA,487OS,NAICS_2012_Code,48831,, +BTS_TSA,487OS,NAICS_2012_Code,488310,, +BTS_TSA,487OS,NAICS_2012_Code,48832,, +BTS_TSA,487OS,NAICS_2012_Code,488320,, +BTS_TSA,487OS,NAICS_2012_Code,48833,, +BTS_TSA,487OS,NAICS_2012_Code,488330,, +BTS_TSA,487OS,NAICS_2012_Code,48839,, +BTS_TSA,487OS,NAICS_2012_Code,488390,, +BTS_TSA,487OS,NAICS_2012_Code,4884,, +BTS_TSA,487OS,NAICS_2012_Code,48841,, +BTS_TSA,487OS,NAICS_2012_Code,488410,, +BTS_TSA,487OS,NAICS_2012_Code,48849,, +BTS_TSA,487OS,NAICS_2012_Code,488490,, +BTS_TSA,487OS,NAICS_2012_Code,4885,, +BTS_TSA,487OS,NAICS_2012_Code,48851,, +BTS_TSA,487OS,NAICS_2012_Code,488510,, +BTS_TSA,487OS,NAICS_2012_Code,4889,, +BTS_TSA,487OS,NAICS_2012_Code,48899,, +BTS_TSA,487OS,NAICS_2012_Code,488991,, +BTS_TSA,487OS,NAICS_2012_Code,488999,, +BTS_TSA,GFE,NAICS_2012_Code,49,, +BTS_TSA,487OS,NAICS_2012_Code,49,, +BTS_TSA,493,NAICS_2012_Code,49,, +BTS_TSA,GFE,NAICS_2012_Code,491,, +BTS_TSA,GFE,NAICS_2012_Code,4911,, +BTS_TSA,GFE,NAICS_2012_Code,49111,, +BTS_TSA,GFE,NAICS_2012_Code,491110,, +BTS_TSA,487OS,NAICS_2012_Code,492,, +BTS_TSA,487OS,NAICS_2012_Code,4921,, +BTS_TSA,487OS,NAICS_2012_Code,49211,, +BTS_TSA,487OS,NAICS_2012_Code,492110,, +BTS_TSA,487OS,NAICS_2012_Code,4922,, +BTS_TSA,487OS,NAICS_2012_Code,49221,, +BTS_TSA,487OS,NAICS_2012_Code,492210,, +BTS_TSA,493,NAICS_2012_Code,493,, +BTS_TSA,493,NAICS_2012_Code,4931,, +BTS_TSA,493,NAICS_2012_Code,49311,, +BTS_TSA,493,NAICS_2012_Code,493110,, +BTS_TSA,493,NAICS_2012_Code,49312,, +BTS_TSA,493,NAICS_2012_Code,493120,, +BTS_TSA,493,NAICS_2012_Code,49313,, +BTS_TSA,493,NAICS_2012_Code,493130,, +BTS_TSA,493,NAICS_2012_Code,49319,, +BTS_TSA,493,NAICS_2012_Code,493190,, +BTS_TSA,511,NAICS_2012_Code,51,, +BTS_TSA,512,NAICS_2012_Code,51,, +BTS_TSA,513,NAICS_2012_Code,51,, +BTS_TSA,514,NAICS_2012_Code,51,, +BTS_TSA,511,NAICS_2012_Code,511,, +BTS_TSA,511,NAICS_2012_Code,5111,, +BTS_TSA,511,NAICS_2012_Code,51111,, +BTS_TSA,511,NAICS_2012_Code,511110,, +BTS_TSA,511,NAICS_2012_Code,51112,, +BTS_TSA,511,NAICS_2012_Code,511120,, +BTS_TSA,511,NAICS_2012_Code,51113,, +BTS_TSA,511,NAICS_2012_Code,511130,, +BTS_TSA,511,NAICS_2012_Code,51114,, +BTS_TSA,511,NAICS_2012_Code,511140,, +BTS_TSA,511,NAICS_2012_Code,51119,, +BTS_TSA,511,NAICS_2012_Code,511191,, +BTS_TSA,511,NAICS_2012_Code,511199,, +BTS_TSA,511,NAICS_2012_Code,5112,, +BTS_TSA,511,NAICS_2012_Code,51121,, +BTS_TSA,511,NAICS_2012_Code,511210,, +BTS_TSA,512,NAICS_2012_Code,512,, +BTS_TSA,512,NAICS_2012_Code,5121,, +BTS_TSA,512,NAICS_2012_Code,51211,, +BTS_TSA,512,NAICS_2012_Code,512110,, +BTS_TSA,512,NAICS_2012_Code,51212,, +BTS_TSA,512,NAICS_2012_Code,512120,, +BTS_TSA,512,NAICS_2012_Code,51213,, +BTS_TSA,512,NAICS_2012_Code,512131,, +BTS_TSA,512,NAICS_2012_Code,512132,, +BTS_TSA,512,NAICS_2012_Code,51219,, +BTS_TSA,512,NAICS_2012_Code,512191,, +BTS_TSA,512,NAICS_2012_Code,512199,, +BTS_TSA,512,NAICS_2012_Code,5122,, +BTS_TSA,512,NAICS_2012_Code,51221,, +BTS_TSA,512,NAICS_2012_Code,512210,, +BTS_TSA,512,NAICS_2012_Code,51222,, +BTS_TSA,512,NAICS_2012_Code,512220,, +BTS_TSA,512,NAICS_2012_Code,51223,, +BTS_TSA,512,NAICS_2012_Code,512230,, +BTS_TSA,512,NAICS_2012_Code,51224,, +BTS_TSA,512,NAICS_2012_Code,512240,, +BTS_TSA,512,NAICS_2012_Code,51229,, +BTS_TSA,512,NAICS_2012_Code,512290,, +BTS_TSA,513,NAICS_2012_Code,515,, +BTS_TSA,513,NAICS_2012_Code,5151,, +BTS_TSA,513,NAICS_2012_Code,51511,, +BTS_TSA,513,NAICS_2012_Code,515111,, +BTS_TSA,513,NAICS_2012_Code,515112,, +BTS_TSA,513,NAICS_2012_Code,51512,, +BTS_TSA,513,NAICS_2012_Code,515120,, +BTS_TSA,513,NAICS_2012_Code,5152,, +BTS_TSA,513,NAICS_2012_Code,51521,, +BTS_TSA,513,NAICS_2012_Code,515210,, +BTS_TSA,513,NAICS_2012_Code,517,, +BTS_TSA,513,NAICS_2012_Code,5171,, +BTS_TSA,513,NAICS_2012_Code,51711,, +BTS_TSA,513,NAICS_2012_Code,517110,, +BTS_TSA,513,NAICS_2012_Code,5172,, +BTS_TSA,513,NAICS_2012_Code,51721,, +BTS_TSA,513,NAICS_2012_Code,517210,, +BTS_TSA,513,NAICS_2012_Code,5174,, +BTS_TSA,513,NAICS_2012_Code,51741,, +BTS_TSA,513,NAICS_2012_Code,517410,, +BTS_TSA,513,NAICS_2012_Code,5179,, +BTS_TSA,513,NAICS_2012_Code,51791,, +BTS_TSA,513,NAICS_2012_Code,517911,, +BTS_TSA,513,NAICS_2012_Code,517919,, +BTS_TSA,514,NAICS_2012_Code,518,, +BTS_TSA,514,NAICS_2012_Code,5182,, +BTS_TSA,514,NAICS_2012_Code,51821,, +BTS_TSA,514,NAICS_2012_Code,518210,, +BTS_TSA,514,NAICS_2012_Code,519,, +BTS_TSA,514,NAICS_2012_Code,5191,, +BTS_TSA,514,NAICS_2012_Code,51911,, +BTS_TSA,514,NAICS_2012_Code,519110,, +BTS_TSA,514,NAICS_2012_Code,51912,, +BTS_TSA,514,NAICS_2012_Code,519120,, +BTS_TSA,514,NAICS_2012_Code,51913,, +BTS_TSA,514,NAICS_2012_Code,519130,, +BTS_TSA,514,NAICS_2012_Code,51919,, +BTS_TSA,514,NAICS_2012_Code,519190,, +BTS_TSA,521CI,NAICS_2012_Code,52,, +BTS_TSA,523,NAICS_2012_Code,52,, +BTS_TSA,524,NAICS_2012_Code,52,, +BTS_TSA,525,NAICS_2012_Code,52,, +BTS_TSA,521CI,NAICS_2012_Code,521,, +BTS_TSA,521CI,NAICS_2012_Code,5211,, +BTS_TSA,521CI,NAICS_2012_Code,52111,, +BTS_TSA,521CI,NAICS_2012_Code,521110,, +BTS_TSA,521CI,NAICS_2012_Code,522,, +BTS_TSA,521CI,NAICS_2012_Code,5221,, +BTS_TSA,521CI,NAICS_2012_Code,52211,, +BTS_TSA,521CI,NAICS_2012_Code,522110,, +BTS_TSA,521CI,NAICS_2012_Code,52212,, +BTS_TSA,521CI,NAICS_2012_Code,522120,, +BTS_TSA,521CI,NAICS_2012_Code,52213,, +BTS_TSA,521CI,NAICS_2012_Code,522130,, +BTS_TSA,521CI,NAICS_2012_Code,52219,, +BTS_TSA,521CI,NAICS_2012_Code,522190,, +BTS_TSA,521CI,NAICS_2012_Code,5222,, +BTS_TSA,521CI,NAICS_2012_Code,52221,, +BTS_TSA,521CI,NAICS_2012_Code,522210,, +BTS_TSA,521CI,NAICS_2012_Code,52222,, +BTS_TSA,521CI,NAICS_2012_Code,522220,, +BTS_TSA,521CI,NAICS_2012_Code,52229,, +BTS_TSA,521CI,NAICS_2012_Code,522291,, +BTS_TSA,521CI,NAICS_2012_Code,522292,, +BTS_TSA,521CI,NAICS_2012_Code,522293,, +BTS_TSA,521CI,NAICS_2012_Code,522294,, +BTS_TSA,521CI,NAICS_2012_Code,522298,, +BTS_TSA,521CI,NAICS_2012_Code,5223,, +BTS_TSA,521CI,NAICS_2012_Code,52231,, +BTS_TSA,521CI,NAICS_2012_Code,522310,, +BTS_TSA,521CI,NAICS_2012_Code,52232,, +BTS_TSA,521CI,NAICS_2012_Code,522320,, +BTS_TSA,521CI,NAICS_2012_Code,52239,, +BTS_TSA,521CI,NAICS_2012_Code,522390,, +BTS_TSA,523,NAICS_2012_Code,523,, +BTS_TSA,523,NAICS_2012_Code,5231,, +BTS_TSA,523,NAICS_2012_Code,52311,, +BTS_TSA,523,NAICS_2012_Code,523110,, +BTS_TSA,523,NAICS_2012_Code,52312,, +BTS_TSA,523,NAICS_2012_Code,523120,, +BTS_TSA,523,NAICS_2012_Code,52313,, +BTS_TSA,523,NAICS_2012_Code,523130,, +BTS_TSA,523,NAICS_2012_Code,52314,, +BTS_TSA,523,NAICS_2012_Code,523140,, +BTS_TSA,523,NAICS_2012_Code,5232,, +BTS_TSA,523,NAICS_2012_Code,52321,, +BTS_TSA,523,NAICS_2012_Code,523210,, +BTS_TSA,523,NAICS_2012_Code,5239,, +BTS_TSA,523,NAICS_2012_Code,52391,, +BTS_TSA,523,NAICS_2012_Code,523910,, +BTS_TSA,523,NAICS_2012_Code,52392,, +BTS_TSA,523,NAICS_2012_Code,523920,, +BTS_TSA,523,NAICS_2012_Code,52393,, +BTS_TSA,523,NAICS_2012_Code,523930,, +BTS_TSA,523,NAICS_2012_Code,52399,, +BTS_TSA,523,NAICS_2012_Code,523991,, +BTS_TSA,523,NAICS_2012_Code,523999,, +BTS_TSA,524,NAICS_2012_Code,524,, +BTS_TSA,524,NAICS_2012_Code,5241,, +BTS_TSA,524,NAICS_2012_Code,52411,, +BTS_TSA,524,NAICS_2012_Code,524113,, +BTS_TSA,524,NAICS_2012_Code,524114,, +BTS_TSA,524,NAICS_2012_Code,52412,, +BTS_TSA,524,NAICS_2012_Code,524126,, +BTS_TSA,524,NAICS_2012_Code,524127,, +BTS_TSA,524,NAICS_2012_Code,524128,, +BTS_TSA,524,NAICS_2012_Code,52413,, +BTS_TSA,524,NAICS_2012_Code,524130,, +BTS_TSA,524,NAICS_2012_Code,5242,, +BTS_TSA,524,NAICS_2012_Code,52421,, +BTS_TSA,524,NAICS_2012_Code,524210,, +BTS_TSA,524,NAICS_2012_Code,52429,, +BTS_TSA,524,NAICS_2012_Code,524291,, +BTS_TSA,524,NAICS_2012_Code,524292,, +BTS_TSA,524,NAICS_2012_Code,524298,, +BTS_TSA,525,NAICS_2012_Code,525,, +BTS_TSA,525,NAICS_2012_Code,5251,, +BTS_TSA,525,NAICS_2012_Code,52511,, +BTS_TSA,525,NAICS_2012_Code,525110,, +BTS_TSA,525,NAICS_2012_Code,52512,, +BTS_TSA,525,NAICS_2012_Code,525120,, +BTS_TSA,525,NAICS_2012_Code,52519,, +BTS_TSA,525,NAICS_2012_Code,525190,, +BTS_TSA,525,NAICS_2012_Code,5259,, +BTS_TSA,525,NAICS_2012_Code,52591,, +BTS_TSA,525,NAICS_2012_Code,525910,, +BTS_TSA,525,NAICS_2012_Code,52592,, +BTS_TSA,525,NAICS_2012_Code,525920,, +BTS_TSA,525,NAICS_2012_Code,52599,, +BTS_TSA,525,NAICS_2012_Code,525990,, +BTS_TSA,HS,NAICS_2012_Code,53,, +BTS_TSA,ORE,NAICS_2012_Code,53,, +BTS_TSA,532RL,NAICS_2012_Code,53,, +BTS_TSA,HS,NAICS_2012_Code,531,, +BTS_TSA,ORE,NAICS_2012_Code,531,, +BTS_TSA,HS,NAICS_2012_Code,5311,, +BTS_TSA,ORE,NAICS_2012_Code,5311,, +BTS_TSA,HS,NAICS_2012_Code,53111,, +BTS_TSA,ORE,NAICS_2012_Code,53111,, +BTS_TSA,HS,NAICS_2012_Code,531110,, +BTS_TSA,ORE,NAICS_2012_Code,531110,, +BTS_TSA,HS,NAICS_2012_Code,53112,, +BTS_TSA,ORE,NAICS_2012_Code,53112,, +BTS_TSA,HS,NAICS_2012_Code,531120,, +BTS_TSA,ORE,NAICS_2012_Code,531120,, +BTS_TSA,HS,NAICS_2012_Code,53113,, +BTS_TSA,ORE,NAICS_2012_Code,53113,, +BTS_TSA,HS,NAICS_2012_Code,531130,, +BTS_TSA,ORE,NAICS_2012_Code,531130,, +BTS_TSA,HS,NAICS_2012_Code,53119,, +BTS_TSA,ORE,NAICS_2012_Code,53119,, +BTS_TSA,HS,NAICS_2012_Code,531190,, +BTS_TSA,ORE,NAICS_2012_Code,531190,, +BTS_TSA,HS,NAICS_2012_Code,5312,, +BTS_TSA,ORE,NAICS_2012_Code,5312,, +BTS_TSA,HS,NAICS_2012_Code,53121,, +BTS_TSA,ORE,NAICS_2012_Code,53121,, +BTS_TSA,HS,NAICS_2012_Code,531210,, +BTS_TSA,ORE,NAICS_2012_Code,531210,, +BTS_TSA,HS,NAICS_2012_Code,5313,, +BTS_TSA,ORE,NAICS_2012_Code,5313,, +BTS_TSA,HS,NAICS_2012_Code,53131,, +BTS_TSA,ORE,NAICS_2012_Code,53131,, +BTS_TSA,HS,NAICS_2012_Code,531311,, +BTS_TSA,ORE,NAICS_2012_Code,531311,, +BTS_TSA,HS,NAICS_2012_Code,531312,, +BTS_TSA,ORE,NAICS_2012_Code,531312,, +BTS_TSA,HS,NAICS_2012_Code,53132,, +BTS_TSA,ORE,NAICS_2012_Code,53132,, +BTS_TSA,HS,NAICS_2012_Code,531320,, +BTS_TSA,ORE,NAICS_2012_Code,531320,, +BTS_TSA,HS,NAICS_2012_Code,53139,, +BTS_TSA,ORE,NAICS_2012_Code,53139,, +BTS_TSA,HS,NAICS_2012_Code,531390,, +BTS_TSA,ORE,NAICS_2012_Code,531390,, +BTS_TSA,HS,NAICS_2012_Code,532,, +BTS_TSA,532RL,NAICS_2012_Code,532,, +BTS_TSA,HS,NAICS_2012_Code,5321,, +BTS_TSA,532RL,NAICS_2012_Code,5321,, +BTS_TSA,HS,NAICS_2012_Code,53211,, +BTS_TSA,532RL,NAICS_2012_Code,53211,, +BTS_TSA,HS,NAICS_2012_Code,532111,, +BTS_TSA,532RL,NAICS_2012_Code,532111,, +BTS_TSA,HS,NAICS_2012_Code,532112,, +BTS_TSA,532RL,NAICS_2012_Code,532112,, +BTS_TSA,HS,NAICS_2012_Code,53212,, +BTS_TSA,532RL,NAICS_2012_Code,53212,, +BTS_TSA,HS,NAICS_2012_Code,532120,, +BTS_TSA,532RL,NAICS_2012_Code,532120,, +BTS_TSA,HS,NAICS_2012_Code,5322,, +BTS_TSA,532RL,NAICS_2012_Code,5322,, +BTS_TSA,HS,NAICS_2012_Code,53221,, +BTS_TSA,532RL,NAICS_2012_Code,53221,, +BTS_TSA,HS,NAICS_2012_Code,532210,, +BTS_TSA,532RL,NAICS_2012_Code,532210,, +BTS_TSA,HS,NAICS_2012_Code,53222,, +BTS_TSA,532RL,NAICS_2012_Code,53222,, +BTS_TSA,HS,NAICS_2012_Code,532220,, +BTS_TSA,532RL,NAICS_2012_Code,532220,, +BTS_TSA,HS,NAICS_2012_Code,53223,, +BTS_TSA,532RL,NAICS_2012_Code,53223,, +BTS_TSA,HS,NAICS_2012_Code,532230,, +BTS_TSA,532RL,NAICS_2012_Code,532230,, +BTS_TSA,HS,NAICS_2012_Code,53229,, +BTS_TSA,532RL,NAICS_2012_Code,53229,, +BTS_TSA,HS,NAICS_2012_Code,532291,, +BTS_TSA,532RL,NAICS_2012_Code,532291,, +BTS_TSA,HS,NAICS_2012_Code,532292,, +BTS_TSA,532RL,NAICS_2012_Code,532292,, +BTS_TSA,HS,NAICS_2012_Code,532299,, +BTS_TSA,532RL,NAICS_2012_Code,532299,, +BTS_TSA,HS,NAICS_2012_Code,5323,, +BTS_TSA,532RL,NAICS_2012_Code,5323,, +BTS_TSA,HS,NAICS_2012_Code,53231,, +BTS_TSA,532RL,NAICS_2012_Code,53231,, +BTS_TSA,HS,NAICS_2012_Code,532310,, +BTS_TSA,532RL,NAICS_2012_Code,532310,, +BTS_TSA,HS,NAICS_2012_Code,5324,, +BTS_TSA,532RL,NAICS_2012_Code,5324,, +BTS_TSA,HS,NAICS_2012_Code,53241,, +BTS_TSA,532RL,NAICS_2012_Code,53241,, +BTS_TSA,HS,NAICS_2012_Code,532411,, +BTS_TSA,532RL,NAICS_2012_Code,532411,, +BTS_TSA,HS,NAICS_2012_Code,532412,, +BTS_TSA,532RL,NAICS_2012_Code,532412,, +BTS_TSA,HS,NAICS_2012_Code,53242,, +BTS_TSA,532RL,NAICS_2012_Code,53242,, +BTS_TSA,HS,NAICS_2012_Code,532420,, +BTS_TSA,532RL,NAICS_2012_Code,532420,, +BTS_TSA,HS,NAICS_2012_Code,53249,, +BTS_TSA,532RL,NAICS_2012_Code,53249,, +BTS_TSA,HS,NAICS_2012_Code,532490,, +BTS_TSA,532RL,NAICS_2012_Code,532490,, +BTS_TSA,HS,NAICS_2012_Code,533,, +BTS_TSA,532RL,NAICS_2012_Code,533,, +BTS_TSA,HS,NAICS_2012_Code,5331,, +BTS_TSA,532RL,NAICS_2012_Code,5331,, +BTS_TSA,HS,NAICS_2012_Code,53311,, +BTS_TSA,532RL,NAICS_2012_Code,53311,, +BTS_TSA,HS,NAICS_2012_Code,533110,, +BTS_TSA,532RL,NAICS_2012_Code,533110,, +BTS_TSA,5411,NAICS_2012_Code,54,, +BTS_TSA,5412OP,NAICS_2012_Code,54,, +BTS_TSA,5415,NAICS_2012_Code,54,, +BTS_TSA,5411,NAICS_2012_Code,541,, +BTS_TSA,5412OP,NAICS_2012_Code,541,, +BTS_TSA,5415,NAICS_2012_Code,541,, +BTS_TSA,5411,NAICS_2012_Code,5411,, +BTS_TSA,5411,NAICS_2012_Code,54111,, +BTS_TSA,5411,NAICS_2012_Code,541110,, +BTS_TSA,5411,NAICS_2012_Code,54112,, +BTS_TSA,5411,NAICS_2012_Code,541120,, +BTS_TSA,5411,NAICS_2012_Code,54119,, +BTS_TSA,5411,NAICS_2012_Code,541191,, +BTS_TSA,5411,NAICS_2012_Code,541199,, +BTS_TSA,5412OP,NAICS_2012_Code,5412,, +BTS_TSA,5412OP,NAICS_2012_Code,54121,, +BTS_TSA,5412OP,NAICS_2012_Code,541211,, +BTS_TSA,5412OP,NAICS_2012_Code,541213,, +BTS_TSA,5412OP,NAICS_2012_Code,541214,, +BTS_TSA,5412OP,NAICS_2012_Code,541219,, +BTS_TSA,5412OP,NAICS_2012_Code,5413,, +BTS_TSA,5412OP,NAICS_2012_Code,54131,, +BTS_TSA,5412OP,NAICS_2012_Code,541310,, +BTS_TSA,5412OP,NAICS_2012_Code,54132,, +BTS_TSA,5412OP,NAICS_2012_Code,541320,, +BTS_TSA,5412OP,NAICS_2012_Code,54133,, +BTS_TSA,5412OP,NAICS_2012_Code,541330,, +BTS_TSA,5412OP,NAICS_2012_Code,54134,, +BTS_TSA,5412OP,NAICS_2012_Code,541340,, +BTS_TSA,5412OP,NAICS_2012_Code,54135,, +BTS_TSA,5412OP,NAICS_2012_Code,541350,, +BTS_TSA,5412OP,NAICS_2012_Code,54136,, +BTS_TSA,5412OP,NAICS_2012_Code,541360,, +BTS_TSA,5412OP,NAICS_2012_Code,54137,, +BTS_TSA,5412OP,NAICS_2012_Code,541370,, +BTS_TSA,5412OP,NAICS_2012_Code,54138,, +BTS_TSA,5412OP,NAICS_2012_Code,541380,, +BTS_TSA,5412OP,NAICS_2012_Code,5414,, +BTS_TSA,5412OP,NAICS_2012_Code,54141,, +BTS_TSA,5412OP,NAICS_2012_Code,541410,, +BTS_TSA,5412OP,NAICS_2012_Code,54142,, +BTS_TSA,5412OP,NAICS_2012_Code,541420,, +BTS_TSA,5412OP,NAICS_2012_Code,54143,, +BTS_TSA,5412OP,NAICS_2012_Code,541430,, +BTS_TSA,5412OP,NAICS_2012_Code,54149,, +BTS_TSA,5412OP,NAICS_2012_Code,541490,, +BTS_TSA,5415,NAICS_2012_Code,5415,, +BTS_TSA,5415,NAICS_2012_Code,54151,, +BTS_TSA,5415,NAICS_2012_Code,541511,, +BTS_TSA,5415,NAICS_2012_Code,541512,, +BTS_TSA,5415,NAICS_2012_Code,541513,, +BTS_TSA,5415,NAICS_2012_Code,541519,, +BTS_TSA,5412OP,NAICS_2012_Code,5416,, +BTS_TSA,5412OP,NAICS_2012_Code,54161,, +BTS_TSA,5412OP,NAICS_2012_Code,541611,, +BTS_TSA,5412OP,NAICS_2012_Code,541612,, +BTS_TSA,5412OP,NAICS_2012_Code,541613,, +BTS_TSA,5412OP,NAICS_2012_Code,541614,, +BTS_TSA,5412OP,NAICS_2012_Code,541618,, +BTS_TSA,5412OP,NAICS_2012_Code,54162,, +BTS_TSA,5412OP,NAICS_2012_Code,541620,, +BTS_TSA,5412OP,NAICS_2012_Code,54169,, +BTS_TSA,5412OP,NAICS_2012_Code,541690,, +BTS_TSA,5412OP,NAICS_2012_Code,5417,, +BTS_TSA,5412OP,NAICS_2012_Code,54171,, +BTS_TSA,5412OP,NAICS_2012_Code,541711,, +BTS_TSA,5412OP,NAICS_2012_Code,541712,, +BTS_TSA,5412OP,NAICS_2012_Code,54172,, +BTS_TSA,5412OP,NAICS_2012_Code,541720,, +BTS_TSA,5412OP,NAICS_2012_Code,5418,, +BTS_TSA,5412OP,NAICS_2012_Code,54181,, +BTS_TSA,5412OP,NAICS_2012_Code,541810,, +BTS_TSA,5412OP,NAICS_2012_Code,54182,, +BTS_TSA,5412OP,NAICS_2012_Code,541820,, +BTS_TSA,5412OP,NAICS_2012_Code,54183,, +BTS_TSA,5412OP,NAICS_2012_Code,541830,, +BTS_TSA,5412OP,NAICS_2012_Code,54184,, +BTS_TSA,5412OP,NAICS_2012_Code,541840,, +BTS_TSA,5412OP,NAICS_2012_Code,54185,, +BTS_TSA,5412OP,NAICS_2012_Code,541850,, +BTS_TSA,5412OP,NAICS_2012_Code,54186,, +BTS_TSA,5412OP,NAICS_2012_Code,541860,, +BTS_TSA,5412OP,NAICS_2012_Code,54187,, +BTS_TSA,5412OP,NAICS_2012_Code,541870,, +BTS_TSA,5412OP,NAICS_2012_Code,54189,, +BTS_TSA,5412OP,NAICS_2012_Code,541890,, +BTS_TSA,5412OP,NAICS_2012_Code,5419,, +BTS_TSA,5412OP,NAICS_2012_Code,54191,, +BTS_TSA,5412OP,NAICS_2012_Code,541910,, +BTS_TSA,5412OP,NAICS_2012_Code,54192,, +BTS_TSA,5412OP,NAICS_2012_Code,541921,, +BTS_TSA,5412OP,NAICS_2012_Code,541922,, +BTS_TSA,5412OP,NAICS_2012_Code,54193,, +BTS_TSA,5412OP,NAICS_2012_Code,541930,, +BTS_TSA,5412OP,NAICS_2012_Code,54194,, +BTS_TSA,5412OP,NAICS_2012_Code,541940,, +BTS_TSA,5412OP,NAICS_2012_Code,54199,, +BTS_TSA,5412OP,NAICS_2012_Code,541990,, +BTS_TSA,55,NAICS_2012_Code,55,, +BTS_TSA,55,NAICS_2012_Code,551,, +BTS_TSA,55,NAICS_2012_Code,5511,, +BTS_TSA,55,NAICS_2012_Code,55111,, +BTS_TSA,55,NAICS_2012_Code,551111,, +BTS_TSA,55,NAICS_2012_Code,551112,, +BTS_TSA,55,NAICS_2012_Code,551114,, +BTS_TSA,561,NAICS_2012_Code,56,, +BTS_TSA,562,NAICS_2012_Code,56,, +BTS_TSA,561,NAICS_2012_Code,561,, +BTS_TSA,561,NAICS_2012_Code,5611,, +BTS_TSA,561,NAICS_2012_Code,56111,, +BTS_TSA,561,NAICS_2012_Code,561110,, +BTS_TSA,561,NAICS_2012_Code,5612,, +BTS_TSA,561,NAICS_2012_Code,56121,, +BTS_TSA,561,NAICS_2012_Code,561210,, +BTS_TSA,561,NAICS_2012_Code,5613,, +BTS_TSA,561,NAICS_2012_Code,56131,, +BTS_TSA,561,NAICS_2012_Code,561311,, +BTS_TSA,561,NAICS_2012_Code,561312,, +BTS_TSA,561,NAICS_2012_Code,56132,, +BTS_TSA,561,NAICS_2012_Code,561320,, +BTS_TSA,561,NAICS_2012_Code,56133,, +BTS_TSA,561,NAICS_2012_Code,561330,, +BTS_TSA,561,NAICS_2012_Code,5614,, +BTS_TSA,561,NAICS_2012_Code,56141,, +BTS_TSA,561,NAICS_2012_Code,561410,, +BTS_TSA,561,NAICS_2012_Code,56142,, +BTS_TSA,561,NAICS_2012_Code,561421,, +BTS_TSA,561,NAICS_2012_Code,561422,, +BTS_TSA,561,NAICS_2012_Code,56143,, +BTS_TSA,561,NAICS_2012_Code,561431,, +BTS_TSA,561,NAICS_2012_Code,561439,, +BTS_TSA,561,NAICS_2012_Code,56144,, +BTS_TSA,561,NAICS_2012_Code,561440,, +BTS_TSA,561,NAICS_2012_Code,56145,, +BTS_TSA,561,NAICS_2012_Code,561450,, +BTS_TSA,561,NAICS_2012_Code,56149,, +BTS_TSA,561,NAICS_2012_Code,561491,, +BTS_TSA,561,NAICS_2012_Code,561492,, +BTS_TSA,561,NAICS_2012_Code,561499,, +BTS_TSA,561,NAICS_2012_Code,5615,, +BTS_TSA,561,NAICS_2012_Code,56151,, +BTS_TSA,561,NAICS_2012_Code,561510,, +BTS_TSA,561,NAICS_2012_Code,56152,, +BTS_TSA,561,NAICS_2012_Code,561520,, +BTS_TSA,561,NAICS_2012_Code,56159,, +BTS_TSA,561,NAICS_2012_Code,561591,, +BTS_TSA,561,NAICS_2012_Code,561599,, +BTS_TSA,561,NAICS_2012_Code,5616,, +BTS_TSA,561,NAICS_2012_Code,56161,, +BTS_TSA,561,NAICS_2012_Code,561611,, +BTS_TSA,561,NAICS_2012_Code,561612,, +BTS_TSA,561,NAICS_2012_Code,561613,, +BTS_TSA,561,NAICS_2012_Code,56162,, +BTS_TSA,561,NAICS_2012_Code,561621,, +BTS_TSA,561,NAICS_2012_Code,561622,, +BTS_TSA,561,NAICS_2012_Code,5617,, +BTS_TSA,561,NAICS_2012_Code,56171,, +BTS_TSA,561,NAICS_2012_Code,561710,, +BTS_TSA,561,NAICS_2012_Code,56172,, +BTS_TSA,561,NAICS_2012_Code,561720,, +BTS_TSA,561,NAICS_2012_Code,56173,, +BTS_TSA,561,NAICS_2012_Code,561730,, +BTS_TSA,561,NAICS_2012_Code,56174,, +BTS_TSA,561,NAICS_2012_Code,561740,, +BTS_TSA,561,NAICS_2012_Code,56179,, +BTS_TSA,561,NAICS_2012_Code,561790,, +BTS_TSA,561,NAICS_2012_Code,5619,, +BTS_TSA,561,NAICS_2012_Code,56191,, +BTS_TSA,561,NAICS_2012_Code,561910,, +BTS_TSA,561,NAICS_2012_Code,56192,, +BTS_TSA,561,NAICS_2012_Code,561920,, +BTS_TSA,561,NAICS_2012_Code,56199,, +BTS_TSA,561,NAICS_2012_Code,561990,, +BTS_TSA,562,NAICS_2012_Code,562,, +BTS_TSA,562,NAICS_2012_Code,5621,, +BTS_TSA,562,NAICS_2012_Code,56211,, +BTS_TSA,562,NAICS_2012_Code,562111,, +BTS_TSA,562,NAICS_2012_Code,562112,, +BTS_TSA,562,NAICS_2012_Code,562119,, +BTS_TSA,562,NAICS_2012_Code,5622,, +BTS_TSA,562,NAICS_2012_Code,56221,, +BTS_TSA,562,NAICS_2012_Code,562211,, +BTS_TSA,562,NAICS_2012_Code,562212,, +BTS_TSA,562,NAICS_2012_Code,562213,, +BTS_TSA,562,NAICS_2012_Code,562219,, +BTS_TSA,562,NAICS_2012_Code,5629,, +BTS_TSA,562,NAICS_2012_Code,56291,, +BTS_TSA,562,NAICS_2012_Code,562910,, +BTS_TSA,562,NAICS_2012_Code,56292,, +BTS_TSA,562,NAICS_2012_Code,562920,, +BTS_TSA,562,NAICS_2012_Code,56299,, +BTS_TSA,562,NAICS_2012_Code,562991,, +BTS_TSA,562,NAICS_2012_Code,562998,, +BTS_TSA,61,NAICS_2012_Code,61,, +BTS_TSA,61,NAICS_2012_Code,611,, +BTS_TSA,61,NAICS_2012_Code,6111,, +BTS_TSA,61,NAICS_2012_Code,61111,, +BTS_TSA,61,NAICS_2012_Code,611110,, +BTS_TSA,61,NAICS_2012_Code,6112,, +BTS_TSA,61,NAICS_2012_Code,61121,, +BTS_TSA,61,NAICS_2012_Code,611210,, +BTS_TSA,61,NAICS_2012_Code,6113,, +BTS_TSA,61,NAICS_2012_Code,61131,, +BTS_TSA,61,NAICS_2012_Code,611310,, +BTS_TSA,61,NAICS_2012_Code,6114,, +BTS_TSA,61,NAICS_2012_Code,61141,, +BTS_TSA,61,NAICS_2012_Code,611410,, +BTS_TSA,61,NAICS_2012_Code,61142,, +BTS_TSA,61,NAICS_2012_Code,611420,, +BTS_TSA,61,NAICS_2012_Code,61143,, +BTS_TSA,61,NAICS_2012_Code,611430,, +BTS_TSA,61,NAICS_2012_Code,6115,, +BTS_TSA,61,NAICS_2012_Code,61151,, +BTS_TSA,61,NAICS_2012_Code,611511,, +BTS_TSA,61,NAICS_2012_Code,611512,, +BTS_TSA,61,NAICS_2012_Code,611513,, +BTS_TSA,61,NAICS_2012_Code,611519,, +BTS_TSA,61,NAICS_2012_Code,6116,, +BTS_TSA,61,NAICS_2012_Code,61161,, +BTS_TSA,61,NAICS_2012_Code,611610,, +BTS_TSA,61,NAICS_2012_Code,61162,, +BTS_TSA,61,NAICS_2012_Code,611620,, +BTS_TSA,61,NAICS_2012_Code,61163,, +BTS_TSA,61,NAICS_2012_Code,611630,, +BTS_TSA,61,NAICS_2012_Code,61169,, +BTS_TSA,61,NAICS_2012_Code,611691,, +BTS_TSA,61,NAICS_2012_Code,611692,, +BTS_TSA,61,NAICS_2012_Code,611699,, +BTS_TSA,61,NAICS_2012_Code,6117,, +BTS_TSA,61,NAICS_2012_Code,61171,, +BTS_TSA,61,NAICS_2012_Code,611710,, +BTS_TSA,621,NAICS_2012_Code,62,, +BTS_TSA,622,NAICS_2012_Code,62,, +BTS_TSA,623,NAICS_2012_Code,62,, +BTS_TSA,624,NAICS_2012_Code,62,, +BTS_TSA,621,NAICS_2012_Code,621,, +BTS_TSA,621,NAICS_2012_Code,6211,, +BTS_TSA,621,NAICS_2012_Code,62111,, +BTS_TSA,621,NAICS_2012_Code,621111,, +BTS_TSA,621,NAICS_2012_Code,621112,, +BTS_TSA,621,NAICS_2012_Code,6212,, +BTS_TSA,621,NAICS_2012_Code,62121,, +BTS_TSA,621,NAICS_2012_Code,621210,, +BTS_TSA,621,NAICS_2012_Code,6213,, +BTS_TSA,621,NAICS_2012_Code,62131,, +BTS_TSA,621,NAICS_2012_Code,621310,, +BTS_TSA,621,NAICS_2012_Code,62132,, +BTS_TSA,621,NAICS_2012_Code,621320,, +BTS_TSA,621,NAICS_2012_Code,62133,, +BTS_TSA,621,NAICS_2012_Code,621330,, +BTS_TSA,621,NAICS_2012_Code,62134,, +BTS_TSA,621,NAICS_2012_Code,621340,, +BTS_TSA,621,NAICS_2012_Code,62139,, +BTS_TSA,621,NAICS_2012_Code,621391,, +BTS_TSA,621,NAICS_2012_Code,621399,, +BTS_TSA,621,NAICS_2012_Code,6214,, +BTS_TSA,621,NAICS_2012_Code,62141,, +BTS_TSA,621,NAICS_2012_Code,621410,, +BTS_TSA,621,NAICS_2012_Code,62142,, +BTS_TSA,621,NAICS_2012_Code,621420,, +BTS_TSA,621,NAICS_2012_Code,62149,, +BTS_TSA,621,NAICS_2012_Code,621491,, +BTS_TSA,621,NAICS_2012_Code,621492,, +BTS_TSA,621,NAICS_2012_Code,621493,, +BTS_TSA,621,NAICS_2012_Code,621498,, +BTS_TSA,621,NAICS_2012_Code,6215,, +BTS_TSA,621,NAICS_2012_Code,62151,, +BTS_TSA,621,NAICS_2012_Code,621511,, +BTS_TSA,621,NAICS_2012_Code,621512,, +BTS_TSA,621,NAICS_2012_Code,6216,, +BTS_TSA,621,NAICS_2012_Code,62161,, +BTS_TSA,621,NAICS_2012_Code,621610,, +BTS_TSA,621,NAICS_2012_Code,6219,, +BTS_TSA,621,NAICS_2012_Code,62191,, +BTS_TSA,621,NAICS_2012_Code,621910,, +BTS_TSA,621,NAICS_2012_Code,62199,, +BTS_TSA,621,NAICS_2012_Code,621991,, +BTS_TSA,621,NAICS_2012_Code,621999,, +BTS_TSA,622,NAICS_2012_Code,622,, +BTS_TSA,622,NAICS_2012_Code,6221,, +BTS_TSA,622,NAICS_2012_Code,62211,, +BTS_TSA,622,NAICS_2012_Code,622110,, +BTS_TSA,622,NAICS_2012_Code,6222,, +BTS_TSA,622,NAICS_2012_Code,62221,, +BTS_TSA,622,NAICS_2012_Code,622210,, +BTS_TSA,622,NAICS_2012_Code,6223,, +BTS_TSA,622,NAICS_2012_Code,62231,, +BTS_TSA,622,NAICS_2012_Code,622310,, +BTS_TSA,623,NAICS_2012_Code,623,, +BTS_TSA,623,NAICS_2012_Code,6231,, +BTS_TSA,623,NAICS_2012_Code,62311,, +BTS_TSA,623,NAICS_2012_Code,623110,, +BTS_TSA,623,NAICS_2012_Code,6232,, +BTS_TSA,623,NAICS_2012_Code,62321,, +BTS_TSA,623,NAICS_2012_Code,623210,, +BTS_TSA,623,NAICS_2012_Code,62322,, +BTS_TSA,623,NAICS_2012_Code,623220,, +BTS_TSA,623,NAICS_2012_Code,6233,, +BTS_TSA,623,NAICS_2012_Code,62331,, +BTS_TSA,623,NAICS_2012_Code,623311,, +BTS_TSA,623,NAICS_2012_Code,623312,, +BTS_TSA,623,NAICS_2012_Code,6239,, +BTS_TSA,623,NAICS_2012_Code,62399,, +BTS_TSA,623,NAICS_2012_Code,623990,, +BTS_TSA,624,NAICS_2012_Code,624,, +BTS_TSA,624,NAICS_2012_Code,6241,, +BTS_TSA,624,NAICS_2012_Code,62411,, +BTS_TSA,624,NAICS_2012_Code,624110,, +BTS_TSA,624,NAICS_2012_Code,62412,, +BTS_TSA,624,NAICS_2012_Code,624120,, +BTS_TSA,624,NAICS_2012_Code,62419,, +BTS_TSA,624,NAICS_2012_Code,624190,, +BTS_TSA,624,NAICS_2012_Code,6242,, +BTS_TSA,624,NAICS_2012_Code,62421,, +BTS_TSA,624,NAICS_2012_Code,624210,, +BTS_TSA,624,NAICS_2012_Code,62422,, +BTS_TSA,624,NAICS_2012_Code,624221,, +BTS_TSA,624,NAICS_2012_Code,624229,, +BTS_TSA,624,NAICS_2012_Code,62423,, +BTS_TSA,624,NAICS_2012_Code,624230,, +BTS_TSA,624,NAICS_2012_Code,6243,, +BTS_TSA,624,NAICS_2012_Code,62431,, +BTS_TSA,624,NAICS_2012_Code,624310,, +BTS_TSA,624,NAICS_2012_Code,6244,, +BTS_TSA,624,NAICS_2012_Code,62441,, +BTS_TSA,624,NAICS_2012_Code,624410,, +BTS_TSA,711AS,NAICS_2012_Code,71,, +BTS_TSA,713,NAICS_2012_Code,71,, +BTS_TSA,711AS,NAICS_2012_Code,711,, +BTS_TSA,711AS,NAICS_2012_Code,7111,, +BTS_TSA,711AS,NAICS_2012_Code,71111,, +BTS_TSA,711AS,NAICS_2012_Code,711110,, +BTS_TSA,711AS,NAICS_2012_Code,71112,, +BTS_TSA,711AS,NAICS_2012_Code,711120,, +BTS_TSA,711AS,NAICS_2012_Code,71113,, +BTS_TSA,711AS,NAICS_2012_Code,711130,, +BTS_TSA,711AS,NAICS_2012_Code,71119,, +BTS_TSA,711AS,NAICS_2012_Code,711190,, +BTS_TSA,711AS,NAICS_2012_Code,7112,, +BTS_TSA,711AS,NAICS_2012_Code,71121,, +BTS_TSA,711AS,NAICS_2012_Code,711211,, +BTS_TSA,711AS,NAICS_2012_Code,711212,, +BTS_TSA,711AS,NAICS_2012_Code,711219,, +BTS_TSA,711AS,NAICS_2012_Code,7113,, +BTS_TSA,711AS,NAICS_2012_Code,71131,, +BTS_TSA,711AS,NAICS_2012_Code,711310,, +BTS_TSA,711AS,NAICS_2012_Code,71132,, +BTS_TSA,711AS,NAICS_2012_Code,711320,, +BTS_TSA,711AS,NAICS_2012_Code,7114,, +BTS_TSA,711AS,NAICS_2012_Code,71141,, +BTS_TSA,711AS,NAICS_2012_Code,711410,, +BTS_TSA,711AS,NAICS_2012_Code,7115,, +BTS_TSA,711AS,NAICS_2012_Code,71151,, +BTS_TSA,711AS,NAICS_2012_Code,711510,, +BTS_TSA,711AS,NAICS_2012_Code,712,, +BTS_TSA,711AS,NAICS_2012_Code,7121,, +BTS_TSA,711AS,NAICS_2012_Code,71211,, +BTS_TSA,711AS,NAICS_2012_Code,712110,, +BTS_TSA,711AS,NAICS_2012_Code,71212,, +BTS_TSA,711AS,NAICS_2012_Code,712120,, +BTS_TSA,711AS,NAICS_2012_Code,71213,, +BTS_TSA,711AS,NAICS_2012_Code,712130,, +BTS_TSA,711AS,NAICS_2012_Code,71219,, +BTS_TSA,711AS,NAICS_2012_Code,712190,, +BTS_TSA,713,NAICS_2012_Code,713,, +BTS_TSA,713,NAICS_2012_Code,7131,, +BTS_TSA,713,NAICS_2012_Code,71311,, +BTS_TSA,713,NAICS_2012_Code,713110,, +BTS_TSA,713,NAICS_2012_Code,71312,, +BTS_TSA,713,NAICS_2012_Code,713120,, +BTS_TSA,713,NAICS_2012_Code,7132,, +BTS_TSA,713,NAICS_2012_Code,71321,, +BTS_TSA,713,NAICS_2012_Code,713210,, +BTS_TSA,713,NAICS_2012_Code,71329,, +BTS_TSA,713,NAICS_2012_Code,713290,, +BTS_TSA,713,NAICS_2012_Code,7139,, +BTS_TSA,713,NAICS_2012_Code,71391,, +BTS_TSA,713,NAICS_2012_Code,713910,, +BTS_TSA,713,NAICS_2012_Code,71392,, +BTS_TSA,713,NAICS_2012_Code,713920,, +BTS_TSA,713,NAICS_2012_Code,71393,, +BTS_TSA,713,NAICS_2012_Code,713930,, +BTS_TSA,713,NAICS_2012_Code,71394,, +BTS_TSA,713,NAICS_2012_Code,713940,, +BTS_TSA,713,NAICS_2012_Code,71395,, +BTS_TSA,713,NAICS_2012_Code,713950,, +BTS_TSA,713,NAICS_2012_Code,71399,, +BTS_TSA,713,NAICS_2012_Code,713990,, +BTS_TSA,721,NAICS_2012_Code,72,, +BTS_TSA,722,NAICS_2012_Code,72,, +BTS_TSA,721,NAICS_2012_Code,721,, +BTS_TSA,721,NAICS_2012_Code,7211,, +BTS_TSA,721,NAICS_2012_Code,72111,, +BTS_TSA,721,NAICS_2012_Code,721110,, +BTS_TSA,721,NAICS_2012_Code,72112,, +BTS_TSA,721,NAICS_2012_Code,721120,, +BTS_TSA,721,NAICS_2012_Code,72119,, +BTS_TSA,721,NAICS_2012_Code,721191,, +BTS_TSA,721,NAICS_2012_Code,721199,, +BTS_TSA,721,NAICS_2012_Code,7212,, +BTS_TSA,721,NAICS_2012_Code,72121,, +BTS_TSA,721,NAICS_2012_Code,721211,, +BTS_TSA,721,NAICS_2012_Code,721214,, +BTS_TSA,721,NAICS_2012_Code,7213,, +BTS_TSA,721,NAICS_2012_Code,72131,, +BTS_TSA,721,NAICS_2012_Code,721310,, +BTS_TSA,722,NAICS_2012_Code,722,, +BTS_TSA,722,NAICS_2012_Code,7223,, +BTS_TSA,722,NAICS_2012_Code,72231,, +BTS_TSA,722,NAICS_2012_Code,722310,, +BTS_TSA,722,NAICS_2012_Code,72232,, +BTS_TSA,722,NAICS_2012_Code,722320,, +BTS_TSA,722,NAICS_2012_Code,72233,, +BTS_TSA,722,NAICS_2012_Code,722330,, +BTS_TSA,722,NAICS_2012_Code,7224,, +BTS_TSA,722,NAICS_2012_Code,72241,, +BTS_TSA,722,NAICS_2012_Code,722410,, +BTS_TSA,722,NAICS_2012_Code,7225,, +BTS_TSA,722,NAICS_2012_Code,72251,, +BTS_TSA,722,NAICS_2012_Code,722511,, +BTS_TSA,722,NAICS_2012_Code,722513,, +BTS_TSA,722,NAICS_2012_Code,722514,, +BTS_TSA,722,NAICS_2012_Code,722515,, +BTS_TSA,81,NAICS_2012_Code,81,, +BTS_TSA,81,NAICS_2012_Code,811,, +BTS_TSA,81,NAICS_2012_Code,8111,, +BTS_TSA,81,NAICS_2012_Code,81111,, +BTS_TSA,81,NAICS_2012_Code,811111,, +BTS_TSA,81,NAICS_2012_Code,811112,, +BTS_TSA,81,NAICS_2012_Code,811113,, +BTS_TSA,81,NAICS_2012_Code,811118,, +BTS_TSA,81,NAICS_2012_Code,81112,, +BTS_TSA,81,NAICS_2012_Code,811121,, +BTS_TSA,81,NAICS_2012_Code,811122,, +BTS_TSA,81,NAICS_2012_Code,81119,, +BTS_TSA,81,NAICS_2012_Code,811191,, +BTS_TSA,81,NAICS_2012_Code,811192,, +BTS_TSA,81,NAICS_2012_Code,811198,, +BTS_TSA,81,NAICS_2012_Code,8112,, +BTS_TSA,81,NAICS_2012_Code,81121,, +BTS_TSA,81,NAICS_2012_Code,811211,, +BTS_TSA,81,NAICS_2012_Code,811212,, +BTS_TSA,81,NAICS_2012_Code,811213,, +BTS_TSA,81,NAICS_2012_Code,811219,, +BTS_TSA,81,NAICS_2012_Code,8113,, +BTS_TSA,81,NAICS_2012_Code,81131,, +BTS_TSA,81,NAICS_2012_Code,811310,, +BTS_TSA,81,NAICS_2012_Code,8114,, +BTS_TSA,81,NAICS_2012_Code,81141,, +BTS_TSA,81,NAICS_2012_Code,811411,, +BTS_TSA,81,NAICS_2012_Code,811412,, +BTS_TSA,81,NAICS_2012_Code,81142,, +BTS_TSA,81,NAICS_2012_Code,811420,, +BTS_TSA,81,NAICS_2012_Code,81143,, +BTS_TSA,81,NAICS_2012_Code,811430,, +BTS_TSA,81,NAICS_2012_Code,81149,, +BTS_TSA,81,NAICS_2012_Code,811490,, +BTS_TSA,81,NAICS_2012_Code,812,, +BTS_TSA,81,NAICS_2012_Code,8121,, +BTS_TSA,81,NAICS_2012_Code,81211,, +BTS_TSA,81,NAICS_2012_Code,812111,, +BTS_TSA,81,NAICS_2012_Code,812112,, +BTS_TSA,81,NAICS_2012_Code,812113,, +BTS_TSA,81,NAICS_2012_Code,81219,, +BTS_TSA,81,NAICS_2012_Code,812191,, +BTS_TSA,81,NAICS_2012_Code,812199,, +BTS_TSA,81,NAICS_2012_Code,8122,, +BTS_TSA,81,NAICS_2012_Code,81221,, +BTS_TSA,81,NAICS_2012_Code,812210,, +BTS_TSA,81,NAICS_2012_Code,81222,, +BTS_TSA,81,NAICS_2012_Code,812220,, +BTS_TSA,81,NAICS_2012_Code,8123,, +BTS_TSA,81,NAICS_2012_Code,81231,, +BTS_TSA,81,NAICS_2012_Code,812310,, +BTS_TSA,81,NAICS_2012_Code,81232,, +BTS_TSA,81,NAICS_2012_Code,812320,, +BTS_TSA,81,NAICS_2012_Code,81233,, +BTS_TSA,81,NAICS_2012_Code,812331,, +BTS_TSA,81,NAICS_2012_Code,812332,, +BTS_TSA,81,NAICS_2012_Code,8129,, +BTS_TSA,81,NAICS_2012_Code,81291,, +BTS_TSA,81,NAICS_2012_Code,812910,, +BTS_TSA,81,NAICS_2012_Code,81292,, +BTS_TSA,81,NAICS_2012_Code,812921,, +BTS_TSA,81,NAICS_2012_Code,812922,, +BTS_TSA,81,NAICS_2012_Code,81293,, +BTS_TSA,81,NAICS_2012_Code,812930,, +BTS_TSA,81,NAICS_2012_Code,81299,, +BTS_TSA,81,NAICS_2012_Code,812990,, +BTS_TSA,81,NAICS_2012_Code,813,, +BTS_TSA,81,NAICS_2012_Code,8131,, +BTS_TSA,81,NAICS_2012_Code,81311,, +BTS_TSA,81,NAICS_2012_Code,813110,, +BTS_TSA,81,NAICS_2012_Code,8132,, +BTS_TSA,81,NAICS_2012_Code,81321,, +BTS_TSA,81,NAICS_2012_Code,813211,, +BTS_TSA,81,NAICS_2012_Code,813212,, +BTS_TSA,81,NAICS_2012_Code,813219,, +BTS_TSA,81,NAICS_2012_Code,8133,, +BTS_TSA,81,NAICS_2012_Code,81331,, +BTS_TSA,81,NAICS_2012_Code,813311,, +BTS_TSA,81,NAICS_2012_Code,813312,, +BTS_TSA,81,NAICS_2012_Code,813319,, +BTS_TSA,81,NAICS_2012_Code,8134,, +BTS_TSA,81,NAICS_2012_Code,81341,, +BTS_TSA,81,NAICS_2012_Code,813410,, +BTS_TSA,81,NAICS_2012_Code,8139,, +BTS_TSA,81,NAICS_2012_Code,81391,, +BTS_TSA,81,NAICS_2012_Code,813910,, +BTS_TSA,81,NAICS_2012_Code,81392,, +BTS_TSA,81,NAICS_2012_Code,813920,, +BTS_TSA,81,NAICS_2012_Code,81393,, +BTS_TSA,81,NAICS_2012_Code,813930,, +BTS_TSA,81,NAICS_2012_Code,81394,, +BTS_TSA,81,NAICS_2012_Code,813940,, +BTS_TSA,81,NAICS_2012_Code,81399,, +BTS_TSA,81,NAICS_2012_Code,813990,, +BTS_TSA,81,NAICS_2012_Code,814,, +BTS_TSA,81,NAICS_2012_Code,8141,, +BTS_TSA,81,NAICS_2012_Code,81411,, +BTS_TSA,81,NAICS_2012_Code,814110,, +BTS_TSA,GSLG,NAICS_2012_Code,92,, +BTS_TSA,GFE,NAICS_2012_Code,92,, +BTS_TSA,GSLE,NAICS_2012_Code,92,, +BTS_TSA,GFGD,NAICS_2012_Code,92,, +BTS_TSA,GFGN,NAICS_2012_Code,92,, +BTS_TSA,GSLG,NAICS_2012_Code,921,, +BTS_TSA,GFGN,NAICS_2012_Code,921,, +BTS_TSA,GSLG,NAICS_2012_Code,9211,, +BTS_TSA,GFGN,NAICS_2012_Code,9211,, +BTS_TSA,GSLG,NAICS_2012_Code,92111,, +BTS_TSA,GFGN,NAICS_2012_Code,92111,, +BTS_TSA,GSLG,NAICS_2012_Code,921110,, +BTS_TSA,GFGN,NAICS_2012_Code,921110,, +BTS_TSA,GSLG,NAICS_2012_Code,92112,, +BTS_TSA,GFGN,NAICS_2012_Code,92112,, +BTS_TSA,GSLG,NAICS_2012_Code,921120,, +BTS_TSA,GFGN,NAICS_2012_Code,921120,, +BTS_TSA,GSLG,NAICS_2012_Code,92113,, +BTS_TSA,GFGN,NAICS_2012_Code,92113,, +BTS_TSA,GSLG,NAICS_2012_Code,921130,, +BTS_TSA,GFGN,NAICS_2012_Code,921130,, +BTS_TSA,GSLG,NAICS_2012_Code,92114,, +BTS_TSA,GFGN,NAICS_2012_Code,92114,, +BTS_TSA,GSLG,NAICS_2012_Code,921140,, +BTS_TSA,GFGN,NAICS_2012_Code,921140,, +BTS_TSA,GSLG,NAICS_2012_Code,92115,, +BTS_TSA,GSLG,NAICS_2012_Code,921150,, +BTS_TSA,GSLG,NAICS_2012_Code,92119,, +BTS_TSA,GFGN,NAICS_2012_Code,92119,, +BTS_TSA,GSLG,NAICS_2012_Code,921190,, +BTS_TSA,GFGN,NAICS_2012_Code,921190,, +BTS_TSA,GSLG,NAICS_2012_Code,922,, +BTS_TSA,GSLE,NAICS_2012_Code,922,, +BTS_TSA,GFGN,NAICS_2012_Code,922,, +BTS_TSA,GSLG,NAICS_2012_Code,9221,, +BTS_TSA,GFE,NAICS_2012_Code,9221,, +BTS_TSA,GSLE,NAICS_2012_Code,9221,, +BTS_TSA,GFGN,NAICS_2012_Code,9221,, +BTS_TSA,GSLG,NAICS_2012_Code,92211,, +BTS_TSA,GFGN,NAICS_2012_Code,92211,, +BTS_TSA,GSLG,NAICS_2012_Code,922110,, +BTS_TSA,GFGN,NAICS_2012_Code,922110,, +BTS_TSA,GSLG,NAICS_2012_Code,92212,, +BTS_TSA,GFE,NAICS_2012_Code,92212,, +BTS_TSA,GSLE,NAICS_2012_Code,92212,, +BTS_TSA,GFGN,NAICS_2012_Code,92212,, +BTS_TSA,GSLG,NAICS_2012_Code,922120,, +BTS_TSA,GFGN,NAICS_2012_Code,922120,, +BTS_TSA,GSLG,NAICS_2012_Code,92213,, +BTS_TSA,GFGN,NAICS_2012_Code,92213,, +BTS_TSA,GSLG,NAICS_2012_Code,922130,, +BTS_TSA,GFGN,NAICS_2012_Code,922130,, +BTS_TSA,GSLG,NAICS_2012_Code,92214,, +BTS_TSA,GFE,NAICS_2012_Code,92214,, +BTS_TSA,GSLE,NAICS_2012_Code,92214,, +BTS_TSA,GFGN,NAICS_2012_Code,92214,, +BTS_TSA,GSLG,NAICS_2012_Code,922140,, +BTS_TSA,GFGN,NAICS_2012_Code,922140,, +BTS_TSA,GSLG,NAICS_2012_Code,92215,, +BTS_TSA,GFGN,NAICS_2012_Code,92215,, +BTS_TSA,GSLG,NAICS_2012_Code,922150,, +BTS_TSA,GFGN,NAICS_2012_Code,922150,, +BTS_TSA,GSLG,NAICS_2012_Code,92216,, +BTS_TSA,GSLE,NAICS_2012_Code,92216,, +BTS_TSA,GSLG,NAICS_2012_Code,922160,, +BTS_TSA,GFGN,NAICS_2012_Code,922160,, +BTS_TSA,GSLG,NAICS_2012_Code,92219,, +BTS_TSA,GFGN,NAICS_2012_Code,92219,, +BTS_TSA,GSLG,NAICS_2012_Code,922190,, +BTS_TSA,GFGN,NAICS_2012_Code,922190,, +BTS_TSA,GSLG,NAICS_2012_Code,923,, +BTS_TSA,GFGN,NAICS_2012_Code,923,, +BTS_TSA,GSLG,NAICS_2012_Code,9231,, +BTS_TSA,GFGN,NAICS_2012_Code,9231,, +BTS_TSA,GSLG,NAICS_2012_Code,92311,, +BTS_TSA,GFGN,NAICS_2012_Code,92311,, +BTS_TSA,GSLG,NAICS_2012_Code,923110,, +BTS_TSA,GFGN,NAICS_2012_Code,923110,, +BTS_TSA,GSLG,NAICS_2012_Code,92312,, +BTS_TSA,GFGN,NAICS_2012_Code,92312,, +BTS_TSA,GSLG,NAICS_2012_Code,923120,, +BTS_TSA,GFGN,NAICS_2012_Code,923120,, +BTS_TSA,GSLG,NAICS_2012_Code,92313,, +BTS_TSA,GFGN,NAICS_2012_Code,92313,, +BTS_TSA,GSLG,NAICS_2012_Code,923130,, +BTS_TSA,GFGN,NAICS_2012_Code,923130,, +BTS_TSA,GFGN,NAICS_2012_Code,92314,, +BTS_TSA,GFGN,NAICS_2012_Code,923140,, +BTS_TSA,GSLG,NAICS_2012_Code,924,, +BTS_TSA,GFGN,NAICS_2012_Code,924,, +BTS_TSA,GSLG,NAICS_2012_Code,9241,, +BTS_TSA,GFGN,NAICS_2012_Code,9241,, +BTS_TSA,GSLG,NAICS_2012_Code,92411,, +BTS_TSA,GFGN,NAICS_2012_Code,92411,, +BTS_TSA,GSLG,NAICS_2012_Code,924110,, +BTS_TSA,GFGN,NAICS_2012_Code,924110,, +BTS_TSA,GSLG,NAICS_2012_Code,92412,, +BTS_TSA,GFGN,NAICS_2012_Code,92412,, +BTS_TSA,GSLG,NAICS_2012_Code,924120,, +BTS_TSA,GFGN,NAICS_2012_Code,924120,, +BTS_TSA,GSLG,NAICS_2012_Code,925,, +BTS_TSA,GFGN,NAICS_2012_Code,925,, +BTS_TSA,GSLG,NAICS_2012_Code,9251,, +BTS_TSA,GFGN,NAICS_2012_Code,9251,, +BTS_TSA,GSLG,NAICS_2012_Code,92511,, +BTS_TSA,GFGN,NAICS_2012_Code,92511,, +BTS_TSA,GSLG,NAICS_2012_Code,925110,, +BTS_TSA,GFGN,NAICS_2012_Code,925110,, +BTS_TSA,GSLG,NAICS_2012_Code,92512,, +BTS_TSA,GFGN,NAICS_2012_Code,92512,, +BTS_TSA,GSLG,NAICS_2012_Code,925120,, +BTS_TSA,GFGN,NAICS_2012_Code,925120,, +BTS_TSA,GSLG,NAICS_2012_Code,926,, +BTS_TSA,GFGN,NAICS_2012_Code,926,, +BTS_TSA,GSLG,NAICS_2012_Code,9261,, +BTS_TSA,GFGN,NAICS_2012_Code,9261,, +BTS_TSA,GSLG,NAICS_2012_Code,92611,, +BTS_TSA,GFGN,NAICS_2012_Code,92611,, +BTS_TSA,GSLG,NAICS_2012_Code,926110,, +BTS_TSA,GFGN,NAICS_2012_Code,926110,, +BTS_TSA,GFGN,NAICS_2012_Code,92612,, +BTS_TSA,GSLG,NAICS_2012_Code,926120,, +BTS_TSA,GSLG,NAICS_2012_Code,92613,, +BTS_TSA,GFGN,NAICS_2012_Code,92613,, +BTS_TSA,GSLG,NAICS_2012_Code,926130,, +BTS_TSA,GFGN,NAICS_2012_Code,926130,, +BTS_TSA,GSLG,NAICS_2012_Code,92614,, +BTS_TSA,GFGN,NAICS_2012_Code,92614,, +BTS_TSA,GSLG,NAICS_2012_Code,926140,, +BTS_TSA,GFGN,NAICS_2012_Code,926140,, +BTS_TSA,GSLG,NAICS_2012_Code,92615,, +BTS_TSA,GFGN,NAICS_2012_Code,92615,, +BTS_TSA,GSLG,NAICS_2012_Code,926150,, +BTS_TSA,GFGN,NAICS_2012_Code,926150,, +BTS_TSA,GFE,NAICS_2012_Code,927,, +BTS_TSA,GFE,NAICS_2012_Code,9271,, +BTS_TSA,GFE,NAICS_2012_Code,92711,, +BTS_TSA,GFE,NAICS_2012_Code,927110,, +BTS_TSA,GFGD,NAICS_2012_Code,928,, +BTS_TSA,GFGN,NAICS_2012_Code,928,, +BTS_TSA,GFGD,NAICS_2012_Code,9281,, +BTS_TSA,GFGN,NAICS_2012_Code,9281,, +BTS_TSA,GFGD,NAICS_2012_Code,92811,, +BTS_TSA,GFGD,NAICS_2012_Code,928110,, +BTS_TSA,GFGN,NAICS_2012_Code,92812,, +BTS_TSA,GFGN,NAICS_2012_Code,928120,, +BTS_TSA,F010,NAICS_2012_Code,F010,, +BTS_TSA,F010,NAICS_2012_Code,F01000,, +BTS_TSA,GFE,NAICS_2012_Code,S00101,, +BTS_TSA,GSLE,NAICS_2012_Code,S00201,, +BTS_TSA,GSLE,NAICS_2012_Code,S00202,, diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_trucking.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_trucking.csv new file mode 100644 index 000000000..75a744637 --- /dev/null +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_trucking.csv @@ -0,0 +1,132 @@ +ActivitySourceName,Activity,SectorSourceName,Sector,SectorType,Notes,Table +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,22,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,48,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,49,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,22,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,48,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,49,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +,,,,,, +EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,484,,484000,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,92212,,S00203,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,92214,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,92216,,,EPA_GHGI_T_A_79 From 3a5571c1a579a7a148b38a4978b35e2c84ef2cd6 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 24 Jun 2022 10:27:18 -0400 Subject: [PATCH 0123/1127] Added location code to BTS_TSA FBA generating script --- flowsa/data_source_scripts/BTS_TSA.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/data_source_scripts/BTS_TSA.py b/flowsa/data_source_scripts/BTS_TSA.py index 0978e9126..c81ea3441 100644 --- a/flowsa/data_source_scripts/BTS_TSA.py +++ b/flowsa/data_source_scripts/BTS_TSA.py @@ -63,7 +63,7 @@ def tsa_parse(*, df_list, source, year, config, **_): df['FlowType'] = 'TECHNOSPHERE_FLOW' # df['ActivityConsumedBy'] = '' # df['Compartment'] = '' # ??? - # df['Location'] = '' + df['Location'] = '00000' # df['LocationSystem'] = '' # df['MeasureofSpread'] = '' df['DataReliability'] = 3 # temp From fa8411320be4052e9800861696b098101fba095f Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 24 Jun 2022 14:06:03 -0400 Subject: [PATCH 0124/1127] Added Mobile Sources N2O and CH4 --- .../flowbysectormethods/SEEA_2017_v1.yaml | 94 +++++++++++-------- 1 file changed, 54 insertions(+), 40 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index 67d4cae36..d404849fa 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -291,11 +291,9 @@ source_names: selection_fields: PrimaryActivity: - Passenger Cars Gasoline On-Road - # - Light-Duty Trucks Gasoline On-Road - Rail Non-Road - Ships and Boats Non-Road - Aircraft Non-Road - # - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road attribution_method: direct trucking: @@ -303,48 +301,64 @@ source_names: PrimaryActivity: - Light-Duty Trucks Gasoline On-Road - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road + activity_to_sector_mapping: EPA_GHGI_trucking attribution_method: proportional attribution_source: - BTS_TSA + BTS_TSA: + year: 2017 + selection_fields: + Description: + - In-house truck transportation + - For-hire truck transportation + activity_to_sector_mapping: BTS_TSA + attribution_method: proportional + attribution_source: + BLS_QCEW: + selection_fields: + Class: Employment + year: 2012 + clean_fba: !script_function:temp_data_source_functions clean_qcew - # construction_and_mining: - # selection_fields: - # PrimaryActivity: Construction/Mining Equipment Non-Road - # attribution_method: proportional - # attribution_source: - # BEA_Use_Detail_PRO_BeforeRedef: - # <<: *bea_use - # selection_fields: - # ActivityProducedBy: '333120' # purchases of construction/mining equipment + construction_and_mining: + selection_fields: + PrimaryActivity: Construction/Mining Equipment Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333120' # purchases of construction/mining equipment - # farm_non_road: - # selection_fields: - # PrimaryActivity: Agricultural Equipment Non-Road - # attribution_method: proportional - # attribution_source: - # BEA_Use_Detail_PRO_BeforeRedef: - # <<: *bea_use - # selection_fields: - # ActivityProducedBy: '333111' # purchases of farm machinery + farm_non_road: + selection_fields: + PrimaryActivity: Agricultural Equipment Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333111' # purchases of farm machinery - # other_non_road: # attributed by purchases of petroleum refinery products - # selection_fields: - # PrimaryActivity: Other Non-Road - # attribution_method: proportional - # attribution_source: - # BEA_Use_Detail_PRO_BeforeRedef: - # <<: *bea_use - # selection_fields: - # ActivityProducedBy: '324110' # purchases of refinery products + other_non_road: # attributed by purchases of petroleum refinery products + selection_fields: + PrimaryActivity: Other Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # purchases of refinery products - # alt_fuel_on_road: # assumes natural gas is primary alternate fuel - # selection_fields: - # PrimaryActivity: Alternative Fuel On-Road - # attribution_method: proportional - # attribution_source: - # BEA_Use_Detail_PRO_BeforeRedef: - # <<: *bea_use - # selection_fields: - # ActivityProducedBy: '221200' # purchases of natural gas + alt_fuel_on_road: # assumes natural gas is primary alternate fuel + selection_fields: + PrimaryActivity: + - Alternative Fuel On-Road + - All activities Alternative Fuel On-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '221200' # purchases of natural gas - # "EPA_GHGI_T_3_15": *mobile #N2O from mobile combustion duplicates method for CH4 + "EPA_GHGI_T_3_15": *mobile #N2O from mobile combustion duplicates method for CH4 From 82959076922830f22e0c5cbe56278b6a372c9ac2 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 27 Jun 2022 08:51:58 -0400 Subject: [PATCH 0125/1127] Added function socket before splitting into activity sets --- flowsa/flowby.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 354fa39ed..bd8c3c21b 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1240,8 +1240,14 @@ def flagged_proportionally_attribute(self: 'FlowByActivity'): def convert_to_fbs(self: 'FlowByActivity') -> 'FlowBySector': if 'activity_sets' in self.config: return ( - pd.concat([fba.convert_to_fbs() - for fba in self.activity_sets()]) + pd.concat([ + fba.convert_to_fbs() + for fba in ( + self + .function_socket('clean_fba_before_activity_sets') + .activity_sets() + ) + ]) .reset_index(drop=True) ) @@ -1274,7 +1280,9 @@ def activity_sets(self) -> List['FlowByActivity']: log.info('Splitting %s into activity sets', self.full_name) activities = self.config['activity_sets'] parent_config = {k: v for k, v in self.config.items() - if k != 'activity_sets' and not k.startswith('_')} + if k not in ['activity_sets', + 'clean_fba_before_activity_sets'] + and not k.startswith('_')} parent_fba = self.reset_index().rename(columns={'index': 'row'}) child_fba_list = [] From c224ea3f8d2f0609bdebe1a8d12180ca89040202 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 27 Jun 2022 09:01:43 -0400 Subject: [PATCH 0126/1127] Added stop-gap eia mecs functions, specific to BEA summary target industry spec --- .../temp_data_source_functions.py | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index db3cc447c..658e8c405 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -1,6 +1,7 @@ from flowsa import naics from flowsa.flowsa_log import log import pandas as pd +from flowsa.data_source_scripts import EIA_MECS as mecs def clean_qcew(fba, **kwargs): @@ -55,3 +56,36 @@ def clean_usda_cropland_naics(fba, **kwargs): filtered = fba.query('ActivityProducedBy in @target_naics') return filtered + + +def clean_mecs_energy_fba_for_bea_summary(fba, **kwargs): + naics_3 = fba.query('ActivityConsumedBy.str.len() == 3') + naics_4 = fba.query('ActivityConsumedBy.str.len() == 4 ' + '& ActivityConsumedBy.str.startswith("336")') + naics_4_sum = ( + naics_4 + .assign(ActivityConsumedBy='336') + .aggregate_flowby() + [['Flowable', 'FlowAmount', 'Unit', 'ActivityConsumedBy']] + .rename(columns={'FlowAmount': 'naics_4_sum'}) + ) + + merged = naics_3.merge(naics_4_sum, how='left').fillna({'naics_4_sum': 0}) + subtracted = ( + merged + .assign(FlowAmount=merged.FlowAmount - merged.naics_4_sum) + .drop(columns='naics_4_sum') + ) + + subtracted.config['naics_4_list'] = list( + naics_4.ActivityConsumedBy.unique() + ) + + return subtracted + + +def clean_mapped_mecs_energy_fba_for_bea_summary(fba, **kwargs): + naics_4_list = fba.config['naics_4_list'] + + return fba.query('~(SectorConsumedBy in @naics_4_list ' + '& ActivityConsumedBy != SectorConsumedBy)') From 3ab2c286e0bb692853f032bbe49e9a1ac2e935ea Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 27 Jun 2022 13:21:01 -0400 Subject: [PATCH 0127/1127] Additions to allow for proper attribution of truck and bus CO2 emissions --- .../NAICS_Crosswalk_EPA_GHGI.csv | 5 +- .../NAICS_Crosswalk_EPA_GHGI_trucking.csv | 98 ++++++++++++++----- 2 files changed, 78 insertions(+), 25 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv index b9bbce301..388c92b3c 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv @@ -515,6 +515,9 @@ EPA_GHGI,School and Tour Buses,NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_103 EPA_GHGI,Ships and Boats,NAICS_2012_Code,483,,483000,EPA_GHGI_T_A_103 EPA_GHGI,Transit Buses,,,,excluded,EPA_GHGI_T_A_103 EPA_GHGI,Buses,NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_79 +EPA_GHGI,Buses,NAICS_2012_Code,487,,,EPA_GHGI_T_A_79 +EPA_GHGI,Buses,NAICS_2012_Code,488,,,EPA_GHGI_T_A_79 +EPA_GHGI,Buses,NAICS_2012_Code,S00201,,,EPA_GHGI_T_A_79 EPA_GHGI,Buses - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_79 EPA_GHGI,Buses - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,487,,48A000,EPA_GHGI_T_A_79 EPA_GHGI,Buses - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,488,,,EPA_GHGI_T_A_79 @@ -537,4 +540,4 @@ EPA_GHGI,Pipelines,NAICS_2012_Code,486,,486000,EPA_GHGI_T_A_79 EPA_GHGI,Recreational Boats,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 EPA_GHGI,Ships and Boats,NAICS_2012_Code,4831,,483000,EPA_GHGI_T_A_79 EPA_GHGI,Ships and Boats,NAICS_2012_Code,4832,,4-digit to avoid data loss in BLS_QCEW,EPA_GHGI_T_A_79 -EPA_GHGI,Ships and Non-Recreational Boats,NAICS_2012_Code,483,,483000,EPA_GHGI_T_A_79 \ No newline at end of file +EPA_GHGI,Ships and Non-Recreational Boats,NAICS_2012_Code,483,,483000,EPA_GHGI_T_A_79 diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_trucking.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_trucking.csv index 75a744637..c2872373c 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_trucking.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_trucking.csv @@ -24,6 +24,31 @@ EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_1 EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,22,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,48,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,49,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,22,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" @@ -48,30 +73,55 @@ EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code, EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,22,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,48,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,49,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,22,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,48,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,49,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" ,,,,,, ,,,,,, ,,,,,, From d245af73d26e45af358c3fa474e3d4f49de5aaa8 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 27 Jun 2022 16:31:41 -0400 Subject: [PATCH 0128/1127] Added several GHGI tables --- .../flowbysectormethods/SEEA_2017_v1.yaml | 382 ++++++++++++++---- 1 file changed, 299 insertions(+), 83 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index d404849fa..5b557b76b 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -22,12 +22,30 @@ _ghgi_parameters: &ghgi_parameters fedefl_mapping: GHGI _attribution_sources: + BLS_QCEW: &bls_qcew + selection_fields: + Class: Employment + year: 2012 + clean_fba: !script_function:temp_data_source_functions clean_qcew BEA_Use_Detail_PRO_BeforeRedef: &bea_use - activity_to_sector_mapping: BEA_2012_Detail year: 2012 - # selection_fields: # Need to provide - # ActivityProducedBy: - # - '327400' + activity_to_sector_mapping: BEA_2012_Detail + attribution_method: proportional + attribution_source: + BLS_QCEW: + <<: *bls_qcew + EPA_GHGI_T_A_79: &t_a_79 + attribution_method: proportional + attribution_source: + BLS_QCEW: + <<: *bls_qcew + BTS_TSA: &tsa_trucking + year: 2017 + selection_fields: + Description: + - In-house truck transportation + - For-hire truck transportation + activity_to_sector_mapping: BTS_TSA attribution_method: proportional attribution_source: BLS_QCEW: @@ -35,6 +53,17 @@ _attribution_sources: Class: Employment year: 2012 clean_fba: !script_function:temp_data_source_functions clean_qcew + EIA_MECS_Energy: &mecs_energy + year: 2014 + selection_fields: &mecs_energy_default_selection + Class: Energy + Unit: Trillion Btu + clean_fba: !script_function:temp_data_source_functions clean_mecs_energy_fba_for_bea_summary + clean_fba_w_sec: !script_function:temp_data_source_functions clean_mapped_mecs_energy_fba_for_bea_summary + attribution_method: proportional # cleaning fxns remove need for proportional-flagged IF industry_spec is BEA summary + attribution_source: + BLS_QCEW: + <<: *bls_qcew USDA_CoA_Cropland_NAICS: &usda_pasture # allocated based on USDA Animal operation land (acres) selection_fields: Class: @@ -283,82 +312,269 @@ source_names: # pasture: # <<: *pasture -## Mobile Sources (N20 and CH4) - EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion - <<: *ghgi_parameters - activity_sets: - direct_attribution: # Some of these need to be separated and attributed differently - selection_fields: - PrimaryActivity: - - Passenger Cars Gasoline On-Road - - Rail Non-Road - - Ships and Boats Non-Road - - Aircraft Non-Road - attribution_method: direct - - trucking: - selection_fields: - PrimaryActivity: - - Light-Duty Trucks Gasoline On-Road - - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road - activity_to_sector_mapping: EPA_GHGI_trucking - attribution_method: proportional - attribution_source: - BTS_TSA: - year: 2017 - selection_fields: - Description: - - In-house truck transportation - - For-hire truck transportation - activity_to_sector_mapping: BTS_TSA - attribution_method: proportional - attribution_source: - BLS_QCEW: - selection_fields: - Class: Employment - year: 2012 - clean_fba: !script_function:temp_data_source_functions clean_qcew - - construction_and_mining: - selection_fields: - PrimaryActivity: Construction/Mining Equipment Non-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333120' # purchases of construction/mining equipment - - farm_non_road: - selection_fields: - PrimaryActivity: Agricultural Equipment Non-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333111' # purchases of farm machinery - - other_non_road: # attributed by purchases of petroleum refinery products - selection_fields: - PrimaryActivity: Other Non-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # purchases of refinery products - - alt_fuel_on_road: # assumes natural gas is primary alternate fuel - selection_fields: - PrimaryActivity: - - Alternative Fuel On-Road - - All activities Alternative Fuel On-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '221200' # purchases of natural gas - - "EPA_GHGI_T_3_15": *mobile #N2O from mobile combustion duplicates method for CH4 +# ## Mobile Sources (N20 and CH4) + # EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion + # <<: *ghgi_parameters + # activity_sets: + # direct_attribution: # Some of these need to be separated and attributed differently + # selection_fields: + # PrimaryActivity: + # - Passenger Cars Gasoline On-Road + # - Rail Non-Road + # - Ships and Boats Non-Road + # - Aircraft Non-Road + # attribution_method: direct + + # trucking: + # selection_fields: + # PrimaryActivity: + # - Light-Duty Trucks Gasoline On-Road + # - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road + # activity_to_sector_mapping: EPA_GHGI_trucking + # attribution_method: proportional + # attribution_source: + # BTS_TSA: + # <<: *tsa_trucking + + # construction_and_mining: + # selection_fields: + # PrimaryActivity: Construction/Mining Equipment Non-Road + # attribution_method: proportional + # attribution_source: + # BEA_Use_Detail_PRO_BeforeRedef: + # <<: *bea_use + # selection_fields: + # ActivityProducedBy: '333120' # purchases of construction/mining equipment + + # farm_non_road: + # selection_fields: + # PrimaryActivity: Agricultural Equipment Non-Road + # attribution_method: proportional + # attribution_source: + # BEA_Use_Detail_PRO_BeforeRedef: + # <<: *bea_use + # selection_fields: + # ActivityProducedBy: '333111' # purchases of farm machinery + + # other_non_road: # attributed by purchases of petroleum refinery products + # selection_fields: + # PrimaryActivity: Other Non-Road + # attribution_method: proportional + # attribution_source: + # BEA_Use_Detail_PRO_BeforeRedef: + # <<: *bea_use + # selection_fields: + # ActivityProducedBy: '324110' # purchases of refinery products + + # alt_fuel_on_road: # assumes natural gas is primary alternate fuel + # selection_fields: + # PrimaryActivity: + # - Alternative Fuel On-Road + # - All activities Alternative Fuel On-Road + # attribution_method: proportional + # attribution_source: + # BEA_Use_Detail_PRO_BeforeRedef: + # <<: *bea_use + # selection_fields: + # ActivityProducedBy: '221200' # purchases of natural gas + + # EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 + +## Major CO2 Sources + # EPA_GHGI_T_A_13: # (2017 specific table) CO2 emissions from stationary combustion and transportation + # <<: *ghgi_parameters + # clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion + # activity_sets: + # direct_attribution: + # selection_fields: + # PrimaryActivity: Total (All Fuels) Residential + # attribution_method: direct + # non-manufacturing_coal: + # selection_fields: + # PrimaryActivity: + # - Commercial Coal Commercial + # - Industrial Other Coal Industrial + # attribution_method: proportional + # attribution_source: + # BEA_Use_Detail_PRO_BeforeRedef: + # <<: *bea_use + # selection_fields: + # ActivityProducedBy: '212100' # purchases of coal + # non-manufacturing_natural_gas: + # selection_fields: + # PrimaryActivity: + # - Natural Gas Commercial + # - Natural Gas Industrial + # attribution_method: proportional + # attribution_source: + # BEA_Use_Detail_PRO_BeforeRedef: + # <<: *bea_use + # selection_fields: + # ActivityProducedBy: '221200' # purchases of natural gas + # non-manufacturing_petroleum: + # selection_fields: + # PrimaryActivity: + # - Total Petroleum Commercial + # - Total Petroleum Industrial + # attribution_method: proportional + # attribution_source: + # BEA_Use_Detail_PRO_BeforeRedef: + # <<: *bea_use + # selection_fields: + # ActivityProducedBy: '324110' # purchases of refinery products + # manufacturing_coal: # Industrial Coal for Manufacturing + # selection_fields: + # PrimaryActivity: + # - Industrial Other Coal Industrial - Manufacturing + # attribution_method: proportional + # attribution_source: + # EIA_MECS_Energy: + # <<: *mecs_energy + # selection_fields: + # <<: *mecs_energy_default_selection + # FlowName: Coal + # manufacturing_natural_gas: # Industrial Natural Gas for manufacturing + # selection_fields: + # PrimaryActivity: + # - Natural Gas Industrial - Manufacturing + # attribution_method: proportional + # attribution_source: + # EIA_MECS_Energy: + # <<: *mecs_energy + # selection_fields: + # <<: *mecs_energy_default_selection + # FlowName: Natural Gas + + ### Transportation + # natural_gas_transportation: + # selection_fields: + # PrimaryActivity: Natural Gas Transportation + # attribution_method: proportional + # attribution_source: + # EPA_GHGI_T_A_79: + # <<: *t_a_79 + # selection_fields: + # FlowName: Natural Gas + + # aviation_gas_transportation: + # selection_fields: + # PrimaryActivity: Aviation Gasoline Transportation + # attribution_method: proportional + # attribution_source: + # EPA_GHGI_T_A_79: + # <<: *t_a_79 + # selection_fields: + # FlowName: Aviation Gasoline + + # jet_fuel_transportation: + # selection_fields: + # PrimaryActivity: Jet Fuel Transportation + # attribution_method: proportional + # attribution_source: + # EPA_GHGI_T_A_79: + # <<: *t_a_79 + # selection_fields: + # FlowName: Jet Fuel + + # propane_transportation: + # selection_fields: + # PrimaryActivity: LPG (Propane) Transportation + # attribution_method: proportional + # attribution_source: + # EPA_GHGI_T_A_79: + # <<: *t_a_79 + # selection_fields: + # FlowName: LPG + + # residual_fuel_transportation: + # selection_fields: + # PrimaryActivity: Residual Fuel Transportation + # attribution_method: proportional + # attribution_source: + # EPA_GHGI_T_A_79: + # <<: *t_a_79 + # selection_fields: + # FlowName: Residual Fuel Oil + + # distillate_fuel_transportation: + # selection_fields: + # PrimaryActivity: + # - Distillate Fuel Oil Transportation + # activity_to_sector_mapping: EPA_GHGI_trucking + # attribution_method: proportional + # attribution_source: + # EPA_GHGI_T_A_79: + # <<: *t_a_79 + # activity_to_sector_mapping: EPA_GHGI + # activity_sets: + # direct_attribution: + # selection_fields: + # FlowName: Distillate Fuel Oil (Diesel Fuel) + # PrimaryActivity: + # - Passenger Cars + # - Rail + # - Recreational Boats + # - Ships and Non-Recreational Boats + # attribution_method: direct + # trucking: + # selection_fields: + # FlowName: Distillate Fuel Oil (Diesel Fuel) + # PrimaryActivity: + # - Light-Duty Trucks + # - Medium- and Heavy-Duty Trucks + # activity_to_sector_mapping: EPA_GHGI_trucking + # attribution_method: proportional + # attribution_source: + # BTS_TSA: + # <<: *tsa_trucking + # buses: + # selection_fields: + # FlowName: Distillate Fuel Oil (Diesel Fuel) + # PrimaryActivity: Buses + # attribution_method: proportional + # attribution_source: + # BEA_Use_Detail_PRO_BeforeRedef: + # <<: *bea_use + # selection_fields: + # ActivityProducedBy: '324110' # use of petroleum products + + # motor_gasoline_transportation: + # selection_fields: + # PrimaryActivity: + # - Motor Gasoline Transportation + # activity_to_sector_mapping: EPA_GHGI_trucking + # attribution_method: proportional + # attribution_source: + # EPA_GHGI_T_A_79: + # <<: *t_a_79 + # activity_to_sector_mapping: EPA_GHGI + # activity_sets: + # direct_attribution: + # selection_fields: + # FlowName: Motor Gasoline + # PrimaryActivity: + # - Passenger Cars + # - Motorcycles + # - Recreational Boats + # attribution_method: direct + # trucking: + # selection_fields: + # FlowName: Motor Gasoline + # PrimaryActivity: + # - Light-Duty Trucks + # - Medium- and Heavy-Duty Trucks + # activity_to_sector_mapping: EPA_GHGI_trucking + # attribution_method: proportional + # attribution_source: + # BTS_TSA: + # <<: *tsa_trucking + # buses: + # selection_fields: + # FlowName: Motor Gasoline + # PrimaryActivity: Buses + # attribution_method: proportional + # attribution_source: + # BEA_Use_Detail_PRO_BeforeRedef: + # <<: *bea_use + # selection_fields: + # ActivityProducedBy: '324110' # use of petroleum products From 5e50c5cc6dbcddd4e29471f1f3ec0eb4a638ddef Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 27 Jun 2022 16:35:26 -0400 Subject: [PATCH 0129/1127] Added activity set to FBA SourceName/FBS MetaSourceName column, for easier identification of problem spots. --- flowsa/flowby.py | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index bd8c3c21b..3d86b7c9b 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1294,6 +1294,7 @@ def activity_sets(self) -> List['FlowByActivity']: ) child_fba.full_name += f'{NAME_SEP_CHAR}{activity_set}' child_fba.config = {**parent_config, **activity_config} + child_fba = child_fba.assign(SourceName=child_fba.full_name) if set(child_fba.row) & assigned_rows: log.error( From a3d546c906022a8ee3365034cbb490d8499cbdaa Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 27 Jun 2022 16:36:05 -0400 Subject: [PATCH 0130/1127] Added needed rows --- .../NAICS_Crosswalk_EPA_GHGI_trucking.csv | 148 +++++++++--------- 1 file changed, 74 insertions(+), 74 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_trucking.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_trucking.csv index c2872373c..879ae3d70 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_trucking.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_trucking.csv @@ -24,31 +24,31 @@ EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_1 EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,22,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,48,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,49,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,11,,,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,21,,,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,22,,,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,23,,,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,31,,,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,32,,,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,33,,,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,42,,,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,44,,,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,45,,,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,48,,,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,49,,,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,51,,,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,52,,,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,53,,,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,54,,,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,55,,,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,56,,,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,61,,,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,62,,,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,71,,,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,72,,,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,81,,,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,92,,,EPA_GHGI_T_A_79 EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,22,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" @@ -73,30 +73,30 @@ EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code, EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,22,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,48,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,49,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,11,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,21,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,22,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,23,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,31,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,32,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,33,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,42,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,44,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,45,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,48,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,49,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,51,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,52,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,53,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,54,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,55,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,56,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,61,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,62,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,71,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,72,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,81,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,92,,,EPA_GHGI_T_A_79 EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" @@ -122,31 +122,31 @@ EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_1 EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,22,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,48,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,49,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" ,,,,,, ,,,,,, ,,,,,, From 3d37ff4b2645beae044063f322c6dc08a9fd7376 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 29 Jun 2022 13:34:43 -0400 Subject: [PATCH 0131/1127] Added type hinting, hfc functions --- .../temp_data_source_functions.py | 41 +++++++++++++++++-- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index 658e8c405..aca92a25d 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -2,9 +2,11 @@ from flowsa.flowsa_log import log import pandas as pd from flowsa.data_source_scripts import EIA_MECS as mecs +from flowsa.data_source_scripts import EPA_GHGI as ghgi +from flowsa.flowby import FlowByActivity -def clean_qcew(fba, **kwargs): +def clean_qcew(fba: FlowByActivity, **kwargs): if fba.config.get('geoscale') == 'national': fba = fba.query('Location == "00000"') @@ -39,7 +41,7 @@ def clean_qcew(fba, **kwargs): return filtered -def clean_usda_cropland_naics(fba, **kwargs): +def clean_usda_cropland_naics(fba: FlowByActivity, **kwargs): if fba.config['industry_spec']['default'] == 'NAICS_2': naics_2 = ( fba @@ -58,7 +60,7 @@ def clean_usda_cropland_naics(fba, **kwargs): return filtered -def clean_mecs_energy_fba_for_bea_summary(fba, **kwargs): +def clean_mecs_energy_fba_for_bea_summary(fba: FlowByActivity, **kwargs): naics_3 = fba.query('ActivityConsumedBy.str.len() == 3') naics_4 = fba.query('ActivityConsumedBy.str.len() == 4 ' '& ActivityConsumedBy.str.startswith("336")') @@ -84,8 +86,39 @@ def clean_mecs_energy_fba_for_bea_summary(fba, **kwargs): return subtracted -def clean_mapped_mecs_energy_fba_for_bea_summary(fba, **kwargs): +def clean_mapped_mecs_energy_fba_for_bea_summary( + fba: FlowByActivity, + **kwargs +): naics_4_list = fba.config['naics_4_list'] return fba.query('~(SectorConsumedBy in @naics_4_list ' '& ActivityConsumedBy != SectorConsumedBy)') + + +def clean_hfc_fba(fba: FlowByActivity, **kwargs): + attributes_to_save = { + attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] + } + + df = ghgi.clean_HFC_fba(fba) + + new_fba = FlowByActivity(df) + for attr in attributes_to_save: + setattr(new_fba, attr, attributes_to_save[attr]) + + return new_fba + + +def split_hfcs_by_type(fba: FlowByActivity, **kwargs): + attributes_to_save = { + attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] + } + + df = ghgi.split_HFCs_by_type(fba) + + new_fba = FlowByActivity(df) + for attr in attributes_to_save: + setattr(new_fba, attr, attributes_to_save[attr]) + + return new_fba From e20d7cf3aa7ace399e5cd63d1a58a07f8d209e51 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 29 Jun 2022 13:35:21 -0400 Subject: [PATCH 0132/1127] Clarified make vs use, ACB vs APB --- flowsa/data_source_scripts/BTS_TSA.py | 7 ++++--- flowsa/methods/flowbyactivitymethods/BTS_TSA.yaml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/flowsa/data_source_scripts/BTS_TSA.py b/flowsa/data_source_scripts/BTS_TSA.py index c81ea3441..92e078331 100644 --- a/flowsa/data_source_scripts/BTS_TSA.py +++ b/flowsa/data_source_scripts/BTS_TSA.py @@ -36,7 +36,8 @@ def tsa_parse(*, df_list, source, year, config, **_): .drop(columns=df.columns.difference( list(config['parse']['rename_columns_use'].keys()) )) - .rename(columns=config['parse']['rename_columns_use'])) + .rename(columns=config['parse']['rename_columns_use']) + .assign(SourceName=f'{source}.use')) in_house = use[use.Description.str.startswith('In-house')] # Data on for-hire production of transportation services (which may @@ -47,7 +48,8 @@ def tsa_parse(*, df_list, source, year, config, **_): .drop(columns=df.columns.difference( list(config['parse']['rename_columns_make'].keys()) )) - .rename(columns=config['parse']['rename_columns_make'])) + .rename(columns=config['parse']['rename_columns_make']) + .assign(SourceName=f'{source}.make')) for_hire = make[make.Description.str.startswith('For-hire')] df = pd.concat([in_house, for_hire]) @@ -57,7 +59,6 @@ def tsa_parse(*, df_list, source, year, config, **_): # Add other columns as needed for complete FBA df['Class'] = 'Money' - df['SourceName'] = source df['FlowName'] = 'Gross Output' df['Unit'] = 'USD' df['FlowType'] = 'TECHNOSPHERE_FLOW' diff --git a/flowsa/methods/flowbyactivitymethods/BTS_TSA.yaml b/flowsa/methods/flowbyactivitymethods/BTS_TSA.yaml index 3534bf711..b3d228009 100644 --- a/flowsa/methods/flowbyactivitymethods/BTS_TSA.yaml +++ b/flowsa/methods/flowbyactivitymethods/BTS_TSA.yaml @@ -10,7 +10,7 @@ call_response_fxn: !script_function:BTS_TSA tsa_call parse_response_fxn: !script_function:BTS_TSA tsa_parse parse: rename_columns_use: # Dict to rename columns from USE table {old_name: new_name} - col_code: ActivityProducedBy + col_code: ActivityConsumedBy row_label: Description dollars: FlowAmount year: Year From 76d5df3c35aafa94fe20747bb6f95126b9743c42 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 29 Jun 2022 13:35:47 -0400 Subject: [PATCH 0133/1127] Added rows --- .../NAICS_Crosswalk_EPA_GHGI_trucking.csv | 122 +++++++++++------- 1 file changed, 73 insertions(+), 49 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_trucking.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_trucking.csv index 879ae3d70..c1d7e5d72 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_trucking.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_trucking.csv @@ -24,31 +24,31 @@ EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_1 EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,11,,,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,21,,,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,22,,,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,23,,,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,31,,,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,32,,,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,33,,,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,42,,,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,44,,,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,45,,,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,48,,,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,49,,,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,51,,,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,52,,,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,53,,,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,54,,,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,55,,,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,56,,,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,61,,,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,62,,,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,71,,,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,72,,,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,81,,,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,92,,,EPA_GHGI_T_A_79 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,11,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,21,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,22,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,23,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,31,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,32,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,33,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,42,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,44,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,45,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,48,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,49,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,51,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,52,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,53,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,54,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,55,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,56,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,61,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,62,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,71,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,72,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,81,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,92,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,22,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" @@ -73,30 +73,54 @@ EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code, EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,11,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,21,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,22,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,23,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,31,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,32,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,33,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,42,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,44,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,45,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,48,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,49,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,51,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,52,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,53,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,54,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,55,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,56,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,61,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,62,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,71,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,72,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,81,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,92,,,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,11,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,21,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,22,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,23,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,31,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,32,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,33,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,42,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,44,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,45,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,48,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,49,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,51,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,52,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,53,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,54,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,55,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,56,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,61,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,62,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,71,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,72,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,81,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,92,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,11,,,EPA_GHGI_T_A_103 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,21,,,EPA_GHGI_T_A_103 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,22,,,EPA_GHGI_T_A_103 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,23,,,EPA_GHGI_T_A_103 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,31,,,EPA_GHGI_T_A_103 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,32,,,EPA_GHGI_T_A_103 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,33,,,EPA_GHGI_T_A_103 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,42,,,EPA_GHGI_T_A_103 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,44,,,EPA_GHGI_T_A_103 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,45,,,EPA_GHGI_T_A_103 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,48,,,EPA_GHGI_T_A_103 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,49,,,EPA_GHGI_T_A_103 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,51,,,EPA_GHGI_T_A_103 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,52,,,EPA_GHGI_T_A_103 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,53,,,EPA_GHGI_T_A_103 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,54,,,EPA_GHGI_T_A_103 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,55,,,EPA_GHGI_T_A_103 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,56,,,EPA_GHGI_T_A_103 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,61,,,EPA_GHGI_T_A_103 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,62,,,EPA_GHGI_T_A_103 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,71,,,EPA_GHGI_T_A_103 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,72,,,EPA_GHGI_T_A_103 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,81,,,EPA_GHGI_T_A_103 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,92,,,EPA_GHGI_T_A_103 EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" From 6af1042868018ee7cd01a05bc0a28f0ea1217bc1 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 29 Jun 2022 15:17:14 -0400 Subject: [PATCH 0134/1127] Fixed TSA allocation problem --- .../NAICS_Crosswalk_BTS_TSA.csv | 4552 ++++++++--------- .../flowbysectormethods/SEEA_2017_v1.yaml | 1236 +++-- 2 files changed, 2916 insertions(+), 2872 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_BTS_TSA.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_BTS_TSA.csv index 9cfcb82c8..ea9d2a25b 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_BTS_TSA.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_BTS_TSA.csv @@ -1,2393 +1,2159 @@ -ActivitySourceName,Activity,SectorSourceName,Sector,SectorType,Notes -BTS_TSA,111CA,NAICS_2012_Code,11,, -BTS_TSA,113FF,NAICS_2012_Code,11,, -BTS_TSA,111CA,NAICS_2012_Code,111,, -BTS_TSA,111CA,NAICS_2012_Code,1111,, -BTS_TSA,111CA,NAICS_2012_Code,11111,, -BTS_TSA,111CA,NAICS_2012_Code,111110,, -BTS_TSA,111CA,NAICS_2012_Code,11112,, -BTS_TSA,111CA,NAICS_2012_Code,111120,, -BTS_TSA,111CA,NAICS_2012_Code,11113,, -BTS_TSA,111CA,NAICS_2012_Code,111130,, -BTS_TSA,111CA,NAICS_2012_Code,11114,, -BTS_TSA,111CA,NAICS_2012_Code,111140,, -BTS_TSA,111CA,NAICS_2012_Code,11115,, -BTS_TSA,111CA,NAICS_2012_Code,111150,, -BTS_TSA,111CA,NAICS_2012_Code,11116,, -BTS_TSA,111CA,NAICS_2012_Code,111160,, -BTS_TSA,111CA,NAICS_2012_Code,11119,, -BTS_TSA,111CA,NAICS_2012_Code,111191,, -BTS_TSA,111CA,NAICS_2012_Code,111199,, -BTS_TSA,111CA,NAICS_2012_Code,1112,, -BTS_TSA,111CA,NAICS_2012_Code,11121,, -BTS_TSA,111CA,NAICS_2012_Code,111211,, -BTS_TSA,111CA,NAICS_2012_Code,111219,, -BTS_TSA,111CA,NAICS_2012_Code,1113,, -BTS_TSA,111CA,NAICS_2012_Code,11131,, -BTS_TSA,111CA,NAICS_2012_Code,111310,, -BTS_TSA,111CA,NAICS_2012_Code,11132,, -BTS_TSA,111CA,NAICS_2012_Code,111320,, -BTS_TSA,111CA,NAICS_2012_Code,11133,, -BTS_TSA,111CA,NAICS_2012_Code,111331,, -BTS_TSA,111CA,NAICS_2012_Code,111332,, -BTS_TSA,111CA,NAICS_2012_Code,111333,, -BTS_TSA,111CA,NAICS_2012_Code,111334,, -BTS_TSA,111CA,NAICS_2012_Code,111335,, -BTS_TSA,111CA,NAICS_2012_Code,111336,, -BTS_TSA,111CA,NAICS_2012_Code,111339,, -BTS_TSA,111CA,NAICS_2012_Code,1114,, -BTS_TSA,111CA,NAICS_2012_Code,11141,, -BTS_TSA,111CA,NAICS_2012_Code,111411,, -BTS_TSA,111CA,NAICS_2012_Code,111419,, -BTS_TSA,111CA,NAICS_2012_Code,11142,, -BTS_TSA,111CA,NAICS_2012_Code,111421,, -BTS_TSA,111CA,NAICS_2012_Code,111422,, -BTS_TSA,111CA,NAICS_2012_Code,1119,, -BTS_TSA,111CA,NAICS_2012_Code,11191,, -BTS_TSA,111CA,NAICS_2012_Code,111910,, -BTS_TSA,111CA,NAICS_2012_Code,11192,, -BTS_TSA,111CA,NAICS_2012_Code,111920,, -BTS_TSA,111CA,NAICS_2012_Code,11193,, -BTS_TSA,111CA,NAICS_2012_Code,111930,, -BTS_TSA,111CA,NAICS_2012_Code,11194,, -BTS_TSA,111CA,NAICS_2012_Code,111940,, -BTS_TSA,111CA,NAICS_2012_Code,11199,, -BTS_TSA,111CA,NAICS_2012_Code,111991,, -BTS_TSA,111CA,NAICS_2012_Code,111992,, -BTS_TSA,111CA,NAICS_2012_Code,111998,, -BTS_TSA,111CA,NAICS_2012_Code,112,, -BTS_TSA,111CA,NAICS_2012_Code,1121,, -BTS_TSA,111CA,NAICS_2012_Code,11211,, -BTS_TSA,111CA,NAICS_2012_Code,112111,, -BTS_TSA,111CA,NAICS_2012_Code,112112,, -BTS_TSA,111CA,NAICS_2012_Code,11212,, -BTS_TSA,111CA,NAICS_2012_Code,112120,, -BTS_TSA,111CA,NAICS_2012_Code,11213,, -BTS_TSA,111CA,NAICS_2012_Code,112130,, -BTS_TSA,111CA,NAICS_2012_Code,1122,, -BTS_TSA,111CA,NAICS_2012_Code,11221,, -BTS_TSA,111CA,NAICS_2012_Code,112210,, -BTS_TSA,111CA,NAICS_2012_Code,1123,, -BTS_TSA,111CA,NAICS_2012_Code,11231,, -BTS_TSA,111CA,NAICS_2012_Code,112310,, -BTS_TSA,111CA,NAICS_2012_Code,11232,, -BTS_TSA,111CA,NAICS_2012_Code,112320,, -BTS_TSA,111CA,NAICS_2012_Code,11233,, -BTS_TSA,111CA,NAICS_2012_Code,112330,, -BTS_TSA,111CA,NAICS_2012_Code,11234,, -BTS_TSA,111CA,NAICS_2012_Code,112340,, -BTS_TSA,111CA,NAICS_2012_Code,11239,, -BTS_TSA,111CA,NAICS_2012_Code,112390,, -BTS_TSA,111CA,NAICS_2012_Code,1124,, -BTS_TSA,111CA,NAICS_2012_Code,11241,, -BTS_TSA,111CA,NAICS_2012_Code,112410,, -BTS_TSA,111CA,NAICS_2012_Code,11242,, -BTS_TSA,111CA,NAICS_2012_Code,112420,, -BTS_TSA,111CA,NAICS_2012_Code,1125,, -BTS_TSA,111CA,NAICS_2012_Code,11251,, -BTS_TSA,111CA,NAICS_2012_Code,112511,, -BTS_TSA,111CA,NAICS_2012_Code,112512,, -BTS_TSA,111CA,NAICS_2012_Code,112519,, -BTS_TSA,111CA,NAICS_2012_Code,1129,, -BTS_TSA,111CA,NAICS_2012_Code,11291,, -BTS_TSA,111CA,NAICS_2012_Code,112910,, -BTS_TSA,111CA,NAICS_2012_Code,11292,, -BTS_TSA,111CA,NAICS_2012_Code,112920,, -BTS_TSA,111CA,NAICS_2012_Code,11293,, -BTS_TSA,111CA,NAICS_2012_Code,112930,, -BTS_TSA,111CA,NAICS_2012_Code,11299,, -BTS_TSA,111CA,NAICS_2012_Code,112990,, -BTS_TSA,113FF,NAICS_2012_Code,113,, -BTS_TSA,113FF,NAICS_2012_Code,1131,, -BTS_TSA,113FF,NAICS_2012_Code,11311,, -BTS_TSA,113FF,NAICS_2012_Code,113110,, -BTS_TSA,113FF,NAICS_2012_Code,1132,, -BTS_TSA,113FF,NAICS_2012_Code,11321,, -BTS_TSA,113FF,NAICS_2012_Code,113210,, -BTS_TSA,113FF,NAICS_2012_Code,1133,, -BTS_TSA,113FF,NAICS_2012_Code,11331,, -BTS_TSA,113FF,NAICS_2012_Code,113310,, -BTS_TSA,113FF,NAICS_2012_Code,114,, -BTS_TSA,113FF,NAICS_2012_Code,1141,, -BTS_TSA,113FF,NAICS_2012_Code,11411,, -BTS_TSA,113FF,NAICS_2012_Code,114111,, -BTS_TSA,113FF,NAICS_2012_Code,114112,, -BTS_TSA,113FF,NAICS_2012_Code,114119,, -BTS_TSA,113FF,NAICS_2012_Code,1142,, -BTS_TSA,113FF,NAICS_2012_Code,11421,, -BTS_TSA,113FF,NAICS_2012_Code,114210,, -BTS_TSA,113FF,NAICS_2012_Code,115,, -BTS_TSA,113FF,NAICS_2012_Code,1151,, -BTS_TSA,113FF,NAICS_2012_Code,11511,, -BTS_TSA,113FF,NAICS_2012_Code,115111,, -BTS_TSA,113FF,NAICS_2012_Code,115112,, -BTS_TSA,113FF,NAICS_2012_Code,115113,, -BTS_TSA,113FF,NAICS_2012_Code,115114,, -BTS_TSA,113FF,NAICS_2012_Code,115115,, -BTS_TSA,113FF,NAICS_2012_Code,115116,, -BTS_TSA,113FF,NAICS_2012_Code,1152,, -BTS_TSA,113FF,NAICS_2012_Code,11521,, -BTS_TSA,113FF,NAICS_2012_Code,115210,, -BTS_TSA,113FF,NAICS_2012_Code,1153,, -BTS_TSA,113FF,NAICS_2012_Code,11531,, -BTS_TSA,113FF,NAICS_2012_Code,115310,, -BTS_TSA,211,NAICS_2012_Code,21,, -BTS_TSA,212,NAICS_2012_Code,21,, -BTS_TSA,213,NAICS_2012_Code,21,, -BTS_TSA,211,NAICS_2012_Code,211,, -BTS_TSA,211,NAICS_2012_Code,2111,, -BTS_TSA,211,NAICS_2012_Code,21111,, -BTS_TSA,211,NAICS_2012_Code,211111,, -BTS_TSA,211,NAICS_2012_Code,211112,, -BTS_TSA,212,NAICS_2012_Code,212,, -BTS_TSA,212,NAICS_2012_Code,2121,, -BTS_TSA,212,NAICS_2012_Code,21211,, -BTS_TSA,212,NAICS_2012_Code,212111,, -BTS_TSA,212,NAICS_2012_Code,212112,, -BTS_TSA,212,NAICS_2012_Code,212113,, -BTS_TSA,212,NAICS_2012_Code,2122,, -BTS_TSA,212,NAICS_2012_Code,21221,, -BTS_TSA,212,NAICS_2012_Code,212210,, -BTS_TSA,212,NAICS_2012_Code,21222,, -BTS_TSA,212,NAICS_2012_Code,212221,, -BTS_TSA,212,NAICS_2012_Code,212222,, -BTS_TSA,212,NAICS_2012_Code,21223,, -BTS_TSA,212,NAICS_2012_Code,212231,, -BTS_TSA,212,NAICS_2012_Code,212234,, -BTS_TSA,212,NAICS_2012_Code,21229,, -BTS_TSA,212,NAICS_2012_Code,212291,, -BTS_TSA,212,NAICS_2012_Code,212299,, -BTS_TSA,212,NAICS_2012_Code,2123,, -BTS_TSA,212,NAICS_2012_Code,21231,, -BTS_TSA,212,NAICS_2012_Code,212311,, -BTS_TSA,212,NAICS_2012_Code,212312,, -BTS_TSA,212,NAICS_2012_Code,212313,, -BTS_TSA,212,NAICS_2012_Code,212319,, -BTS_TSA,212,NAICS_2012_Code,21232,, -BTS_TSA,212,NAICS_2012_Code,212321,, -BTS_TSA,212,NAICS_2012_Code,212322,, -BTS_TSA,212,NAICS_2012_Code,212324,, -BTS_TSA,212,NAICS_2012_Code,212325,, -BTS_TSA,212,NAICS_2012_Code,21239,, -BTS_TSA,212,NAICS_2012_Code,212391,, -BTS_TSA,212,NAICS_2012_Code,212392,, -BTS_TSA,212,NAICS_2012_Code,212393,, -BTS_TSA,212,NAICS_2012_Code,212399,, -BTS_TSA,213,NAICS_2012_Code,213,, -BTS_TSA,213,NAICS_2012_Code,2131,, -BTS_TSA,213,NAICS_2012_Code,21311,, -BTS_TSA,213,NAICS_2012_Code,213111,, -BTS_TSA,213,NAICS_2012_Code,213112,, -BTS_TSA,213,NAICS_2012_Code,213113,, -BTS_TSA,213,NAICS_2012_Code,213114,, -BTS_TSA,213,NAICS_2012_Code,213115,, -BTS_TSA,22,NAICS_2012_Code,22,, -BTS_TSA,22,NAICS_2012_Code,221,, -BTS_TSA,22,NAICS_2012_Code,2211,, -BTS_TSA,22,NAICS_2012_Code,22111,, -BTS_TSA,22,NAICS_2012_Code,221111,, -BTS_TSA,22,NAICS_2012_Code,221112,, -BTS_TSA,22,NAICS_2012_Code,221113,, -BTS_TSA,22,NAICS_2012_Code,221114,, -BTS_TSA,22,NAICS_2012_Code,221115,, -BTS_TSA,22,NAICS_2012_Code,221116,, -BTS_TSA,22,NAICS_2012_Code,221117,, -BTS_TSA,22,NAICS_2012_Code,221118,, -BTS_TSA,22,NAICS_2012_Code,22112,, -BTS_TSA,22,NAICS_2012_Code,221121,, -BTS_TSA,22,NAICS_2012_Code,221122,, -BTS_TSA,22,NAICS_2012_Code,2212,, -BTS_TSA,22,NAICS_2012_Code,22121,, -BTS_TSA,22,NAICS_2012_Code,221210,, -BTS_TSA,22,NAICS_2012_Code,2213,, -BTS_TSA,22,NAICS_2012_Code,22131,, -BTS_TSA,22,NAICS_2012_Code,221310,, -BTS_TSA,22,NAICS_2012_Code,22132,, -BTS_TSA,22,NAICS_2012_Code,221320,, -BTS_TSA,22,NAICS_2012_Code,22133,, -BTS_TSA,22,NAICS_2012_Code,221330,, -BTS_TSA,23,NAICS_2012_Code,23,, -BTS_TSA,23,NAICS_2012_Code,236,, -BTS_TSA,23,NAICS_2012_Code,2361,, -BTS_TSA,23,NAICS_2012_Code,23611,, -BTS_TSA,23,NAICS_2012_Code,236115,, -BTS_TSA,23,NAICS_2012_Code,236116,, -BTS_TSA,23,NAICS_2012_Code,236117,, -BTS_TSA,23,NAICS_2012_Code,236118,, -BTS_TSA,23,NAICS_2012_Code,2362,, -BTS_TSA,23,NAICS_2012_Code,23621,, -BTS_TSA,23,NAICS_2012_Code,236210,, -BTS_TSA,23,NAICS_2012_Code,23622,, -BTS_TSA,23,NAICS_2012_Code,236220,, -BTS_TSA,23,NAICS_2012_Code,237,, -BTS_TSA,23,NAICS_2012_Code,2371,, -BTS_TSA,23,NAICS_2012_Code,23711,, -BTS_TSA,23,NAICS_2012_Code,237110,, -BTS_TSA,23,NAICS_2012_Code,23712,, -BTS_TSA,23,NAICS_2012_Code,237120,, -BTS_TSA,23,NAICS_2012_Code,23713,, -BTS_TSA,23,NAICS_2012_Code,237130,, -BTS_TSA,23,NAICS_2012_Code,2372,, -BTS_TSA,23,NAICS_2012_Code,23721,, -BTS_TSA,23,NAICS_2012_Code,237210,, -BTS_TSA,23,NAICS_2012_Code,2373,, -BTS_TSA,23,NAICS_2012_Code,23731,, -BTS_TSA,23,NAICS_2012_Code,237310,, -BTS_TSA,23,NAICS_2012_Code,2379,, -BTS_TSA,23,NAICS_2012_Code,23799,, -BTS_TSA,23,NAICS_2012_Code,237990,, -BTS_TSA,23,NAICS_2012_Code,238,, -BTS_TSA,23,NAICS_2012_Code,2381,, -BTS_TSA,23,NAICS_2012_Code,23811,, -BTS_TSA,23,NAICS_2012_Code,238110,, -BTS_TSA,23,NAICS_2012_Code,23812,, -BTS_TSA,23,NAICS_2012_Code,238120,, -BTS_TSA,23,NAICS_2012_Code,23813,, -BTS_TSA,23,NAICS_2012_Code,238130,, -BTS_TSA,23,NAICS_2012_Code,23814,, -BTS_TSA,23,NAICS_2012_Code,238140,, -BTS_TSA,23,NAICS_2012_Code,23815,, -BTS_TSA,23,NAICS_2012_Code,238150,, -BTS_TSA,23,NAICS_2012_Code,23816,, -BTS_TSA,23,NAICS_2012_Code,238160,, -BTS_TSA,23,NAICS_2012_Code,23817,, -BTS_TSA,23,NAICS_2012_Code,238170,, -BTS_TSA,23,NAICS_2012_Code,23819,, -BTS_TSA,23,NAICS_2012_Code,238190,, -BTS_TSA,23,NAICS_2012_Code,2382,, -BTS_TSA,23,NAICS_2012_Code,23821,, -BTS_TSA,23,NAICS_2012_Code,238210,, -BTS_TSA,23,NAICS_2012_Code,23822,, -BTS_TSA,23,NAICS_2012_Code,238220,, -BTS_TSA,23,NAICS_2012_Code,23829,, -BTS_TSA,23,NAICS_2012_Code,238290,, -BTS_TSA,23,NAICS_2012_Code,2383,, -BTS_TSA,23,NAICS_2012_Code,23831,, -BTS_TSA,23,NAICS_2012_Code,238310,, -BTS_TSA,23,NAICS_2012_Code,23832,, -BTS_TSA,23,NAICS_2012_Code,238320,, -BTS_TSA,23,NAICS_2012_Code,23833,, -BTS_TSA,23,NAICS_2012_Code,238330,, -BTS_TSA,23,NAICS_2012_Code,23834,, -BTS_TSA,23,NAICS_2012_Code,238340,, -BTS_TSA,23,NAICS_2012_Code,23835,, -BTS_TSA,23,NAICS_2012_Code,238350,, -BTS_TSA,23,NAICS_2012_Code,23839,, -BTS_TSA,23,NAICS_2012_Code,238390,, -BTS_TSA,23,NAICS_2012_Code,2389,, -BTS_TSA,23,NAICS_2012_Code,23891,, -BTS_TSA,23,NAICS_2012_Code,238910,, -BTS_TSA,23,NAICS_2012_Code,23899,, -BTS_TSA,23,NAICS_2012_Code,238990,, -BTS_TSA,311FT,NAICS_2012_Code,31,, -BTS_TSA,313TT,NAICS_2012_Code,31,, -BTS_TSA,315AL,NAICS_2012_Code,31,, -BTS_TSA,311FT,NAICS_2012_Code,311,, -BTS_TSA,311FT,NAICS_2012_Code,3111,, -BTS_TSA,311FT,NAICS_2012_Code,31111,, -BTS_TSA,311FT,NAICS_2012_Code,311111,, -BTS_TSA,311FT,NAICS_2012_Code,311119,, -BTS_TSA,311FT,NAICS_2012_Code,3112,, -BTS_TSA,311FT,NAICS_2012_Code,31121,, -BTS_TSA,311FT,NAICS_2012_Code,311211,, -BTS_TSA,311FT,NAICS_2012_Code,311212,, -BTS_TSA,311FT,NAICS_2012_Code,311213,, -BTS_TSA,311FT,NAICS_2012_Code,31122,, -BTS_TSA,311FT,NAICS_2012_Code,311221,, -BTS_TSA,311FT,NAICS_2012_Code,311224,, -BTS_TSA,311FT,NAICS_2012_Code,311225,, -BTS_TSA,311FT,NAICS_2012_Code,31123,, -BTS_TSA,311FT,NAICS_2012_Code,311230,, -BTS_TSA,311FT,NAICS_2012_Code,3113,, -BTS_TSA,311FT,NAICS_2012_Code,31131,, -BTS_TSA,311FT,NAICS_2012_Code,311313,, -BTS_TSA,311FT,NAICS_2012_Code,311314,, -BTS_TSA,311FT,NAICS_2012_Code,31134,, -BTS_TSA,311FT,NAICS_2012_Code,311340,, -BTS_TSA,311FT,NAICS_2012_Code,31135,, -BTS_TSA,311FT,NAICS_2012_Code,311351,, -BTS_TSA,311FT,NAICS_2012_Code,311352,, -BTS_TSA,311FT,NAICS_2012_Code,3114,, -BTS_TSA,311FT,NAICS_2012_Code,31141,, -BTS_TSA,311FT,NAICS_2012_Code,311411,, -BTS_TSA,311FT,NAICS_2012_Code,311412,, -BTS_TSA,311FT,NAICS_2012_Code,31142,, -BTS_TSA,311FT,NAICS_2012_Code,311421,, -BTS_TSA,311FT,NAICS_2012_Code,311422,, -BTS_TSA,311FT,NAICS_2012_Code,311423,, -BTS_TSA,311FT,NAICS_2012_Code,3115,, -BTS_TSA,311FT,NAICS_2012_Code,31151,, -BTS_TSA,311FT,NAICS_2012_Code,311511,, -BTS_TSA,311FT,NAICS_2012_Code,311512,, -BTS_TSA,311FT,NAICS_2012_Code,311513,, -BTS_TSA,311FT,NAICS_2012_Code,311514,, -BTS_TSA,311FT,NAICS_2012_Code,31152,, -BTS_TSA,311FT,NAICS_2012_Code,311520,, -BTS_TSA,311FT,NAICS_2012_Code,3116,, -BTS_TSA,311FT,NAICS_2012_Code,31161,, -BTS_TSA,311FT,NAICS_2012_Code,311611,, -BTS_TSA,311FT,NAICS_2012_Code,311612,, -BTS_TSA,311FT,NAICS_2012_Code,311613,, -BTS_TSA,311FT,NAICS_2012_Code,311615,, -BTS_TSA,311FT,NAICS_2012_Code,3117,, -BTS_TSA,311FT,NAICS_2012_Code,31171,, -BTS_TSA,311FT,NAICS_2012_Code,311710,, -BTS_TSA,311FT,NAICS_2012_Code,3118,, -BTS_TSA,311FT,NAICS_2012_Code,31181,, -BTS_TSA,311FT,NAICS_2012_Code,311811,, -BTS_TSA,311FT,NAICS_2012_Code,311812,, -BTS_TSA,311FT,NAICS_2012_Code,311813,, -BTS_TSA,311FT,NAICS_2012_Code,31182,, -BTS_TSA,311FT,NAICS_2012_Code,311821,, -BTS_TSA,311FT,NAICS_2012_Code,311824,, -BTS_TSA,311FT,NAICS_2012_Code,31183,, -BTS_TSA,311FT,NAICS_2012_Code,311830,, -BTS_TSA,311FT,NAICS_2012_Code,3119,, -BTS_TSA,311FT,NAICS_2012_Code,31191,, -BTS_TSA,311FT,NAICS_2012_Code,311911,, -BTS_TSA,311FT,NAICS_2012_Code,311919,, -BTS_TSA,311FT,NAICS_2012_Code,31192,, -BTS_TSA,311FT,NAICS_2012_Code,311920,, -BTS_TSA,311FT,NAICS_2012_Code,31193,, -BTS_TSA,311FT,NAICS_2012_Code,311930,, -BTS_TSA,311FT,NAICS_2012_Code,31194,, -BTS_TSA,311FT,NAICS_2012_Code,311941,, -BTS_TSA,311FT,NAICS_2012_Code,311942,, -BTS_TSA,311FT,NAICS_2012_Code,31199,, -BTS_TSA,311FT,NAICS_2012_Code,311991,, -BTS_TSA,311FT,NAICS_2012_Code,311999,, -BTS_TSA,311FT,NAICS_2012_Code,312,, -BTS_TSA,311FT,NAICS_2012_Code,3121,, -BTS_TSA,311FT,NAICS_2012_Code,31211,, -BTS_TSA,311FT,NAICS_2012_Code,312111,, -BTS_TSA,311FT,NAICS_2012_Code,312112,, -BTS_TSA,311FT,NAICS_2012_Code,312113,, -BTS_TSA,311FT,NAICS_2012_Code,31212,, -BTS_TSA,311FT,NAICS_2012_Code,312120,, -BTS_TSA,311FT,NAICS_2012_Code,31213,, -BTS_TSA,311FT,NAICS_2012_Code,312130,, -BTS_TSA,311FT,NAICS_2012_Code,31214,, -BTS_TSA,311FT,NAICS_2012_Code,312140,, -BTS_TSA,311FT,NAICS_2012_Code,3122,, -BTS_TSA,311FT,NAICS_2012_Code,31223,, -BTS_TSA,311FT,NAICS_2012_Code,312230,, -BTS_TSA,313TT,NAICS_2012_Code,313,, -BTS_TSA,313TT,NAICS_2012_Code,3131,, -BTS_TSA,313TT,NAICS_2012_Code,31311,, -BTS_TSA,313TT,NAICS_2012_Code,313110,, -BTS_TSA,313TT,NAICS_2012_Code,3132,, -BTS_TSA,313TT,NAICS_2012_Code,31321,, -BTS_TSA,313TT,NAICS_2012_Code,313210,, -BTS_TSA,313TT,NAICS_2012_Code,31322,, -BTS_TSA,313TT,NAICS_2012_Code,313220,, -BTS_TSA,313TT,NAICS_2012_Code,31323,, -BTS_TSA,313TT,NAICS_2012_Code,313230,, -BTS_TSA,313TT,NAICS_2012_Code,31324,, -BTS_TSA,313TT,NAICS_2012_Code,313240,, -BTS_TSA,313TT,NAICS_2012_Code,3133,, -BTS_TSA,313TT,NAICS_2012_Code,31331,, -BTS_TSA,313TT,NAICS_2012_Code,313310,, -BTS_TSA,313TT,NAICS_2012_Code,31332,, -BTS_TSA,313TT,NAICS_2012_Code,313320,, -BTS_TSA,313TT,NAICS_2012_Code,314,, -BTS_TSA,313TT,NAICS_2012_Code,3141,, -BTS_TSA,313TT,NAICS_2012_Code,31411,, -BTS_TSA,313TT,NAICS_2012_Code,314110,, -BTS_TSA,313TT,NAICS_2012_Code,31412,, -BTS_TSA,313TT,NAICS_2012_Code,314120,, -BTS_TSA,313TT,NAICS_2012_Code,3149,, -BTS_TSA,313TT,NAICS_2012_Code,31491,, -BTS_TSA,313TT,NAICS_2012_Code,314910,, -BTS_TSA,313TT,NAICS_2012_Code,31499,, -BTS_TSA,313TT,NAICS_2012_Code,314994,, -BTS_TSA,313TT,NAICS_2012_Code,314999,, -BTS_TSA,315AL,NAICS_2012_Code,315,, -BTS_TSA,315AL,NAICS_2012_Code,3151,, -BTS_TSA,315AL,NAICS_2012_Code,31511,, -BTS_TSA,315AL,NAICS_2012_Code,315110,, -BTS_TSA,315AL,NAICS_2012_Code,31519,, -BTS_TSA,315AL,NAICS_2012_Code,315190,, -BTS_TSA,315AL,NAICS_2012_Code,3152,, -BTS_TSA,315AL,NAICS_2012_Code,31521,, -BTS_TSA,315AL,NAICS_2012_Code,315210,, -BTS_TSA,315AL,NAICS_2012_Code,31522,, -BTS_TSA,315AL,NAICS_2012_Code,315220,, -BTS_TSA,315AL,NAICS_2012_Code,31524,, -BTS_TSA,315AL,NAICS_2012_Code,315240,, -BTS_TSA,315AL,NAICS_2012_Code,31528,, -BTS_TSA,315AL,NAICS_2012_Code,315280,, -BTS_TSA,315AL,NAICS_2012_Code,3159,, -BTS_TSA,315AL,NAICS_2012_Code,31599,, -BTS_TSA,315AL,NAICS_2012_Code,315990,, -BTS_TSA,315AL,NAICS_2012_Code,316,, -BTS_TSA,315AL,NAICS_2012_Code,3161,, -BTS_TSA,315AL,NAICS_2012_Code,31611,, -BTS_TSA,315AL,NAICS_2012_Code,316110,, -BTS_TSA,315AL,NAICS_2012_Code,3162,, -BTS_TSA,315AL,NAICS_2012_Code,31621,, -BTS_TSA,315AL,NAICS_2012_Code,316210,, -BTS_TSA,315AL,NAICS_2012_Code,3169,, -BTS_TSA,315AL,NAICS_2012_Code,31699,, -BTS_TSA,315AL,NAICS_2012_Code,316992,, -BTS_TSA,315AL,NAICS_2012_Code,316998,, -BTS_TSA,321,NAICS_2012_Code,32,, -BTS_TSA,322,NAICS_2012_Code,32,, -BTS_TSA,323,NAICS_2012_Code,32,, -BTS_TSA,324,NAICS_2012_Code,32,, -BTS_TSA,325,NAICS_2012_Code,32,, -BTS_TSA,326,NAICS_2012_Code,32,, -BTS_TSA,327,NAICS_2012_Code,32,, -BTS_TSA,321,NAICS_2012_Code,321,, -BTS_TSA,321,NAICS_2012_Code,3211,, -BTS_TSA,321,NAICS_2012_Code,32111,, -BTS_TSA,321,NAICS_2012_Code,321113,, -BTS_TSA,321,NAICS_2012_Code,321114,, -BTS_TSA,321,NAICS_2012_Code,3212,, -BTS_TSA,321,NAICS_2012_Code,32121,, -BTS_TSA,321,NAICS_2012_Code,321211,, -BTS_TSA,321,NAICS_2012_Code,321212,, -BTS_TSA,321,NAICS_2012_Code,321213,, -BTS_TSA,321,NAICS_2012_Code,321214,, -BTS_TSA,321,NAICS_2012_Code,321219,, -BTS_TSA,321,NAICS_2012_Code,3219,, -BTS_TSA,321,NAICS_2012_Code,32191,, -BTS_TSA,321,NAICS_2012_Code,321911,, -BTS_TSA,321,NAICS_2012_Code,321912,, -BTS_TSA,321,NAICS_2012_Code,321918,, -BTS_TSA,321,NAICS_2012_Code,32192,, -BTS_TSA,321,NAICS_2012_Code,321920,, -BTS_TSA,321,NAICS_2012_Code,32199,, -BTS_TSA,321,NAICS_2012_Code,321991,, -BTS_TSA,321,NAICS_2012_Code,321992,, -BTS_TSA,321,NAICS_2012_Code,321999,, -BTS_TSA,322,NAICS_2012_Code,322,, -BTS_TSA,322,NAICS_2012_Code,3221,, -BTS_TSA,322,NAICS_2012_Code,32211,, -BTS_TSA,322,NAICS_2012_Code,322110,, -BTS_TSA,322,NAICS_2012_Code,32212,, -BTS_TSA,322,NAICS_2012_Code,322121,, -BTS_TSA,322,NAICS_2012_Code,322122,, -BTS_TSA,322,NAICS_2012_Code,32213,, -BTS_TSA,322,NAICS_2012_Code,322130,, -BTS_TSA,322,NAICS_2012_Code,3222,, -BTS_TSA,322,NAICS_2012_Code,32221,, -BTS_TSA,322,NAICS_2012_Code,322211,, -BTS_TSA,322,NAICS_2012_Code,322212,, -BTS_TSA,322,NAICS_2012_Code,322219,, -BTS_TSA,322,NAICS_2012_Code,32222,, -BTS_TSA,322,NAICS_2012_Code,322220,, -BTS_TSA,322,NAICS_2012_Code,32223,, -BTS_TSA,322,NAICS_2012_Code,322230,, -BTS_TSA,322,NAICS_2012_Code,32229,, -BTS_TSA,322,NAICS_2012_Code,322291,, -BTS_TSA,322,NAICS_2012_Code,322299,, -BTS_TSA,323,NAICS_2012_Code,323,, -BTS_TSA,323,NAICS_2012_Code,3231,, -BTS_TSA,323,NAICS_2012_Code,32311,, -BTS_TSA,323,NAICS_2012_Code,323111,, -BTS_TSA,323,NAICS_2012_Code,323113,, -BTS_TSA,323,NAICS_2012_Code,323117,, -BTS_TSA,323,NAICS_2012_Code,32312,, -BTS_TSA,323,NAICS_2012_Code,323120,, -BTS_TSA,324,NAICS_2012_Code,324,, -BTS_TSA,324,NAICS_2012_Code,3241,, -BTS_TSA,324,NAICS_2012_Code,32411,, -BTS_TSA,324,NAICS_2012_Code,324110,, -BTS_TSA,324,NAICS_2012_Code,32412,, -BTS_TSA,324,NAICS_2012_Code,324121,, -BTS_TSA,324,NAICS_2012_Code,324122,, -BTS_TSA,324,NAICS_2012_Code,32419,, -BTS_TSA,324,NAICS_2012_Code,324191,, -BTS_TSA,324,NAICS_2012_Code,324199,, -BTS_TSA,325,NAICS_2012_Code,325,, -BTS_TSA,325,NAICS_2012_Code,3251,, -BTS_TSA,325,NAICS_2012_Code,32511,, -BTS_TSA,325,NAICS_2012_Code,325110,, -BTS_TSA,325,NAICS_2012_Code,32512,, -BTS_TSA,325,NAICS_2012_Code,325120,, -BTS_TSA,325,NAICS_2012_Code,32513,, -BTS_TSA,325,NAICS_2012_Code,325130,, -BTS_TSA,325,NAICS_2012_Code,32518,, -BTS_TSA,325,NAICS_2012_Code,325180,, -BTS_TSA,325,NAICS_2012_Code,32519,, -BTS_TSA,325,NAICS_2012_Code,325193,, -BTS_TSA,325,NAICS_2012_Code,325194,, -BTS_TSA,325,NAICS_2012_Code,325199,, -BTS_TSA,325,NAICS_2012_Code,3252,, -BTS_TSA,325,NAICS_2012_Code,32521,, -BTS_TSA,325,NAICS_2012_Code,325211,, -BTS_TSA,325,NAICS_2012_Code,325212,, -BTS_TSA,325,NAICS_2012_Code,32522,, -BTS_TSA,325,NAICS_2012_Code,325220,, -BTS_TSA,325,NAICS_2012_Code,3253,, -BTS_TSA,325,NAICS_2012_Code,32531,, -BTS_TSA,325,NAICS_2012_Code,325311,, -BTS_TSA,325,NAICS_2012_Code,325312,, -BTS_TSA,325,NAICS_2012_Code,325314,, -BTS_TSA,325,NAICS_2012_Code,32532,, -BTS_TSA,325,NAICS_2012_Code,325320,, -BTS_TSA,325,NAICS_2012_Code,3254,, -BTS_TSA,325,NAICS_2012_Code,32541,, -BTS_TSA,325,NAICS_2012_Code,325411,, -BTS_TSA,325,NAICS_2012_Code,325412,, -BTS_TSA,325,NAICS_2012_Code,325413,, -BTS_TSA,325,NAICS_2012_Code,325414,, -BTS_TSA,325,NAICS_2012_Code,3255,, -BTS_TSA,325,NAICS_2012_Code,32551,, -BTS_TSA,325,NAICS_2012_Code,325510,, -BTS_TSA,325,NAICS_2012_Code,32552,, -BTS_TSA,325,NAICS_2012_Code,325520,, -BTS_TSA,325,NAICS_2012_Code,3256,, -BTS_TSA,325,NAICS_2012_Code,32561,, -BTS_TSA,325,NAICS_2012_Code,325611,, -BTS_TSA,325,NAICS_2012_Code,325612,, -BTS_TSA,325,NAICS_2012_Code,325613,, -BTS_TSA,325,NAICS_2012_Code,32562,, -BTS_TSA,325,NAICS_2012_Code,325620,, -BTS_TSA,325,NAICS_2012_Code,3259,, -BTS_TSA,325,NAICS_2012_Code,32591,, -BTS_TSA,325,NAICS_2012_Code,325910,, -BTS_TSA,325,NAICS_2012_Code,32592,, -BTS_TSA,325,NAICS_2012_Code,325920,, -BTS_TSA,325,NAICS_2012_Code,32599,, -BTS_TSA,325,NAICS_2012_Code,325991,, -BTS_TSA,325,NAICS_2012_Code,325992,, -BTS_TSA,325,NAICS_2012_Code,325998,, -BTS_TSA,326,NAICS_2012_Code,326,, -BTS_TSA,326,NAICS_2012_Code,3261,, -BTS_TSA,326,NAICS_2012_Code,32611,, -BTS_TSA,326,NAICS_2012_Code,326111,, -BTS_TSA,326,NAICS_2012_Code,326112,, -BTS_TSA,326,NAICS_2012_Code,326113,, -BTS_TSA,326,NAICS_2012_Code,32612,, -BTS_TSA,326,NAICS_2012_Code,326121,, -BTS_TSA,326,NAICS_2012_Code,326122,, -BTS_TSA,326,NAICS_2012_Code,32613,, -BTS_TSA,326,NAICS_2012_Code,326130,, -BTS_TSA,326,NAICS_2012_Code,32614,, -BTS_TSA,326,NAICS_2012_Code,326140,, -BTS_TSA,326,NAICS_2012_Code,32615,, -BTS_TSA,326,NAICS_2012_Code,326150,, -BTS_TSA,326,NAICS_2012_Code,32616,, -BTS_TSA,326,NAICS_2012_Code,326160,, -BTS_TSA,326,NAICS_2012_Code,32619,, -BTS_TSA,326,NAICS_2012_Code,326191,, -BTS_TSA,326,NAICS_2012_Code,326199,, -BTS_TSA,326,NAICS_2012_Code,3262,, -BTS_TSA,326,NAICS_2012_Code,32621,, -BTS_TSA,326,NAICS_2012_Code,326211,, -BTS_TSA,326,NAICS_2012_Code,326212,, -BTS_TSA,326,NAICS_2012_Code,32622,, -BTS_TSA,326,NAICS_2012_Code,326220,, -BTS_TSA,326,NAICS_2012_Code,32629,, -BTS_TSA,326,NAICS_2012_Code,326291,, -BTS_TSA,326,NAICS_2012_Code,326299,, -BTS_TSA,327,NAICS_2012_Code,327,, -BTS_TSA,327,NAICS_2012_Code,3271,, -BTS_TSA,327,NAICS_2012_Code,32711,, -BTS_TSA,327,NAICS_2012_Code,327110,, -BTS_TSA,327,NAICS_2012_Code,32712,, -BTS_TSA,327,NAICS_2012_Code,327120,, -BTS_TSA,327,NAICS_2012_Code,3272,, -BTS_TSA,327,NAICS_2012_Code,32721,, -BTS_TSA,327,NAICS_2012_Code,327211,, -BTS_TSA,327,NAICS_2012_Code,327212,, -BTS_TSA,327,NAICS_2012_Code,327213,, -BTS_TSA,327,NAICS_2012_Code,327215,, -BTS_TSA,327,NAICS_2012_Code,3273,, -BTS_TSA,327,NAICS_2012_Code,32731,, -BTS_TSA,327,NAICS_2012_Code,327310,, -BTS_TSA,327,NAICS_2012_Code,32732,, -BTS_TSA,327,NAICS_2012_Code,327320,, -BTS_TSA,327,NAICS_2012_Code,32733,, -BTS_TSA,327,NAICS_2012_Code,327331,, -BTS_TSA,327,NAICS_2012_Code,327332,, -BTS_TSA,327,NAICS_2012_Code,32739,, -BTS_TSA,327,NAICS_2012_Code,327390,, -BTS_TSA,327,NAICS_2012_Code,3274,, -BTS_TSA,327,NAICS_2012_Code,32741,, -BTS_TSA,327,NAICS_2012_Code,327410,, -BTS_TSA,327,NAICS_2012_Code,32742,, -BTS_TSA,327,NAICS_2012_Code,327420,, -BTS_TSA,327,NAICS_2012_Code,3279,, -BTS_TSA,327,NAICS_2012_Code,32791,, -BTS_TSA,327,NAICS_2012_Code,327910,, -BTS_TSA,327,NAICS_2012_Code,32799,, -BTS_TSA,327,NAICS_2012_Code,327991,, -BTS_TSA,327,NAICS_2012_Code,327992,, -BTS_TSA,327,NAICS_2012_Code,327993,, -BTS_TSA,327,NAICS_2012_Code,327999,, -BTS_TSA,331,NAICS_2012_Code,33,, -BTS_TSA,332,NAICS_2012_Code,33,, -BTS_TSA,333,NAICS_2012_Code,33,, -BTS_TSA,334,NAICS_2012_Code,33,, -BTS_TSA,335,NAICS_2012_Code,33,, -BTS_TSA,3361MV,NAICS_2012_Code,33,, -BTS_TSA,3364OT,NAICS_2012_Code,33,, -BTS_TSA,337,NAICS_2012_Code,33,, -BTS_TSA,339,NAICS_2012_Code,33,, -BTS_TSA,331,NAICS_2012_Code,331,, -BTS_TSA,331,NAICS_2012_Code,3311,, -BTS_TSA,331,NAICS_2012_Code,33111,, -BTS_TSA,331,NAICS_2012_Code,331110,, -BTS_TSA,331,NAICS_2012_Code,3312,, -BTS_TSA,331,NAICS_2012_Code,33121,, -BTS_TSA,331,NAICS_2012_Code,331210,, -BTS_TSA,331,NAICS_2012_Code,33122,, -BTS_TSA,331,NAICS_2012_Code,331221,, -BTS_TSA,331,NAICS_2012_Code,331222,, -BTS_TSA,331,NAICS_2012_Code,3313,, -BTS_TSA,331,NAICS_2012_Code,33131,, -BTS_TSA,331,NAICS_2012_Code,331313,, -BTS_TSA,331,NAICS_2012_Code,331314,, -BTS_TSA,331,NAICS_2012_Code,331315,, -BTS_TSA,331,NAICS_2012_Code,331318,, -BTS_TSA,331,NAICS_2012_Code,3314,, -BTS_TSA,331,NAICS_2012_Code,33141,, -BTS_TSA,331,NAICS_2012_Code,331410,, -BTS_TSA,331,NAICS_2012_Code,33142,, -BTS_TSA,331,NAICS_2012_Code,331420,, -BTS_TSA,331,NAICS_2012_Code,33149,, -BTS_TSA,331,NAICS_2012_Code,331491,, -BTS_TSA,331,NAICS_2012_Code,331492,, -BTS_TSA,331,NAICS_2012_Code,3315,, -BTS_TSA,331,NAICS_2012_Code,33151,, -BTS_TSA,331,NAICS_2012_Code,331511,, -BTS_TSA,331,NAICS_2012_Code,331512,, -BTS_TSA,331,NAICS_2012_Code,331513,, -BTS_TSA,331,NAICS_2012_Code,33152,, -BTS_TSA,331,NAICS_2012_Code,331523,, -BTS_TSA,331,NAICS_2012_Code,331524,, -BTS_TSA,331,NAICS_2012_Code,331529,, -BTS_TSA,332,NAICS_2012_Code,332,, -BTS_TSA,332,NAICS_2012_Code,3321,, -BTS_TSA,332,NAICS_2012_Code,33211,, -BTS_TSA,332,NAICS_2012_Code,332111,, -BTS_TSA,332,NAICS_2012_Code,332112,, -BTS_TSA,332,NAICS_2012_Code,332114,, -BTS_TSA,332,NAICS_2012_Code,332117,, -BTS_TSA,332,NAICS_2012_Code,332119,, -BTS_TSA,332,NAICS_2012_Code,3322,, -BTS_TSA,332,NAICS_2012_Code,33221,, -BTS_TSA,332,NAICS_2012_Code,332215,, -BTS_TSA,332,NAICS_2012_Code,332216,, -BTS_TSA,332,NAICS_2012_Code,3323,, -BTS_TSA,332,NAICS_2012_Code,33231,, -BTS_TSA,332,NAICS_2012_Code,332311,, -BTS_TSA,332,NAICS_2012_Code,332312,, -BTS_TSA,332,NAICS_2012_Code,332313,, -BTS_TSA,332,NAICS_2012_Code,33232,, -BTS_TSA,332,NAICS_2012_Code,332321,, -BTS_TSA,332,NAICS_2012_Code,332322,, -BTS_TSA,332,NAICS_2012_Code,332323,, -BTS_TSA,332,NAICS_2012_Code,3324,, -BTS_TSA,332,NAICS_2012_Code,33241,, -BTS_TSA,332,NAICS_2012_Code,332410,, -BTS_TSA,332,NAICS_2012_Code,33242,, -BTS_TSA,332,NAICS_2012_Code,332420,, -BTS_TSA,332,NAICS_2012_Code,33243,, -BTS_TSA,332,NAICS_2012_Code,332431,, -BTS_TSA,332,NAICS_2012_Code,332439,, -BTS_TSA,332,NAICS_2012_Code,3325,, -BTS_TSA,332,NAICS_2012_Code,33251,, -BTS_TSA,332,NAICS_2012_Code,332510,, -BTS_TSA,332,NAICS_2012_Code,3326,, -BTS_TSA,332,NAICS_2012_Code,33261,, -BTS_TSA,332,NAICS_2012_Code,332613,, -BTS_TSA,332,NAICS_2012_Code,332618,, -BTS_TSA,332,NAICS_2012_Code,3327,, -BTS_TSA,332,NAICS_2012_Code,33271,, -BTS_TSA,332,NAICS_2012_Code,332710,, -BTS_TSA,332,NAICS_2012_Code,33272,, -BTS_TSA,332,NAICS_2012_Code,332721,, -BTS_TSA,332,NAICS_2012_Code,332722,, -BTS_TSA,332,NAICS_2012_Code,3328,, -BTS_TSA,332,NAICS_2012_Code,33281,, -BTS_TSA,332,NAICS_2012_Code,332811,, -BTS_TSA,332,NAICS_2012_Code,332812,, -BTS_TSA,332,NAICS_2012_Code,332813,, -BTS_TSA,332,NAICS_2012_Code,3329,, -BTS_TSA,332,NAICS_2012_Code,33291,, -BTS_TSA,332,NAICS_2012_Code,332911,, -BTS_TSA,332,NAICS_2012_Code,332912,, -BTS_TSA,332,NAICS_2012_Code,332913,, -BTS_TSA,332,NAICS_2012_Code,332919,, -BTS_TSA,332,NAICS_2012_Code,33299,, -BTS_TSA,332,NAICS_2012_Code,332991,, -BTS_TSA,332,NAICS_2012_Code,332992,, -BTS_TSA,332,NAICS_2012_Code,332993,, -BTS_TSA,332,NAICS_2012_Code,332994,, -BTS_TSA,332,NAICS_2012_Code,332996,, -BTS_TSA,332,NAICS_2012_Code,332999,, -BTS_TSA,333,NAICS_2012_Code,333,, -BTS_TSA,333,NAICS_2012_Code,3331,, -BTS_TSA,333,NAICS_2012_Code,33311,, -BTS_TSA,333,NAICS_2012_Code,333111,, -BTS_TSA,333,NAICS_2012_Code,333112,, -BTS_TSA,333,NAICS_2012_Code,33312,, -BTS_TSA,333,NAICS_2012_Code,333120,, -BTS_TSA,333,NAICS_2012_Code,33313,, -BTS_TSA,333,NAICS_2012_Code,333131,, -BTS_TSA,333,NAICS_2012_Code,333132,, -BTS_TSA,333,NAICS_2012_Code,3332,, -BTS_TSA,333,NAICS_2012_Code,33324,, -BTS_TSA,333,NAICS_2012_Code,333241,, -BTS_TSA,333,NAICS_2012_Code,333242,, -BTS_TSA,333,NAICS_2012_Code,333243,, -BTS_TSA,333,NAICS_2012_Code,333244,, -BTS_TSA,333,NAICS_2012_Code,333249,, -BTS_TSA,333,NAICS_2012_Code,3333,, -BTS_TSA,333,NAICS_2012_Code,33331,, -BTS_TSA,333,NAICS_2012_Code,333314,, -BTS_TSA,333,NAICS_2012_Code,333316,, -BTS_TSA,333,NAICS_2012_Code,333318,, -BTS_TSA,333,NAICS_2012_Code,3334,, -BTS_TSA,333,NAICS_2012_Code,33341,, -BTS_TSA,333,NAICS_2012_Code,333413,, -BTS_TSA,333,NAICS_2012_Code,333414,, -BTS_TSA,333,NAICS_2012_Code,333415,, -BTS_TSA,333,NAICS_2012_Code,3335,, -BTS_TSA,333,NAICS_2012_Code,33351,, -BTS_TSA,333,NAICS_2012_Code,333511,, -BTS_TSA,333,NAICS_2012_Code,333514,, -BTS_TSA,333,NAICS_2012_Code,333515,, -BTS_TSA,333,NAICS_2012_Code,333517,, -BTS_TSA,333,NAICS_2012_Code,333519,, -BTS_TSA,333,NAICS_2012_Code,3336,, -BTS_TSA,333,NAICS_2012_Code,33361,, -BTS_TSA,333,NAICS_2012_Code,333611,, -BTS_TSA,333,NAICS_2012_Code,333612,, -BTS_TSA,333,NAICS_2012_Code,333613,, -BTS_TSA,333,NAICS_2012_Code,333618,, -BTS_TSA,333,NAICS_2012_Code,3339,, -BTS_TSA,333,NAICS_2012_Code,33391,, -BTS_TSA,333,NAICS_2012_Code,333911,, -BTS_TSA,333,NAICS_2012_Code,333912,, -BTS_TSA,333,NAICS_2012_Code,333913,, -BTS_TSA,333,NAICS_2012_Code,33392,, -BTS_TSA,333,NAICS_2012_Code,333921,, -BTS_TSA,333,NAICS_2012_Code,333922,, -BTS_TSA,333,NAICS_2012_Code,333923,, -BTS_TSA,333,NAICS_2012_Code,333924,, -BTS_TSA,333,NAICS_2012_Code,33399,, -BTS_TSA,333,NAICS_2012_Code,333991,, -BTS_TSA,333,NAICS_2012_Code,333992,, -BTS_TSA,333,NAICS_2012_Code,333993,, -BTS_TSA,333,NAICS_2012_Code,333994,, -BTS_TSA,333,NAICS_2012_Code,333995,, -BTS_TSA,333,NAICS_2012_Code,333996,, -BTS_TSA,333,NAICS_2012_Code,333997,, -BTS_TSA,333,NAICS_2012_Code,333999,, -BTS_TSA,334,NAICS_2012_Code,334,, -BTS_TSA,334,NAICS_2012_Code,3341,, -BTS_TSA,334,NAICS_2012_Code,33411,, -BTS_TSA,334,NAICS_2012_Code,334111,, -BTS_TSA,334,NAICS_2012_Code,334112,, -BTS_TSA,334,NAICS_2012_Code,334118,, -BTS_TSA,334,NAICS_2012_Code,3342,, -BTS_TSA,334,NAICS_2012_Code,33421,, -BTS_TSA,334,NAICS_2012_Code,334210,, -BTS_TSA,334,NAICS_2012_Code,33422,, -BTS_TSA,334,NAICS_2012_Code,334220,, -BTS_TSA,334,NAICS_2012_Code,33429,, -BTS_TSA,334,NAICS_2012_Code,334290,, -BTS_TSA,334,NAICS_2012_Code,3343,, -BTS_TSA,334,NAICS_2012_Code,33431,, -BTS_TSA,334,NAICS_2012_Code,334310,, -BTS_TSA,334,NAICS_2012_Code,3344,, -BTS_TSA,334,NAICS_2012_Code,33441,, -BTS_TSA,334,NAICS_2012_Code,334412,, -BTS_TSA,334,NAICS_2012_Code,334413,, -BTS_TSA,334,NAICS_2012_Code,334416,, -BTS_TSA,334,NAICS_2012_Code,334417,, -BTS_TSA,334,NAICS_2012_Code,334418,, -BTS_TSA,334,NAICS_2012_Code,334419,, -BTS_TSA,334,NAICS_2012_Code,3345,, -BTS_TSA,334,NAICS_2012_Code,33451,, -BTS_TSA,334,NAICS_2012_Code,334510,, -BTS_TSA,334,NAICS_2012_Code,334511,, -BTS_TSA,334,NAICS_2012_Code,334512,, -BTS_TSA,334,NAICS_2012_Code,334513,, -BTS_TSA,334,NAICS_2012_Code,334514,, -BTS_TSA,334,NAICS_2012_Code,334515,, -BTS_TSA,334,NAICS_2012_Code,334516,, -BTS_TSA,334,NAICS_2012_Code,334517,, -BTS_TSA,334,NAICS_2012_Code,334519,, -BTS_TSA,334,NAICS_2012_Code,3346,, -BTS_TSA,334,NAICS_2012_Code,33461,, -BTS_TSA,334,NAICS_2012_Code,334613,, -BTS_TSA,334,NAICS_2012_Code,334614,, -BTS_TSA,335,NAICS_2012_Code,335,, -BTS_TSA,335,NAICS_2012_Code,3351,, -BTS_TSA,335,NAICS_2012_Code,33511,, -BTS_TSA,335,NAICS_2012_Code,335110,, -BTS_TSA,335,NAICS_2012_Code,33512,, -BTS_TSA,335,NAICS_2012_Code,335121,, -BTS_TSA,335,NAICS_2012_Code,335122,, -BTS_TSA,335,NAICS_2012_Code,335129,, -BTS_TSA,335,NAICS_2012_Code,3352,, -BTS_TSA,335,NAICS_2012_Code,33521,, -BTS_TSA,335,NAICS_2012_Code,335210,, -BTS_TSA,335,NAICS_2012_Code,33522,, -BTS_TSA,335,NAICS_2012_Code,335221,, -BTS_TSA,335,NAICS_2012_Code,335222,, -BTS_TSA,335,NAICS_2012_Code,335224,, -BTS_TSA,335,NAICS_2012_Code,335228,, -BTS_TSA,335,NAICS_2012_Code,3353,, -BTS_TSA,335,NAICS_2012_Code,33531,, -BTS_TSA,335,NAICS_2012_Code,335311,, -BTS_TSA,335,NAICS_2012_Code,335312,, -BTS_TSA,335,NAICS_2012_Code,335313,, -BTS_TSA,335,NAICS_2012_Code,335314,, -BTS_TSA,335,NAICS_2012_Code,3359,, -BTS_TSA,335,NAICS_2012_Code,33591,, -BTS_TSA,335,NAICS_2012_Code,335911,, -BTS_TSA,335,NAICS_2012_Code,335912,, -BTS_TSA,335,NAICS_2012_Code,33592,, -BTS_TSA,335,NAICS_2012_Code,335921,, -BTS_TSA,335,NAICS_2012_Code,335929,, -BTS_TSA,335,NAICS_2012_Code,33593,, -BTS_TSA,335,NAICS_2012_Code,335931,, -BTS_TSA,335,NAICS_2012_Code,335932,, -BTS_TSA,335,NAICS_2012_Code,33599,, -BTS_TSA,335,NAICS_2012_Code,335991,, -BTS_TSA,335,NAICS_2012_Code,335999,, -BTS_TSA,3361MV,NAICS_2012_Code,336,, -BTS_TSA,3364OT,NAICS_2012_Code,336,, -BTS_TSA,3361MV,NAICS_2012_Code,3361,, -BTS_TSA,3361MV,NAICS_2012_Code,33611,, -BTS_TSA,3361MV,NAICS_2012_Code,336111,, -BTS_TSA,3361MV,NAICS_2012_Code,336112,, -BTS_TSA,3361MV,NAICS_2012_Code,33612,, -BTS_TSA,3361MV,NAICS_2012_Code,336120,, -BTS_TSA,3361MV,NAICS_2012_Code,3362,, -BTS_TSA,3361MV,NAICS_2012_Code,33621,, -BTS_TSA,3361MV,NAICS_2012_Code,336211,, -BTS_TSA,3361MV,NAICS_2012_Code,336212,, -BTS_TSA,3361MV,NAICS_2012_Code,336213,, -BTS_TSA,3361MV,NAICS_2012_Code,336214,, -BTS_TSA,3361MV,NAICS_2012_Code,3363,, -BTS_TSA,3361MV,NAICS_2012_Code,33631,, -BTS_TSA,3361MV,NAICS_2012_Code,336310,, -BTS_TSA,3361MV,NAICS_2012_Code,33632,, -BTS_TSA,3361MV,NAICS_2012_Code,336320,, -BTS_TSA,3361MV,NAICS_2012_Code,33633,, -BTS_TSA,3361MV,NAICS_2012_Code,336330,, -BTS_TSA,3361MV,NAICS_2012_Code,33634,, -BTS_TSA,3361MV,NAICS_2012_Code,336340,, -BTS_TSA,3361MV,NAICS_2012_Code,33635,, -BTS_TSA,3361MV,NAICS_2012_Code,336350,, -BTS_TSA,3361MV,NAICS_2012_Code,33636,, -BTS_TSA,3361MV,NAICS_2012_Code,336360,, -BTS_TSA,3361MV,NAICS_2012_Code,33637,, -BTS_TSA,3361MV,NAICS_2012_Code,336370,, -BTS_TSA,3361MV,NAICS_2012_Code,33639,, -BTS_TSA,3361MV,NAICS_2012_Code,336390,, -BTS_TSA,3364OT,NAICS_2012_Code,3364,, -BTS_TSA,3364OT,NAICS_2012_Code,33641,, -BTS_TSA,3364OT,NAICS_2012_Code,336411,, -BTS_TSA,3364OT,NAICS_2012_Code,336412,, -BTS_TSA,3364OT,NAICS_2012_Code,336413,, -BTS_TSA,3364OT,NAICS_2012_Code,336414,, -BTS_TSA,3364OT,NAICS_2012_Code,336415,, -BTS_TSA,3364OT,NAICS_2012_Code,336419,, -BTS_TSA,3364OT,NAICS_2012_Code,3365,, -BTS_TSA,3364OT,NAICS_2012_Code,33651,, -BTS_TSA,3364OT,NAICS_2012_Code,336510,, -BTS_TSA,3364OT,NAICS_2012_Code,3366,, -BTS_TSA,3364OT,NAICS_2012_Code,33661,, -BTS_TSA,3364OT,NAICS_2012_Code,336611,, -BTS_TSA,3364OT,NAICS_2012_Code,336612,, -BTS_TSA,3364OT,NAICS_2012_Code,3369,, -BTS_TSA,3364OT,NAICS_2012_Code,33699,, -BTS_TSA,3364OT,NAICS_2012_Code,336991,, -BTS_TSA,3364OT,NAICS_2012_Code,336992,, -BTS_TSA,3364OT,NAICS_2012_Code,336999,, -BTS_TSA,337,NAICS_2012_Code,337,, -BTS_TSA,337,NAICS_2012_Code,3371,, -BTS_TSA,337,NAICS_2012_Code,33711,, -BTS_TSA,337,NAICS_2012_Code,337110,, -BTS_TSA,337,NAICS_2012_Code,33712,, -BTS_TSA,337,NAICS_2012_Code,337121,, -BTS_TSA,337,NAICS_2012_Code,337122,, -BTS_TSA,337,NAICS_2012_Code,337124,, -BTS_TSA,337,NAICS_2012_Code,337125,, -BTS_TSA,337,NAICS_2012_Code,337127,, -BTS_TSA,337,NAICS_2012_Code,3372,, -BTS_TSA,337,NAICS_2012_Code,33721,, -BTS_TSA,337,NAICS_2012_Code,337211,, -BTS_TSA,337,NAICS_2012_Code,337212,, -BTS_TSA,337,NAICS_2012_Code,337214,, -BTS_TSA,337,NAICS_2012_Code,337215,, -BTS_TSA,337,NAICS_2012_Code,3379,, -BTS_TSA,337,NAICS_2012_Code,33791,, -BTS_TSA,337,NAICS_2012_Code,337910,, -BTS_TSA,337,NAICS_2012_Code,33792,, -BTS_TSA,337,NAICS_2012_Code,337920,, -BTS_TSA,339,NAICS_2012_Code,339,, -BTS_TSA,339,NAICS_2012_Code,3391,, -BTS_TSA,339,NAICS_2012_Code,33911,, -BTS_TSA,339,NAICS_2012_Code,339112,, -BTS_TSA,339,NAICS_2012_Code,339113,, -BTS_TSA,339,NAICS_2012_Code,339114,, -BTS_TSA,339,NAICS_2012_Code,339115,, -BTS_TSA,339,NAICS_2012_Code,339116,, -BTS_TSA,339,NAICS_2012_Code,3399,, -BTS_TSA,339,NAICS_2012_Code,33991,, -BTS_TSA,339,NAICS_2012_Code,339910,, -BTS_TSA,339,NAICS_2012_Code,33992,, -BTS_TSA,339,NAICS_2012_Code,339920,, -BTS_TSA,339,NAICS_2012_Code,33993,, -BTS_TSA,339,NAICS_2012_Code,339930,, -BTS_TSA,339,NAICS_2012_Code,33994,, -BTS_TSA,339,NAICS_2012_Code,339940,, -BTS_TSA,339,NAICS_2012_Code,33995,, -BTS_TSA,339,NAICS_2012_Code,339950,, -BTS_TSA,339,NAICS_2012_Code,33999,, -BTS_TSA,339,NAICS_2012_Code,339991,, -BTS_TSA,339,NAICS_2012_Code,339992,, -BTS_TSA,339,NAICS_2012_Code,339993,, -BTS_TSA,339,NAICS_2012_Code,339994,, -BTS_TSA,339,NAICS_2012_Code,339995,, -BTS_TSA,339,NAICS_2012_Code,339999,, -BTS_TSA,42,NAICS_2012_Code,42,, -BTS_TSA,42,NAICS_2012_Code,423,, -BTS_TSA,42,NAICS_2012_Code,4231,, -BTS_TSA,42,NAICS_2012_Code,42311,, -BTS_TSA,42,NAICS_2012_Code,423110,, -BTS_TSA,42,NAICS_2012_Code,42312,, -BTS_TSA,42,NAICS_2012_Code,423120,, -BTS_TSA,42,NAICS_2012_Code,42313,, -BTS_TSA,42,NAICS_2012_Code,423130,, -BTS_TSA,42,NAICS_2012_Code,42314,, -BTS_TSA,42,NAICS_2012_Code,423140,, -BTS_TSA,42,NAICS_2012_Code,4232,, -BTS_TSA,42,NAICS_2012_Code,42321,, -BTS_TSA,42,NAICS_2012_Code,423210,, -BTS_TSA,42,NAICS_2012_Code,42322,, -BTS_TSA,42,NAICS_2012_Code,423220,, -BTS_TSA,42,NAICS_2012_Code,4233,, -BTS_TSA,42,NAICS_2012_Code,42331,, -BTS_TSA,42,NAICS_2012_Code,423310,, -BTS_TSA,42,NAICS_2012_Code,42332,, -BTS_TSA,42,NAICS_2012_Code,423320,, -BTS_TSA,42,NAICS_2012_Code,42333,, -BTS_TSA,42,NAICS_2012_Code,423330,, -BTS_TSA,42,NAICS_2012_Code,42339,, -BTS_TSA,42,NAICS_2012_Code,423390,, -BTS_TSA,42,NAICS_2012_Code,4234,, -BTS_TSA,42,NAICS_2012_Code,42341,, -BTS_TSA,42,NAICS_2012_Code,423410,, -BTS_TSA,42,NAICS_2012_Code,42342,, -BTS_TSA,42,NAICS_2012_Code,423420,, -BTS_TSA,42,NAICS_2012_Code,42343,, -BTS_TSA,42,NAICS_2012_Code,423430,, -BTS_TSA,42,NAICS_2012_Code,42344,, -BTS_TSA,42,NAICS_2012_Code,423440,, -BTS_TSA,42,NAICS_2012_Code,42345,, -BTS_TSA,42,NAICS_2012_Code,423450,, -BTS_TSA,42,NAICS_2012_Code,42346,, -BTS_TSA,42,NAICS_2012_Code,423460,, -BTS_TSA,42,NAICS_2012_Code,42349,, -BTS_TSA,42,NAICS_2012_Code,423490,, -BTS_TSA,42,NAICS_2012_Code,4235,, -BTS_TSA,42,NAICS_2012_Code,42351,, -BTS_TSA,42,NAICS_2012_Code,423510,, -BTS_TSA,42,NAICS_2012_Code,42352,, -BTS_TSA,42,NAICS_2012_Code,423520,, -BTS_TSA,42,NAICS_2012_Code,4236,, -BTS_TSA,42,NAICS_2012_Code,42361,, -BTS_TSA,42,NAICS_2012_Code,423610,, -BTS_TSA,42,NAICS_2012_Code,42362,, -BTS_TSA,42,NAICS_2012_Code,423620,, -BTS_TSA,42,NAICS_2012_Code,42369,, -BTS_TSA,42,NAICS_2012_Code,423690,, -BTS_TSA,42,NAICS_2012_Code,4237,, -BTS_TSA,42,NAICS_2012_Code,42371,, -BTS_TSA,42,NAICS_2012_Code,423710,, -BTS_TSA,42,NAICS_2012_Code,42372,, -BTS_TSA,42,NAICS_2012_Code,423720,, -BTS_TSA,42,NAICS_2012_Code,42373,, -BTS_TSA,42,NAICS_2012_Code,423730,, -BTS_TSA,42,NAICS_2012_Code,42374,, -BTS_TSA,42,NAICS_2012_Code,423740,, -BTS_TSA,42,NAICS_2012_Code,4238,, -BTS_TSA,42,NAICS_2012_Code,42381,, -BTS_TSA,42,NAICS_2012_Code,423810,, -BTS_TSA,42,NAICS_2012_Code,42382,, -BTS_TSA,42,NAICS_2012_Code,423820,, -BTS_TSA,42,NAICS_2012_Code,42383,, -BTS_TSA,42,NAICS_2012_Code,423830,, -BTS_TSA,42,NAICS_2012_Code,42384,, -BTS_TSA,42,NAICS_2012_Code,423840,, -BTS_TSA,42,NAICS_2012_Code,42385,, -BTS_TSA,42,NAICS_2012_Code,423850,, -BTS_TSA,42,NAICS_2012_Code,42386,, -BTS_TSA,42,NAICS_2012_Code,423860,, -BTS_TSA,42,NAICS_2012_Code,4239,, -BTS_TSA,42,NAICS_2012_Code,42391,, -BTS_TSA,42,NAICS_2012_Code,423910,, -BTS_TSA,42,NAICS_2012_Code,42392,, -BTS_TSA,42,NAICS_2012_Code,423920,, -BTS_TSA,42,NAICS_2012_Code,42393,, -BTS_TSA,42,NAICS_2012_Code,423930,, -BTS_TSA,42,NAICS_2012_Code,42394,, -BTS_TSA,42,NAICS_2012_Code,423940,, -BTS_TSA,42,NAICS_2012_Code,42399,, -BTS_TSA,42,NAICS_2012_Code,423990,, -BTS_TSA,42,NAICS_2012_Code,424,, -BTS_TSA,42,NAICS_2012_Code,4241,, -BTS_TSA,42,NAICS_2012_Code,42411,, -BTS_TSA,42,NAICS_2012_Code,424110,, -BTS_TSA,42,NAICS_2012_Code,42412,, -BTS_TSA,42,NAICS_2012_Code,424120,, -BTS_TSA,42,NAICS_2012_Code,42413,, -BTS_TSA,42,NAICS_2012_Code,424130,, -BTS_TSA,42,NAICS_2012_Code,4242,, -BTS_TSA,42,NAICS_2012_Code,42421,, -BTS_TSA,42,NAICS_2012_Code,424210,, -BTS_TSA,42,NAICS_2012_Code,4243,, -BTS_TSA,42,NAICS_2012_Code,42431,, -BTS_TSA,42,NAICS_2012_Code,424310,, -BTS_TSA,42,NAICS_2012_Code,42432,, -BTS_TSA,42,NAICS_2012_Code,424320,, -BTS_TSA,42,NAICS_2012_Code,42433,, -BTS_TSA,42,NAICS_2012_Code,424330,, -BTS_TSA,42,NAICS_2012_Code,42434,, -BTS_TSA,42,NAICS_2012_Code,424340,, -BTS_TSA,42,NAICS_2012_Code,4244,, -BTS_TSA,42,NAICS_2012_Code,42441,, -BTS_TSA,42,NAICS_2012_Code,424410,, -BTS_TSA,42,NAICS_2012_Code,42442,, -BTS_TSA,42,NAICS_2012_Code,424420,, -BTS_TSA,42,NAICS_2012_Code,42443,, -BTS_TSA,42,NAICS_2012_Code,424430,, -BTS_TSA,42,NAICS_2012_Code,42444,, -BTS_TSA,42,NAICS_2012_Code,424440,, -BTS_TSA,42,NAICS_2012_Code,42445,, -BTS_TSA,42,NAICS_2012_Code,424450,, -BTS_TSA,42,NAICS_2012_Code,42446,, -BTS_TSA,42,NAICS_2012_Code,424460,, -BTS_TSA,42,NAICS_2012_Code,42447,, -BTS_TSA,42,NAICS_2012_Code,424470,, -BTS_TSA,42,NAICS_2012_Code,42448,, -BTS_TSA,42,NAICS_2012_Code,424480,, -BTS_TSA,42,NAICS_2012_Code,42449,, -BTS_TSA,42,NAICS_2012_Code,424490,, -BTS_TSA,42,NAICS_2012_Code,4245,, -BTS_TSA,42,NAICS_2012_Code,42451,, -BTS_TSA,42,NAICS_2012_Code,424510,, -BTS_TSA,42,NAICS_2012_Code,42452,, -BTS_TSA,42,NAICS_2012_Code,424520,, -BTS_TSA,42,NAICS_2012_Code,42459,, -BTS_TSA,42,NAICS_2012_Code,424590,, -BTS_TSA,42,NAICS_2012_Code,4246,, -BTS_TSA,42,NAICS_2012_Code,42461,, -BTS_TSA,42,NAICS_2012_Code,424610,, -BTS_TSA,42,NAICS_2012_Code,42469,, -BTS_TSA,42,NAICS_2012_Code,424690,, -BTS_TSA,42,NAICS_2012_Code,4247,, -BTS_TSA,42,NAICS_2012_Code,42471,, -BTS_TSA,42,NAICS_2012_Code,424710,, -BTS_TSA,42,NAICS_2012_Code,42472,, -BTS_TSA,42,NAICS_2012_Code,424720,, -BTS_TSA,42,NAICS_2012_Code,4248,, -BTS_TSA,42,NAICS_2012_Code,42481,, -BTS_TSA,42,NAICS_2012_Code,424810,, -BTS_TSA,42,NAICS_2012_Code,42482,, -BTS_TSA,42,NAICS_2012_Code,424820,, -BTS_TSA,42,NAICS_2012_Code,4249,, -BTS_TSA,42,NAICS_2012_Code,42491,, -BTS_TSA,42,NAICS_2012_Code,424910,, -BTS_TSA,42,NAICS_2012_Code,42492,, -BTS_TSA,42,NAICS_2012_Code,424920,, -BTS_TSA,42,NAICS_2012_Code,42493,, -BTS_TSA,42,NAICS_2012_Code,424930,, -BTS_TSA,42,NAICS_2012_Code,42494,, -BTS_TSA,42,NAICS_2012_Code,424940,, -BTS_TSA,42,NAICS_2012_Code,42495,, -BTS_TSA,42,NAICS_2012_Code,424950,, -BTS_TSA,42,NAICS_2012_Code,42499,, -BTS_TSA,42,NAICS_2012_Code,424990,, -BTS_TSA,42,NAICS_2012_Code,425,, -BTS_TSA,42,NAICS_2012_Code,4251,, -BTS_TSA,42,NAICS_2012_Code,42511,, -BTS_TSA,42,NAICS_2012_Code,425110,, -BTS_TSA,42,NAICS_2012_Code,42512,, -BTS_TSA,42,NAICS_2012_Code,425120,, -BTS_TSA,441,NAICS_2012_Code,44,, -BTS_TSA,4A0,NAICS_2012_Code,44,, -BTS_TSA,445,NAICS_2012_Code,44,, -BTS_TSA,441,NAICS_2012_Code,441,, -BTS_TSA,441,NAICS_2012_Code,4411,, -BTS_TSA,441,NAICS_2012_Code,44111,, -BTS_TSA,441,NAICS_2012_Code,441110,, -BTS_TSA,441,NAICS_2012_Code,44112,, -BTS_TSA,441,NAICS_2012_Code,441120,, -BTS_TSA,441,NAICS_2012_Code,4412,, -BTS_TSA,441,NAICS_2012_Code,44121,, -BTS_TSA,441,NAICS_2012_Code,441210,, -BTS_TSA,441,NAICS_2012_Code,44122,, -BTS_TSA,441,NAICS_2012_Code,441222,, -BTS_TSA,441,NAICS_2012_Code,441228,, -BTS_TSA,441,NAICS_2012_Code,4413,, -BTS_TSA,441,NAICS_2012_Code,44131,, -BTS_TSA,441,NAICS_2012_Code,441310,, -BTS_TSA,441,NAICS_2012_Code,44132,, -BTS_TSA,441,NAICS_2012_Code,441320,, -BTS_TSA,4A0,NAICS_2012_Code,442,, -BTS_TSA,4A0,NAICS_2012_Code,4421,, -BTS_TSA,4A0,NAICS_2012_Code,44211,, -BTS_TSA,4A0,NAICS_2012_Code,442110,, -BTS_TSA,4A0,NAICS_2012_Code,4422,, -BTS_TSA,4A0,NAICS_2012_Code,44221,, -BTS_TSA,4A0,NAICS_2012_Code,442210,, -BTS_TSA,4A0,NAICS_2012_Code,44229,, -BTS_TSA,4A0,NAICS_2012_Code,442291,, -BTS_TSA,4A0,NAICS_2012_Code,442299,, -BTS_TSA,4A0,NAICS_2012_Code,443,, -BTS_TSA,4A0,NAICS_2012_Code,4431,, -BTS_TSA,4A0,NAICS_2012_Code,44314,, -BTS_TSA,4A0,NAICS_2012_Code,443141,, -BTS_TSA,4A0,NAICS_2012_Code,443142,, -BTS_TSA,4A0,NAICS_2012_Code,444,, -BTS_TSA,4A0,NAICS_2012_Code,4441,, -BTS_TSA,4A0,NAICS_2012_Code,44411,, -BTS_TSA,4A0,NAICS_2012_Code,444110,, -BTS_TSA,4A0,NAICS_2012_Code,44412,, -BTS_TSA,4A0,NAICS_2012_Code,444120,, -BTS_TSA,4A0,NAICS_2012_Code,44413,, -BTS_TSA,4A0,NAICS_2012_Code,444130,, -BTS_TSA,4A0,NAICS_2012_Code,44419,, -BTS_TSA,4A0,NAICS_2012_Code,444190,, -BTS_TSA,4A0,NAICS_2012_Code,4442,, -BTS_TSA,4A0,NAICS_2012_Code,44421,, -BTS_TSA,4A0,NAICS_2012_Code,444210,, -BTS_TSA,4A0,NAICS_2012_Code,44422,, -BTS_TSA,4A0,NAICS_2012_Code,444220,, -BTS_TSA,445,NAICS_2012_Code,445,, -BTS_TSA,445,NAICS_2012_Code,4451,, -BTS_TSA,445,NAICS_2012_Code,44511,, -BTS_TSA,445,NAICS_2012_Code,445110,, -BTS_TSA,445,NAICS_2012_Code,44512,, -BTS_TSA,445,NAICS_2012_Code,445120,, -BTS_TSA,445,NAICS_2012_Code,4452,, -BTS_TSA,445,NAICS_2012_Code,44521,, -BTS_TSA,445,NAICS_2012_Code,445210,, -BTS_TSA,445,NAICS_2012_Code,44522,, -BTS_TSA,445,NAICS_2012_Code,445220,, -BTS_TSA,445,NAICS_2012_Code,44523,, -BTS_TSA,445,NAICS_2012_Code,445230,, -BTS_TSA,445,NAICS_2012_Code,44529,, -BTS_TSA,445,NAICS_2012_Code,445291,, -BTS_TSA,445,NAICS_2012_Code,445292,, -BTS_TSA,445,NAICS_2012_Code,445299,, -BTS_TSA,445,NAICS_2012_Code,4453,, -BTS_TSA,445,NAICS_2012_Code,44531,, -BTS_TSA,445,NAICS_2012_Code,445310,, -BTS_TSA,4A0,NAICS_2012_Code,446,, -BTS_TSA,4A0,NAICS_2012_Code,4461,, -BTS_TSA,4A0,NAICS_2012_Code,44611,, -BTS_TSA,4A0,NAICS_2012_Code,446110,, -BTS_TSA,4A0,NAICS_2012_Code,44612,, -BTS_TSA,4A0,NAICS_2012_Code,446120,, -BTS_TSA,4A0,NAICS_2012_Code,44613,, -BTS_TSA,4A0,NAICS_2012_Code,446130,, -BTS_TSA,4A0,NAICS_2012_Code,44619,, -BTS_TSA,4A0,NAICS_2012_Code,446191,, -BTS_TSA,4A0,NAICS_2012_Code,446199,, -BTS_TSA,4A0,NAICS_2012_Code,447,, -BTS_TSA,4A0,NAICS_2012_Code,4471,, -BTS_TSA,4A0,NAICS_2012_Code,44711,, -BTS_TSA,4A0,NAICS_2012_Code,447110,, -BTS_TSA,4A0,NAICS_2012_Code,44719,, -BTS_TSA,4A0,NAICS_2012_Code,447190,, -BTS_TSA,4A0,NAICS_2012_Code,448,, -BTS_TSA,4A0,NAICS_2012_Code,4481,, -BTS_TSA,4A0,NAICS_2012_Code,44811,, -BTS_TSA,4A0,NAICS_2012_Code,448110,, -BTS_TSA,4A0,NAICS_2012_Code,44812,, -BTS_TSA,4A0,NAICS_2012_Code,448120,, -BTS_TSA,4A0,NAICS_2012_Code,44813,, -BTS_TSA,4A0,NAICS_2012_Code,448130,, -BTS_TSA,4A0,NAICS_2012_Code,44814,, -BTS_TSA,4A0,NAICS_2012_Code,448140,, -BTS_TSA,4A0,NAICS_2012_Code,44815,, -BTS_TSA,4A0,NAICS_2012_Code,448150,, -BTS_TSA,4A0,NAICS_2012_Code,44819,, -BTS_TSA,4A0,NAICS_2012_Code,448190,, -BTS_TSA,4A0,NAICS_2012_Code,4482,, -BTS_TSA,4A0,NAICS_2012_Code,44821,, -BTS_TSA,4A0,NAICS_2012_Code,448210,, -BTS_TSA,4A0,NAICS_2012_Code,4483,, -BTS_TSA,4A0,NAICS_2012_Code,44831,, -BTS_TSA,4A0,NAICS_2012_Code,448310,, -BTS_TSA,4A0,NAICS_2012_Code,44832,, -BTS_TSA,4A0,NAICS_2012_Code,448320,, -BTS_TSA,452,NAICS_2012_Code,45,, -BTS_TSA,4A0,NAICS_2012_Code,45,, -BTS_TSA,4A0,NAICS_2012_Code,451,, -BTS_TSA,4A0,NAICS_2012_Code,4511,, -BTS_TSA,4A0,NAICS_2012_Code,45111,, -BTS_TSA,4A0,NAICS_2012_Code,451110,, -BTS_TSA,4A0,NAICS_2012_Code,45112,, -BTS_TSA,4A0,NAICS_2012_Code,451120,, -BTS_TSA,4A0,NAICS_2012_Code,45113,, -BTS_TSA,4A0,NAICS_2012_Code,451130,, -BTS_TSA,4A0,NAICS_2012_Code,45114,, -BTS_TSA,4A0,NAICS_2012_Code,451140,, -BTS_TSA,4A0,NAICS_2012_Code,4512,, -BTS_TSA,4A0,NAICS_2012_Code,45121,, -BTS_TSA,4A0,NAICS_2012_Code,451211,, -BTS_TSA,4A0,NAICS_2012_Code,451212,, -BTS_TSA,452,NAICS_2012_Code,452,, -BTS_TSA,452,NAICS_2012_Code,4521,, -BTS_TSA,452,NAICS_2012_Code,45211,, -BTS_TSA,452,NAICS_2012_Code,452111,, -BTS_TSA,452,NAICS_2012_Code,452112,, -BTS_TSA,452,NAICS_2012_Code,4529,, -BTS_TSA,452,NAICS_2012_Code,45291,, -BTS_TSA,452,NAICS_2012_Code,452910,, -BTS_TSA,452,NAICS_2012_Code,45299,, -BTS_TSA,452,NAICS_2012_Code,452990,, -BTS_TSA,4A0,NAICS_2012_Code,453,, -BTS_TSA,4A0,NAICS_2012_Code,4531,, -BTS_TSA,4A0,NAICS_2012_Code,45311,, -BTS_TSA,4A0,NAICS_2012_Code,453110,, -BTS_TSA,4A0,NAICS_2012_Code,4532,, -BTS_TSA,4A0,NAICS_2012_Code,45321,, -BTS_TSA,4A0,NAICS_2012_Code,453210,, -BTS_TSA,4A0,NAICS_2012_Code,45322,, -BTS_TSA,4A0,NAICS_2012_Code,453220,, -BTS_TSA,4A0,NAICS_2012_Code,4533,, -BTS_TSA,4A0,NAICS_2012_Code,45331,, -BTS_TSA,4A0,NAICS_2012_Code,453310,, -BTS_TSA,4A0,NAICS_2012_Code,4539,, -BTS_TSA,4A0,NAICS_2012_Code,45391,, -BTS_TSA,4A0,NAICS_2012_Code,453910,, -BTS_TSA,4A0,NAICS_2012_Code,45392,, -BTS_TSA,4A0,NAICS_2012_Code,453920,, -BTS_TSA,4A0,NAICS_2012_Code,45393,, -BTS_TSA,4A0,NAICS_2012_Code,453930,, -BTS_TSA,4A0,NAICS_2012_Code,45399,, -BTS_TSA,4A0,NAICS_2012_Code,453991,, -BTS_TSA,4A0,NAICS_2012_Code,453998,, -BTS_TSA,4A0,NAICS_2012_Code,454,, -BTS_TSA,4A0,NAICS_2012_Code,4541,, -BTS_TSA,4A0,NAICS_2012_Code,45411,, -BTS_TSA,4A0,NAICS_2012_Code,454111,, -BTS_TSA,4A0,NAICS_2012_Code,454112,, -BTS_TSA,4A0,NAICS_2012_Code,454113,, -BTS_TSA,4A0,NAICS_2012_Code,4542,, -BTS_TSA,4A0,NAICS_2012_Code,45421,, -BTS_TSA,4A0,NAICS_2012_Code,454210,, -BTS_TSA,4A0,NAICS_2012_Code,4543,, -BTS_TSA,4A0,NAICS_2012_Code,45431,, -BTS_TSA,4A0,NAICS_2012_Code,454310,, -BTS_TSA,4A0,NAICS_2012_Code,45439,, -BTS_TSA,4A0,NAICS_2012_Code,454390,, -BTS_TSA,481,NAICS_2012_Code,48,, -BTS_TSA,482,NAICS_2012_Code,48,, -BTS_TSA,483,NAICS_2012_Code,48,, -BTS_TSA,484,NAICS_2012_Code,48,, -BTS_TSA,485,NAICS_2012_Code,48,, -BTS_TSA,486,NAICS_2012_Code,48,, -BTS_TSA,487OS,NAICS_2012_Code,48,, -BTS_TSA,481,NAICS_2012_Code,481,, -BTS_TSA,481,NAICS_2012_Code,4811,, -BTS_TSA,481,NAICS_2012_Code,48111,, -BTS_TSA,481,NAICS_2012_Code,481111,, -BTS_TSA,481,NAICS_2012_Code,481112,, -BTS_TSA,481,NAICS_2012_Code,4812,, -BTS_TSA,481,NAICS_2012_Code,48121,, -BTS_TSA,481,NAICS_2012_Code,481211,, -BTS_TSA,481,NAICS_2012_Code,481212,, -BTS_TSA,481,NAICS_2012_Code,481219,, -BTS_TSA,482,NAICS_2012_Code,482,, -BTS_TSA,482,NAICS_2012_Code,4821,, -BTS_TSA,482,NAICS_2012_Code,48211,, -BTS_TSA,482,NAICS_2012_Code,482111,, -BTS_TSA,482,NAICS_2012_Code,482112,, -BTS_TSA,483,NAICS_2012_Code,483,, -BTS_TSA,483,NAICS_2012_Code,4831,, -BTS_TSA,483,NAICS_2012_Code,48311,, -BTS_TSA,483,NAICS_2012_Code,483111,, -BTS_TSA,483,NAICS_2012_Code,483112,, -BTS_TSA,483,NAICS_2012_Code,483113,, -BTS_TSA,483,NAICS_2012_Code,483114,, -BTS_TSA,483,NAICS_2012_Code,4832,, -BTS_TSA,483,NAICS_2012_Code,48321,, -BTS_TSA,483,NAICS_2012_Code,483211,, -BTS_TSA,483,NAICS_2012_Code,483212,, -BTS_TSA,484,NAICS_2012_Code,484,, -BTS_TSA,484,NAICS_2012_Code,4841,, -BTS_TSA,484,NAICS_2012_Code,48411,, -BTS_TSA,484,NAICS_2012_Code,484110,, -BTS_TSA,484,NAICS_2012_Code,48412,, -BTS_TSA,484,NAICS_2012_Code,484121,, -BTS_TSA,484,NAICS_2012_Code,484122,, -BTS_TSA,484,NAICS_2012_Code,4842,, -BTS_TSA,484,NAICS_2012_Code,48421,, -BTS_TSA,484,NAICS_2012_Code,484210,, -BTS_TSA,484,NAICS_2012_Code,48422,, -BTS_TSA,484,NAICS_2012_Code,484220,, -BTS_TSA,484,NAICS_2012_Code,48423,, -BTS_TSA,484,NAICS_2012_Code,484230,, -BTS_TSA,485,NAICS_2012_Code,485,, -BTS_TSA,485,NAICS_2012_Code,4851,, -BTS_TSA,485,NAICS_2012_Code,48511,, -BTS_TSA,485,NAICS_2012_Code,485111,, -BTS_TSA,485,NAICS_2012_Code,485112,, -BTS_TSA,485,NAICS_2012_Code,485113,, -BTS_TSA,485,NAICS_2012_Code,485119,, -BTS_TSA,485,NAICS_2012_Code,4852,, -BTS_TSA,485,NAICS_2012_Code,48521,, -BTS_TSA,485,NAICS_2012_Code,485210,, -BTS_TSA,485,NAICS_2012_Code,4853,, -BTS_TSA,485,NAICS_2012_Code,48531,, -BTS_TSA,485,NAICS_2012_Code,485310,, -BTS_TSA,485,NAICS_2012_Code,48532,, -BTS_TSA,485,NAICS_2012_Code,485320,, -BTS_TSA,485,NAICS_2012_Code,4854,, -BTS_TSA,485,NAICS_2012_Code,48541,, -BTS_TSA,485,NAICS_2012_Code,485410,, -BTS_TSA,485,NAICS_2012_Code,4855,, -BTS_TSA,485,NAICS_2012_Code,48551,, -BTS_TSA,485,NAICS_2012_Code,485510,, -BTS_TSA,485,NAICS_2012_Code,4859,, -BTS_TSA,485,NAICS_2012_Code,48599,, -BTS_TSA,485,NAICS_2012_Code,485991,, -BTS_TSA,485,NAICS_2012_Code,485999,, -BTS_TSA,486,NAICS_2012_Code,486,, -BTS_TSA,486,NAICS_2012_Code,4861,, -BTS_TSA,486,NAICS_2012_Code,48611,, -BTS_TSA,486,NAICS_2012_Code,486110,, -BTS_TSA,486,NAICS_2012_Code,4862,, -BTS_TSA,486,NAICS_2012_Code,48621,, -BTS_TSA,486,NAICS_2012_Code,486210,, -BTS_TSA,486,NAICS_2012_Code,4869,, -BTS_TSA,486,NAICS_2012_Code,48691,, -BTS_TSA,486,NAICS_2012_Code,486910,, -BTS_TSA,486,NAICS_2012_Code,48699,, -BTS_TSA,486,NAICS_2012_Code,486990,, -BTS_TSA,487OS,NAICS_2012_Code,487,, -BTS_TSA,487OS,NAICS_2012_Code,4871,, -BTS_TSA,487OS,NAICS_2012_Code,48711,, -BTS_TSA,487OS,NAICS_2012_Code,487110,, -BTS_TSA,487OS,NAICS_2012_Code,4872,, -BTS_TSA,487OS,NAICS_2012_Code,48721,, -BTS_TSA,487OS,NAICS_2012_Code,487210,, -BTS_TSA,487OS,NAICS_2012_Code,4879,, -BTS_TSA,487OS,NAICS_2012_Code,48799,, -BTS_TSA,487OS,NAICS_2012_Code,487990,, -BTS_TSA,487OS,NAICS_2012_Code,488,, -BTS_TSA,487OS,NAICS_2012_Code,4881,, -BTS_TSA,487OS,NAICS_2012_Code,48811,, -BTS_TSA,487OS,NAICS_2012_Code,488111,, -BTS_TSA,487OS,NAICS_2012_Code,488119,, -BTS_TSA,487OS,NAICS_2012_Code,48819,, -BTS_TSA,487OS,NAICS_2012_Code,488190,, -BTS_TSA,487OS,NAICS_2012_Code,4882,, -BTS_TSA,487OS,NAICS_2012_Code,48821,, -BTS_TSA,487OS,NAICS_2012_Code,488210,, -BTS_TSA,487OS,NAICS_2012_Code,4883,, -BTS_TSA,487OS,NAICS_2012_Code,48831,, -BTS_TSA,487OS,NAICS_2012_Code,488310,, -BTS_TSA,487OS,NAICS_2012_Code,48832,, -BTS_TSA,487OS,NAICS_2012_Code,488320,, -BTS_TSA,487OS,NAICS_2012_Code,48833,, -BTS_TSA,487OS,NAICS_2012_Code,488330,, -BTS_TSA,487OS,NAICS_2012_Code,48839,, -BTS_TSA,487OS,NAICS_2012_Code,488390,, -BTS_TSA,487OS,NAICS_2012_Code,4884,, -BTS_TSA,487OS,NAICS_2012_Code,48841,, -BTS_TSA,487OS,NAICS_2012_Code,488410,, -BTS_TSA,487OS,NAICS_2012_Code,48849,, -BTS_TSA,487OS,NAICS_2012_Code,488490,, -BTS_TSA,487OS,NAICS_2012_Code,4885,, -BTS_TSA,487OS,NAICS_2012_Code,48851,, -BTS_TSA,487OS,NAICS_2012_Code,488510,, -BTS_TSA,487OS,NAICS_2012_Code,4889,, -BTS_TSA,487OS,NAICS_2012_Code,48899,, -BTS_TSA,487OS,NAICS_2012_Code,488991,, -BTS_TSA,487OS,NAICS_2012_Code,488999,, -BTS_TSA,GFE,NAICS_2012_Code,49,, -BTS_TSA,487OS,NAICS_2012_Code,49,, -BTS_TSA,493,NAICS_2012_Code,49,, -BTS_TSA,GFE,NAICS_2012_Code,491,, -BTS_TSA,GFE,NAICS_2012_Code,4911,, -BTS_TSA,GFE,NAICS_2012_Code,49111,, -BTS_TSA,GFE,NAICS_2012_Code,491110,, -BTS_TSA,487OS,NAICS_2012_Code,492,, -BTS_TSA,487OS,NAICS_2012_Code,4921,, -BTS_TSA,487OS,NAICS_2012_Code,49211,, -BTS_TSA,487OS,NAICS_2012_Code,492110,, -BTS_TSA,487OS,NAICS_2012_Code,4922,, -BTS_TSA,487OS,NAICS_2012_Code,49221,, -BTS_TSA,487OS,NAICS_2012_Code,492210,, -BTS_TSA,493,NAICS_2012_Code,493,, -BTS_TSA,493,NAICS_2012_Code,4931,, -BTS_TSA,493,NAICS_2012_Code,49311,, -BTS_TSA,493,NAICS_2012_Code,493110,, -BTS_TSA,493,NAICS_2012_Code,49312,, -BTS_TSA,493,NAICS_2012_Code,493120,, -BTS_TSA,493,NAICS_2012_Code,49313,, -BTS_TSA,493,NAICS_2012_Code,493130,, -BTS_TSA,493,NAICS_2012_Code,49319,, -BTS_TSA,493,NAICS_2012_Code,493190,, -BTS_TSA,511,NAICS_2012_Code,51,, -BTS_TSA,512,NAICS_2012_Code,51,, -BTS_TSA,513,NAICS_2012_Code,51,, -BTS_TSA,514,NAICS_2012_Code,51,, -BTS_TSA,511,NAICS_2012_Code,511,, -BTS_TSA,511,NAICS_2012_Code,5111,, -BTS_TSA,511,NAICS_2012_Code,51111,, -BTS_TSA,511,NAICS_2012_Code,511110,, -BTS_TSA,511,NAICS_2012_Code,51112,, -BTS_TSA,511,NAICS_2012_Code,511120,, -BTS_TSA,511,NAICS_2012_Code,51113,, -BTS_TSA,511,NAICS_2012_Code,511130,, -BTS_TSA,511,NAICS_2012_Code,51114,, -BTS_TSA,511,NAICS_2012_Code,511140,, -BTS_TSA,511,NAICS_2012_Code,51119,, -BTS_TSA,511,NAICS_2012_Code,511191,, -BTS_TSA,511,NAICS_2012_Code,511199,, -BTS_TSA,511,NAICS_2012_Code,5112,, -BTS_TSA,511,NAICS_2012_Code,51121,, -BTS_TSA,511,NAICS_2012_Code,511210,, -BTS_TSA,512,NAICS_2012_Code,512,, -BTS_TSA,512,NAICS_2012_Code,5121,, -BTS_TSA,512,NAICS_2012_Code,51211,, -BTS_TSA,512,NAICS_2012_Code,512110,, -BTS_TSA,512,NAICS_2012_Code,51212,, -BTS_TSA,512,NAICS_2012_Code,512120,, -BTS_TSA,512,NAICS_2012_Code,51213,, -BTS_TSA,512,NAICS_2012_Code,512131,, -BTS_TSA,512,NAICS_2012_Code,512132,, -BTS_TSA,512,NAICS_2012_Code,51219,, -BTS_TSA,512,NAICS_2012_Code,512191,, -BTS_TSA,512,NAICS_2012_Code,512199,, -BTS_TSA,512,NAICS_2012_Code,5122,, -BTS_TSA,512,NAICS_2012_Code,51221,, -BTS_TSA,512,NAICS_2012_Code,512210,, -BTS_TSA,512,NAICS_2012_Code,51222,, -BTS_TSA,512,NAICS_2012_Code,512220,, -BTS_TSA,512,NAICS_2012_Code,51223,, -BTS_TSA,512,NAICS_2012_Code,512230,, -BTS_TSA,512,NAICS_2012_Code,51224,, -BTS_TSA,512,NAICS_2012_Code,512240,, -BTS_TSA,512,NAICS_2012_Code,51229,, -BTS_TSA,512,NAICS_2012_Code,512290,, -BTS_TSA,513,NAICS_2012_Code,515,, -BTS_TSA,513,NAICS_2012_Code,5151,, -BTS_TSA,513,NAICS_2012_Code,51511,, -BTS_TSA,513,NAICS_2012_Code,515111,, -BTS_TSA,513,NAICS_2012_Code,515112,, -BTS_TSA,513,NAICS_2012_Code,51512,, -BTS_TSA,513,NAICS_2012_Code,515120,, -BTS_TSA,513,NAICS_2012_Code,5152,, -BTS_TSA,513,NAICS_2012_Code,51521,, -BTS_TSA,513,NAICS_2012_Code,515210,, -BTS_TSA,513,NAICS_2012_Code,517,, -BTS_TSA,513,NAICS_2012_Code,5171,, -BTS_TSA,513,NAICS_2012_Code,51711,, -BTS_TSA,513,NAICS_2012_Code,517110,, -BTS_TSA,513,NAICS_2012_Code,5172,, -BTS_TSA,513,NAICS_2012_Code,51721,, -BTS_TSA,513,NAICS_2012_Code,517210,, -BTS_TSA,513,NAICS_2012_Code,5174,, -BTS_TSA,513,NAICS_2012_Code,51741,, -BTS_TSA,513,NAICS_2012_Code,517410,, -BTS_TSA,513,NAICS_2012_Code,5179,, -BTS_TSA,513,NAICS_2012_Code,51791,, -BTS_TSA,513,NAICS_2012_Code,517911,, -BTS_TSA,513,NAICS_2012_Code,517919,, -BTS_TSA,514,NAICS_2012_Code,518,, -BTS_TSA,514,NAICS_2012_Code,5182,, -BTS_TSA,514,NAICS_2012_Code,51821,, -BTS_TSA,514,NAICS_2012_Code,518210,, -BTS_TSA,514,NAICS_2012_Code,519,, -BTS_TSA,514,NAICS_2012_Code,5191,, -BTS_TSA,514,NAICS_2012_Code,51911,, -BTS_TSA,514,NAICS_2012_Code,519110,, -BTS_TSA,514,NAICS_2012_Code,51912,, -BTS_TSA,514,NAICS_2012_Code,519120,, -BTS_TSA,514,NAICS_2012_Code,51913,, -BTS_TSA,514,NAICS_2012_Code,519130,, -BTS_TSA,514,NAICS_2012_Code,51919,, -BTS_TSA,514,NAICS_2012_Code,519190,, -BTS_TSA,521CI,NAICS_2012_Code,52,, -BTS_TSA,523,NAICS_2012_Code,52,, -BTS_TSA,524,NAICS_2012_Code,52,, -BTS_TSA,525,NAICS_2012_Code,52,, -BTS_TSA,521CI,NAICS_2012_Code,521,, -BTS_TSA,521CI,NAICS_2012_Code,5211,, -BTS_TSA,521CI,NAICS_2012_Code,52111,, -BTS_TSA,521CI,NAICS_2012_Code,521110,, -BTS_TSA,521CI,NAICS_2012_Code,522,, -BTS_TSA,521CI,NAICS_2012_Code,5221,, -BTS_TSA,521CI,NAICS_2012_Code,52211,, -BTS_TSA,521CI,NAICS_2012_Code,522110,, -BTS_TSA,521CI,NAICS_2012_Code,52212,, -BTS_TSA,521CI,NAICS_2012_Code,522120,, -BTS_TSA,521CI,NAICS_2012_Code,52213,, -BTS_TSA,521CI,NAICS_2012_Code,522130,, -BTS_TSA,521CI,NAICS_2012_Code,52219,, -BTS_TSA,521CI,NAICS_2012_Code,522190,, -BTS_TSA,521CI,NAICS_2012_Code,5222,, -BTS_TSA,521CI,NAICS_2012_Code,52221,, -BTS_TSA,521CI,NAICS_2012_Code,522210,, -BTS_TSA,521CI,NAICS_2012_Code,52222,, -BTS_TSA,521CI,NAICS_2012_Code,522220,, -BTS_TSA,521CI,NAICS_2012_Code,52229,, -BTS_TSA,521CI,NAICS_2012_Code,522291,, -BTS_TSA,521CI,NAICS_2012_Code,522292,, -BTS_TSA,521CI,NAICS_2012_Code,522293,, -BTS_TSA,521CI,NAICS_2012_Code,522294,, -BTS_TSA,521CI,NAICS_2012_Code,522298,, -BTS_TSA,521CI,NAICS_2012_Code,5223,, -BTS_TSA,521CI,NAICS_2012_Code,52231,, -BTS_TSA,521CI,NAICS_2012_Code,522310,, -BTS_TSA,521CI,NAICS_2012_Code,52232,, -BTS_TSA,521CI,NAICS_2012_Code,522320,, -BTS_TSA,521CI,NAICS_2012_Code,52239,, -BTS_TSA,521CI,NAICS_2012_Code,522390,, -BTS_TSA,523,NAICS_2012_Code,523,, -BTS_TSA,523,NAICS_2012_Code,5231,, -BTS_TSA,523,NAICS_2012_Code,52311,, -BTS_TSA,523,NAICS_2012_Code,523110,, -BTS_TSA,523,NAICS_2012_Code,52312,, -BTS_TSA,523,NAICS_2012_Code,523120,, -BTS_TSA,523,NAICS_2012_Code,52313,, -BTS_TSA,523,NAICS_2012_Code,523130,, -BTS_TSA,523,NAICS_2012_Code,52314,, -BTS_TSA,523,NAICS_2012_Code,523140,, -BTS_TSA,523,NAICS_2012_Code,5232,, -BTS_TSA,523,NAICS_2012_Code,52321,, -BTS_TSA,523,NAICS_2012_Code,523210,, -BTS_TSA,523,NAICS_2012_Code,5239,, -BTS_TSA,523,NAICS_2012_Code,52391,, -BTS_TSA,523,NAICS_2012_Code,523910,, -BTS_TSA,523,NAICS_2012_Code,52392,, -BTS_TSA,523,NAICS_2012_Code,523920,, -BTS_TSA,523,NAICS_2012_Code,52393,, -BTS_TSA,523,NAICS_2012_Code,523930,, -BTS_TSA,523,NAICS_2012_Code,52399,, -BTS_TSA,523,NAICS_2012_Code,523991,, -BTS_TSA,523,NAICS_2012_Code,523999,, -BTS_TSA,524,NAICS_2012_Code,524,, -BTS_TSA,524,NAICS_2012_Code,5241,, -BTS_TSA,524,NAICS_2012_Code,52411,, -BTS_TSA,524,NAICS_2012_Code,524113,, -BTS_TSA,524,NAICS_2012_Code,524114,, -BTS_TSA,524,NAICS_2012_Code,52412,, -BTS_TSA,524,NAICS_2012_Code,524126,, -BTS_TSA,524,NAICS_2012_Code,524127,, -BTS_TSA,524,NAICS_2012_Code,524128,, -BTS_TSA,524,NAICS_2012_Code,52413,, -BTS_TSA,524,NAICS_2012_Code,524130,, -BTS_TSA,524,NAICS_2012_Code,5242,, -BTS_TSA,524,NAICS_2012_Code,52421,, -BTS_TSA,524,NAICS_2012_Code,524210,, -BTS_TSA,524,NAICS_2012_Code,52429,, -BTS_TSA,524,NAICS_2012_Code,524291,, -BTS_TSA,524,NAICS_2012_Code,524292,, -BTS_TSA,524,NAICS_2012_Code,524298,, -BTS_TSA,525,NAICS_2012_Code,525,, -BTS_TSA,525,NAICS_2012_Code,5251,, -BTS_TSA,525,NAICS_2012_Code,52511,, -BTS_TSA,525,NAICS_2012_Code,525110,, -BTS_TSA,525,NAICS_2012_Code,52512,, -BTS_TSA,525,NAICS_2012_Code,525120,, -BTS_TSA,525,NAICS_2012_Code,52519,, -BTS_TSA,525,NAICS_2012_Code,525190,, -BTS_TSA,525,NAICS_2012_Code,5259,, -BTS_TSA,525,NAICS_2012_Code,52591,, -BTS_TSA,525,NAICS_2012_Code,525910,, -BTS_TSA,525,NAICS_2012_Code,52592,, -BTS_TSA,525,NAICS_2012_Code,525920,, -BTS_TSA,525,NAICS_2012_Code,52599,, -BTS_TSA,525,NAICS_2012_Code,525990,, -BTS_TSA,HS,NAICS_2012_Code,53,, -BTS_TSA,ORE,NAICS_2012_Code,53,, -BTS_TSA,532RL,NAICS_2012_Code,53,, -BTS_TSA,HS,NAICS_2012_Code,531,, -BTS_TSA,ORE,NAICS_2012_Code,531,, -BTS_TSA,HS,NAICS_2012_Code,5311,, -BTS_TSA,ORE,NAICS_2012_Code,5311,, -BTS_TSA,HS,NAICS_2012_Code,53111,, -BTS_TSA,ORE,NAICS_2012_Code,53111,, -BTS_TSA,HS,NAICS_2012_Code,531110,, -BTS_TSA,ORE,NAICS_2012_Code,531110,, -BTS_TSA,HS,NAICS_2012_Code,53112,, -BTS_TSA,ORE,NAICS_2012_Code,53112,, -BTS_TSA,HS,NAICS_2012_Code,531120,, -BTS_TSA,ORE,NAICS_2012_Code,531120,, -BTS_TSA,HS,NAICS_2012_Code,53113,, -BTS_TSA,ORE,NAICS_2012_Code,53113,, -BTS_TSA,HS,NAICS_2012_Code,531130,, -BTS_TSA,ORE,NAICS_2012_Code,531130,, -BTS_TSA,HS,NAICS_2012_Code,53119,, -BTS_TSA,ORE,NAICS_2012_Code,53119,, -BTS_TSA,HS,NAICS_2012_Code,531190,, -BTS_TSA,ORE,NAICS_2012_Code,531190,, -BTS_TSA,HS,NAICS_2012_Code,5312,, -BTS_TSA,ORE,NAICS_2012_Code,5312,, -BTS_TSA,HS,NAICS_2012_Code,53121,, -BTS_TSA,ORE,NAICS_2012_Code,53121,, -BTS_TSA,HS,NAICS_2012_Code,531210,, -BTS_TSA,ORE,NAICS_2012_Code,531210,, -BTS_TSA,HS,NAICS_2012_Code,5313,, -BTS_TSA,ORE,NAICS_2012_Code,5313,, -BTS_TSA,HS,NAICS_2012_Code,53131,, -BTS_TSA,ORE,NAICS_2012_Code,53131,, -BTS_TSA,HS,NAICS_2012_Code,531311,, -BTS_TSA,ORE,NAICS_2012_Code,531311,, -BTS_TSA,HS,NAICS_2012_Code,531312,, -BTS_TSA,ORE,NAICS_2012_Code,531312,, -BTS_TSA,HS,NAICS_2012_Code,53132,, -BTS_TSA,ORE,NAICS_2012_Code,53132,, -BTS_TSA,HS,NAICS_2012_Code,531320,, -BTS_TSA,ORE,NAICS_2012_Code,531320,, -BTS_TSA,HS,NAICS_2012_Code,53139,, -BTS_TSA,ORE,NAICS_2012_Code,53139,, -BTS_TSA,HS,NAICS_2012_Code,531390,, -BTS_TSA,ORE,NAICS_2012_Code,531390,, -BTS_TSA,HS,NAICS_2012_Code,532,, -BTS_TSA,532RL,NAICS_2012_Code,532,, -BTS_TSA,HS,NAICS_2012_Code,5321,, -BTS_TSA,532RL,NAICS_2012_Code,5321,, -BTS_TSA,HS,NAICS_2012_Code,53211,, -BTS_TSA,532RL,NAICS_2012_Code,53211,, -BTS_TSA,HS,NAICS_2012_Code,532111,, -BTS_TSA,532RL,NAICS_2012_Code,532111,, -BTS_TSA,HS,NAICS_2012_Code,532112,, -BTS_TSA,532RL,NAICS_2012_Code,532112,, -BTS_TSA,HS,NAICS_2012_Code,53212,, -BTS_TSA,532RL,NAICS_2012_Code,53212,, -BTS_TSA,HS,NAICS_2012_Code,532120,, -BTS_TSA,532RL,NAICS_2012_Code,532120,, -BTS_TSA,HS,NAICS_2012_Code,5322,, -BTS_TSA,532RL,NAICS_2012_Code,5322,, -BTS_TSA,HS,NAICS_2012_Code,53221,, -BTS_TSA,532RL,NAICS_2012_Code,53221,, -BTS_TSA,HS,NAICS_2012_Code,532210,, -BTS_TSA,532RL,NAICS_2012_Code,532210,, -BTS_TSA,HS,NAICS_2012_Code,53222,, -BTS_TSA,532RL,NAICS_2012_Code,53222,, -BTS_TSA,HS,NAICS_2012_Code,532220,, -BTS_TSA,532RL,NAICS_2012_Code,532220,, -BTS_TSA,HS,NAICS_2012_Code,53223,, -BTS_TSA,532RL,NAICS_2012_Code,53223,, -BTS_TSA,HS,NAICS_2012_Code,532230,, -BTS_TSA,532RL,NAICS_2012_Code,532230,, -BTS_TSA,HS,NAICS_2012_Code,53229,, -BTS_TSA,532RL,NAICS_2012_Code,53229,, -BTS_TSA,HS,NAICS_2012_Code,532291,, -BTS_TSA,532RL,NAICS_2012_Code,532291,, -BTS_TSA,HS,NAICS_2012_Code,532292,, -BTS_TSA,532RL,NAICS_2012_Code,532292,, -BTS_TSA,HS,NAICS_2012_Code,532299,, -BTS_TSA,532RL,NAICS_2012_Code,532299,, -BTS_TSA,HS,NAICS_2012_Code,5323,, -BTS_TSA,532RL,NAICS_2012_Code,5323,, -BTS_TSA,HS,NAICS_2012_Code,53231,, -BTS_TSA,532RL,NAICS_2012_Code,53231,, -BTS_TSA,HS,NAICS_2012_Code,532310,, -BTS_TSA,532RL,NAICS_2012_Code,532310,, -BTS_TSA,HS,NAICS_2012_Code,5324,, -BTS_TSA,532RL,NAICS_2012_Code,5324,, -BTS_TSA,HS,NAICS_2012_Code,53241,, -BTS_TSA,532RL,NAICS_2012_Code,53241,, -BTS_TSA,HS,NAICS_2012_Code,532411,, -BTS_TSA,532RL,NAICS_2012_Code,532411,, -BTS_TSA,HS,NAICS_2012_Code,532412,, -BTS_TSA,532RL,NAICS_2012_Code,532412,, -BTS_TSA,HS,NAICS_2012_Code,53242,, -BTS_TSA,532RL,NAICS_2012_Code,53242,, -BTS_TSA,HS,NAICS_2012_Code,532420,, -BTS_TSA,532RL,NAICS_2012_Code,532420,, -BTS_TSA,HS,NAICS_2012_Code,53249,, -BTS_TSA,532RL,NAICS_2012_Code,53249,, -BTS_TSA,HS,NAICS_2012_Code,532490,, -BTS_TSA,532RL,NAICS_2012_Code,532490,, -BTS_TSA,HS,NAICS_2012_Code,533,, -BTS_TSA,532RL,NAICS_2012_Code,533,, -BTS_TSA,HS,NAICS_2012_Code,5331,, -BTS_TSA,532RL,NAICS_2012_Code,5331,, -BTS_TSA,HS,NAICS_2012_Code,53311,, -BTS_TSA,532RL,NAICS_2012_Code,53311,, -BTS_TSA,HS,NAICS_2012_Code,533110,, -BTS_TSA,532RL,NAICS_2012_Code,533110,, -BTS_TSA,5411,NAICS_2012_Code,54,, -BTS_TSA,5412OP,NAICS_2012_Code,54,, -BTS_TSA,5415,NAICS_2012_Code,54,, -BTS_TSA,5411,NAICS_2012_Code,541,, -BTS_TSA,5412OP,NAICS_2012_Code,541,, -BTS_TSA,5415,NAICS_2012_Code,541,, -BTS_TSA,5411,NAICS_2012_Code,5411,, -BTS_TSA,5411,NAICS_2012_Code,54111,, -BTS_TSA,5411,NAICS_2012_Code,541110,, -BTS_TSA,5411,NAICS_2012_Code,54112,, -BTS_TSA,5411,NAICS_2012_Code,541120,, -BTS_TSA,5411,NAICS_2012_Code,54119,, -BTS_TSA,5411,NAICS_2012_Code,541191,, -BTS_TSA,5411,NAICS_2012_Code,541199,, -BTS_TSA,5412OP,NAICS_2012_Code,5412,, -BTS_TSA,5412OP,NAICS_2012_Code,54121,, -BTS_TSA,5412OP,NAICS_2012_Code,541211,, -BTS_TSA,5412OP,NAICS_2012_Code,541213,, -BTS_TSA,5412OP,NAICS_2012_Code,541214,, -BTS_TSA,5412OP,NAICS_2012_Code,541219,, -BTS_TSA,5412OP,NAICS_2012_Code,5413,, -BTS_TSA,5412OP,NAICS_2012_Code,54131,, -BTS_TSA,5412OP,NAICS_2012_Code,541310,, -BTS_TSA,5412OP,NAICS_2012_Code,54132,, -BTS_TSA,5412OP,NAICS_2012_Code,541320,, -BTS_TSA,5412OP,NAICS_2012_Code,54133,, -BTS_TSA,5412OP,NAICS_2012_Code,541330,, -BTS_TSA,5412OP,NAICS_2012_Code,54134,, -BTS_TSA,5412OP,NAICS_2012_Code,541340,, -BTS_TSA,5412OP,NAICS_2012_Code,54135,, -BTS_TSA,5412OP,NAICS_2012_Code,541350,, -BTS_TSA,5412OP,NAICS_2012_Code,54136,, -BTS_TSA,5412OP,NAICS_2012_Code,541360,, -BTS_TSA,5412OP,NAICS_2012_Code,54137,, -BTS_TSA,5412OP,NAICS_2012_Code,541370,, -BTS_TSA,5412OP,NAICS_2012_Code,54138,, -BTS_TSA,5412OP,NAICS_2012_Code,541380,, -BTS_TSA,5412OP,NAICS_2012_Code,5414,, -BTS_TSA,5412OP,NAICS_2012_Code,54141,, -BTS_TSA,5412OP,NAICS_2012_Code,541410,, -BTS_TSA,5412OP,NAICS_2012_Code,54142,, -BTS_TSA,5412OP,NAICS_2012_Code,541420,, -BTS_TSA,5412OP,NAICS_2012_Code,54143,, -BTS_TSA,5412OP,NAICS_2012_Code,541430,, -BTS_TSA,5412OP,NAICS_2012_Code,54149,, -BTS_TSA,5412OP,NAICS_2012_Code,541490,, -BTS_TSA,5415,NAICS_2012_Code,5415,, -BTS_TSA,5415,NAICS_2012_Code,54151,, -BTS_TSA,5415,NAICS_2012_Code,541511,, -BTS_TSA,5415,NAICS_2012_Code,541512,, -BTS_TSA,5415,NAICS_2012_Code,541513,, -BTS_TSA,5415,NAICS_2012_Code,541519,, -BTS_TSA,5412OP,NAICS_2012_Code,5416,, -BTS_TSA,5412OP,NAICS_2012_Code,54161,, -BTS_TSA,5412OP,NAICS_2012_Code,541611,, -BTS_TSA,5412OP,NAICS_2012_Code,541612,, -BTS_TSA,5412OP,NAICS_2012_Code,541613,, -BTS_TSA,5412OP,NAICS_2012_Code,541614,, -BTS_TSA,5412OP,NAICS_2012_Code,541618,, -BTS_TSA,5412OP,NAICS_2012_Code,54162,, -BTS_TSA,5412OP,NAICS_2012_Code,541620,, -BTS_TSA,5412OP,NAICS_2012_Code,54169,, -BTS_TSA,5412OP,NAICS_2012_Code,541690,, -BTS_TSA,5412OP,NAICS_2012_Code,5417,, -BTS_TSA,5412OP,NAICS_2012_Code,54171,, -BTS_TSA,5412OP,NAICS_2012_Code,541711,, -BTS_TSA,5412OP,NAICS_2012_Code,541712,, -BTS_TSA,5412OP,NAICS_2012_Code,54172,, -BTS_TSA,5412OP,NAICS_2012_Code,541720,, -BTS_TSA,5412OP,NAICS_2012_Code,5418,, -BTS_TSA,5412OP,NAICS_2012_Code,54181,, -BTS_TSA,5412OP,NAICS_2012_Code,541810,, -BTS_TSA,5412OP,NAICS_2012_Code,54182,, -BTS_TSA,5412OP,NAICS_2012_Code,541820,, -BTS_TSA,5412OP,NAICS_2012_Code,54183,, -BTS_TSA,5412OP,NAICS_2012_Code,541830,, -BTS_TSA,5412OP,NAICS_2012_Code,54184,, -BTS_TSA,5412OP,NAICS_2012_Code,541840,, -BTS_TSA,5412OP,NAICS_2012_Code,54185,, -BTS_TSA,5412OP,NAICS_2012_Code,541850,, -BTS_TSA,5412OP,NAICS_2012_Code,54186,, -BTS_TSA,5412OP,NAICS_2012_Code,541860,, -BTS_TSA,5412OP,NAICS_2012_Code,54187,, -BTS_TSA,5412OP,NAICS_2012_Code,541870,, -BTS_TSA,5412OP,NAICS_2012_Code,54189,, -BTS_TSA,5412OP,NAICS_2012_Code,541890,, -BTS_TSA,5412OP,NAICS_2012_Code,5419,, -BTS_TSA,5412OP,NAICS_2012_Code,54191,, -BTS_TSA,5412OP,NAICS_2012_Code,541910,, -BTS_TSA,5412OP,NAICS_2012_Code,54192,, -BTS_TSA,5412OP,NAICS_2012_Code,541921,, -BTS_TSA,5412OP,NAICS_2012_Code,541922,, -BTS_TSA,5412OP,NAICS_2012_Code,54193,, -BTS_TSA,5412OP,NAICS_2012_Code,541930,, -BTS_TSA,5412OP,NAICS_2012_Code,54194,, -BTS_TSA,5412OP,NAICS_2012_Code,541940,, -BTS_TSA,5412OP,NAICS_2012_Code,54199,, -BTS_TSA,5412OP,NAICS_2012_Code,541990,, -BTS_TSA,55,NAICS_2012_Code,55,, -BTS_TSA,55,NAICS_2012_Code,551,, -BTS_TSA,55,NAICS_2012_Code,5511,, -BTS_TSA,55,NAICS_2012_Code,55111,, -BTS_TSA,55,NAICS_2012_Code,551111,, -BTS_TSA,55,NAICS_2012_Code,551112,, -BTS_TSA,55,NAICS_2012_Code,551114,, -BTS_TSA,561,NAICS_2012_Code,56,, -BTS_TSA,562,NAICS_2012_Code,56,, -BTS_TSA,561,NAICS_2012_Code,561,, -BTS_TSA,561,NAICS_2012_Code,5611,, -BTS_TSA,561,NAICS_2012_Code,56111,, -BTS_TSA,561,NAICS_2012_Code,561110,, -BTS_TSA,561,NAICS_2012_Code,5612,, -BTS_TSA,561,NAICS_2012_Code,56121,, -BTS_TSA,561,NAICS_2012_Code,561210,, -BTS_TSA,561,NAICS_2012_Code,5613,, -BTS_TSA,561,NAICS_2012_Code,56131,, -BTS_TSA,561,NAICS_2012_Code,561311,, -BTS_TSA,561,NAICS_2012_Code,561312,, -BTS_TSA,561,NAICS_2012_Code,56132,, -BTS_TSA,561,NAICS_2012_Code,561320,, -BTS_TSA,561,NAICS_2012_Code,56133,, -BTS_TSA,561,NAICS_2012_Code,561330,, -BTS_TSA,561,NAICS_2012_Code,5614,, -BTS_TSA,561,NAICS_2012_Code,56141,, -BTS_TSA,561,NAICS_2012_Code,561410,, -BTS_TSA,561,NAICS_2012_Code,56142,, -BTS_TSA,561,NAICS_2012_Code,561421,, -BTS_TSA,561,NAICS_2012_Code,561422,, -BTS_TSA,561,NAICS_2012_Code,56143,, -BTS_TSA,561,NAICS_2012_Code,561431,, -BTS_TSA,561,NAICS_2012_Code,561439,, -BTS_TSA,561,NAICS_2012_Code,56144,, -BTS_TSA,561,NAICS_2012_Code,561440,, -BTS_TSA,561,NAICS_2012_Code,56145,, -BTS_TSA,561,NAICS_2012_Code,561450,, -BTS_TSA,561,NAICS_2012_Code,56149,, -BTS_TSA,561,NAICS_2012_Code,561491,, -BTS_TSA,561,NAICS_2012_Code,561492,, -BTS_TSA,561,NAICS_2012_Code,561499,, -BTS_TSA,561,NAICS_2012_Code,5615,, -BTS_TSA,561,NAICS_2012_Code,56151,, -BTS_TSA,561,NAICS_2012_Code,561510,, -BTS_TSA,561,NAICS_2012_Code,56152,, -BTS_TSA,561,NAICS_2012_Code,561520,, -BTS_TSA,561,NAICS_2012_Code,56159,, -BTS_TSA,561,NAICS_2012_Code,561591,, -BTS_TSA,561,NAICS_2012_Code,561599,, -BTS_TSA,561,NAICS_2012_Code,5616,, -BTS_TSA,561,NAICS_2012_Code,56161,, -BTS_TSA,561,NAICS_2012_Code,561611,, -BTS_TSA,561,NAICS_2012_Code,561612,, -BTS_TSA,561,NAICS_2012_Code,561613,, -BTS_TSA,561,NAICS_2012_Code,56162,, -BTS_TSA,561,NAICS_2012_Code,561621,, -BTS_TSA,561,NAICS_2012_Code,561622,, -BTS_TSA,561,NAICS_2012_Code,5617,, -BTS_TSA,561,NAICS_2012_Code,56171,, -BTS_TSA,561,NAICS_2012_Code,561710,, -BTS_TSA,561,NAICS_2012_Code,56172,, -BTS_TSA,561,NAICS_2012_Code,561720,, -BTS_TSA,561,NAICS_2012_Code,56173,, -BTS_TSA,561,NAICS_2012_Code,561730,, -BTS_TSA,561,NAICS_2012_Code,56174,, -BTS_TSA,561,NAICS_2012_Code,561740,, -BTS_TSA,561,NAICS_2012_Code,56179,, -BTS_TSA,561,NAICS_2012_Code,561790,, -BTS_TSA,561,NAICS_2012_Code,5619,, -BTS_TSA,561,NAICS_2012_Code,56191,, -BTS_TSA,561,NAICS_2012_Code,561910,, -BTS_TSA,561,NAICS_2012_Code,56192,, -BTS_TSA,561,NAICS_2012_Code,561920,, -BTS_TSA,561,NAICS_2012_Code,56199,, -BTS_TSA,561,NAICS_2012_Code,561990,, -BTS_TSA,562,NAICS_2012_Code,562,, -BTS_TSA,562,NAICS_2012_Code,5621,, -BTS_TSA,562,NAICS_2012_Code,56211,, -BTS_TSA,562,NAICS_2012_Code,562111,, -BTS_TSA,562,NAICS_2012_Code,562112,, -BTS_TSA,562,NAICS_2012_Code,562119,, -BTS_TSA,562,NAICS_2012_Code,5622,, -BTS_TSA,562,NAICS_2012_Code,56221,, -BTS_TSA,562,NAICS_2012_Code,562211,, -BTS_TSA,562,NAICS_2012_Code,562212,, -BTS_TSA,562,NAICS_2012_Code,562213,, -BTS_TSA,562,NAICS_2012_Code,562219,, -BTS_TSA,562,NAICS_2012_Code,5629,, -BTS_TSA,562,NAICS_2012_Code,56291,, -BTS_TSA,562,NAICS_2012_Code,562910,, -BTS_TSA,562,NAICS_2012_Code,56292,, -BTS_TSA,562,NAICS_2012_Code,562920,, -BTS_TSA,562,NAICS_2012_Code,56299,, -BTS_TSA,562,NAICS_2012_Code,562991,, -BTS_TSA,562,NAICS_2012_Code,562998,, -BTS_TSA,61,NAICS_2012_Code,61,, -BTS_TSA,61,NAICS_2012_Code,611,, -BTS_TSA,61,NAICS_2012_Code,6111,, -BTS_TSA,61,NAICS_2012_Code,61111,, -BTS_TSA,61,NAICS_2012_Code,611110,, -BTS_TSA,61,NAICS_2012_Code,6112,, -BTS_TSA,61,NAICS_2012_Code,61121,, -BTS_TSA,61,NAICS_2012_Code,611210,, -BTS_TSA,61,NAICS_2012_Code,6113,, -BTS_TSA,61,NAICS_2012_Code,61131,, -BTS_TSA,61,NAICS_2012_Code,611310,, -BTS_TSA,61,NAICS_2012_Code,6114,, -BTS_TSA,61,NAICS_2012_Code,61141,, -BTS_TSA,61,NAICS_2012_Code,611410,, -BTS_TSA,61,NAICS_2012_Code,61142,, -BTS_TSA,61,NAICS_2012_Code,611420,, -BTS_TSA,61,NAICS_2012_Code,61143,, -BTS_TSA,61,NAICS_2012_Code,611430,, -BTS_TSA,61,NAICS_2012_Code,6115,, -BTS_TSA,61,NAICS_2012_Code,61151,, -BTS_TSA,61,NAICS_2012_Code,611511,, -BTS_TSA,61,NAICS_2012_Code,611512,, -BTS_TSA,61,NAICS_2012_Code,611513,, -BTS_TSA,61,NAICS_2012_Code,611519,, -BTS_TSA,61,NAICS_2012_Code,6116,, -BTS_TSA,61,NAICS_2012_Code,61161,, -BTS_TSA,61,NAICS_2012_Code,611610,, -BTS_TSA,61,NAICS_2012_Code,61162,, -BTS_TSA,61,NAICS_2012_Code,611620,, -BTS_TSA,61,NAICS_2012_Code,61163,, -BTS_TSA,61,NAICS_2012_Code,611630,, -BTS_TSA,61,NAICS_2012_Code,61169,, -BTS_TSA,61,NAICS_2012_Code,611691,, -BTS_TSA,61,NAICS_2012_Code,611692,, -BTS_TSA,61,NAICS_2012_Code,611699,, -BTS_TSA,61,NAICS_2012_Code,6117,, -BTS_TSA,61,NAICS_2012_Code,61171,, -BTS_TSA,61,NAICS_2012_Code,611710,, -BTS_TSA,621,NAICS_2012_Code,62,, -BTS_TSA,622,NAICS_2012_Code,62,, -BTS_TSA,623,NAICS_2012_Code,62,, -BTS_TSA,624,NAICS_2012_Code,62,, -BTS_TSA,621,NAICS_2012_Code,621,, -BTS_TSA,621,NAICS_2012_Code,6211,, -BTS_TSA,621,NAICS_2012_Code,62111,, -BTS_TSA,621,NAICS_2012_Code,621111,, -BTS_TSA,621,NAICS_2012_Code,621112,, -BTS_TSA,621,NAICS_2012_Code,6212,, -BTS_TSA,621,NAICS_2012_Code,62121,, -BTS_TSA,621,NAICS_2012_Code,621210,, -BTS_TSA,621,NAICS_2012_Code,6213,, -BTS_TSA,621,NAICS_2012_Code,62131,, -BTS_TSA,621,NAICS_2012_Code,621310,, -BTS_TSA,621,NAICS_2012_Code,62132,, -BTS_TSA,621,NAICS_2012_Code,621320,, -BTS_TSA,621,NAICS_2012_Code,62133,, -BTS_TSA,621,NAICS_2012_Code,621330,, -BTS_TSA,621,NAICS_2012_Code,62134,, -BTS_TSA,621,NAICS_2012_Code,621340,, -BTS_TSA,621,NAICS_2012_Code,62139,, -BTS_TSA,621,NAICS_2012_Code,621391,, -BTS_TSA,621,NAICS_2012_Code,621399,, -BTS_TSA,621,NAICS_2012_Code,6214,, -BTS_TSA,621,NAICS_2012_Code,62141,, -BTS_TSA,621,NAICS_2012_Code,621410,, -BTS_TSA,621,NAICS_2012_Code,62142,, -BTS_TSA,621,NAICS_2012_Code,621420,, -BTS_TSA,621,NAICS_2012_Code,62149,, -BTS_TSA,621,NAICS_2012_Code,621491,, -BTS_TSA,621,NAICS_2012_Code,621492,, -BTS_TSA,621,NAICS_2012_Code,621493,, -BTS_TSA,621,NAICS_2012_Code,621498,, -BTS_TSA,621,NAICS_2012_Code,6215,, -BTS_TSA,621,NAICS_2012_Code,62151,, -BTS_TSA,621,NAICS_2012_Code,621511,, -BTS_TSA,621,NAICS_2012_Code,621512,, -BTS_TSA,621,NAICS_2012_Code,6216,, -BTS_TSA,621,NAICS_2012_Code,62161,, -BTS_TSA,621,NAICS_2012_Code,621610,, -BTS_TSA,621,NAICS_2012_Code,6219,, -BTS_TSA,621,NAICS_2012_Code,62191,, -BTS_TSA,621,NAICS_2012_Code,621910,, -BTS_TSA,621,NAICS_2012_Code,62199,, -BTS_TSA,621,NAICS_2012_Code,621991,, -BTS_TSA,621,NAICS_2012_Code,621999,, -BTS_TSA,622,NAICS_2012_Code,622,, -BTS_TSA,622,NAICS_2012_Code,6221,, -BTS_TSA,622,NAICS_2012_Code,62211,, -BTS_TSA,622,NAICS_2012_Code,622110,, -BTS_TSA,622,NAICS_2012_Code,6222,, -BTS_TSA,622,NAICS_2012_Code,62221,, -BTS_TSA,622,NAICS_2012_Code,622210,, -BTS_TSA,622,NAICS_2012_Code,6223,, -BTS_TSA,622,NAICS_2012_Code,62231,, -BTS_TSA,622,NAICS_2012_Code,622310,, -BTS_TSA,623,NAICS_2012_Code,623,, -BTS_TSA,623,NAICS_2012_Code,6231,, -BTS_TSA,623,NAICS_2012_Code,62311,, -BTS_TSA,623,NAICS_2012_Code,623110,, -BTS_TSA,623,NAICS_2012_Code,6232,, -BTS_TSA,623,NAICS_2012_Code,62321,, -BTS_TSA,623,NAICS_2012_Code,623210,, -BTS_TSA,623,NAICS_2012_Code,62322,, -BTS_TSA,623,NAICS_2012_Code,623220,, -BTS_TSA,623,NAICS_2012_Code,6233,, -BTS_TSA,623,NAICS_2012_Code,62331,, -BTS_TSA,623,NAICS_2012_Code,623311,, -BTS_TSA,623,NAICS_2012_Code,623312,, -BTS_TSA,623,NAICS_2012_Code,6239,, -BTS_TSA,623,NAICS_2012_Code,62399,, -BTS_TSA,623,NAICS_2012_Code,623990,, -BTS_TSA,624,NAICS_2012_Code,624,, -BTS_TSA,624,NAICS_2012_Code,6241,, -BTS_TSA,624,NAICS_2012_Code,62411,, -BTS_TSA,624,NAICS_2012_Code,624110,, -BTS_TSA,624,NAICS_2012_Code,62412,, -BTS_TSA,624,NAICS_2012_Code,624120,, -BTS_TSA,624,NAICS_2012_Code,62419,, -BTS_TSA,624,NAICS_2012_Code,624190,, -BTS_TSA,624,NAICS_2012_Code,6242,, -BTS_TSA,624,NAICS_2012_Code,62421,, -BTS_TSA,624,NAICS_2012_Code,624210,, -BTS_TSA,624,NAICS_2012_Code,62422,, -BTS_TSA,624,NAICS_2012_Code,624221,, -BTS_TSA,624,NAICS_2012_Code,624229,, -BTS_TSA,624,NAICS_2012_Code,62423,, -BTS_TSA,624,NAICS_2012_Code,624230,, -BTS_TSA,624,NAICS_2012_Code,6243,, -BTS_TSA,624,NAICS_2012_Code,62431,, -BTS_TSA,624,NAICS_2012_Code,624310,, -BTS_TSA,624,NAICS_2012_Code,6244,, -BTS_TSA,624,NAICS_2012_Code,62441,, -BTS_TSA,624,NAICS_2012_Code,624410,, -BTS_TSA,711AS,NAICS_2012_Code,71,, -BTS_TSA,713,NAICS_2012_Code,71,, -BTS_TSA,711AS,NAICS_2012_Code,711,, -BTS_TSA,711AS,NAICS_2012_Code,7111,, -BTS_TSA,711AS,NAICS_2012_Code,71111,, -BTS_TSA,711AS,NAICS_2012_Code,711110,, -BTS_TSA,711AS,NAICS_2012_Code,71112,, -BTS_TSA,711AS,NAICS_2012_Code,711120,, -BTS_TSA,711AS,NAICS_2012_Code,71113,, -BTS_TSA,711AS,NAICS_2012_Code,711130,, -BTS_TSA,711AS,NAICS_2012_Code,71119,, -BTS_TSA,711AS,NAICS_2012_Code,711190,, -BTS_TSA,711AS,NAICS_2012_Code,7112,, -BTS_TSA,711AS,NAICS_2012_Code,71121,, -BTS_TSA,711AS,NAICS_2012_Code,711211,, -BTS_TSA,711AS,NAICS_2012_Code,711212,, -BTS_TSA,711AS,NAICS_2012_Code,711219,, -BTS_TSA,711AS,NAICS_2012_Code,7113,, -BTS_TSA,711AS,NAICS_2012_Code,71131,, -BTS_TSA,711AS,NAICS_2012_Code,711310,, -BTS_TSA,711AS,NAICS_2012_Code,71132,, -BTS_TSA,711AS,NAICS_2012_Code,711320,, -BTS_TSA,711AS,NAICS_2012_Code,7114,, -BTS_TSA,711AS,NAICS_2012_Code,71141,, -BTS_TSA,711AS,NAICS_2012_Code,711410,, -BTS_TSA,711AS,NAICS_2012_Code,7115,, -BTS_TSA,711AS,NAICS_2012_Code,71151,, -BTS_TSA,711AS,NAICS_2012_Code,711510,, -BTS_TSA,711AS,NAICS_2012_Code,712,, -BTS_TSA,711AS,NAICS_2012_Code,7121,, -BTS_TSA,711AS,NAICS_2012_Code,71211,, -BTS_TSA,711AS,NAICS_2012_Code,712110,, -BTS_TSA,711AS,NAICS_2012_Code,71212,, -BTS_TSA,711AS,NAICS_2012_Code,712120,, -BTS_TSA,711AS,NAICS_2012_Code,71213,, -BTS_TSA,711AS,NAICS_2012_Code,712130,, -BTS_TSA,711AS,NAICS_2012_Code,71219,, -BTS_TSA,711AS,NAICS_2012_Code,712190,, -BTS_TSA,713,NAICS_2012_Code,713,, -BTS_TSA,713,NAICS_2012_Code,7131,, -BTS_TSA,713,NAICS_2012_Code,71311,, -BTS_TSA,713,NAICS_2012_Code,713110,, -BTS_TSA,713,NAICS_2012_Code,71312,, -BTS_TSA,713,NAICS_2012_Code,713120,, -BTS_TSA,713,NAICS_2012_Code,7132,, -BTS_TSA,713,NAICS_2012_Code,71321,, -BTS_TSA,713,NAICS_2012_Code,713210,, -BTS_TSA,713,NAICS_2012_Code,71329,, -BTS_TSA,713,NAICS_2012_Code,713290,, -BTS_TSA,713,NAICS_2012_Code,7139,, -BTS_TSA,713,NAICS_2012_Code,71391,, -BTS_TSA,713,NAICS_2012_Code,713910,, -BTS_TSA,713,NAICS_2012_Code,71392,, -BTS_TSA,713,NAICS_2012_Code,713920,, -BTS_TSA,713,NAICS_2012_Code,71393,, -BTS_TSA,713,NAICS_2012_Code,713930,, -BTS_TSA,713,NAICS_2012_Code,71394,, -BTS_TSA,713,NAICS_2012_Code,713940,, -BTS_TSA,713,NAICS_2012_Code,71395,, -BTS_TSA,713,NAICS_2012_Code,713950,, -BTS_TSA,713,NAICS_2012_Code,71399,, -BTS_TSA,713,NAICS_2012_Code,713990,, -BTS_TSA,721,NAICS_2012_Code,72,, -BTS_TSA,722,NAICS_2012_Code,72,, -BTS_TSA,721,NAICS_2012_Code,721,, -BTS_TSA,721,NAICS_2012_Code,7211,, -BTS_TSA,721,NAICS_2012_Code,72111,, -BTS_TSA,721,NAICS_2012_Code,721110,, -BTS_TSA,721,NAICS_2012_Code,72112,, -BTS_TSA,721,NAICS_2012_Code,721120,, -BTS_TSA,721,NAICS_2012_Code,72119,, -BTS_TSA,721,NAICS_2012_Code,721191,, -BTS_TSA,721,NAICS_2012_Code,721199,, -BTS_TSA,721,NAICS_2012_Code,7212,, -BTS_TSA,721,NAICS_2012_Code,72121,, -BTS_TSA,721,NAICS_2012_Code,721211,, -BTS_TSA,721,NAICS_2012_Code,721214,, -BTS_TSA,721,NAICS_2012_Code,7213,, -BTS_TSA,721,NAICS_2012_Code,72131,, -BTS_TSA,721,NAICS_2012_Code,721310,, -BTS_TSA,722,NAICS_2012_Code,722,, -BTS_TSA,722,NAICS_2012_Code,7223,, -BTS_TSA,722,NAICS_2012_Code,72231,, -BTS_TSA,722,NAICS_2012_Code,722310,, -BTS_TSA,722,NAICS_2012_Code,72232,, -BTS_TSA,722,NAICS_2012_Code,722320,, -BTS_TSA,722,NAICS_2012_Code,72233,, -BTS_TSA,722,NAICS_2012_Code,722330,, -BTS_TSA,722,NAICS_2012_Code,7224,, -BTS_TSA,722,NAICS_2012_Code,72241,, -BTS_TSA,722,NAICS_2012_Code,722410,, -BTS_TSA,722,NAICS_2012_Code,7225,, -BTS_TSA,722,NAICS_2012_Code,72251,, -BTS_TSA,722,NAICS_2012_Code,722511,, -BTS_TSA,722,NAICS_2012_Code,722513,, -BTS_TSA,722,NAICS_2012_Code,722514,, -BTS_TSA,722,NAICS_2012_Code,722515,, -BTS_TSA,81,NAICS_2012_Code,81,, -BTS_TSA,81,NAICS_2012_Code,811,, -BTS_TSA,81,NAICS_2012_Code,8111,, -BTS_TSA,81,NAICS_2012_Code,81111,, -BTS_TSA,81,NAICS_2012_Code,811111,, -BTS_TSA,81,NAICS_2012_Code,811112,, -BTS_TSA,81,NAICS_2012_Code,811113,, -BTS_TSA,81,NAICS_2012_Code,811118,, -BTS_TSA,81,NAICS_2012_Code,81112,, -BTS_TSA,81,NAICS_2012_Code,811121,, -BTS_TSA,81,NAICS_2012_Code,811122,, -BTS_TSA,81,NAICS_2012_Code,81119,, -BTS_TSA,81,NAICS_2012_Code,811191,, -BTS_TSA,81,NAICS_2012_Code,811192,, -BTS_TSA,81,NAICS_2012_Code,811198,, -BTS_TSA,81,NAICS_2012_Code,8112,, -BTS_TSA,81,NAICS_2012_Code,81121,, -BTS_TSA,81,NAICS_2012_Code,811211,, -BTS_TSA,81,NAICS_2012_Code,811212,, -BTS_TSA,81,NAICS_2012_Code,811213,, -BTS_TSA,81,NAICS_2012_Code,811219,, -BTS_TSA,81,NAICS_2012_Code,8113,, -BTS_TSA,81,NAICS_2012_Code,81131,, -BTS_TSA,81,NAICS_2012_Code,811310,, -BTS_TSA,81,NAICS_2012_Code,8114,, -BTS_TSA,81,NAICS_2012_Code,81141,, -BTS_TSA,81,NAICS_2012_Code,811411,, -BTS_TSA,81,NAICS_2012_Code,811412,, -BTS_TSA,81,NAICS_2012_Code,81142,, -BTS_TSA,81,NAICS_2012_Code,811420,, -BTS_TSA,81,NAICS_2012_Code,81143,, -BTS_TSA,81,NAICS_2012_Code,811430,, -BTS_TSA,81,NAICS_2012_Code,81149,, -BTS_TSA,81,NAICS_2012_Code,811490,, -BTS_TSA,81,NAICS_2012_Code,812,, -BTS_TSA,81,NAICS_2012_Code,8121,, -BTS_TSA,81,NAICS_2012_Code,81211,, -BTS_TSA,81,NAICS_2012_Code,812111,, -BTS_TSA,81,NAICS_2012_Code,812112,, -BTS_TSA,81,NAICS_2012_Code,812113,, -BTS_TSA,81,NAICS_2012_Code,81219,, -BTS_TSA,81,NAICS_2012_Code,812191,, -BTS_TSA,81,NAICS_2012_Code,812199,, -BTS_TSA,81,NAICS_2012_Code,8122,, -BTS_TSA,81,NAICS_2012_Code,81221,, -BTS_TSA,81,NAICS_2012_Code,812210,, -BTS_TSA,81,NAICS_2012_Code,81222,, -BTS_TSA,81,NAICS_2012_Code,812220,, -BTS_TSA,81,NAICS_2012_Code,8123,, -BTS_TSA,81,NAICS_2012_Code,81231,, -BTS_TSA,81,NAICS_2012_Code,812310,, -BTS_TSA,81,NAICS_2012_Code,81232,, -BTS_TSA,81,NAICS_2012_Code,812320,, -BTS_TSA,81,NAICS_2012_Code,81233,, -BTS_TSA,81,NAICS_2012_Code,812331,, -BTS_TSA,81,NAICS_2012_Code,812332,, -BTS_TSA,81,NAICS_2012_Code,8129,, -BTS_TSA,81,NAICS_2012_Code,81291,, -BTS_TSA,81,NAICS_2012_Code,812910,, -BTS_TSA,81,NAICS_2012_Code,81292,, -BTS_TSA,81,NAICS_2012_Code,812921,, -BTS_TSA,81,NAICS_2012_Code,812922,, -BTS_TSA,81,NAICS_2012_Code,81293,, -BTS_TSA,81,NAICS_2012_Code,812930,, -BTS_TSA,81,NAICS_2012_Code,81299,, -BTS_TSA,81,NAICS_2012_Code,812990,, -BTS_TSA,81,NAICS_2012_Code,813,, -BTS_TSA,81,NAICS_2012_Code,8131,, -BTS_TSA,81,NAICS_2012_Code,81311,, -BTS_TSA,81,NAICS_2012_Code,813110,, -BTS_TSA,81,NAICS_2012_Code,8132,, -BTS_TSA,81,NAICS_2012_Code,81321,, -BTS_TSA,81,NAICS_2012_Code,813211,, -BTS_TSA,81,NAICS_2012_Code,813212,, -BTS_TSA,81,NAICS_2012_Code,813219,, -BTS_TSA,81,NAICS_2012_Code,8133,, -BTS_TSA,81,NAICS_2012_Code,81331,, -BTS_TSA,81,NAICS_2012_Code,813311,, -BTS_TSA,81,NAICS_2012_Code,813312,, -BTS_TSA,81,NAICS_2012_Code,813319,, -BTS_TSA,81,NAICS_2012_Code,8134,, -BTS_TSA,81,NAICS_2012_Code,81341,, -BTS_TSA,81,NAICS_2012_Code,813410,, -BTS_TSA,81,NAICS_2012_Code,8139,, -BTS_TSA,81,NAICS_2012_Code,81391,, -BTS_TSA,81,NAICS_2012_Code,813910,, -BTS_TSA,81,NAICS_2012_Code,81392,, -BTS_TSA,81,NAICS_2012_Code,813920,, -BTS_TSA,81,NAICS_2012_Code,81393,, -BTS_TSA,81,NAICS_2012_Code,813930,, -BTS_TSA,81,NAICS_2012_Code,81394,, -BTS_TSA,81,NAICS_2012_Code,813940,, -BTS_TSA,81,NAICS_2012_Code,81399,, -BTS_TSA,81,NAICS_2012_Code,813990,, -BTS_TSA,81,NAICS_2012_Code,814,, -BTS_TSA,81,NAICS_2012_Code,8141,, -BTS_TSA,81,NAICS_2012_Code,81411,, -BTS_TSA,81,NAICS_2012_Code,814110,, -BTS_TSA,GSLG,NAICS_2012_Code,92,, -BTS_TSA,GFE,NAICS_2012_Code,92,, -BTS_TSA,GSLE,NAICS_2012_Code,92,, -BTS_TSA,GFGD,NAICS_2012_Code,92,, -BTS_TSA,GFGN,NAICS_2012_Code,92,, -BTS_TSA,GSLG,NAICS_2012_Code,921,, -BTS_TSA,GFGN,NAICS_2012_Code,921,, -BTS_TSA,GSLG,NAICS_2012_Code,9211,, -BTS_TSA,GFGN,NAICS_2012_Code,9211,, -BTS_TSA,GSLG,NAICS_2012_Code,92111,, -BTS_TSA,GFGN,NAICS_2012_Code,92111,, -BTS_TSA,GSLG,NAICS_2012_Code,921110,, -BTS_TSA,GFGN,NAICS_2012_Code,921110,, -BTS_TSA,GSLG,NAICS_2012_Code,92112,, -BTS_TSA,GFGN,NAICS_2012_Code,92112,, -BTS_TSA,GSLG,NAICS_2012_Code,921120,, -BTS_TSA,GFGN,NAICS_2012_Code,921120,, -BTS_TSA,GSLG,NAICS_2012_Code,92113,, -BTS_TSA,GFGN,NAICS_2012_Code,92113,, -BTS_TSA,GSLG,NAICS_2012_Code,921130,, -BTS_TSA,GFGN,NAICS_2012_Code,921130,, -BTS_TSA,GSLG,NAICS_2012_Code,92114,, -BTS_TSA,GFGN,NAICS_2012_Code,92114,, -BTS_TSA,GSLG,NAICS_2012_Code,921140,, -BTS_TSA,GFGN,NAICS_2012_Code,921140,, -BTS_TSA,GSLG,NAICS_2012_Code,92115,, -BTS_TSA,GSLG,NAICS_2012_Code,921150,, -BTS_TSA,GSLG,NAICS_2012_Code,92119,, -BTS_TSA,GFGN,NAICS_2012_Code,92119,, -BTS_TSA,GSLG,NAICS_2012_Code,921190,, -BTS_TSA,GFGN,NAICS_2012_Code,921190,, -BTS_TSA,GSLG,NAICS_2012_Code,922,, -BTS_TSA,GSLE,NAICS_2012_Code,922,, -BTS_TSA,GFGN,NAICS_2012_Code,922,, -BTS_TSA,GSLG,NAICS_2012_Code,9221,, -BTS_TSA,GFE,NAICS_2012_Code,9221,, -BTS_TSA,GSLE,NAICS_2012_Code,9221,, -BTS_TSA,GFGN,NAICS_2012_Code,9221,, -BTS_TSA,GSLG,NAICS_2012_Code,92211,, -BTS_TSA,GFGN,NAICS_2012_Code,92211,, -BTS_TSA,GSLG,NAICS_2012_Code,922110,, -BTS_TSA,GFGN,NAICS_2012_Code,922110,, -BTS_TSA,GSLG,NAICS_2012_Code,92212,, -BTS_TSA,GFE,NAICS_2012_Code,92212,, -BTS_TSA,GSLE,NAICS_2012_Code,92212,, -BTS_TSA,GFGN,NAICS_2012_Code,92212,, -BTS_TSA,GSLG,NAICS_2012_Code,922120,, -BTS_TSA,GFGN,NAICS_2012_Code,922120,, -BTS_TSA,GSLG,NAICS_2012_Code,92213,, -BTS_TSA,GFGN,NAICS_2012_Code,92213,, -BTS_TSA,GSLG,NAICS_2012_Code,922130,, -BTS_TSA,GFGN,NAICS_2012_Code,922130,, -BTS_TSA,GSLG,NAICS_2012_Code,92214,, -BTS_TSA,GFE,NAICS_2012_Code,92214,, -BTS_TSA,GSLE,NAICS_2012_Code,92214,, -BTS_TSA,GFGN,NAICS_2012_Code,92214,, -BTS_TSA,GSLG,NAICS_2012_Code,922140,, -BTS_TSA,GFGN,NAICS_2012_Code,922140,, -BTS_TSA,GSLG,NAICS_2012_Code,92215,, -BTS_TSA,GFGN,NAICS_2012_Code,92215,, -BTS_TSA,GSLG,NAICS_2012_Code,922150,, -BTS_TSA,GFGN,NAICS_2012_Code,922150,, -BTS_TSA,GSLG,NAICS_2012_Code,92216,, -BTS_TSA,GSLE,NAICS_2012_Code,92216,, -BTS_TSA,GSLG,NAICS_2012_Code,922160,, -BTS_TSA,GFGN,NAICS_2012_Code,922160,, -BTS_TSA,GSLG,NAICS_2012_Code,92219,, -BTS_TSA,GFGN,NAICS_2012_Code,92219,, -BTS_TSA,GSLG,NAICS_2012_Code,922190,, -BTS_TSA,GFGN,NAICS_2012_Code,922190,, -BTS_TSA,GSLG,NAICS_2012_Code,923,, -BTS_TSA,GFGN,NAICS_2012_Code,923,, -BTS_TSA,GSLG,NAICS_2012_Code,9231,, -BTS_TSA,GFGN,NAICS_2012_Code,9231,, -BTS_TSA,GSLG,NAICS_2012_Code,92311,, -BTS_TSA,GFGN,NAICS_2012_Code,92311,, -BTS_TSA,GSLG,NAICS_2012_Code,923110,, -BTS_TSA,GFGN,NAICS_2012_Code,923110,, -BTS_TSA,GSLG,NAICS_2012_Code,92312,, -BTS_TSA,GFGN,NAICS_2012_Code,92312,, -BTS_TSA,GSLG,NAICS_2012_Code,923120,, -BTS_TSA,GFGN,NAICS_2012_Code,923120,, -BTS_TSA,GSLG,NAICS_2012_Code,92313,, -BTS_TSA,GFGN,NAICS_2012_Code,92313,, -BTS_TSA,GSLG,NAICS_2012_Code,923130,, -BTS_TSA,GFGN,NAICS_2012_Code,923130,, -BTS_TSA,GFGN,NAICS_2012_Code,92314,, -BTS_TSA,GFGN,NAICS_2012_Code,923140,, -BTS_TSA,GSLG,NAICS_2012_Code,924,, -BTS_TSA,GFGN,NAICS_2012_Code,924,, -BTS_TSA,GSLG,NAICS_2012_Code,9241,, -BTS_TSA,GFGN,NAICS_2012_Code,9241,, -BTS_TSA,GSLG,NAICS_2012_Code,92411,, -BTS_TSA,GFGN,NAICS_2012_Code,92411,, -BTS_TSA,GSLG,NAICS_2012_Code,924110,, -BTS_TSA,GFGN,NAICS_2012_Code,924110,, -BTS_TSA,GSLG,NAICS_2012_Code,92412,, -BTS_TSA,GFGN,NAICS_2012_Code,92412,, -BTS_TSA,GSLG,NAICS_2012_Code,924120,, -BTS_TSA,GFGN,NAICS_2012_Code,924120,, -BTS_TSA,GSLG,NAICS_2012_Code,925,, -BTS_TSA,GFGN,NAICS_2012_Code,925,, -BTS_TSA,GSLG,NAICS_2012_Code,9251,, -BTS_TSA,GFGN,NAICS_2012_Code,9251,, -BTS_TSA,GSLG,NAICS_2012_Code,92511,, -BTS_TSA,GFGN,NAICS_2012_Code,92511,, -BTS_TSA,GSLG,NAICS_2012_Code,925110,, -BTS_TSA,GFGN,NAICS_2012_Code,925110,, -BTS_TSA,GSLG,NAICS_2012_Code,92512,, -BTS_TSA,GFGN,NAICS_2012_Code,92512,, -BTS_TSA,GSLG,NAICS_2012_Code,925120,, -BTS_TSA,GFGN,NAICS_2012_Code,925120,, -BTS_TSA,GSLG,NAICS_2012_Code,926,, -BTS_TSA,GFGN,NAICS_2012_Code,926,, -BTS_TSA,GSLG,NAICS_2012_Code,9261,, -BTS_TSA,GFGN,NAICS_2012_Code,9261,, -BTS_TSA,GSLG,NAICS_2012_Code,92611,, -BTS_TSA,GFGN,NAICS_2012_Code,92611,, -BTS_TSA,GSLG,NAICS_2012_Code,926110,, -BTS_TSA,GFGN,NAICS_2012_Code,926110,, -BTS_TSA,GFGN,NAICS_2012_Code,92612,, -BTS_TSA,GSLG,NAICS_2012_Code,926120,, -BTS_TSA,GSLG,NAICS_2012_Code,92613,, -BTS_TSA,GFGN,NAICS_2012_Code,92613,, -BTS_TSA,GSLG,NAICS_2012_Code,926130,, -BTS_TSA,GFGN,NAICS_2012_Code,926130,, -BTS_TSA,GSLG,NAICS_2012_Code,92614,, -BTS_TSA,GFGN,NAICS_2012_Code,92614,, -BTS_TSA,GSLG,NAICS_2012_Code,926140,, -BTS_TSA,GFGN,NAICS_2012_Code,926140,, -BTS_TSA,GSLG,NAICS_2012_Code,92615,, -BTS_TSA,GFGN,NAICS_2012_Code,92615,, -BTS_TSA,GSLG,NAICS_2012_Code,926150,, -BTS_TSA,GFGN,NAICS_2012_Code,926150,, -BTS_TSA,GFE,NAICS_2012_Code,927,, -BTS_TSA,GFE,NAICS_2012_Code,9271,, -BTS_TSA,GFE,NAICS_2012_Code,92711,, -BTS_TSA,GFE,NAICS_2012_Code,927110,, -BTS_TSA,GFGD,NAICS_2012_Code,928,, -BTS_TSA,GFGN,NAICS_2012_Code,928,, -BTS_TSA,GFGD,NAICS_2012_Code,9281,, -BTS_TSA,GFGN,NAICS_2012_Code,9281,, -BTS_TSA,GFGD,NAICS_2012_Code,92811,, -BTS_TSA,GFGD,NAICS_2012_Code,928110,, -BTS_TSA,GFGN,NAICS_2012_Code,92812,, -BTS_TSA,GFGN,NAICS_2012_Code,928120,, -BTS_TSA,F010,NAICS_2012_Code,F010,, -BTS_TSA,F010,NAICS_2012_Code,F01000,, -BTS_TSA,GFE,NAICS_2012_Code,S00101,, -BTS_TSA,GSLE,NAICS_2012_Code,S00201,, -BTS_TSA,GSLE,NAICS_2012_Code,S00202,, +,ActivitySourceName,Activity,SectorSourceName,Sector,SectorType,Notes +4,BTS_TSA,111CA,NAICS_2012_Code,11111,, +5,BTS_TSA,111CA,NAICS_2012_Code,111110,, +6,BTS_TSA,111CA,NAICS_2012_Code,11112,, +7,BTS_TSA,111CA,NAICS_2012_Code,111120,, +8,BTS_TSA,111CA,NAICS_2012_Code,11113,, +9,BTS_TSA,111CA,NAICS_2012_Code,111130,, +10,BTS_TSA,111CA,NAICS_2012_Code,11114,, +11,BTS_TSA,111CA,NAICS_2012_Code,111140,, +12,BTS_TSA,111CA,NAICS_2012_Code,11115,, +13,BTS_TSA,111CA,NAICS_2012_Code,111150,, +14,BTS_TSA,111CA,NAICS_2012_Code,11116,, +15,BTS_TSA,111CA,NAICS_2012_Code,111160,, +16,BTS_TSA,111CA,NAICS_2012_Code,11119,, +17,BTS_TSA,111CA,NAICS_2012_Code,111191,, +18,BTS_TSA,111CA,NAICS_2012_Code,111199,, +20,BTS_TSA,111CA,NAICS_2012_Code,11121,, +21,BTS_TSA,111CA,NAICS_2012_Code,111211,, +22,BTS_TSA,111CA,NAICS_2012_Code,111219,, +24,BTS_TSA,111CA,NAICS_2012_Code,11131,, +25,BTS_TSA,111CA,NAICS_2012_Code,111310,, +26,BTS_TSA,111CA,NAICS_2012_Code,11132,, +27,BTS_TSA,111CA,NAICS_2012_Code,111320,, +28,BTS_TSA,111CA,NAICS_2012_Code,11133,, +29,BTS_TSA,111CA,NAICS_2012_Code,111331,, +30,BTS_TSA,111CA,NAICS_2012_Code,111332,, +31,BTS_TSA,111CA,NAICS_2012_Code,111333,, +32,BTS_TSA,111CA,NAICS_2012_Code,111334,, +33,BTS_TSA,111CA,NAICS_2012_Code,111335,, +34,BTS_TSA,111CA,NAICS_2012_Code,111336,, +35,BTS_TSA,111CA,NAICS_2012_Code,111339,, +37,BTS_TSA,111CA,NAICS_2012_Code,11141,, +38,BTS_TSA,111CA,NAICS_2012_Code,111411,, +39,BTS_TSA,111CA,NAICS_2012_Code,111419,, +40,BTS_TSA,111CA,NAICS_2012_Code,11142,, +41,BTS_TSA,111CA,NAICS_2012_Code,111421,, +42,BTS_TSA,111CA,NAICS_2012_Code,111422,, +44,BTS_TSA,111CA,NAICS_2012_Code,11191,, +45,BTS_TSA,111CA,NAICS_2012_Code,111910,, +46,BTS_TSA,111CA,NAICS_2012_Code,11192,, +47,BTS_TSA,111CA,NAICS_2012_Code,111920,, +48,BTS_TSA,111CA,NAICS_2012_Code,11193,, +49,BTS_TSA,111CA,NAICS_2012_Code,111930,, +50,BTS_TSA,111CA,NAICS_2012_Code,11194,, +51,BTS_TSA,111CA,NAICS_2012_Code,111940,, +52,BTS_TSA,111CA,NAICS_2012_Code,11199,, +53,BTS_TSA,111CA,NAICS_2012_Code,111991,, +54,BTS_TSA,111CA,NAICS_2012_Code,111992,, +55,BTS_TSA,111CA,NAICS_2012_Code,111998,, +58,BTS_TSA,111CA,NAICS_2012_Code,11211,, +59,BTS_TSA,111CA,NAICS_2012_Code,112111,, +60,BTS_TSA,111CA,NAICS_2012_Code,112112,, +61,BTS_TSA,111CA,NAICS_2012_Code,11212,, +62,BTS_TSA,111CA,NAICS_2012_Code,112120,, +63,BTS_TSA,111CA,NAICS_2012_Code,11213,, +64,BTS_TSA,111CA,NAICS_2012_Code,112130,, +66,BTS_TSA,111CA,NAICS_2012_Code,11221,, +67,BTS_TSA,111CA,NAICS_2012_Code,112210,, +69,BTS_TSA,111CA,NAICS_2012_Code,11231,, +70,BTS_TSA,111CA,NAICS_2012_Code,112310,, +71,BTS_TSA,111CA,NAICS_2012_Code,11232,, +72,BTS_TSA,111CA,NAICS_2012_Code,112320,, +73,BTS_TSA,111CA,NAICS_2012_Code,11233,, +74,BTS_TSA,111CA,NAICS_2012_Code,112330,, +75,BTS_TSA,111CA,NAICS_2012_Code,11234,, +76,BTS_TSA,111CA,NAICS_2012_Code,112340,, +77,BTS_TSA,111CA,NAICS_2012_Code,11239,, +78,BTS_TSA,111CA,NAICS_2012_Code,112390,, +80,BTS_TSA,111CA,NAICS_2012_Code,11241,, +81,BTS_TSA,111CA,NAICS_2012_Code,112410,, +82,BTS_TSA,111CA,NAICS_2012_Code,11242,, +83,BTS_TSA,111CA,NAICS_2012_Code,112420,, +85,BTS_TSA,111CA,NAICS_2012_Code,11251,, +86,BTS_TSA,111CA,NAICS_2012_Code,112511,, +87,BTS_TSA,111CA,NAICS_2012_Code,112512,, +88,BTS_TSA,111CA,NAICS_2012_Code,112519,, +90,BTS_TSA,111CA,NAICS_2012_Code,11291,, +91,BTS_TSA,111CA,NAICS_2012_Code,112910,, +92,BTS_TSA,111CA,NAICS_2012_Code,11292,, +93,BTS_TSA,111CA,NAICS_2012_Code,112920,, +94,BTS_TSA,111CA,NAICS_2012_Code,11293,, +95,BTS_TSA,111CA,NAICS_2012_Code,112930,, +96,BTS_TSA,111CA,NAICS_2012_Code,11299,, +97,BTS_TSA,111CA,NAICS_2012_Code,112990,, +100,BTS_TSA,113FF,NAICS_2012_Code,11311,, +101,BTS_TSA,113FF,NAICS_2012_Code,113110,, +103,BTS_TSA,113FF,NAICS_2012_Code,11321,, +104,BTS_TSA,113FF,NAICS_2012_Code,113210,, +106,BTS_TSA,113FF,NAICS_2012_Code,11331,, +107,BTS_TSA,113FF,NAICS_2012_Code,113310,, +110,BTS_TSA,113FF,NAICS_2012_Code,11411,, +111,BTS_TSA,113FF,NAICS_2012_Code,114111,, +112,BTS_TSA,113FF,NAICS_2012_Code,114112,, +113,BTS_TSA,113FF,NAICS_2012_Code,114119,, +115,BTS_TSA,113FF,NAICS_2012_Code,11421,, +116,BTS_TSA,113FF,NAICS_2012_Code,114210,, +119,BTS_TSA,113FF,NAICS_2012_Code,11511,, +120,BTS_TSA,113FF,NAICS_2012_Code,115111,, +121,BTS_TSA,113FF,NAICS_2012_Code,115112,, +122,BTS_TSA,113FF,NAICS_2012_Code,115113,, +123,BTS_TSA,113FF,NAICS_2012_Code,115114,, +124,BTS_TSA,113FF,NAICS_2012_Code,115115,, +125,BTS_TSA,113FF,NAICS_2012_Code,115116,, +127,BTS_TSA,113FF,NAICS_2012_Code,11521,, +128,BTS_TSA,113FF,NAICS_2012_Code,115210,, +130,BTS_TSA,113FF,NAICS_2012_Code,11531,, +131,BTS_TSA,113FF,NAICS_2012_Code,115310,, +135,BTS_TSA,211,NAICS_2012_Code,211,, +136,BTS_TSA,211,NAICS_2012_Code,2111,, +137,BTS_TSA,211,NAICS_2012_Code,21111,, +138,BTS_TSA,211,NAICS_2012_Code,211111,, +139,BTS_TSA,211,NAICS_2012_Code,211112,, +140,BTS_TSA,212,NAICS_2012_Code,212,, +141,BTS_TSA,212,NAICS_2012_Code,2121,, +142,BTS_TSA,212,NAICS_2012_Code,21211,, +143,BTS_TSA,212,NAICS_2012_Code,212111,, +144,BTS_TSA,212,NAICS_2012_Code,212112,, +145,BTS_TSA,212,NAICS_2012_Code,212113,, +146,BTS_TSA,212,NAICS_2012_Code,2122,, +147,BTS_TSA,212,NAICS_2012_Code,21221,, +148,BTS_TSA,212,NAICS_2012_Code,212210,, +149,BTS_TSA,212,NAICS_2012_Code,21222,, +150,BTS_TSA,212,NAICS_2012_Code,212221,, +151,BTS_TSA,212,NAICS_2012_Code,212222,, +152,BTS_TSA,212,NAICS_2012_Code,21223,, +153,BTS_TSA,212,NAICS_2012_Code,212231,, +154,BTS_TSA,212,NAICS_2012_Code,212234,, +155,BTS_TSA,212,NAICS_2012_Code,21229,, +156,BTS_TSA,212,NAICS_2012_Code,212291,, +157,BTS_TSA,212,NAICS_2012_Code,212299,, +158,BTS_TSA,212,NAICS_2012_Code,2123,, +159,BTS_TSA,212,NAICS_2012_Code,21231,, +160,BTS_TSA,212,NAICS_2012_Code,212311,, +161,BTS_TSA,212,NAICS_2012_Code,212312,, +162,BTS_TSA,212,NAICS_2012_Code,212313,, +163,BTS_TSA,212,NAICS_2012_Code,212319,, +164,BTS_TSA,212,NAICS_2012_Code,21232,, +165,BTS_TSA,212,NAICS_2012_Code,212321,, +166,BTS_TSA,212,NAICS_2012_Code,212322,, +167,BTS_TSA,212,NAICS_2012_Code,212324,, +168,BTS_TSA,212,NAICS_2012_Code,212325,, +169,BTS_TSA,212,NAICS_2012_Code,21239,, +170,BTS_TSA,212,NAICS_2012_Code,212391,, +171,BTS_TSA,212,NAICS_2012_Code,212392,, +172,BTS_TSA,212,NAICS_2012_Code,212393,, +173,BTS_TSA,212,NAICS_2012_Code,212399,, +174,BTS_TSA,213,NAICS_2012_Code,213,, +175,BTS_TSA,213,NAICS_2012_Code,2131,, +176,BTS_TSA,213,NAICS_2012_Code,21311,, +177,BTS_TSA,213,NAICS_2012_Code,213111,, +178,BTS_TSA,213,NAICS_2012_Code,213112,, +179,BTS_TSA,213,NAICS_2012_Code,213113,, +180,BTS_TSA,213,NAICS_2012_Code,213114,, +181,BTS_TSA,213,NAICS_2012_Code,213115,, +182,BTS_TSA,22,NAICS_2012_Code,22,, +183,BTS_TSA,22,NAICS_2012_Code,221,, +184,BTS_TSA,22,NAICS_2012_Code,2211,, +185,BTS_TSA,22,NAICS_2012_Code,22111,, +186,BTS_TSA,22,NAICS_2012_Code,221111,, +187,BTS_TSA,22,NAICS_2012_Code,221112,, +188,BTS_TSA,22,NAICS_2012_Code,221113,, +189,BTS_TSA,22,NAICS_2012_Code,221114,, +190,BTS_TSA,22,NAICS_2012_Code,221115,, +191,BTS_TSA,22,NAICS_2012_Code,221116,, +192,BTS_TSA,22,NAICS_2012_Code,221117,, +193,BTS_TSA,22,NAICS_2012_Code,221118,, +194,BTS_TSA,22,NAICS_2012_Code,22112,, +195,BTS_TSA,22,NAICS_2012_Code,221121,, +196,BTS_TSA,22,NAICS_2012_Code,221122,, +197,BTS_TSA,22,NAICS_2012_Code,2212,, +198,BTS_TSA,22,NAICS_2012_Code,22121,, +199,BTS_TSA,22,NAICS_2012_Code,221210,, +200,BTS_TSA,22,NAICS_2012_Code,2213,, +201,BTS_TSA,22,NAICS_2012_Code,22131,, +202,BTS_TSA,22,NAICS_2012_Code,221310,, +203,BTS_TSA,22,NAICS_2012_Code,22132,, +204,BTS_TSA,22,NAICS_2012_Code,221320,, +205,BTS_TSA,22,NAICS_2012_Code,22133,, +206,BTS_TSA,22,NAICS_2012_Code,221330,, +207,BTS_TSA,23,NAICS_2012_Code,23,, +208,BTS_TSA,23,NAICS_2012_Code,236,, +209,BTS_TSA,23,NAICS_2012_Code,2361,, +210,BTS_TSA,23,NAICS_2012_Code,23611,, +211,BTS_TSA,23,NAICS_2012_Code,236115,, +212,BTS_TSA,23,NAICS_2012_Code,236116,, +213,BTS_TSA,23,NAICS_2012_Code,236117,, +214,BTS_TSA,23,NAICS_2012_Code,236118,, +215,BTS_TSA,23,NAICS_2012_Code,2362,, +216,BTS_TSA,23,NAICS_2012_Code,23621,, +217,BTS_TSA,23,NAICS_2012_Code,236210,, +218,BTS_TSA,23,NAICS_2012_Code,23622,, +219,BTS_TSA,23,NAICS_2012_Code,236220,, +220,BTS_TSA,23,NAICS_2012_Code,237,, +221,BTS_TSA,23,NAICS_2012_Code,2371,, +222,BTS_TSA,23,NAICS_2012_Code,23711,, +223,BTS_TSA,23,NAICS_2012_Code,237110,, +224,BTS_TSA,23,NAICS_2012_Code,23712,, +225,BTS_TSA,23,NAICS_2012_Code,237120,, +226,BTS_TSA,23,NAICS_2012_Code,23713,, +227,BTS_TSA,23,NAICS_2012_Code,237130,, +228,BTS_TSA,23,NAICS_2012_Code,2372,, +229,BTS_TSA,23,NAICS_2012_Code,23721,, +230,BTS_TSA,23,NAICS_2012_Code,237210,, +231,BTS_TSA,23,NAICS_2012_Code,2373,, +232,BTS_TSA,23,NAICS_2012_Code,23731,, +233,BTS_TSA,23,NAICS_2012_Code,237310,, +234,BTS_TSA,23,NAICS_2012_Code,2379,, +235,BTS_TSA,23,NAICS_2012_Code,23799,, +236,BTS_TSA,23,NAICS_2012_Code,237990,, +237,BTS_TSA,23,NAICS_2012_Code,238,, +238,BTS_TSA,23,NAICS_2012_Code,2381,, +239,BTS_TSA,23,NAICS_2012_Code,23811,, +240,BTS_TSA,23,NAICS_2012_Code,238110,, +241,BTS_TSA,23,NAICS_2012_Code,23812,, +242,BTS_TSA,23,NAICS_2012_Code,238120,, +243,BTS_TSA,23,NAICS_2012_Code,23813,, +244,BTS_TSA,23,NAICS_2012_Code,238130,, +245,BTS_TSA,23,NAICS_2012_Code,23814,, +246,BTS_TSA,23,NAICS_2012_Code,238140,, +247,BTS_TSA,23,NAICS_2012_Code,23815,, +248,BTS_TSA,23,NAICS_2012_Code,238150,, +249,BTS_TSA,23,NAICS_2012_Code,23816,, +250,BTS_TSA,23,NAICS_2012_Code,238160,, +251,BTS_TSA,23,NAICS_2012_Code,23817,, +252,BTS_TSA,23,NAICS_2012_Code,238170,, +253,BTS_TSA,23,NAICS_2012_Code,23819,, +254,BTS_TSA,23,NAICS_2012_Code,238190,, +255,BTS_TSA,23,NAICS_2012_Code,2382,, +256,BTS_TSA,23,NAICS_2012_Code,23821,, +257,BTS_TSA,23,NAICS_2012_Code,238210,, +258,BTS_TSA,23,NAICS_2012_Code,23822,, +259,BTS_TSA,23,NAICS_2012_Code,238220,, +260,BTS_TSA,23,NAICS_2012_Code,23829,, +261,BTS_TSA,23,NAICS_2012_Code,238290,, +262,BTS_TSA,23,NAICS_2012_Code,2383,, +263,BTS_TSA,23,NAICS_2012_Code,23831,, +264,BTS_TSA,23,NAICS_2012_Code,238310,, +265,BTS_TSA,23,NAICS_2012_Code,23832,, +266,BTS_TSA,23,NAICS_2012_Code,238320,, +267,BTS_TSA,23,NAICS_2012_Code,23833,, +268,BTS_TSA,23,NAICS_2012_Code,238330,, +269,BTS_TSA,23,NAICS_2012_Code,23834,, +270,BTS_TSA,23,NAICS_2012_Code,238340,, +271,BTS_TSA,23,NAICS_2012_Code,23835,, +272,BTS_TSA,23,NAICS_2012_Code,238350,, +273,BTS_TSA,23,NAICS_2012_Code,23839,, +274,BTS_TSA,23,NAICS_2012_Code,238390,, +275,BTS_TSA,23,NAICS_2012_Code,2389,, +276,BTS_TSA,23,NAICS_2012_Code,23891,, +277,BTS_TSA,23,NAICS_2012_Code,238910,, +278,BTS_TSA,23,NAICS_2012_Code,23899,, +279,BTS_TSA,23,NAICS_2012_Code,238990,, +285,BTS_TSA,311FT,NAICS_2012_Code,31111,, +286,BTS_TSA,311FT,NAICS_2012_Code,311111,, +287,BTS_TSA,311FT,NAICS_2012_Code,311119,, +289,BTS_TSA,311FT,NAICS_2012_Code,31121,, +290,BTS_TSA,311FT,NAICS_2012_Code,311211,, +291,BTS_TSA,311FT,NAICS_2012_Code,311212,, +292,BTS_TSA,311FT,NAICS_2012_Code,311213,, +293,BTS_TSA,311FT,NAICS_2012_Code,31122,, +294,BTS_TSA,311FT,NAICS_2012_Code,311221,, +295,BTS_TSA,311FT,NAICS_2012_Code,311224,, +296,BTS_TSA,311FT,NAICS_2012_Code,311225,, +297,BTS_TSA,311FT,NAICS_2012_Code,31123,, +298,BTS_TSA,311FT,NAICS_2012_Code,311230,, +300,BTS_TSA,311FT,NAICS_2012_Code,31131,, +301,BTS_TSA,311FT,NAICS_2012_Code,311313,, +302,BTS_TSA,311FT,NAICS_2012_Code,311314,, +303,BTS_TSA,311FT,NAICS_2012_Code,31134,, +304,BTS_TSA,311FT,NAICS_2012_Code,311340,, +305,BTS_TSA,311FT,NAICS_2012_Code,31135,, +306,BTS_TSA,311FT,NAICS_2012_Code,311351,, +307,BTS_TSA,311FT,NAICS_2012_Code,311352,, +309,BTS_TSA,311FT,NAICS_2012_Code,31141,, +310,BTS_TSA,311FT,NAICS_2012_Code,311411,, +311,BTS_TSA,311FT,NAICS_2012_Code,311412,, +312,BTS_TSA,311FT,NAICS_2012_Code,31142,, +313,BTS_TSA,311FT,NAICS_2012_Code,311421,, +314,BTS_TSA,311FT,NAICS_2012_Code,311422,, +315,BTS_TSA,311FT,NAICS_2012_Code,311423,, +317,BTS_TSA,311FT,NAICS_2012_Code,31151,, +318,BTS_TSA,311FT,NAICS_2012_Code,311511,, +319,BTS_TSA,311FT,NAICS_2012_Code,311512,, +320,BTS_TSA,311FT,NAICS_2012_Code,311513,, +321,BTS_TSA,311FT,NAICS_2012_Code,311514,, +322,BTS_TSA,311FT,NAICS_2012_Code,31152,, +323,BTS_TSA,311FT,NAICS_2012_Code,311520,, +325,BTS_TSA,311FT,NAICS_2012_Code,31161,, +326,BTS_TSA,311FT,NAICS_2012_Code,311611,, +327,BTS_TSA,311FT,NAICS_2012_Code,311612,, +328,BTS_TSA,311FT,NAICS_2012_Code,311613,, +329,BTS_TSA,311FT,NAICS_2012_Code,311615,, +331,BTS_TSA,311FT,NAICS_2012_Code,31171,, +332,BTS_TSA,311FT,NAICS_2012_Code,311710,, +334,BTS_TSA,311FT,NAICS_2012_Code,31181,, +335,BTS_TSA,311FT,NAICS_2012_Code,311811,, +336,BTS_TSA,311FT,NAICS_2012_Code,311812,, +337,BTS_TSA,311FT,NAICS_2012_Code,311813,, +338,BTS_TSA,311FT,NAICS_2012_Code,31182,, +339,BTS_TSA,311FT,NAICS_2012_Code,311821,, +340,BTS_TSA,311FT,NAICS_2012_Code,311824,, +341,BTS_TSA,311FT,NAICS_2012_Code,31183,, +342,BTS_TSA,311FT,NAICS_2012_Code,311830,, +344,BTS_TSA,311FT,NAICS_2012_Code,31191,, +345,BTS_TSA,311FT,NAICS_2012_Code,311911,, +346,BTS_TSA,311FT,NAICS_2012_Code,311919,, +347,BTS_TSA,311FT,NAICS_2012_Code,31192,, +348,BTS_TSA,311FT,NAICS_2012_Code,311920,, +349,BTS_TSA,311FT,NAICS_2012_Code,31193,, +350,BTS_TSA,311FT,NAICS_2012_Code,311930,, +351,BTS_TSA,311FT,NAICS_2012_Code,31194,, +352,BTS_TSA,311FT,NAICS_2012_Code,311941,, +353,BTS_TSA,311FT,NAICS_2012_Code,311942,, +354,BTS_TSA,311FT,NAICS_2012_Code,31199,, +355,BTS_TSA,311FT,NAICS_2012_Code,311991,, +356,BTS_TSA,311FT,NAICS_2012_Code,311999,, +359,BTS_TSA,311FT,NAICS_2012_Code,31211,, +360,BTS_TSA,311FT,NAICS_2012_Code,312111,, +361,BTS_TSA,311FT,NAICS_2012_Code,312112,, +362,BTS_TSA,311FT,NAICS_2012_Code,312113,, +363,BTS_TSA,311FT,NAICS_2012_Code,31212,, +364,BTS_TSA,311FT,NAICS_2012_Code,312120,, +365,BTS_TSA,311FT,NAICS_2012_Code,31213,, +366,BTS_TSA,311FT,NAICS_2012_Code,312130,, +367,BTS_TSA,311FT,NAICS_2012_Code,31214,, +368,BTS_TSA,311FT,NAICS_2012_Code,312140,, +370,BTS_TSA,311FT,NAICS_2012_Code,31223,, +371,BTS_TSA,311FT,NAICS_2012_Code,312230,, +374,BTS_TSA,313TT,NAICS_2012_Code,31311,, +375,BTS_TSA,313TT,NAICS_2012_Code,313110,, +377,BTS_TSA,313TT,NAICS_2012_Code,31321,, +378,BTS_TSA,313TT,NAICS_2012_Code,313210,, +379,BTS_TSA,313TT,NAICS_2012_Code,31322,, +380,BTS_TSA,313TT,NAICS_2012_Code,313220,, +381,BTS_TSA,313TT,NAICS_2012_Code,31323,, +382,BTS_TSA,313TT,NAICS_2012_Code,313230,, +383,BTS_TSA,313TT,NAICS_2012_Code,31324,, +384,BTS_TSA,313TT,NAICS_2012_Code,313240,, +386,BTS_TSA,313TT,NAICS_2012_Code,31331,, +387,BTS_TSA,313TT,NAICS_2012_Code,313310,, +388,BTS_TSA,313TT,NAICS_2012_Code,31332,, +389,BTS_TSA,313TT,NAICS_2012_Code,313320,, +392,BTS_TSA,313TT,NAICS_2012_Code,31411,, +393,BTS_TSA,313TT,NAICS_2012_Code,314110,, +394,BTS_TSA,313TT,NAICS_2012_Code,31412,, +395,BTS_TSA,313TT,NAICS_2012_Code,314120,, +397,BTS_TSA,313TT,NAICS_2012_Code,31491,, +398,BTS_TSA,313TT,NAICS_2012_Code,314910,, +399,BTS_TSA,313TT,NAICS_2012_Code,31499,, +400,BTS_TSA,313TT,NAICS_2012_Code,314994,, +401,BTS_TSA,313TT,NAICS_2012_Code,314999,, +404,BTS_TSA,315AL,NAICS_2012_Code,31511,, +405,BTS_TSA,315AL,NAICS_2012_Code,315110,, +406,BTS_TSA,315AL,NAICS_2012_Code,31519,, +407,BTS_TSA,315AL,NAICS_2012_Code,315190,, +409,BTS_TSA,315AL,NAICS_2012_Code,31521,, +410,BTS_TSA,315AL,NAICS_2012_Code,315210,, +411,BTS_TSA,315AL,NAICS_2012_Code,31522,, +412,BTS_TSA,315AL,NAICS_2012_Code,315220,, +413,BTS_TSA,315AL,NAICS_2012_Code,31524,, +414,BTS_TSA,315AL,NAICS_2012_Code,315240,, +415,BTS_TSA,315AL,NAICS_2012_Code,31528,, +416,BTS_TSA,315AL,NAICS_2012_Code,315280,, +418,BTS_TSA,315AL,NAICS_2012_Code,31599,, +419,BTS_TSA,315AL,NAICS_2012_Code,315990,, +422,BTS_TSA,315AL,NAICS_2012_Code,31611,, +423,BTS_TSA,315AL,NAICS_2012_Code,316110,, +425,BTS_TSA,315AL,NAICS_2012_Code,31621,, +426,BTS_TSA,315AL,NAICS_2012_Code,316210,, +428,BTS_TSA,315AL,NAICS_2012_Code,31699,, +429,BTS_TSA,315AL,NAICS_2012_Code,316992,, +430,BTS_TSA,315AL,NAICS_2012_Code,316998,, +438,BTS_TSA,321,NAICS_2012_Code,321,, +439,BTS_TSA,321,NAICS_2012_Code,3211,, +440,BTS_TSA,321,NAICS_2012_Code,32111,, +441,BTS_TSA,321,NAICS_2012_Code,321113,, +442,BTS_TSA,321,NAICS_2012_Code,321114,, +443,BTS_TSA,321,NAICS_2012_Code,3212,, +444,BTS_TSA,321,NAICS_2012_Code,32121,, +445,BTS_TSA,321,NAICS_2012_Code,321211,, +446,BTS_TSA,321,NAICS_2012_Code,321212,, +447,BTS_TSA,321,NAICS_2012_Code,321213,, +448,BTS_TSA,321,NAICS_2012_Code,321214,, +449,BTS_TSA,321,NAICS_2012_Code,321219,, +450,BTS_TSA,321,NAICS_2012_Code,3219,, +451,BTS_TSA,321,NAICS_2012_Code,32191,, +452,BTS_TSA,321,NAICS_2012_Code,321911,, +453,BTS_TSA,321,NAICS_2012_Code,321912,, +454,BTS_TSA,321,NAICS_2012_Code,321918,, +455,BTS_TSA,321,NAICS_2012_Code,32192,, +456,BTS_TSA,321,NAICS_2012_Code,321920,, +457,BTS_TSA,321,NAICS_2012_Code,32199,, +458,BTS_TSA,321,NAICS_2012_Code,321991,, +459,BTS_TSA,321,NAICS_2012_Code,321992,, +460,BTS_TSA,321,NAICS_2012_Code,321999,, +461,BTS_TSA,322,NAICS_2012_Code,322,, +462,BTS_TSA,322,NAICS_2012_Code,3221,, +463,BTS_TSA,322,NAICS_2012_Code,32211,, +464,BTS_TSA,322,NAICS_2012_Code,322110,, +465,BTS_TSA,322,NAICS_2012_Code,32212,, +466,BTS_TSA,322,NAICS_2012_Code,322121,, +467,BTS_TSA,322,NAICS_2012_Code,322122,, +468,BTS_TSA,322,NAICS_2012_Code,32213,, +469,BTS_TSA,322,NAICS_2012_Code,322130,, +470,BTS_TSA,322,NAICS_2012_Code,3222,, +471,BTS_TSA,322,NAICS_2012_Code,32221,, +472,BTS_TSA,322,NAICS_2012_Code,322211,, +473,BTS_TSA,322,NAICS_2012_Code,322212,, +474,BTS_TSA,322,NAICS_2012_Code,322219,, +475,BTS_TSA,322,NAICS_2012_Code,32222,, +476,BTS_TSA,322,NAICS_2012_Code,322220,, +477,BTS_TSA,322,NAICS_2012_Code,32223,, +478,BTS_TSA,322,NAICS_2012_Code,322230,, +479,BTS_TSA,322,NAICS_2012_Code,32229,, +480,BTS_TSA,322,NAICS_2012_Code,322291,, +481,BTS_TSA,322,NAICS_2012_Code,322299,, +482,BTS_TSA,323,NAICS_2012_Code,323,, +483,BTS_TSA,323,NAICS_2012_Code,3231,, +484,BTS_TSA,323,NAICS_2012_Code,32311,, +485,BTS_TSA,323,NAICS_2012_Code,323111,, +486,BTS_TSA,323,NAICS_2012_Code,323113,, +487,BTS_TSA,323,NAICS_2012_Code,323117,, +488,BTS_TSA,323,NAICS_2012_Code,32312,, +489,BTS_TSA,323,NAICS_2012_Code,323120,, +490,BTS_TSA,324,NAICS_2012_Code,324,, +491,BTS_TSA,324,NAICS_2012_Code,3241,, +492,BTS_TSA,324,NAICS_2012_Code,32411,, +493,BTS_TSA,324,NAICS_2012_Code,324110,, +494,BTS_TSA,324,NAICS_2012_Code,32412,, +495,BTS_TSA,324,NAICS_2012_Code,324121,, +496,BTS_TSA,324,NAICS_2012_Code,324122,, +497,BTS_TSA,324,NAICS_2012_Code,32419,, +498,BTS_TSA,324,NAICS_2012_Code,324191,, +499,BTS_TSA,324,NAICS_2012_Code,324199,, +500,BTS_TSA,325,NAICS_2012_Code,325,, +501,BTS_TSA,325,NAICS_2012_Code,3251,, +502,BTS_TSA,325,NAICS_2012_Code,32511,, +503,BTS_TSA,325,NAICS_2012_Code,325110,, +504,BTS_TSA,325,NAICS_2012_Code,32512,, +505,BTS_TSA,325,NAICS_2012_Code,325120,, +506,BTS_TSA,325,NAICS_2012_Code,32513,, +507,BTS_TSA,325,NAICS_2012_Code,325130,, +508,BTS_TSA,325,NAICS_2012_Code,32518,, +509,BTS_TSA,325,NAICS_2012_Code,325180,, +510,BTS_TSA,325,NAICS_2012_Code,32519,, +511,BTS_TSA,325,NAICS_2012_Code,325193,, +512,BTS_TSA,325,NAICS_2012_Code,325194,, +513,BTS_TSA,325,NAICS_2012_Code,325199,, +514,BTS_TSA,325,NAICS_2012_Code,3252,, +515,BTS_TSA,325,NAICS_2012_Code,32521,, +516,BTS_TSA,325,NAICS_2012_Code,325211,, +517,BTS_TSA,325,NAICS_2012_Code,325212,, +518,BTS_TSA,325,NAICS_2012_Code,32522,, +519,BTS_TSA,325,NAICS_2012_Code,325220,, +520,BTS_TSA,325,NAICS_2012_Code,3253,, +521,BTS_TSA,325,NAICS_2012_Code,32531,, +522,BTS_TSA,325,NAICS_2012_Code,325311,, +523,BTS_TSA,325,NAICS_2012_Code,325312,, +524,BTS_TSA,325,NAICS_2012_Code,325314,, +525,BTS_TSA,325,NAICS_2012_Code,32532,, +526,BTS_TSA,325,NAICS_2012_Code,325320,, +527,BTS_TSA,325,NAICS_2012_Code,3254,, +528,BTS_TSA,325,NAICS_2012_Code,32541,, +529,BTS_TSA,325,NAICS_2012_Code,325411,, +530,BTS_TSA,325,NAICS_2012_Code,325412,, +531,BTS_TSA,325,NAICS_2012_Code,325413,, +532,BTS_TSA,325,NAICS_2012_Code,325414,, +533,BTS_TSA,325,NAICS_2012_Code,3255,, +534,BTS_TSA,325,NAICS_2012_Code,32551,, +535,BTS_TSA,325,NAICS_2012_Code,325510,, +536,BTS_TSA,325,NAICS_2012_Code,32552,, +537,BTS_TSA,325,NAICS_2012_Code,325520,, +538,BTS_TSA,325,NAICS_2012_Code,3256,, +539,BTS_TSA,325,NAICS_2012_Code,32561,, +540,BTS_TSA,325,NAICS_2012_Code,325611,, +541,BTS_TSA,325,NAICS_2012_Code,325612,, +542,BTS_TSA,325,NAICS_2012_Code,325613,, +543,BTS_TSA,325,NAICS_2012_Code,32562,, +544,BTS_TSA,325,NAICS_2012_Code,325620,, +545,BTS_TSA,325,NAICS_2012_Code,3259,, +546,BTS_TSA,325,NAICS_2012_Code,32591,, +547,BTS_TSA,325,NAICS_2012_Code,325910,, +548,BTS_TSA,325,NAICS_2012_Code,32592,, +549,BTS_TSA,325,NAICS_2012_Code,325920,, +550,BTS_TSA,325,NAICS_2012_Code,32599,, +551,BTS_TSA,325,NAICS_2012_Code,325991,, +552,BTS_TSA,325,NAICS_2012_Code,325992,, +553,BTS_TSA,325,NAICS_2012_Code,325998,, +554,BTS_TSA,326,NAICS_2012_Code,326,, +555,BTS_TSA,326,NAICS_2012_Code,3261,, +556,BTS_TSA,326,NAICS_2012_Code,32611,, +557,BTS_TSA,326,NAICS_2012_Code,326111,, +558,BTS_TSA,326,NAICS_2012_Code,326112,, +559,BTS_TSA,326,NAICS_2012_Code,326113,, +560,BTS_TSA,326,NAICS_2012_Code,32612,, +561,BTS_TSA,326,NAICS_2012_Code,326121,, +562,BTS_TSA,326,NAICS_2012_Code,326122,, +563,BTS_TSA,326,NAICS_2012_Code,32613,, +564,BTS_TSA,326,NAICS_2012_Code,326130,, +565,BTS_TSA,326,NAICS_2012_Code,32614,, +566,BTS_TSA,326,NAICS_2012_Code,326140,, +567,BTS_TSA,326,NAICS_2012_Code,32615,, +568,BTS_TSA,326,NAICS_2012_Code,326150,, +569,BTS_TSA,326,NAICS_2012_Code,32616,, +570,BTS_TSA,326,NAICS_2012_Code,326160,, +571,BTS_TSA,326,NAICS_2012_Code,32619,, +572,BTS_TSA,326,NAICS_2012_Code,326191,, +573,BTS_TSA,326,NAICS_2012_Code,326199,, +574,BTS_TSA,326,NAICS_2012_Code,3262,, +575,BTS_TSA,326,NAICS_2012_Code,32621,, +576,BTS_TSA,326,NAICS_2012_Code,326211,, +577,BTS_TSA,326,NAICS_2012_Code,326212,, +578,BTS_TSA,326,NAICS_2012_Code,32622,, +579,BTS_TSA,326,NAICS_2012_Code,326220,, +580,BTS_TSA,326,NAICS_2012_Code,32629,, +581,BTS_TSA,326,NAICS_2012_Code,326291,, +582,BTS_TSA,326,NAICS_2012_Code,326299,, +583,BTS_TSA,327,NAICS_2012_Code,327,, +584,BTS_TSA,327,NAICS_2012_Code,3271,, +585,BTS_TSA,327,NAICS_2012_Code,32711,, +586,BTS_TSA,327,NAICS_2012_Code,327110,, +587,BTS_TSA,327,NAICS_2012_Code,32712,, +588,BTS_TSA,327,NAICS_2012_Code,327120,, +589,BTS_TSA,327,NAICS_2012_Code,3272,, +590,BTS_TSA,327,NAICS_2012_Code,32721,, +591,BTS_TSA,327,NAICS_2012_Code,327211,, +592,BTS_TSA,327,NAICS_2012_Code,327212,, +593,BTS_TSA,327,NAICS_2012_Code,327213,, +594,BTS_TSA,327,NAICS_2012_Code,327215,, +595,BTS_TSA,327,NAICS_2012_Code,3273,, +596,BTS_TSA,327,NAICS_2012_Code,32731,, +597,BTS_TSA,327,NAICS_2012_Code,327310,, +598,BTS_TSA,327,NAICS_2012_Code,32732,, +599,BTS_TSA,327,NAICS_2012_Code,327320,, +600,BTS_TSA,327,NAICS_2012_Code,32733,, +601,BTS_TSA,327,NAICS_2012_Code,327331,, +602,BTS_TSA,327,NAICS_2012_Code,327332,, +603,BTS_TSA,327,NAICS_2012_Code,32739,, +604,BTS_TSA,327,NAICS_2012_Code,327390,, +605,BTS_TSA,327,NAICS_2012_Code,3274,, +606,BTS_TSA,327,NAICS_2012_Code,32741,, +607,BTS_TSA,327,NAICS_2012_Code,327410,, +608,BTS_TSA,327,NAICS_2012_Code,32742,, +609,BTS_TSA,327,NAICS_2012_Code,327420,, +610,BTS_TSA,327,NAICS_2012_Code,3279,, +611,BTS_TSA,327,NAICS_2012_Code,32791,, +612,BTS_TSA,327,NAICS_2012_Code,327910,, +613,BTS_TSA,327,NAICS_2012_Code,32799,, +614,BTS_TSA,327,NAICS_2012_Code,327991,, +615,BTS_TSA,327,NAICS_2012_Code,327992,, +616,BTS_TSA,327,NAICS_2012_Code,327993,, +617,BTS_TSA,327,NAICS_2012_Code,327999,, +627,BTS_TSA,331,NAICS_2012_Code,331,, +628,BTS_TSA,331,NAICS_2012_Code,3311,, +629,BTS_TSA,331,NAICS_2012_Code,33111,, +630,BTS_TSA,331,NAICS_2012_Code,331110,, +631,BTS_TSA,331,NAICS_2012_Code,3312,, +632,BTS_TSA,331,NAICS_2012_Code,33121,, +633,BTS_TSA,331,NAICS_2012_Code,331210,, +634,BTS_TSA,331,NAICS_2012_Code,33122,, +635,BTS_TSA,331,NAICS_2012_Code,331221,, +636,BTS_TSA,331,NAICS_2012_Code,331222,, +637,BTS_TSA,331,NAICS_2012_Code,3313,, +638,BTS_TSA,331,NAICS_2012_Code,33131,, +639,BTS_TSA,331,NAICS_2012_Code,331313,, +640,BTS_TSA,331,NAICS_2012_Code,331314,, +641,BTS_TSA,331,NAICS_2012_Code,331315,, +642,BTS_TSA,331,NAICS_2012_Code,331318,, +643,BTS_TSA,331,NAICS_2012_Code,3314,, +644,BTS_TSA,331,NAICS_2012_Code,33141,, +645,BTS_TSA,331,NAICS_2012_Code,331410,, +646,BTS_TSA,331,NAICS_2012_Code,33142,, +647,BTS_TSA,331,NAICS_2012_Code,331420,, +648,BTS_TSA,331,NAICS_2012_Code,33149,, +649,BTS_TSA,331,NAICS_2012_Code,331491,, +650,BTS_TSA,331,NAICS_2012_Code,331492,, +651,BTS_TSA,331,NAICS_2012_Code,3315,, +652,BTS_TSA,331,NAICS_2012_Code,33151,, +653,BTS_TSA,331,NAICS_2012_Code,331511,, +654,BTS_TSA,331,NAICS_2012_Code,331512,, +655,BTS_TSA,331,NAICS_2012_Code,331513,, +656,BTS_TSA,331,NAICS_2012_Code,33152,, +657,BTS_TSA,331,NAICS_2012_Code,331523,, +658,BTS_TSA,331,NAICS_2012_Code,331524,, +659,BTS_TSA,331,NAICS_2012_Code,331529,, +660,BTS_TSA,332,NAICS_2012_Code,332,, +661,BTS_TSA,332,NAICS_2012_Code,3321,, +662,BTS_TSA,332,NAICS_2012_Code,33211,, +663,BTS_TSA,332,NAICS_2012_Code,332111,, +664,BTS_TSA,332,NAICS_2012_Code,332112,, +665,BTS_TSA,332,NAICS_2012_Code,332114,, +666,BTS_TSA,332,NAICS_2012_Code,332117,, +667,BTS_TSA,332,NAICS_2012_Code,332119,, +668,BTS_TSA,332,NAICS_2012_Code,3322,, +669,BTS_TSA,332,NAICS_2012_Code,33221,, +670,BTS_TSA,332,NAICS_2012_Code,332215,, +671,BTS_TSA,332,NAICS_2012_Code,332216,, +672,BTS_TSA,332,NAICS_2012_Code,3323,, +673,BTS_TSA,332,NAICS_2012_Code,33231,, +674,BTS_TSA,332,NAICS_2012_Code,332311,, +675,BTS_TSA,332,NAICS_2012_Code,332312,, +676,BTS_TSA,332,NAICS_2012_Code,332313,, +677,BTS_TSA,332,NAICS_2012_Code,33232,, +678,BTS_TSA,332,NAICS_2012_Code,332321,, +679,BTS_TSA,332,NAICS_2012_Code,332322,, +680,BTS_TSA,332,NAICS_2012_Code,332323,, +681,BTS_TSA,332,NAICS_2012_Code,3324,, +682,BTS_TSA,332,NAICS_2012_Code,33241,, +683,BTS_TSA,332,NAICS_2012_Code,332410,, +684,BTS_TSA,332,NAICS_2012_Code,33242,, +685,BTS_TSA,332,NAICS_2012_Code,332420,, +686,BTS_TSA,332,NAICS_2012_Code,33243,, +687,BTS_TSA,332,NAICS_2012_Code,332431,, +688,BTS_TSA,332,NAICS_2012_Code,332439,, +689,BTS_TSA,332,NAICS_2012_Code,3325,, +690,BTS_TSA,332,NAICS_2012_Code,33251,, +691,BTS_TSA,332,NAICS_2012_Code,332510,, +692,BTS_TSA,332,NAICS_2012_Code,3326,, +693,BTS_TSA,332,NAICS_2012_Code,33261,, +694,BTS_TSA,332,NAICS_2012_Code,332613,, +695,BTS_TSA,332,NAICS_2012_Code,332618,, +696,BTS_TSA,332,NAICS_2012_Code,3327,, +697,BTS_TSA,332,NAICS_2012_Code,33271,, +698,BTS_TSA,332,NAICS_2012_Code,332710,, +699,BTS_TSA,332,NAICS_2012_Code,33272,, +700,BTS_TSA,332,NAICS_2012_Code,332721,, +701,BTS_TSA,332,NAICS_2012_Code,332722,, +702,BTS_TSA,332,NAICS_2012_Code,3328,, +703,BTS_TSA,332,NAICS_2012_Code,33281,, +704,BTS_TSA,332,NAICS_2012_Code,332811,, +705,BTS_TSA,332,NAICS_2012_Code,332812,, +706,BTS_TSA,332,NAICS_2012_Code,332813,, +707,BTS_TSA,332,NAICS_2012_Code,3329,, +708,BTS_TSA,332,NAICS_2012_Code,33291,, +709,BTS_TSA,332,NAICS_2012_Code,332911,, +710,BTS_TSA,332,NAICS_2012_Code,332912,, +711,BTS_TSA,332,NAICS_2012_Code,332913,, +712,BTS_TSA,332,NAICS_2012_Code,332919,, +713,BTS_TSA,332,NAICS_2012_Code,33299,, +714,BTS_TSA,332,NAICS_2012_Code,332991,, +715,BTS_TSA,332,NAICS_2012_Code,332992,, +716,BTS_TSA,332,NAICS_2012_Code,332993,, +717,BTS_TSA,332,NAICS_2012_Code,332994,, +718,BTS_TSA,332,NAICS_2012_Code,332996,, +719,BTS_TSA,332,NAICS_2012_Code,332999,, +720,BTS_TSA,333,NAICS_2012_Code,333,, +721,BTS_TSA,333,NAICS_2012_Code,3331,, +722,BTS_TSA,333,NAICS_2012_Code,33311,, +723,BTS_TSA,333,NAICS_2012_Code,333111,, +724,BTS_TSA,333,NAICS_2012_Code,333112,, +725,BTS_TSA,333,NAICS_2012_Code,33312,, +726,BTS_TSA,333,NAICS_2012_Code,333120,, +727,BTS_TSA,333,NAICS_2012_Code,33313,, +728,BTS_TSA,333,NAICS_2012_Code,333131,, +729,BTS_TSA,333,NAICS_2012_Code,333132,, +730,BTS_TSA,333,NAICS_2012_Code,3332,, +731,BTS_TSA,333,NAICS_2012_Code,33324,, +732,BTS_TSA,333,NAICS_2012_Code,333241,, +733,BTS_TSA,333,NAICS_2012_Code,333242,, +734,BTS_TSA,333,NAICS_2012_Code,333243,, +735,BTS_TSA,333,NAICS_2012_Code,333244,, +736,BTS_TSA,333,NAICS_2012_Code,333249,, +737,BTS_TSA,333,NAICS_2012_Code,3333,, +738,BTS_TSA,333,NAICS_2012_Code,33331,, +739,BTS_TSA,333,NAICS_2012_Code,333314,, +740,BTS_TSA,333,NAICS_2012_Code,333316,, +741,BTS_TSA,333,NAICS_2012_Code,333318,, +742,BTS_TSA,333,NAICS_2012_Code,3334,, +743,BTS_TSA,333,NAICS_2012_Code,33341,, +744,BTS_TSA,333,NAICS_2012_Code,333413,, +745,BTS_TSA,333,NAICS_2012_Code,333414,, +746,BTS_TSA,333,NAICS_2012_Code,333415,, +747,BTS_TSA,333,NAICS_2012_Code,3335,, +748,BTS_TSA,333,NAICS_2012_Code,33351,, +749,BTS_TSA,333,NAICS_2012_Code,333511,, +750,BTS_TSA,333,NAICS_2012_Code,333514,, +751,BTS_TSA,333,NAICS_2012_Code,333515,, +752,BTS_TSA,333,NAICS_2012_Code,333517,, +753,BTS_TSA,333,NAICS_2012_Code,333519,, +754,BTS_TSA,333,NAICS_2012_Code,3336,, +755,BTS_TSA,333,NAICS_2012_Code,33361,, +756,BTS_TSA,333,NAICS_2012_Code,333611,, +757,BTS_TSA,333,NAICS_2012_Code,333612,, +758,BTS_TSA,333,NAICS_2012_Code,333613,, +759,BTS_TSA,333,NAICS_2012_Code,333618,, +760,BTS_TSA,333,NAICS_2012_Code,3339,, +761,BTS_TSA,333,NAICS_2012_Code,33391,, +762,BTS_TSA,333,NAICS_2012_Code,333911,, +763,BTS_TSA,333,NAICS_2012_Code,333912,, +764,BTS_TSA,333,NAICS_2012_Code,333913,, +765,BTS_TSA,333,NAICS_2012_Code,33392,, +766,BTS_TSA,333,NAICS_2012_Code,333921,, +767,BTS_TSA,333,NAICS_2012_Code,333922,, +768,BTS_TSA,333,NAICS_2012_Code,333923,, +769,BTS_TSA,333,NAICS_2012_Code,333924,, +770,BTS_TSA,333,NAICS_2012_Code,33399,, +771,BTS_TSA,333,NAICS_2012_Code,333991,, +772,BTS_TSA,333,NAICS_2012_Code,333992,, +773,BTS_TSA,333,NAICS_2012_Code,333993,, +774,BTS_TSA,333,NAICS_2012_Code,333994,, +775,BTS_TSA,333,NAICS_2012_Code,333995,, +776,BTS_TSA,333,NAICS_2012_Code,333996,, +777,BTS_TSA,333,NAICS_2012_Code,333997,, +778,BTS_TSA,333,NAICS_2012_Code,333999,, +779,BTS_TSA,334,NAICS_2012_Code,334,, +780,BTS_TSA,334,NAICS_2012_Code,3341,, +781,BTS_TSA,334,NAICS_2012_Code,33411,, +782,BTS_TSA,334,NAICS_2012_Code,334111,, +783,BTS_TSA,334,NAICS_2012_Code,334112,, +784,BTS_TSA,334,NAICS_2012_Code,334118,, +785,BTS_TSA,334,NAICS_2012_Code,3342,, +786,BTS_TSA,334,NAICS_2012_Code,33421,, +787,BTS_TSA,334,NAICS_2012_Code,334210,, +788,BTS_TSA,334,NAICS_2012_Code,33422,, +789,BTS_TSA,334,NAICS_2012_Code,334220,, +790,BTS_TSA,334,NAICS_2012_Code,33429,, +791,BTS_TSA,334,NAICS_2012_Code,334290,, +792,BTS_TSA,334,NAICS_2012_Code,3343,, +793,BTS_TSA,334,NAICS_2012_Code,33431,, +794,BTS_TSA,334,NAICS_2012_Code,334310,, +795,BTS_TSA,334,NAICS_2012_Code,3344,, +796,BTS_TSA,334,NAICS_2012_Code,33441,, +797,BTS_TSA,334,NAICS_2012_Code,334412,, +798,BTS_TSA,334,NAICS_2012_Code,334413,, +799,BTS_TSA,334,NAICS_2012_Code,334416,, +800,BTS_TSA,334,NAICS_2012_Code,334417,, +801,BTS_TSA,334,NAICS_2012_Code,334418,, +802,BTS_TSA,334,NAICS_2012_Code,334419,, +803,BTS_TSA,334,NAICS_2012_Code,3345,, +804,BTS_TSA,334,NAICS_2012_Code,33451,, +805,BTS_TSA,334,NAICS_2012_Code,334510,, +806,BTS_TSA,334,NAICS_2012_Code,334511,, +807,BTS_TSA,334,NAICS_2012_Code,334512,, +808,BTS_TSA,334,NAICS_2012_Code,334513,, +809,BTS_TSA,334,NAICS_2012_Code,334514,, +810,BTS_TSA,334,NAICS_2012_Code,334515,, +811,BTS_TSA,334,NAICS_2012_Code,334516,, +812,BTS_TSA,334,NAICS_2012_Code,334517,, +813,BTS_TSA,334,NAICS_2012_Code,334519,, +814,BTS_TSA,334,NAICS_2012_Code,3346,, +815,BTS_TSA,334,NAICS_2012_Code,33461,, +816,BTS_TSA,334,NAICS_2012_Code,334613,, +817,BTS_TSA,334,NAICS_2012_Code,334614,, +818,BTS_TSA,335,NAICS_2012_Code,335,, +819,BTS_TSA,335,NAICS_2012_Code,3351,, +820,BTS_TSA,335,NAICS_2012_Code,33511,, +821,BTS_TSA,335,NAICS_2012_Code,335110,, +822,BTS_TSA,335,NAICS_2012_Code,33512,, +823,BTS_TSA,335,NAICS_2012_Code,335121,, +824,BTS_TSA,335,NAICS_2012_Code,335122,, +825,BTS_TSA,335,NAICS_2012_Code,335129,, +826,BTS_TSA,335,NAICS_2012_Code,3352,, +827,BTS_TSA,335,NAICS_2012_Code,33521,, +828,BTS_TSA,335,NAICS_2012_Code,335210,, +829,BTS_TSA,335,NAICS_2012_Code,33522,, +830,BTS_TSA,335,NAICS_2012_Code,335221,, +831,BTS_TSA,335,NAICS_2012_Code,335222,, +832,BTS_TSA,335,NAICS_2012_Code,335224,, +833,BTS_TSA,335,NAICS_2012_Code,335228,, +834,BTS_TSA,335,NAICS_2012_Code,3353,, +835,BTS_TSA,335,NAICS_2012_Code,33531,, +836,BTS_TSA,335,NAICS_2012_Code,335311,, +837,BTS_TSA,335,NAICS_2012_Code,335312,, +838,BTS_TSA,335,NAICS_2012_Code,335313,, +839,BTS_TSA,335,NAICS_2012_Code,335314,, +840,BTS_TSA,335,NAICS_2012_Code,3359,, +841,BTS_TSA,335,NAICS_2012_Code,33591,, +842,BTS_TSA,335,NAICS_2012_Code,335911,, +843,BTS_TSA,335,NAICS_2012_Code,335912,, +844,BTS_TSA,335,NAICS_2012_Code,33592,, +845,BTS_TSA,335,NAICS_2012_Code,335921,, +846,BTS_TSA,335,NAICS_2012_Code,335929,, +847,BTS_TSA,335,NAICS_2012_Code,33593,, +848,BTS_TSA,335,NAICS_2012_Code,335931,, +849,BTS_TSA,335,NAICS_2012_Code,335932,, +850,BTS_TSA,335,NAICS_2012_Code,33599,, +851,BTS_TSA,335,NAICS_2012_Code,335991,, +852,BTS_TSA,335,NAICS_2012_Code,335999,, +857,BTS_TSA,3361MV,NAICS_2012_Code,336111,, +858,BTS_TSA,3361MV,NAICS_2012_Code,336112,, +860,BTS_TSA,3361MV,NAICS_2012_Code,336120,, +863,BTS_TSA,3361MV,NAICS_2012_Code,336211,, +864,BTS_TSA,3361MV,NAICS_2012_Code,336212,, +865,BTS_TSA,3361MV,NAICS_2012_Code,336213,, +866,BTS_TSA,3361MV,NAICS_2012_Code,336214,, +869,BTS_TSA,3361MV,NAICS_2012_Code,336310,, +871,BTS_TSA,3361MV,NAICS_2012_Code,336320,, +873,BTS_TSA,3361MV,NAICS_2012_Code,336330,, +875,BTS_TSA,3361MV,NAICS_2012_Code,336340,, +877,BTS_TSA,3361MV,NAICS_2012_Code,336350,, +879,BTS_TSA,3361MV,NAICS_2012_Code,336360,, +881,BTS_TSA,3361MV,NAICS_2012_Code,336370,, +883,BTS_TSA,3361MV,NAICS_2012_Code,336390,, +886,BTS_TSA,3364OT,NAICS_2012_Code,336411,, +887,BTS_TSA,3364OT,NAICS_2012_Code,336412,, +888,BTS_TSA,3364OT,NAICS_2012_Code,336413,, +889,BTS_TSA,3364OT,NAICS_2012_Code,336414,, +890,BTS_TSA,3364OT,NAICS_2012_Code,336415,, +891,BTS_TSA,3364OT,NAICS_2012_Code,336419,, +894,BTS_TSA,3364OT,NAICS_2012_Code,336510,, +897,BTS_TSA,3364OT,NAICS_2012_Code,336611,, +898,BTS_TSA,3364OT,NAICS_2012_Code,336612,, +901,BTS_TSA,3364OT,NAICS_2012_Code,336991,, +902,BTS_TSA,3364OT,NAICS_2012_Code,336992,, +903,BTS_TSA,3364OT,NAICS_2012_Code,336999,, +904,BTS_TSA,337,NAICS_2012_Code,337,, +905,BTS_TSA,337,NAICS_2012_Code,3371,, +906,BTS_TSA,337,NAICS_2012_Code,33711,, +907,BTS_TSA,337,NAICS_2012_Code,337110,, +908,BTS_TSA,337,NAICS_2012_Code,33712,, +909,BTS_TSA,337,NAICS_2012_Code,337121,, +910,BTS_TSA,337,NAICS_2012_Code,337122,, +911,BTS_TSA,337,NAICS_2012_Code,337124,, +912,BTS_TSA,337,NAICS_2012_Code,337125,, +913,BTS_TSA,337,NAICS_2012_Code,337127,, +914,BTS_TSA,337,NAICS_2012_Code,3372,, +915,BTS_TSA,337,NAICS_2012_Code,33721,, +916,BTS_TSA,337,NAICS_2012_Code,337211,, +917,BTS_TSA,337,NAICS_2012_Code,337212,, +918,BTS_TSA,337,NAICS_2012_Code,337214,, +919,BTS_TSA,337,NAICS_2012_Code,337215,, +920,BTS_TSA,337,NAICS_2012_Code,3379,, +921,BTS_TSA,337,NAICS_2012_Code,33791,, +922,BTS_TSA,337,NAICS_2012_Code,337910,, +923,BTS_TSA,337,NAICS_2012_Code,33792,, +924,BTS_TSA,337,NAICS_2012_Code,337920,, +925,BTS_TSA,339,NAICS_2012_Code,339,, +926,BTS_TSA,339,NAICS_2012_Code,3391,, +927,BTS_TSA,339,NAICS_2012_Code,33911,, +928,BTS_TSA,339,NAICS_2012_Code,339112,, +929,BTS_TSA,339,NAICS_2012_Code,339113,, +930,BTS_TSA,339,NAICS_2012_Code,339114,, +931,BTS_TSA,339,NAICS_2012_Code,339115,, +932,BTS_TSA,339,NAICS_2012_Code,339116,, +933,BTS_TSA,339,NAICS_2012_Code,3399,, +934,BTS_TSA,339,NAICS_2012_Code,33991,, +935,BTS_TSA,339,NAICS_2012_Code,339910,, +936,BTS_TSA,339,NAICS_2012_Code,33992,, +937,BTS_TSA,339,NAICS_2012_Code,339920,, +938,BTS_TSA,339,NAICS_2012_Code,33993,, +939,BTS_TSA,339,NAICS_2012_Code,339930,, +940,BTS_TSA,339,NAICS_2012_Code,33994,, +941,BTS_TSA,339,NAICS_2012_Code,339940,, +942,BTS_TSA,339,NAICS_2012_Code,33995,, +943,BTS_TSA,339,NAICS_2012_Code,339950,, +944,BTS_TSA,339,NAICS_2012_Code,33999,, +945,BTS_TSA,339,NAICS_2012_Code,339991,, +946,BTS_TSA,339,NAICS_2012_Code,339992,, +947,BTS_TSA,339,NAICS_2012_Code,339993,, +948,BTS_TSA,339,NAICS_2012_Code,339994,, +949,BTS_TSA,339,NAICS_2012_Code,339995,, +950,BTS_TSA,339,NAICS_2012_Code,339999,, +951,BTS_TSA,42,NAICS_2012_Code,42,, +952,BTS_TSA,42,NAICS_2012_Code,423,, +953,BTS_TSA,42,NAICS_2012_Code,4231,, +954,BTS_TSA,42,NAICS_2012_Code,42311,, +955,BTS_TSA,42,NAICS_2012_Code,423110,, +956,BTS_TSA,42,NAICS_2012_Code,42312,, +957,BTS_TSA,42,NAICS_2012_Code,423120,, +958,BTS_TSA,42,NAICS_2012_Code,42313,, +959,BTS_TSA,42,NAICS_2012_Code,423130,, +960,BTS_TSA,42,NAICS_2012_Code,42314,, +961,BTS_TSA,42,NAICS_2012_Code,423140,, +962,BTS_TSA,42,NAICS_2012_Code,4232,, +963,BTS_TSA,42,NAICS_2012_Code,42321,, +964,BTS_TSA,42,NAICS_2012_Code,423210,, +965,BTS_TSA,42,NAICS_2012_Code,42322,, +966,BTS_TSA,42,NAICS_2012_Code,423220,, +967,BTS_TSA,42,NAICS_2012_Code,4233,, +968,BTS_TSA,42,NAICS_2012_Code,42331,, +969,BTS_TSA,42,NAICS_2012_Code,423310,, +970,BTS_TSA,42,NAICS_2012_Code,42332,, +971,BTS_TSA,42,NAICS_2012_Code,423320,, +972,BTS_TSA,42,NAICS_2012_Code,42333,, +973,BTS_TSA,42,NAICS_2012_Code,423330,, +974,BTS_TSA,42,NAICS_2012_Code,42339,, +975,BTS_TSA,42,NAICS_2012_Code,423390,, +976,BTS_TSA,42,NAICS_2012_Code,4234,, +977,BTS_TSA,42,NAICS_2012_Code,42341,, +978,BTS_TSA,42,NAICS_2012_Code,423410,, +979,BTS_TSA,42,NAICS_2012_Code,42342,, +980,BTS_TSA,42,NAICS_2012_Code,423420,, +981,BTS_TSA,42,NAICS_2012_Code,42343,, +982,BTS_TSA,42,NAICS_2012_Code,423430,, +983,BTS_TSA,42,NAICS_2012_Code,42344,, +984,BTS_TSA,42,NAICS_2012_Code,423440,, +985,BTS_TSA,42,NAICS_2012_Code,42345,, +986,BTS_TSA,42,NAICS_2012_Code,423450,, +987,BTS_TSA,42,NAICS_2012_Code,42346,, +988,BTS_TSA,42,NAICS_2012_Code,423460,, +989,BTS_TSA,42,NAICS_2012_Code,42349,, +990,BTS_TSA,42,NAICS_2012_Code,423490,, +991,BTS_TSA,42,NAICS_2012_Code,4235,, +992,BTS_TSA,42,NAICS_2012_Code,42351,, +993,BTS_TSA,42,NAICS_2012_Code,423510,, +994,BTS_TSA,42,NAICS_2012_Code,42352,, +995,BTS_TSA,42,NAICS_2012_Code,423520,, +996,BTS_TSA,42,NAICS_2012_Code,4236,, +997,BTS_TSA,42,NAICS_2012_Code,42361,, +998,BTS_TSA,42,NAICS_2012_Code,423610,, +999,BTS_TSA,42,NAICS_2012_Code,42362,, +1000,BTS_TSA,42,NAICS_2012_Code,423620,, +1001,BTS_TSA,42,NAICS_2012_Code,42369,, +1002,BTS_TSA,42,NAICS_2012_Code,423690,, +1003,BTS_TSA,42,NAICS_2012_Code,4237,, +1004,BTS_TSA,42,NAICS_2012_Code,42371,, +1005,BTS_TSA,42,NAICS_2012_Code,423710,, +1006,BTS_TSA,42,NAICS_2012_Code,42372,, +1007,BTS_TSA,42,NAICS_2012_Code,423720,, +1008,BTS_TSA,42,NAICS_2012_Code,42373,, +1009,BTS_TSA,42,NAICS_2012_Code,423730,, +1010,BTS_TSA,42,NAICS_2012_Code,42374,, +1011,BTS_TSA,42,NAICS_2012_Code,423740,, +1012,BTS_TSA,42,NAICS_2012_Code,4238,, +1013,BTS_TSA,42,NAICS_2012_Code,42381,, +1014,BTS_TSA,42,NAICS_2012_Code,423810,, +1015,BTS_TSA,42,NAICS_2012_Code,42382,, +1016,BTS_TSA,42,NAICS_2012_Code,423820,, +1017,BTS_TSA,42,NAICS_2012_Code,42383,, +1018,BTS_TSA,42,NAICS_2012_Code,423830,, +1019,BTS_TSA,42,NAICS_2012_Code,42384,, +1020,BTS_TSA,42,NAICS_2012_Code,423840,, +1021,BTS_TSA,42,NAICS_2012_Code,42385,, +1022,BTS_TSA,42,NAICS_2012_Code,423850,, +1023,BTS_TSA,42,NAICS_2012_Code,42386,, +1024,BTS_TSA,42,NAICS_2012_Code,423860,, +1025,BTS_TSA,42,NAICS_2012_Code,4239,, +1026,BTS_TSA,42,NAICS_2012_Code,42391,, +1027,BTS_TSA,42,NAICS_2012_Code,423910,, +1028,BTS_TSA,42,NAICS_2012_Code,42392,, +1029,BTS_TSA,42,NAICS_2012_Code,423920,, +1030,BTS_TSA,42,NAICS_2012_Code,42393,, +1031,BTS_TSA,42,NAICS_2012_Code,423930,, +1032,BTS_TSA,42,NAICS_2012_Code,42394,, +1033,BTS_TSA,42,NAICS_2012_Code,423940,, +1034,BTS_TSA,42,NAICS_2012_Code,42399,, +1035,BTS_TSA,42,NAICS_2012_Code,423990,, +1036,BTS_TSA,42,NAICS_2012_Code,424,, +1037,BTS_TSA,42,NAICS_2012_Code,4241,, +1038,BTS_TSA,42,NAICS_2012_Code,42411,, +1039,BTS_TSA,42,NAICS_2012_Code,424110,, +1040,BTS_TSA,42,NAICS_2012_Code,42412,, +1041,BTS_TSA,42,NAICS_2012_Code,424120,, +1042,BTS_TSA,42,NAICS_2012_Code,42413,, +1043,BTS_TSA,42,NAICS_2012_Code,424130,, +1044,BTS_TSA,42,NAICS_2012_Code,4242,, +1045,BTS_TSA,42,NAICS_2012_Code,42421,, +1046,BTS_TSA,42,NAICS_2012_Code,424210,, +1047,BTS_TSA,42,NAICS_2012_Code,4243,, +1048,BTS_TSA,42,NAICS_2012_Code,42431,, +1049,BTS_TSA,42,NAICS_2012_Code,424310,, +1050,BTS_TSA,42,NAICS_2012_Code,42432,, +1051,BTS_TSA,42,NAICS_2012_Code,424320,, +1052,BTS_TSA,42,NAICS_2012_Code,42433,, +1053,BTS_TSA,42,NAICS_2012_Code,424330,, +1054,BTS_TSA,42,NAICS_2012_Code,42434,, +1055,BTS_TSA,42,NAICS_2012_Code,424340,, +1056,BTS_TSA,42,NAICS_2012_Code,4244,, +1057,BTS_TSA,42,NAICS_2012_Code,42441,, +1058,BTS_TSA,42,NAICS_2012_Code,424410,, +1059,BTS_TSA,42,NAICS_2012_Code,42442,, +1060,BTS_TSA,42,NAICS_2012_Code,424420,, +1061,BTS_TSA,42,NAICS_2012_Code,42443,, +1062,BTS_TSA,42,NAICS_2012_Code,424430,, +1063,BTS_TSA,42,NAICS_2012_Code,42444,, +1064,BTS_TSA,42,NAICS_2012_Code,424440,, +1065,BTS_TSA,42,NAICS_2012_Code,42445,, +1066,BTS_TSA,42,NAICS_2012_Code,424450,, +1067,BTS_TSA,42,NAICS_2012_Code,42446,, +1068,BTS_TSA,42,NAICS_2012_Code,424460,, +1069,BTS_TSA,42,NAICS_2012_Code,42447,, +1070,BTS_TSA,42,NAICS_2012_Code,424470,, +1071,BTS_TSA,42,NAICS_2012_Code,42448,, +1072,BTS_TSA,42,NAICS_2012_Code,424480,, +1073,BTS_TSA,42,NAICS_2012_Code,42449,, +1074,BTS_TSA,42,NAICS_2012_Code,424490,, +1075,BTS_TSA,42,NAICS_2012_Code,4245,, +1076,BTS_TSA,42,NAICS_2012_Code,42451,, +1077,BTS_TSA,42,NAICS_2012_Code,424510,, +1078,BTS_TSA,42,NAICS_2012_Code,42452,, +1079,BTS_TSA,42,NAICS_2012_Code,424520,, +1080,BTS_TSA,42,NAICS_2012_Code,42459,, +1081,BTS_TSA,42,NAICS_2012_Code,424590,, +1082,BTS_TSA,42,NAICS_2012_Code,4246,, +1083,BTS_TSA,42,NAICS_2012_Code,42461,, +1084,BTS_TSA,42,NAICS_2012_Code,424610,, +1085,BTS_TSA,42,NAICS_2012_Code,42469,, +1086,BTS_TSA,42,NAICS_2012_Code,424690,, +1087,BTS_TSA,42,NAICS_2012_Code,4247,, +1088,BTS_TSA,42,NAICS_2012_Code,42471,, +1089,BTS_TSA,42,NAICS_2012_Code,424710,, +1090,BTS_TSA,42,NAICS_2012_Code,42472,, +1091,BTS_TSA,42,NAICS_2012_Code,424720,, +1092,BTS_TSA,42,NAICS_2012_Code,4248,, +1093,BTS_TSA,42,NAICS_2012_Code,42481,, +1094,BTS_TSA,42,NAICS_2012_Code,424810,, +1095,BTS_TSA,42,NAICS_2012_Code,42482,, +1096,BTS_TSA,42,NAICS_2012_Code,424820,, +1097,BTS_TSA,42,NAICS_2012_Code,4249,, +1098,BTS_TSA,42,NAICS_2012_Code,42491,, +1099,BTS_TSA,42,NAICS_2012_Code,424910,, +1100,BTS_TSA,42,NAICS_2012_Code,42492,, +1101,BTS_TSA,42,NAICS_2012_Code,424920,, +1102,BTS_TSA,42,NAICS_2012_Code,42493,, +1103,BTS_TSA,42,NAICS_2012_Code,424930,, +1104,BTS_TSA,42,NAICS_2012_Code,42494,, +1105,BTS_TSA,42,NAICS_2012_Code,424940,, +1106,BTS_TSA,42,NAICS_2012_Code,42495,, +1107,BTS_TSA,42,NAICS_2012_Code,424950,, +1108,BTS_TSA,42,NAICS_2012_Code,42499,, +1109,BTS_TSA,42,NAICS_2012_Code,424990,, +1110,BTS_TSA,42,NAICS_2012_Code,425,, +1111,BTS_TSA,42,NAICS_2012_Code,4251,, +1112,BTS_TSA,42,NAICS_2012_Code,42511,, +1113,BTS_TSA,42,NAICS_2012_Code,425110,, +1114,BTS_TSA,42,NAICS_2012_Code,42512,, +1115,BTS_TSA,42,NAICS_2012_Code,425120,, +1119,BTS_TSA,441,NAICS_2012_Code,441,, +1120,BTS_TSA,441,NAICS_2012_Code,4411,, +1121,BTS_TSA,441,NAICS_2012_Code,44111,, +1122,BTS_TSA,441,NAICS_2012_Code,441110,, +1123,BTS_TSA,441,NAICS_2012_Code,44112,, +1124,BTS_TSA,441,NAICS_2012_Code,441120,, +1125,BTS_TSA,441,NAICS_2012_Code,4412,, +1126,BTS_TSA,441,NAICS_2012_Code,44121,, +1127,BTS_TSA,441,NAICS_2012_Code,441210,, +1128,BTS_TSA,441,NAICS_2012_Code,44122,, +1129,BTS_TSA,441,NAICS_2012_Code,441222,, +1130,BTS_TSA,441,NAICS_2012_Code,441228,, +1131,BTS_TSA,441,NAICS_2012_Code,4413,, +1132,BTS_TSA,441,NAICS_2012_Code,44131,, +1133,BTS_TSA,441,NAICS_2012_Code,441310,, +1134,BTS_TSA,441,NAICS_2012_Code,44132,, +1135,BTS_TSA,441,NAICS_2012_Code,441320,, +1136,BTS_TSA,4A0,NAICS_2012_Code,442,, +1137,BTS_TSA,4A0,NAICS_2012_Code,4421,, +1138,BTS_TSA,4A0,NAICS_2012_Code,44211,, +1139,BTS_TSA,4A0,NAICS_2012_Code,442110,, +1140,BTS_TSA,4A0,NAICS_2012_Code,4422,, +1141,BTS_TSA,4A0,NAICS_2012_Code,44221,, +1142,BTS_TSA,4A0,NAICS_2012_Code,442210,, +1143,BTS_TSA,4A0,NAICS_2012_Code,44229,, +1144,BTS_TSA,4A0,NAICS_2012_Code,442291,, +1145,BTS_TSA,4A0,NAICS_2012_Code,442299,, +1146,BTS_TSA,4A0,NAICS_2012_Code,443,, +1147,BTS_TSA,4A0,NAICS_2012_Code,4431,, +1148,BTS_TSA,4A0,NAICS_2012_Code,44314,, +1149,BTS_TSA,4A0,NAICS_2012_Code,443141,, +1150,BTS_TSA,4A0,NAICS_2012_Code,443142,, +1151,BTS_TSA,4A0,NAICS_2012_Code,444,, +1152,BTS_TSA,4A0,NAICS_2012_Code,4441,, +1153,BTS_TSA,4A0,NAICS_2012_Code,44411,, +1154,BTS_TSA,4A0,NAICS_2012_Code,444110,, +1155,BTS_TSA,4A0,NAICS_2012_Code,44412,, +1156,BTS_TSA,4A0,NAICS_2012_Code,444120,, +1157,BTS_TSA,4A0,NAICS_2012_Code,44413,, +1158,BTS_TSA,4A0,NAICS_2012_Code,444130,, +1159,BTS_TSA,4A0,NAICS_2012_Code,44419,, +1160,BTS_TSA,4A0,NAICS_2012_Code,444190,, +1161,BTS_TSA,4A0,NAICS_2012_Code,4442,, +1162,BTS_TSA,4A0,NAICS_2012_Code,44421,, +1163,BTS_TSA,4A0,NAICS_2012_Code,444210,, +1164,BTS_TSA,4A0,NAICS_2012_Code,44422,, +1165,BTS_TSA,4A0,NAICS_2012_Code,444220,, +1166,BTS_TSA,445,NAICS_2012_Code,445,, +1167,BTS_TSA,445,NAICS_2012_Code,4451,, +1168,BTS_TSA,445,NAICS_2012_Code,44511,, +1169,BTS_TSA,445,NAICS_2012_Code,445110,, +1170,BTS_TSA,445,NAICS_2012_Code,44512,, +1171,BTS_TSA,445,NAICS_2012_Code,445120,, +1172,BTS_TSA,445,NAICS_2012_Code,4452,, +1173,BTS_TSA,445,NAICS_2012_Code,44521,, +1174,BTS_TSA,445,NAICS_2012_Code,445210,, +1175,BTS_TSA,445,NAICS_2012_Code,44522,, +1176,BTS_TSA,445,NAICS_2012_Code,445220,, +1177,BTS_TSA,445,NAICS_2012_Code,44523,, +1178,BTS_TSA,445,NAICS_2012_Code,445230,, +1179,BTS_TSA,445,NAICS_2012_Code,44529,, +1180,BTS_TSA,445,NAICS_2012_Code,445291,, +1181,BTS_TSA,445,NAICS_2012_Code,445292,, +1182,BTS_TSA,445,NAICS_2012_Code,445299,, +1183,BTS_TSA,445,NAICS_2012_Code,4453,, +1184,BTS_TSA,445,NAICS_2012_Code,44531,, +1185,BTS_TSA,445,NAICS_2012_Code,445310,, +1186,BTS_TSA,4A0,NAICS_2012_Code,446,, +1187,BTS_TSA,4A0,NAICS_2012_Code,4461,, +1188,BTS_TSA,4A0,NAICS_2012_Code,44611,, +1189,BTS_TSA,4A0,NAICS_2012_Code,446110,, +1190,BTS_TSA,4A0,NAICS_2012_Code,44612,, +1191,BTS_TSA,4A0,NAICS_2012_Code,446120,, +1192,BTS_TSA,4A0,NAICS_2012_Code,44613,, +1193,BTS_TSA,4A0,NAICS_2012_Code,446130,, +1194,BTS_TSA,4A0,NAICS_2012_Code,44619,, +1195,BTS_TSA,4A0,NAICS_2012_Code,446191,, +1196,BTS_TSA,4A0,NAICS_2012_Code,446199,, +1197,BTS_TSA,4A0,NAICS_2012_Code,447,, +1198,BTS_TSA,4A0,NAICS_2012_Code,4471,, +1199,BTS_TSA,4A0,NAICS_2012_Code,44711,, +1200,BTS_TSA,4A0,NAICS_2012_Code,447110,, +1201,BTS_TSA,4A0,NAICS_2012_Code,44719,, +1202,BTS_TSA,4A0,NAICS_2012_Code,447190,, +1203,BTS_TSA,4A0,NAICS_2012_Code,448,, +1204,BTS_TSA,4A0,NAICS_2012_Code,4481,, +1205,BTS_TSA,4A0,NAICS_2012_Code,44811,, +1206,BTS_TSA,4A0,NAICS_2012_Code,448110,, +1207,BTS_TSA,4A0,NAICS_2012_Code,44812,, +1208,BTS_TSA,4A0,NAICS_2012_Code,448120,, +1209,BTS_TSA,4A0,NAICS_2012_Code,44813,, +1210,BTS_TSA,4A0,NAICS_2012_Code,448130,, +1211,BTS_TSA,4A0,NAICS_2012_Code,44814,, +1212,BTS_TSA,4A0,NAICS_2012_Code,448140,, +1213,BTS_TSA,4A0,NAICS_2012_Code,44815,, +1214,BTS_TSA,4A0,NAICS_2012_Code,448150,, +1215,BTS_TSA,4A0,NAICS_2012_Code,44819,, +1216,BTS_TSA,4A0,NAICS_2012_Code,448190,, +1217,BTS_TSA,4A0,NAICS_2012_Code,4482,, +1218,BTS_TSA,4A0,NAICS_2012_Code,44821,, +1219,BTS_TSA,4A0,NAICS_2012_Code,448210,, +1220,BTS_TSA,4A0,NAICS_2012_Code,4483,, +1221,BTS_TSA,4A0,NAICS_2012_Code,44831,, +1222,BTS_TSA,4A0,NAICS_2012_Code,448310,, +1223,BTS_TSA,4A0,NAICS_2012_Code,44832,, +1224,BTS_TSA,4A0,NAICS_2012_Code,448320,, +1227,BTS_TSA,4A0,NAICS_2012_Code,451,, +1228,BTS_TSA,4A0,NAICS_2012_Code,4511,, +1229,BTS_TSA,4A0,NAICS_2012_Code,45111,, +1230,BTS_TSA,4A0,NAICS_2012_Code,451110,, +1231,BTS_TSA,4A0,NAICS_2012_Code,45112,, +1232,BTS_TSA,4A0,NAICS_2012_Code,451120,, +1233,BTS_TSA,4A0,NAICS_2012_Code,45113,, +1234,BTS_TSA,4A0,NAICS_2012_Code,451130,, +1235,BTS_TSA,4A0,NAICS_2012_Code,45114,, +1236,BTS_TSA,4A0,NAICS_2012_Code,451140,, +1237,BTS_TSA,4A0,NAICS_2012_Code,4512,, +1238,BTS_TSA,4A0,NAICS_2012_Code,45121,, +1239,BTS_TSA,4A0,NAICS_2012_Code,451211,, +1240,BTS_TSA,4A0,NAICS_2012_Code,451212,, +1241,BTS_TSA,452,NAICS_2012_Code,452,, +1242,BTS_TSA,452,NAICS_2012_Code,4521,, +1243,BTS_TSA,452,NAICS_2012_Code,45211,, +1244,BTS_TSA,452,NAICS_2012_Code,452111,, +1245,BTS_TSA,452,NAICS_2012_Code,452112,, +1246,BTS_TSA,452,NAICS_2012_Code,4529,, +1247,BTS_TSA,452,NAICS_2012_Code,45291,, +1248,BTS_TSA,452,NAICS_2012_Code,452910,, +1249,BTS_TSA,452,NAICS_2012_Code,45299,, +1250,BTS_TSA,452,NAICS_2012_Code,452990,, +1251,BTS_TSA,4A0,NAICS_2012_Code,453,, +1252,BTS_TSA,4A0,NAICS_2012_Code,4531,, +1253,BTS_TSA,4A0,NAICS_2012_Code,45311,, +1254,BTS_TSA,4A0,NAICS_2012_Code,453110,, +1255,BTS_TSA,4A0,NAICS_2012_Code,4532,, +1256,BTS_TSA,4A0,NAICS_2012_Code,45321,, +1257,BTS_TSA,4A0,NAICS_2012_Code,453210,, +1258,BTS_TSA,4A0,NAICS_2012_Code,45322,, +1259,BTS_TSA,4A0,NAICS_2012_Code,453220,, +1260,BTS_TSA,4A0,NAICS_2012_Code,4533,, +1261,BTS_TSA,4A0,NAICS_2012_Code,45331,, +1262,BTS_TSA,4A0,NAICS_2012_Code,453310,, +1263,BTS_TSA,4A0,NAICS_2012_Code,4539,, +1264,BTS_TSA,4A0,NAICS_2012_Code,45391,, +1265,BTS_TSA,4A0,NAICS_2012_Code,453910,, +1266,BTS_TSA,4A0,NAICS_2012_Code,45392,, +1267,BTS_TSA,4A0,NAICS_2012_Code,453920,, +1268,BTS_TSA,4A0,NAICS_2012_Code,45393,, +1269,BTS_TSA,4A0,NAICS_2012_Code,453930,, +1270,BTS_TSA,4A0,NAICS_2012_Code,45399,, +1271,BTS_TSA,4A0,NAICS_2012_Code,453991,, +1272,BTS_TSA,4A0,NAICS_2012_Code,453998,, +1273,BTS_TSA,4A0,NAICS_2012_Code,454,, +1274,BTS_TSA,4A0,NAICS_2012_Code,4541,, +1275,BTS_TSA,4A0,NAICS_2012_Code,45411,, +1276,BTS_TSA,4A0,NAICS_2012_Code,454111,, +1277,BTS_TSA,4A0,NAICS_2012_Code,454112,, +1278,BTS_TSA,4A0,NAICS_2012_Code,454113,, +1279,BTS_TSA,4A0,NAICS_2012_Code,4542,, +1280,BTS_TSA,4A0,NAICS_2012_Code,45421,, +1281,BTS_TSA,4A0,NAICS_2012_Code,454210,, +1282,BTS_TSA,4A0,NAICS_2012_Code,4543,, +1283,BTS_TSA,4A0,NAICS_2012_Code,45431,, +1284,BTS_TSA,4A0,NAICS_2012_Code,454310,, +1285,BTS_TSA,4A0,NAICS_2012_Code,45439,, +1286,BTS_TSA,4A0,NAICS_2012_Code,454390,, +1294,BTS_TSA,481,NAICS_2012_Code,481,, +1295,BTS_TSA,481,NAICS_2012_Code,4811,, +1296,BTS_TSA,481,NAICS_2012_Code,48111,, +1297,BTS_TSA,481,NAICS_2012_Code,481111,, +1298,BTS_TSA,481,NAICS_2012_Code,481112,, +1299,BTS_TSA,481,NAICS_2012_Code,4812,, +1300,BTS_TSA,481,NAICS_2012_Code,48121,, +1301,BTS_TSA,481,NAICS_2012_Code,481211,, +1302,BTS_TSA,481,NAICS_2012_Code,481212,, +1303,BTS_TSA,481,NAICS_2012_Code,481219,, +1304,BTS_TSA,482,NAICS_2012_Code,482,, +1305,BTS_TSA,482,NAICS_2012_Code,4821,, +1306,BTS_TSA,482,NAICS_2012_Code,48211,, +1307,BTS_TSA,482,NAICS_2012_Code,482111,, +1308,BTS_TSA,482,NAICS_2012_Code,482112,, +1309,BTS_TSA,483,NAICS_2012_Code,483,, +1310,BTS_TSA,483,NAICS_2012_Code,4831,, +1311,BTS_TSA,483,NAICS_2012_Code,48311,, +1312,BTS_TSA,483,NAICS_2012_Code,483111,, +1313,BTS_TSA,483,NAICS_2012_Code,483112,, +1314,BTS_TSA,483,NAICS_2012_Code,483113,, +1315,BTS_TSA,483,NAICS_2012_Code,483114,, +1316,BTS_TSA,483,NAICS_2012_Code,4832,, +1317,BTS_TSA,483,NAICS_2012_Code,48321,, +1318,BTS_TSA,483,NAICS_2012_Code,483211,, +1319,BTS_TSA,483,NAICS_2012_Code,483212,, +1320,BTS_TSA,484,NAICS_2012_Code,484,, +1321,BTS_TSA,484,NAICS_2012_Code,4841,, +1322,BTS_TSA,484,NAICS_2012_Code,48411,, +1323,BTS_TSA,484,NAICS_2012_Code,484110,, +1324,BTS_TSA,484,NAICS_2012_Code,48412,, +1325,BTS_TSA,484,NAICS_2012_Code,484121,, +1326,BTS_TSA,484,NAICS_2012_Code,484122,, +1327,BTS_TSA,484,NAICS_2012_Code,4842,, +1328,BTS_TSA,484,NAICS_2012_Code,48421,, +1329,BTS_TSA,484,NAICS_2012_Code,484210,, +1330,BTS_TSA,484,NAICS_2012_Code,48422,, +1331,BTS_TSA,484,NAICS_2012_Code,484220,, +1332,BTS_TSA,484,NAICS_2012_Code,48423,, +1333,BTS_TSA,484,NAICS_2012_Code,484230,, +1334,BTS_TSA,485,NAICS_2012_Code,485,, +1335,BTS_TSA,485,NAICS_2012_Code,4851,, +1336,BTS_TSA,485,NAICS_2012_Code,48511,, +1337,BTS_TSA,485,NAICS_2012_Code,485111,, +1338,BTS_TSA,485,NAICS_2012_Code,485112,, +1339,BTS_TSA,485,NAICS_2012_Code,485113,, +1340,BTS_TSA,485,NAICS_2012_Code,485119,, +1341,BTS_TSA,485,NAICS_2012_Code,4852,, +1342,BTS_TSA,485,NAICS_2012_Code,48521,, +1343,BTS_TSA,485,NAICS_2012_Code,485210,, +1344,BTS_TSA,485,NAICS_2012_Code,4853,, +1345,BTS_TSA,485,NAICS_2012_Code,48531,, +1346,BTS_TSA,485,NAICS_2012_Code,485310,, +1347,BTS_TSA,485,NAICS_2012_Code,48532,, +1348,BTS_TSA,485,NAICS_2012_Code,485320,, +1349,BTS_TSA,485,NAICS_2012_Code,4854,, +1350,BTS_TSA,485,NAICS_2012_Code,48541,, +1351,BTS_TSA,485,NAICS_2012_Code,485410,, +1352,BTS_TSA,485,NAICS_2012_Code,4855,, +1353,BTS_TSA,485,NAICS_2012_Code,48551,, +1354,BTS_TSA,485,NAICS_2012_Code,485510,, +1355,BTS_TSA,485,NAICS_2012_Code,4859,, +1356,BTS_TSA,485,NAICS_2012_Code,48599,, +1357,BTS_TSA,485,NAICS_2012_Code,485991,, +1358,BTS_TSA,485,NAICS_2012_Code,485999,, +1359,BTS_TSA,486,NAICS_2012_Code,486,, +1360,BTS_TSA,486,NAICS_2012_Code,4861,, +1361,BTS_TSA,486,NAICS_2012_Code,48611,, +1362,BTS_TSA,486,NAICS_2012_Code,486110,, +1363,BTS_TSA,486,NAICS_2012_Code,4862,, +1364,BTS_TSA,486,NAICS_2012_Code,48621,, +1365,BTS_TSA,486,NAICS_2012_Code,486210,, +1366,BTS_TSA,486,NAICS_2012_Code,4869,, +1367,BTS_TSA,486,NAICS_2012_Code,48691,, +1368,BTS_TSA,486,NAICS_2012_Code,486910,, +1369,BTS_TSA,486,NAICS_2012_Code,48699,, +1370,BTS_TSA,486,NAICS_2012_Code,486990,, +1373,BTS_TSA,487OS,NAICS_2012_Code,48711,, +1374,BTS_TSA,487OS,NAICS_2012_Code,487110,, +1376,BTS_TSA,487OS,NAICS_2012_Code,48721,, +1377,BTS_TSA,487OS,NAICS_2012_Code,487210,, +1379,BTS_TSA,487OS,NAICS_2012_Code,48799,, +1380,BTS_TSA,487OS,NAICS_2012_Code,487990,, +1383,BTS_TSA,487OS,NAICS_2012_Code,48811,, +1384,BTS_TSA,487OS,NAICS_2012_Code,488111,, +1385,BTS_TSA,487OS,NAICS_2012_Code,488119,, +1386,BTS_TSA,487OS,NAICS_2012_Code,48819,, +1387,BTS_TSA,487OS,NAICS_2012_Code,488190,, +1389,BTS_TSA,487OS,NAICS_2012_Code,48821,, +1390,BTS_TSA,487OS,NAICS_2012_Code,488210,, +1392,BTS_TSA,487OS,NAICS_2012_Code,48831,, +1393,BTS_TSA,487OS,NAICS_2012_Code,488310,, +1394,BTS_TSA,487OS,NAICS_2012_Code,48832,, +1395,BTS_TSA,487OS,NAICS_2012_Code,488320,, +1396,BTS_TSA,487OS,NAICS_2012_Code,48833,, +1397,BTS_TSA,487OS,NAICS_2012_Code,488330,, +1398,BTS_TSA,487OS,NAICS_2012_Code,48839,, +1399,BTS_TSA,487OS,NAICS_2012_Code,488390,, +1401,BTS_TSA,487OS,NAICS_2012_Code,48841,, +1402,BTS_TSA,487OS,NAICS_2012_Code,488410,, +1403,BTS_TSA,487OS,NAICS_2012_Code,48849,, +1404,BTS_TSA,487OS,NAICS_2012_Code,488490,, +1406,BTS_TSA,487OS,NAICS_2012_Code,48851,, +1407,BTS_TSA,487OS,NAICS_2012_Code,488510,, +1409,BTS_TSA,487OS,NAICS_2012_Code,48899,, +1410,BTS_TSA,487OS,NAICS_2012_Code,488991,, +1411,BTS_TSA,487OS,NAICS_2012_Code,488999,, +1415,BTS_TSA,GFE,NAICS_2012_Code,491,, +1416,BTS_TSA,GFE,NAICS_2012_Code,4911,, +1417,BTS_TSA,GFE,NAICS_2012_Code,49111,, +1418,BTS_TSA,GFE,NAICS_2012_Code,491110,, +1421,BTS_TSA,487OS,NAICS_2012_Code,49211,, +1422,BTS_TSA,487OS,NAICS_2012_Code,492110,, +1424,BTS_TSA,487OS,NAICS_2012_Code,49221,, +1425,BTS_TSA,487OS,NAICS_2012_Code,492210,, +1426,BTS_TSA,493,NAICS_2012_Code,493,, +1427,BTS_TSA,493,NAICS_2012_Code,4931,, +1428,BTS_TSA,493,NAICS_2012_Code,49311,, +1429,BTS_TSA,493,NAICS_2012_Code,493110,, +1430,BTS_TSA,493,NAICS_2012_Code,49312,, +1431,BTS_TSA,493,NAICS_2012_Code,493120,, +1432,BTS_TSA,493,NAICS_2012_Code,49313,, +1433,BTS_TSA,493,NAICS_2012_Code,493130,, +1434,BTS_TSA,493,NAICS_2012_Code,49319,, +1435,BTS_TSA,493,NAICS_2012_Code,493190,, +1440,BTS_TSA,511,NAICS_2012_Code,511,, +1441,BTS_TSA,511,NAICS_2012_Code,5111,, +1442,BTS_TSA,511,NAICS_2012_Code,51111,, +1443,BTS_TSA,511,NAICS_2012_Code,511110,, +1444,BTS_TSA,511,NAICS_2012_Code,51112,, +1445,BTS_TSA,511,NAICS_2012_Code,511120,, +1446,BTS_TSA,511,NAICS_2012_Code,51113,, +1447,BTS_TSA,511,NAICS_2012_Code,511130,, +1448,BTS_TSA,511,NAICS_2012_Code,51114,, +1449,BTS_TSA,511,NAICS_2012_Code,511140,, +1450,BTS_TSA,511,NAICS_2012_Code,51119,, +1451,BTS_TSA,511,NAICS_2012_Code,511191,, +1452,BTS_TSA,511,NAICS_2012_Code,511199,, +1453,BTS_TSA,511,NAICS_2012_Code,5112,, +1454,BTS_TSA,511,NAICS_2012_Code,51121,, +1455,BTS_TSA,511,NAICS_2012_Code,511210,, +1456,BTS_TSA,512,NAICS_2012_Code,512,, +1457,BTS_TSA,512,NAICS_2012_Code,5121,, +1458,BTS_TSA,512,NAICS_2012_Code,51211,, +1459,BTS_TSA,512,NAICS_2012_Code,512110,, +1460,BTS_TSA,512,NAICS_2012_Code,51212,, +1461,BTS_TSA,512,NAICS_2012_Code,512120,, +1462,BTS_TSA,512,NAICS_2012_Code,51213,, +1463,BTS_TSA,512,NAICS_2012_Code,512131,, +1464,BTS_TSA,512,NAICS_2012_Code,512132,, +1465,BTS_TSA,512,NAICS_2012_Code,51219,, +1466,BTS_TSA,512,NAICS_2012_Code,512191,, +1467,BTS_TSA,512,NAICS_2012_Code,512199,, +1468,BTS_TSA,512,NAICS_2012_Code,5122,, +1469,BTS_TSA,512,NAICS_2012_Code,51221,, +1470,BTS_TSA,512,NAICS_2012_Code,512210,, +1471,BTS_TSA,512,NAICS_2012_Code,51222,, +1472,BTS_TSA,512,NAICS_2012_Code,512220,, +1473,BTS_TSA,512,NAICS_2012_Code,51223,, +1474,BTS_TSA,512,NAICS_2012_Code,512230,, +1475,BTS_TSA,512,NAICS_2012_Code,51224,, +1476,BTS_TSA,512,NAICS_2012_Code,512240,, +1477,BTS_TSA,512,NAICS_2012_Code,51229,, +1478,BTS_TSA,512,NAICS_2012_Code,512290,, +1479,BTS_TSA,513,NAICS_2012_Code,515,, +1480,BTS_TSA,513,NAICS_2012_Code,5151,, +1481,BTS_TSA,513,NAICS_2012_Code,51511,, +1482,BTS_TSA,513,NAICS_2012_Code,515111,, +1483,BTS_TSA,513,NAICS_2012_Code,515112,, +1484,BTS_TSA,513,NAICS_2012_Code,51512,, +1485,BTS_TSA,513,NAICS_2012_Code,515120,, +1486,BTS_TSA,513,NAICS_2012_Code,5152,, +1487,BTS_TSA,513,NAICS_2012_Code,51521,, +1488,BTS_TSA,513,NAICS_2012_Code,515210,, +1489,BTS_TSA,513,NAICS_2012_Code,517,, +1490,BTS_TSA,513,NAICS_2012_Code,5171,, +1491,BTS_TSA,513,NAICS_2012_Code,51711,, +1492,BTS_TSA,513,NAICS_2012_Code,517110,, +1493,BTS_TSA,513,NAICS_2012_Code,5172,, +1494,BTS_TSA,513,NAICS_2012_Code,51721,, +1495,BTS_TSA,513,NAICS_2012_Code,517210,, +1496,BTS_TSA,513,NAICS_2012_Code,5174,, +1497,BTS_TSA,513,NAICS_2012_Code,51741,, +1498,BTS_TSA,513,NAICS_2012_Code,517410,, +1499,BTS_TSA,513,NAICS_2012_Code,5179,, +1500,BTS_TSA,513,NAICS_2012_Code,51791,, +1501,BTS_TSA,513,NAICS_2012_Code,517911,, +1502,BTS_TSA,513,NAICS_2012_Code,517919,, +1503,BTS_TSA,514,NAICS_2012_Code,518,, +1504,BTS_TSA,514,NAICS_2012_Code,5182,, +1505,BTS_TSA,514,NAICS_2012_Code,51821,, +1506,BTS_TSA,514,NAICS_2012_Code,518210,, +1507,BTS_TSA,514,NAICS_2012_Code,519,, +1508,BTS_TSA,514,NAICS_2012_Code,5191,, +1509,BTS_TSA,514,NAICS_2012_Code,51911,, +1510,BTS_TSA,514,NAICS_2012_Code,519110,, +1511,BTS_TSA,514,NAICS_2012_Code,51912,, +1512,BTS_TSA,514,NAICS_2012_Code,519120,, +1513,BTS_TSA,514,NAICS_2012_Code,51913,, +1514,BTS_TSA,514,NAICS_2012_Code,519130,, +1515,BTS_TSA,514,NAICS_2012_Code,51919,, +1516,BTS_TSA,514,NAICS_2012_Code,519190,, +1523,BTS_TSA,521CI,NAICS_2012_Code,52111,, +1524,BTS_TSA,521CI,NAICS_2012_Code,521110,, +1527,BTS_TSA,521CI,NAICS_2012_Code,52211,, +1528,BTS_TSA,521CI,NAICS_2012_Code,522110,, +1529,BTS_TSA,521CI,NAICS_2012_Code,52212,, +1530,BTS_TSA,521CI,NAICS_2012_Code,522120,, +1531,BTS_TSA,521CI,NAICS_2012_Code,52213,, +1532,BTS_TSA,521CI,NAICS_2012_Code,522130,, +1533,BTS_TSA,521CI,NAICS_2012_Code,52219,, +1534,BTS_TSA,521CI,NAICS_2012_Code,522190,, +1536,BTS_TSA,521CI,NAICS_2012_Code,52221,, +1537,BTS_TSA,521CI,NAICS_2012_Code,522210,, +1538,BTS_TSA,521CI,NAICS_2012_Code,52222,, +1539,BTS_TSA,521CI,NAICS_2012_Code,522220,, +1540,BTS_TSA,521CI,NAICS_2012_Code,52229,, +1541,BTS_TSA,521CI,NAICS_2012_Code,522291,, +1542,BTS_TSA,521CI,NAICS_2012_Code,522292,, +1543,BTS_TSA,521CI,NAICS_2012_Code,522293,, +1544,BTS_TSA,521CI,NAICS_2012_Code,522294,, +1545,BTS_TSA,521CI,NAICS_2012_Code,522298,, +1547,BTS_TSA,521CI,NAICS_2012_Code,52231,, +1548,BTS_TSA,521CI,NAICS_2012_Code,522310,, +1549,BTS_TSA,521CI,NAICS_2012_Code,52232,, +1550,BTS_TSA,521CI,NAICS_2012_Code,522320,, +1551,BTS_TSA,521CI,NAICS_2012_Code,52239,, +1552,BTS_TSA,521CI,NAICS_2012_Code,522390,, +1553,BTS_TSA,523,NAICS_2012_Code,523,, +1554,BTS_TSA,523,NAICS_2012_Code,5231,, +1555,BTS_TSA,523,NAICS_2012_Code,52311,, +1556,BTS_TSA,523,NAICS_2012_Code,523110,, +1557,BTS_TSA,523,NAICS_2012_Code,52312,, +1558,BTS_TSA,523,NAICS_2012_Code,523120,, +1559,BTS_TSA,523,NAICS_2012_Code,52313,, +1560,BTS_TSA,523,NAICS_2012_Code,523130,, +1561,BTS_TSA,523,NAICS_2012_Code,52314,, +1562,BTS_TSA,523,NAICS_2012_Code,523140,, +1563,BTS_TSA,523,NAICS_2012_Code,5232,, +1564,BTS_TSA,523,NAICS_2012_Code,52321,, +1565,BTS_TSA,523,NAICS_2012_Code,523210,, +1566,BTS_TSA,523,NAICS_2012_Code,5239,, +1567,BTS_TSA,523,NAICS_2012_Code,52391,, +1568,BTS_TSA,523,NAICS_2012_Code,523910,, +1569,BTS_TSA,523,NAICS_2012_Code,52392,, +1570,BTS_TSA,523,NAICS_2012_Code,523920,, +1571,BTS_TSA,523,NAICS_2012_Code,52393,, +1572,BTS_TSA,523,NAICS_2012_Code,523930,, +1573,BTS_TSA,523,NAICS_2012_Code,52399,, +1574,BTS_TSA,523,NAICS_2012_Code,523991,, +1575,BTS_TSA,523,NAICS_2012_Code,523999,, +1576,BTS_TSA,524,NAICS_2012_Code,524,, +1577,BTS_TSA,524,NAICS_2012_Code,5241,, +1578,BTS_TSA,524,NAICS_2012_Code,52411,, +1579,BTS_TSA,524,NAICS_2012_Code,524113,, +1580,BTS_TSA,524,NAICS_2012_Code,524114,, +1581,BTS_TSA,524,NAICS_2012_Code,52412,, +1582,BTS_TSA,524,NAICS_2012_Code,524126,, +1583,BTS_TSA,524,NAICS_2012_Code,524127,, +1584,BTS_TSA,524,NAICS_2012_Code,524128,, +1585,BTS_TSA,524,NAICS_2012_Code,52413,, +1586,BTS_TSA,524,NAICS_2012_Code,524130,, +1587,BTS_TSA,524,NAICS_2012_Code,5242,, +1588,BTS_TSA,524,NAICS_2012_Code,52421,, +1589,BTS_TSA,524,NAICS_2012_Code,524210,, +1590,BTS_TSA,524,NAICS_2012_Code,52429,, +1591,BTS_TSA,524,NAICS_2012_Code,524291,, +1592,BTS_TSA,524,NAICS_2012_Code,524292,, +1593,BTS_TSA,524,NAICS_2012_Code,524298,, +1594,BTS_TSA,525,NAICS_2012_Code,525,, +1595,BTS_TSA,525,NAICS_2012_Code,5251,, +1596,BTS_TSA,525,NAICS_2012_Code,52511,, +1597,BTS_TSA,525,NAICS_2012_Code,525110,, +1598,BTS_TSA,525,NAICS_2012_Code,52512,, +1599,BTS_TSA,525,NAICS_2012_Code,525120,, +1600,BTS_TSA,525,NAICS_2012_Code,52519,, +1601,BTS_TSA,525,NAICS_2012_Code,525190,, +1602,BTS_TSA,525,NAICS_2012_Code,5259,, +1603,BTS_TSA,525,NAICS_2012_Code,52591,, +1604,BTS_TSA,525,NAICS_2012_Code,525910,, +1605,BTS_TSA,525,NAICS_2012_Code,52592,, +1606,BTS_TSA,525,NAICS_2012_Code,525920,, +1607,BTS_TSA,525,NAICS_2012_Code,52599,, +1608,BTS_TSA,525,NAICS_2012_Code,525990,, +1609,BTS_TSA,HS,NAICS_2012_Code,53,, +1612,BTS_TSA,HS,NAICS_2012_Code,531,, +1613,BTS_TSA,ORE,NAICS_2012_Code,531,, +1614,BTS_TSA,HS,NAICS_2012_Code,5311,, +1615,BTS_TSA,ORE,NAICS_2012_Code,5311,, +1616,BTS_TSA,HS,NAICS_2012_Code,53111,, +1617,BTS_TSA,ORE,NAICS_2012_Code,53111,, +1618,BTS_TSA,HS,NAICS_2012_Code,531110,, +1619,BTS_TSA,ORE,NAICS_2012_Code,531110,, +1620,BTS_TSA,HS,NAICS_2012_Code,53112,, +1621,BTS_TSA,ORE,NAICS_2012_Code,53112,, +1622,BTS_TSA,HS,NAICS_2012_Code,531120,, +1623,BTS_TSA,ORE,NAICS_2012_Code,531120,, +1624,BTS_TSA,HS,NAICS_2012_Code,53113,, +1625,BTS_TSA,ORE,NAICS_2012_Code,53113,, +1626,BTS_TSA,HS,NAICS_2012_Code,531130,, +1627,BTS_TSA,ORE,NAICS_2012_Code,531130,, +1628,BTS_TSA,HS,NAICS_2012_Code,53119,, +1629,BTS_TSA,ORE,NAICS_2012_Code,53119,, +1630,BTS_TSA,HS,NAICS_2012_Code,531190,, +1631,BTS_TSA,ORE,NAICS_2012_Code,531190,, +1632,BTS_TSA,HS,NAICS_2012_Code,5312,, +1633,BTS_TSA,ORE,NAICS_2012_Code,5312,, +1634,BTS_TSA,HS,NAICS_2012_Code,53121,, +1635,BTS_TSA,ORE,NAICS_2012_Code,53121,, +1636,BTS_TSA,HS,NAICS_2012_Code,531210,, +1637,BTS_TSA,ORE,NAICS_2012_Code,531210,, +1638,BTS_TSA,HS,NAICS_2012_Code,5313,, +1639,BTS_TSA,ORE,NAICS_2012_Code,5313,, +1640,BTS_TSA,HS,NAICS_2012_Code,53131,, +1641,BTS_TSA,ORE,NAICS_2012_Code,53131,, +1642,BTS_TSA,HS,NAICS_2012_Code,531311,, +1643,BTS_TSA,ORE,NAICS_2012_Code,531311,, +1644,BTS_TSA,HS,NAICS_2012_Code,531312,, +1645,BTS_TSA,ORE,NAICS_2012_Code,531312,, +1646,BTS_TSA,HS,NAICS_2012_Code,53132,, +1647,BTS_TSA,ORE,NAICS_2012_Code,53132,, +1648,BTS_TSA,HS,NAICS_2012_Code,531320,, +1649,BTS_TSA,ORE,NAICS_2012_Code,531320,, +1650,BTS_TSA,HS,NAICS_2012_Code,53139,, +1651,BTS_TSA,ORE,NAICS_2012_Code,53139,, +1652,BTS_TSA,HS,NAICS_2012_Code,531390,, +1653,BTS_TSA,ORE,NAICS_2012_Code,531390,, +1654,BTS_TSA,HS,NAICS_2012_Code,532,, +1656,BTS_TSA,HS,NAICS_2012_Code,5321,, +1658,BTS_TSA,HS,NAICS_2012_Code,53211,, +1659,BTS_TSA,532RL,NAICS_2012_Code,53211,, +1660,BTS_TSA,HS,NAICS_2012_Code,532111,, +1661,BTS_TSA,532RL,NAICS_2012_Code,532111,, +1662,BTS_TSA,HS,NAICS_2012_Code,532112,, +1663,BTS_TSA,532RL,NAICS_2012_Code,532112,, +1664,BTS_TSA,HS,NAICS_2012_Code,53212,, +1665,BTS_TSA,532RL,NAICS_2012_Code,53212,, +1666,BTS_TSA,HS,NAICS_2012_Code,532120,, +1667,BTS_TSA,532RL,NAICS_2012_Code,532120,, +1668,BTS_TSA,HS,NAICS_2012_Code,5322,, +1670,BTS_TSA,HS,NAICS_2012_Code,53221,, +1671,BTS_TSA,532RL,NAICS_2012_Code,53221,, +1672,BTS_TSA,HS,NAICS_2012_Code,532210,, +1673,BTS_TSA,532RL,NAICS_2012_Code,532210,, +1674,BTS_TSA,HS,NAICS_2012_Code,53222,, +1675,BTS_TSA,532RL,NAICS_2012_Code,53222,, +1676,BTS_TSA,HS,NAICS_2012_Code,532220,, +1677,BTS_TSA,532RL,NAICS_2012_Code,532220,, +1678,BTS_TSA,HS,NAICS_2012_Code,53223,, +1679,BTS_TSA,532RL,NAICS_2012_Code,53223,, +1680,BTS_TSA,HS,NAICS_2012_Code,532230,, +1681,BTS_TSA,532RL,NAICS_2012_Code,532230,, +1682,BTS_TSA,HS,NAICS_2012_Code,53229,, +1683,BTS_TSA,532RL,NAICS_2012_Code,53229,, +1684,BTS_TSA,HS,NAICS_2012_Code,532291,, +1685,BTS_TSA,532RL,NAICS_2012_Code,532291,, +1686,BTS_TSA,HS,NAICS_2012_Code,532292,, +1687,BTS_TSA,532RL,NAICS_2012_Code,532292,, +1688,BTS_TSA,HS,NAICS_2012_Code,532299,, +1689,BTS_TSA,532RL,NAICS_2012_Code,532299,, +1690,BTS_TSA,HS,NAICS_2012_Code,5323,, +1692,BTS_TSA,HS,NAICS_2012_Code,53231,, +1693,BTS_TSA,532RL,NAICS_2012_Code,53231,, +1694,BTS_TSA,HS,NAICS_2012_Code,532310,, +1695,BTS_TSA,532RL,NAICS_2012_Code,532310,, +1696,BTS_TSA,HS,NAICS_2012_Code,5324,, +1698,BTS_TSA,HS,NAICS_2012_Code,53241,, +1699,BTS_TSA,532RL,NAICS_2012_Code,53241,, +1700,BTS_TSA,HS,NAICS_2012_Code,532411,, +1701,BTS_TSA,532RL,NAICS_2012_Code,532411,, +1702,BTS_TSA,HS,NAICS_2012_Code,532412,, +1703,BTS_TSA,532RL,NAICS_2012_Code,532412,, +1704,BTS_TSA,HS,NAICS_2012_Code,53242,, +1705,BTS_TSA,532RL,NAICS_2012_Code,53242,, +1706,BTS_TSA,HS,NAICS_2012_Code,532420,, +1707,BTS_TSA,532RL,NAICS_2012_Code,532420,, +1708,BTS_TSA,HS,NAICS_2012_Code,53249,, +1709,BTS_TSA,532RL,NAICS_2012_Code,53249,, +1710,BTS_TSA,HS,NAICS_2012_Code,532490,, +1711,BTS_TSA,532RL,NAICS_2012_Code,532490,, +1712,BTS_TSA,HS,NAICS_2012_Code,533,, +1714,BTS_TSA,HS,NAICS_2012_Code,5331,, +1716,BTS_TSA,HS,NAICS_2012_Code,53311,, +1717,BTS_TSA,532RL,NAICS_2012_Code,53311,, +1718,BTS_TSA,HS,NAICS_2012_Code,533110,, +1719,BTS_TSA,532RL,NAICS_2012_Code,533110,, +1726,BTS_TSA,5411,NAICS_2012_Code,5411,, +1727,BTS_TSA,5411,NAICS_2012_Code,54111,, +1728,BTS_TSA,5411,NAICS_2012_Code,541110,, +1729,BTS_TSA,5411,NAICS_2012_Code,54112,, +1730,BTS_TSA,5411,NAICS_2012_Code,541120,, +1731,BTS_TSA,5411,NAICS_2012_Code,54119,, +1732,BTS_TSA,5411,NAICS_2012_Code,541191,, +1733,BTS_TSA,5411,NAICS_2012_Code,541199,, +1736,BTS_TSA,5412OP,NAICS_2012_Code,541211,, +1737,BTS_TSA,5412OP,NAICS_2012_Code,541213,, +1738,BTS_TSA,5412OP,NAICS_2012_Code,541214,, +1739,BTS_TSA,5412OP,NAICS_2012_Code,541219,, +1742,BTS_TSA,5412OP,NAICS_2012_Code,541310,, +1744,BTS_TSA,5412OP,NAICS_2012_Code,541320,, +1746,BTS_TSA,5412OP,NAICS_2012_Code,541330,, +1748,BTS_TSA,5412OP,NAICS_2012_Code,541340,, +1750,BTS_TSA,5412OP,NAICS_2012_Code,541350,, +1752,BTS_TSA,5412OP,NAICS_2012_Code,541360,, +1754,BTS_TSA,5412OP,NAICS_2012_Code,541370,, +1756,BTS_TSA,5412OP,NAICS_2012_Code,541380,, +1759,BTS_TSA,5412OP,NAICS_2012_Code,541410,, +1761,BTS_TSA,5412OP,NAICS_2012_Code,541420,, +1763,BTS_TSA,5412OP,NAICS_2012_Code,541430,, +1765,BTS_TSA,5412OP,NAICS_2012_Code,541490,, +1766,BTS_TSA,5415,NAICS_2012_Code,5415,, +1767,BTS_TSA,5415,NAICS_2012_Code,54151,, +1768,BTS_TSA,5415,NAICS_2012_Code,541511,, +1769,BTS_TSA,5415,NAICS_2012_Code,541512,, +1770,BTS_TSA,5415,NAICS_2012_Code,541513,, +1771,BTS_TSA,5415,NAICS_2012_Code,541519,, +1774,BTS_TSA,5412OP,NAICS_2012_Code,541611,, +1775,BTS_TSA,5412OP,NAICS_2012_Code,541612,, +1776,BTS_TSA,5412OP,NAICS_2012_Code,541613,, +1777,BTS_TSA,5412OP,NAICS_2012_Code,541614,, +1778,BTS_TSA,5412OP,NAICS_2012_Code,541618,, +1780,BTS_TSA,5412OP,NAICS_2012_Code,541620,, +1782,BTS_TSA,5412OP,NAICS_2012_Code,541690,, +1785,BTS_TSA,5412OP,NAICS_2012_Code,541711,, +1786,BTS_TSA,5412OP,NAICS_2012_Code,541712,, +1788,BTS_TSA,5412OP,NAICS_2012_Code,541720,, +1791,BTS_TSA,5412OP,NAICS_2012_Code,541810,, +1793,BTS_TSA,5412OP,NAICS_2012_Code,541820,, +1795,BTS_TSA,5412OP,NAICS_2012_Code,541830,, +1797,BTS_TSA,5412OP,NAICS_2012_Code,541840,, +1799,BTS_TSA,5412OP,NAICS_2012_Code,541850,, +1801,BTS_TSA,5412OP,NAICS_2012_Code,541860,, +1803,BTS_TSA,5412OP,NAICS_2012_Code,541870,, +1805,BTS_TSA,5412OP,NAICS_2012_Code,541890,, +1808,BTS_TSA,5412OP,NAICS_2012_Code,541910,, +1810,BTS_TSA,5412OP,NAICS_2012_Code,541921,, +1811,BTS_TSA,5412OP,NAICS_2012_Code,541922,, +1813,BTS_TSA,5412OP,NAICS_2012_Code,541930,, +1815,BTS_TSA,5412OP,NAICS_2012_Code,541940,, +1817,BTS_TSA,5412OP,NAICS_2012_Code,541990,, +1818,BTS_TSA,55,NAICS_2012_Code,55,, +1819,BTS_TSA,55,NAICS_2012_Code,551,, +1820,BTS_TSA,55,NAICS_2012_Code,5511,, +1821,BTS_TSA,55,NAICS_2012_Code,55111,, +1822,BTS_TSA,55,NAICS_2012_Code,551111,, +1823,BTS_TSA,55,NAICS_2012_Code,551112,, +1824,BTS_TSA,55,NAICS_2012_Code,551114,, +1827,BTS_TSA,561,NAICS_2012_Code,561,, +1828,BTS_TSA,561,NAICS_2012_Code,5611,, +1829,BTS_TSA,561,NAICS_2012_Code,56111,, +1830,BTS_TSA,561,NAICS_2012_Code,561110,, +1831,BTS_TSA,561,NAICS_2012_Code,5612,, +1832,BTS_TSA,561,NAICS_2012_Code,56121,, +1833,BTS_TSA,561,NAICS_2012_Code,561210,, +1834,BTS_TSA,561,NAICS_2012_Code,5613,, +1835,BTS_TSA,561,NAICS_2012_Code,56131,, +1836,BTS_TSA,561,NAICS_2012_Code,561311,, +1837,BTS_TSA,561,NAICS_2012_Code,561312,, +1838,BTS_TSA,561,NAICS_2012_Code,56132,, +1839,BTS_TSA,561,NAICS_2012_Code,561320,, +1840,BTS_TSA,561,NAICS_2012_Code,56133,, +1841,BTS_TSA,561,NAICS_2012_Code,561330,, +1842,BTS_TSA,561,NAICS_2012_Code,5614,, +1843,BTS_TSA,561,NAICS_2012_Code,56141,, +1844,BTS_TSA,561,NAICS_2012_Code,561410,, +1845,BTS_TSA,561,NAICS_2012_Code,56142,, +1846,BTS_TSA,561,NAICS_2012_Code,561421,, +1847,BTS_TSA,561,NAICS_2012_Code,561422,, +1848,BTS_TSA,561,NAICS_2012_Code,56143,, +1849,BTS_TSA,561,NAICS_2012_Code,561431,, +1850,BTS_TSA,561,NAICS_2012_Code,561439,, +1851,BTS_TSA,561,NAICS_2012_Code,56144,, +1852,BTS_TSA,561,NAICS_2012_Code,561440,, +1853,BTS_TSA,561,NAICS_2012_Code,56145,, +1854,BTS_TSA,561,NAICS_2012_Code,561450,, +1855,BTS_TSA,561,NAICS_2012_Code,56149,, +1856,BTS_TSA,561,NAICS_2012_Code,561491,, +1857,BTS_TSA,561,NAICS_2012_Code,561492,, +1858,BTS_TSA,561,NAICS_2012_Code,561499,, +1859,BTS_TSA,561,NAICS_2012_Code,5615,, +1860,BTS_TSA,561,NAICS_2012_Code,56151,, +1861,BTS_TSA,561,NAICS_2012_Code,561510,, +1862,BTS_TSA,561,NAICS_2012_Code,56152,, +1863,BTS_TSA,561,NAICS_2012_Code,561520,, +1864,BTS_TSA,561,NAICS_2012_Code,56159,, +1865,BTS_TSA,561,NAICS_2012_Code,561591,, +1866,BTS_TSA,561,NAICS_2012_Code,561599,, +1867,BTS_TSA,561,NAICS_2012_Code,5616,, +1868,BTS_TSA,561,NAICS_2012_Code,56161,, +1869,BTS_TSA,561,NAICS_2012_Code,561611,, +1870,BTS_TSA,561,NAICS_2012_Code,561612,, +1871,BTS_TSA,561,NAICS_2012_Code,561613,, +1872,BTS_TSA,561,NAICS_2012_Code,56162,, +1873,BTS_TSA,561,NAICS_2012_Code,561621,, +1874,BTS_TSA,561,NAICS_2012_Code,561622,, +1875,BTS_TSA,561,NAICS_2012_Code,5617,, +1876,BTS_TSA,561,NAICS_2012_Code,56171,, +1877,BTS_TSA,561,NAICS_2012_Code,561710,, +1878,BTS_TSA,561,NAICS_2012_Code,56172,, +1879,BTS_TSA,561,NAICS_2012_Code,561720,, +1880,BTS_TSA,561,NAICS_2012_Code,56173,, +1881,BTS_TSA,561,NAICS_2012_Code,561730,, +1882,BTS_TSA,561,NAICS_2012_Code,56174,, +1883,BTS_TSA,561,NAICS_2012_Code,561740,, +1884,BTS_TSA,561,NAICS_2012_Code,56179,, +1885,BTS_TSA,561,NAICS_2012_Code,561790,, +1886,BTS_TSA,561,NAICS_2012_Code,5619,, +1887,BTS_TSA,561,NAICS_2012_Code,56191,, +1888,BTS_TSA,561,NAICS_2012_Code,561910,, +1889,BTS_TSA,561,NAICS_2012_Code,56192,, +1890,BTS_TSA,561,NAICS_2012_Code,561920,, +1891,BTS_TSA,561,NAICS_2012_Code,56199,, +1892,BTS_TSA,561,NAICS_2012_Code,561990,, +1893,BTS_TSA,562,NAICS_2012_Code,562,, +1894,BTS_TSA,562,NAICS_2012_Code,5621,, +1895,BTS_TSA,562,NAICS_2012_Code,56211,, +1896,BTS_TSA,562,NAICS_2012_Code,562111,, +1897,BTS_TSA,562,NAICS_2012_Code,562112,, +1898,BTS_TSA,562,NAICS_2012_Code,562119,, +1899,BTS_TSA,562,NAICS_2012_Code,5622,, +1900,BTS_TSA,562,NAICS_2012_Code,56221,, +1901,BTS_TSA,562,NAICS_2012_Code,562211,, +1902,BTS_TSA,562,NAICS_2012_Code,562212,, +1903,BTS_TSA,562,NAICS_2012_Code,562213,, +1904,BTS_TSA,562,NAICS_2012_Code,562219,, +1905,BTS_TSA,562,NAICS_2012_Code,5629,, +1906,BTS_TSA,562,NAICS_2012_Code,56291,, +1907,BTS_TSA,562,NAICS_2012_Code,562910,, +1908,BTS_TSA,562,NAICS_2012_Code,56292,, +1909,BTS_TSA,562,NAICS_2012_Code,562920,, +1910,BTS_TSA,562,NAICS_2012_Code,56299,, +1911,BTS_TSA,562,NAICS_2012_Code,562991,, +1912,BTS_TSA,562,NAICS_2012_Code,562998,, +1913,BTS_TSA,61,NAICS_2012_Code,61,, +1914,BTS_TSA,61,NAICS_2012_Code,611,, +1915,BTS_TSA,61,NAICS_2012_Code,6111,, +1916,BTS_TSA,61,NAICS_2012_Code,61111,, +1917,BTS_TSA,61,NAICS_2012_Code,611110,, +1918,BTS_TSA,61,NAICS_2012_Code,6112,, +1919,BTS_TSA,61,NAICS_2012_Code,61121,, +1920,BTS_TSA,61,NAICS_2012_Code,611210,, +1921,BTS_TSA,61,NAICS_2012_Code,6113,, +1922,BTS_TSA,61,NAICS_2012_Code,61131,, +1923,BTS_TSA,61,NAICS_2012_Code,611310,, +1924,BTS_TSA,61,NAICS_2012_Code,6114,, +1925,BTS_TSA,61,NAICS_2012_Code,61141,, +1926,BTS_TSA,61,NAICS_2012_Code,611410,, +1927,BTS_TSA,61,NAICS_2012_Code,61142,, +1928,BTS_TSA,61,NAICS_2012_Code,611420,, +1929,BTS_TSA,61,NAICS_2012_Code,61143,, +1930,BTS_TSA,61,NAICS_2012_Code,611430,, +1931,BTS_TSA,61,NAICS_2012_Code,6115,, +1932,BTS_TSA,61,NAICS_2012_Code,61151,, +1933,BTS_TSA,61,NAICS_2012_Code,611511,, +1934,BTS_TSA,61,NAICS_2012_Code,611512,, +1935,BTS_TSA,61,NAICS_2012_Code,611513,, +1936,BTS_TSA,61,NAICS_2012_Code,611519,, +1937,BTS_TSA,61,NAICS_2012_Code,6116,, +1938,BTS_TSA,61,NAICS_2012_Code,61161,, +1939,BTS_TSA,61,NAICS_2012_Code,611610,, +1940,BTS_TSA,61,NAICS_2012_Code,61162,, +1941,BTS_TSA,61,NAICS_2012_Code,611620,, +1942,BTS_TSA,61,NAICS_2012_Code,61163,, +1943,BTS_TSA,61,NAICS_2012_Code,611630,, +1944,BTS_TSA,61,NAICS_2012_Code,61169,, +1945,BTS_TSA,61,NAICS_2012_Code,611691,, +1946,BTS_TSA,61,NAICS_2012_Code,611692,, +1947,BTS_TSA,61,NAICS_2012_Code,611699,, +1948,BTS_TSA,61,NAICS_2012_Code,6117,, +1949,BTS_TSA,61,NAICS_2012_Code,61171,, +1950,BTS_TSA,61,NAICS_2012_Code,611710,, +1955,BTS_TSA,621,NAICS_2012_Code,621,, +1956,BTS_TSA,621,NAICS_2012_Code,6211,, +1957,BTS_TSA,621,NAICS_2012_Code,62111,, +1958,BTS_TSA,621,NAICS_2012_Code,621111,, +1959,BTS_TSA,621,NAICS_2012_Code,621112,, +1960,BTS_TSA,621,NAICS_2012_Code,6212,, +1961,BTS_TSA,621,NAICS_2012_Code,62121,, +1962,BTS_TSA,621,NAICS_2012_Code,621210,, +1963,BTS_TSA,621,NAICS_2012_Code,6213,, +1964,BTS_TSA,621,NAICS_2012_Code,62131,, +1965,BTS_TSA,621,NAICS_2012_Code,621310,, +1966,BTS_TSA,621,NAICS_2012_Code,62132,, +1967,BTS_TSA,621,NAICS_2012_Code,621320,, +1968,BTS_TSA,621,NAICS_2012_Code,62133,, +1969,BTS_TSA,621,NAICS_2012_Code,621330,, +1970,BTS_TSA,621,NAICS_2012_Code,62134,, +1971,BTS_TSA,621,NAICS_2012_Code,621340,, +1972,BTS_TSA,621,NAICS_2012_Code,62139,, +1973,BTS_TSA,621,NAICS_2012_Code,621391,, +1974,BTS_TSA,621,NAICS_2012_Code,621399,, +1975,BTS_TSA,621,NAICS_2012_Code,6214,, +1976,BTS_TSA,621,NAICS_2012_Code,62141,, +1977,BTS_TSA,621,NAICS_2012_Code,621410,, +1978,BTS_TSA,621,NAICS_2012_Code,62142,, +1979,BTS_TSA,621,NAICS_2012_Code,621420,, +1980,BTS_TSA,621,NAICS_2012_Code,62149,, +1981,BTS_TSA,621,NAICS_2012_Code,621491,, +1982,BTS_TSA,621,NAICS_2012_Code,621492,, +1983,BTS_TSA,621,NAICS_2012_Code,621493,, +1984,BTS_TSA,621,NAICS_2012_Code,621498,, +1985,BTS_TSA,621,NAICS_2012_Code,6215,, +1986,BTS_TSA,621,NAICS_2012_Code,62151,, +1987,BTS_TSA,621,NAICS_2012_Code,621511,, +1988,BTS_TSA,621,NAICS_2012_Code,621512,, +1989,BTS_TSA,621,NAICS_2012_Code,6216,, +1990,BTS_TSA,621,NAICS_2012_Code,62161,, +1991,BTS_TSA,621,NAICS_2012_Code,621610,, +1992,BTS_TSA,621,NAICS_2012_Code,6219,, +1993,BTS_TSA,621,NAICS_2012_Code,62191,, +1994,BTS_TSA,621,NAICS_2012_Code,621910,, +1995,BTS_TSA,621,NAICS_2012_Code,62199,, +1996,BTS_TSA,621,NAICS_2012_Code,621991,, +1997,BTS_TSA,621,NAICS_2012_Code,621999,, +1998,BTS_TSA,622,NAICS_2012_Code,622,, +1999,BTS_TSA,622,NAICS_2012_Code,6221,, +2000,BTS_TSA,622,NAICS_2012_Code,62211,, +2001,BTS_TSA,622,NAICS_2012_Code,622110,, +2002,BTS_TSA,622,NAICS_2012_Code,6222,, +2003,BTS_TSA,622,NAICS_2012_Code,62221,, +2004,BTS_TSA,622,NAICS_2012_Code,622210,, +2005,BTS_TSA,622,NAICS_2012_Code,6223,, +2006,BTS_TSA,622,NAICS_2012_Code,62231,, +2007,BTS_TSA,622,NAICS_2012_Code,622310,, +2008,BTS_TSA,623,NAICS_2012_Code,623,, +2009,BTS_TSA,623,NAICS_2012_Code,6231,, +2010,BTS_TSA,623,NAICS_2012_Code,62311,, +2011,BTS_TSA,623,NAICS_2012_Code,623110,, +2012,BTS_TSA,623,NAICS_2012_Code,6232,, +2013,BTS_TSA,623,NAICS_2012_Code,62321,, +2014,BTS_TSA,623,NAICS_2012_Code,623210,, +2015,BTS_TSA,623,NAICS_2012_Code,62322,, +2016,BTS_TSA,623,NAICS_2012_Code,623220,, +2017,BTS_TSA,623,NAICS_2012_Code,6233,, +2018,BTS_TSA,623,NAICS_2012_Code,62331,, +2019,BTS_TSA,623,NAICS_2012_Code,623311,, +2020,BTS_TSA,623,NAICS_2012_Code,623312,, +2021,BTS_TSA,623,NAICS_2012_Code,6239,, +2022,BTS_TSA,623,NAICS_2012_Code,62399,, +2023,BTS_TSA,623,NAICS_2012_Code,623990,, +2024,BTS_TSA,624,NAICS_2012_Code,624,, +2025,BTS_TSA,624,NAICS_2012_Code,6241,, +2026,BTS_TSA,624,NAICS_2012_Code,62411,, +2027,BTS_TSA,624,NAICS_2012_Code,624110,, +2028,BTS_TSA,624,NAICS_2012_Code,62412,, +2029,BTS_TSA,624,NAICS_2012_Code,624120,, +2030,BTS_TSA,624,NAICS_2012_Code,62419,, +2031,BTS_TSA,624,NAICS_2012_Code,624190,, +2032,BTS_TSA,624,NAICS_2012_Code,6242,, +2033,BTS_TSA,624,NAICS_2012_Code,62421,, +2034,BTS_TSA,624,NAICS_2012_Code,624210,, +2035,BTS_TSA,624,NAICS_2012_Code,62422,, +2036,BTS_TSA,624,NAICS_2012_Code,624221,, +2037,BTS_TSA,624,NAICS_2012_Code,624229,, +2038,BTS_TSA,624,NAICS_2012_Code,62423,, +2039,BTS_TSA,624,NAICS_2012_Code,624230,, +2040,BTS_TSA,624,NAICS_2012_Code,6243,, +2041,BTS_TSA,624,NAICS_2012_Code,62431,, +2042,BTS_TSA,624,NAICS_2012_Code,624310,, +2043,BTS_TSA,624,NAICS_2012_Code,6244,, +2044,BTS_TSA,624,NAICS_2012_Code,62441,, +2045,BTS_TSA,624,NAICS_2012_Code,624410,, +2050,BTS_TSA,711AS,NAICS_2012_Code,71111,, +2051,BTS_TSA,711AS,NAICS_2012_Code,711110,, +2052,BTS_TSA,711AS,NAICS_2012_Code,71112,, +2053,BTS_TSA,711AS,NAICS_2012_Code,711120,, +2054,BTS_TSA,711AS,NAICS_2012_Code,71113,, +2055,BTS_TSA,711AS,NAICS_2012_Code,711130,, +2056,BTS_TSA,711AS,NAICS_2012_Code,71119,, +2057,BTS_TSA,711AS,NAICS_2012_Code,711190,, +2059,BTS_TSA,711AS,NAICS_2012_Code,71121,, +2060,BTS_TSA,711AS,NAICS_2012_Code,711211,, +2061,BTS_TSA,711AS,NAICS_2012_Code,711212,, +2062,BTS_TSA,711AS,NAICS_2012_Code,711219,, +2064,BTS_TSA,711AS,NAICS_2012_Code,71131,, +2065,BTS_TSA,711AS,NAICS_2012_Code,711310,, +2066,BTS_TSA,711AS,NAICS_2012_Code,71132,, +2067,BTS_TSA,711AS,NAICS_2012_Code,711320,, +2069,BTS_TSA,711AS,NAICS_2012_Code,71141,, +2070,BTS_TSA,711AS,NAICS_2012_Code,711410,, +2072,BTS_TSA,711AS,NAICS_2012_Code,71151,, +2073,BTS_TSA,711AS,NAICS_2012_Code,711510,, +2076,BTS_TSA,711AS,NAICS_2012_Code,71211,, +2077,BTS_TSA,711AS,NAICS_2012_Code,712110,, +2078,BTS_TSA,711AS,NAICS_2012_Code,71212,, +2079,BTS_TSA,711AS,NAICS_2012_Code,712120,, +2080,BTS_TSA,711AS,NAICS_2012_Code,71213,, +2081,BTS_TSA,711AS,NAICS_2012_Code,712130,, +2082,BTS_TSA,711AS,NAICS_2012_Code,71219,, +2083,BTS_TSA,711AS,NAICS_2012_Code,712190,, +2084,BTS_TSA,713,NAICS_2012_Code,713,, +2085,BTS_TSA,713,NAICS_2012_Code,7131,, +2086,BTS_TSA,713,NAICS_2012_Code,71311,, +2087,BTS_TSA,713,NAICS_2012_Code,713110,, +2088,BTS_TSA,713,NAICS_2012_Code,71312,, +2089,BTS_TSA,713,NAICS_2012_Code,713120,, +2090,BTS_TSA,713,NAICS_2012_Code,7132,, +2091,BTS_TSA,713,NAICS_2012_Code,71321,, +2092,BTS_TSA,713,NAICS_2012_Code,713210,, +2093,BTS_TSA,713,NAICS_2012_Code,71329,, +2094,BTS_TSA,713,NAICS_2012_Code,713290,, +2095,BTS_TSA,713,NAICS_2012_Code,7139,, +2096,BTS_TSA,713,NAICS_2012_Code,71391,, +2097,BTS_TSA,713,NAICS_2012_Code,713910,, +2098,BTS_TSA,713,NAICS_2012_Code,71392,, +2099,BTS_TSA,713,NAICS_2012_Code,713920,, +2100,BTS_TSA,713,NAICS_2012_Code,71393,, +2101,BTS_TSA,713,NAICS_2012_Code,713930,, +2102,BTS_TSA,713,NAICS_2012_Code,71394,, +2103,BTS_TSA,713,NAICS_2012_Code,713940,, +2104,BTS_TSA,713,NAICS_2012_Code,71395,, +2105,BTS_TSA,713,NAICS_2012_Code,713950,, +2106,BTS_TSA,713,NAICS_2012_Code,71399,, +2107,BTS_TSA,713,NAICS_2012_Code,713990,, +2110,BTS_TSA,721,NAICS_2012_Code,721,, +2111,BTS_TSA,721,NAICS_2012_Code,7211,, +2112,BTS_TSA,721,NAICS_2012_Code,72111,, +2113,BTS_TSA,721,NAICS_2012_Code,721110,, +2114,BTS_TSA,721,NAICS_2012_Code,72112,, +2115,BTS_TSA,721,NAICS_2012_Code,721120,, +2116,BTS_TSA,721,NAICS_2012_Code,72119,, +2117,BTS_TSA,721,NAICS_2012_Code,721191,, +2118,BTS_TSA,721,NAICS_2012_Code,721199,, +2119,BTS_TSA,721,NAICS_2012_Code,7212,, +2120,BTS_TSA,721,NAICS_2012_Code,72121,, +2121,BTS_TSA,721,NAICS_2012_Code,721211,, +2122,BTS_TSA,721,NAICS_2012_Code,721214,, +2123,BTS_TSA,721,NAICS_2012_Code,7213,, +2124,BTS_TSA,721,NAICS_2012_Code,72131,, +2125,BTS_TSA,721,NAICS_2012_Code,721310,, +2126,BTS_TSA,722,NAICS_2012_Code,722,, +2127,BTS_TSA,722,NAICS_2012_Code,7223,, +2128,BTS_TSA,722,NAICS_2012_Code,72231,, +2129,BTS_TSA,722,NAICS_2012_Code,722310,, +2130,BTS_TSA,722,NAICS_2012_Code,72232,, +2131,BTS_TSA,722,NAICS_2012_Code,722320,, +2132,BTS_TSA,722,NAICS_2012_Code,72233,, +2133,BTS_TSA,722,NAICS_2012_Code,722330,, +2134,BTS_TSA,722,NAICS_2012_Code,7224,, +2135,BTS_TSA,722,NAICS_2012_Code,72241,, +2136,BTS_TSA,722,NAICS_2012_Code,722410,, +2137,BTS_TSA,722,NAICS_2012_Code,7225,, +2138,BTS_TSA,722,NAICS_2012_Code,72251,, +2139,BTS_TSA,722,NAICS_2012_Code,722511,, +2140,BTS_TSA,722,NAICS_2012_Code,722513,, +2141,BTS_TSA,722,NAICS_2012_Code,722514,, +2142,BTS_TSA,722,NAICS_2012_Code,722515,, +2143,BTS_TSA,81,NAICS_2012_Code,81,, +2144,BTS_TSA,81,NAICS_2012_Code,811,, +2145,BTS_TSA,81,NAICS_2012_Code,8111,, +2146,BTS_TSA,81,NAICS_2012_Code,81111,, +2147,BTS_TSA,81,NAICS_2012_Code,811111,, +2148,BTS_TSA,81,NAICS_2012_Code,811112,, +2149,BTS_TSA,81,NAICS_2012_Code,811113,, +2150,BTS_TSA,81,NAICS_2012_Code,811118,, +2151,BTS_TSA,81,NAICS_2012_Code,81112,, +2152,BTS_TSA,81,NAICS_2012_Code,811121,, +2153,BTS_TSA,81,NAICS_2012_Code,811122,, +2154,BTS_TSA,81,NAICS_2012_Code,81119,, +2155,BTS_TSA,81,NAICS_2012_Code,811191,, +2156,BTS_TSA,81,NAICS_2012_Code,811192,, +2157,BTS_TSA,81,NAICS_2012_Code,811198,, +2158,BTS_TSA,81,NAICS_2012_Code,8112,, +2159,BTS_TSA,81,NAICS_2012_Code,81121,, +2160,BTS_TSA,81,NAICS_2012_Code,811211,, +2161,BTS_TSA,81,NAICS_2012_Code,811212,, +2162,BTS_TSA,81,NAICS_2012_Code,811213,, +2163,BTS_TSA,81,NAICS_2012_Code,811219,, +2164,BTS_TSA,81,NAICS_2012_Code,8113,, +2165,BTS_TSA,81,NAICS_2012_Code,81131,, +2166,BTS_TSA,81,NAICS_2012_Code,811310,, +2167,BTS_TSA,81,NAICS_2012_Code,8114,, +2168,BTS_TSA,81,NAICS_2012_Code,81141,, +2169,BTS_TSA,81,NAICS_2012_Code,811411,, +2170,BTS_TSA,81,NAICS_2012_Code,811412,, +2171,BTS_TSA,81,NAICS_2012_Code,81142,, +2172,BTS_TSA,81,NAICS_2012_Code,811420,, +2173,BTS_TSA,81,NAICS_2012_Code,81143,, +2174,BTS_TSA,81,NAICS_2012_Code,811430,, +2175,BTS_TSA,81,NAICS_2012_Code,81149,, +2176,BTS_TSA,81,NAICS_2012_Code,811490,, +2177,BTS_TSA,81,NAICS_2012_Code,812,, +2178,BTS_TSA,81,NAICS_2012_Code,8121,, +2179,BTS_TSA,81,NAICS_2012_Code,81211,, +2180,BTS_TSA,81,NAICS_2012_Code,812111,, +2181,BTS_TSA,81,NAICS_2012_Code,812112,, +2182,BTS_TSA,81,NAICS_2012_Code,812113,, +2183,BTS_TSA,81,NAICS_2012_Code,81219,, +2184,BTS_TSA,81,NAICS_2012_Code,812191,, +2185,BTS_TSA,81,NAICS_2012_Code,812199,, +2186,BTS_TSA,81,NAICS_2012_Code,8122,, +2187,BTS_TSA,81,NAICS_2012_Code,81221,, +2188,BTS_TSA,81,NAICS_2012_Code,812210,, +2189,BTS_TSA,81,NAICS_2012_Code,81222,, +2190,BTS_TSA,81,NAICS_2012_Code,812220,, +2191,BTS_TSA,81,NAICS_2012_Code,8123,, +2192,BTS_TSA,81,NAICS_2012_Code,81231,, +2193,BTS_TSA,81,NAICS_2012_Code,812310,, +2194,BTS_TSA,81,NAICS_2012_Code,81232,, +2195,BTS_TSA,81,NAICS_2012_Code,812320,, +2196,BTS_TSA,81,NAICS_2012_Code,81233,, +2197,BTS_TSA,81,NAICS_2012_Code,812331,, +2198,BTS_TSA,81,NAICS_2012_Code,812332,, +2199,BTS_TSA,81,NAICS_2012_Code,8129,, +2200,BTS_TSA,81,NAICS_2012_Code,81291,, +2201,BTS_TSA,81,NAICS_2012_Code,812910,, +2202,BTS_TSA,81,NAICS_2012_Code,81292,, +2203,BTS_TSA,81,NAICS_2012_Code,812921,, +2204,BTS_TSA,81,NAICS_2012_Code,812922,, +2205,BTS_TSA,81,NAICS_2012_Code,81293,, +2206,BTS_TSA,81,NAICS_2012_Code,812930,, +2207,BTS_TSA,81,NAICS_2012_Code,81299,, +2208,BTS_TSA,81,NAICS_2012_Code,812990,, +2209,BTS_TSA,81,NAICS_2012_Code,813,, +2210,BTS_TSA,81,NAICS_2012_Code,8131,, +2211,BTS_TSA,81,NAICS_2012_Code,81311,, +2212,BTS_TSA,81,NAICS_2012_Code,813110,, +2213,BTS_TSA,81,NAICS_2012_Code,8132,, +2214,BTS_TSA,81,NAICS_2012_Code,81321,, +2215,BTS_TSA,81,NAICS_2012_Code,813211,, +2216,BTS_TSA,81,NAICS_2012_Code,813212,, +2217,BTS_TSA,81,NAICS_2012_Code,813219,, +2218,BTS_TSA,81,NAICS_2012_Code,8133,, +2219,BTS_TSA,81,NAICS_2012_Code,81331,, +2220,BTS_TSA,81,NAICS_2012_Code,813311,, +2221,BTS_TSA,81,NAICS_2012_Code,813312,, +2222,BTS_TSA,81,NAICS_2012_Code,813319,, +2223,BTS_TSA,81,NAICS_2012_Code,8134,, +2224,BTS_TSA,81,NAICS_2012_Code,81341,, +2225,BTS_TSA,81,NAICS_2012_Code,813410,, +2226,BTS_TSA,81,NAICS_2012_Code,8139,, +2227,BTS_TSA,81,NAICS_2012_Code,81391,, +2228,BTS_TSA,81,NAICS_2012_Code,813910,, +2229,BTS_TSA,81,NAICS_2012_Code,81392,, +2230,BTS_TSA,81,NAICS_2012_Code,813920,, +2231,BTS_TSA,81,NAICS_2012_Code,81393,, +2232,BTS_TSA,81,NAICS_2012_Code,813930,, +2233,BTS_TSA,81,NAICS_2012_Code,81394,, +2234,BTS_TSA,81,NAICS_2012_Code,813940,, +2235,BTS_TSA,81,NAICS_2012_Code,81399,, +2236,BTS_TSA,81,NAICS_2012_Code,813990,, +2237,BTS_TSA,81,NAICS_2012_Code,814,, +2238,BTS_TSA,81,NAICS_2012_Code,8141,, +2239,BTS_TSA,81,NAICS_2012_Code,81411,, +2240,BTS_TSA,81,NAICS_2012_Code,814110,, +2248,BTS_TSA,GSLG,NAICS_2012_Code,9211,, +2249,BTS_TSA,GFGN,NAICS_2012_Code,9211,, +2250,BTS_TSA,GSLG,NAICS_2012_Code,92111,, +2251,BTS_TSA,GFGN,NAICS_2012_Code,92111,, +2252,BTS_TSA,GSLG,NAICS_2012_Code,921110,, +2253,BTS_TSA,GFGN,NAICS_2012_Code,921110,, +2254,BTS_TSA,GSLG,NAICS_2012_Code,92112,, +2255,BTS_TSA,GFGN,NAICS_2012_Code,92112,, +2256,BTS_TSA,GSLG,NAICS_2012_Code,921120,, +2257,BTS_TSA,GFGN,NAICS_2012_Code,921120,, +2258,BTS_TSA,GSLG,NAICS_2012_Code,92113,, +2259,BTS_TSA,GFGN,NAICS_2012_Code,92113,, +2260,BTS_TSA,GSLG,NAICS_2012_Code,921130,, +2261,BTS_TSA,GFGN,NAICS_2012_Code,921130,, +2262,BTS_TSA,GSLG,NAICS_2012_Code,92114,, +2263,BTS_TSA,GFGN,NAICS_2012_Code,92114,, +2264,BTS_TSA,GSLG,NAICS_2012_Code,921140,, +2265,BTS_TSA,GFGN,NAICS_2012_Code,921140,, +2266,BTS_TSA,GSLG,NAICS_2012_Code,92115,, +2267,BTS_TSA,GSLG,NAICS_2012_Code,921150,, +2268,BTS_TSA,GSLG,NAICS_2012_Code,92119,, +2269,BTS_TSA,GFGN,NAICS_2012_Code,92119,, +2270,BTS_TSA,GSLG,NAICS_2012_Code,921190,, +2271,BTS_TSA,GFGN,NAICS_2012_Code,921190,, +2275,BTS_TSA,GSLG,NAICS_2012_Code,9221,, +2276,BTS_TSA,GFE,NAICS_2012_Code,9221,, +2277,BTS_TSA,GSLE,NAICS_2012_Code,9221,, +2278,BTS_TSA,GFGN,NAICS_2012_Code,9221,, +2279,BTS_TSA,GSLG,NAICS_2012_Code,92211,, +2280,BTS_TSA,GFGN,NAICS_2012_Code,92211,, +2281,BTS_TSA,GSLG,NAICS_2012_Code,922110,, +2282,BTS_TSA,GFGN,NAICS_2012_Code,922110,, +2283,BTS_TSA,GSLG,NAICS_2012_Code,92212,, +2284,BTS_TSA,GFE,NAICS_2012_Code,92212,, +2285,BTS_TSA,GSLE,NAICS_2012_Code,92212,, +2286,BTS_TSA,GFGN,NAICS_2012_Code,92212,, +2287,BTS_TSA,GSLG,NAICS_2012_Code,922120,, +2288,BTS_TSA,GFGN,NAICS_2012_Code,922120,, +2289,BTS_TSA,GSLG,NAICS_2012_Code,92213,, +2290,BTS_TSA,GFGN,NAICS_2012_Code,92213,, +2291,BTS_TSA,GSLG,NAICS_2012_Code,922130,, +2292,BTS_TSA,GFGN,NAICS_2012_Code,922130,, +2293,BTS_TSA,GSLG,NAICS_2012_Code,92214,, +2294,BTS_TSA,GFE,NAICS_2012_Code,92214,, +2295,BTS_TSA,GSLE,NAICS_2012_Code,92214,, +2296,BTS_TSA,GFGN,NAICS_2012_Code,92214,, +2297,BTS_TSA,GSLG,NAICS_2012_Code,922140,, +2298,BTS_TSA,GFGN,NAICS_2012_Code,922140,, +2299,BTS_TSA,GSLG,NAICS_2012_Code,92215,, +2300,BTS_TSA,GFGN,NAICS_2012_Code,92215,, +2301,BTS_TSA,GSLG,NAICS_2012_Code,922150,, +2302,BTS_TSA,GFGN,NAICS_2012_Code,922150,, +2303,BTS_TSA,GSLG,NAICS_2012_Code,92216,, +2304,BTS_TSA,GSLE,NAICS_2012_Code,92216,, +2305,BTS_TSA,GSLG,NAICS_2012_Code,922160,, +2306,BTS_TSA,GFGN,NAICS_2012_Code,922160,, +2307,BTS_TSA,GSLG,NAICS_2012_Code,92219,, +2308,BTS_TSA,GFGN,NAICS_2012_Code,92219,, +2309,BTS_TSA,GSLG,NAICS_2012_Code,922190,, +2310,BTS_TSA,GFGN,NAICS_2012_Code,922190,, +2313,BTS_TSA,GSLG,NAICS_2012_Code,9231,, +2314,BTS_TSA,GFGN,NAICS_2012_Code,9231,, +2315,BTS_TSA,GSLG,NAICS_2012_Code,92311,, +2316,BTS_TSA,GFGN,NAICS_2012_Code,92311,, +2317,BTS_TSA,GSLG,NAICS_2012_Code,923110,, +2318,BTS_TSA,GFGN,NAICS_2012_Code,923110,, +2319,BTS_TSA,GSLG,NAICS_2012_Code,92312,, +2320,BTS_TSA,GFGN,NAICS_2012_Code,92312,, +2321,BTS_TSA,GSLG,NAICS_2012_Code,923120,, +2322,BTS_TSA,GFGN,NAICS_2012_Code,923120,, +2323,BTS_TSA,GSLG,NAICS_2012_Code,92313,, +2324,BTS_TSA,GFGN,NAICS_2012_Code,92313,, +2325,BTS_TSA,GSLG,NAICS_2012_Code,923130,, +2326,BTS_TSA,GFGN,NAICS_2012_Code,923130,, +2327,BTS_TSA,GFGN,NAICS_2012_Code,92314,, +2328,BTS_TSA,GFGN,NAICS_2012_Code,923140,, +2331,BTS_TSA,GSLG,NAICS_2012_Code,9241,, +2332,BTS_TSA,GFGN,NAICS_2012_Code,9241,, +2333,BTS_TSA,GSLG,NAICS_2012_Code,92411,, +2334,BTS_TSA,GFGN,NAICS_2012_Code,92411,, +2335,BTS_TSA,GSLG,NAICS_2012_Code,924110,, +2336,BTS_TSA,GFGN,NAICS_2012_Code,924110,, +2337,BTS_TSA,GSLG,NAICS_2012_Code,92412,, +2338,BTS_TSA,GFGN,NAICS_2012_Code,92412,, +2339,BTS_TSA,GSLG,NAICS_2012_Code,924120,, +2340,BTS_TSA,GFGN,NAICS_2012_Code,924120,, +2343,BTS_TSA,GSLG,NAICS_2012_Code,9251,, +2344,BTS_TSA,GFGN,NAICS_2012_Code,9251,, +2345,BTS_TSA,GSLG,NAICS_2012_Code,92511,, +2346,BTS_TSA,GFGN,NAICS_2012_Code,92511,, +2347,BTS_TSA,GSLG,NAICS_2012_Code,925110,, +2348,BTS_TSA,GFGN,NAICS_2012_Code,925110,, +2349,BTS_TSA,GSLG,NAICS_2012_Code,92512,, +2350,BTS_TSA,GFGN,NAICS_2012_Code,92512,, +2351,BTS_TSA,GSLG,NAICS_2012_Code,925120,, +2352,BTS_TSA,GFGN,NAICS_2012_Code,925120,, +2355,BTS_TSA,GSLG,NAICS_2012_Code,9261,, +2356,BTS_TSA,GFGN,NAICS_2012_Code,9261,, +2357,BTS_TSA,GSLG,NAICS_2012_Code,92611,, +2358,BTS_TSA,GFGN,NAICS_2012_Code,92611,, +2359,BTS_TSA,GSLG,NAICS_2012_Code,926110,, +2360,BTS_TSA,GFGN,NAICS_2012_Code,926110,, +2361,BTS_TSA,GFGN,NAICS_2012_Code,92612,, +2362,BTS_TSA,GSLG,NAICS_2012_Code,926120,, +2363,BTS_TSA,GSLG,NAICS_2012_Code,92613,, +2364,BTS_TSA,GFGN,NAICS_2012_Code,92613,, +2365,BTS_TSA,GSLG,NAICS_2012_Code,926130,, +2366,BTS_TSA,GFGN,NAICS_2012_Code,926130,, +2367,BTS_TSA,GSLG,NAICS_2012_Code,92614,, +2368,BTS_TSA,GFGN,NAICS_2012_Code,92614,, +2369,BTS_TSA,GSLG,NAICS_2012_Code,926140,, +2370,BTS_TSA,GFGN,NAICS_2012_Code,926140,, +2371,BTS_TSA,GSLG,NAICS_2012_Code,92615,, +2372,BTS_TSA,GFGN,NAICS_2012_Code,92615,, +2373,BTS_TSA,GSLG,NAICS_2012_Code,926150,, +2374,BTS_TSA,GFGN,NAICS_2012_Code,926150,, +2375,BTS_TSA,GFE,NAICS_2012_Code,927,, +2376,BTS_TSA,GFE,NAICS_2012_Code,9271,, +2377,BTS_TSA,GFE,NAICS_2012_Code,92711,, +2378,BTS_TSA,GFE,NAICS_2012_Code,927110,, +2381,BTS_TSA,GFGD,NAICS_2012_Code,9281,, +2382,BTS_TSA,GFGN,NAICS_2012_Code,9281,, +2383,BTS_TSA,GFGD,NAICS_2012_Code,92811,, +2384,BTS_TSA,GFGD,NAICS_2012_Code,928110,, +2385,BTS_TSA,GFGN,NAICS_2012_Code,92812,, +2386,BTS_TSA,GFGN,NAICS_2012_Code,928120,, +2387,BTS_TSA,F010,NAICS_2012_Code,F010,, +2388,BTS_TSA,F010,NAICS_2012_Code,F01000,, +2389,BTS_TSA,GFE,NAICS_2012_Code,S00101,, +2390,BTS_TSA,GSLE,NAICS_2012_Code,S00201,, +2391,BTS_TSA,GSLE,NAICS_2012_Code,S00202,, diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index 5b557b76b..262d05a29 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -99,482 +99,760 @@ source_names: # reassign_process_to_sectors: # - airplane_emissions - # EPA_GHGI_T_2_1: #U.S. GHG emissions - # <<: *ghgi_parameters - # activity_sets: - # direct_attribution: - # selection_fields: - # PrimaryActivity: - # - Iron and Steel Production & Metallurgical Coke Production #CO2, CH4 - # - Cement Production #CO2 - # - Lime Production #CO2 - # - Ammonia Production #CO2 - # - Incineration of Waste #CO2, #N2O - # - Aluminum Production #CO2 - # - Soda Ash Production #CO2 - # - Ferroalloy Production #CO2, CH4 - # - Titanium Dioxide Production #CO2 - # - Zinc Production #CO2 - # - Phosphoric Acid Production #CO2 - # - Glass Production #CO2 - # - Carbide Production and Consumption #CO2, CH4 - # - Landfills #CH4 - # - Coal Mining #CH4 - # - Wastewater Treatment #CH4, N2O - # - Rice Cultivation #CH4 - # - Abandoned Oil and Gas Wells #CH4 - # - Abandoned Underground Coal Mines #CH4 - # - Anaerobic Digestion at Biogas Facilities #CH4 new activity - # - Composting #CH4, N2O - # - Nitric Acid Production #N2O - # - Adipic Acid Production #N2O - # - Caprolactam, Glyoxal, and Glyoxylic Acid Production #CH4 - # - Electronics Industry #N2O - # FlowName: # HFCs and other flows are attributed elsewhere - # - CO2 - # - CH4 - # - N2O - # attribution_method: direct - - # electric_distribution: - # selection_fields: - # PrimaryActivity: Electrical Transmission and Distribution #SF6 - # FlowName: SF6 - # attribution_method: direct - - # liming: - # selection_fields: - # PrimaryActivity: Liming #CO2 - # attribution_method: proportional - # attribution_source: - # BEA_Use_Detail_PRO_BeforeRedef: - # <<: *bea_use - # selection_fields: - # ActivityProducedBy: '327400' - - # urea: - # selection_fields: - # PrimaryActivity: - # - Urea Fertilization #CO2 - # - Urea Consumption for Non-Agricultural Purposes #CO2 - # attribution_method: proportional - # attribution_source: - # BEA_Use_Detail_PRO_BeforeRedef: - # <<: *bea_use - # selection_fields: - # ActivityProducedBy: '325310' # Fertilizers - - # carbonate_use: - # selection_fields: - # PrimaryActivity: Other Process Uses of Carbonates #CO2 - # attribution_method: proportional - # attribution_source: - # BEA_Use_Detail_PRO_BeforeRedef: - # <<: *bea_use - # selection_fields: - # ActivityProducedBy: '325180' # Other Basic Inorganic Chemicals - - # lead_production: - # selection_fields: - # PrimaryActivity: Lead Production #CO2 - # attribution_method: proportional - # attribution_source: - # USGS_MYB_Lead: - # year: 2016 - # selection_fields: - # ActivityProducedBy: - # - Primary lead, refined content, domestic ores and base bullion - # - Secondary lead, lead content - - # nitrous_oxide_use: - # selection_fields: - # PrimaryActivity: N2O from Product Uses #N2O - # attribution_method: proportional - # attribution_source: - # BEA_Use_Detail_PRO_BeforeRedef: - # <<: *bea_use - # selection_fields: - # ActivityProducedBy: '325120' # Industrial gases - -# ## Stationary Combustion for Electric Power -# EPA_GHGI_T_3_7: &stationary_electric # CO2 emissions from stationary combustion (electricity only) -# <<: *ghgi_parameters -# selection_fields: -# PrimaryActivity: -# - Coal Electric Power -# - Natural Gas Electric Power -# - Natural gas Electric Power # note lower case -# - Fuel Oil Electric Power -# - Geothermal Electric Power -# - Wood Electric Power -# activity_to_sector_mapping: EPA_GHGI_m2 -# attribution_method: direct -# EPA_GHGI_T_3_8: *stationary_electric # CH4 emissions from stationary combustion -# EPA_GHGI_T_3_9: *stationary_electric # N2O emissions from stationary combustion - -# ## Fossil Fuels -# EPA_GHGI_T_3_63: &natgas #CH4 from Natural Gas Systems -# <<: *ghgi_parameters -# selection_fields: -# PrimaryActivity: -# - Distribution -# - Exploration -# - Processing -# - Production -# - Transmission and Storage -# attribution_method: direct -# EPA_GHGI_T_3_65: *natgas #CO2 from Natural Gas Systems mimics CH4 -# EPA_GHGI_T_3_67: *natgas #N2O from Natural Gas Systems, not used in original method, mimics CH4 - -# EPA_GHGI_T_3_38: &petroleum #CH4 from Petroleum Systems -# <<: *ghgi_parameters -# selection_fields: -# PrimaryActivity: -# - Crude Oil Transportation -# - Exploration -# - Production -# - Refining -# attribution_method: direct -# EPA_GHGI_T_3_40: *petroleum #CO2 from Petroleum Systems mimics CH4 -# EPA_GHGI_T_3_42: *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 - -# ## Agriculture -# EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues -# <<: *ghgi_parameters -# attribution_method: direct -# selection_fields: -# PrimaryActivity: -# - Chickpeas -# - Cotton -# - Maize -# - Rice -# - Soybeans -# - Wheat - -# EPA_GHGI_T_5_3: &animals #CH4 from Enteric Fermentation -# <<: *ghgi_parameters -# attribution_method: direct -# selection_fields: -# PrimaryActivity: -# - American Bison -# - Beef Cattle -# - Dairy Cattle -# - Goats -# - Horses -# - Mules and Asses -# - Sheep -# - Swine -# - Poultry -# EPA_GHGI_T_5_7: *animals #CH4 and N2O from manure, mimics enteric fermentation - -# EPA_GHGI_T_5_18: #Direct N2O emissions from agricultural soils -# <<: *ghgi_parameters -# activity_sets: -# fertilizer_use: &fertilizer # allocated based on fertilizer use -# selection_fields: -# PrimaryActivity: -# - Organic Amendment Cropland -# - Residue N Cropland -# - Synthetic Fertilizer Cropland -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea_use -# selection_fields: -# ActivityProducedBy: -# - '325310' -# cropland: -# selection_fields: -# PrimaryActivity: -# - Mineralization and Asymbiotic Fixation Cropland -# - Drained Organic Soils Cropland -# attribution_method: proportional -# attribution_source: -# USDA_CoA_Cropland: -# <<: *usda_cropland -# pasture: &pasture -# selection_fields: -# PrimaryActivity: -# - All activities Grassland -# attribution_method: proportional -# attribution_source: -# USDA_CoA_Cropland_NAICS: -# <<: *usda_pasture -# EPA_GHGI_T_5_19: #Indirect N2O emissions from agricultural soils -# <<: *ghgi_parameters -# activity_sets: -# fertilizer_use: # allocated based on fertilizer use -# <<: *fertilizer -# selection_fields: -# PrimaryActivity: -# - Volatilization & Atm. Deposition Cropland -# - Surface Leaching & Run-Off Cropland -# pasture: -# <<: *pasture - -# ## Mobile Sources (N20 and CH4) - # EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion - # <<: *ghgi_parameters - # activity_sets: - # direct_attribution: # Some of these need to be separated and attributed differently - # selection_fields: - # PrimaryActivity: - # - Passenger Cars Gasoline On-Road - # - Rail Non-Road - # - Ships and Boats Non-Road - # - Aircraft Non-Road - # attribution_method: direct - - # trucking: - # selection_fields: - # PrimaryActivity: - # - Light-Duty Trucks Gasoline On-Road - # - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road - # activity_to_sector_mapping: EPA_GHGI_trucking - # attribution_method: proportional - # attribution_source: - # BTS_TSA: - # <<: *tsa_trucking - - # construction_and_mining: - # selection_fields: - # PrimaryActivity: Construction/Mining Equipment Non-Road - # attribution_method: proportional - # attribution_source: - # BEA_Use_Detail_PRO_BeforeRedef: - # <<: *bea_use - # selection_fields: - # ActivityProducedBy: '333120' # purchases of construction/mining equipment - - # farm_non_road: - # selection_fields: - # PrimaryActivity: Agricultural Equipment Non-Road - # attribution_method: proportional - # attribution_source: - # BEA_Use_Detail_PRO_BeforeRedef: - # <<: *bea_use - # selection_fields: - # ActivityProducedBy: '333111' # purchases of farm machinery - - # other_non_road: # attributed by purchases of petroleum refinery products - # selection_fields: - # PrimaryActivity: Other Non-Road - # attribution_method: proportional - # attribution_source: - # BEA_Use_Detail_PRO_BeforeRedef: - # <<: *bea_use - # selection_fields: - # ActivityProducedBy: '324110' # purchases of refinery products - - # alt_fuel_on_road: # assumes natural gas is primary alternate fuel - # selection_fields: - # PrimaryActivity: - # - Alternative Fuel On-Road - # - All activities Alternative Fuel On-Road - # attribution_method: proportional - # attribution_source: - # BEA_Use_Detail_PRO_BeforeRedef: - # <<: *bea_use - # selection_fields: - # ActivityProducedBy: '221200' # purchases of natural gas - - # EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 - -## Major CO2 Sources - # EPA_GHGI_T_A_13: # (2017 specific table) CO2 emissions from stationary combustion and transportation - # <<: *ghgi_parameters - # clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion - # activity_sets: - # direct_attribution: - # selection_fields: - # PrimaryActivity: Total (All Fuels) Residential - # attribution_method: direct - # non-manufacturing_coal: - # selection_fields: - # PrimaryActivity: - # - Commercial Coal Commercial - # - Industrial Other Coal Industrial - # attribution_method: proportional - # attribution_source: - # BEA_Use_Detail_PRO_BeforeRedef: - # <<: *bea_use - # selection_fields: - # ActivityProducedBy: '212100' # purchases of coal - # non-manufacturing_natural_gas: - # selection_fields: - # PrimaryActivity: - # - Natural Gas Commercial - # - Natural Gas Industrial - # attribution_method: proportional - # attribution_source: - # BEA_Use_Detail_PRO_BeforeRedef: - # <<: *bea_use - # selection_fields: - # ActivityProducedBy: '221200' # purchases of natural gas - # non-manufacturing_petroleum: - # selection_fields: - # PrimaryActivity: - # - Total Petroleum Commercial - # - Total Petroleum Industrial - # attribution_method: proportional - # attribution_source: - # BEA_Use_Detail_PRO_BeforeRedef: - # <<: *bea_use - # selection_fields: - # ActivityProducedBy: '324110' # purchases of refinery products - # manufacturing_coal: # Industrial Coal for Manufacturing - # selection_fields: - # PrimaryActivity: - # - Industrial Other Coal Industrial - Manufacturing - # attribution_method: proportional - # attribution_source: - # EIA_MECS_Energy: - # <<: *mecs_energy - # selection_fields: - # <<: *mecs_energy_default_selection - # FlowName: Coal - # manufacturing_natural_gas: # Industrial Natural Gas for manufacturing - # selection_fields: - # PrimaryActivity: - # - Natural Gas Industrial - Manufacturing - # attribution_method: proportional - # attribution_source: - # EIA_MECS_Energy: - # <<: *mecs_energy - # selection_fields: - # <<: *mecs_energy_default_selection - # FlowName: Natural Gas - - ### Transportation - # natural_gas_transportation: - # selection_fields: - # PrimaryActivity: Natural Gas Transportation - # attribution_method: proportional - # attribution_source: - # EPA_GHGI_T_A_79: - # <<: *t_a_79 - # selection_fields: - # FlowName: Natural Gas - - # aviation_gas_transportation: - # selection_fields: - # PrimaryActivity: Aviation Gasoline Transportation - # attribution_method: proportional - # attribution_source: - # EPA_GHGI_T_A_79: - # <<: *t_a_79 - # selection_fields: - # FlowName: Aviation Gasoline - - # jet_fuel_transportation: - # selection_fields: - # PrimaryActivity: Jet Fuel Transportation - # attribution_method: proportional - # attribution_source: - # EPA_GHGI_T_A_79: - # <<: *t_a_79 - # selection_fields: - # FlowName: Jet Fuel - - # propane_transportation: - # selection_fields: - # PrimaryActivity: LPG (Propane) Transportation - # attribution_method: proportional - # attribution_source: - # EPA_GHGI_T_A_79: - # <<: *t_a_79 - # selection_fields: - # FlowName: LPG - - # residual_fuel_transportation: - # selection_fields: - # PrimaryActivity: Residual Fuel Transportation - # attribution_method: proportional - # attribution_source: - # EPA_GHGI_T_A_79: - # <<: *t_a_79 - # selection_fields: - # FlowName: Residual Fuel Oil - - # distillate_fuel_transportation: - # selection_fields: - # PrimaryActivity: - # - Distillate Fuel Oil Transportation - # activity_to_sector_mapping: EPA_GHGI_trucking - # attribution_method: proportional - # attribution_source: - # EPA_GHGI_T_A_79: - # <<: *t_a_79 - # activity_to_sector_mapping: EPA_GHGI - # activity_sets: - # direct_attribution: - # selection_fields: - # FlowName: Distillate Fuel Oil (Diesel Fuel) - # PrimaryActivity: - # - Passenger Cars - # - Rail - # - Recreational Boats - # - Ships and Non-Recreational Boats - # attribution_method: direct - # trucking: - # selection_fields: - # FlowName: Distillate Fuel Oil (Diesel Fuel) - # PrimaryActivity: - # - Light-Duty Trucks - # - Medium- and Heavy-Duty Trucks - # activity_to_sector_mapping: EPA_GHGI_trucking - # attribution_method: proportional - # attribution_source: - # BTS_TSA: - # <<: *tsa_trucking - # buses: - # selection_fields: - # FlowName: Distillate Fuel Oil (Diesel Fuel) - # PrimaryActivity: Buses - # attribution_method: proportional - # attribution_source: - # BEA_Use_Detail_PRO_BeforeRedef: - # <<: *bea_use - # selection_fields: - # ActivityProducedBy: '324110' # use of petroleum products - - # motor_gasoline_transportation: - # selection_fields: - # PrimaryActivity: - # - Motor Gasoline Transportation - # activity_to_sector_mapping: EPA_GHGI_trucking - # attribution_method: proportional - # attribution_source: - # EPA_GHGI_T_A_79: - # <<: *t_a_79 - # activity_to_sector_mapping: EPA_GHGI - # activity_sets: - # direct_attribution: - # selection_fields: - # FlowName: Motor Gasoline - # PrimaryActivity: - # - Passenger Cars - # - Motorcycles - # - Recreational Boats - # attribution_method: direct - # trucking: - # selection_fields: - # FlowName: Motor Gasoline - # PrimaryActivity: - # - Light-Duty Trucks - # - Medium- and Heavy-Duty Trucks - # activity_to_sector_mapping: EPA_GHGI_trucking - # attribution_method: proportional - # attribution_source: - # BTS_TSA: - # <<: *tsa_trucking - # buses: - # selection_fields: - # FlowName: Motor Gasoline - # PrimaryActivity: Buses - # attribution_method: proportional - # attribution_source: - # BEA_Use_Detail_PRO_BeforeRedef: - # <<: *bea_use - # selection_fields: - # ActivityProducedBy: '324110' # use of petroleum products + EPA_GHGI_T_2_1: #U.S. GHG emissions + <<: *ghgi_parameters + activity_sets: + direct_attribution: + selection_fields: + PrimaryActivity: + - Iron and Steel Production & Metallurgical Coke Production #CO2, CH4 + - Cement Production #CO2 + - Lime Production #CO2 + - Ammonia Production #CO2 + - Incineration of Waste #CO2, #N2O + - Aluminum Production #CO2 + - Soda Ash Production #CO2 + - Ferroalloy Production #CO2, CH4 + - Titanium Dioxide Production #CO2 + - Zinc Production #CO2 + - Phosphoric Acid Production #CO2 + - Glass Production #CO2 + - Carbide Production and Consumption #CO2, CH4 + - Landfills #CH4 + - Coal Mining #CH4 + - Wastewater Treatment #CH4, N2O + - Rice Cultivation #CH4 + - Abandoned Oil and Gas Wells #CH4 + - Abandoned Underground Coal Mines #CH4 + - Anaerobic Digestion at Biogas Facilities #CH4 new activity + - Composting #CH4, N2O + - Nitric Acid Production #N2O + - Adipic Acid Production #N2O + - Caprolactam, Glyoxal, and Glyoxylic Acid Production #CH4 + - Electronics Industry #N2O + FlowName: # HFCs and other flows are attributed elsewhere + - CO2 + - CH4 + - N2O + attribution_method: direct + + electric_distribution: + selection_fields: + PrimaryActivity: Electrical Transmission and Distribution #SF6 + FlowName: SF6 + attribution_method: direct + + liming: + selection_fields: + PrimaryActivity: Liming #CO2 + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '327400' + + urea: + selection_fields: + PrimaryActivity: + - Urea Fertilization #CO2 + - Urea Consumption for Non-Agricultural Purposes #CO2 + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '325310' # Fertilizers + + carbonate_use: + selection_fields: + PrimaryActivity: Other Process Uses of Carbonates #CO2 + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '325180' # Other Basic Inorganic Chemicals + + lead_production: + selection_fields: + PrimaryActivity: Lead Production #CO2 + attribution_method: proportional + attribution_source: + USGS_MYB_Lead: + year: 2016 + selection_fields: + ActivityProducedBy: + - Primary lead, refined content, domestic ores and base bullion + - Secondary lead, lead content + + nitrous_oxide_use: + selection_fields: + PrimaryActivity: N2O from Product Uses #N2O + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '325120' # Industrial gases + +## Fossil Fuels + EPA_GHGI_T_3_63: &natgas #CH4 from Natural Gas Systems + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: + - Distribution + - Exploration + - Processing + - Production + - Transmission and Storage + attribution_method: direct + EPA_GHGI_T_3_65: *natgas #CO2 from Natural Gas Systems mimics CH4 + EPA_GHGI_T_3_67: *natgas #N2O from Natural Gas Systems, not used in original method, mimics CH4 + + EPA_GHGI_T_3_38: &petroleum #CH4 from Petroleum Systems + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: + - Crude Oil Transportation + - Exploration + - Production + - Refining + attribution_method: direct + EPA_GHGI_T_3_40: *petroleum #CO2 from Petroleum Systems mimics CH4 + EPA_GHGI_T_3_42: *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 + +## Stationary Combustion (note that CO2 is electric power only) + EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion + <<: *ghgi_parameters + clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion + activity_sets: + direct_attribution: + selection_fields: + PrimaryActivity: + - Fuel Oil Residential + - Coal Residential + - Natural Gas Residential + - Wood Residential + attribution_method: direct + electric_power: &stationary_electric + selection_fields: + PrimaryActivity: + - Coal Electric Power + - Natural Gas Electric Power + - Natural gas Electric Power # note lower case + - Fuel Oil Electric Power + - Geothermal Electric Power + - Wood Electric Power + activity_to_sector_mapping: EPA_GHGI_m2 + attribution_method: direct + fuel_oil: + selection_fields: + PrimaryActivity: + - Fuel Oil Commercial + - Fuel Oil Industrial + attribution_methods: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # purchases of refinery products + natural_gas: + selection_fields: + PrimaryActivity: + - Natural gas Commercial + - Natural gas Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '221200' # purchases of natural gas + coal: + selection_fields: + PrimaryActivity: Coal Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '212100' # purchases of coal + coal_manufacturing: + selection_fields: + PrimaryActivity: Coal Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Coal + natural_gas_manufacturing: + selection_fields: + PrimaryActivity: Natural gas Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Natural Gas + EPA_GHGI_T_3_9: # N2O emissions from stationary combustion + <<: *stationary_combustion + EPA_GHGI_T_3_7: # CO2 emissions from stationary combustion (electricity only) + <<: [*ghgi_parameters, *stationary_electric] + +## Agriculture + EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues + <<: *ghgi_parameters + attribution_method: direct + selection_fields: + PrimaryActivity: + - Chickpeas + - Cotton + - Maize + - Rice + - Soybeans + - Wheat + + EPA_GHGI_T_5_3: &animals #CH4 from Enteric Fermentation + <<: *ghgi_parameters + attribution_method: direct + selection_fields: + PrimaryActivity: + - American Bison + - Beef Cattle + - Dairy Cattle + - Goats + - Horses + - Mules and Asses + - Sheep + - Swine + - Poultry + EPA_GHGI_T_5_7: *animals #CH4 and N2O from manure, mimics enteric fermentation + + EPA_GHGI_T_5_18: #Direct N2O emissions from agricultural soils + <<: *ghgi_parameters + activity_sets: + fertilizer_use: &fertilizer # allocated based on fertilizer use + selection_fields: + PrimaryActivity: + - Organic Amendment Cropland + - Residue N Cropland + - Synthetic Fertilizer Cropland + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: + - '325310' + cropland: + selection_fields: + PrimaryActivity: + - Mineralization and Asymbiotic Fixation Cropland + - Drained Organic Soils Cropland + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland: + <<: *usda_cropland + pasture: &pasture + selection_fields: + PrimaryActivity: + - All activities Grassland + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + <<: *usda_pasture + EPA_GHGI_T_5_19: #Indirect N2O emissions from agricultural soils + <<: *ghgi_parameters + activity_sets: + fertilizer_use: # allocated based on fertilizer use + <<: *fertilizer + selection_fields: + PrimaryActivity: + - Volatilization & Atm. Deposition Cropland + - Surface Leaching & Run-Off Cropland + pasture: + <<: *pasture + +## Mobile Sources (N20 and CH4) + EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion + <<: *ghgi_parameters + activity_sets: + direct_attribution: # Some of these need to be separated and attributed differently + selection_fields: + PrimaryActivity: + - Passenger Cars Gasoline On-Road + - Rail Non-Road + - Ships and Boats Non-Road + - Aircraft Non-Road + attribution_method: direct + + trucking: + selection_fields: + PrimaryActivity: + - Light-Duty Trucks Gasoline On-Road + - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: + BTS_TSA: + <<: *tsa_trucking + + construction_and_mining: + selection_fields: + PrimaryActivity: Construction/Mining Equipment Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333120' # purchases of construction/mining equipment + + farm_non_road: + selection_fields: + PrimaryActivity: Agricultural Equipment Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333111' # purchases of farm machinery + + other_non_road: # attributed by purchases of petroleum refinery products + selection_fields: + PrimaryActivity: Other Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # purchases of refinery products + + alt_fuel_on_road: # assumes natural gas is primary alternate fuel + selection_fields: + PrimaryActivity: + - Alternative Fuel On-Road + - All activities Alternative Fuel On-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '221200' # purchases of natural gas + EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 + +# Major CO2 Sources + EPA_GHGI_T_A_13: # (2017 specific table) CO2 emissions from stationary combustion and transportation + <<: *ghgi_parameters + clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion + activity_sets: + direct_attribution: + selection_fields: + PrimaryActivity: Total (All Fuels) Residential + attribution_method: direct + non-manufacturing_coal: + selection_fields: + PrimaryActivity: + - Commercial Coal Commercial + - Industrial Other Coal Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '212100' # purchases of coal + non-manufacturing_natural_gas: + selection_fields: + PrimaryActivity: + - Natural Gas Commercial + - Natural Gas Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '221200' # purchases of natural gas + non-manufacturing_petroleum: + selection_fields: + PrimaryActivity: + - Total Petroleum Commercial + - Total Petroleum Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # purchases of refinery products + manufacturing_coal: # Industrial Coal for Manufacturing + selection_fields: + PrimaryActivity: + - Industrial Other Coal Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Coal + manufacturing_natural_gas: # Industrial Natural Gas for manufacturing + selection_fields: + PrimaryActivity: + - Natural Gas Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Natural Gas + + ## Transportation + natural_gas_transportation: + selection_fields: + PrimaryActivity: Natural Gas Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + selection_fields: + FlowName: Natural Gas + + aviation_gas_transportation: + selection_fields: + PrimaryActivity: Aviation Gasoline Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + selection_fields: + FlowName: Aviation Gasoline + + jet_fuel_transportation: + selection_fields: + PrimaryActivity: Jet Fuel Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + selection_fields: + FlowName: Jet Fuel + + propane_transportation: + selection_fields: + PrimaryActivity: LPG (Propane) Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + selection_fields: + FlowName: LPG + + residual_fuel_transportation: + selection_fields: + PrimaryActivity: Residual Fuel Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + selection_fields: + FlowName: Residual Fuel Oil + + distillate_fuel_transportation: + selection_fields: + PrimaryActivity: + - Distillate Fuel Oil Transportation + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + activity_to_sector_mapping: EPA_GHGI + activity_sets: + direct_attribution: + selection_fields: + FlowName: Distillate Fuel Oil (Diesel Fuel) + PrimaryActivity: + - Passenger Cars + - Rail + - Recreational Boats + - Ships and Non-Recreational Boats + attribution_method: direct + trucking: + selection_fields: + FlowName: Distillate Fuel Oil (Diesel Fuel) + PrimaryActivity: + - Light-Duty Trucks + - Medium- and Heavy-Duty Trucks + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: + BTS_TSA: + <<: *tsa_trucking + buses: + selection_fields: + FlowName: Distillate Fuel Oil (Diesel Fuel) + PrimaryActivity: Buses + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # use of petroleum products + + motor_gasoline_transportation: + selection_fields: + PrimaryActivity: + - Motor Gasoline Transportation + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + activity_to_sector_mapping: EPA_GHGI + activity_sets: + direct_attribution: + selection_fields: + FlowName: Motor Gasoline + PrimaryActivity: + - Passenger Cars + - Motorcycles + - Recreational Boats + attribution_method: direct + trucking: + selection_fields: + FlowName: Motor Gasoline + PrimaryActivity: + - Light-Duty Trucks + - Medium- and Heavy-Duty Trucks + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: + BTS_TSA: + <<: *tsa_trucking + buses: + selection_fields: + FlowName: Motor Gasoline + PrimaryActivity: Buses + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # use of petroleum products + +## Other sources + EPA_GHGI_T_4_46: #CO2 for selected petrochemicals + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: + - Acrylonitrile + - Carbon Black + - Ethylene + - Ethylene Dichloride + - Ethylene Oxide + - Methanol + attribution_method: direct + + EPA_GHGI_T_3_22b: #Fossil fuel for non-energy uses + <<: *ghgi_parameters + activity_sets: + coal: + selection_fields: + PrimaryActivity: + - Industry Industrial Coking Coal + - Industry Industrial Other Coal + attribution_method: direct + + distillate_fuel_feedstocks: + selection_fields: + PrimaryActivity: Industry Distillate Fuel Oil + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: Distillate Fuel Oil + + hgl_feedstocks: + selection_fields: + PrimaryActivity: + - Industry LPG + - Industry Pentanes Plus + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: Hydrocarbon Gas Liquids, excluding natural gasoline + + petroleum_coke_feedstocks: + selection_fields: + PrimaryActivity: Industry Petroleum Coke + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: Coke and Breeze + + natural_gas_feedstocks: + selection_fields: + PrimaryActivity: + - Industry Still Gas + - Industry Natural Gas to Chemical Plants + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: Natural Gas + + other_petroleum_feedstocks: + selection_fields: + PrimaryActivity: + - Industry Asphalt & Road Oil + - Industry Lubricants + - Industry Miscellaneous Products + - Industry Naphtha (<401 F) + - Industry Other Oil (>401 F) + - Industry Special Naphtha + - Industry Waxes + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: Other + + transportation_lubricants: + selection_fields: + PrimaryActivity: Transportation Lubricants + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # use of petroleum products + + EPA_GHGI_T_4_50: # HFCs from HCFC-22 production + <<: *ghgi_parameters + selection_fields: + Unit: MMT CO2e + PrimaryActivity: HCFC-22 Production + attribution_method: direct + + EPA_GHGI_T_4_94: # HFCs and other emissions from electronics manufacture + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: Electronics Production + attribution_method: direct + + EPA_GHGI_T_4_101: # HFCs and PFCs from ODS Substitutes + <<: *ghgi_parameters + clean_fba_before_activity_sets: !script_function:temp_data_source_functions clean_hfc_fba # removes HFCs from transportation + activity_sets: + household_refrigeration: + selection_fields: + PrimaryActivity: Refrigeration/Air Conditioning - Households + attribution_method: direct + + non-household_refrigeration: + selection_fields: + PrimaryActivity: Refrigeration/Air Conditioning + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333415' # Air conditioning equipment + + polystyrene_foam: + selection_fields: + PrimaryActivity: Foams - Polystyrene + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '326140' # Polystyrene foam + + urethane_foam: + selection_fields: + PrimaryActivity: Foams - Urethane + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '326150' # Urethane and other foams. + + EPA_GHGI_T_A_103: # HFCs from Transportation + <<: *ghgi_parameters + clean_fba_before_activity_sets: !script_function:temp_data_source_functions split_hfcs_by_type + activity_sets: + passenger_cars: + selection_fields: + PrimaryActivity: Passenger Cars + attribution_method: direct + trucking: + selection_fields: + PrimaryActivity: + - Light-Duty Trucks + - Heavy-Duty Vehicles + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: + BTS_TSA: + <<: *tsa_trucking + refrigerated_trucks: + selection_fields: + PrimaryActivity: Medium- and Heavy-Duty Trucks + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333415' # purchases of refrigeration equipment + other_cooling: + selection_fields: + PrimaryActivity: + - School and Tour Buses + - Transit Buses + - Rail + - Ships and Boats + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333415' # purchases of refrigeration equipment + + EPA_GHGI_T_4_80: # PFCs from aluminum production + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: Aluminum Production + attribution_method: direct + + EPA_GHGI_T_4_84: # HFCs, SF6, CO2 from magnesium production + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: Magnesium Production and Processing + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: T008 # Gross output. From a9293465906f886834d0e153ff41a5d259ec8aa1 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 29 Jun 2022 16:09:15 -0400 Subject: [PATCH 0135/1127] Enable chaining add_full_name into activity sets, for better log warnings --- flowsa/flowby.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 3d86b7c9b..a4a199be4 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -518,6 +518,11 @@ def _identify_secondary(row: _FlowBySeries) -> str: return fb + def add_full_name(self: FB, full_name: str) -> FB: + fb = self.copy() + fb.full_name = full_name + return fb + class FlowByActivity(_FlowBy): _metadata = [*_FlowBy()._metadata] @@ -1289,10 +1294,15 @@ def activity_sets(self) -> List['FlowByActivity']: assigned_rows = set() for activity_set, activity_config in activities.items(): log.info('Creating FlowByActivity for %s', activity_set) - child_fba = parent_fba.select_by_fields( - selection_fields=activity_config['selection_fields'] + + child_fba = ( + parent_fba + .add_full_name( + f'{parent_fba.full_name}{NAME_SEP_CHAR}{activity_set}') + .select_by_fields( + selection_fields=activity_config['selection_fields']) ) - child_fba.full_name += f'{NAME_SEP_CHAR}{activity_set}' + child_fba.config = {**parent_config, **activity_config} child_fba = child_fba.assign(SourceName=child_fba.full_name) From 357a14a597922e274730629fb13a8ec1b38b89b2 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 29 Jun 2022 16:56:28 -0400 Subject: [PATCH 0136/1127] Added data_format to BTS_TSA and EPA_GHGI --- flowsa/data/source_catalog.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 1e51671fa..b40c92f3f 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -49,6 +49,7 @@ BLS_QCEW: activity_schema: NAICS_2012_Code sector_aggregation_level: "disaggregated" BTS_TSA: + data_format: FBA sector-like_activities: False CalRecycle_WasteCharacterization: class: @@ -116,6 +117,7 @@ EPA_CDDPath: activity_schema: sector_aggregation_level: "aggregated" EPA_GHGI: + data_format: FBA class: - Chemicals - Energy From 75a0a5a9993fcdefa9aaf0c44e434f29783ddea9 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 30 Jun 2022 08:34:02 -0400 Subject: [PATCH 0137/1127] Switched to MT CO2e instead of MMT Co2e --- flowsa/data/unit_conversion.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/data/unit_conversion.csv b/flowsa/data/unit_conversion.csv index b5ea767cc..7a813cd14 100644 --- a/flowsa/data/unit_conversion.csv +++ b/flowsa/data/unit_conversion.csv @@ -16,5 +16,5 @@ gal/USD,kg/USD,3.79 Quadrillion Btu,MJ,1.05506E+12 Trillion Btu,MJ,1055055900 Tbtu,MJ,1055055900 -MT CO2e,MMT CO2e,0.000001 +MMT CO2e,MT CO2e,1000000 p,employees,1 From 7f4ad31c28db7e48a3315aa31fa83a4879fd54c1 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 30 Jun 2022 08:43:49 -0400 Subject: [PATCH 0138/1127] Shifted data_type flag to source_catalog, and commented out proportional-flagged attribution (should really be handled otherwise) --- flowsa/flowby.py | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index a4a199be4..c6a1b55cc 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -884,18 +884,18 @@ def attribute_flows_to_sectors( **config} ).convert_to_fbs() ) - elif attribution_method == 'proportional-flagged': - (source, config), = fba.config['attribution_source'].items() - attributed_fba = fba.flagged_proportionally_attribute( - FlowByActivity.getFlowByActivity( - full_name=source, - config={**{k: v for k, v in fba.config.items() - if k in fba.config['method_config_keys'] - or k == 'method_config_keys'}, - **get_catalog_info(source), - **config} - ).convert_to_fbs() - ) + # elif attribution_method == 'proportional-flagged': + # (source, config), = fba.config['attribution_source'].items() + # attributed_fba = fba.flagged_proportionally_attribute( + # FlowByActivity.getFlowByActivity( + # full_name=source, + # config={**{k: v for k, v in fba.config.items() + # if k in fba.config['method_config_keys'] + # or k == 'method_config_keys'}, + # **get_catalog_info(source), + # **config} + # ).convert_to_fbs() + # ) else: if (attribution_method is not None and attribution_method != 'direct'): @@ -1239,8 +1239,8 @@ def proportionally_attribute( .reset_index(drop=True) ) - def flagged_proportionally_attribute(self: 'FlowByActivity'): - raise NotImplementedError + # def flagged_proportionally_attribute(self: 'FlowByActivity'): + # raise NotImplementedError def convert_to_fbs(self: 'FlowByActivity') -> 'FlowBySector': if 'activity_sets' in self.config: @@ -1458,7 +1458,7 @@ def generateFlowBySector( ) .convert_to_fbs() for source_name, config in sources.items() - if config['data_format'] == 'FBA' + if get_catalog_info(source_name)['data_format'] == 'FBA' ] source_fbs_list = [ FlowBySector.getFlowBySector( @@ -1478,7 +1478,7 @@ def generateFlowBySector( .select_by_fields() .convert_fips_to_geoscale(method_config['geoscale']) for source_name, config in sources.items() - if config['data_format'] == 'FBS' + if get_catalog_info(source_name)['data_format'] == 'FBS' ] source_external_fbs_list = [ FlowBySector( @@ -1492,7 +1492,8 @@ def generateFlowBySector( .select_by_fields() .convert_fips_to_geoscale(method_config['geoscale']) for source_name, config in sources.items() - if config['data_format'] == 'FBS_outside_flowsa' + if get_catalog_info(source_name)['data_format'] + == 'FBS_outside_flowsa' ] fbs = pd.concat([ From 1809f8e46043bb0164d46607f0c45f97f2909fe3 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 30 Jun 2022 10:48:02 -0400 Subject: [PATCH 0139/1127] Added get_flowby_from_config and prepare_fbs, refactored generate_FBS to use those --- flowsa/flowby.py | 104 ++++++++++++++++++++++++----------------------- 1 file changed, 53 insertions(+), 51 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index c6a1b55cc..d8079dbc6 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -27,6 +27,42 @@ def get_catalog_info(source_name: str) -> dict: return source_catalog.get(source_name, {}) +# TODO: Should this be in the flowsa __init__.py? +def get_flowby_from_config( + name: str, + config: dict, + external_config_path: str = None, + download_sources_ok: bool = True +) -> FB: + if config['data_format'] == 'FBA': + return FlowByActivity.getFlowByActivity( + full_name=name, + config=config, + download_ok=download_sources_ok + ) + elif config['data_format'] == 'FBS': + return FlowBySector.getFlowBySector( + method=name, + full_name=name, + config=config, + external_config_path=external_config_path, + download_sources_ok=download_sources_ok, + download_fbs_ok=download_sources_ok + ) + elif config['data_format'] == 'FBS_outside_flowsa': + return FlowBySector( + config['FBS_datapull_fxn']( + config, config, external_config_path + ), + full_name=name, + config=config + ) + else: + log.critical('Unrecognized data format %s for source %s', + config['data_format'], name) + raise ValueError('Unrecognized data format') + + class _FlowBy(pd.DataFrame): _metadata = ['full_name', 'config'] @@ -188,7 +224,7 @@ def _getFlowBy( '%s %s could not be found locally, downloaded, or generated', file_metadata.name_data, file_metadata.category ) - fb = cls(df, full_name=full_name, config=config or {}) + fb = cls(df, full_name=full_name or '', config=config or {}) return fb def standardize_units(self: FB) -> FB: @@ -609,7 +645,7 @@ def getFlowByActivity( flowby_generator=flowby_generator, output_path=settings.fbaoutputpath, full_name=full_name, - config=config or {} + config=config ) # TODO: probably only slight modification is needed to allow for material @@ -882,7 +918,7 @@ def attribute_flows_to_sectors( or k == 'method_config_keys'}, **get_catalog_info(source), **config} - ).convert_to_fbs() + ).prepare_fbs() ) # elif attribution_method == 'proportional-flagged': # (source, config), = fba.config['attribution_source'].items() @@ -1242,11 +1278,11 @@ def proportionally_attribute( # def flagged_proportionally_attribute(self: 'FlowByActivity'): # raise NotImplementedError - def convert_to_fbs(self: 'FlowByActivity') -> 'FlowBySector': + def prepare_fbs(self: 'FlowByActivity') -> 'FlowBySector': if 'activity_sets' in self.config: return ( pd.concat([ - fba.convert_to_fbs() + fba.prepare_fbs() for fba in ( self .function_socket('clean_fba_before_activity_sets') @@ -1445,24 +1481,8 @@ def generateFlowBySector( external_config_path) sources = method_config.pop('source_names') - source_fba_list = [ - FlowByActivity.getFlowByActivity( - full_name=source_name, - config={ - **method_config, - 'method_config_keys': method_config.keys(), - **get_catalog_info(source_name), - **config - }, - download_ok=download_sources_ok - ) - .convert_to_fbs() - for source_name, config in sources.items() - if get_catalog_info(source_name)['data_format'] == 'FBA' - ] - source_fbs_list = [ - FlowBySector.getFlowBySector( - method=source_name, + fbs = pd.concat([ + get_flowby_from_config( name=source_name, config={ **method_config, @@ -1471,39 +1491,21 @@ def generateFlowBySector( **config }, external_config_path=external_config_path, - download_sources_ok=download_sources_ok, - download_fbs_ok=download_sources_ok, - ) - .function_socket('clean_fbs_df_fxn') - .select_by_fields() - .convert_fips_to_geoscale(method_config['geoscale']) - for source_name, config in sources.items() - if get_catalog_info(source_name)['data_format'] == 'FBS' - ] - source_external_fbs_list = [ - FlowBySector( - config['FBS_datapull_fxn']( - config, method_config, external_config_path - ), - full_name=source_name, - config=config - ) - .function_socket('clean_fbs_df_fxn') - .select_by_fields() - .convert_fips_to_geoscale(method_config['geoscale']) + download_sources_ok=download_sources_ok + ).prepare_fbs() for source_name, config in sources.items() - if get_catalog_info(source_name)['data_format'] - == 'FBS_outside_flowsa' - ] - - fbs = pd.concat([ - *source_fba_list, - *source_fbs_list, - *source_external_fbs_list ]) return fbs + def prepare_fbs(self: 'FlowBySector') -> 'FlowBySector': + return ( + self + .function_socket('clean_fbs_df_fxn') + .select_by_fields() + .convert_fips_to_geoscale(self.config['geoscale']) + ) + # The three classes extending pd.Series, together with the _constructor... # methods of each class, are required for allowing pandas methods called on From d11182e5a8d704ee7a50c690c6ff8b93286d817c Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 30 Jun 2022 10:49:00 -0400 Subject: [PATCH 0140/1127] Removed HFC/PFC speciation from clean_hfc_fba --- flowsa/data_source_scripts/temp_data_source_functions.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index aca92a25d..8a8cf60f8 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -101,7 +101,12 @@ def clean_hfc_fba(fba: FlowByActivity, **kwargs): attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] } - df = ghgi.clean_HFC_fba(fba) + df = ( + fba + .pipe(ghgi.subtract_HFC_transport_emissions) + .pipe(ghgi.allocate_HFC_to_residential) + .pipe(ghgi.split_HFC_foams) + ) new_fba = FlowByActivity(df) for attr in attributes_to_save: From d554cfde26c9184581eab5ef0dd5cdfbf7d24918 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 30 Jun 2022 11:37:40 -0400 Subject: [PATCH 0141/1127] Enable caching of attribution sources (and use of cached sources for attribution) --- flowsa/flowby.py | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index d8079dbc6..5b8d77ff3 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -909,16 +909,22 @@ def attribute_flows_to_sectors( attribution_method = fba.config.get('attribution_method') if attribution_method == 'proportional': - (source, config), = fba.config['attribution_source'].items() - attributed_fba = fba.proportionally_attribute( - FlowByActivity.getFlowByActivity( - full_name=source, + if isinstance(fba.config['attribution_source'], str): + attribution_fbs = (fba.config['cache'] + [fba.config['attribution_source']]) + else: + (name, config), = fba.config['attribution_source'].items() + attribution_fbs = get_flowby_from_config( + name=name, config={**{k: v for k, v in fba.config.items() if k in fba.config['method_config_keys'] or k == 'method_config_keys'}, - **get_catalog_info(source), + **get_catalog_info(name), **config} ).prepare_fbs() + + attributed_fba = fba.proportionally_attribute( + attribution_fbs ) # elif attribution_method == 'proportional-flagged': # (source, config), = fba.config['attribution_source'].items() @@ -1479,6 +1485,27 @@ def generateFlowBySector( log.info('Beginning FlowBySector generation for %s', method) method_config = common.load_yaml_dict(method, 'FBS', external_config_path) + + to_cache = method_config.pop('sources_to_cache', {}) + if 'cache' in method_config: + log.warning('Config key "cache" for %s about to be overwritten', + method) + + method_config['cache'] = { + source_name: get_flowby_from_config( + name=source_name, + config={ + **method_config, + 'method_config_keys': method_config.keys(), + **get_catalog_info(source_name), + **config + }, + external_config_path=external_config_path, + download_sources_ok=download_sources_ok + ).prepare_fbs() + for source_name, config in to_cache.items() + } + sources = method_config.pop('source_names') fbs = pd.concat([ From ab6ba5d05f72e48a11366676500ba8e59e59ba94 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 30 Jun 2022 12:01:37 -0400 Subject: [PATCH 0142/1127] Untested implementation of function_socket allowing the relevant config entry to contain a list of functions instead of a single function --- flowsa/flowby.py | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 5b8d77ff3..dff597cf2 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -269,9 +269,32 @@ def standardize_units(self: FB) -> FB: return standardized - def function_socket(self: FB, function_name: str, *args, **kwargs) -> FB: - if function_name in self.config: - return self.config[function_name](self, *args, **kwargs) + def function_socket( + self: FB, + socket_name: str, + *args, **kwargs + ) -> FB: + ''' + Allows us to define positions ("sockets") in method chains where a user + defined function can be applied to the FlowBy. Such functions should + take as their first argument a FlowBy, and return a FlowBy. Most of the + existing functions in various source.py files that are used in this way + already work, since they take, and return, DataFrames. If passed a + FlowBy, they generally therefore return a FlowBy. + + :param socket_name: str, the key in self.config where the function (or + list of functions) to be applied is found. + :param *args, **kwargs: passed indiscriminately to the function or + functions specified in self.config[socket_name]. + :return: transformed FlowBy dataset + ''' + if socket_name in self.config: + if isinstance(self.config[socket_name], list): + return reduce(lambda fb, func: fb.pipe(func, *args, **kwargs), + self.config[socket_name], + self) + else: + return self.config[socket_name](self, *args, **kwargs) else: return self @@ -927,17 +950,7 @@ def attribute_flows_to_sectors( attribution_fbs ) # elif attribution_method == 'proportional-flagged': - # (source, config), = fba.config['attribution_source'].items() - # attributed_fba = fba.flagged_proportionally_attribute( - # FlowByActivity.getFlowByActivity( - # full_name=source, - # config={**{k: v for k, v in fba.config.items() - # if k in fba.config['method_config_keys'] - # or k == 'method_config_keys'}, - # **get_catalog_info(source), - # **config} - # ).convert_to_fbs() - # ) + # attributed_fba = fba.flagged_proportionally_attribute90 else: if (attribution_method is not None and attribution_method != 'direct'): From de878705346d7eda09689e9fd69af1c5ee9ea23d Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 30 Jun 2022 12:11:36 -0400 Subject: [PATCH 0143/1127] Added a little bit of logging to proportionally_attribute --- flowsa/flowby.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index dff597cf2..8c7c7e9eb 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1193,6 +1193,9 @@ def proportionally_attribute( fba_geoscale = geo.scale.from_string(self.config['geoscale']) other_geoscale = geo.scale.from_string(other.config['geoscale']) + log.info('Attributing flows in %s using %s.', + self.full_name, other.full_name) + if other_geoscale < fba_geoscale: other = ( other From e9227e965507b53ef9ee07ae0968484a199ca70f Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 30 Jun 2022 14:07:58 -0400 Subject: [PATCH 0144/1127] Added some necessary data_format specifications --- flowsa/data/source_catalog.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index b40c92f3f..94a954619 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -29,6 +29,7 @@ BEA_Use: # activity_schema: BEA_2012_Detail_Code sector_aggregation_level: "disaggregated" BEA_Use_Detail_PRO_BeforeRedef: + data_format: FBA class: - Money sector-like_activities: False #update to true once alternate activity_schema in place @@ -41,6 +42,7 @@ BEA_Make_Detail_BeforeRedef: # activity_schema: BEA_2012_Detail_Code sector_aggregation_level: "disaggregated" BLS_QCEW: + data_format: FBA class: - Employment - Money From bd28dd82b470f0541f2b34c039f32ce8e5d16651 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 30 Jun 2022 18:52:34 -0400 Subject: [PATCH 0145/1127] Changed source caching to use for loop instead of dict comprehension so that the definition of one cached source could refer to an earlier one. --- flowsa/flowby.py | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 8c7c7e9eb..40283b137 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1507,20 +1507,24 @@ def generateFlowBySector( log.warning('Config key "cache" for %s about to be overwritten', method) - method_config['cache'] = { - source_name: get_flowby_from_config( - name=source_name, - config={ - **method_config, - 'method_config_keys': method_config.keys(), - **get_catalog_info(source_name), - **config - }, - external_config_path=external_config_path, - download_sources_ok=download_sources_ok - ).prepare_fbs() - for source_name, config in to_cache.items() - } + method_config['cache'] = {} + for source_name, config in to_cache.items(): + method_config['cache'][source_name] = ( + get_flowby_from_config( + name=source_name, + config={ + **method_config, + 'method_config_keys': method_config.keys(), + **get_catalog_info(source_name), + **config + }, + external_config_path=external_config_path, + download_sources_ok=download_sources_ok + ).prepare_fbs() + ) + # ^^^ This is done with a for loop instead of a dict comprehension + # so that later entries in method_config['sources_to_cache'] + # can make use of the cached copy of an earlier entry. sources = method_config.pop('source_names') From 94e53398f4a4860b6d7f56e3e12e15f15bcf9993 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 30 Jun 2022 18:53:06 -0400 Subject: [PATCH 0146/1127] Cleaned up BTS_TSA.py a little; nothing important --- flowsa/data_source_scripts/BTS_TSA.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/flowsa/data_source_scripts/BTS_TSA.py b/flowsa/data_source_scripts/BTS_TSA.py index 92e078331..c409b4b40 100644 --- a/flowsa/data_source_scripts/BTS_TSA.py +++ b/flowsa/data_source_scripts/BTS_TSA.py @@ -1,4 +1,4 @@ -# BEA.py (flowsa) +# BTS_TSA.py (flowsa) # !/usr/bin/env python3 # coding=utf-8 @@ -7,12 +7,6 @@ ''' from io import BytesIO import pandas as pd -from flowsa.common import fbs_activity_fields -from flowsa.location import US_FIPS -from flowsa.schema import activity_fields -from flowsa.settings import externaldatapath -from flowsa.flowbyfunctions import assign_fips_location_system -from flowsa.fbs_allocation import allocation_helper def tsa_call(*, resp, year, **_): @@ -63,9 +57,9 @@ def tsa_parse(*, df_list, source, year, config, **_): df['Unit'] = 'USD' df['FlowType'] = 'TECHNOSPHERE_FLOW' # df['ActivityConsumedBy'] = '' - # df['Compartment'] = '' # ??? + # df['Compartment'] = '' df['Location'] = '00000' - # df['LocationSystem'] = '' + df['LocationSystem'] = 'FIPS_2015' # df['MeasureofSpread'] = '' df['DataReliability'] = 3 # temp df['DataCollection'] = 5 # temp From 74cd7f3ea7b9ab4f63f3c1d8b7084bf5fa2d2c22 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 30 Jun 2022 18:53:56 -0400 Subject: [PATCH 0147/1127] Added conversion from activity to emissions capability --- flowsa/flowby.py | 45 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 40283b137..27d9d02b4 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -394,7 +394,7 @@ def select_by_fields(self: FB, selection_fields: dict = None) -> FB: if selection_fields is None: return self - selection_fields = {k: [v] if isinstance(v, str) else v + selection_fields = {k: [v] if not isinstance(v, (list, dict)) else v for k, v in selection_fields.items()} if 'PrimaryActivity' in selection_fields: @@ -1318,7 +1318,7 @@ def prepare_fbs(self: 'FlowByActivity') -> 'FlowBySector': self .function_socket('clean_fba_before_mapping') .select_by_fields() - .standardize_units_and_flows() + .convert_units_and_flows() .function_socket('clean_fba') .convert_to_geoscale() .attribute_flows_to_sectors() # recursive call to convert_to_fbs @@ -1386,9 +1386,12 @@ def activity_sets(self) -> List['FlowByActivity']: return child_fba_list - def standardize_units_and_flows( + def convert_units_and_flows( self: 'FlowByActivity' ) -> 'FlowByActivity': + if 'emissions_factors' in self.config: + self = self.convert_activity_to_emissions() + standardized = self.standardize_units() if self.config.get('fedefl_mapping'): return standardized.map_to_fedefl_list() @@ -1396,6 +1399,42 @@ def standardize_units_and_flows( return standardized.rename(columns={'FlowName': 'Flowable', 'Compartment': 'Context'}) + def convert_activity_to_emissions( + self: 'FlowByActivity' + ) -> 'FlowByActivity': + ''' + This method converts flows of an activity (most commonly a measure of + fuel burned) into flows of one or more pollutants. This is a first + draft, so it may need some refinement. + + Emissions factors may be specified in a .csv file, with whatever + columns need to be matched on for accurate conversion from activity to + emissions. + ''' + emissions_factors = ( + pd.read_csv( + f'{settings.datapath}{self.config["emissions_factors"]}.csv') + .drop(columns='source') + ) + + emissions_fba = ( + self + .merge(emissions_factors, how='left') + .assign(FlowName=lambda x: x.pollutant, + FlowAmount=lambda x: x.FlowAmount * x.emissions_factor, + Unit=lambda x: x.target_unit, + Class='Chemicals', + FlowType='ELEMENTARY_FLOW') + .drop(columns=['pollutant', 'target_unit', 'emissions_factor']) + .add_primary_secondary_columns('Activity') + .assign(ActivityProducedBy=lambda x: x.PrimaryActivity, + ActivityConsumedBy=lambda x: x.SecondaryActivity) + # ^^^ TODO: This is a line I'm quite skeptical of. There's got to + # be a better way to do this. Maybe specify in the config? + .drop(columns=['PrimaryActivity', 'SecondaryActivity']) + ) + return emissions_fba + class FlowBySector(_FlowBy): _metadata = [*_FlowBy()._metadata] From cee132f1625ac68c48acd6b5d316b84535fe49aa Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 30 Jun 2022 18:54:46 -0400 Subject: [PATCH 0148/1127] Added BTS_Airlines data source --- .../data/BTS_Airlines_emissions_factors.csv | 3 + flowsa/data/source_catalog.yaml | 6 + flowsa/data_source_scripts/BTS_Airlines.py | 33 + .../flowbyactivitymethods/BTS_Airlines.yaml | 34 + .../flowbysectormethods/SEEA_2017_v1.yaml | 1527 ++++++++--------- 5 files changed, 833 insertions(+), 770 deletions(-) create mode 100644 flowsa/data/BTS_Airlines_emissions_factors.csv create mode 100644 flowsa/data_source_scripts/BTS_Airlines.py create mode 100644 flowsa/methods/flowbyactivitymethods/BTS_Airlines.yaml diff --git a/flowsa/data/BTS_Airlines_emissions_factors.csv b/flowsa/data/BTS_Airlines_emissions_factors.csv new file mode 100644 index 000000000..9de75c529 --- /dev/null +++ b/flowsa/data/BTS_Airlines_emissions_factors.csv @@ -0,0 +1,3 @@ +Unit,ActivityConsumedBy,pollutant,target_unit,emissions_factor,source +gal,Commercial Aircraft,CO2,MT CO2e,0.00975,Federal Register EPA; 40 CFR Part 98; e-CFR (see link below). Table C-1 (as amended at 81 FR 89252 Dec. 9 2016). https://www.ecfr.gov/cgi-bin/text-idx?SID=ae265d7d6f98ec86fcd8640b9793a3f6&mc=true&node=pt40.23.98&rgn=div5#ap40.23.98_19.1 +gal,Commercial Aircraft,N2O,MT CO2e,0.0000894,EPA (2021) Inventory of U.S. Greenhouse Gas Emissions and Sinks: 1990-2019 (Annexes). All values are calculated from Tables A-97 through A-98; also Intergovernmental Panel on Climate Change (IPCC) Fourth Assessment Report (AR4) 2007 diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 94a954619..40696897f 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -53,6 +53,9 @@ BLS_QCEW: BTS_TSA: data_format: FBA sector-like_activities: False +BTS_Airlines: + data_format: FBA + sector-like_activities: False CalRecycle_WasteCharacterization: class: - Other @@ -94,6 +97,7 @@ EIA_CBECS_Water: activity_schema: sector_aggregation_level: "aggregated" EIA_MECS_Energy: + data_format: FBA class: - Energy - Other @@ -179,6 +183,7 @@ StatCan_LFS: activity_schema: sector_aggregation_level: "aggregated" USDA_CoA_Cropland: + data_format: FBA class: - Land - Other @@ -186,6 +191,7 @@ USDA_CoA_Cropland: activity_schema: sector_aggregation_level: "disaggregated" USDA_CoA_Cropland_NAICS: + data_format: FBA class: - Land sector-like_activities: True diff --git a/flowsa/data_source_scripts/BTS_Airlines.py b/flowsa/data_source_scripts/BTS_Airlines.py new file mode 100644 index 000000000..061d16eaa --- /dev/null +++ b/flowsa/data_source_scripts/BTS_Airlines.py @@ -0,0 +1,33 @@ +import pandas as pd +import numpy as np +from flowsa.flowby import FlowByActivity +from flowsa import flowsa_yaml, settings + +with open(f'{settings.sourceconfigpath}BTS_Airlines.yaml') as f: + config = flowsa_yaml.load(f) + +year_list = config['years'] + +df = pd.DataFrame(FlowByActivity(( + pd.read_csv(config['file_path']) + [[c for c in config['parse']['rename_columns']]] + .rename(columns=config['parse']['rename_columns']) + .query('Year in @year_list') + .reset_index(drop=True) + .groupby('Year').agg('sum').reset_index() + .assign( + Class='Fuel', + Compartment='air', + SourceName='BTS_Airlines', + LocationSystem='FIPS_2015', + ActivityConsumedBy='Commercial Aircraft', + Unit='gal', + FlowName='Total Gallons Consumed', + FlowType='TECHNOSPHERE_FLOW', + Location='00000', + DataReliability=3, + DataCollection=5 + ) +))) + +df.to_parquet(f'{settings.fbaoutputpath}BTS_Airlines.parquet') diff --git a/flowsa/methods/flowbyactivitymethods/BTS_Airlines.yaml b/flowsa/methods/flowbyactivitymethods/BTS_Airlines.yaml new file mode 100644 index 000000000..33371694d --- /dev/null +++ b/flowsa/methods/flowbyactivitymethods/BTS_Airlines.yaml @@ -0,0 +1,34 @@ +author: US Bureau of Transportation Statistics +source_name: Airline Fuel Cost and Consumption +source_url: https://www.transtats.bts.gov/FUEL/ +bib_id: BTS_Airlines +api_name: BTS_Airlines +format: .csv +file_path: //serv03cl/inea/Research/Projects/US SEEA/Air Emissions Account/Data/T_F41SCHEDULE_P12A.csv +parse: + rename_columns: + YEAR: Year + TOTAL_GALLONS: FlowAmount +years: + - 2000 + - 2001 + - 2002 + - 2003 + - 2004 + - 2005 + - 2006 + - 2007 + - 2008 + - 2009 + - 2010 + - 2011 + - 2012 + - 2013 + - 2014 + - 2015 + - 2016 + - 2017 + - 2018 + - 2019 + - 2020 + - 2021 diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index 262d05a29..b5e1ec6bc 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -16,43 +16,18 @@ target_naics_year: 2012 geoscale: national _ghgi_parameters: &ghgi_parameters - data_format: FBA geoscale: national - year: 2017 - fedefl_mapping: GHGI + year: &year 2017 _attribution_sources: - BLS_QCEW: &bls_qcew - selection_fields: - Class: Employment - year: 2012 - clean_fba: !script_function:temp_data_source_functions clean_qcew BEA_Use_Detail_PRO_BeforeRedef: &bea_use year: 2012 activity_to_sector_mapping: BEA_2012_Detail attribution_method: proportional - attribution_source: - BLS_QCEW: - <<: *bls_qcew + attribution_source: BLS_QCEW EPA_GHGI_T_A_79: &t_a_79 attribution_method: proportional - attribution_source: - BLS_QCEW: - <<: *bls_qcew - BTS_TSA: &tsa_trucking - year: 2017 - selection_fields: - Description: - - In-house truck transportation - - For-hire truck transportation - activity_to_sector_mapping: BTS_TSA - attribution_method: proportional - attribution_source: - BLS_QCEW: - selection_fields: - Class: Employment - year: 2012 - clean_fba: !script_function:temp_data_source_functions clean_qcew + attribution_source: BLS_QCEW EIA_MECS_Energy: &mecs_energy year: 2014 selection_fields: &mecs_energy_default_selection @@ -61,9 +36,7 @@ _attribution_sources: clean_fba: !script_function:temp_data_source_functions clean_mecs_energy_fba_for_bea_summary clean_fba_w_sec: !script_function:temp_data_source_functions clean_mapped_mecs_energy_fba_for_bea_summary attribution_method: proportional # cleaning fxns remove need for proportional-flagged IF industry_spec is BEA summary - attribution_source: - BLS_QCEW: - <<: *bls_qcew + attribution_source: BLS_QCEW USDA_CoA_Cropland_NAICS: &usda_pasture # allocated based on USDA Animal operation land (acres) selection_fields: Class: @@ -85,6 +58,22 @@ _attribution_sources: clean_fba: !script_function:USDA_CoA_Cropland coa_irrigated_cropland_fba_cleanup clean_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics +# sources_to_cache: +# BLS_QCEW: +# selection_fields: +# Class: Employment +# year: 2012 +# clean_fba: !script_function:temp_data_source_functions clean_qcew +# BTS_TSA: +# year: 2017 +# selection_fields: +# Description: +# - In-house truck transportation +# - For-hire truck transportation +# activity_to_sector_mapping: BTS_TSA +# attribution_method: proportional +# attribution_source: BLS_QCEW + source_names: # stewiFBS: # data_format: FBS_outside_flowsa @@ -99,221 +88,221 @@ source_names: # reassign_process_to_sectors: # - airplane_emissions - EPA_GHGI_T_2_1: #U.S. GHG emissions - <<: *ghgi_parameters - activity_sets: - direct_attribution: - selection_fields: - PrimaryActivity: - - Iron and Steel Production & Metallurgical Coke Production #CO2, CH4 - - Cement Production #CO2 - - Lime Production #CO2 - - Ammonia Production #CO2 - - Incineration of Waste #CO2, #N2O - - Aluminum Production #CO2 - - Soda Ash Production #CO2 - - Ferroalloy Production #CO2, CH4 - - Titanium Dioxide Production #CO2 - - Zinc Production #CO2 - - Phosphoric Acid Production #CO2 - - Glass Production #CO2 - - Carbide Production and Consumption #CO2, CH4 - - Landfills #CH4 - - Coal Mining #CH4 - - Wastewater Treatment #CH4, N2O - - Rice Cultivation #CH4 - - Abandoned Oil and Gas Wells #CH4 - - Abandoned Underground Coal Mines #CH4 - - Anaerobic Digestion at Biogas Facilities #CH4 new activity - - Composting #CH4, N2O - - Nitric Acid Production #N2O - - Adipic Acid Production #N2O - - Caprolactam, Glyoxal, and Glyoxylic Acid Production #CH4 - - Electronics Industry #N2O - FlowName: # HFCs and other flows are attributed elsewhere - - CO2 - - CH4 - - N2O - attribution_method: direct - - electric_distribution: - selection_fields: - PrimaryActivity: Electrical Transmission and Distribution #SF6 - FlowName: SF6 - attribution_method: direct - - liming: - selection_fields: - PrimaryActivity: Liming #CO2 - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '327400' - - urea: - selection_fields: - PrimaryActivity: - - Urea Fertilization #CO2 - - Urea Consumption for Non-Agricultural Purposes #CO2 - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '325310' # Fertilizers - - carbonate_use: - selection_fields: - PrimaryActivity: Other Process Uses of Carbonates #CO2 - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '325180' # Other Basic Inorganic Chemicals - - lead_production: - selection_fields: - PrimaryActivity: Lead Production #CO2 - attribution_method: proportional - attribution_source: - USGS_MYB_Lead: - year: 2016 - selection_fields: - ActivityProducedBy: - - Primary lead, refined content, domestic ores and base bullion - - Secondary lead, lead content - - nitrous_oxide_use: - selection_fields: - PrimaryActivity: N2O from Product Uses #N2O - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '325120' # Industrial gases - -## Fossil Fuels - EPA_GHGI_T_3_63: &natgas #CH4 from Natural Gas Systems - <<: *ghgi_parameters - selection_fields: - PrimaryActivity: - - Distribution - - Exploration - - Processing - - Production - - Transmission and Storage - attribution_method: direct - EPA_GHGI_T_3_65: *natgas #CO2 from Natural Gas Systems mimics CH4 - EPA_GHGI_T_3_67: *natgas #N2O from Natural Gas Systems, not used in original method, mimics CH4 - - EPA_GHGI_T_3_38: &petroleum #CH4 from Petroleum Systems - <<: *ghgi_parameters - selection_fields: - PrimaryActivity: - - Crude Oil Transportation - - Exploration - - Production - - Refining - attribution_method: direct - EPA_GHGI_T_3_40: *petroleum #CO2 from Petroleum Systems mimics CH4 - EPA_GHGI_T_3_42: *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 - -## Stationary Combustion (note that CO2 is electric power only) - EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion - <<: *ghgi_parameters - clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion - activity_sets: - direct_attribution: - selection_fields: - PrimaryActivity: - - Fuel Oil Residential - - Coal Residential - - Natural Gas Residential - - Wood Residential - attribution_method: direct - electric_power: &stationary_electric - selection_fields: - PrimaryActivity: - - Coal Electric Power - - Natural Gas Electric Power - - Natural gas Electric Power # note lower case - - Fuel Oil Electric Power - - Geothermal Electric Power - - Wood Electric Power - activity_to_sector_mapping: EPA_GHGI_m2 - attribution_method: direct - fuel_oil: - selection_fields: - PrimaryActivity: - - Fuel Oil Commercial - - Fuel Oil Industrial - attribution_methods: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # purchases of refinery products - natural_gas: - selection_fields: - PrimaryActivity: - - Natural gas Commercial - - Natural gas Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '221200' # purchases of natural gas - coal: - selection_fields: - PrimaryActivity: Coal Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '212100' # purchases of coal - coal_manufacturing: - selection_fields: - PrimaryActivity: Coal Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Coal - natural_gas_manufacturing: - selection_fields: - PrimaryActivity: Natural gas Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Natural Gas - EPA_GHGI_T_3_9: # N2O emissions from stationary combustion - <<: *stationary_combustion - EPA_GHGI_T_3_7: # CO2 emissions from stationary combustion (electricity only) - <<: [*ghgi_parameters, *stationary_electric] - -## Agriculture - EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues - <<: *ghgi_parameters - attribution_method: direct - selection_fields: - PrimaryActivity: - - Chickpeas - - Cotton - - Maize - - Rice - - Soybeans - - Wheat +# EPA_GHGI_T_2_1: #U.S. GHG emissions +# <<: *ghgi_parameters +# activity_sets: +# direct_attribution: +# selection_fields: +# PrimaryActivity: +# - Iron and Steel Production & Metallurgical Coke Production #CO2, CH4 +# - Cement Production #CO2 +# - Lime Production #CO2 +# - Ammonia Production #CO2 +# - Incineration of Waste #CO2, #N2O +# - Aluminum Production #CO2 +# - Soda Ash Production #CO2 +# - Ferroalloy Production #CO2, CH4 +# - Titanium Dioxide Production #CO2 +# - Zinc Production #CO2 +# - Phosphoric Acid Production #CO2 +# - Glass Production #CO2 +# - Carbide Production and Consumption #CO2, CH4 +# - Landfills #CH4 +# - Coal Mining #CH4 +# - Wastewater Treatment #CH4, N2O +# - Rice Cultivation #CH4 +# - Abandoned Oil and Gas Wells #CH4 +# - Abandoned Underground Coal Mines #CH4 +# - Anaerobic Digestion at Biogas Facilities #CH4 new activity +# - Composting #CH4, N2O +# - Nitric Acid Production #N2O +# - Adipic Acid Production #N2O +# - Caprolactam, Glyoxal, and Glyoxylic Acid Production #CH4 +# - Electronics Industry #N2O +# FlowName: # HFCs and other flows are attributed elsewhere +# - CO2 +# - CH4 +# - N2O +# attribution_method: direct + +# electric_distribution: +# selection_fields: +# PrimaryActivity: Electrical Transmission and Distribution #SF6 +# FlowName: SF6 +# attribution_method: direct + +# liming: +# selection_fields: +# PrimaryActivity: Liming #CO2 +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea_use +# selection_fields: +# ActivityProducedBy: '327400' + +# urea: +# selection_fields: +# PrimaryActivity: +# - Urea Fertilization #CO2 +# - Urea Consumption for Non-Agricultural Purposes #CO2 +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea_use +# selection_fields: +# ActivityProducedBy: '325310' # Fertilizers + +# carbonate_use: +# selection_fields: +# PrimaryActivity: Other Process Uses of Carbonates #CO2 +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea_use +# selection_fields: +# ActivityProducedBy: '325180' # Other Basic Inorganic Chemicals + +# lead_production: +# selection_fields: +# PrimaryActivity: Lead Production #CO2 +# attribution_method: proportional +# attribution_source: +# USGS_MYB_Lead: +# year: 2016 +# selection_fields: +# ActivityProducedBy: +# - Primary lead, refined content, domestic ores and base bullion +# - Secondary lead, lead content + +# nitrous_oxide_use: +# selection_fields: +# PrimaryActivity: N2O from Product Uses #N2O +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea_use +# selection_fields: +# ActivityProducedBy: '325120' # Industrial gases + +# ## Fossil Fuels +# EPA_GHGI_T_3_63: &natgas #CH4 from Natural Gas Systems +# <<: *ghgi_parameters +# selection_fields: +# PrimaryActivity: +# - Distribution +# - Exploration +# - Processing +# - Production +# - Transmission and Storage +# attribution_method: direct +# EPA_GHGI_T_3_65: *natgas #CO2 from Natural Gas Systems mimics CH4 +# EPA_GHGI_T_3_67: *natgas #N2O from Natural Gas Systems, not used in original method, mimics CH4 + +# EPA_GHGI_T_3_38: &petroleum #CH4 from Petroleum Systems +# <<: *ghgi_parameters +# selection_fields: +# PrimaryActivity: +# - Crude Oil Transportation +# - Exploration +# - Production +# - Refining +# attribution_method: direct +# EPA_GHGI_T_3_40: *petroleum #CO2 from Petroleum Systems mimics CH4 +# EPA_GHGI_T_3_42: *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 + +# ## Stationary Combustion (note that CO2 is electric power only) +# EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion +# <<: *ghgi_parameters +# clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion +# activity_sets: +# direct_attribution: +# selection_fields: +# PrimaryActivity: +# - Fuel Oil Residential +# - Coal Residential +# - Natural Gas Residential +# - Wood Residential +# attribution_method: direct +# electric_power: &stationary_electric +# selection_fields: +# PrimaryActivity: +# - Coal Electric Power +# - Natural Gas Electric Power +# - Natural gas Electric Power # note lower case +# - Fuel Oil Electric Power +# - Geothermal Electric Power +# - Wood Electric Power +# activity_to_sector_mapping: EPA_GHGI_m2 +# attribution_method: direct +# fuel_oil: +# selection_fields: +# PrimaryActivity: +# - Fuel Oil Commercial +# - Fuel Oil Industrial +# attribution_methods: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea_use +# selection_fields: +# ActivityProducedBy: '324110' # purchases of refinery products +# natural_gas: +# selection_fields: +# PrimaryActivity: +# - Natural gas Commercial +# - Natural gas Industrial +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea_use +# selection_fields: +# ActivityProducedBy: '221200' # purchases of natural gas +# coal: +# selection_fields: +# PrimaryActivity: Coal Industrial +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea_use +# selection_fields: +# ActivityProducedBy: '212100' # purchases of coal +# coal_manufacturing: +# selection_fields: +# PrimaryActivity: Coal Industrial - Manufacturing +# attribution_method: proportional +# attribution_source: +# EIA_MECS_Energy: +# <<: *mecs_energy +# selection_fields: +# <<: *mecs_energy_default_selection +# FlowName: Coal +# natural_gas_manufacturing: +# selection_fields: +# PrimaryActivity: Natural gas Industrial - Manufacturing +# attribution_method: proportional +# attribution_source: +# EIA_MECS_Energy: +# <<: *mecs_energy +# selection_fields: +# <<: *mecs_energy_default_selection +# FlowName: Natural Gas +# EPA_GHGI_T_3_9: # N2O emissions from stationary combustion +# <<: *stationary_combustion +# EPA_GHGI_T_3_7: # CO2 emissions from stationary combustion (electricity only) +# <<: [*ghgi_parameters, *stationary_electric] + +# # ## Agriculture +# EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues +# <<: *ghgi_parameters +# attribution_method: direct +# selection_fields: +# PrimaryActivity: +# - Chickpeas +# - Cotton +# - Maize +# - Rice +# - Soybeans +# - Wheat EPA_GHGI_T_5_3: &animals #CH4 from Enteric Fermentation <<: *ghgi_parameters @@ -331,528 +320,526 @@ source_names: - Poultry EPA_GHGI_T_5_7: *animals #CH4 and N2O from manure, mimics enteric fermentation - EPA_GHGI_T_5_18: #Direct N2O emissions from agricultural soils - <<: *ghgi_parameters - activity_sets: - fertilizer_use: &fertilizer # allocated based on fertilizer use - selection_fields: - PrimaryActivity: - - Organic Amendment Cropland - - Residue N Cropland - - Synthetic Fertilizer Cropland - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: - - '325310' - cropland: - selection_fields: - PrimaryActivity: - - Mineralization and Asymbiotic Fixation Cropland - - Drained Organic Soils Cropland - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland: - <<: *usda_cropland - pasture: &pasture - selection_fields: - PrimaryActivity: - - All activities Grassland - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland_NAICS: - <<: *usda_pasture - EPA_GHGI_T_5_19: #Indirect N2O emissions from agricultural soils - <<: *ghgi_parameters - activity_sets: - fertilizer_use: # allocated based on fertilizer use - <<: *fertilizer - selection_fields: - PrimaryActivity: - - Volatilization & Atm. Deposition Cropland - - Surface Leaching & Run-Off Cropland - pasture: - <<: *pasture - -## Mobile Sources (N20 and CH4) - EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion - <<: *ghgi_parameters - activity_sets: - direct_attribution: # Some of these need to be separated and attributed differently - selection_fields: - PrimaryActivity: - - Passenger Cars Gasoline On-Road - - Rail Non-Road - - Ships and Boats Non-Road - - Aircraft Non-Road - attribution_method: direct - - trucking: - selection_fields: - PrimaryActivity: - - Light-Duty Trucks Gasoline On-Road - - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road - activity_to_sector_mapping: EPA_GHGI_trucking - attribution_method: proportional - attribution_source: - BTS_TSA: - <<: *tsa_trucking - - construction_and_mining: - selection_fields: - PrimaryActivity: Construction/Mining Equipment Non-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333120' # purchases of construction/mining equipment - - farm_non_road: - selection_fields: - PrimaryActivity: Agricultural Equipment Non-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333111' # purchases of farm machinery - - other_non_road: # attributed by purchases of petroleum refinery products - selection_fields: - PrimaryActivity: Other Non-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # purchases of refinery products - - alt_fuel_on_road: # assumes natural gas is primary alternate fuel - selection_fields: - PrimaryActivity: - - Alternative Fuel On-Road - - All activities Alternative Fuel On-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '221200' # purchases of natural gas - EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 - -# Major CO2 Sources - EPA_GHGI_T_A_13: # (2017 specific table) CO2 emissions from stationary combustion and transportation - <<: *ghgi_parameters - clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion - activity_sets: - direct_attribution: - selection_fields: - PrimaryActivity: Total (All Fuels) Residential - attribution_method: direct - non-manufacturing_coal: - selection_fields: - PrimaryActivity: - - Commercial Coal Commercial - - Industrial Other Coal Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '212100' # purchases of coal - non-manufacturing_natural_gas: - selection_fields: - PrimaryActivity: - - Natural Gas Commercial - - Natural Gas Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '221200' # purchases of natural gas - non-manufacturing_petroleum: - selection_fields: - PrimaryActivity: - - Total Petroleum Commercial - - Total Petroleum Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # purchases of refinery products - manufacturing_coal: # Industrial Coal for Manufacturing - selection_fields: - PrimaryActivity: - - Industrial Other Coal Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Coal - manufacturing_natural_gas: # Industrial Natural Gas for manufacturing - selection_fields: - PrimaryActivity: - - Natural Gas Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Natural Gas - - ## Transportation - natural_gas_transportation: - selection_fields: - PrimaryActivity: Natural Gas Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - selection_fields: - FlowName: Natural Gas - - aviation_gas_transportation: - selection_fields: - PrimaryActivity: Aviation Gasoline Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - selection_fields: - FlowName: Aviation Gasoline - - jet_fuel_transportation: - selection_fields: - PrimaryActivity: Jet Fuel Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - selection_fields: - FlowName: Jet Fuel - - propane_transportation: - selection_fields: - PrimaryActivity: LPG (Propane) Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - selection_fields: - FlowName: LPG - - residual_fuel_transportation: - selection_fields: - PrimaryActivity: Residual Fuel Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - selection_fields: - FlowName: Residual Fuel Oil - - distillate_fuel_transportation: - selection_fields: - PrimaryActivity: - - Distillate Fuel Oil Transportation - activity_to_sector_mapping: EPA_GHGI_trucking - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - activity_to_sector_mapping: EPA_GHGI - activity_sets: - direct_attribution: - selection_fields: - FlowName: Distillate Fuel Oil (Diesel Fuel) - PrimaryActivity: - - Passenger Cars - - Rail - - Recreational Boats - - Ships and Non-Recreational Boats - attribution_method: direct - trucking: - selection_fields: - FlowName: Distillate Fuel Oil (Diesel Fuel) - PrimaryActivity: - - Light-Duty Trucks - - Medium- and Heavy-Duty Trucks - activity_to_sector_mapping: EPA_GHGI_trucking - attribution_method: proportional - attribution_source: - BTS_TSA: - <<: *tsa_trucking - buses: - selection_fields: - FlowName: Distillate Fuel Oil (Diesel Fuel) - PrimaryActivity: Buses - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # use of petroleum products - - motor_gasoline_transportation: - selection_fields: - PrimaryActivity: - - Motor Gasoline Transportation - activity_to_sector_mapping: EPA_GHGI_trucking - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - activity_to_sector_mapping: EPA_GHGI - activity_sets: - direct_attribution: - selection_fields: - FlowName: Motor Gasoline - PrimaryActivity: - - Passenger Cars - - Motorcycles - - Recreational Boats - attribution_method: direct - trucking: - selection_fields: - FlowName: Motor Gasoline - PrimaryActivity: - - Light-Duty Trucks - - Medium- and Heavy-Duty Trucks - activity_to_sector_mapping: EPA_GHGI_trucking - attribution_method: proportional - attribution_source: - BTS_TSA: - <<: *tsa_trucking - buses: - selection_fields: - FlowName: Motor Gasoline - PrimaryActivity: Buses - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # use of petroleum products - -## Other sources - EPA_GHGI_T_4_46: #CO2 for selected petrochemicals - <<: *ghgi_parameters - selection_fields: - PrimaryActivity: - - Acrylonitrile - - Carbon Black - - Ethylene - - Ethylene Dichloride - - Ethylene Oxide - - Methanol - attribution_method: direct - - EPA_GHGI_T_3_22b: #Fossil fuel for non-energy uses - <<: *ghgi_parameters - activity_sets: - coal: - selection_fields: - PrimaryActivity: - - Industry Industrial Coking Coal - - Industry Industrial Other Coal - attribution_method: direct - - distillate_fuel_feedstocks: - selection_fields: - PrimaryActivity: Industry Distillate Fuel Oil - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: Distillate Fuel Oil - - hgl_feedstocks: - selection_fields: - PrimaryActivity: - - Industry LPG - - Industry Pentanes Plus - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: Hydrocarbon Gas Liquids, excluding natural gasoline - - petroleum_coke_feedstocks: - selection_fields: - PrimaryActivity: Industry Petroleum Coke - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: Coke and Breeze - - natural_gas_feedstocks: - selection_fields: - PrimaryActivity: - - Industry Still Gas - - Industry Natural Gas to Chemical Plants - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: Natural Gas - - other_petroleum_feedstocks: - selection_fields: - PrimaryActivity: - - Industry Asphalt & Road Oil - - Industry Lubricants - - Industry Miscellaneous Products - - Industry Naphtha (<401 F) - - Industry Other Oil (>401 F) - - Industry Special Naphtha - - Industry Waxes - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: Other - - transportation_lubricants: - selection_fields: - PrimaryActivity: Transportation Lubricants - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # use of petroleum products - - EPA_GHGI_T_4_50: # HFCs from HCFC-22 production - <<: *ghgi_parameters - selection_fields: - Unit: MMT CO2e - PrimaryActivity: HCFC-22 Production - attribution_method: direct - - EPA_GHGI_T_4_94: # HFCs and other emissions from electronics manufacture - <<: *ghgi_parameters - selection_fields: - PrimaryActivity: Electronics Production - attribution_method: direct - - EPA_GHGI_T_4_101: # HFCs and PFCs from ODS Substitutes - <<: *ghgi_parameters - clean_fba_before_activity_sets: !script_function:temp_data_source_functions clean_hfc_fba # removes HFCs from transportation - activity_sets: - household_refrigeration: - selection_fields: - PrimaryActivity: Refrigeration/Air Conditioning - Households - attribution_method: direct - - non-household_refrigeration: - selection_fields: - PrimaryActivity: Refrigeration/Air Conditioning - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333415' # Air conditioning equipment - - polystyrene_foam: - selection_fields: - PrimaryActivity: Foams - Polystyrene - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '326140' # Polystyrene foam - - urethane_foam: - selection_fields: - PrimaryActivity: Foams - Urethane - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '326150' # Urethane and other foams. - - EPA_GHGI_T_A_103: # HFCs from Transportation - <<: *ghgi_parameters - clean_fba_before_activity_sets: !script_function:temp_data_source_functions split_hfcs_by_type - activity_sets: - passenger_cars: - selection_fields: - PrimaryActivity: Passenger Cars - attribution_method: direct - trucking: - selection_fields: - PrimaryActivity: - - Light-Duty Trucks - - Heavy-Duty Vehicles - activity_to_sector_mapping: EPA_GHGI_trucking - attribution_method: proportional - attribution_source: - BTS_TSA: - <<: *tsa_trucking - refrigerated_trucks: - selection_fields: - PrimaryActivity: Medium- and Heavy-Duty Trucks - activity_to_sector_mapping: EPA_GHGI_trucking - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333415' # purchases of refrigeration equipment - other_cooling: - selection_fields: - PrimaryActivity: - - School and Tour Buses - - Transit Buses - - Rail - - Ships and Boats - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333415' # purchases of refrigeration equipment - - EPA_GHGI_T_4_80: # PFCs from aluminum production - <<: *ghgi_parameters +# EPA_GHGI_T_5_18: #Direct N2O emissions from agricultural soils +# <<: *ghgi_parameters +# activity_sets: +# fertilizer_use: &fertilizer # allocated based on fertilizer use +# selection_fields: +# PrimaryActivity: +# - Organic Amendment Cropland +# - Residue N Cropland +# - Synthetic Fertilizer Cropland +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea_use +# selection_fields: +# ActivityProducedBy: +# - '325310' +# cropland: +# selection_fields: +# PrimaryActivity: +# - Mineralization and Asymbiotic Fixation Cropland +# - Drained Organic Soils Cropland +# attribution_method: proportional +# attribution_source: +# USDA_CoA_Cropland: +# <<: *usda_cropland +# pasture: &pasture +# selection_fields: +# PrimaryActivity: +# - All activities Grassland +# attribution_method: proportional +# attribution_source: +# USDA_CoA_Cropland_NAICS: +# <<: *usda_pasture +# EPA_GHGI_T_5_19: #Indirect N2O emissions from agricultural soils +# <<: *ghgi_parameters +# activity_sets: +# fertilizer_use: # allocated based on fertilizer use +# <<: *fertilizer +# selection_fields: +# PrimaryActivity: +# - Volatilization & Atm. Deposition Cropland +# - Surface Leaching & Run-Off Cropland +# pasture: +# <<: *pasture + +# ## Mobile Sources (N20 and CH4) +# EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion +# <<: *ghgi_parameters +# activity_sets: +# direct_attribution: # Some of these need to be separated and attributed differently +# selection_fields: +# PrimaryActivity: +# - Passenger Cars Gasoline On-Road +# - Rail Non-Road +# - Ships and Boats Non-Road +# - Aircraft Non-Road +# attribution_method: direct + +# trucking: +# selection_fields: +# PrimaryActivity: +# - Light-Duty Trucks Gasoline On-Road +# - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road +# activity_to_sector_mapping: EPA_GHGI_trucking +# attribution_method: proportional +# attribution_source: BTS_TSA + +# construction_and_mining: +# selection_fields: +# PrimaryActivity: Construction/Mining Equipment Non-Road +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea_use +# selection_fields: +# ActivityProducedBy: '333120' # purchases of construction/mining equipment + +# farm_non_road: +# selection_fields: +# PrimaryActivity: Agricultural Equipment Non-Road +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea_use +# selection_fields: +# ActivityProducedBy: '333111' # purchases of farm machinery + +# other_non_road: # attributed by purchases of petroleum refinery products +# selection_fields: +# PrimaryActivity: Other Non-Road +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea_use +# selection_fields: +# ActivityProducedBy: '324110' # purchases of refinery products + +# alt_fuel_on_road: # assumes natural gas is primary alternate fuel +# selection_fields: +# PrimaryActivity: +# - Alternative Fuel On-Road +# - All activities Alternative Fuel On-Road +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea_use +# selection_fields: +# ActivityProducedBy: '221200' # purchases of natural gas +# EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 + +# # Major CO2 Sources +# EPA_GHGI_T_A_13: # (2017 specific table) CO2 emissions from stationary combustion and transportation +# <<: *ghgi_parameters +# clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion +# activity_sets: +# direct_attribution: +# selection_fields: +# PrimaryActivity: Total (All Fuels) Residential +# attribution_method: direct +# non-manufacturing_coal: +# selection_fields: +# PrimaryActivity: +# - Commercial Coal Commercial +# - Industrial Other Coal Industrial +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea_use +# selection_fields: +# ActivityProducedBy: '212100' # purchases of coal +# non-manufacturing_natural_gas: +# selection_fields: +# PrimaryActivity: +# - Natural Gas Commercial +# - Natural Gas Industrial +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea_use +# selection_fields: +# ActivityProducedBy: '221200' # purchases of natural gas +# non-manufacturing_petroleum: +# selection_fields: +# PrimaryActivity: +# - Total Petroleum Commercial +# - Total Petroleum Industrial +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea_use +# selection_fields: +# ActivityProducedBy: '324110' # purchases of refinery products +# manufacturing_coal: # Industrial Coal for Manufacturing +# selection_fields: +# PrimaryActivity: +# - Industrial Other Coal Industrial - Manufacturing +# attribution_method: proportional +# attribution_source: +# EIA_MECS_Energy: +# <<: *mecs_energy +# selection_fields: +# <<: *mecs_energy_default_selection +# FlowName: Coal +# manufacturing_natural_gas: # Industrial Natural Gas for manufacturing +# selection_fields: +# PrimaryActivity: +# - Natural Gas Industrial - Manufacturing +# attribution_method: proportional +# attribution_source: +# EIA_MECS_Energy: +# <<: *mecs_energy +# selection_fields: +# <<: *mecs_energy_default_selection +# FlowName: Natural Gas + +# ## Transportation +# natural_gas_transportation: +# selection_fields: +# PrimaryActivity: Natural Gas Transportation +# attribution_method: proportional +# attribution_source: +# EPA_GHGI_T_A_79: +# <<: *t_a_79 +# selection_fields: +# FlowName: Natural Gas + +# aviation_gas_transportation: +# selection_fields: +# PrimaryActivity: Aviation Gasoline Transportation +# attribution_method: proportional +# attribution_source: +# EPA_GHGI_T_A_79: +# <<: *t_a_79 +# selection_fields: +# FlowName: Aviation Gasoline + +# jet_fuel_transportation: +# selection_fields: +# PrimaryActivity: Jet Fuel Transportation +# attribution_method: proportional +# attribution_source: +# EPA_GHGI_T_A_79: +# <<: *t_a_79 +# selection_fields: +# FlowName: Jet Fuel + +# propane_transportation: +# selection_fields: +# PrimaryActivity: LPG (Propane) Transportation +# attribution_method: proportional +# attribution_source: +# EPA_GHGI_T_A_79: +# <<: *t_a_79 +# selection_fields: +# FlowName: LPG + +# residual_fuel_transportation: +# selection_fields: +# PrimaryActivity: Residual Fuel Transportation +# attribution_method: proportional +# attribution_source: +# EPA_GHGI_T_A_79: +# <<: *t_a_79 +# selection_fields: +# FlowName: Residual Fuel Oil + +# distillate_fuel_transportation: +# selection_fields: +# PrimaryActivity: +# - Distillate Fuel Oil Transportation +# activity_to_sector_mapping: EPA_GHGI_trucking +# attribution_method: proportional +# attribution_source: +# EPA_GHGI_T_A_79: +# <<: *t_a_79 +# activity_to_sector_mapping: EPA_GHGI +# activity_sets: +# direct_attribution: +# selection_fields: +# FlowName: Distillate Fuel Oil (Diesel Fuel) +# PrimaryActivity: +# - Passenger Cars +# - Rail +# - Recreational Boats +# - Ships and Non-Recreational Boats +# attribution_method: direct +# trucking: +# selection_fields: +# FlowName: Distillate Fuel Oil (Diesel Fuel) +# PrimaryActivity: +# - Light-Duty Trucks +# - Medium- and Heavy-Duty Trucks +# activity_to_sector_mapping: EPA_GHGI_trucking +# attribution_method: proportional +# attribution_source: BTS_TSA +# buses: +# selection_fields: +# FlowName: Distillate Fuel Oil (Diesel Fuel) +# PrimaryActivity: Buses +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea_use +# selection_fields: +# ActivityProducedBy: '324110' # use of petroleum products + +# motor_gasoline_transportation: +# selection_fields: +# PrimaryActivity: +# - Motor Gasoline Transportation +# activity_to_sector_mapping: EPA_GHGI_trucking +# attribution_method: proportional +# attribution_source: +# EPA_GHGI_T_A_79: +# <<: *t_a_79 +# activity_to_sector_mapping: EPA_GHGI +# activity_sets: +# direct_attribution: +# selection_fields: +# FlowName: Motor Gasoline +# PrimaryActivity: +# - Passenger Cars +# - Motorcycles +# - Recreational Boats +# attribution_method: direct +# trucking: +# selection_fields: +# FlowName: Motor Gasoline +# PrimaryActivity: +# - Light-Duty Trucks +# - Medium- and Heavy-Duty Trucks +# activity_to_sector_mapping: EPA_GHGI_trucking +# attribution_method: proportional +# attribution_source: BTS_TSA +# buses: +# selection_fields: +# FlowName: Motor Gasoline +# PrimaryActivity: Buses +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea_use +# selection_fields: +# ActivityProducedBy: '324110' # use of petroleum products + +# ## Other sources +# EPA_GHGI_T_4_46: #CO2 for selected petrochemicals +# <<: *ghgi_parameters +# selection_fields: +# PrimaryActivity: +# - Acrylonitrile +# - Carbon Black +# - Ethylene +# - Ethylene Dichloride +# - Ethylene Oxide +# - Methanol +# attribution_method: direct + +# EPA_GHGI_T_3_22b: #Fossil fuel for non-energy uses +# <<: *ghgi_parameters +# activity_sets: +# coal: +# selection_fields: +# PrimaryActivity: +# - Industry Industrial Coking Coal +# - Industry Industrial Other Coal +# attribution_method: direct + +# distillate_fuel_feedstocks: +# selection_fields: +# PrimaryActivity: Industry Distillate Fuel Oil +# attribution_method: proportional +# attribution_source: +# EIA_MECS_Energy: +# <<: *mecs_energy +# selection_fields: +# Class: Other +# Unit: Trillion Btu +# FlowName: Distillate Fuel Oil + +# hgl_feedstocks: +# selection_fields: +# PrimaryActivity: +# - Industry LPG +# - Industry Pentanes Plus +# attribution_method: proportional +# attribution_source: +# EIA_MECS_Energy: +# <<: *mecs_energy +# selection_fields: +# Class: Other +# Unit: Trillion Btu +# FlowName: Hydrocarbon Gas Liquids, excluding natural gasoline + +# petroleum_coke_feedstocks: +# selection_fields: +# PrimaryActivity: Industry Petroleum Coke +# attribution_method: proportional +# attribution_source: +# EIA_MECS_Energy: +# <<: *mecs_energy +# selection_fields: +# Class: Other +# Unit: Trillion Btu +# FlowName: Coke and Breeze + +# natural_gas_feedstocks: +# selection_fields: +# PrimaryActivity: +# - Industry Still Gas +# - Industry Natural Gas to Chemical Plants +# attribution_method: proportional +# attribution_source: +# EIA_MECS_Energy: +# <<: *mecs_energy +# selection_fields: +# Class: Other +# Unit: Trillion Btu +# FlowName: Natural Gas + +# other_petroleum_feedstocks: +# selection_fields: +# PrimaryActivity: +# - Industry Asphalt & Road Oil +# - Industry Lubricants +# - Industry Miscellaneous Products +# - Industry Naphtha (<401 F) +# - Industry Other Oil (>401 F) +# - Industry Special Naphtha +# - Industry Waxes +# attribution_method: proportional +# attribution_source: +# EIA_MECS_Energy: +# <<: *mecs_energy +# selection_fields: +# Class: Other +# Unit: Trillion Btu +# FlowName: Other + +# transportation_lubricants: +# selection_fields: +# PrimaryActivity: Transportation Lubricants +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea_use +# selection_fields: +# ActivityProducedBy: '324110' # use of petroleum products + +# EPA_GHGI_T_4_50: # HFCs from HCFC-22 production +# <<: *ghgi_parameters +# selection_fields: +# Unit: MMT CO2e +# PrimaryActivity: HCFC-22 Production +# attribution_method: direct + +# EPA_GHGI_T_4_94: # HFCs and other emissions from electronics manufacture +# <<: *ghgi_parameters +# selection_fields: +# PrimaryActivity: Electronics Production +# attribution_method: direct + +# EPA_GHGI_T_4_101: # HFCs and PFCs from ODS Substitutes +# <<: *ghgi_parameters +# clean_fba_before_activity_sets: !script_function:temp_data_source_functions clean_hfc_fba # removes HFCs from transportation +# activity_sets: +# household_refrigeration: +# selection_fields: +# PrimaryActivity: Refrigeration/Air Conditioning - Households +# attribution_method: direct + +# non-household_refrigeration: +# selection_fields: +# PrimaryActivity: Refrigeration/Air Conditioning +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea_use +# selection_fields: +# ActivityProducedBy: '333415' # Air conditioning equipment + +# polystyrene_foam: +# selection_fields: +# PrimaryActivity: Foams - Polystyrene +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea_use +# selection_fields: +# ActivityProducedBy: '326140' # Polystyrene foam + +# urethane_foam: +# selection_fields: +# PrimaryActivity: Foams - Urethane +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea_use +# selection_fields: +# ActivityProducedBy: '326150' # Urethane and other foams. + +# EPA_GHGI_T_A_103: # HFCs from Transportation +# <<: *ghgi_parameters +# # clean_fba_before_activity_sets: !script_function:temp_data_source_functions split_hfcs_by_type +# activity_sets: +# passenger_cars: +# selection_fields: +# PrimaryActivity: Passenger Cars +# attribution_method: direct +# trucking: +# selection_fields: +# PrimaryActivity: +# - Light-Duty Trucks +# - Heavy-Duty Vehicles +# activity_to_sector_mapping: EPA_GHGI_trucking +# attribution_method: proportional +# attribution_source: BTS_TSA +# refrigerated_trucks: +# selection_fields: +# PrimaryActivity: Medium- and Heavy-Duty Trucks +# activity_to_sector_mapping: EPA_GHGI_trucking +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea_use +# selection_fields: +# ActivityProducedBy: '333415' # purchases of refrigeration equipment +# other_cooling: +# selection_fields: +# PrimaryActivity: +# - School and Tour Buses +# - Transit Buses +# - Rail +# - Ships and Boats +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea_use +# selection_fields: +# ActivityProducedBy: '333415' # purchases of refrigeration equipment + +# EPA_GHGI_T_4_80: # PFCs from aluminum production +# <<: *ghgi_parameters +# selection_fields: +# PrimaryActivity: Aluminum Production +# attribution_method: direct + +# EPA_GHGI_T_4_84: # HFCs, SF6, CO2 from magnesium production +# <<: *ghgi_parameters +# selection_fields: +# PrimaryActivity: Magnesium Production and Processing +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea_use +# selection_fields: +# ActivityProducedBy: T008 # Gross output. + + BTS_Airlines: selection_fields: - PrimaryActivity: Aluminum Production - attribution_method: direct - - EPA_GHGI_T_4_84: # HFCs, SF6, CO2 from magnesium production - <<: *ghgi_parameters - selection_fields: - PrimaryActivity: Magnesium Production and Processing - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: T008 # Gross output. + Year: *year + emissions_factors: BTS_Airlines_emissions_factors + activity_to_sector_mapping: EPA_GHGI From b4e576dac8ab3d6e3836fca75e85873051299960 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 30 Jun 2022 21:05:10 -0400 Subject: [PATCH 0149/1127] draft 0.2 --- .../flowbysectormethods/SEEA_2017_v1.yaml | 1494 ++++++++--------- 1 file changed, 747 insertions(+), 747 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index b5e1ec6bc..b73eb5bc5 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -58,21 +58,21 @@ _attribution_sources: clean_fba: !script_function:USDA_CoA_Cropland coa_irrigated_cropland_fba_cleanup clean_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics -# sources_to_cache: -# BLS_QCEW: -# selection_fields: -# Class: Employment -# year: 2012 -# clean_fba: !script_function:temp_data_source_functions clean_qcew -# BTS_TSA: -# year: 2017 -# selection_fields: -# Description: -# - In-house truck transportation -# - For-hire truck transportation -# activity_to_sector_mapping: BTS_TSA -# attribution_method: proportional -# attribution_source: BLS_QCEW +sources_to_cache: + BLS_QCEW: + selection_fields: + Class: Employment + year: 2012 + clean_fba: !script_function:temp_data_source_functions clean_qcew + BTS_TSA: + year: 2017 + selection_fields: + Description: + - In-house truck transportation + - For-hire truck transportation + activity_to_sector_mapping: BTS_TSA + attribution_method: proportional + attribution_source: BLS_QCEW source_names: # stewiFBS: @@ -88,221 +88,221 @@ source_names: # reassign_process_to_sectors: # - airplane_emissions -# EPA_GHGI_T_2_1: #U.S. GHG emissions -# <<: *ghgi_parameters -# activity_sets: -# direct_attribution: -# selection_fields: -# PrimaryActivity: -# - Iron and Steel Production & Metallurgical Coke Production #CO2, CH4 -# - Cement Production #CO2 -# - Lime Production #CO2 -# - Ammonia Production #CO2 -# - Incineration of Waste #CO2, #N2O -# - Aluminum Production #CO2 -# - Soda Ash Production #CO2 -# - Ferroalloy Production #CO2, CH4 -# - Titanium Dioxide Production #CO2 -# - Zinc Production #CO2 -# - Phosphoric Acid Production #CO2 -# - Glass Production #CO2 -# - Carbide Production and Consumption #CO2, CH4 -# - Landfills #CH4 -# - Coal Mining #CH4 -# - Wastewater Treatment #CH4, N2O -# - Rice Cultivation #CH4 -# - Abandoned Oil and Gas Wells #CH4 -# - Abandoned Underground Coal Mines #CH4 -# - Anaerobic Digestion at Biogas Facilities #CH4 new activity -# - Composting #CH4, N2O -# - Nitric Acid Production #N2O -# - Adipic Acid Production #N2O -# - Caprolactam, Glyoxal, and Glyoxylic Acid Production #CH4 -# - Electronics Industry #N2O -# FlowName: # HFCs and other flows are attributed elsewhere -# - CO2 -# - CH4 -# - N2O -# attribution_method: direct - -# electric_distribution: -# selection_fields: -# PrimaryActivity: Electrical Transmission and Distribution #SF6 -# FlowName: SF6 -# attribution_method: direct - -# liming: -# selection_fields: -# PrimaryActivity: Liming #CO2 -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea_use -# selection_fields: -# ActivityProducedBy: '327400' - -# urea: -# selection_fields: -# PrimaryActivity: -# - Urea Fertilization #CO2 -# - Urea Consumption for Non-Agricultural Purposes #CO2 -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea_use -# selection_fields: -# ActivityProducedBy: '325310' # Fertilizers - -# carbonate_use: -# selection_fields: -# PrimaryActivity: Other Process Uses of Carbonates #CO2 -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea_use -# selection_fields: -# ActivityProducedBy: '325180' # Other Basic Inorganic Chemicals - -# lead_production: -# selection_fields: -# PrimaryActivity: Lead Production #CO2 -# attribution_method: proportional -# attribution_source: -# USGS_MYB_Lead: -# year: 2016 -# selection_fields: -# ActivityProducedBy: -# - Primary lead, refined content, domestic ores and base bullion -# - Secondary lead, lead content - -# nitrous_oxide_use: -# selection_fields: -# PrimaryActivity: N2O from Product Uses #N2O -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea_use -# selection_fields: -# ActivityProducedBy: '325120' # Industrial gases - -# ## Fossil Fuels -# EPA_GHGI_T_3_63: &natgas #CH4 from Natural Gas Systems -# <<: *ghgi_parameters -# selection_fields: -# PrimaryActivity: -# - Distribution -# - Exploration -# - Processing -# - Production -# - Transmission and Storage -# attribution_method: direct -# EPA_GHGI_T_3_65: *natgas #CO2 from Natural Gas Systems mimics CH4 -# EPA_GHGI_T_3_67: *natgas #N2O from Natural Gas Systems, not used in original method, mimics CH4 - -# EPA_GHGI_T_3_38: &petroleum #CH4 from Petroleum Systems -# <<: *ghgi_parameters -# selection_fields: -# PrimaryActivity: -# - Crude Oil Transportation -# - Exploration -# - Production -# - Refining -# attribution_method: direct -# EPA_GHGI_T_3_40: *petroleum #CO2 from Petroleum Systems mimics CH4 -# EPA_GHGI_T_3_42: *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 - -# ## Stationary Combustion (note that CO2 is electric power only) -# EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion -# <<: *ghgi_parameters -# clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion -# activity_sets: -# direct_attribution: -# selection_fields: -# PrimaryActivity: -# - Fuel Oil Residential -# - Coal Residential -# - Natural Gas Residential -# - Wood Residential -# attribution_method: direct -# electric_power: &stationary_electric -# selection_fields: -# PrimaryActivity: -# - Coal Electric Power -# - Natural Gas Electric Power -# - Natural gas Electric Power # note lower case -# - Fuel Oil Electric Power -# - Geothermal Electric Power -# - Wood Electric Power -# activity_to_sector_mapping: EPA_GHGI_m2 -# attribution_method: direct -# fuel_oil: -# selection_fields: -# PrimaryActivity: -# - Fuel Oil Commercial -# - Fuel Oil Industrial -# attribution_methods: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea_use -# selection_fields: -# ActivityProducedBy: '324110' # purchases of refinery products -# natural_gas: -# selection_fields: -# PrimaryActivity: -# - Natural gas Commercial -# - Natural gas Industrial -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea_use -# selection_fields: -# ActivityProducedBy: '221200' # purchases of natural gas -# coal: -# selection_fields: -# PrimaryActivity: Coal Industrial -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea_use -# selection_fields: -# ActivityProducedBy: '212100' # purchases of coal -# coal_manufacturing: -# selection_fields: -# PrimaryActivity: Coal Industrial - Manufacturing -# attribution_method: proportional -# attribution_source: -# EIA_MECS_Energy: -# <<: *mecs_energy -# selection_fields: -# <<: *mecs_energy_default_selection -# FlowName: Coal -# natural_gas_manufacturing: -# selection_fields: -# PrimaryActivity: Natural gas Industrial - Manufacturing -# attribution_method: proportional -# attribution_source: -# EIA_MECS_Energy: -# <<: *mecs_energy -# selection_fields: -# <<: *mecs_energy_default_selection -# FlowName: Natural Gas -# EPA_GHGI_T_3_9: # N2O emissions from stationary combustion -# <<: *stationary_combustion -# EPA_GHGI_T_3_7: # CO2 emissions from stationary combustion (electricity only) -# <<: [*ghgi_parameters, *stationary_electric] - -# # ## Agriculture -# EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues -# <<: *ghgi_parameters -# attribution_method: direct -# selection_fields: -# PrimaryActivity: -# - Chickpeas -# - Cotton -# - Maize -# - Rice -# - Soybeans -# - Wheat + EPA_GHGI_T_2_1: #U.S. GHG emissions + <<: *ghgi_parameters + activity_sets: + direct_attribution: + selection_fields: + PrimaryActivity: + - Iron and Steel Production & Metallurgical Coke Production #CO2, CH4 + - Cement Production #CO2 + - Lime Production #CO2 + - Ammonia Production #CO2 + - Incineration of Waste #CO2, #N2O + - Aluminum Production #CO2 + - Soda Ash Production #CO2 + - Ferroalloy Production #CO2, CH4 + - Titanium Dioxide Production #CO2 + - Zinc Production #CO2 + - Phosphoric Acid Production #CO2 + - Glass Production #CO2 + - Carbide Production and Consumption #CO2, CH4 + - Landfills #CH4 + - Coal Mining #CH4 + - Wastewater Treatment #CH4, N2O + - Rice Cultivation #CH4 + - Abandoned Oil and Gas Wells #CH4 + - Abandoned Underground Coal Mines #CH4 + - Anaerobic Digestion at Biogas Facilities #CH4 new activity + - Composting #CH4, N2O + - Nitric Acid Production #N2O + - Adipic Acid Production #N2O + - Caprolactam, Glyoxal, and Glyoxylic Acid Production #CH4 + - Electronics Industry #N2O + FlowName: # HFCs and other flows are attributed elsewhere + - CO2 + - CH4 + - N2O + attribution_method: direct + + electric_distribution: + selection_fields: + PrimaryActivity: Electrical Transmission and Distribution #SF6 + FlowName: SF6 + attribution_method: direct + + liming: + selection_fields: + PrimaryActivity: Liming #CO2 + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '327400' + + urea: + selection_fields: + PrimaryActivity: + - Urea Fertilization #CO2 + - Urea Consumption for Non-Agricultural Purposes #CO2 + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '325310' # Fertilizers + + carbonate_use: + selection_fields: + PrimaryActivity: Other Process Uses of Carbonates #CO2 + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '325180' # Other Basic Inorganic Chemicals + + lead_production: + selection_fields: + PrimaryActivity: Lead Production #CO2 + attribution_method: proportional + attribution_source: + USGS_MYB_Lead: + year: 2016 + selection_fields: + ActivityProducedBy: + - Primary lead, refined content, domestic ores and base bullion + - Secondary lead, lead content + + nitrous_oxide_use: + selection_fields: + PrimaryActivity: N2O from Product Uses #N2O + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '325120' # Industrial gases + +## Fossil Fuels + EPA_GHGI_T_3_63: &natgas #CH4 from Natural Gas Systems + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: + - Distribution + - Exploration + - Processing + - Production + - Transmission and Storage + attribution_method: direct + EPA_GHGI_T_3_65: *natgas #CO2 from Natural Gas Systems mimics CH4 + EPA_GHGI_T_3_67: *natgas #N2O from Natural Gas Systems, not used in original method, mimics CH4 + + EPA_GHGI_T_3_38: &petroleum #CH4 from Petroleum Systems + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: + - Crude Oil Transportation + - Exploration + - Production + - Refining + attribution_method: direct + EPA_GHGI_T_3_40: *petroleum #CO2 from Petroleum Systems mimics CH4 + EPA_GHGI_T_3_42: *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 + +## Stationary Combustion (note that CO2 is electric power only) + EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion + <<: *ghgi_parameters + clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion + activity_sets: + direct_attribution: + selection_fields: + PrimaryActivity: + - Fuel Oil Residential + - Coal Residential + - Natural Gas Residential + - Wood Residential + attribution_method: direct + electric_power: &stationary_electric + selection_fields: + PrimaryActivity: + - Coal Electric Power + - Natural Gas Electric Power + - Natural gas Electric Power # note lower case + - Fuel Oil Electric Power + - Geothermal Electric Power + - Wood Electric Power + activity_to_sector_mapping: EPA_GHGI_m2 + attribution_method: direct + fuel_oil: + selection_fields: + PrimaryActivity: + - Fuel Oil Commercial + - Fuel Oil Industrial + attribution_methods: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # purchases of refinery products + natural_gas: + selection_fields: + PrimaryActivity: + - Natural gas Commercial + - Natural gas Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '221200' # purchases of natural gas + coal: + selection_fields: + PrimaryActivity: Coal Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '212100' # purchases of coal + coal_manufacturing: + selection_fields: + PrimaryActivity: Coal Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Coal + natural_gas_manufacturing: + selection_fields: + PrimaryActivity: Natural gas Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Natural Gas + EPA_GHGI_T_3_9: # N2O emissions from stationary combustion + <<: *stationary_combustion + EPA_GHGI_T_3_7: # CO2 emissions from stationary combustion (electricity only) + <<: [*ghgi_parameters, *stationary_electric] + +# ## Agriculture + EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues + <<: *ghgi_parameters + attribution_method: direct + selection_fields: + PrimaryActivity: + - Chickpeas + - Cotton + - Maize + - Rice + - Soybeans + - Wheat EPA_GHGI_T_5_3: &animals #CH4 from Enteric Fermentation <<: *ghgi_parameters @@ -320,523 +320,523 @@ source_names: - Poultry EPA_GHGI_T_5_7: *animals #CH4 and N2O from manure, mimics enteric fermentation -# EPA_GHGI_T_5_18: #Direct N2O emissions from agricultural soils -# <<: *ghgi_parameters -# activity_sets: -# fertilizer_use: &fertilizer # allocated based on fertilizer use -# selection_fields: -# PrimaryActivity: -# - Organic Amendment Cropland -# - Residue N Cropland -# - Synthetic Fertilizer Cropland -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea_use -# selection_fields: -# ActivityProducedBy: -# - '325310' -# cropland: -# selection_fields: -# PrimaryActivity: -# - Mineralization and Asymbiotic Fixation Cropland -# - Drained Organic Soils Cropland -# attribution_method: proportional -# attribution_source: -# USDA_CoA_Cropland: -# <<: *usda_cropland -# pasture: &pasture -# selection_fields: -# PrimaryActivity: -# - All activities Grassland -# attribution_method: proportional -# attribution_source: -# USDA_CoA_Cropland_NAICS: -# <<: *usda_pasture -# EPA_GHGI_T_5_19: #Indirect N2O emissions from agricultural soils -# <<: *ghgi_parameters -# activity_sets: -# fertilizer_use: # allocated based on fertilizer use -# <<: *fertilizer -# selection_fields: -# PrimaryActivity: -# - Volatilization & Atm. Deposition Cropland -# - Surface Leaching & Run-Off Cropland -# pasture: -# <<: *pasture - -# ## Mobile Sources (N20 and CH4) -# EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion -# <<: *ghgi_parameters -# activity_sets: -# direct_attribution: # Some of these need to be separated and attributed differently -# selection_fields: -# PrimaryActivity: -# - Passenger Cars Gasoline On-Road -# - Rail Non-Road -# - Ships and Boats Non-Road -# - Aircraft Non-Road -# attribution_method: direct - -# trucking: -# selection_fields: -# PrimaryActivity: -# - Light-Duty Trucks Gasoline On-Road -# - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road -# activity_to_sector_mapping: EPA_GHGI_trucking -# attribution_method: proportional -# attribution_source: BTS_TSA - -# construction_and_mining: -# selection_fields: -# PrimaryActivity: Construction/Mining Equipment Non-Road -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea_use -# selection_fields: -# ActivityProducedBy: '333120' # purchases of construction/mining equipment - -# farm_non_road: -# selection_fields: -# PrimaryActivity: Agricultural Equipment Non-Road -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea_use -# selection_fields: -# ActivityProducedBy: '333111' # purchases of farm machinery - -# other_non_road: # attributed by purchases of petroleum refinery products -# selection_fields: -# PrimaryActivity: Other Non-Road -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea_use -# selection_fields: -# ActivityProducedBy: '324110' # purchases of refinery products - -# alt_fuel_on_road: # assumes natural gas is primary alternate fuel -# selection_fields: -# PrimaryActivity: -# - Alternative Fuel On-Road -# - All activities Alternative Fuel On-Road -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea_use -# selection_fields: -# ActivityProducedBy: '221200' # purchases of natural gas -# EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 - -# # Major CO2 Sources -# EPA_GHGI_T_A_13: # (2017 specific table) CO2 emissions from stationary combustion and transportation -# <<: *ghgi_parameters -# clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion -# activity_sets: -# direct_attribution: -# selection_fields: -# PrimaryActivity: Total (All Fuels) Residential -# attribution_method: direct -# non-manufacturing_coal: -# selection_fields: -# PrimaryActivity: -# - Commercial Coal Commercial -# - Industrial Other Coal Industrial -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea_use -# selection_fields: -# ActivityProducedBy: '212100' # purchases of coal -# non-manufacturing_natural_gas: -# selection_fields: -# PrimaryActivity: -# - Natural Gas Commercial -# - Natural Gas Industrial -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea_use -# selection_fields: -# ActivityProducedBy: '221200' # purchases of natural gas -# non-manufacturing_petroleum: -# selection_fields: -# PrimaryActivity: -# - Total Petroleum Commercial -# - Total Petroleum Industrial -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea_use -# selection_fields: -# ActivityProducedBy: '324110' # purchases of refinery products -# manufacturing_coal: # Industrial Coal for Manufacturing -# selection_fields: -# PrimaryActivity: -# - Industrial Other Coal Industrial - Manufacturing -# attribution_method: proportional -# attribution_source: -# EIA_MECS_Energy: -# <<: *mecs_energy -# selection_fields: -# <<: *mecs_energy_default_selection -# FlowName: Coal -# manufacturing_natural_gas: # Industrial Natural Gas for manufacturing -# selection_fields: -# PrimaryActivity: -# - Natural Gas Industrial - Manufacturing -# attribution_method: proportional -# attribution_source: -# EIA_MECS_Energy: -# <<: *mecs_energy -# selection_fields: -# <<: *mecs_energy_default_selection -# FlowName: Natural Gas - -# ## Transportation -# natural_gas_transportation: -# selection_fields: -# PrimaryActivity: Natural Gas Transportation -# attribution_method: proportional -# attribution_source: -# EPA_GHGI_T_A_79: -# <<: *t_a_79 -# selection_fields: -# FlowName: Natural Gas - -# aviation_gas_transportation: -# selection_fields: -# PrimaryActivity: Aviation Gasoline Transportation -# attribution_method: proportional -# attribution_source: -# EPA_GHGI_T_A_79: -# <<: *t_a_79 -# selection_fields: -# FlowName: Aviation Gasoline - -# jet_fuel_transportation: -# selection_fields: -# PrimaryActivity: Jet Fuel Transportation -# attribution_method: proportional -# attribution_source: -# EPA_GHGI_T_A_79: -# <<: *t_a_79 -# selection_fields: -# FlowName: Jet Fuel - -# propane_transportation: -# selection_fields: -# PrimaryActivity: LPG (Propane) Transportation -# attribution_method: proportional -# attribution_source: -# EPA_GHGI_T_A_79: -# <<: *t_a_79 -# selection_fields: -# FlowName: LPG - -# residual_fuel_transportation: -# selection_fields: -# PrimaryActivity: Residual Fuel Transportation -# attribution_method: proportional -# attribution_source: -# EPA_GHGI_T_A_79: -# <<: *t_a_79 -# selection_fields: -# FlowName: Residual Fuel Oil - -# distillate_fuel_transportation: -# selection_fields: -# PrimaryActivity: -# - Distillate Fuel Oil Transportation -# activity_to_sector_mapping: EPA_GHGI_trucking -# attribution_method: proportional -# attribution_source: -# EPA_GHGI_T_A_79: -# <<: *t_a_79 -# activity_to_sector_mapping: EPA_GHGI -# activity_sets: -# direct_attribution: -# selection_fields: -# FlowName: Distillate Fuel Oil (Diesel Fuel) -# PrimaryActivity: -# - Passenger Cars -# - Rail -# - Recreational Boats -# - Ships and Non-Recreational Boats -# attribution_method: direct -# trucking: -# selection_fields: -# FlowName: Distillate Fuel Oil (Diesel Fuel) -# PrimaryActivity: -# - Light-Duty Trucks -# - Medium- and Heavy-Duty Trucks -# activity_to_sector_mapping: EPA_GHGI_trucking -# attribution_method: proportional -# attribution_source: BTS_TSA -# buses: -# selection_fields: -# FlowName: Distillate Fuel Oil (Diesel Fuel) -# PrimaryActivity: Buses -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea_use -# selection_fields: -# ActivityProducedBy: '324110' # use of petroleum products - -# motor_gasoline_transportation: -# selection_fields: -# PrimaryActivity: -# - Motor Gasoline Transportation -# activity_to_sector_mapping: EPA_GHGI_trucking -# attribution_method: proportional -# attribution_source: -# EPA_GHGI_T_A_79: -# <<: *t_a_79 -# activity_to_sector_mapping: EPA_GHGI -# activity_sets: -# direct_attribution: -# selection_fields: -# FlowName: Motor Gasoline -# PrimaryActivity: -# - Passenger Cars -# - Motorcycles -# - Recreational Boats -# attribution_method: direct -# trucking: -# selection_fields: -# FlowName: Motor Gasoline -# PrimaryActivity: -# - Light-Duty Trucks -# - Medium- and Heavy-Duty Trucks -# activity_to_sector_mapping: EPA_GHGI_trucking -# attribution_method: proportional -# attribution_source: BTS_TSA -# buses: -# selection_fields: -# FlowName: Motor Gasoline -# PrimaryActivity: Buses -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea_use -# selection_fields: -# ActivityProducedBy: '324110' # use of petroleum products - -# ## Other sources -# EPA_GHGI_T_4_46: #CO2 for selected petrochemicals -# <<: *ghgi_parameters -# selection_fields: -# PrimaryActivity: -# - Acrylonitrile -# - Carbon Black -# - Ethylene -# - Ethylene Dichloride -# - Ethylene Oxide -# - Methanol -# attribution_method: direct - -# EPA_GHGI_T_3_22b: #Fossil fuel for non-energy uses -# <<: *ghgi_parameters -# activity_sets: -# coal: -# selection_fields: -# PrimaryActivity: -# - Industry Industrial Coking Coal -# - Industry Industrial Other Coal -# attribution_method: direct - -# distillate_fuel_feedstocks: -# selection_fields: -# PrimaryActivity: Industry Distillate Fuel Oil -# attribution_method: proportional -# attribution_source: -# EIA_MECS_Energy: -# <<: *mecs_energy -# selection_fields: -# Class: Other -# Unit: Trillion Btu -# FlowName: Distillate Fuel Oil - -# hgl_feedstocks: -# selection_fields: -# PrimaryActivity: -# - Industry LPG -# - Industry Pentanes Plus -# attribution_method: proportional -# attribution_source: -# EIA_MECS_Energy: -# <<: *mecs_energy -# selection_fields: -# Class: Other -# Unit: Trillion Btu -# FlowName: Hydrocarbon Gas Liquids, excluding natural gasoline - -# petroleum_coke_feedstocks: -# selection_fields: -# PrimaryActivity: Industry Petroleum Coke -# attribution_method: proportional -# attribution_source: -# EIA_MECS_Energy: -# <<: *mecs_energy -# selection_fields: -# Class: Other -# Unit: Trillion Btu -# FlowName: Coke and Breeze - -# natural_gas_feedstocks: -# selection_fields: -# PrimaryActivity: -# - Industry Still Gas -# - Industry Natural Gas to Chemical Plants -# attribution_method: proportional -# attribution_source: -# EIA_MECS_Energy: -# <<: *mecs_energy -# selection_fields: -# Class: Other -# Unit: Trillion Btu -# FlowName: Natural Gas - -# other_petroleum_feedstocks: -# selection_fields: -# PrimaryActivity: -# - Industry Asphalt & Road Oil -# - Industry Lubricants -# - Industry Miscellaneous Products -# - Industry Naphtha (<401 F) -# - Industry Other Oil (>401 F) -# - Industry Special Naphtha -# - Industry Waxes -# attribution_method: proportional -# attribution_source: -# EIA_MECS_Energy: -# <<: *mecs_energy -# selection_fields: -# Class: Other -# Unit: Trillion Btu -# FlowName: Other - -# transportation_lubricants: -# selection_fields: -# PrimaryActivity: Transportation Lubricants -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea_use -# selection_fields: -# ActivityProducedBy: '324110' # use of petroleum products - -# EPA_GHGI_T_4_50: # HFCs from HCFC-22 production -# <<: *ghgi_parameters -# selection_fields: -# Unit: MMT CO2e -# PrimaryActivity: HCFC-22 Production -# attribution_method: direct - -# EPA_GHGI_T_4_94: # HFCs and other emissions from electronics manufacture -# <<: *ghgi_parameters -# selection_fields: -# PrimaryActivity: Electronics Production -# attribution_method: direct - -# EPA_GHGI_T_4_101: # HFCs and PFCs from ODS Substitutes -# <<: *ghgi_parameters -# clean_fba_before_activity_sets: !script_function:temp_data_source_functions clean_hfc_fba # removes HFCs from transportation -# activity_sets: -# household_refrigeration: -# selection_fields: -# PrimaryActivity: Refrigeration/Air Conditioning - Households -# attribution_method: direct - -# non-household_refrigeration: -# selection_fields: -# PrimaryActivity: Refrigeration/Air Conditioning -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea_use -# selection_fields: -# ActivityProducedBy: '333415' # Air conditioning equipment - -# polystyrene_foam: -# selection_fields: -# PrimaryActivity: Foams - Polystyrene -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea_use -# selection_fields: -# ActivityProducedBy: '326140' # Polystyrene foam - -# urethane_foam: -# selection_fields: -# PrimaryActivity: Foams - Urethane -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea_use -# selection_fields: -# ActivityProducedBy: '326150' # Urethane and other foams. - -# EPA_GHGI_T_A_103: # HFCs from Transportation -# <<: *ghgi_parameters -# # clean_fba_before_activity_sets: !script_function:temp_data_source_functions split_hfcs_by_type -# activity_sets: -# passenger_cars: -# selection_fields: -# PrimaryActivity: Passenger Cars -# attribution_method: direct -# trucking: -# selection_fields: -# PrimaryActivity: -# - Light-Duty Trucks -# - Heavy-Duty Vehicles -# activity_to_sector_mapping: EPA_GHGI_trucking -# attribution_method: proportional -# attribution_source: BTS_TSA -# refrigerated_trucks: -# selection_fields: -# PrimaryActivity: Medium- and Heavy-Duty Trucks -# activity_to_sector_mapping: EPA_GHGI_trucking -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea_use -# selection_fields: -# ActivityProducedBy: '333415' # purchases of refrigeration equipment -# other_cooling: -# selection_fields: -# PrimaryActivity: -# - School and Tour Buses -# - Transit Buses -# - Rail -# - Ships and Boats -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea_use -# selection_fields: -# ActivityProducedBy: '333415' # purchases of refrigeration equipment - -# EPA_GHGI_T_4_80: # PFCs from aluminum production -# <<: *ghgi_parameters -# selection_fields: -# PrimaryActivity: Aluminum Production -# attribution_method: direct - -# EPA_GHGI_T_4_84: # HFCs, SF6, CO2 from magnesium production -# <<: *ghgi_parameters -# selection_fields: -# PrimaryActivity: Magnesium Production and Processing -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea_use -# selection_fields: -# ActivityProducedBy: T008 # Gross output. + EPA_GHGI_T_5_18: #Direct N2O emissions from agricultural soils + <<: *ghgi_parameters + activity_sets: + fertilizer_use: &fertilizer # allocated based on fertilizer use + selection_fields: + PrimaryActivity: + - Organic Amendment Cropland + - Residue N Cropland + - Synthetic Fertilizer Cropland + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: + - '325310' + cropland: + selection_fields: + PrimaryActivity: + - Mineralization and Asymbiotic Fixation Cropland + - Drained Organic Soils Cropland + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland: + <<: *usda_cropland + pasture: &pasture + selection_fields: + PrimaryActivity: + - All activities Grassland + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + <<: *usda_pasture + EPA_GHGI_T_5_19: #Indirect N2O emissions from agricultural soils + <<: *ghgi_parameters + activity_sets: + fertilizer_use: # allocated based on fertilizer use + <<: *fertilizer + selection_fields: + PrimaryActivity: + - Volatilization & Atm. Deposition Cropland + - Surface Leaching & Run-Off Cropland + pasture: + <<: *pasture + +## Mobile Sources (N20 and CH4) + EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion + <<: *ghgi_parameters + activity_sets: + direct_attribution: # Some of these need to be separated and attributed differently + selection_fields: + PrimaryActivity: + - Passenger Cars Gasoline On-Road + - Rail Non-Road + - Ships and Boats Non-Road + # - Aircraft Non-Road + attribution_method: direct + + trucking: + selection_fields: + PrimaryActivity: + - Light-Duty Trucks Gasoline On-Road + - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: BTS_TSA + + construction_and_mining: + selection_fields: + PrimaryActivity: Construction/Mining Equipment Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333120' # purchases of construction/mining equipment + + farm_non_road: + selection_fields: + PrimaryActivity: Agricultural Equipment Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333111' # purchases of farm machinery + + other_non_road: # attributed by purchases of petroleum refinery products + selection_fields: + PrimaryActivity: Other Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # purchases of refinery products + + alt_fuel_on_road: # assumes natural gas is primary alternate fuel + selection_fields: + PrimaryActivity: + - Alternative Fuel On-Road + - All activities Alternative Fuel On-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '221200' # purchases of natural gas + EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 + +# Major CO2 Sources + EPA_GHGI_T_A_13: # (2017 specific table) CO2 emissions from stationary combustion and transportation + <<: *ghgi_parameters + clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion + activity_sets: + direct_attribution: + selection_fields: + PrimaryActivity: Total (All Fuels) Residential + attribution_method: direct + non-manufacturing_coal: + selection_fields: + PrimaryActivity: + - Commercial Coal Commercial + - Industrial Other Coal Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '212100' # purchases of coal + non-manufacturing_natural_gas: + selection_fields: + PrimaryActivity: + - Natural Gas Commercial + - Natural Gas Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '221200' # purchases of natural gas + non-manufacturing_petroleum: + selection_fields: + PrimaryActivity: + - Total Petroleum Commercial + - Total Petroleum Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # purchases of refinery products + manufacturing_coal: # Industrial Coal for Manufacturing + selection_fields: + PrimaryActivity: + - Industrial Other Coal Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Coal + manufacturing_natural_gas: # Industrial Natural Gas for manufacturing + selection_fields: + PrimaryActivity: + - Natural Gas Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Natural Gas + + ## Transportation + natural_gas_transportation: + selection_fields: + PrimaryActivity: Natural Gas Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + selection_fields: + FlowName: Natural Gas + + aviation_gas_transportation: + selection_fields: + PrimaryActivity: Aviation Gasoline Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + selection_fields: + FlowName: Aviation Gasoline + + # jet_fuel_transportation: + # selection_fields: + # PrimaryActivity: Jet Fuel Transportation + # attribution_method: proportional + # attribution_source: + # EPA_GHGI_T_A_79: + # <<: *t_a_79 + # selection_fields: + # FlowName: Jet Fuel + + propane_transportation: + selection_fields: + PrimaryActivity: LPG (Propane) Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + selection_fields: + FlowName: LPG + + residual_fuel_transportation: + selection_fields: + PrimaryActivity: Residual Fuel Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + selection_fields: + FlowName: Residual Fuel Oil + + distillate_fuel_transportation: + selection_fields: + PrimaryActivity: + - Distillate Fuel Oil Transportation + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + activity_to_sector_mapping: EPA_GHGI + activity_sets: + direct_attribution: + selection_fields: + FlowName: Distillate Fuel Oil (Diesel Fuel) + PrimaryActivity: + - Passenger Cars + - Rail + - Recreational Boats + - Ships and Non-Recreational Boats + attribution_method: direct + trucking: + selection_fields: + FlowName: Distillate Fuel Oil (Diesel Fuel) + PrimaryActivity: + - Light-Duty Trucks + - Medium- and Heavy-Duty Trucks + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: BTS_TSA + buses: + selection_fields: + FlowName: Distillate Fuel Oil (Diesel Fuel) + PrimaryActivity: Buses + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # use of petroleum products + + motor_gasoline_transportation: + selection_fields: + PrimaryActivity: + - Motor Gasoline Transportation + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + activity_to_sector_mapping: EPA_GHGI + activity_sets: + direct_attribution: + selection_fields: + FlowName: Motor Gasoline + PrimaryActivity: + - Passenger Cars + - Motorcycles + - Recreational Boats + attribution_method: direct + trucking: + selection_fields: + FlowName: Motor Gasoline + PrimaryActivity: + - Light-Duty Trucks + - Medium- and Heavy-Duty Trucks + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: BTS_TSA + buses: + selection_fields: + FlowName: Motor Gasoline + PrimaryActivity: Buses + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # use of petroleum products + +## Other sources + EPA_GHGI_T_4_46: #CO2 for selected petrochemicals + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: + - Acrylonitrile + - Carbon Black + - Ethylene + - Ethylene Dichloride + - Ethylene Oxide + - Methanol + attribution_method: direct + + EPA_GHGI_T_3_22b: #Fossil fuel for non-energy uses + <<: *ghgi_parameters + activity_sets: + coal: + selection_fields: + PrimaryActivity: + - Industry Industrial Coking Coal + - Industry Industrial Other Coal + attribution_method: direct + + distillate_fuel_feedstocks: + selection_fields: + PrimaryActivity: Industry Distillate Fuel Oil + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: Distillate Fuel Oil + + hgl_feedstocks: + selection_fields: + PrimaryActivity: + - Industry LPG + - Industry Pentanes Plus + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: Hydrocarbon Gas Liquids, excluding natural gasoline + + petroleum_coke_feedstocks: + selection_fields: + PrimaryActivity: Industry Petroleum Coke + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: Coke and Breeze + + natural_gas_feedstocks: + selection_fields: + PrimaryActivity: + - Industry Still Gas + - Industry Natural Gas to Chemical Plants + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: Natural Gas + + other_petroleum_feedstocks: + selection_fields: + PrimaryActivity: + - Industry Asphalt & Road Oil + - Industry Lubricants + - Industry Miscellaneous Products + - Industry Naphtha (<401 F) + - Industry Other Oil (>401 F) + - Industry Special Naphtha + - Industry Waxes + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: Other + + transportation_lubricants: + selection_fields: + PrimaryActivity: Transportation Lubricants + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # use of petroleum products + + EPA_GHGI_T_4_50: # HFCs from HCFC-22 production + <<: *ghgi_parameters + selection_fields: + Unit: MMT CO2e + PrimaryActivity: HCFC-22 Production + attribution_method: direct + + EPA_GHGI_T_4_94: # HFCs and other emissions from electronics manufacture + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: Electronics Production + attribution_method: direct + + EPA_GHGI_T_4_101: # HFCs and PFCs from ODS Substitutes + <<: *ghgi_parameters + clean_fba_before_activity_sets: !script_function:temp_data_source_functions clean_hfc_fba # removes HFCs from transportation + activity_sets: + household_refrigeration: + selection_fields: + PrimaryActivity: Refrigeration/Air Conditioning - Households + attribution_method: direct + + non-household_refrigeration: + selection_fields: + PrimaryActivity: Refrigeration/Air Conditioning + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333415' # Air conditioning equipment + + polystyrene_foam: + selection_fields: + PrimaryActivity: Foams - Polystyrene + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '326140' # Polystyrene foam + + urethane_foam: + selection_fields: + PrimaryActivity: Foams - Urethane + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '326150' # Urethane and other foams. + + EPA_GHGI_T_A_103: # HFCs from Transportation + <<: *ghgi_parameters + # clean_fba_before_activity_sets: !script_function:temp_data_source_functions split_hfcs_by_type + activity_sets: + passenger_cars: + selection_fields: + PrimaryActivity: Passenger Cars + attribution_method: direct + trucking: + selection_fields: + PrimaryActivity: + - Light-Duty Trucks + - Heavy-Duty Vehicles + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: BTS_TSA + refrigerated_trucks: + selection_fields: + PrimaryActivity: Medium- and Heavy-Duty Trucks + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333415' # purchases of refrigeration equipment + other_cooling: + selection_fields: + PrimaryActivity: + - School and Tour Buses + - Transit Buses + - Rail + - Ships and Boats + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333415' # purchases of refrigeration equipment + + EPA_GHGI_T_4_80: # PFCs from aluminum production + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: Aluminum Production + attribution_method: direct + + EPA_GHGI_T_4_84: # HFCs, SF6, CO2 from magnesium production + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: Magnesium Production and Processing + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: T008 # Gross output. BTS_Airlines: selection_fields: From 795f2e239ff04da92452b2b6e6cd3e5cc19bf892 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 1 Jul 2022 08:56:22 -0400 Subject: [PATCH 0150/1127] Small correction to alternative fuel on road --- .../NAICS_Crosswalk_EPA_GHGI.csv | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv index 388c92b3c..0a89da571 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv @@ -47,11 +47,11 @@ EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,111,,"111, 112, 113, 11 EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,112,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,113,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,114,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,485,,"485000, 486000, 48A000, 492000","EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,486,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,487,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,488,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,492,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,All activities Alternative Fuel On-Road,NAICS_2012_Code,485,,"485000, 486000, 48A000, 492000","EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,All activities Alternative Fuel On-Road,NAICS_2012_Code,486,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,All activities Alternative Fuel On-Road,NAICS_2012_Code,487,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,All activities Alternative Fuel On-Road,NAICS_2012_Code,488,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,All activities Alternative Fuel On-Road,NAICS_2012_Code,492,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Construction/Mining Equipment Non-Road,NAICS_2012_Code,211,,"211000, 212100, 2122A0, 212230, 212310, 2123AO, 213111","EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Construction/Mining Equipment Non-Road,NAICS_2012_Code,212,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Construction/Mining Equipment Non-Road,NAICS_2012_Code,213111,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" From 991a94f943f9604b6d186ef7bdc0f4e7252cc4f5 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 1 Jul 2022 08:57:05 -0400 Subject: [PATCH 0151/1127] Fixed alternative fuel on road, emissions from electronics manufacturing, and tA103 other cooling --- flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index b73eb5bc5..59065b4cb 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -420,7 +420,6 @@ source_names: alt_fuel_on_road: # assumes natural gas is primary alternate fuel selection_fields: PrimaryActivity: - - Alternative Fuel On-Road - All activities Alternative Fuel On-Road attribution_method: proportional attribution_source: @@ -739,7 +738,11 @@ source_names: EPA_GHGI_T_4_94: # HFCs and other emissions from electronics manufacture <<: *ghgi_parameters selection_fields: - PrimaryActivity: Electronics Production + FlowName: + - SF6 + - Total F-GHGs + - NF3 + - N2O[2] attribution_method: direct EPA_GHGI_T_4_101: # HFCs and PFCs from ODS Substitutes @@ -811,7 +814,7 @@ source_names: selection_fields: PrimaryActivity: - School and Tour Buses - - Transit Buses + # - Transit Buses # crosswalk marks these as excluded; I'm not at all sure why - Rail - Ships and Boats attribution_method: proportional From d65f726583f4f18a847a225578b88b3155df1e2c Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 6 Jul 2022 10:31:50 -0400 Subject: [PATCH 0152/1127] switched back to MMT CO2e --- flowsa/data/unit_conversion.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/data/unit_conversion.csv b/flowsa/data/unit_conversion.csv index 7a813cd14..b5ea767cc 100644 --- a/flowsa/data/unit_conversion.csv +++ b/flowsa/data/unit_conversion.csv @@ -16,5 +16,5 @@ gal/USD,kg/USD,3.79 Quadrillion Btu,MJ,1.05506E+12 Trillion Btu,MJ,1055055900 Tbtu,MJ,1055055900 -MMT CO2e,MT CO2e,1000000 +MT CO2e,MMT CO2e,0.000001 p,employees,1 From d5f4d659053ea1469e35b245b48b1c7d61b6d659 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 6 Jul 2022 10:50:20 -0400 Subject: [PATCH 0153/1127] Updated SEEA method and added SEEA_kg method (with hand residency adjustment :-( ) --- .../flowbysectormethods/SEEA_2017_kg_v1.yaml | 854 ++++++++++++++++++ .../flowbysectormethods/SEEA_2017_v1.yaml | 14 +- 2 files changed, 863 insertions(+), 5 deletions(-) create mode 100644 flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml new file mode 100644 index 000000000..2582406aa --- /dev/null +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml @@ -0,0 +1,854 @@ +%YAML 1.1 + +--- +# m2 for the GHG national replicates the method used in the National GHG Industry Attribution Model +#(https://doi.org/10.23719/1517571), except that sector attribution is to 6-digit NAICS, +# rather than the BEA 2012 IO schema + +# !include:BEA_summary_target.yaml +industry_spec: + default: NAICS_3 + '336': {default: NAICS_4} + '541': {default: NAICS_4} +# industry_spec: +# default: NAICS_4 +target_naics_year: 2012 +geoscale: national + +_ghgi_parameters: &ghgi_parameters + geoscale: national + year: &year 2017 + fedefl_mapping: 'GHGI' + +_attribution_sources: + BEA_Use_Detail_PRO_BeforeRedef: &bea_use + year: 2012 + activity_to_sector_mapping: BEA_2012_Detail + attribution_method: proportional + attribution_source: BLS_QCEW + EPA_GHGI_T_A_79: &t_a_79 + attribution_method: proportional + attribution_source: BLS_QCEW + EIA_MECS_Energy: &mecs_energy + year: 2014 + selection_fields: &mecs_energy_default_selection + Class: Energy + Unit: Trillion Btu + clean_fba: !script_function:temp_data_source_functions clean_mecs_energy_fba_for_bea_summary + clean_fba_w_sec: !script_function:temp_data_source_functions clean_mapped_mecs_energy_fba_for_bea_summary + attribution_method: proportional # cleaning fxns remove need for proportional-flagged IF industry_spec is BEA summary + attribution_source: BLS_QCEW + USDA_CoA_Cropland_NAICS: &usda_pasture # allocated based on USDA Animal operation land (acres) + selection_fields: + Class: + - Land + FlowName: + - FARM OPERATIONS + year: 2017 + clean_fba: !script_function:temp_data_source_functions clean_usda_cropland_naics + USDA_CoA_Cropland: &usda_cropland + selection_fields: + Class: + - Land + FlowName: + - AREA HARVESTED + - AREA BEARING & NON-BEARING # Orchards + - AREA GROWN # Berry totals + - AREA IN PRODUCTION # Vegetable totals + year: 2017 + clean_fba: !script_function:USDA_CoA_Cropland coa_irrigated_cropland_fba_cleanup + clean_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics + +sources_to_cache: + BLS_QCEW: + selection_fields: + Class: Employment + year: 2012 + clean_fba: !script_function:temp_data_source_functions clean_qcew + BTS_TSA: + year: 2017 + selection_fields: + Description: + - In-house truck transportation + - For-hire truck transportation + activity_to_sector_mapping: BTS_TSA + attribution_method: proportional + attribution_source: BLS_QCEW + +source_names: + # stewiFBS: + # data_format: FBS_outside_flowsa + # FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector + # inventory_dict: {'NEI': '2017'} + # local_inventory_name: NEI_TRI_air_2017 + # selection_fields: # Remember GHGs should not be drawn from NEI + # Flowable: + # Particulate matter, ≤ 2.5μm: PM 2.5 + # compartments: + # - air + # reassign_process_to_sectors: + # - airplane_emissions + + EPA_GHGI_T_2_1: #U.S. GHG emissions + <<: *ghgi_parameters + activity_sets: + direct_attribution: + selection_fields: + PrimaryActivity: + - Iron and Steel Production & Metallurgical Coke Production #CO2, CH4 + - Cement Production #CO2 + - Lime Production #CO2 + - Ammonia Production #CO2 + - Incineration of Waste #CO2, #N2O + - Aluminum Production #CO2 + - Soda Ash Production #CO2 + - Ferroalloy Production #CO2, CH4 + - Titanium Dioxide Production #CO2 + - Zinc Production #CO2 + - Phosphoric Acid Production #CO2 + - Glass Production #CO2 + - Carbide Production and Consumption #CO2, CH4 + - Landfills #CH4 + - Coal Mining #CH4 + - Wastewater Treatment #CH4, N2O + - Rice Cultivation #CH4 + - Abandoned Oil and Gas Wells #CH4 + - Abandoned Underground Coal Mines #CH4 + - Anaerobic Digestion at Biogas Facilities #CH4 new activity + - Composting #CH4, N2O + - Nitric Acid Production #N2O + - Adipic Acid Production #N2O + - Caprolactam, Glyoxal, and Glyoxylic Acid Production #CH4 + - Electronics Industry #N2O + FlowName: # HFCs and other flows are attributed elsewhere + - CO2 + - CH4 + - N2O + attribution_method: direct + + electric_distribution: + selection_fields: + PrimaryActivity: Electrical Transmission and Distribution #SF6 + FlowName: SF6 + attribution_method: direct + + liming: + selection_fields: + PrimaryActivity: Liming #CO2 + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '327400' + + urea: + selection_fields: + PrimaryActivity: + - Urea Fertilization #CO2 + - Urea Consumption for Non-Agricultural Purposes #CO2 + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '325310' # Fertilizers + + carbonate_use: + selection_fields: + PrimaryActivity: Other Process Uses of Carbonates #CO2 + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '325180' # Other Basic Inorganic Chemicals + + lead_production: + selection_fields: + PrimaryActivity: Lead Production #CO2 + attribution_method: proportional + attribution_source: + USGS_MYB_Lead: + year: 2016 + selection_fields: + ActivityProducedBy: + - Primary lead, refined content, domestic ores and base bullion + - Secondary lead, lead content + + nitrous_oxide_use: + selection_fields: + PrimaryActivity: N2O from Product Uses #N2O + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '325120' # Industrial gases + +## Fossil Fuels + EPA_GHGI_T_3_63: &natgas #CH4 from Natural Gas Systems + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: + - Distribution + - Exploration + - Processing + - Production + - Transmission and Storage + attribution_method: direct + EPA_GHGI_T_3_65: *natgas #CO2 from Natural Gas Systems mimics CH4 + EPA_GHGI_T_3_67: *natgas #N2O from Natural Gas Systems, not used in original method, mimics CH4 + + EPA_GHGI_T_3_38: &petroleum #CH4 from Petroleum Systems + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: + - Crude Oil Transportation + - Exploration + - Production + - Refining + attribution_method: direct + EPA_GHGI_T_3_40: *petroleum #CO2 from Petroleum Systems mimics CH4 + EPA_GHGI_T_3_42: *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 + +## Stationary Combustion (note that CO2 is electric power only) + EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion + <<: *ghgi_parameters + clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion + activity_sets: + direct_attribution: + selection_fields: + PrimaryActivity: + - Fuel Oil Residential + - Coal Residential + - Natural Gas Residential + - Wood Residential + attribution_method: direct + electric_power: &stationary_electric + selection_fields: + PrimaryActivity: + - Coal Electric Power + - Natural Gas Electric Power + - Natural gas Electric Power # note lower case + - Fuel Oil Electric Power + - Geothermal Electric Power + - Wood Electric Power + activity_to_sector_mapping: EPA_GHGI_m2 + attribution_method: direct + fuel_oil: + selection_fields: + PrimaryActivity: + - Fuel Oil Commercial + - Fuel Oil Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # purchases of refinery products + natural_gas: + selection_fields: + PrimaryActivity: + - Natural gas Commercial + - Natural gas Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '221200' # purchases of natural gas + coal: + selection_fields: + PrimaryActivity: Coal Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '212100' # purchases of coal + coal_manufacturing: + selection_fields: + PrimaryActivity: Coal Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Coal + natural_gas_manufacturing: + selection_fields: + PrimaryActivity: Natural gas Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Natural Gas + EPA_GHGI_T_3_9: # N2O emissions from stationary combustion + <<: *stationary_combustion + EPA_GHGI_T_3_7: # CO2 emissions from stationary combustion (electricity only) + <<: [*ghgi_parameters, *stationary_electric] + +# ## Agriculture + EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues + <<: *ghgi_parameters + attribution_method: direct + selection_fields: + PrimaryActivity: + - Chickpeas + - Cotton + - Maize + - Rice + - Soybeans + - Wheat + + EPA_GHGI_T_5_3: &animals #CH4 from Enteric Fermentation + <<: *ghgi_parameters + attribution_method: direct + selection_fields: + PrimaryActivity: + - American Bison + - Beef Cattle + - Dairy Cattle + - Goats + - Horses + - Mules and Asses + - Sheep + - Swine + - Poultry + EPA_GHGI_T_5_7: *animals #CH4 and N2O from manure, mimics enteric fermentation + + EPA_GHGI_T_5_18: #Direct N2O emissions from agricultural soils + <<: *ghgi_parameters + activity_sets: + fertilizer_use: &fertilizer # allocated based on fertilizer use + selection_fields: + PrimaryActivity: + - Organic Amendment Cropland + - Residue N Cropland + - Synthetic Fertilizer Cropland + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: + - '325310' + cropland: + selection_fields: + PrimaryActivity: + - Mineralization and Asymbiotic Fixation Cropland + - Drained Organic Soils Cropland + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland: + <<: *usda_cropland + pasture: &pasture + selection_fields: + PrimaryActivity: + - All activities Grassland + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + <<: *usda_pasture + EPA_GHGI_T_5_19: #Indirect N2O emissions from agricultural soils + <<: *ghgi_parameters + activity_sets: + fertilizer_use: # allocated based on fertilizer use + <<: *fertilizer + selection_fields: + PrimaryActivity: + - Volatilization & Atm. Deposition Cropland + - Surface Leaching & Run-Off Cropland + pasture: + <<: *pasture + +## Mobile Sources (N20 and CH4) + EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion + <<: *ghgi_parameters + activity_sets: + direct_attribution: # Some of these need to be separated and attributed differently + selection_fields: + PrimaryActivity: + - Passenger Cars Gasoline On-Road + - Rail Non-Road + - Ships and Boats Non-Road + # - Aircraft Non-Road + attribution_method: direct + + trucking: + adjustment_factor: 0.99 + selection_fields: + PrimaryActivity: + - Light-Duty Trucks Gasoline On-Road + - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: BTS_TSA + + construction_and_mining: + selection_fields: + PrimaryActivity: Construction/Mining Equipment Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333120' # purchases of construction/mining equipment + + farm_non_road: + selection_fields: + PrimaryActivity: Agricultural Equipment Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333111' # purchases of farm machinery + + other_non_road: # attributed by purchases of petroleum refinery products + selection_fields: + PrimaryActivity: Other Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # purchases of refinery products + + alt_fuel_on_road: # assumes natural gas is primary alternate fuel + selection_fields: + PrimaryActivity: + - All activities Alternative Fuel On-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '221200' # purchases of natural gas + EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 + +# Major CO2 Sources + EPA_GHGI_T_A_13: # (2017 specific table) CO2 emissions from stationary combustion and transportation + <<: *ghgi_parameters + clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion + activity_sets: + direct_attribution: + selection_fields: + PrimaryActivity: Total (All Fuels) Residential + attribution_method: direct + non-manufacturing_coal: + selection_fields: + PrimaryActivity: + - Commercial Coal Commercial + - Industrial Other Coal Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '212100' # purchases of coal + non-manufacturing_natural_gas: + selection_fields: + PrimaryActivity: + - Natural Gas Commercial + - Natural Gas Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '221200' # purchases of natural gas + non-manufacturing_petroleum: + selection_fields: + PrimaryActivity: + - Total Petroleum Commercial + - Total Petroleum Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # purchases of refinery products + manufacturing_coal: # Industrial Coal for Manufacturing + selection_fields: + PrimaryActivity: + - Industrial Other Coal Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Coal + manufacturing_natural_gas: # Industrial Natural Gas for manufacturing + selection_fields: + PrimaryActivity: + - Natural Gas Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Natural Gas + + ## Transportation + natural_gas_transportation: + selection_fields: + PrimaryActivity: Natural Gas Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + selection_fields: + FlowName: Natural Gas + + aviation_gas_transportation: + selection_fields: + PrimaryActivity: Aviation Gasoline Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + selection_fields: + FlowName: Aviation Gasoline + + # jet_fuel_transportation: + # selection_fields: + # PrimaryActivity: Jet Fuel Transportation + # attribution_method: proportional + # attribution_source: + # EPA_GHGI_T_A_79: + # <<: *t_a_79 + # selection_fields: + # FlowName: Jet Fuel + + propane_transportation: + selection_fields: + PrimaryActivity: LPG (Propane) Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + selection_fields: + FlowName: LPG + + residual_fuel_transportation: + selection_fields: + PrimaryActivity: Residual Fuel Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + selection_fields: + FlowName: Residual Fuel Oil + + distillate_fuel_transportation: + selection_fields: + PrimaryActivity: + - Distillate Fuel Oil Transportation + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + activity_to_sector_mapping: EPA_GHGI + activity_sets: + direct_attribution: + selection_fields: + FlowName: Distillate Fuel Oil (Diesel Fuel) + PrimaryActivity: + - Passenger Cars + - Rail + - Recreational Boats + - Ships and Non-Recreational Boats + attribution_method: direct + trucking: + adjustment_factor: 0.99 + selection_fields: + FlowName: Distillate Fuel Oil (Diesel Fuel) + PrimaryActivity: + - Light-Duty Trucks + - Medium- and Heavy-Duty Trucks + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: BTS_TSA + buses: + selection_fields: + FlowName: Distillate Fuel Oil (Diesel Fuel) + PrimaryActivity: Buses + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # use of petroleum products + + motor_gasoline_transportation: + selection_fields: + PrimaryActivity: + - Motor Gasoline Transportation + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + activity_to_sector_mapping: EPA_GHGI + activity_sets: + direct_attribution: + selection_fields: + FlowName: Motor Gasoline + PrimaryActivity: + - Passenger Cars + - Motorcycles + - Recreational Boats + attribution_method: direct + trucking: + adjustment_factor: 0.99 + selection_fields: + FlowName: Motor Gasoline + PrimaryActivity: + - Light-Duty Trucks + - Medium- and Heavy-Duty Trucks + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: BTS_TSA + buses: + selection_fields: + FlowName: Motor Gasoline + PrimaryActivity: Buses + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # use of petroleum products + +## Other sources + EPA_GHGI_T_4_46: #CO2 for selected petrochemicals + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: + - Acrylonitrile + - Carbon Black + - Ethylene + - Ethylene Dichloride + - Ethylene Oxide + - Methanol + attribution_method: direct + + EPA_GHGI_T_3_22b: #Fossil fuel for non-energy uses + <<: *ghgi_parameters + activity_sets: + coal: + selection_fields: + PrimaryActivity: + - Industry Industrial Coking Coal + - Industry Industrial Other Coal + attribution_method: direct + + distillate_fuel_feedstocks: + selection_fields: + PrimaryActivity: Industry Distillate Fuel Oil + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: Distillate Fuel Oil + + hgl_feedstocks: + selection_fields: + PrimaryActivity: + - Industry LPG + - Industry Pentanes Plus + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: Hydrocarbon Gas Liquids, excluding natural gasoline + + petroleum_coke_feedstocks: + selection_fields: + PrimaryActivity: Industry Petroleum Coke + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: Coke and Breeze + + natural_gas_feedstocks: + selection_fields: + PrimaryActivity: + - Industry Still Gas + - Industry Natural Gas to Chemical Plants + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: Natural Gas + + other_petroleum_feedstocks: + selection_fields: + PrimaryActivity: + - Industry Asphalt & Road Oil + - Industry Lubricants + - Industry Miscellaneous Products + - Industry Naphtha (<401 F) + - Industry Other Oil (>401 F) + - Industry Special Naphtha + - Industry Waxes + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: Other + + transportation_lubricants: + selection_fields: + PrimaryActivity: Transportation Lubricants + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # use of petroleum products + + EPA_GHGI_T_4_50: # HFCs from HCFC-22 production + <<: *ghgi_parameters + selection_fields: + Unit: MMT CO2e + PrimaryActivity: HCFC-22 Production + attribution_method: direct + + EPA_GHGI_T_4_94: # HFCs and other emissions from electronics manufacture + <<: *ghgi_parameters + selection_fields: + FlowName: + SF6: SF6 + Total F-GHGs: HFCs and PFCs + NF3: NF3 + N2O[2]: N2O + attribution_method: direct + + EPA_GHGI_T_4_101: # HFCs and PFCs from ODS Substitutes + <<: *ghgi_parameters + clean_fba_before_activity_sets: !script_function:temp_data_source_functions clean_hfc_fba # removes HFCs from transportation + activity_sets: + household_refrigeration: + selection_fields: + PrimaryActivity: Refrigeration/Air Conditioning - Households + attribution_method: direct + + non-household_refrigeration: + selection_fields: + PrimaryActivity: Refrigeration/Air Conditioning + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333415' # Air conditioning equipment + + polystyrene_foam: + selection_fields: + PrimaryActivity: Foams - Polystyrene + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '326140' # Polystyrene foam + + urethane_foam: + selection_fields: + PrimaryActivity: Foams - Urethane + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '326150' # Urethane and other foams. + + EPA_GHGI_T_A_103: # HFCs from Transportation + <<: *ghgi_parameters + # clean_fba_before_activity_sets: !script_function:temp_data_source_functions split_hfcs_by_type + activity_sets: + passenger_cars: + selection_fields: + PrimaryActivity: Passenger Cars + attribution_method: direct + trucking: + selection_fields: + PrimaryActivity: + - Light-Duty Trucks + - Heavy-Duty Vehicles + adjustment_factor: 0.99 + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: BTS_TSA + refrigerated_trucks: + selection_fields: + PrimaryActivity: Medium- and Heavy-Duty Trucks + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333415' # purchases of refrigeration equipment + other_cooling: + selection_fields: + PrimaryActivity: + - School and Tour Buses + # - Transit Buses # crosswalk marks these as excluded; I'm not at all sure why + - Rail + - Ships and Boats + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333415' # purchases of refrigeration equipment + + EPA_GHGI_T_4_80: # PFCs from aluminum production + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: Aluminum Production + attribution_method: direct + + EPA_GHGI_T_4_84: # HFCs, SF6, CO2 from magnesium production + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: Magnesium Production and Processing + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: T008 # Gross output. + + BTS_Airlines: + selection_fields: + Year: *year + emissions_factors: BTS_Airlines_emissions_factors + fedefl_mapping: 'GHGI' + activity_to_sector_mapping: EPA_GHGI diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index 59065b4cb..471b115ef 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -240,7 +240,7 @@ source_names: PrimaryActivity: - Fuel Oil Commercial - Fuel Oil Industrial - attribution_methods: proportional + attribution_method: proportional attribution_source: BEA_Use_Detail_PRO_BeforeRedef: <<: *bea_use @@ -379,6 +379,7 @@ source_names: attribution_method: direct trucking: + adjustment_factor: 0.99 selection_fields: PrimaryActivity: - Light-Duty Trucks Gasoline On-Road @@ -566,6 +567,7 @@ source_names: - Ships and Non-Recreational Boats attribution_method: direct trucking: + adjustment_factor: 0.99 selection_fields: FlowName: Distillate Fuel Oil (Diesel Fuel) PrimaryActivity: @@ -605,6 +607,7 @@ source_names: - Recreational Boats attribution_method: direct trucking: + adjustment_factor: 0.99 selection_fields: FlowName: Motor Gasoline PrimaryActivity: @@ -739,10 +742,10 @@ source_names: <<: *ghgi_parameters selection_fields: FlowName: - - SF6 - - Total F-GHGs - - NF3 - - N2O[2] + SF6: SF6 + Total F-GHGs: HFCs and PFCs + NF3: NF3 + N2O[2]: N2O attribution_method: direct EPA_GHGI_T_4_101: # HFCs and PFCs from ODS Substitutes @@ -797,6 +800,7 @@ source_names: PrimaryActivity: - Light-Duty Trucks - Heavy-Duty Vehicles + adjustment_factor: 0.99 activity_to_sector_mapping: EPA_GHGI_trucking attribution_method: proportional attribution_source: BTS_TSA From 3fca32be260bb1d8b5ad0da497b01b3b3c22658a Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 6 Jul 2022 10:52:43 -0400 Subject: [PATCH 0154/1127] Switched flowby_generator for FBS to FBS.generateFBS() --- flowsa/flowby.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 27d9d02b4..8a4673b5d 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1507,12 +1507,11 @@ def getFlowBySector( :return: FlowBySector dataframe ''' file_metadata = metadata.set_fb_meta(method, 'FlowBySector') - flowby_generator = partial( - flowbysector.main, - method=method, - fbsconfigpath=external_config_path, - download_FBAs_if_missing=download_sources_ok - ) + flowby_generator = ( + lambda x=method, y=external_config_path, z=download_sources_ok: + cls.generateFlowBySector(x, y, z) + .to_parquet(f'{settings.fbsoutputpath}{method}.parquet') + ) return super()._getFlowBy( file_metadata=file_metadata, download_ok=download_fbs_ok, From e7761d7efaa5988571bcdfe1a5e5577014554ce5 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 6 Jul 2022 10:54:40 -0400 Subject: [PATCH 0155/1127] Added to_parquet to _FB, overriding DF.to_parquet --- flowsa/flowby.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 8a4673b5d..925a52c14 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -582,6 +582,12 @@ def add_full_name(self: FB, full_name: str) -> FB: fb.full_name = full_name return fb + def to_parquet(self: FB, *args, **kwargs) -> None: + pd.DataFrame(self).to_parquet(*args, **kwargs) + # ^^^ For some reason, the extra features of a FlowBy stop to_parquet + # from working, and the data need to be cast back to a plain + # DataFrame before writing to a parquet. + class FlowByActivity(_FlowBy): _metadata = [*_FlowBy()._metadata] @@ -1507,11 +1513,12 @@ def getFlowBySector( :return: FlowBySector dataframe ''' file_metadata = metadata.set_fb_meta(method, 'FlowBySector') - flowby_generator = ( - lambda x=method, y=external_config_path, z=download_sources_ok: - cls.generateFlowBySector(x, y, z) - .to_parquet(f'{settings.fbsoutputpath}{method}.parquet') - ) + flowby_generator = partial( + flowbysector.main, + method=method, + fbsconfigpath=external_config_path, + download_FBAs_if_missing=download_sources_ok + ) return super()._getFlowBy( file_metadata=file_metadata, download_ok=download_fbs_ok, From add98b0fa8ba705d5a806a9caa8f537ed7d388bf Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 6 Jul 2022 10:58:16 -0400 Subject: [PATCH 0156/1127] Added manual adjustment factor capability to convert_units_and_flows() :-( There has to be a better way --- flowsa/flowby.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 925a52c14..3d19de2a8 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1397,6 +1397,10 @@ def convert_units_and_flows( ) -> 'FlowByActivity': if 'emissions_factors' in self.config: self = self.convert_activity_to_emissions() + if 'adjustment_factor' in self.config: + # ^^^ TODO: There has to be a better way to do this. + self = self.assign(FlowAmount=self.FlowAmount + * self.config['adjustment_factor']) standardized = self.standardize_units() if self.config.get('fedefl_mapping'): From b26cb188c7e995063b7cc9ba395b027912bac989 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 6 Jul 2022 10:59:03 -0400 Subject: [PATCH 0157/1127] Tweaks --- flowsa/flowby.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 3d19de2a8..39c777895 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1517,12 +1517,11 @@ def getFlowBySector( :return: FlowBySector dataframe ''' file_metadata = metadata.set_fb_meta(method, 'FlowBySector') - flowby_generator = partial( - flowbysector.main, - method=method, - fbsconfigpath=external_config_path, - download_FBAs_if_missing=download_sources_ok - ) + flowby_generator = ( + lambda x=method, y=external_config_path, z=download_sources_ok: + cls.generateFlowBySector(x, y, z) + .to_parquet(f'{settings.fbsoutputpath}{method}.parquet') + ) return super()._getFlowBy( file_metadata=file_metadata, download_ok=download_fbs_ok, @@ -1599,7 +1598,7 @@ def prepare_fbs(self: 'FlowBySector') -> 'FlowBySector': self .function_socket('clean_fbs_df_fxn') .select_by_fields() - .convert_fips_to_geoscale(self.config['geoscale']) + .convert_fips_to_geoscale() ) From 51c721a368b73b07a124d75c07bd260aad04ddef Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 6 Jul 2022 12:48:16 -0400 Subject: [PATCH 0158/1127] Update getFBS docstring --- flowsa/flowby.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 39c777895..8bf6842c8 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1510,10 +1510,10 @@ def getFlowBySector( used in generating the FBS from EPA's remote server rather than generating (if not found locally) :param download_FBS_if_missing: bool, if True will attempt to load the - the FBS from EPA's remote server rather than generating it + FBS from EPA's remote server rather than generating it (if not found locally) :kwargs: keyword arguments to pass to _getFlowBy(). Possible kwargs - include source_name and config. + include full_name and config. :return: FlowBySector dataframe ''' file_metadata = metadata.set_fb_meta(method, 'FlowBySector') From da78a36422b9aca3f5b2774ef8c16eb6e05fbfad Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 8 Jul 2022 17:54:05 -0400 Subject: [PATCH 0159/1127] Non-functional tweaks to method yaml --- flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml index 2582406aa..168e3b984 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml @@ -18,7 +18,7 @@ geoscale: national _ghgi_parameters: &ghgi_parameters geoscale: national year: &year 2017 - fedefl_mapping: 'GHGI' + fedefl_mapping: GHGI _attribution_sources: BEA_Use_Detail_PRO_BeforeRedef: &bea_use @@ -850,5 +850,6 @@ source_names: selection_fields: Year: *year emissions_factors: BTS_Airlines_emissions_factors - fedefl_mapping: 'GHGI' + fedefl_mapping: GHGI activity_to_sector_mapping: EPA_GHGI + attribution_method: direct From c6d261e982e4759e4a622d3080dcfa512345ea25 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sun, 10 Jul 2022 21:02:17 -0400 Subject: [PATCH 0160/1127] fix TypeError for pandas < 1.4 #238 --- flowsa/geo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/geo.py b/flowsa/geo.py index e3644d21f..85a9500f0 100644 --- a/flowsa/geo.py +++ b/flowsa/geo.py @@ -87,7 +87,7 @@ def filtered_fips( year: Literal[2010, 2013, 2015] = 2015 ) -> pd.DataFrame: if geoscale == 'national' or geoscale == scale.NATIONAL: - return (get_all_fips(year).query('State.isnull()')) + return (get_all_fips(year).query('State.isnull()', engine='python')) elif geoscale == 'state' or geoscale == scale.STATE: return (get_all_fips(year).query('State.notnull() & County.isnull()')) elif geoscale == 'county' or geoscale == scale.COUNTY: From c7ea4f7b8f67b8e19c6c19448f67aadbbeb6889f Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sun, 10 Jul 2022 21:03:08 -0400 Subject: [PATCH 0161/1127] fix minor errors --- flowsa/flowby.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 8bf6842c8..19f681eab 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -343,13 +343,12 @@ def convert_fips_to_geoscale( ) elif to_geoscale == geo.scale.STATE: return self.assign( - {column: self[column].str.slice_replace(start=2, repl='000')} + **{column: self[column].str.slice_replace(start=2, repl='000')} ) elif to_geoscale == geo.scale.COUNTY: return self else: - log.error('No FIPS level corresponds to the given geoscale: %s', - to_geoscale) + log.error(f'No FIPS level corresponds to {to_geoscale}') def select_by_fields(self: FB, selection_fields: dict = None) -> FB: ''' @@ -1598,7 +1597,7 @@ def prepare_fbs(self: 'FlowBySector') -> 'FlowBySector': self .function_socket('clean_fbs_df_fxn') .select_by_fields() - .convert_fips_to_geoscale() + .convert_fips_to_geoscale(self.config['geoscale']) ) From 82d5f9f01e3449fa5728f8c6af164652ac192914 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sun, 10 Jul 2022 21:03:24 -0400 Subject: [PATCH 0162/1127] update GRDREL to new format --- .../flowbysectormethods/GRDREL_national_2017.yaml | 9 +++++---- .../methods/flowbysectormethods/GRDREL_state_2017.yaml | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GRDREL_national_2017.yaml b/flowsa/methods/flowbysectormethods/GRDREL_national_2017.yaml index fbd04d4c2..88b2c7fa0 100644 --- a/flowsa/methods/flowbysectormethods/GRDREL_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/GRDREL_national_2017.yaml @@ -2,10 +2,11 @@ target_sector_level: NAICS_6 target_sector_source: NAICS_2012_Code target_geoscale: national source_names: - "stewiFBS": - data_format: 'FBS_outside_flowsa' + stewiFBS: + data_format: FBS_outside_flowsa + geoscale: national FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector inventory_dict: {"TRI":"2017"} - local_inventory_name: 'TRI_GRDREL_2017' + local_inventory_name: TRI_GRDREL_2017 compartments: - - 'soil' + - soil diff --git a/flowsa/methods/flowbysectormethods/GRDREL_state_2017.yaml b/flowsa/methods/flowbysectormethods/GRDREL_state_2017.yaml index 1605b09d4..e5c3766fa 100644 --- a/flowsa/methods/flowbysectormethods/GRDREL_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/GRDREL_state_2017.yaml @@ -2,10 +2,11 @@ target_sector_level: NAICS_6 target_sector_source: NAICS_2012_Code target_geoscale: state source_names: - "stewiFBS": - data_format: 'FBS_outside_flowsa' + stewiFBS: + data_format: FBS_outside_flowsa + geoscale: state FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector inventory_dict: {"TRI":"2017"} - local_inventory_name: 'TRI_GRDREL_2017' + local_inventory_name: TRI_GRDREL_2017 compartments: - - 'soil' + - soil From 485cbc6b64df1d6554710462ea4c4ff5c2e9feaa Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 11 Jul 2022 10:39:21 -0400 Subject: [PATCH 0163/1127] convert_fips_to_geoscale now get geoscale from self.config, mirroring convert_geoscale --- flowsa/flowby.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 19f681eab..c5bcf72dc 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -319,9 +319,9 @@ def conditional_method( def convert_fips_to_geoscale( self: FB, - to_geoscale: Literal['national', 'state', 'county', - geo.scale.NATIONAL, geo.scale.STATE, - geo.scale.COUNTY], + target_geoscale: Literal['national', 'state', 'county', + geo.scale.NATIONAL, geo.scale.STATE, + geo.scale.COUNTY] = None, column: str = 'Location' ) -> FB: """ @@ -334,21 +334,22 @@ def convert_fips_to_geoscale( Default = 'Location' :return: FlowBy dataset with 5 digit fips """ - if type(to_geoscale) == str: - to_geoscale = geo.scale.from_string(to_geoscale) + target_geoscale = target_geoscale or self.config.get('geoscale') + if type(target_geoscale) == str: + target_geoscale = geo.scale.from_string(target_geoscale) - if to_geoscale == geo.scale.NATIONAL: + if target_geoscale == geo.scale.NATIONAL: return self.assign( **{column: geo.filtered_fips('national').FIPS.values[0]} ) - elif to_geoscale == geo.scale.STATE: + elif target_geoscale == geo.scale.STATE: return self.assign( **{column: self[column].str.slice_replace(start=2, repl='000')} ) - elif to_geoscale == geo.scale.COUNTY: + elif target_geoscale == geo.scale.COUNTY: return self else: - log.error(f'No FIPS level corresponds to {to_geoscale}') + log.error(f'No FIPS level corresponds to {target_geoscale}') def select_by_fields(self: FB, selection_fields: dict = None) -> FB: ''' @@ -1597,7 +1598,7 @@ def prepare_fbs(self: 'FlowBySector') -> 'FlowBySector': self .function_socket('clean_fbs_df_fxn') .select_by_fields() - .convert_fips_to_geoscale(self.config['geoscale']) + .convert_fips_to_geoscale() ) From e392cb2fb3d6b7c01b3dc522a3a880ccd6cfb30b Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 11 Jul 2022 11:42:44 -0400 Subject: [PATCH 0164/1127] Documentation, logging, and formatting tweaks --- flowsa/flowby.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index c5bcf72dc..f6ee2b3a2 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -584,9 +584,9 @@ def add_full_name(self: FB, full_name: str) -> FB: def to_parquet(self: FB, *args, **kwargs) -> None: pd.DataFrame(self).to_parquet(*args, **kwargs) - # ^^^ For some reason, the extra features of a FlowBy stop to_parquet - # from working, and the data need to be cast back to a plain - # DataFrame before writing to a parquet. + # ^^^ For some reason, the extra features of a FlowBy stop the + # to_parquet method inherited from DatFrame from working, so this + # casts the data back to plain DataFrame to write to a parquet. class FlowByActivity(_FlowBy): @@ -952,21 +952,21 @@ def attribute_flows_to_sectors( **config} ).prepare_fbs() - attributed_fba = fba.proportionally_attribute( - attribution_fbs - ) + attributed_fba = fba.proportionally_attribute(attribution_fbs) + # elif attribution_method == 'proportional-flagged': # attributed_fba = fba.flagged_proportionally_attribute90 + else: - if (attribution_method is not None - and attribution_method != 'direct'): - log.error('Attribution method for %s not recognized: %s', - fba.full_name, attribution_method) - raise ValueError('Attribution method not recognized') - elif attribution_method is None: + if attribution_method is None: log.warning('No attribution method specified for %s. ' 'Using equal attribution as default.', fba.full_name) + elif attribution_method != 'direct': + log.error('Attribution method for %s not recognized: %s', + fba.full_name, attribution_method) + raise ValueError('Attribution method not recognized') + attributed_fba = fba.equally_attribute() validation_fba = attributed_fba.assign( From 896c77788e3be3a7d7aa96c797636bb98045b23e Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 11 Jul 2022 12:13:47 -0400 Subject: [PATCH 0165/1127] Documentation tweaks --- flowsa/flowby.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index f6ee2b3a2..0385bdc60 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -129,6 +129,9 @@ def __finalize__(self, other, method=None, **kwargs): other circumstances, such as merging. merge: use metadata of left FlowBy + concat: for full_name or config, use the shared portion (possibly + '' or {}); for other _metadata (if any), use values from the + first FlowBy ''' self = super().__finalize__(other, method=method, **kwargs) @@ -825,8 +828,8 @@ def convert_to_geoscale( (geo.filtered_fips(scale) .assign(geoscale=scale, National='USA') # ^^^ Need to have a column for each relevant scale - # (only FIPS for now) .rename(columns={'FIPS': 'Location'})) + # ^^^ (only FIPS for now) for scale in [s for s in geo.scale if s.has_fips_level] ]) From 86f568e8d2111ddae8288a09525e16fbf2e8e682 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 11 Jul 2022 15:11:43 -0400 Subject: [PATCH 0166/1127] Require pandas >= 1.4, revert change from c6d261e to accommodate pandas 1.3.3 --- flowsa/geo.py | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/geo.py b/flowsa/geo.py index 85a9500f0..e3644d21f 100644 --- a/flowsa/geo.py +++ b/flowsa/geo.py @@ -87,7 +87,7 @@ def filtered_fips( year: Literal[2010, 2013, 2015] = 2015 ) -> pd.DataFrame: if geoscale == 'national' or geoscale == scale.NATIONAL: - return (get_all_fips(year).query('State.isnull()', engine='python')) + return (get_all_fips(year).query('State.isnull()')) elif geoscale == 'state' or geoscale == scale.STATE: return (get_all_fips(year).query('State.notnull() & County.isnull()')) elif geoscale == 'county' or geoscale == scale.COUNTY: diff --git a/requirements.txt b/requirements.txt index 6223afaf2..522e91316 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git@develop#egg=fedelemflowlist git+https://github.com/USEPA/esupy.git@develop#egg=esupy git+https://github.com/USEPA/standardizedinventories.git@develop#egg=StEWI -pandas>=1.3.2 # Powerful data structures for data analysis, time series, and statistics. +pandas>=1.4 # Powerful data structures for data analysis, time series, and statistics. pip>=9 # The PyPA recommended tool for installing Python packages. setuptools>=41 # Fully-featured library designed to facilitate packaging Python projects. pyyaml>=5.3 # Yaml for python From d3c4fdbba0e88fe0b36b38761a1b0edc38472717 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 11 Jul 2022 15:20:00 -0400 Subject: [PATCH 0167/1127] Still reverting c6d261e, but waiting to change requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 522e91316..497d6c70e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git@develop#egg=fedelemflowlist git+https://github.com/USEPA/esupy.git@develop#egg=esupy git+https://github.com/USEPA/standardizedinventories.git@develop#egg=StEWI -pandas>=1.4 # Powerful data structures for data analysis, time series, and statistics. +pandas>=1.3.2 # Powerful data structures for data analysis, time series, and statistics. pip>=9 # The PyPA recommended tool for installing Python packages. setuptools>=41 # Fully-featured library designed to facilitate packaging Python projects. pyyaml>=5.3 # Yaml for python From 09449848b849378f07a228121ed6db04d4f4636b Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 11 Jul 2022 18:08:41 -0400 Subject: [PATCH 0168/1127] Updated allocate_industrial_combustion to use fba.config --- flowsa/data_source_scripts/EPA_GHGI.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_GHGI.py b/flowsa/data_source_scripts/EPA_GHGI.py index ab02079f4..59eb3c64b 100644 --- a/flowsa/data_source_scripts/EPA_GHGI.py +++ b/flowsa/data_source_scripts/EPA_GHGI.py @@ -680,7 +680,7 @@ def closest_value(input_list, input_value): return pct_dict -def allocate_industrial_combustion(fba, source_dict, **_): +def allocate_industrial_combustion(fba, *_, **__): """ Split industrial combustion emissions into two buckets to be further allocated. @@ -688,7 +688,7 @@ def allocate_industrial_combustion(fba, source_dict, **_): EIA MECS relative to EPA GHGI. Create new activities to distinguish those which use EIA MECS as allocation source and those that use alternate source. """ - pct_dict = get_manufacturing_energy_ratios(source_dict.get('year')) + pct_dict = get_manufacturing_energy_ratios(fba.config.get('year')) # activities reflect flows in A_14 and 3_8 and 3_9 activities_to_split = {'Industrial Other Coal Industrial': 'Coal', From ebf1e29327209418b527164aeaaf52bbb400af75 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 11 Jul 2022 18:10:06 -0400 Subject: [PATCH 0169/1127] Added FBS.display_tables() allowing for automated construction of nice display tables, and optional configuration of these in method yaml --- flowsa/flowby.py | 68 +++++++++++++++++++ .../flowbysectormethods/SEEA_2017_kg_v1.yaml | 18 ++++- .../flowbysectormethods/SEEA_2017_v1.yaml | 31 ++++++++- flowsa/settings.py | 2 + 4 files changed, 117 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 0385bdc60..de37f5433 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1,5 +1,6 @@ from typing import List, Literal, TypeVar import pandas as pd +from pandas import ExcelWriter import numpy as np from functools import partial, reduce from . import (common, settings, metadata, sectormapping, @@ -1594,6 +1595,8 @@ def generateFlowBySector( for source_name, config in sources.items() ]) + fbs.full_name = method + return fbs def prepare_fbs(self: 'FlowBySector') -> 'FlowBySector': @@ -1601,9 +1604,74 @@ def prepare_fbs(self: 'FlowBySector') -> 'FlowBySector': self .function_socket('clean_fbs_df_fxn') .select_by_fields() + # TODO: Add a method to convert to proper industry spec. .convert_fips_to_geoscale() ) + def display_tables( + self: 'FlowBySector', + display_tables: dict = None + ) -> pd.DataFrame: + display_tables = display_tables or self.config.get('display_tables') + if display_tables is None: + log.error('Cannot generate display tables, since no configuration' + 'is specified for them') + return None + + def convert_industry_spec( + fb_at_source_naics: 'FlowBySector', + industry_spec: dict = None + ) -> 'FlowBySector': + ''' + This is here because it's only for display purposes. It can be + replaced once there's a proper method for converting an FBS to + a new industry_spec + ''' + if industry_spec is None: + return fb_at_source_naics + fb_at_target_naics = ( + fb_at_source_naics + .merge(naics.industry_spec_key(industry_spec), + how='left', + left_on='SectorProducedBy', right_on='source_naics') + .assign( + SectorProducedBy=lambda x: + x.SectorProducedBy.mask(x.SectorProducedBy.str.len() + >= x.target_naics.str.len(), + x.target_naics) + ) + .drop(columns=['target_naics', 'source_naics']) + .aggregate_flowby() + ) + return fb_at_target_naics + + table_dict = { + table_name: ( + self + .select_by_fields(table_config.get('selection_fields')) + .pipe(convert_industry_spec, table_config.get('industry_spec')) + [['Flowable', 'Unit', 'SectorProducedBy', 'FlowAmount']] + .rename(columns={'Flowable': 'Pollutant', + 'SectorProducedBy': 'Industry', + 'FlowAmount': 'Amount'}) + .replace(table_config.get('replace_dict', {})) + .assign(Pollutant=lambda x: x.Pollutant + ' (' + x.Unit + ')') + .drop(columns='Unit') + .groupby(['Pollutant', 'Industry']).agg('sum') + .reset_index() + .pivot(index='Pollutant', columns='Industry', values='Amount') + ) + for table_name, table_config in display_tables.items() + } + + tables_path = (f'{settings.tableoutputpath}{self.full_name}' + f'_Display_Tables.xlsx') + with ExcelWriter(tables_path) as writer: + for name, table in table_dict.items(): + table.to_excel(writer, name) + + return table_dict + # The three classes extending pd.Series, together with the _constructor... # methods of each class, are required for allowing pandas methods called on diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml index 168e3b984..602c8530c 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml @@ -15,6 +15,23 @@ industry_spec: target_naics_year: 2012 geoscale: national +display_tables: + NAICS 2: + industry_spec: {default: NAICS_2} + replace_dict: + Industry: {'31': '31-33', '32': '31-33', '33': '31-33', + '44': '44-45', '45': '44-45', + '48': '48-49', '49': '48-49'}, + Pollutant: {C2F6: F-GHGs, C3F8: F-GHGs, CF4: F-GHGs, + 'HFC, PFC and SF6 F-HTFs': F-GHGs, + HFC-134a: F-GHGs, HFC-23: F-GHGs, + HFCs: F-GHGs, HFCs and PFCs: F-GHGs, + Total F-GHGs: F-GHGs, c-C4F8: F-GHGs, + CO2: Carbon dioxide, CH4: Methane, + N2O: Nitrous oxide, 'N2O[2]': Nitrous oxide, + SF6: Sulfur hexafluoride, + NF3: Nitrogen trifluoride} + _ghgi_parameters: &ghgi_parameters geoscale: national year: &year 2017 @@ -56,7 +73,6 @@ _attribution_sources: - AREA GROWN # Berry totals - AREA IN PRODUCTION # Vegetable totals year: 2017 - clean_fba: !script_function:USDA_CoA_Cropland coa_irrigated_cropland_fba_cleanup clean_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics sources_to_cache: diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index 471b115ef..5fe1491cc 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -15,6 +15,36 @@ industry_spec: target_naics_year: 2012 geoscale: national +display_tables: + NAICS 2: + industry_spec: {default: NAICS_2} + replace_dict: + Industry: + '31': 31-33 + '32': 31-33 + '33': 31-33 + '44': 44-45 + '45': 44-45 + '48': 48-49 + '49': 48-49 + Pollutant: + C2F6: F-GHGs + C3F8: F-GHGs + CF4: F-GHGs + HFC, PFC and SF6 F-HTFs: F-GHGs + HFC-134a: F-GHGs + HFC-23: F-GHGs + HFCs: F-GHGs + HFCs and PFCs: F-GHGs + Total F-GHGs: F-GHGs + c-C4F8: F-GHGs + CO2: Carbon dioxide + CH4: Methane + N2O: Nitrous oxide + N2O[2]: Nitrous oxide + SF6: Sulfur hexafluoride + NF3: Nitrogen trifluoride + _ghgi_parameters: &ghgi_parameters geoscale: national year: &year 2017 @@ -55,7 +85,6 @@ _attribution_sources: - AREA GROWN # Berry totals - AREA IN PRODUCTION # Vegetable totals year: 2017 - clean_fba: !script_function:USDA_CoA_Cropland coa_irrigated_cropland_fba_cleanup clean_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics sources_to_cache: diff --git a/flowsa/settings.py b/flowsa/settings.py index 6bb2af5ab..065ec00df 100644 --- a/flowsa/settings.py +++ b/flowsa/settings.py @@ -33,10 +33,12 @@ biboutputpath = outputpath + 'Bibliography/' logoutputpath = outputpath + 'Log/' plotoutputpath = outputpath + 'Plots/' +tableoutputpath = outputpath + 'DisplayTables/' # ensure directories exist create_paths_if_missing(logoutputpath) create_paths_if_missing(plotoutputpath) +create_paths_if_missing(tableoutputpath) DEFAULT_DOWNLOAD_IF_MISSING = False From 016976b03a1027e06644d413fc5e73b076fc5923 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 12 Jul 2022 08:07:51 -0400 Subject: [PATCH 0170/1127] Added simple parquet saving to FBS.generateFBS(). Needs refinement + metadata --- flowsa/flowby.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index de37f5433..d95e9a20b 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1524,7 +1524,6 @@ def getFlowBySector( flowby_generator = ( lambda x=method, y=external_config_path, z=download_sources_ok: cls.generateFlowBySector(x, y, z) - .to_parquet(f'{settings.fbsoutputpath}{method}.parquet') ) return super()._getFlowBy( file_metadata=file_metadata, @@ -1597,6 +1596,9 @@ def generateFlowBySector( fbs.full_name = method + fbs.to_parquet(f'{settings.fbsoutputpath}{method}.parquet') + # TODO: Needs refinement + saving metadata + return fbs def prepare_fbs(self: 'FlowBySector') -> 'FlowBySector': From 7a85836764d27e971e13687af27dadf3ddf7eaca Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 12 Jul 2022 08:12:20 -0400 Subject: [PATCH 0171/1127] Added SEEA_2016 method, first draft --- .../flowbysectormethods/SEEA_2016_v1.yaml | 868 ++++++++++++++++++ 1 file changed, 868 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml diff --git a/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml new file mode 100644 index 000000000..f8ae5a8f7 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml @@ -0,0 +1,868 @@ +%YAML 1.1 + +--- +# m2 for the GHG national replicates the method used in the National GHG Industry Attribution Model +#(https://doi.org/10.23719/1517571), except that sector attribution is to 6-digit NAICS, +# rather than the BEA 2012 IO schema + +# !include:BEA_summary_target.yaml +industry_spec: + default: NAICS_3 + '336': {default: NAICS_4} + '541': {default: NAICS_4} +# industry_spec: +# default: NAICS_4 +target_naics_year: 2012 +geoscale: national + +display_tables: + NAICS 2: + industry_spec: {default: NAICS_2} + replace_dict: + Industry: + '31': 31-33 + '32': 31-33 + '33': 31-33 + '44': 44-45 + '45': 44-45 + '48': 48-49 + '49': 48-49 + Pollutant: + C2F6: F-GHGs + C3F8: F-GHGs + CF4: F-GHGs + HFC, PFC and SF6 F-HTFs: F-GHGs + HFC-134a: F-GHGs + HFC-23: F-GHGs + HFCs: F-GHGs + HFCs and PFCs: F-GHGs + Total F-GHGs: F-GHGs + c-C4F8: F-GHGs + CO2: Carbon dioxide + CH4: Methane + N2O: Nitrous oxide + N2O[2]: Nitrous oxide + SF6: Sulfur hexafluoride + NF3: Nitrogen trifluoride + +_ghgi_parameters: &ghgi_parameters + geoscale: national + year: &year 2016 + +_attribution_sources: + BEA_Use_Detail_PRO_BeforeRedef: &bea_use + year: 2012 + activity_to_sector_mapping: BEA_2012_Detail + attribution_method: proportional + attribution_source: BLS_QCEW + EPA_GHGI_T_A_79: &t_a_79 + attribution_method: proportional + attribution_source: BLS_QCEW + EIA_MECS_Energy: &mecs_energy + year: 2014 + selection_fields: &mecs_energy_default_selection + Class: Energy + Unit: Trillion Btu + clean_fba: !script_function:temp_data_source_functions clean_mecs_energy_fba_for_bea_summary + clean_fba_w_sec: !script_function:temp_data_source_functions clean_mapped_mecs_energy_fba_for_bea_summary + attribution_method: proportional # cleaning fxns remove need for proportional-flagged IF industry_spec is BEA summary + attribution_source: BLS_QCEW + USDA_CoA_Cropland_NAICS: &usda_pasture # allocated based on USDA Animal operation land (acres) + selection_fields: + Class: + - Land + FlowName: + - FARM OPERATIONS + year: 2017 + clean_fba: !script_function:temp_data_source_functions clean_usda_cropland_naics + USDA_CoA_Cropland: &usda_cropland + selection_fields: + Class: + - Land + FlowName: + - AREA HARVESTED + - AREA BEARING & NON-BEARING # Orchards + - AREA GROWN # Berry totals + - AREA IN PRODUCTION # Vegetable totals + year: 2017 + clean_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics + +sources_to_cache: + BLS_QCEW: + selection_fields: + Class: Employment + year: 2012 + clean_fba: !script_function:temp_data_source_functions clean_qcew + BTS_TSA: + year: 2016 + selection_fields: + Description: + - In-house truck transportation + - For-hire truck transportation + activity_to_sector_mapping: BTS_TSA + attribution_method: proportional + attribution_source: BLS_QCEW + +source_names: + EPA_GHGI_T_2_1: #U.S. GHG emissions + <<: *ghgi_parameters + activity_sets: + direct_attribution: + selection_fields: + PrimaryActivity: + - Iron and Steel Production & Metallurgical Coke Production #CO2, CH4 + - Cement Production #CO2 + - Lime Production #CO2 + - Ammonia Production #CO2 + - Incineration of Waste #CO2, #N2O + - Aluminum Production #CO2 + - Soda Ash Production #CO2 + - Ferroalloy Production #CO2, CH4 + - Titanium Dioxide Production #CO2 + - Zinc Production #CO2 + - Phosphoric Acid Production #CO2 + - Glass Production #CO2 + - Carbide Production and Consumption #CO2, CH4 + - Landfills #CH4 + - Coal Mining #CH4 + - Wastewater Treatment #CH4, N2O + - Rice Cultivation #CH4 + - Abandoned Oil and Gas Wells #CH4 + - Abandoned Underground Coal Mines #CH4 + - Anaerobic Digestion at Biogas Facilities #CH4 new activity + - Composting #CH4, N2O + - Nitric Acid Production #N2O + - Adipic Acid Production #N2O + - Caprolactam, Glyoxal, and Glyoxylic Acid Production #CH4 + - Electronics Industry #N2O + FlowName: # HFCs and other flows are attributed elsewhere + - CO2 + - CH4 + - N2O + attribution_method: direct + + electric_distribution: + selection_fields: + PrimaryActivity: Electrical Transmission and Distribution #SF6 + FlowName: SF6 + attribution_method: direct + + liming: + selection_fields: + PrimaryActivity: Liming #CO2 + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '327400' + + urea: + selection_fields: + PrimaryActivity: + - Urea Fertilization #CO2 + - Urea Consumption for Non-Agricultural Purposes #CO2 + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '325310' # Fertilizers + + carbonate_use: + selection_fields: + PrimaryActivity: Other Process Uses of Carbonates #CO2 + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '325180' # Other Basic Inorganic Chemicals + + lead_production: + selection_fields: + PrimaryActivity: Lead Production #CO2 + attribution_method: proportional + attribution_source: + USGS_MYB_Lead: + year: 2016 + selection_fields: + ActivityProducedBy: + - Primary lead, refined content, domestic ores and base bullion + - Secondary lead, lead content + + nitrous_oxide_use: + selection_fields: + PrimaryActivity: N2O from Product Uses #N2O + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '325120' # Industrial gases + +## Fossil Fuels + EPA_GHGI_T_3_63: &natgas #CH4 from Natural Gas Systems + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: + - Distribution + - Exploration + - Processing + - Production + - Transmission and Storage + attribution_method: direct + EPA_GHGI_T_3_65: *natgas #CO2 from Natural Gas Systems mimics CH4 + EPA_GHGI_T_3_67: *natgas #N2O from Natural Gas Systems, not used in original method, mimics CH4 + + EPA_GHGI_T_3_38: &petroleum #CH4 from Petroleum Systems + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: + - Crude Oil Transportation + - Exploration + - Production + - Refining + attribution_method: direct + EPA_GHGI_T_3_40: *petroleum #CO2 from Petroleum Systems mimics CH4 + EPA_GHGI_T_3_42: *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 + +## Stationary Combustion (note that CO2 is electric power only) + EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion + <<: *ghgi_parameters + clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion + activity_sets: + direct_attribution: + selection_fields: + PrimaryActivity: + - Fuel Oil Residential + - Coal Residential + - Natural Gas Residential + - Wood Residential + attribution_method: direct + electric_power: &stationary_electric + selection_fields: + PrimaryActivity: + - Coal Electric Power + - Natural Gas Electric Power + - Natural gas Electric Power # note lower case + - Fuel Oil Electric Power + - Geothermal Electric Power + - Wood Electric Power + activity_to_sector_mapping: EPA_GHGI_m2 + attribution_method: direct + fuel_oil: + selection_fields: + PrimaryActivity: + - Fuel Oil Commercial + - Fuel Oil Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # purchases of refinery products + natural_gas: + selection_fields: + PrimaryActivity: + - Natural gas Commercial + - Natural gas Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '221200' # purchases of natural gas + coal: + selection_fields: + PrimaryActivity: Coal Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '212100' # purchases of coal + coal_manufacturing: + selection_fields: + PrimaryActivity: Coal Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Coal + natural_gas_manufacturing: + selection_fields: + PrimaryActivity: Natural gas Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Natural Gas + EPA_GHGI_T_3_9: # N2O emissions from stationary combustion + <<: *stationary_combustion + EPA_GHGI_T_3_7: # CO2 emissions from stationary combustion (electricity only) + <<: [*ghgi_parameters, *stationary_electric] + +# ## Agriculture + EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues + <<: *ghgi_parameters + attribution_method: direct + selection_fields: + PrimaryActivity: + - Chickpeas + - Cotton + - Maize + - Rice + - Soybeans + - Wheat + + EPA_GHGI_T_5_3: &animals #CH4 from Enteric Fermentation + <<: *ghgi_parameters + attribution_method: direct + selection_fields: + PrimaryActivity: + - American Bison + - Beef Cattle + - Dairy Cattle + - Goats + - Horses + - Mules and Asses + - Sheep + - Swine + - Poultry + EPA_GHGI_T_5_7: *animals #CH4 and N2O from manure, mimics enteric fermentation + + EPA_GHGI_T_5_18: #Direct N2O emissions from agricultural soils + <<: *ghgi_parameters + activity_sets: + fertilizer_use: &fertilizer # allocated based on fertilizer use + selection_fields: + PrimaryActivity: + - Organic Amendment Cropland + - Residue N Cropland + - Synthetic Fertilizer Cropland + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: + - '325310' + cropland: + selection_fields: + PrimaryActivity: + - Mineralization and Asymbiotic Fixation Cropland + - Drained Organic Soils Cropland + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland: + <<: *usda_cropland + pasture: &pasture + selection_fields: + PrimaryActivity: + - All activities Grassland + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + <<: *usda_pasture + EPA_GHGI_T_5_19: #Indirect N2O emissions from agricultural soils + <<: *ghgi_parameters + activity_sets: + fertilizer_use: # allocated based on fertilizer use + <<: *fertilizer + selection_fields: + PrimaryActivity: + - Volatilization & Atm. Deposition Cropland + - Surface Leaching & Run-Off Cropland + pasture: + <<: *pasture + +## Mobile Sources (N20 and CH4) + EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion + <<: *ghgi_parameters + activity_sets: + direct_attribution: # Some of these need to be separated and attributed differently + selection_fields: + PrimaryActivity: + - Passenger Cars Gasoline On-Road + - Rail Non-Road + - Ships and Boats Non-Road + # - Aircraft Non-Road + attribution_method: direct + + trucking: + adjustment_factor: 0.99 + selection_fields: + PrimaryActivity: + - Light-Duty Trucks Gasoline On-Road + - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: BTS_TSA + + construction_and_mining: + selection_fields: + PrimaryActivity: Construction/Mining Equipment Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333120' # purchases of construction/mining equipment + + farm_non_road: + selection_fields: + PrimaryActivity: Agricultural Equipment Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333111' # purchases of farm machinery + + other_non_road: # attributed by purchases of petroleum refinery products + selection_fields: + PrimaryActivity: Other Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # purchases of refinery products + + alt_fuel_on_road: # assumes natural gas is primary alternate fuel + selection_fields: + PrimaryActivity: + - All activities Alternative Fuel On-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '221200' # purchases of natural gas + EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 + +# Major CO2 Sources + EPA_GHGI_T_A_14: # (2016 specific table) CO2 emissions from stationary combustion and transportation + <<: *ghgi_parameters + clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion + activity_sets: + direct_attribution: + selection_fields: + PrimaryActivity: Total (All Fuels) Residential + attribution_method: direct + non-manufacturing_coal: + selection_fields: + PrimaryActivity: + - Commercial Coal Commercial + - Industrial Other Coal Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '212100' # purchases of coal + non-manufacturing_natural_gas: + selection_fields: + PrimaryActivity: + - Natural Gas Commercial + - Natural Gas Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '221200' # purchases of natural gas + non-manufacturing_petroleum: + selection_fields: + PrimaryActivity: + - Total Petroleum Commercial + - Total Petroleum Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # purchases of refinery products + manufacturing_coal: # Industrial Coal for Manufacturing + selection_fields: + PrimaryActivity: + - Industrial Other Coal Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Coal + manufacturing_natural_gas: # Industrial Natural Gas for manufacturing + selection_fields: + PrimaryActivity: + - Natural Gas Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Natural Gas + + ## Transportation + natural_gas_transportation: + selection_fields: + PrimaryActivity: Natural Gas Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + selection_fields: + FlowName: Natural Gas + + aviation_gas_transportation: + selection_fields: + PrimaryActivity: Aviation Gasoline Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + selection_fields: + FlowName: Aviation Gasoline + + # jet_fuel_transportation: + # selection_fields: + # PrimaryActivity: Jet Fuel Transportation + # attribution_method: proportional + # attribution_source: + # EPA_GHGI_T_A_79: + # <<: *t_a_79 + # selection_fields: + # FlowName: Jet Fuel + + propane_transportation: + selection_fields: + PrimaryActivity: LPG (Propane) Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + selection_fields: + FlowName: LPG + + residual_fuel_transportation: + selection_fields: + PrimaryActivity: Residual Fuel Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + selection_fields: + FlowName: Residual Fuel Oil + + distillate_fuel_transportation: + selection_fields: + PrimaryActivity: + - Distillate Fuel Oil Transportation + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + activity_to_sector_mapping: EPA_GHGI + activity_sets: + direct_attribution: + selection_fields: + FlowName: Distillate Fuel Oil (Diesel Fuel) + PrimaryActivity: + - Passenger Cars + - Rail + - Recreational Boats + - Ships and Non-Recreational Boats + attribution_method: direct + trucking: + adjustment_factor: 0.99 + selection_fields: + FlowName: Distillate Fuel Oil (Diesel Fuel) + PrimaryActivity: + - Light-Duty Trucks + - Medium- and Heavy-Duty Trucks + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: BTS_TSA + buses: + selection_fields: + FlowName: Distillate Fuel Oil (Diesel Fuel) + PrimaryActivity: Buses + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # use of petroleum products + + motor_gasoline_transportation: + selection_fields: + PrimaryActivity: + - Motor Gasoline Transportation + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + activity_to_sector_mapping: EPA_GHGI + activity_sets: + direct_attribution: + selection_fields: + FlowName: Motor Gasoline + PrimaryActivity: + - Passenger Cars + - Motorcycles + - Recreational Boats + attribution_method: direct + trucking: + adjustment_factor: 0.99 + selection_fields: + FlowName: Motor Gasoline + PrimaryActivity: + - Light-Duty Trucks + - Medium- and Heavy-Duty Trucks + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: BTS_TSA + buses: + selection_fields: + FlowName: Motor Gasoline + PrimaryActivity: Buses + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # use of petroleum products + +## Other sources + EPA_GHGI_T_4_46: #CO2 for selected petrochemicals + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: + - Acrylonitrile + - Carbon Black + - Ethylene + - Ethylene Dichloride + - Ethylene Oxide + - Methanol + attribution_method: direct + + EPA_GHGI_T_3_22b: #Fossil fuel for non-energy uses + <<: *ghgi_parameters + activity_sets: + coal: + selection_fields: + PrimaryActivity: + - Industry Industrial Coking Coal + - Industry Industrial Other Coal + attribution_method: direct + + distillate_fuel_feedstocks: + selection_fields: + PrimaryActivity: Industry Distillate Fuel Oil + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: Distillate Fuel Oil + + hgl_feedstocks: + selection_fields: + PrimaryActivity: + - Industry LPG + - Industry Pentanes Plus + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: Hydrocarbon Gas Liquids, excluding natural gasoline + + petroleum_coke_feedstocks: + selection_fields: + PrimaryActivity: Industry Petroleum Coke + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: Coke and Breeze + + natural_gas_feedstocks: + selection_fields: + PrimaryActivity: + - Industry Still Gas + - Industry Natural Gas to Chemical Plants + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: Natural Gas + + other_petroleum_feedstocks: + selection_fields: + PrimaryActivity: + - Industry Asphalt & Road Oil + - Industry Lubricants + - Industry Miscellaneous Products + - Industry Naphtha (<401 F) + - Industry Other Oil (>401 F) + - Industry Special Naphtha + - Industry Waxes + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: Other + + transportation_lubricants: + selection_fields: + PrimaryActivity: Transportation Lubricants + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # use of petroleum products + + EPA_GHGI_T_4_50: # HFCs from HCFC-22 production + <<: *ghgi_parameters + selection_fields: + Unit: MMT CO2e + PrimaryActivity: HCFC-22 Production + attribution_method: direct + + EPA_GHGI_T_4_94: # HFCs and other emissions from electronics manufacture + <<: *ghgi_parameters + selection_fields: + FlowName: + SF6: SF6 + Total F-GHGs: HFCs and PFCs + NF3: NF3 + N2O[2]: N2O + attribution_method: direct + + EPA_GHGI_T_4_101: # HFCs and PFCs from ODS Substitutes + <<: *ghgi_parameters + clean_fba_before_activity_sets: !script_function:temp_data_source_functions clean_hfc_fba # removes HFCs from transportation + activity_sets: + household_refrigeration: + selection_fields: + PrimaryActivity: Refrigeration/Air Conditioning - Households + attribution_method: direct + + non-household_refrigeration: + selection_fields: + PrimaryActivity: Refrigeration/Air Conditioning + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333415' # Air conditioning equipment + + polystyrene_foam: + selection_fields: + PrimaryActivity: Foams - Polystyrene + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '326140' # Polystyrene foam + + urethane_foam: + selection_fields: + PrimaryActivity: Foams - Urethane + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '326150' # Urethane and other foams. + + EPA_GHGI_T_A_103: # HFCs from Transportation + <<: *ghgi_parameters + # clean_fba_before_activity_sets: !script_function:temp_data_source_functions split_hfcs_by_type + activity_sets: + passenger_cars: + selection_fields: + PrimaryActivity: Passenger Cars + attribution_method: direct + trucking: + selection_fields: + PrimaryActivity: + - Light-Duty Trucks + - Heavy-Duty Vehicles + adjustment_factor: 0.99 + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: BTS_TSA + refrigerated_trucks: + selection_fields: + PrimaryActivity: Medium- and Heavy-Duty Trucks + activity_to_sector_mapping: EPA_GHGI_trucking + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333415' # purchases of refrigeration equipment + other_cooling: + selection_fields: + PrimaryActivity: + - School and Tour Buses + # - Transit Buses # crosswalk marks these as excluded; I'm not at all sure why + - Rail + - Ships and Boats + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333415' # purchases of refrigeration equipment + + EPA_GHGI_T_4_80: # PFCs from aluminum production + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: Aluminum Production + attribution_method: direct + + EPA_GHGI_T_4_84: # HFCs, SF6, CO2 from magnesium production + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: Magnesium Production and Processing + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: T008 # Gross output. + + BTS_Airlines: + selection_fields: + Year: *year + emissions_factors: BTS_Airlines_emissions_factors + activity_to_sector_mapping: EPA_GHGI From 23e3994cb9d791fa273b06e5623e269d127c30c0 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 12 Jul 2022 11:24:13 -0400 Subject: [PATCH 0172/1127] Added BEA_summary display table config, made 2016 include 2017's display tables --- .../flowbysectormethods/SEEA_2016_v1.yaml | 30 +--- .../flowbysectormethods/SEEA_2017_v1.yaml | 135 ++++++++++++++++++ 2 files changed, 136 insertions(+), 29 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml index f8ae5a8f7..e50ff8b29 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml @@ -15,35 +15,7 @@ industry_spec: target_naics_year: 2012 geoscale: national -display_tables: - NAICS 2: - industry_spec: {default: NAICS_2} - replace_dict: - Industry: - '31': 31-33 - '32': 31-33 - '33': 31-33 - '44': 44-45 - '45': 44-45 - '48': 48-49 - '49': 48-49 - Pollutant: - C2F6: F-GHGs - C3F8: F-GHGs - CF4: F-GHGs - HFC, PFC and SF6 F-HTFs: F-GHGs - HFC-134a: F-GHGs - HFC-23: F-GHGs - HFCs: F-GHGs - HFCs and PFCs: F-GHGs - Total F-GHGs: F-GHGs - c-C4F8: F-GHGs - CO2: Carbon dioxide - CH4: Methane - N2O: Nitrous oxide - N2O[2]: Nitrous oxide - SF6: Sulfur hexafluoride - NF3: Nitrogen trifluoride +display_tables: !include:SEEA_2017_v1.yaml:display_tables _ghgi_parameters: &ghgi_parameters geoscale: national diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index 5fe1491cc..18cc48bf7 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -44,6 +44,141 @@ display_tables: N2O[2]: Nitrous oxide SF6: Sulfur hexafluoride NF3: Nitrogen trifluoride + BEA Summary: + replace_dict: + Industry: + '111': 111CA + '112': 111CA + '113': 113FF + '114': 113FF + '115': 113FF + '211': '211' + '212': '212' + '213': '213' + '221': '22' + '236': '23' + '237': '23' + '238': '23' + '311': 311FT + '312': 311FT + '313': 313TT + '314': 313TT + '315': 315AL + '316': 315AL + '321': '321' + '322': '322' + '323': '323' + '324': '324' + '325': '325' + '326': '326' + '327': '327' + '331': '331' + '332': '332' + '333': '333' + '334': '334' + '335': '335' + '3361': 3361MV + '3362': 3361MV + '3363': 3361MV + '3364': 3364OT + '3365': 3364OT + '3366': 3364OT + '3369': 3364OT + '337': '337' + '339': '339' + '423': '42' + '424': '42' + '425': '42' + '441': '441' + '442': 4A0 + '443': 4A0 + '444': 4A0 + '445': '445' + '446': 4A0 + '447': 4A0 + '448': 4A0 + '451': 4A0 + '452': '452' + '453': 4A0 + '454': 4A0 + '481': '481' + '482': '482' + '483': '483' + '484': '484' + '485': '485' + '486': '486' + '487': 487OS + '488': 487OS + '491': GFE + '492': 487OS + '493': '493' + '511': '511' + '512': '512' + '515': '513' + '517': '513' + '518': '514' + '519': '514' + '521': 521CI + '522': 521CI + '523': '523' + '524': '524' + '525': '525' + '531': ORE + '532': 532RL + '533': 532RL + '5411': '5411' + '5412': 5412OP + '5413': 5412OP + '5414': 5412OP + '5415': '5415' + '5416': 5412OP + '5417': 5412OP + '5418': 5412OP + '5419': 5412OP + '551': '55' + '561': '561' + '562': '562' + '611': '61' + '621': '621' + '622': '622' + '623': '623' + '624': '624' + '711': 711AS + '712': 711AS + '713': '713' + '721': '721' + '722': '722' + '811': '81' + '812': '81' + '813': '81' + '814': '81' + '921': GFGN + '922': GFGN + '923': GFGN + '924': GFGN + '925': GFGN + '926': GFGN + '927': GFE + '928': GFGN + F01: PCE + S00: G + Pollutant: + C2F6: F-GHGs + C3F8: F-GHGs + CF4: F-GHGs + HFC, PFC and SF6 F-HTFs: F-GHGs + HFC-134a: F-GHGs + HFC-23: F-GHGs + HFCs: F-GHGs + HFCs and PFCs: F-GHGs + Total F-GHGs: F-GHGs + c-C4F8: F-GHGs + CO2: Carbon dioxide + CH4: Methane + N2O: Nitrous oxide + N2O[2]: Nitrous oxide + SF6: Sulfur hexafluoride + NF3: Nitrogen trifluoride _ghgi_parameters: &ghgi_parameters geoscale: national From 320393c01b1399601044bf55518401d287345d0e Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 12 Jul 2022 11:43:43 -0400 Subject: [PATCH 0173/1127] Added printing of issue report (report of all logged warnings, errors) to console at end of FBS generation. --- flowsa/flowby.py | 17 ++++++++++------- flowsa/flowsa_log.py | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index d95e9a20b..cfa24a205 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -5,7 +5,7 @@ from functools import partial, reduce from . import (common, settings, metadata, sectormapping, literature_values, flowbyactivity, flowbysector, flowsa_yaml, - validation, geo, naics) + validation, geo, naics, flowsa_log) from .flowsa_log import log import esupy.processed_data_mgmt import esupy.dqi @@ -264,12 +264,13 @@ def standardize_units(self: FB) -> FB: standardized_units = list(conversion_table.new_unit.unique()) if any(~standardized.Unit.isin(standardized_units)): - log.warning('Units not standardized by standardize_units(): ' - '%s. Not a problem if they will be ' - 'standardized later, e.g. by mapping to the federal ' - 'elementary flow list', - [unit for unit in standardized.Unit.unique() - if unit not in standardized_units]) + unstandardized_units = [ + unit for unit in standardized.Unit.unique() + if unit not in standardized_units + ] + log.warning(f'Some units in {standardized.full_name} not ' + f'standardized by standardize_units(): ' + f'{unstandardized_units}.') return standardized @@ -1594,6 +1595,8 @@ def generateFlowBySector( for source_name, config in sources.items() ]) + flowsa_log.print_issue_report() + fbs.full_name = method fbs.to_parquet(f'{settings.fbsoutputpath}{method}.parquet') diff --git a/flowsa/flowsa_log.py b/flowsa/flowsa_log.py index 48936fb42..9a884f784 100644 --- a/flowsa/flowsa_log.py +++ b/flowsa/flowsa_log.py @@ -1,5 +1,6 @@ import logging import sys +from io import StringIO from .settings import logoutputpath try: @@ -9,6 +10,7 @@ console_formatter = logging.Formatter( '%(asctime)s %(levelname)-8s %(message)s', datefmt='%Y-%m-%d %H:%M:%S') + issue_report_title = '\nWARNING and ERROR report:\n' else: init() @@ -43,6 +45,9 @@ def format(self, record): console_formatter = ColoredFormatter() + issue_report_title = (f'\n{Fore.YELLOW}WARNING{Fore.RESET} and ' + f'{Fore.RED}ERROR{Fore.RESET} report:\n') + file_formatter = logging.Formatter('%(asctime)s %(levelname)-8s %(message)s', datefmt='%Y-%m-%d %H:%M:%S') @@ -62,12 +67,25 @@ def format(self, record): console_handler.setLevel(logging.INFO) console_handler.setFormatter(console_formatter) +issue_report_stream = StringIO() +issue_report_handler = logging.StreamHandler(issue_report_stream) +issue_report_handler.setLevel(logging.WARNING) +issue_report_handler.setFormatter(console_formatter) + log = logging.getLogger('flowsa') log.setLevel(logging.DEBUG) log.addHandler(console_handler) log.addHandler(log_file_handler) +log.addHandler(issue_report_handler) log.propagate = False vlog = logging.getLogger('flowsa.validation') vlog.setLevel(logging.DEBUG) vlog.addHandler(validation_file_handler) + + +def print_issue_report(): + print(issue_report_title) + print(issue_report_stream.getvalue()) + issue_report_stream.seek(0) + issue_report_stream.truncate(0) From 68f323d504016834eb1212573ad33b0222077f42 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 12 Jul 2022 11:55:58 -0400 Subject: [PATCH 0174/1127] Revert "Added printing of issue report (report of all logged warnings, errors) to console at end of FBS generation." This reverts commit 320393c01b1399601044bf55518401d287345d0e. --- flowsa/flowby.py | 17 +++++++---------- flowsa/flowsa_log.py | 18 ------------------ 2 files changed, 7 insertions(+), 28 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index cfa24a205..d95e9a20b 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -5,7 +5,7 @@ from functools import partial, reduce from . import (common, settings, metadata, sectormapping, literature_values, flowbyactivity, flowbysector, flowsa_yaml, - validation, geo, naics, flowsa_log) + validation, geo, naics) from .flowsa_log import log import esupy.processed_data_mgmt import esupy.dqi @@ -264,13 +264,12 @@ def standardize_units(self: FB) -> FB: standardized_units = list(conversion_table.new_unit.unique()) if any(~standardized.Unit.isin(standardized_units)): - unstandardized_units = [ - unit for unit in standardized.Unit.unique() - if unit not in standardized_units - ] - log.warning(f'Some units in {standardized.full_name} not ' - f'standardized by standardize_units(): ' - f'{unstandardized_units}.') + log.warning('Units not standardized by standardize_units(): ' + '%s. Not a problem if they will be ' + 'standardized later, e.g. by mapping to the federal ' + 'elementary flow list', + [unit for unit in standardized.Unit.unique() + if unit not in standardized_units]) return standardized @@ -1595,8 +1594,6 @@ def generateFlowBySector( for source_name, config in sources.items() ]) - flowsa_log.print_issue_report() - fbs.full_name = method fbs.to_parquet(f'{settings.fbsoutputpath}{method}.parquet') diff --git a/flowsa/flowsa_log.py b/flowsa/flowsa_log.py index 9a884f784..48936fb42 100644 --- a/flowsa/flowsa_log.py +++ b/flowsa/flowsa_log.py @@ -1,6 +1,5 @@ import logging import sys -from io import StringIO from .settings import logoutputpath try: @@ -10,7 +9,6 @@ console_formatter = logging.Formatter( '%(asctime)s %(levelname)-8s %(message)s', datefmt='%Y-%m-%d %H:%M:%S') - issue_report_title = '\nWARNING and ERROR report:\n' else: init() @@ -45,9 +43,6 @@ def format(self, record): console_formatter = ColoredFormatter() - issue_report_title = (f'\n{Fore.YELLOW}WARNING{Fore.RESET} and ' - f'{Fore.RED}ERROR{Fore.RESET} report:\n') - file_formatter = logging.Formatter('%(asctime)s %(levelname)-8s %(message)s', datefmt='%Y-%m-%d %H:%M:%S') @@ -67,25 +62,12 @@ def format(self, record): console_handler.setLevel(logging.INFO) console_handler.setFormatter(console_formatter) -issue_report_stream = StringIO() -issue_report_handler = logging.StreamHandler(issue_report_stream) -issue_report_handler.setLevel(logging.WARNING) -issue_report_handler.setFormatter(console_formatter) - log = logging.getLogger('flowsa') log.setLevel(logging.DEBUG) log.addHandler(console_handler) log.addHandler(log_file_handler) -log.addHandler(issue_report_handler) log.propagate = False vlog = logging.getLogger('flowsa.validation') vlog.setLevel(logging.DEBUG) vlog.addHandler(validation_file_handler) - - -def print_issue_report(): - print(issue_report_title) - print(issue_report_stream.getvalue()) - issue_report_stream.seek(0) - issue_report_stream.truncate(0) From 4216e91259c4f353fe03cf2f3f29244b8522cf4e Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 12 Jul 2022 13:09:51 -0400 Subject: [PATCH 0175/1127] Updated log message --- flowsa/flowby.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index d95e9a20b..190e1e489 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -264,12 +264,11 @@ def standardize_units(self: FB) -> FB: standardized_units = list(conversion_table.new_unit.unique()) if any(~standardized.Unit.isin(standardized_units)): - log.warning('Units not standardized by standardize_units(): ' - '%s. Not a problem if they will be ' - 'standardized later, e.g. by mapping to the federal ' - 'elementary flow list', - [unit for unit in standardized.Unit.unique() - if unit not in standardized_units]) + unstandardized_units = [unit for unit in standardized.Unit.unique() + if unit not in standardized_units] + log.warning(f'Some units in {standardized.full_name} not ' + f'standardized by standardize_units(): ' + f'{unstandardized_units}.') return standardized From 26b0d9d4faf2194502407a6efd54f4c1a6e0a4ba Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 13 Jul 2022 15:46:09 -0400 Subject: [PATCH 0176/1127] getFBS() now tries to find the appropriate method yaml and read it in and attach it as .config --- flowsa/flowby.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 190e1e489..a64b50237 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -5,7 +5,7 @@ from functools import partial, reduce from . import (common, settings, metadata, sectormapping, literature_values, flowbyactivity, flowbysector, flowsa_yaml, - validation, geo, naics) + validation, geo, naics, exceptions) from .flowsa_log import log import esupy.processed_data_mgmt import esupy.dqi @@ -1520,6 +1520,12 @@ def getFlowBySector( :return: FlowBySector dataframe ''' file_metadata = metadata.set_fb_meta(method, 'FlowBySector') + + try: + config = common.load_yaml_dict(method, 'FBS', external_config_path) + except exceptions.FlowsaMethodNotFoundError: + config = {} + flowby_generator = ( lambda x=method, y=external_config_path, z=download_sources_ok: cls.generateFlowBySector(x, y, z) @@ -1529,6 +1535,8 @@ def getFlowBySector( download_ok=download_fbs_ok, flowby_generator=flowby_generator, output_path=settings.fbsoutputpath, + full_name=method, + config=config, **kwargs ) @@ -1667,9 +1675,13 @@ def convert_industry_spec( tables_path = (f'{settings.tableoutputpath}{self.full_name}' f'_Display_Tables.xlsx') - with ExcelWriter(tables_path) as writer: - for name, table in table_dict.items(): - table.to_excel(writer, name) + try: + with ExcelWriter(tables_path) as writer: + for name, table in table_dict.items(): + table.to_excel(writer, name) + except PermissionError: + log.warning(f'Permission to write display tables for ' + f'{self.full_name} to {tables_path} denied.') return table_dict From ecff987a16dc821b49c1ac58cc9db8af15f4bcc1 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 15 Jul 2022 16:04:00 -0400 Subject: [PATCH 0177/1127] modify equal_allocation() to base duplication assessment on additional columns --- flowsa/allocation.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/flowsa/allocation.py b/flowsa/allocation.py index cdd01b9c3..717cefb0b 100644 --- a/flowsa/allocation.py +++ b/flowsa/allocation.py @@ -356,14 +356,22 @@ def equal_allocation(fba_load): log.info('Dropping rows duplicated due to assigning sector lengths ' 'for ambiguous sectors. Keeping sector length assignments ' 'to most specific sectors.') - dfc = dfc[dfc.duplicated(duplicate_cols, keep='first')] + dfc = dfc.sort_values(['Location', 'ActivityProducedBy', + 'ActivityConsumedBy', 'SectorProducedByLength', + 'SectorConsumedByLength','Class', 'Flowable', + 'SectorProducedBy', 'SectorConsumedBy' + ]) + dfc = dfc.drop_duplicates(subset=duplicate_cols, keep="last") # Before equally allocating, check that each activity is being allocated # to sectors of the same length - dfsub = dfc[['ActivityProducedBy', 'ActivityConsumedBy', + dfsub = dfc[['Class', 'Flowable', 'ActivityProducedBy', + 'ActivityConsumedBy', 'Context', 'Location', 'SectorProducedByLength', 'SectorConsumedByLength']].drop_duplicates() - df_dup = dfsub[dfsub.duplicated(['ActivityProducedBy', 'ActivityConsumedBy'])] + df_dup = dfsub[dfsub.duplicated(['Flowable', 'ActivityProducedBy', + 'ActivityConsumedBy', 'Context', + 'Location'])] if len(df_dup) > 1: log.error('Cannot equally allocate because sector lengths vary. All ' 'sectors must be the same sector level.') From a39761ed8eb6a263c1b2d6f81820360ce196b387 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 19 Jul 2022 10:32:19 -0400 Subject: [PATCH 0178/1127] Added ability to specify non-NAICS "industries" in industry_spec dictionary (for SEEA treatment of emissions from landfills) --- flowsa/naics.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/flowsa/naics.py b/flowsa/naics.py index 714f50b83..fedc36084 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -30,6 +30,12 @@ def industry_spec_key( level, except that codes in 112 and 113 would be mapped to the 4-digit level, with codes in 1129 being mapped to the 6 digits level. + The top industry_spec dictionary may also include a key 'non_naics', where + the associated value is a non-NAICS "industry" or list of such "industries" + that should be included in the set of industries that can be mapped to. + In this case, the user will need to supply their own crosswalk which maps + activities to that industry. + Some important points in formatting an industry specification: 1. Every dictionary in the spec must have a 'default' key, whose value is used for any relevant codes not specifically named in the dictionary. @@ -67,13 +73,15 @@ def _truncate( .query('source_naics.str.startswith(@naics)')), _industry_spec[naics] ) - for naics in _industry_spec if naics != 'default' + for naics in _industry_spec if naics not in ['default', + 'non_naics'] ] ]) truncated_naics_list = _truncate(naics_list, industry_spec) naics_list = naics_list.merge(truncated_naics_list, how='left') + _non_naics = industry_spec.get('non_naics', []) naics_key = pd.concat([ naics_list.query('target_naics.notna()'), @@ -94,7 +102,11 @@ def _truncate( ) for length in (naics_list.query('target_naics.isna()') .source_naics.str.len().unique()) - ] + ], + pd.DataFrame( + {'source_naics': _non_naics, 'target_naics': _non_naics}, + index=[0] if isinstance(_non_naics, str) else None + ) ]) naics_key = ( From 92b5cd1e36dfba88a5033868b43f2bae2b9600cd Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 19 Jul 2022 10:34:05 -0400 Subject: [PATCH 0179/1127] Added proper treatment of methan emissions from landfills to SEEA FBS method --- ....csv => NAICS_Crosswalk_EPA_GHGI_SEEA.csv} | 34 +------------------ .../flowbysectormethods/SEEA_2017_v1.yaml | 23 ++++++++----- 2 files changed, 16 insertions(+), 41 deletions(-) rename flowsa/data/activitytosectormapping/{NAICS_Crosswalk_EPA_GHGI_trucking.csv => NAICS_Crosswalk_EPA_GHGI_SEEA.csv} (96%) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_trucking.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv similarity index 96% rename from flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_trucking.csv rename to flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv index c1d7e5d72..922a2bae2 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_trucking.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv @@ -171,36 +171,4 @@ EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_14, EP EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -,,,,,, -EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,484,,484000,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,92212,,S00203,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,92214,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,92216,,,EPA_GHGI_T_A_79 +EPA_GHGI,Landfills,NAICS_2012_Code,ACC,,,"EPA_GHGI_T_2_1" diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index 18cc48bf7..56b51d5f7 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -10,6 +10,7 @@ industry_spec: default: NAICS_3 '336': {default: NAICS_4} '541': {default: NAICS_4} + non_naics: ACC # industry_spec: # default: NAICS_4 target_naics_year: 2012 @@ -271,7 +272,7 @@ source_names: - Phosphoric Acid Production #CO2 - Glass Production #CO2 - Carbide Production and Consumption #CO2, CH4 - - Landfills #CH4 + # - Landfills #CH4 - Coal Mining #CH4 - Wastewater Treatment #CH4, N2O - Rice Cultivation #CH4 @@ -289,6 +290,12 @@ source_names: - N2O attribution_method: direct + waste_decomposition: + selection_fields: + PrimaryActivity: Landfills + activity_to_sector_mapping: EPA_GHGI_SEEA + attribution_method: direct + electric_distribution: selection_fields: PrimaryActivity: Electrical Transmission and Distribution #SF6 @@ -548,7 +555,7 @@ source_names: PrimaryActivity: - Light-Duty Trucks Gasoline On-Road - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road - activity_to_sector_mapping: EPA_GHGI_trucking + activity_to_sector_mapping: EPA_GHGI_SEEA attribution_method: proportional attribution_source: BTS_TSA @@ -714,7 +721,7 @@ source_names: selection_fields: PrimaryActivity: - Distillate Fuel Oil Transportation - activity_to_sector_mapping: EPA_GHGI_trucking + activity_to_sector_mapping: EPA_GHGI_SEEA attribution_method: proportional attribution_source: EPA_GHGI_T_A_79: @@ -737,7 +744,7 @@ source_names: PrimaryActivity: - Light-Duty Trucks - Medium- and Heavy-Duty Trucks - activity_to_sector_mapping: EPA_GHGI_trucking + activity_to_sector_mapping: EPA_GHGI_SEEA attribution_method: proportional attribution_source: BTS_TSA buses: @@ -755,7 +762,7 @@ source_names: selection_fields: PrimaryActivity: - Motor Gasoline Transportation - activity_to_sector_mapping: EPA_GHGI_trucking + activity_to_sector_mapping: EPA_GHGI_SEEA attribution_method: proportional attribution_source: EPA_GHGI_T_A_79: @@ -777,7 +784,7 @@ source_names: PrimaryActivity: - Light-Duty Trucks - Medium- and Heavy-Duty Trucks - activity_to_sector_mapping: EPA_GHGI_trucking + activity_to_sector_mapping: EPA_GHGI_SEEA attribution_method: proportional attribution_source: BTS_TSA buses: @@ -965,13 +972,13 @@ source_names: - Light-Duty Trucks - Heavy-Duty Vehicles adjustment_factor: 0.99 - activity_to_sector_mapping: EPA_GHGI_trucking + activity_to_sector_mapping: EPA_GHGI_SEEA attribution_method: proportional attribution_source: BTS_TSA refrigerated_trucks: selection_fields: PrimaryActivity: Medium- and Heavy-Duty Trucks - activity_to_sector_mapping: EPA_GHGI_trucking + activity_to_sector_mapping: EPA_GHGI_SEEA attribution_method: proportional attribution_source: BEA_Use_Detail_PRO_BeforeRedef: From 986b6ce4790cd6ed13487cec2f344f0cc5a2369d Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 19 Jul 2022 16:26:26 -0400 Subject: [PATCH 0180/1127] Slight reformat for easier translation to other years --- .../flowbysectormethods/SEEA_2017_v2.yaml | 1026 +++++++++++++++++ 1 file changed, 1026 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml new file mode 100644 index 000000000..11a761ea3 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml @@ -0,0 +1,1026 @@ +%YAML 1.1 + +--- +# m2 for the GHG national replicates the method used in the National GHG Industry Attribution Model +#(https://doi.org/10.23719/1517571), except that sector attribution is to 6-digit NAICS, +# rather than the BEA 2012 IO schema + +# !include:BEA_summary_target.yaml +industry_spec: + default: NAICS_3 + '336': {default: NAICS_4} + '541': {default: NAICS_4} + non_naics: ACC +year: &year 2017 +# industry_spec: +# default: NAICS_4 +target_naics_year: 2012 +geoscale: national + +display_tables: + NAICS 2: + industry_spec: {default: NAICS_2} + replace_dict: + Industry: + '31': 31-33 + '32': 31-33 + '33': 31-33 + '44': 44-45 + '45': 44-45 + '48': 48-49 + '49': 48-49 + Pollutant: + C2F6: F-GHGs + C3F8: F-GHGs + CF4: F-GHGs + HFC, PFC and SF6 F-HTFs: F-GHGs + HFC-134a: F-GHGs + HFC-23: F-GHGs + HFCs: F-GHGs + HFCs and PFCs: F-GHGs + Total F-GHGs: F-GHGs + c-C4F8: F-GHGs + CO2: Carbon dioxide + CH4: Methane + N2O: Nitrous oxide + N2O[2]: Nitrous oxide + SF6: Sulfur hexafluoride + NF3: Nitrogen trifluoride + BEA Summary: + replace_dict: + Industry: + '111': 111CA + '112': 111CA + '113': 113FF + '114': 113FF + '115': 113FF + '211': '211' + '212': '212' + '213': '213' + '221': '22' + '236': '23' + '237': '23' + '238': '23' + '311': 311FT + '312': 311FT + '313': 313TT + '314': 313TT + '315': 315AL + '316': 315AL + '321': '321' + '322': '322' + '323': '323' + '324': '324' + '325': '325' + '326': '326' + '327': '327' + '331': '331' + '332': '332' + '333': '333' + '334': '334' + '335': '335' + '3361': 3361MV + '3362': 3361MV + '3363': 3361MV + '3364': 3364OT + '3365': 3364OT + '3366': 3364OT + '3369': 3364OT + '337': '337' + '339': '339' + '423': '42' + '424': '42' + '425': '42' + '441': '441' + '442': 4A0 + '443': 4A0 + '444': 4A0 + '445': '445' + '446': 4A0 + '447': 4A0 + '448': 4A0 + '451': 4A0 + '452': '452' + '453': 4A0 + '454': 4A0 + '481': '481' + '482': '482' + '483': '483' + '484': '484' + '485': '485' + '486': '486' + '487': 487OS + '488': 487OS + '491': GFE + '492': 487OS + '493': '493' + '511': '511' + '512': '512' + '515': '513' + '517': '513' + '518': '514' + '519': '514' + '521': 521CI + '522': 521CI + '523': '523' + '524': '524' + '525': '525' + '531': ORE + '532': 532RL + '533': 532RL + '5411': '5411' + '5412': 5412OP + '5413': 5412OP + '5414': 5412OP + '5415': '5415' + '5416': 5412OP + '5417': 5412OP + '5418': 5412OP + '5419': 5412OP + '551': '55' + '561': '561' + '562': '562' + '611': '61' + '621': '621' + '622': '622' + '623': '623' + '624': '624' + '711': 711AS + '712': 711AS + '713': '713' + '721': '721' + '722': '722' + '811': '81' + '812': '81' + '813': '81' + '814': '81' + '921': GFGN + '922': GFGN + '923': GFGN + '924': GFGN + '925': GFGN + '926': GFGN + '927': GFE + '928': GFGN + F01: PCE + S00: G + Pollutant: + C2F6: F-GHGs + C3F8: F-GHGs + CF4: F-GHGs + HFC, PFC and SF6 F-HTFs: F-GHGs + HFC-134a: F-GHGs + HFC-23: F-GHGs + HFCs: F-GHGs + HFCs and PFCs: F-GHGs + Total F-GHGs: F-GHGs + c-C4F8: F-GHGs + CO2: Carbon dioxide + CH4: Methane + N2O: Nitrous oxide + N2O[2]: Nitrous oxide + SF6: Sulfur hexafluoride + NF3: Nitrogen trifluoride + +_ghgi_parameters: &ghgi_parameters + geoscale: national + # year: &year 2017 + +_attribution_sources: + BEA_Use_Detail_PRO_BeforeRedef: &bea_use + year: 2012 + activity_to_sector_mapping: BEA_2012_Detail + attribution_method: proportional + attribution_source: BLS_QCEW + EPA_GHGI_T_A_79: &t_a_79 + <<: *ghgi_parameters + attribution_method: proportional + attribution_source: BLS_QCEW + EIA_MECS_Energy: &mecs_energy + year: 2014 + selection_fields: &mecs_energy_default_selection + Class: Energy + Unit: Trillion Btu + clean_fba: !script_function:temp_data_source_functions clean_mecs_energy_fba_for_bea_summary + clean_fba_w_sec: !script_function:temp_data_source_functions clean_mapped_mecs_energy_fba_for_bea_summary + attribution_method: proportional # cleaning fxns remove need for proportional-flagged IF industry_spec is BEA summary + attribution_source: BLS_QCEW + USDA_CoA_Cropland_NAICS: &usda_pasture # allocated based on USDA Animal operation land (acres) + selection_fields: + Class: + - Land + FlowName: + - FARM OPERATIONS + year: 2017 + clean_fba: !script_function:temp_data_source_functions clean_usda_cropland_naics + USDA_CoA_Cropland: &usda_cropland + selection_fields: + Class: + - Land + FlowName: + - AREA HARVESTED + - AREA BEARING & NON-BEARING # Orchards + - AREA GROWN # Berry totals + - AREA IN PRODUCTION # Vegetable totals + year: 2017 + clean_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics + +sources_to_cache: + BLS_QCEW: + selection_fields: + Class: Employment + year: 2012 + clean_fba: !script_function:temp_data_source_functions clean_qcew + BTS_TSA: + year: 2017 + selection_fields: + Description: + - In-house truck transportation + - For-hire truck transportation + activity_to_sector_mapping: BTS_TSA + attribution_method: proportional + attribution_source: BLS_QCEW + +source_names: + # stewiFBS: + # data_format: FBS_outside_flowsa + # FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector + # inventory_dict: {'NEI': '2017'} + # local_inventory_name: NEI_TRI_air_2017 + # selection_fields: # Remember GHGs should not be drawn from NEI + # Flowable: + # Particulate matter, ≤ 2.5μm: PM 2.5 + # compartments: + # - air + # reassign_process_to_sectors: + # - airplane_emissions + + EPA_GHGI_T_2_1: #U.S. GHG emissions + <<: *ghgi_parameters + activity_sets: + direct_attribution: + selection_fields: + PrimaryActivity: + - Iron and Steel Production & Metallurgical Coke Production #CO2, CH4 + - Cement Production #CO2 + - Lime Production #CO2 + - Ammonia Production #CO2 + - Incineration of Waste #CO2, #N2O + - Aluminum Production #CO2 + - Soda Ash Production #CO2 + - Ferroalloy Production #CO2, CH4 + - Titanium Dioxide Production #CO2 + - Zinc Production #CO2 + - Phosphoric Acid Production #CO2 + - Glass Production #CO2 + - Carbide Production and Consumption #CO2, CH4 + # - Landfills #CH4 + - Coal Mining #CH4 + - Wastewater Treatment #CH4, N2O + - Rice Cultivation #CH4 + - Abandoned Oil and Gas Wells #CH4 + - Abandoned Underground Coal Mines #CH4 + - Anaerobic Digestion at Biogas Facilities #CH4 new activity + - Composting #CH4, N2O + - Nitric Acid Production #N2O + - Adipic Acid Production #N2O + - Caprolactam, Glyoxal, and Glyoxylic Acid Production #CH4 + - Electronics Industry #N2O + FlowName: # HFCs and other flows are attributed elsewhere + - CO2 + - CH4 + - N2O + attribution_method: direct + + waste_decomposition: + selection_fields: + PrimaryActivity: Landfills + activity_to_sector_mapping: EPA_GHGI_SEEA + attribution_method: direct + + electric_distribution: + selection_fields: + PrimaryActivity: Electrical Transmission and Distribution #SF6 + FlowName: SF6 + attribution_method: direct + + liming: + selection_fields: + PrimaryActivity: Liming #CO2 + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '327400' + + urea: + selection_fields: + PrimaryActivity: + - Urea Fertilization #CO2 + - Urea Consumption for Non-Agricultural Purposes #CO2 + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '325310' # Fertilizers + + carbonate_use: + selection_fields: + PrimaryActivity: Other Process Uses of Carbonates #CO2 + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '325180' # Other Basic Inorganic Chemicals + + lead_production: + selection_fields: + PrimaryActivity: Lead Production #CO2 + attribution_method: proportional + attribution_source: + USGS_MYB_Lead: + year: 2016 + selection_fields: + ActivityProducedBy: + - Primary lead, refined content, domestic ores and base bullion + - Secondary lead, lead content + + nitrous_oxide_use: + selection_fields: + PrimaryActivity: N2O from Product Uses #N2O + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '325120' # Industrial gases + +## Fossil Fuels + EPA_GHGI_T_3_63: &natgas #CH4 from Natural Gas Systems + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: + - Distribution + - Exploration + - Processing + - Production + - Transmission and Storage + attribution_method: direct + EPA_GHGI_T_3_65: *natgas #CO2 from Natural Gas Systems mimics CH4 + EPA_GHGI_T_3_67: *natgas #N2O from Natural Gas Systems, not used in original method, mimics CH4 + + EPA_GHGI_T_3_38: &petroleum #CH4 from Petroleum Systems + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: + - Crude Oil Transportation + - Exploration + - Production + - Refining + attribution_method: direct + EPA_GHGI_T_3_40: *petroleum #CO2 from Petroleum Systems mimics CH4 + EPA_GHGI_T_3_42: *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 + +# ## Stationary Combustion (note that CO2 is electric power only) + EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion + <<: *ghgi_parameters + clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion + activity_sets: + direct_attribution: + selection_fields: + PrimaryActivity: + - Fuel Oil Residential + - Coal Residential + - Natural Gas Residential + - Wood Residential + attribution_method: direct + electric_power: &stationary_electric + selection_fields: + PrimaryActivity: + - Coal Electric Power + - Natural Gas Electric Power + - Natural gas Electric Power # note lower case + - Fuel Oil Electric Power + - Geothermal Electric Power + - Wood Electric Power + activity_to_sector_mapping: EPA_GHGI_m2 + attribution_method: direct + fuel_oil: + selection_fields: + PrimaryActivity: + - Fuel Oil Commercial + - Fuel Oil Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # purchases of refinery products + natural_gas: + selection_fields: + PrimaryActivity: + - Natural gas Commercial + - Natural gas Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '221200' # purchases of natural gas + coal: + selection_fields: + PrimaryActivity: Coal Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '212100' # purchases of coal + coal_manufacturing: + selection_fields: + PrimaryActivity: Coal Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Coal + natural_gas_manufacturing: + selection_fields: + PrimaryActivity: Natural gas Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Natural Gas + EPA_GHGI_T_3_9: # N2O emissions from stationary combustion + <<: *stationary_combustion + EPA_GHGI_T_3_7: # CO2 emissions from stationary combustion (electricity only) + <<: [*ghgi_parameters, *stationary_electric] + +# ## Agriculture + EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues + <<: *ghgi_parameters + attribution_method: direct + selection_fields: + PrimaryActivity: + - Chickpeas + - Cotton + - Maize + - Rice + - Soybeans + - Wheat + + EPA_GHGI_T_5_3: &animals #CH4 from Enteric Fermentation + <<: *ghgi_parameters + attribution_method: direct + selection_fields: + PrimaryActivity: + - American Bison + - Beef Cattle + - Dairy Cattle + - Goats + - Horses + - Mules and Asses + - Sheep + - Swine + - Poultry + EPA_GHGI_T_5_7: *animals #CH4 and N2O from manure, mimics enteric fermentation + + EPA_GHGI_T_5_18: #Direct N2O emissions from agricultural soils + <<: *ghgi_parameters + activity_sets: + fertilizer_use: &fertilizer # allocated based on fertilizer use + selection_fields: + PrimaryActivity: + - Organic Amendment Cropland + - Residue N Cropland + - Synthetic Fertilizer Cropland + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: + - '325310' + cropland: + selection_fields: + PrimaryActivity: + - Mineralization and Asymbiotic Fixation Cropland + - Drained Organic Soils Cropland + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland: + <<: *usda_cropland + pasture: &pasture + selection_fields: + PrimaryActivity: + - All activities Grassland + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + <<: *usda_pasture + EPA_GHGI_T_5_19: #Indirect N2O emissions from agricultural soils + <<: *ghgi_parameters + activity_sets: + fertilizer_use: # allocated based on fertilizer use + <<: *fertilizer + selection_fields: + PrimaryActivity: + - Volatilization & Atm. Deposition Cropland + - Surface Leaching & Run-Off Cropland + pasture: + <<: *pasture + +## Mobile Sources (N20 and CH4) + EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion + <<: *ghgi_parameters + activity_sets: + direct_attribution: # Some of these need to be separated and attributed differently + selection_fields: + PrimaryActivity: + - Passenger Cars Gasoline On-Road + - Rail Non-Road + - Ships and Boats Non-Road + # - Aircraft Non-Road + attribution_method: direct + + trucking: + adjustment_factor: 0.99 + selection_fields: + PrimaryActivity: + - Light-Duty Trucks Gasoline On-Road + - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road + activity_to_sector_mapping: EPA_GHGI_SEEA + attribution_method: proportional + attribution_source: BTS_TSA + + construction_and_mining: + selection_fields: + PrimaryActivity: Construction/Mining Equipment Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333120' # purchases of construction/mining equipment + + farm_non_road: + selection_fields: + PrimaryActivity: Agricultural Equipment Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333111' # purchases of farm machinery + + other_non_road: # attributed by purchases of petroleum refinery products + selection_fields: + PrimaryActivity: Other Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # purchases of refinery products + + alt_fuel_on_road: # assumes natural gas is primary alternate fuel + selection_fields: + PrimaryActivity: + - All activities Alternative Fuel On-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '221200' # purchases of natural gas + EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 + +# Major CO2 Sources + EPA_GHGI_T_A_13: # (2017 specific table) CO2 emissions from stationary combustion and transportation + <<: *ghgi_parameters + clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion + activity_sets: + direct_attribution: + selection_fields: + PrimaryActivity: Total (All Fuels) Residential + attribution_method: direct + non-manufacturing_coal: + selection_fields: + PrimaryActivity: + - Commercial Coal Commercial + - Industrial Other Coal Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '212100' # purchases of coal + non-manufacturing_natural_gas: + selection_fields: + PrimaryActivity: + - Natural Gas Commercial + - Natural Gas Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '221200' # purchases of natural gas + non-manufacturing_petroleum: + selection_fields: + PrimaryActivity: + - Total Petroleum Commercial + - Total Petroleum Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # purchases of refinery products + manufacturing_coal: # Industrial Coal for Manufacturing + selection_fields: + PrimaryActivity: + - Industrial Other Coal Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Coal + manufacturing_natural_gas: # Industrial Natural Gas for manufacturing + selection_fields: + PrimaryActivity: + - Natural Gas Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Natural Gas + + ## Transportation + natural_gas_transportation: + selection_fields: + PrimaryActivity: Natural Gas Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + selection_fields: + FlowName: Natural Gas + + aviation_gas_transportation: + selection_fields: + PrimaryActivity: Aviation Gasoline Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + selection_fields: + FlowName: Aviation Gasoline + + # jet_fuel_transportation: + # selection_fields: + # PrimaryActivity: Jet Fuel Transportation + # attribution_method: proportional + # attribution_source: + # EPA_GHGI_T_A_79: + # <<: *t_a_79 + # selection_fields: + # FlowName: Jet Fuel + + propane_transportation: + selection_fields: + PrimaryActivity: LPG (Propane) Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + selection_fields: + FlowName: LPG + + residual_fuel_transportation: + selection_fields: + PrimaryActivity: Residual Fuel Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + selection_fields: + FlowName: Residual Fuel Oil + + distillate_fuel_transportation: + selection_fields: + PrimaryActivity: + - Distillate Fuel Oil Transportation + activity_to_sector_mapping: EPA_GHGI_SEEA + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + activity_to_sector_mapping: EPA_GHGI + activity_sets: + direct_attribution: + selection_fields: + FlowName: Distillate Fuel Oil (Diesel Fuel) + PrimaryActivity: + - Passenger Cars + - Rail + - Recreational Boats + - Ships and Non-Recreational Boats + attribution_method: direct + trucking: + adjustment_factor: 0.99 + selection_fields: + FlowName: Distillate Fuel Oil (Diesel Fuel) + PrimaryActivity: + - Light-Duty Trucks + - Medium- and Heavy-Duty Trucks + activity_to_sector_mapping: EPA_GHGI_SEEA + attribution_method: proportional + attribution_source: BTS_TSA + buses: + selection_fields: + FlowName: Distillate Fuel Oil (Diesel Fuel) + PrimaryActivity: Buses + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # use of petroleum products + + motor_gasoline_transportation: + selection_fields: + PrimaryActivity: + - Motor Gasoline Transportation + activity_to_sector_mapping: EPA_GHGI_SEEA + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + <<: *t_a_79 + activity_to_sector_mapping: EPA_GHGI + activity_sets: + direct_attribution: + selection_fields: + FlowName: Motor Gasoline + PrimaryActivity: + - Passenger Cars + - Motorcycles + - Recreational Boats + attribution_method: direct + trucking: + adjustment_factor: 0.99 + selection_fields: + FlowName: Motor Gasoline + PrimaryActivity: + - Light-Duty Trucks + - Medium- and Heavy-Duty Trucks + activity_to_sector_mapping: EPA_GHGI_SEEA + attribution_method: proportional + attribution_source: BTS_TSA + buses: + selection_fields: + FlowName: Motor Gasoline + PrimaryActivity: Buses + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # use of petroleum products + +## Other sources + EPA_GHGI_T_4_46: #CO2 for selected petrochemicals + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: + - Acrylonitrile + - Carbon Black + - Ethylene + - Ethylene Dichloride + - Ethylene Oxide + - Methanol + attribution_method: direct + + EPA_GHGI_T_3_22b: #Fossil fuel for non-energy uses + <<: *ghgi_parameters + activity_sets: + coal: + selection_fields: + PrimaryActivity: + - Industry Industrial Coking Coal + - Industry Industrial Other Coal + attribution_method: direct + + distillate_fuel_feedstocks: + selection_fields: + PrimaryActivity: Industry Distillate Fuel Oil + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: Distillate Fuel Oil + + hgl_feedstocks: + selection_fields: + PrimaryActivity: + - Industry LPG + - Industry Pentanes Plus + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: Hydrocarbon Gas Liquids, excluding natural gasoline + + petroleum_coke_feedstocks: + selection_fields: + PrimaryActivity: Industry Petroleum Coke + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: Coke and Breeze + + natural_gas_feedstocks: + selection_fields: + PrimaryActivity: + - Industry Still Gas + - Industry Natural Gas to Chemical Plants + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: Natural Gas + + other_petroleum_feedstocks: + selection_fields: + PrimaryActivity: + - Industry Asphalt & Road Oil + - Industry Lubricants + - Industry Miscellaneous Products + - Industry Naphtha (<401 F) + - Industry Other Oil (>401 F) + - Industry Special Naphtha + - Industry Waxes + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: Other + + transportation_lubricants: + selection_fields: + PrimaryActivity: Transportation Lubricants + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # use of petroleum products + + EPA_GHGI_T_4_50: # HFCs from HCFC-22 production + <<: *ghgi_parameters + selection_fields: + Unit: MMT CO2e + PrimaryActivity: HCFC-22 Production + attribution_method: direct + + EPA_GHGI_T_4_94: # HFCs and other emissions from electronics manufacture + <<: *ghgi_parameters + selection_fields: + FlowName: + SF6: SF6 + Total F-GHGs: HFCs and PFCs + NF3: NF3 + N2O[2]: N2O + attribution_method: direct + + EPA_GHGI_T_4_101: # HFCs and PFCs from ODS Substitutes + <<: *ghgi_parameters + clean_fba_before_activity_sets: !script_function:temp_data_source_functions clean_hfc_fba # removes HFCs from transportation + activity_sets: + household_refrigeration: + selection_fields: + PrimaryActivity: Refrigeration/Air Conditioning - Households + attribution_method: direct + + non-household_refrigeration: + selection_fields: + PrimaryActivity: Refrigeration/Air Conditioning + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333415' # Air conditioning equipment + + polystyrene_foam: + selection_fields: + PrimaryActivity: Foams - Polystyrene + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '326140' # Polystyrene foam + + urethane_foam: + selection_fields: + PrimaryActivity: Foams - Urethane + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '326150' # Urethane and other foams. + + EPA_GHGI_T_A_103: # HFCs from Transportation + <<: *ghgi_parameters + # clean_fba_before_activity_sets: !script_function:temp_data_source_functions split_hfcs_by_type + activity_sets: + passenger_cars: + selection_fields: + PrimaryActivity: Passenger Cars + attribution_method: direct + trucking: + selection_fields: + PrimaryActivity: + - Light-Duty Trucks + - Heavy-Duty Vehicles + adjustment_factor: 0.99 + activity_to_sector_mapping: EPA_GHGI_SEEA + attribution_method: proportional + attribution_source: BTS_TSA + refrigerated_trucks: + selection_fields: + PrimaryActivity: Medium- and Heavy-Duty Trucks + activity_to_sector_mapping: EPA_GHGI_SEEA + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333415' # purchases of refrigeration equipment + other_cooling: + selection_fields: + PrimaryActivity: + - School and Tour Buses + # - Transit Buses # crosswalk marks these as excluded; I'm not at all sure why + - Rail + - Ships and Boats + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '333415' # purchases of refrigeration equipment + + EPA_GHGI_T_4_80: # PFCs from aluminum production + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: Aluminum Production + attribution_method: direct + + EPA_GHGI_T_4_84: # HFCs, SF6, CO2 from magnesium production + <<: *ghgi_parameters + selection_fields: + PrimaryActivity: Magnesium Production and Processing + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: T008 # Gross output. + + BTS_Airlines: + year: null + selection_fields: + Year: *year + emissions_factors: BTS_Airlines_emissions_factors + activity_to_sector_mapping: EPA_GHGI From edf16065b8ea92ac0d1a0b4707c55b8834c6830e Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 19 Jul 2022 17:20:43 -0400 Subject: [PATCH 0181/1127] Moved _ghgi_parameters to just be top level parameters, since they apply to pretty much everything anyway, and can be overridden when needed. --- .../flowbysectormethods/SEEA_2017_v2.yaml | 25 +------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml index 11a761ea3..c2f1c2a9d 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml @@ -182,10 +182,6 @@ display_tables: SF6: Sulfur hexafluoride NF3: Nitrogen trifluoride -_ghgi_parameters: &ghgi_parameters - geoscale: national - # year: &year 2017 - _attribution_sources: BEA_Use_Detail_PRO_BeforeRedef: &bea_use year: 2012 @@ -193,7 +189,6 @@ _attribution_sources: attribution_method: proportional attribution_source: BLS_QCEW EPA_GHGI_T_A_79: &t_a_79 - <<: *ghgi_parameters attribution_method: proportional attribution_source: BLS_QCEW EIA_MECS_Energy: &mecs_energy @@ -256,7 +251,6 @@ source_names: # - airplane_emissions EPA_GHGI_T_2_1: #U.S. GHG emissions - <<: *ghgi_parameters activity_sets: direct_attribution: selection_fields: @@ -360,7 +354,6 @@ source_names: ## Fossil Fuels EPA_GHGI_T_3_63: &natgas #CH4 from Natural Gas Systems - <<: *ghgi_parameters selection_fields: PrimaryActivity: - Distribution @@ -373,7 +366,6 @@ source_names: EPA_GHGI_T_3_67: *natgas #N2O from Natural Gas Systems, not used in original method, mimics CH4 EPA_GHGI_T_3_38: &petroleum #CH4 from Petroleum Systems - <<: *ghgi_parameters selection_fields: PrimaryActivity: - Crude Oil Transportation @@ -386,7 +378,6 @@ source_names: # ## Stationary Combustion (note that CO2 is electric power only) EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion - <<: *ghgi_parameters clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion activity_sets: direct_attribution: @@ -462,11 +453,10 @@ source_names: EPA_GHGI_T_3_9: # N2O emissions from stationary combustion <<: *stationary_combustion EPA_GHGI_T_3_7: # CO2 emissions from stationary combustion (electricity only) - <<: [*ghgi_parameters, *stationary_electric] + <<: *stationary_electric # ## Agriculture EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues - <<: *ghgi_parameters attribution_method: direct selection_fields: PrimaryActivity: @@ -478,7 +468,6 @@ source_names: - Wheat EPA_GHGI_T_5_3: &animals #CH4 from Enteric Fermentation - <<: *ghgi_parameters attribution_method: direct selection_fields: PrimaryActivity: @@ -494,7 +483,6 @@ source_names: EPA_GHGI_T_5_7: *animals #CH4 and N2O from manure, mimics enteric fermentation EPA_GHGI_T_5_18: #Direct N2O emissions from agricultural soils - <<: *ghgi_parameters activity_sets: fertilizer_use: &fertilizer # allocated based on fertilizer use selection_fields: @@ -527,7 +515,6 @@ source_names: USDA_CoA_Cropland_NAICS: <<: *usda_pasture EPA_GHGI_T_5_19: #Indirect N2O emissions from agricultural soils - <<: *ghgi_parameters activity_sets: fertilizer_use: # allocated based on fertilizer use <<: *fertilizer @@ -540,7 +527,6 @@ source_names: ## Mobile Sources (N20 and CH4) EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion - <<: *ghgi_parameters activity_sets: direct_attribution: # Some of these need to be separated and attributed differently selection_fields: @@ -605,7 +591,6 @@ source_names: # Major CO2 Sources EPA_GHGI_T_A_13: # (2017 specific table) CO2 emissions from stationary combustion and transportation - <<: *ghgi_parameters clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion activity_sets: direct_attribution: @@ -802,7 +787,6 @@ source_names: ## Other sources EPA_GHGI_T_4_46: #CO2 for selected petrochemicals - <<: *ghgi_parameters selection_fields: PrimaryActivity: - Acrylonitrile @@ -814,7 +798,6 @@ source_names: attribution_method: direct EPA_GHGI_T_3_22b: #Fossil fuel for non-energy uses - <<: *ghgi_parameters activity_sets: coal: selection_fields: @@ -905,14 +888,12 @@ source_names: ActivityProducedBy: '324110' # use of petroleum products EPA_GHGI_T_4_50: # HFCs from HCFC-22 production - <<: *ghgi_parameters selection_fields: Unit: MMT CO2e PrimaryActivity: HCFC-22 Production attribution_method: direct EPA_GHGI_T_4_94: # HFCs and other emissions from electronics manufacture - <<: *ghgi_parameters selection_fields: FlowName: SF6: SF6 @@ -922,7 +903,6 @@ source_names: attribution_method: direct EPA_GHGI_T_4_101: # HFCs and PFCs from ODS Substitutes - <<: *ghgi_parameters clean_fba_before_activity_sets: !script_function:temp_data_source_functions clean_hfc_fba # removes HFCs from transportation activity_sets: household_refrigeration: @@ -961,7 +941,6 @@ source_names: ActivityProducedBy: '326150' # Urethane and other foams. EPA_GHGI_T_A_103: # HFCs from Transportation - <<: *ghgi_parameters # clean_fba_before_activity_sets: !script_function:temp_data_source_functions split_hfcs_by_type activity_sets: passenger_cars: @@ -1002,13 +981,11 @@ source_names: ActivityProducedBy: '333415' # purchases of refrigeration equipment EPA_GHGI_T_4_80: # PFCs from aluminum production - <<: *ghgi_parameters selection_fields: PrimaryActivity: Aluminum Production attribution_method: direct EPA_GHGI_T_4_84: # HFCs, SF6, CO2 from magnesium production - <<: *ghgi_parameters selection_fields: PrimaryActivity: Magnesium Production and Processing attribution_method: proportional From fc14218d8f9c6445126f39dfdf698174ccd259c4 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 21 Jul 2022 10:04:07 -0400 Subject: [PATCH 0182/1127] tweaked flowsa.getFlowByActivity() --- flowsa/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flowsa/__init__.py b/flowsa/__init__.py index bf0789cba..06ca9ea8a 100644 --- a/flowsa/__init__.py +++ b/flowsa/__init__.py @@ -38,11 +38,12 @@ def getFlowByActivity(datasource, year, flowclass=None, geographic_level=None, download_FBA_if_missing=DEFAULT_DOWNLOAD_IF_MISSING): fba = FlowByActivity.getFlowByActivity( full_name=datasource, + config={}, year=int(year), download_ok=download_FBA_if_missing ) - if len(fba) ==0: + if len(fba) == 0: raise flowsa.exceptions.FBANotAvailableError( message=f"Error generating {datasource} for {str(year)}") if flowclass is not None: From 8b7dcc364c2af7934851951389c634c88b8589f7 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 22 Jul 2022 12:15:06 -0400 Subject: [PATCH 0183/1127] refactored HFC cleaning functions in temp_data_source_functions slightly --- .../temp_data_source_functions.py | 20 +++++++++++++++++ .../flowbysectormethods/SEEA_2016_v1.yaml | 2 +- .../flowbysectormethods/SEEA_2017_kg_v1.yaml | 2 +- .../flowbysectormethods/SEEA_2017_v1.yaml | 2 +- .../flowbysectormethods/SEEA_2017_v2.yaml | 22 +++++++++---------- 5 files changed, 34 insertions(+), 14 deletions(-) diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index 8a8cf60f8..08330b8ed 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -101,6 +101,26 @@ def clean_hfc_fba(fba: FlowByActivity, **kwargs): attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] } + df = ( + fba + .pipe(ghgi.subtract_HFC_transport_emissions) + .pipe(ghgi.allocate_HFC_to_residential) + .pipe(ghgi.split_HFC_foams) + .pipe(ghgi.split_HFCs_by_type) + ) + + new_fba = FlowByActivity(df) + for attr in attributes_to_save: + setattr(new_fba, attr, attributes_to_save[attr]) + + return new_fba + + +def clean_hfc_fba_for_seea(fba: FlowByActivity, **kwargs): + attributes_to_save = { + attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] + } + df = ( fba .pipe(ghgi.subtract_HFC_transport_emissions) diff --git a/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml index e50ff8b29..461371de4 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml @@ -738,7 +738,7 @@ source_names: EPA_GHGI_T_4_101: # HFCs and PFCs from ODS Substitutes <<: *ghgi_parameters - clean_fba_before_activity_sets: !script_function:temp_data_source_functions clean_hfc_fba # removes HFCs from transportation + clean_fba_before_activity_sets: !script_function:temp_data_source_functions clean_hfc_fba_for_seea # removes HFCs from transportation activity_sets: household_refrigeration: selection_fields: diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml index 602c8530c..1249f2e0b 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml @@ -767,7 +767,7 @@ source_names: EPA_GHGI_T_4_101: # HFCs and PFCs from ODS Substitutes <<: *ghgi_parameters - clean_fba_before_activity_sets: !script_function:temp_data_source_functions clean_hfc_fba # removes HFCs from transportation + clean_fba_before_activity_sets: !script_function:temp_data_source_functions clean_hfc_fba_for_seea # removes HFCs from transportation activity_sets: household_refrigeration: selection_fields: diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index 56b51d5f7..0e01cef5d 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -921,7 +921,7 @@ source_names: EPA_GHGI_T_4_101: # HFCs and PFCs from ODS Substitutes <<: *ghgi_parameters - clean_fba_before_activity_sets: !script_function:temp_data_source_functions clean_hfc_fba # removes HFCs from transportation + clean_fba_before_activity_sets: !script_function:temp_data_source_functions clean_hfc_fba_for_seea # removes HFCs from transportation activity_sets: household_refrigeration: selection_fields: diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml index c2f1c2a9d..f39194f52 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml @@ -457,18 +457,17 @@ source_names: # ## Agriculture EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues - attribution_method: direct - selection_fields: - PrimaryActivity: - - Chickpeas - - Cotton - - Maize - - Rice - - Soybeans - - Wheat + selection_fields: + PrimaryActivity: + - Chickpeas + - Cotton + - Maize + - Rice + - Soybeans + - Wheat + attribution_method: direct EPA_GHGI_T_5_3: &animals #CH4 from Enteric Fermentation - attribution_method: direct selection_fields: PrimaryActivity: - American Bison @@ -480,6 +479,7 @@ source_names: - Sheep - Swine - Poultry + attribution_method: direct EPA_GHGI_T_5_7: *animals #CH4 and N2O from manure, mimics enteric fermentation EPA_GHGI_T_5_18: #Direct N2O emissions from agricultural soils @@ -903,7 +903,7 @@ source_names: attribution_method: direct EPA_GHGI_T_4_101: # HFCs and PFCs from ODS Substitutes - clean_fba_before_activity_sets: !script_function:temp_data_source_functions clean_hfc_fba # removes HFCs from transportation + clean_fba_before_activity_sets: !script_function:temp_data_source_functions clean_hfc_fba_for_seea # removes HFCs from transportation activity_sets: household_refrigeration: selection_fields: From fb8977c7f08fd66661cba44aecff1d69db5286bd Mon Sep 17 00:00:00 2001 From: Eric Bell Date: Mon, 25 Jul 2022 12:07:55 -0400 Subject: [PATCH 0184/1127] Pull in detailed data from the "Summary N2O" and "Summary CH4" tabs of the Stationary Combustion Module. --- flowsa/data_source_scripts/EPA_SIT.py | 155 ++++--- .../flowbyactivitymethods/EPA_SIT.yaml | 434 +++++++++--------- 2 files changed, 297 insertions(+), 292 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_SIT.py b/flowsa/data_source_scripts/EPA_SIT.py index 1e17d88aa..5019d156e 100644 --- a/flowsa/data_source_scripts/EPA_SIT.py +++ b/flowsa/data_source_scripts/EPA_SIT.py @@ -17,87 +17,92 @@ def epa_sit_parse(*, source, year, config, **_): state = config['state'] - filepath = f"{externaldatapath}/SIT_data/{state}/{config['file']}" - # dictionary containing Excel sheet-specific information - sheet_dict = config['sheet_dict'] + # initialize the dataframe df0 = pd.DataFrame() - - if not os.path.exists(filepath): - raise FileNotFoundError(f'SIT file not found in {filepath}') - - # for each sheet in the Excel file containing data... - for sheet, sheet_dict in config.get('sheet_dict').items(): - sheetname = sheet_dict.get('sheetname', sheet) - tablename = sheet_dict.get('tablename') - if tablename: - sheetandtable = f'{sheetname}, {tablename}' - else: - sheetandtable = sheetname - tablename = sheet_dict.get('tablename', sheetname) - log.debug(f'Loading data from: {sheetname}...') - # read in data from Excel sheet - df = pd.read_excel(filepath, - sheet_name = sheetname, - header=sheet_dict.get('header', 2), - skiprows=range(sheet_dict.get('skiprowstart', 0), - sheet_dict.get('skiprowend', 0)), - usecols="B:AG", - nrows=sheet_dict.get('nrows')) - df.columns = df.columns.map(str) - df['ActivityProducedBy'] = df.iloc[:,0] - - # for each row in the data table... - # ...emissions categories will be renamed with the format - # 'sheet name, emissions category' - # ...emissions subcategories will be renamed with the format - # 'sheet name, emissions category, emissions subcategory' - for ind in df.index: - current_header = df['ActivityProducedBy'][ind].strip() - # for level 1 headers... - if current_header in sheet_dict.get('headers'): - active_header = current_header - if sheet_dict.get('subgroup') == 'activitybyflow': - df.loc[ind, 'FlowName'] = active_header - elif sheet_dict.get('subgroup') == 'flow': - df.loc[ind, 'FlowName'] = 'Total N2O and CH4 Emissions' - df.loc[ind,'ActivityProducedBy'] = ( - f'{sheetandtable}, {active_header}') - # for level 2 headers... - elif current_header not in sheet_dict.get('subsubheaders',''): - active_subheader = df['ActivityProducedBy'][ind].strip() - if sheet_dict.get('subgroup') == 'flow': - df.loc[ind, 'FlowName'] = active_subheader + + # for each Excel data file listed in the .yaml... + for file in config['files']: + print(f'Loading data from {file}...') + filepath = f"{externaldatapath}/SIT_data/{state}/{file}" + # dictionary containing Excel sheet-specific information + file_dict = config['files'][file]['file_dict'] + + if not os.path.exists(filepath): + raise FileNotFoundError(f'SIT file not found in {filepath}') + + # for each sheet in the Excel file containing data... + for sheet, sheet_dict in file_dict.items(): + sheetname = sheet_dict.get('sheetname', sheet) + tablename = sheet_dict.get('tablename') + if tablename: + sheetandtable = f'{sheetname}, {tablename}' + else: + sheetandtable = sheetname + tablename = sheet_dict.get('tablename', sheetname) + log.debug(f'Loading data from: {sheetname}...') + # read in data from Excel sheet + df = pd.read_excel(filepath, + sheet_name = sheetname, + header=sheet_dict.get('header', 2), + skiprows=range(sheet_dict.get('skiprowstart', 0), + sheet_dict.get('skiprowend', 0)), + usecols="B:AG", + nrows=sheet_dict.get('nrows')) + df.columns = df.columns.map(str) + df['ActivityProducedBy'] = df.iloc[:,0] + + # for each row in the data table... + # ...emissions categories will be renamed with the format + # 'sheet name, emissions category' + # ...emissions subcategories will be renamed with the format + # 'sheet name, emissions category, emissions subcategory' + for ind in df.index: + current_header = df['ActivityProducedBy'][ind].strip() + # for level 1 headers... + if current_header in sheet_dict.get('headers'): + active_header = current_header + if sheet_dict.get('subgroup') == 'activitybyflow': + df.loc[ind, 'FlowName'] = active_header + elif sheet_dict.get('subgroup') == 'flow': + df.loc[ind, 'FlowName'] = 'Total N2O and CH4 Emissions' df.loc[ind,'ActivityProducedBy'] = ( f'{sheetandtable}, {active_header}') - elif sheet_dict.get('subgroup') == 'activitybyflow': - df.loc[ind, 'FlowName'] = active_header - df.loc[ind,'ActivityProducedBy'] = ( - f'{sheetandtable}, {active_subheader}') + # for level 2 headers... + elif current_header not in sheet_dict.get('subsubheaders',''): + active_subheader = df['ActivityProducedBy'][ind].strip() + if sheet_dict.get('subgroup') == 'flow': + df.loc[ind, 'FlowName'] = active_subheader + df.loc[ind,'ActivityProducedBy'] = ( + f'{sheetandtable}, {active_header}') + elif sheet_dict.get('subgroup') == 'activitybyflow': + df.loc[ind, 'FlowName'] = active_header + df.loc[ind,'ActivityProducedBy'] = ( + f'{sheetandtable}, {active_subheader}') + else: + df.loc[ind,'ActivityProducedBy'] = ( + f'{sheetandtable}, {active_header}, ' + f'{active_subheader}') + # for level 3 headers (only occur in IndirectCO2 and Agriculture tabs)... else: + subsubheader = df['ActivityProducedBy'][ind].strip() df.loc[ind,'ActivityProducedBy'] = ( f'{sheetandtable}, {active_header}, ' - f'{active_subheader}') - # for level 3 headers (only occur in IndirectCO2 and Agriculture tabs)... - else: - subsubheader = df['ActivityProducedBy'][ind].strip() - df.loc[ind,'ActivityProducedBy'] = ( - f'{sheetandtable}, {active_header}, ' - f'{active_subheader}, {subsubheader}') - - # drop all columns except the desired emissions year and the - # emissions activity source - df = df.filter([year, 'ActivityProducedBy', 'FlowName']) - # rename columns - df = df.rename(columns={year: 'FlowAmount'}) - # add sheet-specific hardcoded data - if 'subgroup' not in sheet_dict: - df['FlowName'] = sheet_dict.get('flow') - df['Unit'] = sheet_dict.get('unit') - df['Description'] = sheetname - - # concatenate dataframe from each sheet with existing master dataframe - df0 = pd.concat([df0, df]) + f'{active_subheader}, {subsubheader}') + + # drop all columns except the desired emissions year and the + # emissions activity source + df = df.filter([year, 'ActivityProducedBy', 'FlowName']) + # rename columns + df = df.rename(columns={year: 'FlowAmount'}) + # add sheet-specific hardcoded data + if 'subgroup' not in sheet_dict: + df['FlowName'] = sheet_dict.get('flow') + df['Unit'] = sheet_dict.get('unit') + df['Description'] = sheet + + # concatenate dataframe from each sheet with existing master dataframe + df0 = pd.concat([df0, df]) # add general hardcoded data df0['Class'] = 'Chemicals' @@ -115,6 +120,8 @@ def epa_sit_parse(*, source, year, config, **_): # add FIPS location system df0 = assign_fips_location_system(df0, '2015') + df0.to_csv('C:/Users/EBell/Desktop/' + 'df0' + '.csv',index=False) + return df0 def disaggregate_emissions(fba, source_dict, **_): diff --git a/flowsa/methods/flowbyactivitymethods/EPA_SIT.yaml b/flowsa/methods/flowbyactivitymethods/EPA_SIT.yaml index ac690d1b4..1e741918a 100644 --- a/flowsa/methods/flowbyactivitymethods/EPA_SIT.yaml +++ b/flowsa/methods/flowbyactivitymethods/EPA_SIT.yaml @@ -6,7 +6,6 @@ format: xlsm # macro-enabled spreadsheet url: None parse_response_fxn: !script_function:EPA_SIT epa_sit_parse state: 'ME' -file: 'Synthesis Tool.xlsm' years: - 2019 - 2018 @@ -39,222 +38,221 @@ years: - 1991 - 1990 -sheet_dict: +files: - 'CO2FFC': - nrows: 33 - unit: MMTCO2e - flow: CO2 - headers: - - Residential - - Commercial - - Industrial - - Transportation - - Electric Utilities - - International Bunker Fuels - - TOTAL - - Additional CO2 Emissions + 'Synthesis Tool.xlsm': + + file_dict: + + 'Fossil Fuel Combustion': + sheetname: 'CO2FFC' + nrows: 33 + unit: MMTCO2e + flow: CO2 + headers: + - Residential + - Commercial + - Industrial + - Transportation + - Electric Utilities + - International Bunker Fuels + - TOTAL + - Additional CO2 Emissions + + 'Mobile Combustion CH4': + sheetname: Mobile Combustion + header: 55 + nrows: 22 + flow: CH4 + unit: MTCO2e + headers: + - Gasoline Highway + - Diesel Highway + - Non-Highway + - Alternative Fuel Vehicles + - Additional CH4 Emissions + - Total + + 'Mobile Combustion N2O': + sheetname: Mobile Combustion + header: 82 + nrows: 22 + flow: N2O + unit: MTCO2e + headers: + - Gasoline Highway + - Diesel Highway + - Non-Highway + - Alternative Fuel Vehicles + - Additional N2O Emissions + - Total + + 'Coal Mining Activities': + sheetname: Coal + header: 3 + nrows: 6 + unit: MTCO2e + flow: CH4 + headers: + - Coal Mining + - Abandoned Coal Mines + - Additional Emissions Source + + 'Oil and Gas Activities': + sheetname: Gas and Oil + header: 17 + nrows: 5 + unit: MT + flow: CH4 + headers: + - Natural Gas + - Oil + + 'Natural Gas Flaring': + sheetname: Gas and Oil + header: 24 + nrows: 1 + unit: MMT + flow: CO2 + headers: + - Natural Gas Flaring + + 'Industrial Processes': + sheetname: IP + nrows: 23 + unit: MTCO2e + headers: + - Carbon Dioxide Emissions + - Nitrous Oxide Emissions + - HFC, PFC, SF6 and NF3 Emissions + - Additional Carbon Dioxide Emissions + - Additional Nitrous Oxide Emissions + - Additional HFC, PFC, SF6, and NF3 Emissions + - Total Emissions + subgroup: 'activitybyflow' + + 'Agriculture': + sheetname: Agriculture + header: 26 + nrows: 12 + unit: MMT + headers: + - Carbon Dioxide + - Methane + - Nitrous Oxide + subgroup: 'activitybyflow' + + 'Agricultural Soil Management': + sheetname: Agriculture + tablename: Agricultural Soil Management + header: 41 + nrows: 13 + unit: MT + flow: N2O + headers: + - Direct + - Indirect + - TOTAL + subsubheaders: + - Fertilizer Runoff/Leached + - Manure Runoff/Leached + + 'Land-Use Change and Forest Emissions and Sequestration': + sheetname: Forest Management + header: 8 + nrows: 37 + unit: MMTCO2E + flow: CO2E + headers: + - Forest Carbon Flux + - Urban Trees + - Landfilled Yard Trimmings and Food Scraps + - Forest Fires + - N2O from Settlement Soils + - Agricultural Soil Carbon Flux + - Additional Carbon Dioxide Emissions + - Additional Methane Emissions + - Additional Nitrous Oxide Emissions + - Total + subsubheaders: + - Aboveground Biomass + - Belowground Biomass + - Deadwood + - Litter + - Soil (Mineral) + - Soil (Organic) + - Drained Organic Soil + - Total wood products and landfills + skiprowstart: 10 + skiprowend: 18 + + 'Landfills': + sheetname: Waste + tablename: Emissions from Landfills + header: 13 + nrows: 9 + unit: MTCO2E + flow: CH4 + headers: + - Potential CH4 + - CH4 Avoided + - Oxidation at MSW Landfills + - Oxidation at Industrial Landfills + - Total CH4 Emissions + + 'Waste Combustion': + sheetname: Waste + tablename: Emissions from Waste Combustion + header: 25 + nrows: 7 + unit: MTCO2e + headers: + - CO2 + - N2O + - CH4 + - Total CO2, N2O, CH4 Emissions + subgroup: 'activitybyflow' + + 'Wastewater': + header: 3 + nrows: 10 + unit: MMTCO2e + headers: + - Municipal CH4 + - Municipal N2O + - Industrial CH4 + - Additional Nitrous Oxide Emissions + - Additional Methan Emissions + - Total Emissions + subgroup: 'activitybyflow' - 'IndirectCO2': - nrows: 45 - unit: MMTCO2e - flow: CO2 - headers: - - Residential - - Commercial - - Industrial - - Transportation - - TOTAL - - Additional CO2 Emissions - subsubheaders: - - Conventional Boiler Use - - CHP and/or Cogeneration Process - - Process Heating - - Process Cooling and Refrigeration - - Machine Drive - - Electro-Chemical Processes - - Other Process Use - - Facility HVAC - - Facility Lighting - - Other Facility Support - - Onsite Transportation - - Other Nonprocess Use - - 'Stationary': - nrows: 17 - unit: MMTCO2e - headers: - - Residential - - Commercial - - Industrial - - Electric Utilities - - Additional N2O Emissions - - Additional CH4 Emissions - - TOTAL - skiprowstart: 13 - skiprowend: 15 - subgroup: flow - - 'Mobile Combustion CH4': - sheetname: Mobile Combustion - header: 55 - nrows: 22 - flow: CH4 - unit: MTCO2e - headers: - - Gasoline Highway - - Diesel Highway - - Non-Highway - - Alternative Fuel Vehicles - - Additional CH4 Emissions - - Total - - 'Mobile Combustion N2O': - sheetname: Mobile Combustion - header: 82 - nrows: 22 - flow: N2O - unit: MTCO2e - headers: - - Gasoline Highway - - Diesel Highway - - Non-Highway - - Alternative Fuel Vehicles - - Additional N2O Emissions - - Total - - 'Coal': - header: 3 - nrows: 6 - unit: MTCO2e - flow: CH4 - headers: - - Coal Mining - - Abandoned Coal Mines - - Additional Emissions Source - - 'Gas and Oil': - header: 17 - nrows: 5 - unit: MT - flow: CH4 - headers: - - Natural Gas - - Oil - - 'Natural Gas Flaring': - sheetname: 'Gas and Oil' - header: 24 - nrows: 1 - unit: MMT - flow: CO2 - headers: - - Natural Gas Flaring - - 'IP': - nrows: 23 - unit: MTCO2e - headers: - - Carbon Dioxide Emissions - - Nitrous Oxide Emissions - - HFC, PFC, SF6 and NF3 Emissions - - Additional Carbon Dioxide Emissions - - Additional Nitrous Oxide Emissions - - Additional HFC, PFC, SF6, and NF3 Emissions - - Total Emissions - subgroup: 'activitybyflow' - - 'Agriculture': - sheetname: Agriculture - header: 26 - nrows: 12 - unit: MMT - headers: - - Carbon Dioxide - - Methane - - Nitrous Oxide - subgroup: 'activitybyflow' - - 'Agricultural Soil Management': - sheetname: Agriculture - tablename: Agricultural Soil Management - header: 41 - nrows: 13 - unit: MT - flow: N2O - headers: - - Direct - - Indirect - - TOTAL - subsubheaders: - - Fertilizer Runoff/Leached - - Manure Runoff/Leached - - 'Land-Use Change and Forest Emissions and Sequestration': - sheetname: Forest Management - header: 8 - nrows: 37 - unit: MMTCO2E - flow: CO2E - headers: - - Forest Carbon Flux - - Urban Trees - - Landfilled Yard Trimmings and Food Scraps - - Forest Fires - - N2O from Settlement Soils - - Agricultural Soil Carbon Flux - - Additional Carbon Dioxide Emissions - - Additional Methane Emissions - - Additional Nitrous Oxide Emissions - - Total - subsubheaders: - - Aboveground Biomass - - Belowground Biomass - - Deadwood - - Litter - - Soil (Mineral) - - Soil (Organic) - - Drained Organic Soil - - Total wood products and landfills - skiprowstart: 10 - skiprowend: 18 - - 'Emissions from Landfills': - sheetname: Waste - tablename: Emissions from Landfills - header: 13 - nrows: 9 - unit: MTCO2E - flow: CH4 - headers: - - Potential CH4 - - CH4 Avoided - - Oxidation at MSW Landfills - - Oxidation at Industrial Landfills - - Total CH4 Emissions - - 'Waste Combustion': - sheetname: Waste - tablename: Emissions from Waste Combustion - header: 25 - nrows: 7 - unit: MTCO2e - headers: - - CO2 - - N2O - - CH4 - - Total CO2, N2O, CH4 Emissions - subgroup: 'activitybyflow' - - 'Wastewater': - header: 3 - nrows: 10 - unit: MMTCO2e - headers: - - Municipal CH4 - - Municipal N2O - - Industrial CH4 - - Additional Nitrous Oxide Emissions - - Additional Methan Emissions - - Total Emissions - subgroup: 'activitybyflow' \ No newline at end of file + + 'Stationary Combustion Module.xlsm': + + file_dict: + + 'Stationary Combustion CH4': + sheetname: Summary CH4 + header: 4 + nrows: 30 + unit: MMTCO2e + flow: CH4 + headers: + - Residential + - Commercial + - Industrial + - Electric Power + - TOTAL + + 'Stationary Combustion N2O': + sheetname: Summary N2O + header: 4 + nrows: 30 + unit: MMTCO2e + flow: N2O + headers: + - Residential + - Commercial + - Industrial + - Electric Power + - TOTAL \ No newline at end of file From 89c137695e3e4e5e33042c26aca3eb42f6361f7e Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 25 Jul 2022 17:47:49 -0400 Subject: [PATCH 0185/1127] Searching for Canadian exchange rate now uses config --- flowsa/flowby.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index a64b50237..dd40c10d8 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -234,7 +234,7 @@ def _getFlowBy( def standardize_units(self: FB) -> FB: exchange_rate = float( literature_values - .get_Canadian_to_USD_exchange_rate(str(self.Year.unique()[0])) + .get_Canadian_to_USD_exchange_rate(str(self.config['year'])) ) conversion_table = pd.concat([ pd.read_csv(f'{settings.datapath}unit_conversion.csv'), @@ -1623,7 +1623,7 @@ def display_tables( ) -> pd.DataFrame: display_tables = display_tables or self.config.get('display_tables') if display_tables is None: - log.error('Cannot generate display tables, since no configuration' + log.error('Cannot generate display tables, since no configuration ' 'is specified for them') return None From 599cb09619c3ea2ab5c220ea108484b5f3962f7e Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 26 Jul 2022 09:20:05 -0400 Subject: [PATCH 0186/1127] update headers in equal_allocation() to work for both FBA and FBS datasets --- flowsa/allocation.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/flowsa/allocation.py b/flowsa/allocation.py index 717cefb0b..4cb98c6c3 100644 --- a/flowsa/allocation.py +++ b/flowsa/allocation.py @@ -358,20 +358,26 @@ def equal_allocation(fba_load): 'to most specific sectors.') dfc = dfc.sort_values(['Location', 'ActivityProducedBy', 'ActivityConsumedBy', 'SectorProducedByLength', - 'SectorConsumedByLength','Class', 'Flowable', + 'SectorConsumedByLength', 'Class', + 'FlowName', 'Flowable', 'SectorProducedBy', 'SectorConsumedBy' ]) dfc = dfc.drop_duplicates(subset=duplicate_cols, keep="last") # Before equally allocating, check that each activity is being allocated # to sectors of the same length - dfsub = dfc[['Class', 'Flowable', 'ActivityProducedBy', - 'ActivityConsumedBy', 'Context', 'Location', - 'SectorProducedByLength', - 'SectorConsumedByLength']].drop_duplicates() - df_dup = dfsub[dfsub.duplicated(['Flowable', 'ActivityProducedBy', - 'ActivityConsumedBy', 'Context', - 'Location'])] + possible_headers = ['Class', 'FlowName', 'Flowable', 'ActivityProducedBy', + 'ActivityConsumedBy', 'Compartment', 'Context', + 'Location', 'SectorProducedByLength', + 'SectorConsumedByLength'] + dfsub = dfc[dfc.columns.intersection(possible_headers)].drop_duplicates() + + # create column list based on if df is FBA or FBS + duplicated_cols = [e for e in dfsub.columns if e in + ['FlowName', 'Flowable', 'ActivityProducedBy', + 'ActivityConsumedBy', 'Compartment', 'Context', + 'Location']] + df_dup = dfsub[dfsub.duplicated(duplicated_cols)] if len(df_dup) > 1: log.error('Cannot equally allocate because sector lengths vary. All ' 'sectors must be the same sector level.') From 31e070b3b7fc69dc9bbce59e2d67224b61eb1f96 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 26 Jul 2022 16:24:51 -0400 Subject: [PATCH 0187/1127] Fixed QCEW issue, added disaggregate CoA cropland (should be replaced) --- .../temp_data_source_functions.py | 38 ++++++++++++++++++- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index 08330b8ed..05a3b287a 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -1,8 +1,10 @@ from flowsa import naics +from flowsa import settings from flowsa.flowsa_log import log import pandas as pd from flowsa.data_source_scripts import EIA_MECS as mecs from flowsa.data_source_scripts import EPA_GHGI as ghgi +from flowsa.data_source_scripts import USDA_CoA_Cropland as coa from flowsa.flowby import FlowByActivity @@ -36,7 +38,14 @@ def clean_qcew(fba: FlowByActivity, **kwargs): target_naics = set(naics.industry_spec_key(fba.config['industry_spec']) .target_naics) - filtered = fixed.query('ActivityProducedBy in @target_naics') + filtered = ( + fixed + .assign(ActivityProducedBy=fixed.ActivityProducedBy.mask( + (fixed.ActivityProducedBy + '0').isin(target_naics), + fixed.ActivityProducedBy + '0' + )) + .query('ActivityProducedBy in @target_naics') + ) return filtered @@ -55,7 +64,8 @@ def clean_usda_cropland_naics(fba: FlowByActivity, **kwargs): target_naics = set(naics.industry_spec_key(fba.config['industry_spec']) .target_naics) - filtered = fba.query('ActivityProducedBy in @target_naics') + + filtered = fba.query('ActivityConsumedBy in @target_naics') return filtered @@ -147,3 +157,27 @@ def split_hfcs_by_type(fba: FlowByActivity, **kwargs): setattr(new_fba, attr, attributes_to_save[attr]) return new_fba + + +def disaggregate_coa_cropland_to_6_digit_naics(fba: FlowByActivity): + """ + Disaggregate usda coa cropland to naics 6. Fragile implementation, should + be replaced. In particular, it will break things for any industry + specification other than {'default': 'NAICS_6'}. + :param fba: df, CoA cropland data, FBA format with sector columns + :return: df, CoA cropland with disaggregated NAICS sectors + """ + attributes_to_save = { + attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] + } + + df = coa.disaggregate_coa_cropland_to_6_digit_naics( + fba, fba.config, fba.config, + download_FBA_if_missing=settings.DEFAULT_DOWNLOAD_IF_MISSING + ) + + new_fba = FlowByActivity(df) + for attr in attributes_to_save: + setattr(new_fba, attr, attributes_to_save[attr]) + + return new_fba From 50426541746f6eae3c0e8f45ffcce5781d4af49f Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 27 Jul 2022 14:16:10 -0400 Subject: [PATCH 0188/1127] Enabled specifying primary_action_type (for primary/secondary activities/sectors) in config yaml. --- flowsa/flowby.py | 55 ++++++++++++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index dd40c10d8..4ef1cc324 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -550,20 +550,32 @@ def add_primary_secondary_columns( f'columns, since {col_type}ProducedBy and/or ' f'{col_type}ConsumedBy columns are missing.') return self + else: - fb = self.assign( - **{f'Primary{col_type}': self[f'{col_type}ProducedBy'].mask( - ((self.FlowType == 'TECHNOSPHERE_FLOW') - | (self[f'{col_type}ProducedBy'].isna()) - | (self[f'{col_type}ProducedBy'].isin( - ['22', '221', '2213', '22131', '221310'] - ) - & self[f'{col_type}ConsumedBy'].isin( - ['F010', 'F0100', 'F01000'] - ))) & self[f'{col_type}ConsumedBy'].notna(), - self[f'{col_type}ConsumedBy'] - )} - ) + if 'primary_action_type' in self.config: + fb = self.assign( + **{f'Primary{col_type}': + self[f'{col_type}' + f'{self.config["primary_action_type"]}By']} + ) + + else: + fb = self.assign( + **{f'Primary{col_type}': + self[f'{col_type}ProducedBy'].mask( + ((self.FlowType == 'TECHNOSPHERE_FLOW') + | (self[f'{col_type}ProducedBy'].isna()) + | (self[f'{col_type}ProducedBy'].isin( + ['22', '221', '2213', '22131', '221310'] + ) + & self[f'{col_type}ConsumedBy'].isin( + ['F010', 'F0100', 'F01000'] + ))) + & self[f'{col_type}ConsumedBy'].notna(), + self[f'{col_type}ConsumedBy'] + ) + } + ) def _identify_secondary(row: _FlowBySeries) -> str: sectors = [row[f'{col_type}ProducedBy'], @@ -1015,6 +1027,8 @@ def map_to_sectors( :param external_config_path: str, an external path to search for a crosswalk. ''' + naics_key = naics.industry_spec_key(self.config['industry_spec']) + if self.config['sector-like_activities']: log.info('Activities in %s are NAICS codes.', self.full_name) @@ -1039,11 +1053,10 @@ def map_to_sectors( for direction in ['ProducedBy', 'ConsumedBy']: fba_w_naics = ( fba_w_naics - .merge( - naics.industry_spec_key(self.config['industry_spec']), - how='left', - left_on=f'Activity{direction}', - right_on='source_naics') + .merge(naics_key, + how='left', + left_on=f'Activity{direction}', + right_on='source_naics') .rename(columns={'target_naics': f'Sector{direction}'}) .drop(columns='source_naics') ) @@ -1086,8 +1099,10 @@ def map_to_sectors( 'industry/sector aggregation structure.') activity_to_target_naics_crosswalk = ( activity_to_source_naics_crosswalk - .merge(naics.industry_spec_key(self.config['industry_spec']), - how='left', left_on='Sector', right_on='source_naics') + .merge(naics_key, + how='left', + left_on='Sector', + right_on='source_naics') .assign(Sector=lambda x: x.target_naics) .drop(columns=['source_naics', 'target_naics']) .drop_duplicates() From 502c39e8d349aafb40914e1a3b9c78a56144916c Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 28 Jul 2022 12:14:43 -0400 Subject: [PATCH 0189/1127] Added EIA_MECS cleaning functions --- .../temp_data_source_functions.py | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index 05a3b287a..2ad4cb75e 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -106,6 +106,130 @@ def clean_mapped_mecs_energy_fba_for_bea_summary( '& ActivityConsumedBy != SectorConsumedBy)') +def clean_mecs_energy_fba(fba: FlowByActivity, **_) -> FlowByActivity: + ''' + This function helps address the unique structure of the EIA MECS dataset. + The MECS dataset contains rows at various levels of aggregation between + NAICS-3 and NAICS-6 (inclusive). Each aggregated row contains the total + for that level of aggregation, even if data are also reported for a less + aggregated subset of those industries. For example: + + ActivityConsumedBy | FlowAmount | ... + ------------------------------------- + 311 | 110 | + 3112 | 65 | + 311221 | 55 | + + where the 110 reported for 311 includes the 65 reported for 3112, which + includes the 55 reported for 211221. If we do not address this issue, there + will be double counting. Additionally, if we are trying to disaggregate + to the NAICS-6 level, all three rows shown above will be mapped to NAICS-6 + 311221 (with the first wo rows also being mapped to several other NAICS-6 + codes as well). We will then over attribute the (double-counted) flows to + those industries and groups of industries for which more specific detail + is provided. + + This function addresses the double counting issue. For each aggregated + industry group, all descendant (less aggregated) industries or industry + groups for which detailed information is given are subtracted from the + aggregated total. Using the example from above: + + ActivityConsumedBy | FlowAmount | ... + ------------------------------------- + 311 | 45 | + 3112 | 10 | + 311221 | 55 | + + Additionally, this function adds a column called "descendants", which for + each industry holds all the descendant industries or industry groups that + have detailed information provided in the dataset. After mapping to + industries, but before attribution is performed, this column is used by the + clean_mapped_mecs_energy_fba function to drop any row that is mapped + from an aggregated industry group to a less aggregated industry or industry + group THAT HAS DETAILED INFORMATION GIVEN IN THE MECS (and therefore has + its own row already) to avoid the over-attribution issue. + Again using the previous example: + + ActivityConsumedBy | FlowAmount | descendants | ... + --------------------------------------------------- + 311 | 45 | 3112 311221 | + 3112 | 10 | 311221 | + 311221 | 55 | | + + Note that this function is not useful if the desired aggregation level is + NAICS-2. In such a case, the MECS dataset can be filtered to include only + the rows with ActivityConsumedBy == "31-33", then disaggregated to 31, 32, + 33 using another dataset (such as the QCEW). + ''' + mecs = ( + fba + .query('ActivityConsumedBy != "31-33"') + .assign(descendants='') + ) + + for level in [5, 4, 3]: + descendants = ( + mecs + .drop(columns='descendants') + .query(f'ActivityConsumedBy.str.len() > {level}') + .assign( + parent=lambda x: x.ActivityConsumedBy.str.slice(stop=level) + ) + .groupby(['Flowable', 'Location', 'parent']) + .agg({'FlowAmount': 'sum', 'ActivityConsumedBy': ' '.join}) + .reset_index() + .rename(columns={'ActivityConsumedBy': 'descendants', + 'FlowAmount': 'descendant_flows', + 'parent': 'ActivityConsumedBy'}) + ) + + mecs = ( + mecs + .merge(descendants, + how='left', + on=['Flowable', 'Location', 'ActivityConsumedBy'], + suffixes=(None, '_y')) + .fillna({'descendant_flows': 0, 'descendants_y': ''}) + .assign( + descendants=lambda x: x.descendants.mask(x.descendants == '', + x.descendants_y), + FlowAmount=lambda x: (x.FlowAmount - x.descendant_flows).mask( + x.FlowAmount - x.descendant_flows < 0, 0) + ) + .drop(columns=['descendant_flows', 'descendants_y']) + ) + + return mecs + + +def clean_mapped_mecs_energy_fba(fba: FlowByActivity, **_) -> FlowByActivity: + ''' + This function finishes handling the over-attribution issue described in + the documentation for clean_mecs_energy_fba by dropping any row in the + MECS dataset which has been mapped to an industry or industry group which + is a subset (strict or otherwise) of an industry group listed in the + descendants columns. So, if 311 and 3112 both appear in the MECS datset, + 3112 will be listed as a descendant of 311 and this function will therefore + drop a row mapping 311 to 311221 (since more detailed information on 3112, + which contains 311221, is provided). If 31122 and 311221 do not appear in + the dataset, a row mapping 3112 to 311221 will not be dropped, since no + more detailed information on 311221 is given. Further attribution/ + disaggregation should be done using another datatset such as the QCEW. + ''' + mecs = ( + fba + .assign(to_keep=fba.apply( + lambda x: not any([x.SectorConsumedBy.startswith(d) + for d in x.descendants.split()]), + axis='columns' + )) + .query('to_keep') + .drop(columns=['descendants', 'to_keep']) + ) + + return mecs + + def clean_hfc_fba(fba: FlowByActivity, **kwargs): attributes_to_save = { attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] From 55eb74e81a06b00bbed997fffaf0ceb663ab7060 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 28 Jul 2022 16:09:50 -0400 Subject: [PATCH 0190/1127] Correction to USDA CoA crosswalk + additions to source_catalog --- .../NAICS_Crosswalk_USDA_CoA_Cropland.csv | 2 +- flowsa/data/source_catalog.yaml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_USDA_CoA_Cropland.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_USDA_CoA_Cropland.csv index 7a2716b5c..1d9468eb3 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_USDA_CoA_Cropland.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_USDA_CoA_Cropland.csv @@ -40,7 +40,7 @@ USDA_CoA_Cropland,ORCHARDS,NAICS_2012_Code,111310, USDA_CoA_Cropland,ORCHARDS,NAICS_2012_Code,111320, USDA_CoA_Cropland,ORCHARDS,NAICS_2012_Code,111331, USDA_CoA_Cropland,ORCHARDS,NAICS_2012_Code,111332, -USDA_CoA_Cropland,ORCHARDS,NAICS_2012_Code,111333, +USDA_CoA_Cropland,BERRY TOTALS,NAICS_2012_Code,111333, USDA_CoA_Cropland,BERRY TOTALS,NAICS_2012_Code,111334, USDA_CoA_Cropland,ORCHARDS,NAICS_2012_Code,111335, USDA_CoA_Cropland,ORCHARDS,NAICS_2012_Code,111336, diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 1fde6f036..2e3a00ef1 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -36,6 +36,7 @@ BEA_Use_Detail_PRO_BeforeRedef: # activity_schema: BEA_2012_Detail_Code sector_aggregation_level: "disaggregated" BEA_Make_Detail_BeforeRedef: + data_format: FBA class: - Money sector-like_activities: False #update to true once alternate activity_schema in place @@ -258,6 +259,7 @@ write_FBA_California_Commercial_bySector: activity_schema: sector_aggregation_level: "" USGS_MYB_Lead: + data_format: FBA class: - Geological sector-like_activities: False From 95a23e3a4e81af313acbe11c14664e5bad392cd7 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 28 Jul 2022 16:23:23 -0400 Subject: [PATCH 0191/1127] fix key error --- flowsa/allocation.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/flowsa/allocation.py b/flowsa/allocation.py index 4cb98c6c3..e0899b2ae 100644 --- a/flowsa/allocation.py +++ b/flowsa/allocation.py @@ -356,12 +356,13 @@ def equal_allocation(fba_load): log.info('Dropping rows duplicated due to assigning sector lengths ' 'for ambiguous sectors. Keeping sector length assignments ' 'to most specific sectors.') - dfc = dfc.sort_values(['Location', 'ActivityProducedBy', - 'ActivityConsumedBy', 'SectorProducedByLength', - 'SectorConsumedByLength', 'Class', - 'FlowName', 'Flowable', - 'SectorProducedBy', 'SectorConsumedBy' - ]) + sort_cols = ['Location', 'ActivityProducedBy', + 'ActivityConsumedBy', 'SectorProducedByLength', + 'SectorConsumedByLength', 'Class', + 'FlowName', 'Flowable', + 'SectorProducedBy', 'SectorConsumedBy' + ] + dfc = dfc.sort_values([e for e in sort_cols if e in dfc.columns]) dfc = dfc.drop_duplicates(subset=duplicate_cols, keep="last") # Before equally allocating, check that each activity is being allocated From 7fec75bc9dbe01d5667202ce9f663c8c0c784c29 Mon Sep 17 00:00:00 2001 From: Eric Bell Date: Tue, 16 Aug 2022 14:44:07 -0400 Subject: [PATCH 0192/1127] Write new method to pull in supplementary ME biogenic data as FBA. --- flowsa/data_source_scripts/EPA_SIT.py | 2 - flowsa/data_source_scripts/StateGHGI.py | 86 +++++++++++++++++++ .../flowbyactivitymethods/StateGHGI_ME.yaml | 61 +++++++++++++ 3 files changed, 147 insertions(+), 2 deletions(-) create mode 100644 flowsa/data_source_scripts/StateGHGI.py create mode 100644 flowsa/methods/flowbyactivitymethods/StateGHGI_ME.yaml diff --git a/flowsa/data_source_scripts/EPA_SIT.py b/flowsa/data_source_scripts/EPA_SIT.py index 5019d156e..b2833fc70 100644 --- a/flowsa/data_source_scripts/EPA_SIT.py +++ b/flowsa/data_source_scripts/EPA_SIT.py @@ -120,8 +120,6 @@ def epa_sit_parse(*, source, year, config, **_): # add FIPS location system df0 = assign_fips_location_system(df0, '2015') - df0.to_csv('C:/Users/EBell/Desktop/' + 'df0' + '.csv',index=False) - return df0 def disaggregate_emissions(fba, source_dict, **_): diff --git a/flowsa/data_source_scripts/StateGHGI.py b/flowsa/data_source_scripts/StateGHGI.py new file mode 100644 index 000000000..a6733d7c5 --- /dev/null +++ b/flowsa/data_source_scripts/StateGHGI.py @@ -0,0 +1,86 @@ +# EPA_SIT.py (flowsa) +# !/usr/bin/env python3 +# coding=utf-8 +""" +Loads EPA State Inventory Tool (SIT) data for state specified from external +data directory. Parses EPA SIT data to flowbyactivity format. +""" + +import pandas as pd +import os +from flowsa.settings import externaldatapath, log +from flowsa.flowbyfunctions import assign_fips_location_system, \ + load_fba_w_standardized_units +from flowsa.location import apply_county_FIPS +from flowsa.schema import flow_by_activity_fields + +def ME_biogenic_parse(*, source, year, config, **_): + + # initialize the dataframe + df0 = pd.DataFrame() + + filename = config['filename'] + + log.info(f'Loading data from file {filename}...') + + filepath = f"{externaldatapath}/StateGHGI_data/ME/{filename}" + + # dictionary containing Excel sheet-specific information + file_dict = config['file_dict'] + + if not os.path.exists(filepath): + raise FileNotFoundError(f'StateGHGI file not found in {filepath}') + + # for each data table in the Excel file... + for table, table_dict in file_dict.items(): + + log.info(f'Loading data from table {table}...') + + # read in data from Excel sheet + df = pd.read_excel(filepath, + header=table_dict.get('header'), + usecols="A:AG", + nrows=table_dict.get('nrows')) + df.columns = df.columns.map(str) + + # rename certain columns + df.rename(columns = { + 'Gas':'FlowName', + 'Sector/Activity':'ActivityProducedBy', + 'Units':'Unit', + year:'FlowAmount' + }, inplace = True) + df['ActivityProducedBy'] = df['ActivityProducedBy'] + ", " + table[15:] + + # drop all years except the desired emissions year + df = df.filter(['FlowAmount', 'FlowName', 'ActivityProducedBy', 'Unit']) + + # concatenate dataframe from each table with existing master dataframe + df0 = pd.concat([df0, df]) + + # add hardcoded data + df0['Description'] = "Maine supplementary biogenic emissions data" + df0['Class'] = 'Chemicals' + df0['SourceName'] = source + df0['FlowType'] = "ELEMENTARY_FLOW" + df0['Compartment'] = 'air' + df0['Year'] = year + df0['DataReliability'] = 5 + df0['DataCollection'] = 5 + + # add state FIPS code + df0['State'] = 'ME' + df0['County'] = '' + df0 = apply_county_FIPS(df0, year='2015', source_state_abbrev=True) + # add FIPS location system + df0 = assign_fips_location_system(df0, '2015') + + df0.to_csv('C:/Users/EBell/Desktop/' + 'df0' + '.csv',index=False) + + return df0 + + +if __name__ == '__main__': + import flowsa + flowsa.flowbyactivity.main(source='StateGHGI_ME', year='2019') + fba = flowsa.getFlowByActivity('StateGHGI_ME', '2019') diff --git a/flowsa/methods/flowbyactivitymethods/StateGHGI_ME.yaml b/flowsa/methods/flowbyactivitymethods/StateGHGI_ME.yaml new file mode 100644 index 000000000..05e6d917b --- /dev/null +++ b/flowsa/methods/flowbyactivitymethods/StateGHGI_ME.yaml @@ -0,0 +1,61 @@ +author: Maine Department of Environmental Protection +source_name: Maine State Biogenic Emissions Data +bib_id: StateGHGI_ME +format: xlsx # Excel spreadsheet +url: None +parse_response_fxn: !script_function:StateGHGI ME_biogenic_parse +years: +- 2019 +- 2018 +- 2017 +- 2016 +- 2015 +- 2014 +- 2013 +- 2012 +- 2011 +- 2010 +- 2009 +- 2008 +- 2007 +- 2006 +- 2005 +- 2004 +- 2003 +- 2002 +- 2001 +- 2000 +- 1999 +- 1998 +- 1997 +- 1996 +- 1995 +- 1994 +- 1993 +- 1992 +- 1991 +- 1990 + +filename: 'ME_biogenic_data_summary.xlsx' + +file_dict: + + 'Emissions from Ethanol Combustion': + sheetname: 'Sheet1' + header: 1 + nrows: 9 + + 'Emissions from Biodiesel Combustion': + sheetname: 'Sheet1' + header: 14 + nrows: 3 + + 'Emissions from Solid Waste Management': + sheetname: 'Sheet1' + header: 21 + nrows: 4 + + 'Emissions from Wood and Wood Residuals': + sheetname: 'Sheet1' + header: 29 + nrows: 12 \ No newline at end of file From 0341d0c2463bb0c5cdedfbfe7e39bc8753335538 Mon Sep 17 00:00:00 2001 From: Eric Bell Date: Tue, 16 Aug 2022 14:46:55 -0400 Subject: [PATCH 0193/1127] Rename FlowName to clarify that emissions are biogenic. --- flowsa/data_source_scripts/StateGHGI.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/flowsa/data_source_scripts/StateGHGI.py b/flowsa/data_source_scripts/StateGHGI.py index a6733d7c5..6f28718cb 100644 --- a/flowsa/data_source_scripts/StateGHGI.py +++ b/flowsa/data_source_scripts/StateGHGI.py @@ -51,7 +51,8 @@ def ME_biogenic_parse(*, source, year, config, **_): year:'FlowAmount' }, inplace = True) df['ActivityProducedBy'] = df['ActivityProducedBy'] + ", " + table[15:] - + df['FlowName'] = 'Biogenic ' + df['FlowName'] + # drop all years except the desired emissions year df = df.filter(['FlowAmount', 'FlowName', 'ActivityProducedBy', 'Unit']) @@ -75,8 +76,6 @@ def ME_biogenic_parse(*, source, year, config, **_): # add FIPS location system df0 = assign_fips_location_system(df0, '2015') - df0.to_csv('C:/Users/EBell/Desktop/' + 'df0' + '.csv',index=False) - return df0 From 66d2285d5072bbfa371ca5aa90c7b432334ad4b2 Mon Sep 17 00:00:00 2001 From: Eric Bell Date: Wed, 17 Aug 2022 15:41:40 -0400 Subject: [PATCH 0194/1127] Revise EPA_SIT to process multiple states in one run. --- flowsa/data_source_scripts/EPA_SIT.py | 166 +++++++++--------- .../flowbyactivitymethods/EPA_SIT.yaml | 2 +- 2 files changed, 85 insertions(+), 83 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_SIT.py b/flowsa/data_source_scripts/EPA_SIT.py index b2833fc70..8315af913 100644 --- a/flowsa/data_source_scripts/EPA_SIT.py +++ b/flowsa/data_source_scripts/EPA_SIT.py @@ -16,93 +16,96 @@ def epa_sit_parse(*, source, year, config, **_): - state = config['state'] - # initialize the dataframe - df0 = pd.DataFrame() - - # for each Excel data file listed in the .yaml... - for file in config['files']: - print(f'Loading data from {file}...') - filepath = f"{externaldatapath}/SIT_data/{state}/{file}" - # dictionary containing Excel sheet-specific information - file_dict = config['files'][file]['file_dict'] + df0 = pd.DataFrame() - if not os.path.exists(filepath): - raise FileNotFoundError(f'SIT file not found in {filepath}') + # for each state listed in the method file... + for state in config['state_list']: + log.info(f'Parsing data for {state}...') + + # for each Excel data file listed in the .yaml... + for file in config['files']: + log.info(f'Loading data from {file}...') + filepath = f"{externaldatapath}/SIT_data/{state}/{file}" + # dictionary containing Excel sheet-specific information + file_dict = config['files'][file]['file_dict'] - # for each sheet in the Excel file containing data... - for sheet, sheet_dict in file_dict.items(): - sheetname = sheet_dict.get('sheetname', sheet) - tablename = sheet_dict.get('tablename') - if tablename: - sheetandtable = f'{sheetname}, {tablename}' - else: - sheetandtable = sheetname - tablename = sheet_dict.get('tablename', sheetname) - log.debug(f'Loading data from: {sheetname}...') - # read in data from Excel sheet - df = pd.read_excel(filepath, - sheet_name = sheetname, - header=sheet_dict.get('header', 2), - skiprows=range(sheet_dict.get('skiprowstart', 0), - sheet_dict.get('skiprowend', 0)), - usecols="B:AG", - nrows=sheet_dict.get('nrows')) - df.columns = df.columns.map(str) - df['ActivityProducedBy'] = df.iloc[:,0] - - # for each row in the data table... - # ...emissions categories will be renamed with the format - # 'sheet name, emissions category' - # ...emissions subcategories will be renamed with the format - # 'sheet name, emissions category, emissions subcategory' - for ind in df.index: - current_header = df['ActivityProducedBy'][ind].strip() - # for level 1 headers... - if current_header in sheet_dict.get('headers'): - active_header = current_header - if sheet_dict.get('subgroup') == 'activitybyflow': - df.loc[ind, 'FlowName'] = active_header - elif sheet_dict.get('subgroup') == 'flow': - df.loc[ind, 'FlowName'] = 'Total N2O and CH4 Emissions' - df.loc[ind,'ActivityProducedBy'] = ( - f'{sheetandtable}, {active_header}') - # for level 2 headers... - elif current_header not in sheet_dict.get('subsubheaders',''): - active_subheader = df['ActivityProducedBy'][ind].strip() - if sheet_dict.get('subgroup') == 'flow': - df.loc[ind, 'FlowName'] = active_subheader + if not os.path.exists(filepath): + raise FileNotFoundError(f'SIT file not found in {filepath}') + + # for each sheet in the Excel file containing data... + for sheet, sheet_dict in file_dict.items(): + sheetname = sheet_dict.get('sheetname', sheet) + tablename = sheet_dict.get('tablename') + if tablename: + sheetandtable = f'{sheetname}, {tablename}' + else: + sheetandtable = sheetname + tablename = sheet_dict.get('tablename', sheetname) + log.debug(f'Loading data from: {sheetname}...') + # read in data from Excel sheet + df = pd.read_excel(filepath, + sheet_name = sheetname, + header=sheet_dict.get('header', 2), + skiprows=range(sheet_dict.get('skiprowstart', 0), + sheet_dict.get('skiprowend', 0)), + usecols="B:AG", + nrows=sheet_dict.get('nrows')) + df.columns = df.columns.map(str) + df['ActivityProducedBy'] = df.iloc[:,0] + + # for each row in the data table... + # ...emissions categories will be renamed with the format + # 'sheet name, emissions category' + # ...emissions subcategories will be renamed with the format + # 'sheet name, emissions category, emissions subcategory' + for ind in df.index: + current_header = df['ActivityProducedBy'][ind].strip() + # for level 1 headers... + if current_header in sheet_dict.get('headers'): + active_header = current_header + if sheet_dict.get('subgroup') == 'activitybyflow': + df.loc[ind, 'FlowName'] = active_header + elif sheet_dict.get('subgroup') == 'flow': + df.loc[ind, 'FlowName'] = 'Total N2O and CH4 Emissions' df.loc[ind,'ActivityProducedBy'] = ( f'{sheetandtable}, {active_header}') - elif sheet_dict.get('subgroup') == 'activitybyflow': - df.loc[ind, 'FlowName'] = active_header - df.loc[ind,'ActivityProducedBy'] = ( - f'{sheetandtable}, {active_subheader}') + # for level 2 headers... + elif current_header not in sheet_dict.get('subsubheaders',''): + active_subheader = df['ActivityProducedBy'][ind].strip() + if sheet_dict.get('subgroup') == 'flow': + df.loc[ind, 'FlowName'] = active_subheader + df.loc[ind,'ActivityProducedBy'] = ( + f'{sheetandtable}, {active_header}') + elif sheet_dict.get('subgroup') == 'activitybyflow': + df.loc[ind, 'FlowName'] = active_header + df.loc[ind,'ActivityProducedBy'] = ( + f'{sheetandtable}, {active_subheader}') + else: + df.loc[ind,'ActivityProducedBy'] = ( + f'{sheetandtable}, {active_header}, ' + f'{active_subheader}') + # for level 3 headers (only occur in IndirectCO2 and Agriculture tabs)... else: + subsubheader = df['ActivityProducedBy'][ind].strip() df.loc[ind,'ActivityProducedBy'] = ( f'{sheetandtable}, {active_header}, ' - f'{active_subheader}') - # for level 3 headers (only occur in IndirectCO2 and Agriculture tabs)... - else: - subsubheader = df['ActivityProducedBy'][ind].strip() - df.loc[ind,'ActivityProducedBy'] = ( - f'{sheetandtable}, {active_header}, ' - f'{active_subheader}, {subsubheader}') - - # drop all columns except the desired emissions year and the - # emissions activity source - df = df.filter([year, 'ActivityProducedBy', 'FlowName']) - # rename columns - df = df.rename(columns={year: 'FlowAmount'}) - # add sheet-specific hardcoded data - if 'subgroup' not in sheet_dict: - df['FlowName'] = sheet_dict.get('flow') - df['Unit'] = sheet_dict.get('unit') - df['Description'] = sheet - - # concatenate dataframe from each sheet with existing master dataframe - df0 = pd.concat([df0, df]) + f'{active_subheader}, {subsubheader}') + + # drop all columns except the desired emissions year and the + # emissions activity source + df = df.filter([year, 'ActivityProducedBy', 'FlowName']) + # rename columns + df = df.rename(columns={year: 'FlowAmount'}) + # add sheet-specific hardcoded data + if 'subgroup' not in sheet_dict: + df['FlowName'] = sheet_dict.get('flow') + df['Unit'] = sheet_dict.get('unit') + df['Description'] = sheet + df['State'] = state + + # concatenate dataframe from each sheet with existing master dataframe + df0 = pd.concat([df0, df]) # add general hardcoded data df0['Class'] = 'Chemicals' @@ -114,7 +117,6 @@ def epa_sit_parse(*, source, year, config, **_): df0['DataCollection'] = 5 # add state FIPS code - df0['State'] = state df0['County'] = '' df0 = apply_county_FIPS(df0, year='2015', source_state_abbrev=True) # add FIPS location system @@ -178,5 +180,5 @@ def disaggregate_emissions(fba, source_dict, **_): if __name__ == '__main__': import flowsa - flowsa.flowbyactivity.main(source='EPA_SIT', year='2017') - fba = flowsa.getFlowByActivity('EPA_SIT', '2017') + flowsa.flowbyactivity.main(source='EPA_SIT', year='2019') + fba = flowsa.getFlowByActivity('EPA_SIT', '2019') diff --git a/flowsa/methods/flowbyactivitymethods/EPA_SIT.yaml b/flowsa/methods/flowbyactivitymethods/EPA_SIT.yaml index 1e741918a..4b751eb8e 100644 --- a/flowsa/methods/flowbyactivitymethods/EPA_SIT.yaml +++ b/flowsa/methods/flowbyactivitymethods/EPA_SIT.yaml @@ -5,7 +5,7 @@ bib_id: EPA_SIT format: xlsm # macro-enabled spreadsheet url: None parse_response_fxn: !script_function:EPA_SIT epa_sit_parse -state: 'ME' +state_list: ['ME', 'CT'] years: - 2019 - 2018 From c9d7276ebde0f4264884aef27f32866e94a81ca0 Mon Sep 17 00:00:00 2001 From: Eric Bell Date: Tue, 23 Aug 2022 07:41:57 -0400 Subject: [PATCH 0195/1127] Add clean_fba_df_fxn to include SIT data for select states only --- flowsa/data_source_scripts/EPA_SIT.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/flowsa/data_source_scripts/EPA_SIT.py b/flowsa/data_source_scripts/EPA_SIT.py index 8315af913..095f8670e 100644 --- a/flowsa/data_source_scripts/EPA_SIT.py +++ b/flowsa/data_source_scripts/EPA_SIT.py @@ -178,6 +178,24 @@ def disaggregate_emissions(fba, source_dict, **_): return fba +def include_select_states(fba, source_dict, **_): + """ + clean_fba_df_fxn to remove states OTHER THAN those selected for + alternate data sources. State abbreviations must be passed as list + in method parameter 'state_list' + + :param fba: df + :param source_dict: dictionary of source methods includes 'state_list' + key of states to remove + """ + state_list = source_dict.get('state_list') + state_df = pd.DataFrame(state_list, columns=['State']) + state_df['County'] ='' + state_df = apply_county_FIPS(state_df) + df_subset = fba[fba['Location'].isin(state_df['Location'])] + + return df_subset + if __name__ == '__main__': import flowsa flowsa.flowbyactivity.main(source='EPA_SIT', year='2019') From 160536902933e21eaf933c8bf75d5f9fd20d967a Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 26 Aug 2022 15:12:56 -0400 Subject: [PATCH 0196/1127] Working on duplicating old 2016 GHGI method in new recursive format --- .../GHGI_recursive_2016_m1.yaml | 723 ++++++++++++++++++ 1 file changed, 723 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml diff --git a/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml b/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml new file mode 100644 index 000000000..f7ace5bf0 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml @@ -0,0 +1,723 @@ +%YAML 1.1 + +--- +# m1 for the GHG national replicates the method used in the National GHG Industry Attribution Model +#(https://doi.org/10.23719/1517571), except that sector attribution is to 6-digit NAICS, +# rather than the BEA 2012 IO schema + +industry_spec: + default: NAICS_6 +year: &ghgi_year 2016 +target_naics_year: 2012 +geoscale: national + +sources_to_cache: + BLS_QCEW: + year: 2012 + selection_fields: + Class: Employment + clean_fba: !script_function:temp_data_source_functions clean_qcew + +_attribution_sources: + EIA_MECS_Energy: &mecs_energy + year: 2014 + selection_fields: &mecs_energy_default_selection + Class: Energy + Unit: Trillion Btu + clean_fba: !script_function:temp_data_source_functions clean_mecs_energy_fba + clean_fba_w_sec: !script_function:temp_data_source_functions clean_mapped_mecs_energy_fba + attribution_method: proportional # cleaning fxns remove need for proportional-flagged + attribution_source: BLS_QCEW + BEA: &bea + year: 2012 + activity_to_sector_mapping: BEA_2012_Detail + attribution_method: proportional + attribution_source: BLS_QCEW + +source_names: + EPA_GHGI_T_2_1: #U.S. GHG emissions + fedefl_mapping: GHGI + activity_sets: + direct_attribution: + selection_fields: + PrimaryActivity: + - Iron and Steel Production & Metallurgical Coke Production #CO2, CH4 + - Cement Production #CO2 + - Lime Production #CO2 + - Ammonia Production #CO2 + - Incineration of Waste #CO2, #N2O + - Aluminum Production #CO2 + - Soda Ash Production #CO2 + - Ferroalloy Production #CO2, CH4 + - Titanium Dioxide Production #CO2 + - Zinc Production #CO2 + - Phosphoric Acid Production #CO2 + - Glass Production #CO2 + - Carbide Production and Consumption #CO2, CH4 + - Landfills #CH4 + - Coal Mining #CH4 + - Wastewater Treatment #CH4, N2O + - Rice Cultivation #CH4 + - Abandoned Oil and Gas Wells #CH4 + - Abandoned Underground Coal Mines #CH4 + - Anaerobic Digestion at Biogas Facilities #CH4 new activity + - Composting #CH4, N2O + - Nitric Acid Production #N2O + - Adipic Acid Production #N2O + - Caprolactam, Glyoxal, and Glyoxylic Acid Production #CH4 + - Electronics Industry #N2O + FlowName: + - CO2 + - CH4 + - N20 + attribution_method: direct + + electric_distribution: + selection_fields: + PrimaryActivity: Electrical Transmission and Distribution #SF6 + FlowName: SF6 + attribution_method: direct + + electric_production: &electricity_make + selection_fields: + PrimaryActivity: Electric Power #CO2 + attribution_method: proportional + attribution_source: + BEA_Make_Detail_BeforeRedef: + <<: *bea + primary_action_type: Produced + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity + + liming: + selection_fields: + PrimaryActivity: Liming #CO2 + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'327400': ''} + + urea: + selection_fields: + PrimaryActivity: + - Urea Fertilization #CO2 + - Urea Consumption for Non-Agricultural Purposes #CO2 + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + + carbonate_use: + selection_fields: + PrimaryActivity: Other Process Uses of Carbonates #CO2 + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + + lead_production: + selection_fields: + PrimaryActivity: Lead Production #CO2 + attribution_method: proportional + attribution_source: + USGS_MYB_Lead: + year: 2016 + selection_fields: + ActivityProducedBy: + - Primary lead, refined content, domestic ores and base bullion + - Secondary lead, lead content + + nitrous_oxide_use: + selection_fields: + PrimaryActivity: N2O from Product Uses #N2O + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325120': ''} # Industrial gases + +# ## Fossil Fuels +# EPA_GHGI_T_3_63: &natgas #CH4 from Natural Gas Systems +# fedefl_mapping: GHGI +# selection_fields: +# PrimaryActivity: +# - Distribution +# - Exploration +# - Processing +# - Production +# - Transmission and Storage +# attribution_method: direct +# EPA_GHGI_T_3_65: *natgas #CO2 from Natural Gas Systems mimics CH4 +# EPA_GHGI_T_3_67: *natgas #N2O from Natural Gas Systems, not used in original method, mimics CH4 + +# EPA_GHGI_T_3_38: &petroleum #CH4 from Petroleum Systems +# fedefl_mapping: GHGI +# selection_fields: +# PrimaryActivity: +# - Crude Oil Transportation +# - Exploration +# - Production +# - Refining +# attribution_method: direct +# EPA_GHGI_T_3_40: *petroleum #CO2 from Petroleum Systems mimics CH4 +# EPA_GHGI_T_3_42: *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 + +# ## Agriculture +# EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues +# fedefl_mapping: GHGI +# selection_fields: +# PrimaryActivity: +# - Chickpeas +# - Cotton +# - Maize +# - Rice +# - Soybeans +# - Wheat +# attribution_method: direct + +# EPA_GHGI_T_5_3: &animals #CH4 from Enteric Fermentation +# fedefl_mapping: GHGI +# selection_fields: +# PrimaryActivity: +# - American Bison +# - Beef Cattle +# - Dairy Cattle +# - Goats +# - Horses +# - Mules and Asses +# - Sheep +# - Swine +# - Poultry +# attribution_method: direct +# EPA_GHGI_T_5_7: *animals #CH4 and N2O from manure, mimics enteric fermentation + +# EPA_GHGI_T_5_18: #Direct N2O emissions from agricultural soils +# fedefl_mapping: GHGI +# activity_sets: +# fertilizer_use: &fertilizer # allocated based on fertilizer use +# selection_fields: +# PrimaryActivity: +# - Organic Amendment Cropland +# - Residue N Cropland +# - Synthetic Fertilizer Cropland +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea +# selection_fields: +# ActivityProducedBy: {'325310': ''} + +# cropland: # allocated based on USDA land area harvested +# selection_fields: +# PrimaryActivity: +# - Mineralization and Asymbiotic Fixation Cropland +# - Drained Organic Soils Cropland +# attribution_method: proportional +# attribution_source: +# USDA_CoA_Cropland: +# year: 2017 +# selection_fields: +# Class: Land +# FlowName: +# - AREA HARVESTED +# - AREA BEARING & NON-BEARING # Orchards +# - AREA GROWN # Berry totals +# - AREA IN PRODUCTION # Vegetable totals +# attribution_method: proportional +# attribution_source: +# USDA_CoA_Cropland_NAICS: +# year: 2017 +# selection_fields: +# Class: Land +# FlowName: AG LAND, CROPLAND, HARVESTED + +# pasture: &pasture # allocated based on USDA Animal operation land (acres) +# selection_fields: +# PrimaryActivity: +# - All activities Grassland +# attribution_method: proportional +# attribution_source: +# USDA_CoA_Cropland_NAICS: +# year: 2017 +# selection_fields: +# Class: Land +# FlowName: FARM OPERATIONS +# clean_fba: !script_function:temp_data_source_functions clean_usda_cropland_naics + +# EPA_GHGI_T_5_19: #Indirect N2O emissions from agricultural soils +# fedefl_mapping: GHGI +# activity_sets: +# fertilizer_use: # allocated based on fertilizer use +# <<: *fertilizer +# selection_fields: +# PrimaryActivity: +# - Volatilization & Atm. Deposition Cropland +# - Surface Leaching & Run-Off Cropland +# pasture: # allocated based on USDA Animal operation land (acres) +# <<: *pasture + + +# ## Mobile Sources +# EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion +# fedefl_mapping: GHGI +# activity_sets: +# direct_attribution: +# selection_fields: +# PrimaryActivity: +# - Passenger Cars Gasoline On-Road +# - Light-Duty Trucks Gasoline On-Road +# - Rail Non-Road +# - Ships and Boats Non-Road +# - Aircraft Non-Road +# - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road +# attribution_method: direct + +# construction_and_mining: #this set is allocated by purchases of construction equipment +# selection_fields: +# PrimaryActivity: Construction/Mining Equipment Non-Road +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea +# selection_fields: +# ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment + +# farm_non_road: #this set is allocated by purchases of farm machinery +# selection_fields: +# PrimaryActivity: Agricultural Equipment Non-Road +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea +# selection_fields: +# ActivityProducedBy: {'333111': ''} # purchases of farm machinery + +# other_non_road: #this set is allocated by purchases of petroleum refining +# selection_fields: +# PrimaryActivity: Other Non-Road +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea +# selection_fields: +# ActivityProducedBy: {'324110': ''} # purchases of refinery products + +# alt_fuel_on_road: #this set is allocated by purchases of natural gas +# selection_fields: +# PrimaryActivity: +# - All activities Alternative Fuel On-Road # corrected from "Alternative Fuel On-Road", which isn't in the source FBA. +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea +# selection_fields: +# ActivityProducedBy: {'221200': ''} # purchases of natural gas + +# EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 + +# ## Major CO2 Sources +# EPA_GHGI_T_A_14: # CO2 emissions from stationary combustion and transportation +# fedefl_mapping: GHGI +# clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion +# activity_sets: +# direct_attribution: #direct allocation +# selection_fields: +# PrimaryActivity: Total (All Fuels) Residential +# attribution_method: direct + +# non-manufacturing_coal: +# selection_fields: +# PrimaryActivity: +# - Commercial Coal Commercial +# - Industrial Other Coal Industrial +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea +# selection_fields: +# ActivityProducedBy: {'212100': ''} # purchases of coal + +# non-manufacturing_natural_gas: +# selection_fields: +# PrimaryActivity: +# - Natural Gas Commercial +# - Natural Gas Industrial +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea +# selection_fields: +# ActivityProducedBy: {'221200': ''} # purchases of natural gas + +# non-manufacturing_petroleum: # Petroleum +# selection_fields: +# PrimaryActivity: +# - Total Petroleum Commercial +# - Total Petroleum Industrial +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea +# selection_fields: +# ActivityProducedBy: {'324110': ''} # purchases of refinery products + +# manufacturing_coal: # Industrial Coal for Manufacturing +# selection_fields: +# PrimaryActivity: +# - Industrial Other Coal Industrial - Manufacturing +# attribution_method: proportional +# attribution_source: +# EIA_MECS_Energy: +# <<: *mecs_energy +# selection_fields: +# <<: *mecs_energy_default_selection +# FlowName: Coal + +# manufacturing_natural_gas: # Industrial Natural Gas for manufacturing +# selection_fields: +# PrimaryActivity: +# - Natural Gas Industrial - Manufacturing +# attribution_method: proportional +# attribution_source: +# EIA_MECS_Energy: +# <<: *mecs_energy +# selection_fields: +# <<: *mecs_energy_default_selection +# FlowName: Natural Gas + +# ### Transportation +# natural_gas_transportation: +# selection_fields: +# PrimaryActivity: Natural Gas Transportation +# attribution_method: proportional +# attribution_source: +# EPA_GHGI_T_A_79: +# selection_fields: +# FlowName: Natural Gas +# attribution_method: proportional +# attribution_source: BLS_QCEW + +# aviation_gas_transportation: +# selection_fields: +# PrimaryActivity: Aviation Gasoline Transportation +# attribution_method: proportional +# attribution_source: +# EPA_GHGI_T_A_79: +# selection_fields: +# FlowName: Aviation Gasoline +# attribution_method: proportional +# attribution_source: BLS_QCEW + +# jet_fuel_transportation: +# selection_fields: +# PrimaryActivity: Jet Fuel Transportation +# attribution_method: proportional +# attribution_source: +# EPA_GHGI_T_A_79: +# selection_fields: +# FlowName: Jet Fuel +# attribution_method: proportional +# attribution_source: BLS_QCEW + +# propane_transportation: +# selection_fields: +# PrimaryActivity: LPG (Propane) Transportation +# attribution_method: proportional +# attribution_source: +# EPA_GHGI_T_A_79: +# selection_fields: +# FlowName: LPG +# attribution_method: proportional +# attribution_source: BLS_QCEW + +# residual_fuel_transportation: +# selection_fields: +# PrimaryActivity: Residual Fuel Transportation +# attribution_method: proportional +# attribution_source: +# EPA_GHGI_T_A_79: +# selection_fields: +# FlowName: Residual Fuel Oil +# attribution_method: proportional +# attribution_source: BLS_QCEW + +# distillate_fuel_transportation: # industry_spec defined as default: NAICS_6 replaces previous clean_allocation_fba_w_sec +# selection_fields: +# PrimaryActivity: Distillate Fuel Oil Transportation +# attribution_method: proportional +# attribution_source: +# EPA_GHGI_T_A_79: +# selection_fields: +# FlowName: Distillate Fuel Oil (Diesel Fuel) # these selection fields replaces previous clean_allocation_fba +# ActivityConsumedBy: +# - Medium- and Heavy-Duty Trucks +# - Buses +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea +# selection_fields: +# ActivityProducedBy: {'324110': ''} # use of petroleum products + +# gasoline_transportation: # industry_spec defined as default: NAICS_6 replaces previous clean_allocation_fba_w_sec +# selection_fields: +# PrimaryActivity: Motor Gasoline Transportation +# attribution_method: proportional +# attribution_source: +# EPA_GHGI_T_A_79: +# selection_fields: +# FlowName: Motor Gasoline +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea +# selection_fields: +# ActivityProducedBy: {'324110': ''} # use of petroleum products + +# ## Stationary Combustion +# EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion +# fedefl_mapping: GHGI +# clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion +# activity_sets: +# direct_attribution: +# selection_fields: +# PrimaryActivity: +# - Fuel Oil Residential +# - Coal Residential +# - Natural Gas Residential +# - Wood Residential +# attribution_method: direct + +# electric_power: +# <<: *electricity_make +# selection_fields: +# PrimaryActivity: +# - Coal Electric Power +# - Natural Gas Electric Power +# - Natural gas Electric Power # note lower case +# - Fuel Oil Electric Power +# - Wood Electric Power + +# fuel_oil: +# selection_fields: +# PrimaryActivity: +# - Fuel Oil Commercial +# - Fuel Oil Industrial +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea +# selection_fields: +# ActivityProducedBy: {'324110': ''} # purchases of refinery products + +# natural_gas: +# selection_fields: +# PrimaryActivity: +# - Natural gas Commercial +# - Natural gas Industrial +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea +# selection_fields: +# ActivityProducedBy: {'221200': ''} # purchases of natural gas + +# coal: +# selection_fields: +# PrimaryActivity: Coal Industrial +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea +# selection_fields: +# ActivityProducedBy: {'212100': ''} # purchases of coal + +# coal_manufacturing: +# selection_fields: +# PrimaryActivity: Coal Industrial - Manufacturing +# attribution_method: proportional +# attribution_source: +# EIA_MECS_Energy: +# <<: *mecs_energy +# selection_fields: +# <<: *mecs_energy_default_selection +# FlowName: Coal + +# natural_gas_manufacturing: +# selection_fields: +# PrimaryActivity: Natural gas Industrial - Manufacturing +# attribution_method: proportional +# attribution_source: +# EIA_MECS_Energy: +# <<: *mecs_energy +# selection_fields: +# <<: *mecs_energy_default_selection +# FlowName: Natural Gas + +# EPA_GHGI_T_3_9: +# <<: *stationary_combustion # N2O emissions from stationary combustion + +# ## Other sources +# EPA_GHGI_T_4_46: #CO2 for selected petrochemicals +# fedefl_mapping: GHGI +# selection_fields: +# PrimaryActivity: +# - Acrylonitrile +# - Carbon Black +# - Ethylene +# - Ethylene Dichloride +# - Ethylene Oxide +# - Methanol +# attribution_method: direct + +# EPA_GHGI_T_3_22b: #Fossil fuel for non-energy uses +# fedefl_mapping: GHGI +# activity_sets: +# coal: +# selection_fields: +# PrimaryActivity: +# - Industry Industrial Coking Coal +# - Industry Industrial Other Coal +# attribution_method: direct + +# petroleum_feedstocks: # consumed petroleum products +# selection_fields: +# PrimaryActivity: +# - Industry Asphalt & Road Oil +# - Industry Distillate Fuel Oil +# - Industry LPG +# - Industry Lubricants +# - Industry Miscellaneous Products +# - Industry Naphtha (<401 F) +# - Industry Other Oil (>401 F) +# - Industry Pentanes Plus +# - Industry Petroleum Coke +# - Industry Special Naphtha +# - Industry Still Gas +# - Industry Waxes +# attribution_method: proportional +# attribution_source: +# EIA_MECS_Energy: +# <<: *mecs_energy +# selection_fields: +# Class: Other +# FlowName: Other +# Unit: Trillion Btu + +# natural_gas_feedstocks: # consumed nat gas to chemical plants +# selection_fields: +# PrimaryActivity: Industry Natural Gas to Chemical Plants +# attribution_method: proportional +# attribution_source: +# EIA_MECS_Energy: +# <<: *mecs_energy +# selection_fields: +# Class: Other +# FlowName: Natural Gas +# Unit: Trillion Btu + +# transportation_lubricants: +# selection_fields: +# PrimaryActivity: Transportation Lubricants +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea +# selection_fields: +# ActivityProducedBy: '324110' # use of petroleum products + +# ## Other Emissions +# EPA_GHGI_T_4_50: # HFCs from HCFC-22 production +# selection_fields: +# Unit: MMT CO2e +# PrimaryActivity: HCFC-22 Production +# fedefl_mapping: GHGI +# attribution_method: direct + +# EPA_GHGI_T_4_94: # HFCs and other emissions from electronics manufacture +# selection_fields: +# FlowName: +# C2F6: C2F6 +# C3F8: C3F8 +# CF4: CF4 +# HFC-23: HFC-23 +# c-C4F8: c-C4F8 +# SF6: SF6 +# NF3: NF3 +# N2O[2]: N2O +# fedefl_mapping: GHGI +# attribution_method: direct + +# EPA_GHGI_T_4_101: # HFCs and PFCs from ODS Substitutes +# clean_fba_before_activity_sets: !script_function:temp_data_source_functions clean_hfc_fba # removes HFCs from transportation +# fedefl_mapping: 'GHGI' +# activity_sets: +# household_refrigeration: +# selection_fields: +# PrimaryActivity: Refrigeration/Air Conditioning - Households +# attribution_method: direct + +# non-household_refrigeration: +# selection_fields: +# PrimaryActivity: Refrigeration/Air Conditioning +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea +# selection_fields: +# ActivityProducedBy: {'333415': ''} # Air conditioning equipment + +# polystyrene_foam: +# selection_fields: +# PrimaryActivity: Foams - Polystyrene +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea +# selection_fields: +# ActivityProducedBy: {'326140': ''} # Polystyrene foam + +# urethane_foam: +# selection_fields: +# PrimaryActivity: Foams - Urethane +# attribution_method: proportional +# attribution_source: +# BEA_Use_Detail_PRO_BeforeRedef: +# <<: *bea +# selection_fields: +# ActivityProducedBy: {'326150': ''} # Urethane and other foams. + +# EPA_GHGI_T_A_103: # HFCs from Transportation +# clean_fba_before_mapping: !script_function:temp_data_source_functions split_hfcs_by_type +# fedefl_mapping: GHGI +# selection_fields: +# PrimaryActivity: +# Mobile AC - Passenger Cars: Passenger Cars +# Mobile AC - Heavy-Duty Vehicles: Heavy-Duty Vehicles +# Mobile AC - Light-Duty Trucks: Light-Duty Trucks +# Comfort Cooling for Trains and Buses - School and Tour Buses: School and Tour Buses +# Comfort Cooling for Trains and Buses - Rail: Rail +# Refrigerated Transport - Medium- and Heavy-Duty Trucks: Medium- and Heavy-Duty Trucks +# Refrigerated Transport - Rail: Rail +# Refrigerated Transport - Ships and Boats: Ships and Boats +# attribution_method: direct + +# EPA_GHGI_T_4_80: # PFCs from aluminum production +# fedefl_mapping: GHGI +# attribution_method: direct + +# EPA_GHGI_T_4_84: # HFCs, SF6, CO2 from magnesium production +# fedefl_mapping: GHGI +# attribution_method: proportional +# attribution_source: +# BEA_Make_Detail_BeforeRedef: +# <<: *bea +# selection_fields: +# ActivityConsumedBy: {T008: ''} # Total Output From 4c44b09323f29b135345622a94ebc5fb7de9e689 Mon Sep 17 00:00:00 2001 From: Eric Bell Date: Wed, 31 Aug 2022 16:41:15 -0400 Subject: [PATCH 0197/1127] Update source_catalog to add StateGHGI dataset --- flowsa/data/source_catalog.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index ee6dbfef8..e40e3dba8 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -188,6 +188,12 @@ StatCan_LFS: sector-like_activities: False activity_schema: sector_aggregation_level: "aggregated" +StateGHGI: + class: + - Chemicals + sector-like_activities: False + activity_schema: + sector_aggregation_level: "aggregated" stateio: class: - Money From f182edd12343fba3c7f9a9466852203a38b8a188 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 2 Sep 2022 15:19:41 -0400 Subject: [PATCH 0198/1127] Added function to estimate suppressed QCEW data. Needs verification. --- .../temp_data_source_functions.py | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index 2ad4cb75e..b9470ad09 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -2,6 +2,7 @@ from flowsa import settings from flowsa.flowsa_log import log import pandas as pd +import numpy as np from flowsa.data_source_scripts import EIA_MECS as mecs from flowsa.data_source_scripts import EPA_GHGI as ghgi from flowsa.data_source_scripts import USDA_CoA_Cropland as coa @@ -50,6 +51,77 @@ def clean_qcew(fba: FlowByActivity, **kwargs): return filtered +def estimate_suppressed_qcew(fba: FlowByActivity) -> FlowByActivity: + indexed = ( + fba + .assign(n2=fba.ActivityProducedBy.str.slice(stop=2), + n3=fba.ActivityProducedBy.str.slice(stop=3), + n4=fba.ActivityProducedBy.str.slice(stop=4), + n5=fba.ActivityProducedBy.str.slice(stop=5), + n6=fba.ActivityProducedBy.str.slice(stop=6), + location=fba.Location, + category=fba.FlowName) + .replace({'FlowAmount': {0: np.nan}, + 'ActivityProducedBy': {'31-33': '3X', + '44-45': '4X', + '48-49': '4Y'}, + 'n2': {'31': '3X', '32': '3X', '33': '3X', + '44': '4X', '45': '4X', + '48': '4Y', '49': '4Y'}}) + .set_index(['n2', 'n3', 'n4', 'n5', 'n6', 'location', 'category'], + verify_integrity=True) + ) + + def fill_suppressed( + flows: pd.Series, + level: int, + full_naics: pd.Series + ) -> pd.Series: + parent = flows[full_naics.str.len() == level] + children = flows[full_naics.str.len() == level + 1] + null_children = children[children.isna()] + + if null_children.empty or parent.empty: + return flows + else: + value = max((parent[0] - children.sum()) / null_children.size, 0) + return flows.fillna(pd.Series(value, index=null_children.index)) + + unsuppressed = ( + indexed + .assign( + FlowAmount=lambda x: ( + x.groupby(level=['n2', + 'location', 'category'])['FlowAmount'] + .transform(fill_suppressed, 2, x.ActivityProducedBy))) + .assign( + FlowAmount=lambda x: ( + x.groupby(level=['n2', 'n3', + 'location', 'category'])['FlowAmount'] + .transform(fill_suppressed, 3, x.ActivityProducedBy))) + .assign( + FlowAmount=lambda x: ( + x.groupby(level=['n2', 'n3', 'n4', + 'location', 'category'])['FlowAmount'] + .transform(fill_suppressed, 4, x.ActivityProducedBy))) + .assign( + FlowAmount=lambda x: ( + x.groupby(level=['n2', 'n3', 'n4', 'n5', + 'location', 'category'])['FlowAmount'] + .transform(fill_suppressed, 5, x.ActivityProducedBy))) + .fillna({'FlowAmount': 0}) + .reset_index(drop=True) + ) + + aggregated = ( + unsuppressed + .assign(FlowName='Number of employees') + .aggregate_flowby() + ) + + return aggregated + + def clean_usda_cropland_naics(fba: FlowByActivity, **kwargs): if fba.config['industry_spec']['default'] == 'NAICS_2': naics_2 = ( From 0ed8bec2fb4966eac2bfe1c810d9070075ffd331 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 12 Sep 2022 11:01:12 -0400 Subject: [PATCH 0199/1127] Update clean_usda_cropland_naics() so it picks up all relevant NAICS codes. --- flowsa/data_source_scripts/temp_data_source_functions.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index b9470ad09..f831014a9 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -134,8 +134,11 @@ def clean_usda_cropland_naics(fba: FlowByActivity, **kwargs): ) fba = pd.concat([naics_2, fba]).reset_index(drop=True) - target_naics = set(naics.industry_spec_key(fba.config['industry_spec']) - .target_naics) + target_naics = set( + naics.industry_spec_key(fba.config['industry_spec']) + .target_naics + .str.replace('0', '') + ) | {'1122', '1125'} filtered = fba.query('ActivityConsumedBy in @target_naics') From ec82584f53f000f1bbec6dcfba1c8aa20b24aed2 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 13 Sep 2022 13:00:49 -0400 Subject: [PATCH 0200/1127] estimate_suppressed_qcew() now changes cells that started as 31-33, etc. back when finished. --- flowsa/data_source_scripts/temp_data_source_functions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index f831014a9..9a6fc552a 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -116,6 +116,9 @@ def fill_suppressed( aggregated = ( unsuppressed .assign(FlowName='Number of employees') + .replace({'ActivityProducedBy': {'3X': '31-33', + '4X': '44-45', + '4Y': '48-49'}}) .aggregate_flowby() ) From b0150dd1d142218b912376443be94ae4844d7c06 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 13 Sep 2022 15:17:35 -0400 Subject: [PATCH 0201/1127] Critical fix to clean_mapped_mecs_energy_fba() --- flowsa/data_source_scripts/temp_data_source_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index 9a6fc552a..426969b1a 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -277,7 +277,7 @@ def clean_mecs_energy_fba(fba: FlowByActivity, **_) -> FlowByActivity: .drop(columns=['descendant_flows', 'descendants_y']) ) - return mecs + return mecs def clean_mapped_mecs_energy_fba(fba: FlowByActivity, **_) -> FlowByActivity: From 68bed2fb8b864ef904cd575e7f061b253bbf5eda Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 14 Sep 2022 16:52:24 -0400 Subject: [PATCH 0202/1127] Implemented estimation of suppressed data from QCEW --- flowsa/data_source_scripts/temp_data_source_functions.py | 5 +++++ .../methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml | 1 + 2 files changed, 6 insertions(+) diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index 426969b1a..9207afd6e 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -52,6 +52,11 @@ def clean_qcew(fba: FlowByActivity, **kwargs): def estimate_suppressed_qcew(fba: FlowByActivity) -> FlowByActivity: + if fba.config.get('geoscale') == 'national': + fba = fba.query('Location == "00000"') + else: + log.critical('At a subnational scale, this will take a long time.') + indexed = ( fba .assign(n2=fba.ActivityProducedBy.str.slice(stop=2), diff --git a/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml b/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml index f7ace5bf0..18e4cd6dc 100644 --- a/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml @@ -16,6 +16,7 @@ sources_to_cache: year: 2012 selection_fields: Class: Employment + clean_fba_before_mapping: !script_function:temp_data_source_functions estimate_suppressed_qcew clean_fba: !script_function:temp_data_source_functions clean_qcew _attribution_sources: From aa195e477222132cce6568639e95d043687b7e59 Mon Sep 17 00:00:00 2001 From: Eric Bell Date: Wed, 28 Sep 2022 11:32:39 -0400 Subject: [PATCH 0203/1127] Update code to include Vermont SIT and supplementary emissions data. --- flowsa/data_source_scripts/EPA_SIT.py | 52 ++++++++++++++-- flowsa/data_source_scripts/StateGHGI.py | 61 +++++++++++++++++++ .../flowbyactivitymethods/EPA_SIT.yaml | 8 +-- .../flowbyactivitymethods/StateGHGI_VT.yaml | 61 +++++++++++++++++++ 4 files changed, 174 insertions(+), 8 deletions(-) create mode 100644 flowsa/methods/flowbyactivitymethods/StateGHGI_VT.yaml diff --git a/flowsa/data_source_scripts/EPA_SIT.py b/flowsa/data_source_scripts/EPA_SIT.py index 095f8670e..1b264dbce 100644 --- a/flowsa/data_source_scripts/EPA_SIT.py +++ b/flowsa/data_source_scripts/EPA_SIT.py @@ -178,21 +178,65 @@ def disaggregate_emissions(fba, source_dict, **_): return fba -def include_select_states(fba, source_dict, **_): +def clean_up_state_data(fba, source_dict, **_): """ - clean_fba_df_fxn to remove states OTHER THAN those selected for + clean_fba_df_fxn to: + + (i) remove states OTHER THAN those selected for alternate data sources. State abbreviations must be passed as list - in method parameter 'state_list' + in method parameter 'state_list'. + + (ii) remove specific SIT data for specific states. + these data must be excluded to avoid double counting because some states + have opted to use custom methods (e.g., Vermont estimates emissions from + natural gas distribution separately from the SIT tool). :param fba: df :param source_dict: dictionary of source methods includes 'state_list' - key of states to remove + key of states to include in inventory """ state_list = source_dict.get('state_list') + + # (i) drop all states OTHER THAN those selected for alternative data sources state_df = pd.DataFrame(state_list, columns=['State']) state_df['County'] ='' state_df = apply_county_FIPS(state_df) df_subset = fba[fba['Location'].isin(state_df['Location'])] + + # (ii) drop unused SIT data from specific states + + # if Vermont is included in the inventory, exclude certain data + # (these data will later be replaced with custom data in the 'StateGHGI' + # stage) + if 'VT' in state_list: + + # remove Vermont natural gas distribution data + df_subset.drop(df_subset[ + ((df_subset.Location == '50000') & + (df_subset.ActivityProducedBy == 'Gas and Oil, Natural Gas, Distribution') + )].index, inplace=True) + + # remove Vermont ODS substitutes data + df_subset.drop(df_subset[ + ((df_subset.Location == '50000') & + (df_subset.ActivityProducedBy == 'IP, ODS Substitutes') + )].index, inplace=True) + + # remove Vermont semiconductor manufacturing data + df_subset.drop(df_subset[ + ((df_subset.Location == '50000') & + (df_subset.ActivityProducedBy == 'IP, Semiconductor Manufacturing') + )].index, inplace=True) + + # remove Vermont solid waste data + df_subset.drop(df_subset[ + ((df_subset.Location == '50000') & + (df_subset.Description == 'Landfills') + )].index, inplace=True) + df_subset.drop(df_subset[ + ((df_subset.Location == '50000') & + (df_subset.Description == 'Waste Combustion') + )].index, inplace=True) return df_subset diff --git a/flowsa/data_source_scripts/StateGHGI.py b/flowsa/data_source_scripts/StateGHGI.py index 6f28718cb..4382ac029 100644 --- a/flowsa/data_source_scripts/StateGHGI.py +++ b/flowsa/data_source_scripts/StateGHGI.py @@ -78,6 +78,67 @@ def ME_biogenic_parse(*, source, year, config, **_): return df0 +def VT_supplementary_parse(*, source, year, config, **_): + + # initialize the dataframe + df0 = pd.DataFrame() + + filename = config['filename'] + + log.info(f'Loading data from file {filename}...') + + filepath = f"{externaldatapath}/StateGHGI_data/VT/{filename}" + + # dictionary containing Excel sheet-specific information + file_dict = config['file_dict'] + + if not os.path.exists(filepath): + raise FileNotFoundError(f'StateGHGI file not found in {filepath}') + + # for each data table in the Excel file... + for table, table_dict in file_dict.items(): + + log.info(f'Loading data from table {table}...') + + # read in data from Excel sheet + df = pd.read_excel(filepath, + header=table_dict.get('header'), + usecols="A:AG", + nrows=table_dict.get('nrows')) + df.columns = df.columns.map(str) + + # rename certain columns + df.rename(columns = { + 'Gas':'FlowName', + 'Sector/Activity':'ActivityProducedBy', + 'Units':'Unit', + year:'FlowAmount' + }, inplace = True) + + # drop all years except the desired emissions year + df = df.filter(['FlowAmount', 'FlowName', 'ActivityProducedBy', 'Unit']) + + # concatenate dataframe from each table with existing master dataframe + df0 = pd.concat([df0, df]) + + # add hardcoded data + df0['Description'] = "Vermont supplementary emissions data" + df0['Class'] = 'Chemicals' + df0['SourceName'] = source + df0['FlowType'] = "ELEMENTARY_FLOW" + df0['Compartment'] = 'air' + df0['Year'] = year + df0['DataReliability'] = 5 + df0['DataCollection'] = 5 + + # add state FIPS code + df0['State'] = 'VT' + df0['County'] = '' + df0 = apply_county_FIPS(df0, year='2015', source_state_abbrev=True) + # add FIPS location system + df0 = assign_fips_location_system(df0, '2015') + + return df0 if __name__ == '__main__': import flowsa diff --git a/flowsa/methods/flowbyactivitymethods/EPA_SIT.yaml b/flowsa/methods/flowbyactivitymethods/EPA_SIT.yaml index 4b751eb8e..5bb640ece 100644 --- a/flowsa/methods/flowbyactivitymethods/EPA_SIT.yaml +++ b/flowsa/methods/flowbyactivitymethods/EPA_SIT.yaml @@ -5,7 +5,7 @@ bib_id: EPA_SIT format: xlsm # macro-enabled spreadsheet url: None parse_response_fxn: !script_function:EPA_SIT epa_sit_parse -state_list: ['ME', 'CT'] +state_list: ['ME', 'CT', 'VT'] years: - 2019 - 2018 @@ -161,8 +161,8 @@ files: sheetname: Forest Management header: 8 nrows: 37 - unit: MMTCO2E - flow: CO2E + unit: MMTCO2e + flow: CO2e headers: - Forest Carbon Flux - Urban Trees @@ -191,7 +191,7 @@ files: tablename: Emissions from Landfills header: 13 nrows: 9 - unit: MTCO2E + unit: MTCO2e flow: CH4 headers: - Potential CH4 diff --git a/flowsa/methods/flowbyactivitymethods/StateGHGI_VT.yaml b/flowsa/methods/flowbyactivitymethods/StateGHGI_VT.yaml new file mode 100644 index 000000000..53a85a615 --- /dev/null +++ b/flowsa/methods/flowbyactivitymethods/StateGHGI_VT.yaml @@ -0,0 +1,61 @@ +author: Vermont Department of Environmental Conservation +source_name: Vermont State Supplementary Emissions Data +bib_id: StateGHGI_VT +format: xlsx # Excel spreadsheet +url: None +parse_response_fxn: !script_function:StateGHGI VT_supplementary_parse +years: +- 2019 +- 2018 +- 2017 +- 2016 +- 2015 +- 2014 +- 2013 +- 2012 +- 2011 +- 2010 +- 2009 +- 2008 +- 2007 +- 2006 +- 2005 +- 2004 +- 2003 +- 2002 +- 2001 +- 2000 +- 1999 +- 1998 +- 1997 +- 1996 +- 1995 +- 1994 +- 1993 +- 1992 +- 1991 +- 1990 + +filename: 'VT_custom_data_summary.xlsx' + +file_dict: + + 'Emissions from Natural Gas Distribution': + sheetname: 'Sheet1' + header: 1 + nrows: 2 + + 'Emissions from ODS Substitutes': + sheetname: 'Sheet1' + header: 7 + nrows: 5 + + 'Emissions from Semiconductor Manufacturing': + sheetname: 'Sheet1' + header: 16 + nrows: 7 + + 'Emissions from Solid Waste': + sheetname: 'Sheet1' + header: 27 + nrows: 3 \ No newline at end of file From 9fa3c2561d8fc06951b66f4f3b52e0ad7d4a32a9 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 13 Oct 2022 15:30:57 -0400 Subject: [PATCH 0204/1127] Small fixes during QA checking --- .../activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv | 8 ++++++-- flowsa/data_source_scripts/EPA_GHGI.py | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv index 0a89da571..eea0bad38 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv @@ -509,14 +509,17 @@ EPA_GHGI,Fire Protection,,,,excluded,EPA_GHGI_T_4_101 EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,484,,484000,EPA_GHGI_T_A_103 EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_A_103, EPA_GHGI_T_A_79" EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,484,,484000,"EPA_GHGI_T_A_103, EPA_GHGI_T_A_79" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,488410,,,"EPA_GHGI_T_A_103, EPA_GHGI_T_A_79" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,922120,,,"EPA_GHGI_T_A_103, EPA_GHGI_T_A_79" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,922140,,,"EPA_GHGI_T_A_103, EPA_GHGI_T_A_79" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,922160,,,"EPA_GHGI_T_A_103, EPA_GHGI_T_A_79" EPA_GHGI,Passenger Cars,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_A_103, EPA_GHGI_T_A_79" EPA_GHGI,Rail,NAICS_2012_Code,482,,482000,"EPA_GHGI_T_A_103, EPA_GHGI_T_A_79" EPA_GHGI,School and Tour Buses,NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_103 EPA_GHGI,Ships and Boats,NAICS_2012_Code,483,,483000,EPA_GHGI_T_A_103 EPA_GHGI,Transit Buses,,,,excluded,EPA_GHGI_T_A_103 EPA_GHGI,Buses,NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_79 -EPA_GHGI,Buses,NAICS_2012_Code,487,,,EPA_GHGI_T_A_79 -EPA_GHGI,Buses,NAICS_2012_Code,488,,,EPA_GHGI_T_A_79 +EPA_GHGI,Buses,NAICS_2012_Code,4871,,,EPA_GHGI_T_A_79 EPA_GHGI,Buses,NAICS_2012_Code,S00201,,,EPA_GHGI_T_A_79 EPA_GHGI,Buses - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_79 EPA_GHGI,Buses - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,487,,48A000,EPA_GHGI_T_A_79 @@ -541,3 +544,4 @@ EPA_GHGI,Recreational Boats,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 EPA_GHGI,Ships and Boats,NAICS_2012_Code,4831,,483000,EPA_GHGI_T_A_79 EPA_GHGI,Ships and Boats,NAICS_2012_Code,4832,,4-digit to avoid data loss in BLS_QCEW,EPA_GHGI_T_A_79 EPA_GHGI,Ships and Non-Recreational Boats,NAICS_2012_Code,483,,483000,EPA_GHGI_T_A_79 +EPA_GHGI,Ships and Non-Recreational Boats,NAICS_2012_Code,4872,,483000,EPA_GHGI_T_A_79 diff --git a/flowsa/data_source_scripts/EPA_GHGI.py b/flowsa/data_source_scripts/EPA_GHGI.py index 59eb3c64b..c173619ce 100644 --- a/flowsa/data_source_scripts/EPA_GHGI.py +++ b/flowsa/data_source_scripts/EPA_GHGI.py @@ -688,7 +688,8 @@ def allocate_industrial_combustion(fba, *_, **__): EIA MECS relative to EPA GHGI. Create new activities to distinguish those which use EIA MECS as allocation source and those that use alternate source. """ - pct_dict = get_manufacturing_energy_ratios(fba.config.get('year')) + year = fba.config.get('year') or __['source_dict']['year'] + pct_dict = get_manufacturing_energy_ratios(year) # activities reflect flows in A_14 and 3_8 and 3_9 activities_to_split = {'Industrial Other Coal Industrial': 'Coal', From 2200695400de9616de440a938ddbd77270f2c297 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 13 Oct 2022 15:35:43 -0400 Subject: [PATCH 0205/1127] Added capability to preserve suppressed cell designations and estimate the suppressed cells during FBS creation (without treating 0s as suppressed cells) --- flowsa/data/flowby_config.yaml | 1 + .../temp_data_source_functions.py | 68 +++++++++++++++++++ flowsa/flowby.py | 3 +- .../EIA_MECS_Energy.yaml | 2 +- flowsa/schema.py | 1 + 5 files changed, 73 insertions(+), 2 deletions(-) diff --git a/flowsa/data/flowby_config.yaml b/flowsa/data/flowby_config.yaml index 790ee1bca..465e97cd6 100644 --- a/flowsa/data/flowby_config.yaml +++ b/flowsa/data/flowby_config.yaml @@ -7,6 +7,7 @@ _fba_base_fields: &fba_base_fields Description: object DistributionType: object FlowAmount: float + Suppressed: object FlowType: object Location: object LocationSystem: object diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index 9207afd6e..024a8355b 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -7,6 +7,8 @@ from flowsa.data_source_scripts import EPA_GHGI as ghgi from flowsa.data_source_scripts import USDA_CoA_Cropland as coa from flowsa.flowby import FlowByActivity +from flowsa.location import US_FIPS +from flowsa.flowbyfunctions import assign_fips_location_system def clean_qcew(fba: FlowByActivity, **kwargs): @@ -153,6 +155,72 @@ def clean_usda_cropland_naics(fba: FlowByActivity, **kwargs): return filtered +def eia_mecs_energy_parse(*, df_list, source, year, **_): + """ + Combine, parse, and format the provided dataframes + :param df_list: list of dataframes to concat and format + :param year: year + :param source: source + :return: df, parsed and partially formatted to flowbyactivity + specifications + """ + from flowsa.location import assign_census_regions + + # concatenate dataframe list into single dataframe + df = pd.concat(df_list, sort=True) + + # rename columns to match standard flowbyactivity format + df = df.rename(columns={'NAICS Code': 'ActivityConsumedBy', + 'Subsector and Industry': 'Description'}) + df['ActivityConsumedBy'] = df['ActivityConsumedBy'].str.strip() + # add hardcoded data + df["SourceName"] = source + df["Compartment"] = None + df['FlowType'] = 'TECHNOSPHERE_FLOWS' + df['Year'] = year + df['MeasureofSpread'] = "RSE" + # assign location codes and location system + df.loc[df['Location'] == 'Total United States', 'Location'] = US_FIPS + df = assign_fips_location_system(df, year) + df = assign_census_regions(df) + df.loc[df['Description'] == 'Total', 'ActivityConsumedBy'] = '31-33' + df['DataReliability'] = 5 # tmp + df['DataCollection'] = 5 # tmp + + # drop rows that reflect subtotals (only necessary in 2014) + df.dropna(subset=['ActivityConsumedBy'], inplace=True) + + suppressed = df.assign( + FlowAmount=df.FlowAmount.mask(df.FlowAmount.str.isnumeric() == False, + np.nan), + Suppressed=df.FlowAmount.where(df.FlowAmount.str.isnumeric() == False, + np.nan), + Spread=df.Spread.mask(df.Spread.str.isnumeric() == False, np.nan) + ) + + return suppressed + + +def estimate_suppressed_mecs_energy( + fba: FlowByActivity, + **kwargs +) -> FlowByActivity: + ''' + Rough first pass at an estimation method, for testing purposes. This + will drop rows with 'D' or 'Q' values, on the grounds that as far as I can + tell we don't have any more information for them than we do for any + industry without its own line item in the MECS anyway. '*' is for value + less than 0.5 Trillion Btu and will be assumed to be 0.25 Trillion Btu + ''' + print(fba.Suppressed.value_counts()) + dropped = fba.query('Suppressed not in ["D", "Q"]') + unsuppressed = dropped.assign( + FlowAmount=dropped.FlowAmount.mask(dropped.Suppressed == '*', 0.25) + ) + + return unsuppressed.drop(columns='Suppressed') + + def clean_mecs_energy_fba_for_bea_summary(fba: FlowByActivity, **kwargs): naics_3 = fba.query('ActivityConsumedBy.str.len() == 3') naics_4 = fba.query('ActivityConsumedBy.str.len() == 4 ' diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 4ef1cc324..9346b8c8f 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1342,10 +1342,11 @@ def prepare_fbs(self: 'FlowByActivity') -> 'FlowBySector': self .function_socket('clean_fba_before_mapping') .select_by_fields() + .function_socket('estimate_suppressed') .convert_units_and_flows() .function_socket('clean_fba') .convert_to_geoscale() - .attribute_flows_to_sectors() # recursive call to convert_to_fbs + .attribute_flows_to_sectors() # recursive call to prepare_fbs .drop(columns=['ActivityProducedBy', 'ActivityConsumedBy']) .aggregate_flowby() ) diff --git a/flowsa/methods/flowbyactivitymethods/EIA_MECS_Energy.yaml b/flowsa/methods/flowbyactivitymethods/EIA_MECS_Energy.yaml index dd7e7ca36..dd16a6f15 100644 --- a/flowsa/methods/flowbyactivitymethods/EIA_MECS_Energy.yaml +++ b/flowsa/methods/flowbyactivitymethods/EIA_MECS_Energy.yaml @@ -9,7 +9,7 @@ url: base_url: https://www.eia.gov/consumption/manufacturing/data/__year__/xls/__table__.xlsx url_replace_fxn: !script_function:EIA_MECS eia_mecs_URL_helper call_response_fxn: !script_function:EIA_MECS eia_mecs_energy_call -parse_response_fxn: !script_function:EIA_MECS eia_mecs_energy_parse +parse_response_fxn: !script_function:temp_data_source_functions eia_mecs_energy_parse years: - 2010 - 2014 diff --git a/flowsa/schema.py b/flowsa/schema.py index 85873a83c..92d4f31f4 100644 --- a/flowsa/schema.py +++ b/flowsa/schema.py @@ -11,6 +11,7 @@ 'SourceName': [{'dtype': 'str'}, {'required': True}], 'FlowName': [{'dtype': 'str'}, {'required': True}], 'FlowAmount': [{'dtype': 'float'}, {'required': True}], + 'Suppressed': [{'dtype': 'object'}, {'required': False}], 'Unit': [{'dtype': 'str'}, {'required': True}], 'FlowType': [{'dtype': 'str'}, {'required': True}], 'ActivityProducedBy': [{'dtype': 'str'}, {'required': False}], From 8ed4b9692b4c62a81226e921718d45e0fb59b490 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 13 Oct 2022 15:37:47 -0400 Subject: [PATCH 0206/1127] GHGI 2016 implemented in recursive fashion. Some fixed may still need to be made. Needs checking to see what corresponding changes need to be made in SEEA_recursive. --- .../GHGI_recursive_2016_m1.yaml | 1254 +++++++++-------- 1 file changed, 675 insertions(+), 579 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml b/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml index 18e4cd6dc..3e8724619 100644 --- a/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml @@ -25,6 +25,7 @@ _attribution_sources: selection_fields: &mecs_energy_default_selection Class: Energy Unit: Trillion Btu + estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_mecs_energy clean_fba: !script_function:temp_data_source_functions clean_mecs_energy_fba clean_fba_w_sec: !script_function:temp_data_source_functions clean_mapped_mecs_energy_fba attribution_method: proportional # cleaning fxns remove need for proportional-flagged @@ -70,7 +71,7 @@ source_names: FlowName: - CO2 - CH4 - - N20 + - N2O attribution_method: direct electric_distribution: @@ -144,581 +145,676 @@ source_names: selection_fields: ActivityProducedBy: {'325120': ''} # Industrial gases -# ## Fossil Fuels -# EPA_GHGI_T_3_63: &natgas #CH4 from Natural Gas Systems -# fedefl_mapping: GHGI -# selection_fields: -# PrimaryActivity: -# - Distribution -# - Exploration -# - Processing -# - Production -# - Transmission and Storage -# attribution_method: direct -# EPA_GHGI_T_3_65: *natgas #CO2 from Natural Gas Systems mimics CH4 -# EPA_GHGI_T_3_67: *natgas #N2O from Natural Gas Systems, not used in original method, mimics CH4 - -# EPA_GHGI_T_3_38: &petroleum #CH4 from Petroleum Systems -# fedefl_mapping: GHGI -# selection_fields: -# PrimaryActivity: -# - Crude Oil Transportation -# - Exploration -# - Production -# - Refining -# attribution_method: direct -# EPA_GHGI_T_3_40: *petroleum #CO2 from Petroleum Systems mimics CH4 -# EPA_GHGI_T_3_42: *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 - -# ## Agriculture -# EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues -# fedefl_mapping: GHGI -# selection_fields: -# PrimaryActivity: -# - Chickpeas -# - Cotton -# - Maize -# - Rice -# - Soybeans -# - Wheat -# attribution_method: direct - -# EPA_GHGI_T_5_3: &animals #CH4 from Enteric Fermentation -# fedefl_mapping: GHGI -# selection_fields: -# PrimaryActivity: -# - American Bison -# - Beef Cattle -# - Dairy Cattle -# - Goats -# - Horses -# - Mules and Asses -# - Sheep -# - Swine -# - Poultry -# attribution_method: direct -# EPA_GHGI_T_5_7: *animals #CH4 and N2O from manure, mimics enteric fermentation - -# EPA_GHGI_T_5_18: #Direct N2O emissions from agricultural soils -# fedefl_mapping: GHGI -# activity_sets: -# fertilizer_use: &fertilizer # allocated based on fertilizer use -# selection_fields: -# PrimaryActivity: -# - Organic Amendment Cropland -# - Residue N Cropland -# - Synthetic Fertilizer Cropland -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea -# selection_fields: -# ActivityProducedBy: {'325310': ''} - -# cropland: # allocated based on USDA land area harvested -# selection_fields: -# PrimaryActivity: -# - Mineralization and Asymbiotic Fixation Cropland -# - Drained Organic Soils Cropland -# attribution_method: proportional -# attribution_source: -# USDA_CoA_Cropland: -# year: 2017 -# selection_fields: -# Class: Land -# FlowName: -# - AREA HARVESTED -# - AREA BEARING & NON-BEARING # Orchards -# - AREA GROWN # Berry totals -# - AREA IN PRODUCTION # Vegetable totals -# attribution_method: proportional -# attribution_source: -# USDA_CoA_Cropland_NAICS: -# year: 2017 -# selection_fields: -# Class: Land -# FlowName: AG LAND, CROPLAND, HARVESTED - -# pasture: &pasture # allocated based on USDA Animal operation land (acres) -# selection_fields: -# PrimaryActivity: -# - All activities Grassland -# attribution_method: proportional -# attribution_source: -# USDA_CoA_Cropland_NAICS: -# year: 2017 -# selection_fields: -# Class: Land -# FlowName: FARM OPERATIONS -# clean_fba: !script_function:temp_data_source_functions clean_usda_cropland_naics - -# EPA_GHGI_T_5_19: #Indirect N2O emissions from agricultural soils -# fedefl_mapping: GHGI -# activity_sets: -# fertilizer_use: # allocated based on fertilizer use -# <<: *fertilizer -# selection_fields: -# PrimaryActivity: -# - Volatilization & Atm. Deposition Cropland -# - Surface Leaching & Run-Off Cropland -# pasture: # allocated based on USDA Animal operation land (acres) -# <<: *pasture - - -# ## Mobile Sources -# EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion -# fedefl_mapping: GHGI -# activity_sets: -# direct_attribution: -# selection_fields: -# PrimaryActivity: -# - Passenger Cars Gasoline On-Road -# - Light-Duty Trucks Gasoline On-Road -# - Rail Non-Road -# - Ships and Boats Non-Road -# - Aircraft Non-Road -# - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road -# attribution_method: direct - -# construction_and_mining: #this set is allocated by purchases of construction equipment -# selection_fields: -# PrimaryActivity: Construction/Mining Equipment Non-Road -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea -# selection_fields: -# ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment - -# farm_non_road: #this set is allocated by purchases of farm machinery -# selection_fields: -# PrimaryActivity: Agricultural Equipment Non-Road -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea -# selection_fields: -# ActivityProducedBy: {'333111': ''} # purchases of farm machinery - -# other_non_road: #this set is allocated by purchases of petroleum refining -# selection_fields: -# PrimaryActivity: Other Non-Road -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea -# selection_fields: -# ActivityProducedBy: {'324110': ''} # purchases of refinery products - -# alt_fuel_on_road: #this set is allocated by purchases of natural gas -# selection_fields: -# PrimaryActivity: -# - All activities Alternative Fuel On-Road # corrected from "Alternative Fuel On-Road", which isn't in the source FBA. -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea -# selection_fields: -# ActivityProducedBy: {'221200': ''} # purchases of natural gas - -# EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 - -# ## Major CO2 Sources -# EPA_GHGI_T_A_14: # CO2 emissions from stationary combustion and transportation -# fedefl_mapping: GHGI -# clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion -# activity_sets: -# direct_attribution: #direct allocation -# selection_fields: -# PrimaryActivity: Total (All Fuels) Residential -# attribution_method: direct - -# non-manufacturing_coal: -# selection_fields: -# PrimaryActivity: -# - Commercial Coal Commercial -# - Industrial Other Coal Industrial -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea -# selection_fields: -# ActivityProducedBy: {'212100': ''} # purchases of coal - -# non-manufacturing_natural_gas: -# selection_fields: -# PrimaryActivity: -# - Natural Gas Commercial -# - Natural Gas Industrial -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea -# selection_fields: -# ActivityProducedBy: {'221200': ''} # purchases of natural gas - -# non-manufacturing_petroleum: # Petroleum -# selection_fields: -# PrimaryActivity: -# - Total Petroleum Commercial -# - Total Petroleum Industrial -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea -# selection_fields: -# ActivityProducedBy: {'324110': ''} # purchases of refinery products - -# manufacturing_coal: # Industrial Coal for Manufacturing -# selection_fields: -# PrimaryActivity: -# - Industrial Other Coal Industrial - Manufacturing -# attribution_method: proportional -# attribution_source: -# EIA_MECS_Energy: -# <<: *mecs_energy -# selection_fields: -# <<: *mecs_energy_default_selection -# FlowName: Coal - -# manufacturing_natural_gas: # Industrial Natural Gas for manufacturing -# selection_fields: -# PrimaryActivity: -# - Natural Gas Industrial - Manufacturing -# attribution_method: proportional -# attribution_source: -# EIA_MECS_Energy: -# <<: *mecs_energy -# selection_fields: -# <<: *mecs_energy_default_selection -# FlowName: Natural Gas - -# ### Transportation -# natural_gas_transportation: -# selection_fields: -# PrimaryActivity: Natural Gas Transportation -# attribution_method: proportional -# attribution_source: -# EPA_GHGI_T_A_79: -# selection_fields: -# FlowName: Natural Gas -# attribution_method: proportional -# attribution_source: BLS_QCEW - -# aviation_gas_transportation: -# selection_fields: -# PrimaryActivity: Aviation Gasoline Transportation -# attribution_method: proportional -# attribution_source: -# EPA_GHGI_T_A_79: -# selection_fields: -# FlowName: Aviation Gasoline -# attribution_method: proportional -# attribution_source: BLS_QCEW - -# jet_fuel_transportation: -# selection_fields: -# PrimaryActivity: Jet Fuel Transportation -# attribution_method: proportional -# attribution_source: -# EPA_GHGI_T_A_79: -# selection_fields: -# FlowName: Jet Fuel -# attribution_method: proportional -# attribution_source: BLS_QCEW - -# propane_transportation: -# selection_fields: -# PrimaryActivity: LPG (Propane) Transportation -# attribution_method: proportional -# attribution_source: -# EPA_GHGI_T_A_79: -# selection_fields: -# FlowName: LPG -# attribution_method: proportional -# attribution_source: BLS_QCEW - -# residual_fuel_transportation: -# selection_fields: -# PrimaryActivity: Residual Fuel Transportation -# attribution_method: proportional -# attribution_source: -# EPA_GHGI_T_A_79: -# selection_fields: -# FlowName: Residual Fuel Oil -# attribution_method: proportional -# attribution_source: BLS_QCEW - -# distillate_fuel_transportation: # industry_spec defined as default: NAICS_6 replaces previous clean_allocation_fba_w_sec -# selection_fields: -# PrimaryActivity: Distillate Fuel Oil Transportation -# attribution_method: proportional -# attribution_source: -# EPA_GHGI_T_A_79: -# selection_fields: -# FlowName: Distillate Fuel Oil (Diesel Fuel) # these selection fields replaces previous clean_allocation_fba -# ActivityConsumedBy: -# - Medium- and Heavy-Duty Trucks -# - Buses -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea -# selection_fields: -# ActivityProducedBy: {'324110': ''} # use of petroleum products - -# gasoline_transportation: # industry_spec defined as default: NAICS_6 replaces previous clean_allocation_fba_w_sec -# selection_fields: -# PrimaryActivity: Motor Gasoline Transportation -# attribution_method: proportional -# attribution_source: -# EPA_GHGI_T_A_79: -# selection_fields: -# FlowName: Motor Gasoline -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea -# selection_fields: -# ActivityProducedBy: {'324110': ''} # use of petroleum products - -# ## Stationary Combustion -# EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion -# fedefl_mapping: GHGI -# clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion -# activity_sets: -# direct_attribution: -# selection_fields: -# PrimaryActivity: -# - Fuel Oil Residential -# - Coal Residential -# - Natural Gas Residential -# - Wood Residential -# attribution_method: direct - -# electric_power: -# <<: *electricity_make -# selection_fields: -# PrimaryActivity: -# - Coal Electric Power -# - Natural Gas Electric Power -# - Natural gas Electric Power # note lower case -# - Fuel Oil Electric Power -# - Wood Electric Power - -# fuel_oil: -# selection_fields: -# PrimaryActivity: -# - Fuel Oil Commercial -# - Fuel Oil Industrial -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea -# selection_fields: -# ActivityProducedBy: {'324110': ''} # purchases of refinery products - -# natural_gas: -# selection_fields: -# PrimaryActivity: -# - Natural gas Commercial -# - Natural gas Industrial -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea -# selection_fields: -# ActivityProducedBy: {'221200': ''} # purchases of natural gas - -# coal: -# selection_fields: -# PrimaryActivity: Coal Industrial -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea -# selection_fields: -# ActivityProducedBy: {'212100': ''} # purchases of coal - -# coal_manufacturing: -# selection_fields: -# PrimaryActivity: Coal Industrial - Manufacturing -# attribution_method: proportional -# attribution_source: -# EIA_MECS_Energy: -# <<: *mecs_energy -# selection_fields: -# <<: *mecs_energy_default_selection -# FlowName: Coal - -# natural_gas_manufacturing: -# selection_fields: -# PrimaryActivity: Natural gas Industrial - Manufacturing -# attribution_method: proportional -# attribution_source: -# EIA_MECS_Energy: -# <<: *mecs_energy -# selection_fields: -# <<: *mecs_energy_default_selection -# FlowName: Natural Gas - -# EPA_GHGI_T_3_9: -# <<: *stationary_combustion # N2O emissions from stationary combustion - -# ## Other sources -# EPA_GHGI_T_4_46: #CO2 for selected petrochemicals -# fedefl_mapping: GHGI -# selection_fields: -# PrimaryActivity: -# - Acrylonitrile -# - Carbon Black -# - Ethylene -# - Ethylene Dichloride -# - Ethylene Oxide -# - Methanol -# attribution_method: direct - -# EPA_GHGI_T_3_22b: #Fossil fuel for non-energy uses -# fedefl_mapping: GHGI -# activity_sets: -# coal: -# selection_fields: -# PrimaryActivity: -# - Industry Industrial Coking Coal -# - Industry Industrial Other Coal -# attribution_method: direct - -# petroleum_feedstocks: # consumed petroleum products -# selection_fields: -# PrimaryActivity: -# - Industry Asphalt & Road Oil -# - Industry Distillate Fuel Oil -# - Industry LPG -# - Industry Lubricants -# - Industry Miscellaneous Products -# - Industry Naphtha (<401 F) -# - Industry Other Oil (>401 F) -# - Industry Pentanes Plus -# - Industry Petroleum Coke -# - Industry Special Naphtha -# - Industry Still Gas -# - Industry Waxes -# attribution_method: proportional -# attribution_source: -# EIA_MECS_Energy: -# <<: *mecs_energy -# selection_fields: -# Class: Other -# FlowName: Other -# Unit: Trillion Btu - -# natural_gas_feedstocks: # consumed nat gas to chemical plants -# selection_fields: -# PrimaryActivity: Industry Natural Gas to Chemical Plants -# attribution_method: proportional -# attribution_source: -# EIA_MECS_Energy: -# <<: *mecs_energy -# selection_fields: -# Class: Other -# FlowName: Natural Gas -# Unit: Trillion Btu - -# transportation_lubricants: -# selection_fields: -# PrimaryActivity: Transportation Lubricants -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea -# selection_fields: -# ActivityProducedBy: '324110' # use of petroleum products - -# ## Other Emissions -# EPA_GHGI_T_4_50: # HFCs from HCFC-22 production -# selection_fields: -# Unit: MMT CO2e -# PrimaryActivity: HCFC-22 Production -# fedefl_mapping: GHGI -# attribution_method: direct - -# EPA_GHGI_T_4_94: # HFCs and other emissions from electronics manufacture -# selection_fields: -# FlowName: -# C2F6: C2F6 -# C3F8: C3F8 -# CF4: CF4 -# HFC-23: HFC-23 -# c-C4F8: c-C4F8 -# SF6: SF6 -# NF3: NF3 -# N2O[2]: N2O -# fedefl_mapping: GHGI -# attribution_method: direct - -# EPA_GHGI_T_4_101: # HFCs and PFCs from ODS Substitutes -# clean_fba_before_activity_sets: !script_function:temp_data_source_functions clean_hfc_fba # removes HFCs from transportation -# fedefl_mapping: 'GHGI' -# activity_sets: -# household_refrigeration: -# selection_fields: -# PrimaryActivity: Refrigeration/Air Conditioning - Households -# attribution_method: direct - -# non-household_refrigeration: -# selection_fields: -# PrimaryActivity: Refrigeration/Air Conditioning -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea -# selection_fields: -# ActivityProducedBy: {'333415': ''} # Air conditioning equipment - -# polystyrene_foam: -# selection_fields: -# PrimaryActivity: Foams - Polystyrene -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea -# selection_fields: -# ActivityProducedBy: {'326140': ''} # Polystyrene foam - -# urethane_foam: -# selection_fields: -# PrimaryActivity: Foams - Urethane -# attribution_method: proportional -# attribution_source: -# BEA_Use_Detail_PRO_BeforeRedef: -# <<: *bea -# selection_fields: -# ActivityProducedBy: {'326150': ''} # Urethane and other foams. - -# EPA_GHGI_T_A_103: # HFCs from Transportation -# clean_fba_before_mapping: !script_function:temp_data_source_functions split_hfcs_by_type -# fedefl_mapping: GHGI -# selection_fields: -# PrimaryActivity: -# Mobile AC - Passenger Cars: Passenger Cars -# Mobile AC - Heavy-Duty Vehicles: Heavy-Duty Vehicles -# Mobile AC - Light-Duty Trucks: Light-Duty Trucks -# Comfort Cooling for Trains and Buses - School and Tour Buses: School and Tour Buses -# Comfort Cooling for Trains and Buses - Rail: Rail -# Refrigerated Transport - Medium- and Heavy-Duty Trucks: Medium- and Heavy-Duty Trucks -# Refrigerated Transport - Rail: Rail -# Refrigerated Transport - Ships and Boats: Ships and Boats -# attribution_method: direct - -# EPA_GHGI_T_4_80: # PFCs from aluminum production -# fedefl_mapping: GHGI -# attribution_method: direct - -# EPA_GHGI_T_4_84: # HFCs, SF6, CO2 from magnesium production -# fedefl_mapping: GHGI -# attribution_method: proportional -# attribution_source: -# BEA_Make_Detail_BeforeRedef: -# <<: *bea -# selection_fields: -# ActivityConsumedBy: {T008: ''} # Total Output +## Fossil Fuels + EPA_GHGI_T_3_63: &natgas #CH4 from Natural Gas Systems + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + - Distribution + - Exploration + - Processing + - Production + - Transmission and Storage + attribution_method: direct + EPA_GHGI_T_3_65: *natgas #CO2 from Natural Gas Systems mimics CH4 + EPA_GHGI_T_3_67: *natgas #N2O from Natural Gas Systems, not used in original method, mimics CH4 + + EPA_GHGI_T_3_38: &petroleum #CH4 from Petroleum Systems + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + - Crude Oil Transportation + - Exploration + - Production + - Refining + attribution_method: direct + EPA_GHGI_T_3_40: *petroleum #CO2 from Petroleum Systems mimics CH4 + EPA_GHGI_T_3_42: *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 + +## Agriculture + EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + - Chickpeas + - Cotton + - Maize + - Rice + - Soybeans + - Wheat + attribution_method: direct + + EPA_GHGI_T_5_3: &animals #CH4 from Enteric Fermentation + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + - American Bison + - Beef Cattle + - Dairy Cattle + - Goats + - Horses + - Mules and Asses + - Sheep + - Swine + - Poultry + attribution_method: direct + EPA_GHGI_T_5_7: *animals #CH4 and N2O from manure, mimics enteric fermentation + + EPA_GHGI_T_5_18: #Direct N2O emissions from agricultural soils + fedefl_mapping: GHGI + activity_sets: + fertilizer_use: &fertilizer # allocated based on fertilizer use + selection_fields: + PrimaryActivity: + - Organic Amendment Cropland + - Residue N Cropland + - Synthetic Fertilizer Cropland + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} + + cropland: # allocated based on USDA land area harvested + selection_fields: + PrimaryActivity: + - Mineralization and Asymbiotic Fixation Cropland + - Drained Organic Soils Cropland + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland: + year: 2017 + selection_fields: + Class: Land + FlowName: + - AREA HARVESTED + - AREA BEARING & NON-BEARING # Orchards + - AREA GROWN # Berry totals + - AREA IN PRODUCTION # Vegetable totals + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + year: 2017 + selection_fields: + Class: Land + FlowName: AG LAND, CROPLAND, HARVESTED + + pasture: &pasture # allocated based on USDA Animal operation land (acres) + selection_fields: + PrimaryActivity: + - All activities Grassland + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + year: 2017 + selection_fields: + Class: Land + FlowName: FARM OPERATIONS + clean_fba: !script_function:temp_data_source_functions clean_usda_cropland_naics + + EPA_GHGI_T_5_19: #Indirect N2O emissions from agricultural soils + fedefl_mapping: GHGI + activity_sets: + fertilizer_use: # allocated based on fertilizer use + <<: *fertilizer + selection_fields: + PrimaryActivity: + - Volatilization & Atm. Deposition Cropland + - Surface Leaching & Run-Off Cropland + pasture: # allocated based on USDA Animal operation land (acres) + <<: *pasture + +## Mobile Sources + EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion + fedefl_mapping: GHGI + activity_sets: + direct_attribution: + selection_fields: + PrimaryActivity: + - Passenger Cars Gasoline On-Road + - Light-Duty Trucks Gasoline On-Road + - Rail Non-Road + - Ships and Boats Non-Road + - Aircraft Non-Road + - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road + attribution_method: direct + + construction_and_mining: #this set is allocated by purchases of construction equipment + selection_fields: + PrimaryActivity: Construction/Mining Equipment Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment + + farm_non_road: #this set is allocated by purchases of farm machinery + selection_fields: + PrimaryActivity: Agricultural Equipment Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333111': ''} # purchases of farm machinery + + other_non_road: #this set is allocated by purchases of petroleum refining + selection_fields: + PrimaryActivity: Other Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + alt_fuel_on_road: #this set is allocated by purchases of natural gas + selection_fields: + PrimaryActivity: + - All activities Alternative Fuel On-Road # corrected from "Alternative Fuel On-Road", which isn't in the source FBA. + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 + +## Major CO2 Sources + EPA_GHGI_T_A_14: # CO2 emissions from stationary combustion and transportation + fedefl_mapping: GHGI + clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion + activity_sets: + direct_attribution: #direct allocation + selection_fields: + PrimaryActivity: Total (All Fuels) Residential + attribution_method: direct + + non-manufacturing_coal: + selection_fields: + PrimaryActivity: + - Commercial Coal Commercial + - Industrial Other Coal Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal + + non-manufacturing_natural_gas: + selection_fields: + PrimaryActivity: + - Natural Gas Commercial + - Natural Gas Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + non-manufacturing_petroleum: # Petroleum + selection_fields: + PrimaryActivity: + - Total Petroleum Commercial + - Total Petroleum Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + manufacturing_coal: # Industrial Coal for Manufacturing + selection_fields: + PrimaryActivity: + - Industrial Other Coal Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Coal + + manufacturing_natural_gas: # Industrial Natural Gas for manufacturing + selection_fields: + PrimaryActivity: + - Natural Gas Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Natural Gas + + ### Transportation + natural_gas_transportation: + selection_fields: + PrimaryActivity: Natural Gas Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + selection_fields: + FlowName: Natural Gas + attribution_method: proportional + attribution_source: BLS_QCEW + + aviation_gas_transportation: + selection_fields: + PrimaryActivity: Aviation Gasoline Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + selection_fields: + FlowName: Aviation Gasoline + attribution_method: proportional + attribution_source: BLS_QCEW + + jet_fuel_transportation: + selection_fields: + PrimaryActivity: Jet Fuel Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + selection_fields: + FlowName: Jet Fuel + attribution_method: proportional + attribution_source: BLS_QCEW + + propane_transportation: + selection_fields: + PrimaryActivity: LPG (Propane) Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + selection_fields: + FlowName: LPG + attribution_method: proportional + attribution_source: BLS_QCEW + + residual_fuel_transportation: + selection_fields: + PrimaryActivity: Residual Fuel Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + selection_fields: + FlowName: Residual Fuel Oil + attribution_method: proportional + attribution_source: BLS_QCEW + + distillate_fuel_transportation: # industry_spec defined as default: NAICS_6 replaces previous clean_allocation_fba_w_sec + selection_fields: + PrimaryActivity: Distillate Fuel Oil Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + selection_fields: + FlowName: Distillate Fuel Oil (Diesel Fuel) # these selection fields replaces previous clean_allocation_fba + ActivityConsumedBy: + - Passenger Cars + - Light-Duty Trucks + - Medium- and Heavy-Duty Trucks + - Buses + - Rail + - Recreational Boats + - Ships and Non-Recreational Boats + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # use of petroleum products + + gasoline_transportation: # industry_spec defined as default: NAICS_6 replaces previous clean_allocation_fba_w_sec + selection_fields: + PrimaryActivity: Motor Gasoline Transportation + attribution_method: proportional + attribution_source: + EPA_GHGI_T_A_79: + selection_fields: + FlowName: Motor Gasoline + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # use of petroleum products + +## Stationary Combustion + EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion + fedefl_mapping: GHGI + clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion + activity_sets: + direct_attribution: + selection_fields: + PrimaryActivity: + - Fuel Oil Residential + - Coal Residential + - Natural Gas Residential + - Wood Residential + attribution_method: direct + + electric_power: + # <<: *electricity_make + selection_fields: + PrimaryActivity: + - Coal Electric Power + - Natural Gas Electric Power + - Natural gas Electric Power # note lower case + - Fuel Oil Electric Power + - Wood Electric Power + attribution_method: proportional + attribution_source: + BEA_Make_Detail_BeforeRedef: + <<: *bea + primary_action_type: Produced + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity + + fuel_oil: + selection_fields: + PrimaryActivity: + - Fuel Oil Commercial + - Fuel Oil Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + natural_gas: + selection_fields: + PrimaryActivity: + - Natural gas Commercial + - Natural gas Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + coal: + selection_fields: + PrimaryActivity: Coal Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal + + coal_manufacturing: + selection_fields: + PrimaryActivity: Coal Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Coal + + natural_gas_manufacturing: + selection_fields: + PrimaryActivity: Natural gas Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Natural Gas + + EPA_GHGI_T_3_9: + <<: *stationary_combustion # N2O emissions from stationary combustion + fedefl_mapping: GHGI + clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion + activity_sets: + direct_attribution: + selection_fields: + PrimaryActivity: + - Fuel Oil Residential + - Coal Residential + - Natural Gas Residential + - Wood Residential + attribution_method: direct + + electric_power: + # <<: *electricity_make + selection_fields: + PrimaryActivity: + - Coal Electric Power + - Natural Gas Electric Power + - Natural gas Electric Power # note lower case + - Fuel Oil Electric Power + - Wood Electric Power + attribution_method: proportional + attribution_source: + BEA_Make_Detail_BeforeRedef: + <<: *bea + primary_action_type: Produced + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity + + fuel_oil: + selection_fields: + PrimaryActivity: + - Fuel Oil Commercial + - Fuel Oil Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + natural_gas: + selection_fields: + PrimaryActivity: + - Natural gas Commercial + - Natural gas Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + coal: + selection_fields: + PrimaryActivity: Coal Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal + + coal_manufacturing: + selection_fields: + PrimaryActivity: Coal Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Coal + + natural_gas_manufacturing: + selection_fields: + PrimaryActivity: Natural gas Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Natural Gas + +## Other sources + EPA_GHGI_T_4_46: #CO2 for selected petrochemicals + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + - Acrylonitrile + - Carbon Black + - Ethylene + - Ethylene Dichloride + - Ethylene Oxide + - Methanol + attribution_method: direct + + EPA_GHGI_T_3_22b: #Fossil fuel for non-energy uses + fedefl_mapping: GHGI + activity_sets: + coal: + selection_fields: + PrimaryActivity: + - Industry Industrial Coking Coal + - Industry Industrial Other Coal + attribution_method: direct + + petroleum_feedstocks: # consumed petroleum products + selection_fields: + PrimaryActivity: + - Industry Asphalt & Road Oil + - Industry Distillate Fuel Oil + - Industry LPG + - Industry Lubricants + - Industry Miscellaneous Products + - Industry Naphtha (<401 F) + - Industry Other Oil (>401 F) + - Industry Pentanes Plus + - Industry Petroleum Coke + - Industry Special Naphtha + - Industry Still Gas + - Industry Waxes + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + FlowName: Other + Unit: Trillion Btu + + natural_gas_feedstocks: # consumed nat gas to chemical plants + selection_fields: + PrimaryActivity: Industry Natural Gas to Chemical Plants + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + FlowName: Natural Gas + Unit: Trillion Btu + + transportation_lubricants: + selection_fields: + PrimaryActivity: Transportation Lubricants + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: '324110' # use of petroleum products + +## Other Emissions + EPA_GHGI_T_4_50: # HFCs from HCFC-22 production + selection_fields: + Unit: MMT CO2e + PrimaryActivity: HCFC-22 Production + fedefl_mapping: GHGI + attribution_method: direct + + EPA_GHGI_T_4_94: # HFCs and other emissions from electronics manufacture + selection_fields: + FlowName: + C2F6: C2F6 + C3F8: C3F8 + CF4: CF4 + HFC-23: HFC-23 + c-C4F8: c-C4F8 + SF6: SF6 + NF3: NF3 + N2O[2]: N2O + fedefl_mapping: GHGI + attribution_method: direct + + EPA_GHGI_T_4_101: # HFCs and PFCs from ODS Substitutes + clean_fba_before_activity_sets: !script_function:temp_data_source_functions clean_hfc_fba # removes HFCs from transportation + fedefl_mapping: 'GHGI' + activity_sets: + household_refrigeration: + selection_fields: + PrimaryActivity: Refrigeration/Air Conditioning - Households + attribution_method: direct + + non-household_refrigeration: + selection_fields: + PrimaryActivity: Refrigeration/Air Conditioning + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment + + polystyrene_foam: + selection_fields: + PrimaryActivity: Foams - Polystyrene + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'326140': ''} # Polystyrene foam + + urethane_foam: + selection_fields: + PrimaryActivity: Foams - Urethane + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'326150': ''} # Urethane and other foams. + + EPA_GHGI_T_A_103: # HFCs from Transportation + clean_fba_before_mapping: !script_function:temp_data_source_functions split_hfcs_by_type + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + Mobile AC - Passenger Cars: Passenger Cars + Mobile AC - Heavy-Duty Vehicles: Heavy-Duty Vehicles + Mobile AC - Light-Duty Trucks: Light-Duty Trucks + Comfort Cooling for Trains and Buses - School and Tour Buses: School and Tour Buses + Comfort Cooling for Trains and Buses - Rail: Rail + Refrigerated Transport - Medium- and Heavy-Duty Trucks: Medium- and Heavy-Duty Trucks + Refrigerated Transport - Rail: Rail + Refrigerated Transport - Ships and Boats: Ships and Boats + attribution_method: direct + + EPA_GHGI_T_4_80: # PFCs from aluminum production + fedefl_mapping: GHGI + attribution_method: direct + + EPA_GHGI_T_4_84: # HFCs, SF6, CO2 from magnesium production + fedefl_mapping: GHGI + attribution_method: proportional + attribution_source: + BEA_Make_Detail_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {T008: ''} # Total Output From b1fa752c63a23c5a5dbf42e9aab6ffe2e6da3466 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 17 Oct 2022 10:32:22 -0400 Subject: [PATCH 0207/1127] ensure county exists before assigning FIPS --- flowsa/data_source_scripts/EPA_SIT.py | 2 -- flowsa/data_source_scripts/EPA_StateGHGI.py | 1 - flowsa/data_source_scripts/stateio.py | 1 - flowsa/location.py | 6 ++++-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_SIT.py b/flowsa/data_source_scripts/EPA_SIT.py index 1b264dbce..83ec1ea21 100644 --- a/flowsa/data_source_scripts/EPA_SIT.py +++ b/flowsa/data_source_scripts/EPA_SIT.py @@ -117,7 +117,6 @@ def epa_sit_parse(*, source, year, config, **_): df0['DataCollection'] = 5 # add state FIPS code - df0['County'] = '' df0 = apply_county_FIPS(df0, year='2015', source_state_abbrev=True) # add FIPS location system df0 = assign_fips_location_system(df0, '2015') @@ -199,7 +198,6 @@ def clean_up_state_data(fba, source_dict, **_): # (i) drop all states OTHER THAN those selected for alternative data sources state_df = pd.DataFrame(state_list, columns=['State']) - state_df['County'] ='' state_df = apply_county_FIPS(state_df) df_subset = fba[fba['Location'].isin(state_df['Location'])] diff --git a/flowsa/data_source_scripts/EPA_StateGHGI.py b/flowsa/data_source_scripts/EPA_StateGHGI.py index 8f59134f8..b7123368f 100644 --- a/flowsa/data_source_scripts/EPA_StateGHGI.py +++ b/flowsa/data_source_scripts/EPA_StateGHGI.py @@ -51,7 +51,6 @@ def epa_state_ghgi_parse(*, source, year, config, **_): df.drop(columns=activity_cols, inplace=True) activities = df[['ActivityProducedBy']].drop_duplicates() - df['County'] = '' df = apply_county_FIPS(df) df = assign_fips_location_system(df, '2015') df.drop(columns=['County'], inplace=True) diff --git a/flowsa/data_source_scripts/stateio.py b/flowsa/data_source_scripts/stateio.py index d3aa77771..f4ee1a20f 100644 --- a/flowsa/data_source_scripts/stateio.py +++ b/flowsa/data_source_scripts/stateio.py @@ -56,7 +56,6 @@ def parse_statior(*, source, year, config, **_): fba = fba.drop(columns=['ActivityConsumedBy']) # Assign location - fba['County'] = '' fba = apply_county_FIPS(fba) fba = assign_fips_location_system(fba, '2015') fba.drop(columns=['County'], inplace=True) diff --git a/flowsa/location.py b/flowsa/location.py index f8bd73f89..1a6d5088c 100644 --- a/flowsa/location.py +++ b/flowsa/location.py @@ -94,6 +94,8 @@ def apply_county_FIPS(df, year='2015', source_state_abbrev=True): df['State'] = df['State'].map(abbrev_us_state).fillna(df['State']) df['State'] = df.apply(lambda x: clean_str_and_capitalize(x.State), axis=1) + if 'County' not in df: + df['County'] = '' df['County'] = df.apply(lambda x: clean_str_and_capitalize(x.County), axis=1) @@ -103,10 +105,10 @@ def apply_county_FIPS(df, year='2015', source_state_abbrev=True): # Where no county match occurs, assign state FIPS instead mapping_FIPS = get_state_FIPS() - mapping_FIPS.drop(columns=['County'], inplace=True) + mapping_FIPS = mapping_FIPS.drop(columns=['County']) df = df.merge(mapping_FIPS, left_on='State', right_on='State', how='left') df['Location'] = df['FIPS_x'].where(df['FIPS_x'].notnull(), df['FIPS_y']) - df.drop(columns=['FIPS_x', 'FIPS_y'], inplace=True) + df = df.drop(columns=['FIPS_x', 'FIPS_y']) return df From 4b881a1541729b013b6a7a93d8cdb2b69bc16712 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 17 Oct 2022 10:56:40 -0400 Subject: [PATCH 0208/1127] cleanup of state supplementary data --- flowsa/data_source_scripts/StateGHGI.py | 60 +++++++++---------- .../flowbyactivitymethods/StateGHGI_ME.yaml | 15 +++-- .../flowbyactivitymethods/StateGHGI_VT.yaml | 5 +- 3 files changed, 36 insertions(+), 44 deletions(-) diff --git a/flowsa/data_source_scripts/StateGHGI.py b/flowsa/data_source_scripts/StateGHGI.py index 4382ac029..68afc6caf 100644 --- a/flowsa/data_source_scripts/StateGHGI.py +++ b/flowsa/data_source_scripts/StateGHGI.py @@ -9,48 +9,46 @@ import pandas as pd import os from flowsa.settings import externaldatapath, log -from flowsa.flowbyfunctions import assign_fips_location_system, \ - load_fba_w_standardized_units +from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.location import apply_county_FIPS from flowsa.schema import flow_by_activity_fields +data_path = f"{externaldatapath}/StateGHGI_data" + def ME_biogenic_parse(*, source, year, config, **_): # initialize the dataframe df0 = pd.DataFrame() filename = config['filename'] - - log.info(f'Loading data from file {filename}...') - - filepath = f"{externaldatapath}/StateGHGI_data/ME/{filename}" + filepath = f"{data_path}/{filename}" # dictionary containing Excel sheet-specific information - file_dict = config['file_dict'] + table_dicts = config['table_dict'] if not os.path.exists(filepath): raise FileNotFoundError(f'StateGHGI file not found in {filepath}') + + log.info(f'Loading data from file {filename}...') # for each data table in the Excel file... - for table, table_dict in file_dict.items(): - + for table, table_dict in table_dicts.items(): + log.info(f'Loading data from table {table}...') # read in data from Excel sheet df = pd.read_excel(filepath, header=table_dict.get('header'), - usecols="A:AG", + # usecols="A:AG", nrows=table_dict.get('nrows')) df.columns = df.columns.map(str) # rename certain columns - df.rename(columns = { - 'Gas':'FlowName', - 'Sector/Activity':'ActivityProducedBy', - 'Units':'Unit', - year:'FlowAmount' - }, inplace = True) - df['ActivityProducedBy'] = df['ActivityProducedBy'] + ", " + table[15:] + df = df.rename(columns = {'Gas':'FlowName', + 'Sector/Activity':'ActivityProducedBy', + 'Units':'Unit', + year:'FlowAmount'}) + df['ActivityProducedBy'] = df['ActivityProducedBy'] + ", " + table df['FlowName'] = 'Biogenic ' + df['FlowName'] # drop all years except the desired emissions year @@ -71,7 +69,6 @@ def ME_biogenic_parse(*, source, year, config, **_): # add state FIPS code df0['State'] = 'ME' - df0['County'] = '' df0 = apply_county_FIPS(df0, year='2015', source_state_abbrev=True) # add FIPS location system df0 = assign_fips_location_system(df0, '2015') @@ -85,38 +82,36 @@ def VT_supplementary_parse(*, source, year, config, **_): filename = config['filename'] - log.info(f'Loading data from file {filename}...') - - filepath = f"{externaldatapath}/StateGHGI_data/VT/{filename}" + filepath = f"{data_path}/{filename}" # dictionary containing Excel sheet-specific information - file_dict = config['file_dict'] + table_dicts = config['table_dict'] if not os.path.exists(filepath): - raise FileNotFoundError(f'StateGHGI file not found in {filepath}') + raise FileNotFoundError(f'{filename} file not found in {filepath}') + log.info(f'Loading data from file {filename}...') # for each data table in the Excel file... - for table, table_dict in file_dict.items(): + for table, table_dict in table_dicts.items(): log.info(f'Loading data from table {table}...') # read in data from Excel sheet df = pd.read_excel(filepath, header=table_dict.get('header'), - usecols="A:AG", + # usecols="A:AG", nrows=table_dict.get('nrows')) df.columns = df.columns.map(str) # rename certain columns - df.rename(columns = { - 'Gas':'FlowName', - 'Sector/Activity':'ActivityProducedBy', - 'Units':'Unit', - year:'FlowAmount' - }, inplace = True) + df = df.rename(columns = {'Gas': 'FlowName', + 'Sector/Activity': 'ActivityProducedBy', + 'Units': 'Unit', + year:'FlowAmount'}) # drop all years except the desired emissions year - df = df.filter(['FlowAmount', 'FlowName', 'ActivityProducedBy', 'Unit']) + df = df.filter(['FlowAmount', 'FlowName', 'ActivityProducedBy', + 'Unit']) # concatenate dataframe from each table with existing master dataframe df0 = pd.concat([df0, df]) @@ -133,7 +128,6 @@ def VT_supplementary_parse(*, source, year, config, **_): # add state FIPS code df0['State'] = 'VT' - df0['County'] = '' df0 = apply_county_FIPS(df0, year='2015', source_state_abbrev=True) # add FIPS location system df0 = assign_fips_location_system(df0, '2015') diff --git a/flowsa/methods/flowbyactivitymethods/StateGHGI_ME.yaml b/flowsa/methods/flowbyactivitymethods/StateGHGI_ME.yaml index 05e6d917b..879c5e06b 100644 --- a/flowsa/methods/flowbyactivitymethods/StateGHGI_ME.yaml +++ b/flowsa/methods/flowbyactivitymethods/StateGHGI_ME.yaml @@ -3,6 +3,7 @@ source_name: Maine State Biogenic Emissions Data bib_id: StateGHGI_ME format: xlsx # Excel spreadsheet url: None +filename: 'ME_biogenic_data_summary.xlsx' parse_response_fxn: !script_function:StateGHGI ME_biogenic_parse years: - 2019 @@ -36,26 +37,24 @@ years: - 1991 - 1990 -filename: 'ME_biogenic_data_summary.xlsx' - -file_dict: +table_dict: - 'Emissions from Ethanol Combustion': + 'Ethanol Combustion': sheetname: 'Sheet1' header: 1 nrows: 9 - 'Emissions from Biodiesel Combustion': + 'Biodiesel Combustion': sheetname: 'Sheet1' header: 14 nrows: 3 - 'Emissions from Solid Waste Management': + 'Solid Waste Management': sheetname: 'Sheet1' header: 21 nrows: 4 - 'Emissions from Wood and Wood Residuals': + 'Wood and Wood Residuals': sheetname: 'Sheet1' header: 29 - nrows: 12 \ No newline at end of file + nrows: 12 diff --git a/flowsa/methods/flowbyactivitymethods/StateGHGI_VT.yaml b/flowsa/methods/flowbyactivitymethods/StateGHGI_VT.yaml index 53a85a615..db70cad31 100644 --- a/flowsa/methods/flowbyactivitymethods/StateGHGI_VT.yaml +++ b/flowsa/methods/flowbyactivitymethods/StateGHGI_VT.yaml @@ -3,6 +3,7 @@ source_name: Vermont State Supplementary Emissions Data bib_id: StateGHGI_VT format: xlsx # Excel spreadsheet url: None +filename: 'VT_custom_data_summary.xlsx' parse_response_fxn: !script_function:StateGHGI VT_supplementary_parse years: - 2019 @@ -35,10 +36,8 @@ years: - 1992 - 1991 - 1990 - -filename: 'VT_custom_data_summary.xlsx' -file_dict: +table_dict: 'Emissions from Natural Gas Distribution': sheetname: 'Sheet1' From 44275a9409d6507f1b58b3ed5a2d09bf9dc02156 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 17 Oct 2022 10:58:04 -0400 Subject: [PATCH 0209/1127] Update function doc string --- flowsa/data_source_scripts/StateGHGI.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/flowsa/data_source_scripts/StateGHGI.py b/flowsa/data_source_scripts/StateGHGI.py index 68afc6caf..53f709815 100644 --- a/flowsa/data_source_scripts/StateGHGI.py +++ b/flowsa/data_source_scripts/StateGHGI.py @@ -1,9 +1,8 @@ -# EPA_SIT.py (flowsa) +# StateGHGI.py (flowsa) # !/usr/bin/env python3 # coding=utf-8 """ -Loads EPA State Inventory Tool (SIT) data for state specified from external -data directory. Parses EPA SIT data to flowbyactivity format. +Loads state specific GHGI data to supplement EPA State Inventory Tool (SIT). """ import pandas as pd @@ -11,13 +10,12 @@ from flowsa.settings import externaldatapath, log from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.location import apply_county_FIPS -from flowsa.schema import flow_by_activity_fields + data_path = f"{externaldatapath}/StateGHGI_data" def ME_biogenic_parse(*, source, year, config, **_): - # initialize the dataframe df0 = pd.DataFrame() filename = config['filename'] @@ -77,7 +75,6 @@ def ME_biogenic_parse(*, source, year, config, **_): def VT_supplementary_parse(*, source, year, config, **_): - # initialize the dataframe df0 = pd.DataFrame() filename = config['filename'] From d83db341f109aa3e50692b0d6d78de49049f6387 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 17 Oct 2022 11:13:31 -0400 Subject: [PATCH 0210/1127] confirm supplementary data in method before removing data; move to StateGHGI.py --- flowsa/data_source_scripts/EPA_SIT.py | 34 +++---------------------- flowsa/data_source_scripts/StateGHGI.py | 33 ++++++++++++++++++++++++ flowsa/flowbysector.py | 3 ++- 3 files changed, 39 insertions(+), 31 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_SIT.py b/flowsa/data_source_scripts/EPA_SIT.py index 83ec1ea21..fd14c1e0f 100644 --- a/flowsa/data_source_scripts/EPA_SIT.py +++ b/flowsa/data_source_scripts/EPA_SIT.py @@ -177,7 +177,7 @@ def disaggregate_emissions(fba, source_dict, **_): return fba -def clean_up_state_data(fba, source_dict, **_): +def clean_up_state_data(fba, source_dict, method, **_): """ clean_fba_df_fxn to: @@ -206,35 +206,9 @@ def clean_up_state_data(fba, source_dict, **_): # if Vermont is included in the inventory, exclude certain data # (these data will later be replaced with custom data in the 'StateGHGI' # stage) - if 'VT' in state_list: - - # remove Vermont natural gas distribution data - df_subset.drop(df_subset[ - ((df_subset.Location == '50000') & - (df_subset.ActivityProducedBy == 'Gas and Oil, Natural Gas, Distribution') - )].index, inplace=True) - - # remove Vermont ODS substitutes data - df_subset.drop(df_subset[ - ((df_subset.Location == '50000') & - (df_subset.ActivityProducedBy == 'IP, ODS Substitutes') - )].index, inplace=True) - - # remove Vermont semiconductor manufacturing data - df_subset.drop(df_subset[ - ((df_subset.Location == '50000') & - (df_subset.ActivityProducedBy == 'IP, Semiconductor Manufacturing') - )].index, inplace=True) - - # remove Vermont solid waste data - df_subset.drop(df_subset[ - ((df_subset.Location == '50000') & - (df_subset.Description == 'Landfills') - )].index, inplace=True) - df_subset.drop(df_subset[ - ((df_subset.Location == '50000') & - (df_subset.Description == 'Waste Combustion') - )].index, inplace=True) + if ('VT' in state_list) and ('StateGHGI_VT' in method['source_names'].keys()): + from flowsa.StateGHGI import VT_remove_dupicate_activities + df_subset = VT_remove_dupicate_activities(df_subset) return df_subset diff --git a/flowsa/data_source_scripts/StateGHGI.py b/flowsa/data_source_scripts/StateGHGI.py index 53f709815..0c29fbe3e 100644 --- a/flowsa/data_source_scripts/StateGHGI.py +++ b/flowsa/data_source_scripts/StateGHGI.py @@ -131,6 +131,39 @@ def VT_supplementary_parse(*, source, year, config, **_): return df0 + +def VT_remove_dupicate_activities(df_subset): + # remove Vermont natural gas distribution data + df_subset.drop(df_subset[ + ((df_subset.Location == '50000') & + (df_subset.ActivityProducedBy == 'Gas and Oil, Natural Gas, Distribution') + )].index, inplace=True) + + # remove Vermont ODS substitutes data + df_subset.drop(df_subset[ + ((df_subset.Location == '50000') & + (df_subset.ActivityProducedBy == 'IP, ODS Substitutes') + )].index, inplace=True) + + # remove Vermont semiconductor manufacturing data + df_subset.drop(df_subset[ + ((df_subset.Location == '50000') & + (df_subset.ActivityProducedBy == 'IP, Semiconductor Manufacturing') + )].index, inplace=True) + + # remove Vermont solid waste data + df_subset.drop(df_subset[ + ((df_subset.Location == '50000') & + (df_subset.Description == 'Landfills') + )].index, inplace=True) + df_subset.drop(df_subset[ + ((df_subset.Location == '50000') & + (df_subset.Description == 'Waste Combustion') + )].index, inplace=True) + + return df_subset + + if __name__ == '__main__': import flowsa flowsa.flowbyactivity.main(source='StateGHGI_ME', year='2019') diff --git a/flowsa/flowbysector.py b/flowsa/flowbysector.py index be6084d0b..f109ab347 100644 --- a/flowsa/flowbysector.py +++ b/flowsa/flowbysector.py @@ -183,7 +183,8 @@ def main(**kwargs): fxn = v.get("clean_fba_df_fxn") if callable(fxn): vLog.info(f"Cleaning up {k} FlowByActivity") - flows_mapped = fxn(fba=flows_mapped, source_dict=v) + flows_mapped = fxn(fba=flows_mapped, source_dict=v, + method=method) elif fxn: raise flowsa.exceptions.FBSMethodConstructionError( error_type='fxn_call') From 8ab1369becedb4a9ef2c235e7d9d97ba7556d356 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 17 Oct 2022 11:24:10 -0400 Subject: [PATCH 0211/1127] move activities to remove to yaml --- flowsa/data_source_scripts/StateGHGI.py | 38 ++++++------------- .../flowbyactivitymethods/StateGHGI_VT.yaml | 6 ++- 2 files changed, 16 insertions(+), 28 deletions(-) diff --git a/flowsa/data_source_scripts/StateGHGI.py b/flowsa/data_source_scripts/StateGHGI.py index 0c29fbe3e..2abd32bdf 100644 --- a/flowsa/data_source_scripts/StateGHGI.py +++ b/flowsa/data_source_scripts/StateGHGI.py @@ -10,6 +10,7 @@ from flowsa.settings import externaldatapath, log from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.location import apply_county_FIPS +from flowsa.common import load_yaml_dict data_path = f"{externaldatapath}/StateGHGI_data" @@ -133,33 +134,16 @@ def VT_supplementary_parse(*, source, year, config, **_): def VT_remove_dupicate_activities(df_subset): - # remove Vermont natural gas distribution data - df_subset.drop(df_subset[ - ((df_subset.Location == '50000') & - (df_subset.ActivityProducedBy == 'Gas and Oil, Natural Gas, Distribution') - )].index, inplace=True) - - # remove Vermont ODS substitutes data - df_subset.drop(df_subset[ - ((df_subset.Location == '50000') & - (df_subset.ActivityProducedBy == 'IP, ODS Substitutes') - )].index, inplace=True) - - # remove Vermont semiconductor manufacturing data - df_subset.drop(df_subset[ - ((df_subset.Location == '50000') & - (df_subset.ActivityProducedBy == 'IP, Semiconductor Manufacturing') - )].index, inplace=True) - - # remove Vermont solid waste data - df_subset.drop(df_subset[ - ((df_subset.Location == '50000') & - (df_subset.Description == 'Landfills') - )].index, inplace=True) - df_subset.drop(df_subset[ - ((df_subset.Location == '50000') & - (df_subset.Description == 'Waste Combustion') - )].index, inplace=True) + """Remove activities from standard SIT that are captured by supplementary + file.""" + fba_config = load_yaml_dict('StateGHGI_VT', flowbytype='FBA') + for table, table_dict in fba_config['table_dict'].items(): + proxy = table_dict['SIT_APB_proxy'] + proxy = [proxy] if isinstance(proxy, str) else proxy + df_subset = df_subset.drop(df_subset[ + ((df_subset.Location == '50000') & + (df_subset.ActivityProducedBy.isin(proxy)) + )].index) return df_subset diff --git a/flowsa/methods/flowbyactivitymethods/StateGHGI_VT.yaml b/flowsa/methods/flowbyactivitymethods/StateGHGI_VT.yaml index db70cad31..5abf1f586 100644 --- a/flowsa/methods/flowbyactivitymethods/StateGHGI_VT.yaml +++ b/flowsa/methods/flowbyactivitymethods/StateGHGI_VT.yaml @@ -43,18 +43,22 @@ table_dict: sheetname: 'Sheet1' header: 1 nrows: 2 + SIT_APB_proxy: 'Gas and Oil, Natural Gas, Distribution' 'Emissions from ODS Substitutes': sheetname: 'Sheet1' header: 7 nrows: 5 + SIT_APB_proxy: 'IP, ODS Substitutes' 'Emissions from Semiconductor Manufacturing': sheetname: 'Sheet1' header: 16 nrows: 7 + SIT_APB_proxy: 'IP, Semiconductor Manufacturing' 'Emissions from Solid Waste': sheetname: 'Sheet1' header: 27 - nrows: 3 \ No newline at end of file + nrows: 3 + SIT_APB_proxy: ['Landfills', 'Waste Combustion'] From a9dcabf140ffcc3e3d47ae9fa6c2e9e4cce231bb Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 17 Oct 2022 11:31:46 -0400 Subject: [PATCH 0212/1127] add new years to stateio --- flowsa/methods/flowbyactivitymethods/stateio_Common.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flowsa/methods/flowbyactivitymethods/stateio_Common.yaml b/flowsa/methods/flowbyactivitymethods/stateio_Common.yaml index 9a61c425e..aa7fd8406 100644 --- a/flowsa/methods/flowbyactivitymethods/stateio_Common.yaml +++ b/flowsa/methods/flowbyactivitymethods/stateio_Common.yaml @@ -15,4 +15,7 @@ years: - 2015 - 2016 - 2017 +- 2018 +- 2019 +- 2020 # datatype: 'State_Summary_Make' # Update for each dataset From 7e163ffa17972362e64ee7e9e6beab9fa8a299ba Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 17 Oct 2022 14:08:17 -0400 Subject: [PATCH 0213/1127] update SIT metadata --- flowsa/methods/flowbyactivitymethods/EPA_SIT.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/methods/flowbyactivitymethods/EPA_SIT.yaml b/flowsa/methods/flowbyactivitymethods/EPA_SIT.yaml index 5bb640ece..672a0d5e0 100644 --- a/flowsa/methods/flowbyactivitymethods/EPA_SIT.yaml +++ b/flowsa/methods/flowbyactivitymethods/EPA_SIT.yaml @@ -1,5 +1,6 @@ author: US Environmental Protection Agency source_name: State Inventory Tool +# Aligns with March 2022 version of tool source_url: 'https://www.epa.gov/statelocalenergy/state-inventory-and-projection-tool' bib_id: EPA_SIT format: xlsm # macro-enabled spreadsheet From 3717dacb5276d7a049d17bdb8626e765665ebcf6 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 17 Oct 2022 16:49:34 -0400 Subject: [PATCH 0214/1127] Fixed Canadian exchange rate function to return np.nan if given an invalid year, and simplified it to take an integer year and return a float. --- flowsa/dataclean.py | 2 +- flowsa/flowby.py | 5 +++-- flowsa/literature_values.py | 42 ++++++++++++++++++------------------- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/flowsa/dataclean.py b/flowsa/dataclean.py index 8a07161b6..e4205627e 100644 --- a/flowsa/dataclean.py +++ b/flowsa/dataclean.py @@ -131,7 +131,7 @@ def standardize_units(df): # class = money, unit = USD if df['Unit'].str.contains('Canadian Dollar').any(): exchange_rate = float(get_Canadian_to_USD_exchange_rate( - str(df['Year'].unique()[0]))) + df['Year'].unique()[0])) df.loc[:, 'FlowAmount'] = np.where(df['Unit'] == 'Canadian Dollar', df['FlowAmount'] / exchange_rate, df['FlowAmount']) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 9346b8c8f..a7438b0e7 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -232,10 +232,11 @@ def _getFlowBy( return fb def standardize_units(self: FB) -> FB: - exchange_rate = float( + exchange_rate = ( literature_values - .get_Canadian_to_USD_exchange_rate(str(self.config['year'])) + .get_Canadian_to_USD_exchange_rate(self.config['year']) ) + conversion_table = pd.concat([ pd.read_csv(f'{settings.datapath}unit_conversion.csv'), pd.Series({'old_unit': 'Canadian Dollar', diff --git a/flowsa/literature_values.py b/flowsa/literature_values.py index d6a571c2c..77f10ac84 100644 --- a/flowsa/literature_values.py +++ b/flowsa/literature_values.py @@ -55,29 +55,29 @@ def get_Canadian_to_USD_exchange_rate(year): :param year: str, year of exchange rate to return :return: number, value of exchange rate for year """ - er = ({'2000': '1.4855', - '2001': '1.5487', - '2002': '1.5704', - '2003': '1.4008', - '2004': '1.3017', - '2005': '1.2115', - '2006': '1.134', - '2007': '1.0734', - '2008': '1.066', - '2009': '1.1412', - '2010': '1.0298', - '2011': '0.9887', - '2012': '0.9995', - '2013': '1.03', - '2014': '1.1043', - '2015': '1.2791', - '2016': '1.3243', - '2017': '1.2984', - '2018': '1.2957', - '2019': '1.3269' + er = ({2000: 1.4855, + 2001: 1.5487, + 2002: 1.5704, + 2003: 1.4008, + 2004: 1.3017, + 2005: 1.2115, + 2006: 1.134, + 2007: 1.0734, + 2008: 1.066, + 2009: 1.1412, + 2010: 1.0298, + 2011: 0.9887, + 2012: 0.9995, + 2013: 1.03, + 2014: 1.1043, + 2015: 1.2791, + 2016: 1.3243, + 2017: 1.2984, + 2018: 1.2957, + 2019: 1.3269 }) - exchange_rate = er.get(year) + exchange_rate = er.get(year, np.nan) return exchange_rate From 662080ebe8717684407abfa160be81168eb04cf7 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 17 Oct 2022 16:51:39 -0400 Subject: [PATCH 0215/1127] Added a check of the data folder for !include: tags, so that yaml files in that folder can be referenced. --- flowsa/flowsa_yaml.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flowsa/flowsa_yaml.py b/flowsa/flowsa_yaml.py index cca4779cb..90bb0ca60 100644 --- a/flowsa/flowsa_yaml.py +++ b/flowsa/flowsa_yaml.py @@ -27,7 +27,8 @@ def include(loader: 'FlowsaLoader', suffix: str, node: yaml.Node) -> dict: for folder in [ *loader.external_paths_to_search, flowsa.settings.sourceconfigpath, - flowsa.settings.flowbysectormethodpath + flowsa.settings.flowbysectormethodpath, + flowsa.settings.datapath ]: if path.exists(path.join(folder, file)): file = path.join(folder, file) From d642cbb487bc72672506405e8f116dc22419755b Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 17 Oct 2022 16:52:16 -0400 Subject: [PATCH 0216/1127] Renamed file and added EPA emissions factors for marine fuel burning --- flowsa/data/BTS_Airlines_emissions_factors.csv | 3 --- flowsa/data/EPA_emissions_factors.csv | 6 ++++++ 2 files changed, 6 insertions(+), 3 deletions(-) delete mode 100644 flowsa/data/BTS_Airlines_emissions_factors.csv create mode 100644 flowsa/data/EPA_emissions_factors.csv diff --git a/flowsa/data/BTS_Airlines_emissions_factors.csv b/flowsa/data/BTS_Airlines_emissions_factors.csv deleted file mode 100644 index 9de75c529..000000000 --- a/flowsa/data/BTS_Airlines_emissions_factors.csv +++ /dev/null @@ -1,3 +0,0 @@ -Unit,ActivityConsumedBy,pollutant,target_unit,emissions_factor,source -gal,Commercial Aircraft,CO2,MT CO2e,0.00975,Federal Register EPA; 40 CFR Part 98; e-CFR (see link below). Table C-1 (as amended at 81 FR 89252 Dec. 9 2016). https://www.ecfr.gov/cgi-bin/text-idx?SID=ae265d7d6f98ec86fcd8640b9793a3f6&mc=true&node=pt40.23.98&rgn=div5#ap40.23.98_19.1 -gal,Commercial Aircraft,N2O,MT CO2e,0.0000894,EPA (2021) Inventory of U.S. Greenhouse Gas Emissions and Sinks: 1990-2019 (Annexes). All values are calculated from Tables A-97 through A-98; also Intergovernmental Panel on Climate Change (IPCC) Fourth Assessment Report (AR4) 2007 diff --git a/flowsa/data/EPA_emissions_factors.csv b/flowsa/data/EPA_emissions_factors.csv new file mode 100644 index 000000000..521b6a362 --- /dev/null +++ b/flowsa/data/EPA_emissions_factors.csv @@ -0,0 +1,6 @@ +FlowName,ActivityConsumedBy,Unit,pollutant,target_unit,emissions_factor,source +Total Gallons Consumed,Commercial Aircraft,gal,CO2,MT CO2e,0.00975,Federal Register EPA; 40 CFR Part 98; e-CFR (see link below). Table C-1 (as amended at 81 FR 89252 Dec. 9 2016). https://www.ecfr.gov/cgi-bin/text-idx?SID=ae265d7d6f98ec86fcd8640b9793a3f6&mc=true&node=pt40.23.98&rgn=div5#ap40.23.98_19.1 +Total Gallons Consumed,Commercial Aircraft,gal,N2O,MT CO2e,0.0000894,EPA (2021) Inventory of U.S. Greenhouse Gas Emissions and Sinks: 1990-2019 (Annexes). All values are calculated from Tables A-97 through A-98; also Intergovernmental Panel on Climate Change (IPCC) Fourth Assessment Report (AR4) 2007 +Bunker Fuel,Marine Shipping,tonne fuel oil,CO2,MT CO2e,3.224,Federal Register EPA; 40 CFR Part 98; e-CFR (see link below). Table C-1 (as amended at 81 FR 89252 Dec. 9 2016). https://www.ecfr.gov/cgi-bin/text-idx?SID=ae265d7d6f98ec86fcd8640b9793a3f6&mc=true&node=pt40.23.98&rgn=div5#ap40.23.98_19.1 +Bunker Fuel,Marine Shipping,tonne fuel oil,N2O,MT CO2e,0.0272,EPA (2021) Inventory of U.S. Greenhouse Gas Emissions and Sinks: 1990-2019 (Annexes). All values are calculated from Tables A-97 through A-98; also Intergovernmental Panel on Climate Change (IPCC) Fourth Assessment Report (AR4) 2007 +Bunker Fuel,Marine Shipping,tonne fuel oil,CH4,MT CO2e,0.00793,EPA (2021) Inventory of U.S. Greenhouse Gas Emissions and Sinks: 1990-2019 (Annexes). All values are calculated from Tables A-97 through A-98; also Intergovernmental Panel on Climate Change (IPCC) Fourth Assessment Report (AR4) 2007 From 666c1842278081224d2767caffc9f54534fa04d7 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 17 Oct 2022 16:52:58 -0400 Subject: [PATCH 0217/1127] Added external_data.yaml to .gitignore, so paths can be stored there. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0b1addeb6..34e289c2b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .idea venv .venv +external_data.yaml *.env *__pycache__ *.egg* From 0488a029d4760155fa4c739ef9e00efffa22b022 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 17 Oct 2022 16:54:42 -0400 Subject: [PATCH 0218/1127] Commented out the Suppressed column so it won't get added to every FBA automatically. Will have to think about whether this entry is needed at all. If it is, I'll have to figure out a way to make it not get added automatically. --- flowsa/data/flowby_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/data/flowby_config.yaml b/flowsa/data/flowby_config.yaml index 465e97cd6..5836f799d 100644 --- a/flowsa/data/flowby_config.yaml +++ b/flowsa/data/flowby_config.yaml @@ -7,7 +7,7 @@ _fba_base_fields: &fba_base_fields Description: object DistributionType: object FlowAmount: float - Suppressed: object + # Suppressed: object FlowType: object Location: object LocationSystem: object From 1df60621b2a5571d7cf2295437fa9be5090edc76 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 17 Oct 2022 17:00:52 -0400 Subject: [PATCH 0219/1127] Incorporated rename of emissions factor file --- flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml index f39194f52..5ed04f5d6 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml @@ -999,5 +999,5 @@ source_names: year: null selection_fields: Year: *year - emissions_factors: BTS_Airlines_emissions_factors + emissions_factors: EPA_emissions_factors activity_to_sector_mapping: EPA_GHGI From 82511cd8a30571a0dee65ec9881d247ffa0d33e5 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 17 Oct 2022 17:05:01 -0400 Subject: [PATCH 0220/1127] Enabled loading FlowBy parquets from external data paths (including) specified in the config --- flowsa/flowby.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index a7438b0e7..7ec03857e 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -3,6 +3,7 @@ from pandas import ExcelWriter import numpy as np from functools import partial, reduce +from copy import deepcopy from . import (common, settings, metadata, sectormapping, literature_values, flowbyactivity, flowbysector, flowsa_yaml, validation, geo, naics, exceptions) @@ -35,11 +36,14 @@ def get_flowby_from_config( external_config_path: str = None, download_sources_ok: bool = True ) -> FB: + external_data_path = config.get('external_data_path') + if config['data_format'] == 'FBA': return FlowByActivity.getFlowByActivity( full_name=name, config=config, - download_ok=download_sources_ok + download_ok=download_sources_ok, + external_data_path=external_data_path ) elif config['data_format'] == 'FBS': return FlowBySector.getFlowBySector( @@ -48,7 +52,8 @@ def get_flowby_from_config( config=config, external_config_path=external_config_path, download_sources_ok=download_sources_ok, - download_fbs_ok=download_sources_ok + download_fbs_ok=download_sources_ok, + external_data_path=external_data_path ) elif config['data_format'] == 'FBS_outside_flowsa': return FlowBySector( @@ -191,7 +196,11 @@ def _getFlowBy( *, full_name: str = None, config: dict = None, + external_data_path: str = None ) -> '_FlowBy': + paths = deepcopy(settings.paths) + paths.local_path = external_data_path or paths.local_path + for attempt in ['import local', 'download', 'generate']: log.info( 'Attempting to %s %s %s', @@ -200,20 +209,20 @@ def _getFlowBy( if attempt == 'download' and download_ok: esupy.processed_data_mgmt.download_from_remote( file_metadata, - settings.paths + paths ) if attempt == 'generate': flowby_generator() df = esupy.processed_data_mgmt.load_preprocessed_output( file_metadata, - settings.paths + paths ) if df is None: log.info( '%s %s not found in %s', file_metadata.name_data, file_metadata.category, - output_path + paths.local_path ) else: log.info( @@ -690,7 +699,8 @@ def getFlowByActivity( flowby_generator=flowby_generator, output_path=settings.fbaoutputpath, full_name=full_name, - config=config + config=config, + **kwargs ) # TODO: probably only slight modification is needed to allow for material From 8ea83be09e1953d359055f0d30ba013b802e80cb Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 17 Oct 2022 17:07:04 -0400 Subject: [PATCH 0221/1127] Added BEA_Marine_Bunker_Fuel to source_catalog and crosswalk --- .../NAICS_Crosswalk_EPA_GHGI_SEEA.csv | 1 + flowsa/data/source_catalog.yaml | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv index 922a2bae2..4c3b39d2e 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv @@ -172,3 +172,4 @@ EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_14, EP EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Landfills,NAICS_2012_Code,ACC,,,"EPA_GHGI_T_2_1" +EPA_GHGI,Marine Shipping,NAICS_2012_Code,4831,,,"BEA_Bunker_Fuel" diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 2e3a00ef1..68675471b 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -42,6 +42,12 @@ BEA_Make_Detail_BeforeRedef: sector-like_activities: False #update to true once alternate activity_schema in place # activity_schema: BEA_2012_Detail_Code sector_aggregation_level: "disaggregated" +BEA_Marine_Bunker_Fuel: + data_format: FBA + class: + - Energy + sector-like_activities: False + sector_aggregation_level: "aggregated" BLS_QCEW: data_format: FBA class: From cc40d01f3faf30c9f9ebb0fa8e4950c48c165a79 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 18 Oct 2022 09:38:30 -0400 Subject: [PATCH 0222/1127] line up use of anchor with lines below --- flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml b/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml index 3e8724619..51aaedb62 100644 --- a/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml @@ -575,7 +575,7 @@ source_names: FlowName: Natural Gas EPA_GHGI_T_3_9: - <<: *stationary_combustion # N2O emissions from stationary combustion + <<: *stationary_combustion # N2O emissions from stationary combustion fedefl_mapping: GHGI clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion activity_sets: From ff308e69ffcf95d5eeb24ea5b08b30e37b49122c Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 18 Oct 2022 11:46:31 -0400 Subject: [PATCH 0223/1127] use employment FBS at same year of MECS --- flowsa/data_source_scripts/EIA_MECS.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/flowsa/data_source_scripts/EIA_MECS.py b/flowsa/data_source_scripts/EIA_MECS.py index 1a496251a..5741b1915 100644 --- a/flowsa/data_source_scripts/EIA_MECS.py +++ b/flowsa/data_source_scripts/EIA_MECS.py @@ -502,8 +502,9 @@ def update_regions_to_states(fba_load, attr, **_): if len(x) < 5 else x)) # Allocate MECS based on employment FBS - year = 2017 #TODO update when more FBS available - hlp = flowsa.getFlowBySector(methodname=f'Employment_state_{year}') + year = attr.get('allocation_source_year') + hlp = flowsa.getFlowBySector(methodname=f'Employment_state_{year}', + download_FBS_if_missing=True) # To match the various sector resolution of MECS, generate employment # dataset for all NAICS resolution by aggregating @@ -521,6 +522,7 @@ def update_regions_to_states(fba_load, attr, **_): how='left', on=['Region','SectorConsumedBy']) fba['FlowAmount'] = fba['FlowAmount'] * fba['Allocation'] fba = fba.drop(columns=['Allocation','Region']) + fba['LocationSystem'] = 'FIPS_2015' # Check for data loss if (abs(1-(sum(fba['FlowAmount']) / From 0e5e08bbb53a39e5017cd2538a5d2dfacb406f9f Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 18 Oct 2022 16:11:13 -0400 Subject: [PATCH 0224/1127] add table 3-104 to GHGI --- flowsa/data_source_scripts/EPA_GHGI.py | 2 +- flowsa/methods/flowbyactivitymethods/EPA_GHGI.yaml | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/flowsa/data_source_scripts/EPA_GHGI.py b/flowsa/data_source_scripts/EPA_GHGI.py index c173619ce..bb43ab50a 100644 --- a/flowsa/data_source_scripts/EPA_GHGI.py +++ b/flowsa/data_source_scripts/EPA_GHGI.py @@ -419,7 +419,7 @@ def ghg_parse(*, df_list, year, config, **_): df = assign_fips_location_system(df, str(year)) # modified_activity_list = ["ES-5"] - multi_chem_names = ["2-1", "4-46", "5-7", "5-29", "ES-5"] + multi_chem_names = ["2-1", "3-104", "4-46", "5-7", "5-29", "ES-5"] source_No_activity = ["3-22", "3-22b"] # Handle tables with 1 parent level category source_activity_1 = ["3-7", "3-8", "3-9", "3-10", "3-14", "3-15", diff --git a/flowsa/methods/flowbyactivitymethods/EPA_GHGI.yaml b/flowsa/methods/flowbyactivitymethods/EPA_GHGI.yaml index 9c3070daa..f6c43892f 100644 --- a/flowsa/methods/flowbyactivitymethods/EPA_GHGI.yaml +++ b/flowsa/methods/flowbyactivitymethods/EPA_GHGI.yaml @@ -129,6 +129,13 @@ Tables: "flow": "N2O" "desc": "Table 3-67: N2O Emissions from Natural Gas Systems (Metric Tons CO2 Eq.)" +# International Bunker Fuels + "3-104": + "class": "Chemicals" + "unit": "MMT CO2e" + "compartment": "air" + "desc": "Table 3-104: CO2, CH4, and N2O Emissions from International Bunker Fuels (MMT CO2 Eq.)" + "Ch 4 - Industrial Processes": "4-14": # Emissions captured in 2-1 "class": "Chemicals" From 28bf4eaa2fba3aa4072657b3f8f8e1345b90508e Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 19 Oct 2022 10:52:50 -0400 Subject: [PATCH 0225/1127] Removed unnecessary disgnostic print function --- flowsa/data_source_scripts/temp_data_source_functions.py | 1 - 1 file changed, 1 deletion(-) diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index 024a8355b..6b1aed70c 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -212,7 +212,6 @@ def estimate_suppressed_mecs_energy( industry without its own line item in the MECS anyway. '*' is for value less than 0.5 Trillion Btu and will be assumed to be 0.25 Trillion Btu ''' - print(fba.Suppressed.value_counts()) dropped = fba.query('Suppressed not in ["D", "Q"]') unsuppressed = dropped.assign( FlowAmount=dropped.FlowAmount.mask(dropped.Suppressed == '*', 0.25) From 3e88b3f11d4a16508e4d0be401f45f6b126f8dbe Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 19 Oct 2022 10:56:22 -0400 Subject: [PATCH 0226/1127] Added necessary files to create FBA for GHGI table 3-104 using 2020 (2022) GHGI version since the csv for the 2019 (2021) version has an error. Can be removed once we update to the 2020 (2022) GHGI. --- flowsa/data_source_scripts/GHGI2020.py | 850 ++++++++++++++++++ .../flowbyactivitymethods/GHGI2020_3_104.yaml | 41 + 2 files changed, 891 insertions(+) create mode 100644 flowsa/data_source_scripts/GHGI2020.py create mode 100644 flowsa/methods/flowbyactivitymethods/GHGI2020_3_104.yaml diff --git a/flowsa/data_source_scripts/GHGI2020.py b/flowsa/data_source_scripts/GHGI2020.py new file mode 100644 index 000000000..f9ef28a95 --- /dev/null +++ b/flowsa/data_source_scripts/GHGI2020.py @@ -0,0 +1,850 @@ +# EPA_GHGI.py (flowsa) +# !/usr/bin/env python3 +# coding=utf-8 +""" +Inventory of US EPA GHG +https://www.epa.gov/ghgemissions/inventory-us-greenhouse-gas-emissions-and-sinks +""" + +import io +import zipfile +import numpy as np +import pandas as pd +from flowsa.flowbyfunctions import assign_fips_location_system, \ + load_fba_w_standardized_units +from flowsa.dataclean import replace_NoneType_with_empty_cells +from flowsa.settings import log, externaldatapath +from flowsa.schema import flow_by_activity_fields +from flowsa.common import load_yaml_dict +from flowsa.data_source_scripts import EIA_MECS + + +SECTOR_DICT = {'Res.': 'Residential', + 'Comm.': 'Commercial', + 'Ind.': 'Industrial', + 'Trans.': 'Transportation', + 'Elec.': 'Electricity Power', + 'Terr.': 'U.S. Territory'} + +ANNEX_HEADERS = {"Total Consumption (TBtu) a": "Total Consumption (TBtu)", + "Adjustments (TBtu) b": "Adjustments (TBtu)", + "Adjusted Consumption (TBtu) a": "Adjusted Consumption (TBtu)", + "Emissions b (MMT CO2 Eq.) from Energy Use": + "Emissions (MMT CO2 Eq.) from Energy Use" + } + +# Tables for annual CO2 emissions from fossil fuel combustion +ANNEX_ENERGY_TABLES = ["A-10", "A-11", "A-12", "A-13", "A-14", "A-15", "A-16", + "A-17", "A-18", "A-19", "A-20"] + +SPECIAL_FORMAT = ["3-10", "3-22", "3-22b", "4-46", "5-29", + "A-93", "A-94", "A-118", ] + + +DROP_COLS = ["Unnamed: 0"] + list(pd.date_range( + start="1990", end="2010", freq='Y').year.astype(str)) + +YEARS = list(pd.date_range(start="2010", end="2020", freq='Y').year.astype(str)) + + +def ghg_url_helper(*, build_url, config, **_): + """ + This helper function uses the "build_url" input from flowbyactivity.py, + which is a base url for data imports that requires parts of the url text + string to be replaced with info specific to the data year. This function + does not parse the data, only modifies the urls from which data is + obtained. + :param build_url: string, base url + :param config: dictionary, items in FBA method yaml + :return: list, urls to call, concat, parse, format into Flow-By-Activity + format + """ + annex_url = config['url']['annex_url'] + return [build_url] + + +def cell_get_name(value, default_flow_name): + """ + Given a single string value (cell), separate the name and units. + :param value: str + :param default_flow_name: indicate return flow name string subset + :return: flow name for row + """ + if '(' not in value: + return default_flow_name.replace('__type__', value.strip()) + + spl = value.split(' ') + name = '' + found_units = False + for sub in spl: + if '(' not in sub and not found_units: + name = f'{name.strip()} {sub}' + else: + found_units = True + return name.strip() + + +def cell_get_units(value, default_units): + """ + Given a single string value (cell), separate the name and units. + :param value: str + :param default_units: indicate return units string subset + :return: unit for row + """ + if '(' not in value: + return default_units + + spl = value.split(' ') + name = '' + found_units = False + for sub in spl: + if ')' in sub: + found_units = False + if '(' in sub or found_units: + name = f'{name} {sub.replace("(", "").replace(")", "")} ' + found_units = True + return name.strip() + + +def series_separate_name_and_units(series, default_flow_name, default_units): + """ + Given a series (such as a df column), split the contents' strings into a name and units. + An example might be converting "Carbon Stored (MMT C)" into ["Carbon Stored", "MMT C"]. + + :param series: df column + :param default_flow_name: df column for flow name to be modified + :param default_units: df column for units to be modified + :return: str, flowname and units for each row in df + """ + names = series.apply(lambda x: cell_get_name(x, default_flow_name)) + units = series.apply(lambda x: cell_get_units(x, default_units)) + return {'names': names, 'units': units} + + +def annex_yearly_tables(data, table=None): + """Special handling of ANNEX Energy Tables""" + df = pd.read_csv(data, skiprows=1, encoding="ISO-8859-1", + header=[0, 1], thousands=",") + if table == "A-10": + # Extra row to drop in this table + df = df.drop([0]) + header_name = "" + newcols = [] # empty list to have new column names + for i in range(len(df.columns)): + fuel_type = str(df.iloc[0, i]) + for abbrev, full_name in SECTOR_DICT.items(): + fuel_type = fuel_type.replace(abbrev, full_name) + fuel_type = fuel_type.strip() + + col_name = df.columns[i][1] + if "Unnamed" in col_name: + column_name = header_name + elif col_name in ANNEX_HEADERS.keys(): + column_name = ANNEX_HEADERS[col_name] + header_name = ANNEX_HEADERS[col_name] + + newcols.append(f"{column_name} - {fuel_type}") + df.columns = newcols # assign column names + df = df.iloc[1:, :] # exclude first row + df.dropna(how='all', inplace=True) + df = df.reset_index(drop=True) + return df + + +def ghg_call(*, resp, url, year, config, **_): + """ + Convert response for calling url to pandas dataframe, begin parsing df + into FBA format + :param resp: df, response from url call + :param url: string, url + :param year: year + :param config: dictionary, items in FBA method yaml + :return: pandas dataframe of original source data + """ + df = None + with zipfile.ZipFile(io.BytesIO(resp.content), "r") as f: + frames = [] + if 'Annex' in url: + is_annex = True + t_tables = config['Annex'] + else: + is_annex = False + t_tables = config['Tables'] + for chapter, tables in t_tables.items(): + for table in tables: + tbl_year = tables[table].get('year') + if tbl_year is not None and tbl_year != year: + # Skip tables when the year does not align with target year + continue + + if is_annex: + path = f"Annex/{chapter}/Table {table}.csv" + else: + path = f"Chapter Tables/{chapter}/Table {table}.csv" + + # Handle special case of table 3-22 in external data folder + if table == "3-22b": + if str(year) == '2019': + # Skip 3-22b for year 2019 (use 3-22 instead) + continue + else: + df = pd.read_csv(f"{externaldatapath}/GHGI_Table_{table}.csv", + skiprows=2, encoding="ISO-8859-1", thousands=",") + else: + data = f.open(path) + + if table not in SPECIAL_FORMAT + ANNEX_ENERGY_TABLES: + # Default case + df = pd.read_csv(data, skiprows=2, encoding="ISO-8859-1", + thousands=",") + elif table in ['3-10', '4-46', '5-29', + 'A-93', 'A-94', 'A-118']: + # Skip single row + df = pd.read_csv(data, skiprows=1, encoding="ISO-8859-1", + thousands=",", decimal=".") + elif table == "3-22": + # Skip first two rows, as usual, but make headers the next 3 rows: + df = pd.read_csv(data, skiprows=2, encoding="ISO-8859-1", + header=[0, 1, 2], thousands=",") + # The next two rows are headers and the third is units: + new_headers = [] + for col in df.columns: + # unit = col[2] + new_header = 'Unnamed: 0' + if 'Unnamed' not in col[0]: + if 'Unnamed' not in col[1]: + new_header = f'{col[0]} {col[1]}' + else: + new_header = col[0] + if 'Unnamed' not in col[2]: + new_header += f' {col[2]}' + # unit = col[2] + elif 'Unnamed' in col[0] and 'Unnamed' not in col[2]: + new_header = col[2] + new_headers.append(new_header) + df.columns = new_headers + elif table in ANNEX_ENERGY_TABLES: + df = annex_yearly_tables(data, table) + + if df is not None and len(df.columns) > 1: + years = YEARS.copy() + years.remove(str(year)) + df = df.drop(columns=(DROP_COLS + years), errors='ignore') + df["SourceName"] = f"GHGI2020_{table.replace('-', '_')}" + frames.append(df) + else: + log.warning(f"Error in generating {table}") + return frames + + +def get_unnamed_cols(df): + """ + Get a list of all unnamed columns, used to drop them. + :param df: df being formatted + :return: list, unnamed columns + """ + return [col for col in df.columns if "Unnamed" in col] + + +def get_table_meta(source_name, config): + """Find and return table meta from source_name.""" + if "_A_" in source_name: + td = config['Annex'] + else: + td = config['Tables'] + for chapter in td.keys(): + for k, v in td[chapter].items(): + if source_name.endswith(k.replace("-", "_")): + return v + +def is_consumption(source_name, config): + """ + Determine whether the given source contains consumption or production data. + :param source_name: df + :return: True or False + """ + if 'consum' in get_table_meta(source_name, config)['desc'].lower(): + return True + return False + +def strip_char(text): + """ + Removes the footnote chars from the text + """ + text = text + " " + notes = [" a ", " b ", " c ", " d ", " e ", " f ", " g ", + " h ", " i ", " j ", " k ", " b,c ", " h,i ", " f,g "] + for i in notes: + if i in text: + text_split = text.split(i) + text = text_split[0] + return text.strip() + + +def ghg_parse(*, df_list, year, config, **_): + """ + Combine, parse, and format the provided dataframes + :param df_list: list of dataframes to concat and format + :param year: year + :param config: dictionary, items in FBA method yaml + :return: df, parsed and partially formatted to flowbyactivity + specifications + """ + cleaned_list = [] + for df in df_list: + source_name = df["SourceName"][0] + table_name = source_name.replace("GHGI2020_", "").replace('_', '-') + log.info(f'Processing {source_name}') + + # Specify to ignore errors in case one of the drop_cols is missing. + df = df.drop(columns=get_unnamed_cols(df), errors='ignore') + is_cons = is_consumption(source_name, config) + + # Rename to "ActivityProducedBy" or "ActivityConsumedBy": + if is_cons: + df = df.rename(columns={df.columns[0]: "ActivityConsumedBy"}) + df["ActivityProducedBy"] = 'None' + else: + df = df.rename(columns={df.columns[0]: "ActivityProducedBy"}) + df["ActivityConsumedBy"] = 'None' + + df["FlowType"] = "ELEMENTARY_FLOW" + df["Location"] = "00000" + + id_vars = ["SourceName", "ActivityConsumedBy", "ActivityProducedBy", + "FlowType", "Location"] + + df.set_index(id_vars) + + meta = get_table_meta(source_name, config) + + if table_name in ['3-22']: + df = df.melt(id_vars=id_vars, + var_name=meta.get('melt_var'), + value_name="FlowAmount") + df = df.rename(columns={"ActivityConsumedBy": "ActivityProducedBy", + "ActivityProducedBy": "ActivityConsumedBy"}) + name_unit = series_separate_name_and_units(df['FlowName'], + meta['activity'], + meta['unit']) + df['FlowName'] = name_unit['names'] + df['Unit'] = name_unit['units'] + df['Year'] = year + + elif table_name in ['4-14', '4-33', '4-50', '4-80']: + # When Year is the first column in the table, need to make this correction + df = df.rename(columns={'ActivityProducedBy': 'Year', + 'Year': 'ActivityProducedBy'}) + # Melt on custom defined variable + melt_var = meta.get('melt_var') + if melt_var in id_vars: + id_vars.remove(melt_var) + elif 'ActivityProducedBy' not in df: + df["ActivityProducedBy"] = 'None' + id_vars.append('Year') + df = df.melt(id_vars=id_vars, var_name=melt_var, + value_name="FlowAmount") + + elif table_name in ANNEX_ENERGY_TABLES: + df = df.melt(id_vars=id_vars, var_name="FlowName", + value_name="FlowAmount") + df["Year"] = year + for index, row in df.iterrows(): + col_name = row['FlowName'] + acb = row['ActivityConsumedBy'].strip() + name_split = col_name.split(" (") + source = name_split[1].split('- ')[1] + # Append column name after dash to activity + activity = f"{acb.strip()} {name_split[1].split('- ')[1]}" + + df.loc[index, 'Description'] = meta['desc'] + if name_split[0] == "Emissions": + df.loc[index, 'FlowName'] = meta['emission'] + df.loc[index, 'Unit'] = meta['emission_unit'] + df.loc[index, 'Class'] = meta['emission_class'] + df.loc[index, 'Compartment'] = meta['emission_compartment'] + df.loc[index, 'ActivityProducedBy'] = activity + df.loc[index, 'ActivityConsumedBy'] = "None" + else: # "Consumption" + df.loc[index, 'FlowName'] = acb + df.loc[index, 'FlowType'] = "TECHNOSPHERE_FLOW" + df.loc[index, 'Unit'] = meta['unit'] + df.loc[index, 'Class'] = meta['class'] + df.loc[index, 'ActivityProducedBy'] = "None" + df.loc[index, 'ActivityConsumedBy'] = source + + else: + # Standard years (one or more) as column headers + df = df.melt(id_vars=id_vars, var_name="Year", + value_name="FlowAmount") + + + # Dropping all rows with value "+": represents non-zero value + df["FlowAmount"].replace("\+", np.nan, inplace=True, regex=True) + # Dropping all rows with value "NE" + df["FlowAmount"].replace("NE", np.nan, inplace=True) + # Convert all empty cells to nan cells + df["FlowAmount"].replace("", np.nan, inplace=True) + # Table 3-10 has some NO (Not Occuring) values, dropping these. + df["FlowAmount"].replace("NO", np.nan, inplace=True) + # Table A-118 has some IE values, dropping these. + df["FlowAmount"].replace("IE", np.nan, inplace=True) + df["FlowAmount"].replace(r'NO ', np.nan, inplace=True) + + # Drop any nan rows + df.dropna(subset=['FlowAmount'], inplace=True) + + if table_name not in ANNEX_ENERGY_TABLES: + if 'Unit' not in df: + df.loc[df["SourceName"] == source_name, "Unit"] = meta.get("unit") + if 'FlowName' not in df: + df.loc[df["SourceName"] == source_name, "FlowName"] = meta.get("flow") + + df.loc[df["SourceName"] == source_name, "Class"] = meta.get("class") + df.loc[df["SourceName"] == source_name, "Description"] = meta.get("desc") + df.loc[df["SourceName"] == source_name, "Compartment"] = meta.get("compartment") + + if 'Year' not in df.columns: + df['Year'] = year + else: + df = df[df['Year'].astype(str).isin([year])] + + # Add DQ scores + df["DataReliability"] = 5 # tmp + df["DataCollection"] = 5 # tmp + # Fill in the rest of the Flow by fields so they show "None" instead of nan + df["MeasureofSpread"] = 'None' + df["DistributionType"] = 'None' + df["LocationSystem"] = 'None' + df = assign_fips_location_system(df, str(year)) + + # modified_activity_list = ["ES-5"] + multi_chem_names = ["2-1", "3-104", "4-46", "5-7", "5-29", "ES-5"] + source_No_activity = ["3-22", "3-22b"] + # Handle tables with 1 parent level category + source_activity_1 = ["3-7", "3-8", "3-9", "3-10", "3-14", "3-15", + "5-18", "5-19", "A-76", "A-77"] + # Tables with sub categories + source_activity_2 = ["3-38", "3-63", "A-103"] + + if table_name in multi_chem_names: + bool_apb = False + apbe_value = "" + flow_name_list = ["CO2", "CH4", "N2O", "NF3", "HFCs", "PFCs", + "SF6", "NF3", "CH4 a", "N2O b", "CO", "NOx"] + for index, row in df.iterrows(): + apb_value = row["ActivityProducedBy"] + if "CH4" in apb_value: + apb_value = "CH4" + elif "N2O" in apb_value and apb_value != "N2O from Product Uses": + apb_value = "N2O" + elif "CO2" in apb_value: + apb_value = "CO2" + + if apb_value in flow_name_list: + apbe_value = apb_value + df.loc[index, 'FlowName'] = apbe_value + df.loc[index, 'ActivityProducedBy'] = "All activities" + bool_apb = True + elif apb_value.startswith('LULUCF'): + df.loc[index, 'FlowName'] = 'CO2e' + df.loc[index, 'ActivityProducedBy'] = strip_char(apb_value) + elif apb_value.startswith('Total'): + df = df.drop(index) + else: + apb_txt = df.loc[index, 'ActivityProducedBy'] + apb_txt = strip_char(apb_txt) + df.loc[index, 'ActivityProducedBy'] = apb_txt + if bool_apb == True: + df.loc[index, 'FlowName'] = apbe_value + + elif table_name in source_No_activity: + apbe_value = "" + flow_name_list = ["Industry", "Transportation", "U.S. Territories"] + for index, row in df.iterrows(): + unit = row["Unit"] + if unit.strip() == "MMT CO2": + df.loc[index, 'Unit'] = "MMT CO2e" + if df.loc[index, 'Unit'] != "MMT CO2e": + df = df.drop(index) + else: + df.loc[index, 'FlowName'] = meta.get('flow') + # use .join and split to remove interior spaces + apb_value = " ".join(row["ActivityProducedBy"].split()) + apb_value = apb_value.replace("°", "") + if apb_value in flow_name_list: + # set header + apbe_value = apb_value + df.loc[index, 'ActivityProducedBy' + ] = f"{apbe_value} All activities" + else: + # apply header + apb_txt = strip_char(apb_value) + df.loc[index, 'ActivityProducedBy' + ] = f"{apbe_value} {apb_txt}" + if "Total" == apb_value or "Total " == apb_value: + df = df.drop(index) + + elif table_name in source_activity_1: + apbe_value = "" + activity_subtotal = ["Electric Power", "Industrial", "Commercial", + "Residential", "U.S. Territories", + "Transportation", + "Fuel Type/Vehicle Type", "Diesel On-Road", + "Alternative Fuel On-Road", "Non-Road", + "Gasoline On-Road", "Exploration", + "Production (Total)", "Refining", + "Crude Oil Transportation", + "Cropland", "Grassland"] + for index, row in df.iterrows(): + apb_value = strip_char(row["ActivityProducedBy"]) + if apb_value in activity_subtotal: + # set the header + apbe_value = apb_value + df.loc[index, 'ActivityProducedBy' + ] = f"All activities {apbe_value}" + else: + # apply the header + apb_txt = apb_value + if table_name == "3-10": + # Separate Flows and activities for this table + df.loc[index, 'ActivityProducedBy'] = apbe_value + df.loc[index, 'FlowName'] = apb_txt + else: + df.loc[index, 'ActivityProducedBy' + ] = f"{apb_txt} {apbe_value}" + if apb_value.startswith("Total"): + df = df.drop(index) + + elif table_name in source_activity_2: + bool_apb = False + apbe_value = "" + flow_name_list = ["Explorationb", "Production", "Processing", + "Transmission and Storage", "Distribution", + "Crude Oil Transportation", "Refining", + "Exploration", "Mobile AC", + "Refrigerated Transport", + "Comfort Cooling for Trains and Buses"] + for index, row in df.iterrows(): + apb_value = row["ActivityProducedBy"] + start_activity = row["FlowName"] + if apb_value.strip() in flow_name_list: + apbe_value = apb_value + if apbe_value == "Explorationb": + apbe_value = "Exploration" + df.loc[index, 'FlowName'] = start_activity + df.loc[index, 'ActivityProducedBy'] = apbe_value + bool_apb = True + else: + if bool_apb == True: + df.loc[index, 'FlowName'] = start_activity + apb_txt = df.loc[index, 'ActivityProducedBy'] + apb_txt = strip_char(apb_txt) + if apb_txt == "Gathering and Boostingc": + apb_txt = "Gathering and Boosting" + df.loc[index, 'ActivityProducedBy' + ] = f"{apbe_value} - {apb_txt}" + else: + apb_txt = df.loc[index, 'ActivityProducedBy'] + apb_txt = strip_char(apb_txt) + df.loc[index, 'ActivityProducedBy' + ] = f"{apb_txt} {apbe_value}" + if "Total" == apb_value or "Total " == apb_value: + df = df.drop(index) + + elif table_name == "A-79": + fuel_name = "" + A_79_unit_dict = {'Natural Gas': 'trillion cubic feet', + 'Electricity': 'million kilowatt-hours'} + df.loc[:, 'FlowType'] = 'TECHNOSPHERE_FLOW' + for index, row in df.iterrows(): + if row["ActivityConsumedBy"].startswith(' '): + # indicates subcategory + df.loc[index, 'ActivityConsumedBy'] = strip_char( + df.loc[index, 'ActivityConsumedBy']) + df.loc[index, 'FlowName'] = fuel_name + else: + # fuel header + fuel_name = df.loc[index, 'ActivityConsumedBy'] + fuel_name = strip_char(fuel_name) + df.loc[index, 'ActivityConsumedBy'] = "All activities" + df.loc[index, 'FlowName'] = fuel_name + if fuel_name in A_79_unit_dict.keys(): + df.loc[index, 'Unit'] = A_79_unit_dict[fuel_name] + + else: + if table_name in ["4-48"]: + # Assign activity as flow for technosphere flows + df.loc[:, 'FlowType'] = 'TECHNOSPHERE_FLOW' + df.loc[:, 'FlowName'] = df.loc[:, 'ActivityProducedBy'] + + elif table_name in ["4-84", "4-94", "4-99"]: + # Table with flow names as Rows + df.loc[:, 'FlowName'] = df.loc[:, 'ActivityProducedBy'] + df.loc[:, 'ActivityProducedBy'] = meta.get('activity') + + elif table_name in ["4-33", "4-50", "4-80"]: + # Table with units or flows as columns + df.loc[:, 'ActivityProducedBy'] = meta.get('activity') + df.loc[df['Unit'] == 'MMT CO2 Eq.', 'Unit'] = 'MMT CO2e' + df.loc[df['Unit'].str.contains('kt'), 'Unit'] = 'kt' + + elif table_name in ["4-14", "4-99"]: + # Remove notes from activity names + for index, row in df.iterrows(): + apb_value = strip_char(row["ActivityProducedBy"]) + if "(" in apb_value: + text_split = apb_value.split("(") + df.loc[index, 'ActivityProducedBy'] = text_split[0] + + elif table_name in ["A-101"]: + for index, row in df.iterrows(): + apb_value = strip_char(row["ActivityProducedBy"]) + df.loc[index, 'ActivityProducedBy'] = apb_value + + else: + for index, row in df.iterrows(): + if "CO2" in row['Unit']: + if table_name in ["3-42", "3-67"]: + df.loc[index, 'Unit'] = df.loc[index, 'Unit'] + else: + df.loc[index, 'Unit'] = "MMT CO2e" + + df['ActivityProducedBy'] = df['ActivityProducedBy'].str.strip() + df['ActivityConsumedBy'] = df['ActivityConsumedBy'].str.strip() + print(df.FlowName.unique()) + df['FlowName'] = df['FlowName'].str.strip() + + # Update location for terriory-based activities + df.loc[(df['ActivityProducedBy'].str.contains("U.S. Territor")) | + (df['ActivityConsumedBy'].str.contains("U.S. Territor")), + 'Location'] = "99000" + + df.drop(df.loc[df['ActivityProducedBy'] == "Total"].index, inplace=True) + df.drop(df.loc[df['FlowName'] == "Total"].index, inplace=True) + + df = df.loc[:, ~df.columns.duplicated()] + # Remove commas from numbers again in case any were missed: + df["FlowAmount"].replace(',', '', regex=True, inplace=True) + cleaned_list.append(df) + + return cleaned_list + + +def get_manufacturing_energy_ratios(year): + """Calculate energy ratio by fuel between GHGI and EIA MECS.""" + # flow correspondence between GHGI and MECS + flow_corr = {'Industrial Other Coal': 'Coal', + 'Natural Gas': 'Natural Gas', + } + + def closest_value(input_list, input_value): + difference = lambda input_list : abs(input_list - input_value) + return min(input_list, key=difference) + + mecs_year = closest_value(load_yaml_dict('EIA_MECS_Energy', + flowbytype='FBA').get('years'), + year) + + # Filter MECS for total national energy consumption for manufacturing sectors + mecs = load_fba_w_standardized_units(datasource='EIA_MECS_Energy', + year=mecs_year, + flowclass='Energy') + mecs = mecs.loc[(mecs['ActivityConsumedBy'] == '31-33') & + (mecs['Location'] == '00000')].reset_index(drop=True) + mecs = EIA_MECS.mecs_energy_fba_cleanup(mecs, None) + + # Identify the GHGI table that matches EIA_MECS + for t, v in (load_yaml_dict('EPA_GHGI', 'FBA') + .get('Annex').get('Annex').items()): + if ((v.get('class') == 'Energy') + & ('Energy Consumption Data' in v.get('desc')) + & (v.get('year') == str(mecs_year))): + table = f"EPA_GHGI_T_{t.replace('-', '_')}" + break + else: + log.error('unable to identify corresponding GHGI table') + + ghgi = load_fba_w_standardized_units(datasource=table, + year=mecs_year, + flowclass='Energy') + ghgi = ghgi[ghgi['ActivityConsumedBy']=='Industrial'].reset_index(drop=True) + + pct_dict = {} + for ghgi_flow, mecs_flow in flow_corr.items(): + # Calculate percent energy contribution from MECS based on v + mecs_energy = mecs.loc[mecs['FlowName'] == mecs_flow, 'FlowAmount'].values[0] + ghgi_energy = ghgi.loc[ghgi['FlowName'] == ghgi_flow, 'FlowAmount'].values[0] + pct = np.minimum(mecs_energy / ghgi_energy, 1) + pct_dict[mecs_flow] = pct + + return pct_dict + + +def allocate_industrial_combustion(fba, *_, **__): + """ + Split industrial combustion emissions into two buckets to be further allocated. + + clean_fba_df_fxn. Calculate the percentage of fuel consumption captured in + EIA MECS relative to EPA GHGI. Create new activities to distinguish those + which use EIA MECS as allocation source and those that use alternate source. + """ + year = fba.config.get('year') or __['source_dict']['year'] + pct_dict = get_manufacturing_energy_ratios(year) + + # activities reflect flows in A_14 and 3_8 and 3_9 + activities_to_split = {'Industrial Other Coal Industrial': 'Coal', + 'Natural Gas Industrial': 'Natural Gas', + 'Coal Industrial': 'Coal', + 'Natural gas industrial': 'Natural Gas'} + + for activity, fuel in activities_to_split.items(): + df_subset = fba.loc[fba['ActivityProducedBy'] == activity].reset_index(drop=True) + if len(df_subset) == 0: + continue + df_subset['FlowAmount'] = df_subset['FlowAmount'] * pct_dict[fuel] + df_subset['ActivityProducedBy'] = f"{activity} - Manufacturing" + fba.loc[fba['ActivityProducedBy'] == activity, + 'FlowAmount'] = fba['FlowAmount'] * (1-pct_dict[fuel]) + fba = pd.concat([fba, df_subset], ignore_index=True) + + return fba + + +def split_HFCs_by_type(fba, **_): + """Speciates HFCs and PFCs for all activities based on T_4_99. + clean_fba_before_mapping_df_fxn""" + splits = load_fba_w_standardized_units(datasource='EPA_GHGI_T_4_99', + year=fba['Year'][0]) + splits['pct'] = splits['FlowAmount'] / splits['FlowAmount'].sum() + splits = splits[['FlowName', 'pct']] + + speciated_df = fba.apply(lambda x: [p * x['FlowAmount'] for p in splits['pct']], + axis=1, result_type='expand') + speciated_df.columns = splits['FlowName'] + speciated_df = pd.concat([fba, speciated_df], axis=1) + speciated_df = speciated_df.melt(id_vars=flow_by_activity_fields.keys(), + var_name='Flow') + speciated_df['FlowName'] = speciated_df['Flow'] + speciated_df['FlowAmount'] = speciated_df['value'] + speciated_df.drop(columns=['Flow', 'value'], inplace=True) + + return speciated_df + + +def subtract_HFC_transport_emissions(df): + """Remove the portion of transportation emissions which are sourced elsewhere.""" + transport_df = load_fba_w_standardized_units(datasource='EPA_GHGI_T_A_103', + year=df['Year'][0]) + activity_list = ['Mobile AC', 'Comfort Cooling for Trains and Buses', + 'Refrigerated Transport'] # Total of all sub categories + transport_df = transport_df[transport_df['ActivityProducedBy'].isin(activity_list)] + df.loc[df['ActivityProducedBy'] == 'Refrigeration/Air Conditioning', + 'FlowAmount'] = df['FlowAmount'] - transport_df['FlowAmount'].sum() + return df + + +def allocate_HFC_to_residential(df): + """Split HFC emissions into two buckets to be further allocated. + + Calculate the portion of Refrigerants applied to households based on production of + household: 335222 + industry: 333415 + """ + make_df = load_fba_w_standardized_units(datasource='BEA_Make_Detail_BeforeRedef', + year=2012) + household = make_df[(make_df['ActivityProducedBy'] == '335222') & + (make_df['ActivityConsumedBy'] == '335222') + ].reset_index()['FlowAmount'][0] + industry = make_df[(make_df['ActivityProducedBy'] == '333415') & + (make_df['ActivityConsumedBy'] == '333415') + ].reset_index()['FlowAmount'][0] + + activity = 'Refrigeration/Air Conditioning' + df_subset = df.loc[df['ActivityProducedBy'] == activity].reset_index(drop=True) + df_subset['FlowAmount'] = df_subset[ + 'FlowAmount'] * (household / (industry + household)) + df_subset['ActivityProducedBy'] = f"{activity} - Households" + df.loc[df['ActivityProducedBy'] == activity, + 'FlowAmount'] = df['FlowAmount'] * (industry / (industry + household)) + df = pd.concat([df, df_subset], ignore_index=True) + + return df + + +def split_HFC_foams(df): + """Split HFC emissions from foams into two buckets to be allocated separately. + + Calculate the portion for + Polystyrene: 326140 + Urethane: 326150 + """ + make_df = load_fba_w_standardized_units(datasource='BEA_Make_Detail_BeforeRedef', + year=2012) + polystyrene = make_df[(make_df['ActivityProducedBy'] == '326140') & + (make_df['ActivityConsumedBy'] == '326140') + ].reset_index()['FlowAmount'][0] + urethane = make_df[(make_df['ActivityProducedBy'] == '326150') & + (make_df['ActivityConsumedBy'] == '326150') + ].reset_index()['FlowAmount'][0] + + activity = 'Foams' + df_subset = df.loc[df['ActivityProducedBy'] == activity].reset_index(drop=True) + df_subset['FlowAmount'] = df_subset[ + 'FlowAmount'] * (polystyrene / (urethane + polystyrene)) + df_subset['ActivityProducedBy'] = f"{activity} - Polystyrene" + df.loc[df['ActivityProducedBy'] == activity, 'FlowAmount'] = df[ + 'FlowAmount'] * (urethane / (urethane + polystyrene)) + df.loc[df['ActivityProducedBy'] == activity, + 'ActivityProducedBy'] = f"{activity} - Urethane" + df = pd.concat([df, df_subset], ignore_index=True) + + return df + + +def clean_HFC_fba(fba, **_): + """Adjust HFC emissions for improved parsing. + clean_fba_before_mapping_df_fxn used in EPA_GHGI_T_4_101.""" + df = subtract_HFC_transport_emissions(fba) + df = allocate_HFC_to_residential(df) + df = split_HFC_foams(df) + df = split_HFCs_by_type(df) + return df + + +def remove_HFC_kt(fba, **_): + """Remove records of emissions in kt, data are also provided in MMT CO2e. + clean_fba_before_mapping_df_fxn used in EPA_GHGI_T_4_50.""" + return fba.loc[fba['Unit'] != 'kt'] + + +def adjust_transport_activities(df, **_): + """Update activity names for improved transportatin parsing. + clean_allocation_fba used in EPA_GHGI_T_A_14""" + activities = {'Gasoline': ['Light-Duty Trucks', + 'Passenger Cars'], + 'Distillate Fuel Oil (Diesel Fuel)': + ['Medium- and Heavy-Duty Trucks', + 'Buses'], + } + for k, v in activities.items(): + df.loc[(df['ActivityConsumedBy'].isin(v)) & + (df['FlowName'] == k), + 'ActivityConsumedBy'] = df['ActivityConsumedBy'] + f" - {k}" + return df + + +def keep_six_digit_naics(df_w_sec, **_): + """Keep only activities at the 6-digit NAICS level + clean_allocation_fba_w_sec used for EPA_GHGI_T_A_79""" + df_w_sec = replace_NoneType_with_empty_cells(df_w_sec) + df_w_sec = df_w_sec.loc[ + (df_w_sec['SectorProducedBy'].apply(lambda x: len(x) == 6)) | + (df_w_sec['SectorConsumedBy'].apply(lambda x: len(x) == 6))] + return df_w_sec + +if __name__ == "__main__": + import flowsa + # fba = flowsa.getFlowByActivity('EPA_GHGI_T_4_101', 2016) + # df = clean_HFC_fba(fba) + fba = flowsa.flowbyactivity.main(year=2016, source='EPA_GHGI') diff --git a/flowsa/methods/flowbyactivitymethods/GHGI2020_3_104.yaml b/flowsa/methods/flowbyactivitymethods/GHGI2020_3_104.yaml new file mode 100644 index 000000000..69ae09b6b --- /dev/null +++ b/flowsa/methods/flowbyactivitymethods/GHGI2020_3_104.yaml @@ -0,0 +1,41 @@ +author: US Environmental Protection Agency +source_name: 'Inventory of US Greenhouse Gas Emissions and Sinks: 1990-2020' +source_url: https://www.epa.gov/ghgemissions/inventory-us-greenhouse-gas-emissions-and-sinks-1990-2020 +bib_id: EPA_GHGI +# api_name: EPA_GHGI +# api_key_required: false +format: csv +url: + base_url: https://www.epa.gov/system/files/other-files/2022-05/Main%20Chapter.zip + annex_url: https://www.epa.gov/system/files/other-files/2022-06/Annex.zip +url_replace_fxn: !script_function:GHGI2020 ghg_url_helper +call_response_fxn: !script_function:GHGI2020 ghg_call +parse_response_fxn: !script_function:GHGI2020 ghg_parse +years: +- 2010 +- 2011 +- 2012 +- 2013 +- 2014 +- 2015 +- 2016 +- 2017 +- 2018 +- 2019 + +Tables: + Ch 3 - Energy: + 3-104: + class: Chemicals + unit: MMT CO2e + compartment: air + desc: 'Table 3-104: CO2, CH4, and N2O Emissions from International Bunker Fuels (MMT CO2 Eq.)' + +Annex: + Annex 3: + A-103: + class: Chemicals + unit: MMT CO2e + compartment: air + flow: HFCs + desc: HFC Emissions from Transportation Sources (MMT CO2 Eq.) From b5ffbc0924e584ecf8401ad7834298ad1c611364 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 19 Oct 2022 15:31:38 -0400 Subject: [PATCH 0227/1127] Added marine shipping adjustment FBS method + necessary entries in source_catalog and crosswalk. GHGI2020 can be removed once we officially update the source for GHGI tables. --- .../NAICS_Crosswalk_EPA_GHGI_SEEA.csv | 1 + flowsa/data/source_catalog.yaml | 9 ++++ .../marine_shipping_adjustment.yaml | 47 +++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/marine_shipping_adjustment.yaml diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv index 4c3b39d2e..63692ff33 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv @@ -173,3 +173,4 @@ EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_14, EP EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Landfills,NAICS_2012_Code,ACC,,,"EPA_GHGI_T_2_1" EPA_GHGI,Marine Shipping,NAICS_2012_Code,4831,,,"BEA_Bunker_Fuel" +EPA_GHGI,Marine,NAICS_2012_Code,4831,,,"GHGI2020_3_104" diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 68675471b..b84320cee 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -138,6 +138,15 @@ EPA_GHGI: sector-like_activities: False activity_schema: sector_aggregation_level: "aggregated" +GHGI2020: + data_format: FBA + class: + - Chemicals + - Energy + - Other + sector-like_activities: False + activity_schema: + sector_aggregation_level: "aggregated" EPA_StateGHGI: class: - Chemicals diff --git a/flowsa/methods/flowbysectormethods/marine_shipping_adjustment.yaml b/flowsa/methods/flowbysectormethods/marine_shipping_adjustment.yaml new file mode 100644 index 000000000..0874a38cd --- /dev/null +++ b/flowsa/methods/flowbysectormethods/marine_shipping_adjustment.yaml @@ -0,0 +1,47 @@ +%YAML 1.1 + +--- +# m1 for the GHG national replicates the method used in the National GHG Industry Attribution Model +#(https://doi.org/10.23719/1517571), except that sector attribution is to 6-digit NAICS, +# rather than the BEA 2012 IO schema + +industry_spec: + default: NAICS_6 +year: 2017 +target_naics_year: 2012 +geoscale: national + +sources_to_cache: + BLS_QCEW: + year: 2012 + selection_fields: + Class: Employment + clean_fba_before_mapping: !script_function:temp_data_source_functions estimate_suppressed_qcew + clean_fba: !script_function:temp_data_source_functions clean_qcew + +source_names: + BEA_Marine_Bunker_Fuel: + external_data_path: !include:external_data.yaml:BEA_Marine_Bunker_Fuel + year: null + emissions_factors: EPA_emissions_factors + activity_to_sector_mapping: EPA_GHGI_SEEA + attribution_method: proportional + attribution_source: BLS_QCEW + activity_sets: + imports: + selection_fields: + Year: 2017 + Description: Imports + exports: + selection_fields: + Year: 2017 + Description: Exports + adjustment_factor: -1 + + GHGI2020_3_104: + selection_fields: + ActivityProducedBy: Marine + # fedefl_mapping: GHGI + activity_to_sector_mapping: EPA_GHGI_SEEA + attribution_method: proportional + attribution_source: BLS_QCEW From 975c7c3cf45043fc9832991bf37e6114992dc706 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 19 Oct 2022 15:33:33 -0400 Subject: [PATCH 0228/1127] Tweaked import statements. Possibly unnecessary. --- flowsa/flowby.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 7ec03857e..17c49c94f 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -4,10 +4,10 @@ import numpy as np from functools import partial, reduce from copy import deepcopy -from . import (common, settings, metadata, sectormapping, - literature_values, flowbyactivity, flowbysector, flowsa_yaml, - validation, geo, naics, exceptions) -from .flowsa_log import log +from flowsa import (common, settings, metadata, sectormapping, + literature_values, flowbyactivity, flowbysector, flowsa_yaml, + validation, geo, naics, exceptions) +from flowsa.flowsa_log import log import esupy.processed_data_mgmt import esupy.dqi import fedelemflowlist From 6304513b4e7197546937467537b3b04a3c61d0f7 Mon Sep 17 00:00:00 2001 From: Eric Bell Date: Tue, 25 Oct 2022 16:32:26 -0400 Subject: [PATCH 0229/1127] Pull in NY customized state GHG inventory and convert to FBA format. --- flowsa/data_source_scripts/EPA_SIT.py | 2 +- flowsa/data_source_scripts/StateGHGI.py | 100 +++++++++++++++++- .../flowbyactivitymethods/StateGHGI_NY.yaml | 91 ++++++++++++++++ 3 files changed, 191 insertions(+), 2 deletions(-) create mode 100644 flowsa/methods/flowbyactivitymethods/StateGHGI_NY.yaml diff --git a/flowsa/data_source_scripts/EPA_SIT.py b/flowsa/data_source_scripts/EPA_SIT.py index fd14c1e0f..132e5da11 100644 --- a/flowsa/data_source_scripts/EPA_SIT.py +++ b/flowsa/data_source_scripts/EPA_SIT.py @@ -207,7 +207,7 @@ def clean_up_state_data(fba, source_dict, method, **_): # (these data will later be replaced with custom data in the 'StateGHGI' # stage) if ('VT' in state_list) and ('StateGHGI_VT' in method['source_names'].keys()): - from flowsa.StateGHGI import VT_remove_dupicate_activities + from flowsa.data_source_scripts.StateGHGI import VT_remove_dupicate_activities df_subset = VT_remove_dupicate_activities(df_subset) return df_subset diff --git a/flowsa/data_source_scripts/StateGHGI.py b/flowsa/data_source_scripts/StateGHGI.py index 2abd32bdf..076783578 100644 --- a/flowsa/data_source_scripts/StateGHGI.py +++ b/flowsa/data_source_scripts/StateGHGI.py @@ -8,7 +8,8 @@ import pandas as pd import os from flowsa.settings import externaldatapath, log -from flowsa.flowbyfunctions import assign_fips_location_system +from flowsa.flowbyfunctions import assign_fips_location_system, \ + load_fba_w_standardized_units from flowsa.location import apply_county_FIPS from flowsa.common import load_yaml_dict @@ -132,6 +133,103 @@ def VT_supplementary_parse(*, source, year, config, **_): return df0 +def NY_customized_parse(*, source, year, config, **_): + + filename = config['filename'] + + filepath = f"{data_path}/{filename}" + + if not os.path.exists(filepath): + raise FileNotFoundError(f'{filename} file not found in {filepath}') + log.info(f'Loading data from file {filename}...') + + # read in data from Excel sheet + df = pd.read_csv(filepath) + + # make sure the 'year' column is a string + df['year'] = df['year'].astype(str) + + # drop all years except the desired emissions year + df.drop(df.index[df['year'] != year], inplace = True) + + # drop all data except the conventional accounting method + df.drop(df.index[df['conventional_accounting'] != 'Yes'], inplace = True) + + # add emissions source + df['ActivityProducedBy'] = df['economic_sector'] + ", " + \ + df['sector'] + ", " + \ + df['category'] + ", " + \ + df['sub_category_1'] + ", " + \ + df['sub_category_2'] + ", " + \ + df['sub_category_3'] + + # rename certain columns + df = df.rename(columns = {'gas':'FlowName', + 'mt_co2e_ar5_20_yr':'FlowAmount'}) + + # drop all other columns + df = df.filter(['ActivityProducedBy', 'FlowAmount', 'FlowName']) + + # disaggregate HFC and PFC emissions + # dictionary of activities where GHG emissions need to be disaggregated + activity_dict = config['disagg_activity_dict'] + # for all activities included in the dictionary... + for activity_name, activity_properties in activity_dict.items(): + for flow_group, flow_properties in activity_properties.items(): + # name of table to be used for proportional split + table_name = flow_properties.get('table') + # load percentages to be used for proportional split + splits = load_fba_w_standardized_units(datasource=table_name, year=year) + # there are certain circumstances where one or more rows need to be + # excluded from the table + drop_rows = flow_properties.get('drop_rows') + if drop_rows is not None: + splits = splits[~splits['FlowName'].isin(drop_rows)] + splits['pct'] = splits['FlowAmount'] / splits['FlowAmount'].sum() + splits = splits[['FlowName', 'pct']] + # split fba dataframe to include only those items matching the activity and flow type + mask = (df['ActivityProducedBy'] == activity_name) & (df['FlowName'] == flow_group) + df_activity = df[mask] + df_main = df[~mask] + # apply proportional split to activity data + speciated_df = df_activity.apply(lambda x: [p * x['FlowAmount'] for p in splits['pct']], + axis=1, result_type='expand') + speciated_df.columns = splits['FlowName'] + speciated_df = pd.concat([df_activity, speciated_df], axis=1) + speciated_df = speciated_df.melt(id_vars=['ActivityProducedBy', 'FlowAmount', 'FlowName'], + var_name='Flow') + speciated_df['FlowName'] = speciated_df['Flow'] + speciated_df['FlowAmount'] = speciated_df['value'] + speciated_df.drop(columns=['Flow', 'value'], inplace=True) + # merge split dataframes back together + df = pd.concat([df_main, speciated_df], axis=0, join='inner') + + # calculate mass of emission from CO2e + AR5GWP20 = config['AR5GWP20'] + AR5GWP20 = pd.DataFrame(list(AR5GWP20.items()), columns = ['FlowName', 'GWP']) + df = pd.merge(df, AR5GWP20, on='FlowName') + df['FlowAmount'] = df['FlowAmount'] / df['GWP'] + df = df.drop(columns = ['GWP']) + + # add hardcoded data + df['Description'] = 'New York customized inventory' + df['Class'] = 'Chemicals' + df['SourceName'] = source + df['FlowType'] = 'ELEMENTARY_FLOW' + df['Compartment'] = 'air' + df['Year'] = year + df['Units'] = 'MT' + df['DataReliability'] = 5 + df['DataCollection'] = 5 + + # add state FIPS code + df['State'] = 'NY' + df = apply_county_FIPS(df, year='2015', source_state_abbrev=True) + # add FIPS location system + df = assign_fips_location_system(df, '2015') + + return df + def VT_remove_dupicate_activities(df_subset): """Remove activities from standard SIT that are captured by supplementary diff --git a/flowsa/methods/flowbyactivitymethods/StateGHGI_NY.yaml b/flowsa/methods/flowbyactivitymethods/StateGHGI_NY.yaml new file mode 100644 index 000000000..31a9fb821 --- /dev/null +++ b/flowsa/methods/flowbyactivitymethods/StateGHGI_NY.yaml @@ -0,0 +1,91 @@ +# data location: https://data.ny.gov/Energy-Environment/Statewide-Greenhouse-Gas-Emissions-Beginning-1990/5i6e-asw6 +# direct url: https://data.ny.gov/resource/5i6e-asw6.csv + +author: New York Department of Environmental Conservation +source_name: Statewide Greenhouse Gas Emissions Beginning 1990 +bib_id: StateGHGI_NY +format: csv # comma-separated values +url: None +filename: 'NY_customized_inventory.csv' +parse_response_fxn: !script_function:StateGHGI NY_customized_parse +years: +- 2019 +- 2018 +- 2017 + + +# Dictionary of activities for disaggregation of HFCs and PFCs +# The table numbers listed below are based on +# Inventory of U.S. Greenhouse Gas Emissions and Sinks: 1990–2019 (published 2021) +disagg_activity_dict: + Buildings, IPPU, Product Use, ODS Substitues, Building HVAC, Not Applicable: &ODS_allocation + HFCs: + table: 'EPA_GHGI_T_4_99' + drop_rows: + - 'CF4' + - 'Others (a)' + Buildings, IPPU, Product Use, ODS Substitues, Building Refrigeration, Not Applicable: + <<: *ODS_allocation + Buildings, IPPU, Product Use, ODS Substitues, Industrial, Not Applicable: + <<: *ODS_allocation + Buildings, IPPU, Product Use, ODS Substitues, Other Building Appliances, Not Applicable: + <<: *ODS_allocation + Buildings, IPPU, Product Use, ODS Substitues, Other, Not Applicable: + <<: *ODS_allocation + Transportation, IPPU, Product Use, ODS Substitues, Transportation HVAC, Not Applicable: + <<: *ODS_allocation + Transportation, IPPU, Product Use, ODS Substitues, Transportation Refrigeration, Not Applicable: + <<: *ODS_allocation + Industry, IPPU, Electronics, Semiconductor Industry, Not Applicable, Not Applicable: + HFCs: + table: 'EPA_GHGI_T_4_94' + drop_rows: + - 'C2F6' + - 'C3F8' + - 'c-C4F8' + - 'CF4' + - 'HFC, PFC and SF6 F-HTFs' + - 'MEMS' + - 'N2O[2]' + - 'NF3' + - 'PV' + - 'SF6' + - 'Total F-GHGs' + PFCs: + table: 'EPA_GHGI_T_4_94' + drop_rows: + - 'HFC, PFC and SF6 F-HTFs' + - 'HFC-23' + - 'MEMS' + - 'N2O[2]' + - 'NF3' + - 'PV' + - 'SF6' + - 'Total F-GHGs' + Industry, IPPU, Metals, Aluminum, Not Applicable, Not Applicable: + PFCs: + table: 'EPA_GHGI_T_4_80' + drop_rows: + + +# List of IPCC AR5 GWP-20 values needed to convert flow ammount from CO2e to mass emitted +# Values were taken from Table 2 of Summary Report of the 2021 NYS Statewide GHG Emissions Report (p.5) +# available at: https://www.dec.ny.gov/energy/99223.html +AR5GWP20: + CO2: 1 + CH4: 84 + N2O: 264 + HFC-23: 10800 + HFC-32: 2430 + HFC-125: 6090 + HFC-134a: 3580 + HFC-143a: 6940 + HFC-236fa: 6940 + C2F6: 8210 # PFC-116 + C3F8: 6640 # PFC-218 + CF4: 4880 # PFC-14 + c-C4F8: 7110 # PFC-318 + SF6: 17500 + NF3: 12800 + + From e5e5455d1db87b1b8480209a701151b6164a524f Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 26 Oct 2022 08:48:30 -0400 Subject: [PATCH 0230/1127] match pandas requirements in develop branch --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 497d6c70e..d9fcde54f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git@develop#egg=fedelemflowlist git+https://github.com/USEPA/esupy.git@develop#egg=esupy git+https://github.com/USEPA/standardizedinventories.git@develop#egg=StEWI -pandas>=1.3.2 # Powerful data structures for data analysis, time series, and statistics. +pandas>=1.4.0 # Powerful data structures for data analysis, time series, and statistics. pip>=9 # The PyPA recommended tool for installing Python packages. setuptools>=41 # Fully-featured library designed to facilitate packaging Python projects. pyyaml>=5.3 # Yaml for python From d7c9403491c3b2fe45910bbee938369e7c5602c2 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 26 Oct 2022 08:50:32 -0400 Subject: [PATCH 0231/1127] spacing to match develop branch --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d9fcde54f..5093a1a74 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git@develop#egg=fedelemflowlist git+https://github.com/USEPA/esupy.git@develop#egg=esupy git+https://github.com/USEPA/standardizedinventories.git@develop#egg=StEWI -pandas>=1.4.0 # Powerful data structures for data analysis, time series, and statistics. +pandas>=1.4.0 # Powerful data structures for data analysis, time series, and statistics. pip>=9 # The PyPA recommended tool for installing Python packages. setuptools>=41 # Fully-featured library designed to facilitate packaging Python projects. pyyaml>=5.3 # Yaml for python From 08b8ca797bdcc2ad1290adcac2287523ec90996d Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 26 Oct 2022 10:43:48 -0400 Subject: [PATCH 0232/1127] add bts airlines to FBA error to ignore in GH actions --- flowsa/methods/method_status.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/flowsa/methods/method_status.yaml b/flowsa/methods/method_status.yaml index aa85497d6..a1f60cb08 100644 --- a/flowsa/methods/method_status.yaml +++ b/flowsa/methods/method_status.yaml @@ -17,6 +17,11 @@ Blackhurst_IO: Status: Error in HTTP request during testing only Type: HTTPError +BTS_Airlines: + Active: True + Status: Private data + Type: FileNotFoundError + # Flow By Sector CNHW_state_2014: From 5f1f04b4ac0b1aff4e136aac9a9957ac1cf59587 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 28 Oct 2022 13:17:24 -0400 Subject: [PATCH 0233/1127] Override .astype() from DataFrame to fix issues introduced by the update to pandas 1.5.0 --- flowsa/flowby.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 17c49c94f..8a81ed7d0 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1,4 +1,4 @@ -from typing import List, Literal, TypeVar +from typing import List, Literal, TypeVar, Union import pandas as pd from pandas import ExcelWriter import numpy as np @@ -613,6 +613,28 @@ def to_parquet(self: FB, *args, **kwargs) -> None: # to_parquet method inherited from DatFrame from working, so this # casts the data back to plain DataFrame to write to a parquet. + def astype(self: FB, *args, **kwargs) -> FB: + ''' + Overrides DataFrame.astype(). Necessary only for pandas >= 1.5.0. + With this update, DataFrame.astype() calls the constructor method + of the calling dataframe. The FlowBy constructor 1) calls .astype() and + 2) adds missing FlowBy columns. Consequently, when it's called in the + middle of DataFrame.astype() it creates an infinite loop. When the + infinite loop is fixed elsewhere, a problem still exists because of + missing columns being added (the data submitted to the constructor by + DataFrame.astype() don't have column names, so a bunch of empty columns + are added on the end and then .astype() can't assign data types and add + column names back properly). This function fixes the problem by making + it so DataFrame.astype() is not called by a FlowBy dataframe, but + instead by a plain pd.DataFrame. + ''' + metadata = {attribute: self.__getattr__(attribute) + for attribute in self._metadata} + df = pd.DataFrame(self).astype(*args, **kwargs) + fb = type(self)(df, **metadata) + + return fb + class FlowByActivity(_FlowBy): _metadata = [*_FlowBy()._metadata] From d51ab1012ca176fc3ed54376dae8243076fbe9a4 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 28 Oct 2022 13:40:31 -0400 Subject: [PATCH 0234/1127] wrapped code in a function call so it won't all execute on import --- flowsa/data_source_scripts/BTS_Airlines.py | 52 +++++++++++----------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/flowsa/data_source_scripts/BTS_Airlines.py b/flowsa/data_source_scripts/BTS_Airlines.py index 061d16eaa..bfb365643 100644 --- a/flowsa/data_source_scripts/BTS_Airlines.py +++ b/flowsa/data_source_scripts/BTS_Airlines.py @@ -3,31 +3,33 @@ from flowsa.flowby import FlowByActivity from flowsa import flowsa_yaml, settings -with open(f'{settings.sourceconfigpath}BTS_Airlines.yaml') as f: - config = flowsa_yaml.load(f) -year_list = config['years'] +def generate_fba(): + with open(f'{settings.sourceconfigpath}BTS_Airlines.yaml') as f: + config = flowsa_yaml.load(f) -df = pd.DataFrame(FlowByActivity(( - pd.read_csv(config['file_path']) - [[c for c in config['parse']['rename_columns']]] - .rename(columns=config['parse']['rename_columns']) - .query('Year in @year_list') - .reset_index(drop=True) - .groupby('Year').agg('sum').reset_index() - .assign( - Class='Fuel', - Compartment='air', - SourceName='BTS_Airlines', - LocationSystem='FIPS_2015', - ActivityConsumedBy='Commercial Aircraft', - Unit='gal', - FlowName='Total Gallons Consumed', - FlowType='TECHNOSPHERE_FLOW', - Location='00000', - DataReliability=3, - DataCollection=5 - ) -))) + year_list = config['years'] -df.to_parquet(f'{settings.fbaoutputpath}BTS_Airlines.parquet') + df = pd.DataFrame(FlowByActivity(( + pd.read_csv(config['file_path']) + [[c for c in config['parse']['rename_columns']]] + .rename(columns=config['parse']['rename_columns']) + .query('Year in @year_list') + .reset_index(drop=True) + .groupby('Year').agg('sum').reset_index() + .assign( + Class='Fuel', + Compartment='air', + SourceName='BTS_Airlines', + LocationSystem='FIPS_2015', + ActivityConsumedBy='Commercial Aircraft', + Unit='gal', + FlowName='Total Gallons Consumed', + FlowType='TECHNOSPHERE_FLOW', + Location='00000', + DataReliability=3, + DataCollection=5 + ) + ))) + + df.to_parquet(f'{settings.fbaoutputpath}BTS_Airlines.parquet') From 187c88264c07dc34ca59f75bf3a5f9399431895a Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 28 Oct 2022 21:45:11 -0400 Subject: [PATCH 0235/1127] ignore marine_shipping FBS on actions testing --- flowsa/methods/method_status.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/flowsa/methods/method_status.yaml b/flowsa/methods/method_status.yaml index a1f60cb08..44d7c115f 100644 --- a/flowsa/methods/method_status.yaml +++ b/flowsa/methods/method_status.yaml @@ -27,3 +27,8 @@ BTS_Airlines: CNHW_state_2014: Active: True Status: Memory Error # Skip during GH-action testing + +marine_shipping_adjustment: + Active: True + Status: Private data + Type: FileNoutFoundError From ba33b9eb2c671a753ab5317bdd52bee3961d9213 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 28 Oct 2022 21:57:08 -0400 Subject: [PATCH 0236/1127] check method status before running `test_FBS_methods` --- flowsa/methods/method_status.yaml | 5 +++++ flowsa/test_methods.py | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/flowsa/methods/method_status.yaml b/flowsa/methods/method_status.yaml index 44d7c115f..6e350c814 100644 --- a/flowsa/methods/method_status.yaml +++ b/flowsa/methods/method_status.yaml @@ -32,3 +32,8 @@ marine_shipping_adjustment: Active: True Status: Private data Type: FileNoutFoundError + +SEEA_2017_kg_v1: + Active: False + Status: Method error + Type: ParserError diff --git a/flowsa/test_methods.py b/flowsa/test_methods.py index f0ebcf3df..6537bee9a 100644 --- a/flowsa/test_methods.py +++ b/flowsa/test_methods.py @@ -51,10 +51,12 @@ def test_FBA_urls(): def test_FBS_methods(): """Succesfully load the yaml method for all FBS""" + method_status = check_method_status() for m in seeAvailableFlowByModels("FBS", print_method=False): print(f"Testing method: {m}") - load_yaml_dict(m, flowbytype='FBS') + if method_status.get(m) is None: + load_yaml_dict(m, flowbytype='FBS') if __name__ == "__main__": - test_FBA_urls() - # test_FBS_methods() + # test_FBA_urls() + test_FBS_methods() From 738f06aff1cf4cf55315d6213d91cddc3b2a1e5a Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 28 Oct 2022 22:16:10 -0400 Subject: [PATCH 0237/1127] update compare_FBS_results to use new generation FBS class method --- flowsa/validation.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/flowsa/validation.py b/flowsa/validation.py index 01a2446e7..1901bf557 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -931,8 +931,10 @@ def compare_FBS_results(fbs1, fbs2, ignore_metasources=False, # load second file if compare_to_remote: # Generate the FBS locally and then immediately load - flowsa.flowbysector.main(method=fbs2, - download_FBAs_if_missing=True) + flowsa.flowby.FlowBySector.generateFlowBySector(method=fbs2, + download_sources_ok=True) + # flowsa.flowbysector.main(method=fbs2, + # download_FBAs_if_missing=True) df2 = flowsa.getFlowBySector(fbs2).rename( columns={'FlowAmount': 'FlowAmount_fbs2'}) df2 = replace_strings_with_NoneType(df2) From 1c803ee977ec88241b497ef4c89c8d2c00dee65e Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 28 Oct 2022 23:04:30 -0400 Subject: [PATCH 0238/1127] remove LocationSystem from FBS comparison --- flowsa/validation.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/flowsa/validation.py b/flowsa/validation.py index 1901bf557..678d68fb0 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -931,16 +931,18 @@ def compare_FBS_results(fbs1, fbs2, ignore_metasources=False, # load second file if compare_to_remote: # Generate the FBS locally and then immediately load - flowsa.flowby.FlowBySector.generateFlowBySector(method=fbs2, - download_sources_ok=True) + df2 = (flowsa.flowby.FlowBySector.generateFlowBySector( + method=fbs2, download_sources_ok=True) + .rename(columns={'FlowAmount': 'FlowAmount_fbs2'})) # flowsa.flowbysector.main(method=fbs2, # download_FBAs_if_missing=True) - df2 = flowsa.getFlowBySector(fbs2).rename( - columns={'FlowAmount': 'FlowAmount_fbs2'}) + else: + df2 = flowsa.getFlowBySector(fbs2).rename( + columns={'FlowAmount': 'FlowAmount_fbs2'}) df2 = replace_strings_with_NoneType(df2) # compare df merge_cols = ['Flowable', 'Class', 'SectorProducedBy', 'SectorConsumedBy', - 'SectorSourceName', 'Context', 'Location', 'LocationSystem', + 'SectorSourceName', 'Context', 'Location', 'Unit', 'FlowType', 'Year', 'MetaSources'] if ignore_metasources: merge_cols.remove('MetaSources') From 51a4753b05e65bc1aaac731191eedb614f3f327b Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sat, 29 Oct 2022 22:30:53 -0400 Subject: [PATCH 0239/1127] update CAP_HAP_national --- .../CAP_HAP_national_2017.yaml | 384 ++++++++++-------- 1 file changed, 221 insertions(+), 163 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index 24c4f5058..f7668539f 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -1,209 +1,267 @@ -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: national - -_allocation_types: - _mecs_allocation: &mecs_allocation - allocation_method: proportional - allocation_source: - EIA_MECS_Energy: - class: Energy - year: 2014 - geoscale: national - # flows: - # - Coal # override this. However, can't override inside nested as easily with my set up. Ponder on this. - allocation_compartment: None - allocation_selection_fields: - Description: - - "Table 2.2" - - "Table 3.2" - clean_fba_df_fxn: !script_function:EIA_MECS mecs_energy_fba_cleanup - clean_fba_w_sec_df_fxn: !script_function:EIA_MECS eia_mecs_energy_clean_allocation_fba_w_sec - allocation_method: proportional-flagged - allocation_source: - BLS_QCEW: - class: Employment - year: 2014 - geoscale: national - flows: None # Verify what this does - clean_fba_wsec_df_fxn: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec - - _use_allocation: &use_allocation - # names: # override this - allocation_source: "BEA_Use_Detail_PRO_BeforeRedef" - activity_to_sector_mapping: "BEA_2012_Detail" - allocation_method: proportional - allocation_source_class: "Money" - allocation_source_year: 2012 - allocation_flow: - - "USD2012" - allocation_compartment: None - allocation_from_scale: national - clean_allocation_fba: !script_function:BEA subset_BEA_table - # clean_parameter: {"324110": 'ActivityProducedBy'} # override this - helper_source: "BLS_QCEW" - helper_method: proportional - helper_source_class: "Employment" - helper_source_year: 2012 - helper_flow: - - "Number of employees, Federal Government" - - "Number of employees, State Government" - - "Number of employees, Local Government" - - "Number of employees, Private" - helper_from_scale: national - clean_helper_fba_wsec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec +industry_spec: + default: NAICS_6 +year: 2017 +target_naics_year: 2012 +geoscale: national + +sources_to_cache: + BLS_QCEW: + year: 2014 + selection_fields: + Class: Employment + clean_fba_before_mapping: !script_function:temp_data_source_functions estimate_suppressed_qcew + clean_fba: !script_function:temp_data_source_functions clean_qcew + # clean_fba_wsec_df_fxn: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec + BLS_QCEW: # What to do about same data source but different year? + year: 2012 + selection_fields: + Class: Employment + clean_fba_before_mapping: !script_function:temp_data_source_functions estimate_suppressed_qcew + clean_fba: !script_function:temp_data_source_functions clean_qcew + # clean_fba_wsec_df_fxn: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec + +_attribution_sources: + EIA_MECS_Energy: &mecs_energy + year: 2014 + selection_fields: &mecs_energy_default_selection + Class: Energy + Unit: Trillion Btu + # NEW EIA MECS Energy FBAs show tables in description + Description: + - Table 2.2 + - Table 3.2 + estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_mecs_energy + clean_fba: !script_function:temp_data_source_functions clean_mecs_energy_fba + clean_fba_w_sec: !script_function:temp_data_source_functions clean_mapped_mecs_energy_fba + # clean_fba_df_fxn: !script_function:EIA_MECS mecs_energy_fba_cleanup + # clean_fba_w_sec_df_fxn: !script_function:EIA_MECS eia_mecs_energy_clean_allocation_fba_w_sec + attribution_method: proportional # cleaning fxns remove need for proportional-flagged + attribution_source: BLS_QCEW + + BEA: &bea + year: 2012 + activity_to_sector_mapping: BEA_2012_Detail + attribution_method: proportional + attribution_source: BLS_QCEW source_names: EPA_NEI_Nonpoint: - # data_format: 'FBA' - class: Chemicals geoscale: state year: 2017 - activity_to_sector_mapping: 'SCC' - clean_fba_df_fxn: !script_function:EPA_NEI clean_NEI_fba_no_pesticides - # fedefl_mapping: 'NEI' + activity_to_sector_mapping: SCC + clean_fba_before_mapping: !script_function:EPA_NEI clean_NEI_fba_no_pesticides + fedefl_mapping: NEI activity_sets: direct_allocation: - names: !from_index:NEI_Nonpoint_2017_asets.csv direct_allocation - # ^^^ "names" defines how the partitioning occurs + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv direct_allocation attribution_method: direct - # allocation_source: None - # allocation_from_scale: national # Not sure how to integrate this. + cropland: - names: !from_index:NEI_Nonpoint_2017_asets.csv cropland + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv cropland attribution_method: proportional attribution_source: USDA_CoA_Cropland: - class: Land year: 2017 - flows: - - AREA HARVESTED - allocation_compartment: None geoscale: state + selection_fields: + Class: Land + FlowName: AREA HARVESTED + ## CONFIRM HOW TO HANDLE THESE CLEANING FXNS clean_fba_w_sec_df_fxn: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics # OR attribution_method: function attribution function: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics # wrapped in an appropriate aggregation industry_combustion_coal: #only allocating to 3digits - <<: *mecs_allocation - names: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_coal - allocation_flow: - - Coal + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_coal + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Coal + industry_combustion_coke: #only allocating to 3digits - <<: *mecs_allocation - names: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_coke - allocation_flow: - - "Coke and Breeze" + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_coke + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Coke and Breeze + industry_combustion_distillate: #only allocating to 3digits - <<: *mecs_allocation - names: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_distillate - allocation_flow: - - "Distillate Fuel Oil" + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_distillate + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Distillate Fuel Oil + industry_combustion_hgl: #only allocating to 3digits - <<: *mecs_allocation - names: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_hgl - allocation_flow: # Are we sure the next line is supposed to say "natural gasoline"? - - "Hydrocarbon Gas Liquids, excluding natural gasoline" + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_hgl + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Hydrocarbon Gas Liquids, excluding natural gasoline + industry_combustion_nat_gas: #only allocating to 3digits - <<: *mecs_allocation - names: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_nat_gas - allocation_flow: - - "Natural Gas" + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_nat_gas + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Natural Gas + industry_combustion_other: #only allocating to 3digits - <<: *mecs_allocation - names: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_other - allocation_flow: - - "Other" + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_other + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Other + industry_combustion_residual: #only allocating to 3digits - <<: *mecs_allocation - names: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_residual - allocation_flow: - - "Residual Fuel Oil" + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_residual + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Residual Fuel Oil + livestock: #Livestock losing NAICS 11211 - names: !from_index:NEI_Nonpoint_2017_asets.csv livestock - allocation_method: proportional - allocation_source: "USDA_CoA_Livestock" - allocation_source_class: "Other" - allocation_source_year: 2017 - allocation_flow: - - "HEAD" - - "NUMBER" - - "COLONIES" - allocation_compartment: - - "NOT SPECIFIED" - allocation_from_scale: state + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv livestock + attribution_method: proportional + attribution_source: + USDA_CoA_Livestock: + year: 2017 + geoscale: state + selection_fields: + Class: Other + FlowName: + - HEAD + - NUMBER + - COLONIES + Compartment: NOT SPECIFIED + mobile_and_fuel_storage: - <<: *use_allocation - names: !from_index:NEI_Nonpoint_2017_asets.csv mobile_and_fuel_storage - clean_parameter: {"324110": 'ActivityProducedBy'} + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv mobile_and_fuel_storage + attribution_method: proportional + attribution_source: + BEA_Make_Detail_BeforeRedef: + <<: *bea + primary_action_type: Consumed # confirm this + selection_fields: + ActivityProducedBy: {'324110': ''} # Petroleum + fertilizers: - <<: *use_allocation - names: !from_index:NEI_Nonpoint_2017_asets.csv fertilizers - clean_parameter: {"325310": 'ActivityProducedBy'} - output_allocation: # Gross Output - names: !from_index:NEI_Nonpoint_2017_asets.csv output_allocation - allocation_source: "BEA_GDP_GrossOutput" - activity_to_sector_mapping: "BEA_2012_Detail" - allocation_method: proportional - allocation_source_class: "Money" - allocation_source_year: 2017 - allocation_flow: - - "Gross Output" - allocation_compartment: None - allocation_from_scale: national - helper_source: "BLS_QCEW" - helper_method: proportional - helper_source_class: "Employment" - helper_source_year: 2012 - helper_flow: - - "Number of employees, Federal Government" - - "Number of employees, State Government" - - "Number of employees, Local Government" - - "Number of employees, Private" - helper_from_scale: national - clean_helper_fba_wsec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv fertilizers + attribution_method: proportional + attribution_source: + BEA_Make_Detail_BeforeRedef: + <<: *bea + primary_action_type: Consumed # confirm this + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + pesticides: # pesticides - <<: *use_allocation - names: !from_index:NEI_Nonpoint_2017_asets.csv pesticides - clean_parameter: {"325320": 'ActivityProducedBy'} + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv pesticides + attribution_method: proportional + attribution_source: + BEA_Make_Detail_BeforeRedef: + <<: *bea + primary_action_type: Consumed # confirm this + selection_fields: + ActivityProducedBy: {'325320': ''} # Pesticides + + output_allocation: # Gross Output + selection_fields: + PrimaryActivity: NEI_Nonpoint_2017_asets.csv output_allocation + attribution_method: proportional + attribution_source: + BEA_GDP_GrossOutput: + year: 2017 + activity_to_sector_mapping: "BEA_2012_Detail" + selection_fields: + Class: Money + FlowName: Gross Output + attribution_method: proportional + attribution_source: BLS_QCEW + + "EPA_NEI_Nonroad": - data_format: 'FBA' - class: Chemicals - geoscale_to_use: national + geoscale: state year: 2017 - activity_to_sector_mapping: 'SCC' + activity_to_sector_mapping: SCC clean_fba_df_fxn: !script_function:EPA_NEI clean_NEI_fba - fedefl_mapping: 'NEI' + fedefl_mapping: NEI activity_sets: direct_allocation: - names: !from_index:NEI_Nonroad_2017_asets.csv direct_allocation - allocation_method: direct - allocation_source: None - allocation_from_scale: national + selection_fields: + PrimaryActivity: !from_index:NEI_Nonroad_2017_asets.csv direct_allocation + attribution_method: direct + offroad_vehicles_equipment: - <<: *use_allocation - names: !from_index:NEI_Nonroad_2017_asets.csv offroad_vehicles_equipment - clean_parameter: {"324110": 'ActivityProducedBy'} + selection_fields: + PrimaryActivity: !from_index:NEI_Nonroad_2017_asets.csv offroad_vehicles_equipment + attribution_method: proportional + attribution_source: + BEA_Make_Detail_BeforeRedef: + <<: *bea + primary_action_type: Consumed # confirm this + selection_fields: + ActivityProducedBy: {'324110': ''} # Petroleum + "EPA_NEI_Onroad": - data_format: 'FBA' - class: Chemicals - geoscale_to_use: national + geoscale: state year: 2017 - activity_to_sector_mapping: 'SCC' + activity_to_sector_mapping: SCC clean_fba_df_fxn: !script_function:EPA_NEI clean_NEI_fba - fedefl_mapping: 'NEI' + fedefl_mapping: NEI activity_sets: direct_allocation: - names: !from_index:NEI_Onroad_2017_asets.csv direct_allocation - allocation_method: direct - allocation_source: None - allocation_from_scale: national + selection_fields: + PrimaryActivity: !from_index:NEI_Onroad_2017_asets.csv direct_allocation + attribution_method: direct + onroad_vehicles_gas_stations: - <<: *use_allocation - names: !from_index:NEI_Onroad_2017_asets.csv onroad_vehicles_gas_stations - clean_parameter: {"324110": 'ActivityProducedBy'} + selection_fields: + PrimaryActivity: !from_index:NEI_Onroad_2017_asets.csv onroad_vehicles_gas_stations + attribution_method: proportional + attribution_source: + BEA_Make_Detail_BeforeRedef: + <<: *bea + primary_action_type: Consumed # confirm this + selection_fields: + ActivityProducedBy: {'324110': ''} # Petroleum + "stewiFBS": data_format: 'FBS_outside_flowsa' FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector From 3b8a5323fdb7d00239cafef1fcdc7068122be8b4 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sun, 30 Oct 2022 09:22:21 -0400 Subject: [PATCH 0240/1127] update TRI_DMR methods --- flowsa/data_source_scripts/stewiFBS.py | 2 +- .../flowbysectormethods/TRI_DMR_national_2017.yaml | 11 +++++++++-- .../flowbysectormethods/TRI_DMR_state_2017.yaml | 11 +++++++++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/flowsa/data_source_scripts/stewiFBS.py b/flowsa/data_source_scripts/stewiFBS.py index 69089b490..5555bdcbd 100644 --- a/flowsa/data_source_scripts/stewiFBS.py +++ b/flowsa/data_source_scripts/stewiFBS.py @@ -295,7 +295,7 @@ def prepare_stewi_fbs(df_load, yaml_load, method): geo_scale = method.get('target_geoscale') # update location to appropriate geoscale prior to aggregating - df = df_load.dropna(subset=['Location']) + df = df_load.dropna(subset=['Location']).reset_index(drop=True) df['Location'] = df['Location'].astype(str) df = update_geoscale(df, geo_scale) diff --git a/flowsa/methods/flowbysectormethods/TRI_DMR_national_2017.yaml b/flowsa/methods/flowbysectormethods/TRI_DMR_national_2017.yaml index 9bb61c3fb..287103a16 100644 --- a/flowsa/methods/flowbysectormethods/TRI_DMR_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/TRI_DMR_national_2017.yaml @@ -1,6 +1,13 @@ +industry_spec: + default: NAICS_6 +year: 2017 +target_naics_year: 2012 +geoscale: national + +# temporarily maintain target_sector_level for +# allocation.equally_allocate_parent_to_child_naics() target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: national + source_names: "stewiFBS": data_format: 'FBS_outside_flowsa' diff --git a/flowsa/methods/flowbysectormethods/TRI_DMR_state_2017.yaml b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2017.yaml index 0e688d23c..822e5342b 100644 --- a/flowsa/methods/flowbysectormethods/TRI_DMR_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2017.yaml @@ -1,6 +1,13 @@ +industry_spec: + default: NAICS_6 +year: 2017 +target_naics_year: 2012 +geoscale: state + +# temporarily maintain target_sector_level for +# allocation.equally_allocate_parent_to_child_naics() target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: state + source_names: "stewiFBS": data_format: 'FBS_outside_flowsa' From 776d0fe316baa0bf67344c34ed448af79c83411d Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sun, 30 Oct 2022 09:27:53 -0400 Subject: [PATCH 0241/1127] update CRHW method spec --- flowsa/data_source_scripts/stewiFBS.py | 2 +- .../flowbysectormethods/CRHW_national_2017.yaml | 11 +++++++++-- .../methods/flowbysectormethods/CRHW_state_2017.yaml | 11 +++++++++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/flowsa/data_source_scripts/stewiFBS.py b/flowsa/data_source_scripts/stewiFBS.py index 5555bdcbd..dcbb9fcf4 100644 --- a/flowsa/data_source_scripts/stewiFBS.py +++ b/flowsa/data_source_scripts/stewiFBS.py @@ -118,7 +118,7 @@ def stewi_to_sector(yaml_load, method, *_): download_if_missing=True) inv['Year'] = year inv['MetaSources'] = database - df = df.append(inv) + df = pd.concat([df, inv], ignore_index=True) if yaml_load.get('compartments'): # Subset based on primary compartment df = df[df['Compartment'].str.split('/', expand=True) diff --git a/flowsa/methods/flowbysectormethods/CRHW_national_2017.yaml b/flowsa/methods/flowbysectormethods/CRHW_national_2017.yaml index 01b24799c..cbc0128c0 100644 --- a/flowsa/methods/flowbysectormethods/CRHW_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CRHW_national_2017.yaml @@ -1,6 +1,13 @@ +industry_spec: + default: NAICS_6 +year: 2017 +target_naics_year: 2012 +geoscale: national + +# temporarily maintain target_sector_level for +# allocation.equally_allocate_parent_to_child_naics() target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: national + source_names: "stewiFBS": data_format: 'FBS_outside_flowsa' diff --git a/flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml b/flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml index 138d489ab..2a6a4aa03 100644 --- a/flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml @@ -1,6 +1,13 @@ +industry_spec: + default: NAICS_6 +year: 2017 +target_naics_year: 2012 +geoscale: state + +# temporarily maintain target_sector_level for +# allocation.equally_allocate_parent_to_child_naics() target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: state + source_names: "stewiFBS": data_format: 'FBS_outside_flowsa' From acc7aabeb6fad1113af69830ef4e20344879c29a Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sun, 30 Oct 2022 09:57:48 -0400 Subject: [PATCH 0242/1127] aggregate FBS for `FBS_outside_flowsa`; add some code flow comments --- flowsa/flowby.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 8a81ed7d0..e6167366a 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -36,6 +36,11 @@ def get_flowby_from_config( external_config_path: str = None, download_sources_ok: bool = True ) -> FB: + """ + Loads FBA or FBS dataframe + + :return: a FlowByActivity dataframe + """ external_data_path = config.get('external_data_path') if config['data_format'] == 'FBA': @@ -62,7 +67,7 @@ def get_flowby_from_config( ), full_name=name, config=config - ) + ).aggregate_flowby() else: log.critical('Unrecognized data format %s for source %s', config['data_format'], name) @@ -986,6 +991,7 @@ def attribute_flows_to_sectors( attribution_method = fba.config.get('attribution_method') if attribution_method == 'proportional': + # First check cache for FlowBy if isinstance(fba.config['attribution_source'], str): attribution_fbs = (fba.config['cache'] [fba.config['attribution_source']]) @@ -1371,12 +1377,13 @@ def prepare_fbs(self: 'FlowByActivity') -> 'FlowBySector': .reset_index(drop=True) ) + # Primary FlowBySector generation approach: return FlowBySector( self .function_socket('clean_fba_before_mapping') .select_by_fields() .function_socket('estimate_suppressed') - .convert_units_and_flows() + .convert_units_and_flows() # and also map to flow lists .function_socket('clean_fba') .convert_to_geoscale() .attribute_flows_to_sectors() # recursive call to prepare_fbs @@ -1609,6 +1616,7 @@ def generateFlowBySector( method_config = common.load_yaml_dict(method, 'FBS', external_config_path) + # Cache one or more sources by attaching to method_config to_cache = method_config.pop('sources_to_cache', {}) if 'cache' in method_config: log.warning('Config key "cache" for %s about to be overwritten', @@ -1633,6 +1641,7 @@ def generateFlowBySector( # so that later entries in method_config['sources_to_cache'] # can make use of the cached copy of an earlier entry. + # Generate FBS from method_config sources = method_config.pop('source_names') fbs = pd.concat([ From a685318d52a881e1ef45b53e87701b2b30d8b05a Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sun, 30 Oct 2022 20:50:31 -0400 Subject: [PATCH 0243/1127] aggregate_flowby after updating geoscale --- flowsa/flowby.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index e6167366a..148a656ba 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -67,7 +67,7 @@ def get_flowby_from_config( ), full_name=name, config=config - ).aggregate_flowby() + ) else: log.critical('Unrecognized data format %s for source %s', config['data_format'], name) @@ -1673,6 +1673,7 @@ def prepare_fbs(self: 'FlowBySector') -> 'FlowBySector': .select_by_fields() # TODO: Add a method to convert to proper industry spec. .convert_fips_to_geoscale() + .aggregate_flowby() # necessary after consolidating geoscale ) def display_tables( From 9e5ba334c8c3db80ff404962f8cce2272c0be9ff Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Mon, 31 Oct 2022 14:00:04 -0400 Subject: [PATCH 0244/1127] Minor styling fixes --- flowsa/flowby.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 148a656ba..a47bce705 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -5,7 +5,7 @@ from functools import partial, reduce from copy import deepcopy from flowsa import (common, settings, metadata, sectormapping, - literature_values, flowbyactivity, flowbysector, flowsa_yaml, + literature_values, flowbyactivity, flowsa_yaml, validation, geo, naics, exceptions) from flowsa.flowsa_log import log import esupy.processed_data_mgmt @@ -1383,7 +1383,7 @@ def prepare_fbs(self: 'FlowByActivity') -> 'FlowBySector': .function_socket('clean_fba_before_mapping') .select_by_fields() .function_socket('estimate_suppressed') - .convert_units_and_flows() # and also map to flow lists + .convert_units_and_flows() # and also map to flow lists .function_socket('clean_fba') .convert_to_geoscale() .attribute_flows_to_sectors() # recursive call to prepare_fbs @@ -1673,7 +1673,7 @@ def prepare_fbs(self: 'FlowBySector') -> 'FlowBySector': .select_by_fields() # TODO: Add a method to convert to proper industry spec. .convert_fips_to_geoscale() - .aggregate_flowby() # necessary after consolidating geoscale + .aggregate_flowby() # necessary after consolidating geoscale ) def display_tables( From fc3f7b473c6dcc8b8488f7647319f9b9f8044125 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 1 Nov 2022 09:16:47 -0400 Subject: [PATCH 0245/1127] Started adding docstrings --- flowsa/flowby.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index a47bce705..865f19b5e 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -20,10 +20,16 @@ with open(settings.datapath + 'flowby_config.yaml') as f: flowby_config = flowsa_yaml.load(f) + # ^^^ Replaces schema.py # TODO: Move this to common.py def get_catalog_info(source_name: str) -> dict: + ''' + Retrieves the information on a given source from source_catalog.yaml. + Replaces (when used appropriately), common.check_activities_sector_like() + as well as various pieces of code that load the source_catalog yaml. + ''' source_catalog = common.load_yaml_dict('source_catalog') source_name = common.return_true_source_catalog_name(source_name) return source_catalog.get(source_name, {}) @@ -37,7 +43,8 @@ def get_flowby_from_config( download_sources_ok: bool = True ) -> FB: """ - Loads FBA or FBS dataframe + Loads FBA or FBS dataframe from a config dictionary and attaches that + dictionary to the FBA or FBS. Exists for convenience. :return: a FlowByActivity dataframe """ @@ -89,6 +96,15 @@ def __init__( string_null: 'np.nan' or None = np.nan, **kwargs ) -> None: + ''' + Extends pandas DataFrame. Attaches metadata if provided as kwargs and + ensures that all columns described in flowby_config.yaml are present + and of the correct datatype. + + All args and kwargs not specified above or in FBA/FBS metadata are + passed to the DataFrame constructor. + ''' + # Assign values to metadata attributes, checking the following sources, # in order: self, data, kwargs; then defaulting to an empty version of # the type specified in the type hints, or None. From 94501765f938e5578fa70c4b46f2a8e75ebfd56e Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 1 Nov 2022 10:48:54 -0400 Subject: [PATCH 0246/1127] Removed unused tags from CRHW, GRDREL, and TRI_DMR, both national and state. --- .../flowbysectormethods/CRHW_national_2017.yaml | 12 +++--------- .../methods/flowbysectormethods/CRHW_state_2017.yaml | 12 +++--------- .../flowbysectormethods/GRDREL_national_2017.yaml | 7 +++---- .../flowbysectormethods/GRDREL_state_2017.yaml | 7 +++---- .../flowbysectormethods/TRI_DMR_national_2017.yaml | 12 +++--------- .../flowbysectormethods/TRI_DMR_state_2017.yaml | 12 +++--------- 6 files changed, 18 insertions(+), 44 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/CRHW_national_2017.yaml b/flowsa/methods/flowbysectormethods/CRHW_national_2017.yaml index cbc0128c0..fab590031 100644 --- a/flowsa/methods/flowbysectormethods/CRHW_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CRHW_national_2017.yaml @@ -1,17 +1,11 @@ -industry_spec: - default: NAICS_6 -year: 2017 -target_naics_year: 2012 geoscale: national - -# temporarily maintain target_sector_level for -# allocation.equally_allocate_parent_to_child_naics() -target_sector_level: NAICS_6 - source_names: "stewiFBS": data_format: 'FBS_outside_flowsa' FBS_datapull_fxn: !script_function:stewiFBS stewi_to_sector + # temporarily maintain target_sector_level for + # allocation.equally_allocate_parent_to_child_naics() + target_sector_level: NAICS_6 inventory_dict: {"RCRAInfo":"2017"} compartments: - 'waste' diff --git a/flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml b/flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml index 2a6a4aa03..eafa7ce9c 100644 --- a/flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml @@ -1,17 +1,11 @@ -industry_spec: - default: NAICS_6 -year: 2017 -target_naics_year: 2012 geoscale: state - -# temporarily maintain target_sector_level for -# allocation.equally_allocate_parent_to_child_naics() -target_sector_level: NAICS_6 - source_names: "stewiFBS": data_format: 'FBS_outside_flowsa' FBS_datapull_fxn: !script_function:stewiFBS stewi_to_sector + # temporarily maintain target_sector_level for + # allocation.equally_allocate_parent_to_child_naics() + target_sector_level: NAICS_6 inventory_dict: {"RCRAInfo":"2017"} compartments: - 'waste' diff --git a/flowsa/methods/flowbysectormethods/GRDREL_national_2017.yaml b/flowsa/methods/flowbysectormethods/GRDREL_national_2017.yaml index 88b2c7fa0..1812c883b 100644 --- a/flowsa/methods/flowbysectormethods/GRDREL_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/GRDREL_national_2017.yaml @@ -1,11 +1,10 @@ -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: national +geoscale: national source_names: stewiFBS: data_format: FBS_outside_flowsa - geoscale: national FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector + # Below are arguments needed by the stewicombo_to_sector function + target_sector_level: NAICS_6 inventory_dict: {"TRI":"2017"} local_inventory_name: TRI_GRDREL_2017 compartments: diff --git a/flowsa/methods/flowbysectormethods/GRDREL_state_2017.yaml b/flowsa/methods/flowbysectormethods/GRDREL_state_2017.yaml index e5c3766fa..50f040e15 100644 --- a/flowsa/methods/flowbysectormethods/GRDREL_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/GRDREL_state_2017.yaml @@ -1,11 +1,10 @@ -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: state +geoscale: state source_names: stewiFBS: data_format: FBS_outside_flowsa - geoscale: state FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector + # Below are arguments needed by the stewicombo_to_sector function + target_sector_level: NAICS_6 inventory_dict: {"TRI":"2017"} local_inventory_name: TRI_GRDREL_2017 compartments: diff --git a/flowsa/methods/flowbysectormethods/TRI_DMR_national_2017.yaml b/flowsa/methods/flowbysectormethods/TRI_DMR_national_2017.yaml index 287103a16..338e0bb99 100644 --- a/flowsa/methods/flowbysectormethods/TRI_DMR_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/TRI_DMR_national_2017.yaml @@ -1,17 +1,11 @@ -industry_spec: - default: NAICS_6 -year: 2017 -target_naics_year: 2012 geoscale: national - -# temporarily maintain target_sector_level for -# allocation.equally_allocate_parent_to_child_naics() -target_sector_level: NAICS_6 - source_names: "stewiFBS": data_format: 'FBS_outside_flowsa' FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector + # temporarily maintain target_sector_level for + # allocation.equally_allocate_parent_to_child_naics() + target_sector_level: NAICS_6 inventory_dict: {"TRI":"2017", "DMR":"2017"} local_inventory_name: 'TRI_DMR_2017' compartments: diff --git a/flowsa/methods/flowbysectormethods/TRI_DMR_state_2017.yaml b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2017.yaml index 822e5342b..426738160 100644 --- a/flowsa/methods/flowbysectormethods/TRI_DMR_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2017.yaml @@ -1,17 +1,11 @@ -industry_spec: - default: NAICS_6 -year: 2017 -target_naics_year: 2012 geoscale: state - -# temporarily maintain target_sector_level for -# allocation.equally_allocate_parent_to_child_naics() -target_sector_level: NAICS_6 - source_names: "stewiFBS": data_format: 'FBS_outside_flowsa' FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector + # temporarily maintain target_sector_level for + # allocation.equally_allocate_parent_to_child_naics() + target_sector_level: NAICS_6 inventory_dict: {"TRI":"2017", "DMR":"2017"} local_inventory_name: 'TRI_DMR_2017' compartments: From 53754538e7391bcb1ef3f244706260948f30d48b Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 1 Nov 2022 14:12:01 -0400 Subject: [PATCH 0247/1127] Fixed call to validation.compare_geographic_scales() + styling fixes. --- flowsa/flowby.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 148a656ba..4c15f8813 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -5,7 +5,7 @@ from functools import partial, reduce from copy import deepcopy from flowsa import (common, settings, metadata, sectormapping, - literature_values, flowbyactivity, flowbysector, flowsa_yaml, + literature_values, flowbyactivity, flowsa_yaml, validation, geo, naics, exceptions) from flowsa.flowsa_log import log import esupy.processed_data_mgmt @@ -953,7 +953,7 @@ def convert_to_geoscale( validation.compare_geographic_totals( fba_at_target_geoscale, self, self.source_name, self.config, - self.activity_set, self.config['names'] + self.full_name.split('.')[-1], self.config['names'] # ^^^ TODO: Rewrite validation to use fb metadata ) @@ -1383,7 +1383,7 @@ def prepare_fbs(self: 'FlowByActivity') -> 'FlowBySector': .function_socket('clean_fba_before_mapping') .select_by_fields() .function_socket('estimate_suppressed') - .convert_units_and_flows() # and also map to flow lists + .convert_units_and_flows() # and also map to flow lists .function_socket('clean_fba') .convert_to_geoscale() .attribute_flows_to_sectors() # recursive call to prepare_fbs @@ -1673,7 +1673,7 @@ def prepare_fbs(self: 'FlowBySector') -> 'FlowBySector': .select_by_fields() # TODO: Add a method to convert to proper industry spec. .convert_fips_to_geoscale() - .aggregate_flowby() # necessary after consolidating geoscale + .aggregate_flowby() # necessary after consolidating geoscale ) def display_tables( From 66f92c33f5c7c7a2efe39e79e984f98a693fec32 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 1 Nov 2022 20:49:51 -0400 Subject: [PATCH 0248/1127] consistent formatting for methods --- .../methods/flowbysectormethods/CRHW_national_2017.yaml | 6 +++--- flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml | 6 +++--- .../flowbysectormethods/TRI_DMR_national_2017.yaml | 8 ++++---- .../methods/flowbysectormethods/TRI_DMR_state_2017.yaml | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/CRHW_national_2017.yaml b/flowsa/methods/flowbysectormethods/CRHW_national_2017.yaml index fab590031..776d28d1a 100644 --- a/flowsa/methods/flowbysectormethods/CRHW_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CRHW_national_2017.yaml @@ -1,11 +1,11 @@ geoscale: national source_names: - "stewiFBS": - data_format: 'FBS_outside_flowsa' + stewiFBS: + data_format: FBS_outside_flowsa FBS_datapull_fxn: !script_function:stewiFBS stewi_to_sector # temporarily maintain target_sector_level for # allocation.equally_allocate_parent_to_child_naics() target_sector_level: NAICS_6 inventory_dict: {"RCRAInfo":"2017"} compartments: - - 'waste' + - waste diff --git a/flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml b/flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml index eafa7ce9c..82ec5cbf8 100644 --- a/flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml @@ -1,11 +1,11 @@ geoscale: state source_names: - "stewiFBS": - data_format: 'FBS_outside_flowsa' + stewiFBS: + data_format: FBS_outside_flowsa FBS_datapull_fxn: !script_function:stewiFBS stewi_to_sector # temporarily maintain target_sector_level for # allocation.equally_allocate_parent_to_child_naics() target_sector_level: NAICS_6 inventory_dict: {"RCRAInfo":"2017"} compartments: - - 'waste' + - waste diff --git a/flowsa/methods/flowbysectormethods/TRI_DMR_national_2017.yaml b/flowsa/methods/flowbysectormethods/TRI_DMR_national_2017.yaml index 338e0bb99..69ddab71c 100644 --- a/flowsa/methods/flowbysectormethods/TRI_DMR_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/TRI_DMR_national_2017.yaml @@ -1,12 +1,12 @@ geoscale: national source_names: - "stewiFBS": - data_format: 'FBS_outside_flowsa' + stewiFBS: + data_format: FBS_outside_flowsa FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector # temporarily maintain target_sector_level for # allocation.equally_allocate_parent_to_child_naics() target_sector_level: NAICS_6 inventory_dict: {"TRI":"2017", "DMR":"2017"} - local_inventory_name: 'TRI_DMR_2017' + local_inventory_name: TRI_DMR_2017 compartments: - - 'water' + - water diff --git a/flowsa/methods/flowbysectormethods/TRI_DMR_state_2017.yaml b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2017.yaml index 426738160..3f846f427 100644 --- a/flowsa/methods/flowbysectormethods/TRI_DMR_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2017.yaml @@ -1,12 +1,12 @@ geoscale: state source_names: - "stewiFBS": - data_format: 'FBS_outside_flowsa' + stewiFBS: + data_format: FBS_outside_flowsa FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector # temporarily maintain target_sector_level for # allocation.equally_allocate_parent_to_child_naics() target_sector_level: NAICS_6 inventory_dict: {"TRI":"2017", "DMR":"2017"} - local_inventory_name: 'TRI_DMR_2017' + local_inventory_name: TRI_DMR_2017 compartments: - - 'water' + - water From 4a109f094e7e41e5f881a406e608cc0ad9cb86fd Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 1 Nov 2022 21:14:59 -0400 Subject: [PATCH 0249/1127] update CNHW methods --- .../flowbysectormethods/CNHW_CA_2014.yaml | 85 +++++++++---------- .../CNHW_national_2014.yaml | 13 +-- 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/CNHW_CA_2014.yaml b/flowsa/methods/flowbysectormethods/CNHW_CA_2014.yaml index defd8d804..3aa53245b 100644 --- a/flowsa/methods/flowbysectormethods/CNHW_CA_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CNHW_CA_2014.yaml @@ -1,48 +1,45 @@ -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: state +industry_spec: + default: NAICS_6 +year: 2014 +target_naics_year: 2012 +geoscale: state + source_names: - "CalRecycle_WasteCharacterization": - data_format: 'FBA' - class: Other - geoscale_to_use: state + CalRecycle_WasteCharacterization: + geoscale: state year: 2014 clean_fba_df_fxn: !script_function:CalRecycle_WasteCharacterization keep_generated_quantity - mfl_mapping: 'CalRecycle' + mfl_mapping: CalRecycle activity_sets: - activity_set_1: - names: - - "Arts Entertainment Recreation" - - "Durable Wholesale Trucking" - - "Education" - - "Electronic Equipment" - - "Food Beverage Stores" - - "Food Nondurable Wholesale" - - "Hotel Lodging" - - "Medical Health" - - "Other Manufacturing" - - "Other Retail Trade" - - "Public Administration" - - "Restaurants" - - "Services Management Administration Support Social" - - "Services Professional Technical Financial" - - "Services Repair Personal" - - "Not Elsewhere Classified" - allocation_method: proportional - allocation_source: "BLS_QCEW" - allocation_source_class: "Employment" - allocation_source_year: 2014 - allocation_flow: - - "Number of employees, Federal Government" - - "Number of employees, State Government" - - "Number of employees, Local Government" - - "Number of employees, Private" - allocation_compartment: None - allocation_from_scale: state - allocation_fba_load_scale: state - clean_allocation_fba_w_sec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec - activity_set_2: - names: - - "Multifamily" - allocation_method: direct - allocation_from_scale: state + employment: + selection_fields: + PrimaryActivity: + - Arts Entertainment Recreation + - Durable Wholesale Trucking + - Education + - Electronic Equipment + - Food Beverage Stores + - Food Nondurable Wholesale + - Hotel Lodging + - Medical Health + - Other Manufacturing + - Other Retail Trade + - Public Administration + - Restaurants + - Services Management Administration Support Social + - Services Professional Technical Financial + - Services Repair Personal + - Not Elsewhere Classified + attribution_method: proportional + attribution_source: + BLS_QCEW: + year: 2014 + selection_fields: + Class: Employment + clean_fba_before_mapping: !script_function:temp_data_source_functions estimate_suppressed_qcew + clean_fba: !script_function:temp_data_source_functions clean_qcew + direct: + selection_fields: + PrimaryActivity: + - Multifamily + attribution_method: direct diff --git a/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml b/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml index 3e2d66735..655e89849 100644 --- a/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml @@ -1,8 +1,11 @@ -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: national +industry_spec: + default: NAICS_6 +year: 2014 +target_naics_year: 2012 +geoscale: national + source_names: - "CNHW_CA_2014": - data_format: 'FBS' + CNHW_CA_2014: + data_format: FBS clean_fbs_df_fxn: !script_function:CalRecycle_WasteCharacterization apply_tons_per_employee_per_year_to_states year: 2014 From dcb3166e6f7f6c64f27ad68819944d65ac040a84 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 1 Nov 2022 21:15:42 -0400 Subject: [PATCH 0250/1127] add `FBA` to source catalog --- flowsa/data/source_catalog.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index cebe739c3..3bf901b7d 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -64,6 +64,7 @@ BTS_Airlines: data_format: FBA sector-like_activities: False CalRecycle_WasteCharacterization: + data_format: FBA class: - Other sector-like_activities: False @@ -95,6 +96,7 @@ Census_QWI: activity_schema: NAICS_2012_Code sector_aggregation_level: "disaggregated" Census_VIP: + data_format: FBA class: Money sector-like_activities: False activity_schema: @@ -142,6 +144,7 @@ EIA_SEDS: sector-like_activities: False # sector_aggregation_level: "aggregated" EPA_CDDPath: + data_format: FBA class: - Other sector-like_activities: False From 5307084d9ddf80f54f561ed276a338b622875146 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 1 Nov 2022 21:31:32 -0400 Subject: [PATCH 0251/1127] update USEEIO and BEA_summary and CNHW_state --- .../flowbysectormethods/BEA_summary_target.yaml | 8 +++++--- .../flowbysectormethods/CNHW_state_2014.yaml | 16 +++++++++++----- .../USEEIO_summary_target.yaml | 9 ++++++--- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/BEA_summary_target.yaml b/flowsa/methods/flowbysectormethods/BEA_summary_target.yaml index e2a7ac4db..a1053b6c6 100644 --- a/flowsa/methods/flowbysectormethods/BEA_summary_target.yaml +++ b/flowsa/methods/flowbysectormethods/BEA_summary_target.yaml @@ -6,9 +6,11 @@ # !include:BEA_summary_target.yaml # to the top of the method replacing the three parameters below -target_sector_level: NAICS_3 -target_subset_sector_level: {NAICS_4: ['336', '541']} +industry_spec: + default: NAICS_3 + '336': {default: NAICS_4} + '541': {default: NAICS_4} # Note 531, 532, 533, and 92* are not resolved at the 3 digit NAICS # but they do not resolve at higher resolution and so using 3-digit NAICS # is sufficient -target_sector_source: NAICS_2012_Code +target_naics_year: 2012 diff --git a/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml b/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml index ebd231ca8..fa3567c67 100644 --- a/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml @@ -1,10 +1,16 @@ !include:USEEIO_summary_target.yaml -# target_sector_level: NAICS_6 -# target_sector_source: NAICS_2012_Code -target_geoscale: state +# industry_spec: +# default: NAICS_3 +# '221': {default: NAICS_4} +# '336': {default: NAICS_4} +# '541': {default: NAICS_4} +# target_naics_year: 2012 +year: 2014 +geoscale: state + source_names: - "CNHW_CA_2014": - data_format: 'FBS' + CNHW_CA_2014: + data_format: FBS clean_fbs_df_fxn: !script_function:CalRecycle_WasteCharacterization apply_tons_per_employee_per_year_to_states year: 2014 diff --git a/flowsa/methods/flowbysectormethods/USEEIO_summary_target.yaml b/flowsa/methods/flowbysectormethods/USEEIO_summary_target.yaml index b3a51eef3..2aba5703b 100644 --- a/flowsa/methods/flowbysectormethods/USEEIO_summary_target.yaml +++ b/flowsa/methods/flowbysectormethods/USEEIO_summary_target.yaml @@ -6,8 +6,11 @@ # !include:USEEIO_summary_target.yaml # to the top of the method replacing the three parameters below -target_sector_level: NAICS_3 -target_subset_sector_level: {NAICS_4: ['221', '336', '541']} +industry_spec: + default: NAICS_3 + '221': {default: NAICS_4} + '336': {default: NAICS_4} + '541': {default: NAICS_4} # In USEEIO models 221 (Utilities) is disaggregated to 2211, 2212, and 2213 # '336' and '541' carry over from the BEA summary sectors -target_sector_source: NAICS_2012_Code +target_naics_year: 2012 From ea9f8f5b514b68841bd4a1e5bc322fbab95ae045 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 2 Nov 2022 09:27:48 -0400 Subject: [PATCH 0252/1127] Fixed getFBS() and convert_to_geoscale() to allow for 1) using an FBS as a primary source and 2) converting to a subnational geoscale --- flowsa/flowby.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 4c15f8813..4b87b8442 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -53,7 +53,6 @@ def get_flowby_from_config( elif config['data_format'] == 'FBS': return FlowBySector.getFlowBySector( method=name, - full_name=name, config=config, external_config_path=external_config_path, download_sources_ok=download_sources_ok, @@ -950,10 +949,18 @@ def convert_to_geoscale( ) if target_geoscale != geo.scale.NATIONAL: + # TODO: This block of code can be simplified a great deal once + # validation.py is rewritten to use the FB config dictionary + activities = list( + self + .add_primary_secondary_columns('Activity') + .PrimaryActivity.unique() + ) + validation.compare_geographic_totals( fba_at_target_geoscale, self, self.source_name, self.config, - self.full_name.split('.')[-1], self.config['names'] + self.full_name.split('.')[-1], activities # ^^^ TODO: Rewrite validation to use fb metadata ) @@ -1553,6 +1560,7 @@ def _constructor_sliced(self) -> '_FBSSeries': def getFlowBySector( cls, method: str, + config: dict = None, external_config_path: str = None, download_sources_ok: bool = settings.DEFAULT_DOWNLOAD_IF_MISSING, download_fbs_ok: bool = settings.DEFAULT_DOWNLOAD_IF_MISSING, @@ -1577,10 +1585,12 @@ def getFlowBySector( ''' file_metadata = metadata.set_fb_meta(method, 'FlowBySector') - try: - config = common.load_yaml_dict(method, 'FBS', external_config_path) - except exceptions.FlowsaMethodNotFoundError: - config = {} + if config is None: + try: + config = common.load_yaml_dict(method, 'FBS', + external_config_path) + except exceptions.FlowsaMethodNotFoundError: + config = {} flowby_generator = ( lambda x=method, y=external_config_path, z=download_sources_ok: From b5216b17179e020132bd9e56f14f0c457e93dbc3 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 2 Nov 2022 11:58:34 -0400 Subject: [PATCH 0253/1127] refactor employment FBS yaml - still need to refactor functions --- .../Employment_common.yaml | 21 ++++++++++--------- .../Employment_national_2017.yaml | 8 ++++--- .../Employment_national_2018.yaml | 10 +++++---- .../Employment_state_2012.yaml | 8 ++++--- .../Employment_state_2013.yaml | 8 ++++--- .../Employment_state_2014.yaml | 8 ++++--- .../Employment_state_2015.yaml | 8 ++++--- .../Employment_state_2016.yaml | 8 ++++--- .../Employment_state_2017.yaml | 8 ++++--- .../Employment_state_2018.yaml | 8 ++++--- .../Employment_state_2019.yaml | 8 ++++--- .../Employment_state_2020.yaml | 8 ++++--- 12 files changed, 67 insertions(+), 44 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Employment_common.yaml b/flowsa/methods/flowbysectormethods/Employment_common.yaml index 3fc08abd1..d87c91403 100644 --- a/flowsa/methods/flowbysectormethods/Employment_common.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_common.yaml @@ -1,27 +1,28 @@ _bls_load_and_clean: &bls_load_and_clean - data_format: 'FBA' - class: Employment + selection_fields: + Class: Employment clean_fba_df_fxn: !script_function:BLS_QCEW clean_bls_qcew_fba_for_employment_sat_table clean_fba_w_sec_df_fxn: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec _bls_allocation: &bls_allocation - names: !from_index:BLS_QCEW_asets.csv qcew - allocation_method: direct + selection_fields: + PrimaryActivity: !from_index:BLS_QCEW_asets.csv qcew + attribution_method: direct bls_load_and_clean_national: <<: *bls_load_and_clean - geoscale_to_use: &geoscaleNational national - source_fba_load_scale: *geoscaleNational + geoscale: &geoscaleNational national +# source_fba_load_scale: *geoscaleNational bls_allocation_national: <<: *bls_allocation - allocation_from_scale: *geoscaleNational + geoscale: *geoscaleNational bls_load_and_clean_state: <<: *bls_load_and_clean - geoscale_to_use: &geoscaleState state - source_fba_load_scale: *geoscaleState + geoscale: &geoscaleState state +# source_fba_load_scale: *geoscaleState bls_allocation_state: <<: *bls_allocation - allocation_from_scale: *geoscaleState + geoscale: *geoscaleState diff --git a/flowsa/methods/flowbysectormethods/Employment_national_2017.yaml b/flowsa/methods/flowbysectormethods/Employment_national_2017.yaml index 86add3483..0a83ff1c3 100644 --- a/flowsa/methods/flowbysectormethods/Employment_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_national_2017.yaml @@ -1,6 +1,8 @@ -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: national +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: national + source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_national year: 2017 diff --git a/flowsa/methods/flowbysectormethods/Employment_national_2018.yaml b/flowsa/methods/flowbysectormethods/Employment_national_2018.yaml index c153c2bbe..b856f9222 100644 --- a/flowsa/methods/flowbysectormethods/Employment_national_2018.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_national_2018.yaml @@ -1,8 +1,10 @@ -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: national +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: national + source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_national year: 2018 activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation_national \ No newline at end of file + qcew: !include:Employment_common.yaml:bls_allocation_national diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2012.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2012.yaml index 668063a6e..952b41138 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2012.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2012.yaml @@ -1,6 +1,8 @@ -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: state +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: state + source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state year: 2012 diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2013.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2013.yaml index 5ed3fa2d6..05bfd4906 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2013.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2013.yaml @@ -1,6 +1,8 @@ -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: state +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: state + source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state year: 2013 diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2014.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2014.yaml index 0b81e1612..a68cb1be7 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2014.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2014.yaml @@ -1,6 +1,8 @@ -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: state +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: state + source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state year: 2014 diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2015.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2015.yaml index 9e7aeab61..1cc57eab3 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2015.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2015.yaml @@ -1,6 +1,8 @@ -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: state +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: state + source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state year: 2015 diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2016.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2016.yaml index 141861255..4d24dd3ad 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2016.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2016.yaml @@ -1,6 +1,8 @@ -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: state +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: state + source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state year: 2016 diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2017.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2017.yaml index 1c5cc5d72..d4d540816 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2017.yaml @@ -1,6 +1,8 @@ -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: state +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: state + source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state year: 2017 diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2018.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2018.yaml index 92a0396b6..ff7dc8e6f 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2018.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2018.yaml @@ -1,6 +1,8 @@ -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: state +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: state + source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state year: 2018 diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2019.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2019.yaml index 28ac0a2d6..c62506b59 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2019.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2019.yaml @@ -1,6 +1,8 @@ -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: state +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: state + source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state year: 2019 diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2020.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2020.yaml index c0a6b5bb5..1779709a7 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2020.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2020.yaml @@ -1,6 +1,8 @@ -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: state +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: state + source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state year: 2020 From b66f4a2730f3b4c256956e04c232c3481c2a60ca Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 2 Nov 2022 11:59:08 -0400 Subject: [PATCH 0254/1127] add data format to additional FBAs --- flowsa/data/source_catalog.yaml | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 3bf901b7d..8b0d10a50 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -1,28 +1,33 @@ Blackhurst_IO: + data_format: FBA class: - Water sector-like_activities: False activity_schema: sector_aggregation_level: "disaggregated" BLM_PLS: + data_format: FBA class: - Land sector-like_activities: False activity_schema: sector_aggregation_level: "aggregated" BEA_GDP: + data_format: FBA class: - Money sector-like_activities: False # activity_schema: BEA_2012_Detail_Code sector_aggregation_level: "disaggregated" BEA_GDP_GrossOutput: + data_format: FBA class: - Money sector-like_activities: False # activity_schema: BEA_2012_Detail_Code sector_aggregation_level: "disaggregated" BEA_Use: + data_format: FBA class: - Money sector-like_activities: False #update to true once alternate activity_schema in place @@ -70,13 +75,8 @@ CalRecycle_WasteCharacterization: sector-like_activities: False activity_schema: sector_aggregation_level: "aggregated" -Census_AHS: - class: - - Land - sector-like_activities: False - activity_schema: - sector_aggregation_level: "disaggregated" Census_CBP: + data_format: FBA class: - Employment - Money @@ -85,11 +85,13 @@ Census_CBP: activity_schema: NAICS_2012_Code sector_aggregation_level: "disaggregated" Census_PEP_Population: + data_format: FBA class: Other sector-like_activities: False activity_schema: sector_aggregation_level: "" Census_QWI: + data_format: FBA class: - Employment sector-like_activities: True @@ -102,16 +104,19 @@ Census_VIP: activity_schema: sector_aggregation_level: "aggregated" EIA_CBECS_Land: + data_format: FBA class: Land sector-like_activities: False activity_schema: sector_aggregation_level: "aggregated" EIA_CBECS_Water: + data_format: FBA class: Water sector-like_activities: False activity_schema: sector_aggregation_level: "aggregated" EIA_AEO: + data_format: FBA class: - Energy sector-like_activities: False @@ -126,18 +131,21 @@ EIA_MECS_Energy: activity_schema: NAICS_2012_Code sector_aggregation_level: "disaggregated" EIA_MECS_Land: + data_format: FBA class: - Land sector-like_activities: True activity_schema: sector_aggregation_level: "disaggregated" EIA_MER: + data_format: FBA class: - Energy sector-like_activities: False activity_schema: sector_aggregation_level: "disaggregated" EIA_SEDS: + data_format: FBA class: - Energy - Money @@ -253,36 +261,42 @@ USDA_CoA_Cropland_NAICS: activity_schema: NAICS_2012_Code sector_aggregation_level: "disaggregated" USDA_CoA_Livestock: + data_format: FBA class: - Other sector-like_activities: False activity_schema: sector_aggregation_level: "disaggregated" USDA_ERS_FIWS: + data_format: FBA class: - Money sector-like_activities: False activity_schema: sector_aggregation_level: "" USDA_ERS_MLU: + data_format: FBA class: - Land sector-like_activities: False activity_schema: sector_aggregation_level: "aggregated" USDA_IWMS: + data_format: FBA class: - Water sector-like_activities: False activity_schema: sector_aggregation_level: "aggregated" USGS_NWIS_WU: + data_format: FBA class: - Water sector-like_activities: False activity_schema: sector_aggregation_level: "aggregated" USGS_WU_Coef: + data_format: FBA class: - Water sector-like_activities: False From 5e218d616ac9dedef1ffc78cfe0be63eea66adb0 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 2 Nov 2022 12:06:56 -0400 Subject: [PATCH 0255/1127] update keys --- flowsa/methods/flowbysectormethods/Employment_common.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Employment_common.yaml b/flowsa/methods/flowbysectormethods/Employment_common.yaml index d87c91403..45d2af083 100644 --- a/flowsa/methods/flowbysectormethods/Employment_common.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_common.yaml @@ -1,8 +1,8 @@ _bls_load_and_clean: &bls_load_and_clean selection_fields: Class: Employment - clean_fba_df_fxn: !script_function:BLS_QCEW clean_bls_qcew_fba_for_employment_sat_table - clean_fba_w_sec_df_fxn: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec + clean_fba: !script_function:BLS_QCEW clean_bls_qcew_fba_for_employment_sat_table + clean_fba_w_sec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec _bls_allocation: &bls_allocation selection_fields: From 05c19db9c89c6cf5c9ec8e5d95ac740220050e6c Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 2 Nov 2022 12:26:44 -0400 Subject: [PATCH 0256/1127] update employment FBS to use recursive functions --- .../temp_data_source_functions.py | 23 +++++++++++++++++++ .../Employment_common.yaml | 4 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index 6b1aed70c..b168f7c83 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -53,6 +53,29 @@ def clean_qcew(fba: FlowByActivity, **kwargs): return filtered +def clean_qcew_for_fbs(fba: FlowByActivity, **kwargs): + """ + clean up bls df with sectors by estimating suppresed data + :param df_w_sec: df, FBA format BLS QCEW data + :param kwargs: additional arguments can include 'attr', a + dictionary of FBA method yaml parameters + :return: df, BLS QCEW FBA with estimated suppressed data + """ + df = clean_qcew(FlowByActivity, **kwargs) + + # for purposes of allocation, we do not need to differentiate between + # federal government, state government, local government, or private + # sectors. So after estimating the suppressed data (above), modify the + # flow names and aggregate data + df['Flowable'] = df['Flowable'].str.split(',').str[0] + df2 = aggregator(df, groupcols) + + # rename flowname value + df2['Flowable'] = df2['Flowable'].str.replace('Number of employees', 'Jobs') + + return df2 + + def estimate_suppressed_qcew(fba: FlowByActivity) -> FlowByActivity: if fba.config.get('geoscale') == 'national': fba = fba.query('Location == "00000"') diff --git a/flowsa/methods/flowbysectormethods/Employment_common.yaml b/flowsa/methods/flowbysectormethods/Employment_common.yaml index 45d2af083..b93b77cea 100644 --- a/flowsa/methods/flowbysectormethods/Employment_common.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_common.yaml @@ -1,8 +1,8 @@ _bls_load_and_clean: &bls_load_and_clean selection_fields: Class: Employment - clean_fba: !script_function:BLS_QCEW clean_bls_qcew_fba_for_employment_sat_table - clean_fba_w_sec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec + clean_fba_before_mapping: !script_function:temp_data_source_functions estimate_suppressed_qcew + clean_fba: !script_function:temp_data_source_functions clean_qcew_for_fbs _bls_allocation: &bls_allocation selection_fields: From 5bb98b337a761eea1729365b759c5d1cff0307ab Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 2 Nov 2022 12:37:41 -0400 Subject: [PATCH 0257/1127] revise apply_tons_per_employee_per_year_to_states, maintain target_sector_level for `get_sector_list()` --- .../CalRecycle_WasteCharacterization.py | 13 ++++++------- flowsa/flowbyfunctions.py | 2 +- .../flowbysectormethods/CNHW_national_2014.yaml | 3 +++ .../flowbysectormethods/CNHW_state_2014.yaml | 6 ------ .../flowbysectormethods/USEEIO_summary_target.yaml | 4 ++++ 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py b/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py index 9a7d1c985..d5e60d625 100644 --- a/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py +++ b/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py @@ -125,20 +125,16 @@ def keep_generated_quantity(fba, **_): return fba -def apply_tons_per_employee_per_year_to_states(fbs, method, **_): +def apply_tons_per_employee_per_year_to_states(fbs, **kwargs): """ Calculates tons per employee per year based on BLS_QCEW employees by sector and applies that quantity to employees in all states clean_fbs_df_fxn """ bls = load_fba_w_standardized_units(datasource='BLS_QCEW', - year=fbs['Year'].unique()[0], + year=fbs.config['year'], flowclass='Employment', geographic_level='state') - bls = bls[bls['FlowName'].isin(["Number of employees, Federal Government", - "Number of employees, State Government", - "Number of employees, Local Government", - "Number of employees, Private"])] bls = add_sectors_to_flowbyactivity(bls) # Subset BLS dataset @@ -164,7 +160,10 @@ def apply_tons_per_employee_per_year_to_states(fbs, method, **_): national_waste['FlowAmount'] = \ national_waste['Employees'] * national_waste['TPEPY'] - df = aggregate_and_subset_for_target_sectors(national_waste, method) + df = aggregate_and_subset_for_target_sectors(national_waste, + national_waste.config) + # Ensure config remains on the dataframe + df.config = national_waste.config df = replace_strings_with_NoneType(df) return df diff --git a/flowsa/flowbyfunctions.py b/flowsa/flowbyfunctions.py index 9ef4faa1b..3d9733da5 100644 --- a/flowsa/flowbyfunctions.py +++ b/flowsa/flowbyfunctions.py @@ -1173,7 +1173,7 @@ def aggregate_and_subset_for_target_sectors(df, method): # load the crosswalk linking sector lengths secondary_sector_level = method.get('target_subset_sector_level') sector_list = get_sector_list( - method['target_sector_level'], + method.get('target_sector_level'), secondary_sector_level_dict=secondary_sector_level) # subset df to get NAICS at the target level diff --git a/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml b/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml index 655e89849..f0fcceb43 100644 --- a/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml @@ -4,6 +4,9 @@ year: 2014 target_naics_year: 2012 geoscale: national +# Needed temporarily still for aggregate_and_subset_for_target_sectors +target_sector_level: NAICS_6 + source_names: CNHW_CA_2014: data_format: FBS diff --git a/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml b/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml index fa3567c67..26d4f079e 100644 --- a/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml @@ -1,10 +1,4 @@ !include:USEEIO_summary_target.yaml -# industry_spec: -# default: NAICS_3 -# '221': {default: NAICS_4} -# '336': {default: NAICS_4} -# '541': {default: NAICS_4} -# target_naics_year: 2012 year: 2014 geoscale: state diff --git a/flowsa/methods/flowbysectormethods/USEEIO_summary_target.yaml b/flowsa/methods/flowbysectormethods/USEEIO_summary_target.yaml index 2aba5703b..5d4ee92f3 100644 --- a/flowsa/methods/flowbysectormethods/USEEIO_summary_target.yaml +++ b/flowsa/methods/flowbysectormethods/USEEIO_summary_target.yaml @@ -14,3 +14,7 @@ industry_spec: # In USEEIO models 221 (Utilities) is disaggregated to 2211, 2212, and 2213 # '336' and '541' carry over from the BEA summary sectors target_naics_year: 2012 + +# Needed temporarily still for some old subetting functions +target_sector_level: NAICS_3 +target_subset_sector_level: {NAICS_4: ['221', '336', '541']} From 651b62f9e59c51c1ee71251fcf3dfb2110e54b1a Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 2 Nov 2022 14:45:21 -0400 Subject: [PATCH 0258/1127] separate `convert_daily_to_annual()` from `standardize_units()` --- flowsa/flowby.py | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 4b87b8442..35599b895 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -244,6 +244,17 @@ def _getFlowBy( fb = cls(df, full_name=full_name or '', config=config or {}) return fb + def convert_daily_to_annual(self: FB) -> FB: + if any(self.Unit.str.contains('/d')): + log.info('Converting daily flows %s to annual', + [unit for unit in self.Unit.unique() if '/d' in unit]) + return ( + self + .assign(FlowAmount=self.FlowAmount.mask( + self.Unit.str.contains('/d'), self.FlowAmount * 365), + Unit=self.Unit.str.replace('/d', '')) + ) + def standardize_units(self: FB) -> FB: exchange_rate = ( literature_values @@ -257,16 +268,9 @@ def standardize_units(self: FB) -> FB: 'conversion_factor': 1 / exchange_rate}).to_frame().T ]) - if any(self.Unit.str.contains('/d')): - log.info('Converting daily flows %s to annual', - [unit for unit in self.Unit.unique() if '/d' in unit]) - standardized = ( self .assign(Unit=self.Unit.str.strip()) - .assign(FlowAmount=self.FlowAmount.mask( - self.Unit.str.contains('/d'), self.FlowAmount * 365), - Unit=self.Unit.str.replace('/d', '')) .merge(conversion_table, how='left', left_on='Unit', right_on='old_unit') .assign(Unit=lambda x: x.new_unit.mask(x.new_unit.isna(), x.Unit), @@ -1468,12 +1472,13 @@ def convert_units_and_flows( self = self.assign(FlowAmount=self.FlowAmount * self.config['adjustment_factor']) - standardized = self.standardize_units() + self = self.convert_daily_to_annual() if self.config.get('fedefl_mapping'): - return standardized.map_to_fedefl_list() + mapped = self.map_to_fedefl_list() else: - return standardized.rename(columns={'FlowName': 'Flowable', - 'Compartment': 'Context'}) + mapped = self.rename(columns={'FlowName': 'Flowable', + 'Compartment': 'Context'}) + return (mapped.standardize_units()) def convert_activity_to_emissions( self: 'FlowByActivity' From 0911316bd86625606eb91d1b95cdcede04f355d7 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 2 Nov 2022 15:40:41 -0400 Subject: [PATCH 0259/1127] replace BLS_QCEW with employment FBS --- .../CAP_HAP_national_2017.yaml | 31 ++++++++----------- .../flowbysectormethods/CNHW_CA_2014.yaml | 7 ++--- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index f7668539f..7cc6853e0 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -5,21 +5,7 @@ year: 2017 target_naics_year: 2012 geoscale: national -sources_to_cache: - BLS_QCEW: - year: 2014 - selection_fields: - Class: Employment - clean_fba_before_mapping: !script_function:temp_data_source_functions estimate_suppressed_qcew - clean_fba: !script_function:temp_data_source_functions clean_qcew - # clean_fba_wsec_df_fxn: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec - BLS_QCEW: # What to do about same data source but different year? - year: 2012 - selection_fields: - Class: Employment - clean_fba_before_mapping: !script_function:temp_data_source_functions estimate_suppressed_qcew - clean_fba: !script_function:temp_data_source_functions clean_qcew - # clean_fba_wsec_df_fxn: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec +# sources_to_cache: _attribution_sources: EIA_MECS_Energy: &mecs_energy @@ -37,13 +23,19 @@ _attribution_sources: # clean_fba_df_fxn: !script_function:EIA_MECS mecs_energy_fba_cleanup # clean_fba_w_sec_df_fxn: !script_function:EIA_MECS eia_mecs_energy_clean_allocation_fba_w_sec attribution_method: proportional # cleaning fxns remove need for proportional-flagged - attribution_source: BLS_QCEW + attribution_source: + Employment_national_2018: # replace with 2014 when available + data_format: FBS + year: 2018 BEA: &bea year: 2012 activity_to_sector_mapping: BEA_2012_Detail attribution_method: proportional - attribution_source: BLS_QCEW + attribution_source: + Employment_national_2018: # replace with 2012 when available + data_format: FBS + year: 2018 source_names: EPA_NEI_Nonpoint: @@ -213,7 +205,10 @@ source_names: Class: Money FlowName: Gross Output attribution_method: proportional - attribution_source: BLS_QCEW + attribution_source: + Employment_national_2017: + data_format: FBS + year: 2017 "EPA_NEI_Nonroad": diff --git a/flowsa/methods/flowbysectormethods/CNHW_CA_2014.yaml b/flowsa/methods/flowbysectormethods/CNHW_CA_2014.yaml index 3aa53245b..1aa27c729 100644 --- a/flowsa/methods/flowbysectormethods/CNHW_CA_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CNHW_CA_2014.yaml @@ -32,12 +32,9 @@ source_names: - Not Elsewhere Classified attribution_method: proportional attribution_source: - BLS_QCEW: + Employment_state_2014: + data_format: FBS year: 2014 - selection_fields: - Class: Employment - clean_fba_before_mapping: !script_function:temp_data_source_functions estimate_suppressed_qcew - clean_fba: !script_function:temp_data_source_functions clean_qcew direct: selection_fields: PrimaryActivity: From af981e369ce076fa54d9e2840a9ddc143083b99b Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 2 Nov 2022 15:48:45 -0400 Subject: [PATCH 0260/1127] update clean_qcew_for_fbs() --- .../data_source_scripts/temp_data_source_functions.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index b168f7c83..d02562a73 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -12,6 +12,7 @@ def clean_qcew(fba: FlowByActivity, **kwargs): + #todo: check function method for state if fba.config.get('geoscale') == 'national': fba = fba.query('Location == "00000"') @@ -61,17 +62,15 @@ def clean_qcew_for_fbs(fba: FlowByActivity, **kwargs): dictionary of FBA method yaml parameters :return: df, BLS QCEW FBA with estimated suppressed data """ - df = clean_qcew(FlowByActivity, **kwargs) + df = clean_qcew(fba, **kwargs) # for purposes of allocation, we do not need to differentiate between # federal government, state government, local government, or private # sectors. So after estimating the suppressed data (above), modify the # flow names and aggregate data - df['Flowable'] = df['Flowable'].str.split(',').str[0] - df2 = aggregator(df, groupcols) - - # rename flowname value - df2['Flowable'] = df2['Flowable'].str.replace('Number of employees', 'Jobs') + df['Flowable'] = (df['Flowable'].str.split(',').str[0] + .str.replace('Number of employees', 'Jobs')) + df2 = df.aggregate_flowby() return df2 From ae42b139d110edc8e32a52b0ec2f5c883407a018 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 2 Nov 2022 16:45:14 -0400 Subject: [PATCH 0261/1127] add location to national selection fields for Employment_common.yaml --- .../flowbysectormethods/Employment_common.yaml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Employment_common.yaml b/flowsa/methods/flowbysectormethods/Employment_common.yaml index b93b77cea..20054d98d 100644 --- a/flowsa/methods/flowbysectormethods/Employment_common.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_common.yaml @@ -1,6 +1,14 @@ -_bls_load_and_clean: &bls_load_and_clean +_bls_selection_fields_national: &bls_selection_fields_national + selection_fields: + Class: Employment + Location: '00000' + +_bls_selection_fields_state: &bls_selection_fields_state selection_fields: Class: Employment +# Location: + +_bls_load_and_clean: &bls_load_and_clean clean_fba_before_mapping: !script_function:temp_data_source_functions estimate_suppressed_qcew clean_fba: !script_function:temp_data_source_functions clean_qcew_for_fbs @@ -10,18 +18,18 @@ _bls_allocation: &bls_allocation attribution_method: direct bls_load_and_clean_national: + <<: *bls_selection_fields_national <<: *bls_load_and_clean geoscale: &geoscaleNational national -# source_fba_load_scale: *geoscaleNational bls_allocation_national: <<: *bls_allocation geoscale: *geoscaleNational bls_load_and_clean_state: + <<: *bls_selection_fields_state <<: *bls_load_and_clean geoscale: &geoscaleState state -# source_fba_load_scale: *geoscaleState bls_allocation_state: <<: *bls_allocation From 9a53b77934056fa2f2d973cf015bdcb493f0e587 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 2 Nov 2022 16:53:22 -0400 Subject: [PATCH 0262/1127] Modify validation.compare_geographic_totals() to work with new-style FBAs/FBSs --- flowsa/flowby.py | 3 ++- flowsa/validation.py | 26 +++++++++++++++++++------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 4b87b8442..8da0461f5 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -960,7 +960,8 @@ def convert_to_geoscale( validation.compare_geographic_totals( fba_at_target_geoscale, self, self.source_name, self.config, - self.full_name.split('.')[-1], activities + self.full_name.split('.')[-1], activities, + df_type='FBS', subnational_geoscale=target_geoscale # ^^^ TODO: Rewrite validation to use fb metadata ) diff --git a/flowsa/validation.py b/flowsa/validation.py index 678d68fb0..6c0b3adb5 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -970,7 +970,9 @@ def compare_FBS_results(fbs1, fbs2, ignore_metasources=False, def compare_geographic_totals( - df_subset, df_load, sourcename, attr, activity_set, activity_names): + df_subset, df_load, sourcename, attr, activity_set, activity_names, + df_type='FBA', subnational_geoscale=None +): """ Check for any data loss between the geoscale used and published national data @@ -980,7 +982,11 @@ def compare_geographic_totals( :param attr: dictionary, attributes :param activity_set: str, activity set :param activity_names: list of names in the activity set by which - to subset national level data + to subset national level data + :param type: str, 'FBA' or 'FBS' + :param subnational_geoscale: geoscale being compared against the + national geoscale. Only necessary if df_subset is a FlowBy object + rather than a DataFrame. :return: df, comparing published national level data to df subset """ @@ -1003,9 +1009,13 @@ def compare_geographic_totals( columns={'FlowAmount': 'FlowAmount_sub'}) # compare df - merge_cols = ['Class', 'SourceName', 'FlowName', 'Unit', - 'FlowType', 'ActivityProducedBy', 'ActivityConsumedBy', - 'Compartment', 'Location', 'LocationSystem', 'Year'] + merge_cols = (['Class', 'SourceName', 'FlowName', 'Unit', + 'FlowType', 'ActivityProducedBy', 'ActivityConsumedBy', + 'Compartment', 'Location', 'LocationSystem', 'Year'] + if df_type == 'FBA' else + ['Class', 'SourceName', 'Flowable', 'Unit', + 'FlowType', 'ActivityProducedBy', 'ActivityConsumedBy', + 'Context', 'Location', 'LocationSystem', 'Year']) # comapare units compare_df_units(nat, sub2) df_m = pd.merge(nat[merge_cols + ['FlowAmount_nat']], @@ -1021,14 +1031,16 @@ def compare_geographic_totals( df_m_sub = df_m[(df_m['Percent_Diff'] > 1) | (df_m['Percent_Diff'].isna())].reset_index(drop=True) + subnational_geoscale = (subnational_geoscale + or attr['allocation_from_scale']) if len(df_m_sub) == 0: vLog.info('No data loss greater than 1%% between national ' 'level data and %s subset', - attr['allocation_from_scale']) + subnational_geoscale) else: vLog.info('There are data differences between published national' ' values and %s subset, saving to validation log', - attr['allocation_from_scale']) + subnational_geoscale) vLogDetailed.info( 'Comparison of National FlowAmounts to aggregated data ' From c8293d03c0cde83dbe1282e6a57edd48328cbd22 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 2 Nov 2022 16:55:00 -0400 Subject: [PATCH 0263/1127] Prevent log message saying we will attempt to download a FlowBy dataset even when downlaoding is not allowed. --- flowsa/flowby.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 8da0461f5..039794030 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -205,12 +205,15 @@ def _getFlowBy( paths = deepcopy(settings.paths) paths.local_path = external_data_path or paths.local_path - for attempt in ['import local', 'download', 'generate']: + attempt_list = (['import local', 'download', 'generate'] + if download_ok else ['import local', 'generate']) + + for attempt in attempt_list: log.info( 'Attempting to %s %s %s', attempt, file_metadata.name_data, file_metadata.category ) - if attempt == 'download' and download_ok: + if attempt == 'download': esupy.processed_data_mgmt.download_from_remote( file_metadata, paths From 23a07baadbe27f653b5a24f78391ad3b92f8cb37 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 2 Nov 2022 17:11:51 -0400 Subject: [PATCH 0264/1127] convert water_national_2015_m1 to recursive method --- .../Water_national_2015_m1.yaml | 162 +++++++++--------- 1 file changed, 78 insertions(+), 84 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index 8efd8fc96..6d1602031 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -1,89 +1,83 @@ -%YAML 1.1 +# Attribute USGS NWIS water withdrawal to sectors. ---- +industry_spec: + default: NAICS_6 +year: 2015 +target_naics_year: 2012 +geoscale: national -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: national source_names: "USGS_NWIS_WU": - data_format: 'FBA' - class: Water - geoscale_to_use: state - year: 2015 - clean_fba_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup - clean_fba_w_sec_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_w_sectors_data_cleanup + fedefl_mapping: USGS_NWIS_WU + geoscale: state + clean_fba: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup + clean_fba_w_sec: !script_function:USGS_NWIS_WU usgs_fba_w_sectors_data_cleanup activity_sets: - activity_set_1: - names: - - "Aquaculture" - - "Irrigation Golf Courses" - - "Public Supply" - - "Thermoelectric Power" - - "Domestic" - allocation_method: direct - allocation_source: None - allocation_source_class: None - allocation_source_year: None - allocation_flow: None - allocation_compartment: None - allocation_from_scale: state - activity_set_2: - names: - - "Industrial" - - "Mining" - allocation_method: proportional - allocation_source: "BLS_QCEW" - allocation_source_class: "Employment" - allocation_source_year: 2015 - allocation_flow: - - "Number of employees, Federal Government" - - "Number of employees, State Government" - - "Number of employees, Local Government" - - "Number of employees, Private" - allocation_compartment: None - allocation_from_scale: national - clean_allocation_fba_w_sec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec - activity_set_3: - names: - - "Irrigation Crop" - allocation_method: proportional - allocation_source: "USDA_CoA_Cropland" - allocation_source_class: "Land" - allocation_source_year: 2017 - allocation_flow: - - "AREA HARVESTED, IRRIGATED" - - "AREA IN PRODUCTION, IRRIGATED" - - "AREA, IRRIGATED" - - 'AREA BEARING & NON-BEARING, IRRIGATED' - - 'AREA GROWN, IRRIGATED' - allocation_compartment: None - allocation_from_scale: state - clean_allocation_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics_for_water_withdrawal - helper_source: "USDA_IWMS" - helper_method: multiplication - helper_source_class: "Water" - helper_source_year: 2018 - helper_flow: None - helper_from_scale: state - clean_helper_fba_wsec: !script_function:USDA_IWMS iwms_aggregation - activity_set_4: - names: - - "Livestock" - allocation_method: proportional - allocation_source: "USDA_CoA_Livestock" - allocation_source_class: "Other" - allocation_source_year: 2017 - allocation_flow: - - "HEAD" - - "NUMBER" - - "COLONIES" - allocation_compartment: - - "NOT SPECIFIED" - allocation_from_scale: state - helper_source: "USGS_WU_Coef" - helper_method: multiplication - helper_source_class: "Water" - helper_source_year: 2005 - helper_flow: None - helper_from_scale: national + direct_attribution: + selection_fields: + PrimaryActivity: + - "Aquaculture" + - "Irrigation Golf Courses" + - "Public Supply" + - "Thermoelectric Power" + - "Domestic" + attribution_method: direct + employment_attribution: + selection_fields: + PrimaryActivity: + - "Industrial" + - "Mining" + attribution_method: proportional + attribution_source: + BLS_QCEW: + year: 2015 + geoscale: national + selection_fields: + Class: "Employment" + clean_fba_w_sec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec + cropland_attribution: + selection_fields: + PrimaryActivity: + - "Irrigation Crop" + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland: + year: 2017 + geoscale: state + selection_fields: + Class: "Land" + FlowName: + - "AREA HARVESTED, IRRIGATED" + - "AREA IN PRODUCTION, IRRIGATED" + - "AREA, IRRIGATED" + - 'AREA BEARING & NON-BEARING, IRRIGATED' + - 'AREA GROWN, IRRIGATED' + clean_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics_for_water_withdrawal + attribution_method: multiplication + attribution_source: + USDA_IWMS: + year: 2018 + geoscale: state + clean_fba_wsec: !script_function:USDA_IWMS iwms_aggregation + livestock_attribution: + selection_fields: + PrimaryActivity: + - "Livestock" + attribution_method: proportional + attribution_source: + USDA_CoA_Livestock: + year: 2017 + geoscale: state + selection_fields: + Class: Other + FlowName: + - "HEAD" + - "NUMBER" + - "COLONIES" + Compartment: + - "NOT SPECIFIED" + attribution_method: multiplication + attribution_source: + USGS_WU_Coef: + year: 2005 + geoscale: national From ee7e30713ab77818c2c29d424f2b0c81277725fa Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 2 Nov 2022 17:14:32 -0400 Subject: [PATCH 0265/1127] update flowname/compartment to flowable/context for usgs_nwis_wu data cleanup for recursive version --- flowsa/data_source_scripts/USGS_NWIS_WU.py | 49 +++++++++++----------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/flowsa/data_source_scripts/USGS_NWIS_WU.py b/flowsa/data_source_scripts/USGS_NWIS_WU.py index 5fcf66f36..1e27a437e 100644 --- a/flowsa/data_source_scripts/USGS_NWIS_WU.py +++ b/flowsa/data_source_scripts/USGS_NWIS_WU.py @@ -392,7 +392,7 @@ def usgs_fba_data_cleanup(fba, **_): vLogDetailed.info('Drop rows where the FlowName is total to prevent' 'double counting at the state and county levels. ' 'Retain rows at national level') - df2 = dfc[dfc['FlowName'] == 'total'] + df2 = dfc[dfc['Flowable'] == 'Water'] # set conditions for data to keep when flowname = 'total c1 = df2['Location'] != US_FIPS c2 = (~df2['ActivityProducedBy'].isnull()) & \ @@ -401,8 +401,8 @@ def usgs_fba_data_cleanup(fba, **_): df2 = df2[c1 & c2].reset_index(drop=True) # second subset doesn't have total flowname or total compartment - df3 = dfc[dfc['FlowName'] != 'total'] - df3 = df3[df3['Compartment'] != 'total'] + df3 = dfc[dfc['Flowable'] != 'Water'] + df3 = df3[df3['Context'] != 'resource/water'] df3 = df3[df3['Location'] != US_FIPS] # concat the two df @@ -411,7 +411,7 @@ def usgs_fba_data_cleanup(fba, **_): # In 2015, there is data for consumptive water use for # thermo and crop, drop because do not calculate consumptive water loss # for all water categories - dfd = dfd[dfd['Compartment'] != 'air'].reset_index(drop=True) + dfd = dfd[dfd['Context'] != 'air'].reset_index(drop=True) return dfd @@ -471,10 +471,10 @@ def calculate_net_public_supply(df_load): # split consumed further into fresh water (assumption domestic # deliveries are freshwater) assumption that water withdrawal taken # equally from ground and surface - df_w1 = df_w[(df_w['FlowName'] == 'fresh') & - (df_w['Compartment'] != 'total')] - df_w2 = df_w[(df_w['FlowName'] == 'fresh') & - (df_w['Compartment'] == 'total')] + df_w1 = df_w[(df_w['Flowable'] == 'Water, fresh') & + (df_w['Context'] != 'resource/water')] + df_w2 = df_w[(df_w['Flowable'] == 'Water, fresh') & + (df_w['Context'] == 'resource/water')] # compare units compare_df_units(df_w1, df_w2) df_wm = pd.merge(df_w1, df_w2[['FlowAmount', 'Location', 'Unit']], @@ -506,17 +506,16 @@ def calculate_net_public_supply(df_load): # compare units compare_df_units(df_d, net_ps) - # because assuming domestic is all fresh, drop - # flowname/flowable/Compartment/context + # because assuming domestic is all fresh, drop flowable/context # and instead use those column data from the net_ps df - df_d_modified = df_d.drop(columns=['FlowName', 'Flowable', 'Compartment', - 'Context', 'FlowUUID']) + df_d_modified = df_d.drop(columns=['Flowable', 'Context', 'FlowUUID']) # Also allocate to ground/surface from state ratios - df_d_modified = pd.merge( - df_d_modified, net_ps[['FlowName', 'Flowable', 'Compartment', - 'Context', 'FlowUUID', 'Location', - 'FlowRatio']], - how='left', left_on='Location', right_on='Location') + df_d_modified = pd.merge(df_d_modified, + net_ps[['Flowable', 'Context', 'FlowUUID', + 'Location', 'FlowRatio']], + how='left', + left_on='Location', + right_on='Location') df_d_modified.loc[:, 'FlowAmount'] = \ df_d_modified['FlowAmount'] * df_d_modified['FlowRatio'] df_d_modified = df_d_modified.drop(columns=["FlowRatio"]) @@ -599,12 +598,12 @@ def subset_and_merge_irrigation_types(df): # merge the golf and total irrigation into crop df and # modify crop FlowAmounts if necessary df_m = pd.merge(df_i, - df_g[['FlowName', 'FlowAmount', 'ActivityProducedBy', - 'ActivityConsumedBy', 'Compartment', 'Location', + df_g[['Flowable', 'FlowAmount', 'ActivityProducedBy', + 'ActivityConsumedBy', 'Context', 'Location', 'Year']], how='outer', - right_on=['FlowName', 'Compartment', 'Location', 'Year'], - left_on=['FlowName', 'Compartment', 'Location', 'Year']) + right_on=['Flowable', 'Context', 'Location', 'Year'], + left_on=['Flowable', 'Context', 'Location', 'Year']) df_m = df_m.rename(columns={"FlowAmount_x": "FlowAmount", "ActivityProducedBy_x": "ActivityProducedBy", "ActivityConsumedBy_x": "ActivityConsumedBy", @@ -614,12 +613,12 @@ def subset_and_merge_irrigation_types(df): }) compare_df_units(df_m, df_c) df_m2 = pd.merge(df_m, - df_c[['FlowName', 'FlowAmount', 'ActivityProducedBy', - 'ActivityConsumedBy', 'Compartment', + df_c[['Flowable', 'FlowAmount', 'ActivityProducedBy', + 'ActivityConsumedBy', 'Context', 'Location', 'Year', 'Description']], how='outer', - right_on=['FlowName', 'Compartment', 'Location', 'Year'], - left_on=['FlowName', 'Compartment', 'Location', 'Year']) + right_on=['Flowable', 'Context', 'Location', 'Year'], + left_on=['Flowable', 'Context', 'Location', 'Year']) df_m2 = df_m2.rename(columns={"FlowAmount_x": "FlowAmount", "ActivityProducedBy_x": "ActivityProducedBy", "ActivityConsumedBy_x": "ActivityConsumedBy", From f2628c6695233c7cf4599d3231fd9403920580f4 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 2 Nov 2022 17:31:50 -0400 Subject: [PATCH 0266/1127] add new employment national fbs --- .../flowbysectormethods/Employment_national_2012.yaml | 10 ++++++---- .../flowbysectormethods/Employment_national_2014.yaml | 10 ++++++---- .../flowbysectormethods/Employment_national_2015.yaml | 10 ++++++---- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Employment_national_2012.yaml b/flowsa/methods/flowbysectormethods/Employment_national_2012.yaml index 4f07f082e..96d0ba8d5 100644 --- a/flowsa/methods/flowbysectormethods/Employment_national_2012.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_national_2012.yaml @@ -1,8 +1,10 @@ -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: national +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: national + source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_national year: 2012 activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation_national + qcew: !include:Employment_common.yaml:bls_allocation_national \ No newline at end of file diff --git a/flowsa/methods/flowbysectormethods/Employment_national_2014.yaml b/flowsa/methods/flowbysectormethods/Employment_national_2014.yaml index 0401cef22..e6df649fc 100644 --- a/flowsa/methods/flowbysectormethods/Employment_national_2014.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_national_2014.yaml @@ -1,8 +1,10 @@ -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: national +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: national + source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_national year: 2014 activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation_national + qcew: !include:Employment_common.yaml:bls_allocation_national \ No newline at end of file diff --git a/flowsa/methods/flowbysectormethods/Employment_national_2015.yaml b/flowsa/methods/flowbysectormethods/Employment_national_2015.yaml index 70ac5a6fa..7d0ef05b4 100644 --- a/flowsa/methods/flowbysectormethods/Employment_national_2015.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_national_2015.yaml @@ -1,8 +1,10 @@ -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: national +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: national + source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_national year: 2015 activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation_national + qcew: !include:Employment_common.yaml:bls_allocation_national \ No newline at end of file From 0bae6cfda6e809fbddc0366f87f57cf938b2bebb Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 2 Nov 2022 20:28:07 -0400 Subject: [PATCH 0267/1127] allow cached datasets to undergo futher selection --- flowsa/flowby.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 35599b895..e919ab09a 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1003,11 +1003,22 @@ def attribute_flows_to_sectors( if attribution_method == 'proportional': # First check cache for FlowBy - if isinstance(fba.config['attribution_source'], str): - attribution_fbs = (fba.config['cache'] - [fba.config['attribution_source']]) + attribution_source = fba.config['attribution_source'] + if isinstance(attribution_source, str): + # attribution_source as string MUST BE cached + attribution_fbs = (fba.config['cache'][attribution_source]) else: (name, config), = fba.config['attribution_source'].items() + if name in fba.config['cache'].keys(): + # cached attribution_source passed as dictionary can include + # additional selection fields + attribution_fbs = fba.config['cache'][name] + if config.get('selection_fields'): + attribution_fbs = (attribution_fbs + .select_by_fields( + config.get('selection_fields') + )) + else: attribution_fbs = get_flowby_from_config( name=name, config={**{k: v for k, v in fba.config.items() From c23df052dd76b16df0aa3da34ef206b29ac30dbd Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 2 Nov 2022 20:43:35 -0400 Subject: [PATCH 0268/1127] add backwards compatability to `estimate_suppressed_mecs_energy()` --- flowsa/data_source_scripts/temp_data_source_functions.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index d02562a73..716357e24 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -234,6 +234,11 @@ def estimate_suppressed_mecs_energy( industry without its own line item in the MECS anyway. '*' is for value less than 0.5 Trillion Btu and will be assumed to be 0.25 Trillion Btu ''' + if 'Suppressed' not in fba.columns: + log.warning('The current MECS dataframe does not contain data ' + 'on estimation method and so suppressed data will ' + 'not be assessed.') + return fba dropped = fba.query('Suppressed not in ["D", "Q"]') unsuppressed = dropped.assign( FlowAmount=dropped.FlowAmount.mask(dropped.Suppressed == '*', 0.25) From 1aca9f47382b9bab0e6187e80de2d80ad0ac3907 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 2 Nov 2022 20:47:02 -0400 Subject: [PATCH 0269/1127] add units to conversion --- flowsa/data/unit_conversion.csv | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flowsa/data/unit_conversion.csv b/flowsa/data/unit_conversion.csv index b5ea767cc..388181354 100644 --- a/flowsa/data/unit_conversion.csv +++ b/flowsa/data/unit_conversion.csv @@ -10,6 +10,8 @@ Bgal,kg,3790000000 gal,kg,3.79 million Cubic metres/year,kg,1000000000 TON,kg,907.185 +tons,kg,907.185 +short tons,kg,907.185 LB,kg,0.45359 ACRE FEET / ACRE,kg/m2,304.8000006 gal/USD,kg/USD,3.79 From 6d8a539fc0159fc2812f7d1927294f7833150583 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 2 Nov 2022 21:11:23 -0400 Subject: [PATCH 0270/1127] replace clean function with selection_fields --- .../CalRecycle_WasteCharacterization.py | 16 ++-------------- .../flowbysectormethods/CNHW_CA_2014.yaml | 4 ++-- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py b/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py index d5e60d625..c5d485d17 100644 --- a/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py +++ b/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py @@ -111,26 +111,14 @@ def calR_parse(*, year, **_): return output -def keep_generated_quantity(fba, **_): - """ - Function to clean CalRecycles FBA to remove quantities not - assigned as Generated - :param fba: df, FBA format - :return: df, modified CalRecycles FBA - """ - fba = fba[fba['Description'] == 'Generated'].reset_index(drop=True) - # if no mapping performed, still update units - if 'tons' in fba['Unit'].values: - fba = standardize_units(fba) - return fba - - def apply_tons_per_employee_per_year_to_states(fbs, **kwargs): """ Calculates tons per employee per year based on BLS_QCEW employees by sector and applies that quantity to employees in all states clean_fbs_df_fxn """ + ### TODO replace the below with the employment FBS + bls = load_fba_w_standardized_units(datasource='BLS_QCEW', year=fbs.config['year'], flowclass='Employment', diff --git a/flowsa/methods/flowbysectormethods/CNHW_CA_2014.yaml b/flowsa/methods/flowbysectormethods/CNHW_CA_2014.yaml index 1aa27c729..f48d393b3 100644 --- a/flowsa/methods/flowbysectormethods/CNHW_CA_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CNHW_CA_2014.yaml @@ -8,8 +8,7 @@ source_names: CalRecycle_WasteCharacterization: geoscale: state year: 2014 - clean_fba_df_fxn: !script_function:CalRecycle_WasteCharacterization keep_generated_quantity - mfl_mapping: CalRecycle + # mfl_mapping: CalRecycle activity_sets: employment: selection_fields: @@ -30,6 +29,7 @@ source_names: - Services Professional Technical Financial - Services Repair Personal - Not Elsewhere Classified + Description: Generated attribution_method: proportional attribution_source: Employment_state_2014: From 9589831ae7cd0a40737a5340b3b211f43e6f03fe Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 2 Nov 2022 21:33:41 -0400 Subject: [PATCH 0271/1127] filter by description for all CNHW activity sets --- flowsa/methods/flowbysectormethods/CNHW_CA_2014.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/methods/flowbysectormethods/CNHW_CA_2014.yaml b/flowsa/methods/flowbysectormethods/CNHW_CA_2014.yaml index f48d393b3..4767661e3 100644 --- a/flowsa/methods/flowbysectormethods/CNHW_CA_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CNHW_CA_2014.yaml @@ -39,4 +39,5 @@ source_names: selection_fields: PrimaryActivity: - Multifamily + Description: Generated attribution_method: direct From f9fd3cd4d5e2b1ad0ee6f458cf00386fd32f2f33 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 2 Nov 2022 21:34:15 -0400 Subject: [PATCH 0272/1127] ignore metasources for single fbs comparison --- flowsa/test_single_FBS.py | 3 ++- flowsa/validation.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/flowsa/test_single_FBS.py b/flowsa/test_single_FBS.py index adba5bfc1..f8059e012 100644 --- a/flowsa/test_single_FBS.py +++ b/flowsa/test_single_FBS.py @@ -18,7 +18,8 @@ def compare_single_FBS_against_remote(m, outdir=diffpath): print("--------------------------------\n" f"Method: {m}\n" "--------------------------------") - df = compare_FBS_results(m, m, compare_to_remote=True) + df = compare_FBS_results(m, m, ignore_metasources=True, + compare_to_remote=True) df.rename(columns = {'FlowAmount_fbs1': 'FlowAmount_remote', 'FlowAmount_fbs2': 'FlowAmount_HEAD'}, inplace=True) diff --git a/flowsa/validation.py b/flowsa/validation.py index 6c0b3adb5..9e4b3d9d2 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -946,6 +946,8 @@ def compare_FBS_results(fbs1, fbs2, ignore_metasources=False, 'Unit', 'FlowType', 'Year', 'MetaSources'] if ignore_metasources: merge_cols.remove('MetaSources') + df1 = df1.groupby(merge_cols).agg({'FlowAmount_fbs1':'sum'}).reset_index() + df2 = df2.groupby(merge_cols).agg({'FlowAmount_fbs2':'sum'}).reset_index() # check units compare_df_units(df1, df2) df_m = pd.merge(df1[merge_cols + ['FlowAmount_fbs1']], From 73ee583794269514c7955a3c078175ecd24d9428 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 2 Nov 2022 21:53:50 -0400 Subject: [PATCH 0273/1127] update CNHWC, switch to employment FBS --- flowsa/data_source_scripts/EPA_CDDPath.py | 5 -- .../CNHWC_national_2014.yaml | 64 +++++++++---------- 2 files changed, 30 insertions(+), 39 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_CDDPath.py b/flowsa/data_source_scripts/EPA_CDDPath.py index 8ef581457..058e916a7 100644 --- a/flowsa/data_source_scripts/EPA_CDDPath.py +++ b/flowsa/data_source_scripts/EPA_CDDPath.py @@ -103,14 +103,9 @@ def assign_wood_to_engineering(fba, **_): :param fba: df, FBA of CDDPath :return: df, CDDPath FBA with wood reassigned """ - # Update wood to a new activity for improved mapping fba.loc[((fba.FlowName == 'Wood') & (fba.ActivityProducedBy == 'Other')), 'ActivityProducedBy'] = 'Other - Wood' - # if no mapping performed, still update units - if 'short tons' in fba['Unit'].values: - fba = standardize_units(fba) - return fba diff --git a/flowsa/methods/flowbysectormethods/CNHWC_national_2014.yaml b/flowsa/methods/flowbysectormethods/CNHWC_national_2014.yaml index f5eaec62e..350d14639 100644 --- a/flowsa/methods/flowbysectormethods/CNHWC_national_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CNHWC_national_2014.yaml @@ -1,37 +1,33 @@ -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: national +industry_spec: + default: NAICS_6 +year: 2014 +target_naics_year: 2012 +geoscale: national + source_names: - "EPA_CDDPath": - data_format: 'FBA' - class: Other - geoscale_to_use: national + EPA_CDDPath: + geoscale: national year: 2014 - clean_fba_df_fxn: !script_function:EPA_CDDPath 'assign_wood_to_engineering' - mfl_mapping: 'EPA_CDDPath' + clean_fba_before_mapping: !script_function:EPA_CDDPath assign_wood_to_engineering + # mfl_mapping: 'EPA_CDDPath' activity_sets: - activity_set_1: - names: - - "Buildings" - - "Other" - - "Other - Wood" - - "Roads and Bridges" - allocation_source: "Census_VIP" - allocation_method: proportional - allocation_source_class: 'Money' - allocation_source_year: 2014 - allocation_flow: - - "Construction spending" - allocation_compartment: None - allocation_from_scale: national - helper_source: "BLS_QCEW" - helper_method: proportional - helper_source_class: "Employment" - helper_source_year: 2014 - helper_flow: - - "Number of employees, Federal Government" - - "Number of employees, State Government" - - "Number of employees, Local Government" - - "Number of employees, Private" - helper_from_scale: national - clean_helper_fba_wsec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec + construction_spending: + selection_fields: + PrimaryActivity: + - Buildings + - Other + - Other - Wood + - Roads and Bridges + attribution_method: proportional + attribution_source: + Census_VIP: + year: 2014 + geoscale: national + selection_fields: + Class: Money + FlowName: Construction spending + attribution_method: proportional + attribution_source: + Employment_national_2014: + data_format: FBS + year: 2014 From c8d94c6c32dbf2240b2a5216c49bc1f216467264 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 3 Nov 2022 11:28:15 -0400 Subject: [PATCH 0274/1127] Allowed for more modifications to cached FBSs --- flowsa/flowby.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index e919ab09a..29f00e342 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1002,22 +1002,21 @@ def attribute_flows_to_sectors( attribution_method = fba.config.get('attribution_method') if attribution_method == 'proportional': - # First check cache for FlowBy attribution_source = fba.config['attribution_source'] + if isinstance(attribution_source, str): - # attribution_source as string MUST BE cached - attribution_fbs = (fba.config['cache'][attribution_source]) + name, config = attribution_source, {} else: - (name, config), = fba.config['attribution_source'].items() - if name in fba.config['cache'].keys(): - # cached attribution_source passed as dictionary can include - # additional selection fields - attribution_fbs = fba.config['cache'][name] - if config.get('selection_fields'): - attribution_fbs = (attribution_fbs - .select_by_fields( - config.get('selection_fields') - )) + (name, config), = attribution_source.items() + + if name in fba.config['cache']: + attribution_fbs = fba.config['cache'][name].copy() + attribution_fbs.config = { + **{k: attribution_fbs.config[k] + for k in attribution_fbs.config['method_config_keys']}, + **config + } + attribution_fbs = attribution_fbs.prepare_fbs() else: attribution_fbs = get_flowby_from_config( name=name, From 3cbc9c430d7a1167cbee9f804b932bd9589406d8 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 3 Nov 2022 21:30:06 -0400 Subject: [PATCH 0275/1127] update CAP_HAP with cached MECS --- .../CAP_HAP_national_2017.yaml | 52 +++++++------------ 1 file changed, 20 insertions(+), 32 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index 7cc6853e0..3312e5b7f 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -5,12 +5,10 @@ year: 2017 target_naics_year: 2012 geoscale: national -# sources_to_cache: - -_attribution_sources: - EIA_MECS_Energy: &mecs_energy +sources_to_cache: + EIA_MECS_Energy: year: 2014 - selection_fields: &mecs_energy_default_selection + selection_fields: Class: Energy Unit: Trillion Btu # NEW EIA MECS Energy FBAs show tables in description @@ -22,20 +20,21 @@ _attribution_sources: clean_fba_w_sec: !script_function:temp_data_source_functions clean_mapped_mecs_energy_fba # clean_fba_df_fxn: !script_function:EIA_MECS mecs_energy_fba_cleanup # clean_fba_w_sec_df_fxn: !script_function:EIA_MECS eia_mecs_energy_clean_allocation_fba_w_sec - attribution_method: proportional # cleaning fxns remove need for proportional-flagged + attribution_method: proportional attribution_source: - Employment_national_2018: # replace with 2014 when available + Employment_national_2014: data_format: FBS - year: 2018 + year: 2014 +_attribution_sources: BEA: &bea year: 2012 activity_to_sector_mapping: BEA_2012_Detail attribution_method: proportional attribution_source: - Employment_national_2018: # replace with 2012 when available + Employment_national_2012: data_format: FBS - year: 2018 + year: 2012 source_names: EPA_NEI_Nonpoint: @@ -73,9 +72,7 @@ source_names: attribution_method: proportional attribution_source: EIA_MECS_Energy: - <<: *mecs_energy selection_fields: - <<: *mecs_energy_default_selection FlowName: Coal industry_combustion_coke: #only allocating to 3digits @@ -84,9 +81,7 @@ source_names: attribution_method: proportional attribution_source: EIA_MECS_Energy: - <<: *mecs_energy selection_fields: - <<: *mecs_energy_default_selection FlowName: Coke and Breeze industry_combustion_distillate: #only allocating to 3digits @@ -95,9 +90,7 @@ source_names: attribution_method: proportional attribution_source: EIA_MECS_Energy: - <<: *mecs_energy selection_fields: - <<: *mecs_energy_default_selection FlowName: Distillate Fuel Oil industry_combustion_hgl: #only allocating to 3digits @@ -106,9 +99,7 @@ source_names: attribution_method: proportional attribution_source: EIA_MECS_Energy: - <<: *mecs_energy selection_fields: - <<: *mecs_energy_default_selection FlowName: Hydrocarbon Gas Liquids, excluding natural gasoline industry_combustion_nat_gas: #only allocating to 3digits @@ -117,9 +108,7 @@ source_names: attribution_method: proportional attribution_source: EIA_MECS_Energy: - <<: *mecs_energy selection_fields: - <<: *mecs_energy_default_selection FlowName: Natural Gas industry_combustion_other: #only allocating to 3digits @@ -128,9 +117,7 @@ source_names: attribution_method: proportional attribution_source: EIA_MECS_Energy: - <<: *mecs_energy selection_fields: - <<: *mecs_energy_default_selection FlowName: Other industry_combustion_residual: #only allocating to 3digits @@ -139,9 +126,7 @@ source_names: attribution_method: proportional attribution_source: EIA_MECS_Energy: - <<: *mecs_energy selection_fields: - <<: *mecs_energy_default_selection FlowName: Residual Fuel Oil livestock: #Livestock losing NAICS 11211 @@ -200,7 +185,7 @@ source_names: attribution_source: BEA_GDP_GrossOutput: year: 2017 - activity_to_sector_mapping: "BEA_2012_Detail" + activity_to_sector_mapping: BEA_2012_Detail selection_fields: Class: Money FlowName: Gross Output @@ -211,7 +196,7 @@ source_names: year: 2017 - "EPA_NEI_Nonroad": + EPA_NEI_Nonroad: geoscale: state year: 2017 activity_to_sector_mapping: SCC @@ -234,7 +219,7 @@ source_names: selection_fields: ActivityProducedBy: {'324110': ''} # Petroleum - "EPA_NEI_Onroad": + EPA_NEI_Onroad: geoscale: state year: 2017 activity_to_sector_mapping: SCC @@ -257,13 +242,16 @@ source_names: selection_fields: ActivityProducedBy: {'324110': ''} # Petroleum - "stewiFBS": - data_format: 'FBS_outside_flowsa' + stewiFBS: + data_format: FBS_outside_flowsa FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector inventory_dict: {"NEI":"2017", "TRI":"2017"} - local_inventory_name: 'NEI_TRI_air_2017' + local_inventory_name: NEI_TRI_air_2017 + # temporarily maintain target_sector_level for + # allocation.equally_allocate_parent_to_child_naics() + target_sector_level: NAICS_6 clean_fbs_df_fxn: !script_function:EPA_NEI drop_GHGs compartments: - - 'air' + - air reassign_process_to_sectors: - - 'airplane_emissions' + - airplane_emissions From 073b5dd296bbe7bdfc9e4e990d7da3b359dfd74e Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 4 Nov 2022 12:20:48 -0400 Subject: [PATCH 0276/1127] Missing FBA columns were being added back in due to the constructor being called during .atype(). Added a new constructor argument to prevent this behavior. --- flowsa/flowby.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 14a9118e9..9aee1acb8 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -83,6 +83,7 @@ def __init__( self, data: pd.DataFrame or '_FlowBy' = None, *args, + add_missing_columns: bool = True, fields: dict = None, column_order: List[str] = None, string_null: 'np.nan' or None = np.nan, @@ -102,6 +103,13 @@ def __init__( ) if isinstance(data, pd.DataFrame) and fields is not None: + if add_missing_columns: + data = data.assign(**{field: None + for field in fields + if field not in data.columns}) + else: + fields = {k: v for k, v in fields.items() if k in data.columns} + fill_na_dict = { field: 0 if dtype in ['int', 'float'] else string_null for field, dtype in fields.items() @@ -112,12 +120,12 @@ def __init__( np.nan, pd.NA, None]} for field, dtype in fields.items() if dtype == 'object' } + data = (data - .assign(**{field: None - for field in fields if field not in data.columns}) .fillna(fill_na_dict) .replace(null_string_dict) .astype(fields)) + if isinstance(data, pd.DataFrame) and column_order is not None: data = data[[c for c in column_order if c in data.columns] + [c for c in data.columns if c not in column_order]] @@ -642,7 +650,7 @@ def astype(self: FB, *args, **kwargs) -> FB: metadata = {attribute: self.__getattr__(attribute) for attribute in self._metadata} df = pd.DataFrame(self).astype(*args, **kwargs) - fb = type(self)(df, **metadata) + fb = type(self)(df, add_missing_columns=False, **metadata) return fb From 10d0697d289e58a6570fb5764dd53f45fbb5e1ad Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 4 Nov 2022 20:39:56 -0400 Subject: [PATCH 0277/1127] delete daily conversion which is handled in separate function --- flowsa/flowby.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 14a9118e9..2f06ef96b 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -766,7 +766,7 @@ def map_to_fedefl_list( 'SourceFlowContext' ] merge_type = 'inner' if drop_unmapped_rows else 'left' - + ## TODO update this logic if self.config.get('fedefl_mapping') is True: mapping_subset = self.source_name else: @@ -777,17 +777,11 @@ def map_to_fedefl_list( log.info('Mapping flows in %s to federal elementary flow list', self.full_name) - if any(self.Unit.str.contains('/d')): - log.info('Converting daily flows %s to annual', - [unit for unit in self.Unit.unique() if '/d' in unit]) fba = ( self .assign(Flowable=self.FlowName, Context=self.Compartment, - FlowAmount=self.FlowAmount.mask( - self.Unit.str.contains('/d'), - self.FlowAmount * 365), - Unit=self.Unit.str.replace('/d', '')) + ) .drop(columns=['FlowName', 'Compartment']) ) From 0e7f59d3eb4c25f951bf321ce636c6fe14b8f85e Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 8 Nov 2022 13:28:48 -0500 Subject: [PATCH 0278/1127] fix typo pointing to make table --- .../flowbysectormethods/CAP_HAP_national_2017.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index 3312e5b7f..acad7bc67 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -150,7 +150,7 @@ source_names: PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv mobile_and_fuel_storage attribution_method: proportional attribution_source: - BEA_Make_Detail_BeforeRedef: + BEA_Use_Detail_BeforeRedef: <<: *bea primary_action_type: Consumed # confirm this selection_fields: @@ -161,7 +161,7 @@ source_names: PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv fertilizers attribution_method: proportional attribution_source: - BEA_Make_Detail_BeforeRedef: + BEA_Use_Detail_BeforeRedef: <<: *bea primary_action_type: Consumed # confirm this selection_fields: @@ -172,7 +172,7 @@ source_names: PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv pesticides attribution_method: proportional attribution_source: - BEA_Make_Detail_BeforeRedef: + BEA_Use_Detail_BeforeRedef: <<: *bea primary_action_type: Consumed # confirm this selection_fields: @@ -213,7 +213,7 @@ source_names: PrimaryActivity: !from_index:NEI_Nonroad_2017_asets.csv offroad_vehicles_equipment attribution_method: proportional attribution_source: - BEA_Make_Detail_BeforeRedef: + BEA_Use_Detail_BeforeRedef: <<: *bea primary_action_type: Consumed # confirm this selection_fields: @@ -236,7 +236,7 @@ source_names: PrimaryActivity: !from_index:NEI_Onroad_2017_asets.csv onroad_vehicles_gas_stations attribution_method: proportional attribution_source: - BEA_Make_Detail_BeforeRedef: + BEA_Use_Detail_BeforeRedef: <<: *bea primary_action_type: Consumed # confirm this selection_fields: From d9fc3e3c7c0b3c43f130258db1f599cb956d17be Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 9 Nov 2022 11:08:00 -0500 Subject: [PATCH 0279/1127] run usgs nwis wu clean fba before activity sets --- flowsa/data_source_scripts/USGS_NWIS_WU.py | 38 +++++++++---------- .../Water_national_2015_m1.yaml | 2 +- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/flowsa/data_source_scripts/USGS_NWIS_WU.py b/flowsa/data_source_scripts/USGS_NWIS_WU.py index 1e27a437e..bebf9489a 100644 --- a/flowsa/data_source_scripts/USGS_NWIS_WU.py +++ b/flowsa/data_source_scripts/USGS_NWIS_WU.py @@ -392,7 +392,7 @@ def usgs_fba_data_cleanup(fba, **_): vLogDetailed.info('Drop rows where the FlowName is total to prevent' 'double counting at the state and county levels. ' 'Retain rows at national level') - df2 = dfc[dfc['Flowable'] == 'Water'] + df2 = dfc[dfc['FlowName'] == 'total'] # set conditions for data to keep when flowname = 'total c1 = df2['Location'] != US_FIPS c2 = (~df2['ActivityProducedBy'].isnull()) & \ @@ -401,8 +401,8 @@ def usgs_fba_data_cleanup(fba, **_): df2 = df2[c1 & c2].reset_index(drop=True) # second subset doesn't have total flowname or total compartment - df3 = dfc[dfc['Flowable'] != 'Water'] - df3 = df3[df3['Context'] != 'resource/water'] + df3 = dfc[dfc['FlowName'] != 'total'] + df3 = df3[df3['Compartment'] != 'total'] df3 = df3[df3['Location'] != US_FIPS] # concat the two df @@ -411,7 +411,7 @@ def usgs_fba_data_cleanup(fba, **_): # In 2015, there is data for consumptive water use for # thermo and crop, drop because do not calculate consumptive water loss # for all water categories - dfd = dfd[dfd['Context'] != 'air'].reset_index(drop=True) + dfd = dfd[dfd['Compartment'] != 'air'].reset_index(drop=True) return dfd @@ -471,10 +471,10 @@ def calculate_net_public_supply(df_load): # split consumed further into fresh water (assumption domestic # deliveries are freshwater) assumption that water withdrawal taken # equally from ground and surface - df_w1 = df_w[(df_w['Flowable'] == 'Water, fresh') & - (df_w['Context'] != 'resource/water')] - df_w2 = df_w[(df_w['Flowable'] == 'Water, fresh') & - (df_w['Context'] == 'resource/water')] + df_w1 = df_w[(df_w['FlowName'] == 'fresh') & + (df_w['Compartment'] != 'total')] + df_w2 = df_w[(df_w['FlowName'] == 'fresh') & + (df_w['Compartment'] == 'total')] # compare units compare_df_units(df_w1, df_w2) df_wm = pd.merge(df_w1, df_w2[['FlowAmount', 'Location', 'Unit']], @@ -508,10 +508,10 @@ def calculate_net_public_supply(df_load): compare_df_units(df_d, net_ps) # because assuming domestic is all fresh, drop flowable/context # and instead use those column data from the net_ps df - df_d_modified = df_d.drop(columns=['Flowable', 'Context', 'FlowUUID']) + df_d_modified = df_d.drop(columns=['FlowName', 'Compartment']) # Also allocate to ground/surface from state ratios df_d_modified = pd.merge(df_d_modified, - net_ps[['Flowable', 'Context', 'FlowUUID', + net_ps[['FlowName', 'Compartment', 'Location', 'FlowRatio']], how='left', left_on='Location', @@ -598,12 +598,10 @@ def subset_and_merge_irrigation_types(df): # merge the golf and total irrigation into crop df and # modify crop FlowAmounts if necessary df_m = pd.merge(df_i, - df_g[['Flowable', 'FlowAmount', 'ActivityProducedBy', - 'ActivityConsumedBy', 'Context', 'Location', - 'Year']], - how='outer', - right_on=['Flowable', 'Context', 'Location', 'Year'], - left_on=['Flowable', 'Context', 'Location', 'Year']) + df_g[['FlowName', 'FlowAmount', 'ActivityProducedBy', + 'ActivityConsumedBy', 'Compartment', 'Location', + 'Year']], how='outer', + on=['FlowName', 'Compartment', 'Location', 'Year']) df_m = df_m.rename(columns={"FlowAmount_x": "FlowAmount", "ActivityProducedBy_x": "ActivityProducedBy", "ActivityConsumedBy_x": "ActivityConsumedBy", @@ -613,12 +611,12 @@ def subset_and_merge_irrigation_types(df): }) compare_df_units(df_m, df_c) df_m2 = pd.merge(df_m, - df_c[['Flowable', 'FlowAmount', 'ActivityProducedBy', - 'ActivityConsumedBy', 'Context', + df_c[['FlowName', 'FlowAmount', 'ActivityProducedBy', + 'ActivityConsumedBy', 'Compartment', 'Location', 'Year', 'Description']], how='outer', - right_on=['Flowable', 'Context', 'Location', 'Year'], - left_on=['Flowable', 'Context', 'Location', 'Year']) + right_on=['FlowName', 'Compartment', 'Location', 'Year'], + left_on=['FlowName', 'Compartment', 'Location', 'Year']) df_m2 = df_m2.rename(columns={"FlowAmount_x": "FlowAmount", "ActivityProducedBy_x": "ActivityProducedBy", "ActivityConsumedBy_x": "ActivityConsumedBy", diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index 6d1602031..9c3fb2da3 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -10,7 +10,7 @@ source_names: "USGS_NWIS_WU": fedefl_mapping: USGS_NWIS_WU geoscale: state - clean_fba: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup + clean_fba_before_activity_sets: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup clean_fba_w_sec: !script_function:USGS_NWIS_WU usgs_fba_w_sectors_data_cleanup activity_sets: direct_attribution: From df81d5c58f00fbe44bc856dc5dceb570b505cf6d Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 9 Nov 2022 15:08:39 -0500 Subject: [PATCH 0280/1127] add `primary_action_type: Produced` to improve speed --- flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index acad7bc67..15600e72d 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -43,6 +43,7 @@ source_names: activity_to_sector_mapping: SCC clean_fba_before_mapping: !script_function:EPA_NEI clean_NEI_fba_no_pesticides fedefl_mapping: NEI + primary_action_type: Produced activity_sets: direct_allocation: selection_fields: From cb9eeef767435019c92850f7cd5eb31462a9cb5b Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 9 Nov 2022 17:00:11 -0500 Subject: [PATCH 0281/1127] Fix how primary and secondary columns are added when the primary action type is specified, resulting in large speed increases. --- flowsa/flowby.py | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 675b4669e..949fdbea5 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -582,10 +582,16 @@ def add_primary_secondary_columns( else: if 'primary_action_type' in self.config: + primary_action_type = self.config['primary_action_type'] + secondary_action_type = ('Consumed' + if primary_action_type == 'Produced' + else 'Produced') + fb = self.assign( **{f'Primary{col_type}': - self[f'{col_type}' - f'{self.config["primary_action_type"]}By']} + self[f'{col_type}{primary_action_type}By'], + f'Secondary{col_type}': + self[f'{col_type}{secondary_action_type}By']} ) else: @@ -606,18 +612,18 @@ def add_primary_secondary_columns( } ) - def _identify_secondary(row: _FlowBySeries) -> str: - sectors = [row[f'{col_type}ProducedBy'], - row[f'{col_type}ConsumedBy']] - sectors.remove(row[f'Primary{col_type}']) - return sectors[0] - - fb = fb.assign( - **{f'Secondary{col_type}': ( - fb.apply(_identify_secondary, axis='columns') - # ^^^ Applying with axis='columns' applies TO each row. - .astype('object'))} - ) + def _identify_secondary(row: _FlowBySeries) -> str: + sectors = [row[f'{col_type}ProducedBy'], + row[f'{col_type}ConsumedBy']] + sectors.remove(row[f'Primary{col_type}']) + return sectors[0] + + fb = fb.assign( + **{f'Secondary{col_type}': ( + fb.apply(_identify_secondary, axis='columns') + # ^^^ Applying with axis='columns' applies TO each row. + .astype('object'))} + ) return fb From 507503c3bcc75bf4a62bd38b241cf57f736871f0 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 9 Nov 2022 17:08:29 -0500 Subject: [PATCH 0282/1127] update year to use config --- flowsa/data_source_scripts/USDA_CoA_Cropland.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/flowsa/data_source_scripts/USDA_CoA_Cropland.py b/flowsa/data_source_scripts/USDA_CoA_Cropland.py index 535320025..f3221ebbd 100644 --- a/flowsa/data_source_scripts/USDA_CoA_Cropland.py +++ b/flowsa/data_source_scripts/USDA_CoA_Cropland.py @@ -353,15 +353,16 @@ def disaggregate_coa_cropland_to_6_digit_naics_for_water_withdrawal( # use ratios of usda 'land in farms' to determine animal use of # pasturelands at 6 digit naics + # todo: replace with download_sources_ok fba_w_sector = disaggregate_pastureland( - fba_w_sector, attr, method, year=attr['allocation_source_year'], - sector_column=sector_col, download_FBA_if_missing=kwargs[ - 'download_FBA_if_missing'], parameter_drop=['1125']) + fba_w_sector, attr, method, year=fba_w_sector.config['year'], + sector_column=sector_col, download_FBA_if_missing=kwargs['download_FBA_if_missing'], + parameter_drop=['1125']) # use ratios of usda 'harvested cropland' to determine missing 6 digit # naics fba_w_sector = disaggregate_cropland( - fba_w_sector, attr, method, year=attr['allocation_source_year'], + fba_w_sector, attr, method, year=fba_w_sector.config['year'], sector_column=sector_col, download_FBA_if_missing=kwargs[ 'download_FBA_if_missing']) From 682188305386f70ad0fe1106b9725218a896dc02 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 9 Nov 2022 17:10:01 -0500 Subject: [PATCH 0283/1127] use employment fbs over qcew fba --- .../flowbysectormethods/Water_national_2015_m1.yaml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index 9c3fb2da3..7ebd638f8 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -29,12 +29,9 @@ source_names: - "Mining" attribution_method: proportional attribution_source: - BLS_QCEW: - year: 2015 - geoscale: national - selection_fields: - Class: "Employment" - clean_fba_w_sec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec + Employment_national_2015: + data_format: FBS + year: 2015 cropland_attribution: selection_fields: PrimaryActivity: From 03dec3618b2c2226eaa01aaa1d9d993c68efac7a Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 9 Nov 2022 17:11:10 -0500 Subject: [PATCH 0284/1127] ensure all columns are object (if column of all np.nan then wast cast as float64) --- flowsa/flowby.py | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 949fdbea5..073102f15 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -918,6 +918,7 @@ def convert_to_geoscale( .rename(columns={ 'geoscale': f'highest_reporting_level_by_{scale.name.title()}' })) + .astype(object) for scale in geo.scale if scale.has_fips_level and scale <= target_geoscale ] From 193726aa8820c6fa9fc8567b6d841d0c323ae614 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 9 Nov 2022 17:12:15 -0500 Subject: [PATCH 0285/1127] update the flow_by_activity_mapped_fields and flow_by_activity_mapped_wsec_fields schemas --- flowsa/schema.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/flowsa/schema.py b/flowsa/schema.py index 92d4f31f4..7e6de79f0 100644 --- a/flowsa/schema.py +++ b/flowsa/schema.py @@ -87,14 +87,12 @@ flow_by_activity_mapped_fields = \ {'Class': [{'dtype': 'str'}, {'required': True}], 'SourceName': [{'dtype': 'str'}, {'required': True}], - 'FlowName': [{'dtype': 'str'}, {'required': True}], 'Flowable': [{'dtype': 'str'}, {'required': True}], 'FlowAmount': [{'dtype': 'float'}, {'required': True}], 'Unit': [{'dtype': 'str'}, {'required': True}], 'FlowType': [{'dtype': 'str'}, {'required': True}], 'ActivityProducedBy': [{'dtype': 'str'}, {'required': False}], 'ActivityConsumedBy': [{'dtype': 'str'}, {'required': False}], - 'Compartment': [{'dtype': 'str'}, {'required': False}], 'Context': [{'dtype': 'str'}, {'required': False}], 'Location': [{'dtype': 'str'}, {'required': True}], 'LocationSystem': [{'dtype': 'str'}, {'required': True}], @@ -138,15 +136,13 @@ flow_by_activity_mapped_wsec_fields = \ {'Class': [{'dtype': 'str'}, {'required': True}], 'SourceName': [{'dtype': 'str'}, {'required': True}], - 'FlowName': [{'dtype': 'str'}, {'required': True}], 'Flowable': [{'dtype': 'str'}, {'required': True}], 'FlowAmount': [{'dtype': 'float'}, {'required': True}], 'Unit': [{'dtype': 'str'}, {'required': True}], 'FlowType': [{'dtype': 'str'}, {'required': True}], 'ActivityProducedBy': [{'dtype': 'str'}, {'required': False}], 'ActivityConsumedBy': [{'dtype': 'str'}, {'required': False}], - 'Compartment': [{'dtype': 'str'}, {'required': False}], - 'Context': [{'dtype': 'str'}, {'required': False}], + 'Context': [{'dtype': 'str'}, {'required': True}], 'Location': [{'dtype': 'str'}, {'required': True}], 'LocationSystem': [{'dtype': 'str'}, {'required': True}], 'Year': [{'dtype': 'int'}, {'required': True}], @@ -157,8 +153,8 @@ 'Max': [{'dtype': 'float'}, {'required': False}], 'DataReliability': [{'dtype': 'float'}, {'required': True}], 'DataCollection': [{'dtype': 'float'}, {'required': True}], - 'Description': [{'dtype': 'str'}, {'required': True}], - 'FlowUUID': [{'dtype': 'str'}, {'required': True}], + 'Description': [{'dtype': 'str'}, {'required': False}], + 'FlowUUID': [{'dtype': 'str'}, {'required': False}], 'SectorProducedBy': [{'dtype': 'str'}, {'required': False}], 'SectorConsumedBy': [{'dtype': 'str'}, {'required': False}], 'SectorSourceName': [{'dtype': 'str'}, {'required': False}], From b97e94d5f91bb4364732504cbe54718e56f91989 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 9 Nov 2022 22:41:04 -0500 Subject: [PATCH 0286/1127] updates for CAP_HAP: limit MECS to national scale; change cleaning fxn to `before_activity_sets`; only remove pesticides for specific activity set; remove 0 values to improve speed --- flowsa/data_source_scripts/EPA_NEI.py | 17 ++---- .../CAP_HAP_national_2017.yaml | 60 ++++++++++--------- 2 files changed, 36 insertions(+), 41 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_NEI.py b/flowsa/data_source_scripts/EPA_NEI.py index 3fe4e99d4..75c2cd994 100644 --- a/flowsa/data_source_scripts/EPA_NEI.py +++ b/flowsa/data_source_scripts/EPA_NEI.py @@ -11,6 +11,7 @@ import pandas as pd from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.dataclean import standardize_units +from flowsa.flowby import FlowByActivity def epa_nei_url_helper(*, build_url, year, config, **_): @@ -155,11 +156,11 @@ def epa_nei_nonpoint_parse(*, df_list, source, year, config, **_): return df -def clean_NEI_fba(fba, **_): +def clean_NEI_fba(fba: FlowByActivity, **_) -> FlowByActivity: """ Clean up the NEI FBA for use in FBS creation :param fba: df, FBA format - :return: df, modified FBA + :return: modified FBA """ fba = remove_duplicate_NEI_flows(fba) fba = drop_GHGs(fba) @@ -178,17 +179,9 @@ def clean_NEI_fba(fba, **_): fba.loc[(fba['FlowName'] == 'PM10 Primary (Filt + Cond)'), ['FlowName', 'Flowable', 'FlowUUID']] = ['PM10-PM2.5', PM_list[0], PM_list[1]] - return fba - + # Drop zero values to reduce size + fba = fba.query('FlowAmount != 0').reset_index(drop=True) -def clean_NEI_fba_no_pesticides(fba, **_): - """ - Clean up the NEI FBA with no pesicides for use in FBS creation - :param fba: df, FBA format - :return: df, modified FBA - """ - fba = drop_pesticides(fba) - fba = clean_NEI_fba(fba=fba) return fba diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index 15600e72d..70c5f8269 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -11,6 +11,7 @@ sources_to_cache: selection_fields: Class: Energy Unit: Trillion Btu + Location: '00000' # NEW EIA MECS Energy FBAs show tables in description Description: - Table 2.2 @@ -40,32 +41,32 @@ source_names: EPA_NEI_Nonpoint: geoscale: state year: 2017 + primary_action_type: Produced activity_to_sector_mapping: SCC - clean_fba_before_mapping: !script_function:EPA_NEI clean_NEI_fba_no_pesticides + clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba fedefl_mapping: NEI - primary_action_type: Produced activity_sets: - direct_allocation: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv direct_allocation - attribution_method: direct + # direct_allocation: + # selection_fields: + # PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv direct_allocation + # attribution_method: direct - cropland: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv cropland - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland: - year: 2017 - geoscale: state - selection_fields: - Class: Land - FlowName: AREA HARVESTED - ## CONFIRM HOW TO HANDLE THESE CLEANING FXNS - clean_fba_w_sec_df_fxn: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics - # OR - attribution_method: function - attribution function: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics # wrapped in an appropriate aggregation + # cropland: + # selection_fields: + # PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv cropland + # attribution_method: proportional + # attribution_source: + # USDA_CoA_Cropland: + # year: 2017 + # geoscale: state + # selection_fields: + # Class: Land + # FlowName: AREA HARVESTED + # ## CONFIRM HOW TO HANDLE THESE CLEANING FXNS + # clean_fba_w_sec_df_fxn: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics + # # OR + # attribution_method: function + # attribution function: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics # wrapped in an appropriate aggregation industry_combustion_coal: #only allocating to 3digits selection_fields: @@ -74,7 +75,7 @@ source_names: attribution_source: EIA_MECS_Energy: selection_fields: - FlowName: Coal + Flowable: Coal industry_combustion_coke: #only allocating to 3digits selection_fields: @@ -83,7 +84,7 @@ source_names: attribution_source: EIA_MECS_Energy: selection_fields: - FlowName: Coke and Breeze + Flowable: Coke and Breeze industry_combustion_distillate: #only allocating to 3digits selection_fields: @@ -92,7 +93,7 @@ source_names: attribution_source: EIA_MECS_Energy: selection_fields: - FlowName: Distillate Fuel Oil + Flowable: Distillate Fuel Oil industry_combustion_hgl: #only allocating to 3digits selection_fields: @@ -101,7 +102,7 @@ source_names: attribution_source: EIA_MECS_Energy: selection_fields: - FlowName: Hydrocarbon Gas Liquids, excluding natural gasoline + Flowable: Hydrocarbon Gas Liquids, excluding natural gasoline industry_combustion_nat_gas: #only allocating to 3digits selection_fields: @@ -110,7 +111,7 @@ source_names: attribution_source: EIA_MECS_Energy: selection_fields: - FlowName: Natural Gas + Flowable: Natural Gas industry_combustion_other: #only allocating to 3digits selection_fields: @@ -119,7 +120,7 @@ source_names: attribution_source: EIA_MECS_Energy: selection_fields: - FlowName: Other + Flowable: Other industry_combustion_residual: #only allocating to 3digits selection_fields: @@ -128,7 +129,7 @@ source_names: attribution_source: EIA_MECS_Energy: selection_fields: - FlowName: Residual Fuel Oil + Flowable: Residual Fuel Oil livestock: #Livestock losing NAICS 11211 selection_fields: @@ -169,6 +170,7 @@ source_names: ActivityProducedBy: {'325310': ''} # Fertilizers pesticides: # pesticides + clean_fba_before_mapping: !script_function:EPA_NEI drop_pesticides selection_fields: PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv pesticides attribution_method: proportional From 4ad6a7e9535c0721dfbc6d45899a5e25bdb43a86 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 9 Nov 2022 22:41:32 -0500 Subject: [PATCH 0287/1127] revise mapping logic including `drop_unmapped_rows` parameter --- flowsa/flowby.py | 19 +++++++------------ .../CAP_HAP_national_2017.yaml | 1 + 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 073102f15..6b60157fc 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -757,7 +757,6 @@ def map_to_fedefl_list( drop_unmapped_rows: bool = False ) -> 'FlowByActivity': fba_merge_keys = [ - 'SourceName', 'Flowable', 'Unit', 'Context' @@ -774,22 +773,16 @@ def map_to_fedefl_list( 'TargetFlowUUID' ] mapping_merge_keys = [ - 'SourceListName', 'SourceFlowName', 'SourceUnit', 'SourceFlowContext' ] merge_type = 'inner' if drop_unmapped_rows else 'left' - ## TODO update this logic - if self.config.get('fedefl_mapping') is True: - mapping_subset = self.source_name - else: - mapping_subset = self.config.get('fedefl_mapping') - fba_merge_keys.remove('SourceName') - mapping_merge_keys.remove('SourceListName') - log.info('Mapping flows in %s to federal elementary flow list', - self.full_name) + mapping_subset = self.config.get('fedefl_mapping') + + log.info(f'Mapping flows in {self.full_name} to ' + f'{mapping_subset} in federal elementary flow list') fba = ( self @@ -1497,7 +1490,9 @@ def convert_units_and_flows( self = self.convert_daily_to_annual() if self.config.get('fedefl_mapping'): - mapped = self.map_to_fedefl_list() + mapped = self.map_to_fedefl_list( + drop_unmapped_rows=self.config.get('drop_unmapped_rows', False) + ) else: mapped = self.rename(columns={'FlowName': 'Flowable', 'Compartment': 'Context'}) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index 70c5f8269..4ae82b212 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -45,6 +45,7 @@ source_names: activity_to_sector_mapping: SCC clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba fedefl_mapping: NEI + drop_unmapped_rows: True activity_sets: # direct_allocation: # selection_fields: From a7dd49fa9ffa27a1dd1f99d5d9dfe47069aa2f32 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 9 Nov 2022 23:04:04 -0500 Subject: [PATCH 0288/1127] drop outdated MECS functions --- flowsa/data_source_scripts/EIA_MECS.py | 41 +----------------- .../CAP_HAP_national_2017.yaml | 42 +++++++++---------- 2 files changed, 21 insertions(+), 62 deletions(-) diff --git a/flowsa/data_source_scripts/EIA_MECS.py b/flowsa/data_source_scripts/EIA_MECS.py index 1b372a8c2..13e8bad94 100644 --- a/flowsa/data_source_scripts/EIA_MECS.py +++ b/flowsa/data_source_scripts/EIA_MECS.py @@ -459,46 +459,6 @@ def eia_mecs_energy_parse(*, df_list, source, year, **_): return df -def mecs_energy_fba_cleanup(fba, attr, **kwargs): - """ - Clean up the EIA MECS energy FlowByActivity - :param fba: df, FBA format - :param attr: dictionary, attribute data from method yaml for activity set - :param kwargs: optional, can also include bool 'download_FBAs_if_missing' - :return: df, subset of EIA MECS Energy FBA - """ - # subset the df to only include values where the unit = MJ - fba = fba.loc[fba['Unit'] == 'MJ'].reset_index(drop=True) - - return fba - - -def eia_mecs_energy_clean_allocation_fba_w_sec( - df_w_sec, attr, method, **kwargs): - """ - clean up eia_mecs_energy df with sectors by estimating missing data - :param df_w_sec: df, EIA MECS Energy, FBA format with sector columns - :param attr: dictionary, attribute data from method yaml for activity set - :param method: dictionary, FBS method yaml - :param kwargs: includes "sourcename" which is required for other - 'clean_fba_w_sec' fxns - :return: df, EIA MECS energy with estimated missing data - """ - - # drop rows where flowamount = 0, which drops supressed data - df_w_sec = df_w_sec[df_w_sec['FlowAmount'] != 0].reset_index(drop=True) - - # estimate missing data - sector_column = 'SectorConsumedBy' - df = determine_flows_requiring_disaggregation( - df_w_sec, attr, method, sector_column) - - # drop rows where flowamount = 0 - df2 = df[df['FlowAmount'] != 0].reset_index(drop=True) - - return df2 - - def mecs_land_fba_cleanup(fba, **_): """ Modify the EIA MECS Land FBA @@ -552,6 +512,7 @@ def mecs_land_clean_allocation_mapped_fba_w_sec(df, attr, method): return df +# TODO confirm this function can be dropped and replaced def determine_flows_requiring_disaggregation( df_load, attr, method, sector_column): """ diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index 4ae82b212..fd039489e 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -19,8 +19,6 @@ sources_to_cache: estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_mecs_energy clean_fba: !script_function:temp_data_source_functions clean_mecs_energy_fba clean_fba_w_sec: !script_function:temp_data_source_functions clean_mapped_mecs_energy_fba - # clean_fba_df_fxn: !script_function:EIA_MECS mecs_energy_fba_cleanup - # clean_fba_w_sec_df_fxn: !script_function:EIA_MECS eia_mecs_energy_clean_allocation_fba_w_sec attribution_method: proportional attribution_source: Employment_national_2014: @@ -47,27 +45,27 @@ source_names: fedefl_mapping: NEI drop_unmapped_rows: True activity_sets: - # direct_allocation: - # selection_fields: - # PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv direct_allocation - # attribution_method: direct + direct_allocation: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv direct_allocation + attribution_method: direct - # cropland: - # selection_fields: - # PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv cropland - # attribution_method: proportional - # attribution_source: - # USDA_CoA_Cropland: - # year: 2017 - # geoscale: state - # selection_fields: - # Class: Land - # FlowName: AREA HARVESTED - # ## CONFIRM HOW TO HANDLE THESE CLEANING FXNS - # clean_fba_w_sec_df_fxn: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics - # # OR - # attribution_method: function - # attribution function: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics # wrapped in an appropriate aggregation + cropland: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv cropland + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland: + year: 2017 + geoscale: state + selection_fields: + Class: Land + FlowName: AREA HARVESTED + ## CONFIRM HOW TO HANDLE THESE CLEANING FXNS + clean_fba_w_sec_df_fxn: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics + # OR + attribution_method: function + attribution function: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics # wrapped in an appropriate aggregation industry_combustion_coal: #only allocating to 3digits selection_fields: From ec43a6ad7cd7b0b5d57c4de2b0c9601f550b9f49 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 10 Nov 2022 08:52:26 -0500 Subject: [PATCH 0289/1127] use temp_data_source for USDA function --- .../methods/flowbysectormethods/CAP_HAP_national_2017.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index fd039489e..6bb6bad83 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -62,10 +62,7 @@ source_names: Class: Land FlowName: AREA HARVESTED ## CONFIRM HOW TO HANDLE THESE CLEANING FXNS - clean_fba_w_sec_df_fxn: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics - # OR - attribution_method: function - attribution function: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics # wrapped in an appropriate aggregation + clean_fba_w_sec_df_fxn: !script_function:temp_data_source_functions disaggregate_coa_cropland_to_6_digit_naics industry_combustion_coal: #only allocating to 3digits selection_fields: @@ -201,6 +198,7 @@ source_names: EPA_NEI_Nonroad: geoscale: state year: 2017 + primary_action_type: Produced activity_to_sector_mapping: SCC clean_fba_df_fxn: !script_function:EPA_NEI clean_NEI_fba fedefl_mapping: NEI @@ -224,6 +222,7 @@ source_names: EPA_NEI_Onroad: geoscale: state year: 2017 + primary_action_type: Produced activity_to_sector_mapping: SCC clean_fba_df_fxn: !script_function:EPA_NEI clean_NEI_fba fedefl_mapping: NEI From d3c34633679e1ae2a79c4101523507738a780f54 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 10 Nov 2022 09:10:34 -0500 Subject: [PATCH 0290/1127] update column assignment to handle FBS --- flowsa/validation.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/flowsa/validation.py b/flowsa/validation.py index 9e4b3d9d2..18d88f054 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -1007,17 +1007,20 @@ def compare_geographic_totals( # depending on the datasource, might need to rename some # strings for national comparison sub = rename_column_values_for_comparison(sub, sourcename) - sub2 = aggregator(sub, fba_default_grouping_fields).rename( - columns={'FlowAmount': 'FlowAmount_sub'}) # compare df - merge_cols = (['Class', 'SourceName', 'FlowName', 'Unit', - 'FlowType', 'ActivityProducedBy', 'ActivityConsumedBy', - 'Compartment', 'Location', 'LocationSystem', 'Year'] - if df_type == 'FBA' else - ['Class', 'SourceName', 'Flowable', 'Unit', + merge_cols = ['Class', 'SourceName', 'Unit', 'FlowType', 'ActivityProducedBy', 'ActivityConsumedBy', - 'Context', 'Location', 'LocationSystem', 'Year']) + 'Location', 'LocationSystem', 'Year'] + + if df_type == 'FBA': + merge_cols.extend(['FlowName', 'Compartment']) + else: + merge_cols.extend(['Flowable', 'Context']) + + sub2 = aggregator(sub, merge_cols).rename( + columns={'FlowAmount': 'FlowAmount_sub'}) + # comapare units compare_df_units(nat, sub2) df_m = pd.merge(nat[merge_cols + ['FlowAmount_nat']], From d66dc2cfdf750029ba492c4ea05bd8fe1146e0b5 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 10 Nov 2022 09:28:33 -0500 Subject: [PATCH 0291/1127] replace cleaning fxn with USDA_CoA_Cropland_NAICS --- .../flowbysectormethods/CAP_HAP_national_2017.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index 6bb6bad83..ae576b2f5 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -61,8 +61,13 @@ source_names: selection_fields: Class: Land FlowName: AREA HARVESTED - ## CONFIRM HOW TO HANDLE THESE CLEANING FXNS - clean_fba_w_sec_df_fxn: !script_function:temp_data_source_functions disaggregate_coa_cropland_to_6_digit_naics + attribution_source: + USDA_CoA_Cropland_NAICS: + year: 2017 + geoscale: state + selection_fields: + Class: Land + FlowName: AG LAND, CROPLAND, HARVESTED industry_combustion_coal: #only allocating to 3digits selection_fields: From eb3724ab04503719de5e49249d11e4b338c62ec0 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 10 Nov 2022 11:15:20 -0500 Subject: [PATCH 0292/1127] add missing attribution method --- flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index ae576b2f5..92cbe729a 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -61,6 +61,7 @@ source_names: selection_fields: Class: Land FlowName: AREA HARVESTED + attribution_method: proportional attribution_source: USDA_CoA_Cropland_NAICS: year: 2017 From 4a43ec0c4beafd1da8156b0c62a9a850a9c06fa5 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 10 Nov 2022 13:05:42 -0500 Subject: [PATCH 0293/1127] replace use of aggregator() with aggregate_flowby() to retain attached configuration file --- flowsa/data_source_scripts/USGS_NWIS_WU.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/flowsa/data_source_scripts/USGS_NWIS_WU.py b/flowsa/data_source_scripts/USGS_NWIS_WU.py index bebf9489a..30a7b99fa 100644 --- a/flowsa/data_source_scripts/USGS_NWIS_WU.py +++ b/flowsa/data_source_scripts/USGS_NWIS_WU.py @@ -15,6 +15,7 @@ from flowsa.flowbyfunctions import assign_fips_location_system, aggregator from flowsa.validation import compare_df_units, \ calculate_flowamount_diff_between_dfs +from flowsa.flowby import FlowByActivity def usgs_URL_helper(*, build_url, config, **_): @@ -354,7 +355,7 @@ def standardize_usgs_nwis_names(flowbyactivity_df): return flowbyactivity_df -def usgs_fba_data_cleanup(fba, **_): +def usgs_fba_data_cleanup(fba: FlowByActivity) -> FlowByActivity: """ Clean up the dataframe to prepare for flowbysector. Used in flowbysector.py :param fba: df, FBA format @@ -416,7 +417,7 @@ def usgs_fba_data_cleanup(fba, **_): return dfd -def calculate_net_public_supply(df_load): +def calculate_net_public_supply(df_load: FlowByActivity): """ USGS Provides info on the quantity of public supply withdrawals that are delivered to domestic use. The USGS PS withdrawals are not necessarily @@ -530,7 +531,7 @@ def calculate_net_public_supply(df_load): return modified_ps -def check_golf_and_crop_irrigation_totals(df_load): +def check_golf_and_crop_irrigation_totals(df_load: FlowByActivity): """ Check that golf + crop values equal published irrigation totals. If not, assign water to crop irrigation. @@ -564,11 +565,12 @@ def check_golf_and_crop_irrigation_totals(df_load): df_w_missing_crop = pd.concat([df_load, df_m3], ignore_index=True) group_cols = list(df.select_dtypes(include=['object', 'int']).columns) - df_w_missing_crop = aggregator(df_w_missing_crop, group_cols, - retain_zeros=True) + + df_w_missing_crop2 = df_w_missing_crop.aggregate_flowby( + retain_zeros=True, columns_to_group_by=group_cols) # validate results - the differences should all be 0 - df_check = subset_and_merge_irrigation_types(df_w_missing_crop) + df_check = subset_and_merge_irrigation_types(df_w_missing_crop2) df_check = df_check[df_check['Location'] != US_FIPS].reset_index( drop=True) df_check['Diff'] = df_check['Diff'].apply(lambda x: round(x, 2)) @@ -579,12 +581,12 @@ def check_golf_and_crop_irrigation_totals(df_load): else: vLogDetailed.info('The golf and crop irrigation add up to total ' 'irrigation.') - return df_w_missing_crop + return df_w_missing_crop2 else: return df_load -def subset_and_merge_irrigation_types(df): +def subset_and_merge_irrigation_types(df: FlowByActivity): # subset into golf, crop, and total irrigation (and non irrigation) df_i = df[(df[fba_activity_fields[0]] == 'Irrigation') | (df[fba_activity_fields[1]] == 'Irrigation')] @@ -635,7 +637,7 @@ def subset_and_merge_irrigation_types(df): return df_m2 -def usgs_fba_w_sectors_data_cleanup(df_wsec, attr, **kwargs): +def usgs_fba_w_sectors_data_cleanup(df_wsec: FlowByActivity, attr, **kwargs) -> FlowByActivity: """ Call on functions to modify the fba with sectors df before being allocated to sectors used in flowbysector.py @@ -651,7 +653,7 @@ def usgs_fba_w_sectors_data_cleanup(df_wsec, attr, **kwargs): return df -def modify_sector_length(df_wsec): +def modify_sector_length(df_wsec: FlowByActivity): """ After assigning sectors to activities, modify the sector length of an activity, to match the assigned sector in another sector column ( From 7e5f83a7455d31ee61cd8236faeb499c20d2a3ee Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 10 Nov 2022 13:06:19 -0500 Subject: [PATCH 0294/1127] option to retain zeros within aggregate_flowby(), default is false --- flowsa/flowby.py | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 073102f15..142ff4661 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -483,9 +483,10 @@ def select_by_fields(self: FB, selection_fields: dict = None) -> FB: return replaced_fb def aggregate_flowby( - self: FB, - columns_to_group_by: List[str] = None, - columns_to_average: List[str] = None + self: FB, + columns_to_group_by: List[str] = None, + columns_to_average: List[str] = None, + retain_zeros: bool = False ) -> FB: """ Aggregates (sums) FlowBy 'FlowAmount' column based on group_by_columns @@ -507,14 +508,24 @@ def aggregate_flowby( if self[x].dtype == 'float' and x != 'FlowAmount' ] - fb = ( - self - .query('FlowAmount != 0') - .drop(columns=[c for c in self.columns - if c not in ['FlowAmount', - *columns_to_average, - *columns_to_group_by]]) - ) + if retain_zeros: + # keep rows of zero values + fb = ( + self + .drop(columns=[c for c in self.columns + if c not in ['FlowAmount', + *columns_to_average, + *columns_to_group_by]]) + ) + else: + fb = ( + self + .query('FlowAmount != 0') + .drop(columns=[c for c in self.columns + if c not in ['FlowAmount', + *columns_to_average, + *columns_to_group_by]]) + ) aggregated = ( fb From d62f73940272b97d76189e22517989c195f3e9e9 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 10 Nov 2022 13:07:06 -0500 Subject: [PATCH 0295/1127] update flowable/flowname and compartment/context use --- flowsa/validation.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/flowsa/validation.py b/flowsa/validation.py index 9e4b3d9d2..6553d60c1 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -15,7 +15,7 @@ replace_NoneType_with_empty_cells from flowsa.common import sector_level_key, \ load_crosswalk, SECTOR_SOURCE_NAME, fba_activity_fields, \ - fba_default_grouping_fields, check_activities_sector_like + fba_mapped_default_grouping_fields, check_activities_sector_like from flowsa.location import US_FIPS, fips_number_key from flowsa.settings import log, vLog, vLogDetailed @@ -300,10 +300,10 @@ def calculate_flowamount_diff_between_dfs(dfa_load, dfb_load): # Because code will sometimes change terminology, aggregate # data by context and flowable to compare df differences # subset df - dfs = df[['Flowable', 'Context', 'ActivityProducedBy', + dfs = df[['FlowName', 'Compartment', 'ActivityProducedBy', 'ActivityConsumedBy', 'FlowAmount_Original', 'FlowAmount_Modified', 'Unit', 'geoscale']] - agg_cols = ['Flowable', 'Context', 'ActivityProducedBy', + agg_cols = ['FlowName', 'Compartment', 'ActivityProducedBy', 'ActivityConsumedBy', 'Unit', 'geoscale'] dfagg = dfs.groupby( agg_cols, dropna=False, as_index=False).agg( @@ -324,7 +324,7 @@ def calculate_flowamount_diff_between_dfs(dfa_load, dfb_load): columns=['ActivityProducedBy', 'ActivityConsumedBy', 'FlowAmount_Difference', 'Percent_Difference']) dfagg4 = dfagg3.groupby( - ['Flowable', 'Context', 'Unit', 'geoscale'], + ['FlowName', 'Compartment', 'Unit', 'geoscale'], dropna=False, as_index=False).agg( {'FlowAmount_Original': sum, 'FlowAmount_Modified': sum}) # column calculating difference @@ -1007,7 +1007,7 @@ def compare_geographic_totals( # depending on the datasource, might need to rename some # strings for national comparison sub = rename_column_values_for_comparison(sub, sourcename) - sub2 = aggregator(sub, fba_default_grouping_fields).rename( + sub2 = aggregator(sub, fba_mapped_default_grouping_fields).rename( columns={'FlowAmount': 'FlowAmount_sub'}) # compare df @@ -1018,7 +1018,7 @@ def compare_geographic_totals( ['Class', 'SourceName', 'Flowable', 'Unit', 'FlowType', 'ActivityProducedBy', 'ActivityConsumedBy', 'Context', 'Location', 'LocationSystem', 'Year']) - # comapare units + # compare units compare_df_units(nat, sub2) df_m = pd.merge(nat[merge_cols + ['FlowAmount_nat']], sub2[merge_cols + ['FlowAmount_sub']], @@ -1064,12 +1064,10 @@ def rename_column_values_for_comparison(df, sourcename): # for fresh/saline and ground/surface water. Therefore, to compare # subset data to national level, rename to match national values. if sourcename == 'USGS_NWIS_WU': - df['FlowName'] = np.where( - df['ActivityConsumedBy'] != 'Livestock', 'total', df['FlowName']) - df['Compartment'] = df['Compartment'].str.replace( - 'ground', 'total', regex=True) - df['Compartment'] = df['Compartment'].str.replace( - 'surface', 'total', regex=True) + df['Flowable'] = np.where( + df['ActivityConsumedBy'] != 'Livestock', 'Water', df['Flowable']) + df['Context'] = np.where(df['Context'].str.contains('resource/water/'), + 'resource/water', df['Context']) return df From 0c767614150394d1c2ae4f48d6a5b2db48dc4eee Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 10 Nov 2022 13:08:12 -0500 Subject: [PATCH 0296/1127] set download FBA to true - revisit to incorporate download_sources_ok default --- flowsa/data_source_scripts/USDA_CoA_Cropland.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flowsa/data_source_scripts/USDA_CoA_Cropland.py b/flowsa/data_source_scripts/USDA_CoA_Cropland.py index f3221ebbd..521438e2f 100644 --- a/flowsa/data_source_scripts/USDA_CoA_Cropland.py +++ b/flowsa/data_source_scripts/USDA_CoA_Cropland.py @@ -353,18 +353,18 @@ def disaggregate_coa_cropland_to_6_digit_naics_for_water_withdrawal( # use ratios of usda 'land in farms' to determine animal use of # pasturelands at 6 digit naics - # todo: replace with download_sources_ok + # todo: update download fba if missing to use default input (download_sources_ok) fba_w_sector = disaggregate_pastureland( fba_w_sector, attr, method, year=fba_w_sector.config['year'], - sector_column=sector_col, download_FBA_if_missing=kwargs['download_FBA_if_missing'], + sector_column=sector_col, download_FBA_if_missing=True, parameter_drop=['1125']) # use ratios of usda 'harvested cropland' to determine missing 6 digit # naics + # todo: update download fba if missing to use default input (download_sources_ok) fba_w_sector = disaggregate_cropland( fba_w_sector, attr, method, year=fba_w_sector.config['year'], - sector_column=sector_col, download_FBA_if_missing=kwargs[ - 'download_FBA_if_missing']) + sector_column=sector_col, download_FBA_if_missing=True) return fba_w_sector From b7ac56904d7b566fe8dd4e1d0ad34de07e1eeed5 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 10 Nov 2022 13:57:33 -0500 Subject: [PATCH 0297/1127] fix BEA_Use --- .../CAP_HAP_national_2017.yaml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index 92cbe729a..99ed1e6ee 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -28,6 +28,7 @@ sources_to_cache: _attribution_sources: BEA: &bea year: 2012 + geoscale: national activity_to_sector_mapping: BEA_2012_Detail attribution_method: proportional attribution_source: @@ -154,9 +155,8 @@ source_names: PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv mobile_and_fuel_storage attribution_method: proportional attribution_source: - BEA_Use_Detail_BeforeRedef: + BEA_Use_Detail_PRO_BeforeRedef: <<: *bea - primary_action_type: Consumed # confirm this selection_fields: ActivityProducedBy: {'324110': ''} # Petroleum @@ -165,9 +165,8 @@ source_names: PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv fertilizers attribution_method: proportional attribution_source: - BEA_Use_Detail_BeforeRedef: + BEA_Use_Detail_PRO_BeforeRedef: <<: *bea - primary_action_type: Consumed # confirm this selection_fields: ActivityProducedBy: {'325310': ''} # Fertilizers @@ -177,9 +176,8 @@ source_names: PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv pesticides attribution_method: proportional attribution_source: - BEA_Use_Detail_BeforeRedef: + BEA_Use_Detail_PRO_BeforeRedef: <<: *bea - primary_action_type: Consumed # confirm this selection_fields: ActivityProducedBy: {'325320': ''} # Pesticides @@ -219,9 +217,8 @@ source_names: PrimaryActivity: !from_index:NEI_Nonroad_2017_asets.csv offroad_vehicles_equipment attribution_method: proportional attribution_source: - BEA_Use_Detail_BeforeRedef: + BEA_Use_Detail_PRO_BeforeRedef: <<: *bea - primary_action_type: Consumed # confirm this selection_fields: ActivityProducedBy: {'324110': ''} # Petroleum @@ -243,9 +240,8 @@ source_names: PrimaryActivity: !from_index:NEI_Onroad_2017_asets.csv onroad_vehicles_gas_stations attribution_method: proportional attribution_source: - BEA_Use_Detail_BeforeRedef: + BEA_Use_Detail_PRO_BeforeRedef: <<: *bea - primary_action_type: Consumed # confirm this selection_fields: ActivityProducedBy: {'324110': ''} # Petroleum From fb252bd09a11559ccc9630a42049799edfcf0504 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 10 Nov 2022 13:59:56 -0500 Subject: [PATCH 0298/1127] Fix data types in convert_to_geoscale() --- flowsa/flowby.py | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 4364c9d75..471f6a525 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -508,24 +508,14 @@ def aggregate_flowby( if self[x].dtype == 'float' and x != 'FlowAmount' ] - if retain_zeros: - # keep rows of zero values - fb = ( - self - .drop(columns=[c for c in self.columns - if c not in ['FlowAmount', - *columns_to_average, - *columns_to_group_by]]) - ) - else: - fb = ( - self - .query('FlowAmount != 0') - .drop(columns=[c for c in self.columns - if c not in ['FlowAmount', - *columns_to_average, - *columns_to_group_by]]) - ) + if not retain_zeros: + self = self.query('FlowAmount != 0') + # ^^^ keep rows of zero values + + fb = self.drop(columns=[c for c in self.columns + if c not in ['FlowAmount', + *columns_to_average, + *columns_to_group_by]]) aggregated = ( fb @@ -921,8 +911,10 @@ def convert_to_geoscale( .reset_index() .rename(columns={ 'geoscale': f'highest_reporting_level_by_{scale.name.title()}' - })) - .astype(object) + }) + .astype({activity: flowby_config['fba_fields'][activity] + for activity in ['ActivityProducedBy', + 'ActivityConsumedBy']})) for scale in geo.scale if scale.has_fips_level and scale <= target_geoscale ] From d10ed172754ecf1976fd19e493c30ebb24dcc56d Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 10 Nov 2022 15:07:18 -0500 Subject: [PATCH 0299/1127] move attribution df prep to new fxn to prevent code duplication --- flowsa/flowby.py | 53 +++++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 4364c9d75..d3e8c2cb8 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -987,6 +987,33 @@ def convert_to_geoscale( return fba_at_target_geoscale + def load_prepare_attribution_source(self: 'FlowByActivity') -> 'FlowBySector': + attribution_source = self.config['attribution_source'] + + if isinstance(attribution_source, str): + name, config = attribution_source, {} + else: + (name, config), = attribution_source.items() + + if name in self.config['cache']: + attribution_fbs = self.config['cache'][name].copy() + attribution_fbs.config = { + **{k: attribution_fbs.config[k] + for k in attribution_fbs.config['method_config_keys']}, + **config + } + attribution_fbs = attribution_fbs.prepare_fbs() + else: + attribution_fbs = get_flowby_from_config( + name=name, + config={**{k: v for k, v in self.config.items() + if k in self.config['method_config_keys'] + or k == 'method_config_keys'}, + **get_catalog_info(name), + **config} + ).prepare_fbs() + return attribution_fbs + def attribute_flows_to_sectors( self: 'FlowByActivity', external_config_path: str = None @@ -1019,31 +1046,7 @@ def attribute_flows_to_sectors( attribution_method = fba.config.get('attribution_method') if attribution_method == 'proportional': - attribution_source = fba.config['attribution_source'] - - if isinstance(attribution_source, str): - name, config = attribution_source, {} - else: - (name, config), = attribution_source.items() - - if name in fba.config['cache']: - attribution_fbs = fba.config['cache'][name].copy() - attribution_fbs.config = { - **{k: attribution_fbs.config[k] - for k in attribution_fbs.config['method_config_keys']}, - **config - } - attribution_fbs = attribution_fbs.prepare_fbs() - else: - attribution_fbs = get_flowby_from_config( - name=name, - config={**{k: v for k, v in fba.config.items() - if k in fba.config['method_config_keys'] - or k == 'method_config_keys'}, - **get_catalog_info(name), - **config} - ).prepare_fbs() - + attribution_fbs = fba.load_prepare_attribution_source() attributed_fba = fba.proportionally_attribute(attribution_fbs) # elif attribution_method == 'proportional-flagged': From 88a6d348688fe8e563770941c7665fdbd416e43b Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 10 Nov 2022 15:08:11 -0500 Subject: [PATCH 0300/1127] begin code for multiplication of attribution data - not working yet --- flowsa/flowby.py | 73 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index d3e8c2cb8..aa07040ed 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1049,6 +1049,10 @@ def attribute_flows_to_sectors( attribution_fbs = fba.load_prepare_attribution_source() attributed_fba = fba.proportionally_attribute(attribution_fbs) + elif attribution_method == 'multiplication': + attribution_fbs = fba.load_prepare_attribution_source() + attributed_fba = fba.multiplication_attribution(attribution_fbs) + # elif attribution_method == 'proportional-flagged': # attributed_fba = fba.flagged_proportionally_attribute90 @@ -1401,6 +1405,75 @@ def proportionally_attribute( .reset_index(drop=True) ) + def multiplication_attribution(self: 'FlowByActivity', + other: 'FlowBySector' ) -> 'FlowByActivity': + """ + This method takes flows from the calling FBA which are mapped to + multiple sectors and multiplies them by flows from other (an FBS). + """ + # todo: function not working correctly + + fba_geoscale = geo.scale.from_string(self.config['geoscale']) + other_geoscale = geo.scale.from_string(other.config['geoscale']) + + log.info('Multiplying flows in %s by %s.', + self.full_name, other.full_name) + + if other_geoscale < fba_geoscale: + other = ( + other + .convert_fips_to_geoscale(fba_geoscale) + .aggregate_flowby() + ) + elif other_geoscale > fba_geoscale: + self = ( + self + .assign(temp_location=self.Location) + .convert_fips_to_geoscale(other_geoscale, + column='temp_location') + ) + + fba = self.add_primary_secondary_columns('Sector') + other = ( + other + .add_primary_secondary_columns('Sector') + [['PrimarySector', 'Location', 'FlowAmount']] + .groupby(['PrimarySector', 'Location']) + .agg('sum') + .reset_index() + ) + + groupby_cols = ['group_id'] + for rank in ['Primary', 'Secondary']: + merged = (fba + .merge(other, + how='left', + left_on=[f'{rank}Sector', + 'temp_location' + if 'temp_location' in fba + else 'Location'], + right_on=['PrimarySector', 'Location'], + suffixes=[None, '_other']) + .fillna({'FlowAmount_other': 0}) + ) + + fba = (merged + .assign(FlowAmount=lambda x: (x.FlowAmount + * x.FlowAmount_other)) + .drop(columns=['PrimarySector_other', 'Location_other', + 'FlowAmount_other', 'denominator'], + errors='ignore') + ) + groupby_cols.append(f'{rank}Sector') + + return ( + fba + .drop(columns=['PrimarySector', 'SecondarySector', + 'temp_location'], + errors='ignore') + .reset_index(drop=True) + ) + # def flagged_proportionally_attribute(self: 'FlowByActivity'): # raise NotImplementedError From 332d8964fe3877cfa1e093c22260550c4c5b78ac Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 11 Nov 2022 22:15:12 -0500 Subject: [PATCH 0301/1127] update stewicombo to sector with new classes, test with GRDREL --- flowsa/data_source_scripts/stewiFBS.py | 205 +++++++----------- flowsa/flowby.py | 4 +- .../GRDREL_national_2017.yaml | 4 +- .../GRDREL_state_2017.yaml | 4 +- 4 files changed, 91 insertions(+), 126 deletions(-) diff --git a/flowsa/data_source_scripts/stewiFBS.py b/flowsa/data_source_scripts/stewiFBS.py index dcbb9fcf4..bbfa47d87 100644 --- a/flowsa/data_source_scripts/stewiFBS.py +++ b/flowsa/data_source_scripts/stewiFBS.py @@ -14,17 +14,11 @@ import sys import os import pandas as pd -from esupy.dqi import get_weighted_average +import numpy as np from esupy.processed_data_mgmt import read_source_metadata -from flowsa.allocation import equally_allocate_parent_to_child_naics -from flowsa.flowbyfunctions import assign_fips_location_system,\ - aggregate_and_subset_for_target_sectors -from flowsa.dataclean import add_missing_flow_by_fields -from flowsa.sectormapping import map_flows -from flowsa.location import apply_county_FIPS, update_geoscale -from flowsa.schema import flow_by_sector_fields +from flowsa.flowby import FlowBySector, FlowByActivity +from flowsa.location import apply_county_FIPS from flowsa.settings import log, process_adjustmentpath -from flowsa.validation import replace_naics_w_naics_from_another_year import stewicombo import stewi from stewicombo.overlaphandler import remove_default_flow_overlaps @@ -33,10 +27,15 @@ import facilitymatcher -def stewicombo_to_sector(yaml_load, method, fbsconfigpath=None): +def stewicombo_to_sector( + config, + full_name, + external_config_path: str = None, + **_ + ) -> 'FlowBySector': """ Returns emissions from stewicombo in fbs format, requires stewi >= 0.9.5 - :param yaml_load: which may contain the following elements: + :param config: which may contain the following elements: local_inventory_name: (optional) a string naming the file from which to source a pregenerated stewicombo file stored locally (e.g., 'CAP_HAP_national_2017_v0.9.7_5cf36c0.parquet' or @@ -47,10 +46,12 @@ def stewicombo_to_sector(yaml_load, method, fbsconfigpath=None): 'soil'), use None to include all compartments functions: list of functions (str) to call for additional processing :param method: dictionary, FBS method - :param fbsconfigpath, str, optional path to an FBS method outside flowsa repo - :return: df, FBS format + :param external_config_path, str, optional path to an FBS method outside + flowsa repo + :return: FlowBySector object """ - inventory_name = yaml_load.get('local_inventory_name') + inventory_name = config.get('local_inventory_name') + config['full_name'] = full_name df = None if inventory_name is not None: @@ -60,70 +61,66 @@ def stewicombo_to_sector(yaml_load, method, fbsconfigpath=None): # run stewicombo to combine inventories, filter for LCI, remove overlap log.info('generating inventory in stewicombo') df = stewicombo.combineFullInventories( - yaml_load['inventory_dict'], filter_for_LCI=True, - remove_overlap=True, compartments=yaml_load.get('compartments')) + config['inventory_dict'], filter_for_LCI=True, + remove_overlap=True, compartments=config.get('compartments')) if df is None: # Inventories not found for stewicombo, return empty FBS return - df.drop( - columns=['SRS_CAS', 'SRS_ID', 'FacilityIDs_Combined'], inplace=True) - - inventory_list = list(yaml_load['inventory_dict'].keys()) - facility_mapping = extract_facility_data(yaml_load['inventory_dict']) + facility_mapping = extract_facility_data(config['inventory_dict']) # merge dataframes to assign facility information based on facility IDs - df = pd.merge(df, - facility_mapping.loc[:, facility_mapping.columns != 'NAICS'], - how='left', on='FacilityID') + df = (df.drop(columns=['SRS_CAS', 'SRS_ID', 'FacilityIDs_Combined']) + .merge(facility_mapping.loc[:, facility_mapping.columns != 'NAICS'], + how='left', on='FacilityID') + ) - all_NAICS = obtain_NAICS_from_facility_matcher(inventory_list) + all_NAICS = obtain_NAICS_from_facility_matcher( + list(config['inventory_dict'].keys())) df = assign_naics_to_stewicombo(df, all_NAICS, facility_mapping) - if 'reassign_process_to_sectors' in yaml_load: + if 'reassign_process_to_sectors' in config: df = reassign_process_to_sectors( - df, yaml_load['inventory_dict']['NEI'], - yaml_load['reassign_process_to_sectors'], - fbsconfigpath) - - df['MetaSources'] = df['Source'] + df, config['inventory_dict']['NEI'], + config['reassign_process_to_sectors'], + external_config_path) - fbs = prepare_stewi_fbs(df, yaml_load, method) + fbs = prepare_stewi_fbs(df, config) return fbs -def stewi_to_sector(yaml_load, method, *_): +def stewi_to_sector(config, **_) -> 'FlowBySector': """ Returns emissions from stewi in fbs format, requires stewi >= 0.9.5 - :param yaml_load: which may contain the following elements: + :param config: which may contain the following elements: inventory_dict: a dictionary of inventory types and years (e.g., {'NEI':'2017', 'TRI':'2017'}) compartments: list of compartments to include (e.g., 'water', 'air', 'soil'), use None to include all compartments functions: list of functions (str) to call for additional processing - :param method: dictionary, FBS method - :return: df, FBS format + :return: FlowBySector object """ # determine if fxns specified in FBS method yaml - functions = yaml_load.get('functions', []) + functions = config.get('functions', []) # run stewi to generate inventory and filter for LCI df = pd.DataFrame() - for database, year in yaml_load['inventory_dict'].items(): - inv = stewi.getInventory( - database, year, filters=['filter_for_LCI', 'US_States_only'], - download_if_missing=True) - inv['Year'] = year - inv['MetaSources'] = database + for database, year in config['inventory_dict'].items(): + inv = (stewi.getInventory( + database, year, filters=['filter_for_LCI', 'US_States_only'], + download_if_missing=True) + .assign(Year=year) + .assign(Source=database) + ) df = pd.concat([df, inv], ignore_index=True) - if yaml_load.get('compartments'): + if config.get('compartments'): # Subset based on primary compartment df = df[df['Compartment'].str.split('/', expand=True) - [0].isin(yaml_load.get('compartments'))] - facility_mapping = extract_facility_data(yaml_load['inventory_dict']) + [0].isin(config.get('compartments'))] + facility_mapping = extract_facility_data(config['inventory_dict']) # Convert NAICS to string (first to int to avoid decimals) facility_mapping['NAICS'] = \ facility_mapping['NAICS'].astype(int).astype(str) @@ -132,7 +129,7 @@ def stewi_to_sector(yaml_load, method, *_): df = pd.merge(df, facility_mapping, how='left', on='FacilityID') - fbs = prepare_stewi_fbs(df, yaml_load, method) + fbs = prepare_stewi_fbs(df, config) for function in functions: fbs = getattr(sys.modules[__name__], function)(fbs) @@ -140,7 +137,7 @@ def stewi_to_sector(yaml_load, method, *_): return fbs -def reassign_process_to_sectors(df, year, file_list, fbsconfigpath): +def reassign_process_to_sectors(df, year, file_list, external_config_path): """ Reassigns emissions from a specific process or SCC and NAICS combination to a new NAICS. @@ -149,14 +146,15 @@ def reassign_process_to_sectors(df, year, file_list, fbsconfigpath): :param year: year as str :param file_list: list, one or more names of csv files in process_adjustmentpath - :param fbsconfigpath, str, optional path to an FBS method outside flowsa repo + :param external_config_path, str, optional path to an FBS method outside + flowsa repo :return: df """ df_adj = pd.DataFrame() for file in file_list: fpath = f"{process_adjustmentpath}{file}.csv" - if fbsconfigpath: - f_out_path = f"{fbsconfigpath}process_adjustments/{file}.csv" + if external_config_path: + f_out_path = f"{external_config_path}process_adjustments/{file}.csv" if os.path.isfile(f_out_path): fpath = f_out_path log.debug(f"modifying processes from {fpath}") @@ -282,86 +280,47 @@ def assign_naics_to_stewicombo(df, all_NAICS, facility_mapping): return df -def prepare_stewi_fbs(df_load, yaml_load, method): +def prepare_stewi_fbs(df_load, config) -> 'FlowBySector': """ Function to prepare an emissions df from stewi or stewicombo for use as FBS :param df_load: a dataframe of emissions and mapped faciliites from stewi or stewicombo - :param yaml_load: dictionary, FBS method data source configuration - :param method: dictonary, FBS method + :param config: dictionary, FBS method data source configuration :return: df """ - inventory_dict = yaml_load.get('inventory_dict') - geo_scale = method.get('target_geoscale') + config['sector-like_activities']=True + config['fedefl_mapping'] = list( + config.get('inventory_dict').keys()) + config['drop_unmapped_rows'] = True # update location to appropriate geoscale prior to aggregating - df = df_load.dropna(subset=['Location']).reset_index(drop=True) - df['Location'] = df['Location'].astype(str) - df = update_geoscale(df, geo_scale) - - df = df.rename(columns = {"NAICS": "SectorProducedBy"}) - df.loc[:,'SectorConsumedBy'] = 'None' - - df = replace_naics_w_naics_from_another_year(df, 'NAICS_2012_Code') - df = equally_allocate_parent_to_child_naics(df, method) - - df_subset = aggregate_and_subset_for_target_sectors(df, method) - - # assign grouping variables based on desired geographic aggregation level - grouping_vars = ['FlowName', 'Compartment', 'Location', - 'SectorProducedBy'] - if 'MetaSources' in df: - grouping_vars.append('MetaSources') - - # aggregate by NAICS code, FlowName, compartment, and geographic level - fbs = df_subset.groupby(grouping_vars).agg({'FlowAmount': 'sum', - 'Year': 'first', - 'Unit': 'first'}) - - # add reliability score - fbs['DataReliability'] = get_weighted_average( - df, 'DataReliability', 'FlowAmount', grouping_vars) - fbs.reset_index(inplace=True) - - # apply flow mapping separately for elementary and waste flows - fbs['FlowType'] = 'ELEMENTARY_FLOW' - fbs.loc[fbs['MetaSources'] == 'RCRAInfo', 'FlowType'] = 'WASTE_FLOW' - - # Add 'SourceName' for mapping purposes - fbs['SourceName'] = fbs['MetaSources'] - fbs_elem = fbs.loc[fbs['FlowType'] == 'ELEMENTARY_FLOW'] - fbs_waste = fbs.loc[fbs['FlowType'] == 'WASTE_FLOW'] - fbs_list = [] - if len(fbs_elem) > 0: - fbs_elem = map_flows(fbs_elem, list(inventory_dict.keys()), - flow_type='ELEMENTARY_FLOW') - fbs_list.append(fbs_elem) - if len(fbs_waste) > 0: - fbs_waste = map_flows(fbs_waste, list(inventory_dict.keys()), - flow_type='WASTE_FLOW') - fbs_list.append(fbs_waste) - - if len(fbs_list) == 1: - fbs_mapped = fbs_list[0].copy() - else: - fbs_mapped = pd.concat[fbs_list].reset_index(drop=True) - - # add hardcoded data, depending on the source data, - # some of these fields may need to change - fbs_mapped['Class'] = 'Chemicals' - fbs_mapped['SectorSourceName'] = 'NAICS_2012_Code' - - fbs_mapped = assign_fips_location_system( - fbs_mapped, list(inventory_dict.values())[0]) - - # add missing flow by sector fields - fbs_mapped = add_missing_flow_by_fields(fbs_mapped, flow_by_sector_fields) - - # sort dataframe and reset index - fbs_mapped = fbs_mapped.sort_values( - list(flow_by_sector_fields.keys())).reset_index(drop=True) - - return fbs_mapped + fbs = FlowByActivity( + df_load + .rename(columns={"NAICS": "ActivityProducedBy", + 'Source': 'SourceName'}) + .assign(Class='Chemicals') + .assign(FlowType=lambda x: np.where( + x['SourceName']=='RCRAInfo', + 'WASTE_FLOW', + 'ELEMENTARY_FLOW') + ) + .drop(columns=['FacilityID','FRS_ID','State','County'], + errors='ignore') + .dropna(subset=['Location']) + .reset_index(drop=True), + full_name=config.get('full_name'), + config=config, + ).prepare_fbs() + + ## TODO replace_naics_w_naics_from_another_year + # df = replace_naics_w_naics_from_another_year(df, 'NAICS_2012_Code') + # df = equally_allocate_parent_to_child_naics(df, config) + # df_subset = aggregate_and_subset_for_target_sectors(df, config) + + # fbs_mapped = assign_fips_location_system( + # fbs_mapped, list(inventory_dict.values())[0]) + + return fbs def add_stewi_metadata(inventory_dict): diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 6fdd6da52..81b87f7ae 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -62,7 +62,9 @@ def get_flowby_from_config( elif config['data_format'] == 'FBS_outside_flowsa': return FlowBySector( config['FBS_datapull_fxn']( - config, config, external_config_path + config=config, + external_config_path=external_config_path, + full_name=name ), full_name=name, config=config diff --git a/flowsa/methods/flowbysectormethods/GRDREL_national_2017.yaml b/flowsa/methods/flowbysectormethods/GRDREL_national_2017.yaml index 1812c883b..3cd77b094 100644 --- a/flowsa/methods/flowbysectormethods/GRDREL_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/GRDREL_national_2017.yaml @@ -1,10 +1,12 @@ +industry_spec: + default: NAICS_6 +year: 2017 geoscale: national source_names: stewiFBS: data_format: FBS_outside_flowsa FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector # Below are arguments needed by the stewicombo_to_sector function - target_sector_level: NAICS_6 inventory_dict: {"TRI":"2017"} local_inventory_name: TRI_GRDREL_2017 compartments: diff --git a/flowsa/methods/flowbysectormethods/GRDREL_state_2017.yaml b/flowsa/methods/flowbysectormethods/GRDREL_state_2017.yaml index 50f040e15..8ba153214 100644 --- a/flowsa/methods/flowbysectormethods/GRDREL_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/GRDREL_state_2017.yaml @@ -1,10 +1,12 @@ +industry_spec: + default: NAICS_6 +year: 2017 geoscale: state source_names: stewiFBS: data_format: FBS_outside_flowsa FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector # Below are arguments needed by the stewicombo_to_sector function - target_sector_level: NAICS_6 inventory_dict: {"TRI":"2017"} local_inventory_name: TRI_GRDREL_2017 compartments: From c9b9003662d549f005eeba43f7f4b6eff93cd71b Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 11 Nov 2022 22:15:41 -0500 Subject: [PATCH 0302/1127] for validation ignore empty columns --- flowsa/validation.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/flowsa/validation.py b/flowsa/validation.py index b99d3effa..bdd225767 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -946,13 +946,16 @@ def compare_FBS_results(fbs1, fbs2, ignore_metasources=False, 'Unit', 'FlowType', 'Year', 'MetaSources'] if ignore_metasources: merge_cols.remove('MetaSources') - df1 = df1.groupby(merge_cols).agg({'FlowAmount_fbs1':'sum'}).reset_index() - df2 = df2.groupby(merge_cols).agg({'FlowAmount_fbs2':'sum'}).reset_index() + df1 = (df1.groupby(merge_cols, dropna=False) + .agg({'FlowAmount_fbs1':'sum'}).reset_index()) + df2 = (df2.groupby(merge_cols, dropna=False) + .agg({'FlowAmount_fbs2':'sum'}).reset_index()) # check units compare_df_units(df1, df2) - df_m = pd.merge(df1[merge_cols + ['FlowAmount_fbs1']], - df2[merge_cols + ['FlowAmount_fbs2']], - how='outer') + df_m = pd.DataFrame( + pd.merge(df1[merge_cols + ['FlowAmount_fbs1']], + df2[merge_cols + ['FlowAmount_fbs2']], + how='outer')) df_m = df_m.assign(FlowAmount_diff=df_m['FlowAmount_fbs2'] .fillna(0) - df_m['FlowAmount_fbs1'].fillna(0)) df_m = df_m.assign( From 10120985b37bb3e3838eeabb142b4e07450f0d68 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 11 Nov 2022 22:38:49 -0500 Subject: [PATCH 0303/1127] updates for stewi_to_sector --- flowsa/data_source_scripts/stewiFBS.py | 13 ++++++++++--- .../flowbysectormethods/CRHW_national_2017.yaml | 7 ++++--- .../flowbysectormethods/CRHW_state_2017.yaml | 7 ++++--- .../flowbysectormethods/TRI_DMR_national_2017.yaml | 7 ++++--- .../flowbysectormethods/TRI_DMR_state_2017.yaml | 7 ++++--- 5 files changed, 26 insertions(+), 15 deletions(-) diff --git a/flowsa/data_source_scripts/stewiFBS.py b/flowsa/data_source_scripts/stewiFBS.py index bbfa47d87..5f4e5f86c 100644 --- a/flowsa/data_source_scripts/stewiFBS.py +++ b/flowsa/data_source_scripts/stewiFBS.py @@ -92,7 +92,12 @@ def stewicombo_to_sector( return fbs -def stewi_to_sector(config, **_) -> 'FlowBySector': +def stewi_to_sector( + config, + full_name, + external_config_path: str = None, + **_ + ) -> 'FlowBySector': """ Returns emissions from stewi in fbs format, requires stewi >= 0.9.5 :param config: which may contain the following elements: @@ -105,6 +110,7 @@ def stewi_to_sector(config, **_) -> 'FlowBySector': """ # determine if fxns specified in FBS method yaml functions = config.get('functions', []) + config['full_name'] = full_name # run stewi to generate inventory and filter for LCI df = pd.DataFrame() @@ -289,8 +295,9 @@ def prepare_stewi_fbs(df_load, config) -> 'FlowBySector': :return: df """ config['sector-like_activities']=True - config['fedefl_mapping'] = list( - config.get('inventory_dict').keys()) + config['fedefl_mapping'] = ( + [x for x in config.get('inventory_dict').keys() + if x != 'RCRAInfo']) config['drop_unmapped_rows'] = True # update location to appropriate geoscale prior to aggregating diff --git a/flowsa/methods/flowbysectormethods/CRHW_national_2017.yaml b/flowsa/methods/flowbysectormethods/CRHW_national_2017.yaml index 776d28d1a..b1a9f4771 100644 --- a/flowsa/methods/flowbysectormethods/CRHW_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CRHW_national_2017.yaml @@ -1,11 +1,12 @@ +industry_spec: + default: NAICS_6 +year: 2017 geoscale: national source_names: stewiFBS: data_format: FBS_outside_flowsa FBS_datapull_fxn: !script_function:stewiFBS stewi_to_sector - # temporarily maintain target_sector_level for - # allocation.equally_allocate_parent_to_child_naics() - target_sector_level: NAICS_6 + # Below are arguments needed by the stewicombo_to_sector function inventory_dict: {"RCRAInfo":"2017"} compartments: - waste diff --git a/flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml b/flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml index 82ec5cbf8..363d7b478 100644 --- a/flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml @@ -1,11 +1,12 @@ +industry_spec: + default: NAICS_6 +year: 2017 geoscale: state source_names: stewiFBS: data_format: FBS_outside_flowsa FBS_datapull_fxn: !script_function:stewiFBS stewi_to_sector - # temporarily maintain target_sector_level for - # allocation.equally_allocate_parent_to_child_naics() - target_sector_level: NAICS_6 + # Below are arguments needed by the stewicombo_to_sector function inventory_dict: {"RCRAInfo":"2017"} compartments: - waste diff --git a/flowsa/methods/flowbysectormethods/TRI_DMR_national_2017.yaml b/flowsa/methods/flowbysectormethods/TRI_DMR_national_2017.yaml index 69ddab71c..7e21aa95a 100644 --- a/flowsa/methods/flowbysectormethods/TRI_DMR_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/TRI_DMR_national_2017.yaml @@ -1,11 +1,12 @@ +industry_spec: + default: NAICS_6 +year: 2017 geoscale: national source_names: stewiFBS: data_format: FBS_outside_flowsa FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector - # temporarily maintain target_sector_level for - # allocation.equally_allocate_parent_to_child_naics() - target_sector_level: NAICS_6 + # Below are arguments needed by the stewicombo_to_sector function inventory_dict: {"TRI":"2017", "DMR":"2017"} local_inventory_name: TRI_DMR_2017 compartments: diff --git a/flowsa/methods/flowbysectormethods/TRI_DMR_state_2017.yaml b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2017.yaml index 3f846f427..0592f8f38 100644 --- a/flowsa/methods/flowbysectormethods/TRI_DMR_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2017.yaml @@ -1,11 +1,12 @@ +industry_spec: + default: NAICS_6 +year: 2017 geoscale: state source_names: stewiFBS: data_format: FBS_outside_flowsa FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector - # temporarily maintain target_sector_level for - # allocation.equally_allocate_parent_to_child_naics() - target_sector_level: NAICS_6 + # Below are arguments needed by the stewicombo_to_sector function inventory_dict: {"TRI":"2017", "DMR":"2017"} local_inventory_name: TRI_DMR_2017 compartments: From 0d0e36134c86077c47919d9ebc076d492947e7c5 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sat, 12 Nov 2022 13:26:56 -0500 Subject: [PATCH 0304/1127] simplify cleaning fxn name: `clean_fbs` --- flowsa/flowby.py | 2 +- .../methods/flowbysectormethods/CAP_HAP_national_2017.yaml | 6 +++--- flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml | 2 +- flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 81b87f7ae..12ef88ffe 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1783,7 +1783,7 @@ def generateFlowBySector( def prepare_fbs(self: 'FlowBySector') -> 'FlowBySector': return ( self - .function_socket('clean_fbs_df_fxn') + .function_socket('clean_fbs') .select_by_fields() # TODO: Add a method to convert to proper industry spec. .convert_fips_to_geoscale() diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index 99ed1e6ee..76dd6e1fb 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -204,7 +204,7 @@ source_names: year: 2017 primary_action_type: Produced activity_to_sector_mapping: SCC - clean_fba_df_fxn: !script_function:EPA_NEI clean_NEI_fba + clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba fedefl_mapping: NEI activity_sets: direct_allocation: @@ -227,7 +227,7 @@ source_names: year: 2017 primary_action_type: Produced activity_to_sector_mapping: SCC - clean_fba_df_fxn: !script_function:EPA_NEI clean_NEI_fba + clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba fedefl_mapping: NEI activity_sets: direct_allocation: @@ -253,7 +253,7 @@ source_names: # temporarily maintain target_sector_level for # allocation.equally_allocate_parent_to_child_naics() target_sector_level: NAICS_6 - clean_fbs_df_fxn: !script_function:EPA_NEI drop_GHGs + clean_fbs: !script_function:EPA_NEI drop_GHGs compartments: - air reassign_process_to_sectors: diff --git a/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml b/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml index f0fcceb43..e152b6244 100644 --- a/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml @@ -10,5 +10,5 @@ target_sector_level: NAICS_6 source_names: CNHW_CA_2014: data_format: FBS - clean_fbs_df_fxn: !script_function:CalRecycle_WasteCharacterization apply_tons_per_employee_per_year_to_states + clean_fbs: !script_function:CalRecycle_WasteCharacterization apply_tons_per_employee_per_year_to_states year: 2014 diff --git a/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml b/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml index 26d4f079e..12fcf65e6 100644 --- a/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml @@ -5,7 +5,7 @@ geoscale: state source_names: CNHW_CA_2014: data_format: FBS - clean_fbs_df_fxn: !script_function:CalRecycle_WasteCharacterization apply_tons_per_employee_per_year_to_states + clean_fbs: !script_function:CalRecycle_WasteCharacterization apply_tons_per_employee_per_year_to_states year: 2014 From e07958c6963086ef43439b255fe2f7bf6f0a905c Mon Sep 17 00:00:00 2001 From: Eric Bell Date: Thu, 17 Nov 2022 15:37:24 -0500 Subject: [PATCH 0305/1127] Fix minor typo on 'Unit' column in NY_customized_parse --- flowsa/data_source_scripts/StateGHGI.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/data_source_scripts/StateGHGI.py b/flowsa/data_source_scripts/StateGHGI.py index 076783578..e18c5aefa 100644 --- a/flowsa/data_source_scripts/StateGHGI.py +++ b/flowsa/data_source_scripts/StateGHGI.py @@ -218,7 +218,7 @@ def NY_customized_parse(*, source, year, config, **_): df['FlowType'] = 'ELEMENTARY_FLOW' df['Compartment'] = 'air' df['Year'] = year - df['Units'] = 'MT' + df['Unit'] = 'MT' df['DataReliability'] = 5 df['DataCollection'] = 5 From fb4f9f479e702d2148b28baeb6b8af3d7222837c Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 23 Nov 2022 10:05:57 -0500 Subject: [PATCH 0306/1127] If all activity sets are empty, prepare_fbs now return an empty FBS instead of an error. standardize_units() now takes an optional year argument so it can be called on an FBA without a config dict attached --- flowsa/flowby.py | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 12ef88ffe..eea258bec 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -268,10 +268,10 @@ def convert_daily_to_annual(self: FB) -> FB: Unit=self.Unit.str.replace('/d', '')) ) - def standardize_units(self: FB) -> FB: + def standardize_units(self: FB, year: int = None) -> FB: exchange_rate = ( literature_values - .get_Canadian_to_USD_exchange_rate(self.config['year']) + .get_Canadian_to_USD_exchange_rate(year or self.config['year']) ) conversion_table = pd.concat([ @@ -1473,17 +1473,20 @@ def multiplication_attribution(self: 'FlowByActivity', def prepare_fbs(self: 'FlowByActivity') -> 'FlowBySector': if 'activity_sets' in self.config: - return ( - pd.concat([ - fba.prepare_fbs() - for fba in ( - self - .function_socket('clean_fba_before_activity_sets') - .activity_sets() - ) - ]) - .reset_index(drop=True) - ) + try: + return ( + pd.concat([ + fba.prepare_fbs() + for fba in ( + self + .function_socket('clean_fba_before_activity_sets') + .activity_sets() + ) + ]) + .reset_index(drop=True) + ) + except ValueError: + return FlowBySector(pd.DataFrame()) # Primary FlowBySector generation approach: return FlowBySector( From 444d79554d5870fe83e7e2791011aa9758d8e5a5 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 23 Nov 2022 10:11:54 -0500 Subject: [PATCH 0307/1127] Tweaks for functionality --- flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index 0e01cef5d..2b25270bc 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -192,6 +192,7 @@ _attribution_sources: attribution_method: proportional attribution_source: BLS_QCEW EPA_GHGI_T_A_79: &t_a_79 + <<: *ghgi_parameters attribution_method: proportional attribution_source: BLS_QCEW EIA_MECS_Energy: &mecs_energy @@ -1017,7 +1018,8 @@ source_names: ActivityProducedBy: T008 # Gross output. BTS_Airlines: + year: null selection_fields: Year: *year - emissions_factors: BTS_Airlines_emissions_factors + emissions_factors: EPA_emissions_factors activity_to_sector_mapping: EPA_GHGI From 400ffd5adafe696090325ea1b85398ab03834c5c Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 23 Nov 2022 10:56:51 -0500 Subject: [PATCH 0308/1127] Rewrote get_manufacturing_energy_ratios() to use new FBA methods and stop filtering on description == Table 3.2 or Table 2.2, since that doesn't seem to work with the current 2018 MECS FBA. --- flowsa/data_source_scripts/EPA_GHGI.py | 87 +++++++++++++------------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_GHGI.py b/flowsa/data_source_scripts/EPA_GHGI.py index cc32566e3..91e3ae81c 100644 --- a/flowsa/data_source_scripts/EPA_GHGI.py +++ b/flowsa/data_source_scripts/EPA_GHGI.py @@ -10,6 +10,7 @@ import zipfile import numpy as np import pandas as pd +import flowsa from flowsa.flowbyfunctions import assign_fips_location_system, \ load_fba_w_standardized_units from flowsa.dataclean import replace_NoneType_with_empty_cells @@ -640,55 +641,55 @@ def ghg_parse(*, df_list, year, config, **_): def get_manufacturing_energy_ratios(year): - """Calculate energy ratio by fuel between GHGI and EIA MECS.""" - # flow correspondence between GHGI and MECS - flow_corr = {'Industrial Other Coal': 'Coal', - 'Natural Gas': 'Natural Gas', - } - - def closest_value(input_list, input_value): - difference = lambda input_list : abs(input_list - input_value) - return min(input_list, key=difference) - - mecs_year = closest_value(load_yaml_dict('EIA_MECS_Energy', - flowbytype='FBA').get('years'), - year) - - # Filter MECS for total national energy consumption for manufacturing sectors - mecs = load_fba_w_standardized_units(datasource='EIA_MECS_Energy', - year=mecs_year, - flowclass='Energy') - mecs = (mecs.loc[(mecs['ActivityConsumedBy'] == '31-33') & - (mecs['Location'] == '00000') & - (mecs['Description'].isin(['Table 3.2', 'Table 2.2']))] - .reset_index(drop=True)) - mecs = EIA_MECS.mecs_energy_fba_cleanup(mecs, None) - - # Identify the GHGI table that matches EIA_MECS - for t, v in (load_yaml_dict('EPA_GHGI', 'FBA') - .get('Annex').get('Annex').items()): + """Calculate energy ratio by fuel between EIA MECS and GHGI.""" + flows = [('Industrial Other Coal', 'Coal'), ('Natural Gas', 'Natural Gas')] + # ^^^ (GHGI flow name, MECS flow name) + + mecs_config = load_yaml_dict('EIA_MECS_Energy', flowbytype='FBA') + ghgi_config = load_yaml_dict('EPA_GHGI', flowbytype='FBA') + + mecs_year = min(mecs_config.get('years'), key=lambda x: abs(x - year)) + + mecs = ( + flowsa.getFlowByActivity('EIA_MECS_Energy', mecs_year) + .select_by_fields({ + 'Class': 'Energy', + 'ActivityConsumedBy': '31-33', + 'Location': '00000', + # 'Description': ['Table 3.2', 'Table 2.2'], + 'Unit': 'Trillion Btu' + }) + .standardize_units(year=mecs_year) + ) + + # Identify the corresponding GHGI table + for t, v in ghgi_config['Annex']['Annex'].items(): if ((v.get('class') == 'Energy') - & ('Energy Consumption Data' in v.get('desc')) - & (v.get('year') == str(mecs_year))): - table = f"EPA_GHGI_T_{t.replace('-', '_')}" - break + & ('Energy Consumption Data' in v.get('desc')) + & (v.get('year') == str(mecs_year))): + ghgi_table = f"EPA_GHGI_T_{t.replace('-', '_')}" + break else: log.error('unable to identify corresponding GHGI table') - ghgi = load_fba_w_standardized_units(datasource=table, - year=mecs_year, - flowclass='Energy') - ghgi = ghgi[ghgi['ActivityConsumedBy']=='Industrial'].reset_index(drop=True) + ghgi = ( + flowsa.getFlowByActivity(ghgi_table, mecs_year) + .select_by_fields({ + 'Class': 'Energy', + 'ActivityConsumedBy': 'Industrial' + }) + ) + + log.critical(f'MECS length: {len(mecs)}\nMECS columns: {mecs.columns}') + + ratio_dict = {} + for ghgi_flow, mecs_flow in flows: + mecs_energy = mecs.query(f'FlowName == @mecs_flow').FlowAmount.values[0] + ghgi_energy = ghgi.query(f'FlowName == @ghgi_flow').FlowAmount.values[0] - pct_dict = {} - for ghgi_flow, mecs_flow in flow_corr.items(): - # Calculate percent energy contribution from MECS based on v - mecs_energy = mecs.loc[mecs['FlowName'] == mecs_flow, 'FlowAmount'].values[0] - ghgi_energy = ghgi.loc[ghgi['FlowName'] == ghgi_flow, 'FlowAmount'].values[0] - pct = np.minimum(mecs_energy / ghgi_energy, 1) - pct_dict[mecs_flow] = pct + ratio_dict[mecs_flow] = min(mecs_energy / ghgi_energy, 1) - return pct_dict + return ratio_dict def allocate_industrial_combustion(fba, *_, **__): From 0c45cb68a242172c3092b640bc80967e68651f41 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 23 Nov 2022 11:20:37 -0500 Subject: [PATCH 0309/1127] Added method_config to generated FBS to enable display_tables(), etc. Also some minor styling. --- flowsa/flowby.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index eea258bec..488dcf28e 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -981,7 +981,9 @@ def convert_to_geoscale( return fba_at_target_geoscale - def load_prepare_attribution_source(self: 'FlowByActivity') -> 'FlowBySector': + def load_prepare_attribution_source( + self: 'FlowByActivity' + ) -> 'FlowBySector': attribution_source = self.config['attribution_source'] if isinstance(attribution_source, str): @@ -1399,8 +1401,10 @@ def proportionally_attribute( .reset_index(drop=True) ) - def multiplication_attribution(self: 'FlowByActivity', - other: 'FlowBySector' ) -> 'FlowByActivity': + def multiplication_attribution( + self: 'FlowByActivity', + other: 'FlowBySector' + ) -> 'FlowByActivity': """ This method takes flows from the calling FBA which are mapped to multiple sectors and multiplies them by flows from other (an FBS). @@ -1462,10 +1466,10 @@ def multiplication_attribution(self: 'FlowByActivity', return ( fba - .drop(columns=['PrimarySector', 'SecondarySector', - 'temp_location'], - errors='ignore') - .reset_index(drop=True) + .drop(columns=['PrimarySector', 'SecondarySector', + 'temp_location'], + errors='ignore') + .reset_index(drop=True) ) # def flagged_proportionally_attribute(self: 'FlowByActivity'): @@ -1777,6 +1781,7 @@ def generateFlowBySector( ]) fbs.full_name = method + fbs.config = method_config fbs.to_parquet(f'{settings.fbsoutputpath}{method}.parquet') # TODO: Needs refinement + saving metadata From 095d180f78ab73689ee9e1d2769a011f8a6ad89b Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 25 Nov 2022 10:28:47 -0500 Subject: [PATCH 0310/1127] update convert_daily_to_annual to convert for '/day' as well as '/day' --- flowsa/flowby.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 488dcf28e..5dd6c1834 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -258,14 +258,17 @@ def _getFlowBy( return fb def convert_daily_to_annual(self: FB) -> FB: - if any(self.Unit.str.contains('/d')): + daily_list = ['/d', '/day'] + if any(self.Unit.str.endswith(tuple(daily_list))): log.info('Converting daily flows %s to annual', - [unit for unit in self.Unit.unique() if '/d' in unit]) + [unit for unit in self.Unit.unique() if any( + x in unit for x in daily_list)]) return ( self .assign(FlowAmount=self.FlowAmount.mask( - self.Unit.str.contains('/d'), self.FlowAmount * 365), - Unit=self.Unit.str.replace('/d', '')) + self.Unit.str.endswith(tuple(daily_list)), + self.FlowAmount * 365), + Unit=self.Unit.apply(lambda x: x.split('/d', 1)[0])) ) def standardize_units(self: FB, year: int = None) -> FB: From a9f3084d779f21752fd88f4679d63d5ca9593ce6 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 25 Nov 2022 10:29:35 -0500 Subject: [PATCH 0311/1127] if attribution method is multiplication, skip validation check because new values will not sum to old df values --- flowsa/flowby.py | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 5dd6c1834..2d0edb5ee 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1067,19 +1067,22 @@ def attribute_flows_to_sectors( attributed_fba = fba.equally_attribute() - validation_fba = attributed_fba.assign( - validation_total=(attributed_fba.groupby('group_id') - ['FlowAmount'].transform('sum')) - ) - if not np.allclose(validation_fba.group_total, - validation_fba.validation_total, equal_nan=True): - errors = (validation_fba - .query('validation_total != group_total') - [['group_id', 'ActivityProducedBy', 'ActivityConsumedBy', - 'SectorProducedBy', 'SectorConsumedBy', - 'FlowAmount', 'group_total', 'validation_total']]) - log.error('Errors in attributing flows from %s:\n%s', - self.full_name, errors) + # if the attribution method is not multiplication, check that new df + # values equal original df values + if attribution_method != 'multiplication': + validation_fba = attributed_fba.assign( + validation_total=(attributed_fba.groupby('group_id') + ['FlowAmount'].transform('sum')) + ) + if not np.allclose(validation_fba.group_total, + validation_fba.validation_total, equal_nan=True): + errors = (validation_fba + .query('validation_total != group_total') + [['group_id', 'ActivityProducedBy', 'ActivityConsumedBy', + 'SectorProducedBy', 'SectorConsumedBy', + 'FlowAmount', 'group_total', 'validation_total']]) + log.error('Errors in attributing flows from %s:\n%s', + self.full_name, errors) return attributed_fba.drop(columns=['group_id', 'group_total']) From dca570f9cf1d0aaa2db2edb6b6e2e820ac2e0fd5 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 25 Nov 2022 10:30:33 -0500 Subject: [PATCH 0312/1127] update the multiply attribution column to oly use primary sector columns --- flowsa/flowby.py | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 2d0edb5ee..8507291ca 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1415,7 +1415,6 @@ def multiplication_attribution( This method takes flows from the calling FBA which are mapped to multiple sectors and multiplies them by flows from other (an FBS). """ - # todo: function not working correctly fba_geoscale = geo.scale.from_string(self.config['geoscale']) other_geoscale = geo.scale.from_string(other.config['geoscale']) @@ -1447,28 +1446,25 @@ def multiplication_attribution( .reset_index() ) - groupby_cols = ['group_id'] - for rank in ['Primary', 'Secondary']: - merged = (fba - .merge(other, - how='left', - left_on=[f'{rank}Sector', - 'temp_location' - if 'temp_location' in fba - else 'Location'], - right_on=['PrimarySector', 'Location'], - suffixes=[None, '_other']) - .fillna({'FlowAmount_other': 0}) - ) - - fba = (merged - .assign(FlowAmount=lambda x: (x.FlowAmount - * x.FlowAmount_other)) - .drop(columns=['PrimarySector_other', 'Location_other', - 'FlowAmount_other', 'denominator'], - errors='ignore') - ) - groupby_cols.append(f'{rank}Sector') + # multiply using each dfs primary sector col + merged = (fba + .merge(other, + how='left', + left_on=['PrimarySector', 'temp_location' + if 'temp_location' in fba + else 'Location'], + right_on=['PrimarySector', 'Location'], + suffixes=[None, '_other']) + .fillna({'FlowAmount_other': 0}) + ) + + fba = (merged + .assign(FlowAmount=lambda x: (x.FlowAmount + * x.FlowAmount_other)) + .drop(columns=['PrimarySector_other', 'Location_other', + 'FlowAmount_other', 'denominator'], + errors='ignore') + ) return ( fba From 59105188d10600d8d75e2c2a728cfff442e88c02 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 25 Nov 2022 10:31:45 -0500 Subject: [PATCH 0313/1127] update unit_conversion.csv to account for '/day' already converted to annual before conversion to standardized units --- flowsa/data/unit_conversion.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/data/unit_conversion.csv b/flowsa/data/unit_conversion.csv index 388181354..66f71a20f 100644 --- a/flowsa/data/unit_conversion.csv +++ b/flowsa/data/unit_conversion.csv @@ -4,7 +4,7 @@ Acres,m2,4046.856422 million sq ft,m2,92903 million square feet,m2,92903 square feet,m2,0.092903 -gallons/animal/day,kg,1383.35 +gallons/animal,kg/animal,3.79 Mgal,kg,3790000 Bgal,kg,3790000000 gal,kg,3.79 From dfadf464239b69d9d63ab58ebe32d825de4c76ea Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 28 Nov 2022 13:25:29 -0500 Subject: [PATCH 0314/1127] for coa cropland - use new recursive equal allocation function --- flowsa/data_source_scripts/USDA_CoA_Cropland.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/flowsa/data_source_scripts/USDA_CoA_Cropland.py b/flowsa/data_source_scripts/USDA_CoA_Cropland.py index 521438e2f..1133d6b72 100644 --- a/flowsa/data_source_scripts/USDA_CoA_Cropland.py +++ b/flowsa/data_source_scripts/USDA_CoA_Cropland.py @@ -292,7 +292,8 @@ def disaggregate_coa_cropland_to_6_digit_naics( ~fba_w_sector[sector_col].isna()].reset_index(drop=True) # modify the flowamounts related to the 6 naics 'orchards' are mapped to - fba_w_sector = equal_allocation(fba_w_sector) + fba_w_sector = fba_w_sector.equally_attribute() + # fba_w_sector = equal_allocation(fba_w_sector) # use ratios of usda 'land in farms' to determine animal use of # pasturelands at 6 digit naics @@ -333,7 +334,8 @@ def disaggregate_coa_cropland_to_6_digit_naics_for_water_withdrawal( .reset_index(drop=True) # modify the flowamounts related to the 6 naics 'orchards' are mapped to - fba_w_sector = equal_allocation(fba_w_sector) + # fba_w_sector = equal_allocation(fba_w_sector) + fba_w_sector = fba_w_sector.equally_attribute() # todo: add back in once suppression fxn modified to accept non-naics # like activities and mixed level final naics (naics6 and naics7) @@ -419,7 +421,7 @@ def disaggregate_pastureland(fba_w_sector, attr, method, year, df_f = df_f[~df_f['ActivityConsumedBy'].isin(drop_list)] # create sector columns df_f = add_sectors_to_flowbyactivity( - df_f, sectorsourcename=method['target_sector_source']) + df_f, sectorsourcename=f"NAICS_{str(method['target_naics_year'])}_Code") # estimate suppressed data by equal allocation df_f = equally_allocate_suppressed_parent_to_child_naics( df_f, method, 'SectorConsumedBy', fba_wsec_default_grouping_fields) @@ -501,7 +503,8 @@ def disaggregate_cropland(fba_w_sector, attr, method, year, '&')].reset_index(drop=True) # add sectors naics = add_sectors_to_flowbyactivity( - naics, sectorsourcename=method['target_sector_source']) + naics, sectorsourcename=f"NAICS_" + f"{str(method['target_naics_year'])}_Code") # estimate suppressed data by equally allocating parent to child naics naics = equally_allocate_suppressed_parent_to_child_naics( naics, method, 'SectorConsumedBy', fba_wsec_default_grouping_fields) @@ -570,7 +573,8 @@ def disaggregate_cropland(fba_w_sector, attr, method, year, crop = crop.drop(columns=['Location_tmp']) # equally allocate any further missing naics - crop = equally_allocate_parent_to_child_naics(crop, method) + # crop = equally_allocate_parent_to_child_naics(crop, method) + crop = crop.equally_attribute() # pasture data pasture = \ From 7b5bdb542eaeb8d4731218a61d504759c9c8a000 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 29 Nov 2022 10:58:36 -0500 Subject: [PATCH 0315/1127] Uncached BTS_TSA --- .../flowbysectormethods/SEEA_2017_v2.yaml | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml index 5ed04f5d6..60c6cd202 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml @@ -1,10 +1,6 @@ %YAML 1.1 --- -# m2 for the GHG national replicates the method used in the National GHG Industry Attribution Model -#(https://doi.org/10.23719/1517571), except that sector attribution is to 6-digit NAICS, -# rather than the BEA 2012 IO schema - # !include:BEA_summary_target.yaml industry_spec: default: NAICS_3 @@ -219,14 +215,7 @@ _attribution_sources: - AREA IN PRODUCTION # Vegetable totals year: 2017 clean_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics - -sources_to_cache: - BLS_QCEW: - selection_fields: - Class: Employment - year: 2012 - clean_fba: !script_function:temp_data_source_functions clean_qcew - BTS_TSA: + BTS_TSA: &bts_tsa year: 2017 selection_fields: Description: @@ -236,6 +225,13 @@ sources_to_cache: attribution_method: proportional attribution_source: BLS_QCEW +sources_to_cache: + BLS_QCEW: + selection_fields: + Class: Employment + year: 2012 + clean_fba: !script_function:temp_data_source_functions clean_qcew + source_names: # stewiFBS: # data_format: FBS_outside_flowsa @@ -545,7 +541,8 @@ source_names: - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road activity_to_sector_mapping: EPA_GHGI_SEEA attribution_method: proportional - attribution_source: BTS_TSA + attribution_source: + BTS_TSA: *bts_tsa construction_and_mining: selection_fields: @@ -733,7 +730,8 @@ source_names: - Medium- and Heavy-Duty Trucks activity_to_sector_mapping: EPA_GHGI_SEEA attribution_method: proportional - attribution_source: BTS_TSA + attribution_source: + BTS_TSA: *bts_tsa buses: selection_fields: FlowName: Distillate Fuel Oil (Diesel Fuel) @@ -773,7 +771,8 @@ source_names: - Medium- and Heavy-Duty Trucks activity_to_sector_mapping: EPA_GHGI_SEEA attribution_method: proportional - attribution_source: BTS_TSA + attribution_source: + BTS_TSA: *bts_tsa buses: selection_fields: FlowName: Motor Gasoline @@ -955,7 +954,8 @@ source_names: adjustment_factor: 0.99 activity_to_sector_mapping: EPA_GHGI_SEEA attribution_method: proportional - attribution_source: BTS_TSA + attribution_source: + BTS_TSA: *bts_tsa refrigerated_trucks: selection_fields: PrimaryActivity: Medium- and Heavy-Duty Trucks From 2123729893a1f876d48aef469f3d70e9841a422f Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 29 Nov 2022 11:34:28 -0500 Subject: [PATCH 0316/1127] moved type fix in convert_to_geoscale() to fix bug --- flowsa/flowby.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 488dcf28e..3a4d71cc5 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -913,10 +913,7 @@ def convert_to_geoscale( .reset_index() .rename(columns={ 'geoscale': f'highest_reporting_level_by_{scale.name.title()}' - }) - .astype({activity: flowby_config['fba_fields'][activity] - for activity in ['ActivityProducedBy', - 'ActivityConsumedBy']})) + })) for scale in geo.scale if scale.has_fips_level and scale <= target_geoscale ] @@ -960,6 +957,9 @@ def convert_to_geoscale( .drop(columns='source_geoscale') .convert_fips_to_geoscale(target_geoscale) .aggregate_flowby() + .astype({activity: flowby_config['fba_fields'][activity] + for activity in ['ActivityProducedBy', + 'ActivityConsumedBy']}) ) if target_geoscale != geo.scale.NATIONAL: From 570a7346478dea4e65193e7a80d87c93c9886387 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 30 Nov 2022 09:54:49 -0500 Subject: [PATCH 0317/1127] Fix typo and formatting --- flowsa/flowby.py | 6 ++++-- flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 06029dc66..917dbe64f 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1075,10 +1075,12 @@ def attribute_flows_to_sectors( ['FlowAmount'].transform('sum')) ) if not np.allclose(validation_fba.group_total, - validation_fba.validation_total, equal_nan=True): + validation_fba.validation_total, + equal_nan=True): errors = (validation_fba .query('validation_total != group_total') - [['group_id', 'ActivityProducedBy', 'ActivityConsumedBy', + [['group_id', + 'ActivityProducedBy', 'ActivityConsumedBy', 'SectorProducedBy', 'SectorConsumedBy', 'FlowAmount', 'group_total', 'validation_total']]) log.error('Errors in attributing flows from %s:\n%s', diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml index 60c6cd202..1282a35d9 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml @@ -521,7 +521,7 @@ source_names: pasture: <<: *pasture -## Mobile Sources (N20 and CH4) +## Mobile Sources (N2O and CH4) EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion activity_sets: direct_attribution: # Some of these need to be separated and attributed differently From f581652f0b94da05ea2d39186d0a53be78d8e418 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 1 Dec 2022 13:46:53 -0500 Subject: [PATCH 0318/1127] add usda_iwms class --- flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index 7ebd638f8..afa198d07 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -55,6 +55,8 @@ source_names: USDA_IWMS: year: 2018 geoscale: state + selection_fields: + Class: Water clean_fba_wsec: !script_function:USDA_IWMS iwms_aggregation livestock_attribution: selection_fields: From c9e5cf3b5377a611015952696772ca16bc768ed7 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 1 Dec 2022 13:47:15 -0500 Subject: [PATCH 0319/1127] add eap_nei_nonroad data_format --- flowsa/data/source_catalog.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 8b0d10a50..879235dfe 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -197,6 +197,7 @@ EPA_NEI_Nonpoint: fedefl_mapping: NEI # sector_aggregation_level: "aggregated" EPA_NEI_Nonroad: + data_format: FBA class: - Chemicals sector-like_activities: False From 4bec98b498288eda3a61310f22d41b2db9dc258d Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 28 Dec 2022 13:10:15 -0500 Subject: [PATCH 0320/1127] in convert_to_geoscale() convert cols back to object if auto converted to float --- flowsa/flowby.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 06029dc66..ff3d5433d 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -921,6 +921,15 @@ def convert_to_geoscale( if scale.has_fips_level and scale <= target_geoscale ] + # if an activity column is a mix of string and np.nan values but + # after subsetting, the column is all np.nan, then the column dtype is + # converted to float which causes an error when merging float col back + # with the original object dtype. So convert float cols back to object + for df in highest_reporting_level_by_geoscale: + for c in ['ActivityProducedBy', 'ActivityConsumedBy']: + if df[c].dtype == np.float: + df[c] = df[c].astype(object) + fba_with_reporting_levels = reduce( lambda x, y: x.merge(y, how='left'), [self, geoscale_by_fips, *highest_reporting_level_by_geoscale] From 7c401ac5ccdf7e3b18d8e4a936e48f2f646b09ac Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 28 Dec 2022 13:10:41 -0500 Subject: [PATCH 0321/1127] use national data for employment --- flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index afa198d07..6c4934d51 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -23,6 +23,7 @@ source_names: - "Domestic" attribution_method: direct employment_attribution: + geoscale: national selection_fields: PrimaryActivity: - "Industrial" From 2dc484f19df4c2c80e2d26640733272730d7d131 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 28 Dec 2022 13:23:43 -0500 Subject: [PATCH 0322/1127] drop depreciated np.float for float --- flowsa/flowby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index ff3d5433d..a595a8829 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -927,7 +927,7 @@ def convert_to_geoscale( # with the original object dtype. So convert float cols back to object for df in highest_reporting_level_by_geoscale: for c in ['ActivityProducedBy', 'ActivityConsumedBy']: - if df[c].dtype == np.float: + if df[c].dtype == float: df[c] = df[c].astype(object) fba_with_reporting_levels = reduce( From f42666ce4f6974ec868f19a32956a762b5e51ac2 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 28 Dec 2022 15:41:31 -0500 Subject: [PATCH 0323/1127] drop duplicative call for geoscale --- flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index 6c4934d51..9a4f82968 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -41,7 +41,6 @@ source_names: attribution_source: USDA_CoA_Cropland: year: 2017 - geoscale: state selection_fields: Class: "Land" FlowName: @@ -55,7 +54,6 @@ source_names: attribution_source: USDA_IWMS: year: 2018 - geoscale: state selection_fields: Class: Water clean_fba_wsec: !script_function:USDA_IWMS iwms_aggregation @@ -67,7 +65,6 @@ source_names: attribution_source: USDA_CoA_Livestock: year: 2017 - geoscale: state selection_fields: Class: Other FlowName: From 70d41251e7f1936eacb3ab8c288bbf3d5edf4bd4 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 28 Dec 2022 15:43:00 -0500 Subject: [PATCH 0324/1127] in fbs generation aggregate to target geoscale --- flowsa/flowby.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index a595a8829..f46f88e88 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1794,6 +1794,14 @@ def generateFlowBySector( fbs.full_name = method fbs.config = method_config + # aggregate to target sector + fbs = ( + fbs + .convert_fips_to_geoscale( + geo.scale.from_string(fbs.config.get('geoscale'))) + .aggregate_flowby() + ) + fbs.to_parquet(f'{settings.fbsoutputpath}{method}.parquet') # TODO: Needs refinement + saving metadata From 74799a795701a503b5e1c9d81b2bbf41d20dd729 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 29 Dec 2022 12:58:27 -0500 Subject: [PATCH 0325/1127] ad indsutry_spec for naics 6/7 for cropland and livestock activities --- .../Water_national_2015_m1.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index 9a4f82968..3c064ba02 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -34,6 +34,16 @@ source_names: data_format: FBS year: 2015 cropland_attribution: + industry_spec: + default: NAICS_6 + '111120': { default: NAICS_7 } + '111130': { default: NAICS_7 } + '111150': { default: NAICS_7 } + '111199': { default: NAICS_7 } + '111421': { default: NAICS_7 } + '111930': { default: NAICS_7 } + '111991': { default: NAICS_7 } + '111998': { default: NAICS_7 } selection_fields: PrimaryActivity: - "Irrigation Crop" @@ -58,6 +68,15 @@ source_names: Class: Water clean_fba_wsec: !script_function:USDA_IWMS iwms_aggregation livestock_attribution: + industry_spec: + default: NAICS_6 + '112130': { default: NAICS_7 } + '112320': { default: NAICS_7 } + '112390': { default: NAICS_7 } + '112910': { default: NAICS_7 } + '112920': { default: NAICS_7 } + '112930': { default: NAICS_7 } + '112990': { default: NAICS_7 } selection_fields: PrimaryActivity: - "Livestock" From 0271c763395bf8f6d2f10d53b5ddfc0df4d4a6c2 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 29 Dec 2022 13:00:01 -0500 Subject: [PATCH 0326/1127] new sector_aggregation() function in flowby.py to aggregate sector levels identified in activity sets to overall FBS target sector level --- flowsa/flowby.py | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index f46f88e88..2d73487b2 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1794,19 +1794,45 @@ def generateFlowBySector( fbs.full_name = method fbs.config = method_config - # aggregate to target sector + # aggregate to target geoscale fbs = ( fbs .convert_fips_to_geoscale( geo.scale.from_string(fbs.config.get('geoscale'))) .aggregate_flowby() ) + # aggregate to target sector + fbs = fbs.sector_aggregation() fbs.to_parquet(f'{settings.fbsoutputpath}{method}.parquet') # TODO: Needs refinement + saving metadata return fbs + def sector_aggregation(self): + """ + In the event activity sets in an FBS are at a less aggregated target + sector level than the overall target level, aggregate the sectors to + the FBS target scale + :return: + """ + + naics_key = naics.industry_spec_key(self.config['industry_spec']) + + fbs = self + for direction in ['ProducedBy', 'ConsumedBy']: + fbs = ( + fbs + .rename(columns={f'Sector{direction}': 'source_naics'}) + .merge(naics_key, + how='left') + .rename(columns={'target_naics': f'Sector{direction}'}) + .drop(columns='source_naics') + .aggregate_flowby() + ) + + return fbs + def prepare_fbs(self: 'FlowBySector') -> 'FlowBySector': return ( self From 0dbbb0c72672f5022efb1e4f04ebb0192811493b Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 29 Dec 2022 13:35:38 -0500 Subject: [PATCH 0327/1127] update so employment_attribution uses state data with attribution source employment uses national --- flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index 3c064ba02..b65005efb 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -23,7 +23,6 @@ source_names: - "Domestic" attribution_method: direct employment_attribution: - geoscale: national selection_fields: PrimaryActivity: - "Industrial" @@ -31,6 +30,7 @@ source_names: attribution_method: proportional attribution_source: Employment_national_2015: + geoscale: national data_format: FBS year: 2015 cropland_attribution: From ba3ba849a22ff05772d76501d60623788ede1dde Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 29 Dec 2022 13:36:12 -0500 Subject: [PATCH 0328/1127] add log statements when merging source with attribution data about status of geoscales --- flowsa/flowby.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 2d73487b2..bd246a6ef 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1316,12 +1316,17 @@ def proportionally_attribute( self.full_name, other.full_name) if other_geoscale < fba_geoscale: + log.info('Aggregating %s from %s to %s', other.full_name, + other_geoscale, fba_geoscale) other = ( other .convert_fips_to_geoscale(fba_geoscale) .aggregate_flowby() ) elif other_geoscale > fba_geoscale: + log.info('%s is %s, while %s is %s, so attributing %s to ' + '%s', other.full_name, other_geoscale, self.full_name, + fba_geoscale, other_geoscale, fba_geoscale) self = ( self .assign(temp_location=self.Location) @@ -1432,12 +1437,17 @@ def multiplication_attribution( self.full_name, other.full_name) if other_geoscale < fba_geoscale: + log.info('Aggregating %s from %s to %s', other.full_name, + other_geoscale, fba_geoscale) other = ( other .convert_fips_to_geoscale(fba_geoscale) .aggregate_flowby() ) elif other_geoscale > fba_geoscale: + log.info('%s is %s, while %s is %s, so attributing %s to ' + '%s', other.full_name, other_geoscale, self.full_name, + fba_geoscale, other_geoscale, fba_geoscale) self = ( self .assign(temp_location=self.Location) From 9af79e5a4fda2e6ee0621c81bf4456faaf8cfa5d Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 29 Dec 2022 14:33:08 -0500 Subject: [PATCH 0329/1127] update industry specs --- .../Water_national_2015_m1.yaml | 45 +++++++++++-------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index b65005efb..3681a198f 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -34,22 +34,22 @@ source_names: data_format: FBS year: 2015 cropland_attribution: - industry_spec: - default: NAICS_6 - '111120': { default: NAICS_7 } - '111130': { default: NAICS_7 } - '111150': { default: NAICS_7 } - '111199': { default: NAICS_7 } - '111421': { default: NAICS_7 } - '111930': { default: NAICS_7 } - '111991': { default: NAICS_7 } - '111998': { default: NAICS_7 } selection_fields: PrimaryActivity: - "Irrigation Crop" attribution_method: proportional attribution_source: USDA_CoA_Cropland: + industry_spec: + default: NAICS_6 + '111120': { default: NAICS_7 } + '111130': { default: NAICS_7 } + '111150': { default: NAICS_7 } + '111199': { default: NAICS_7 } + '111421': { default: NAICS_7 } + '111930': { default: NAICS_7 } + '111991': { default: NAICS_7 } + '111998': { default: NAICS_7 } year: 2017 selection_fields: Class: "Land" @@ -63,26 +63,31 @@ source_names: attribution_method: multiplication attribution_source: USDA_IWMS: + industry_spec: + default: NAICS_6 + '111150': { default: NAICS_7 } + '111199': { default: NAICS_7 } + '111940': { default: NAICS_7 } year: 2018 selection_fields: Class: Water clean_fba_wsec: !script_function:USDA_IWMS iwms_aggregation livestock_attribution: - industry_spec: - default: NAICS_6 - '112130': { default: NAICS_7 } - '112320': { default: NAICS_7 } - '112390': { default: NAICS_7 } - '112910': { default: NAICS_7 } - '112920': { default: NAICS_7 } - '112930': { default: NAICS_7 } - '112990': { default: NAICS_7 } selection_fields: PrimaryActivity: - "Livestock" attribution_method: proportional attribution_source: USDA_CoA_Livestock: + industry_spec: + default: NAICS_6 + '112130': { default: NAICS_7 } + '112320': { default: NAICS_7 } + '112390': { default: NAICS_7 } + '112910': { default: NAICS_7 } + '112920': { default: NAICS_7 } + '112930': { default: NAICS_7 } + '112990': { default: NAICS_7 } year: 2017 selection_fields: Class: Other @@ -95,5 +100,7 @@ source_names: attribution_method: multiplication attribution_source: USGS_WU_Coef: + industry_spec: + default: NAICS_6 year: 2005 geoscale: national From c24f899433db8d66498612ad4897ffa715bfebdf Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 30 Dec 2022 12:55:53 -0500 Subject: [PATCH 0330/1127] correct conversion from employees to p --- flowsa/data/unit_conversion.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/data/unit_conversion.csv b/flowsa/data/unit_conversion.csv index 66f71a20f..c332251e1 100644 --- a/flowsa/data/unit_conversion.csv +++ b/flowsa/data/unit_conversion.csv @@ -19,4 +19,4 @@ Quadrillion Btu,MJ,1.05506E+12 Trillion Btu,MJ,1055055900 Tbtu,MJ,1055055900 MT CO2e,MMT CO2e,0.000001 -p,employees,1 +employees,p,1 From 033359dbabb700019be3a31d231c69f998d09969 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 30 Dec 2022 12:56:48 -0500 Subject: [PATCH 0331/1127] for clean_qcew_for_fbs() do not want to include clean_qcew() because it converts 5 digit NAICS to 6 digits by adding a 0. no longer need to do this because we are first running fxn to estimate suppressed data --- .../temp_data_source_functions.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index 716357e24..5545b6b97 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -62,17 +62,8 @@ def clean_qcew_for_fbs(fba: FlowByActivity, **kwargs): dictionary of FBA method yaml parameters :return: df, BLS QCEW FBA with estimated suppressed data """ - df = clean_qcew(fba, **kwargs) - - # for purposes of allocation, we do not need to differentiate between - # federal government, state government, local government, or private - # sectors. So after estimating the suppressed data (above), modify the - # flow names and aggregate data - df['Flowable'] = (df['Flowable'].str.split(',').str[0] - .str.replace('Number of employees', 'Jobs')) - df2 = df.aggregate_flowby() - - return df2 + fba['Flowable'] = 'Jobs' + return fba def estimate_suppressed_qcew(fba: FlowByActivity) -> FlowByActivity: From 73c6d1982a45afdeeff176a848776df6564af4bb Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 30 Dec 2022 12:57:51 -0500 Subject: [PATCH 0332/1127] simplify employment_common yaml --- .../Employment_common.yaml | 22 +++++-------------- .../Employment_national_2012.yaml | 2 +- .../Employment_national_2014.yaml | 2 +- .../Employment_national_2015.yaml | 2 +- .../Employment_national_2017.yaml | 2 +- .../Employment_national_2018.yaml | 2 +- .../Employment_state_2012.yaml | 2 +- .../Employment_state_2013.yaml | 2 +- .../Employment_state_2014.yaml | 2 +- .../Employment_state_2015.yaml | 2 +- .../Employment_state_2016.yaml | 2 +- .../Employment_state_2017.yaml | 2 +- .../Employment_state_2018.yaml | 2 +- .../Employment_state_2019.yaml | 2 +- .../Employment_state_2020.yaml | 2 +- 15 files changed, 20 insertions(+), 30 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Employment_common.yaml b/flowsa/methods/flowbysectormethods/Employment_common.yaml index 20054d98d..fa55ed8f0 100644 --- a/flowsa/methods/flowbysectormethods/Employment_common.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_common.yaml @@ -1,36 +1,26 @@ _bls_selection_fields_national: &bls_selection_fields_national selection_fields: Class: Employment - Location: '00000' + Location: !include:Location_common.yaml:_national_location _bls_selection_fields_state: &bls_selection_fields_state selection_fields: Class: Employment -# Location: + Location: !include:Location_common.yaml:_state_location _bls_load_and_clean: &bls_load_and_clean clean_fba_before_mapping: !script_function:temp_data_source_functions estimate_suppressed_qcew clean_fba: !script_function:temp_data_source_functions clean_qcew_for_fbs -_bls_allocation: &bls_allocation - selection_fields: - PrimaryActivity: !from_index:BLS_QCEW_asets.csv qcew - attribution_method: direct - bls_load_and_clean_national: <<: *bls_selection_fields_national <<: *bls_load_and_clean - geoscale: &geoscaleNational national - -bls_allocation_national: - <<: *bls_allocation - geoscale: *geoscaleNational bls_load_and_clean_state: <<: *bls_selection_fields_state <<: *bls_load_and_clean - geoscale: &geoscaleState state -bls_allocation_state: - <<: *bls_allocation - geoscale: *geoscaleState +bls_allocation: + selection_fields: + PrimaryActivity: !from_index:BLS_QCEW_asets.csv qcew + attribution_method: direct diff --git a/flowsa/methods/flowbysectormethods/Employment_national_2012.yaml b/flowsa/methods/flowbysectormethods/Employment_national_2012.yaml index 96d0ba8d5..5db33a700 100644 --- a/flowsa/methods/flowbysectormethods/Employment_national_2012.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_national_2012.yaml @@ -7,4 +7,4 @@ source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_national year: 2012 activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation_national \ No newline at end of file + qcew: !include:Employment_common.yaml:bls_allocation \ No newline at end of file diff --git a/flowsa/methods/flowbysectormethods/Employment_national_2014.yaml b/flowsa/methods/flowbysectormethods/Employment_national_2014.yaml index e6df649fc..2e99e0e88 100644 --- a/flowsa/methods/flowbysectormethods/Employment_national_2014.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_national_2014.yaml @@ -7,4 +7,4 @@ source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_national year: 2014 activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation_national \ No newline at end of file + qcew: !include:Employment_common.yaml:bls_allocation \ No newline at end of file diff --git a/flowsa/methods/flowbysectormethods/Employment_national_2015.yaml b/flowsa/methods/flowbysectormethods/Employment_national_2015.yaml index 7d0ef05b4..80691764b 100644 --- a/flowsa/methods/flowbysectormethods/Employment_national_2015.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_national_2015.yaml @@ -7,4 +7,4 @@ source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_national year: 2015 activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation_national \ No newline at end of file + qcew: !include:Employment_common.yaml:bls_allocation \ No newline at end of file diff --git a/flowsa/methods/flowbysectormethods/Employment_national_2017.yaml b/flowsa/methods/flowbysectormethods/Employment_national_2017.yaml index 0a83ff1c3..d0782639b 100644 --- a/flowsa/methods/flowbysectormethods/Employment_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_national_2017.yaml @@ -7,5 +7,5 @@ source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_national year: 2017 activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation_national + qcew: !include:Employment_common.yaml:bls_allocation \ No newline at end of file diff --git a/flowsa/methods/flowbysectormethods/Employment_national_2018.yaml b/flowsa/methods/flowbysectormethods/Employment_national_2018.yaml index b856f9222..c9e1e26db 100644 --- a/flowsa/methods/flowbysectormethods/Employment_national_2018.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_national_2018.yaml @@ -7,4 +7,4 @@ source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_national year: 2018 activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation_national + qcew: !include:Employment_common.yaml:bls_allocation diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2012.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2012.yaml index 952b41138..a7d9ec79f 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2012.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2012.yaml @@ -7,4 +7,4 @@ source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state year: 2012 activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation_state + qcew: !include:Employment_common.yaml:bls_allocation diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2013.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2013.yaml index 05bfd4906..1b01a69e9 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2013.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2013.yaml @@ -7,4 +7,4 @@ source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state year: 2013 activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation_state + qcew: !include:Employment_common.yaml:bls_allocation diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2014.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2014.yaml index a68cb1be7..720c725b1 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2014.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2014.yaml @@ -7,4 +7,4 @@ source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state year: 2014 activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation_state + qcew: !include:Employment_common.yaml:bls_allocation diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2015.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2015.yaml index 1cc57eab3..7f29be2ab 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2015.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2015.yaml @@ -7,4 +7,4 @@ source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state year: 2015 activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation_state + qcew: !include:Employment_common.yaml:bls_allocation diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2016.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2016.yaml index 4d24dd3ad..2a2c34b6a 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2016.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2016.yaml @@ -7,4 +7,4 @@ source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state year: 2016 activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation_state + qcew: !include:Employment_common.yaml:bls_allocation diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2017.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2017.yaml index d4d540816..62fc70c15 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2017.yaml @@ -7,4 +7,4 @@ source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state year: 2017 activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation_state + qcew: !include:Employment_common.yaml:bls_allocation diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2018.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2018.yaml index ff7dc8e6f..6b3a53e50 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2018.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2018.yaml @@ -7,4 +7,4 @@ source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state year: 2018 activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation_state + qcew: !include:Employment_common.yaml:bls_allocation diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2019.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2019.yaml index c62506b59..aa041a8c6 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2019.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2019.yaml @@ -7,4 +7,4 @@ source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state year: 2019 activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation_state + qcew: !include:Employment_common.yaml:bls_allocation diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2020.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2020.yaml index 1779709a7..284ba044d 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2020.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2020.yaml @@ -7,4 +7,4 @@ source_names: "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state year: 2020 activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation_state + qcew: !include:Employment_common.yaml:bls_allocation From ba5c91848d394a5af3eb75da2d9beb39e776aae6 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 30 Dec 2022 12:58:14 -0500 Subject: [PATCH 0333/1127] add list of state fips for use in selection_field --- .../methods/flowbysectormethods/Location_Common.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/Location_Common.yaml diff --git a/flowsa/methods/flowbysectormethods/Location_Common.yaml b/flowsa/methods/flowbysectormethods/Location_Common.yaml new file mode 100644 index 000000000..277c77c66 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/Location_Common.yaml @@ -0,0 +1,11 @@ +_national_location: "00000" + +_state_location: ["01000", "02000", "04000", "05000", "06000", '08000', + "09000", "10000", "11000", "12000", "13000", "15000", + "16000", "17000", "18000", "19000", "20000", "21000", + "22000", "23000", "24000", "25000", "26000", "27000", + "28000", "29000", "30000", "31000", '32000', "33000", + "34000", "35000", "36000", "37000", "38000", "39000", + "40000", "41000", "42000", "44000", "45000", "46000", + "47000", "48000", "49000", '50000', "51000", "53000", + "54000", "55000", "56000"] From 8133fae00120be25eca52fe7c1c4fde60dbd970e Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 30 Dec 2022 12:59:13 -0500 Subject: [PATCH 0334/1127] approach map_to_sectors() differently for aggregated vs disaggregated sector-like activities --- flowsa/flowby.py | 52 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index bd246a6ef..14add26f3 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1139,22 +1139,48 @@ def map_to_sectors( log.info('NAICS Activities in %s use NAICS year %s.', self.full_name, source_year) - log.info('Converting NAICS codes to desired industry/sector ' - 'aggregation structure.') - fba_w_naics = self.assign( - ActivitySourceName=self.source_name, - SectorType=np.nan - ) - for direction in ['ProducedBy', 'ConsumedBy']: + # todo: expand on this start. There will be cases where although data is disaggregated, + # there might not be all mappings (might stop at NAICS5 in df because NAICS6 is just NAICS5 with added 0) + if self.config['sector_aggregation_level'] == 'disaggregated': + log.info('NAICS are already disaggregated, assigning activity ' + 'columns directly to sector columns') + target_naics = set( + naics.industry_spec_key(self.config['industry_spec']) + .target_naics) + fba_w_naics = self + for direction in ['ProducedBy', 'ConsumedBy']: + fba_w_naics = ( + fba_w_naics + .assign(**{f'Sector{direction}': fba_w_naics[f'Activity{direction}'].mask( + (fba_w_naics[f'Activity{direction}']).isin(target_naics), + fba_w_naics[f'Activity{direction}'] + )})) fba_w_naics = ( fba_w_naics - .merge(naics_key, - how='left', - left_on=f'Activity{direction}', - right_on='source_naics') - .rename(columns={'target_naics': f'Sector{direction}'}) - .drop(columns='source_naics') + .assign(ActivitySourceName=fba_w_naics.source_name, + SectorType=np.nan) + .query('SectorProducedBy in @target_naics ' + '| SectorConsumedBy in @target_naics') ) + else: + # if sector-like activities are aggregated, then map all + # sectors to target sector level + log.info('Converting NAICS codes to desired industry/sector ' + 'aggregation structure.') + fba_w_naics = self.assign( + ActivitySourceName=self.source_name, + SectorType=np.nan + ) + for direction in ['ProducedBy', 'ConsumedBy']: + fba_w_naics = ( + fba_w_naics + .merge(naics_key, + how='left', + left_on=f'Activity{direction}', + right_on='source_naics') + .rename(columns={'target_naics': f'Sector{direction}'}) + .drop(columns='source_naics') + ) else: log.info('Getting crosswalk between activities in %s and ' From a007fc73fcebfeb5d446a4b41354a3bd02e88a50 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 30 Dec 2022 13:00:16 -0500 Subject: [PATCH 0335/1127] when loading source FBA, run select_by_fields() prior to running any cleaning fxn - allows to subset by location/class prior to any cleaning fxn, saving time --- flowsa/flowby.py | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 14add26f3..ffc4ef192 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1530,6 +1530,7 @@ def prepare_fbs(self: 'FlowByActivity') -> 'FlowBySector': fba.prepare_fbs() for fba in ( self + .select_by_fields() .function_socket('clean_fba_before_activity_sets') .activity_sets() ) From 6dbf7a0fc69c933abd9a170e0310e2b1bfd2b9b0 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 30 Dec 2022 13:58:29 -0500 Subject: [PATCH 0336/1127] rename --- .../{Location_Common.yaml => Location_common.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename flowsa/methods/flowbysectormethods/{Location_Common.yaml => Location_common.yaml} (100%) diff --git a/flowsa/methods/flowbysectormethods/Location_Common.yaml b/flowsa/methods/flowbysectormethods/Location_common.yaml similarity index 100% rename from flowsa/methods/flowbysectormethods/Location_Common.yaml rename to flowsa/methods/flowbysectormethods/Location_common.yaml From dbb016d5f214ba396bf3e4e9c6df77515af25ba4 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 30 Dec 2022 14:07:49 -0500 Subject: [PATCH 0337/1127] comment - clean_qcew results in double counting --- flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml | 2 +- .../methods/flowbysectormethods/marine_shipping_adjustment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml b/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml index 51aaedb62..bc9092412 100644 --- a/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml @@ -17,7 +17,7 @@ sources_to_cache: selection_fields: Class: Employment clean_fba_before_mapping: !script_function:temp_data_source_functions estimate_suppressed_qcew - clean_fba: !script_function:temp_data_source_functions clean_qcew + clean_fba: !script_function:temp_data_source_functions clean_qcew #todo: evaluate if necessary because already estimated suppressed data _attribution_sources: EIA_MECS_Energy: &mecs_energy diff --git a/flowsa/methods/flowbysectormethods/marine_shipping_adjustment.yaml b/flowsa/methods/flowbysectormethods/marine_shipping_adjustment.yaml index 0874a38cd..d904ad486 100644 --- a/flowsa/methods/flowbysectormethods/marine_shipping_adjustment.yaml +++ b/flowsa/methods/flowbysectormethods/marine_shipping_adjustment.yaml @@ -17,7 +17,7 @@ sources_to_cache: selection_fields: Class: Employment clean_fba_before_mapping: !script_function:temp_data_source_functions estimate_suppressed_qcew - clean_fba: !script_function:temp_data_source_functions clean_qcew + clean_fba: !script_function:temp_data_source_functions clean_qcew # todo: evaluate if necessary because already estimated suppressed data source_names: BEA_Marine_Bunker_Fuel: From 87f080208828a10225f56cf74a3c98acb7518c65 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 4 Jan 2023 11:05:57 -0500 Subject: [PATCH 0338/1127] for crop irrigation, only keep naics7 where naics7 available in both coa and iwms - otherwise use naics6 --- .../flowbysectormethods/Water_national_2015_m1.yaml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index 3681a198f..1ef877a95 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -42,14 +42,9 @@ source_names: USDA_CoA_Cropland: industry_spec: default: NAICS_6 - '111120': { default: NAICS_7 } - '111130': { default: NAICS_7 } '111150': { default: NAICS_7 } '111199': { default: NAICS_7 } - '111421': { default: NAICS_7 } - '111930': { default: NAICS_7 } - '111991': { default: NAICS_7 } - '111998': { default: NAICS_7 } + '111940': { default: NAICS_7 } year: 2017 selection_fields: Class: "Land" @@ -63,11 +58,6 @@ source_names: attribution_method: multiplication attribution_source: USDA_IWMS: - industry_spec: - default: NAICS_6 - '111150': { default: NAICS_7 } - '111199': { default: NAICS_7 } - '111940': { default: NAICS_7 } year: 2018 selection_fields: Class: Water From 0dfa2cb8555a751f366f49f1373f26a5aa3ac8da Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 4 Jan 2023 11:10:06 -0500 Subject: [PATCH 0339/1127] update sector_aggregation() to first subset naics key by naics string length --- flowsa/flowby.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index ffc4ef192..5cf30b932 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1853,15 +1853,18 @@ def sector_aggregation(self): the FBS target scale :return: """ - naics_key = naics.industry_spec_key(self.config['industry_spec']) + # subset naics to those where the source_naics string length is longer + # than target_naics + naics_key_sub = naics_key.query( + 'source_naics.str.len() >= target_naics.str.len()') fbs = self for direction in ['ProducedBy', 'ConsumedBy']: fbs = ( fbs .rename(columns={f'Sector{direction}': 'source_naics'}) - .merge(naics_key, + .merge(naics_key_sub, how='left') .rename(columns={'target_naics': f'Sector{direction}'}) .drop(columns='source_naics') From d059ac75f63ea9dcb36d792e5a3b8a14c22ec5bb Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 6 Jan 2023 16:09:18 -0500 Subject: [PATCH 0340/1127] reframe "sector_aggregation_level" as "sector_hierarchy" and reframe "aggregated" to "parent" and disaggregated to "parent-child" --- flowsa/data/README.md | 2 +- flowsa/data/source_catalog.yaml | 106 ++++++++++++++++---------------- flowsa/flowby.py | 4 +- flowsa/sectormapping.py | 4 +- 4 files changed, 58 insertions(+), 58 deletions(-) diff --git a/flowsa/data/README.md b/flowsa/data/README.md index debacda02..431951493 100644 --- a/flowsa/data/README.md +++ b/flowsa/data/README.md @@ -15,7 +15,7 @@ Flow-By-Activity. - _activity_schema_: 'None' if 'sector-like_activities' is False, otherwise the year of the sector data (ex. NAICS_2012_Code) -- _sector_aggregation_level_: 'aggregated' or 'disaggregated'. Some dataset +- _sector_hierarchy_: 'parent' or 'parent-child'. Some dataset crosswalks contain every level of relevant sectors (ex. NAICS for 2-6 digits), that is they are fully disaggregated. Other datasets only contain information for the highest relevant sector level, in which case, diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 6b74d80ea..43351218f 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -4,55 +4,55 @@ Blackhurst_IO: - Water sector-like_activities: False activity_schema: - sector_aggregation_level: "disaggregated" + sector_hierarchy: "parent-child" BLM_PLS: data_format: FBA class: - Land sector-like_activities: False activity_schema: - sector_aggregation_level: "aggregated" + sector_hierarchy: "parent" BEA_GDP: data_format: FBA class: - Money sector-like_activities: False # activity_schema: BEA_2012_Detail_Code - sector_aggregation_level: "disaggregated" + sector_hierarchy: "parent-child" BEA_GDP_GrossOutput: data_format: FBA class: - Money sector-like_activities: False # activity_schema: BEA_2012_Detail_Code - sector_aggregation_level: "disaggregated" + sector_hierarchy: "parent-child" BEA_Use: data_format: FBA class: - Money sector-like_activities: False #update to true once alternate activity_schema in place # activity_schema: BEA_2012_Detail_Code - sector_aggregation_level: "disaggregated" + sector_hierarchy: "parent-child" BEA_Use_Detail_PRO_BeforeRedef: data_format: FBA class: - Money sector-like_activities: False #update to true once alternate activity_schema in place # activity_schema: BEA_2012_Detail_Code - sector_aggregation_level: "disaggregated" + sector_hierarchy: "parent-child" BEA_Make_Detail_BeforeRedef: data_format: FBA class: - Money sector-like_activities: False #update to true once alternate activity_schema in place # activity_schema: BEA_2012_Detail_Code - sector_aggregation_level: "disaggregated" + sector_hierarchy: "parent-child" BEA_Marine_Bunker_Fuel: data_format: FBA class: - Energy sector-like_activities: False - sector_aggregation_level: "aggregated" + sector_hierarchy: "parent" BLS_QCEW: data_format: FBA class: @@ -61,7 +61,7 @@ BLS_QCEW: - Other sector-like_activities: True activity_schema: NAICS_2012_Code - sector_aggregation_level: "disaggregated" + sector_hierarchy: "parent-child" BTS_TSA: data_format: FBA sector-like_activities: False @@ -74,13 +74,13 @@ CalRecycle_WasteCharacterization: - Other sector-like_activities: False activity_schema: - sector_aggregation_level: "aggregated" + sector_hierarchy: "parent" Census_ASM: class: - Money sector-like_activities: True activity_schema: None # Codes for 2018 are NAICS_2017_Code - sector_aggregation_level: "disaggregated" + sector_hierarchy: "parent-child" Census_CBP: data_format: FBA class: @@ -89,44 +89,44 @@ Census_CBP: - Other sector-like_activities: True activity_schema: NAICS_2012_Code - sector_aggregation_level: "disaggregated" + sector_hierarchy: "parent-child" Census_PEP_Population: data_format: FBA class: Other sector-like_activities: False activity_schema: - sector_aggregation_level: "" + sector_hierarchy: "" Census_QWI: data_format: FBA class: - Employment sector-like_activities: True activity_schema: NAICS_2012_Code - sector_aggregation_level: "disaggregated" + sector_hierarchy: "parent-child" Census_VIP: data_format: FBA class: Money sector-like_activities: False activity_schema: - sector_aggregation_level: "aggregated" + sector_hierarchy: "parent" EIA_CBECS_Land: data_format: FBA class: Land sector-like_activities: False activity_schema: - sector_aggregation_level: "aggregated" + sector_hierarchy: "parent" EIA_CBECS_Water: data_format: FBA class: Water sector-like_activities: False activity_schema: - sector_aggregation_level: "aggregated" + sector_hierarchy: "parent" EIA_AEO: data_format: FBA class: - Energy sector-like_activities: False - # sector_aggregation_level: "aggregated" + # sector_hierarchy: "parent" EIA_MECS_Energy: data_format: FBA class: @@ -135,41 +135,41 @@ EIA_MECS_Energy: - Money sector-like_activities: True activity_schema: NAICS_2012_Code - sector_aggregation_level: "disaggregated" + sector_hierarchy: "parent-child" EIA_MECS_Land: data_format: FBA class: - Land sector-like_activities: True activity_schema: - sector_aggregation_level: "disaggregated" + sector_hierarchy: "parent-child" EIA_MER: data_format: FBA class: - Energy sector-like_activities: False activity_schema: - sector_aggregation_level: "disaggregated" + sector_hierarchy: "parent-child" EIA_SEDS: data_format: FBA class: - Energy - Money sector-like_activities: False - # sector_aggregation_level: "aggregated" + # sector_hierarchy: "parent" EPA_CDDPath: data_format: FBA class: - Other sector-like_activities: False activity_schema: - sector_aggregation_level: "aggregated" + sector_hierarchy: "parent" EPA_FactsAndFigures: class: - Other sector-like_activities: False activity_schema: None - sector_aggregation_level: "aggregated" + sector_hierarchy: "parent" EPA_GHGI: data_format: FBA class: @@ -178,7 +178,7 @@ EPA_GHGI: - Other sector-like_activities: False activity_schema: - sector_aggregation_level: "aggregated" + sector_hierarchy: "parent" GHGI2020: data_format: FBA class: @@ -187,7 +187,7 @@ GHGI2020: - Other sector-like_activities: False activity_schema: - sector_aggregation_level: "aggregated" + sector_hierarchy: "parent" EPA_REI: class: - Employment @@ -195,19 +195,19 @@ EPA_REI: - Other sector-like_activities: False activity_schema: None - sector_aggregation_level: "disaggregated" + sector_hierarchy: "parent-child" EPA_StateGHGI: class: - Chemicals sector-like_activities: False activity_schema: - sector_aggregation_level: "aggregated" + sector_hierarchy: "parent" EPA_SIT: class: - Chemicals sector-like_activities: False activity_schema: - sector_aggregation_level: "aggregated" + sector_hierarchy: "parent" EPA_NEI_Nonpoint: data_format: FBA class: @@ -215,20 +215,20 @@ EPA_NEI_Nonpoint: sector-like_activities: False activity_schema: SCC fedefl_mapping: NEI - # sector_aggregation_level: "aggregated" + # sector_hierarchy: "parent" EPA_NEI_Nonroad: data_format: FBA class: - Chemicals sector-like_activities: False activity_schema: SCC - sector_aggregation_level: "aggregated" + sector_hierarchy: "parent" EPA_NEI_Onroad: class: - Chemicals sector-like_activities: False activity_schema: SCC - sector_aggregation_level: "aggregated" + sector_hierarchy: "parent" EPA_WARMer: class: - Chemicals @@ -237,50 +237,50 @@ EPA_WARMer: - Employment sector-like_activities: False activity_schema: None - sector_aggregation_level: "aggregated" + sector_hierarchy: "parent" EPA_WFR: class: - Other sector-like_activities: False activity_schema: None - sector_aggregation_level: "aggregated" + sector_hierarchy: "parent" NETL_EIA_PlantWater: class: - Water - Energy sector-like_activities: False activity_schema: None - sector_aggregation_level: "aggregated" + sector_hierarchy: "parent" NOAA_FisheriesLandings: class: - Money sector-like_activities: False activity_schema: - sector_aggregation_level: "" + sector_hierarchy: "" StatCan_GDP: class: - Money sector-like_activities: True activity_schema: NAICS_2012_Code - sector_aggregation_level: "disaggregated" + sector_hierarchy: "parent-child" StatCan_IWS_MI: class: - Water sector-like_activities: True activity_schema: NAICS_2012_Code - sector_aggregation_level: "aggregated" + sector_hierarchy: "parent" StatCan_LFS: class: - Employment sector-like_activities: False activity_schema: - sector_aggregation_level: "aggregated" + sector_hierarchy: "parent" stateio: class: - Money sector-like_activities: False #update to true once alternate activity_schema in place # activity_schema: BEA_2012_Summary_Code - sector_aggregation_level: "disaggregated" + sector_hierarchy: "parent-child" USDA_CoA_Cropland: data_format: FBA class: @@ -288,84 +288,84 @@ USDA_CoA_Cropland: - Other sector-like_activities: False activity_schema: - sector_aggregation_level: "disaggregated" + sector_hierarchy: "parent-child" USDA_CoA_Cropland_NAICS: data_format: FBA class: - Land sector-like_activities: True activity_schema: NAICS_2012_Code - sector_aggregation_level: "disaggregated" + sector_hierarchy: "parent-child" USDA_CoA_Livestock: data_format: FBA class: - Other sector-like_activities: False activity_schema: - sector_aggregation_level: "disaggregated" + sector_hierarchy: "parent-child" USDA_ERS_FIWS: data_format: FBA class: - Money sector-like_activities: False activity_schema: - sector_aggregation_level: "" + sector_hierarchy: "" USDA_ERS_MLU: data_format: FBA class: - Land sector-like_activities: False activity_schema: - sector_aggregation_level: "aggregated" + sector_hierarchy: "parent" USDA_IWMS: data_format: FBA class: - Water sector-like_activities: False activity_schema: - sector_aggregation_level: "aggregated" + sector_hierarchy: "parent" USGS_NWIS_WU: data_format: FBA class: - Water sector-like_activities: False activity_schema: - sector_aggregation_level: "aggregated" + sector_hierarchy: "parent" USGS_WU_Coef: data_format: FBA class: - Water sector-like_activities: False activity_schema: - sector_aggregation_level: "aggregated" + sector_hierarchy: "parent" write_FBA_California_Commercial_bySector: class: - Other sector-like_activities: False activity_schema: - sector_aggregation_level: "" + sector_hierarchy: "" USGS_MYB_Lead: data_format: FBA class: - Geological sector-like_activities: False activity_schema: - sector_aggregation_level: "" + sector_hierarchy: "" USGS_MYB_ManufacturedAbrasive: class: - Geological sector-like_activities: False activity_schema: - sector_aggregation_level: "" + sector_hierarchy: "" USGS_MYB_SodaAsh: class: - Geological sector-like_activities: False activity_schema: - sector_aggregation_level: "" + sector_hierarchy: "" USGS_MYB_Copper: class: - Geological sector-like_activities: False activity_schema: - sector_aggregation_level: "" \ No newline at end of file + sector_hierarchy: "" \ No newline at end of file diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 5cf30b932..b6455bfd3 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1141,8 +1141,8 @@ def map_to_sectors( # todo: expand on this start. There will be cases where although data is disaggregated, # there might not be all mappings (might stop at NAICS5 in df because NAICS6 is just NAICS5 with added 0) - if self.config['sector_aggregation_level'] == 'disaggregated': - log.info('NAICS are already disaggregated, assigning activity ' + if self.config['sector_hierarchy'] == 'parent-child': + log.info('NAICS are a mix of parent-child, assigning activity ' 'columns directly to sector columns') target_naics = set( naics.industry_spec_key(self.config['industry_spec']) diff --git a/flowsa/sectormapping.py b/flowsa/sectormapping.py index 7bfc5e553..1edef59c9 100644 --- a/flowsa/sectormapping.py +++ b/flowsa/sectormapping.py @@ -86,11 +86,11 @@ def add_sectors_to_flowbyactivity( src_info = load_yaml_dict('source_catalog')[ts] # read the pre-determined level of sector aggregation of # each crosswalk from the source catalog - levelofSectoragg = src_info['sector_aggregation_level'] + levelofSectoragg = src_info['sector_hierarchy'] # if the FBS activity set is 'direct', overwrite the # levelofsectoragg, or if specified in fxn call if allocationmethod == 'direct': - levelofSectoragg = 'disaggregated' + levelofSectoragg = 'parent-child' if overwrite_sectorlevel is not None: levelofSectoragg = overwrite_sectorlevel # if data are provided in NAICS format, use the mastercrosswalk From b3311d21ae3865931ac3644a5e73cc908463b7b7 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 6 Jan 2023 17:08:36 -0500 Subject: [PATCH 0341/1127] drop locationsystem from FBS --- flowsa/flowby.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index b6455bfd3..d4c436471 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1831,6 +1831,8 @@ def generateFlowBySector( fbs.full_name = method fbs.config = method_config + # drop year from LocationSystem for FBS use with USEEIO + fbs['LocationSystem'] = fbs['LocationSystem'].str.split('_').str[0] # aggregate to target geoscale fbs = ( fbs From 55918b3f744431efc7538ed4103700812104d6bf Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 11 Jan 2023 14:18:56 -0500 Subject: [PATCH 0342/1127] Allow passing kwargs to flowsa.getFlowBySector() for use by flowsa.flowby.getFlowBySector() --- flowsa/__init__.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/flowsa/__init__.py b/flowsa/__init__.py index 06ca9ea8a..3523e3d70 100644 --- a/flowsa/__init__.py +++ b/flowsa/__init__.py @@ -54,14 +54,19 @@ def getFlowByActivity(datasource, year, flowclass=None, geographic_level=None, return fba -def getFlowBySector(methodname, fbsconfigpath=None, - download_FBAs_if_missing=DEFAULT_DOWNLOAD_IF_MISSING, - download_FBS_if_missing=DEFAULT_DOWNLOAD_IF_MISSING): +def getFlowBySector( + methodname, + fbsconfigpath=None, + download_FBAs_if_missing=DEFAULT_DOWNLOAD_IF_MISSING, + download_FBS_if_missing=DEFAULT_DOWNLOAD_IF_MISSING, + **kwargs +) -> FlowBySector: fbs = FlowBySector.getFlowBySector( method=methodname, external_config_path=fbsconfigpath, download_sources_ok=download_FBAs_if_missing, - download_fbs_ok=download_FBS_if_missing + download_fbs_ok=download_FBS_if_missing, + **kwargs ) return fbs From bbf0d0582850dc5649f5b033653ed138b096f5bd Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 11 Jan 2023 14:25:23 -0500 Subject: [PATCH 0343/1127] Improve handling of provided config file path info --- flowsa/common.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/flowsa/common.py b/flowsa/common.py index 913fa8929..21966e4a1 100644 --- a/flowsa/common.py +++ b/flowsa/common.py @@ -6,6 +6,7 @@ import shutil import os +from os import path import yaml import pandas as pd import numpy as np @@ -116,10 +117,14 @@ def load_yaml_dict(filename, flowbytype=None, filepath=None): else: # first check if a filepath for the yaml is specified, as is the # case with FBS method files located outside FLOWSA - if filepath is not None: + # if filepath is not None: + if path.exists(path.join(str(filepath), f'{filename}.yaml')): log.info(f'Loading {filename} from {filepath}') folder = filepath else: + if filepath is not None: + log.warning(f'{filename} not found in {filepath}. ' + f'Checking default folders') if flowbytype == 'FBA': folder = sourceconfigpath elif flowbytype == 'FBS': From 52e67dbd448bcfa3c4d448900adeace5d3fbed5c Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 11 Jan 2023 14:27:09 -0500 Subject: [PATCH 0344/1127] Removed unnecessary diagnostic log message --- flowsa/data_source_scripts/EPA_GHGI.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_GHGI.py b/flowsa/data_source_scripts/EPA_GHGI.py index 91e3ae81c..6ba233859 100644 --- a/flowsa/data_source_scripts/EPA_GHGI.py +++ b/flowsa/data_source_scripts/EPA_GHGI.py @@ -680,8 +680,6 @@ def get_manufacturing_energy_ratios(year): }) ) - log.critical(f'MECS length: {len(mecs)}\nMECS columns: {mecs.columns}') - ratio_dict = {} for ghgi_flow, mecs_flow in flows: mecs_energy = mecs.query(f'FlowName == @mecs_flow').FlowAmount.values[0] From c216cfa1794331d4d846088cff27ebea0b2b37f1 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 11 Jan 2023 14:27:58 -0500 Subject: [PATCH 0345/1127] Added Employment_national to source_catalog --- flowsa/data/source_catalog.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 879235dfe..745cfcbd4 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -151,6 +151,15 @@ EIA_SEDS: - Money sector-like_activities: False # sector_aggregation_level: "aggregated" +Employment_national: + data_format: FBS + class: + - Employment + - Money + - Other + sector-like_activities: True + activity_schema: NAICS_2012_Code + sector_aggregation_level: "disaggregated" EPA_CDDPath: data_format: FBA class: From ad7a07b477731f0e1c79f0e2e1d2aa523f1df487 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 11 Jan 2023 14:29:02 -0500 Subject: [PATCH 0346/1127] Added Marine Emissions factors --- flowsa/data/EPA_emissions_factors.csv | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flowsa/data/EPA_emissions_factors.csv b/flowsa/data/EPA_emissions_factors.csv index 521b6a362..8b0c61afd 100644 --- a/flowsa/data/EPA_emissions_factors.csv +++ b/flowsa/data/EPA_emissions_factors.csv @@ -4,3 +4,6 @@ Total Gallons Consumed,Commercial Aircraft,gal,N2O,MT CO2e,0.0000894,EPA (2021) Bunker Fuel,Marine Shipping,tonne fuel oil,CO2,MT CO2e,3.224,Federal Register EPA; 40 CFR Part 98; e-CFR (see link below). Table C-1 (as amended at 81 FR 89252 Dec. 9 2016). https://www.ecfr.gov/cgi-bin/text-idx?SID=ae265d7d6f98ec86fcd8640b9793a3f6&mc=true&node=pt40.23.98&rgn=div5#ap40.23.98_19.1 Bunker Fuel,Marine Shipping,tonne fuel oil,N2O,MT CO2e,0.0272,EPA (2021) Inventory of U.S. Greenhouse Gas Emissions and Sinks: 1990-2019 (Annexes). All values are calculated from Tables A-97 through A-98; also Intergovernmental Panel on Climate Change (IPCC) Fourth Assessment Report (AR4) 2007 Bunker Fuel,Marine Shipping,tonne fuel oil,CH4,MT CO2e,0.00793,EPA (2021) Inventory of U.S. Greenhouse Gas Emissions and Sinks: 1990-2019 (Annexes). All values are calculated from Tables A-97 through A-98; also Intergovernmental Panel on Climate Change (IPCC) Fourth Assessment Report (AR4) 2007 +Bunker Fuel,Ships and Boats,tonne fuel oil,CO2,MT CO2e,3.224,Federal Register EPA; 40 CFR Part 98; e-CFR (see link below). Table C-1 (as amended at 81 FR 89252 Dec. 9 2016). https://www.ecfr.gov/cgi-bin/text-idx?SID=ae265d7d6f98ec86fcd8640b9793a3f6&mc=true&node=pt40.23.98&rgn=div5#ap40.23.98_19.1 +Bunker Fuel,Ships and Boats,tonne fuel oil,N2O,MT CO2e,0.0272,EPA (2021) Inventory of U.S. Greenhouse Gas Emissions and Sinks: 1990-2019 (Annexes). All values are calculated from Tables A-97 through A-98; also Intergovernmental Panel on Climate Change (IPCC) Fourth Assessment Report (AR4) 2007 +Bunker Fuel,Ships and Boats,tonne fuel oil,CH4,MT CO2e,0.00793,EPA (2021) Inventory of U.S. Greenhouse Gas Emissions and Sinks: 1990-2019 (Annexes). All values are calculated from Tables A-97 through A-98; also Intergovernmental Panel on Climate Change (IPCC) Fourth Assessment Report (AR4) 2007 From 97f54d506be24555d56adbb6c12784d43fc781e0 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 11 Jan 2023 14:29:40 -0500 Subject: [PATCH 0347/1127] Added marine shipping crosswalk entries for attribution by TSAs --- .../NAICS_Crosswalk_EPA_GHGI_SEEA.csv | 122 +++++++++++++++++- 1 file changed, 120 insertions(+), 2 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv index 63692ff33..c7f11c1ab 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv @@ -172,5 +172,123 @@ EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_14, EP EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Landfills,NAICS_2012_Code,ACC,,,"EPA_GHGI_T_2_1" -EPA_GHGI,Marine Shipping,NAICS_2012_Code,4831,,,"BEA_Bunker_Fuel" -EPA_GHGI,Marine,NAICS_2012_Code,4831,,,"GHGI2020_3_104" +EPA_GHGI,Marine Shipping,NAICS_2012_Code,11,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,21,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,22,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,23,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,31,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,32,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,33,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,42,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,44,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,45,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,48,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,49,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,51,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,52,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,53,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,54,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,55,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,56,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,61,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,62,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,71,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,72,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,81,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,92,,,BEA_Bunker_Fuel +EPA_GHGI,Marine,NAICS_2012_Code,11,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,21,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,22,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,23,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,31,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,32,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,33,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,42,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,44,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,45,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,48,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,49,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,51,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,52,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,53,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,54,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,55,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,56,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,61,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,62,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,71,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,72,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,81,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,92,,,GHGI2020_3_104 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,11,,,EPA_GHGI_T_A_103 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,21,,,EPA_GHGI_T_A_103 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,22,,,EPA_GHGI_T_A_103 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,23,,,EPA_GHGI_T_A_103 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,31,,,EPA_GHGI_T_A_103 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,32,,,EPA_GHGI_T_A_103 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,33,,,EPA_GHGI_T_A_103 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,42,,,EPA_GHGI_T_A_103 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,44,,,EPA_GHGI_T_A_103 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,45,,,EPA_GHGI_T_A_103 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,48,,,EPA_GHGI_T_A_103 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,49,,,EPA_GHGI_T_A_103 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,51,,,EPA_GHGI_T_A_103 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,52,,,EPA_GHGI_T_A_103 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,53,,,EPA_GHGI_T_A_103 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,54,,,EPA_GHGI_T_A_103 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,55,,,EPA_GHGI_T_A_103 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,56,,,EPA_GHGI_T_A_103 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,61,,,EPA_GHGI_T_A_103 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,62,,,EPA_GHGI_T_A_103 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,71,,,EPA_GHGI_T_A_103 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,72,,,EPA_GHGI_T_A_103 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,81,,,EPA_GHGI_T_A_103 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,92,,,EPA_GHGI_T_A_103 +EPA_GHGI,Aviation,NAICS_2012_Code,11,,,EPA_GHGI_T_A_103 +EPA_GHGI,Aviation,NAICS_2012_Code,21,,,EPA_GHGI_T_A_103 +EPA_GHGI,Aviation,NAICS_2012_Code,22,,,EPA_GHGI_T_A_103 +EPA_GHGI,Aviation,NAICS_2012_Code,23,,,EPA_GHGI_T_A_103 +EPA_GHGI,Aviation,NAICS_2012_Code,31,,,EPA_GHGI_T_A_103 +EPA_GHGI,Aviation,NAICS_2012_Code,32,,,EPA_GHGI_T_A_103 +EPA_GHGI,Aviation,NAICS_2012_Code,33,,,EPA_GHGI_T_A_103 +EPA_GHGI,Aviation,NAICS_2012_Code,42,,,EPA_GHGI_T_A_103 +EPA_GHGI,Aviation,NAICS_2012_Code,44,,,EPA_GHGI_T_A_103 +EPA_GHGI,Aviation,NAICS_2012_Code,45,,,EPA_GHGI_T_A_103 +EPA_GHGI,Aviation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_103 +EPA_GHGI,Aviation,NAICS_2012_Code,49,,,EPA_GHGI_T_A_103 +EPA_GHGI,Aviation,NAICS_2012_Code,51,,,EPA_GHGI_T_A_103 +EPA_GHGI,Aviation,NAICS_2012_Code,52,,,EPA_GHGI_T_A_103 +EPA_GHGI,Aviation,NAICS_2012_Code,53,,,EPA_GHGI_T_A_103 +EPA_GHGI,Aviation,NAICS_2012_Code,54,,,EPA_GHGI_T_A_103 +EPA_GHGI,Aviation,NAICS_2012_Code,55,,,EPA_GHGI_T_A_103 +EPA_GHGI,Aviation,NAICS_2012_Code,56,,,EPA_GHGI_T_A_103 +EPA_GHGI,Aviation,NAICS_2012_Code,61,,,EPA_GHGI_T_A_103 +EPA_GHGI,Aviation,NAICS_2012_Code,62,,,EPA_GHGI_T_A_103 +EPA_GHGI,Aviation,NAICS_2012_Code,71,,,EPA_GHGI_T_A_103 +EPA_GHGI,Aviation,NAICS_2012_Code,72,,,EPA_GHGI_T_A_103 +EPA_GHGI,Aviation,NAICS_2012_Code,81,,,EPA_GHGI_T_A_103 +EPA_GHGI,Aviation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_103 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,11,,,EPA_GHGI_T_A_103 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,21,,,EPA_GHGI_T_A_103 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,22,,,EPA_GHGI_T_A_103 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,23,,,EPA_GHGI_T_A_103 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,31,,,EPA_GHGI_T_A_103 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,32,,,EPA_GHGI_T_A_103 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,33,,,EPA_GHGI_T_A_103 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,42,,,EPA_GHGI_T_A_103 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,44,,,EPA_GHGI_T_A_103 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,45,,,EPA_GHGI_T_A_103 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,48,,,EPA_GHGI_T_A_103 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,49,,,EPA_GHGI_T_A_103 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,51,,,EPA_GHGI_T_A_103 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,52,,,EPA_GHGI_T_A_103 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,53,,,EPA_GHGI_T_A_103 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,54,,,EPA_GHGI_T_A_103 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,55,,,EPA_GHGI_T_A_103 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,56,,,EPA_GHGI_T_A_103 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,61,,,EPA_GHGI_T_A_103 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,62,,,EPA_GHGI_T_A_103 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,71,,,EPA_GHGI_T_A_103 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,72,,,EPA_GHGI_T_A_103 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,81,,,EPA_GHGI_T_A_103 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,92,,,EPA_GHGI_T_A_103 From 415c54a02788d33dfa9415ce087f3125a73aaf3c Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 11 Jan 2023 14:30:42 -0500 Subject: [PATCH 0348/1127] Added important comments, reorganized SEEA_2017_... slightly --- .../GHGI_recursive_2016_m1.yaml | 2 + .../flowbysectormethods/SEEA_2017_v2.yaml | 159 +++++++++--------- 2 files changed, 82 insertions(+), 79 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml b/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml index 51aaedb62..eef13891a 100644 --- a/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml @@ -322,6 +322,8 @@ source_names: ActivityProducedBy: {'221200': ''} # purchases of natural gas EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 + # ^^^ TODO: double check this is working as intended. I had a situation where + # we were only getting the first activity set. ## Major CO2 Sources EPA_GHGI_T_A_14: # CO2 emissions from stationary combustion and transportation diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml index 1282a35d9..7282a1299 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml @@ -372,85 +372,6 @@ source_names: EPA_GHGI_T_3_40: *petroleum #CO2 from Petroleum Systems mimics CH4 EPA_GHGI_T_3_42: *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 -# ## Stationary Combustion (note that CO2 is electric power only) - EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion - clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion - activity_sets: - direct_attribution: - selection_fields: - PrimaryActivity: - - Fuel Oil Residential - - Coal Residential - - Natural Gas Residential - - Wood Residential - attribution_method: direct - electric_power: &stationary_electric - selection_fields: - PrimaryActivity: - - Coal Electric Power - - Natural Gas Electric Power - - Natural gas Electric Power # note lower case - - Fuel Oil Electric Power - - Geothermal Electric Power - - Wood Electric Power - activity_to_sector_mapping: EPA_GHGI_m2 - attribution_method: direct - fuel_oil: - selection_fields: - PrimaryActivity: - - Fuel Oil Commercial - - Fuel Oil Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # purchases of refinery products - natural_gas: - selection_fields: - PrimaryActivity: - - Natural gas Commercial - - Natural gas Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '221200' # purchases of natural gas - coal: - selection_fields: - PrimaryActivity: Coal Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '212100' # purchases of coal - coal_manufacturing: - selection_fields: - PrimaryActivity: Coal Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Coal - natural_gas_manufacturing: - selection_fields: - PrimaryActivity: Natural gas Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Natural Gas - EPA_GHGI_T_3_9: # N2O emissions from stationary combustion - <<: *stationary_combustion - EPA_GHGI_T_3_7: # CO2 emissions from stationary combustion (electricity only) - <<: *stationary_electric - # ## Agriculture EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues selection_fields: @@ -723,6 +644,7 @@ source_names: attribution_method: direct trucking: adjustment_factor: 0.99 + # ^^^ This is wrong. As is, it's just shifting attribution toward other transportation modes rather than making a true residency adjustment selection_fields: FlowName: Distillate Fuel Oil (Diesel Fuel) PrimaryActivity: @@ -784,6 +706,85 @@ source_names: selection_fields: ActivityProducedBy: '324110' # use of petroleum products +# ## Stationary Combustion (note that CO2 is electric power only) + EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion + clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion + activity_sets: + direct_attribution: + selection_fields: + PrimaryActivity: + - Fuel Oil Residential + - Coal Residential + - Natural Gas Residential + - Wood Residential + attribution_method: direct + electric_power: &stationary_electric + selection_fields: + PrimaryActivity: + - Coal Electric Power + - Natural Gas Electric Power + - Natural gas Electric Power # note lower case + - Fuel Oil Electric Power + - Geothermal Electric Power + - Wood Electric Power + activity_to_sector_mapping: EPA_GHGI_m2 + attribution_method: direct + fuel_oil: + selection_fields: + PrimaryActivity: + - Fuel Oil Commercial + - Fuel Oil Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '324110' # purchases of refinery products + natural_gas: + selection_fields: + PrimaryActivity: + - Natural gas Commercial + - Natural gas Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '221200' # purchases of natural gas + coal: + selection_fields: + PrimaryActivity: Coal Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea_use + selection_fields: + ActivityProducedBy: '212100' # purchases of coal + coal_manufacturing: + selection_fields: + PrimaryActivity: Coal Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Coal + natural_gas_manufacturing: + selection_fields: + PrimaryActivity: Natural gas Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Natural Gas + EPA_GHGI_T_3_9: # N2O emissions from stationary combustion + <<: *stationary_combustion + EPA_GHGI_T_3_7: # CO2 emissions from stationary combustion (electricity only) + <<: *stationary_electric + ## Other sources EPA_GHGI_T_4_46: #CO2 for selected petrochemicals selection_fields: From 4d32fb916d96cd634365271e09d7bba034cc6031 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Wed, 11 Jan 2023 14:53:39 -0500 Subject: [PATCH 0349/1127] Fix how selection fields works with renaming fields that are to be selected on later (say, to create activity sets) --- flowsa/flowby.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 917dbe64f..4dbb7e7cd 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1545,17 +1545,30 @@ def activity_sets(self) -> List['FlowByActivity']: selection_fields=activity_config['selection_fields']) ) + for field, values in activity_config['selection_fields'].items(): + if isinstance(values, dict): + activity_config['selection_fields'][field] = list(set( + values.values() + )) + # ^^^ This makes it so that if the activity set's + # selection_fields are a dict (implying renaming of the + # given values), then the selection that happens during + # prepare_fbs on the activity set selects by the renamed + # values rather than the original ones. + child_fba.config = {**parent_config, **activity_config} child_fba = child_fba.assign(SourceName=child_fba.full_name) if set(child_fba.row) & assigned_rows: - log.error( + log.critical( 'Some rows from %s assigned to multiple activity ' 'sets. This will lead to double-counting:\n%s', parent_fba.full_name, - child_fba.iloc[list(set(child_fba.row) - & assigned_rows)]) - raise ValueError('Some rows in multiple activity sets') + child_fba.query( + f'row in {list(set(child_fba.row) & assigned_rows)}' + ) + ) + # raise ValueError('Some rows in multiple activity sets') assigned_rows.update(child_fba.row) if not child_fba.empty: From e4de14663ecbb0906583ab103b2a4eb9916370f8 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 12 Jan 2023 13:10:32 -0500 Subject: [PATCH 0350/1127] Specific changes for the SEEA time series estimates, not necessarily applicable generally --- .../NAICS_Crosswalk_EPA_GHGI.csv | 13 ------------- .../Employment_national_2016.yaml | 10 ++++++++++ 2 files changed, 10 insertions(+), 13 deletions(-) create mode 100644 flowsa/methods/flowbysectormethods/Employment_national_2016.yaml diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv index eea0bad38..42d419412 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv @@ -35,8 +35,6 @@ EPA_GHGI,"Caprolactam, Glyoxal, and Glyoxylic Acid Production",NAICS_2012_Code,3 EPA_GHGI,Electronics Industry,NAICS_2012_Code,334413,,"334413, name change from Semiconductor Manufacture",EPA_GHGI_T_2_1 EPA_GHGI,Electrical Transmission and Distribution,NAICS_2012_Code,2211,,221100,EPA_GHGI_T_2_1 EPA_GHGI,Electric Power,NAICS_2012_Code,2211,,"Commodity: 221100 (or I: 221100, S00101, S00202)",EPA_GHGI_T_2_1 -EPA_GHGI,Electric Power,NAICS_2012_Code,S00101,,,EPA_GHGI_T_2_1 -EPA_GHGI,Electric Power,NAICS_2012_Code,S00202,,,EPA_GHGI_T_2_1 EPA_GHGI,Liming,NAICS_2012_Code,111,,"111, 112",EPA_GHGI_T_2_1 EPA_GHGI,Liming,NAICS_2012_Code,112,,,EPA_GHGI_T_2_1 EPA_GHGI,Urea Fertilization,NAICS_2012_Code,111,,"111, 112",EPA_GHGI_T_2_1 @@ -198,16 +196,6 @@ EPA_GHGI,Fuel Oil Electric Power,NAICS_2012_Code,2211,,"Commodity: 221100 (or I: EPA_GHGI,Natural gas Electric Power,NAICS_2012_Code,2211,,"Commodity: 221100 (or I: 221100, S00101, S00202)",EPA_GHGI_T_3_8 EPA_GHGI,Natural Gas Electric Power,NAICS_2012_Code,2211,,,EPA_GHGI_T_3_9 EPA_GHGI,Wood Electric Power,NAICS_2012_Code,2211,,"Commodity: 221100 (or I: 221100, S00101, S00202)","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Electric Power,NAICS_2012_Code,S00101,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Electric Power,NAICS_2012_Code,S00101,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Electric Power,NAICS_2012_Code,S00101,,,EPA_GHGI_T_3_8 -EPA_GHGI,Natural Gas Electric Power,NAICS_2012_Code,S00101,,,EPA_GHGI_T_3_9 -EPA_GHGI,Wood Electric Power,NAICS_2012_Code,S00101,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Electric Power,NAICS_2012_Code,S00202,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Electric Power,NAICS_2012_Code,S00202,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Electric Power,NAICS_2012_Code,S00202,,,EPA_GHGI_T_3_8 -EPA_GHGI,Natural Gas Electric Power,NAICS_2012_Code,S00202,,,EPA_GHGI_T_3_9 -EPA_GHGI,Wood Electric Power,NAICS_2012_Code,S00202,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Coal Residential,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Natural Gas Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" @@ -520,7 +508,6 @@ EPA_GHGI,Ships and Boats,NAICS_2012_Code,483,,483000,EPA_GHGI_T_A_103 EPA_GHGI,Transit Buses,,,,excluded,EPA_GHGI_T_A_103 EPA_GHGI,Buses,NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_79 EPA_GHGI,Buses,NAICS_2012_Code,4871,,,EPA_GHGI_T_A_79 -EPA_GHGI,Buses,NAICS_2012_Code,S00201,,,EPA_GHGI_T_A_79 EPA_GHGI,Buses - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_79 EPA_GHGI,Buses - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,487,,48A000,EPA_GHGI_T_A_79 EPA_GHGI,Buses - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,488,,,EPA_GHGI_T_A_79 diff --git a/flowsa/methods/flowbysectormethods/Employment_national_2016.yaml b/flowsa/methods/flowbysectormethods/Employment_national_2016.yaml new file mode 100644 index 000000000..61288cc1b --- /dev/null +++ b/flowsa/methods/flowbysectormethods/Employment_national_2016.yaml @@ -0,0 +1,10 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: national + +source_names: + "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_national + year: 2016 + activity_sets: + qcew: !include:Employment_common.yaml:bls_allocation_national From d987ebe37689e87b73dd28b2207f61d2a64e810c Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 12 Jan 2023 13:16:16 -0500 Subject: [PATCH 0351/1127] update "sector_hierarchy" terminology from "parent" to "flat" --- flowsa/data/source_catalog.yaml | 52 ++++++++++++++++----------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index f36e4d483..820a934ea 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -11,7 +11,7 @@ BLM_PLS: - Land sector-like_activities: False activity_schema: - sector_hierarchy: "parent" + sector_hierarchy: "flat" BEA_GDP: data_format: FBA class: @@ -52,7 +52,7 @@ BEA_Marine_Bunker_Fuel: class: - Energy sector-like_activities: False - sector_hierarchy: "parent" + sector_hierarchy: "flat" BLS_QCEW: data_format: FBA class: @@ -74,7 +74,7 @@ CalRecycle_WasteCharacterization: - Other sector-like_activities: False activity_schema: - sector_hierarchy: "parent" + sector_hierarchy: "flat" Census_ASM: class: - Money @@ -108,25 +108,25 @@ Census_VIP: class: Money sector-like_activities: False activity_schema: - sector_hierarchy: "parent" + sector_hierarchy: "flat" EIA_CBECS_Land: data_format: FBA class: Land sector-like_activities: False activity_schema: - sector_hierarchy: "parent" + sector_hierarchy: "flat" EIA_CBECS_Water: data_format: FBA class: Water sector-like_activities: False activity_schema: - sector_hierarchy: "parent" + sector_hierarchy: "flat" EIA_AEO: data_format: FBA class: - Energy sector-like_activities: False - # sector_hierarchy: "parent" + # sector_hierarchy: "flat" EIA_MECS_Energy: data_format: FBA class: @@ -156,7 +156,7 @@ EIA_SEDS: - Energy - Money sector-like_activities: False - # sector_hierarchy: "parent" + # sector_hierarchy: "flat" Employment_national: data_format: FBS class: @@ -172,13 +172,13 @@ EPA_CDDPath: - Other sector-like_activities: False activity_schema: - sector_hierarchy: "parent" + sector_hierarchy: "flat" EPA_FactsAndFigures: class: - Other sector-like_activities: False activity_schema: None - sector_hierarchy: "parent" + sector_hierarchy: "flat" EPA_GHGI: data_format: FBA class: @@ -187,7 +187,7 @@ EPA_GHGI: - Other sector-like_activities: False activity_schema: - sector_hierarchy: "parent" + sector_hierarchy: "flat" GHGI2020: data_format: FBA class: @@ -196,7 +196,7 @@ GHGI2020: - Other sector-like_activities: False activity_schema: - sector_hierarchy: "parent" + sector_hierarchy: "flat" EPA_REI: class: - Employment @@ -210,13 +210,13 @@ EPA_StateGHGI: - Chemicals sector-like_activities: False activity_schema: - sector_hierarchy: "parent" + sector_hierarchy: "flat" EPA_SIT: class: - Chemicals sector-like_activities: False activity_schema: - sector_hierarchy: "parent" + sector_hierarchy: "flat" EPA_NEI_Nonpoint: data_format: FBA class: @@ -224,20 +224,20 @@ EPA_NEI_Nonpoint: sector-like_activities: False activity_schema: SCC fedefl_mapping: NEI - # sector_hierarchy: "parent" + # sector_hierarchy: "flat" EPA_NEI_Nonroad: data_format: FBA class: - Chemicals sector-like_activities: False activity_schema: SCC - sector_hierarchy: "parent" + sector_hierarchy: "flat" EPA_NEI_Onroad: class: - Chemicals sector-like_activities: False activity_schema: SCC - sector_hierarchy: "parent" + sector_hierarchy: "flat" EPA_WARMer: class: - Chemicals @@ -246,20 +246,20 @@ EPA_WARMer: - Employment sector-like_activities: False activity_schema: None - sector_hierarchy: "parent" + sector_hierarchy: "flat" EPA_WFR: class: - Other sector-like_activities: False activity_schema: None - sector_hierarchy: "parent" + sector_hierarchy: "flat" NETL_EIA_PlantWater: class: - Water - Energy sector-like_activities: False activity_schema: None - sector_hierarchy: "parent" + sector_hierarchy: "flat" NOAA_FisheriesLandings: class: - Money @@ -277,13 +277,13 @@ StatCan_IWS_MI: - Water sector-like_activities: True activity_schema: NAICS_2012_Code - sector_hierarchy: "parent" + sector_hierarchy: "flat" StatCan_LFS: class: - Employment sector-like_activities: False activity_schema: - sector_hierarchy: "parent" + sector_hierarchy: "flat" stateio: class: - Money @@ -325,28 +325,28 @@ USDA_ERS_MLU: - Land sector-like_activities: False activity_schema: - sector_hierarchy: "parent" + sector_hierarchy: "flat" USDA_IWMS: data_format: FBA class: - Water sector-like_activities: False activity_schema: - sector_hierarchy: "parent" + sector_hierarchy: "flat" USGS_NWIS_WU: data_format: FBA class: - Water sector-like_activities: False activity_schema: - sector_hierarchy: "parent" + sector_hierarchy: "flat" USGS_WU_Coef: data_format: FBA class: - Water sector-like_activities: False activity_schema: - sector_hierarchy: "parent" + sector_hierarchy: "flat" write_FBA_California_Commercial_bySector: class: - Other From 6b165228fa1bca64b8e2efc6fa8eb378ea28fd60 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 12 Jan 2023 14:50:15 -0500 Subject: [PATCH 0352/1127] move attribute_flows_to_sectors() before convert_to_geoscale() to prevent suppressed data from being dropped before opportunity to estimate - see conversation https://github.com/USEPA/flowsa/discussions/285#discussioncomment-4670847 --- flowsa/flowby.py | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index ee08805a2..1b47bac06 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1550,6 +1550,7 @@ def prepare_fbs(self: 'FlowByActivity') -> 'FlowBySector': .function_socket('estimate_suppressed') .convert_units_and_flows() # and also map to flow lists .function_socket('clean_fba') + .attribute_flows_to_sectors() # recursive call to prepare_fbs .convert_to_geoscale() .attribute_flows_to_sectors() # recursive call to prepare_fbs .drop(columns=['ActivityProducedBy', 'ActivityConsumedBy']) From e0b839bbbd65cad8696d6e0d36ff8ec5aa6c2e88 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 24 Jan 2023 08:59:00 -0500 Subject: [PATCH 0353/1127] Added two missing Employment_national years --- .../flowbysectormethods/Employment_national_2013.yaml | 10 ++++++++++ .../flowbysectormethods/Employment_national_2016.yaml | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/Employment_national_2013.yaml create mode 100644 flowsa/methods/flowbysectormethods/Employment_national_2016.yaml diff --git a/flowsa/methods/flowbysectormethods/Employment_national_2013.yaml b/flowsa/methods/flowbysectormethods/Employment_national_2013.yaml new file mode 100644 index 000000000..5d3c58d80 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/Employment_national_2013.yaml @@ -0,0 +1,10 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: national + +source_names: + "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_national + year: 2013 + activity_sets: + qcew: !include:Employment_common.yaml:bls_allocation \ No newline at end of file diff --git a/flowsa/methods/flowbysectormethods/Employment_national_2016.yaml b/flowsa/methods/flowbysectormethods/Employment_national_2016.yaml new file mode 100644 index 000000000..9d8c4cff1 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/Employment_national_2016.yaml @@ -0,0 +1,10 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: national + +source_names: + "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_national + year: 2016 + activity_sets: + qcew: !include:Employment_common.yaml:bls_allocation \ No newline at end of file From ea5f20e306ead71c7c617efd5ee477373bd7e183 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 24 Jan 2023 15:18:52 -0500 Subject: [PATCH 0354/1127] update how FBA attributed to target naics if parent-child hierarchy --- flowsa/flowby.py | 126 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 93 insertions(+), 33 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 1b47bac06..e44652803 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1220,49 +1220,109 @@ def map_to_sectors( log.info('Converting NAICS codes in crosswalk to desired ' 'industry/sector aggregation structure.') - activity_to_target_naics_crosswalk = ( - activity_to_source_naics_crosswalk - .merge(naics_key, - how='left', - left_on='Sector', - right_on='source_naics') - .assign(Sector=lambda x: x.target_naics) - .drop(columns=['source_naics', 'target_naics']) - .drop_duplicates() - ) + if self.config['sector_hierarchy'] == 'parent-child': + existing_sectors = activity_to_source_naics_crosswalk[['Sector']] + # load master crosswalk + cw = common.load_crosswalk('sector_timeseries') + sectors = (cw[['NAICS_2012_Code']] + .drop_duplicates() + .dropna() + ) + # create list of sectors that exist in original df, which, + # if created when expanding sector list cannot be added + + fba_w_naics = self + for direction in ['ProducedBy', 'ConsumedBy']: + naics_df = pd.DataFrame([]) + for i in existing_sectors['Sector']: + dig = len(str(i)) + n = existing_sectors[ + existing_sectors['Sector'].apply( + lambda x: x[0:dig]) == i] + if len(n) == 1: + expanded_n = sectors[ + sectors['NAICS_2012_Code'].apply( + lambda x: x[0:dig] == i)] + expanded_n = expanded_n.assign(Sector=i) + naics_df = pd.concat([naics_df, expanded_n]) + + activity_to_source_naics_crosswalk = ( + activity_to_source_naics_crosswalk + .merge(naics_df, how='left') + .assign(Sector=lambda x: np.where( + x['NAICS_2012_Code'].isna(), x['Sector'], + x['NAICS_2012_Code'])) + .drop(columns=['NAICS_2012_Code']) + ) + + fba_w_naics = ( + fba_w_naics + .merge(activity_to_source_naics_crosswalk, + how='left', + left_on=f'Activity{direction}', + right_on='Activity') + .rename(columns={'Sector': f'Sector{direction}', + 'SectorType': f'{direction}SectorType'}) + .drop(columns=['ActivitySourceName', + 'SectorSourceName', + 'Activity'], + errors='ignore') + ) + + target_naics = set( + naics.industry_spec_key(self.config['industry_spec']) + .target_naics) - log.info('Mapping activities in %s to NAICS codes using crosswalk', - self.full_name) - fba_w_naics = self - for direction in ['ProducedBy', 'ConsumedBy']: fba_w_naics = ( fba_w_naics - .merge(activity_to_target_naics_crosswalk, - how='left', - left_on=f'Activity{direction}', right_on='Activity') - .rename(columns={'Sector': f'Sector{direction}', - 'SectorType': f'{direction}SectorType'}) - .drop(columns=['ActivitySourceName', - 'SectorSourceName', - 'Activity'], - errors='ignore') + .query('SectorProducedBy in @target_naics ' + '| SectorConsumedBy in @target_naics') ) - if source_year != target_year: - log.info('Using NAICS time series/crosswalk to map NAICS codes ' - 'from NAICS year %s to NAICS year %s.', - source_year, target_year) - for direction in ['ProducedBy', 'ConsumedBy']: - fba_w_naics = ( - fba_w_naics - .merge(naics.year_crosswalk(source_year, target_year), + else: + activity_to_target_naics_crosswalk = ( + activity_to_source_naics_crosswalk + .merge(naics_key, how='left', - left_on=f'Sector{direction}', + left_on='Sector', right_on='source_naics') - .assign(**{f'Sector{direction}': lambda x: x.target_naics}) + .assign(Sector=lambda x: x.target_naics) .drop(columns=['source_naics', 'target_naics']) + .drop_duplicates() ) + log.info('Mapping activities in %s to NAICS codes using crosswalk', + self.full_name) + fba_w_naics = self + for direction in ['ProducedBy', 'ConsumedBy']: + fba_w_naics = ( + fba_w_naics + .merge(activity_to_target_naics_crosswalk, + how='left', + left_on=f'Activity{direction}', right_on='Activity') + .rename(columns={'Sector': f'Sector{direction}', + 'SectorType': f'{direction}SectorType'}) + .drop(columns=['ActivitySourceName', + 'SectorSourceName', + 'Activity'], + errors='ignore') + ) + + if source_year != target_year: + log.info('Using NAICS time series/crosswalk to map NAICS codes ' + 'from NAICS year %s to NAICS year %s.', + source_year, target_year) + for direction in ['ProducedBy', 'ConsumedBy']: + fba_w_naics = ( + fba_w_naics + .merge(naics.year_crosswalk(source_year, target_year), + how='left', + left_on=f'Sector{direction}', + right_on='source_naics') + .assign(**{f'Sector{direction}': lambda x: x.target_naics}) + .drop(columns=['source_naics', 'target_naics']) + ) + return ( fba_w_naics .assign(SectorSourceName=f'NAICS_{target_year}_Code') From a451011c39558a66a7fb5928e7cfb4734a233c4c Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 24 Jan 2023 15:19:53 -0500 Subject: [PATCH 0355/1127] drop second call to attribute_flows_to_sectors() --- flowsa/flowby.py | 1 - 1 file changed, 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index e44652803..5a7eae10a 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1612,7 +1612,6 @@ def prepare_fbs(self: 'FlowByActivity') -> 'FlowBySector': .function_socket('clean_fba') .attribute_flows_to_sectors() # recursive call to prepare_fbs .convert_to_geoscale() - .attribute_flows_to_sectors() # recursive call to prepare_fbs .drop(columns=['ActivityProducedBy', 'ActivityConsumedBy']) .aggregate_flowby() ) From 7ae0a6af456dcb5eaecc51ac6df31c0b47245105 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 25 Jan 2023 12:58:27 -0500 Subject: [PATCH 0356/1127] move activity to sector mapping out of for loop --- flowsa/flowby.py | 64 +++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 5a7eae10a..300b0b928 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1230,34 +1230,42 @@ def map_to_sectors( ) # create list of sectors that exist in original df, which, # if created when expanding sector list cannot be added + naics_df = pd.DataFrame([]) + for i in existing_sectors['Sector']: + dig = len(str(i)) + n = existing_sectors[ + existing_sectors['Sector'].apply( + lambda x: x[0:dig]) == i] + if len(n) == 1: + expanded_n = sectors[ + sectors['NAICS_2012_Code'].apply( + lambda x: x[0:dig] == i)] + expanded_n = expanded_n.assign(Sector=i) + naics_df = pd.concat([naics_df, expanded_n]) + + activity_to_source_naics_crosswalk = ( + activity_to_source_naics_crosswalk + .merge(naics_df, how='left') + .assign(Sector=lambda x: np.where( + x['NAICS_2012_Code'].isna(), x['Sector'], + x['NAICS_2012_Code'])) + .drop(columns=['NAICS_2012_Code']) + ) + + target_naics = set( + naics.industry_spec_key(self.config['industry_spec']) + .target_naics) + + activity_to_target_naics_crosswalk = ( + activity_to_source_naics_crosswalk + .query('Sector in @target_naics') + ) fba_w_naics = self for direction in ['ProducedBy', 'ConsumedBy']: - naics_df = pd.DataFrame([]) - for i in existing_sectors['Sector']: - dig = len(str(i)) - n = existing_sectors[ - existing_sectors['Sector'].apply( - lambda x: x[0:dig]) == i] - if len(n) == 1: - expanded_n = sectors[ - sectors['NAICS_2012_Code'].apply( - lambda x: x[0:dig] == i)] - expanded_n = expanded_n.assign(Sector=i) - naics_df = pd.concat([naics_df, expanded_n]) - - activity_to_source_naics_crosswalk = ( - activity_to_source_naics_crosswalk - .merge(naics_df, how='left') - .assign(Sector=lambda x: np.where( - x['NAICS_2012_Code'].isna(), x['Sector'], - x['NAICS_2012_Code'])) - .drop(columns=['NAICS_2012_Code']) - ) - fba_w_naics = ( fba_w_naics - .merge(activity_to_source_naics_crosswalk, + .merge(activity_to_target_naics_crosswalk, how='left', left_on=f'Activity{direction}', right_on='Activity') @@ -1269,16 +1277,6 @@ def map_to_sectors( errors='ignore') ) - target_naics = set( - naics.industry_spec_key(self.config['industry_spec']) - .target_naics) - - fba_w_naics = ( - fba_w_naics - .query('SectorProducedBy in @target_naics ' - '| SectorConsumedBy in @target_naics') - ) - else: activity_to_target_naics_crosswalk = ( activity_to_source_naics_crosswalk From 3b726e37d25ccde82d5ab8112827c3459c9b9986 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 25 Jan 2023 12:58:51 -0500 Subject: [PATCH 0357/1127] change sourcename to metadata for merge cols --- flowsa/validation.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/flowsa/validation.py b/flowsa/validation.py index c507f003a..cf990d706 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -1055,11 +1055,9 @@ def compare_geographic_totals( # depending on the datasource, might need to rename some # strings for national comparison sub = rename_column_values_for_comparison(sub, sourcename) - sub2 = aggregator(sub, fba_mapped_default_grouping_fields).rename( - columns={'FlowAmount': 'FlowAmount_sub'}) # compare df - merge_cols = ['Class', 'SourceName', 'Unit', + merge_cols = ['Class', 'MetaSources', 'Unit', 'FlowType', 'ActivityProducedBy', 'ActivityConsumedBy', 'Location', 'LocationSystem', 'Year'] From 3f5a6edf3e029ea266592c501c476e54e9b85b2e Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 25 Jan 2023 14:46:03 -0500 Subject: [PATCH 0358/1127] update parent-child to parent-completeChild --- flowsa/data/README.md | 12 +++++----- flowsa/data/source_catalog.yaml | 40 ++++++++++++++++----------------- flowsa/flowby.py | 8 +++---- flowsa/sectormapping.py | 2 +- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/flowsa/data/README.md b/flowsa/data/README.md index 431951493..48c0408e6 100644 --- a/flowsa/data/README.md +++ b/flowsa/data/README.md @@ -15,9 +15,9 @@ Flow-By-Activity. - _activity_schema_: 'None' if 'sector-like_activities' is False, otherwise the year of the sector data (ex. NAICS_2012_Code) -- _sector_hierarchy_: 'parent' or 'parent-child'. Some dataset - crosswalks contain every level of relevant sectors (ex. NAICS for 2-6 - digits), that is they are fully disaggregated. Other datasets only - contain information for the highest relevant sector level, in which case, - the dataset is marked as showing aggregated sectors only (e.g., - USGS_WU_Coef crosswalk). \ No newline at end of file +- _sector_hierarchy_: 'parent' or 'parent-completeChild' or + 'parent-incompleteChild'. Some dataset crosswalks contain every level of + relevant sectors (ex. NAICS for 2-6 digits), that is they are fully + disaggregated. Other datasets only contain information for the highest + relevant sector level, in which case, the dataset is marked as showing + aggregated sectors only (e.g., USGS_WU_Coef crosswalk). \ No newline at end of file diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 820a934ea..ce5b8c688 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -4,7 +4,7 @@ Blackhurst_IO: - Water sector-like_activities: False activity_schema: - sector_hierarchy: "parent-child" + sector_hierarchy: "parent-completeChild" BLM_PLS: data_format: FBA class: @@ -18,35 +18,35 @@ BEA_GDP: - Money sector-like_activities: False # activity_schema: BEA_2012_Detail_Code - sector_hierarchy: "parent-child" + sector_hierarchy: "parent-completeChild" BEA_GDP_GrossOutput: data_format: FBA class: - Money sector-like_activities: False # activity_schema: BEA_2012_Detail_Code - sector_hierarchy: "parent-child" + sector_hierarchy: "parent-completeChild" BEA_Use: data_format: FBA class: - Money sector-like_activities: False #update to true once alternate activity_schema in place # activity_schema: BEA_2012_Detail_Code - sector_hierarchy: "parent-child" + sector_hierarchy: "parent-completeChild" BEA_Use_Detail_PRO_BeforeRedef: data_format: FBA class: - Money sector-like_activities: False #update to true once alternate activity_schema in place # activity_schema: BEA_2012_Detail_Code - sector_hierarchy: "parent-child" + sector_hierarchy: "parent-completeChild" BEA_Make_Detail_BeforeRedef: data_format: FBA class: - Money sector-like_activities: False #update to true once alternate activity_schema in place # activity_schema: BEA_2012_Detail_Code - sector_hierarchy: "parent-child" + sector_hierarchy: "parent-completeChild" BEA_Marine_Bunker_Fuel: data_format: FBA class: @@ -61,7 +61,7 @@ BLS_QCEW: - Other sector-like_activities: True activity_schema: NAICS_2012_Code - sector_hierarchy: "parent-child" + sector_hierarchy: "parent-completeChild" BTS_TSA: data_format: FBA sector-like_activities: False @@ -80,7 +80,7 @@ Census_ASM: - Money sector-like_activities: True activity_schema: None # Codes for 2018 are NAICS_2017_Code - sector_hierarchy: "parent-child" + sector_hierarchy: "parent-completeChild" Census_CBP: data_format: FBA class: @@ -89,7 +89,7 @@ Census_CBP: - Other sector-like_activities: True activity_schema: NAICS_2012_Code - sector_hierarchy: "parent-child" + sector_hierarchy: "parent-completeChild" Census_PEP_Population: data_format: FBA class: Other @@ -102,7 +102,7 @@ Census_QWI: - Employment sector-like_activities: True activity_schema: NAICS_2012_Code - sector_hierarchy: "parent-child" + sector_hierarchy: "parent-completeChild" Census_VIP: data_format: FBA class: Money @@ -135,21 +135,21 @@ EIA_MECS_Energy: - Money sector-like_activities: True activity_schema: NAICS_2012_Code - sector_hierarchy: "parent-child" + sector_hierarchy: "parent-completeChild" EIA_MECS_Land: data_format: FBA class: - Land sector-like_activities: True activity_schema: - sector_hierarchy: "parent-child" + sector_hierarchy: "parent-completeChild" EIA_MER: data_format: FBA class: - Energy sector-like_activities: False activity_schema: - sector_hierarchy: "parent-child" + sector_hierarchy: "parent-completeChild" EIA_SEDS: data_format: FBA class: @@ -165,7 +165,7 @@ Employment_national: - Other sector-like_activities: True activity_schema: NAICS_2012_Code - sector_hierarchy: "parent-child" + sector_hierarchy: "parent-completeChild" EPA_CDDPath: data_format: FBA class: @@ -204,7 +204,7 @@ EPA_REI: - Other sector-like_activities: False activity_schema: None - sector_hierarchy: "parent-child" + sector_hierarchy: "parent-completeChild" EPA_StateGHGI: class: - Chemicals @@ -271,7 +271,7 @@ StatCan_GDP: - Money sector-like_activities: True activity_schema: NAICS_2012_Code - sector_hierarchy: "parent-child" + sector_hierarchy: "parent-completeChild" StatCan_IWS_MI: class: - Water @@ -289,7 +289,7 @@ stateio: - Money sector-like_activities: False #update to true once alternate activity_schema in place # activity_schema: BEA_2012_Summary_Code - sector_hierarchy: "parent-child" + sector_hierarchy: "parent-completeChild" USDA_CoA_Cropland: data_format: FBA class: @@ -297,21 +297,21 @@ USDA_CoA_Cropland: - Other sector-like_activities: False activity_schema: - sector_hierarchy: "parent-child" + sector_hierarchy: "parent-completeChild" USDA_CoA_Cropland_NAICS: data_format: FBA class: - Land sector-like_activities: True activity_schema: NAICS_2012_Code - sector_hierarchy: "parent-child" + sector_hierarchy: "parent-completeChild" USDA_CoA_Livestock: data_format: FBA class: - Other sector-like_activities: False activity_schema: - sector_hierarchy: "parent-child" + sector_hierarchy: "parent-completeChild" USDA_ERS_FIWS: data_format: FBA class: diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 300b0b928..3c412fbfa 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1143,9 +1143,9 @@ def map_to_sectors( # todo: expand on this start. There will be cases where although data is disaggregated, # there might not be all mappings (might stop at NAICS5 in df because NAICS6 is just NAICS5 with added 0) - if self.config['sector_hierarchy'] == 'parent-child': - log.info('NAICS are a mix of parent-child, assigning activity ' - 'columns directly to sector columns') + if self.config['sector_hierarchy'] == 'parent-completeChild': + log.info('NAICS are a mix of parent-completeChild, assigning ' + 'activity columns directly to sector columns') target_naics = set( naics.industry_spec_key(self.config['industry_spec']) .target_naics) @@ -1220,7 +1220,7 @@ def map_to_sectors( log.info('Converting NAICS codes in crosswalk to desired ' 'industry/sector aggregation structure.') - if self.config['sector_hierarchy'] == 'parent-child': + if self.config['sector_hierarchy'] == 'parent-completeChild': existing_sectors = activity_to_source_naics_crosswalk[['Sector']] # load master crosswalk cw = common.load_crosswalk('sector_timeseries') diff --git a/flowsa/sectormapping.py b/flowsa/sectormapping.py index 1edef59c9..843b1e7e2 100644 --- a/flowsa/sectormapping.py +++ b/flowsa/sectormapping.py @@ -90,7 +90,7 @@ def add_sectors_to_flowbyactivity( # if the FBS activity set is 'direct', overwrite the # levelofsectoragg, or if specified in fxn call if allocationmethod == 'direct': - levelofSectoragg = 'parent-child' + levelofSectoragg = 'parent-completeChild' if overwrite_sectorlevel is not None: levelofSectoragg = overwrite_sectorlevel # if data are provided in NAICS format, use the mastercrosswalk From 29bfe7d3678e7dc9db99bd48f6512da92597e430 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 27 Jan 2023 11:10:50 -0500 Subject: [PATCH 0359/1127] initial code to add usda coa cropland naics as attribution source for usda cropland - not working correctly --- .../Water_national_2015_m1.yaml | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index 1ef877a95..1d2dd4c9f 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -54,14 +54,24 @@ source_names: - "AREA, IRRIGATED" - 'AREA BEARING & NON-BEARING, IRRIGATED' - 'AREA GROWN, IRRIGATED' - clean_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics_for_water_withdrawal - attribution_method: multiplication +# clean_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics_for_water_withdrawal + attribution_method: proportional attribution_source: - USDA_IWMS: - year: 2018 + USDA_CoA_Cropland_NAICS: + year: 2017 + # todo: add activity set where don't include 1125 or any parent sectors selection_fields: - Class: Water - clean_fba_wsec: !script_function:USDA_IWMS iwms_aggregation + Class: Land + FlowName: + - "FARM OPERATIONS" + - "AG LAND, CROPLAND, HARVESTED" + attribution_method: multiplication + attribution_source: + USDA_IWMS: + year: 2018 + selection_fields: + Class: Water + clean_fba_wsec: !script_function:USDA_IWMS iwms_aggregation livestock_attribution: selection_fields: PrimaryActivity: From 0593f744268c325e9a65fef4856f79081369d566 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 27 Jan 2023 11:12:44 -0500 Subject: [PATCH 0360/1127] move convert_to_geoscale() back to before attribute_flows_to_sectors - we will estimate suppressed data immediately after loading an FBA --- flowsa/flowby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 3c412fbfa..b88a71003 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1608,8 +1608,8 @@ def prepare_fbs(self: 'FlowByActivity') -> 'FlowBySector': .function_socket('estimate_suppressed') .convert_units_and_flows() # and also map to flow lists .function_socket('clean_fba') - .attribute_flows_to_sectors() # recursive call to prepare_fbs .convert_to_geoscale() + .attribute_flows_to_sectors() # recursive call to prepare_fbs .drop(columns=['ActivityProducedBy', 'ActivityConsumedBy']) .aggregate_flowby() ) From 7194477d3f2cf2c9896e9fb3bd8aa4385b6d0687 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 27 Jan 2023 11:13:50 -0500 Subject: [PATCH 0361/1127] change metadata back to sourcename because moved when data aggregated by geoscale --- flowsa/validation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flowsa/validation.py b/flowsa/validation.py index cf990d706..e646c86c0 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -1057,9 +1057,9 @@ def compare_geographic_totals( sub = rename_column_values_for_comparison(sub, sourcename) # compare df - merge_cols = ['Class', 'MetaSources', 'Unit', - 'FlowType', 'ActivityProducedBy', 'ActivityConsumedBy', - 'Location', 'LocationSystem', 'Year'] + merge_cols = ['Class', 'SourceName', 'Unit', 'FlowType', + 'ActivityProducedBy', 'ActivityConsumedBy', + 'Location', 'LocationSystem', 'Year'] if df_type == 'FBA': merge_cols.extend(['FlowName', 'Compartment']) From 86f4337b1e7c6757dc8f218399a531bba17e5c13 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 7 Feb 2023 11:00:26 -0700 Subject: [PATCH 0362/1127] first attempt at activity sets for attribution source for cropland --- .../Water_national_2015_m1.yaml | 100 ++++++++++++++---- 1 file changed, 78 insertions(+), 22 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index 1d2dd4c9f..72452888c 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -46,32 +46,88 @@ source_names: '111199': { default: NAICS_7 } '111940': { default: NAICS_7 } year: 2017 - selection_fields: - Class: "Land" - FlowName: - - "AREA HARVESTED, IRRIGATED" - - "AREA IN PRODUCTION, IRRIGATED" - - "AREA, IRRIGATED" - - 'AREA BEARING & NON-BEARING, IRRIGATED' - - 'AREA GROWN, IRRIGATED' -# clean_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics_for_water_withdrawal - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland_NAICS: - year: 2017 - # todo: add activity set where don't include 1125 or any parent sectors + activity_sets: + cropland_attribution-pastureland: + selection_fields: + Class: "Land" + FlowName: + - "AREA HARVESTED, IRRIGATED" + - "AREA IN PRODUCTION, IRRIGATED" + - "AREA, IRRIGATED" + - 'AREA BEARING & NON-BEARING, IRRIGATED' + - 'AREA GROWN, IRRIGATED' + PrimaryActivity: 'AG LAND, (EXCL HARVESTED CROPLAND)' + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + # todo: estimate suppressed data + year: 2017 + selection_fields: + Class: Land + FlowName: + - "FARM OPERATIONS" + PrimaryActivity: ["112111", "112112", "11212", "1122", + "11231", "11232", "11233", "11234", + "11239", "11241", "11242", "11291", + "11292", "11293", "11299"] + attribution_method: multiplication + attribution_source: + USDA_IWMS: + year: 2018 + selection_fields: + Class: Water + clean_fba_wsec: !script_function:USDA_IWMS iwms_aggregation + cropland_attribution-cropland: selection_fields: - Class: Land + Class: "Land" FlowName: - - "FARM OPERATIONS" - - "AG LAND, CROPLAND, HARVESTED" - attribution_method: multiplication + - "AREA HARVESTED, IRRIGATED" + - "AREA IN PRODUCTION, IRRIGATED" + - "AREA, IRRIGATED" + - 'AREA BEARING & NON-BEARING, IRRIGATED' + - 'AREA GROWN, IRRIGATED' + PrimaryActivity: ['SOYBEANS', 'CANOLA', 'FLAXSEED', + 'MUSTARD, SEED', 'RAPESEED', + 'SAFFLOWER', 'SESAME', 'SUNFLOWER', + 'CAMELINA', 'BEANS, DRY EDIBLE, (EXCL + LIMA), INCL CHICKPEAS', 'BEANS, DRY + EDIBLE, (EXCL CHICKPEAS & LIMA)', + 'BEANS, DRY EDIBLE, LIMA', 'CHICKPEAS', 'LENTILS', + 'PEAS, DRY EDIBLE', 'PEAS, DRY, SOUTHERN (COWPEAS)', + 'WHEAT', 'CORN', 'CORN, GRAIN', 'CORN, SILAGE', + 'POPCORN, SHELLED', 'RICE', 'BARLEY', 'BUCKWHEAT', + 'MILLET, PROSO', 'OATS', 'RYE', 'SORGHUM, GRAIN', + 'SORGHUM, SILAGE', 'SORGHUM, SYRUP', 'TRITICALE', 'WILD + RICE', 'EMMER & SPELT', 'VEGETABLE TOTALS', 'ORCHARDS', + 'BERRY TOTALS', 'CUT CHRISTMAS TREES', 'SHORT TERM WOODY + CROPS', 'TOBACCO', 'COTTON', 'SUGARCANE, SUGAR', + 'SUGARCANE, SEED', 'HAY & HAYLAGE', 'SUGARBEETS', + 'SUGARBEETS, SEED', 'PEANUTS', 'DILL, OIL', 'GRASSES & + LEGUMES TOTALS, SEED', 'GUAR', 'HERBS, DRY', 'HOPS', + 'JOJOBA', 'MINT, OIL', 'MISCANTHUS', 'MINT, TEA LEAVES', + 'SWITCHGRASS', 'FIELD CROPS, OTHER'] + attribution_method: proportional attribution_source: - USDA_IWMS: - year: 2018 + USDA_CoA_Cropland_NAICS: + # todo: estimate suppressed NAICS + year: 2017 selection_fields: - Class: Water - clean_fba_wsec: !script_function:USDA_IWMS iwms_aggregation + Class: Land + FlowName: + - "AG LAND, CROPLAND, HARVESTED" + PrimaryActivity: ["11111", "11113", "11114", "11115", + "11116", "11119", "11131", "11132", + "111331", "111332", "111333", "111334", + "111335", "111336", "111339", "11141", + "111421", "111422", "11191", "11192", + "11193", "11194", "11199"] + attribution_method: multiplication + attribution_source: + USDA_IWMS: + year: 2018 + selection_fields: + Class: Water + clean_fba_wsec: !script_function:USDA_IWMS iwms_aggregation livestock_attribution: selection_fields: PrimaryActivity: From eff929cb27d9a2b9323ccfa309a1a79fdec3bccb Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 7 Feb 2023 12:13:29 -0700 Subject: [PATCH 0363/1127] move where return fba if no attribution is needed because fba meets sector level - allow for use of multiplication --- flowsa/flowby.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index b88a71003..72d3f5fcf 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1046,11 +1046,6 @@ def attribute_flows_to_sectors( .rename(columns={'SourceName': 'MetaSources'}) ) - if all(fba.groupby('group_id')['group_id'].agg('count') == 1): - log.info('No attribution needed for %s at the given industry ' - 'aggregation level', fba.full_name) - return fba.drop(columns=['group_id', 'group_total']) - attribution_method = fba.config.get('attribution_method') if attribution_method == 'proportional': @@ -1061,10 +1056,12 @@ def attribute_flows_to_sectors( attribution_fbs = fba.load_prepare_attribution_source() attributed_fba = fba.multiplication_attribution(attribution_fbs) - # elif attribution_method == 'proportional-flagged': - # attributed_fba = fba.flagged_proportionally_attribute90 - else: + if all(fba.groupby('group_id')['group_id'].agg('count') == 1): + log.info('No attribution needed for %s at the given industry ' + 'aggregation level', fba.full_name) + return fba.drop(columns=['group_id', 'group_total']) + if attribution_method is None: log.warning('No attribution method specified for %s. ' 'Using equal attribution as default.', @@ -1616,7 +1613,7 @@ def prepare_fbs(self: 'FlowByActivity') -> 'FlowBySector': def activity_sets(self) -> List['FlowByActivity']: ''' - This function breaks up an FBA datset into its activity sets, if its + This function breaks up an FBA dataset into its activity sets, if its config dictionary specifies activity sets, and returns a list of the resulting FBAs. Otherwise, it returns a list containing the calling FBA. From 677f4edab4f8be8cd7d22797afe14f33ca2cb5c6 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 7 Feb 2023 13:48:17 -0700 Subject: [PATCH 0364/1127] move where industry_spec defined --- .../Water_national_2015_m1.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index 72452888c..d27e06df1 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -34,17 +34,17 @@ source_names: data_format: FBS year: 2015 cropland_attribution: + industry_spec: + default: NAICS_6 + '111150': { default: NAICS_7 } + '111199': { default: NAICS_7 } + '111940': { default: NAICS_7 } selection_fields: PrimaryActivity: - "Irrigation Crop" attribution_method: proportional attribution_source: USDA_CoA_Cropland: - industry_spec: - default: NAICS_6 - '111150': { default: NAICS_7 } - '111199': { default: NAICS_7 } - '111940': { default: NAICS_7 } year: 2017 activity_sets: cropland_attribution-pastureland: @@ -89,20 +89,20 @@ source_names: PrimaryActivity: ['SOYBEANS', 'CANOLA', 'FLAXSEED', 'MUSTARD, SEED', 'RAPESEED', 'SAFFLOWER', 'SESAME', 'SUNFLOWER', - 'CAMELINA', 'BEANS, DRY EDIBLE, (EXCL - LIMA), INCL CHICKPEAS', 'BEANS, DRY + 'CAMELINA', 'BEANS, DRY EDIBLE, (EXCL + LIMA), INCL CHICKPEAS', 'BEANS, DRY EDIBLE, (EXCL CHICKPEAS & LIMA)', 'BEANS, DRY EDIBLE, LIMA', 'CHICKPEAS', 'LENTILS', 'PEAS, DRY EDIBLE', 'PEAS, DRY, SOUTHERN (COWPEAS)', 'WHEAT', 'CORN', 'CORN, GRAIN', 'CORN, SILAGE', 'POPCORN, SHELLED', 'RICE', 'BARLEY', 'BUCKWHEAT', 'MILLET, PROSO', 'OATS', 'RYE', 'SORGHUM, GRAIN', - 'SORGHUM, SILAGE', 'SORGHUM, SYRUP', 'TRITICALE', 'WILD + 'SORGHUM, SILAGE', 'SORGHUM, SYRUP', 'TRITICALE', 'WILD RICE', 'EMMER & SPELT', 'VEGETABLE TOTALS', 'ORCHARDS', 'BERRY TOTALS', 'CUT CHRISTMAS TREES', 'SHORT TERM WOODY CROPS', 'TOBACCO', 'COTTON', 'SUGARCANE, SUGAR', 'SUGARCANE, SEED', 'HAY & HAYLAGE', 'SUGARBEETS', - 'SUGARBEETS, SEED', 'PEANUTS', 'DILL, OIL', 'GRASSES & + 'SUGARBEETS, SEED', 'PEANUTS', 'DILL, OIL', 'GRASSES & LEGUMES TOTALS, SEED', 'GUAR', 'HERBS, DRY', 'HOPS', 'JOJOBA', 'MINT, OIL', 'MISCANTHUS', 'MINT, TEA LEAVES', 'SWITCHGRASS', 'FIELD CROPS, OTHER'] From 9a3e2591c8e93d22b48e57fd69c7297233849dd0 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 7 Feb 2023 13:56:37 -0700 Subject: [PATCH 0365/1127] update how sector-like activities are mapped to sectors if parent-childComplete --- flowsa/flowby.py | 96 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 72 insertions(+), 24 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 72d3f5fcf..e6f23f8df 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1095,11 +1095,11 @@ def attribute_flows_to_sectors( return attributed_fba.drop(columns=['group_id', 'group_total']) def map_to_sectors( - self: 'FlowByActivity', - target_year: Literal[2002, 2007, 2012, 2017] = 2012, - external_config_path: str = None + self: 'FlowByActivity', + target_year: Literal[2002, 2007, 2012, 2017] = 2012, + external_config_path: str = None ) -> 'FlowByActivity': - ''' + """ Maps the activities in the calling dataframe to industries/sectors, but does not perform any attribution. Columns for SectorProducedBy and SectorConsumedBy are added to the FBA. Each activity may be matched @@ -1120,7 +1120,7 @@ def map_to_sectors( :param target_year: int, which NAICS year to use. :param external_config_path: str, an external path to search for a crosswalk. - ''' + """ naics_key = naics.industry_spec_key(self.config['industry_spec']) if self.config['sector-like_activities']: @@ -1138,29 +1138,75 @@ def map_to_sectors( log.info('NAICS Activities in %s use NAICS year %s.', self.full_name, source_year) - # todo: expand on this start. There will be cases where although data is disaggregated, - # there might not be all mappings (might stop at NAICS5 in df because NAICS6 is just NAICS5 with added 0) if self.config['sector_hierarchy'] == 'parent-completeChild': log.info('NAICS are a mix of parent-completeChild, assigning ' 'activity columns directly to sector columns') + + # existing naics + existing_sectors = pd.DataFrame() + existing_sectors['Sector'] = ( + pd.Series(self[['ActivityProducedBy', + 'ActivityConsumedBy']].values.ravel('F')) + .dropna() + .drop_duplicates() + .reset_index(drop=True) + ) + existing_sectors['Activity'] = existing_sectors['Sector'] + + # load master crosswalk + cw = common.load_crosswalk('sector_timeseries') + sectors = (cw[['NAICS_2012_Code']] + .drop_duplicates() + .dropna() + ) + # create list of sectors that exist in original df, which, + # if created when expanding sector list cannot be added + naics_df = pd.DataFrame([]) + for i in existing_sectors['Sector']: + dig = len(str(i)) + n = existing_sectors[ + existing_sectors['Sector'].apply( + lambda x: x[0:dig]) == i] + if len(n) == 1: + expanded_n = sectors[ + sectors['NAICS_2012_Code'].apply( + lambda x: x[0:dig] == i)] + expanded_n = expanded_n.assign(Sector=i) + naics_df = pd.concat([naics_df, expanded_n]) + + activity_to_source_naics_crosswalk = ( + existing_sectors + .merge(naics_df, how='left') + .assign(Sector=lambda x: np.where( + x['NAICS_2012_Code'].isna(), x['Sector'], + x['NAICS_2012_Code'])) + .drop(columns=['NAICS_2012_Code']) + ) + target_naics = set( naics.industry_spec_key(self.config['industry_spec']) .target_naics) + + activity_to_target_naics_crosswalk = ( + activity_to_source_naics_crosswalk + .query('Sector in @target_naics') + ) + fba_w_naics = self for direction in ['ProducedBy', 'ConsumedBy']: fba_w_naics = ( fba_w_naics - .assign(**{f'Sector{direction}': fba_w_naics[f'Activity{direction}'].mask( - (fba_w_naics[f'Activity{direction}']).isin(target_naics), - fba_w_naics[f'Activity{direction}'] - )})) - fba_w_naics = ( - fba_w_naics - .assign(ActivitySourceName=fba_w_naics.source_name, - SectorType=np.nan) - .query('SectorProducedBy in @target_naics ' - '| SectorConsumedBy in @target_naics') - ) + .merge(activity_to_target_naics_crosswalk, + how='left', + left_on=f'Activity{direction}', + right_on='Activity') + .rename(columns={'Sector': f'Sector{direction}', + 'SectorType': f'{direction}SectorType'}) + .drop(columns=['ActivitySourceName', + 'SectorSourceName', + 'Activity'], + errors='ignore') + ) else: # if sector-like activities are aggregated, then map all # sectors to target sector level @@ -1218,7 +1264,8 @@ def map_to_sectors( log.info('Converting NAICS codes in crosswalk to desired ' 'industry/sector aggregation structure.') if self.config['sector_hierarchy'] == 'parent-completeChild': - existing_sectors = activity_to_source_naics_crosswalk[['Sector']] + existing_sectors = activity_to_source_naics_crosswalk[ + ['Sector']] # load master crosswalk cw = common.load_crosswalk('sector_timeseries') sectors = (cw[['NAICS_2012_Code']] @@ -1286,15 +1333,16 @@ def map_to_sectors( .drop_duplicates() ) - log.info('Mapping activities in %s to NAICS codes using crosswalk', - self.full_name) + log.info('Mapping activities in %s to NAICS codes using ' + 'crosswalk', self.full_name) fba_w_naics = self for direction in ['ProducedBy', 'ConsumedBy']: fba_w_naics = ( fba_w_naics .merge(activity_to_target_naics_crosswalk, how='left', - left_on=f'Activity{direction}', right_on='Activity') + left_on=f'Activity{direction}', + right_on='Activity') .rename(columns={'Sector': f'Sector{direction}', 'SectorType': f'{direction}SectorType'}) .drop(columns=['ActivitySourceName', @@ -1304,8 +1352,8 @@ def map_to_sectors( ) if source_year != target_year: - log.info('Using NAICS time series/crosswalk to map NAICS codes ' - 'from NAICS year %s to NAICS year %s.', + log.info('Using NAICS time series/crosswalk to map NAICS ' + 'codes from NAICS year %s to NAICS year %s.', source_year, target_year) for direction in ['ProducedBy', 'ConsumedBy']: fba_w_naics = ( From 66df63b7e5b70fd712e86dfa530b1945855f7b77 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 8 Feb 2023 09:13:03 -0700 Subject: [PATCH 0366/1127] in sector mapping, only keep activities in activity to mapping crosswalk if the activities are in the fba --- flowsa/flowby.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index e6f23f8df..e7f4841c3 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1261,6 +1261,23 @@ def map_to_sectors( .reset_index(drop=True) ) + # only retain the activities in the crosswalk that exist in + # the FBA. Necessary because the crosswalk could contain parent + # to child relationships that do not exist in the FBA subset and + # if those parent-child relationships are kept in the crosswalk, + # the FBA could be mapped incorrectly + activities_in_fba = (pd.Series(self[['ActivityProducedBy', + 'ActivityConsumedBy']] + .values.ravel('F')) + .dropna() + .drop_duplicates() + .values.tolist() + ) + activity_to_source_naics_crosswalk = \ + activity_to_source_naics_crosswalk[ + activity_to_source_naics_crosswalk['Activity'].isin( + activities_in_fba)] + log.info('Converting NAICS codes in crosswalk to desired ' 'industry/sector aggregation structure.') if self.config['sector_hierarchy'] == 'parent-completeChild': From f3a2e000d7ea0a0b763e936cef5a5efa3148df7c Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 8 Feb 2023 09:13:30 -0700 Subject: [PATCH 0367/1127] add sectors to primaryactivity selection fields --- .../Water_national_2015_m1.yaml | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index d27e06df1..9e72e72b1 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -115,10 +115,12 @@ source_names: Class: Land FlowName: - "AG LAND, CROPLAND, HARVESTED" - PrimaryActivity: ["11111", "11113", "11114", "11115", - "11116", "11119", "11131", "11132", - "111331", "111332", "111333", "111334", - "111335", "111336", "111339", "11141", + PrimaryActivity: ["11111", "11112", "11113", "11114", + "11115", "11116", "11119", "111211", + "111219", "11131", + "11132", "111331", "111332", + "111333", "111334", "111335", + "111336", "111339", "11141", "111421", "111422", "11191", "11192", "11193", "11194", "11199"] attribution_method: multiplication @@ -129,21 +131,21 @@ source_names: Class: Water clean_fba_wsec: !script_function:USDA_IWMS iwms_aggregation livestock_attribution: + industry_spec: + default: NAICS_6 + '112130': { default: NAICS_7 } + '112320': { default: NAICS_7 } + '112390': { default: NAICS_7 } + '112910': { default: NAICS_7 } + '112920': { default: NAICS_7 } + '112930': { default: NAICS_7 } + '112990': { default: NAICS_7 } selection_fields: PrimaryActivity: - "Livestock" attribution_method: proportional attribution_source: USDA_CoA_Livestock: - industry_spec: - default: NAICS_6 - '112130': { default: NAICS_7 } - '112320': { default: NAICS_7 } - '112390': { default: NAICS_7 } - '112910': { default: NAICS_7 } - '112920': { default: NAICS_7 } - '112930': { default: NAICS_7 } - '112990': { default: NAICS_7 } year: 2017 selection_fields: Class: Other From d1ea1b0f6d928fe4985819c648643cfa98b65450 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 8 Feb 2023 09:13:56 -0700 Subject: [PATCH 0368/1127] spelling --- flowsa/validation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/validation.py b/flowsa/validation.py index e646c86c0..d3c13fe5d 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -1069,7 +1069,7 @@ def compare_geographic_totals( sub2 = aggregator(sub, merge_cols).rename( columns={'FlowAmount': 'FlowAmount_sub'}) - # comapare units + # compare units compare_df_units(nat, sub2) df_m = pd.merge(nat[merge_cols + ['FlowAmount_nat']], sub2[merge_cols + ['FlowAmount_sub']], From c58a24d166830aa99cd791cc945931ee2f7af2b3 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 9 Feb 2023 08:43:24 -0700 Subject: [PATCH 0369/1127] update map_to_sectors() so if naics in mapping file is more aggregated to target naics the data is not dropped --- flowsa/flowby.py | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index e7f4841c3..1b39f5061 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1283,12 +1283,7 @@ def map_to_sectors( if self.config['sector_hierarchy'] == 'parent-completeChild': existing_sectors = activity_to_source_naics_crosswalk[ ['Sector']] - # load master crosswalk - cw = common.load_crosswalk('sector_timeseries') - sectors = (cw[['NAICS_2012_Code']] - .drop_duplicates() - .dropna() - ) + # create list of sectors that exist in original df, which, # if created when expanding sector list cannot be added naics_df = pd.DataFrame([]) @@ -1298,28 +1293,15 @@ def map_to_sectors( existing_sectors['Sector'].apply( lambda x: x[0:dig]) == i] if len(n) == 1: - expanded_n = sectors[ - sectors['NAICS_2012_Code'].apply( - lambda x: x[0:dig] == i)] - expanded_n = expanded_n.assign(Sector=i) + expanded_n = naics_key[naics_key['source_naics'] == i] naics_df = pd.concat([naics_df, expanded_n]) - activity_to_source_naics_crosswalk = ( - activity_to_source_naics_crosswalk - .merge(naics_df, how='left') - .assign(Sector=lambda x: np.where( - x['NAICS_2012_Code'].isna(), x['Sector'], - x['NAICS_2012_Code'])) - .drop(columns=['NAICS_2012_Code']) - ) - - target_naics = set( - naics.industry_spec_key(self.config['industry_spec']) - .target_naics) - activity_to_target_naics_crosswalk = ( activity_to_source_naics_crosswalk - .query('Sector in @target_naics') + .merge(naics_df, how='left', left_on='Sector', + right_on='source_naics') + .assign(Sector=lambda x: x['target_naics']) + .drop(columns=['source_naics', 'target_naics']) ) fba_w_naics = self From 954dd46a54d54ff7e8be6fa4d0ba3a150f2e0abd Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 9 Feb 2023 11:15:52 -0700 Subject: [PATCH 0370/1127] estimate suppressed usda coa naics for wat fbs m1 --- .../temp_data_source_functions.py | 89 +++++++++++++++++++ .../Water_national_2015_m1.yaml | 2 + 2 files changed, 91 insertions(+) diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index 5545b6b97..cb3fca871 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -473,3 +473,92 @@ def disaggregate_coa_cropland_to_6_digit_naics(fba: FlowByActivity): setattr(new_fba, attr, attributes_to_save[attr]) return new_fba + +def return_primary_activity_column(fba: FlowByActivity) -> \ + FlowByActivity: + """ + Determine activitiy column with values + :param fba: fbs df with two sector columns + :return: string, primary sector column + """ + if fba['ActivityProducedBy'].isnull().all(): + primary_column = 'ActivityConsumedBy' + elif fba['ActivityConsumedBy'].isnull().all(): + primary_column = 'ActivityProducedBy' + else: + log.error('Could not determine primary activity column as there ' + 'are values in both ActivityProducedBy and ' + 'ActivityConsumedBy') + return primary_column + +def estimate_suppressed_sectors_equal_attribution(fba: FlowByActivity) -> \ + FlowByActivity: + + col = return_primary_activity_column(fba) + indexed = ( + fba + .assign(n2=fba[col].str.slice(stop=2), + n3=fba[col].str.slice(stop=3), + n4=fba[col].str.slice(stop=4), + n5=fba[col].str.slice(stop=5), + n6=fba[col].str.slice(stop=6), + n7=fba[col].str.slice(stop=7), + location=fba.Location, + category=fba.FlowName) + .replace({'FlowAmount': {0: np.nan}}) + .set_index(['n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'location', + 'category'], verify_integrity=True) + ) + + def fill_suppressed( + flows: pd.Series, + level: int, + full_naics: pd.Series + ) -> pd.Series: + parent = flows[full_naics.str.len() == level] + children = flows[full_naics.str.len() == level + 1] + null_children = children[children.isna()] + + if null_children.empty or parent.empty: + return flows + else: + value = max((parent[0] - children.sum()) / null_children.size, 0) + return flows.fillna(pd.Series(value, index=null_children.index)) + + unsuppressed = ( + indexed + .assign( + FlowAmount=lambda x: ( + x.groupby(level=['n2', + 'location', 'category'])['FlowAmount'] + .transform(fill_suppressed, 2, x.ActivityProducedBy))) + .assign( + FlowAmount=lambda x: ( + x.groupby(level=['n2', 'n3', + 'location', 'category'])['FlowAmount'] + .transform(fill_suppressed, 3, x.ActivityProducedBy))) + .assign( + FlowAmount=lambda x: ( + x.groupby(level=['n2', 'n3', 'n4', + 'location', 'category'])['FlowAmount'] + .transform(fill_suppressed, 4, x.ActivityProducedBy))) + .assign( + FlowAmount=lambda x: ( + x.groupby(level=['n2', 'n3', 'n4', 'n5', + 'location', 'category'])['FlowAmount'] + .transform(fill_suppressed, 5, x.ActivityProducedBy))) + .assign( + FlowAmount=lambda x: ( + x.groupby(level=['n2', 'n3', 'n4', 'n5', 'n6', + 'location', 'category'])['FlowAmount'] + .transform(fill_suppressed, 6, x.ActivityProducedBy))) + .fillna({'FlowAmount': 0}) + .reset_index(drop=True) + ) + + aggregated = ( + unsuppressed + .aggregate_flowby() + ) + + return aggregated diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index 9e72e72b1..1aaf1a59d 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -70,6 +70,7 @@ source_names: "11231", "11232", "11233", "11234", "11239", "11241", "11242", "11291", "11292", "11293", "11299"] + estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_sectors_equal_attribution attribution_method: multiplication attribution_source: USDA_IWMS: @@ -123,6 +124,7 @@ source_names: "111336", "111339", "11141", "111421", "111422", "11191", "11192", "11193", "11194", "11199"] + estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_sectors_equal_attribution attribution_method: multiplication attribution_source: USDA_IWMS: From edc474b6ca84fa935932fcc4c73def54d5c05304 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 14 Feb 2023 09:15:49 -0500 Subject: [PATCH 0371/1127] Added entry to source_catalog.yaml --- flowsa/data/source_catalog.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 745cfcbd4..7f190f8c7 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -213,6 +213,7 @@ EPA_NEI_Nonroad: activity_schema: SCC sector_aggregation_level: "aggregated" EPA_NEI_Onroad: + data_format: FBA class: - Chemicals sector-like_activities: False From 953063d8a9e7613c842c07514bfa4ae3df78a78d Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 16 Feb 2023 11:39:43 -0700 Subject: [PATCH 0372/1127] for usgs, convert bgal/d to mgal/d before cleaning up FBA for water attribution --- flowsa/data_source_scripts/USGS_NWIS_WU.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flowsa/data_source_scripts/USGS_NWIS_WU.py b/flowsa/data_source_scripts/USGS_NWIS_WU.py index 30a7b99fa..9530b7815 100644 --- a/flowsa/data_source_scripts/USGS_NWIS_WU.py +++ b/flowsa/data_source_scripts/USGS_NWIS_WU.py @@ -361,7 +361,10 @@ def usgs_fba_data_cleanup(fba: FlowByActivity) -> FlowByActivity: :param fba: df, FBA format :return: df, modified FBA """ - + vLogDetailed.info('Converting Bgal/d to Mgal/d') + fba['FlowAmount'] = np.where(fba['Unit'] == 'Bgal/d', + fba['FlowAmount'] * 1000, fba['FlowAmount']) + fba['Unit'] = np.where(fba['Unit'] == 'Bgal/d', 'Mgal/d', fba['Unit']) # drop rows of commercial data (because only exists for 3 states), # causes issues because linked with public supply # also drop closed-loop or once-through cooling (thermoelectric power) From 6fa092f08132753bc07d872282143ee1841b5c40 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 16 Feb 2023 11:41:05 -0700 Subject: [PATCH 0373/1127] add location to unattributable warning --- flowsa/flowby.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 1b39f5061..3bc87e715 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1520,11 +1520,12 @@ def proportionally_attribute( unattributable = with_denominator.query(f'denominator == 0 ') if not unattributable.empty: - log.error( + log.warning( 'Could not attribute activities %s in %s due to lack of ' 'flows in attribution source %s for mapped %s sectors %s', set(zip(unattributable.ActivityProducedBy, - unattributable.ActivityConsumedBy)), + unattributable.ActivityConsumedBy, + unattributable.Location)), unattributable.full_name, other.full_name, rank, From 7de365bc862f0ffac19cc9a84ea6c99f7f38120a Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 16 Feb 2023 12:31:52 -0700 Subject: [PATCH 0374/1127] move FBA call out of USDA_IWMS iwms_aggregation and into FBS method --- .../Water_national_2015_m1.yaml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index 1aaf1a59d..676eb9232 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -73,11 +73,17 @@ source_names: estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_sectors_equal_attribution attribution_method: multiplication attribution_source: - USDA_IWMS: + USDA_IWMS: &usda_iwms year: 2018 selection_fields: Class: Water - clean_fba_wsec: !script_function:USDA_IWMS iwms_aggregation + allocation method: proportional + allocation_source: + USDA_IWMS: + year: 2018 + selection_fields: + Class: Land + PrimaryActivity: ['HAY & HAYLAGE, (EXCL ALFALFA)', 'HAY & HAYLAGE, ALFALFA'] cropland_attribution-cropland: selection_fields: Class: "Land" @@ -128,10 +134,7 @@ source_names: attribution_method: multiplication attribution_source: USDA_IWMS: - year: 2018 - selection_fields: - Class: Water - clean_fba_wsec: !script_function:USDA_IWMS iwms_aggregation + <<: *usda_iwms livestock_attribution: industry_spec: default: NAICS_6 From f40cc30663fe6f8727ac274215da313e51f301e5 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 16 Feb 2023 12:36:11 -0700 Subject: [PATCH 0375/1127] add usgs_wu_coef allocation method --- flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index 676eb9232..f6dd3a500 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -167,3 +167,4 @@ source_names: default: NAICS_6 year: 2005 geoscale: national + attribution_method: direct From 76fc4fa63a0a301cfedc63b855af753890e66cb8 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 16 Feb 2023 17:57:51 -0500 Subject: [PATCH 0376/1127] Added 'General Aviation Aircraft' to GHGI_SEEA crosswalk --- .../NAICS_Crosswalk_EPA_GHGI_SEEA.csv | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv index c7f11c1ab..2d329d349 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv @@ -121,6 +121,30 @@ EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,71,,,EPA_GHGI_T_A_103 EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,72,,,EPA_GHGI_T_A_103 EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,81,,,EPA_GHGI_T_A_103 EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,92,,,EPA_GHGI_T_A_103 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,11,,,EPA_GHGI_T_A_103 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,21,,,EPA_GHGI_T_A_103 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,22,,,EPA_GHGI_T_A_103 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,23,,,EPA_GHGI_T_A_103 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,31,,,EPA_GHGI_T_A_103 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,32,,,EPA_GHGI_T_A_103 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,33,,,EPA_GHGI_T_A_103 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,42,,,EPA_GHGI_T_A_103 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,44,,,EPA_GHGI_T_A_103 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,45,,,EPA_GHGI_T_A_103 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,48,,,EPA_GHGI_T_A_103 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,49,,,EPA_GHGI_T_A_103 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,51,,,EPA_GHGI_T_A_103 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,52,,,EPA_GHGI_T_A_103 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,53,,,EPA_GHGI_T_A_103 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,54,,,EPA_GHGI_T_A_103 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,55,,,EPA_GHGI_T_A_103 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,56,,,EPA_GHGI_T_A_103 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,61,,,EPA_GHGI_T_A_103 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,62,,,EPA_GHGI_T_A_103 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,71,,,EPA_GHGI_T_A_103 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,72,,,EPA_GHGI_T_A_103 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,81,,,EPA_GHGI_T_A_103 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,92,,,EPA_GHGI_T_A_103 EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" From c9379dea86ce9e7fbc8fbd1089a045f27287a1b7 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 17 Feb 2023 11:16:56 -0500 Subject: [PATCH 0377/1127] Fixed eia_mecs_energy_parse() to have table numbers in the Description column --- flowsa/data_source_scripts/temp_data_source_functions.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index 5545b6b97..1a7709e05 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -182,9 +182,13 @@ def eia_mecs_energy_parse(*, df_list, source, year, **_): # concatenate dataframe list into single dataframe df = pd.concat(df_list, sort=True) + print(df['Table Name'].unique()) + # rename columns to match standard flowbyactivity format df = df.rename(columns={'NAICS Code': 'ActivityConsumedBy', - 'Subsector and Industry': 'Description'}) + 'Table Name': 'Description'}) + df.loc[df['Subsector and Industry'] == 'Total', 'ActivityConsumedBy'] = '31-33' + df = df.drop(columns='Subsector and Industry') df['ActivityConsumedBy'] = df['ActivityConsumedBy'].str.strip() # add hardcoded data df["SourceName"] = source @@ -196,7 +200,6 @@ def eia_mecs_energy_parse(*, df_list, source, year, **_): df.loc[df['Location'] == 'Total United States', 'Location'] = US_FIPS df = assign_fips_location_system(df, year) df = assign_census_regions(df) - df.loc[df['Description'] == 'Total', 'ActivityConsumedBy'] = '31-33' df['DataReliability'] = 5 # tmp df['DataCollection'] = 5 # tmp From e785527d38fc801d072e8edae2224f37f5953d99 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 17 Feb 2023 17:25:40 -0500 Subject: [PATCH 0378/1127] Fix how renaming in selection fields works --- flowsa/flowby.py | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index b281f7ffd..b03239e2a 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -454,10 +454,16 @@ def select_by_fields(self: FB, selection_fields: dict = None) -> FB: filtered_fb = self for field, values in special_fields.items(): - filtered_fb = filtered_fb.query(f'{field}ProducedBy in @values ' - f'| {field}ConsumedBy in @values') + check_values = ([*values.keys(), *values.values()] + if isinstance(values, dict) else values) + filtered_fb = filtered_fb.query( + f'{field}ProducedBy in @check_values ' + f'| {field}ConsumedBy in @check_values' + ) for field, values in other_fields.items(): - filtered_fb = filtered_fb.query(f'{field} in @values') + check_values = ([*values.keys(), *values.values()] + if isinstance(values, dict) else values) + filtered_fb = filtered_fb.query(f'{field} in @check_values') if filtered_fb.empty: log.warning('%s FBA is empty', filtered_fb.full_name) @@ -1591,17 +1597,6 @@ def activity_sets(self) -> List['FlowByActivity']: selection_fields=activity_config['selection_fields']) ) - for field, values in activity_config['selection_fields'].items(): - if isinstance(values, dict): - activity_config['selection_fields'][field] = list(set( - values.values() - )) - # ^^^ This makes it so that if the activity set's - # selection_fields are a dict (implying renaming of the - # given values), then the selection that happens during - # prepare_fbs on the activity set selects by the renamed - # values rather than the original ones. - child_fba.config = {**parent_config, **activity_config} child_fba = child_fba.assign(SourceName=child_fba.full_name) From 480937175b0800669330cc31b66327734aa8467f Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 17 Feb 2023 17:32:46 -0500 Subject: [PATCH 0379/1127] Fix line 441 --- flowsa/flowby.py | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 4dbb7e7cd..426366d0c 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -454,10 +454,16 @@ def select_by_fields(self: FB, selection_fields: dict = None) -> FB: filtered_fb = self for field, values in special_fields.items(): - filtered_fb = filtered_fb.query(f'{field}ProducedBy in @values ' - f'| {field}ConsumedBy in @values') + check_values = ([*values.keys(), *values.values()] + if isinstance(values, dict) else values) + filtered_fb = filtered_fb.query( + f'{field}ProducedBy in @check_values ' + f'| {field}ConsumedBy in @check_values' + ) for field, values in other_fields.items(): - filtered_fb = filtered_fb.query(f'{field} in @values') + check_values = ([*values.keys(), *values.values()] + if isinstance(values, dict) else values) + filtered_fb = filtered_fb.query(f'{field} in @check_values') if filtered_fb.empty: log.warning('%s FBA is empty', filtered_fb.full_name) @@ -1545,17 +1551,6 @@ def activity_sets(self) -> List['FlowByActivity']: selection_fields=activity_config['selection_fields']) ) - for field, values in activity_config['selection_fields'].items(): - if isinstance(values, dict): - activity_config['selection_fields'][field] = list(set( - values.values() - )) - # ^^^ This makes it so that if the activity set's - # selection_fields are a dict (implying renaming of the - # given values), then the selection that happens during - # prepare_fbs on the activity set selects by the renamed - # values rather than the original ones. - child_fba.config = {**parent_config, **activity_config} child_fba = child_fba.assign(SourceName=child_fba.full_name) From 13daa2fa0cf52e7a796418cb89378341b49899e5 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 23 Feb 2023 14:01:06 -0700 Subject: [PATCH 0380/1127] add new estimate_suppressed_iwms() --- flowsa/data_source_scripts/USDA_IWMS.py | 62 ++++++++++++++++++++++--- 1 file changed, 55 insertions(+), 7 deletions(-) diff --git a/flowsa/data_source_scripts/USDA_IWMS.py b/flowsa/data_source_scripts/USDA_IWMS.py index 42b1d70ae..ec78e93db 100644 --- a/flowsa/data_source_scripts/USDA_IWMS.py +++ b/flowsa/data_source_scripts/USDA_IWMS.py @@ -10,15 +10,13 @@ import json import pandas as pd import numpy as np -from esupy.dqi import get_weighted_average -from flowsa.location import US_FIPS -from flowsa.common import WITHDRAWN_KEYWORD, fba_wsec_default_grouping_fields -from flowsa.dataclean import replace_strings_with_NoneType, replace_NoneType_with_empty_cells +from flowsa.location import US_FIPS, get_state_FIPS +from flowsa.common import WITHDRAWN_KEYWORD from flowsa.flowbyfunctions import assign_fips_location_system, \ - load_fba_w_standardized_units + load_fba_w_standardized_units, filter_by_geoscale from flowsa.data_source_scripts.USDA_CoA_Cropland import disaggregate_pastureland, \ disaggregate_cropland - +from flowsa.flowby import FlowByActivity def iwms_url_helper(*, build_url, config, **_): """ @@ -206,4 +204,54 @@ def iwms_aggregation(df_load, **kwargs): df_o = df_load[~df_load['SectorConsumedBy'].isin(['111940A', '111940B'])] df4 = pd.concat([df_o, df3], ignore_index=True) - return df4 \ No newline at end of file + return df4 + + +def estimate_suppressed_iwms(fba: FlowByActivity) -> FlowByActivity: + """ + Fill suppressed state level data with national level rates. Also sub in + national level rates when there is no available state data + :param fba: + :return: + """ + # subset to national data + fba_nat = fba.query('Location == @US_FIPS') + fba_nat_sub = (fba_nat[['FlowAmount', 'ActivityConsumedBy']] + .rename(columns={'FlowAmount': 'FlowAmountNat'}) + ) + + # subset state data + fba_state = filter_by_geoscale(fba, "state") + # merge state with national data and fill in suppressed state data with + # national + fba_state = fba_state.merge(fba_nat_sub, how='left') + fba_state['FlowAmount'] = np.where(fba_state['FlowAmount'] == 0, + fba_state['FlowAmountNat'], + fba_state['FlowAmount']) + # merge state and nat + fbam = (pd.concat([fba_nat, fba_state]) + .drop(columns='FlowAmountNat')) + + # subset state df columns + fba_state_sub = ( + fba_state[['ActivityConsumedBy', 'Location', 'FlowAmount']] + .rename(columns={'FlowAmount': 'FlowAmountState', + 'Location': 'FIPS'})) + # add all possible state FIPS to national df + statefips = (get_state_FIPS()[['FIPS']] + .assign(Location=US_FIPS)) + fba_nat2 = fba_nat.merge(statefips) + # merge national and state dfs and subset to state data that does not + # exist, fill with national level rates + m = (fba_nat2.merge(fba_state_sub, how='left') + .fillna(0) + .query('FlowAmountState == 0')) + m2 = (m + .assign(Location=m['FIPS']) + .drop(columns=['FIPS', 'FlowAmountState']) + ) + + # append new state level rates + fbam2 = pd.concat([fbam, m2], ignore_index=True) + + return fbam2 From f231c1e95c2cc77d6d14920d01c0e898f9b09c70 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 23 Feb 2023 14:02:33 -0700 Subject: [PATCH 0381/1127] estimate suppressed iwms, temp comment out attribution of iwms --- .../Water_national_2015_m1.yaml | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index f6dd3a500..821c22adc 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -76,14 +76,15 @@ source_names: USDA_IWMS: &usda_iwms year: 2018 selection_fields: - Class: Water - allocation method: proportional - allocation_source: - USDA_IWMS: - year: 2018 - selection_fields: - Class: Land - PrimaryActivity: ['HAY & HAYLAGE, (EXCL ALFALFA)', 'HAY & HAYLAGE, ALFALFA'] + Class: Water + estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_iwms +# attribution_method: proportional +# attribution_source: +# USDA_IWMS: +# year: 2018 +# selection_fields: +# Class: Land +# PrimaryActivity: ['HAY & HAYLAGE, (EXCL ALFALFA)', 'HAY & HAYLAGE, ALFALFA'] cropland_attribution-cropland: selection_fields: Class: "Land" @@ -105,14 +106,14 @@ source_names: 'POPCORN, SHELLED', 'RICE', 'BARLEY', 'BUCKWHEAT', 'MILLET, PROSO', 'OATS', 'RYE', 'SORGHUM, GRAIN', 'SORGHUM, SILAGE', 'SORGHUM, SYRUP', 'TRITICALE', 'WILD - RICE', 'EMMER & SPELT', 'VEGETABLE TOTALS', 'ORCHARDS', + RICE', 'VEGETABLE TOTALS', 'ORCHARDS', 'BERRY TOTALS', 'CUT CHRISTMAS TREES', 'SHORT TERM WOODY CROPS', 'TOBACCO', 'COTTON', 'SUGARCANE, SUGAR', 'SUGARCANE, SEED', 'HAY & HAYLAGE', 'SUGARBEETS', - 'SUGARBEETS, SEED', 'PEANUTS', 'DILL, OIL', 'GRASSES & - LEGUMES TOTALS, SEED', 'GUAR', 'HERBS, DRY', 'HOPS', - 'JOJOBA', 'MINT, OIL', 'MISCANTHUS', 'MINT, TEA LEAVES', - 'SWITCHGRASS', 'FIELD CROPS, OTHER'] + 'SUGARBEETS, SEED', 'PEANUTS', 'GRASSES & + LEGUMES TOTALS, SEED', 'HERBS, DRY', 'HOPS', + 'MINT, OIL', 'MISCANTHUS', 'MINT, TEA LEAVES', + 'FIELD CROPS, OTHER'] attribution_method: proportional attribution_source: USDA_CoA_Cropland_NAICS: From 862ec97dd5b8551eada80ff0a1a9c5ab934918e2 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 23 Feb 2023 14:05:12 -0700 Subject: [PATCH 0382/1127] in multiplication attribution, keep units of second FBA and return warning if row flowamounts set to 0 because no data by which to multiply --- flowsa/flowby.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 942bce973..ed6d1d84d 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1596,11 +1596,12 @@ def multiplication_attribution( other = ( other .add_primary_secondary_columns('Sector') - [['PrimarySector', 'Location', 'FlowAmount']] - .groupby(['PrimarySector', 'Location']) + [['PrimarySector', 'Location', 'FlowAmount', 'Unit']] + .groupby(['PrimarySector', 'Location', 'Unit']) .agg('sum') .reset_index() ) + # todo: update units after multiplying # multiply using each dfs primary sector col merged = (fba @@ -1622,6 +1623,18 @@ def multiplication_attribution( errors='ignore') ) + # determine if any flows are lost because multiplied by 0 + fba_null = fba[fba['FlowAmount'] == 0] + if len(fba_null) > 0: + log.warning('FlowAmounts in %s are reset to 0 due to lack of ' + 'flows in attribution source %s for ' + 'ActivityProducedBy/ActivityConsumedBy/Location: %s', + fba.full_name, other.full_name, + set(zip(fba_null.ActivityProducedBy, + fba_null.ActivityConsumedBy, + fba_null.Location)) + ) + return ( fba .drop(columns=['PrimarySector', 'SecondarySector', From 69dc6946570249f5976f5c1b48a66b442bb3b8ec Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 23 Feb 2023 14:14:25 -0700 Subject: [PATCH 0383/1127] update py file --- flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index 821c22adc..79371a91c 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -77,7 +77,7 @@ source_names: year: 2018 selection_fields: Class: Water - estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_iwms + estimate_suppressed: !script_function:USDA_IWMS estimate_suppressed_iwms # attribution_method: proportional # attribution_source: # USDA_IWMS: From 4121ba63ad305cba8e0020e0027a4f8d4b0ca73c Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Fri, 24 Feb 2023 10:49:59 -0500 Subject: [PATCH 0384/1127] Fix eia_mecs_energy_parse() to include table numbers in Description --- flowsa/data_source_scripts/temp_data_source_functions.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index 716357e24..de2c35cb9 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -193,7 +193,9 @@ def eia_mecs_energy_parse(*, df_list, source, year, **_): # rename columns to match standard flowbyactivity format df = df.rename(columns={'NAICS Code': 'ActivityConsumedBy', - 'Subsector and Industry': 'Description'}) + 'Table Name': 'Description'}) + df.loc[df['Subsector and Industry'] == 'Total', 'ActivityConsumedBy'] = '31-33' + df = df.drop(columns='Subsector and Industry') df['ActivityConsumedBy'] = df['ActivityConsumedBy'].str.strip() # add hardcoded data df["SourceName"] = source @@ -205,7 +207,6 @@ def eia_mecs_energy_parse(*, df_list, source, year, **_): df.loc[df['Location'] == 'Total United States', 'Location'] = US_FIPS df = assign_fips_location_system(df, year) df = assign_census_regions(df) - df.loc[df['Description'] == 'Total', 'ActivityConsumedBy'] = '31-33' df['DataReliability'] = 5 # tmp df['DataCollection'] = 5 # tmp From 271fb72946725e36f82c1ecb3ff63b19f7ee28cf Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 8 Mar 2023 10:45:35 -0700 Subject: [PATCH 0385/1127] update calrecycle fxns to use fbs.config --- .../CalRecycle_WasteCharacterization.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py b/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py index 4e3b5ac8e..73b2289dd 100644 --- a/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py +++ b/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py @@ -125,26 +125,28 @@ def keep_generated_quantity(fba, **_): return fba -def load_and_clean_employment_data_for_cnhw(fbs, **kwargs): +def load_and_clean_employment_data_for_cnhw(fbs, year, method, + geographic_level='state'): from flowsa.data_source_scripts.BLS_QCEW import \ bls_clean_allocation_fba_w_sec bls = load_fba_w_standardized_units(datasource='BLS_QCEW', - year=fbs.config['year'], + year=year, flowclass='Employment', - geographic_level='state') + geographic_level=geographic_level) bls = add_sectors_to_flowbyactivity(bls) # estimate suppressed employment data bls = bls_clean_allocation_fba_w_sec(bls, method=method) # Subset BLS dataset - sector_list = list(filter(None, fbs['SectorProducedBy'].unique())) + fbs_sectors = fbs['SectorProducedBy'].unique() + sector_list = list(filter(None, fbs_sectors)) bls = get_fba_allocation_subset(bls, 'BLS_QCEW', sector_list) bls = bls.rename(columns={'FlowAmount': 'Employees'}) bls = bls[['Employees', 'Location', 'Year', 'SectorProducedBy']] return bls -def apply_tons_per_employee_per_year_to_states(fbs, method, **_): +def apply_tons_per_employee_per_year_to_states(fbs, **_): """ Calculates tons per employee per year based on BLS_QCEW employees by sector and applies that quantity to employees in all states @@ -152,7 +154,7 @@ def apply_tons_per_employee_per_year_to_states(fbs, method, **_): """ # load bls employment data for the year of CalRecycle data bls = load_and_clean_employment_data_for_cnhw( - fbs, fbs['Year'].unique()[0], method) + fbs, year=fbs['Year'].unique()[0], method=fbs.config) # Calculate tons per employee per year per material and sector in CA bls_CA = bls[bls['Location'] == '06000'] # California # aggregate all employment prior to generating tpepy @@ -168,9 +170,10 @@ def apply_tons_per_employee_per_year_to_states(fbs, method, **_): # Apply TPEPY back to all employees in all states for year identified in # method, overwrite geoscale based on target geoscale identified in method bls2 = load_and_clean_employment_data_for_cnhw( - fbs, _.get('v')['year'], method, method.get('target_geoscale')) + fbs, year=fbs.config['year'], method=fbs.config, + geographic_level=fbs.config['geoscale']) national_waste = tpepy.merge(bls2, how='left') - national_waste['Year'] = _.get('v')['year'] + national_waste['Year'] = fbs.config['year'] national_waste['FlowAmount'] = \ national_waste['Employees'] * national_waste['TPEPY'] national_waste = national_waste.drop(columns=['TPEPY', 'Employees']) From 37138aa62676ad7354e4051e723bd3a3ff9bf8d1 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 8 Mar 2023 10:46:12 -0700 Subject: [PATCH 0386/1127] update cnhw national 2018 to work for recursive method --- .../flowbysectormethods/CNHW_national_2018.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml b/flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml index c9a2e508e..1a4778ade 100644 --- a/flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml +++ b/flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml @@ -1,8 +1,14 @@ +industry_spec: + default: NAICS_6 +year: 2018 +target_naics_year: 2012 +geoscale: national + +# Needed temporarily still for aggregate_and_subset_for_target_sectors target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: national + source_names: "CNHW_CA_2014": data_format: 'FBS' - clean_fbs_df_fxn: !script_function:CalRecycle_WasteCharacterization apply_tons_per_employee_per_year_to_states + clean_fbs: !script_function:CalRecycle_WasteCharacterization apply_tons_per_employee_per_year_to_states year: 2018 \ No newline at end of file From fab5713ae171149460a7c5516ca613d12a2ecfa5 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 8 Mar 2023 11:02:03 -0700 Subject: [PATCH 0387/1127] specify mecs unit - remove outdated fxn call --- flowsa/data_source_scripts/EPA_GHGI.py | 4 ++-- flowsa/data_source_scripts/GHGI2020.py | 4 ++-- flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml | 2 +- flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml | 2 +- flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml | 2 +- flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml | 2 +- flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_GHGI.py b/flowsa/data_source_scripts/EPA_GHGI.py index 8a12e88b5..fecf31be5 100644 --- a/flowsa/data_source_scripts/EPA_GHGI.py +++ b/flowsa/data_source_scripts/EPA_GHGI.py @@ -723,9 +723,9 @@ def closest_value(input_list, input_value): flowclass='Energy') mecs = (mecs.loc[(mecs['ActivityConsumedBy'] == '31-33') & (mecs['Location'] == '00000') & - (mecs['Description'].isin(['Table 3.2', 'Table 2.2']))] + (mecs['Description'].isin(['Table 3.2', 'Table 2.2'])) & + (mecs['Unit'] == 'MJ')] .reset_index(drop=True)) - mecs = EIA_MECS.mecs_energy_fba_cleanup(mecs, None) # Identify the GHGI table that matches EIA_MECS for t, v in (load_yaml_dict('EPA_GHGI', 'FBA') diff --git a/flowsa/data_source_scripts/GHGI2020.py b/flowsa/data_source_scripts/GHGI2020.py index f9ef28a95..c8627c533 100644 --- a/flowsa/data_source_scripts/GHGI2020.py +++ b/flowsa/data_source_scripts/GHGI2020.py @@ -651,8 +651,8 @@ def closest_value(input_list, input_value): year=mecs_year, flowclass='Energy') mecs = mecs.loc[(mecs['ActivityConsumedBy'] == '31-33') & - (mecs['Location'] == '00000')].reset_index(drop=True) - mecs = EIA_MECS.mecs_energy_fba_cleanup(mecs, None) + (mecs['Location'] == '00000') & + (mecs['Unit'] == 'MJ')].reset_index(drop=True) # Identify the GHGI table that matches EIA_MECS for t, v in (load_yaml_dict('EPA_GHGI', 'FBA') diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml index c81bdf6f0..4369e2298 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml @@ -17,7 +17,7 @@ _allocation_types: Description: - "Table 2.2" # Nonfuel (class Other) - "Table 3.2" # Fuel (class Energy) - clean_allocation_fba: !script_function:EIA_MECS mecs_energy_fba_cleanup + Unit: MJ clean_allocation_fba_w_sec: !script_function:EIA_MECS eia_mecs_energy_clean_allocation_fba_w_sec helper_source: "BLS_QCEW" helper_method: proportional-flagged diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml index 992176856..9b018d64d 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml @@ -142,7 +142,7 @@ source_names: Description: - "Table 2.2" # Nonfuel (class Other) - "Table 3.2" # Fuel (class Energy) - clean_allocation_fba: !script_function:EIA_MECS mecs_energy_fba_cleanup + Unit: MJ clean_allocation_fba_w_sec: !script_function:EIA_MECS eia_mecs_energy_clean_allocation_fba_w_sec helper_source: "BLS_QCEW" helper_method: proportional-flagged diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml index 47b2545d6..e001ddd21 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml @@ -142,7 +142,7 @@ source_names: Description: - "Table 2.2" # Nonfuel (class Other) - "Table 3.2" # Fuel (class Energy) - clean_allocation_fba: !script_function:EIA_MECS mecs_energy_fba_cleanup + Unit: MJ clean_allocation_fba_w_sec: !script_function:EIA_MECS eia_mecs_energy_clean_allocation_fba_w_sec helper_source: "BLS_QCEW" helper_method: proportional-flagged diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml index 97ba9110a..2f667e5a3 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml @@ -143,7 +143,7 @@ source_names: Description: - "Table 2.2" # Nonfuel (class Other) - "Table 3.2" # Fuel (class Energy) - clean_allocation_fba: !script_function:EIA_MECS mecs_energy_fba_cleanup + Unit: MJ clean_allocation_fba_w_sec: !script_function:EIA_MECS eia_mecs_energy_clean_allocation_fba_w_sec helper_source: "BLS_QCEW" helper_method: proportional-flagged diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml index 79bd651f4..221c2ced3 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml @@ -140,7 +140,7 @@ source_names: Description: - "Table 2.2" # Nonfuel (class Other) - "Table 3.2" # Fuel (class Energy) - clean_allocation_fba: !script_function:EIA_MECS mecs_energy_fba_cleanup + Unit: MJ clean_allocation_fba_w_sec: !script_function:EIA_MECS eia_mecs_energy_clean_allocation_fba_w_sec helper_source: "BLS_QCEW" helper_method: proportional-flagged From 0a3b9ef78c8cd9b071ce2fed0ae77c96c0d606c8 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 8 Mar 2023 15:26:32 -0700 Subject: [PATCH 0388/1127] add develop back into package requirements after v1.3.1 merge --- requirements.txt | 6 +++--- setup.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/requirements.txt b/requirements.txt index 8b889216e..53b216783 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List#egg=fedelemflowlist -git+https://github.com/USEPA/esupy#egg=esupy -git+https://github.com/USEPA/standardizedinventories#egg=StEWI +git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git@develop#egg=fedelemflowlist +git+https://github.com/USEPA/esupy.git@develop#egg=esupy +git+https://github.com/USEPA/standardizedinventories.git@develop#egg=StEWI appdirs >= 1.4.3 # Storing user data bibtexparser>=1.2.0 # Generates bibtex kaleido == 0.1.0.post1; platform_system == "Windows" # export plotly.py figures as static images diff --git a/setup.py b/setup.py index ce6b22305..d7f6eab14 100644 --- a/setup.py +++ b/setup.py @@ -12,9 +12,9 @@ include_package_data=True, python_requires=">=3.8", install_requires=[ - 'fedelemflowlist @ git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List#egg=fedelemflowlist', - 'esupy @ git+https://github.com/USEPA/esupy#egg=esupy', - 'StEWI @ git+https://github.com/USEPA/standardizedinventories#egg=StEWI', + 'fedelemflowlist @ git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git@develop#egg=fedelemflowlist', + 'esupy @ git+https://github.com/USEPA/esupy.git@develop#egg=esupy', + 'StEWI @ git+https://github.com/USEPA/standardizedinventories.git@develop#egg=StEWI', 'appdirs>=1.4.3', 'bibtexparser>=1.2.0', "kaleido==0.1.0.post1;platform_system=='Windows'", From df8b402bec61b0a3c698e8a111630171314024d4 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 9 Mar 2023 09:00:58 -0700 Subject: [PATCH 0389/1127] drop comma --- flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml index 1249f2e0b..5c3681ed5 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml @@ -21,7 +21,7 @@ display_tables: replace_dict: Industry: {'31': '31-33', '32': '31-33', '33': '31-33', '44': '44-45', '45': '44-45', - '48': '48-49', '49': '48-49'}, + '48': '48-49', '49': '48-49'} Pollutant: {C2F6: F-GHGs, C3F8: F-GHGs, CF4: F-GHGs, 'HFC, PFC and SF6 F-HTFs': F-GHGs, HFC-134a: F-GHGs, HFC-23: F-GHGs, From bc150392a9e9ca1464598fea3a5e4c553ffc2f44 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 9 Mar 2023 10:22:04 -0700 Subject: [PATCH 0390/1127] skip test of loading FBS yaml files when there is a known error --- flowsa/test_examples.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/flowsa/test_examples.py b/flowsa/test_examples.py index 69a5f7288..1579044cc 100644 --- a/flowsa/test_examples.py +++ b/flowsa/test_examples.py @@ -3,6 +3,7 @@ """ import flowsa from flowsa import seeAvailableFlowByModels +from flowsa.common import check_method_status from flowsa.flowbyactivity import load_yaml_dict @@ -22,7 +23,13 @@ def test_write_bibliography(): def test_FBS_methods(): - """Test succesful loading of FBS yaml files""" + """Test succesful loading of FBS yaml files, skip files know to cause + errors""" + method_status = check_method_status() for m in seeAvailableFlowByModels("FBS", print_method=False): print(f"Testing method: {m}") + if method_status.get(m) is not None: + print(f"{m} skipped due to " + f"{method_status.get(m).get('Status', 'Unknown')}") + continue load_yaml_dict(m, flowbytype='FBS') From f6d594c0765ca67826fd0a2419c634152ee8b8f1 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 14 Mar 2023 11:13:08 -0400 Subject: [PATCH 0391/1127] make sure to explicitly search in `flowbysectormethods` subfolder for external path --- flowsa/flowsa_yaml.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flowsa/flowsa_yaml.py b/flowsa/flowsa_yaml.py index f9b9ebaa5..141cfe533 100644 --- a/flowsa/flowsa_yaml.py +++ b/flowsa/flowsa_yaml.py @@ -122,6 +122,8 @@ def load(stream: IO, external_path: str = None) -> dict: loader = FlowsaLoader(stream) if external_path: loader.external_paths_to_search.append(external_path) + loader.external_paths_to_search.append( + f'{external_path}flowbysectormethods/') loader.external_path_to_pass = external_path try: return loader.get_single_data() From a2cb48eb357bd6f4dd59a9a1342c899406308a02 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 21 Mar 2023 16:15:59 -0400 Subject: [PATCH 0392/1127] add GHGI table 3-108 --- flowsa/methods/flowbyactivitymethods/EPA_GHGI.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/flowsa/methods/flowbyactivitymethods/EPA_GHGI.yaml b/flowsa/methods/flowbyactivitymethods/EPA_GHGI.yaml index 1c4dda89e..c5f6a5cc4 100644 --- a/flowsa/methods/flowbyactivitymethods/EPA_GHGI.yaml +++ b/flowsa/methods/flowbyactivitymethods/EPA_GHGI.yaml @@ -108,6 +108,13 @@ Tables: "flow": "CO2" "desc": "Table 3-22b: Adjusted Non-Energy Use Fossil Fuel Emissions" + "3-108": + "class": "Chemicals" + "unit": "MMT CO2e" + "compartment": "air" + "flow": "CO2" + "desc": "CO2 Emissions from Wood Consumption by End-Use Sector (MMT CO2 Eq.)" + # Petroleum Systems "3-42": "class": "Chemicals" From e3895a12f95d41e06db25412ac1a628eb4e9b149 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 21 Mar 2023 16:18:04 -0400 Subject: [PATCH 0393/1127] clarify consumption tables using flow class; no longer requires swapping columns for 3-22 --- flowsa/data_source_scripts/EPA_GHGI.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_GHGI.py b/flowsa/data_source_scripts/EPA_GHGI.py index de9466274..14129f62d 100644 --- a/flowsa/data_source_scripts/EPA_GHGI.py +++ b/flowsa/data_source_scripts/EPA_GHGI.py @@ -277,7 +277,8 @@ def is_consumption(source_name, config): :param source_name: df :return: True or False """ - if 'consum' in get_table_meta(source_name, config)['desc'].lower(): + if ('consum' in get_table_meta(source_name, config)['desc'].lower() and + get_table_meta(source_name, config)['class']!='Chemicals'): return True return False @@ -392,8 +393,6 @@ def ghg_parse(*, df_list, year, config, **_): df = df.melt(id_vars=id_vars, var_name=meta.get('melt_var'), value_name="FlowAmount") - df = df.rename(columns={"ActivityConsumedBy": "ActivityProducedBy", - "ActivityProducedBy": "ActivityConsumedBy"}) name_unit = series_separate_name_and_units(df['FlowName'], meta['activity'], meta['unit']) From d95c186c5a8d40534f2d7063ebd1860e5facb3f8 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 22 Mar 2023 11:50:16 -0600 Subject: [PATCH 0394/1127] add mecs land activity schema --- flowsa/data/source_catalog.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 1b703b97f..89324d453 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -141,7 +141,7 @@ EIA_MECS_Land: class: - Land sector-like_activities: True - activity_schema: + activity_schema: NAICS_2012_Code sector_hierarchy: "parent-completeChild" EIA_MER: data_format: FBA From 807e7a87a026b918a36c69b6eec4c57288348941 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 23 Mar 2023 16:20:39 -0600 Subject: [PATCH 0395/1127] update data_source_scripts to work for recursive modeling --- flowsa/data_source_scripts/EIA_CBECS_Land.py | 14 +- flowsa/data_source_scripts/EIA_MECS.py | 399 +++++------ .../data_source_scripts/USDA_CoA_Cropland.py | 637 +++++++++--------- .../USDA_CoA_Cropland_NAICS.py | 30 +- .../temp_data_source_functions.py | 2 - 5 files changed, 541 insertions(+), 541 deletions(-) diff --git a/flowsa/data_source_scripts/EIA_CBECS_Land.py b/flowsa/data_source_scripts/EIA_CBECS_Land.py index dba2a5536..2efb5259b 100644 --- a/flowsa/data_source_scripts/EIA_CBECS_Land.py +++ b/flowsa/data_source_scripts/EIA_CBECS_Land.py @@ -312,12 +312,12 @@ def calculate_floorspace_based_on_number_of_floors(fba_load): calculate_flowamount_diff_between_dfs(fba2, fba3) # rename the FlowAmounts and sum so total floorspace, rather than have # multiple rows based on floors - fba3 = fba3.assign(FlowName=fba3['FlowName'].apply( + fba3 = fba3.assign(FlowName=fba3['Flowable'].apply( lambda x: ','.join(x.split(',')[:-1]))) # modify the description fba3 = fba3.assign(Description='Building Footprint') groupbycols = fba_mapped_default_grouping_fields - fba4 = aggregator(fba3, groupbycols) + fba4 = fba3.aggregate_flowby() return fba4 @@ -359,8 +359,8 @@ def disaggregate_eia_cbecs_mercentile(df_load): df_mall3['FlowAmount'] = df_mall3['FlowAmount'] * df_mall3['Mercantile'] df_mall3 = df_mall3.drop(columns='Mercantile') # update flownames - df_mall3['FlowName'] = \ - df_mall3['FlowName'] + ', ' + df_mall3['Description'] + df_mall3['Flowable'] = \ + df_mall3['Flowable'] + ', ' + df_mall3['Description'] # repeat with non mall categories df_nonmall = df_load[ @@ -376,8 +376,8 @@ def disaggregate_eia_cbecs_mercentile(df_load): df_nonmall3['FlowAmount'] * df_nonmall3['Mercantile'] df_nonmall3 = df_nonmall3.drop(columns='Mercantile') # update flownames - df_nonmall3['FlowName'] = \ - df_nonmall3['FlowName'] + ', ' + df_nonmall3['Description'] + df_nonmall3['Flowable'] = \ + df_nonmall3['Flowable'] + ', ' + df_nonmall3['Description'] # concat dfs df = pd.concat( @@ -434,7 +434,7 @@ def disaggregate_eia_cbecs_vacant_and_other(df_load): 'Remainder', 'Description']]) df_vo2['FlowAmount'] = df_vo2['FlowAmount'] * df_vo2['Remainder'] df_vo2 = df_vo2.drop(columns='Remainder') - df_vo2['FlowName'] = df_vo2['FlowName'] + ', ' + df_vo2['Description'] + df_vo2['Flowable'] = df_vo2['Flowable'] + ', ' + df_vo2['Description'] # concat with original df df = pd.concat([df_load, df_vo2], ignore_index=True, sort=False) diff --git a/flowsa/data_source_scripts/EIA_MECS.py b/flowsa/data_source_scripts/EIA_MECS.py index 2ed32700b..b74ca1e2e 100644 --- a/flowsa/data_source_scripts/EIA_MECS.py +++ b/flowsa/data_source_scripts/EIA_MECS.py @@ -631,208 +631,209 @@ def mecs_land_fba_cleanup(fba, **_): :param fba: df, EIA MECS Land FBA format :return: df, EA MECS Land FBA """ + from flowsa.data_source_scripts.temp_data_source_functions import \ + clean_mecs_energy_fba - fba = fba[fba['FlowName'].str.contains( - 'Approximate Enclosed Floorspace of All Buildings Onsite')] + fba2 = clean_mecs_energy_fba(fba) # calculate the land area in addition to building footprint - fba = calculate_total_facility_land_area(fba) - - return fba - - -def mecs_land_fba_cleanup_for_land_2012_fbs(fba, **_): - """ - The 'land_national_2012' FlowBySector uses MECS 2014 data, set - MECS year to 2012 - :param fba: df, EIA MECS Land, FBA format - :return: df, EIA MECS Land FBA modified - """ - - fba = mecs_land_fba_cleanup(fba=fba) - - # reset the EIA MECS Land year from 2014 to 2012 to match - # the USDA ERS MLU year - vLogDetailed.info('Resetting year from 2014 to 2012') - fba['Year'] = 2012 - - return fba - - -def mecs_land_clean_allocation_mapped_fba_w_sec(df, attr, method): - """ - The mecs land dataset has varying levels of information for naics3-6. - Iteratively determine which activities need allocated - - :param df: The mecs df with sectors after mapped to FEDEFL - :param attr: dictionary, attribute data from method yaml for activity set - :param method: string, methodname - :return: df, with additional column flagging rows where sectors should - be disaggregated - """ - - sector_column = 'SectorConsumedBy' - df = determine_flows_requiring_disaggregation( - df, attr, method, sector_column) - - return df + fba3 = calculate_total_facility_land_area(fba2) + + return fba3 + +# todo: delete next fxn +# def mecs_land_fba_cleanup_for_land_2012_fbs(fba, **_): +# """ +# The 'land_national_2012' FlowBySector uses MECS 2014 data, set +# MECS year to 2012 +# :param fba: df, EIA MECS Land, FBA format +# :return: df, EIA MECS Land FBA modified +# """ +# +# fba = mecs_land_fba_cleanup(fba=fba) +# +# # reset the EIA MECS Land year from 2014 to 2012 to match +# # the USDA ERS MLU year +# vLogDetailed.info('Resetting year from 2014 to 2012') +# fba['Year'] = 2012 +# +# return fba + +# todo: delete +# def mecs_land_clean_allocation_mapped_fba_w_sec(df, attr, method): +# """ +# The mecs land dataset has varying levels of information for naics3-6. +# Iteratively determine which activities need allocated +# +# :param df: The mecs df with sectors after mapped to FEDEFL +# :param attr: dictionary, attribute data from method yaml for activity set +# :param method: string, methodname +# :return: df, with additional column flagging rows where sectors should +# be disaggregated +# """ +# +# sector_column = 'SectorConsumedBy' +# df = determine_flows_requiring_disaggregation( +# df, attr, method, sector_column) +# +# return df # TODO confirm this function can be dropped and replaced -def determine_flows_requiring_disaggregation( - df_load, attr, method, sector_column): - """ - The MECS Land data provides FlowAmounts for NAICS3-6. We use BLS QCEW - employment data to determine land use for different industries. To - accurately estimate land use per industry, existing FlowAmounts for a - particular NAICS level (NAICS6) for example, should be subtracted from - the possible FlowAmounts for other NAICS6 that share the first 5 digits. - For Example, there is data for '311', '3112', and '311221' in the 2014 - dataset. FlowAmounts for allocation by employment for NAICS6 are based - on the provided '3112' FlowAmounts. However, since there is data at one - NAICS6 (311221), the FlowAmount for that NAICS6 should be subtracted - from other NAICS6 to accurately depict the remaining 'FlowAmount' that - requires a secondary source (Employment data) for allocation. - :param df_load: df, EIA MECS Land FBA - :param attr: dictionary, attribute data from method yaml for activity set - :param method: dictionary, FBS method yaml - :param sector_column: str, sector column to flag ('SectorProducedBy', - 'SectorConsumedBy') - :return: A dataframe with a column 'disaggregate_flag', if '1', - row requires secondary source to calculate - FlowAmount, if '0' FlowAmount does not require modifications - """ - - from flowsa.sectormapping import add_sectors_to_flowbyactivity - - df_load = replace_NoneType_with_empty_cells(df_load) - # drop rows where there is no value in sector column, which might occur if - # sector-like activities have a "-" in them - df_load = df_load[df_load[sector_column] != ''] - - # determine activity column - if sector_column == 'SectorConsumedBy': - activity_column = 'ActivityConsumedBy' - else: - activity_column = 'ActivityProducedBy' - - # original df - subset - # subset cols of original df - dfo = df_load[['FlowName', 'FlowAmount', 'Location', sector_column]] - # min and max length - min_length = min(df_load[sector_column].apply( - lambda x: len(str(x))).unique()) - max_length = max(df_load[sector_column].apply( - lambda x: len(str(x))).unique()) - # subset by sector length, creating a df - for s in range(min_length, max_length + 1): - df_name = 'dfo_naics' + str(s) - vars()[df_name] = dfo[dfo[sector_column].apply( - lambda x: len(x) == s)].reset_index(drop=True) - vars()[df_name] = vars()[df_name].assign( - SectorMatch=vars()[df_name][sector_column].apply( - lambda x: x[:len(x) - 1])) - # loop through the dfs, merging by sector match. If there is a match, - # subtract the value, if there is not a match, drop last digit in - # sectormatch, add row to the next df, and repeat - df_merged = pd.DataFrame() - df_not_merged = pd.DataFrame() - for s in range(max_length, min_length, -1): - df_name_1 = 'dfo_naics' + str(s - 1) - df_name_2 = 'dfo_naics' + str(s) - # concat df 1 with df_not_merged - df2 = pd.concat([vars()[df_name_2], df_not_merged]) - df2 = df2.rename( - columns={'FlowAmount': 'SubtractFlow', sector_column: 'Sector'}) - df_m = pd.merge( - vars()[df_name_1][['FlowName', 'FlowAmount', 'Location', - sector_column]], - df2, left_on=['FlowName', 'Location', sector_column], - right_on=['FlowName', 'Location', 'SectorMatch'], - indicator=True, how='outer') - # subset by merge and append to appropriate df - df_both = df_m[df_m['_merge'] == 'both'] - if len(df_both) != 0: - # drop columns - df_both1 = df_both.drop( - columns=['Sector', 'SectorMatch', '_merge']) - # aggregate before subtracting - df_both2 = df_both1.groupby( - ['FlowName', 'FlowAmount', 'Location', sector_column], - as_index=False).agg({"SubtractFlow": sum}) - df_both3 = df_both2.assign( - FlowAmount=df_both2['FlowAmount'] - df_both2['SubtractFlow']) - df_both3 = df_both3.drop(columns=['SubtractFlow']) - # drop rows where 0 - # df_both = df_both[df_both['FlowAmount'] != 0] - df_merged = pd.concat([df_merged, df_both3], ignore_index=True) - df_right = df_m[df_m['_merge'] == 'right_only'] - if len(df_right) != 0: - df_right = df_right.drop( - columns=['FlowAmount', sector_column, '_merge']) - df_right = df_right.rename(columns={'SubtractFlow': 'FlowAmount', - 'Sector': sector_column}) - # remove another digit from Sectormatch - df_right = df_right.assign(SectorMatch=df_right[ - sector_column].apply(lambda x: x[:(s - 2)])) - # reorder - df_right = df_right[['FlowName', 'FlowAmount', 'Location', - sector_column, 'SectorMatch']] - df_not_merged = pd.concat([df_not_merged, df_right], - ignore_index=True) - # rename the flowamount column - df_merged = df_merged.rename(columns={'FlowAmount': 'FlowAmountNew', - sector_column: activity_column}) - # In the original EIA MECS df, some of the NAICS 6-digit codes sum - # to a value greater than published NAICS3, due to rounding. In these - # cases, the new FlowAmount is a negative number. Reset neg numbers to 0 - df_merged.loc[df_merged['FlowAmountNew'] < 0, 'FlowAmountNew'] = 0 - # in the original df, drop sector columns re-add sectors, this time with - # sectors = 'aggregated' - dfn = df_load.drop(columns=['SectorProducedBy', 'ProducedBySectorType', - 'SectorConsumedBy', 'ConsumedBySectorType', - 'SectorSourceName']) - dfn = add_sectors_to_flowbyactivity( - dfn, sectorsourcename=method['target_sector_source'], - overwrite_sectorlevel='aggregated') - # add column noting that these columns require an allocation ratio - dfn = dfn.assign(disaggregate_flag=1) - # create lists of sectors to drop - list_original = df_load[activity_column].drop_duplicates().tolist() - # drop values in original df - dfn2 = dfn[~dfn[sector_column].isin(list_original)].sort_values( - [activity_column, sector_column]).reset_index(drop=True) - # drop the sectors that are duplicated by different naics being - # mapped to naics6 - if len(dfn2[dfn2.duplicated(subset=['FlowName', 'Location', sector_column], - keep=False)]) > 0: - dfn2.drop_duplicates(subset=['FlowName', 'Location', sector_column], - keep='last', inplace=True) - # want to allocate at NAICS6, so drop all other sectors - dfn2 = \ - dfn2[dfn2[sector_column].apply(lambda x: len(x) == 6)].reset_index( - drop=True).sort_values([sector_column]) - - # merge revised flowamounts back with modified original df - df_to_allocate = dfn2.merge(df_merged, how='left') - # replace FlowAmount with newly calculated FlowAmount, - # which represents Flows that are currently unaccounted for at NAICS6 - df_to_allocate['FlowAmount'] = np.where( - df_to_allocate['FlowAmountNew'].notnull(), - df_to_allocate['FlowAmountNew'], df_to_allocate['FlowAmount']) - # drop rows where flow amount = 0 - flows are captured through other NAICS6 - df_to_allocate2 = df_to_allocate[df_to_allocate['FlowAmount'] != 0].drop( - columns='FlowAmountNew').reset_index(drop=True) - - # merge the original df with modified - # add column to original df for disaggregate_flag - df_load = df_load.assign(disaggregate_flag=0) - - # concat the two dfs and sort - df_c = pd.concat( - [df_load, df_to_allocate2], ignore_index=True).sort_values( - [sector_column]).reset_index(drop=True) - - df_c = replace_strings_with_NoneType(df_c).sort_values([sector_column]) - - return df_c +# def determine_flows_requiring_disaggregation( +# df_load, attr, method, sector_column): +# """ +# The MECS Land data provides FlowAmounts for NAICS3-6. We use BLS QCEW +# employment data to determine land use for different industries. To +# accurately estimate land use per industry, existing FlowAmounts for a +# particular NAICS level (NAICS6) for example, should be subtracted from +# the possible FlowAmounts for other NAICS6 that share the first 5 digits. +# For Example, there is data for '311', '3112', and '311221' in the 2014 +# dataset. FlowAmounts for allocation by employment for NAICS6 are based +# on the provided '3112' FlowAmounts. However, since there is data at one +# NAICS6 (311221), the FlowAmount for that NAICS6 should be subtracted +# from other NAICS6 to accurately depict the remaining 'FlowAmount' that +# requires a secondary source (Employment data) for allocation. +# :param df_load: df, EIA MECS Land FBA +# :param attr: dictionary, attribute data from method yaml for activity set +# :param method: dictionary, FBS method yaml +# :param sector_column: str, sector column to flag ('SectorProducedBy', +# 'SectorConsumedBy') +# :return: A dataframe with a column 'disaggregate_flag', if '1', +# row requires secondary source to calculate +# FlowAmount, if '0' FlowAmount does not require modifications +# """ +# +# from flowsa.sectormapping import add_sectors_to_flowbyactivity +# +# df_load = replace_NoneType_with_empty_cells(df_load) +# # drop rows where there is no value in sector column, which might occur if +# # sector-like activities have a "-" in them +# df_load = df_load[df_load[sector_column] != ''] +# +# # determine activity column +# if sector_column == 'SectorConsumedBy': +# activity_column = 'ActivityConsumedBy' +# else: +# activity_column = 'ActivityProducedBy' +# +# # original df - subset +# # subset cols of original df +# dfo = df_load[['FlowName', 'FlowAmount', 'Location', sector_column]] +# # min and max length +# min_length = min(df_load[sector_column].apply( +# lambda x: len(str(x))).unique()) +# max_length = max(df_load[sector_column].apply( +# lambda x: len(str(x))).unique()) +# # subset by sector length, creating a df +# for s in range(min_length, max_length + 1): +# df_name = 'dfo_naics' + str(s) +# vars()[df_name] = dfo[dfo[sector_column].apply( +# lambda x: len(x) == s)].reset_index(drop=True) +# vars()[df_name] = vars()[df_name].assign( +# SectorMatch=vars()[df_name][sector_column].apply( +# lambda x: x[:len(x) - 1])) +# # loop through the dfs, merging by sector match. If there is a match, +# # subtract the value, if there is not a match, drop last digit in +# # sectormatch, add row to the next df, and repeat +# df_merged = pd.DataFrame() +# df_not_merged = pd.DataFrame() +# for s in range(max_length, min_length, -1): +# df_name_1 = 'dfo_naics' + str(s - 1) +# df_name_2 = 'dfo_naics' + str(s) +# # concat df 1 with df_not_merged +# df2 = pd.concat([vars()[df_name_2], df_not_merged]) +# df2 = df2.rename( +# columns={'FlowAmount': 'SubtractFlow', sector_column: 'Sector'}) +# df_m = pd.merge( +# vars()[df_name_1][['FlowName', 'FlowAmount', 'Location', +# sector_column]], +# df2, left_on=['FlowName', 'Location', sector_column], +# right_on=['FlowName', 'Location', 'SectorMatch'], +# indicator=True, how='outer') +# # subset by merge and append to appropriate df +# df_both = df_m[df_m['_merge'] == 'both'] +# if len(df_both) != 0: +# # drop columns +# df_both1 = df_both.drop( +# columns=['Sector', 'SectorMatch', '_merge']) +# # aggregate before subtracting +# df_both2 = df_both1.groupby( +# ['FlowName', 'FlowAmount', 'Location', sector_column], +# as_index=False).agg({"SubtractFlow": sum}) +# df_both3 = df_both2.assign( +# FlowAmount=df_both2['FlowAmount'] - df_both2['SubtractFlow']) +# df_both3 = df_both3.drop(columns=['SubtractFlow']) +# # drop rows where 0 +# # df_both = df_both[df_both['FlowAmount'] != 0] +# df_merged = pd.concat([df_merged, df_both3], ignore_index=True) +# df_right = df_m[df_m['_merge'] == 'right_only'] +# if len(df_right) != 0: +# df_right = df_right.drop( +# columns=['FlowAmount', sector_column, '_merge']) +# df_right = df_right.rename(columns={'SubtractFlow': 'FlowAmount', +# 'Sector': sector_column}) +# # remove another digit from Sectormatch +# df_right = df_right.assign(SectorMatch=df_right[ +# sector_column].apply(lambda x: x[:(s - 2)])) +# # reorder +# df_right = df_right[['FlowName', 'FlowAmount', 'Location', +# sector_column, 'SectorMatch']] +# df_not_merged = pd.concat([df_not_merged, df_right], +# ignore_index=True) +# # rename the flowamount column +# df_merged = df_merged.rename(columns={'FlowAmount': 'FlowAmountNew', +# sector_column: activity_column}) +# # In the original EIA MECS df, some of the NAICS 6-digit codes sum +# # to a value greater than published NAICS3, due to rounding. In these +# # cases, the new FlowAmount is a negative number. Reset neg numbers to 0 +# df_merged.loc[df_merged['FlowAmountNew'] < 0, 'FlowAmountNew'] = 0 +# # in the original df, drop sector columns re-add sectors, this time with +# # sectors = 'aggregated' +# dfn = df_load.drop(columns=['SectorProducedBy', 'ProducedBySectorType', +# 'SectorConsumedBy', 'ConsumedBySectorType', +# 'SectorSourceName']) +# dfn = add_sectors_to_flowbyactivity( +# dfn, sectorsourcename=method['target_sector_source'], +# overwrite_sectorlevel='aggregated') +# # add column noting that these columns require an allocation ratio +# dfn = dfn.assign(disaggregate_flag=1) +# # create lists of sectors to drop +# list_original = df_load[activity_column].drop_duplicates().tolist() +# # drop values in original df +# dfn2 = dfn[~dfn[sector_column].isin(list_original)].sort_values( +# [activity_column, sector_column]).reset_index(drop=True) +# # drop the sectors that are duplicated by different naics being +# # mapped to naics6 +# if len(dfn2[dfn2.duplicated(subset=['FlowName', 'Location', sector_column], +# keep=False)]) > 0: +# dfn2.drop_duplicates(subset=['FlowName', 'Location', sector_column], +# keep='last', inplace=True) +# # want to allocate at NAICS6, so drop all other sectors +# dfn2 = \ +# dfn2[dfn2[sector_column].apply(lambda x: len(x) == 6)].reset_index( +# drop=True).sort_values([sector_column]) +# +# # merge revised flowamounts back with modified original df +# df_to_allocate = dfn2.merge(df_merged, how='left') +# # replace FlowAmount with newly calculated FlowAmount, +# # which represents Flows that are currently unaccounted for at NAICS6 +# df_to_allocate['FlowAmount'] = np.where( +# df_to_allocate['FlowAmountNew'].notnull(), +# df_to_allocate['FlowAmountNew'], df_to_allocate['FlowAmount']) +# # drop rows where flow amount = 0 - flows are captured through other NAICS6 +# df_to_allocate2 = df_to_allocate[df_to_allocate['FlowAmount'] != 0].drop( +# columns='FlowAmountNew').reset_index(drop=True) +# +# # merge the original df with modified +# # add column to original df for disaggregate_flag +# df_load = df_load.assign(disaggregate_flag=0) +# +# # concat the two dfs and sort +# df_c = pd.concat( +# [df_load, df_to_allocate2], ignore_index=True).sort_values( +# [sector_column]).reset_index(drop=True) +# +# df_c = replace_strings_with_NoneType(df_c).sort_values([sector_column]) +# +# return df_c diff --git a/flowsa/data_source_scripts/USDA_CoA_Cropland.py b/flowsa/data_source_scripts/USDA_CoA_Cropland.py index 1133d6b72..19b1065b5 100644 --- a/flowsa/data_source_scripts/USDA_CoA_Cropland.py +++ b/flowsa/data_source_scripts/USDA_CoA_Cropland.py @@ -257,7 +257,7 @@ def coa_nonirrigated_cropland_fba_cleanup(fba, **kwargs): # when include 'area harvested' and 'area in production' in # single dataframe, which is necessary to include woody crops, # 'vegetable totals' are double counted - fba = fba[~((fba['FlowName'] == 'AREA IN PRODUCTION') & + fba = fba[~((fba['Flowable'] == 'AREA IN PRODUCTION') & (fba['ActivityConsumedBy'] == 'VEGETABLE TOTALS'))] # When using a mix of flow names, drop activities for ag land (naics 11) @@ -270,320 +270,321 @@ def coa_nonirrigated_cropland_fba_cleanup(fba, **kwargs): return fba - -def disaggregate_coa_cropland_to_6_digit_naics( - fba_w_sector, attr, method, **kwargs): - """ - Disaggregate usda coa cropland to naics 6 - :param fba_w_sector: df, CoA cropland data, FBA format with sector columns - :param attr: dictionary, attribute data from method yaml for activity set - :param method: dictionary, FBS method yaml - :param kwargs: dictionary, arguments that might be required for other - functions. Currently includes data source name. - :return: df, CoA cropland with disaggregated NAICS sectors - """ - - # define the activity and sector columns to base modifications on - # these definitions will vary dependent on class type - sector_col = 'SectorConsumedBy' - - # drop rows without assigned sectors - fba_w_sector = fba_w_sector[ - ~fba_w_sector[sector_col].isna()].reset_index(drop=True) - - # modify the flowamounts related to the 6 naics 'orchards' are mapped to - fba_w_sector = fba_w_sector.equally_attribute() - # fba_w_sector = equal_allocation(fba_w_sector) - - # use ratios of usda 'land in farms' to determine animal use of - # pasturelands at 6 digit naics - fba_w_sector = disaggregate_pastureland( - fba_w_sector, attr, method, year=attr['allocation_source_year'], - sector_column=sector_col, - download_FBA_if_missing=kwargs['download_FBA_if_missing']) - - # use ratios of usda 'harvested cropland' to determine missing 6 digit - # naics - fba_w_sector = disaggregate_cropland( - fba_w_sector, attr, method, year=attr['allocation_source_year'], - sector_column=sector_col, download_FBA_if_missing=kwargs[ - 'download_FBA_if_missing']) - - return fba_w_sector - - -def disaggregate_coa_cropland_to_6_digit_naics_for_water_withdrawal( - fba_w_sector_load, attr, method, **kwargs): - """ - Disaggregate usda coa cropland to naics 6 - :param fba_w_sector_load: df, CoA cropland data, FBA format with sector - columns - :param attr: dictionary, attribute data from method yaml for activity set - :param method: dictionary, FBS method yaml - :param kwargs: dictionary, arguments that might be required for other - functions. Currently includes data source name. - :return: df, CoA cropland with disaggregated NAICS sectors - """ - - # define the activity and sector columns to base modifications on - # these definitions will vary dependent on class type - sector_col = 'SectorConsumedBy' - - # drop rows without assigned sectors - fba_w_sector = fba_w_sector_load[~fba_w_sector_load[sector_col].isna()]\ - .reset_index(drop=True) - - # modify the flowamounts related to the 6 naics 'orchards' are mapped to - # fba_w_sector = equal_allocation(fba_w_sector) - fba_w_sector = fba_w_sector.equally_attribute() - - # todo: add back in once suppression fxn modified to accept non-naics - # like activities and mixed level final naics (naics6 and naics7) - # then estimate any suppressed data by equally allocating parent to - # child naics - # groupcols = list(fba_w_sector3.select_dtypes( - # include=['object', 'int']).columns) - # fba_w_sector = equally_allocate_suppressed_parent_to_child_naics( - # fba_w_sector, method, 'SectorConsumedBy', groupcols) - - # When using irrigated cropland, aggregate sectors to cropland and total - # ag land. Doing this because published values for irrigated harvested - # cropland do not include the water use for vegetables, woody crops, - # berries. - fba_w_sector = fba_w_sector[~fba_w_sector['ActivityConsumedBy'].isin( - ['AG LAND', 'AG LAND, CROPLAND, HARVESTED'])].reset_index(drop=True) - - # use ratios of usda 'land in farms' to determine animal use of - # pasturelands at 6 digit naics - # todo: update download fba if missing to use default input (download_sources_ok) - fba_w_sector = disaggregate_pastureland( - fba_w_sector, attr, method, year=fba_w_sector.config['year'], - sector_column=sector_col, download_FBA_if_missing=True, - parameter_drop=['1125']) - - # use ratios of usda 'harvested cropland' to determine missing 6 digit - # naics - # todo: update download fba if missing to use default input (download_sources_ok) - fba_w_sector = disaggregate_cropland( - fba_w_sector, attr, method, year=fba_w_sector.config['year'], - sector_column=sector_col, download_FBA_if_missing=True) - - return fba_w_sector - - -def disaggregate_pastureland(fba_w_sector, attr, method, year, - sector_column, download_FBA_if_missing, **kwargs): - """ - The USDA CoA Cropland irrigated pastureland data only links - to the 3 digit NAICS '112'. This function uses state - level CoA 'Land in Farms' to allocate the county level acreage data to - 6 digit NAICS. - :param fba_w_sector: df, the CoA Cropland dataframe after linked to sectors - :param attr: dictionary, attribute data from method yaml for activity set - :param method: string, methodname - :param year: str, year of data being disaggregated - :param sector_column: str, the sector column on which to make df - modifications (SectorProducedBy or SectorConsumedBy) - :param download_FBA_if_missing: bool, if True will attempt to load - FBAS used in generating the FBS from remote server prior to - generating if file not found locally - :return: df, the CoA cropland dataframe with disaggregated pastureland data - """ - - # tmp drop NoneTypes - fba_w_sector = replace_NoneType_with_empty_cells(fba_w_sector) - - # subset the coa data so only pastureland - p = fba_w_sector.loc[fba_w_sector[sector_column].apply( - lambda x: x[0:3]) == '112'].reset_index(drop=True) - if len(p) != 0: - # add temp loc column for state fips - p = p.assign(Location_tmp=p['Location'].apply(lambda x: x[0:2])) - - # load usda coa cropland naics - df_f = load_fba_w_standardized_units( - datasource='USDA_CoA_Cropland_NAICS', year=year, flowclass='Land', - download_FBA_if_missing=download_FBA_if_missing) - # subset to land in farms data - df_f = df_f[df_f['FlowName'] == 'FARM OPERATIONS'] - # subset to rows related to pastureland - df_f = df_f.loc[df_f['ActivityConsumedBy'].apply( - lambda x: x[0:3]) == '112'] - # drop rows with "&' - df_f = df_f[~df_f['ActivityConsumedBy'].str.contains('&')] - if 'parameter_drop' in kwargs: - # drop aquaculture because pastureland not used for aquaculture - # drop any activities at a more aggregated sector level because - # will need to be reaggregated after dropping a parameter to - # accurately calculate the allocation ratios - drop_list = [sub[ : -1] for sub in kwargs['parameter_drop']] - drop_list = drop_list + kwargs['parameter_drop'] - df_f = df_f[~df_f['ActivityConsumedBy'].isin(drop_list)] - # create sector columns - df_f = add_sectors_to_flowbyactivity( - df_f, sectorsourcename=f"NAICS_{str(method['target_naics_year'])}_Code") - # estimate suppressed data by equal allocation - df_f = equally_allocate_suppressed_parent_to_child_naics( - df_f, method, 'SectorConsumedBy', fba_wsec_default_grouping_fields) - # create proportional ratios - group_cols = [e for e in fba_wsec_default_grouping_fields if - e not in ('ActivityProducedBy', 'ActivityConsumedBy')] - df_f = allocate_by_sector(df_f, attr, 'proportional', group_cols) - # tmp drop NoneTypes - df_f = replace_NoneType_with_empty_cells(df_f) - # drop naics = '11 - df_f = df_f[df_f[sector_column] != '11'] - # drop 000 in location - df_f = df_f.assign(Location=df_f['Location'].apply(lambda x: x[0:2])) - - # check units before merge - compare_df_units(p, df_f) - # merge the coa pastureland data with land in farm data - df = p.merge(df_f[[sector_column, 'Location', 'FlowAmountRatio']], - how='left', left_on="Location_tmp", right_on="Location") - # multiply the flowamount by the flowratio - df.loc[:, 'FlowAmount'] = df['FlowAmount'] * df['FlowAmountRatio'] - # drop columns and rename - df = df.drop(columns=['Location_tmp', sector_column + '_x', - 'Location_y', 'FlowAmountRatio']) - df = df.rename(columns={sector_column + '_y': sector_column, - "Location_x": 'Location'}) - - # drop rows where sector = 112 and then concat with - # original fba_w_sector - fba_w_sector = fba_w_sector[fba_w_sector[sector_column].apply( - lambda x: x[0:3]) != '112'].reset_index(drop=True) - fba_w_sector = pd.concat([fba_w_sector, df]).reset_index(drop=True) - - # fill empty cells with NoneType - fba_w_sector = replace_strings_with_NoneType(fba_w_sector) - - return fba_w_sector - - -def disaggregate_cropland(fba_w_sector, attr, method, year, - sector_column, download_FBA_if_missing): - """ - In the event there are 4 (or 5) digit naics for cropland - at the county level, use state level harvested cropland to - create ratios - :param fba_w_sector: df, CoA cropland data, FBA format with sector columns - :param attr: dictionary, attribute data from method yaml for activity set - :param method: string, method name - :param year: str, year of data - :param sector_column: str, the sector column on which to make - df modifications (SectorProducedBy or SectorConsumedBy) - :param download_FBA_if_missing: bool, if True will attempt to - load FBAS used in generating the FBS from remote server prior to - generating if file not found locally - :return: df, CoA cropland data disaggregated - """ - - # tmp drop NoneTypes - fba_w_sector = replace_NoneType_with_empty_cells(fba_w_sector) - - # drop pastureland data - crop = fba_w_sector.loc[fba_w_sector[sector_column].apply( - lambda x: x[0:3]) != '112'].reset_index(drop=True) - # drop sectors < 4 digits - crop = crop[crop[sector_column].apply( - lambda x: len(x) > 3)].reset_index(drop=True) - # create tmp location - crop = crop.assign(Location_tmp=crop['Location'].apply(lambda x: x[0:2])) - - # load the relevant state level harvested cropland by naics - naics = load_fba_w_standardized_units( - datasource="USDA_CoA_Cropland_NAICS", year=year, - flowclass='Land', download_FBA_if_missing=download_FBA_if_missing) - # subset the harvested cropland by naics - naics = naics[naics['FlowName'] == - 'AG LAND, CROPLAND, HARVESTED'].reset_index(drop=True) - # drop the activities that include '&' - naics = naics[~naics['ActivityConsumedBy'].str.contains( - '&')].reset_index(drop=True) - # add sectors - naics = add_sectors_to_flowbyactivity( - naics, sectorsourcename=f"NAICS_" - f"{str(method['target_naics_year'])}_Code") - # estimate suppressed data by equally allocating parent to child naics - naics = equally_allocate_suppressed_parent_to_child_naics( - naics, method, 'SectorConsumedBy', fba_wsec_default_grouping_fields) - - # aggregate sectors to create any missing naics levels - naics2 = sector_aggregation(naics) - # add missing naics5/6 when only one naics5/6 associated with a naics4 - naics3 = sector_disaggregation(naics2) - # create ratios - naics4 = sector_ratios(naics3, sector_column) - # create temporary sector column to match the two dfs on - naics4 = naics4.assign( - Location_tmp=naics4['Location'].apply(lambda x: x[0:2])) - # tmp drop Nonetypes - naics4 = replace_NoneType_with_empty_cells(naics4) - - # check units in prep for merge - compare_df_units(crop, naics4) - # for loop through naics lengths to determine - # naics 4 and 5 digits to disaggregate - for i in range(4, 6): - # subset df to sectors with length = i and length = i + 1 - crop_subset = crop.loc[crop[sector_column].apply( - lambda x: i + 1 >= len(x) >= i)] - crop_subset = crop_subset.assign( - Sector_tmp=crop_subset[sector_column].apply(lambda x: x[0:i])) - # if duplicates drop all rows - df = crop_subset.drop_duplicates( - subset=['Location', 'Sector_tmp'], - keep=False).reset_index(drop=True) - # drop sector temp column - df = df.drop(columns=["Sector_tmp"]) - # subset df to keep the sectors of length i - df_subset = df.loc[df[sector_column].apply(lambda x: len(x) == i)] - # subset the naics df where naics length is i + 1 - naics_subset = \ - naics4.loc[naics4[sector_column].apply( - lambda x: len(x) == i + 1)].reset_index(drop=True) - naics_subset = naics_subset.assign( - Sector_tmp=naics_subset[sector_column].apply(lambda x: x[0:i])) - # merge the two df based on locations - df_subset = pd.merge( - df_subset, naics_subset[[sector_column, 'FlowAmountRatio', - 'Sector_tmp', 'Location_tmp']], - how='left', left_on=[sector_column, 'Location_tmp'], - right_on=['Sector_tmp', 'Location_tmp']) - # create flow amounts for the new NAICS based on the flow ratio - df_subset.loc[:, 'FlowAmount'] = \ - df_subset['FlowAmount'] * df_subset['FlowAmountRatio'] - # drop rows of 0 and na - df_subset = df_subset[df_subset['FlowAmount'] != 0] - df_subset = df_subset[ - ~df_subset['FlowAmount'].isna()].reset_index(drop=True) - # drop columns - df_subset = df_subset.drop( - columns=[sector_column + '_x', 'FlowAmountRatio', 'Sector_tmp']) - # rename columns - df_subset = df_subset.rename( - columns={sector_column + '_y': sector_column}) - # tmp drop Nonetypes - df_subset = replace_NoneType_with_empty_cells(df_subset) - # add new rows of data to crop df - crop = pd.concat([crop, df_subset]).reset_index(drop=True) - - # clean up df - crop = crop.drop(columns=['Location_tmp']) - - # equally allocate any further missing naics - # crop = equally_allocate_parent_to_child_naics(crop, method) - crop = crop.equally_attribute() - - # pasture data - pasture = \ - fba_w_sector.loc[fba_w_sector[sector_column].apply( - lambda x: x[0:3]) == '112'].reset_index(drop=True) - # concat crop and pasture - fba_w_sector = pd.concat([pasture, crop]).reset_index(drop=True) - - # fill empty cells with NoneType - fba_w_sector = replace_strings_with_NoneType(fba_w_sector) - - return fba_w_sector +# todo: delete +# def disaggregate_coa_cropland_to_6_digit_naics( +# fba_w_sector, attr, method, **kwargs): +# """ +# Disaggregate usda coa cropland to naics 6 +# :param fba_w_sector: df, CoA cropland data, FBA format with sector columns +# :param attr: dictionary, attribute data from method yaml for activity set +# :param method: dictionary, FBS method yaml +# :param kwargs: dictionary, arguments that might be required for other +# functions. Currently includes data source name. +# :return: df, CoA cropland with disaggregated NAICS sectors +# """ +# +# # define the activity and sector columns to base modifications on +# # these definitions will vary dependent on class type +# sector_col = 'SectorConsumedBy' +# +# # drop rows without assigned sectors +# fba_w_sector = fba_w_sector[ +# ~fba_w_sector[sector_col].isna()].reset_index(drop=True) +# +# # modify the flowamounts related to the 6 naics 'orchards' are mapped to +# fba_w_sector = fba_w_sector.equally_attribute() +# # fba_w_sector = equal_allocation(fba_w_sector) +# +# # use ratios of usda 'land in farms' to determine animal use of +# # pasturelands at 6 digit naics +# fba_w_sector = disaggregate_pastureland( +# fba_w_sector, attr, method, year=attr['allocation_source_year'], +# sector_column=sector_col, +# download_FBA_if_missing=kwargs['download_FBA_if_missing']) +# +# # use ratios of usda 'harvested cropland' to determine missing 6 digit +# # naics +# fba_w_sector = disaggregate_cropland( +# fba_w_sector, attr, method, year=attr['allocation_source_year'], +# sector_column=sector_col, download_FBA_if_missing=kwargs[ +# 'download_FBA_if_missing']) +# +# return fba_w_sector + +# todo: delete +# def disaggregate_coa_cropland_to_6_digit_naics_for_water_withdrawal( +# fba_w_sector_load, attr, method, **kwargs): +# """ +# Disaggregate usda coa cropland to naics 6 +# :param fba_w_sector_load: df, CoA cropland data, FBA format with sector +# columns +# :param attr: dictionary, attribute data from method yaml for activity set +# :param method: dictionary, FBS method yaml +# :param kwargs: dictionary, arguments that might be required for other +# functions. Currently includes data source name. +# :return: df, CoA cropland with disaggregated NAICS sectors +# """ +# +# # define the activity and sector columns to base modifications on +# # these definitions will vary dependent on class type +# sector_col = 'SectorConsumedBy' +# +# # drop rows without assigned sectors +# fba_w_sector = fba_w_sector_load[~fba_w_sector_load[sector_col].isna()]\ +# .reset_index(drop=True) +# +# # modify the flowamounts related to the 6 naics 'orchards' are mapped to +# # fba_w_sector = equal_allocation(fba_w_sector) +# fba_w_sector = fba_w_sector.equally_attribute() +# +# # todo: add back in once suppression fxn modified to accept non-naics +# # like activities and mixed level final naics (naics6 and naics7) +# # then estimate any suppressed data by equally allocating parent to +# # child naics +# # groupcols = list(fba_w_sector3.select_dtypes( +# # include=['object', 'int']).columns) +# # fba_w_sector = equally_allocate_suppressed_parent_to_child_naics( +# # fba_w_sector, method, 'SectorConsumedBy', groupcols) +# +# # When using irrigated cropland, aggregate sectors to cropland and total +# # ag land. Doing this because published values for irrigated harvested +# # cropland do not include the water use for vegetables, woody crops, +# # berries. +# fba_w_sector = fba_w_sector[~fba_w_sector['ActivityConsumedBy'].isin( +# ['AG LAND', 'AG LAND, CROPLAND, HARVESTED'])].reset_index(drop=True) +# +# # use ratios of usda 'land in farms' to determine animal use of +# # pasturelands at 6 digit naics +# # todo: update download fba if missing to use default input (download_sources_ok) +# fba_w_sector = disaggregate_pastureland( +# fba_w_sector, attr, method, year=fba_w_sector.config['year'], +# sector_column=sector_col, download_FBA_if_missing=True, +# parameter_drop=['1125']) +# +# # use ratios of usda 'harvested cropland' to determine missing 6 digit +# # naics +# # todo: update download fba if missing to use default input (download_sources_ok) +# fba_w_sector = disaggregate_cropland( +# fba_w_sector, attr, method, year=fba_w_sector.config['year'], +# sector_column=sector_col, download_FBA_if_missing=True) +# +# return fba_w_sector + + +# def disaggregate_pastureland(fba_w_sector, attr, method, year, +# sector_column, download_FBA_if_missing, **kwargs): +# """ +# The USDA CoA Cropland irrigated pastureland data only links +# to the 3 digit NAICS '112'. This function uses state +# level CoA 'Land in Farms' to allocate the county level acreage data to +# 6 digit NAICS. +# :param fba_w_sector: df, the CoA Cropland dataframe after linked to sectors +# :param attr: dictionary, attribute data from method yaml for activity set +# :param method: string, methodname +# :param year: str, year of data being disaggregated +# :param sector_column: str, the sector column on which to make df +# modifications (SectorProducedBy or SectorConsumedBy) +# :param download_FBA_if_missing: bool, if True will attempt to load +# FBAS used in generating the FBS from remote server prior to +# generating if file not found locally +# :return: df, the CoA cropland dataframe with disaggregated pastureland data +# """ +# +# # tmp drop NoneTypes +# # fba_w_sector = replace_NoneType_with_empty_cells(fba_w_sector) +# +# # subset the coa data so only pastureland +# # p = fba_w_sector.loc[fba_w_sector[sector_column].apply( +# # lambda x: x[0:3]) == '112'].reset_index(drop=True) +# if len(p) != 0: +# # add temp loc column for state fips +# # p = p.assign(Location_tmp=p['Location'].apply(lambda x: x[0:2])) +# +# # todo: need to only attribute to target sectors here +# # load usda coa cropland naics +# # df_f = load_fba_w_standardized_units( +# # datasource='USDA_CoA_Cropland_NAICS', year=year, flowclass='Land', +# # download_FBA_if_missing=download_FBA_if_missing) +# # subset to land in farms data +# # df_f = df_f[df_f['FlowName'] == 'FARM OPERATIONS'] +# # subset to rows related to pastureland +# # df_f = df_f.loc[df_f['ActivityConsumedBy'].apply( +# # lambda x: x[0:3]) == '112'] +# # # drop rows with "&' +# # df_f = df_f[~df_f['ActivityConsumedBy'].str.contains('&')] +# # if 'parameter_drop' in kwargs: +# # # drop aquaculture because pastureland not used for aquaculture +# # # drop any activities at a more aggregated sector level because +# # # will need to be reaggregated after dropping a parameter to +# # # accurately calculate the allocation ratios +# # drop_list = [sub[ : -1] for sub in kwargs['parameter_drop']] +# # drop_list = drop_list + kwargs['parameter_drop'] +# # df_f = df_f[~df_f['ActivityConsumedBy'].isin(drop_list)] +# # create sector columns +# # df_f = add_sectors_to_flowbyactivity( +# # df_f, sectorsourcename=f"NAICS_{str(method['target_naics_year'])}_Code") +# # estimate suppressed data by equal allocation +# df_f = equally_allocate_suppressed_parent_to_child_naics( +# df_f, method, 'SectorConsumedBy', fba_wsec_default_grouping_fields) +# # create proportional ratios +# group_cols = [e for e in fba_wsec_default_grouping_fields if +# e not in ('ActivityProducedBy', 'ActivityConsumedBy')] +# df_f = allocate_by_sector(df_f, attr, 'proportional', group_cols) +# # tmp drop NoneTypes +# df_f = replace_NoneType_with_empty_cells(df_f) +# # drop naics = '11 +# df_f = df_f[df_f[sector_column] != '11'] +# # drop 000 in location +# df_f = df_f.assign(Location=df_f['Location'].apply(lambda x: x[0:2])) +# +# # check units before merge +# compare_df_units(p, df_f) +# # merge the coa pastureland data with land in farm data +# df = p.merge(df_f[[sector_column, 'Location', 'FlowAmountRatio']], +# how='left', left_on="Location_tmp", right_on="Location") +# # multiply the flowamount by the flowratio +# df.loc[:, 'FlowAmount'] = df['FlowAmount'] * df['FlowAmountRatio'] +# # drop columns and rename +# df = df.drop(columns=['Location_tmp', sector_column + '_x', +# 'Location_y', 'FlowAmountRatio']) +# df = df.rename(columns={sector_column + '_y': sector_column, +# "Location_x": 'Location'}) +# +# # drop rows where sector = 112 and then concat with +# # original fba_w_sector +# fba_w_sector = fba_w_sector[fba_w_sector[sector_column].apply( +# lambda x: x[0:3]) != '112'].reset_index(drop=True) +# fba_w_sector = pd.concat([fba_w_sector, df]).reset_index(drop=True) +# +# # fill empty cells with NoneType +# fba_w_sector = replace_strings_with_NoneType(fba_w_sector) +# +# return fba_w_sector + +# todo: delete +# def disaggregate_cropland(fba_w_sector, attr, method, year, +# sector_column, download_FBA_if_missing): +# """ +# In the event there are 4 (or 5) digit naics for cropland +# at the county level, use state level harvested cropland to +# create ratios +# :param fba_w_sector: df, CoA cropland data, FBA format with sector columns +# :param attr: dictionary, attribute data from method yaml for activity set +# :param method: string, method name +# :param year: str, year of data +# :param sector_column: str, the sector column on which to make +# df modifications (SectorProducedBy or SectorConsumedBy) +# :param download_FBA_if_missing: bool, if True will attempt to +# load FBAS used in generating the FBS from remote server prior to +# generating if file not found locally +# :return: df, CoA cropland data disaggregated +# """ +# +# # tmp drop NoneTypes +# # fba_w_sector = replace_NoneType_with_empty_cells(fba_w_sector) +# # +# # # drop pastureland data +# # crop = fba_w_sector.loc[fba_w_sector[sector_column].apply( +# # lambda x: x[0:3]) != '112'].reset_index(drop=True) +# # # drop sectors < 4 digits +# # crop = crop[crop[sector_column].apply( +# # lambda x: len(x) > 3)].reset_index(drop=True) +# # # create tmp location +# # crop = crop.assign(Location_tmp=crop['Location'].apply(lambda x: x[0:2])) +# # +# # # load the relevant state level harvested cropland by naics +# # naics = load_fba_w_standardized_units( +# # datasource="USDA_CoA_Cropland_NAICS", year=year, +# # flowclass='Land', download_FBA_if_missing=download_FBA_if_missing) +# # # subset the harvested cropland by naics +# # naics = naics[naics['FlowName'] == +# # 'AG LAND, CROPLAND, HARVESTED'].reset_index(drop=True) +# # # drop the activities that include '&' +# # naics = naics[~naics['ActivityConsumedBy'].str.contains( +# # '&')].reset_index(drop=True) +# # # add sectors +# # naics = add_sectors_to_flowbyactivity( +# # naics, sectorsourcename=f"NAICS_" +# # f"{str(method['target_naics_year'])}_Code") +# # # estimate suppressed data by equally allocating parent to child naics +# # naics = equally_allocate_suppressed_parent_to_child_naics( +# # naics, method, 'SectorConsumedBy', fba_wsec_default_grouping_fields) +# # +# # # aggregate sectors to create any missing naics levels +# # naics2 = sector_aggregation(naics) +# # # add missing naics5/6 when only one naics5/6 associated with a naics4 +# # naics3 = sector_disaggregation(naics2) +# # # create ratios +# # naics4 = sector_ratios(naics3, sector_column) +# # # create temporary sector column to match the two dfs on +# # naics4 = naics4.assign( +# # Location_tmp=naics4['Location'].apply(lambda x: x[0:2])) +# # # tmp drop Nonetypes +# # naics4 = replace_NoneType_with_empty_cells(naics4) +# # +# # # check units in prep for merge +# # compare_df_units(crop, naics4) +# # # for loop through naics lengths to determine +# # # naics 4 and 5 digits to disaggregate +# # for i in range(4, 6): +# # # subset df to sectors with length = i and length = i + 1 +# # crop_subset = crop.loc[crop[sector_column].apply( +# # lambda x: i + 1 >= len(x) >= i)] +# # crop_subset = crop_subset.assign( +# # Sector_tmp=crop_subset[sector_column].apply(lambda x: x[0:i])) +# # # if duplicates drop all rows +# # df = crop_subset.drop_duplicates( +# # subset=['Location', 'Sector_tmp'], +# # keep=False).reset_index(drop=True) +# # # drop sector temp column +# # df = df.drop(columns=["Sector_tmp"]) +# # # subset df to keep the sectors of length i +# # df_subset = df.loc[df[sector_column].apply(lambda x: len(x) == i)] +# # # subset the naics df where naics length is i + 1 +# # naics_subset = \ +# # naics4.loc[naics4[sector_column].apply( +# # lambda x: len(x) == i + 1)].reset_index(drop=True) +# # naics_subset = naics_subset.assign( +# # Sector_tmp=naics_subset[sector_column].apply(lambda x: x[0:i])) +# # # merge the two df based on locations +# # df_subset = pd.merge( +# # df_subset, naics_subset[[sector_column, 'FlowAmountRatio', +# # 'Sector_tmp', 'Location_tmp']], +# # how='left', left_on=[sector_column, 'Location_tmp'], +# # right_on=['Sector_tmp', 'Location_tmp']) +# # # create flow amounts for the new NAICS based on the flow ratio +# # df_subset.loc[:, 'FlowAmount'] = \ +# # df_subset['FlowAmount'] * df_subset['FlowAmountRatio'] +# # # drop rows of 0 and na +# # df_subset = df_subset[df_subset['FlowAmount'] != 0] +# # df_subset = df_subset[ +# # ~df_subset['FlowAmount'].isna()].reset_index(drop=True) +# # # drop columns +# # df_subset = df_subset.drop( +# # columns=[sector_column + '_x', 'FlowAmountRatio', 'Sector_tmp']) +# # # rename columns +# # df_subset = df_subset.rename( +# # columns={sector_column + '_y': sector_column}) +# # # tmp drop Nonetypes +# # df_subset = replace_NoneType_with_empty_cells(df_subset) +# # # add new rows of data to crop df +# # crop = pd.concat([crop, df_subset]).reset_index(drop=True) +# +# # clean up df +# crop = crop.drop(columns=['Location_tmp']) +# +# # equally allocate any further missing naics +# # crop = equally_allocate_parent_to_child_naics(crop, method) +# crop = crop.equally_attribute() +# +# # pasture data +# pasture = \ +# fba_w_sector.loc[fba_w_sector[sector_column].apply( +# lambda x: x[0:3]) == '112'].reset_index(drop=True) +# # concat crop and pasture +# fba_w_sector = pd.concat([pasture, crop]).reset_index(drop=True) +# +# # fill empty cells with NoneType +# fba_w_sector = replace_strings_with_NoneType(fba_w_sector) +# +# return fba_w_sector diff --git a/flowsa/data_source_scripts/USDA_CoA_Cropland_NAICS.py b/flowsa/data_source_scripts/USDA_CoA_Cropland_NAICS.py index 004147140..6592f4d4f 100644 --- a/flowsa/data_source_scripts/USDA_CoA_Cropland_NAICS.py +++ b/flowsa/data_source_scripts/USDA_CoA_Cropland_NAICS.py @@ -154,18 +154,18 @@ def coa_cropland_NAICS_parse(*, df_list, year, **_): df['DataCollection'] = 2 return df - -def coa_cropland_naics_fba_wsec_cleanup(fba_w_sector, **kwargs): - """ - Clean up the land fba for use in allocation - :param fba_w_sector: df, coa cropland naics flowbyactivity - with sector columns - :param kwargs: dictionary, requires df sourcename - :return: df, flowbyactivity with modified values - """ - - method = kwargs.get('method') - df = equally_allocate_suppressed_parent_to_child_naics( - fba_w_sector, method, 'SectorConsumedBy', - fba_wsec_default_grouping_fields) - return df +# todo: delete +# def coa_cropland_naics_fba_wsec_cleanup(fba_w_sector, **kwargs): +# """ +# Clean up the land fba for use in allocation +# :param fba_w_sector: df, coa cropland naics flowbyactivity +# with sector columns +# :param kwargs: dictionary, requires df sourcename +# :return: df, flowbyactivity with modified values +# """ +# +# method = kwargs.get('method') +# df = equally_allocate_suppressed_parent_to_child_naics( +# fba_w_sector, method, 'SectorConsumedBy', +# fba_wsec_default_grouping_fields) +# return df diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index 7e98278e5..87e15a067 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -182,8 +182,6 @@ def eia_mecs_energy_parse(*, df_list, source, year, **_): # concatenate dataframe list into single dataframe df = pd.concat(df_list, sort=True) - print(df['Table Name'].unique()) - # rename columns to match standard flowbyactivity format df = df.rename(columns={'NAICS Code': 'ActivityConsumedBy', 'Table Name': 'Description'}) From 76fde921900384029ea6798250633d8ea20ae544 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 23 Mar 2023 16:21:10 -0600 Subject: [PATCH 0396/1127] updates to land fbs yaml - recursive modeling --- .../Land_national_2012.yaml | 252 +++++++++--------- 1 file changed, 129 insertions(+), 123 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Land_national_2012.yaml b/flowsa/methods/flowbysectormethods/Land_national_2012.yaml index bf34f4742..19b06d33e 100644 --- a/flowsa/methods/flowbysectormethods/Land_national_2012.yaml +++ b/flowsa/methods/flowbysectormethods/Land_national_2012.yaml @@ -3,151 +3,157 @@ # 'USDA_ERS_MLU' for FBS creation because the results of the two allocated # datasets are used within USDA_ERS_MLU sector attribution --- +industry_spec: + default: NAICS_6 +year: 2015 +target_naics_year: 2012 +geoscale: national -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: national source_names: - "EIA_CBECS_Land": # commercial land use - data_format: 'FBA' - class: Land - geoscale_to_use: national - source_fba_load_scale: national + EIA_CBECS_Land: # commercial land use + fedefl_mapping: EIA_CBECS_Land year: 2012 - clean_fba_df_fxn: !script_function:EIA_CBECS_Land cbecs_land_fba_cleanup + selection_fields: + Class: Land + Location: !include:Location_common.yaml:_national_location + clean_fba: !script_function:EIA_CBECS_Land cbecs_land_fba_cleanup activity_sets: cbecs_land: # all activities in eia cbecs land crosswalk - names: !from_index:EIA_CBECS_Land_2012_asets.csv cbecs_land - allocation_method: proportional - allocation_source: "BLS_QCEW" - allocation_source_class: "Employment" - allocation_source_year: 2012 - allocation_from_scale: national - allocation_fba_load_scale: national - clean_allocation_fba_w_sec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec + selection_fields: + PrimaryActivity: !from_index:EIA_CBECS_Land_2012_asets.csv cbecs_land + attribution_method: proportional + attribution_source: + Employment_national_2012: + data_format: FBS + year: 2012 "EIA_MECS_Land": # manufacturing land use - data_format: 'FBA' - class: Land - geoscale_to_use: national + fedefl_mapping: EIA_MECS_Land year: 2014 - clean_fba_df_fxn: !script_function:EIA_MECS mecs_land_fba_cleanup_for_land_2012_fbs - clean_fba_w_sec_df_fxn: !script_function:EIA_MECS mecs_land_clean_allocation_mapped_fba_w_sec + selection_fields: + Class: Land + Location: !include:Location_common.yaml:_national_location + FlowName: "Approximate Enclosed Floorspace of All Buildings Onsite" + Year: {2014: 2012} # replace year to align with method year + clean_fba: !script_function:EIA_MECS mecs_land_fba_cleanup activity_sets: mecs_land: # all activities in eia mecs land crosswalk - names: !from_index:EIA_MECS_Land_2014_asets.csv mecs_land - allocation_method: proportional-flagged - allocation_source: "BLS_QCEW" - allocation_source_class: "Employment" - allocation_source_year: 2014 - allocation_from_scale: national - allocation_fba_load_scale: national - clean_allocation_fba_w_sec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec + selection_fields: + PrimaryActivity: !from_index:EIA_MECS_Land_2014_asets.csv mecs_land + attribution_method: proportional + attribution_source: + Employment_national_2014: + data_format: FBS + year: 2014 "BLM_PLS": - data_format: 'FBA' - class: Land - geoscale_to_use: national + fedefl_mapping: BLM_PLS year: 2012 + selection_fields: + Class: Land + Location: !include:Location_common.yaml:_national_location activity_sets: general_mining: # all blm pls activities other than hardrock - names: !from_index:BLM_PLS_2012_asets.csv general_mining - allocation_method: direct - allocation_from_scale: national + selection_fields: + PrimaryActivity: !from_index:BLM_PLS_2012_asets.csv general_mining + attribution_method: direct hardrock_mining: - names: !from_index:BLM_PLS_2012_asets.csv hardrock_mining - allocation_method: proportional - allocation_source: "BLS_QCEW" - allocation_source_class: "Employment" - allocation_source_year: 2012 - allocation_from_scale: national - allocation_fba_load_scale: national - clean_allocation_fba_w_sec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec + selection_fields: + PrimaryActivity: !from_index:BLM_PLS_2012_asets.csv hardrock_mining + attribution_method: proportional + attribution_source: + Employment_national_2012: + data_format: FBS + year: 2012 "USDA_ERS_MLU": - data_format: 'FBA' - class: Land - geoscale_to_use: state + fedefl_mapping: USDA_ERS_MLU year: 2012 + selection_fields: + Class: Land + Location: !include:Location_common.yaml:_state_location activity_sets: - activity_set_1: - names: + cropland_crops: + selection_fields: + PrimaryActivity: - 'Cropland used for crops' - allocation_method: proportional - allocation_source: "USDA_CoA_Cropland" - allocation_source_class: "Land" - allocation_source_year: 2012 - allocation_flow: - - "AREA HARVESTED" - - "AREA" - - "AREA IN PRODUCTION" - - 'AREA BEARING & NON-BEARING' - - 'AREA GROWN' - allocation_from_scale: state - clean_allocation_fba: !script_function:USDA_CoA_Cropland coa_nonirrigated_cropland_fba_cleanup - clean_allocation_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics - activity_set_2: - names: - 'Cropland idled' - allocation_method: proportional - allocation_source: "USDA_CoA_Cropland" - allocation_source_class: "Land" - allocation_source_year: 2012 - allocation_flow: - - "AREA HARVESTED" - - "AREA" - - "AREA IN PRODUCTION" - - 'AREA BEARING & NON-BEARING' - - 'AREA GROWN' - allocation_from_scale: state - clean_allocation_fba: !script_function:USDA_CoA_Cropland coa_nonirrigated_cropland_fba_cleanup - clean_allocation_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics - activity_set_3: - names: + attribution_method: proportional + attribution_source: + "USDA_CoA_Cropland": + year: 2012 + selection_fields: + Class: "Land" + FlowName: + - "AREA HARVESTED" + - "AREA" + - "AREA IN PRODUCTION" + - 'AREA BEARING & NON-BEARING' + - 'AREA GROWN' + Location: !include:Location_common.yaml:_state_location + clean_fba: !script_function:USDA_CoA_Cropland coa_nonirrigated_cropland_fba_cleanup + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + year: 2017 + selection_fields: + Class: Land + FlowName: + - "FARM OPERATIONS" + estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_sectors_equal_attribution + selection_fields_after_data_suppression_estimation: + PrimaryActivity: [ "112111", "112112", "11212", "1122", + "11231", "11232", "11233", "11234", + "11239", "11241", "11242", "11291", + "11292", "11293", "11299" ] + pastureland: + selection_fields: + PrimaryActivity: - 'Cropland used for pasture' - 'Forest-use land grazed' - 'Grassland pasture and range' - allocation_method: proportional - allocation_source: "USDA_CoA_Cropland_NAICS" - allocation_source_class: "Land" - allocation_source_year: 2012 - allocation_flow: - - "FARM OPERATIONS" - allocation_from_scale: state - clean_allocation_fba_w_sec: !script_function:USDA_CoA_Cropland_NAICS coa_cropland_naics_fba_wsec_cleanup - activity_set_4: - names: + attribution_method: proportional + attribution_source: + "USDA_CoA_Cropland_NAICS": + year: 2012 + selection_fields: + Class: "Land" + FlowName: "FARM OPERATIONS" + estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_sectors_equal_attribution + forest: + selection_fields: + PrimaryActivity: - 'Forest-use land not grazed' - 'Land in defense and industrial areas' - 'Land in rural parks and wildlife areas' - allocation_method: direct - allocation_from_scale: state - activity_set_5: - names: - - 'Land in rural transportation facilities' - allocation_method: allocation_function - allocation_source: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_land_in_rural_transportation_areas - literature_sources: { - "urban_land_use_for_airports": "2020", - "urban_land_use_for_railroads": "2020", - "transportation_sectors_based_on_FHA_fees": "1997"} - allocation_from_scale: national - activity_set_6: - names: - - 'Land in urban areas' - geoscale_to_use: national - allocation_method: allocation_function - allocation_source: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_land_in_urban_areas - literature_sources: { - "area_of_urban_land_occupied_by_houses_2013": "2017", - "transportation_sectors_based_on_FHA_fees": "1997", - "urban_land_use_for_airports": "2020", - "urban_land_use_for_railroads": "2020", - "open_space_fraction_of_urban_area": "2020"} - allocation_from_scale: national - activity_set_7: - names: - - 'Other land' - geoscale_to_use: national - allocation_method: allocation_function - allocation_source: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_other_land - literature_sources: { - "area_of_rural_land_occupied_by_houses_2013": "2017" } - allocation_from_scale: national + attribution_method: direct +# rural_transportation: +# selection_fields: +# PrimaryActivity: +# - 'Land in rural transportation facilities' +# attribution_method: allocation_function +# attribution_source: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_land_in_rural_transportation_areas +# literature_sources: { +# "urban_land_use_for_airports": "2020", +# "urban_land_use_for_railroads": "2020", +# "transportation_sectors_based_on_FHA_fees": "1997"} +# geoscale: national +# urban: +# selection_fields: +# PrimaryActivity: +# - 'Land in urban areas' +# attribution_method: allocation_function +# attribution_source: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_land_in_urban_areas +# literature_sources: { +# "area_of_urban_land_occupied_by_houses_2013": "2017", +# "transportation_sectors_based_on_FHA_fees": "1997", +# "urban_land_use_for_airports": "2020", +# "urban_land_use_for_railroads": "2020", +# "open_space_fraction_of_urban_area": "2020"} +# geoscale: national +# other: +# selection_fields: +# PrimaryActivity: +# - 'Other land' +# attribution_method: allocation_function +# attribution_source: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_other_land +# literature_sources: { +# "area_of_rural_land_occupied_by_houses_2013": "2017" } +# geoscale: national From ebc91b0fd5a0fb89835991f7b08e23414d4ea51b Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 23 Mar 2023 16:22:45 -0600 Subject: [PATCH 0397/1127] updates to water fbs yaml for recursive modeling --- .../Water_national_2015_m1.yaml | 67 ++++++++++++------- 1 file changed, 42 insertions(+), 25 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index 79371a91c..ed521aa93 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -38,7 +38,6 @@ source_names: default: NAICS_6 '111150': { default: NAICS_7 } '111199': { default: NAICS_7 } - '111940': { default: NAICS_7 } selection_fields: PrimaryActivity: - "Irrigation Crop" @@ -46,31 +45,32 @@ source_names: attribution_source: USDA_CoA_Cropland: year: 2017 + selection_fields: + Class: "Land" + FlowName: + - "AREA HARVESTED, IRRIGATED" + - "AREA IN PRODUCTION, IRRIGATED" + - "AREA, IRRIGATED" + - 'AREA BEARING & NON-BEARING, IRRIGATED' + - 'AREA GROWN, IRRIGATED' activity_sets: cropland_attribution-pastureland: selection_fields: - Class: "Land" - FlowName: - - "AREA HARVESTED, IRRIGATED" - - "AREA IN PRODUCTION, IRRIGATED" - - "AREA, IRRIGATED" - - 'AREA BEARING & NON-BEARING, IRRIGATED' - - 'AREA GROWN, IRRIGATED' PrimaryActivity: 'AG LAND, (EXCL HARVESTED CROPLAND)' attribution_method: proportional attribution_source: USDA_CoA_Cropland_NAICS: - # todo: estimate suppressed data year: 2017 selection_fields: Class: Land FlowName: - "FARM OPERATIONS" + estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_sectors_equal_attribution + selection_fields_after_data_suppression_estimation: PrimaryActivity: ["112111", "112112", "11212", "1122", "11231", "11232", "11233", "11234", "11239", "11241", "11242", "11291", "11292", "11293", "11299"] - estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_sectors_equal_attribution attribution_method: multiplication attribution_source: USDA_IWMS: &usda_iwms @@ -78,22 +78,8 @@ source_names: selection_fields: Class: Water estimate_suppressed: !script_function:USDA_IWMS estimate_suppressed_iwms -# attribution_method: proportional -# attribution_source: -# USDA_IWMS: -# year: 2018 -# selection_fields: -# Class: Land -# PrimaryActivity: ['HAY & HAYLAGE, (EXCL ALFALFA)', 'HAY & HAYLAGE, ALFALFA'] cropland_attribution-cropland: selection_fields: - Class: "Land" - FlowName: - - "AREA HARVESTED, IRRIGATED" - - "AREA IN PRODUCTION, IRRIGATED" - - "AREA, IRRIGATED" - - 'AREA BEARING & NON-BEARING, IRRIGATED' - - 'AREA GROWN, IRRIGATED' PrimaryActivity: ['SOYBEANS', 'CANOLA', 'FLAXSEED', 'MUSTARD, SEED', 'RAPESEED', 'SAFFLOWER', 'SESAME', 'SUNFLOWER', @@ -117,7 +103,6 @@ source_names: attribution_method: proportional attribution_source: USDA_CoA_Cropland_NAICS: - # todo: estimate suppressed NAICS year: 2017 selection_fields: Class: Land @@ -135,7 +120,39 @@ source_names: attribution_method: multiplication attribution_source: USDA_IWMS: + industry_spec: + default: NAICS_6 + '111150': { default: NAICS_7 } + '111199': { default: NAICS_7 } + '111940': { default: NAICS_7 } # hay and haylage set to NAICS7 - will update to NAICS6 <<: *usda_iwms + activity_sets: + cropland_attribution-cropland-nonhay: + selection_fields: + PrimaryActivity: ['BEANS, DRY EDIBLE, INCL CHICKPEAS', + 'BERRY TOTALS', 'CORN, GRAIN', + 'CORN, SILAGE', 'COTTON', 'CROPS, OTHER', + 'HORTICULTURE TOTALS', 'ORCHARDS', + 'PASTURELAND', 'PEANUTS', 'POTATOES', 'RICE', + 'SMALL GRAINS, OTHER', 'SORGHUM, GRAIN', + 'SOYBEANS', 'SWEET CORN', 'TOMATOES', + 'VEGETABLE TOTALS', 'WHEAT'] + cropland_attribution-cropland-hay: + selection_fields: + PrimaryActivity: ['HAY & HAYLAGE, (EXCL ALFALFA)', + 'HAY & HAYLAGE, ALFALFA'] + attribution_method: weighted_average + replacement_dictionary: {'HAY & HAYLAGE, (EXCL ALFALFA)': 'HAY & HAYLAGE', + 'HAY & HAYLAGE, ALFALFA': 'HAY & HAYLAGE', + '111940A': '111940', + '111940B': '111940'} + attribution_source: + USDA_IWMS: + year: 2018 + selection_fields: + Class: Land + PrimaryActivity: ['HAY & HAYLAGE, (EXCL ALFALFA)', 'HAY & HAYLAGE, ALFALFA'] + estimate_suppressed: !script_function:USDA_IWMS estimate_suppressed_iwms livestock_attribution: industry_spec: default: NAICS_6 From e32bd94b0f447a4d99e39bb345a123b8551ccd9b Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 23 Mar 2023 16:24:31 -0600 Subject: [PATCH 0398/1127] add "weighted_average" attribution methodology --- flowsa/flowby.py | 69 ++++++++++++++++++++++++++++++++++++++++++-- flowsa/validation.py | 28 +++++++++++++----- 2 files changed, 88 insertions(+), 9 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index ed6d1d84d..5adfdba5d 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1062,6 +1062,10 @@ def attribute_flows_to_sectors( attribution_fbs = fba.load_prepare_attribution_source() attributed_fba = fba.multiplication_attribution(attribution_fbs) + elif attribution_method == 'weighted_average': + attribution_fbs = fba.load_prepare_attribution_source() + attributed_fba = fba.weighted_average_attribution(attribution_fbs) + else: if all(fba.groupby('group_id')['group_id'].agg('count') == 1): log.info('No attribution needed for %s at the given industry ' @@ -1643,8 +1647,69 @@ def multiplication_attribution( .reset_index(drop=True) ) - # def flagged_proportionally_attribute(self: 'FlowByActivity'): - # raise NotImplementedError + def weighted_average_attribution( + self: 'FlowByActivity', + other: 'FlowBySector' + ) -> 'FlowByActivity': + """ + This method determines weighted average + """ + + log.info('Taking weighted average of %s by %s.', + self.full_name, other.full_name) + fba_geoscale, other_geoscale, fba, other = self.harmonize_geoscale( + other) + + # merge dfs + merged = (fba + .merge(other, + how='left', + left_on=['PrimarySector', 'temp_location' + if 'temp_location' in fba + else 'Location'], + right_on=['PrimarySector', 'Location'], + suffixes=[None, '_other']) + .fillna({'FlowAmount_other': 0}) + ) + # drop rows where flow is 0 + merged = merged[merged['FlowAmount'] != 0] + # replace terms + for original, replacement in self.config.get( + 'replacement_dictionary').items(): + merged = merged.replace({original: replacement}) + + wt_flow = (merged + .groupby(['Class', 'MetaSources', 'Flowable', 'Unit', + 'FlowType', 'ActivityProducedBy', + 'ActivityConsumedBy', 'Context', 'Location', + 'LocationSystem', 'Year', 'MeasureofSpread', + 'Spread', 'DistributionType', 'Min', 'Max', + 'DataReliability', 'DataCollection', + 'SectorProducedBy', 'ProducedBySectorType', + 'SectorConsumedBy', 'ConsumedBySectorType', + 'SectorSourceName'], + dropna=False) + .apply(lambda x: np.average(x['FlowAmount'], + weights=x['FlowAmount_other'])) + .drop(columns='FlowAmount') # original flowamounts + .reset_index(name='FlowAmount') # new, weighted flows + ) + # set attributes todo: revise above code so don't lose attributes + attributes_to_save = { + attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] + } + for attr in attributes_to_save: + setattr(wt_flow, attr, attributes_to_save[attr]) + + # reset dropped information + wt_flow = (wt_flow + .reset_index(drop=True).reset_index() + .rename(columns={'index': 'group_id'}) + .assign(group_total=wt_flow.FlowAmount) + ) + + return wt_flow + def prepare_fbs(self: 'FlowByActivity') -> 'FlowBySector': if 'activity_sets' in self.config: diff --git a/flowsa/validation.py b/flowsa/validation.py index caa043583..6f28cc9f4 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -304,11 +304,15 @@ def calculate_flowamount_diff_between_dfs(dfa_load, dfb_load): # Because code will sometimes change terminology, aggregate # data by context and flowable to compare df differences # subset df - dfs = df[['FlowName', 'Compartment', 'ActivityProducedBy', - 'ActivityConsumedBy', 'FlowAmount_Original', - 'FlowAmount_Modified', 'Unit', 'geoscale']] - agg_cols = ['FlowName', 'Compartment', 'ActivityProducedBy', - 'ActivityConsumedBy', 'Unit', 'geoscale'] + flowcols = ['FlowName', 'Compartment'] + if 'Flowable' in df.columns: + flowcols = ['Flowable', 'Context'] + dfs_cols = flowcols + ['ActivityProducedBy', 'ActivityConsumedBy', + 'FlowAmount_Original', 'FlowAmount_Modified', 'Unit', + 'geoscale'] + dfs = df[dfs_cols] + agg_cols = flowcols + ['ActivityProducedBy', 'ActivityConsumedBy', + 'Unit', 'geoscale'] dfagg = dfs.groupby( agg_cols, dropna=False, as_index=False).agg( {'FlowAmount_Original': sum, 'FlowAmount_Modified': sum}) @@ -327,8 +331,7 @@ def calculate_flowamount_diff_between_dfs(dfa_load, dfb_load): dfagg3 = replace_strings_with_NoneType(dfagg).drop( columns=['ActivityProducedBy', 'ActivityConsumedBy', 'FlowAmount_Difference', 'Percent_Difference']) - dfagg4 = dfagg3.groupby( - ['FlowName', 'Compartment', 'Unit', 'geoscale'], + dfagg4 = dfagg3.groupby(flowcols + ['Unit', 'geoscale'], dropna=False, as_index=False).agg( {'FlowAmount_Original': sum, 'FlowAmount_Modified': sum}) # column calculating difference @@ -965,6 +968,7 @@ def compare_FBS_results(fbs1, fbs2, ignore_metasources=False, df1 = flowsa.getFlowBySector(fbs1, download_FBS_if_missing=compare_to_remote ).rename(columns={'FlowAmount': 'FlowAmount_fbs1'}) + df1 = replace_strings_with_NoneType(df1) # load second file if compare_to_remote: @@ -978,6 +982,16 @@ def compare_FBS_results(fbs1, fbs2, ignore_metasources=False, df2 = flowsa.getFlowBySector(fbs2).rename( columns={'FlowAmount': 'FlowAmount_fbs2'}) df2 = replace_strings_with_NoneType(df2) + + # test + df1 = pd.DataFrame(df1) + df2 = pd.DataFrame(df2) + df1['Unit'] == 'm2' + df1['MeasureofSpread'] = df1['MeasureofSpread'].apply(lambda x: str(x)) + df1 = df1.drop(columns='MeasureofSpread') + df2 = df2.drop(columns='MeasureofSpread') + + # compare df merge_cols = list(df2.select_dtypes(include=[ 'object', 'int']).columns) From 70df9e1cb507e5f24aac4e3e6ed2ade587289e01 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 23 Mar 2023 16:26:21 -0600 Subject: [PATCH 0399/1127] move repeated code for attribution methods into new harmonize_geoscale() fxn --- flowsa/flowby.py | 62 +++++++++++++++++------------------------------- 1 file changed, 22 insertions(+), 40 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 5adfdba5d..47c4caab8 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1086,6 +1086,7 @@ def attribute_flows_to_sectors( # if the attribution method is not multiplication, check that new df # values equal original df values if attribution_method != 'multiplication': + # todo: add results from this if statement to validation log validation_fba = attributed_fba.assign( validation_total=(attributed_fba.groupby('group_id') ['FlowAmount'].transform('sum')) @@ -1440,21 +1441,14 @@ def equally_attribute(self: 'FlowByActivity') -> 'FlowByActivity': *[f'_unique_naics_{n}_by_group' for n in range(2, 8)]] ) - def proportionally_attribute( + def harmonize_geoscale( self: 'FlowByActivity', other: 'FlowBySector' ) -> 'FlowByActivity': - ''' - This method takes flows from the calling FBA which are mapped to - multiple sectors and attributes them to those sectors proportionally to - flows from other (an FBS). - ''' + fba_geoscale = geo.scale.from_string(self.config['geoscale']) other_geoscale = geo.scale.from_string(other.config['geoscale']) - log.info('Attributing flows in %s using %s.', - self.full_name, other.full_name) - if other_geoscale < fba_geoscale: log.info('Aggregating %s from %s to %s', other.full_name, other_geoscale, fba_geoscale) @@ -1484,6 +1478,23 @@ def proportionally_attribute( .reset_index() ) + return fba_geoscale, other_geoscale, fba, other + + def proportionally_attribute( + self: 'FlowByActivity', + other: 'FlowBySector' + ) -> 'FlowByActivity': + ''' + This method takes flows from the calling FBA which are mapped to + multiple sectors and attributes them to those sectors proportionally to + flows from other (an FBS). + ''' + + log.info('Attributing flows in %s using %s.', + self.full_name, other.full_name) + + fba_geoscale, other_geoscale, fba, other = self.harmonize_geoscale(other) + groupby_cols = ['group_id'] for rank in ['Primary', 'Secondary']: counted = fba.assign(group_count=(fba.groupby(groupby_cols) @@ -1571,40 +1582,11 @@ def multiplication_attribution( multiple sectors and multiplies them by flows from other (an FBS). """ - fba_geoscale = geo.scale.from_string(self.config['geoscale']) - other_geoscale = geo.scale.from_string(other.config['geoscale']) - log.info('Multiplying flows in %s by %s.', self.full_name, other.full_name) + fba_geoscale, other_geoscale, fba, other = self.harmonize_geoscale( + other) - if other_geoscale < fba_geoscale: - log.info('Aggregating %s from %s to %s', other.full_name, - other_geoscale, fba_geoscale) - other = ( - other - .convert_fips_to_geoscale(fba_geoscale) - .aggregate_flowby() - ) - elif other_geoscale > fba_geoscale: - log.info('%s is %s, while %s is %s, so attributing %s to ' - '%s', other.full_name, other_geoscale, self.full_name, - fba_geoscale, other_geoscale, fba_geoscale) - self = ( - self - .assign(temp_location=self.Location) - .convert_fips_to_geoscale(other_geoscale, - column='temp_location') - ) - - fba = self.add_primary_secondary_columns('Sector') - other = ( - other - .add_primary_secondary_columns('Sector') - [['PrimarySector', 'Location', 'FlowAmount', 'Unit']] - .groupby(['PrimarySector', 'Location', 'Unit']) - .agg('sum') - .reset_index() - ) # todo: update units after multiplying # multiply using each dfs primary sector col From 936db7b889a54256381e868918d99ce514156b08 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 23 Mar 2023 16:28:53 -0600 Subject: [PATCH 0400/1127] add units to attribution grouping - useful for multiplication methodology --- flowsa/flowby.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 47c4caab8..77147a6a6 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1472,8 +1472,8 @@ def harmonize_geoscale( other = ( other .add_primary_secondary_columns('Sector') - [['PrimarySector', 'Location', 'FlowAmount']] - .groupby(['PrimarySector', 'Location']) + [['PrimarySector', 'Location', 'FlowAmount', 'Unit']] + .groupby(['PrimarySector', 'Location', 'Unit']) .agg('sum') .reset_index() ) @@ -1559,10 +1559,12 @@ def proportionally_attribute( * x.FlowAmount_other / x.denominator)) .drop(columns=['PrimarySector_other', 'Location_other', - 'FlowAmount_other', 'denominator'], + 'FlowAmount_other', 'denominator', + 'Unit_other'], errors='ignore') ) - fba = pd.concat([directly_attributed, proportionally_attributed]) + fba = pd.concat([directly_attributed, + proportionally_attributed], ignore_index=True) groupby_cols.append(f'{rank}Sector') return ( @@ -1757,7 +1759,7 @@ def activity_sets(self) -> List['FlowByActivity']: .add_full_name( f'{parent_fba.full_name}{NAME_SEP_CHAR}{activity_set}') .select_by_fields( - selection_fields=activity_config['selection_fields']) + selection_fields=activity_config.get('selection_fields')) ) child_fba.config = {**parent_config, **activity_config} From 16efb9105da873f8e36040cd4179d2083cd42a5c Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 23 Mar 2023 16:29:28 -0600 Subject: [PATCH 0401/1127] option to select_by_fields after estimating suppressed data (and before) --- flowsa/flowby.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 77147a6a6..275d9a6c3 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1719,6 +1719,8 @@ def prepare_fbs(self: 'FlowByActivity') -> 'FlowBySector': .function_socket('clean_fba_before_mapping') .select_by_fields() .function_socket('estimate_suppressed') + .select_by_fields(selection_fields=self.config.get( + 'selection_fields_after_data_suppression_estimation')) .convert_units_and_flows() # and also map to flow lists .function_socket('clean_fba') .convert_to_geoscale() From e124087a7578164eefc5a611257dbf43eef9a2d4 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 23 Mar 2023 16:30:25 -0600 Subject: [PATCH 0402/1127] Revert "add "weighted_average" attribution methodology" This reverts commit e32bd94b0f447a4d99e39bb345a123b8551ccd9b. --- flowsa/flowby.py | 69 ++------------------------------------------ flowsa/validation.py | 28 +++++------------- 2 files changed, 9 insertions(+), 88 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 275d9a6c3..8dc73b480 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1062,10 +1062,6 @@ def attribute_flows_to_sectors( attribution_fbs = fba.load_prepare_attribution_source() attributed_fba = fba.multiplication_attribution(attribution_fbs) - elif attribution_method == 'weighted_average': - attribution_fbs = fba.load_prepare_attribution_source() - attributed_fba = fba.weighted_average_attribution(attribution_fbs) - else: if all(fba.groupby('group_id')['group_id'].agg('count') == 1): log.info('No attribution needed for %s at the given industry ' @@ -1631,69 +1627,8 @@ def multiplication_attribution( .reset_index(drop=True) ) - def weighted_average_attribution( - self: 'FlowByActivity', - other: 'FlowBySector' - ) -> 'FlowByActivity': - """ - This method determines weighted average - """ - - log.info('Taking weighted average of %s by %s.', - self.full_name, other.full_name) - fba_geoscale, other_geoscale, fba, other = self.harmonize_geoscale( - other) - - # merge dfs - merged = (fba - .merge(other, - how='left', - left_on=['PrimarySector', 'temp_location' - if 'temp_location' in fba - else 'Location'], - right_on=['PrimarySector', 'Location'], - suffixes=[None, '_other']) - .fillna({'FlowAmount_other': 0}) - ) - # drop rows where flow is 0 - merged = merged[merged['FlowAmount'] != 0] - # replace terms - for original, replacement in self.config.get( - 'replacement_dictionary').items(): - merged = merged.replace({original: replacement}) - - wt_flow = (merged - .groupby(['Class', 'MetaSources', 'Flowable', 'Unit', - 'FlowType', 'ActivityProducedBy', - 'ActivityConsumedBy', 'Context', 'Location', - 'LocationSystem', 'Year', 'MeasureofSpread', - 'Spread', 'DistributionType', 'Min', 'Max', - 'DataReliability', 'DataCollection', - 'SectorProducedBy', 'ProducedBySectorType', - 'SectorConsumedBy', 'ConsumedBySectorType', - 'SectorSourceName'], - dropna=False) - .apply(lambda x: np.average(x['FlowAmount'], - weights=x['FlowAmount_other'])) - .drop(columns='FlowAmount') # original flowamounts - .reset_index(name='FlowAmount') # new, weighted flows - ) - # set attributes todo: revise above code so don't lose attributes - attributes_to_save = { - attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] - } - for attr in attributes_to_save: - setattr(wt_flow, attr, attributes_to_save[attr]) - - # reset dropped information - wt_flow = (wt_flow - .reset_index(drop=True).reset_index() - .rename(columns={'index': 'group_id'}) - .assign(group_total=wt_flow.FlowAmount) - ) - - return wt_flow - + # def flagged_proportionally_attribute(self: 'FlowByActivity'): + # raise NotImplementedError def prepare_fbs(self: 'FlowByActivity') -> 'FlowBySector': if 'activity_sets' in self.config: diff --git a/flowsa/validation.py b/flowsa/validation.py index 6f28cc9f4..caa043583 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -304,15 +304,11 @@ def calculate_flowamount_diff_between_dfs(dfa_load, dfb_load): # Because code will sometimes change terminology, aggregate # data by context and flowable to compare df differences # subset df - flowcols = ['FlowName', 'Compartment'] - if 'Flowable' in df.columns: - flowcols = ['Flowable', 'Context'] - dfs_cols = flowcols + ['ActivityProducedBy', 'ActivityConsumedBy', - 'FlowAmount_Original', 'FlowAmount_Modified', 'Unit', - 'geoscale'] - dfs = df[dfs_cols] - agg_cols = flowcols + ['ActivityProducedBy', 'ActivityConsumedBy', - 'Unit', 'geoscale'] + dfs = df[['FlowName', 'Compartment', 'ActivityProducedBy', + 'ActivityConsumedBy', 'FlowAmount_Original', + 'FlowAmount_Modified', 'Unit', 'geoscale']] + agg_cols = ['FlowName', 'Compartment', 'ActivityProducedBy', + 'ActivityConsumedBy', 'Unit', 'geoscale'] dfagg = dfs.groupby( agg_cols, dropna=False, as_index=False).agg( {'FlowAmount_Original': sum, 'FlowAmount_Modified': sum}) @@ -331,7 +327,8 @@ def calculate_flowamount_diff_between_dfs(dfa_load, dfb_load): dfagg3 = replace_strings_with_NoneType(dfagg).drop( columns=['ActivityProducedBy', 'ActivityConsumedBy', 'FlowAmount_Difference', 'Percent_Difference']) - dfagg4 = dfagg3.groupby(flowcols + ['Unit', 'geoscale'], + dfagg4 = dfagg3.groupby( + ['FlowName', 'Compartment', 'Unit', 'geoscale'], dropna=False, as_index=False).agg( {'FlowAmount_Original': sum, 'FlowAmount_Modified': sum}) # column calculating difference @@ -968,7 +965,6 @@ def compare_FBS_results(fbs1, fbs2, ignore_metasources=False, df1 = flowsa.getFlowBySector(fbs1, download_FBS_if_missing=compare_to_remote ).rename(columns={'FlowAmount': 'FlowAmount_fbs1'}) - df1 = replace_strings_with_NoneType(df1) # load second file if compare_to_remote: @@ -982,16 +978,6 @@ def compare_FBS_results(fbs1, fbs2, ignore_metasources=False, df2 = flowsa.getFlowBySector(fbs2).rename( columns={'FlowAmount': 'FlowAmount_fbs2'}) df2 = replace_strings_with_NoneType(df2) - - # test - df1 = pd.DataFrame(df1) - df2 = pd.DataFrame(df2) - df1['Unit'] == 'm2' - df1['MeasureofSpread'] = df1['MeasureofSpread'].apply(lambda x: str(x)) - df1 = df1.drop(columns='MeasureofSpread') - df2 = df2.drop(columns='MeasureofSpread') - - # compare df merge_cols = list(df2.select_dtypes(include=[ 'object', 'int']).columns) From 0cf4525bf5f28d85482c409f4fe8f2dd7d690e96 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 23 Mar 2023 16:42:20 -0600 Subject: [PATCH 0403/1127] drop import statement - fxns converted to recursive model --- flowsa/data_source_scripts/USDA_IWMS.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/data_source_scripts/USDA_IWMS.py b/flowsa/data_source_scripts/USDA_IWMS.py index ec78e93db..5ee531eab 100644 --- a/flowsa/data_source_scripts/USDA_IWMS.py +++ b/flowsa/data_source_scripts/USDA_IWMS.py @@ -14,8 +14,8 @@ from flowsa.common import WITHDRAWN_KEYWORD from flowsa.flowbyfunctions import assign_fips_location_system, \ load_fba_w_standardized_units, filter_by_geoscale -from flowsa.data_source_scripts.USDA_CoA_Cropland import disaggregate_pastureland, \ - disaggregate_cropland +# from flowsa.data_source_scripts.USDA_CoA_Cropland import disaggregate_pastureland, \ +# disaggregate_cropland from flowsa.flowby import FlowByActivity def iwms_url_helper(*, build_url, config, **_): From a4e7993b30c2f622125b6c77553f1df1150eee80 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 23 Mar 2023 16:43:48 -0600 Subject: [PATCH 0404/1127] new weighted_average_attribution() fxn for attribution fbs methods --- flowsa/flowby.py | 69 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 8dc73b480..275d9a6c3 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1062,6 +1062,10 @@ def attribute_flows_to_sectors( attribution_fbs = fba.load_prepare_attribution_source() attributed_fba = fba.multiplication_attribution(attribution_fbs) + elif attribution_method == 'weighted_average': + attribution_fbs = fba.load_prepare_attribution_source() + attributed_fba = fba.weighted_average_attribution(attribution_fbs) + else: if all(fba.groupby('group_id')['group_id'].agg('count') == 1): log.info('No attribution needed for %s at the given industry ' @@ -1627,8 +1631,69 @@ def multiplication_attribution( .reset_index(drop=True) ) - # def flagged_proportionally_attribute(self: 'FlowByActivity'): - # raise NotImplementedError + def weighted_average_attribution( + self: 'FlowByActivity', + other: 'FlowBySector' + ) -> 'FlowByActivity': + """ + This method determines weighted average + """ + + log.info('Taking weighted average of %s by %s.', + self.full_name, other.full_name) + fba_geoscale, other_geoscale, fba, other = self.harmonize_geoscale( + other) + + # merge dfs + merged = (fba + .merge(other, + how='left', + left_on=['PrimarySector', 'temp_location' + if 'temp_location' in fba + else 'Location'], + right_on=['PrimarySector', 'Location'], + suffixes=[None, '_other']) + .fillna({'FlowAmount_other': 0}) + ) + # drop rows where flow is 0 + merged = merged[merged['FlowAmount'] != 0] + # replace terms + for original, replacement in self.config.get( + 'replacement_dictionary').items(): + merged = merged.replace({original: replacement}) + + wt_flow = (merged + .groupby(['Class', 'MetaSources', 'Flowable', 'Unit', + 'FlowType', 'ActivityProducedBy', + 'ActivityConsumedBy', 'Context', 'Location', + 'LocationSystem', 'Year', 'MeasureofSpread', + 'Spread', 'DistributionType', 'Min', 'Max', + 'DataReliability', 'DataCollection', + 'SectorProducedBy', 'ProducedBySectorType', + 'SectorConsumedBy', 'ConsumedBySectorType', + 'SectorSourceName'], + dropna=False) + .apply(lambda x: np.average(x['FlowAmount'], + weights=x['FlowAmount_other'])) + .drop(columns='FlowAmount') # original flowamounts + .reset_index(name='FlowAmount') # new, weighted flows + ) + # set attributes todo: revise above code so don't lose attributes + attributes_to_save = { + attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] + } + for attr in attributes_to_save: + setattr(wt_flow, attr, attributes_to_save[attr]) + + # reset dropped information + wt_flow = (wt_flow + .reset_index(drop=True).reset_index() + .rename(columns={'index': 'group_id'}) + .assign(group_total=wt_flow.FlowAmount) + ) + + return wt_flow + def prepare_fbs(self: 'FlowByActivity') -> 'FlowBySector': if 'activity_sets' in self.config: From 74e976973c5f8faead3b338f171fc32eac045868 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 23 Mar 2023 16:44:34 -0600 Subject: [PATCH 0405/1127] update calculate_flowamount_diff() to work for both FBA and FBS --- flowsa/validation.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/flowsa/validation.py b/flowsa/validation.py index caa043583..01521703b 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -304,11 +304,15 @@ def calculate_flowamount_diff_between_dfs(dfa_load, dfb_load): # Because code will sometimes change terminology, aggregate # data by context and flowable to compare df differences # subset df - dfs = df[['FlowName', 'Compartment', 'ActivityProducedBy', - 'ActivityConsumedBy', 'FlowAmount_Original', - 'FlowAmount_Modified', 'Unit', 'geoscale']] - agg_cols = ['FlowName', 'Compartment', 'ActivityProducedBy', - 'ActivityConsumedBy', 'Unit', 'geoscale'] + flowcols = ['FlowName', 'Compartment'] + if 'Flowable' in df.columns: + flowcols = ['Flowable', 'Context'] + dfs_cols = flowcols + ['ActivityProducedBy', 'ActivityConsumedBy', + 'FlowAmount_Original', 'FlowAmount_Modified', 'Unit', + 'geoscale'] + dfs = df[dfs_cols] + agg_cols = flowcols + ['ActivityProducedBy', 'ActivityConsumedBy', + 'Unit', 'geoscale'] dfagg = dfs.groupby( agg_cols, dropna=False, as_index=False).agg( {'FlowAmount_Original': sum, 'FlowAmount_Modified': sum}) @@ -327,8 +331,7 @@ def calculate_flowamount_diff_between_dfs(dfa_load, dfb_load): dfagg3 = replace_strings_with_NoneType(dfagg).drop( columns=['ActivityProducedBy', 'ActivityConsumedBy', 'FlowAmount_Difference', 'Percent_Difference']) - dfagg4 = dfagg3.groupby( - ['FlowName', 'Compartment', 'Unit', 'geoscale'], + dfagg4 = dfagg3.groupby(flowcols + ['Unit', 'geoscale'], dropna=False, as_index=False).agg( {'FlowAmount_Original': sum, 'FlowAmount_Modified': sum}) # column calculating difference From b8e4f896a1c1d57ddbb8c60f13b158c61c5caeaf Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 23 Mar 2023 22:44:08 -0400 Subject: [PATCH 0406/1127] update GHG_national table 2-1 --- .../GHG_national_2016_m1.yaml | 2 +- .../flowbysectormethods/GHG_national_m1.yaml | 196 ++++++++++-------- 2 files changed, 108 insertions(+), 90 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml index be9a3eca9..d9310ab42 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml @@ -21,7 +21,7 @@ source_names: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_2_1:activity_sets lead: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead - allocation_source_year: *ghgi_year + year: *ghgi_year "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml index f4585590a..e6dde6920 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml @@ -6,9 +6,11 @@ # sector attribution is to 6-digit NAICS, rather than the BEA 2012 IO schema # Allocation source years for BEA Use/Make and Census of Ag (CoA) are currently fixed at 2012 and 2017, respectively # other allocation source years including MECS is not defined here -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: national +industry_spec: + default: NAICS_6 +year: &ghgi_year 2016 +target_naics_year: 2012 +geoscale: national _allocation_types: _mecs_allocation: &fuel_MECS @@ -52,29 +54,10 @@ _allocation_types: clean_allocation_fba_w_sec: !script_function:BEA subset_and_equally_allocate_BEA_table # clean_parameter: # override this with dictionary like {"324110": 'ActivityProducedBy'} - _make_allocation: &make_allocation - # names: # override this - allocation_method: proportional - allocation_source: "BEA_Make_Detail_BeforeRedef" - activity_to_sector_mapping: "BEA_2012_Detail" - allocation_source_class: "Money" - allocation_source_year: 2012 - allocation_flow: - - "USD2012" - allocation_compartment: None - allocation_from_scale: national - clean_allocation_fba_w_sec: !script_function:BEA subset_and_equally_allocate_BEA_table - # clean_parameter: # over ride this with dictionary, like {"221100": 'ActivityConsumedBy'} # Electricity + _BEA: &bea + year: 2012 + activity_to_sector_mapping: BEA_2012_Detail - _lead_allocation: &lead_allocation - names: - - "Lead Production" #CO2 - allocation_method: proportional - allocation_source: "USGS_MYB_Lead" - allocation_source_class: "Geological" - # allocation_source_year: #override this - allocation_compartment: None - allocation_from_scale: national _cropland_allocation: &cropland_allocation names: @@ -124,78 +107,113 @@ _allocation_types: clean_parameter: {"324110": 'ActivityProducedBy'} # use of petroleum products source_names: - "EPA_GHGI_T_2_1": #U.S. GHG emissions - data_format: 'FBA' - class: Chemicals - geoscale_to_use: national + EPA_GHGI_T_2_1: #U.S. GHG emissions # year: # override this - fedefl_mapping: 'GHGI' + fedefl_mapping: GHGI activity_sets: direct: - names: - - "Iron and Steel Production & Metallurgical Coke Production" #CO2, CH4 - - "Cement Production" #CO2 - - "Lime Production" #CO2 - - "Ammonia Production" #CO2 - - "Incineration of Waste" #CO2, #N2O - - "Aluminum Production" #CO2 - - "Soda Ash Production" #CO2 - - "Ferroalloy Production" #CO2, CH4 - - "Titanium Dioxide Production" #CO2 - - "Zinc Production" #CO2 - - "Phosphoric Acid Production" #CO2 - - "Glass Production" #CO2 - - "Carbide Production and Consumption" #CO2, CH4 - - "Landfills" #CH4 - - "Coal Mining" #CO2, CH4 - - "Wastewater Treatment" #CH4, N2O - - "Rice Cultivation" #CH4 - - "Abandoned Oil and Gas Wells" #CH4 - - "Abandoned Underground Coal Mines" #CH4 - - "Anaerobic Digestion at Biogas Facilities" #CH4 new activity - - "Composting" #CH4, N2O - - "Nitric Acid Production" #N2O - - "Adipic Acid Production" #N2O - - "Caprolactam, Glyoxal, and Glyoxylic Acid Production" #N2O - source_flows: ["CO2", "CH4", "N2O"] # HFCs and other flows are pulled elsewhere - allocation_method: direct - allocation_source: None - allocation_from_scale: national + selection_fields: + PrimaryActivity: + - Abandoned Oil and Gas Wells #CH4 + - Abandoned Underground Coal Mines #CH4 + - Adipic Acid Production #N2O + - Aluminum Production #CO2 + - Ammonia Production #CO2 + - Anaerobic Digestion at Biogas Facilities #CH4 new activity + - Caprolactam, Glyoxal, and Glyoxylic Acid Production #N2O + - Carbide Production and Consumption #CO2, CH4 + - Cement Production #CO2 + - Coal Mining #CO2, CH4 + - Composting #CH4, N2O + - Ferroalloy Production #CO2, CH4 + - Glass Production #CO2 + - Landfills #CH4 + - Lime Production #CO2 + - Incineration of Waste #CO2, #N2O + - Iron and Steel Production & Metallurgical Coke Production #CO2, CH4 + - Nitric Acid Production #N2O + - Phosphoric Acid Production #CO2 + - Rice Cultivation #CH4 + - Soda Ash Production #CO2 + - Titanium Dioxide Production #CO2 + - Wastewater Treatment #CH4, N2O + - Zinc Production #CO2 + FlowName: ["CO2", "CH4", "N2O"] # HFCs and other flows are pulled elsewhere + attribution_method: direct + electricity_transmission: - names: - - "Electrical Transmission and Distribution" #SF6 - source_flows: ["SF6"] - allocation_method: direct - allocation_source: None - allocation_from_scale: national + selection_fields: + PrimaryActivity: Electrical Transmission and Distribution #SF6 + FlowName: SF6 + attribution_method: direct + electric_power: - <<: *make_allocation - names: - - "Electric Power Sector" #CO2 - clean_parameter: {"221100": 'ActivityConsumedBy'} # Electricity + selection_fields: + PrimaryActivity: Electric Power Sector #CO2 + attribution_method: proportional + attribution_source: + BEA_Make_Detail_BeforeRedef: + <<: *bea + primary_action_type: Produced + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity + liming: - <<: *use_allocation - names: - - "Liming" #CO2 - clean_parameter: {"327400": 'ActivityProducedBy'} # Lime + selection_fields: + PrimaryActivity: Liming #CO2 + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + # primary_action_type: Consumed + selection_fields: + ActivityProducedBy: {'327400': ''} # Lime + urea: - <<: *use_allocation - names: - - "Urea Fertilization" #CO2 - - "Urea Consumption for Non-Agricultural Purposes" #CO2 - clean_parameter: {"325310": 'ActivityProducedBy'} # Fertilizers - carbonates: - <<: *use_allocation - names: - - "Other Process Uses of Carbonates" #CO2 - clean_parameter: {"325180": 'ActivityProducedBy'} # Other Basic Inorganic Chemicals + selection_fields: + PrimaryActivity: + - Urea Fertilization #CO2 + - Urea Consumption for Non-Agricultural Purposes #CO2 + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + # primary_action_type: Consumed + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + + carbonate_use: + selection_fields: + PrimaryActivity: Other Process Uses of Carbonates #CO2 + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + # primary_action_type: Consumed + selection_fields: + ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + lead: - <<: *lead_allocation - N2O_products: - <<: *use_allocation - names: - - "N2O from Product Uses" #N2O - clean_parameter: {"325120": 'ActivityProducedBy'} # Industrial gases + selection_fields: + PrimaryActivity: Lead Production #CO2 + attribution_method: proportional + attribution_source: + USGS_MYB_Lead: + # year: 2016 Override with appropriate year + selection_fields: + ActivityProducedBy: + - Primary lead, refined content, domestic ores and base bullion + - Secondary lead, lead content + + nitrous_oxide_use: + selection_fields: + PrimaryActivity: N2O from Product Uses #N2O + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325120': ''} # Industrial gases ## Fossil Fuels "EPA_GHGI_T_3_68": &natgas #CH4 from Natural Gas Systems From f382bd65a99c7e0d33f5d970f98912370f48e394 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 23 Mar 2023 23:12:09 -0400 Subject: [PATCH 0407/1127] update oil and gas, include two additional activity names that are different in some tables --- .../NAICS_Crosswalk_EPA_GHGI.csv | 2 + .../flowbysectormethods/GHG_national_m1.yaml | 63 ++++++++----------- 2 files changed, 29 insertions(+), 36 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv index 5867264f5..47e807037 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv @@ -83,7 +83,9 @@ EPA_GHGI,Motorcycles Gasoline On-Road,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T EPA_GHGI,Exploration,NAICS_2012_Code,211111,,211000,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42, EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" EPA_GHGI,Production,NAICS_2012_Code,211111,,211000,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42, EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" EPA_GHGI,Crude Oil Transportation,NAICS_2012_Code,486110,,not mapped,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42" +EPA_GHGI,Transportation,NAICS_2012_Code,486110,,not mapped,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42" EPA_GHGI,Refining,NAICS_2012_Code,324110,,324110,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42" +EPA_GHGI,Crude Refining,NAICS_2012_Code,324110,,324110,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42" EPA_GHGI,Distribution,NAICS_2012_Code,221210,,221200,"EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" EPA_GHGI,Distribution - Post-Meter,NAICS_2012_Code,221210,,,"EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" EPA_GHGI,Processing,NAICS_2012_Code,211111,,211000,"EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml index e6dde6920..2797bb793 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml @@ -216,44 +216,35 @@ source_names: ActivityProducedBy: {'325120': ''} # Industrial gases ## Fossil Fuels - "EPA_GHGI_T_3_68": &natgas #CH4 from Natural Gas Systems - data_format: 'FBA' - class: Chemicals - geoscale_to_use: national + EPA_GHGI_T_3_68: &natgas #CH4 from Natural Gas Systems # year: # override this - fedefl_mapping: 'GHGI' - activity_sets: - nat_gas: - names: - - "Distribution" - - "Distribution - Post-Meter" - - "Exploration" - - "Processing" - - "Production" - - "Transmission and Storage" - allocation_method: direct - allocation_source: None - allocation_from_scale: national - "EPA_GHGI_T_3_70": *natgas #CO2 from Natural Gas Systems mimics CH4 - "EPA_GHGI_T_3_72": *natgas #N2O from Natural Gas Systems, not used in original method, mimics CH4 - "EPA_GHGI_T_3_42": &petroleum #CH4 from Petroleum Systems - data_format: 'FBA' - class: Chemicals - geoscale_to_use: national + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + - Distribution + - Distribution - Post-Meter + - Exploration + - Processing + - Production + - Transmission and Storage + attribution_method: direct + EPA_GHGI_T_3_70: *natgas #CO2 from Natural Gas Systems mimics CH4 + EPA_GHGI_T_3_72: *natgas #N2O from Natural Gas Systems, not used in original method, mimics CH4 + + EPA_GHGI_T_3_42: &petroleum #CH4 from Petroleum Systems # year: # override this - fedefl_mapping: 'GHGI' - activity_sets: - petroleum: - names: - - "Crude Oil Transportation" - - "Exploration" - - "Production" - - "Refining" - allocation_method: direct - allocation_source: None - allocation_from_scale: national - "EPA_GHGI_T_3_44": *petroleum #CO2 from Petroleum Systems mimics CH4 - "EPA_GHGI_T_3_46": *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + - Crude Oil Transportation + - Transportation + - Exploration + - Production + - Refining + - Crude Refining + attribution_method: direct + EPA_GHGI_T_3_44: *petroleum #CO2 from Petroleum Systems mimics CH4 + EPA_GHGI_T_3_46: *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 ## Agriculture "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues From 9ba031be4d0c99f09a515edb067017ec324cb96e Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 23 Mar 2023 23:20:34 -0400 Subject: [PATCH 0408/1127] direct ag --- .../flowbysectormethods/GHG_national_m1.yaml | 66 ++++++++----------- 1 file changed, 27 insertions(+), 39 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml index 2797bb793..019328b27 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml @@ -247,46 +247,34 @@ source_names: EPA_GHGI_T_3_46: *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 ## Agriculture - "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues - data_format: 'FBA' - class: Chemicals - geoscale_to_use: national - # year: # override this - fedefl_mapping: 'GHGI' - activity_sets: - crops: - names: - - "Chickpeas" - - "Cotton" - - "Maize" - - "Rice" - - "Soybeans" - - "Wheat" - allocation_method: direct - allocation_source: None - allocation_from_scale: national - "EPA_GHGI_T_5_3": &animals #CH4 from Enteric Fermentation - data_format: 'FBA' - class: Chemicals - geoscale_to_use: national + EPA_GHGI_T_5_28: #CH4, N2O, CO and NOx from field burning of residues # year: # override this - fedefl_mapping: 'GHGI' - activity_sets: - animals: - names: - - "American Bison" - - "Beef Cattle" - - "Dairy Cattle" - - "Goats" - - "Horses" - - "Mules and Asses" - - "Sheep" - - "Swine" - - "Poultry" - allocation_method: direct - allocation_source: None - allocation_from_scale: national - "EPA_GHGI_T_5_6": *animals #CH4 and N2O from manure, mimics enteric fermentation + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + - Chickpeas + - Cotton + - Maize + - Rice + - Soybeans + - Wheat + attribution_method: direct + EPA_GHGI_T_5_3: &animals #CH4 from Enteric Fermentation + # year: # override this + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + - American Bison + - Beef Cattle + - Dairy Cattle + - Goats + - Horses + - Mules and Asses + - Sheep + - Swine + - Poultry + attribution_method: direct + EPA_GHGI_T_5_6: *animals #CH4 and N2O from manure, mimics enteric fermentation "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils data_format: 'FBA' From ea3da06730a9c9b392c1667c44821b358ccea01e Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 23 Mar 2023 23:42:49 -0400 Subject: [PATCH 0409/1127] more ag tables --- .../flowbysectormethods/GHG_national_m1.yaml | 113 ++++++++++-------- 1 file changed, 60 insertions(+), 53 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml index 019328b27..c7b0b59fe 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml @@ -58,33 +58,30 @@ _allocation_types: year: 2012 activity_to_sector_mapping: BEA_2012_Detail - _cropland_allocation: &cropland_allocation - names: - - "Mineralization and Asymbiotic Fixation Cropland" - - "Drained Organic Soils Cropland" - allocation_source: "USDA_CoA_Cropland" - allocation_method: proportional - allocation_source_class: "Land" - # allocation_source_year: #override this 2017 - allocation_flow: - - "AREA HARVESTED" - - "AREA BEARING & NON-BEARING" # Orchards - - "AREA GROWN" # Berry totals - allocation_from_scale: national - clean_allocation_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics + USDA_CoA_Cropland: + year: 2017 + selection_fields: + Class: Land + FlowName: + - AREA HARVESTED + - AREA BEARING & NON-BEARING # Orchards + - AREA GROWN # Berry totals + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + year: 2017 + selection_fields: + Class: Land + FlowName: AG LAND, CROPLAND, HARVESTED _animal_land_allocation: &animal_land_allocation - names: - - "All activities Grassland" - allocation_method: proportional - allocation_source: "USDA_CoA_Cropland_NAICS" - allocation_source_class: "Land" - # allocation_source_year: #override this - allocation_flow: - - "FARM OPERATIONS" - allocation_compartment: None - allocation_from_scale: national + USDA_CoA_Cropland_NAICS: + year: 2017 + selection_fields: + Class: Land + FlowName: FARM OPERATIONS + clean_fba: !script_function:temp_data_source_functions clean_usda_cropland_naics _transport_energy_use_allocation: &transport_energy_use_allocation allocation_method: proportional @@ -276,41 +273,51 @@ source_names: attribution_method: direct EPA_GHGI_T_5_6: *animals #CH4 and N2O from manure, mimics enteric fermentation - "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils - data_format: 'FBA' - class: Chemicals - geoscale_to_use: national + EPA_GHGI_T_5_17: #Direct N2O emissions from agricultural soils # year: # override this - fedefl_mapping: 'GHGI' + fedefl_mapping: GHGI activity_sets: - fertilizer_use: # allocated based on fertilizer use - <<: *use_allocation - names: - - "Organic Amendment Cropland" - - "Residue N Cropland" - - "Synthetic Fertilizer Cropland" - clean_parameter: {"325310": 'ActivityProducedBy'} # Fertilizers - land_area: - <<: *cropland_allocation - allocation_source_year: 2017 - grassland: &grassland - <<: *animal_land_allocation - allocation_source_year: 2017 + fertilizer_use: &fertilizer # allocated based on fertilizer use + selection_fields: + PrimaryActivity: + - Organic Amendment Cropland + - Residue N Cropland + - Synthetic Fertilizer Cropland + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers - "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils - data_format: 'FBA' - class: Chemicals - geoscale_to_use: national + cropland: # allocated based on USDA land area harvested + selection_fields: + PrimaryActivity: + - Mineralization and Asymbiotic Fixation Cropland + - Drained Organic Soils Cropland + attribution_method: proportional + attribution_source: *cropland_allocation + + pasture: &pasture # allocated based on USDA Animal operation land (acres) + selection_fields: + PrimaryActivity: + - All activities Grassland + attribution_method: proportional + attribution_source: *animal_land_allocation + + EPA_GHGI_T_5_18: #Indirect N2O emissions from agricultural soils # year: # override this - fedefl_mapping: 'GHGI' + fedefl_mapping: GHGI activity_sets: fertilizer_use: # allocated based on fertilizer use - <<: *use_allocation - names: - - "Volatilization & Atm. Deposition Cropland" - - "Surface Leaching & Run-Off Cropland" - clean_parameter: {"325310": 'ActivityProducedBy'} # Fertilizers - grassland: *grassland # allocated based on USDA Animal operation land (acres) + <<: *fertilizer + selection_fields: + PrimaryActivity: + - Volatilization & Atm. Deposition Cropland + - Surface Leaching & Run-Off Cropland + pasture: # allocated based on USDA Animal operation land (acres) + <<: *pasture + ## Mobile Sources "EPA_GHGI_T_3_14": &mobile #CH4 from mobile combustion From 37b32c207ff4b7ec622f1641eeccf927d2d70241 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 24 Mar 2023 09:56:31 -0400 Subject: [PATCH 0410/1127] mobile combustion --- .../flowbysectormethods/GHG_national_m1.yaml | 103 +++++++++++------- 1 file changed, 61 insertions(+), 42 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml index c7b0b59fe..95c1060f1 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml @@ -320,50 +320,69 @@ source_names: ## Mobile Sources - "EPA_GHGI_T_3_14": &mobile #CH4 from mobile combustion - data_format: 'FBA' - class: Chemicals - geoscale_to_use: national - # year: # override this - fedefl_mapping: 'GHGI' + EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion + fedefl_mapping: GHGI activity_sets: - direct: #this set is direct - names: - - "Passenger Cars Gasoline On-Road" - - "Passenger Cars Diesel On-Road" - - "Light-Duty Trucks Gasoline On-Road" - - "Rail Non-Road" - - "Ships and Boats Non-Road" - - "Aircraft Non-Road" - - "Light-Duty Trucks Diesel On-Road" - - "Medium- and Heavy-Duty Trucks Diesel On-Road" - - "Medium- and Heavy-Duty Buses Diesel On-Road" - - "Medium- and Heavy-Duty Trucks and Buses Gasoline On-Road" - - "Motorcycles Gasoline On-Road" - allocation_method: direct - allocation_source: None - allocation_from_scale: national - construction: #this set is allocated by purchases of construction equipment - <<: *use_allocation - names: - - "Construction/Mining Equipment Non-Road" - clean_parameter: {"333120": 'ActivityProducedBy'} # purchases of construction equipment - ag: #this set is allocated by purchases of farm machinery - <<: *use_allocation - names: - - "Agricultural Equipment Non-Road" - clean_parameter: {"333111": 'ActivityProducedBy'} # purchases of farm machinery + direct_attribution: + selection_fields: + PrimaryActivity: + - Passenger Cars Gasoline On-Road + - Passenger Cars Diesel On-Road + - Light-Duty Trucks Gasoline On-Road + - Light-Duty Trucks Diesel On-Road + - Rail Non-Road + - Ships and Boats Non-Road + - Aircraft Non-Road + - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road + - Medium- and Heavy-Duty Buses Diesel On-Road + - Medium- and Heavy-Duty Trucks and Buses Gasoline On-Road + - Motorcycles Gasoline On-Road + attribution_method: direct + + construction_and_mining: #this set is allocated by purchases of construction equipment + selection_fields: + PrimaryActivity: Construction/Mining Equipment Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment + + farm_non_road: #this set is allocated by purchases of farm machinery + selection_fields: + PrimaryActivity: Agricultural Equipment Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333111': ''} # purchases of farm machinery + other_non_road: #this set is allocated by purchases of petroleum refining - <<: *use_allocation - names: - - "Other Non-Road" - clean_parameter: {"324110": 'ActivityProducedBy'} # purchases of refinery products - alternatives: #this set is allocated by purchases of natural gas - <<: *use_allocation - names: - - "Alternative Fuel On-Road" - clean_parameter: {"221200": 'ActivityProducedBy'} # purchases of natural gas - "EPA_GHGI_T_3_15": *mobile #N2O from mobile combustion duplicates method for CH4 + selection_fields: + PrimaryActivity: Other Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + alt_fuel_on_road: #this set is allocated by purchases of natural gas + selection_fields: + PrimaryActivity: + - Alternative Fuel On-Road + - All activities Alternative Fuel On-Road # corrected from "Alternative Fuel On-Road", which isn't in the source FBA. + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 + ## Major CO2 Sources "GHGI_CO2_stationary_combustion_and_transport": # CO2 emissions from stationary combustion and transportation From c11ad401b0a0ce4608bc5d174f604c51c02610fd Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 24 Mar 2023 11:46:58 -0400 Subject: [PATCH 0411/1127] stationary co2 --- flowsa/data_source_scripts/EPA_GHGI.py | 5 +- .../temp_data_source_functions.py | 4 +- .../GHG_national_2016_m1.yaml | 20 +- .../flowbysectormethods/GHG_national_m1.yaml | 179 ++++++++++-------- 4 files changed, 118 insertions(+), 90 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_GHGI.py b/flowsa/data_source_scripts/EPA_GHGI.py index d5f121d91..0d8e25877 100644 --- a/flowsa/data_source_scripts/EPA_GHGI.py +++ b/flowsa/data_source_scripts/EPA_GHGI.py @@ -17,6 +17,7 @@ from flowsa.schema import flow_by_activity_fields from flowsa.common import load_yaml_dict from flowsa.data_source_scripts import EIA_MECS +from flowsa.flowby import FlowByActivity SECTOR_DICT = {'Res.': 'Residential', @@ -748,7 +749,7 @@ def get_manufacturing_energy_ratios(parameter_dict): return pct_dict -def allocate_industrial_combustion(fba, source_dict, **_): +def allocate_industrial_combustion(fba: FlowByActivity, **_) -> FlowByActivity: """ Split industrial combustion emissions into two buckets to be further allocated. @@ -756,7 +757,7 @@ def allocate_industrial_combustion(fba, source_dict, **_): EIA MECS relative to EPA GHGI. Create new activities to distinguish those which use EIA MECS as allocation source and those that use alternate source. """ - pct_dict = get_manufacturing_energy_ratios(source_dict['clean_parameter']) + pct_dict = get_manufacturing_energy_ratios(fba.config.get('clean_parameter')) # activities reflect flows in A_14 and 3_8 and 3_9 activities_to_split = {'Industrial Other Coal Industrial': 'Coal', diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index 7e98278e5..52757f4de 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -3,7 +3,7 @@ from flowsa.flowsa_log import log import pandas as pd import numpy as np -from flowsa.data_source_scripts import EIA_MECS as mecs +# from flowsa.data_source_scripts import EIA_MECS as mecs from flowsa.data_source_scripts import EPA_GHGI as ghgi from flowsa.data_source_scripts import USDA_CoA_Cropland as coa from flowsa.flowby import FlowByActivity @@ -390,7 +390,7 @@ def clean_mapped_mecs_energy_fba(fba: FlowByActivity, **_) -> FlowByActivity: mecs = ( fba .assign(to_keep=fba.apply( - lambda x: not any([x.SectorConsumedBy.startswith(d) + lambda x: not any([str(x.SectorConsumedBy).startswith(d) for d in x.descendants.split()]), axis='columns' )) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml index d9310ab42..198c96f6b 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml @@ -89,10 +89,10 @@ source_names: !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets petroleum: !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum - allocation_source_year: *mecs_year + year: *mecs_year natural_gas: !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas - allocation_source_year: *mecs_year + year: *mecs_year ### Major CO2 Sources "EPA_GHGI_T_A_9": # CO2 emissions from stationary combustion and transportation. This table number changes with year @@ -103,14 +103,14 @@ source_names: !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets coal_manufacturing: !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year ### Transportation ng_transport: &transport_direct !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:ng_transport - allocation_source_year: *ghgi_year + year: *ghgi_year aviation_transport: !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:aviation_transport <<: *transport_direct @@ -125,7 +125,7 @@ source_names: <<: *transport_direct dfo_transport: &transport_use !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:dfo_transport - allocation_source_year: *ghgi_year + year: *ghgi_year gasoline_transport: !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:gasoline_transport <<: *transport_use @@ -138,10 +138,10 @@ source_names: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets coal_manufacturing: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year ng_manufacturing: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9 @@ -151,7 +151,7 @@ source_names: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets coal_manufacturing: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year ng_manufacturing: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml index 95c1060f1..2a7fbe558 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml @@ -12,33 +12,31 @@ year: &ghgi_year 2016 target_naics_year: 2012 geoscale: national -_allocation_types: - _mecs_allocation: &fuel_MECS - # names: # override this - allocation_source: "EIA_MECS_Energy" - allocation_method: proportional - # allocation_source_class: "Energy" #override this - # allocation_source_year: *mecs_year # override this with mecs year - # allocation_flow: # override this - # - "Coal" - allocation_from_scale: national - allocation_selection_fields: +attribution_sources: + _BEA: &bea + year: 2012 + activity_to_sector_mapping: BEA_2012_Detail + + _mecs_energy: + EIA_MECS_Energy: &mecs_energy + # year: *mecs_year # override this with mecs year + selection_fields: &mecs_energy_default_selection + Class: Energy # or Other (for non-energy use) + Unit: Trillion Btu + # Flow: Coal # override this + Location: '00000' Description: - - "Table 2.2" # Nonfuel (class Other) - - "Table 3.2" # Fuel (class Energy) - Unit: - - "MJ" - clean_allocation_fba_w_sec: !script_function:EIA_MECS eia_mecs_energy_clean_allocation_fba_w_sec - helper_source: "BEA_Use_Detail_PRO_BeforeRedef" - helper_activity_to_sector_mapping: "BEA_2012_Detail" - helper_method: proportional-flagged - helper_source_class: "Money" - helper_source_year: 2012 - helper_flow: - - "USD2012" - helper_from_scale: national - clean_helper_fba_wsec: !script_function:BEA subset_and_equally_allocate_BEA_table - # clean_parameter: # override this with dictionary like {"324110": 'ActivityProducedBy'} + - Table 2.2 # applies to Class Other + - Table 3.2 # applies to Class Energy + estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_mecs_energy + clean_fba: !script_function:temp_data_source_functions clean_mecs_energy_fba + clean_fba_w_sec: !script_function:temp_data_source_functions clean_mapped_mecs_energy_fba + attribution_method: proportional + # attribution_source: # Include in main method + # BEA_Use_Detail_PRO_BeforeRedef: + # <<: *bea + # selection_fields: + # ActivityProducedBy: {'XXXXX': ''} _use_allocation: &use_allocation # names: # override this @@ -54,10 +52,6 @@ _allocation_types: clean_allocation_fba_w_sec: !script_function:BEA subset_and_equally_allocate_BEA_table # clean_parameter: # override this with dictionary like {"324110": 'ActivityProducedBy'} - _BEA: &bea - year: 2012 - activity_to_sector_mapping: BEA_2012_Detail - _cropland_allocation: &cropland_allocation USDA_CoA_Cropland: year: 2017 @@ -385,59 +379,92 @@ source_names: ## Major CO2 Sources - "GHGI_CO2_stationary_combustion_and_transport": # CO2 emissions from stationary combustion and transportation - data_format: 'FBA' - class: Chemicals - geoscale_to_use: national + GHGI_CO2_stationary_combustion_and_transport: # CO2 emissions from stationary combustion and transportation + fedefl_mapping: GHGI # year: # override this - clean_fba_df_fxn: !script_function:EPA_GHGI allocate_industrial_combustion + clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion # clean_parameter: # Override each year for use in allocate_industrial_combustion # energy_fba: 'EIA_MECS_Energy' # year: 2018 # ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table - fedefl_mapping: 'GHGI' activity_sets: - direct: - names: - - "Total (All Fuels) Residential" - allocation_method: direct - allocation_source: None - allocation_from_scale: national - coal_nonmanufacturing: - <<: *use_allocation # Applies to non-manufacturing sectors like ag and mining - names: - - "Commercial Coal Commercial" - - "Industrial Other Coal Industrial" - clean_parameter: {"212100": 'ActivityProducedBy'} # purchases of coal - natural_gas_nonmanufacturing: - <<: *use_allocation # Applies to non-manufacturing sectors like ag and mining - names: - - "Natural Gas Commercial" - - "Natural Gas Industrial" - clean_parameter: {"221200": 'ActivityProducedBy'} # purchases of natural gas - petroleum: - <<: *use_allocation - names: - - "Total Petroleum Commercial" - - "Total Petroleum Industrial" - clean_parameter: {"324110": 'ActivityProducedBy'} # purchases of refinery - coal_manufacturing: - <<: *fuel_MECS - names: - - "Industrial Other Coal Industrial - Manufacturing" - allocation_source_class: "Energy" # fuel consumption - allocation_flow: - - "Coal" - - "Coke and Breeze" - clean_parameter: {"212100": 'ActivityProducedBy'} # purchases of coal + direct_attribution: #direct allocation + selection_fields: + PrimaryActivity: Total (All Fuels) Residential + attribution_method: direct + + non-manufacturing_coal: + selection_fields: + PrimaryActivity: + - Commercial Coal Commercial + - Industrial Other Coal Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal + + non-manufacturing_natural_gas: # Applies to non-manufacturing sectors like ag and mining + selection_fields: + PrimaryActivity: + - Natural Gas Commercial + - Natural Gas Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + coal_manufacturing: # Industrial Coal for Manufacturing + selection_fields: + PrimaryActivity: + - Industrial Other Coal Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: + - Coal + - Coke and Breeze + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - <<: *fuel_MECS - names: - - "Natural Gas Industrial - Manufacturing" - allocation_source_class: "Energy" # fuel consumption - allocation_flow: - - "Natural Gas" - clean_parameter: {"221200": 'ActivityProducedBy'} # purchases of natural gas + selection_fields: + PrimaryActivity: + - Natural Gas Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Natural Gas + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + petroleum: # Petroleum + selection_fields: + PrimaryActivity: + - Total Petroleum Commercial + - Total Petroleum Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + ### Transportation ng_transport: &transport_direct names: From 85765d3c4499907dbb5f020a901ccf3e1d6d09b4 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 24 Mar 2023 12:03:39 -0400 Subject: [PATCH 0412/1127] stationary combustion ch4, n2o --- .../flowbysectormethods/GHG_national_m1.yaml | 146 +++++++++++------- 1 file changed, 93 insertions(+), 53 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml index 2a7fbe558..a83cfd8dd 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml @@ -510,73 +510,113 @@ source_names: allocation_flow: ['Motor Gasoline'] ## Stationary Combustion - "EPA_GHGI_T_3_8": &stationary_combustion # CH4 emissions from stationary combustion - data_format: 'FBA' - class: Chemicals - geoscale_to_use: national + EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion # year: #override this with ghgi_year clean_fba_df_fxn: !script_function:EPA_GHGI allocate_industrial_combustion # clean_parameter: # Override each year for use in allocate_industrial_combustion # energy_fba: 'EIA_MECS_Energy' # year: 2018 # ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table - fedefl_mapping: 'GHGI' + fedefl_mapping: GHGI activity_sets: residential: - names: - - "Fuel Oil Residential" - - "Coal Residential" - - "Natural Gas Residential" - - "Wood Residential" - allocation_method: direct - allocation_source: None - allocation_from_scale: national + selection_fields: + PrimaryActivity: + - Fuel Oil Residential + - Coal Residential + - Natural Gas Residential + - Wood Residential + attribution_method: direct + electric_power: - <<: *make_allocation - names: - - "Coal Electric Power" - - "Natural Gas Electric Power" - - "Fuel Oil Electric Power" - - "Wood Electric Power" - clean_parameter: {"221100": 'ActivityConsumedBy'} # Electricity + selection_fields: + PrimaryActivity: + - Coal Electric Power + - Natural Gas Electric Power + - Natural gas Electric Power # note lower case + - Fuel Oil Electric Power + - Wood Electric Power + attribution_method: proportional + attribution_source: + BEA_Make_Detail_BeforeRedef: + <<: *bea + primary_action_type: Produced + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity fuel_oil: - <<: *use_allocation - names: - - "Fuel Oil Commercial" - - "Fuel Oil Industrial" - clean_parameter: {"324110": 'ActivityProducedBy'} # purchases of refinery - natural_gas_nonmanufacturing: # Commercial Natural gas - <<: *use_allocation - names: - - "Natural Gas Commercial" - - "Natural Gas Industrial" - clean_parameter: {"221200": 'ActivityProducedBy'} # purchases of natural gas + selection_fields: + PrimaryActivity: + - Fuel Oil Commercial + - Fuel Oil Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + natural_gas_nonmanufacturing: # Commercial Natural gas + selection_fields: + PrimaryActivity: + - Natural gas Commercial + - Natural gas Industrial + - Natural Gas Commercial + - Natural Gas Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + coal_nonmanufacturing: - <<: *use_allocation - names: - - "Coal Industrial" - clean_parameter: {"212100": 'ActivityProducedBy'} # purchases of coal - coal_manufacturing: # Industrial - <<: *fuel_MECS - names: - - "Coal Industrial - Manufacturing" - allocation_source_class: "Energy" # fuel consumption - allocation_flow: - - "Coal" - clean_parameter: {"212100": 'ActivityProducedBy'} # purchases of coal - ng_manufacturing: # Industrial - <<: *fuel_MECS - names: - - "Natural Gas Industrial - Manufacturing" - allocation_source_class: "Energy" # fuel consumption - allocation_flow: - - "Natural Gas" - clean_parameter: {"221200": 'ActivityProducedBy'} # purchases of natural gas + selection_fields: + PrimaryActivity: Coal Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal + + coal_manufacturing: + selection_fields: + PrimaryActivity: Coal Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Coal + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal + + ng_manufacturing: + selection_fields: + PrimaryActivity: + - Natural gas Industrial - Manufacturing + - Natural Gas Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Natural Gas + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas #Intentionally left out 'Wood Commercial' and 'Wood Industrial' - "EPA_GHGI_T_3_9": - <<: *stationary_combustion # N2O emissions from stationary combustion + EPA_GHGI_T_3_9: + <<: *stationary_combustion # N2O emissions from stationary combustion ## Other sources "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals From c687b21cc371c1b3f1ad5b6423216d2d61b4468c Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 24 Mar 2023 21:51:51 -0400 Subject: [PATCH 0413/1127] update chapter 4 tables --- flowsa/data_source_scripts/EPA_GHGI.py | 6 - .../flowbysectormethods/GHG_national_m1.yaml | 114 ++++++++---------- 2 files changed, 47 insertions(+), 73 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_GHGI.py b/flowsa/data_source_scripts/EPA_GHGI.py index 0d8e25877..7cfd7c4ba 100644 --- a/flowsa/data_source_scripts/EPA_GHGI.py +++ b/flowsa/data_source_scripts/EPA_GHGI.py @@ -887,12 +887,6 @@ def clean_HFC_fba(fba, source_dict, **_): return df -def remove_HFC_kt(fba, **_): - """Remove records of emissions in kt, data are also provided in MMT CO2e. - clean_fba_before_mapping_df_fxn used in EPA_GHGI_T_4_50.""" - return fba.loc[fba['Unit'] != 'kt'] - - def adjust_transport_activities(df, **_): """Update activity names for improved transportatin parsing. clean_allocation_fba used in EPA_GHGI_T_A_14""" diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml index a83cfd8dd..8d7888707 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml @@ -619,24 +619,19 @@ source_names: <<: *stationary_combustion # N2O emissions from stationary combustion ## Other sources - "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals - data_format: 'FBA' - class: Chemicals - geoscale_to_use: national - # year: # override with ghgi_year - fedefl_mapping: 'GHGI' - activity_sets: - direct: - names: - - "Acrylonitrile" - - "Carbon Black" - - "Ethylene" - - "Ethylene Dichloride" - - "Ethylene Oxide" - - "Methanol" - allocation_method: direct - allocation_source: None - allocation_from_scale: national + EPA_GHGI_T_4_46: #CO2 for selected petrochemicals + # year: # override with ghgi_year + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + - Acrylonitrile + - Carbon Black + - Ethylene + - Ethylene Dichloride + - Ethylene Oxide + - Methanol + attribution_method: direct + "GHGI_nonenergy_fossil_fuel_emissions": # Fossil fuel for non-energy uses data_format: 'FBA' class: Chemicals @@ -688,31 +683,21 @@ source_names: clean_parameter: {"324110": 'ActivityProducedBy'} # purchases of refinery ## Other Emissions - "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production - data_format: 'FBA' - class: Chemicals - geoscale_to_use: national - # year: # override with ghgi_year - clean_fba_before_mapping_df_fxn: !script_function:EPA_GHGI remove_HFC_kt - fedefl_mapping: 'GHGI' - activity_sets: - direct: - names: - - "HCFC-22 Production" - allocation_method: direct - allocation_from_scale: national - "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture - data_format: 'FBA' - class: Chemicals - geoscale_to_use: national - # year: # override with ghgi_year - fedefl_mapping: 'GHGI' - activity_sets: - direct: - names: - - "Electronics Production" - allocation_method: direct - allocation_from_scale: national + EPA_GHGI_T_4_50: # HFCs from HCFC-22 production + # year: # override with ghgi_year + fedefl_mapping: GHGI + selection_fields: + Unit: MMT CO2e # drop records in kt + PrimaryActivity: HCFC-22 Production + attribution_method: direct + + EPA_GHGI_T_4_96: # HFCs and other emissions from electronics manufacture + # year: # override with ghgi_year + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: Electronics Production + attribution_method: direct + "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes data_format: 'FBA' class: Chemicals @@ -774,27 +759,22 @@ source_names: - "Refrigerated Transport - Ships and Boats" allocation_method: direct allocation_from_scale: national - "EPA_GHGI_T_4_80": # PFCs from aluminum production - data_format: 'FBA' - class: Chemicals - geoscale_to_use: national - # year: # override with ghgi_year - fedefl_mapping: 'GHGI' - activity_sets: - aluminum: - names: - - "Aluminum Production" - allocation_method: direct - allocation_from_scale: national - "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production - data_format: 'FBA' - class: Chemicals - geoscale_to_use: national - # year: # override with ghgi_year - fedefl_mapping: 'GHGI' - activity_sets: - magnesium: - <<: *make_allocation # Make table allocation - names: - - "Magnesium Production and Processing" - clean_parameter: {"T008": 'ActivityConsumedBy'} # Gross Output + + EPA_GHGI_T_4_80: # PFCs from aluminum production + # year: # override with ghgi_year + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: Aluminum Production + attribution_method: direct + + EPA_GHGI_T_4_86: # HFCs, SF6, CO2 from magnesium production + # year: # override with ghgi_year + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: Magnesium Production and Processing + attribution_method: proportional + attribution_source: + BEA_Make_Detail_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {T008: ''} # Total Output From d9987fdaad8e5542bd368983fd4a487f7d9d790c Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 24 Mar 2023 22:17:14 -0400 Subject: [PATCH 0414/1127] GHGI_nonenergy fuel emissions --- .../flowbysectormethods/GHG_national_m1.yaml | 122 +++++++++++------- 1 file changed, 72 insertions(+), 50 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml index 8d7888707..4f7f0285b 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml @@ -23,7 +23,7 @@ attribution_sources: selection_fields: &mecs_energy_default_selection Class: Energy # or Other (for non-energy use) Unit: Trillion Btu - # Flow: Coal # override this + # FlowName: Coal # override this Location: '00000' Description: - Table 2.2 # applies to Class Other @@ -632,55 +632,77 @@ source_names: - Methanol attribution_method: direct - "GHGI_nonenergy_fossil_fuel_emissions": # Fossil fuel for non-energy uses - data_format: 'FBA' - class: Chemicals - geoscale_to_use: national - # year: #override with ghgi_year - fedefl_mapping: 'GHGI' - activity_sets: - coal: - names: - - "Industry Industrial Coking Coal" - - "Industry Industrial Other Coal" - allocation_method: direct - allocation_from_scale: national - petroleum: - <<: *fuel_MECS - names: #Flows are from T_3_22b except where noted, as they change in T_3_22 post 2019 - - "Industry Asphalt & Road Oil" - - "Industry Distillate Fuel Oil" - - "Industry LPG" - - "Industry Lubricants" - - "Industry Miscellaneous Products" - - "Industry Naphtha (<401 F)" - - "Industry Other Oil (>401 F)" - - "Industry Petroleum Coke" - - "Industry Special Naphtha" - - "Industry Still Gas" - - "Industry Waxes" - - "Industry Pentanes Plus" - - "Industry Natural Gasoline" #T_3_22. Also produced by nat gas plants - - "Industry HGL" #T_3_22. Also produced by nat gas plants - allocation_source_class: "Other" # nonfuel consumption - allocation_flow: - - "Residual Fuel Oil" - - "Distillate Fuel Oil" - - "Hydrocarbon Gas Liquids, excluding natural gasoline" - clean_parameter: {"324110": 'ActivityProducedBy'} # use purchases of petroleum refineries - natural_gas: # consumed nat gas to chemical plants - <<: *fuel_MECS - names: - - "Industry Natural Gas to Chemical Plants" - allocation_source_class: "Other" # nonfuel consumption - allocation_flow: - - "Natural Gas" - clean_parameter: {"221200": 'ActivityProducedBy'} #use purchases of natural gas distribution - transport_lubricants: - <<: *use_allocation - names: - - "Transportation Lubricants" - clean_parameter: {"324110": 'ActivityProducedBy'} # purchases of refinery + GHGI_nonenergy_fossil_fuel_emissions: # Fossil fuel for non-energy uses + # year: #override with ghgi_year + fedefl_mapping: GHGI + activity_sets: + coal: + selection_fields: + PrimaryActivity: + - Industry Industrial Coking Coal + - Industry Industrial Other Coal + attribution_method: direct + + petroleum_feedstocks: # consumed petroleum products + selection_fields: + PrimaryActivity: + - Industry Asphalt & Road Oil + - Industry Distillate Fuel Oil + - Industry LPG + - Industry Lubricants + - Industry Miscellaneous Products + - Industry Naphtha (<401 F) + - Industry Other Oil (>401 F) + - Industry Pentanes Plus + - Industry Petroleum Coke + - Industry Special Naphtha + - Industry Still Gas + - Industry Waxes + - Industry Natural Gasoline #T_3_22. Also produced by nat gas plants + - Industry HGL #T_3_22. Also produced by nat gas plants + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: + - Residual Fuel Oil + - Distillate Fuel Oil + - Hydrocarbon Gas Liquids, excluding natural gasoline + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refineries + + natural_gas: # consumed nat gas to chemical plants + selection_fields: + PrimaryActivity: Industry Natural Gas to Chemical Plants + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + FlowName: Natural Gas + Unit: Trillion Btu + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + transportation_lubricants: + selection_fields: + PrimaryActivity: Transportation Lubricants + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # use of petroleum products ## Other Emissions EPA_GHGI_T_4_50: # HFCs from HCFC-22 production From 757b4836c80af27ea8852794555e4a2a02957ac7 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sat, 25 Mar 2023 11:17:00 -0400 Subject: [PATCH 0415/1127] update table 4-102 --- flowsa/data_source_scripts/EPA_GHGI.py | 31 ++++--- .../flowbysectormethods/GHG_national_m1.yaml | 85 +++++++++++-------- 2 files changed, 71 insertions(+), 45 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_GHGI.py b/flowsa/data_source_scripts/EPA_GHGI.py index 7cfd7c4ba..12947aa0c 100644 --- a/flowsa/data_source_scripts/EPA_GHGI.py +++ b/flowsa/data_source_scripts/EPA_GHGI.py @@ -780,26 +780,35 @@ def allocate_industrial_combustion(fba: FlowByActivity, **_) -> FlowByActivity: return fba -def split_HFCs_by_type(fba, source_dict, **_): +def split_HFCs_by_type(fba: FlowByActivity, **_) -> FlowByActivity: """Speciates HFCs and PFCs for all activities based on T_4_100. clean_fba_before_mapping_df_fxn""" - tbl = source_dict['clean_parameter']['flow_fba'] + + attributes_to_save = { + attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] + } + + tbl = fba.config.get('clean_parameter')['flow_fba'] # 4-100 splits = load_fba_w_standardized_units(datasource=tbl, year=fba['Year'][0]) splits['pct'] = splits['FlowAmount'] / splits['FlowAmount'].sum() splits = splits[['FlowName', 'pct']] speciated_df = fba.apply(lambda x: [p * x['FlowAmount'] for p in splits['pct']], - axis=1, result_type='expand') + axis=1, result_type='expand') speciated_df.columns = splits['FlowName'] - speciated_df = pd.concat([fba, speciated_df], axis=1) - speciated_df = speciated_df.melt(id_vars=flow_by_activity_fields.keys(), - var_name='Flow') - speciated_df['FlowName'] = speciated_df['Flow'] - speciated_df['FlowAmount'] = speciated_df['value'] - speciated_df.drop(columns=['Flow', 'value'], inplace=True) - - return speciated_df + fba = pd.concat([fba, speciated_df], axis=1) + fba = (fba + .melt(id_vars=[c for c in flow_by_activity_fields.keys() if c in fba], + var_name='Flow') + .drop(columns=['FlowName', 'FlowAmount']) + .rename(columns={'Flow': 'FlowName', + 'value': 'FlowAmount'})) + new_fba = FlowByActivity(fba) + for attr in attributes_to_save: + setattr(new_fba, attr, attributes_to_save[attr]) + + return new_fba def subtract_HFC_transport_emissions(df, parameter_dict): diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml index 4f7f0285b..2ca6a01a3 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml @@ -720,40 +720,57 @@ source_names: PrimaryActivity: Electronics Production attribution_method: direct - "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes - data_format: 'FBA' - class: Chemicals - geoscale_to_use: national - # year: # override with ghgi_year - clean_fba_before_mapping_df_fxn: !script_function:EPA_GHGI split_HFCs_by_type - clean_parameter: - # Proportions of specific HFCs are assigned based on national total - flow_fba: 'EPA_GHGI_T_4_100' - fedefl_mapping: 'GHGI' - activity_sets: - households: - names: - - "Domestic Refrigeration" - - "Residential Stationary Air Conditioning" - allocation_method: direct - allocation_from_scale: national - refrigerants: - <<: *use_allocation - names: - - "Commercial Refrigeration" - - "Industrial Process Refrigeration" - clean_parameter: {"333415": 'ActivityProducedBy'} # Air conditioning equipment - air_conditioning: - <<: *use_allocation - names: - - "Commercial Stationary Air Conditioning" - clean_parameter: {"333415": 'ActivityProducedBy'} # Air conditioning equipment - foams: - <<: *use_allocation - names: - - "Foams" - clean_parameter: {"326140": 'ActivityProducedBy', # Polystyrene foam - "326150": 'ActivityProducedBy'} # Urethane and other foam + EPA_GHGI_T_4_102: # HFCs and PFCs from ODS Substitutes + clean_fba_before_activity_sets: !script_function:EPA_GHGI split_HFCs_by_type + clean_parameter: + # Proportions of specific HFCs are assigned based on national total + flow_fba: EPA_GHGI_T_4_100 + # year: # override with ghgi_year + fedefl_mapping: GHGI + activity_sets: + households: + selection_fields: + PrimaryActivity: + - Domestic Refrigeration + - Residential Stationary Air Conditioning + attribution_method: direct + + refrigerants: + selection_fields: + PrimaryActivity: + - Commercial Refrigeration + - Industrial Process Refrigeration + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment + + air_conditioning: + selection_fields: + PrimaryActivity: + - Commercial Stationary Air Conditioning + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment + + foams: + selection_fields: + PrimaryActivity: + - Foams + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: + '326140': '' # Polystyrene foam + '326150': '' # Urethane and other foam + # 'Mobile Air Conditioning' and 'Transport Refrigeration' come from # different table. # Intentionally left out 'Solvents', 'Aerosols', 'Fire Protection' From c2f3c4c21ee8e132a6c6651971f7c69ce9dacea6 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sat, 25 Mar 2023 11:17:17 -0400 Subject: [PATCH 0416/1127] drop old fxns --- flowsa/data_source_scripts/EIA_MECS.py | 330 +++++++++--------- .../temp_data_source_functions.py | 37 +- 2 files changed, 186 insertions(+), 181 deletions(-) diff --git a/flowsa/data_source_scripts/EIA_MECS.py b/flowsa/data_source_scripts/EIA_MECS.py index 2ed32700b..4e4c180ce 100644 --- a/flowsa/data_source_scripts/EIA_MECS.py +++ b/flowsa/data_source_scripts/EIA_MECS.py @@ -460,169 +460,173 @@ def eia_mecs_energy_parse(*, df_list, source, year, **_): return df -def mecs_energy_fba_cleanup(fba, attr, **kwargs): - """ - Clean up the EIA MECS energy FlowByActivity - :param fba: df, FBA format - :param attr: dictionary, attribute data from method yaml for activity set - :param kwargs: optional, can also include bool 'download_FBAs_if_missing' - :return: df, subset of EIA MECS Energy FBA - """ - # subset the df to only include values where the unit = MJ - fba = fba.loc[fba['Unit'] == 'MJ'].reset_index(drop=True) - - return fba - - -def eia_mecs_energy_clean_allocation_fba_w_sec( - df_w_sec, attr, method, **kwargs): - """ - clean up eia_mecs_energy df with sectors by estimating missing data - :param df_w_sec: df, EIA MECS Energy, FBA format with sector columns - :param attr: dictionary, attribute data from method yaml for activity set - :param method: dictionary, FBS method yaml - :param kwargs: includes "sourcename" which is required for other - 'clean_fba_w_sec' fxns - :return: df, EIA MECS energy with estimated missing data - """ - - # drop rows where flowamount = 0, which drops supressed data - df_w_sec = df_w_sec[df_w_sec['FlowAmount'] != 0].reset_index(drop=True) - - # estimate missing data - sector_column = 'SectorConsumedBy' - df = determine_flows_requiring_disaggregation( - df_w_sec, attr, method, sector_column) - - # drop rows where flowamount = 0 - df2 = df[df['FlowAmount'] != 0].reset_index(drop=True) - - return df2 - -def mecs_energy_equally_attribute( - df_w_sec, attr, method, **kwargs): - """ - This function equally attributes EIA MECS data to NAICS6. This function - was developed by pulling from existing functions in the recursive_refac - branch: clean_mecs_energy_fba(), clean_mapped_mecs_energy_fba(), - and equally_attribute(). - - :param df_w_sec: df, EIA MECS Energy, FBA format with sector columns - :param attr: dictionary, attribute data from method yaml for activity set - :param method: dictionary, FBS method yaml - :param kwargs: includes "sourcename" which is required for other - 'clean_fba_w_sec' fxns - :return: df, EIA MECS energy with estimated missing data - """ - - # drop rows where flowamount = 0, which drops supressed data - df = df_w_sec[df_w_sec['FlowAmount'] != 0].reset_index(drop=True) - - mecs = ( - df - .assign(descendants='') - .assign(group_id=df.reset_index().index) - ) - - for level in [5, 4, 3]: - descendants = ( - mecs - .drop(columns='descendants') - .query(f'ActivityConsumedBy.str.len() > {level}') - .assign( - parent=lambda x: x.ActivityConsumedBy.str.slice(stop=level) - ) - .groupby(['FlowName', 'Location', 'parent']) - .agg({'FlowAmount': 'sum', 'ActivityConsumedBy': ' '.join}) - .reset_index() - .rename(columns={'ActivityConsumedBy': 'descendants', - 'FlowAmount': 'descendant_flows', - 'parent': 'ActivityConsumedBy'}) - ) - - mecs = ( - mecs - .merge(descendants, - how='left', - on=['FlowName', 'Location', 'ActivityConsumedBy'], - suffixes=(None, '_y')) - .fillna({'descendant_flows': 0, 'descendants_y': ''}) - .assign( - descendants=lambda x: x.descendants.mask(x.descendants == '', - x.descendants_y), - FlowAmount=lambda x: (x.FlowAmount - x.descendant_flows).mask( - x.FlowAmount - x.descendant_flows < 0, 0) - ) - .drop(columns=['descendant_flows', 'descendants_y']) - ) - - # drop sector columns and map all data to NAICS6 - # load naics 2 to naics 6 crosswalk - cw_load = load_crosswalk('sector_length') - # only keep official naics - cw = cw_load.drop(columns=['NAICS_7']).drop_duplicates() - cw_melt = pd.melt(cw, - id_vars=["NAICS_6"], var_name="NAICS_Length", - value_name="Activity").drop( - columns=['NAICS_Length']).drop_duplicates() - - mecs2 = mecs.drop(columns=['SectorConsumedBy']) - mecs2 = (mecs2 - .merge(cw_melt, how='left', left_on='ActivityConsumedBy', - right_on='Activity') - .rename(columns={'NAICS_6': 'SectorConsumedBy'}) - .drop(columns=['Activity']) - ) - mecs2['SectorConsumedBy'] = mecs2['SectorConsumedBy'].fillna( - mecs2['ActivityConsumedBy']) - - mecs_sub = ( - mecs2 - .assign(to_keep=mecs2.apply( - lambda x: not any([x.SectorConsumedBy.startswith(d) - for d in x.descendants.split()]), - axis='columns' - )) - .query('to_keep') - .drop(columns=['descendants', 'to_keep']) - ) - - groupby_cols = ['group_id'] - mecs_sub = ( - mecs_sub - .assign( - **{f'_naics_{n}': mecs_sub['SectorConsumedBy'].str.slice(stop=n) - for n in range(2, 7)}, - **{f'_unique_naics_{n}_by_group': lambda x, i=n: ( - x.groupby(groupby_cols if i == 2 - else [*groupby_cols, f'_naics_{i - 1}'], - dropna=False) - [[f'_naics_{i}']] - .transform('nunique', dropna=False) - ) - for n in range(2, 7)}, - FlowAmount=lambda x: reduce( - lambda x, y: x / y, - [x.FlowAmount, *[x[f'_unique_naics_{n}_by_group'] - for n in range(2, 7)]] - ) - ) - ) - groupby_cols.append('SectorConsumedBy') - - # replace ACB - mecs_sub['ActivityConsumedBy'] = mecs_sub['SectorConsumedBy'] - - mecs_sub = mecs_sub.drop( - columns=['group_id', *[f'_naics_{n}' for n in range(2, 7)], - *[f'_unique_naics_{n}_by_group' for n in range(2, 7)]] - ) - # aggregate - mecs_sub2 = sector_aggregation(mecs_sub) - mecs_sub2 = mecs_sub2[mecs_sub2['FlowAmount'] != 0].sort_values( - 'SectorConsumedBy').reset_index(drop=True) - - return mecs_sub2 +## Drop this function +# def mecs_energy_fba_cleanup(fba, attr, **kwargs): +# """ +# Clean up the EIA MECS energy FlowByActivity +# :param fba: df, FBA format +# :param attr: dictionary, attribute data from method yaml for activity set +# :param kwargs: optional, can also include bool 'download_FBAs_if_missing' +# :return: df, subset of EIA MECS Energy FBA +# """ +# # subset the df to only include values where the unit = MJ +# fba = fba.loc[fba['Unit'] == 'MJ'].reset_index(drop=True) + +# return fba + + +## Drop this function +# def eia_mecs_energy_clean_allocation_fba_w_sec( +# df_w_sec, attr, method, **kwargs): +# """ +# clean up eia_mecs_energy df with sectors by estimating missing data +# :param df_w_sec: df, EIA MECS Energy, FBA format with sector columns +# :param attr: dictionary, attribute data from method yaml for activity set +# :param method: dictionary, FBS method yaml +# :param kwargs: includes "sourcename" which is required for other +# 'clean_fba_w_sec' fxns +# :return: df, EIA MECS energy with estimated missing data +# """ + +# # drop rows where flowamount = 0, which drops supressed data +# df_w_sec = df_w_sec[df_w_sec['FlowAmount'] != 0].reset_index(drop=True) + +# # estimate missing data +# sector_column = 'SectorConsumedBy' +# df = determine_flows_requiring_disaggregation( +# df_w_sec, attr, method, sector_column) + +# # drop rows where flowamount = 0 +# df2 = df[df['FlowAmount'] != 0].reset_index(drop=True) + +# return df2 + + +## Drop this function +# def mecs_energy_equally_attribute( +# df_w_sec, attr, method, **kwargs): +# """ +# This function equally attributes EIA MECS data to NAICS6. This function +# was developed by pulling from existing functions in the recursive_refac +# branch: clean_mecs_energy_fba(), clean_mapped_mecs_energy_fba(), +# and equally_attribute(). + +# :param df_w_sec: df, EIA MECS Energy, FBA format with sector columns +# :param attr: dictionary, attribute data from method yaml for activity set +# :param method: dictionary, FBS method yaml +# :param kwargs: includes "sourcename" which is required for other +# 'clean_fba_w_sec' fxns +# :return: df, EIA MECS energy with estimated missing data +# """ + +# # drop rows where flowamount = 0, which drops supressed data +# df = df_w_sec[df_w_sec['FlowAmount'] != 0].reset_index(drop=True) + +# mecs = ( +# df +# .assign(descendants='') +# .assign(group_id=df.reset_index().index) +# ) + +# for level in [5, 4, 3]: +# descendants = ( +# mecs +# .drop(columns='descendants') +# .query(f'ActivityConsumedBy.str.len() > {level}') +# .assign( +# parent=lambda x: x.ActivityConsumedBy.str.slice(stop=level) +# ) +# .groupby(['FlowName', 'Location', 'parent']) +# .agg({'FlowAmount': 'sum', 'ActivityConsumedBy': ' '.join}) +# .reset_index() +# .rename(columns={'ActivityConsumedBy': 'descendants', +# 'FlowAmount': 'descendant_flows', +# 'parent': 'ActivityConsumedBy'}) +# ) + +# mecs = ( +# mecs +# .merge(descendants, +# how='left', +# on=['FlowName', 'Location', 'ActivityConsumedBy'], +# suffixes=(None, '_y')) +# .fillna({'descendant_flows': 0, 'descendants_y': ''}) +# .assign( +# descendants=lambda x: x.descendants.mask(x.descendants == '', +# x.descendants_y), +# FlowAmount=lambda x: (x.FlowAmount - x.descendant_flows).mask( +# x.FlowAmount - x.descendant_flows < 0, 0) +# ) +# .drop(columns=['descendant_flows', 'descendants_y']) +# ) + +# # drop sector columns and map all data to NAICS6 +# # load naics 2 to naics 6 crosswalk +# cw_load = load_crosswalk('sector_length') +# # only keep official naics +# cw = cw_load.drop(columns=['NAICS_7']).drop_duplicates() +# cw_melt = pd.melt(cw, +# id_vars=["NAICS_6"], var_name="NAICS_Length", +# value_name="Activity").drop( +# columns=['NAICS_Length']).drop_duplicates() + +# mecs2 = mecs.drop(columns=['SectorConsumedBy']) +# mecs2 = (mecs2 +# .merge(cw_melt, how='left', left_on='ActivityConsumedBy', +# right_on='Activity') +# .rename(columns={'NAICS_6': 'SectorConsumedBy'}) +# .drop(columns=['Activity']) +# ) +# mecs2['SectorConsumedBy'] = mecs2['SectorConsumedBy'].fillna( +# mecs2['ActivityConsumedBy']) + +# mecs_sub = ( +# mecs2 +# .assign(to_keep=mecs2.apply( +# lambda x: not any([x.SectorConsumedBy.startswith(d) +# for d in x.descendants.split()]), +# axis='columns' +# )) +# .query('to_keep') +# .drop(columns=['descendants', 'to_keep']) +# ) + +# groupby_cols = ['group_id'] +# mecs_sub = ( +# mecs_sub +# .assign( +# **{f'_naics_{n}': mecs_sub['SectorConsumedBy'].str.slice(stop=n) +# for n in range(2, 7)}, +# **{f'_unique_naics_{n}_by_group': lambda x, i=n: ( +# x.groupby(groupby_cols if i == 2 +# else [*groupby_cols, f'_naics_{i - 1}'], +# dropna=False) +# [[f'_naics_{i}']] +# .transform('nunique', dropna=False) +# ) +# for n in range(2, 7)}, +# FlowAmount=lambda x: reduce( +# lambda x, y: x / y, +# [x.FlowAmount, *[x[f'_unique_naics_{n}_by_group'] +# for n in range(2, 7)]] +# ) +# ) +# ) +# groupby_cols.append('SectorConsumedBy') + +# # replace ACB +# mecs_sub['ActivityConsumedBy'] = mecs_sub['SectorConsumedBy'] + +# mecs_sub = mecs_sub.drop( +# columns=['group_id', *[f'_naics_{n}' for n in range(2, 7)], +# *[f'_unique_naics_{n}_by_group' for n in range(2, 7)]] +# ) +# # aggregate +# mecs_sub2 = sector_aggregation(mecs_sub) +# mecs_sub2 = mecs_sub2[mecs_sub2['FlowAmount'] != 0].sort_values( +# 'SectorConsumedBy').reset_index(drop=True) + +# return mecs_sub2 def mecs_land_fba_cleanup(fba, **_): diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index 52757f4de..14a32cd3e 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -401,24 +401,25 @@ def clean_mapped_mecs_energy_fba(fba: FlowByActivity, **_) -> FlowByActivity: return mecs -def clean_hfc_fba(fba: FlowByActivity, **kwargs): - attributes_to_save = { - attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] - } - - df = ( - fba - .pipe(ghgi.subtract_HFC_transport_emissions) - .pipe(ghgi.allocate_HFC_to_residential) - .pipe(ghgi.split_HFC_foams) - .pipe(ghgi.split_HFCs_by_type) - ) - - new_fba = FlowByActivity(df) - for attr in attributes_to_save: - setattr(new_fba, attr, attributes_to_save[attr]) - - return new_fba +## Fxn may no longer be necessary due to updated GHGI tables +# def clean_hfc_fba(fba: FlowByActivity, **kwargs): +# attributes_to_save = { +# attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] +# } + +# df = ( +# fba +# .pipe(ghgi.subtract_HFC_transport_emissions) +# .pipe(ghgi.allocate_HFC_to_residential) +# .pipe(ghgi.split_HFC_foams) +# .pipe(ghgi.split_HFCs_by_type) +# ) + +# new_fba = FlowByActivity(df) +# for attr in attributes_to_save: +# setattr(new_fba, attr, attributes_to_save[attr]) + +# return new_fba def clean_hfc_fba_for_seea(fba: FlowByActivity, **kwargs): From 3f07fd864a1427c1d7bc476dd4775522cd91c754 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sat, 25 Mar 2023 12:00:01 -0400 Subject: [PATCH 0417/1127] HFC transport; use dictionary to simplify names and simplify crosswalk --- .../NAICS_Crosswalk_EPA_GHGI.csv | 21 ++++------ .../flowbysectormethods/GHG_national_m1.yaml | 42 +++++++++---------- 2 files changed, 27 insertions(+), 36 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv index 47e807037..96a86fb4e 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv @@ -551,15 +551,11 @@ EPA_GHGI,Foams,NAICS_2012_Code,92,,,EPA_GHGI_T_4_101 EPA_GHGI,Foams,NAICS_2012_Code,F01000,,,EPA_GHGI_T_4_101 EPA_GHGI,Solvents,,,,excluded,EPA_GHGI_T_4_101 EPA_GHGI,Fire Protection,,,,excluded,EPA_GHGI_T_4_101 -EPA_GHGI,Mobile AC - Heavy-Duty Vehicles,NAICS_2012_Code,484,,484000,EPA_GHGI_T_A_103 -EPA_GHGI,Mobile AC - Light-Duty Trucks,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_103 -EPA_GHGI,Refrigerated Transport - Medium- and Heavy-Duty Trucks,NAICS_2012_Code,484,,484000,EPA_GHGI_T_A_103 -EPA_GHGI,Mobile AC - Passenger Cars,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_103 -EPA_GHGI,Comfort Cooling for Trains and Buses - Rail,NAICS_2012_Code,482,,482000,EPA_GHGI_T_A_103 -EPA_GHGI,Refrigerated Transport - Rail,NAICS_2012_Code,482,,482000,EPA_GHGI_T_A_103 -EPA_GHGI,Comfort Cooling for Trains and Buses - School and Tour Buses,NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_103 -EPA_GHGI,Refrigerated Transport - Ships and Boats,NAICS_2012_Code,483,,483000,EPA_GHGI_T_A_103 -EPA_GHGI,Comfort Cooling for Trains and Buses - Transit Buses,,,,excluded,EPA_GHGI_T_A_103 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,484,,484000,EPA_GHGI_T_A_97 +EPA_GHGI,Mobile AC - Light-Duty Trucks,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_97 +EPA_GHGI,Mobile AC - Passenger Cars,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_97 +EPA_GHGI,School and Tour Buses,NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_97 +EPA_GHGI,Transit Buses,,,,excluded,EPA_GHGI_T_A_97 EPA_GHGI,Buses,NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_79 EPA_GHGI,Buses - Distillate Fuel Oil,NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_79 EPA_GHGI,Buses - Distillate Fuel Oil,NAICS_2012_Code,487,,48A000,EPA_GHGI_T_A_79 @@ -576,7 +572,7 @@ EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,492,,492000,EPA_GHGI_T_A_79 EPA_GHGI,Light-Duty Trucks - Gasoline,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 EPA_GHGI,Light-Duty Trucks - Gasoline,NAICS_2012_Code,492,,492000,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,484,,484000,EPA_GHGI_T_A_79 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,484,,484000,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_97" EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil,NAICS_2012_Code,484,,484000,EPA_GHGI_T_A_79 EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil,NAICS_2012_Code,92212,,S00203,EPA_GHGI_T_A_79 EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil,NAICS_2012_Code,92214,,,EPA_GHGI_T_A_79 @@ -590,9 +586,8 @@ EPA_GHGI,Passenger Cars - Gasoline,NAICS_2012_Code,922,,"S00600, GSLGO",EPA_GHGI EPA_GHGI,Passenger Cars - Gasoline,NAICS_2012_Code,491,,491000,EPA_GHGI_T_A_79 EPA_GHGI,Pipelines,NAICS_2012_Code,486,,486000,EPA_GHGI_T_A_79 EPA_GHGI,Pipeline Natural Gas,NAICS_2012_Code,486,,,EPA_GHGI_T_3_13 -EPA_GHGI,Rail,NAICS_2012_Code,482,,482000,EPA_GHGI_T_A_79 +EPA_GHGI,Rail,NAICS_2012_Code,482,,482000,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_97" EPA_GHGI,Recreational Boats,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,4831,,483000,EPA_GHGI_T_A_79 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,4832,,4-digit to avoid data loss in BLS_QCEW,EPA_GHGI_T_A_79 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,483,,483000,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_97" EPA_GHGI,Ships and Non-Recreational Boats,NAICS_2012_Code,483,,483000,EPA_GHGI_T_A_79 EPA_GHGI,Ships and Non-Recreational Boats Residual Fuel Oil,NAICS_2012_Code,483,,,EPA_GHGI_T_3_13 diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml index 2ca6a01a3..4f64f9020 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml @@ -775,29 +775,25 @@ source_names: # different table. # Intentionally left out 'Solvents', 'Aerosols', 'Fire Protection' - "EPA_GHGI_T_A_97": # HFCs from Transportation - data_format: 'FBA' - class: Chemicals - geoscale_to_use: national - # year: # override with ghgi_year - clean_fba_before_mapping_df_fxn: !script_function:EPA_GHGI split_HFCs_by_type - clean_parameter: - # Proportions of specific HFCs are assigned based on national total - flow_fba: 'EPA_GHGI_T_4_100' - fedefl_mapping: 'GHGI' - activity_sets: - direct: - names: - - "Mobile AC - Passenger Cars" - - "Mobile AC - Heavy-Duty Vehicles" - - "Mobile AC - Light-Duty Trucks" - - "Comfort Cooling for Trains and Buses - School and Tour Buses" - - "Comfort Cooling for Trains and Buses - Rail" - - "Refrigerated Transport - Medium- and Heavy-Duty Trucks" - - "Refrigerated Transport - Rail" - - "Refrigerated Transport - Ships and Boats" - allocation_method: direct - allocation_from_scale: national + EPA_GHGI_T_A_97: # HFCs from Transportation + # year: # override with ghgi_year + clean_fba_before_mapping: !script_function:EPA_GHGI split_HFCs_by_type + clean_parameter: + # Proportions of specific HFCs are assigned based on national total + flow_fba: EPA_GHGI_T_4_100 + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + Mobile AC - Passenger Cars: Mobile AC - Passenger Cars # No name change + Mobile AC - Light-Duty Trucks: Mobile AC - Light-Duty Trucks # No name change + Mobile AC - Heavy-Duty Vehicles: Heavy-Duty Vehicles + Comfort Cooling for Trains and Buses - School and Tour Buses: School and Tour Buses + # Comfort Cooling for Trains and Buses - Transit Buses: Transit Buses #excluded + Comfort Cooling for Trains and Buses - Rail: Rail + Refrigerated Transport - Medium- and Heavy-Duty Trucks: Medium- and Heavy-Duty Trucks + Refrigerated Transport - Rail: Rail + Refrigerated Transport - Ships and Boats: Ships and Boats + attribution_method: direct EPA_GHGI_T_4_80: # PFCs from aluminum production # year: # override with ghgi_year From 150ebddb46c53fa6e156886591442d424de2a623 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sat, 25 Mar 2023 13:27:11 -0400 Subject: [PATCH 0418/1127] use dictionary to simplify capitalization and repeated activities --- .../NAICS_Crosswalk_EPA_GHGI.csv | 156 ++++++------------ .../flowbysectormethods/GHG_national_m1.yaml | 24 +-- 2 files changed, 64 insertions(+), 116 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv index 96a86fb4e..0c3fc5ccd 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv @@ -221,30 +221,27 @@ EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,92,,,EPA_GHGI_T_3_22 EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,F01000,,,EPA_GHGI_T_3_22 EPA_GHGI,Coal Electric Power,NAICS_2012_Code,2211,,"Commodity: 221100 (or I: 221100, S00101, S00202)","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Electric Power,NAICS_2012_Code,2211,,"Commodity: 221100 (or I: 221100, S00101, S00202)","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Electric Power,NAICS_2012_Code,2211,,"Commodity: 221100 (or I: 221100, S00101, S00202)",EPA_GHGI_T_3_8 -EPA_GHGI,Natural Gas Electric Power,NAICS_2012_Code,2211,,,EPA_GHGI_T_3_9 +EPA_GHGI,Natural Gas Electric Power,NAICS_2012_Code,2211,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Wood Electric Power,NAICS_2012_Code,2211,,"Commodity: 221100 (or I: 221100, S00101, S00202)","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Coal Electric Power,NAICS_2012_Code,S00101,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Electric Power,NAICS_2012_Code,S00101,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Electric Power,NAICS_2012_Code,S00101,,,EPA_GHGI_T_3_8 -EPA_GHGI,Natural Gas Electric Power,NAICS_2012_Code,S00101,,,EPA_GHGI_T_3_9 +EPA_GHGI,Natural Gas Electric Power,NAICS_2012_Code,S00101,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Wood Electric Power,NAICS_2012_Code,S00101,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Coal Electric Power,NAICS_2012_Code,S00202,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Electric Power,NAICS_2012_Code,S00202,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Electric Power,NAICS_2012_Code,S00202,,,EPA_GHGI_T_3_8 -EPA_GHGI,Natural Gas Electric Power,NAICS_2012_Code,S00202,,,EPA_GHGI_T_3_9 +EPA_GHGI,Natural Gas Electric Power,NAICS_2012_Code,S00202,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Wood Electric Power,NAICS_2012_Code,S00202,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Coal Residential,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Natural Gas Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Wood Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23, 31, 32, 33","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23, 31, 32, 33","EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,31,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,32,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,33,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" @@ -252,10 +249,6 @@ EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_ EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Industrial,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Natural gas Industrial - Manufacturing,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Natural gas Industrial - Manufacturing,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Natural gas Industrial - Manufacturing,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" @@ -266,25 +259,25 @@ EPA_GHGI,Wood Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Wood Industrial,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Wood Industrial,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Wood Industrial,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,2213,,"2213, 42, 44, 45, 493, 5, 6, 7, 8, S00102, GSLGE, GSLGH","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,493,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,927110,,S00102,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,923110,,GSLGE,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,923120,,GSLGH,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,2213,,"2213, 42, 44, 45, 493, 5, 6, 7, 8, S00102, GSLGE, GSLGH","EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,45,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,493,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,51,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,52,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,53,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,54,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,55,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,56,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,61,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,927110,,S00102,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,923110,,GSLGE,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,923120,,GSLGH,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,2213,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" @@ -304,25 +297,6 @@ EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_ EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,927110,,S00102,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,923110,,GSLGE,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,923120,,GSLGH,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,2213,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,493,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,927110,,S00102,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,923110,,GSLGE,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,923120,,GSLGH,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Wood Commercial,NAICS_2012_Code,2213,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Wood Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Wood Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" @@ -392,17 +366,10 @@ EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 -EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23",EPA_GHGI_T_A_14 -EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,21,,,EPA_GHGI_T_A_14 -EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,2212,,,EPA_GHGI_T_A_14 -EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,23,,,EPA_GHGI_T_A_14 -EPA_GHGI,Industrial Other Coal Industrial - Manufacturing,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_A_14 -EPA_GHGI,Industrial Other Coal Industrial - Manufacturing,NAICS_2012_Code,32,,,EPA_GHGI_T_A_14 -EPA_GHGI,Industrial Other Coal Industrial - Manufacturing,NAICS_2012_Code,33,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23",EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,21,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,2212,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,23,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" EPA_GHGI,Natural Gas Industrial - Manufacturing,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_A_14 EPA_GHGI,Natural Gas Industrial - Manufacturing,NAICS_2012_Code,32,,,EPA_GHGI_T_A_14 EPA_GHGI,Natural Gas Industrial - Manufacturing,NAICS_2012_Code,33,,,EPA_GHGI_T_A_14 @@ -413,44 +380,25 @@ EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,23,,,EPA_GHGI_T_A_14 EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,31,,,EPA_GHGI_T_A_14 EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,32,,,EPA_GHGI_T_A_14 EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,33,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,2213,,"2213, 42, 44, 45, 493, 5, 6, 7, 8, S00102, GSLGE, GSLGH",EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,42,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,44,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,45,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,493,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,51,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,52,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,53,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,54,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,55,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,56,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,61,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,62,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,71,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,72,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,81,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,927110,,S00102,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,923110,,GSLGE,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,923120,,GSLGH,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,2213,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,42,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,44,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,45,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,493,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,51,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,52,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,53,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,54,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,55,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,56,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,61,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,62,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,71,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,72,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,81,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,927110,,S00102,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,923110,,GSLGE,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,923120,,GSLGH,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,2213,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,493,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,927110,,S00102,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,923110,,GSLGE,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,923120,,GSLGH,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,2213,,,EPA_GHGI_T_A_14 EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,42,,,EPA_GHGI_T_A_14 EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,44,,,EPA_GHGI_T_A_14 diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml index 4f64f9020..c6e8ba4ad 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml @@ -396,8 +396,8 @@ source_names: non-manufacturing_coal: selection_fields: PrimaryActivity: - - Commercial Coal Commercial - - Industrial Other Coal Industrial + Commercial Coal Commercial: Coal Commercial + Industrial Other Coal Industrial: Coal Industrial attribution_method: proportional attribution_source: BEA_Use_Detail_PRO_BeforeRedef: @@ -420,7 +420,7 @@ source_names: coal_manufacturing: # Industrial Coal for Manufacturing selection_fields: PrimaryActivity: - - Industrial Other Coal Industrial - Manufacturing + Industrial Other Coal Industrial - Manufacturing: Coal Industrial - Manufacturing attribution_method: proportional attribution_source: EIA_MECS_Energy: @@ -531,11 +531,11 @@ source_names: electric_power: selection_fields: PrimaryActivity: - - Coal Electric Power - - Natural Gas Electric Power - - Natural gas Electric Power # note lower case - - Fuel Oil Electric Power - - Wood Electric Power + Coal Electric Power: Coal Electric Power + Natural Gas Electric Power: Natural Gas Electric Power + Natural gas Electric Power: Natural Gas Electric Power # fix capitalization + Fuel Oil Electric Power: Fuel Oil Electric Power + Wood Electric Power: Wood Electric Power attribution_method: proportional attribution_source: BEA_Make_Detail_BeforeRedef: @@ -558,10 +558,10 @@ source_names: natural_gas_nonmanufacturing: # Commercial Natural gas selection_fields: PrimaryActivity: - - Natural gas Commercial - - Natural gas Industrial - - Natural Gas Commercial - - Natural Gas Industrial + Natural gas Commercial: Natural Gas Commercial # fix capitalization + Natural gas Industrial: Natural Gas Industrial # fix capitalization + Natural Gas Commercial: Natural Gas Commercial + Natural Gas Industrial: Natural Gas Industrial attribution_method: proportional attribution_source: BEA_Use_Detail_PRO_BeforeRedef: From d015e46b88fd228682de2a2c0fc143715c8d699c Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sat, 25 Mar 2023 13:44:37 -0400 Subject: [PATCH 0419/1127] consolidate petroleum product names --- .../NAICS_Crosswalk_EPA_GHGI.csv | 105 ++---------------- .../flowbysectormethods/GHG_national_m1.yaml | 30 ++--- 2 files changed, 22 insertions(+), 113 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv index 0c3fc5ccd..5ef956212 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv @@ -113,104 +113,13 @@ EPA_GHGI,Ethylene Oxide,NAICS_2012_Code,325199,,325411 (incorrect in original?), EPA_GHGI,Methanol,NAICS_2012_Code,325199,,325411 (incorrect in original?),EPA_GHGI_T_4_46 EPA_GHGI,Industry Industrial Coking Coal,NAICS_2012_Code,212210,,2122A0 (incorrect in original?),EPA_GHGI_T_3_22 EPA_GHGI,Industry Industrial Other Coal,NAICS_2012_Code,212210,,2122A0 (incorrect in original?),EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry HGL,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry HGL,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry HGL,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry HGL,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry HGL,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry HGL,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry HGL,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Natural Gasoline,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Natural Gasoline,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Natural Gasoline,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Natural Gasoline,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Natural Gasoline,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Natural Gasoline,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Natural Gasoline,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Products Non-energy,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Products Non-energy,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Products Non-energy,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Products Non-energy,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Products Non-energy,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Products Non-energy,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Products Non-energy,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 EPA_GHGI,Industry Natural Gas to Chemical Plants,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 EPA_GHGI,Industry Natural Gas to Chemical Plants,NAICS_2012_Code,32,,,EPA_GHGI_T_3_22 EPA_GHGI,Industry Natural Gas to Chemical Plants,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml index c6e8ba4ad..b40d2eb18 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml @@ -643,23 +643,23 @@ source_names: - Industry Industrial Other Coal attribution_method: direct - petroleum_feedstocks: # consumed petroleum products + petroleum: # consumed petroleum products selection_fields: PrimaryActivity: - - Industry Asphalt & Road Oil - - Industry Distillate Fuel Oil - - Industry LPG - - Industry Lubricants - - Industry Miscellaneous Products - - Industry Naphtha (<401 F) - - Industry Other Oil (>401 F) - - Industry Pentanes Plus - - Industry Petroleum Coke - - Industry Special Naphtha - - Industry Still Gas - - Industry Waxes - - Industry Natural Gasoline #T_3_22. Also produced by nat gas plants - - Industry HGL #T_3_22. Also produced by nat gas plants + 'Industry Asphalt & Road Oil': Industry Petroleum Products Non-energy + Industry Distillate Fuel Oil: Industry Petroleum Products Non-energy + Industry LPG: Industry Petroleum Products Non-energy + Industry Lubricants: Industry Petroleum Products Non-energy + Industry Miscellaneous Products: Industry Petroleum Products Non-energy + 'Industry Naphtha (<401 F)': Industry Petroleum Products Non-energy + 'Industry Other Oil (>401 F)': Industry Petroleum Products Non-energy + Industry Pentanes Plus: Industry Petroleum Products Non-energy + Industry Petroleum Coke: Industry Petroleum Products Non-energy + Industry Special Naphtha: Industry Petroleum Products Non-energy + Industry Still Gas: Industry Petroleum Products Non-energy + Industry Waxes: Industry Petroleum Products Non-energy + Industry Natural Gasoline: Industry Petroleum Products Non-energy #T_3_22. Also produced by nat gas plants + Industry HGL: Industry Petroleum Products Non-energy #T_3_22. Also produced by nat gas plants attribution_method: proportional attribution_source: EIA_MECS_Energy: From 3d9ef3c527475d58b227de26247cd508b1bc1244 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sat, 25 Mar 2023 15:08:55 -0400 Subject: [PATCH 0420/1127] replace A-9 with 3-13, simplify with name updates via dictionary --- .../NAICS_Crosswalk_EPA_GHGI.csv | 147 ++++++------------ flowsa/data_source_scripts/EPA_GHGI.py | 49 +++--- .../GHG_national_2016_m1.yaml | 27 +--- .../flowbysectormethods/GHG_national_m1.yaml | 118 +++++--------- 4 files changed, 122 insertions(+), 219 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv index 5ef956212..7176e3bf2 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv @@ -144,13 +144,13 @@ EPA_GHGI,Coal Residential,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_8, EPA_GH EPA_GHGI,Fuel Oil Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Natural Gas Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Wood Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23, 31, 32, 33","EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,31,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,32,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,33,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23, 31, 32, 33","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" @@ -168,25 +168,25 @@ EPA_GHGI,Wood Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Wood Industrial,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Wood Industrial,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Wood Industrial,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,2213,,"2213, 42, 44, 45, 493, 5, 6, 7, 8, S00102, GSLGE, GSLGH","EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,45,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,493,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,51,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,52,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,53,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,54,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,55,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,56,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,61,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,927110,,S00102,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,923110,,GSLGE,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,923120,,GSLGH,"EPA_GHGI_T_A_14, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,2213,,"2213, 42, 44, 45, 493, 5, 6, 7, 8, S00102, GSLGE, GSLGH","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,493,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,927110,,S00102,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,923110,,GSLGE,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,923120,,GSLGH,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,2213,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" @@ -239,42 +239,6 @@ EPA_GHGI,Synthetic Fertilizer Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_18 EPA_GHGI,All activities Grassland,NAICS_2012_Code,112,,112,"EPA_GHGI_T_5_18, EPA_GHGI_T_5_19" EPA_GHGI,Volatilization & Atm. Deposition Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_19 EPA_GHGI,Surface Leaching & Run-Off Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_19 -EPA_GHGI,Natural Gas Transportation,NAICS_2012_Code,48,,"48, 491, 492, S00500, S00600, GSLGO, S00201, S00203, F01000",EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 -EPA_GHGI,Aviation Gasoline Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 -EPA_GHGI,Aviation Gasoline Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 -EPA_GHGI,Aviation Gasoline Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 -EPA_GHGI,Aviation Gasoline Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 -EPA_GHGI,Aviation Gasoline Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,S00201,,,EPA_GHGI_T_A_14 -EPA_GHGI,Jet Fuel Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 -EPA_GHGI,Jet Fuel Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 -EPA_GHGI,Jet Fuel Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 -EPA_GHGI,Jet Fuel Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 -EPA_GHGI,Jet Fuel Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 -EPA_GHGI,LPG (Propane) Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 -EPA_GHGI,LPG (Propane) Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 -EPA_GHGI,LPG (Propane) Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 -EPA_GHGI,LPG (Propane) Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 -EPA_GHGI,LPG (Propane) Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 -EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 -EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 -EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 -EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 -EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" @@ -413,38 +377,29 @@ EPA_GHGI,Mobile AC - Light-Duty Trucks,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T EPA_GHGI,Mobile AC - Passenger Cars,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_97 EPA_GHGI,School and Tour Buses,NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_97 EPA_GHGI,Transit Buses,,,,excluded,EPA_GHGI_T_A_97 -EPA_GHGI,Buses,NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_79 -EPA_GHGI,Buses - Distillate Fuel Oil,NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_79 -EPA_GHGI,Buses - Distillate Fuel Oil,NAICS_2012_Code,487,,48A000,EPA_GHGI_T_A_79 -EPA_GHGI,Buses - Distillate Fuel Oil,NAICS_2012_Code,488,,,EPA_GHGI_T_A_79 -EPA_GHGI,Buses - Distillate Fuel Oil,NAICS_2012_Code,S00201,,S00201,EPA_GHGI_T_A_79 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,481,,481000,EPA_GHGI_T_A_79 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,481,,481000,EPA_GHGI_T_A_79 -EPA_GHGI,Military Aircraft,NAICS_2012_Code,928110,,S00500,EPA_GHGI_T_A_79 -EPA_GHGI,Commercial Aircraft Jet Fuel,NAICS_2012_Code,481,,,EPA_GHGI_T_3_13 -EPA_GHGI,General Aviation Aircraft Jet Fuel,NAICS_2012_Code,481,,,EPA_GHGI_T_3_13 -EPA_GHGI,General Aviation Aircraft Aviation Gasoline,NAICS_2012_Code,481,,,EPA_GHGI_T_3_13 -EPA_GHGI,Military Aircraft Jet Fuel,NAICS_2012_Code,928110,,,EPA_GHGI_T_3_13 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,492,,492000,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks - Gasoline,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks - Gasoline,NAICS_2012_Code,492,,492000,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,484,,484000,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_97" -EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil,NAICS_2012_Code,484,,484000,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil,NAICS_2012_Code,92212,,S00203,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil,NAICS_2012_Code,92214,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil,NAICS_2012_Code,92216,,,EPA_GHGI_T_A_79 -EPA_GHGI,Motorcycles,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 -EPA_GHGI,Passenger Cars,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 -EPA_GHGI,Passenger Cars,NAICS_2012_Code,922,,"S00600, GSLGO",EPA_GHGI_T_A_79 -EPA_GHGI,Passenger Cars,NAICS_2012_Code,491,,491000,EPA_GHGI_T_A_79 -EPA_GHGI,Passenger Cars - Gasoline,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 -EPA_GHGI,Passenger Cars - Gasoline,NAICS_2012_Code,922,,"S00600, GSLGO",EPA_GHGI_T_A_79 -EPA_GHGI,Passenger Cars - Gasoline,NAICS_2012_Code,491,,491000,EPA_GHGI_T_A_79 -EPA_GHGI,Pipelines,NAICS_2012_Code,486,,486000,EPA_GHGI_T_A_79 +EPA_GHGI,Buses,NAICS_2012_Code,485,,485000,EPA_GHGI_T_3_13 +EPA_GHGI,Buses - Distillate Fuel Oil,NAICS_2012_Code,485,,485000,EPA_GHGI_T_3_13 +EPA_GHGI,Buses - Distillate Fuel Oil,NAICS_2012_Code,487,,48A000,EPA_GHGI_T_3_13 +EPA_GHGI,Buses - Distillate Fuel Oil,NAICS_2012_Code,488,,,EPA_GHGI_T_3_13 +EPA_GHGI,Buses - Distillate Fuel Oil,NAICS_2012_Code,S00201,,S00201,EPA_GHGI_T_3_13 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,481,,481000,EPA_GHGI_T_3_13 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,481,,481000,EPA_GHGI_T_3_13 +EPA_GHGI,Military Aircraft,NAICS_2012_Code,928110,,S00500,EPA_GHGI_T_3_13 +EPA_GHGI,Light-Duty Trucks - Households,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_3_13 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_3_13 +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,492,,492000,EPA_GHGI_T_3_13 +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,484,,484000,"EPA_GHGI_T_3_13, EPA_GHGI_T_A_97" +EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil,NAICS_2012_Code,484,,484000,EPA_GHGI_T_3_13 +EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil,NAICS_2012_Code,92212,,S00203,EPA_GHGI_T_3_13 +EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil,NAICS_2012_Code,92214,,,EPA_GHGI_T_3_13 +EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil,NAICS_2012_Code,92216,,,EPA_GHGI_T_3_13 +EPA_GHGI,Motorcycles,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_3_13 +EPA_GHGI,Passenger Cars - Households,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_3_13 +EPA_GHGI,Passenger Cars,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_3_13 +EPA_GHGI,Passenger Cars,NAICS_2012_Code,922,,"S00600, GSLGO",EPA_GHGI_T_3_13 +EPA_GHGI,Passenger Cars,NAICS_2012_Code,491,,491000,EPA_GHGI_T_3_13 EPA_GHGI,Pipeline Natural Gas,NAICS_2012_Code,486,,,EPA_GHGI_T_3_13 -EPA_GHGI,Rail,NAICS_2012_Code,482,,482000,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_97" -EPA_GHGI,Recreational Boats,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,483,,483000,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_97" -EPA_GHGI,Ships and Non-Recreational Boats,NAICS_2012_Code,483,,483000,EPA_GHGI_T_A_79 -EPA_GHGI,Ships and Non-Recreational Boats Residual Fuel Oil,NAICS_2012_Code,483,,,EPA_GHGI_T_3_13 +EPA_GHGI,Rail,NAICS_2012_Code,482,,482000,"EPA_GHGI_T_3_13, EPA_GHGI_T_A_97" +EPA_GHGI,Recreational Boats,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_3_13 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,483,,483000,EPA_GHGI_T_A_97 +EPA_GHGI,Ships and Non-Recreational Boats,NAICS_2012_Code,483,,483000,EPA_GHGI_T_3_13 diff --git a/flowsa/data_source_scripts/EPA_GHGI.py b/flowsa/data_source_scripts/EPA_GHGI.py index 12947aa0c..72ff488b6 100644 --- a/flowsa/data_source_scripts/EPA_GHGI.py +++ b/flowsa/data_source_scripts/EPA_GHGI.py @@ -896,30 +896,31 @@ def clean_HFC_fba(fba, source_dict, **_): return df -def adjust_transport_activities(df, **_): - """Update activity names for improved transportatin parsing. - clean_allocation_fba used in EPA_GHGI_T_A_14""" - activities = {'Gasoline': ['Light-Duty Trucks', - 'Passenger Cars'], - 'Distillate Fuel Oil': - ['Medium- and Heavy-Duty Trucks', - 'Buses'], - } - for k, v in activities.items(): - df.loc[(df['ActivityConsumedBy'].isin(v)) & - (df['FlowName'] == k), - 'ActivityConsumedBy'] = df['ActivityConsumedBy'] + f" - {k}" - return df - - -def keep_six_digit_naics(df_w_sec, **_): - """Keep only activities at the 6-digit NAICS level - clean_allocation_fba_w_sec used for EPA_GHGI_T_A_73""" - df_w_sec = replace_NoneType_with_empty_cells(df_w_sec) - df_w_sec = df_w_sec.loc[ - (df_w_sec['SectorProducedBy'].apply(lambda x: len(x) == 6)) | - (df_w_sec['SectorConsumedBy'].apply(lambda x: len(x) == 6))] - return df_w_sec +# # No longer needed +# def adjust_transport_activities(df, **_): +# """Update activity names for improved transportatin parsing. +# clean_allocation_fba used in EPA_GHGI_T_A_14""" +# activities = {'Gasoline': ['Light-Duty Trucks', +# 'Passenger Cars'], +# 'Distillate Fuel Oil': +# ['Medium- and Heavy-Duty Trucks', +# 'Buses'], +# } +# for k, v in activities.items(): +# df.loc[(df['ActivityConsumedBy'].isin(v)) & +# (df['FlowName'] == k), +# 'ActivityConsumedBy'] = df['ActivityConsumedBy'] + f" - {k}" +# return df + +# # No longer needed +# def keep_six_digit_naics(df_w_sec, **_): +# """Keep only activities at the 6-digit NAICS level +# clean_allocation_fba_w_sec used for EPA_GHGI_T_A_73""" +# df_w_sec = replace_NoneType_with_empty_cells(df_w_sec) +# df_w_sec = df_w_sec.loc[ +# (df_w_sec['SectorProducedBy'].apply(lambda x: len(x) == 6)) | +# (df_w_sec['SectorConsumedBy'].apply(lambda x: len(x) == 6))] +# return df_w_sec if __name__ == "__main__": import flowsa diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml index 198c96f6b..86cbfd85d 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml @@ -55,6 +55,9 @@ source_names: "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_18 year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion + !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year "EPA_GHGI_T_3_14": #CH4 from mobile combustion !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_14 year: *ghgi_year @@ -95,7 +98,7 @@ source_names: year: *mecs_year ### Major CO2 Sources - "EPA_GHGI_T_A_9": # CO2 emissions from stationary combustion and transportation. This table number changes with year + "EPA_GHGI_T_A_9": # CO2 emissions from stationary combustion. This table number changes with year !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport year: *ghgi_year clean_parameter: *industrial_dict @@ -107,28 +110,6 @@ source_names: natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing year: *mecs_year - ### Transportation - ng_transport: &transport_direct - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:ng_transport - year: *ghgi_year - aviation_transport: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:aviation_transport - <<: *transport_direct - jet_transport: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:jet_transport - <<: *transport_direct - lpg_transport: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:lpg_transport - <<: *transport_direct - rfo_transport: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:rfo_transport - <<: *transport_direct - dfo_transport: &transport_use - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:dfo_transport - year: *ghgi_year - gasoline_transport: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:gasoline_transport - <<: *transport_use "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8 diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml index b40d2eb18..23c1afe05 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml @@ -38,20 +38,6 @@ attribution_sources: # selection_fields: # ActivityProducedBy: {'XXXXX': ''} - _use_allocation: &use_allocation - # names: # override this - allocation_source: "BEA_Use_Detail_PRO_BeforeRedef" - activity_to_sector_mapping: "BEA_2012_Detail" - allocation_method: proportional - allocation_source_class: "Money" - allocation_source_year: 2012 - allocation_flow: - - "USD2012" - allocation_compartment: None - allocation_from_scale: national - clean_allocation_fba_w_sec: !script_function:BEA subset_and_equally_allocate_BEA_table - # clean_parameter: # override this with dictionary like {"324110": 'ActivityProducedBy'} - _cropland_allocation: &cropland_allocation USDA_CoA_Cropland: year: 2017 @@ -77,26 +63,6 @@ attribution_sources: FlowName: FARM OPERATIONS clean_fba: !script_function:temp_data_source_functions clean_usda_cropland_naics - _transport_energy_use_allocation: &transport_energy_use_allocation - allocation_method: proportional - allocation_source: "EPA_GHGI_T_A_73" #Energy consumption by source and transport type - allocation_source_class: "Energy" - # allocation_source_year: # override with ghgi_year - # allocation_flow: # override with activity name, e.g. ['Distillate Fuel Oil'] - allocation_compartment: None - allocation_from_scale: national - clean_allocation_fba: !script_function:EPA_GHGI adjust_transport_activities - clean_allocation_fba_w_sec: !script_function:EPA_GHGI keep_six_digit_naics - helper_source: "BEA_Use_Detail_PRO_BeforeRedef" - helper_activity_to_sector_mapping: "BEA_2012_Detail" - helper_method: proportional - helper_source_class: "Money" - helper_source_year: 2012 - helper_flow: ["USD2012"] - helper_from_scale: national - clean_helper_fba_wsec: !script_function:BEA subset_and_equally_allocate_BEA_table - clean_parameter: {"324110": 'ActivityProducedBy'} # use of petroleum products - source_names: EPA_GHGI_T_2_1: #U.S. GHG emissions # year: # override this @@ -466,48 +432,48 @@ source_names: ActivityProducedBy: {'324110': ''} # purchases of refinery products ### Transportation - ng_transport: &transport_direct - names: - - "Natural Gas Transportation" - allocation_method: proportional - allocation_source: "EPA_GHGI_T_A_73" - allocation_source_class: "Energy" - # allocation_source_year: *ghgi_year - allocation_flow: ['Natural Gas'] - allocation_compartment: None - allocation_from_scale: national - activity_to_sector_aggregation_level: disaggregated - aviation_transport: - <<: *transport_direct - names: - - "Aviation Gasoline Transportation" - allocation_flow: ['Aviation Gasoline'] - jet_transport: - <<: *transport_direct - names: - - "Jet Fuel Transportation" - allocation_flow: ['Jet Fuel'] - lpg_transport: - <<: *transport_direct - names: - - "LPG (Propane) Transportation" - allocation_flow: ['LPG'] - rfo_transport: - <<: *transport_direct - names: - - "Residual Fuel Transportation" - allocation_flow: ['Residual Fuel Oil'] - dfo_transport: - <<: *transport_energy_use_allocation - names: - - "Distillate Fuel Oil Transportation" - # allocation_source_year: # override with ghgi_year - allocation_flow: ['Distillate Fuel Oil'] - gasoline_transport: - <<: *transport_energy_use_allocation - names: - - "Motor Gasoline Transportation" - allocation_flow: ['Motor Gasoline'] + EPA_GHGI_T_3_13: #CO2 from mobile combustion + fedefl_mapping: GHGI + activity_sets: + direct_attribution: + selection_fields: + PrimaryActivity: + General Aviation Aircraft Aviation Gasoline: General Aviation Aircraft + General Aviation Aircraft Jet Fuel: General Aviation Aircraft + Commercial Aircraft Jet Fuel: Commercial Aircraft + Military Aircraft Jet Fuel: Military Aircraft + Buses Gasoline: Buses + Buses LPG: Buses + Buses Natural Gas: Buses + Pipeline Natural Gas: Pipeline Natural Gas + Motorcycles Gasoline: Motorcycles + Rail Distillate Fuel Oil: Rail + Recreational Boats Distillate Fuel Oil: Recreational Boats + Recreational Boats Gasoline: Recreational Boats + Ships and Non-Recreational Boats Distillate Fuel Oil: Ships and Non-Recreational Boats + Ships and Non-Recreational Boats Residual Fuel Oil: Ships and Non-Recreational Boats + Medium- and Heavy-Duty Trucks Gasoline: Medium- and Heavy-Duty Trucks + Medium- and Heavy-Duty Trucks LPG: Medium- and Heavy-Duty Trucks + Light-Duty Trucks LPG: Light-Duty Trucks - Households + Passenger Cars LPG: Passenger Cars - Households + attribution_method: direct + + petroleum_fuels: + selection_fields: + PrimaryActivity: + Medium- and Heavy-Duty Trucks Distillate Fuel Oil: Medium- and Heavy-Duty Trucks - Distillate Fuel Oil + Buses Distillate Fuel Oil: Buses - Distillate Fuel Oil + Passenger Cars Distillate Fuel Oil: Passenger Cars + Passenger Cars Gasoline: Passenger Cars + Light-Duty Trucks Distillate Fuel Oil: Light-Duty Trucks + Light-Duty Trucks Gasoline: Light-Duty Trucks + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + ## Stationary Combustion EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion From c45ad942d1e704c76fcc933fa917ea27d3bfc12a Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sat, 25 Mar 2023 16:22:47 -0400 Subject: [PATCH 0421/1127] update mobile combustion 3-14, 3-15 to align with activity mapping in 3-13; slight update to methodology to include greater number of sectors for some activities --- .../NAICS_Crosswalk_EPA_GHGI.csv | 40 ++++++----------- .../flowbysectormethods/GHG_national_m1.yaml | 43 ++++++++++++------- 2 files changed, 39 insertions(+), 44 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv index 7176e3bf2..6db661c3e 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv @@ -37,9 +37,6 @@ EPA_GHGI,Electrical Transmission and Distribution,NAICS_2012_Code,2211,,221100,E EPA_GHGI,Electric Power,NAICS_2012_Code,2211,,"Commodity: 221100 (or I: 221100, S00101, S00202)",EPA_GHGI_T_2_1 EPA_GHGI,Electric Power,NAICS_2012_Code,S00101,,,EPA_GHGI_T_2_1 EPA_GHGI,Electric Power,NAICS_2012_Code,S00202,,,EPA_GHGI_T_2_1 -EPA_GHGI,Electric Power Sector,NAICS_2012_Code,2211,,"Commodity: 221100 (or I: 221100, S00101, S00202)",EPA_GHGI_T_2_1 -EPA_GHGI,Electric Power Sector,NAICS_2012_Code,S00101,,,EPA_GHGI_T_2_1 -EPA_GHGI,Electric Power Sector,NAICS_2012_Code,S00202,,,EPA_GHGI_T_2_1 EPA_GHGI,Liming,NAICS_2012_Code,111,,"111, 112",EPA_GHGI_T_2_1 EPA_GHGI,Liming,NAICS_2012_Code,112,,,EPA_GHGI_T_2_1 EPA_GHGI,Urea Fertilization,NAICS_2012_Code,111,,"111, 112",EPA_GHGI_T_2_1 @@ -58,12 +55,7 @@ EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,492,,,"EPA_GHGI_T_3_14, EPA_GH EPA_GHGI,Construction/Mining Equipment Non-Road,NAICS_2012_Code,211,,"211000, 212100, 2122A0, 212230, 212310, 2123AO, 213111","EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Construction/Mining Equipment Non-Road,NAICS_2012_Code,212,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Construction/Mining Equipment Non-Road,NAICS_2012_Code,213111,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Diesel On-Road,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,484,,484000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks Diesel On-Road,NAICS_2012_Code,484,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Buses Diesel On-Road,NAICS_2012_Code,485,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Gasoline On-Road,NAICS_2012_Code,484,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses,NAICS_2012_Code,484,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Other Non-Road,NAICS_2012_Code,485,,"485000, 48A000, 492000, 532100, 532400, 621900, 713900, 811100, 811300","EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Other Non-Road,NAICS_2012_Code,487,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Other Non-Road,NAICS_2012_Code,488,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" @@ -74,12 +66,6 @@ EPA_GHGI,Other Non-Road,NAICS_2012_Code,6219,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15 EPA_GHGI,Other Non-Road,NAICS_2012_Code,7139,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Other Non-Road,NAICS_2012_Code,8111,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Other Non-Road,NAICS_2012_Code,8113,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Passenger Cars Gasoline On-Road,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Passenger Cars Diesel On-Road,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Aircraft Non-Road,NAICS_2012_Code,481,,481000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Rail Non-Road,NAICS_2012_Code,482,,482000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Ships and Boats Non-Road,NAICS_2012_Code,483,,483000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motorcycles Gasoline On-Road,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Exploration,NAICS_2012_Code,211111,,211000,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42, EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" EPA_GHGI,Production,NAICS_2012_Code,211111,,211000,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42, EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" EPA_GHGI,Crude Oil Transportation,NAICS_2012_Code,486110,,not mapped,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42" @@ -373,8 +359,6 @@ EPA_GHGI,Foams,NAICS_2012_Code,F01000,,,EPA_GHGI_T_4_101 EPA_GHGI,Solvents,,,,excluded,EPA_GHGI_T_4_101 EPA_GHGI,Fire Protection,,,,excluded,EPA_GHGI_T_4_101 EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,484,,484000,EPA_GHGI_T_A_97 -EPA_GHGI,Mobile AC - Light-Duty Trucks,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_97 -EPA_GHGI,Mobile AC - Passenger Cars,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_97 EPA_GHGI,School and Tour Buses,NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_97 EPA_GHGI,Transit Buses,,,,excluded,EPA_GHGI_T_A_97 EPA_GHGI,Buses,NAICS_2012_Code,485,,485000,EPA_GHGI_T_3_13 @@ -383,23 +367,23 @@ EPA_GHGI,Buses - Distillate Fuel Oil,NAICS_2012_Code,487,,48A000,EPA_GHGI_T_3_13 EPA_GHGI,Buses - Distillate Fuel Oil,NAICS_2012_Code,488,,,EPA_GHGI_T_3_13 EPA_GHGI,Buses - Distillate Fuel Oil,NAICS_2012_Code,S00201,,S00201,EPA_GHGI_T_3_13 EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,481,,481000,EPA_GHGI_T_3_13 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,481,,481000,EPA_GHGI_T_3_13 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,481,,481000,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Military Aircraft,NAICS_2012_Code,928110,,S00500,EPA_GHGI_T_3_13 -EPA_GHGI,Light-Duty Trucks - Households,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_3_13 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_3_13 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,492,,492000,EPA_GHGI_T_3_13 +EPA_GHGI,Light-Duty Trucks - Households,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_13, EPA_GHGI_T_A_97" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,492,,492000,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,484,,484000,"EPA_GHGI_T_3_13, EPA_GHGI_T_A_97" EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil,NAICS_2012_Code,484,,484000,EPA_GHGI_T_3_13 EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil,NAICS_2012_Code,92212,,S00203,EPA_GHGI_T_3_13 EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil,NAICS_2012_Code,92214,,,EPA_GHGI_T_3_13 EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil,NAICS_2012_Code,92216,,,EPA_GHGI_T_3_13 -EPA_GHGI,Motorcycles,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_3_13 -EPA_GHGI,Passenger Cars - Households,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_3_13 -EPA_GHGI,Passenger Cars,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_3_13 -EPA_GHGI,Passenger Cars,NAICS_2012_Code,922,,"S00600, GSLGO",EPA_GHGI_T_3_13 -EPA_GHGI,Passenger Cars,NAICS_2012_Code,491,,491000,EPA_GHGI_T_3_13 +EPA_GHGI,Motorcycles,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Passenger Cars - Households,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_13, EPA_GHGI_T_A_97" +EPA_GHGI,Passenger Cars,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Passenger Cars,NAICS_2012_Code,922,,"S00600, GSLGO","EPA_GHGI_T_3_13, EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Passenger Cars,NAICS_2012_Code,491,,491000,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Pipeline Natural Gas,NAICS_2012_Code,486,,,EPA_GHGI_T_3_13 -EPA_GHGI,Rail,NAICS_2012_Code,482,,482000,"EPA_GHGI_T_3_13, EPA_GHGI_T_A_97" +EPA_GHGI,Rail,NAICS_2012_Code,482,,482000,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14, EPA_GHGI_T_3_15, EPA_GHGI_T_A_97" EPA_GHGI,Recreational Boats,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_3_13 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,483,,483000,EPA_GHGI_T_A_97 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,483,,483000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15, EPA_GHGI_T_A_97" EPA_GHGI,Ships and Non-Recreational Boats,NAICS_2012_Code,483,,483000,EPA_GHGI_T_3_13 diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml index 23c1afe05..ad45f58b8 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml @@ -106,7 +106,8 @@ source_names: electric_power: selection_fields: - PrimaryActivity: Electric Power Sector #CO2 + PrimaryActivity: + Electric Power Sector: Electric Power #CO2 attribution_method: proportional attribution_source: BEA_Make_Detail_BeforeRedef: @@ -286,19 +287,30 @@ source_names: direct_attribution: selection_fields: PrimaryActivity: - - Passenger Cars Gasoline On-Road - - Passenger Cars Diesel On-Road - - Light-Duty Trucks Gasoline On-Road - - Light-Duty Trucks Diesel On-Road - - Rail Non-Road - - Ships and Boats Non-Road - - Aircraft Non-Road - - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road - - Medium- and Heavy-Duty Buses Diesel On-Road - - Medium- and Heavy-Duty Trucks and Buses Gasoline On-Road - - Motorcycles Gasoline On-Road + Rail Non-Road: Rail + Ships and Boats Non-Road: Ships and Boats + Aircraft Non-Road: General Aviation Aircraft + Motorcycles Gasoline On-Road: Motorcycles + Medium- and Heavy-Duty Trucks and Buses Diesel On-Road: Medium- and Heavy-Duty Trucks and Buses + Medium- and Heavy-Duty Trucks and Buses Gasoline On-Road: Medium- and Heavy-Duty Trucks and Buses attribution_method: direct + petroleum_fuels: + selection_fields: + PrimaryActivity: + Passenger Cars Gasoline On-Road: Passenger Cars + Passenger Cars Diesel On-Road: Passenger Cars + Light-Duty Trucks Gasoline On-Road: Light-Duty Trucks + Light-Duty Trucks Diesel On-Road: Light-Duty Trucks + Medium- and Heavy-Duty Buses Diesel On-Road: Buses - Distillate Fuel Oil + Medium- and Heavy-Duty Trucks Diesel On-Road: Medium- and Heavy-Duty Trucks - Distillate Fuel Oil + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + construction_and_mining: #this set is allocated by purchases of construction equipment selection_fields: PrimaryActivity: Construction/Mining Equipment Non-Road @@ -332,8 +344,7 @@ source_names: alt_fuel_on_road: #this set is allocated by purchases of natural gas selection_fields: PrimaryActivity: - - Alternative Fuel On-Road - - All activities Alternative Fuel On-Road # corrected from "Alternative Fuel On-Road", which isn't in the source FBA. + All activities Alternative Fuel On-Road: Alternative Fuel On-Road attribution_method: proportional attribution_source: BEA_Use_Detail_PRO_BeforeRedef: @@ -750,8 +761,8 @@ source_names: fedefl_mapping: GHGI selection_fields: PrimaryActivity: - Mobile AC - Passenger Cars: Mobile AC - Passenger Cars # No name change - Mobile AC - Light-Duty Trucks: Mobile AC - Light-Duty Trucks # No name change + Mobile AC - Passenger Cars: Passenger Cars - Households + Mobile AC - Light-Duty Trucks: Light-Duty Trucks - Households Mobile AC - Heavy-Duty Vehicles: Heavy-Duty Vehicles Comfort Cooling for Trains and Buses - School and Tour Buses: School and Tour Buses # Comfort Cooling for Trains and Buses - Transit Buses: Transit Buses #excluded From 74ab81b8935109f10fd88442727389b47a3e9a8d Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sat, 25 Mar 2023 20:29:01 -0400 Subject: [PATCH 0422/1127] update 2017-2020 methods --- .../GHG_national_2017_m1.yaml | 45 ++++++------------ .../GHG_national_2018_m1.yaml | 45 ++++++------------ .../GHG_national_2019_m1.yaml | 45 ++++++------------ .../GHG_national_2020_m1.yaml | 46 ++++++------------- 4 files changed, 53 insertions(+), 128 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml index 33769acb4..6d327fdb5 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml @@ -21,7 +21,7 @@ source_names: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_2_1:activity_sets lead: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead - allocation_source_year: *ghgi_year + year: *ghgi_year "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year @@ -55,6 +55,9 @@ source_names: "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_18 year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion + !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year "EPA_GHGI_T_3_14": #CH4 from mobile combustion !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_14 year: *ghgi_year @@ -89,13 +92,13 @@ source_names: !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets petroleum: !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum - allocation_source_year: *mecs_year + year: *mecs_year natural_gas: !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas - allocation_source_year: *mecs_year + year: *mecs_year ### Major CO2 Sources - "EPA_GHGI_T_A_8": # CO2 emissions from stationary combustion and transportation + "EPA_GHGI_T_A_8": # CO2 emissions from stationary combustion !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport year: *ghgi_year # Table A_8 is specific to 2017 clean_parameter: *industrial_dict @@ -103,32 +106,10 @@ source_names: !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets coal_manufacturing: !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing - allocation_source_year: *mecs_year - ### Transportation - ng_transport: &transport_direct - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:ng_transport - allocation_source_year: *ghgi_year - aviation_transport: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:aviation_transport - <<: *transport_direct - jet_transport: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:jet_transport - <<: *transport_direct - lpg_transport: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:lpg_transport - <<: *transport_direct - rfo_transport: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:rfo_transport - <<: *transport_direct - dfo_transport: &transport_use - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:dfo_transport - allocation_source_year: *ghgi_year - gasoline_transport: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:gasoline_transport - <<: *transport_use + year: *mecs_year "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8 @@ -138,10 +119,10 @@ source_names: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets coal_manufacturing: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year ng_manufacturing: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9 @@ -151,7 +132,7 @@ source_names: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets coal_manufacturing: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year ng_manufacturing: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml index edde77e0c..c028f6ff0 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml @@ -21,7 +21,7 @@ source_names: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_2_1:activity_sets lead: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead - allocation_source_year: *ghgi_year + year: *ghgi_year "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year @@ -55,6 +55,9 @@ source_names: "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_18 year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion + !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year "EPA_GHGI_T_3_14": #CH4 from mobile combustion !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_14 year: *ghgi_year @@ -89,13 +92,13 @@ source_names: !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets petroleum: !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum - allocation_source_year: *mecs_year + year: *mecs_year natural_gas: !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas - allocation_source_year: *mecs_year + year: *mecs_year ### Major CO2 Sources - "EPA_GHGI_T_A_7": # CO2 emissions from stationary combustion and transportation. This table number varies by GHG year + "EPA_GHGI_T_A_7": # CO2 emissions from stationary combustion. This table number varies by GHG year !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport year: *ghgi_year # Table A_7 is specific to 2018 clean_parameter: *industrial_dict @@ -103,32 +106,10 @@ source_names: !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets coal_manufacturing: !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing - allocation_source_year: *mecs_year - ### Transportation - ng_transport: &transport_direct - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:ng_transport - allocation_source_year: *ghgi_year - aviation_transport: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:aviation_transport - <<: *transport_direct - jet_transport: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:jet_transport - <<: *transport_direct - lpg_transport: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:lpg_transport - <<: *transport_direct - rfo_transport: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:rfo_transport - <<: *transport_direct - dfo_transport: &transport_use - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:dfo_transport - allocation_source_year: *ghgi_year - gasoline_transport: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:gasoline_transport - <<: *transport_use + year: *mecs_year "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8 @@ -138,10 +119,10 @@ source_names: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets coal_manufacturing: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year ng_manufacturing: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9 @@ -151,7 +132,7 @@ source_names: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets coal_manufacturing: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year ng_manufacturing: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml index 630c5f26b..bb044458b 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml @@ -21,7 +21,7 @@ source_names: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_2_1:activity_sets lead: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead - allocation_source_year: *ghgi_year + year: *ghgi_year "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year @@ -55,6 +55,9 @@ source_names: "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_18 year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion + !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year "EPA_GHGI_T_3_14": #CH4 from mobile combustion !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_14 year: *ghgi_year @@ -89,13 +92,13 @@ source_names: !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets petroleum: !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum - allocation_source_year: *mecs_year + year: *mecs_year natural_gas: !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas - allocation_source_year: *mecs_year + year: *mecs_year ### Major CO2 Sources - "EPA_GHGI_T_A_6": # CO2 emissions from stationary combustion and transportation. This table number varies by GHG year. + "EPA_GHGI_T_A_6": # CO2 emissions from stationary combustion. This table number varies by GHG year. !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport year: *ghgi_year clean_parameter: *industrial_dict @@ -103,32 +106,10 @@ source_names: !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets coal_manufacturing: !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing - allocation_source_year: *mecs_year - ### Transportation - ng_transport: &transport_direct - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:ng_transport - allocation_source_year: *ghgi_year - aviation_transport: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:aviation_transport - <<: *transport_direct - jet_transport: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:jet_transport - <<: *transport_direct - lpg_transport: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:lpg_transport - <<: *transport_direct - rfo_transport: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:rfo_transport - <<: *transport_direct - dfo_transport: &transport_use - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:dfo_transport - allocation_source_year: *ghgi_year - gasoline_transport: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:gasoline_transport - <<: *transport_use + year: *mecs_year "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8 @@ -138,10 +119,10 @@ source_names: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets coal_manufacturing: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year ng_manufacturing: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9 @@ -151,7 +132,7 @@ source_names: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets coal_manufacturing: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year ng_manufacturing: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml index d5148bbfa..a020b7373 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml @@ -21,7 +21,7 @@ source_names: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_2_1:activity_sets lead: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead - allocation_source_year: 2019 # latest year + year: 2019 # latest year "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year @@ -55,6 +55,9 @@ source_names: "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_18 year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion + !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year "EPA_GHGI_T_3_14": #CH4 from mobile combustion !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_14 year: *ghgi_year @@ -89,13 +92,13 @@ source_names: !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets petroleum: !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum - allocation_source_year: *mecs_year + year: *mecs_year natural_gas: !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas - allocation_source_year: *mecs_year + year: *mecs_year ## Major CO2 Sources - "EPA_GHGI_T_A_5": # CO2 emissions from stationary combustion and transportation. This table number varies by GHG year. + "EPA_GHGI_T_A_5": # CO2 emissions from stationary combustion. This table number varies by GHG year. !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport year: *ghgi_year clean_parameter: *industrial_dict @@ -103,32 +106,11 @@ source_names: !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets coal_manufacturing: !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing - allocation_source_year: *mecs_year - ### Transportation - ng_transport: &transport_direct - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:ng_transport - allocation_source_year: *ghgi_year - aviation_transport: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:aviation_transport - <<: *transport_direct - jet_transport: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:jet_transport - <<: *transport_direct - lpg_transport: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:lpg_transport - <<: *transport_direct - rfo_transport: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:rfo_transport - <<: *transport_direct - dfo_transport: &transport_use - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:dfo_transport - allocation_source_year: *ghgi_year - gasoline_transport: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:gasoline_transport - <<: *transport_use + year: *mecs_year + "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8 @@ -138,10 +120,10 @@ source_names: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets coal_manufacturing: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year ng_manufacturing: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9 @@ -151,7 +133,7 @@ source_names: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets coal_manufacturing: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year ng_manufacturing: !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing - allocation_source_year: *mecs_year + year: *mecs_year From ce254881d5f88cc3bbe4ad5213b8c76a2c9a78b2 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sat, 25 Mar 2023 20:34:23 -0400 Subject: [PATCH 0423/1127] drop old code --- flowsa/data_source_scripts/EIA_MECS.py | 176 +----------------- .../temp_data_source_functions.py | 22 --- 2 files changed, 2 insertions(+), 196 deletions(-) diff --git a/flowsa/data_source_scripts/EIA_MECS.py b/flowsa/data_source_scripts/EIA_MECS.py index 4e4c180ce..1ff34d962 100644 --- a/flowsa/data_source_scripts/EIA_MECS.py +++ b/flowsa/data_source_scripts/EIA_MECS.py @@ -7,17 +7,14 @@ https://www.eia.gov/consumption/manufacturing/data/2014/ Last updated: 8 Sept. 2020 """ -from functools import reduce import io -import math import pandas as pd import numpy as np -from flowsa.allocation import equally_allocate_parent_to_child_naics from flowsa.location import US_FIPS -from flowsa.common import WITHDRAWN_KEYWORD, load_crosswalk +from flowsa.common import WITHDRAWN_KEYWORD from flowsa.settings import vLogDetailed -from flowsa.flowbyfunctions import assign_fips_location_system, sector_aggregation +from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.dataclean import replace_strings_with_NoneType, \ replace_NoneType_with_empty_cells from flowsa.data_source_scripts.EIA_CBECS_Land import \ @@ -460,175 +457,6 @@ def eia_mecs_energy_parse(*, df_list, source, year, **_): return df -## Drop this function -# def mecs_energy_fba_cleanup(fba, attr, **kwargs): -# """ -# Clean up the EIA MECS energy FlowByActivity -# :param fba: df, FBA format -# :param attr: dictionary, attribute data from method yaml for activity set -# :param kwargs: optional, can also include bool 'download_FBAs_if_missing' -# :return: df, subset of EIA MECS Energy FBA -# """ -# # subset the df to only include values where the unit = MJ -# fba = fba.loc[fba['Unit'] == 'MJ'].reset_index(drop=True) - -# return fba - - -## Drop this function -# def eia_mecs_energy_clean_allocation_fba_w_sec( -# df_w_sec, attr, method, **kwargs): -# """ -# clean up eia_mecs_energy df with sectors by estimating missing data -# :param df_w_sec: df, EIA MECS Energy, FBA format with sector columns -# :param attr: dictionary, attribute data from method yaml for activity set -# :param method: dictionary, FBS method yaml -# :param kwargs: includes "sourcename" which is required for other -# 'clean_fba_w_sec' fxns -# :return: df, EIA MECS energy with estimated missing data -# """ - -# # drop rows where flowamount = 0, which drops supressed data -# df_w_sec = df_w_sec[df_w_sec['FlowAmount'] != 0].reset_index(drop=True) - -# # estimate missing data -# sector_column = 'SectorConsumedBy' -# df = determine_flows_requiring_disaggregation( -# df_w_sec, attr, method, sector_column) - -# # drop rows where flowamount = 0 -# df2 = df[df['FlowAmount'] != 0].reset_index(drop=True) - -# return df2 - - -## Drop this function -# def mecs_energy_equally_attribute( -# df_w_sec, attr, method, **kwargs): -# """ -# This function equally attributes EIA MECS data to NAICS6. This function -# was developed by pulling from existing functions in the recursive_refac -# branch: clean_mecs_energy_fba(), clean_mapped_mecs_energy_fba(), -# and equally_attribute(). - -# :param df_w_sec: df, EIA MECS Energy, FBA format with sector columns -# :param attr: dictionary, attribute data from method yaml for activity set -# :param method: dictionary, FBS method yaml -# :param kwargs: includes "sourcename" which is required for other -# 'clean_fba_w_sec' fxns -# :return: df, EIA MECS energy with estimated missing data -# """ - -# # drop rows where flowamount = 0, which drops supressed data -# df = df_w_sec[df_w_sec['FlowAmount'] != 0].reset_index(drop=True) - -# mecs = ( -# df -# .assign(descendants='') -# .assign(group_id=df.reset_index().index) -# ) - -# for level in [5, 4, 3]: -# descendants = ( -# mecs -# .drop(columns='descendants') -# .query(f'ActivityConsumedBy.str.len() > {level}') -# .assign( -# parent=lambda x: x.ActivityConsumedBy.str.slice(stop=level) -# ) -# .groupby(['FlowName', 'Location', 'parent']) -# .agg({'FlowAmount': 'sum', 'ActivityConsumedBy': ' '.join}) -# .reset_index() -# .rename(columns={'ActivityConsumedBy': 'descendants', -# 'FlowAmount': 'descendant_flows', -# 'parent': 'ActivityConsumedBy'}) -# ) - -# mecs = ( -# mecs -# .merge(descendants, -# how='left', -# on=['FlowName', 'Location', 'ActivityConsumedBy'], -# suffixes=(None, '_y')) -# .fillna({'descendant_flows': 0, 'descendants_y': ''}) -# .assign( -# descendants=lambda x: x.descendants.mask(x.descendants == '', -# x.descendants_y), -# FlowAmount=lambda x: (x.FlowAmount - x.descendant_flows).mask( -# x.FlowAmount - x.descendant_flows < 0, 0) -# ) -# .drop(columns=['descendant_flows', 'descendants_y']) -# ) - -# # drop sector columns and map all data to NAICS6 -# # load naics 2 to naics 6 crosswalk -# cw_load = load_crosswalk('sector_length') -# # only keep official naics -# cw = cw_load.drop(columns=['NAICS_7']).drop_duplicates() -# cw_melt = pd.melt(cw, -# id_vars=["NAICS_6"], var_name="NAICS_Length", -# value_name="Activity").drop( -# columns=['NAICS_Length']).drop_duplicates() - -# mecs2 = mecs.drop(columns=['SectorConsumedBy']) -# mecs2 = (mecs2 -# .merge(cw_melt, how='left', left_on='ActivityConsumedBy', -# right_on='Activity') -# .rename(columns={'NAICS_6': 'SectorConsumedBy'}) -# .drop(columns=['Activity']) -# ) -# mecs2['SectorConsumedBy'] = mecs2['SectorConsumedBy'].fillna( -# mecs2['ActivityConsumedBy']) - -# mecs_sub = ( -# mecs2 -# .assign(to_keep=mecs2.apply( -# lambda x: not any([x.SectorConsumedBy.startswith(d) -# for d in x.descendants.split()]), -# axis='columns' -# )) -# .query('to_keep') -# .drop(columns=['descendants', 'to_keep']) -# ) - -# groupby_cols = ['group_id'] -# mecs_sub = ( -# mecs_sub -# .assign( -# **{f'_naics_{n}': mecs_sub['SectorConsumedBy'].str.slice(stop=n) -# for n in range(2, 7)}, -# **{f'_unique_naics_{n}_by_group': lambda x, i=n: ( -# x.groupby(groupby_cols if i == 2 -# else [*groupby_cols, f'_naics_{i - 1}'], -# dropna=False) -# [[f'_naics_{i}']] -# .transform('nunique', dropna=False) -# ) -# for n in range(2, 7)}, -# FlowAmount=lambda x: reduce( -# lambda x, y: x / y, -# [x.FlowAmount, *[x[f'_unique_naics_{n}_by_group'] -# for n in range(2, 7)]] -# ) -# ) -# ) -# groupby_cols.append('SectorConsumedBy') - -# # replace ACB -# mecs_sub['ActivityConsumedBy'] = mecs_sub['SectorConsumedBy'] - -# mecs_sub = mecs_sub.drop( -# columns=['group_id', *[f'_naics_{n}' for n in range(2, 7)], -# *[f'_unique_naics_{n}_by_group' for n in range(2, 7)]] -# ) -# # aggregate -# mecs_sub2 = sector_aggregation(mecs_sub) -# mecs_sub2 = mecs_sub2[mecs_sub2['FlowAmount'] != 0].sort_values( -# 'SectorConsumedBy').reset_index(drop=True) - -# return mecs_sub2 - - def mecs_land_fba_cleanup(fba, **_): """ Modify the EIA MECS Land FBA diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index 14a32cd3e..02f57b18e 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -3,7 +3,6 @@ from flowsa.flowsa_log import log import pandas as pd import numpy as np -# from flowsa.data_source_scripts import EIA_MECS as mecs from flowsa.data_source_scripts import EPA_GHGI as ghgi from flowsa.data_source_scripts import USDA_CoA_Cropland as coa from flowsa.flowby import FlowByActivity @@ -401,27 +400,6 @@ def clean_mapped_mecs_energy_fba(fba: FlowByActivity, **_) -> FlowByActivity: return mecs -## Fxn may no longer be necessary due to updated GHGI tables -# def clean_hfc_fba(fba: FlowByActivity, **kwargs): -# attributes_to_save = { -# attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] -# } - -# df = ( -# fba -# .pipe(ghgi.subtract_HFC_transport_emissions) -# .pipe(ghgi.allocate_HFC_to_residential) -# .pipe(ghgi.split_HFC_foams) -# .pipe(ghgi.split_HFCs_by_type) -# ) - -# new_fba = FlowByActivity(df) -# for attr in attributes_to_save: -# setattr(new_fba, attr, attributes_to_save[attr]) - -# return new_fba - - def clean_hfc_fba_for_seea(fba: FlowByActivity, **kwargs): attributes_to_save = { attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] From e58a9d1039fd75412a91bf4dc07dbadeb89e57a3 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sat, 25 Mar 2023 21:00:39 -0400 Subject: [PATCH 0424/1127] fix error in fxn call --- flowsa/methods/flowbysectormethods/GHG_national_m1.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml index ad45f58b8..dcab32769 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml @@ -489,7 +489,7 @@ source_names: ## Stationary Combustion EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion # year: #override this with ghgi_year - clean_fba_df_fxn: !script_function:EPA_GHGI allocate_industrial_combustion + clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion # clean_parameter: # Override each year for use in allocate_industrial_combustion # energy_fba: 'EIA_MECS_Energy' # year: 2018 From 45e5b001211067ea330fd49dc722dcda6c28e172 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sun, 26 Mar 2023 09:42:32 -0400 Subject: [PATCH 0425/1127] comment out more inactive functions --- flowsa/data_source_scripts/EPA_GHGI.py | 157 +++++++++++++------------ 1 file changed, 79 insertions(+), 78 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_GHGI.py b/flowsa/data_source_scripts/EPA_GHGI.py index 72ff488b6..df334031c 100644 --- a/flowsa/data_source_scripts/EPA_GHGI.py +++ b/flowsa/data_source_scripts/EPA_GHGI.py @@ -811,89 +811,90 @@ def split_HFCs_by_type(fba: FlowByActivity, **_) -> FlowByActivity: return new_fba -def subtract_HFC_transport_emissions(df, parameter_dict): - """Remove the portion of transportation emissions which are sourced elsewhere.""" - tbl = parameter_dict.get('transport_fba') - transport_df = load_fba_w_standardized_units(datasource=tbl, - year=df['Year'][0]) - activity_list = parameter_dict.get('transport_activities') - transport_df = transport_df[transport_df['ActivityProducedBy'].isin(activity_list)] - df.loc[df['ActivityProducedBy'] == parameter_dict.get('ods_activity'), - 'FlowAmount'] = df['FlowAmount'] - transport_df['FlowAmount'].sum() - return df - - -def allocate_HFC_to_residential(df, parameter_dict): - """Split HFC emissions into two buckets to be further allocated. - - Calculate the portion of Refrigerants applied to households based on production of - household: 335222 - industry: 333415 - """ - make_df = load_fba_w_standardized_units(datasource=parameter_dict.get('make_fba'), - year=parameter_dict.get('make_year')) - h_sec = parameter_dict.get('household_make') - i_sec = parameter_dict.get('industry_make') - household = make_df[(make_df['ActivityProducedBy'] == h_sec) & - (make_df['ActivityConsumedBy'] == h_sec) - ].reset_index()['FlowAmount'][0] - industry = make_df[(make_df['ActivityProducedBy'] == i_sec) & - (make_df['ActivityConsumedBy'] == i_sec) - ].reset_index()['FlowAmount'][0] - - activity = parameter_dict.get('ods_activity') - df_subset = df.loc[df['ActivityProducedBy'] == activity].reset_index(drop=True) - df_subset['FlowAmount'] = df_subset[ - 'FlowAmount'] * (household / (industry + household)) - df_subset['ActivityProducedBy'] = f"{activity} - Households" - df.loc[df['ActivityProducedBy'] == activity, - 'FlowAmount'] = df['FlowAmount'] * (industry / (industry + household)) - df = pd.concat([df, df_subset], ignore_index=True) - - return df - +# # Fxn not actively used +# def subtract_HFC_transport_emissions(df, parameter_dict): +# """Remove the portion of transportation emissions which are sourced elsewhere.""" +# tbl = parameter_dict.get('transport_fba') +# transport_df = load_fba_w_standardized_units(datasource=tbl, +# year=df['Year'][0]) +# activity_list = parameter_dict.get('transport_activities') +# transport_df = transport_df[transport_df['ActivityProducedBy'].isin(activity_list)] +# df.loc[df['ActivityProducedBy'] == parameter_dict.get('ods_activity'), +# 'FlowAmount'] = df['FlowAmount'] - transport_df['FlowAmount'].sum() +# return df -def split_HFC_foams(df, parameter_dict): - """Split HFC emissions from foams into two buckets to be allocated separately. +# # Fxn not actively used +# def allocate_HFC_to_residential(df, parameter_dict): +# """Split HFC emissions into two buckets to be further allocated. + +# Calculate the portion of Refrigerants applied to households based on production of +# household: 335222 +# industry: 333415 +# """ +# make_df = load_fba_w_standardized_units(datasource=parameter_dict.get('make_fba'), +# year=parameter_dict.get('make_year')) +# h_sec = parameter_dict.get('household_make') +# i_sec = parameter_dict.get('industry_make') +# household = make_df[(make_df['ActivityProducedBy'] == h_sec) & +# (make_df['ActivityConsumedBy'] == h_sec) +# ].reset_index()['FlowAmount'][0] +# industry = make_df[(make_df['ActivityProducedBy'] == i_sec) & +# (make_df['ActivityConsumedBy'] == i_sec) +# ].reset_index()['FlowAmount'][0] + +# activity = parameter_dict.get('ods_activity') +# df_subset = df.loc[df['ActivityProducedBy'] == activity].reset_index(drop=True) +# df_subset['FlowAmount'] = df_subset[ +# 'FlowAmount'] * (household / (industry + household)) +# df_subset['ActivityProducedBy'] = f"{activity} - Households" +# df.loc[df['ActivityProducedBy'] == activity, +# 'FlowAmount'] = df['FlowAmount'] * (industry / (industry + household)) +# df = pd.concat([df, df_subset], ignore_index=True) - Calculate the portion for - Polystyrene: 326140 - Urethane: 326150 - """ - make_df = load_fba_w_standardized_units(datasource=parameter_dict.get('make_fba'), - year=parameter_dict.get('make_year')) - polys_sec = parameter_dict.get('polystyrene_make') - ure_sec = parameter_dict.get('urethane_make') - polystyrene = make_df[(make_df['ActivityProducedBy'] == polys_sec) & - (make_df['ActivityConsumedBy'] == polys_sec) - ].reset_index()['FlowAmount'][0] - urethane = make_df[(make_df['ActivityProducedBy'] == ure_sec) & - (make_df['ActivityConsumedBy'] == ure_sec) - ].reset_index()['FlowAmount'][0] - - activity = parameter_dict.get('foam_activity') - df_subset = df.loc[df['ActivityProducedBy'] == activity].reset_index(drop=True) - df_subset['FlowAmount'] = df_subset[ - 'FlowAmount'] * (polystyrene / (urethane + polystyrene)) - df_subset['ActivityProducedBy'] = f"{activity} - Polystyrene" - df.loc[df['ActivityProducedBy'] == activity, 'FlowAmount'] = df[ - 'FlowAmount'] * (urethane / (urethane + polystyrene)) - df.loc[df['ActivityProducedBy'] == activity, - 'ActivityProducedBy'] = f"{activity} - Urethane" - df = pd.concat([df, df_subset], ignore_index=True) +# return df - return df +# # Fxn not actively used +# def split_HFC_foams(df, parameter_dict): +# """Split HFC emissions from foams into two buckets to be allocated separately. + +# Calculate the portion for +# Polystyrene: 326140 +# Urethane: 326150 +# """ +# make_df = load_fba_w_standardized_units(datasource=parameter_dict.get('make_fba'), +# year=parameter_dict.get('make_year')) +# polys_sec = parameter_dict.get('polystyrene_make') +# ure_sec = parameter_dict.get('urethane_make') +# polystyrene = make_df[(make_df['ActivityProducedBy'] == polys_sec) & +# (make_df['ActivityConsumedBy'] == polys_sec) +# ].reset_index()['FlowAmount'][0] +# urethane = make_df[(make_df['ActivityProducedBy'] == ure_sec) & +# (make_df['ActivityConsumedBy'] == ure_sec) +# ].reset_index()['FlowAmount'][0] + +# activity = parameter_dict.get('foam_activity') +# df_subset = df.loc[df['ActivityProducedBy'] == activity].reset_index(drop=True) +# df_subset['FlowAmount'] = df_subset[ +# 'FlowAmount'] * (polystyrene / (urethane + polystyrene)) +# df_subset['ActivityProducedBy'] = f"{activity} - Polystyrene" +# df.loc[df['ActivityProducedBy'] == activity, 'FlowAmount'] = df[ +# 'FlowAmount'] * (urethane / (urethane + polystyrene)) +# df.loc[df['ActivityProducedBy'] == activity, +# 'ActivityProducedBy'] = f"{activity} - Urethane" +# df = pd.concat([df, df_subset], ignore_index=True) +# return df -def clean_HFC_fba(fba, source_dict, **_): - """Adjust HFC emissions for improved parsing. - clean_fba_before_mapping_df_fxn used in EPA_GHGI_T_4_102.""" - parameter_dict = source_dict['clean_parameter'] - df = subtract_HFC_transport_emissions(fba, parameter_dict) - df = allocate_HFC_to_residential(df, parameter_dict) - df = split_HFC_foams(df, parameter_dict) - df = split_HFCs_by_type(df, source_dict) - return df +# # Fxn not actively used +# def clean_HFC_fba(fba, source_dict, **_): +# """Adjust HFC emissions for improved parsing. +# clean_fba_before_mapping_df_fxn used in EPA_GHGI_T_4_102.""" +# parameter_dict = source_dict['clean_parameter'] +# df = subtract_HFC_transport_emissions(fba, parameter_dict) +# df = allocate_HFC_to_residential(df, parameter_dict) +# df = split_HFC_foams(df, parameter_dict) +# df = split_HFCs_by_type(df, source_dict) +# return df # # No longer needed From dd802ee7fa4a2f681f2e979ec998e6d5a012f39e Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 27 Mar 2023 14:07:44 -0600 Subject: [PATCH 0426/1127] drop hard coded "naics_2012_code" --- flowsa/flowby.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index ed6d1d84d..1cda8c5f4 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1161,7 +1161,7 @@ def map_to_sectors( # load master crosswalk cw = common.load_crosswalk('sector_timeseries') - sectors = (cw[['NAICS_2012_Code']] + sectors = (cw[[f'NAICS_{target_year}_Code']] .drop_duplicates() .dropna() ) @@ -1175,7 +1175,7 @@ def map_to_sectors( lambda x: x[0:dig]) == i] if len(n) == 1: expanded_n = sectors[ - sectors['NAICS_2012_Code'].apply( + sectors[f'NAICS_{target_year}_Code'].apply( lambda x: x[0:dig] == i)] expanded_n = expanded_n.assign(Sector=i) naics_df = pd.concat([naics_df, expanded_n]) @@ -1184,9 +1184,9 @@ def map_to_sectors( existing_sectors .merge(naics_df, how='left') .assign(Sector=lambda x: np.where( - x['NAICS_2012_Code'].isna(), x['Sector'], - x['NAICS_2012_Code'])) - .drop(columns=['NAICS_2012_Code']) + x[f'NAICS_{target_year}_Code'].isna(), x['Sector'], + x[f'NAICS_{target_year}_Code'])) + .drop(columns=[f'NAICS_{target_year}_Code']) ) target_naics = set( From 2a0631b1e5660cdbd3badd24d630c26febc0e7bd Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 27 Mar 2023 14:08:17 -0600 Subject: [PATCH 0427/1127] check for existing sectors in df based on activity name --- flowsa/flowby.py | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 1cda8c5f4..2a902b6c6 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1288,24 +1288,31 @@ def map_to_sectors( 'industry/sector aggregation structure.') if self.config['sector_hierarchy'] == 'parent-completeChild': existing_sectors = activity_to_source_naics_crosswalk[ - ['Sector']] + ['Activity', 'Sector']] # create list of sectors that exist in original df, which, # if created when expanding sector list cannot be added naics_df = pd.DataFrame([]) - for i in existing_sectors['Sector']: - dig = len(str(i)) - n = existing_sectors[ - existing_sectors['Sector'].apply( - lambda x: x[0:dig]) == i] - if len(n) == 1: - expanded_n = naics_key[naics_key['source_naics'] == i] - naics_df = pd.concat([naics_df, expanded_n]) + for i in existing_sectors['Activity'].unique(): + existing_sectors_sub = existing_sectors[ + existing_sectors['Activity'] == i] + for j in existing_sectors_sub['Sector']: + dig = len(str(j)) + n = existing_sectors_sub[ + existing_sectors_sub['Sector'].apply( + lambda x: x[0:dig]) == j] + if len(n) == 1: + expanded_n = naics_key[naics_key['source_naics'] + == j] + expanded_n = expanded_n.assign(Activity=i) + naics_df = pd.concat([naics_df, expanded_n]) activity_to_target_naics_crosswalk = ( activity_to_source_naics_crosswalk - .merge(naics_df, how='left', left_on='Sector', - right_on='source_naics') + .merge(naics_df, + how='left', + left_on=['Activity', 'Sector'], + right_on=['Activity', 'source_naics']) .assign(Sector=lambda x: x['target_naics']) .drop(columns=['source_naics', 'target_naics']) ) From 359ad58fb4614097aec4e5223759401286458d7c Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 27 Mar 2023 14:07:44 -0600 Subject: [PATCH 0428/1127] drop hard coded "naics_2012_code" --- flowsa/flowby.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 275d9a6c3..33c2927a0 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1166,7 +1166,7 @@ def map_to_sectors( # load master crosswalk cw = common.load_crosswalk('sector_timeseries') - sectors = (cw[['NAICS_2012_Code']] + sectors = (cw[[f'NAICS_{target_year}_Code']] .drop_duplicates() .dropna() ) @@ -1180,7 +1180,7 @@ def map_to_sectors( lambda x: x[0:dig]) == i] if len(n) == 1: expanded_n = sectors[ - sectors['NAICS_2012_Code'].apply( + sectors[f'NAICS_{target_year}_Code'].apply( lambda x: x[0:dig] == i)] expanded_n = expanded_n.assign(Sector=i) naics_df = pd.concat([naics_df, expanded_n]) @@ -1189,9 +1189,9 @@ def map_to_sectors( existing_sectors .merge(naics_df, how='left') .assign(Sector=lambda x: np.where( - x['NAICS_2012_Code'].isna(), x['Sector'], - x['NAICS_2012_Code'])) - .drop(columns=['NAICS_2012_Code']) + x[f'NAICS_{target_year}_Code'].isna(), x['Sector'], + x[f'NAICS_{target_year}_Code'])) + .drop(columns=[f'NAICS_{target_year}_Code']) ) target_naics = set( From ef7981d3eabfb5f556db3eb7ffb42af20bf2b7f4 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 27 Mar 2023 14:08:17 -0600 Subject: [PATCH 0429/1127] check for existing sectors in df based on activity name --- flowsa/flowby.py | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 33c2927a0..d0ab4fa46 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1293,24 +1293,31 @@ def map_to_sectors( 'industry/sector aggregation structure.') if self.config['sector_hierarchy'] == 'parent-completeChild': existing_sectors = activity_to_source_naics_crosswalk[ - ['Sector']] + ['Activity', 'Sector']] # create list of sectors that exist in original df, which, # if created when expanding sector list cannot be added naics_df = pd.DataFrame([]) - for i in existing_sectors['Sector']: - dig = len(str(i)) - n = existing_sectors[ - existing_sectors['Sector'].apply( - lambda x: x[0:dig]) == i] - if len(n) == 1: - expanded_n = naics_key[naics_key['source_naics'] == i] - naics_df = pd.concat([naics_df, expanded_n]) + for i in existing_sectors['Activity'].unique(): + existing_sectors_sub = existing_sectors[ + existing_sectors['Activity'] == i] + for j in existing_sectors_sub['Sector']: + dig = len(str(j)) + n = existing_sectors_sub[ + existing_sectors_sub['Sector'].apply( + lambda x: x[0:dig]) == j] + if len(n) == 1: + expanded_n = naics_key[naics_key['source_naics'] + == j] + expanded_n = expanded_n.assign(Activity=i) + naics_df = pd.concat([naics_df, expanded_n]) activity_to_target_naics_crosswalk = ( activity_to_source_naics_crosswalk - .merge(naics_df, how='left', left_on='Sector', - right_on='source_naics') + .merge(naics_df, + how='left', + left_on=['Activity', 'Sector'], + right_on=['Activity', 'source_naics']) .assign(Sector=lambda x: x['target_naics']) .drop(columns=['source_naics', 'target_naics']) ) From 294e44eae24b5ef7c274021e57663187f0b9279e Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 28 Mar 2023 15:27:38 -0400 Subject: [PATCH 0430/1127] update to revised data format for state GHGI --- flowsa/data_source_scripts/EPA_StateGHGI.py | 55 +++++++++---------- .../flowbyactivitymethods/EPA_StateGHGI.yaml | 5 +- 2 files changed, 29 insertions(+), 31 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_StateGHGI.py b/flowsa/data_source_scripts/EPA_StateGHGI.py index b7123368f..72f3c2958 100644 --- a/flowsa/data_source_scripts/EPA_StateGHGI.py +++ b/flowsa/data_source_scripts/EPA_StateGHGI.py @@ -4,7 +4,6 @@ """ Inventory of US GHGs from EPA disaggregated to States """ -import json import pandas as pd from flowsa.settings import externaldatapath from flowsa.location import apply_county_FIPS @@ -15,40 +14,38 @@ def epa_state_ghgi_parse(*, source, year, config, **_): try: - with open(externaldatapath + config.get('file')) as f: - data = json.load(f) + data_df = pd.read_excel(externaldatapath + config.get('file'), + sheet_name='Data by Econ Sect') except FileNotFoundError: raise FileNotFoundError('State GHGI data not yet available for ' 'external users') - data_df = pd.DataFrame(data) - activity_cols = ['SECTOR', 'SOURCE', 'SUBSOURCE', 'FUEL_TYPE', - 'SUB_REFERENCE', 'SECSUB_REFERENCE'] + activity_cols = ['ECON_SECTOR', 'ECON_SOURCE', 'SUBSECTOR', + 'CATEGORY', 'FUEL', 'SUBCATEGORY1', + 'SUBCATEGORY2', 'SUBCATEGORY3', 'SUBCATEGORY4'] states = data_df[['STATE']].drop_duplicates() - flows = data_df[['GHG_NAME']].drop_duplicates() - - df = data_df.melt(id_vars = activity_cols + ['STATE'] + ['GHG_NAME'], - value_vars=f'EMISSION_{year}', - var_name = 'Year', - value_name = 'FlowAmount') - df['Year'] = year - df['Unit'] = 'MMT CO2e' # TODO confirm units - df['FlowType'] = 'ELEMENTARY_FLOW' - df['SourceName'] = source - df['Class'] = 'Chemicals' - df['Compartment'] = 'air' - - df.rename(columns={'STATE': 'State', - 'GHG_NAME': 'FlowName'}, - inplace=True) - - df['ActivityProducedBy'] = (df[activity_cols] - .apply(lambda row: ' - '.join( - row.values.astype(str)), axis=1)) - df['ActivityProducedBy'] = (df['ActivityProducedBy'] - .str.replace(' - None', '')) - df.drop(columns=activity_cols, inplace=True) + flows = data_df[['GHG']].drop_duplicates() + + df = (data_df.melt(id_vars = activity_cols + ['STATE'] + ['GHG'], + value_vars=f'Y{year}', + var_name = 'Year', + value_name = 'FlowAmount') + .assign(Year = year) + .assign(Unit = 'MMT CO2e') # TODO confirm units + .assign(FlowType = 'ELEMENTARY_FLOW') + .assign(SourceName = source) + .assign(Class = 'Chemicals') + .assign(Compartment = 'air') + .rename(columns={'STATE': 'State', + 'GHG': 'FlowName'}) + .assign(ActivityProducedBy = lambda x: x[activity_cols] + .apply(lambda row: " - ".join( + row.dropna().drop_duplicates().astype(str)), + axis=1)) + .drop(columns=activity_cols) + ) + activities = df[['ActivityProducedBy']].drop_duplicates() df = apply_county_FIPS(df) diff --git a/flowsa/methods/flowbyactivitymethods/EPA_StateGHGI.yaml b/flowsa/methods/flowbyactivitymethods/EPA_StateGHGI.yaml index 026c671b4..43eb89bda 100644 --- a/flowsa/methods/flowbyactivitymethods/EPA_StateGHGI.yaml +++ b/flowsa/methods/flowbyactivitymethods/EPA_StateGHGI.yaml @@ -2,11 +2,12 @@ author: US Environmental Protection Agency source_name: 'State Greenhouse Gas Inventories' source_url: 'https://www.epa.gov/ghgemissions/state-ghg-emissions-and-removals' bib_id: '' -format: json +format: xlsx url: None parse_response_fxn: !script_function:EPA_StateGHGI epa_state_ghgi_parse -file: "W_INV_FACTS_ACTIVE_GHG_CO2E.json" +file: "PowerUsers Combined Draft 03172023.xlsx" years: +- 2020 - 2019 - 2018 - 2017 From 0f945b1074580b88336b5385fe2ac846254646d4 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Tue, 28 Mar 2023 17:54:09 -0400 Subject: [PATCH 0431/1127] Added all necessary entries from EPA_GHGI crosswalk --- .../NAICS_Crosswalk_EPA_GHGI_SEEA.csv | 788 +++++++++++++----- 1 file changed, 569 insertions(+), 219 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv index 2d329d349..1d3e425a4 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv @@ -1,102 +1,522 @@ ActivitySourceName,Activity,SectorSourceName,Sector,SectorType,Notes,Table -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,22,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,48,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,49,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,11,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,21,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,22,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,23,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,31,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,32,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,33,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,42,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,44,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,45,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,48,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,49,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,51,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,52,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,53,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,54,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,55,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,56,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,61,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,62,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,71,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,72,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,81,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,92,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,22,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,48,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,49,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,11,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,21,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,22,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,23,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,31,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,32,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,33,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,42,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,44,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,45,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,48,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,49,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,51,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,52,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,53,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,54,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,55,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,56,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,61,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,62,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,71,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,72,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,81,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,92,,,"EPA_GHGI_T_A_79, EPA_GHGI_T_A_103" +EPA_GHGI,Iron and Steel Production & Metallurgical Coke Production,NAICS_2012_Code,3311,,331110,EPA_GHGI_T_2_1 +EPA_GHGI,Cement Production,NAICS_2012_Code,32731,,327310,EPA_GHGI_T_2_1 +EPA_GHGI,Lime Production,NAICS_2012_Code,3274,,327400,EPA_GHGI_T_2_1 +EPA_GHGI,Ammonia Production,NAICS_2012_Code,32531,,325310,EPA_GHGI_T_2_1 +EPA_GHGI,Incineration of Waste,NAICS_2012_Code,562,,562000,EPA_GHGI_T_2_1 +EPA_GHGI,Aluminum Production,NAICS_2012_Code,331313,,331313,"EPA_GHGI_T_2_1, EPA_GHGI_T_4_80" +EPA_GHGI,Soda Ash Production,NAICS_2012_Code,32519,,325190,EPA_GHGI_T_2_1 +EPA_GHGI,Ferroalloy Production,NAICS_2012_Code,3311,,331110,EPA_GHGI_T_2_1 +EPA_GHGI,Titanium Dioxide Production,NAICS_2012_Code,32519,,325190,EPA_GHGI_T_2_1 +EPA_GHGI,Zinc Production,NAICS_2012_Code,33142,,331420,EPA_GHGI_T_2_1 +EPA_GHGI,Phosphoric Acid Production,NAICS_2012_Code,32531,,325310,EPA_GHGI_T_2_1 +EPA_GHGI,Glass Production,NAICS_2012_Code,3272,,327200,EPA_GHGI_T_2_1 +EPA_GHGI,Carbide Production and Consumption,NAICS_2012_Code,32518,,325180,EPA_GHGI_T_2_1 +EPA_GHGI,Coal Mining,NAICS_2012_Code,2121,,212100,EPA_GHGI_T_2_1 +EPA_GHGI,Wastewater Treatment,NAICS_2012_Code,2213,,221300,EPA_GHGI_T_2_1 +EPA_GHGI,Rice Cultivation,NAICS_2012_Code,11116,,1111B0,EPA_GHGI_T_2_1 +EPA_GHGI,Abandoned Oil and Gas Wells,NAICS_2012_Code,211,,211000,EPA_GHGI_T_2_1 +EPA_GHGI,Abandoned Underground Coal Mines,NAICS_2012_Code,2121,,212100,EPA_GHGI_T_2_1 +EPA_GHGI,Anaerobic Digestion at Biogas Facilities,NAICS_2012_Code,562,,new in GHGI since 2018,EPA_GHGI_T_2_1 +EPA_GHGI,Composting,NAICS_2012_Code,562,,562000,EPA_GHGI_T_2_1 +EPA_GHGI,Nitric Acid Production,NAICS_2012_Code,32531,,325310,EPA_GHGI_T_2_1 +EPA_GHGI,Adipic Acid Production,NAICS_2012_Code,32519,,325190,EPA_GHGI_T_2_1 +EPA_GHGI,"Caprolactam, Glyoxal, and Glyoxylic Acid Production",NAICS_2012_Code,32519,,325190,EPA_GHGI_T_2_1 +EPA_GHGI,Electronics Industry,NAICS_2012_Code,334413,,,EPA_GHGI_T_2_1 +EPA_GHGI,Landfills,NAICS_2012_Code,ACC,,,EPA_GHGI_T_2_1 +EPA_GHGI,Electrical Transmission and Distribution,NAICS_2012_Code,2211,,221100,EPA_GHGI_T_2_1 +EPA_GHGI,Liming,NAICS_2012_Code,111,,,EPA_GHGI_T_2_1 +EPA_GHGI,Liming,NAICS_2012_Code,112,,,EPA_GHGI_T_2_1 +EPA_GHGI,Urea Fertilization,NAICS_2012_Code,111,,,EPA_GHGI_T_2_1 +EPA_GHGI,Urea Fertilization,NAICS_2012_Code,112,,,EPA_GHGI_T_2_1 +EPA_GHGI,Urea Consumption for Non-Agricultural Purposes,NAICS_2012_Code,31,,,EPA_GHGI_T_2_1 +EPA_GHGI,Urea Consumption for Non-Agricultural Purposes,NAICS_2012_Code,32,,,EPA_GHGI_T_2_1 +EPA_GHGI,Urea Consumption for Non-Agricultural Purposes,NAICS_2012_Code,33,,,EPA_GHGI_T_2_1 +EPA_GHGI,Other Process Uses of Carbonates,NAICS_2012_Code,31,,,EPA_GHGI_T_2_1 +EPA_GHGI,Other Process Uses of Carbonates,NAICS_2012_Code,32,,,EPA_GHGI_T_2_1 +EPA_GHGI,Other Process Uses of Carbonates,NAICS_2012_Code,33,,,EPA_GHGI_T_2_1 +EPA_GHGI,Lead Production,NAICS_2012_Code,3314,,,EPA_GHGI_T_2_1 +EPA_GHGI,N2O from Product Uses,NAICS_2012_Code,621,,,EPA_GHGI_T_2_1 +EPA_GHGI,N2O from Product Uses,NAICS_2012_Code,622,,,EPA_GHGI_T_2_1 +EPA_GHGI,N2O from Product Uses,NAICS_2012_Code,623,,,EPA_GHGI_T_2_1 +EPA_GHGI,Distribution,NAICS_2012_Code,221210,,221200,"EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" +EPA_GHGI,Exploration,NAICS_2012_Code,211111,,211000,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42, EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" +EPA_GHGI,Processing,NAICS_2012_Code,211111,,211000,"EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" +EPA_GHGI,Production,NAICS_2012_Code,211111,,211000,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42, EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" +EPA_GHGI,Transmission and Storage,NAICS_2012_Code,486210,,486000,"EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" +EPA_GHGI,Crude Oil Transportation,NAICS_2012_Code,486110,,not mapped,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42" +EPA_GHGI,Refining,NAICS_2012_Code,324110,,324110,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42" +EPA_GHGI,Chickpeas,NAICS_2012_Code,11113,,1111B0,EPA_GHGI_T_5_29 +EPA_GHGI,Cotton,NAICS_2012_Code,11192,,111900,EPA_GHGI_T_5_29 +EPA_GHGI,Maize,NAICS_2012_Code,11115,,1111B0,EPA_GHGI_T_5_29 +EPA_GHGI,Rice,NAICS_2012_Code,11116,,1111B0,EPA_GHGI_T_5_29 +EPA_GHGI,Soybeans,NAICS_2012_Code,11111,,1111A0,EPA_GHGI_T_5_29 +EPA_GHGI,Wheat,NAICS_2012_Code,11114,,1111B0,EPA_GHGI_T_5_29 +EPA_GHGI,American Bison,NAICS_2012_Code,11299,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Beef Cattle,NAICS_2012_Code,11211,,1121A0,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Dairy Cattle,NAICS_2012_Code,11212,,112120,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Goats,NAICS_2012_Code,11242,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Horses,NAICS_2012_Code,11292,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Mules and Asses,NAICS_2012_Code,11292,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Sheep,NAICS_2012_Code,11241,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Swine,NAICS_2012_Code,1122,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Poultry,NAICS_2012_Code,1123,,112300,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" +EPA_GHGI,Organic Amendment Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_18 +EPA_GHGI,Residue N Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_18 +EPA_GHGI,Synthetic Fertilizer Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_18 +EPA_GHGI,Mineralization and Asymbiotic Fixation Cropland,NAICS_2012_Code,1111,,"111, excl. 1114",EPA_GHGI_T_5_18 +EPA_GHGI,Mineralization and Asymbiotic Fixation Cropland,NAICS_2012_Code,1112,,,EPA_GHGI_T_5_18 +EPA_GHGI,Mineralization and Asymbiotic Fixation Cropland,NAICS_2012_Code,1113,,,EPA_GHGI_T_5_18 +EPA_GHGI,Mineralization and Asymbiotic Fixation Cropland,NAICS_2012_Code,1119,,,EPA_GHGI_T_5_18 +EPA_GHGI,Drained Organic Soils Cropland,NAICS_2012_Code,1111,,"111, excl. 1114",EPA_GHGI_T_5_18 +EPA_GHGI,Drained Organic Soils Cropland,NAICS_2012_Code,1112,,,EPA_GHGI_T_5_18 +EPA_GHGI,Drained Organic Soils Cropland,NAICS_2012_Code,1113,,,EPA_GHGI_T_5_18 +EPA_GHGI,Drained Organic Soils Cropland,NAICS_2012_Code,1119,,,EPA_GHGI_T_5_18 +EPA_GHGI,All activities Grassland,NAICS_2012_Code,112,,112,"EPA_GHGI_T_5_18, EPA_GHGI_T_5_19" +EPA_GHGI,Volatilization & Atm. Deposition Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_19 +EPA_GHGI,Surface Leaching & Run-Off Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_19 +EPA_GHGI,Passenger Cars,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Motorcycles,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Rail,NAICS_2012_Code,482,,482000,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Recreational Boats,NAICS_2012_Code,F01000,,F01000,EOA_GHGI_T_3_13 +EPA_GHGI,Military Aircraft,NAICS_2012_Code,928110,,S00500,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Pipelines,NAICS_2012_Code,486,,486000,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,22,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,48,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,49,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,22,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,48,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,49,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Ships and Boats,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Ships and Boats,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Ships and Boats,NAICS_2012_Code,22,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Ships and Boats,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Ships and Boats,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Ships and Boats,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Ships and Boats,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Ships and Boats,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Ships and Boats,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Ships and Boats,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Ships and Boats,NAICS_2012_Code,48,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Ships and Boats,NAICS_2012_Code,49,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Ships and Boats,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Ships and Boats,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Ships and Boats,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Ships and Boats,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Ships and Boats,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Ships and Boats,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Ships and Boats,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Ships and Boats,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Ships and Boats,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Ships and Boats,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Ships and Boats,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Ships and Boats,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,22,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,48,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,49,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Buses,NAICS_2012_Code,485,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Buses,NAICS_2012_Code,4871,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" +EPA_GHGI,Construction/Mining Equipment Non-Road,NAICS_2012_Code,211,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Construction/Mining Equipment Non-Road,NAICS_2012_Code,212,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Construction/Mining Equipment Non-Road,NAICS_2012_Code,213111,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,111,,"111, 112, 113, 114","EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,112,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,113,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,114,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,485,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,487,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,488,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,492,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,5321,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,5324,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,6219,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,7139,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,8111,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Other Non-Road,NAICS_2012_Code,8113,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,All activities Alternative Fuel On-Road,NAICS_2012_Code,485,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,All activities Alternative Fuel On-Road,NAICS_2012_Code,486,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,All activities Alternative Fuel On-Road,NAICS_2012_Code,487,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,All activities Alternative Fuel On-Road,NAICS_2012_Code,488,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,All activities Alternative Fuel On-Road,NAICS_2012_Code,492,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,11,,,BTS_Airlines +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,21,,,BTS_Airlines +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,22,,,BTS_Airlines +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,23,,,BTS_Airlines +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,31,,,BTS_Airlines +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,32,,,BTS_Airlines +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,33,,,BTS_Airlines +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,42,,,BTS_Airlines +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,44,,,BTS_Airlines +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,45,,,BTS_Airlines +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,48,,,BTS_Airlines +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,49,,,BTS_Airlines +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,51,,,BTS_Airlines +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,52,,,BTS_Airlines +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,53,,,BTS_Airlines +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,54,,,BTS_Airlines +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,55,,,BTS_Airlines +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,56,,,BTS_Airlines +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,61,,,BTS_Airlines +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,62,,,BTS_Airlines +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,71,,,BTS_Airlines +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,72,,,BTS_Airlines +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,81,,,BTS_Airlines +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,92,,,BTS_Airlines +EPA_GHGI,Total (All Fuels) Residential,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_X +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,2213,,,EPA_GHGI_T_A_X +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,42,,,EPA_GHGI_T_A_X +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,44,,,EPA_GHGI_T_A_X +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,45,,,EPA_GHGI_T_A_X +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,493,,,EPA_GHGI_T_A_X +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,51,,,EPA_GHGI_T_A_X +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,52,,,EPA_GHGI_T_A_X +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,53,,,EPA_GHGI_T_A_X +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,54,,,EPA_GHGI_T_A_X +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,55,,,EPA_GHGI_T_A_X +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,56,,,EPA_GHGI_T_A_X +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,61,,,EPA_GHGI_T_A_X +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,62,,,EPA_GHGI_T_A_X +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,71,,,EPA_GHGI_T_A_X +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,72,,,EPA_GHGI_T_A_X +EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,81,,,EPA_GHGI_T_A_X +EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,11,,,EPA_GHGI_T_A_X +EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,21,,,EPA_GHGI_T_A_X +EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,2212,,,EPA_GHGI_T_A_X +EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,23,,,EPA_GHGI_T_A_X +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,2213,,,EPA_GHGI_T_A_X +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,42,,,EPA_GHGI_T_A_X +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,44,,,EPA_GHGI_T_A_X +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,45,,,EPA_GHGI_T_A_X +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,493,,,EPA_GHGI_T_A_X +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,51,,,EPA_GHGI_T_A_X +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,52,,,EPA_GHGI_T_A_X +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,53,,,EPA_GHGI_T_A_X +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,54,,,EPA_GHGI_T_A_X +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,55,,,EPA_GHGI_T_A_X +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,56,,,EPA_GHGI_T_A_X +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,61,,,EPA_GHGI_T_A_X +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,62,,,EPA_GHGI_T_A_X +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,71,,,EPA_GHGI_T_A_X +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,72,,,EPA_GHGI_T_A_X +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,81,,,EPA_GHGI_T_A_X +EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,11,,,EPA_GHGI_T_A_X +EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,21,,,EPA_GHGI_T_A_X +EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,2212,,,EPA_GHGI_T_A_X +EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,23,,,EPA_GHGI_T_A_X +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,2213,,,EPA_GHGI_T_A_X +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,42,,,EPA_GHGI_T_A_X +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,44,,,EPA_GHGI_T_A_X +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,45,,,EPA_GHGI_T_A_X +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,493,,,EPA_GHGI_T_A_X +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,51,,,EPA_GHGI_T_A_X +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,52,,,EPA_GHGI_T_A_X +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,53,,,EPA_GHGI_T_A_X +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,54,,,EPA_GHGI_T_A_X +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,55,,,EPA_GHGI_T_A_X +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,56,,,EPA_GHGI_T_A_X +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,61,,,EPA_GHGI_T_A_X +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,62,,,EPA_GHGI_T_A_X +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,71,,,EPA_GHGI_T_A_X +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,72,,,EPA_GHGI_T_A_X +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,81,,,EPA_GHGI_T_A_X +EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,11,,,EPA_GHGI_T_A_X +EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,21,,,EPA_GHGI_T_A_X +EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,2212,,,EPA_GHGI_T_A_X +EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,23,,,EPA_GHGI_T_A_X +EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,31,,,EPA_GHGI_T_A_X +EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,32,,,EPA_GHGI_T_A_X +EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,33,,,EPA_GHGI_T_A_X +EPA_GHGI,Industrial Other Coal Industrial - Manufacturing,NAICS_2012_Code,31,,,EPA_GHGI_T_A_X +EPA_GHGI,Industrial Other Coal Industrial - Manufacturing,NAICS_2012_Code,32,,,EPA_GHGI_T_A_X +EPA_GHGI,Industrial Other Coal Industrial - Manufacturing,NAICS_2012_Code,33,,,EPA_GHGI_T_A_X +EPA_GHGI,Natural Gas Industrial - Manufacturing,NAICS_2012_Code,31,,,EPA_GHGI_T_A_X +EPA_GHGI,Natural Gas Industrial - Manufacturing,NAICS_2012_Code,32,,,EPA_GHGI_T_A_X +EPA_GHGI,Natural Gas Industrial - Manufacturing,NAICS_2012_Code,33,,,EPA_GHGI_T_A_X +EPA_GHGI,Fuel Oil Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Residential,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural Gas Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Electric Power,NAICS_2012_Code,2211,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Electric Power,NAICS_2012_Code,2211,,,EPA_GHGI_T_3_8 +EPA_GHGI,Natural Gas Electric Power,NAICS_2012_Code,2211,,,EPA_GHGI_T_3_9 +EPA_GHGI,Fuel Oil Electric Power,NAICS_2012_Code,2211,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Electric Power,NAICS_2012_Code,2211,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,2213,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,493,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23, 31, 32, 33","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Industrial - Manufacturing,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Industrial - Manufacturing,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural gas Industrial - Manufacturing,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Electric Power,NAICS_2012_Code,2211,,,EPA_GHGI_T_3_7 +EPA_GHGI,Acrylonitrile,NAICS_2012_Code,325199,,,EPA_GHGI_T_4_46 +EPA_GHGI,Carbon Black,NAICS_2012_Code,325180,,,EPA_GHGI_T_4_46 +EPA_GHGI,Ethylene,NAICS_2012_Code,324110,,,EPA_GHGI_T_4_46 +EPA_GHGI,Ethylene Dichloride,NAICS_2012_Code,325120,,,EPA_GHGI_T_4_46 +EPA_GHGI,Ethylene Oxide,NAICS_2012_Code,325199,,,EPA_GHGI_T_4_46 +EPA_GHGI,Methanol,NAICS_2012_Code,325199,,,EPA_GHGI_T_4_46 +EPA_GHGI,Industry Industrial Coking Coal,NAICS_2012_Code,212210,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Industrial Other Coal,NAICS_2012_Code,212210,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry LPG,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry LPG,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry LPG,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry LPG,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry LPG,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry LPG,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry LPG,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Still Gas,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Still Gas,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Still Gas,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Still Gas,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Still Gas,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Still Gas,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Still Gas,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Natural Gas to Chemical Plants,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Natural Gas to Chemical Plants,NAICS_2012_Code,32,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Natural Gas to Chemical Plants,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_3_22 +EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Lubricants,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Lubricants,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Lubricants,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Lubricants,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Lubricants,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Lubricants,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Lubricants,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Waxes,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Waxes,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Waxes,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Waxes,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Waxes,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Waxes,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Waxes,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,48,,,EPA_GHGI_T_3_22 +EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,491,,,EPA_GHGI_T_3_22 +EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,492,,,EPA_GHGI_T_3_22 +EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,92,,,EPA_GHGI_T_3_22 +EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,F01000,,,EPA_GHGI_T_3_22 +EPA_GHGI,HCFC-22 Production,NAICS_2012_Code,325120,,325120,EPA_GHGI_T_4_50 +EPA_GHGI,Electronics Production,NAICS_2012_Code,334413,,334413,EPA_GHGI_T_4_94 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,11,,"All sectors, excluding transport",EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,21,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,22,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,23,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,31,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,32,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,33,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,42,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,44,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,45,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,49,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,51,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,52,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,53,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,54,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,55,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,56,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,61,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,62,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,71,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,72,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,81,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,92,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,F01000,,,EPA_GHGI_T_4_101 +EPA_GHGI,Refrigeration/Air Conditioning - Households,NAICS_2012_Code,F01000,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,11,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,21,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,22,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,23,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,31,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,32,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,33,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,42,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,44,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,45,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,48,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,49,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,51,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,52,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,53,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,54,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,55,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,56,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,61,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,62,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,71,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,72,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,81,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,92,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,F01000,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,11,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,21,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,22,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,23,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,31,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,32,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,33,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,42,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,44,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,45,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,48,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,49,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,51,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,52,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,53,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,54,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,55,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,56,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,61,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,62,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,71,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,72,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,81,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,92,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams - Urethane,NAICS_2012_Code,F01000,,,EPA_GHGI_T_4_101 +EPA_GHGI,School and Tour Buses,NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_103 EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,11,,,EPA_GHGI_T_A_103 EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,21,,,EPA_GHGI_T_A_103 EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,22,,,EPA_GHGI_T_A_103 @@ -121,30 +541,57 @@ EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,71,,,EPA_GHGI_T_A_103 EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,72,,,EPA_GHGI_T_A_103 EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,81,,,EPA_GHGI_T_A_103 EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,92,,,EPA_GHGI_T_A_103 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,11,,,EPA_GHGI_T_A_103 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,21,,,EPA_GHGI_T_A_103 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,22,,,EPA_GHGI_T_A_103 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,23,,,EPA_GHGI_T_A_103 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,31,,,EPA_GHGI_T_A_103 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,32,,,EPA_GHGI_T_A_103 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,33,,,EPA_GHGI_T_A_103 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,42,,,EPA_GHGI_T_A_103 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,44,,,EPA_GHGI_T_A_103 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,45,,,EPA_GHGI_T_A_103 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,48,,,EPA_GHGI_T_A_103 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,49,,,EPA_GHGI_T_A_103 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,51,,,EPA_GHGI_T_A_103 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,52,,,EPA_GHGI_T_A_103 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,53,,,EPA_GHGI_T_A_103 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,54,,,EPA_GHGI_T_A_103 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,55,,,EPA_GHGI_T_A_103 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,56,,,EPA_GHGI_T_A_103 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,61,,,EPA_GHGI_T_A_103 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,62,,,EPA_GHGI_T_A_103 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,71,,,EPA_GHGI_T_A_103 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,72,,,EPA_GHGI_T_A_103 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,81,,,EPA_GHGI_T_A_103 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,92,,,EPA_GHGI_T_A_103 +EPA_GHGI,Magnesium Production and Processing,NAICS_2012_Code,331410,,"331410, 331490, 331520",EPA_GHGI_T_4_84 +EPA_GHGI,Magnesium Production and Processing,NAICS_2012_Code,33149,,,EPA_GHGI_T_4_84 +EPA_GHGI,Magnesium Production and Processing,NAICS_2012_Code,33152,,,EPA_GHGI_T_4_84 +EPA_GHGI,Marine Shipping,NAICS_2012_Code,11,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,21,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,22,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,23,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,31,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,32,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,33,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,42,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,44,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,45,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,48,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,49,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,51,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,52,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,53,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,54,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,55,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,56,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,61,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,62,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,71,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,72,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,81,,,BEA_Bunker_Fuel +EPA_GHGI,Marine Shipping,NAICS_2012_Code,92,,,BEA_Bunker_Fuel +EPA_GHGI,Marine,NAICS_2012_Code,11,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,21,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,22,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,23,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,31,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,32,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,33,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,42,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,44,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,45,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,48,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,49,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,51,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,52,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,53,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,54,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,55,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,56,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,61,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,62,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,71,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,72,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,81,,,GHGI2020_3_104 +EPA_GHGI,Marine,NAICS_2012_Code,92,,,GHGI2020_3_104 EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" @@ -195,79 +642,6 @@ EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_14, EP EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Landfills,NAICS_2012_Code,ACC,,,"EPA_GHGI_T_2_1" -EPA_GHGI,Marine Shipping,NAICS_2012_Code,11,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,21,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,22,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,23,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,31,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,32,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,33,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,42,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,44,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,45,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,48,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,49,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,51,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,52,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,53,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,54,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,55,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,56,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,61,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,62,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,71,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,72,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,81,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,92,,,BEA_Bunker_Fuel -EPA_GHGI,Marine,NAICS_2012_Code,11,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,21,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,22,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,23,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,31,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,32,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,33,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,42,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,44,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,45,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,48,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,49,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,51,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,52,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,53,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,54,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,55,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,56,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,61,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,62,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,71,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,72,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,81,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,92,,,GHGI2020_3_104 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,11,,,EPA_GHGI_T_A_103 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,21,,,EPA_GHGI_T_A_103 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,22,,,EPA_GHGI_T_A_103 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,23,,,EPA_GHGI_T_A_103 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,31,,,EPA_GHGI_T_A_103 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,32,,,EPA_GHGI_T_A_103 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,33,,,EPA_GHGI_T_A_103 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,42,,,EPA_GHGI_T_A_103 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,44,,,EPA_GHGI_T_A_103 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,45,,,EPA_GHGI_T_A_103 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,48,,,EPA_GHGI_T_A_103 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,49,,,EPA_GHGI_T_A_103 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,51,,,EPA_GHGI_T_A_103 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,52,,,EPA_GHGI_T_A_103 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,53,,,EPA_GHGI_T_A_103 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,54,,,EPA_GHGI_T_A_103 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,55,,,EPA_GHGI_T_A_103 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,56,,,EPA_GHGI_T_A_103 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,61,,,EPA_GHGI_T_A_103 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,62,,,EPA_GHGI_T_A_103 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,71,,,EPA_GHGI_T_A_103 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,72,,,EPA_GHGI_T_A_103 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,81,,,EPA_GHGI_T_A_103 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,92,,,EPA_GHGI_T_A_103 EPA_GHGI,Aviation,NAICS_2012_Code,11,,,EPA_GHGI_T_A_103 EPA_GHGI,Aviation,NAICS_2012_Code,21,,,EPA_GHGI_T_A_103 EPA_GHGI,Aviation,NAICS_2012_Code,22,,,EPA_GHGI_T_A_103 @@ -292,27 +666,3 @@ EPA_GHGI,Aviation,NAICS_2012_Code,71,,,EPA_GHGI_T_A_103 EPA_GHGI,Aviation,NAICS_2012_Code,72,,,EPA_GHGI_T_A_103 EPA_GHGI,Aviation,NAICS_2012_Code,81,,,EPA_GHGI_T_A_103 EPA_GHGI,Aviation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_103 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,11,,,EPA_GHGI_T_A_103 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,21,,,EPA_GHGI_T_A_103 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,22,,,EPA_GHGI_T_A_103 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,23,,,EPA_GHGI_T_A_103 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,31,,,EPA_GHGI_T_A_103 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,32,,,EPA_GHGI_T_A_103 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,33,,,EPA_GHGI_T_A_103 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,42,,,EPA_GHGI_T_A_103 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,44,,,EPA_GHGI_T_A_103 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,45,,,EPA_GHGI_T_A_103 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,48,,,EPA_GHGI_T_A_103 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,49,,,EPA_GHGI_T_A_103 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,51,,,EPA_GHGI_T_A_103 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,52,,,EPA_GHGI_T_A_103 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,53,,,EPA_GHGI_T_A_103 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,54,,,EPA_GHGI_T_A_103 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,55,,,EPA_GHGI_T_A_103 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,56,,,EPA_GHGI_T_A_103 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,61,,,EPA_GHGI_T_A_103 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,62,,,EPA_GHGI_T_A_103 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,71,,,EPA_GHGI_T_A_103 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,72,,,EPA_GHGI_T_A_103 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,81,,,EPA_GHGI_T_A_103 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,92,,,EPA_GHGI_T_A_103 From bca612889c72eca16755ce21ffbf7669de69667c Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 31 Mar 2023 11:34:50 -0400 Subject: [PATCH 0432/1127] avoid KeyError for stewi datasets --- flowsa/flowby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 275d9a6c3..9cee06fb5 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1149,7 +1149,7 @@ def map_to_sectors( log.info('NAICS Activities in %s use NAICS year %s.', self.full_name, source_year) - if self.config['sector_hierarchy'] == 'parent-completeChild': + if self.config.get('sector_hierarchy') == 'parent-completeChild': log.info('NAICS are a mix of parent-completeChild, assigning ' 'activity columns directly to sector columns') From 3fcc451c122092144bc40189c86c5dff1e4cd99c Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 31 Mar 2023 11:35:08 -0400 Subject: [PATCH 0433/1127] update location prior to running FBA for stewi datasets --- flowsa/data_source_scripts/stewiFBS.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/flowsa/data_source_scripts/stewiFBS.py b/flowsa/data_source_scripts/stewiFBS.py index 5f4e5f86c..ef2eaa93e 100644 --- a/flowsa/data_source_scripts/stewiFBS.py +++ b/flowsa/data_source_scripts/stewiFBS.py @@ -17,7 +17,7 @@ import numpy as np from esupy.processed_data_mgmt import read_source_metadata from flowsa.flowby import FlowBySector, FlowByActivity -from flowsa.location import apply_county_FIPS +from flowsa.location import apply_county_FIPS, update_geoscale from flowsa.settings import log, process_adjustmentpath import stewicombo import stewi @@ -292,7 +292,7 @@ def prepare_stewi_fbs(df_load, config) -> 'FlowBySector': :param df_load: a dataframe of emissions and mapped faciliites from stewi or stewicombo :param config: dictionary, FBS method data source configuration - :return: df + :return: FlowBySector """ config['sector-like_activities']=True config['fedefl_mapping'] = ( @@ -301,8 +301,10 @@ def prepare_stewi_fbs(df_load, config) -> 'FlowBySector': config['drop_unmapped_rows'] = True # update location to appropriate geoscale prior to aggregating + df = update_geoscale(df_load, config['geoscale']) + fbs = FlowByActivity( - df_load + df .rename(columns={"NAICS": "ActivityProducedBy", 'Source': 'SourceName'}) .assign(Class='Chemicals') From a5d0c1a5b8ce5e665f7b923483626e9503fac1d9 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 31 Mar 2023 13:22:42 -0400 Subject: [PATCH 0434/1127] update NEI sector-hierarchy --- flowsa/data/source_catalog.yaml | 2 +- flowsa/flowby.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 89324d453..08dc4c6b7 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -224,7 +224,7 @@ EPA_NEI_Nonpoint: sector-like_activities: False activity_schema: SCC fedefl_mapping: NEI - # sector_hierarchy: "flat" + sector_hierarchy: "flat" EPA_NEI_Nonroad: data_format: FBA class: diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 37b1db774..dd6e03c71 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1291,7 +1291,7 @@ def map_to_sectors( log.info('Converting NAICS codes in crosswalk to desired ' 'industry/sector aggregation structure.') - if self.config['sector_hierarchy'] == 'parent-completeChild': + if self.config.get('sector_hierarchy') == 'parent-completeChild': existing_sectors = activity_to_source_naics_crosswalk[ ['Activity', 'Sector']] From d1cda62bfa45deda79b40d81861c1710be105b58 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 31 Mar 2023 13:45:29 -0400 Subject: [PATCH 0435/1127] cleanup CAP_HAP method --- .../CAP_HAP_national_2017.yaml | 58 +++++++++---------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index 76dd6e1fb..f99de2776 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -12,7 +12,6 @@ sources_to_cache: Class: Energy Unit: Trillion Btu Location: '00000' - # NEW EIA MECS Energy FBAs show tables in description Description: - Table 2.2 - Table 3.2 @@ -36,6 +35,32 @@ _attribution_sources: data_format: FBS year: 2012 + USDA_CoA_Cropland: &cropland_allocation + year: 2017 + geoscale: state + selection_fields: + Class: Land + FlowName: AREA HARVESTED + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + year: 2017 + geoscale: state + selection_fields: + Class: Land + FlowName: AG LAND, CROPLAND, HARVESTED + + USDA_CoA_Livestock: &livestock_allocation + year: 2017 + geoscale: state + selection_fields: + Class: Other + FlowName: + - HEAD + - NUMBER + - COLONIES + Compartment: NOT SPECIFIED + source_names: EPA_NEI_Nonpoint: geoscale: state @@ -55,21 +80,7 @@ source_names: selection_fields: PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv cropland attribution_method: proportional - attribution_source: - USDA_CoA_Cropland: - year: 2017 - geoscale: state - selection_fields: - Class: Land - FlowName: AREA HARVESTED - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland_NAICS: - year: 2017 - geoscale: state - selection_fields: - Class: Land - FlowName: AG LAND, CROPLAND, HARVESTED + attribution_source: *cropland_allocation industry_combustion_coal: #only allocating to 3digits selection_fields: @@ -138,17 +149,7 @@ source_names: selection_fields: PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv livestock attribution_method: proportional - attribution_source: - USDA_CoA_Livestock: - year: 2017 - geoscale: state - selection_fields: - Class: Other - FlowName: - - HEAD - - NUMBER - - COLONIES - Compartment: NOT SPECIFIED + attribution_source: *livestock_allocation mobile_and_fuel_storage: selection_fields: @@ -250,9 +251,6 @@ source_names: FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector inventory_dict: {"NEI":"2017", "TRI":"2017"} local_inventory_name: NEI_TRI_air_2017 - # temporarily maintain target_sector_level for - # allocation.equally_allocate_parent_to_child_naics() - target_sector_level: NAICS_6 clean_fbs: !script_function:EPA_NEI drop_GHGs compartments: - air From 495464b6e84eda44b719d9f305ebeb13f464c7ac Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 31 Mar 2023 14:03:49 -0400 Subject: [PATCH 0436/1127] remove old comments --- .../CAP_HAP_national_2017.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index f99de2776..dd8ef3bf9 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -82,7 +82,7 @@ source_names: attribution_method: proportional attribution_source: *cropland_allocation - industry_combustion_coal: #only allocating to 3digits + industry_combustion_coal: selection_fields: PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_coal attribution_method: proportional @@ -91,7 +91,7 @@ source_names: selection_fields: Flowable: Coal - industry_combustion_coke: #only allocating to 3digits + industry_combustion_coke: selection_fields: PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_coke attribution_method: proportional @@ -100,7 +100,7 @@ source_names: selection_fields: Flowable: Coke and Breeze - industry_combustion_distillate: #only allocating to 3digits + industry_combustion_distillate: selection_fields: PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_distillate attribution_method: proportional @@ -109,7 +109,7 @@ source_names: selection_fields: Flowable: Distillate Fuel Oil - industry_combustion_hgl: #only allocating to 3digits + industry_combustion_hgl: selection_fields: PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_hgl attribution_method: proportional @@ -118,7 +118,7 @@ source_names: selection_fields: Flowable: Hydrocarbon Gas Liquids, excluding natural gasoline - industry_combustion_nat_gas: #only allocating to 3digits + industry_combustion_nat_gas: selection_fields: PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_nat_gas attribution_method: proportional @@ -127,7 +127,7 @@ source_names: selection_fields: Flowable: Natural Gas - industry_combustion_other: #only allocating to 3digits + industry_combustion_other: selection_fields: PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_other attribution_method: proportional @@ -136,7 +136,7 @@ source_names: selection_fields: Flowable: Other - industry_combustion_residual: #only allocating to 3digits + industry_combustion_residual: selection_fields: PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_residual attribution_method: proportional @@ -145,7 +145,7 @@ source_names: selection_fields: Flowable: Residual Fuel Oil - livestock: #Livestock losing NAICS 11211 + livestock: selection_fields: PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv livestock attribution_method: proportional @@ -171,7 +171,7 @@ source_names: selection_fields: ActivityProducedBy: {'325310': ''} # Fertilizers - pesticides: # pesticides + pesticides: clean_fba_before_mapping: !script_function:EPA_NEI drop_pesticides selection_fields: PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv pesticides From ec438cebc46cc9bdf67c9c8603780a8f94fffbfc Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 31 Mar 2023 15:32:06 -0400 Subject: [PATCH 0437/1127] fixed level in method causing activity sets to be skipped --- .../methods/flowbysectormethods/CAP_HAP_national_2017.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index dd8ef3bf9..25fce383a 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -80,7 +80,8 @@ source_names: selection_fields: PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv cropland attribution_method: proportional - attribution_source: *cropland_allocation + attribution_source: + USDA_CoA_Cropland: *cropland_allocation industry_combustion_coal: selection_fields: @@ -149,7 +150,8 @@ source_names: selection_fields: PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv livestock attribution_method: proportional - attribution_source: *livestock_allocation + attribution_source: + USDA_CoA_Livestock: *livestock_allocation mobile_and_fuel_storage: selection_fields: From 5ceccd7ce77fcc38ff2e1b35ecd244a639545767 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 31 Mar 2023 16:36:10 -0400 Subject: [PATCH 0438/1127] add CAP_HAP_state method --- flowsa/data/source_catalog.yaml | 1 + flowsa/data_source_scripts/stewiFBS.py | 2 + .../CAP_HAP_state_2017.yaml | 273 ++++++++++++++++++ 3 files changed, 276 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 08dc4c6b7..cfd7945ad 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -286,6 +286,7 @@ StatCan_LFS: activity_schema: sector_hierarchy: "flat" stateio: + data_format: FBA class: - Money sector-like_activities: False #update to true once alternate activity_schema in place diff --git a/flowsa/data_source_scripts/stewiFBS.py b/flowsa/data_source_scripts/stewiFBS.py index ef2eaa93e..ce996e73f 100644 --- a/flowsa/data_source_scripts/stewiFBS.py +++ b/flowsa/data_source_scripts/stewiFBS.py @@ -299,6 +299,8 @@ def prepare_stewi_fbs(df_load, config) -> 'FlowBySector': [x for x in config.get('inventory_dict').keys() if x != 'RCRAInfo']) config['drop_unmapped_rows'] = True + if 'year' not in config: + config['year'] = df_load['Year'][0] # update location to appropriate geoscale prior to aggregating df = update_geoscale(df_load, config['geoscale']) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml new file mode 100644 index 000000000..b524b5f3c --- /dev/null +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml @@ -0,0 +1,273 @@ +## Method for CAPs and HAPs for states is similar to CAP_HAP for national model +# but uses summary level target and stateio economic data for allocation +# allocation for fuel use is TBD +# Note that EPA_Nonpoint already used some state level allocations for ag-related +# emissions + + +!include:BEA_summary_target.yaml + +sources_to_cache: + EIA_MECS_Energy: + year: 2014 + geoscale: national + selection_fields: + Class: Energy + Unit: Trillion Btu + Location: '00000' + Description: + - Table 2.2 + - Table 3.2 + estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_mecs_energy + clean_fba: !script_function:temp_data_source_functions clean_mecs_energy_fba + clean_fba_w_sec: !script_function:temp_data_source_functions clean_mapped_mecs_energy_fba + attribution_method: proportional + attribution_source: + Employment_state_2014: + data_format: FBS + geoscale: state + year: 2014 + +_attribution_sources: + stateio: &stateio + year: 2012 + geoscale: state + activity_to_sector_mapping: BEA_2012_Summary + attribution_method: proportional + attribution_source: + Employment_state_2012: + data_format: FBS + geoscale: state + year: 2012 + + USDA_CoA_Cropland: &cropland_allocation + year: 2017 + geoscale: state + selection_fields: + Class: Land + FlowName: AREA HARVESTED + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + year: 2017 + geoscale: state + selection_fields: + Class: Land + FlowName: AG LAND, CROPLAND, HARVESTED + + USDA_CoA_Livestock: &livestock_allocation + year: 2017 + geoscale: state + selection_fields: + Class: Other + FlowName: + - HEAD + - NUMBER + - COLONIES + Compartment: NOT SPECIFIED + +source_names: + EPA_NEI_Nonpoint: + geoscale: state + year: 2017 + primary_action_type: Produced + activity_to_sector_mapping: SCC + clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba + fedefl_mapping: NEI + drop_unmapped_rows: True + activity_sets: + direct_allocation: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv direct_allocation + attribution_method: direct + + cropland: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv cropland + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland: *cropland_allocation + + industry_combustion_coal: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_coal + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + geoscale: national + selection_fields: + Flowable: Coal + + industry_combustion_coke: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_coke + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + geoscale: national + selection_fields: + Flowable: Coke and Breeze + + industry_combustion_distillate: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_distillate + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + geoscale: national + selection_fields: + Flowable: Distillate Fuel Oil + + industry_combustion_hgl: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_hgl + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + geoscale: national + selection_fields: + Flowable: Hydrocarbon Gas Liquids, excluding natural gasoline + + industry_combustion_nat_gas: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_nat_gas + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + geoscale: national + selection_fields: + Flowable: Natural Gas + + industry_combustion_other: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_other + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + geoscale: national + selection_fields: + Flowable: Other + + industry_combustion_residual: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_residual + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + geoscale: national + selection_fields: + Flowable: Residual Fuel Oil + + livestock: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv livestock + attribution_method: proportional + attribution_source: + USDA_CoA_Livestock: *livestock_allocation + + mobile_and_fuel_storage: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv mobile_and_fuel_storage + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *stateio + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum 324110 + + fertilizers: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv fertilizers + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *stateio + selection_fields: + ActivityProducedBy: {'325': ''} # Fertilizers 325310 + + pesticides: + clean_fba_before_mapping: !script_function:EPA_NEI drop_pesticides + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv pesticides + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *stateio + selection_fields: + ActivityProducedBy: {'325': ''} # Pesticides 325320 + + output_allocation: # Gross Output + selection_fields: + PrimaryActivity: NEI_Nonpoint_2017_asets.csv output_allocation + attribution_method: proportional + attribution_source: + stateio_Industry_GO: + year: 2017 + activity_to_sector_mapping: BEA_2012_Summary + selection_fields: + Class: Money + FlowName: USD2017 + attribution_method: proportional + attribution_source: + Employment_state_2017: + data_format: FBS + geoscale: state + year: 2017 + + EPA_NEI_Nonroad: + geoscale: state + year: 2017 + primary_action_type: Produced + activity_to_sector_mapping: SCC + clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba + fedefl_mapping: NEI + activity_sets: + direct_allocation: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonroad_2017_asets.csv direct_allocation + attribution_method: direct + + offroad_vehicles_equipment: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonroad_2017_asets.csv offroad_vehicles_equipment + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *stateio + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum 324110 + + EPA_NEI_Onroad: + geoscale: state + year: 2017 + primary_action_type: Produced + activity_to_sector_mapping: SCC + clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba + fedefl_mapping: NEI + activity_sets: + direct_allocation: + selection_fields: + PrimaryActivity: !from_index:NEI_Onroad_2017_asets.csv direct_allocation + attribution_method: direct + + onroad_vehicles_gas_stations: + selection_fields: + PrimaryActivity: !from_index:NEI_Onroad_2017_asets.csv onroad_vehicles_gas_stations + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *stateio + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum 324110 + + stewiFBS: + data_format: FBS_outside_flowsa + FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector + geoscale: state + inventory_dict: {"NEI":"2017", "TRI":"2017"} + local_inventory_name: NEI_TRI_air_2017 + clean_fbs: !script_function:EPA_NEI drop_GHGs + compartments: + - air + reassign_process_to_sectors: + - airplane_emissions From 39c4d5627bdbbf50735ce5a4d552c3d7b3ef75db Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 31 Mar 2023 16:43:19 -0400 Subject: [PATCH 0439/1127] fix error in activity sets definition --- flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index 25fce383a..d19d15650 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -186,7 +186,7 @@ source_names: output_allocation: # Gross Output selection_fields: - PrimaryActivity: NEI_Nonpoint_2017_asets.csv output_allocation + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv output_allocation attribution_method: proportional attribution_source: BEA_GDP_GrossOutput: From 17b65952ba82480fd9a5fbeb12df3db3cbdd8b8c Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 31 Mar 2023 16:45:17 -0400 Subject: [PATCH 0440/1127] drop unmapped flows from all sources --- flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index d19d15650..a0e8ace5a 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -209,6 +209,7 @@ source_names: activity_to_sector_mapping: SCC clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba fedefl_mapping: NEI + drop_unmapped_rows: True activity_sets: direct_allocation: selection_fields: @@ -232,6 +233,7 @@ source_names: activity_to_sector_mapping: SCC clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba fedefl_mapping: NEI + drop_unmapped_rows: True activity_sets: direct_allocation: selection_fields: From 4904b848ac561a1719758e29bd2de6f0cf7616ed Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 31 Mar 2023 16:47:44 -0400 Subject: [PATCH 0441/1127] fix same errors in state method --- flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml index b524b5f3c..778329751 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml @@ -198,7 +198,7 @@ source_names: output_allocation: # Gross Output selection_fields: - PrimaryActivity: NEI_Nonpoint_2017_asets.csv output_allocation + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv output_allocation attribution_method: proportional attribution_source: stateio_Industry_GO: @@ -221,6 +221,7 @@ source_names: activity_to_sector_mapping: SCC clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba fedefl_mapping: NEI + drop_unmapped_rows: True activity_sets: direct_allocation: selection_fields: @@ -244,6 +245,7 @@ source_names: activity_to_sector_mapping: SCC clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba fedefl_mapping: NEI + drop_unmapped_rows: True activity_sets: direct_allocation: selection_fields: From b478f78d3ac7ef413c818440e184f632f9a12b95 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 31 Mar 2023 19:04:47 -0400 Subject: [PATCH 0442/1127] fix key error --- flowsa/flowbysector.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flowsa/flowbysector.py b/flowsa/flowbysector.py index eac63a0f7..72a9410ba 100644 --- a/flowsa/flowbysector.py +++ b/flowsa/flowbysector.py @@ -87,7 +87,7 @@ def load_source_dataframe(method, sourcename, source_dict, repo :return: df of identified parquet """ - if source_dict['data_format'] == 'FBA': + if source_dict.get('data_format') == 'FBA': # if yaml specifies a geoscale to load, use parameter # to filter dataframe if 'source_fba_load_scale' in source_dict: @@ -102,14 +102,14 @@ def load_source_dataframe(method, sourcename, source_dict, flowclass=source_dict['class'], geographic_level=geo_level, download_FBA_if_missing=download_FBA_if_missing) - elif source_dict['data_format'] == 'FBS': + elif source_dict.get('data_format') == 'FBS': vLog.info("Retrieving flowbysector for datasource %s", sourcename) flows_df = flowsa.getFlowBySector(sourcename) selection_fields = source_dict.get('selection_fields') if selection_fields is not None: for k, v in selection_fields.items(): flows_df = flows_df[flows_df[k].isin(v)].reset_index(drop=True) - elif source_dict['data_format'] == 'FBS_outside_flowsa': + elif source_dict.get('data_format') == 'FBS_outside_flowsa': vLog.info("Retrieving flowbysector for datasource %s", sourcename) fxn = source_dict.get("FBS_datapull_fxn") if callable(fxn): From 57ff8c5b21223c95e98ae692b7e99ad062a9e790 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 31 Mar 2023 19:42:35 -0400 Subject: [PATCH 0443/1127] add missing geoscale --- flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml | 1 + flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index a0e8ace5a..478e1b681 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -191,6 +191,7 @@ source_names: attribution_source: BEA_GDP_GrossOutput: year: 2017 + geoscale: national activity_to_sector_mapping: BEA_2012_Detail selection_fields: Class: Money diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml index 778329751..3cdaaa972 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml @@ -6,6 +6,8 @@ !include:BEA_summary_target.yaml +year: 2017 +geoscale: state sources_to_cache: EIA_MECS_Energy: @@ -203,6 +205,7 @@ source_names: attribution_source: stateio_Industry_GO: year: 2017 + geoscale: state activity_to_sector_mapping: BEA_2012_Summary selection_fields: Class: Money From fb97eb4151c79f4a9011d71be4f2948a34b0f411 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 31 Mar 2023 22:33:04 -0400 Subject: [PATCH 0444/1127] use FBS method name for artifact --- .github/workflows/compare_single_FBS.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compare_single_FBS.yml b/.github/workflows/compare_single_FBS.yml index 1e8233b71..a563ab0f0 100644 --- a/.github/workflows/compare_single_FBS.yml +++ b/.github/workflows/compare_single_FBS.yml @@ -46,7 +46,7 @@ jobs: uses: actions/upload-artifact@v3.1.1 with: # Artifact name - name: FBS diff files + name: "${{ github.event.inputs.method }}" # A file, directory or wildcard patter that describes what to upload path: | # uses local user data dir for macos ~/Library/Application Support/flowsa/FBSComparisons/* From cc8e4382e79aeaf57387260240cbbae251c04641 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 3 Apr 2023 21:51:55 -0400 Subject: [PATCH 0445/1127] pass through `external_config_path`; add warning for direct attribution --- flowsa/common.py | 2 +- flowsa/flowby.py | 17 ++++++++++++----- flowsa/flowsa_yaml.py | 2 ++ flowsa/sectormapping.py | 20 +++++++++++--------- 4 files changed, 26 insertions(+), 15 deletions(-) diff --git a/flowsa/common.py b/flowsa/common.py index b010e8dfa..edaa2c032 100644 --- a/flowsa/common.py +++ b/flowsa/common.py @@ -140,7 +140,7 @@ def load_yaml_dict(filename, flowbytype=None, filepath=None): folder = flowbysectormethodpath else: raise KeyError('Must specify either \'FBA\' or \'FBS\'') - yaml_path = folder + filename + '.yaml' + yaml_path = f'{folder}/{filename}.yaml' try: with open(yaml_path, 'r', encoding='utf-8') as f: diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 2a902b6c6..06f073e8c 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1362,6 +1362,10 @@ def map_to_sectors( 'Activity'], errors='ignore') ) + if(fba_w_naics['group_id'].duplicated().any()): + log.warning('Duplicate assignment of activities to sectors ' + f'for direct attribution of {self.full_name}. ' + 'Review mapping file for duplicates.') if source_year != target_year: log.info('Using NAICS time series/crosswalk to map NAICS ' @@ -1653,12 +1657,15 @@ def multiplication_attribution( # def flagged_proportionally_attribute(self: 'FlowByActivity'): # raise NotImplementedError - def prepare_fbs(self: 'FlowByActivity') -> 'FlowBySector': + def prepare_fbs( + self: 'FlowByActivity', + external_config_path: str = None + ) -> 'FlowBySector': if 'activity_sets' in self.config: try: return ( pd.concat([ - fba.prepare_fbs() + fba.prepare_fbs(external_config_path=external_config_path) for fba in ( self .select_by_fields() @@ -1680,7 +1687,7 @@ def prepare_fbs(self: 'FlowByActivity') -> 'FlowBySector': .convert_units_and_flows() # and also map to flow lists .function_socket('clean_fba') .convert_to_geoscale() - .attribute_flows_to_sectors() # recursive call to prepare_fbs + .attribute_flows_to_sectors(external_config_path=external_config_path) # recursive call to prepare_fbs .drop(columns=['ActivityProducedBy', 'ActivityConsumedBy']) .aggregate_flowby() ) @@ -1937,7 +1944,7 @@ def generateFlowBySector( }, external_config_path=external_config_path, download_sources_ok=download_sources_ok - ).prepare_fbs() + ).prepare_fbs(external_config_path=external_config_path) ) # ^^^ This is done with a for loop instead of a dict comprehension # so that later entries in method_config['sources_to_cache'] @@ -1957,7 +1964,7 @@ def generateFlowBySector( }, external_config_path=external_config_path, download_sources_ok=download_sources_ok - ).prepare_fbs() + ).prepare_fbs(external_config_path=external_config_path) for source_name, config in sources.items() ]) diff --git a/flowsa/flowsa_yaml.py b/flowsa/flowsa_yaml.py index a68f213ad..2e93e6497 100644 --- a/flowsa/flowsa_yaml.py +++ b/flowsa/flowsa_yaml.py @@ -125,6 +125,8 @@ def load(stream: IO, external_path: str = None) -> dict: loader.external_paths_to_search.append(external_path) loader.external_paths_to_search.append( f'{external_path}flowbysectormethods/') + loader.external_paths_to_search.append( + path.dirname(external_path)) loader.external_path_to_pass = external_path try: return loader.get_single_data() diff --git a/flowsa/sectormapping.py b/flowsa/sectormapping.py index 843b1e7e2..b07b8abeb 100644 --- a/flowsa/sectormapping.py +++ b/flowsa/sectormapping.py @@ -31,15 +31,17 @@ def get_activitytosector_mapping(source, fbsconfigpath=None): # if FBS method file loaded from outside the flowsa directory, check if # there is also a crosswalk - external_mappingpath = f"{fbsconfigpath}activitytosectormapping/" - if os.path.exists(external_mappingpath): - activity_mapping_source_name = get_flowsa_base_name( - external_mappingpath, mapfn, 'csv') - if os.path.isfile(f"{external_mappingpath}" - f"{activity_mapping_source_name}.csv"): - log.info(f"Loading {activity_mapping_source_name}.csv " - f"from {external_mappingpath}") - crosswalkpath = external_mappingpath + if fbsconfigpath is not None: + external_mappingpath = (f"{os.path.dirname(fbsconfigpath)}" + "/activitytosectormapping/") + if os.path.exists(external_mappingpath): + activity_mapping_source_name = get_flowsa_base_name( + external_mappingpath, mapfn, 'csv') + if os.path.isfile(f"{external_mappingpath}" + f"{activity_mapping_source_name}.csv"): + log.info(f"Loading {activity_mapping_source_name}.csv " + f"from {external_mappingpath}") + crosswalkpath = external_mappingpath activity_mapping_source_name = get_flowsa_base_name( crosswalkpath, mapfn, 'csv') mapping = pd.read_csv(f'{crosswalkpath}{activity_mapping_source_name}.csv', From b20e3f381d67e0a5b71f4832a645d4dea72d3c59 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 3 Apr 2023 22:51:49 -0400 Subject: [PATCH 0446/1127] convert FBS as attribution source to industry spec --- flowsa/flowby.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 06f073e8c..f8dca6a39 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1362,10 +1362,6 @@ def map_to_sectors( 'Activity'], errors='ignore') ) - if(fba_w_naics['group_id'].duplicated().any()): - log.warning('Duplicate assignment of activities to sectors ' - f'for direct attribution of {self.full_name}. ' - 'Review mapping file for duplicates.') if source_year != target_year: log.info('Using NAICS time series/crosswalk to map NAICS ' @@ -1493,6 +1489,9 @@ def proportionally_attribute( groupby_cols = ['group_id'] for rank in ['Primary', 'Secondary']: + # skip over Secondary if not relevant + if fba[f'{rank}Sector'].isna().all(): + continue counted = fba.assign(group_count=(fba.groupby(groupby_cols) ['group_id'] .transform('count'))) @@ -1538,15 +1537,15 @@ def proportionally_attribute( if not unattributable.empty: log.warning( - 'Could not attribute activities %s in %s due to lack of ' + 'Could not attribute activities in %s due to lack of ' 'flows in attribution source %s for mapped %s sectors %s', - set(zip(unattributable.ActivityProducedBy, - unattributable.ActivityConsumedBy, - unattributable.Location)), + # set(zip(unattributable.ActivityProducedBy, + # unattributable.ActivityConsumedBy, + # unattributable.Location)), unattributable.full_name, other.full_name, rank, - set(unattributable[f'{rank}Sector']) + sorted(set(unattributable[f'{rank}Sector'])) ) proportionally_attributed = ( @@ -1996,6 +1995,10 @@ def sector_aggregation(self): :return: """ naics_key = naics.industry_spec_key(self.config['industry_spec']) + # TODO fix error here causing special sectors (e.g. F010) to drop + # when doing a summary model because lenght does not align (target_naics) + # does not have the right number of digits + # subset naics to those where the source_naics string length is longer # than target_naics naics_key_sub = naics_key.query( @@ -2020,7 +2023,7 @@ def prepare_fbs(self: 'FlowBySector') -> 'FlowBySector': self .function_socket('clean_fbs') .select_by_fields() - # TODO: Add a method to convert to proper industry spec. + .sector_aggregation() # convert to proper industry spec. .convert_fips_to_geoscale() .aggregate_flowby() # necessary after consolidating geoscale ) From 66ea50f631a5dbdbad750d37eabed36b25fee386 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 4 Apr 2023 15:09:12 -0400 Subject: [PATCH 0447/1127] handle flow mapping when more than single source --- flowsa/flowby.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index b5a6841ec..d154f2862 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -796,6 +796,12 @@ def map_to_fedefl_list( log.info(f'Mapping flows in {self.full_name} to ' f'{mapping_subset} in federal elementary flow list') + # Check for use of multiple mapping files + # TODO this was handled in esupy originally - can we go back to that fxn? + if isinstance(mapping_subset, list): + fba_merge_keys.append('Source') + mapping_merge_keys.append('SourceListName') + fba = ( self .assign(Flowable=self.FlowName, From 4256bea2f2f6dd4b6c509e6708c0727c3f1d476a Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 4 Apr 2023 15:48:02 -0400 Subject: [PATCH 0448/1127] fix key error --- flowsa/flowby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index d154f2862..009810d31 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -799,7 +799,7 @@ def map_to_fedefl_list( # Check for use of multiple mapping files # TODO this was handled in esupy originally - can we go back to that fxn? if isinstance(mapping_subset, list): - fba_merge_keys.append('Source') + fba_merge_keys.append('SourceName') mapping_merge_keys.append('SourceListName') fba = ( From 4d1e72f1dd01c317aa30ac0a296780b17eee85cd Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 4 Apr 2023 16:29:18 -0400 Subject: [PATCH 0449/1127] fix typeError unexpected keyword, prepare_fbs for FBS does not have external_config_path --- flowsa/flowby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 009810d31..fd18d1287 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -2020,7 +2020,7 @@ def generateFlowBySector( }, external_config_path=external_config_path, download_sources_ok=download_sources_ok - ).prepare_fbs(external_config_path=external_config_path) + ).prepare_fbs() for source_name, config in sources.items() ]) From 05a70e3e94bbb7fce4f905fce7f815607add5069 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 4 Apr 2023 19:00:38 -0400 Subject: [PATCH 0450/1127] assign location system for stewi data --- flowsa/data_source_scripts/stewiFBS.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flowsa/data_source_scripts/stewiFBS.py b/flowsa/data_source_scripts/stewiFBS.py index ce996e73f..56a062658 100644 --- a/flowsa/data_source_scripts/stewiFBS.py +++ b/flowsa/data_source_scripts/stewiFBS.py @@ -17,6 +17,7 @@ import numpy as np from esupy.processed_data_mgmt import read_source_metadata from flowsa.flowby import FlowBySector, FlowByActivity +from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.location import apply_county_FIPS, update_geoscale from flowsa.settings import log, process_adjustmentpath import stewicombo @@ -315,6 +316,7 @@ def prepare_stewi_fbs(df_load, config) -> 'FlowBySector': 'WASTE_FLOW', 'ELEMENTARY_FLOW') ) + .pipe(assign_fips_location_system, config['year']) .drop(columns=['FacilityID','FRS_ID','State','County'], errors='ignore') .dropna(subset=['Location']) From e79a564d3775d36e06d129ebd81d66aefb21aec4 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 4 Apr 2023 22:10:40 -0400 Subject: [PATCH 0451/1127] add `target_naics_year` to all FBS --- flowsa/methods/flowbysectormethods/CRHW_national_2017.yaml | 1 + flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml | 1 + flowsa/methods/flowbysectormethods/GRDREL_national_2017.yaml | 1 + flowsa/methods/flowbysectormethods/GRDREL_state_2017.yaml | 1 + flowsa/methods/flowbysectormethods/TRI_DMR_national_2017.yaml | 1 + flowsa/methods/flowbysectormethods/TRI_DMR_state_2017.yaml | 1 + 6 files changed, 6 insertions(+) diff --git a/flowsa/methods/flowbysectormethods/CRHW_national_2017.yaml b/flowsa/methods/flowbysectormethods/CRHW_national_2017.yaml index b1a9f4771..ee1c43b5a 100644 --- a/flowsa/methods/flowbysectormethods/CRHW_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CRHW_national_2017.yaml @@ -1,5 +1,6 @@ industry_spec: default: NAICS_6 +target_naics_year: 2012 year: 2017 geoscale: national source_names: diff --git a/flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml b/flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml index 363d7b478..3f71d9553 100644 --- a/flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml @@ -1,5 +1,6 @@ industry_spec: default: NAICS_6 +target_naics_year: 2012 year: 2017 geoscale: state source_names: diff --git a/flowsa/methods/flowbysectormethods/GRDREL_national_2017.yaml b/flowsa/methods/flowbysectormethods/GRDREL_national_2017.yaml index 3cd77b094..7c3eef521 100644 --- a/flowsa/methods/flowbysectormethods/GRDREL_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/GRDREL_national_2017.yaml @@ -1,5 +1,6 @@ industry_spec: default: NAICS_6 +target_naics_year: 2012 year: 2017 geoscale: national source_names: diff --git a/flowsa/methods/flowbysectormethods/GRDREL_state_2017.yaml b/flowsa/methods/flowbysectormethods/GRDREL_state_2017.yaml index 8ba153214..e797d4666 100644 --- a/flowsa/methods/flowbysectormethods/GRDREL_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/GRDREL_state_2017.yaml @@ -1,5 +1,6 @@ industry_spec: default: NAICS_6 +target_naics_year: 2012 year: 2017 geoscale: state source_names: diff --git a/flowsa/methods/flowbysectormethods/TRI_DMR_national_2017.yaml b/flowsa/methods/flowbysectormethods/TRI_DMR_national_2017.yaml index 7e21aa95a..2983ace36 100644 --- a/flowsa/methods/flowbysectormethods/TRI_DMR_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/TRI_DMR_national_2017.yaml @@ -1,5 +1,6 @@ industry_spec: default: NAICS_6 +target_naics_year: 2012 year: 2017 geoscale: national source_names: diff --git a/flowsa/methods/flowbysectormethods/TRI_DMR_state_2017.yaml b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2017.yaml index 0592f8f38..af03356d7 100644 --- a/flowsa/methods/flowbysectormethods/TRI_DMR_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2017.yaml @@ -1,5 +1,6 @@ industry_spec: default: NAICS_6 +target_naics_year: 2012 year: 2017 geoscale: state source_names: From 4f3e73d586740a8bd0b8961f978bd6d3970e3a3b Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 4 Apr 2023 22:17:46 -0400 Subject: [PATCH 0452/1127] incorporate `replace_naics_w_naics_from_another_year()` --- flowsa/data_source_scripts/stewiFBS.py | 29 +++++++++++--------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/flowsa/data_source_scripts/stewiFBS.py b/flowsa/data_source_scripts/stewiFBS.py index 56a062658..a42bd307e 100644 --- a/flowsa/data_source_scripts/stewiFBS.py +++ b/flowsa/data_source_scripts/stewiFBS.py @@ -20,6 +20,7 @@ from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.location import apply_county_FIPS, update_geoscale from flowsa.settings import log, process_adjustmentpath +from flowsa.validation import replace_naics_w_naics_from_another_year import stewicombo import stewi from stewicombo.overlaphandler import remove_default_flow_overlaps @@ -303,20 +304,22 @@ def prepare_stewi_fbs(df_load, config) -> 'FlowBySector': if 'year' not in config: config['year'] = df_load['Year'][0] - # update location to appropriate geoscale prior to aggregating - df = update_geoscale(df_load, config['geoscale']) - fbs = FlowByActivity( - df + df_load + .pipe(update_geoscale, config['geoscale']) + # ^^ update location to appropriate geoscale prior to aggregating .rename(columns={"NAICS": "ActivityProducedBy", 'Source': 'SourceName'}) .assign(Class='Chemicals') + .assign(ActivityConsumedBy='') + .pipe(replace_naics_w_naics_from_another_year, + f"NAICS_{config['target_naics_year']}_Code") + # ^^ Consider upating this old function .assign(FlowType=lambda x: np.where( x['SourceName']=='RCRAInfo', - 'WASTE_FLOW', - 'ELEMENTARY_FLOW') - ) + 'WASTE_FLOW', 'ELEMENTARY_FLOW')) .pipe(assign_fips_location_system, config['year']) + # ^^ Consider upating this old function .drop(columns=['FacilityID','FRS_ID','State','County'], errors='ignore') .dropna(subset=['Location']) @@ -325,14 +328,6 @@ def prepare_stewi_fbs(df_load, config) -> 'FlowBySector': config=config, ).prepare_fbs() - ## TODO replace_naics_w_naics_from_another_year - # df = replace_naics_w_naics_from_another_year(df, 'NAICS_2012_Code') - # df = equally_allocate_parent_to_child_naics(df, config) - # df_subset = aggregate_and_subset_for_target_sectors(df, config) - - # fbs_mapped = assign_fips_location_system( - # fbs_mapped, list(inventory_dict.values())[0]) - return fbs @@ -354,5 +349,5 @@ def add_stewicombo_metadata(inventory_name): if __name__ == "__main__": import flowsa - flowsa.flowbysector.main(method='CRHW_state_2017') - #flowsa.flowbysector.main(method='TRI_DMR_state_2017') + flowsa.flowby.FlowBySector.generateFlowBySector('CRHW_national_2017') + #flowsa.flowby.FlowBySector.generateFlowBySector('TRI_DMR_state_2017') From 7575e4e635716f85987d1a36e858c9c979061e95 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 4 Apr 2023 23:09:03 -0400 Subject: [PATCH 0453/1127] drop missing facilities to avoid error in assigning locations --- flowsa/data_source_scripts/stewiFBS.py | 9 +++++---- flowsa/location.py | 13 +++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/flowsa/data_source_scripts/stewiFBS.py b/flowsa/data_source_scripts/stewiFBS.py index a42bd307e..5810d952a 100644 --- a/flowsa/data_source_scripts/stewiFBS.py +++ b/flowsa/data_source_scripts/stewiFBS.py @@ -74,8 +74,9 @@ def stewicombo_to_sector( # merge dataframes to assign facility information based on facility IDs df = (df.drop(columns=['SRS_CAS', 'SRS_ID', 'FacilityIDs_Combined']) - .merge(facility_mapping.loc[:, facility_mapping.columns != 'NAICS'], - how='left', on='FacilityID') + .merge(facility_mapping.loc[:, facility_mapping.columns != 'NAICS'], + how='inner', + on='FacilityID') ) all_NAICS = obtain_NAICS_from_facility_matcher( @@ -349,5 +350,5 @@ def add_stewicombo_metadata(inventory_name): if __name__ == "__main__": import flowsa - flowsa.flowby.FlowBySector.generateFlowBySector('CRHW_national_2017') - #flowsa.flowby.FlowBySector.generateFlowBySector('TRI_DMR_state_2017') + fbs = flowsa.flowby.FlowBySector.generateFlowBySector('CRHW_national_2017') + fbs = flowsa.flowby.FlowBySector.generateFlowBySector('TRI_DMR_state_2017') diff --git a/flowsa/location.py b/flowsa/location.py index 7b0e8ff3f..607370fb4 100644 --- a/flowsa/location.py +++ b/flowsa/location.py @@ -122,13 +122,14 @@ def update_geoscale(df, to_scale): """ # code for when the "Location" is a FIPS based system if to_scale == 'state': - df.loc[:, 'Location'] = df['Location'].apply(lambda x: str(x[0:2])) - # pad zeros - df.loc[:, 'Location'] = df['Location'].apply(lambda x: - x.ljust(3 + len(x), '0') - if len(x) < 5 else x) + df = df.assign(Location = (df['Location'] + .apply(lambda x: str(x[0:2])) + .apply(lambda x: + x.ljust(3 + len(x), '0') + if len(x) < 5 else x)) + ) elif to_scale == 'national': - df.loc[:, 'Location'] = US_FIPS + df = df.assign(Location = US_FIPS) return df From 74a3929b574674f6085817f4d1be28f23d3c1927 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 4 Apr 2023 23:24:54 -0400 Subject: [PATCH 0454/1127] drop `ActivitySourceName` and `SectorType` as not applicable in this condition --- flowsa/flowby.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index fd18d1287..9f89335ad 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1229,10 +1229,11 @@ def map_to_sectors( # sectors to target sector level log.info('Converting NAICS codes to desired industry/sector ' 'aggregation structure.') - fba_w_naics = self.assign( - ActivitySourceName=self.source_name, - SectorType=np.nan - ) + fba_w_naics = self.copy() + # fba_w_naics = self.assign( + # ActivitySourceName=self.source_name, + # SectorType=np.nan + # ) ^^ I don't think these fields are necessary in this case for direction in ['ProducedBy', 'ConsumedBy']: fba_w_naics = ( fba_w_naics From 28d3d4ffccb0b76672b4d4a36ade5634374ae033 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 4 Apr 2023 23:53:43 -0400 Subject: [PATCH 0455/1127] linting and chaining --- flowsa/data_source_scripts/stewiFBS.py | 98 +++++++++++++------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/flowsa/data_source_scripts/stewiFBS.py b/flowsa/data_source_scripts/stewiFBS.py index 5810d952a..97e9b7637 100644 --- a/flowsa/data_source_scripts/stewiFBS.py +++ b/flowsa/data_source_scripts/stewiFBS.py @@ -6,9 +6,6 @@ These functions are called if referenced in flowbysectormethods as data_format FBS_outside_flowsa with the function specified in FBS_datapull_fxn - -Requires StEWI >= 0.9.5. https://github.com/USEPA/standardizedinventories - """ import sys @@ -135,9 +132,7 @@ def stewi_to_sector( facility_mapping['NAICS'].astype(int).astype(str) # merge dataframes to assign facility information based on facility IDs - df = pd.merge(df, facility_mapping, how='left', - on='FacilityID') - + df = df.merge(facility_mapping, how='left', on='FacilityID') fbs = prepare_stewi_fbs(df, config) for function in functions: @@ -171,27 +166,28 @@ def reassign_process_to_sectors(df, year, file_list, external_config_path): df_adj = pd.concat([df_adj, df_adj0], ignore_index=True) # Eliminate duplicate adjustments - df_adj.drop_duplicates(inplace=True) + df_adj = df_adj.drop_duplicates() if sum(df_adj.duplicated(subset=['source_naics', 'source_process'], - keep=False)) > 0: + keep=False)) > 0: log.warning('duplicate process adjustments') - df_adj.drop_duplicates(subset=['source_naics', 'source_process'], - inplace=True) + df_adj = df_adj.drop_duplicates(subset=['source_naics', + 'source_process']) # obtain and prepare SCC dataset df_fbp = stewi.getInventory('NEI', year, stewiformat='flowbyprocess', download_if_missing=True) df_fbp = df_fbp[df_fbp['Process'].isin(df_adj['source_process'])] - df_fbp['Source'] = 'NEI' - df_fbp = addChemicalMatches(df_fbp) - df_fbp = remove_default_flow_overlaps(df_fbp, SCC=True) + df_fbp = (df_fbp.assign(Source = 'NEI') + .pipe(addChemicalMatches) + .pipe(remove_default_flow_overlaps, SCC=True) + ) # merge in NAICS data - facility_df = df[['FacilityID', 'NAICS', 'Location']].reset_index(drop=True) - facility_df.drop_duplicates(keep='first', inplace=True) + facility_df = (df.filter(['FacilityID', 'NAICS', 'Location']) + .reset_index(drop=True) + .drop_duplicates(keep='first')) df_fbp = df_fbp.merge(facility_df, how='left', on='FacilityID') - df_fbp['Year'] = year #TODO: expand naics list in scc file to include child naics automatically @@ -200,20 +196,24 @@ def reassign_process_to_sectors(df, year, file_list, external_config_path): right_on=['source_naics', 'source_process']) # subtract emissions by SCC from specific facilities - df_emissions = df_fbp.groupby(['FacilityID', 'FlowName']).agg( - {'FlowAmount': 'sum'}) - df_emissions.rename(columns={'FlowAmount': 'Emissions'}, inplace=True) - df = df.merge(df_emissions, how='left', - on=['FacilityID', 'FlowName']) - df[['Emissions']] = df[['Emissions']].fillna(value=0) - df['FlowAmount'] = df['FlowAmount'] - df['Emissions'] - df.drop(columns=['Emissions'], inplace=True) + df_emissions = ( + df_fbp.groupby(['FacilityID', 'FlowName']) + .agg({'FlowAmount': 'sum'}) + .rename(columns={'FlowAmount': 'Emissions'}) + ) + df = (df.merge(df_emissions, how='left', + on=['FacilityID', 'FlowName']) + .assign(Emissions = lambda x: x['Emissions'].fillna(value=0)) + .assign(FlowAmount = lambda x: x['FlowAmount'] - x['Emissions']) + .drop(columns=['Emissions']) + ) # add back in emissions under the correct target NAICS - df_fbp.drop(columns=['Process', 'NAICS', 'source_naics', 'source_process', - 'ProcessType', 'SRS_CAS', 'SRS_ID'], - inplace=True) - df_fbp.rename(columns={'target_naics': 'NAICS'}, inplace=True) + df_fbp = ( + df_fbp.drop(columns=['Process', 'NAICS', 'source_naics', 'source_process', + 'ProcessType', 'SRS_CAS', 'SRS_ID']) + .rename(columns={'target_naics': 'NAICS'}) + ) df = pd.concat([df, df_fbp], ignore_index=True) return df @@ -237,15 +237,12 @@ def extract_facility_data(inventory_dict): subset='FacilityID', keep=False)]) > 0: log.debug(f'Duplicate facilities in {database}_{year} - ' 'keeping first listed') - facilities.drop_duplicates(subset='FacilityID', - keep='first', inplace=True) + facilities = facilities.drop_duplicates(subset='FacilityID', + keep='first') facilities_list.append(facilities) facility_mapping = pd.concat(facilities_list, ignore_index=True) - # Apply FIPS to facility locations - facility_mapping = apply_county_FIPS(facility_mapping) - - return facility_mapping + return facility_mapping.pipe(apply_county_FIPS) def obtain_NAICS_from_facility_matcher(inventory_list): @@ -260,8 +257,9 @@ def obtain_NAICS_from_facility_matcher(inventory_list): facilitymatcher.get_FRS_NAICSInfo_for_facility_list( frs_id_list=None, inventories_of_interest_list=inventory_list, download_if_missing=True) - all_NAICS = all_NAICS.loc[all_NAICS['PRIMARY_INDICATOR'] == 'PRIMARY'] - all_NAICS.drop(columns=['PRIMARY_INDICATOR'], inplace=True) + all_NAICS = (all_NAICS + .query('PRIMARY_INDICATOR == "PRIMARY"') + .drop(columns=['PRIMARY_INDICATOR'])) return all_NAICS @@ -275,17 +273,20 @@ def assign_naics_to_stewicombo(df, all_NAICS, facility_mapping): :param facility_mapping: df of NAICS by Facility_ID """ # first merge in NAICS by FRS, but only where the FRS has a single NAICS - df = pd.merge(df, all_NAICS[~all_NAICS.duplicated( - subset=['FRS_ID', 'Source'], keep=False)], - how='left', on=['FRS_ID', 'Source']) + df = df.merge(all_NAICS[~all_NAICS.duplicated(subset=['FRS_ID', 'Source'], + keep=False)], + how='left', + on=['FRS_ID', 'Source']) # next use NAICS from inventory sources - df = pd.merge(df, facility_mapping[['FacilityID', 'NAICS']], how='left', - on='FacilityID', suffixes=(None, "_y")) - df['NAICS'].fillna(df['NAICS_y'], inplace=True) - df.drop(columns=['NAICS_y'], inplace=True) - # Drop records where sector can not be assigned - df = df.loc[df['NAICS']!='None'] + df = (df.merge(facility_mapping[['FacilityID', 'NAICS']], + how='left', + on='FacilityID', + suffixes=(None, "_y")) + .assign(NAICS = lambda x: x['NAICS'].fillna(x['NAICS_y'])) + .drop(columns=['NAICS_y']) + .query('NAICS != "None"') + ) return df @@ -297,10 +298,9 @@ def prepare_stewi_fbs(df_load, config) -> 'FlowBySector': :param config: dictionary, FBS method data source configuration :return: FlowBySector """ - config['sector-like_activities']=True - config['fedefl_mapping'] = ( - [x for x in config.get('inventory_dict').keys() - if x != 'RCRAInfo']) + config['sector-like_activities'] = True + config['fedefl_mapping'] = ([x for x in config.get('inventory_dict').keys() + if x != 'RCRAInfo']) config['drop_unmapped_rows'] = True if 'year' not in config: config['year'] = df_load['Year'][0] From 33497152c261549b858df56c64139f30c9dcec52 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 5 Apr 2023 15:40:16 -0400 Subject: [PATCH 0456/1127] fix year for MECS --- .../methods/flowbysectormethods/CAP_HAP_state_2017.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml index 3cdaaa972..406cbf3cb 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml @@ -5,13 +5,13 @@ # emissions -!include:BEA_summary_target.yaml +!include:USEEIO_summary_target.yaml year: 2017 geoscale: state sources_to_cache: EIA_MECS_Energy: - year: 2014 + year: 2018 geoscale: national selection_fields: Class: Energy @@ -25,10 +25,10 @@ sources_to_cache: clean_fba_w_sec: !script_function:temp_data_source_functions clean_mapped_mecs_energy_fba attribution_method: proportional attribution_source: - Employment_state_2014: + Employment_state_2018: data_format: FBS geoscale: state - year: 2014 + year: 2018 _attribution_sources: stateio: &stateio From 73301450eef6066bcc5f5b173c2397b6e0e79b39 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 5 Apr 2023 15:40:27 -0400 Subject: [PATCH 0457/1127] remove deprecated fbs parameters --- flowsa/methods/flowbysectormethods/USEEIO_summary_target.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/USEEIO_summary_target.yaml b/flowsa/methods/flowbysectormethods/USEEIO_summary_target.yaml index 5d4ee92f3..2aba5703b 100644 --- a/flowsa/methods/flowbysectormethods/USEEIO_summary_target.yaml +++ b/flowsa/methods/flowbysectormethods/USEEIO_summary_target.yaml @@ -14,7 +14,3 @@ industry_spec: # In USEEIO models 221 (Utilities) is disaggregated to 2211, 2212, and 2213 # '336' and '541' carry over from the BEA summary sectors target_naics_year: 2012 - -# Needed temporarily still for some old subetting functions -target_sector_level: NAICS_3 -target_subset_sector_level: {NAICS_4: ['221', '336', '541']} From 99894b8f18e0c9c49dad2f125e0aa6c1cd2f6fad Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 5 Apr 2023 15:40:50 -0400 Subject: [PATCH 0458/1127] readd external config paths for `prepare_fbs()` for `FlowBySector` --- flowsa/flowby.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 9f89335ad..2a674cf1b 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -2021,7 +2021,7 @@ def generateFlowBySector( }, external_config_path=external_config_path, download_sources_ok=download_sources_ok - ).prepare_fbs() + ).prepare_fbs(external_config_path=external_config_path) for source_name, config in sources.items() ]) @@ -2076,7 +2076,10 @@ def sector_aggregation(self): return fbs - def prepare_fbs(self: 'FlowBySector') -> 'FlowBySector': + def prepare_fbs( + self: 'FlowBySector', + external_config_path: str = None + ) -> 'FlowBySector': return ( self .function_socket('clean_fbs') From 46bc0391ad33d7123e57b9c8635f8faea24b820f Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 5 Apr 2023 23:04:52 -0400 Subject: [PATCH 0459/1127] create unassigned dataframe for potential review --- flowsa/flowby.py | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 2a674cf1b..9aa9c7b5c 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1808,6 +1808,7 @@ def activity_sets(self) -> List['FlowByActivity']: if set(parent_fba.row) - assigned_rows: log.warning('Some rows from %s not assigned to an activity ' 'set. Is this intentional?', parent_fba.full_name) + unassigned = parent_fba.query('row not in @assigned_rows') return child_fba_list From 28e3db0062ae650cf2fb647c64f9076f16771e7f Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 5 Apr 2023 23:40:31 -0400 Subject: [PATCH 0460/1127] initial implementation of exclusion_fields --- flowsa/flowby.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 9aa9c7b5c..d13120f1a 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -425,9 +425,19 @@ def select_by_fields(self: FB, selection_fields: dict = None) -> FB: added using _FlowBy.add_primary_secondary_columns(), and the selection made based on 'PrimaryActivity' or 'PrimarySector', as specified. Selecting on secondary activities or sectors is not supported. + + Similarly, can use 'exclusion_fields' to remove particular data in the + same manner. ''' + exclusion_fields = self.config.get('exclusion_fields', {}) + exclusion_fields = {k: [v] if not isinstance(v, (list, dict)) else v + for k, v in exclusion_fields.items()} + for field, values in exclusion_fields.items(): + self = self.query(f'{field} not in @values') + selection_fields = (selection_fields or self.config.get('selection_fields')) + if selection_fields is None: return self From dd36ad988f059d61b82df86f9045ac5876f136f9 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 6 Apr 2023 08:32:34 -0400 Subject: [PATCH 0461/1127] pull flow dropping into fbs config --- flowsa/data_source_scripts/EPA_NEI.py | 36 ------------------- flowsa/data_source_scripts/EPA_StateGHGI.py | 18 ---------- .../CAP_HAP_national_2017.yaml | 31 +++++++++++++++- .../CAP_HAP_state_2017.yaml | 31 +++++++++++++++- 4 files changed, 60 insertions(+), 56 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_NEI.py b/flowsa/data_source_scripts/EPA_NEI.py index c984fcaf4..00d08ef0d 100644 --- a/flowsa/data_source_scripts/EPA_NEI.py +++ b/flowsa/data_source_scripts/EPA_NEI.py @@ -162,8 +162,6 @@ def clean_NEI_fba(fba: FlowByActivity, **_) -> FlowByActivity: :param fba: df, FBA format :return: modified FBA """ - fba = remove_duplicate_NEI_flows(fba) - fba = drop_GHGs(fba) # Remove the portion of PM10 that is PM2.5 to eliminate double counting, # rename FlowName and Flowable, and update UUID fba = remove_flow_overlap(fba, 'PM10 Primary (Filt + Cond)', @@ -185,40 +183,6 @@ def clean_NEI_fba(fba: FlowByActivity, **_) -> FlowByActivity: return fba -def remove_duplicate_NEI_flows(df): - """ - These flows for PM will get mapped to the primary PM flowable in FEDEFL - resulting in duplicate emissions - :param df: df, FBA format - :return: df, FBA format with duplicate flows dropped - """ - flowlist = [ - 'PM10-Primary from certain diesel engines', - 'PM25-Primary from certain diesel engines', - ] - - df = df.loc[~df['FlowName'].isin(flowlist)] - return df - - -def drop_GHGs(df, method=None, **_): - """ - GHGs are included in some NEI datasets. If these data are not - compiled together with GHGRP, need to remove them as they will be - tracked from a different source - :param df: df, FBA format - :return: df - """"" - flowlist = [ - 'Carbon Dioxide', 'Carbon dioxide', - 'Methane', - 'Nitrous Oxide', 'Nitrous oxide', - 'Sulfur Hexafluoride', 'Sulfur hexafluoride', - ] - flow_var = 'Flowable' if 'Flowable' in df.columns else 'FlowName' - return df.query(f'{flow_var} not in @flowlist') - - def drop_pesticides(df): """ To avoid overlap with other datasets, emissions of pesticides diff --git a/flowsa/data_source_scripts/EPA_StateGHGI.py b/flowsa/data_source_scripts/EPA_StateGHGI.py index 72f3c2958..aa94fd616 100644 --- a/flowsa/data_source_scripts/EPA_StateGHGI.py +++ b/flowsa/data_source_scripts/EPA_StateGHGI.py @@ -55,24 +55,6 @@ def epa_state_ghgi_parse(*, source, year, config, **_): return df -def remove_select_states(fba, source_dict, **_): - """ - clean_fba_df_fxn to remove selected states so they can be added - from alternate sources. State abbreviations must be passed as list - in method parameter 'state_list' - - :param fba: df - :param source_dict: dictionary of source methods includes 'state_list' - key of states to remove - """ - state_list = source_dict.get('state_list') - state_df = pd.DataFrame(state_list, columns=['State']) - state_df['County'] ='' - state_df = apply_county_FIPS(state_df) - df_subset = fba[~fba['Location'].isin(state_df['Location'])] - return df_subset - - def tag_biogenic_activities(fba, source_dict, **_): """ clean_fba_before_mapping_df_fxn to tag emissions from passed activities diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index 478e1b681..30bda54a7 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -67,6 +67,14 @@ source_names: year: 2017 primary_action_type: Produced activity_to_sector_mapping: SCC + exclusion_fields: + FlowName: + - PM10-Primary from certain diesel engines + - PM25-Primary from certain diesel engines + - Carbon Dioxide + - Methane + - Nitrous Oxide + - Sulfur Hexafluoride clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba fedefl_mapping: NEI drop_unmapped_rows: True @@ -208,6 +216,14 @@ source_names: year: 2017 primary_action_type: Produced activity_to_sector_mapping: SCC + exclusion_fields: + FlowName: + - PM10-Primary from certain diesel engines + - PM25-Primary from certain diesel engines + - Carbon Dioxide + - Methane + - Nitrous Oxide + - Sulfur Hexafluoride clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba fedefl_mapping: NEI drop_unmapped_rows: True @@ -232,6 +248,14 @@ source_names: year: 2017 primary_action_type: Produced activity_to_sector_mapping: SCC + exclusion_fields: + FlowName: + - PM10-Primary from certain diesel engines + - PM25-Primary from certain diesel engines + - Carbon Dioxide + - Methane + - Nitrous Oxide + - Sulfur Hexafluoride clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba fedefl_mapping: NEI drop_unmapped_rows: True @@ -256,8 +280,13 @@ source_names: FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector inventory_dict: {"NEI":"2017", "TRI":"2017"} local_inventory_name: NEI_TRI_air_2017 - clean_fbs: !script_function:EPA_NEI drop_GHGs compartments: - air reassign_process_to_sectors: - airplane_emissions + exclusion_fields: + FlowName: + - Carbon Dioxide + - Methane + - Nitrous Oxide + - Sulfur Hexafluoride diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml index 406cbf3cb..17873fdcc 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml @@ -74,6 +74,14 @@ source_names: year: 2017 primary_action_type: Produced activity_to_sector_mapping: SCC + exclusion_fields: + FlowName: + - PM10-Primary from certain diesel engines + - PM25-Primary from certain diesel engines + - Carbon Dioxide + - Methane + - Nitrous Oxide + - Sulfur Hexafluoride clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba fedefl_mapping: NEI drop_unmapped_rows: True @@ -222,6 +230,14 @@ source_names: year: 2017 primary_action_type: Produced activity_to_sector_mapping: SCC + exclusion_fields: + FlowName: + - PM10-Primary from certain diesel engines + - PM25-Primary from certain diesel engines + - Carbon Dioxide + - Methane + - Nitrous Oxide + - Sulfur Hexafluoride clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba fedefl_mapping: NEI drop_unmapped_rows: True @@ -246,6 +262,14 @@ source_names: year: 2017 primary_action_type: Produced activity_to_sector_mapping: SCC + exclusion_fields: + FlowName: + - PM10-Primary from certain diesel engines + - PM25-Primary from certain diesel engines + - Carbon Dioxide + - Methane + - Nitrous Oxide + - Sulfur Hexafluoride clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba fedefl_mapping: NEI drop_unmapped_rows: True @@ -271,8 +295,13 @@ source_names: geoscale: state inventory_dict: {"NEI":"2017", "TRI":"2017"} local_inventory_name: NEI_TRI_air_2017 - clean_fbs: !script_function:EPA_NEI drop_GHGs compartments: - air reassign_process_to_sectors: - airplane_emissions + exclusion_fields: + FlowName: + - Carbon Dioxide + - Methane + - Nitrous Oxide + - Sulfur Hexafluoride From fb0de5a56be15c5fb73996ae225e284f4f1b0f44 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 6 Apr 2023 15:39:39 -0600 Subject: [PATCH 0462/1127] comment out non-recursive functions - delete --- flowsa/data_source_scripts/USGS_NWIS_WU.py | 158 ++++++++++----------- 1 file changed, 79 insertions(+), 79 deletions(-) diff --git a/flowsa/data_source_scripts/USGS_NWIS_WU.py b/flowsa/data_source_scripts/USGS_NWIS_WU.py index 9530b7815..6a7c3210e 100644 --- a/flowsa/data_source_scripts/USGS_NWIS_WU.py +++ b/flowsa/data_source_scripts/USGS_NWIS_WU.py @@ -639,82 +639,82 @@ def subset_and_merge_irrigation_types(df: FlowByActivity): return df_m2 - -def usgs_fba_w_sectors_data_cleanup(df_wsec: FlowByActivity, attr, **kwargs) -> FlowByActivity: - """ - Call on functions to modify the fba with sectors df before being allocated - to sectors used in flowbysector.py - :param df_wsec: an FBA dataframe with sectors - :param attr: dictionary, attribute data from method yaml for activity set - :param kwargs: includes "method", a parameter required in other - 'clean_fba_w_sec_df_fxn' function calls when building a FBS - :return: df, FBA modified - """ - - df = modify_sector_length(df_wsec) - - return df - - -def modify_sector_length(df_wsec: FlowByActivity): - """ - After assigning sectors to activities, modify the sector length of an - activity, to match the assigned sector in another sector column ( - SectorConsumedBy/SectorProducedBy). This is helpful for sector - aggregation. The USGS NWIS WU "Public Supply" should be modified to - match sector length. - :param df_wsec: a df that includes columns for SectorProducedBy - and SectorConsumedBy - :return: df, FBA with sector columns modified - """ - - # the activity(ies) whose sector length should be modified - activities = ["Public Supply"] - - # subset data - df1 = df_wsec.loc[ - (df_wsec['SectorProducedBy'].isnull()) | - (df_wsec['SectorConsumedBy'].isnull())].reset_index(drop=True) - df2 = df_wsec.loc[ - (df_wsec['SectorProducedBy'].notnull()) & - (df_wsec['SectorConsumedBy'].notnull())].reset_index(drop=True) - - # concat data into single dataframe - if len(df2) != 0: - df2.loc[:, 'LengthToModify'] = np.where( - df2['ActivityProducedBy'].isin(activities), - df2['SectorProducedBy'].str.len(), 0) - df2.loc[:, 'LengthToModify'] = np.where( - df2['ActivityConsumedBy'].isin(activities), - df2['SectorConsumedBy'].str.len(), df2['LengthToModify']) - df2.loc[:, 'TargetLength'] = np.where( - df2['ActivityProducedBy'].isin(activities), - df2['SectorConsumedBy'].str.len(), 0) - df2.loc[:, 'TargetLength'] = np.where( - df2['ActivityConsumedBy'].isin(activities), - df2['SectorProducedBy'].str.len(), df2['TargetLength']) - - df2.loc[:, 'SectorProducedBy'] = df2.apply( - lambda x: x['SectorProducedBy'][:x['TargetLength']] - if x['LengthToModify'] > x['TargetLength'] - else x['SectorProducedBy'], axis=1) - df2.loc[:, 'SectorConsumedBy'] = df2.apply( - lambda x: x['SectorConsumedBy'][:x['TargetLength']] - if x['LengthToModify'] > x['TargetLength'] - else x['SectorConsumedBy'], axis=1) - - df2.loc[:, 'SectorProducedBy'] = df2.apply( - lambda x: x['SectorProducedBy'].ljust(x['TargetLength'], '0') - if x['LengthToModify'] < x['TargetLength'] - else x['SectorProducedBy'], axis=1) - df2.loc[:, 'SectorConsumedBy'] = df2.apply( - lambda x: x['SectorConsumedBy'].ljust(x['TargetLength'], '0') - if x['LengthToModify'] < x['TargetLength'] - else x['SectorConsumedBy'], axis=1) - - df2 = df2.drop(columns=["LengthToModify", 'TargetLength']) - - df = pd.concat([df1, df2]) - return df - else: - return df1 +# todo: delete +# def usgs_fba_w_sectors_data_cleanup(df_wsec: FlowByActivity, attr, **kwargs) -> FlowByActivity: +# """ +# Call on functions to modify the fba with sectors df before being allocated +# to sectors used in flowbysector.py +# :param df_wsec: an FBA dataframe with sectors +# :param attr: dictionary, attribute data from method yaml for activity set +# :param kwargs: includes "method", a parameter required in other +# 'clean_fba_w_sec_df_fxn' function calls when building a FBS +# :return: df, FBA modified +# """ +# +# df = modify_sector_length(df_wsec) +# +# return df + +# todo: delete +# def modify_sector_length(df_wsec: FlowByActivity): +# """ +# After assigning sectors to activities, modify the sector length of an +# activity, to match the assigned sector in another sector column ( +# SectorConsumedBy/SectorProducedBy). This is helpful for sector +# aggregation. The USGS NWIS WU "Public Supply" should be modified to +# match sector length. +# :param df_wsec: a df that includes columns for SectorProducedBy +# and SectorConsumedBy +# :return: df, FBA with sector columns modified +# """ +# +# # the activity(ies) whose sector length should be modified +# activities = ["Public Supply"] +# +# # subset data +# df1 = df_wsec.loc[ +# (df_wsec['SectorProducedBy'].isnull()) | +# (df_wsec['SectorConsumedBy'].isnull())].reset_index(drop=True) +# df2 = df_wsec.loc[ +# (df_wsec['SectorProducedBy'].notnull()) & +# (df_wsec['SectorConsumedBy'].notnull())].reset_index(drop=True) +# +# # concat data into single dataframe +# if len(df2) != 0: +# df2.loc[:, 'LengthToModify'] = np.where( +# df2['ActivityProducedBy'].isin(activities), +# df2['SectorProducedBy'].str.len(), 0) +# df2.loc[:, 'LengthToModify'] = np.where( +# df2['ActivityConsumedBy'].isin(activities), +# df2['SectorConsumedBy'].str.len(), df2['LengthToModify']) +# df2.loc[:, 'TargetLength'] = np.where( +# df2['ActivityProducedBy'].isin(activities), +# df2['SectorConsumedBy'].str.len(), 0) +# df2.loc[:, 'TargetLength'] = np.where( +# df2['ActivityConsumedBy'].isin(activities), +# df2['SectorProducedBy'].str.len(), df2['TargetLength']) +# +# df2.loc[:, 'SectorProducedBy'] = df2.apply( +# lambda x: x['SectorProducedBy'][:x['TargetLength']] +# if x['LengthToModify'] > x['TargetLength'] +# else x['SectorProducedBy'], axis=1) +# df2.loc[:, 'SectorConsumedBy'] = df2.apply( +# lambda x: x['SectorConsumedBy'][:x['TargetLength']] +# if x['LengthToModify'] > x['TargetLength'] +# else x['SectorConsumedBy'], axis=1) +# +# df2.loc[:, 'SectorProducedBy'] = df2.apply( +# lambda x: x['SectorProducedBy'].ljust(x['TargetLength'], '0') +# if x['LengthToModify'] < x['TargetLength'] +# else x['SectorProducedBy'], axis=1) +# df2.loc[:, 'SectorConsumedBy'] = df2.apply( +# lambda x: x['SectorConsumedBy'].ljust(x['TargetLength'], '0') +# if x['LengthToModify'] < x['TargetLength'] +# else x['SectorConsumedBy'], axis=1) +# +# df2 = df2.drop(columns=["LengthToModify", 'TargetLength']) +# +# df = pd.concat([df1, df2]) +# return df +# else: +# return df1 From 2e334d21db2c9ed4b667e50180d8aba1ee7ac04f Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 6 Apr 2023 15:42:00 -0600 Subject: [PATCH 0463/1127] add method of replacing nonexistent state values with national data --- .../Water_national_2015_m1.yaml | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index ed521aa93..316542515 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -11,7 +11,6 @@ source_names: fedefl_mapping: USGS_NWIS_WU geoscale: state clean_fba_before_activity_sets: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup - clean_fba_w_sec: !script_function:USGS_NWIS_WU usgs_fba_w_sectors_data_cleanup activity_sets: direct_attribution: selection_fields: @@ -77,16 +76,20 @@ source_names: year: 2018 selection_fields: Class: Water - estimate_suppressed: !script_function:USDA_IWMS estimate_suppressed_iwms + attribution_method: substitute_nonexistent_values + attribution_source: + USDA_IWMS: + geoscale: national + year: 2018 + selection_fields: + Class: Water cropland_attribution-cropland: selection_fields: PrimaryActivity: ['SOYBEANS', 'CANOLA', 'FLAXSEED', - 'MUSTARD, SEED', 'RAPESEED', - 'SAFFLOWER', 'SESAME', 'SUNFLOWER', - 'CAMELINA', 'BEANS, DRY EDIBLE, (EXCL - LIMA), INCL CHICKPEAS', 'BEANS, DRY - EDIBLE, (EXCL CHICKPEAS & LIMA)', - 'BEANS, DRY EDIBLE, LIMA', 'CHICKPEAS', 'LENTILS', + 'MUSTARD, SEED', 'RAPESEED', 'SAFFLOWER', 'SESAME', + 'SUNFLOWER', 'CAMELINA', 'BEANS, DRY EDIBLE, (EXCL LIMA), + INCL CHICKPEAS', 'BEANS, DRY EDIBLE, (EXCL CHICKPEAS & + LIMA)', 'BEANS, DRY EDIBLE, LIMA', 'CHICKPEAS', 'LENTILS', 'PEAS, DRY EDIBLE', 'PEAS, DRY, SOUTHERN (COWPEAS)', 'WHEAT', 'CORN', 'CORN, GRAIN', 'CORN, SILAGE', 'POPCORN, SHELLED', 'RICE', 'BARLEY', 'BUCKWHEAT', @@ -129,9 +132,9 @@ source_names: activity_sets: cropland_attribution-cropland-nonhay: selection_fields: - PrimaryActivity: ['BEANS, DRY EDIBLE, INCL CHICKPEAS', - 'BERRY TOTALS', 'CORN, GRAIN', - 'CORN, SILAGE', 'COTTON', 'CROPS, OTHER', + PrimaryActivity: ['BEANS, DRY EDIBLE, INCL + CHICKPEAS', 'BERRY TOTALS', 'CORN, GRAIN', + 'CORN, SILAGE', 'COTTON', 'CROPS, OTHER', 'HORTICULTURE TOTALS', 'ORCHARDS', 'PASTURELAND', 'PEANUTS', 'POTATOES', 'RICE', 'SMALL GRAINS, OTHER', 'SORGHUM, GRAIN', @@ -181,8 +184,6 @@ source_names: attribution_method: multiplication attribution_source: USGS_WU_Coef: - industry_spec: - default: NAICS_6 year: 2005 geoscale: national attribution_method: direct From 8d8671d8cc53680c976ade2b9c6635228c9587c5 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 6 Apr 2023 15:43:53 -0600 Subject: [PATCH 0464/1127] new substitute_nonexistent_values() as method to add all possible options for location/activity combos --- flowsa/flowby.py | 63 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 3 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index d0ab4fa46..4a8a8e86a 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -6,7 +6,7 @@ from copy import deepcopy from flowsa import (common, settings, metadata, sectormapping, literature_values, flowbyactivity, flowsa_yaml, - validation, geo, naics, exceptions) + validation, geo, naics, exceptions, location) from flowsa.flowsa_log import log import esupy.processed_data_mgmt import esupy.dqi @@ -1032,11 +1032,11 @@ def attribute_flows_to_sectors( self: 'FlowByActivity', external_config_path: str = None ) -> 'FlowByActivity': - ''' + """ The calling FBA has its activities mapped to sectors, then its flows attributed to those sectors, by the methods specified in the calling FBA's configuration dictionary. - ''' + """ grouped: 'FlowByActivity' = ( self .reset_index(drop=True).reset_index() @@ -1066,6 +1066,10 @@ def attribute_flows_to_sectors( attribution_fbs = fba.load_prepare_attribution_source() attributed_fba = fba.weighted_average_attribution(attribution_fbs) + elif attribution_method == 'substitute_nonexistent_values': + attribution_fbs = fba.load_prepare_attribution_source() + attributed_fba = fba.substitute_nonexistent_values(attribution_fbs) + else: if all(fba.groupby('group_id')['group_id'].agg('count') == 1): log.info('No attribution needed for %s at the given industry ' @@ -1702,6 +1706,59 @@ def weighted_average_attribution( return wt_flow + def substitute_nonexistent_values( + self: 'FlowByActivity', + other: 'FlowBySector' + ) -> 'FlowByActivity': + """ + This method determines weighted average + """ + log.info('Substituting nonexistent values in %s with %s.', + self.full_name, other.full_name) + + fba = (self + .add_primary_secondary_columns('Sector') + .drop(columns=['group_id', 'group_total']) + ) + + other = other.add_primary_secondary_columns('Sector') + + # merge all possible national data with each state + state_geo = pd.concat([ + (geo.filtered_fips(self.config['geoscale'])[['FIPS']] + .assign(Location=location.US_FIPS)) + ]) + + other = (other + .merge(state_geo) + .drop(columns=['Location', 'FlowUUID']) + .rename(columns={'FIPS': 'Location', + 'FlowAmount': 'FlowAmount_other'}) + ) + + merged = (fba + .merge(other, + on=list(other.select_dtypes( + include=['object', 'int']).columns), + how='outer') + .assign(FlowAmount=lambda x: x.FlowAmount. + fillna(x.FlowAmount_other)) + .drop(columns=['PrimarySector', 'SecondarySector', + 'FlowAmount_other', 'group_id'], + errors='ignore') + .reset_index(drop=True).reset_index() + .rename(columns={'index': 'group_id'}) + ) + # replace float dtypes with new data + merged = (merged + .drop(merged.filter(regex='_x').columns, axis=1) + .rename(columns=lambda x: x.replace('_y', '')) + .assign(group_total=merged.FlowAmount) + ) + + return merged + + def prepare_fbs(self: 'FlowByActivity') -> 'FlowBySector': if 'activity_sets' in self.config: try: From 47e47b4ec61d0ed33583f788b26d0794eddcbf80 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 6 Apr 2023 15:44:41 -0600 Subject: [PATCH 0465/1127] skip validation that df values equal original values if multiplation, weighted average, or adding new data --- flowsa/flowby.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 4a8a8e86a..2a83e2808 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1089,7 +1089,8 @@ def attribute_flows_to_sectors( # if the attribution method is not multiplication, check that new df # values equal original df values - if attribution_method != 'multiplication': + if attribution_method not in ['multiplication', 'weighted_average', + 'substitute_nonexistent_values']: # todo: add results from this if statement to validation log validation_fba = attributed_fba.assign( validation_total=(attributed_fba.groupby('group_id') From c839bb5c8827dcabc34090cd472d6159be7018e9 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 6 Apr 2023 15:45:03 -0600 Subject: [PATCH 0466/1127] warn if any activities are not mapped to sectors --- flowsa/flowby.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 2a83e2808..f79ace616 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1388,6 +1388,21 @@ def map_to_sectors( .drop(columns=['source_naics', 'target_naics']) ) + # warn if any activities are not mapped to sectors + not_mapped = fba_w_naics[fba_w_naics[['SectorProducedBy', + 'SectorConsumedBy']].isna().all(1)] + if len(not_mapped) > 0: + not_mapped = (not_mapped + [['ActivityProducedBy', 'ActivityConsumedBy']] + .drop_duplicates()) + log.warning('Activities in %s are not mapped to sectors: %s', + not_mapped.full_name, + set(zip(not_mapped.ActivityProducedBy, + not_mapped.ActivityConsumedBy)) + ) + fba_w_naics = fba_w_naics.dropna(subset=[ + 'SectorProducedBy', 'SectorConsumedBy'], how='all') + return ( fba_w_naics .assign(SectorSourceName=f'NAICS_{target_year}_Code') From 7e28f8f9a48cdc6e294f568a171021542f593831 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 6 Apr 2023 21:24:19 -0400 Subject: [PATCH 0467/1127] update SIT functions with recursive branch --- flowsa/data/source_catalog.yaml | 1 + flowsa/data_source_scripts/EPA_SIT.py | 25 +++++++++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 9794124bb..34c1996b5 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -213,6 +213,7 @@ EPA_StateGHGI: activity_schema: sector_hierarchy: "flat" EPA_SIT: + data_format: FBA class: - Chemicals sector-like_activities: False diff --git a/flowsa/data_source_scripts/EPA_SIT.py b/flowsa/data_source_scripts/EPA_SIT.py index 132e5da11..f40eb4a91 100644 --- a/flowsa/data_source_scripts/EPA_SIT.py +++ b/flowsa/data_source_scripts/EPA_SIT.py @@ -9,6 +9,7 @@ import pandas as pd import os from flowsa.settings import externaldatapath, log +from flowsa.flowby import FlowByActivity from flowsa.flowbyfunctions import assign_fips_location_system, \ load_fba_w_standardized_units from flowsa.location import apply_county_FIPS @@ -123,17 +124,19 @@ def epa_sit_parse(*, source, year, config, **_): return df0 -def disaggregate_emissions(fba, source_dict, **_): +def disaggregate_emissions(fba: FlowByActivity, **_) -> FlowByActivity: """ clean_fba_before_mapping_df_fxn to assign specific flow names to flows that are an amalgamation of multiple different GHGs (e.g., "HFC, PFC, SF6, and NF3 emissions") """ - + attributes_to_save = { + attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] + } # dictionary of activities where GHG emissions need to be disaggregated - activity_dict = source_dict['clean_activity_dict'] - + activity_dict = fba.config.get('clean_activity_dict') + year = fba.config.get('year') # for all activities included in the dictionary... for activity_name, activity_properties in activity_dict.items(): disaggregation_method = activity_properties.get('disaggregation_method') @@ -145,7 +148,7 @@ def disaggregate_emissions(fba, source_dict, **_): table_name = activity_properties.get('disaggregation_data_source') # load percentages to be used for proportional split splits = load_fba_w_standardized_units(datasource=table_name, - year=source_dict['year']) + year=year) drop_rows = activity_properties.get('drop_rows') # there are certain circumstances where one or more rows need to be # excluded from the table @@ -161,8 +164,10 @@ def disaggregate_emissions(fba, source_dict, **_): axis=1, result_type='expand') speciated_df.columns = splits['FlowName'] speciated_df = pd.concat([fba_activity, speciated_df], axis=1) - speciated_df = speciated_df.melt(id_vars=flow_by_activity_fields.keys(), - var_name='Flow') + speciated_df = speciated_df.melt( + id_vars=[c for c in flow_by_activity_fields.keys() + if c in speciated_df.columns], + var_name='Flow') speciated_df['FlowName'] = speciated_df['Flow'] speciated_df['FlowAmount'] = speciated_df['value'] speciated_df.drop(columns=['Flow', 'value'], inplace=True) @@ -175,7 +180,11 @@ def disaggregate_emissions(fba, source_dict, **_): species_name = activity_properties.get('disaggregation_data_source') fba.loc[fba.ActivityProducedBy == activity_name, 'FlowName'] = species_name - return fba + new_fba = FlowByActivity(fba) + for attr in attributes_to_save: + setattr(new_fba, attr, attributes_to_save[attr]) + + return new_fba def clean_up_state_data(fba, source_dict, method, **_): """ From 0616479d05ec744050679bd8bb3582eacfaaf320 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 6 Apr 2023 21:26:22 -0400 Subject: [PATCH 0468/1127] handle activity sets when all data are 0 (and get dropped during aggregation) --- flowsa/flowby.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index d13120f1a..68e8a4f36 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1059,6 +1059,9 @@ def attribute_flows_to_sectors( .rename(columns={'index': 'group_id'}) .assign(group_total=self.FlowAmount) ) + if len(grouped)==0: + log.warning(f'No data remaining in {self.full_name}.') + return self fba: 'FlowByActivity' = ( grouped .map_to_sectors(external_config_path=external_config_path) From c72d9f2e3473fcb42aed371bf8d586a0da17a93a Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 7 Apr 2023 09:13:44 -0400 Subject: [PATCH 0469/1127] initiate adjustments to convert MECS regions to states --- flowsa/data_source_scripts/EIA_MECS.py | 31 ++++++++++--------- flowsa/flowby.py | 2 ++ .../CAP_HAP_state_2017.yaml | 7 +++-- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/flowsa/data_source_scripts/EIA_MECS.py b/flowsa/data_source_scripts/EIA_MECS.py index dc2d4c200..7d990adb0 100644 --- a/flowsa/data_source_scripts/EIA_MECS.py +++ b/flowsa/data_source_scripts/EIA_MECS.py @@ -15,6 +15,7 @@ from flowsa.location import US_FIPS, get_region_and_division_codes from flowsa.common import WITHDRAWN_KEYWORD, load_crosswalk from flowsa.settings import vLogDetailed, log +from flowsa.flowby import FlowByActivity from flowsa.flowbyfunctions import assign_fips_location_system, sector_aggregation from flowsa.dataclean import replace_strings_with_NoneType, \ replace_NoneType_with_empty_cells @@ -458,25 +459,27 @@ def eia_mecs_energy_parse(*, df_list, source, year, **_): return df -def eia_mecs_energy_clean_allocation_fba_w_sec_to_state( - df_w_sec, attr, method, **kwargs): +def clean_mapped_mecs_energy_fba_to_state( + fba: FlowByActivity, **_ + ) -> FlowByActivity: """clean_fba_w_sec fxn that replicates - eia_mecs_energy_clean_allocation_fba_w_sec but also updates regions to + clean_mapped_mecs_energy_fba but also updates regions to states for state models""" - df_w_sec = eia_mecs_energy_clean_allocation_fba_w_sec( - df_w_sec, attr, method, **kwargs) - df_w_sec = update_regions_to_states(df_w_sec, attr) - - return df_w_sec + from flowsa.data_source_scripts.temp_data_source_functions import clean_mapped_mecs_energy_fba + fba = clean_mapped_mecs_energy_fba(fba) + fba = update_regions_to_states(fba) + return fba -def update_regions_to_states(fba_load, attr, **_): +def update_regions_to_states(fba: FlowByActivity, **_) -> FlowByActivity: """ Propogates regions to all states to enable for use in state methods. Allocates sectors across states based on employment. clean_allocation_fba_w_sec fxn """ + fba_load = fba.copy() log.info('Updating census regions to states') + region_map = get_region_and_division_codes() region_map = region_map[['Region','State_FIPS']].drop_duplicates() region_map.loc[:, 'State_FIPS'] = ( @@ -485,7 +488,7 @@ def update_regions_to_states(fba_load, attr, **_): if len(x) < 5 else x)) # Allocate MECS based on employment FBS - year = attr.get('allocation_source_year') + year = fba.config.get('year') hlp = flowsa.getFlowBySector(methodname=f'Employment_state_{year}', download_FBS_if_missing=True) @@ -498,10 +501,10 @@ def update_regions_to_states(fba_load, attr, **_): right_on = 'State_FIPS') hlp['Allocation'] = hlp['FlowAmount']/hlp.groupby( ['Region', 'SectorProducedBy']).FlowAmount.transform('sum') - - fba = pd.merge(fba_load.rename(columns={'Location':'Region'}), - (hlp[['Region','Location','SectorProducedBy','Allocation']] - .rename(columns={'SectorProducedBy':'SectorConsumedBy'})), + ## TODO NEED TO ALSO ADJUST GROUP/GROUP TOTALS + fba = pd.merge(fba.rename(columns={'Location':'Region'}), + (hlp[['Region','Location','SectorProducedBy','Allocation']] + .rename(columns={'SectorProducedBy':'SectorConsumedBy'})), how='left', on=['Region','SectorConsumedBy']) fba['FlowAmount'] = fba['FlowAmount'] * fba['Allocation'] fba = fba.drop(columns=['Allocation','Region']) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 68e8a4f36..a240393e2 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -905,6 +905,8 @@ def convert_to_geoscale( :return: FlowBy data set, with rows filtered or aggregated to the target geoscale. ''' + if self.LocationSystem.eq('Census_Region').all(): + return self target_geoscale = target_geoscale or self.config.get('geoscale') if type(target_geoscale) == str: target_geoscale = geo.scale.from_string(target_geoscale) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml index 17873fdcc..b5d06983f 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml @@ -12,17 +12,18 @@ geoscale: state sources_to_cache: EIA_MECS_Energy: year: 2018 - geoscale: national + geoscale: state selection_fields: Class: Energy Unit: Trillion Btu - Location: '00000' Description: - Table 2.2 - Table 3.2 + exclusion_fields: + Location: '00000' estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_mecs_energy clean_fba: !script_function:temp_data_source_functions clean_mecs_energy_fba - clean_fba_w_sec: !script_function:temp_data_source_functions clean_mapped_mecs_energy_fba + clean_fba_w_sec: !script_function:EIA_MECS clean_mapped_mecs_energy_fba_to_state attribution_method: proportional attribution_source: Employment_state_2018: From ea0e9448e7953ab85b62e872a8b8334508599d9c Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 7 Apr 2023 12:31:21 -0600 Subject: [PATCH 0470/1127] add data_format for food waste method datasets --- flowsa/data/source_catalog.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 89324d453..59f181370 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -76,6 +76,7 @@ CalRecycle_WasteCharacterization: activity_schema: sector_hierarchy: "flat" Census_ASM: + data_format: FBA class: - Money sector-like_activities: True @@ -249,6 +250,7 @@ EPA_WARMer: activity_schema: None sector_hierarchy: "flat" EPA_WFR: + data_format: FBA class: - Other sector-like_activities: False From ca3e032c81c382a1bb8c70899034c1425d847e37 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 7 Apr 2023 12:31:50 -0600 Subject: [PATCH 0471/1127] convert thousand USD to USD --- flowsa/data/unit_conversion.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/data/unit_conversion.csv b/flowsa/data/unit_conversion.csv index c332251e1..01daa5993 100644 --- a/flowsa/data/unit_conversion.csv +++ b/flowsa/data/unit_conversion.csv @@ -20,3 +20,4 @@ Trillion Btu,MJ,1055055900 Tbtu,MJ,1055055900 MT CO2e,MMT CO2e,0.000001 employees,p,1 +Thousand USD,USD,1000 From 0c7ca2637e5cf3a18b734717ad9d1f04244d1eee Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 7 Apr 2023 12:32:42 -0600 Subject: [PATCH 0472/1127] convert foodwaste_use() to recursive method --- flowsa/data_source_scripts/EPA_WFR.py | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_WFR.py b/flowsa/data_source_scripts/EPA_WFR.py index b9abccc0d..c841cde05 100644 --- a/flowsa/data_source_scripts/EPA_WFR.py +++ b/flowsa/data_source_scripts/EPA_WFR.py @@ -10,9 +10,9 @@ import numpy as np from string import ascii_uppercase from tabula.io import read_pdf -from flowsa.flowbyfunctions import assign_fips_location_system, aggregator +from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.location import US_FIPS -from flowsa.schema import flow_by_activity_mapped_fields +from flowsa.flowby import FlowByActivity def epa_wfr_call(*, resp, **_): @@ -373,21 +373,20 @@ def return_REI_fraction_foodwaste_treated_commodities(): return pathway_attribution -def foodwaste_use(fba, source_dict): +def foodwaste_use(fba: FlowByActivity) -> FlowByActivity: """ - clean_fba_df_fxn + clean_fba_before_activity_sets Attribute food waste to how waste is used :param fba: :param source_dict: :return: """ - use = source_dict.get('activity_parameters') + use = fba.config.get('activity_parameters') outputs = fba.loc[fba['ActivityConsumedBy'].isin(use)].reset_index(drop=True) outputs['ActivityProducedBy'] = outputs['ActivityConsumedBy'] outputs = outputs.drop(columns='ActivityConsumedBy') - groupcols = list(outputs.select_dtypes(include=['object', 'int']).columns) - outputs2 = aggregator(outputs, groupcols) + outputs2 = outputs.aggregate_flowby() # load fw treatment dictoinary fw_tmt = return_REI_fraction_foodwaste_treated_commodities() @@ -403,22 +402,22 @@ def foodwaste_use(fba, source_dict): .reset_index()) outputs3 = outputs2.merge(fw_tmt, how='left') - outputs3['Flowable'] = outputs3["Flowable"].apply(lambda x: + outputs3['FlowName'] = outputs3['FlowName'].apply(lambda x: f"{x} Treated") # update flowamount with multiplier fractions outputs3['FlowAmount'] = outputs3['FlowAmount'] * outputs3['Multiplier'] outputs3 = outputs3.drop(columns='Multiplier') # also in wasted food report - APB "food banks" are the output from the ACB "Food Donation" - fba['Flowable'] = np.where(fba['ActivityProducedBy'] == 'Food Banks', - fba["Flowable"].apply(lambda x: f"{x} Treated"), fba["Flowable"]) + fba['FlowName'] = np.where(fba['ActivityProducedBy'] == 'Food Banks', + fba["FlowName"].apply( + lambda x: f"{x} Treated"), + fba["FlowName"]) df1 = pd.concat([fba, outputs3], ignore_index=True) - cols = flow_by_activity_mapped_fields.copy() - cols.pop('FlowAmount') - df1 = aggregator(df1, cols) + df2 = df1.aggregate_flowby() - return df1 + return df2 def reset_wfr_APB(fba, **_): """ From d3b4cb2b60c34b974020e675ee18db7542d53d16 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 7 Apr 2023 12:33:22 -0600 Subject: [PATCH 0473/1127] convert food_waste_national_2018_m1 to recursive method - total values do not fully match original method --- .../Food_Waste_national_2018_m1.yaml | 167 ++++++++++-------- 1 file changed, 89 insertions(+), 78 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m1.yaml b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m1.yaml index 35a80d367..5a63d2403 100644 --- a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m1.yaml @@ -1,18 +1,20 @@ # Attribute EPA's Wasted Food Report to sectors using the scoping memo for # attribution methodology -target_sector_level: NAICS_6 -target_subset_sector_level: {NAICS_7: ['562212', '562219']} -target_sector_source: NAICS_2012_Code -target_geoscale: national +industry_spec: + default: NAICS_6 + '562212': { default: NAICS_7 } + '562219': { default: NAICS_7 } +year: 2018 +target_naics_year: 2012 +geoscale: national + source_names: "EPA_WFR": - data_format: 'FBA' - class: Other - geoscale_to_use: national - year: 2018 + selection_fields: + Class: Other # the below function adds in treated waste and uses REI data to proportionally attribute ABP to ACB - clean_fba_df_fxn: !script_function:EPA_WFR foodwaste_use + clean_fba_before_activity_sets: !script_function:EPA_WFR foodwaste_use # use the activity_parameters to attribute treated food waste to sectors activity_parameters: - "Animal Feed" @@ -21,77 +23,86 @@ source_names: - "Composting/Aerobic Processes" activity_sets: direct: - names: - - "Colleges & Universities" - - "Food Banks" - - "K-12 Schools" - - "Military Installations" - - "Residential" - - "Sports Venues" - allocation_method: direct - allocation_from_scale: national + selection_fields: + PrimaryActivity: + - "Colleges & Universities" + - "Food Banks" + - "K-12 Schools" + - "Military Installations" + - "Residential" + - "Sports Venues" + attribution_method: direct employment: - names: - - "Correctional Facilities" - - "Hospitals" - - "Hotels" - - "Nursing Homes" - - "Office Buildings" - - "Restaurants/Food Services" - - "Retail" - allocation_method: proportional - allocation_source: "BLS_QCEW" - allocation_source_class: "Employment" - allocation_source_year: 2018 - allocation_from_scale: national - allocation_fba_load_scale: national - clean_allocation_fba_w_sec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec + selection_fields: + PrimaryActivity: + - "Correctional Facilities" + - "Hospitals" + - "Hotels" + - "Nursing Homes" + - "Office Buildings" + - "Restaurants/Food Services" + - "Retail" + attribution_method: proportional + attribution_source: + Employment_national_2018: + data_format: FBS + year: 2018 establishments: - names: - - "Wholesale" - allocation_method: proportional - allocation_source: "BLS_QCEW" - allocation_source_class: "Other" - allocation_source_year: 2018 - allocation_from_scale: national - allocation_fba_load_scale: national - clean_allocation_fba_w_sec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec + selection_fields: + PrimaryActivity: + - "Wholesale" + attribution_method: proportional + attribution_source: + "BLS_QCEW": + selection_fields: + Class: "Other" + Location: !include:Location_common.yaml:_national_location + estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_sectors_equal_attribution + selection_fields_after_data_suppression_estimation: + FlowName: { + 'Number of establishments, Federal Government': 'Number of establishments', + 'Number of establishments, Local Government': 'Number of establishments', + 'Number of establishments, Private': 'Number of establishments', + 'Number of establishments, State Government': 'Number of establishments' + } # standardize after estimating suppressed manufacturing: - names: - - "Manufacturing/Processing" - allocation_method: proportional - allocation_source: "Census_ASM" - allocation_source_class: "Money" - allocation_source_year: 2018 - allocation_from_scale: national - allocation_fba_load_scale: national + selection_fields: + PrimaryActivity: + - "Manufacturing/Processing" + attribution_method: proportional + attribution_source: + "Census_ASM": + selection_fields: + Class: "Money" treated_waste_direct: - names: - - 'Dog and cat food manufacturing' - - 'Other animal food manufacturing' - - 'Petrochemical manufacturing' - - 'Other basic organic chemical manufacturing' - - 'Soap and cleaning compound manufacturing' - - 'Toilet preparation manufacturing' - - 'Printing ink manufacturing' - - 'Gasoline' - - 'Natural gas' - - 'Pesticide and other agricultural chemical manufacturing' - allocation_method: direct - allocation_from_scale: national + primary_action_type: Consumed + selection_fields: + Activity: + - 'Dog and cat food manufacturing' + - 'Other animal food manufacturing' + - 'Petrochemical manufacturing' + - 'Other basic organic chemical manufacturing' + - 'Soap and cleaning compound manufacturing' + - 'Toilet preparation manufacturing' + - 'Printing ink manufacturing' + - 'Gasoline' + - 'Natural gas' + - 'Pesticide and other agricultural chemical manufacturing' + attribution_method: direct treated_waste_proportional: - names: - - 'Fresh wheat, corn' - - 'Support activities for agriculture and forestry' - - 'Stone mining and quarrying' - - 'Other nonresidential structures' - - 'Wholesale Trade' - - 'Services to buildings and dwellings' - - 'Museums, historical sites, zoos, and parks' - allocation_method: proportional - allocation_source: "BLS_QCEW" - allocation_source_class: "Employment" - allocation_source_year: 2018 - allocation_from_scale: national - allocation_fba_load_scale: national - clean_allocation_fba_w_sec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec + primary_action_type: Consumed + selection_fields: + Activity: + - 'Fresh wheat, corn' + - 'Support activities for agriculture and forestry' + - 'Stone mining and quarrying' + - 'Other nonresidential structures' + - 'Wholesale Trade' + - 'Services to buildings and dwellings' + - 'Museums, historical sites, zoos, and parks' + attribution_method: proportional + attribution_source: + Employment_national_2018: + data_format: FBS + year: 2018 + primary_action_type: Produced From e75c8a12368b481402e8e821149a7ed0e758e35f Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 7 Apr 2023 20:57:41 -0400 Subject: [PATCH 0474/1127] remove deprecated files --- .../NAICS_Crosswalk_EPA_GHGI_m2.csv | 536 ----------- flowsa/data/source_catalog.yaml | 9 - flowsa/data_source_scripts/GHGI2020.py | 850 ------------------ .../flowbyactivitymethods/GHGI2020_3_104.yaml | 41 - .../GHGI_recursive_2016_m1.yaml | 822 ----------------- .../marine_shipping_adjustment.yaml | 2 +- 6 files changed, 1 insertion(+), 2259 deletions(-) delete mode 100644 flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_m2.csv delete mode 100644 flowsa/data_source_scripts/GHGI2020.py delete mode 100644 flowsa/methods/flowbyactivitymethods/GHGI2020_3_104.yaml delete mode 100644 flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_m2.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_m2.csv deleted file mode 100644 index 3a1e77add..000000000 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_m2.csv +++ /dev/null @@ -1,536 +0,0 @@ -ActivitySourceName,Activity,SectorSourceName,Sector,SectorType,Notes,Table -EPA_GHGI,Iron and Steel Production & Metallurgical Coke Production,NAICS_2012_Code,3311,,331110,EPA_GHGI_T_2_1 -EPA_GHGI,Cement Production,NAICS_2012_Code,32731,,327310,EPA_GHGI_T_2_1 -EPA_GHGI,Lime Production,NAICS_2012_Code,3274,,327400,EPA_GHGI_T_2_1 -EPA_GHGI,Ammonia Production,NAICS_2012_Code,32531,,325310,EPA_GHGI_T_2_1 -EPA_GHGI,Incineration of Waste,NAICS_2012_Code,562,,562000,EPA_GHGI_T_2_1 -EPA_GHGI,Aluminum Production,NAICS_2012_Code,331313,,331313,"EPA_GHGI_T_2_1, EPA_GHGI_T_4_80" -EPA_GHGI,Soda Ash Production,NAICS_2012_Code,32519,,325190,EPA_GHGI_T_2_1 -EPA_GHGI,Ferroalloy Production,NAICS_2012_Code,3311,,331110,EPA_GHGI_T_2_1 -EPA_GHGI,Titanium Dioxide Production,NAICS_2012_Code,32519,,325190,EPA_GHGI_T_2_1 -EPA_GHGI,Zinc Production,NAICS_2012_Code,33142,,331420,EPA_GHGI_T_2_1 -EPA_GHGI,Phosphoric Acid Production,NAICS_2012_Code,32531,,325310,EPA_GHGI_T_2_1 -EPA_GHGI,Glass Production,NAICS_2012_Code,3272,,327200,EPA_GHGI_T_2_1 -EPA_GHGI,Carbide Production and Consumption,NAICS_2012_Code,32518,,325180,EPA_GHGI_T_2_1 -EPA_GHGI,Landfills,NAICS_2012_Code,562,,562000,EPA_GHGI_T_2_1 -EPA_GHGI,Urea Consumption for Non-Agricultural Purposes,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_2_1 -EPA_GHGI,Urea Consumption for Non-Agricultural Purposes,NAICS_2012_Code,32,,,EPA_GHGI_T_2_1 -EPA_GHGI,Urea Consumption for Non-Agricultural Purposes,NAICS_2012_Code,33,,,EPA_GHGI_T_2_1 -EPA_GHGI,Other Process Uses of Carbonates,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_2_1 -EPA_GHGI,Other Process Uses of Carbonates,NAICS_2012_Code,32,,,EPA_GHGI_T_2_1 -EPA_GHGI,Other Process Uses of Carbonates,NAICS_2012_Code,33,,,EPA_GHGI_T_2_1 -EPA_GHGI,Lead Production,NAICS_2012_Code,331410,,"331410, 331490",EPA_GHGI_T_2_1 -EPA_GHGI,Lead Production,NAICS_2012_Code,33149,,,EPA_GHGI_T_2_1 -EPA_GHGI,Coal Mining,NAICS_2012_Code,2121,,212100,EPA_GHGI_T_2_1 -EPA_GHGI,Wastewater Treatment,NAICS_2012_Code,2213,,221300,EPA_GHGI_T_2_1 -EPA_GHGI,Abandoned Oil and Gas Wells,NAICS_2012_Code,211,,211000,EPA_GHGI_T_2_1 -EPA_GHGI,Abandoned Underground Coal Mines,NAICS_2012_Code,2121,,212100,EPA_GHGI_T_2_1 -EPA_GHGI,Composting,NAICS_2012_Code,562,,562000,EPA_GHGI_T_2_1 -EPA_GHGI,Nitric Acid Production,NAICS_2012_Code,32531,,325310,EPA_GHGI_T_2_1 -EPA_GHGI,Adipic Acid Production,NAICS_2012_Code,32519,,325190,EPA_GHGI_T_2_1 -EPA_GHGI,N2O from Product Uses,NAICS_2012_Code,621,,"621, 622, 623",EPA_GHGI_T_2_1 -EPA_GHGI,N2O from Product Uses,NAICS_2012_Code,622,,,EPA_GHGI_T_2_1 -EPA_GHGI,N2O from Product Uses,NAICS_2012_Code,623,,,EPA_GHGI_T_2_1 -EPA_GHGI,"Caprolactam, Glyoxal, and Glyoxylic Acid Production",NAICS_2012_Code,32519,,325190,EPA_GHGI_T_2_1 -EPA_GHGI,Electronics Industry,NAICS_2012_Code,334413,,"334413, name change from Semiconductor Manufacture",EPA_GHGI_T_2_1 -EPA_GHGI,Electrical Transmission and Distribution,NAICS_2012_Code,2211,,221100,EPA_GHGI_T_2_1 -EPA_GHGI,Electric Power,NAICS_2012_Code,2211,,"Commodity: 221100 (or I: 221100, S00101, S00202)",EPA_GHGI_T_2_1 -EPA_GHGI,Electric Power,NAICS_2012_Code,S00101,,,EPA_GHGI_T_2_1 -EPA_GHGI,Electric Power,NAICS_2012_Code,S00202,,,EPA_GHGI_T_2_1 -EPA_GHGI,Liming,NAICS_2012_Code,111,,"111, 112",EPA_GHGI_T_2_1 -EPA_GHGI,Liming,NAICS_2012_Code,112,,,EPA_GHGI_T_2_1 -EPA_GHGI,Urea Fertilization,NAICS_2012_Code,111,,"111, 112",EPA_GHGI_T_2_1 -EPA_GHGI,Urea Fertilization,NAICS_2012_Code,112,,,EPA_GHGI_T_2_1 -EPA_GHGI,Rice Cultivation,NAICS_2012_Code,11116,,1111B0,EPA_GHGI_T_2_1 -EPA_GHGI,Anaerobic Digestion at Biogas Facilities,NAICS_2012_Code,562,,new in GHGI since 2018,EPA_GHGI_T_2_1 -EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,111,,"111, 112, 113, 114","EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,112,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,113,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,114,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,485,,"485000, 486000, 48A000, 492000","EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,486,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,487,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,488,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,492,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Construction/Mining Equipment Non-Road,NAICS_2012_Code,211,,"211000, 212100, 2122A0, 212230, 212310, 2123AO, 213111","EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Construction/Mining Equipment Non-Road,NAICS_2012_Code,212,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Construction/Mining Equipment Non-Road,NAICS_2012_Code,213111,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,484,,484000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Other Non-Road,NAICS_2012_Code,485,,"485000, 48A000, 492000, 532100, 532400, 621900, 713900, 811100, 811300","EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Other Non-Road,NAICS_2012_Code,487,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Other Non-Road,NAICS_2012_Code,488,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Other Non-Road,NAICS_2012_Code,492,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Other Non-Road,NAICS_2012_Code,5321,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Other Non-Road,NAICS_2012_Code,5324,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Other Non-Road,NAICS_2012_Code,6219,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Other Non-Road,NAICS_2012_Code,7139,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Other Non-Road,NAICS_2012_Code,8111,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Other Non-Road,NAICS_2012_Code,8113,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Passenger Cars Gasoline On-Road,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Aircraft Non-Road,NAICS_2012_Code,481,,481000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Rail Non-Road,NAICS_2012_Code,482,,482000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Ships and Boats Non-Road,NAICS_2012_Code,483,,483000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Exploration,NAICS_2012_Code,211111,,211000,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42, EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" -EPA_GHGI,Production,NAICS_2012_Code,211111,,211000,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42, EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" -EPA_GHGI,Crude Oil Transportation,NAICS_2012_Code,486110,,not mapped,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42" -EPA_GHGI,Refining,NAICS_2012_Code,324110,,324110,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42" -EPA_GHGI,Distribution,NAICS_2012_Code,221210,,221200,"EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" -EPA_GHGI,Processing,NAICS_2012_Code,211111,,211000,"EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" -EPA_GHGI,Transmission and Storage,NAICS_2012_Code,486210,,486000,"EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" -EPA_GHGI,Chickpeas,NAICS_2012_Code,11113,,1111B0,EPA_GHGI_T_5_29 -EPA_GHGI,Cotton,NAICS_2012_Code,11192,,111900,EPA_GHGI_T_5_29 -EPA_GHGI,Maize,NAICS_2012_Code,11115,,1111B0,EPA_GHGI_T_5_29 -EPA_GHGI,Rice,NAICS_2012_Code,11116,,1111B0,EPA_GHGI_T_5_29 -EPA_GHGI,Soybeans,NAICS_2012_Code,11111,,1111A0,EPA_GHGI_T_5_29 -EPA_GHGI,Wheat,NAICS_2012_Code,11114,,1111B0,EPA_GHGI_T_5_29 -EPA_GHGI,American Bison,NAICS_2012_Code,11299,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" -EPA_GHGI,Beef Cattle,NAICS_2012_Code,11211,,1121A0,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" -EPA_GHGI,Dairy Cattle,NAICS_2012_Code,11212,,112120,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" -EPA_GHGI,Goats,NAICS_2012_Code,11242,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" -EPA_GHGI,Horses,NAICS_2012_Code,11292,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" -EPA_GHGI,Mules and Asses,NAICS_2012_Code,11292,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" -EPA_GHGI,Sheep,NAICS_2012_Code,11241,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" -EPA_GHGI,Swine,NAICS_2012_Code,1122,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" -EPA_GHGI,Poultry,NAICS_2012_Code,1123,,112300,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" -EPA_GHGI,Acrylonitrile,NAICS_2012_Code,325199,,325411 (incorrect in original?),EPA_GHGI_T_4_46 -EPA_GHGI,Carbon Black,NAICS_2012_Code,325180,,3252A0 (incorrect in original?),EPA_GHGI_T_4_46 -EPA_GHGI,Ethylene,NAICS_2012_Code,324110,,324110,EPA_GHGI_T_4_46 -EPA_GHGI,Ethylene Dichloride,NAICS_2012_Code,325120,,not mapped,EPA_GHGI_T_4_46 -EPA_GHGI,Ethylene Oxide,NAICS_2012_Code,325199,,325411 (incorrect in original?),EPA_GHGI_T_4_46 -EPA_GHGI,Methanol,NAICS_2012_Code,325199,,325411 (incorrect in original?),EPA_GHGI_T_4_46 -EPA_GHGI,Industry Industrial Coking Coal,NAICS_2012_Code,212210,,2122A0 (incorrect in original?),EPA_GHGI_T_3_22 -EPA_GHGI,Industry Industrial Other Coal,NAICS_2012_Code,212210,,2122A0 (incorrect in original?),EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Natural Gas to Chemical Plants,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Natural Gas to Chemical Plants,NAICS_2012_Code,32,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Natural Gas to Chemical Plants,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,48,,"48, 491, 492, S00500, S00600, GSLGO, S00201, S00203, F01000",EPA_GHGI_T_3_22 -EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,491,,,EPA_GHGI_T_3_22 -EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,492,,,EPA_GHGI_T_3_22 -EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,92,,,EPA_GHGI_T_3_22 -EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,F01000,,,EPA_GHGI_T_3_22 -EPA_GHGI,Coal Electric Power,NAICS_2012_Code,221112A,,"Commodity: 221100 (or I: 221100, S00101, S00202)","EPA_GHGI_T_3_7, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Electric Power,NAICS_2012_Code,221112C,,"Commodity: 221100 (or I: 221100, S00101, S00202)","EPA_GHGI_T_3_7, EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Electric Power,NAICS_2012_Code,221112B,,"Commodity: 221100 (or I: 221100, S00101, S00202)",EPA_GHGI_T_3_8 -EPA_GHGI,Natural Gas Electric Power,NAICS_2012_Code,221112B,,,"EPA_GHGI_T_3_7, EPA_GHGI_T_3_9" -EPA_GHGI,Geothermal Electric Power,NAICS_2012_Code,221116,,,EPA_GHGI_T_3_7 -EPA_GHGI,Wood Electric Power,NAICS_2012_Code,221117,,"Commodity: 221100 (or I: 221100, S00101, S00202)","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Residential,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural Gas Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23, 31, 32, 33","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Industrial,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Industrial - Manufacturing,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Industrial - Manufacturing,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Industrial - Manufacturing,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Industrial,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Industrial,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Industrial,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Industrial,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,2213,,"2213, 42, 44, 45, 493, 5, 6, 7, 8, S00102, GSLGE, GSLGH","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,493,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,2213,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,493,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,2213,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,493,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Commercial,NAICS_2012_Code,2213,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Commercial,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Commercial,NAICS_2012_Code,493,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Commercial,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Commercial,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Commercial,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Commercial,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Commercial,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Commercial,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Commercial,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Drained Organic Soils Cropland,NAICS_2012_Code,1111,,"111, excl. 1114",EPA_GHGI_T_5_18 -EPA_GHGI,Drained Organic Soils Cropland,NAICS_2012_Code,1112,,,EPA_GHGI_T_5_18 -EPA_GHGI,Drained Organic Soils Cropland,NAICS_2012_Code,1113,,,EPA_GHGI_T_5_18 -EPA_GHGI,Drained Organic Soils Cropland,NAICS_2012_Code,1119,,,EPA_GHGI_T_5_18 -EPA_GHGI,Mineralization and Asymbiotic Fixation Cropland,NAICS_2012_Code,1111,,"111, excl. 1114",EPA_GHGI_T_5_18 -EPA_GHGI,Mineralization and Asymbiotic Fixation Cropland,NAICS_2012_Code,1112,,,EPA_GHGI_T_5_18 -EPA_GHGI,Mineralization and Asymbiotic Fixation Cropland,NAICS_2012_Code,1113,,,EPA_GHGI_T_5_18 -EPA_GHGI,Mineralization and Asymbiotic Fixation Cropland,NAICS_2012_Code,1119,,,EPA_GHGI_T_5_18 -EPA_GHGI,Organic Amendment Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_18 -EPA_GHGI,Residue N Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_18 -EPA_GHGI,Synthetic Fertilizer Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_18 -EPA_GHGI,All activities Grassland,NAICS_2012_Code,112,,112,"EPA_GHGI_T_5_18, EPA_GHGI_T_5_19" -EPA_GHGI,Volatilization & Atm. Deposition Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_19 -EPA_GHGI,Surface Leaching & Run-Off Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_19 -EPA_GHGI,Natural Gas Transportation,NAICS_2012_Code,48,,"48, 491, 492, S00500, S00600, GSLGO, S00201, S00203, F01000",EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 -EPA_GHGI,Aviation Gasoline Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 -EPA_GHGI,Aviation Gasoline Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 -EPA_GHGI,Aviation Gasoline Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 -EPA_GHGI,Aviation Gasoline Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 -EPA_GHGI,Aviation Gasoline Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 -EPA_GHGI,Jet Fuel Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 -EPA_GHGI,Jet Fuel Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 -EPA_GHGI,Jet Fuel Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 -EPA_GHGI,Jet Fuel Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 -EPA_GHGI,Jet Fuel Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 -EPA_GHGI,LPG (Propane) Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 -EPA_GHGI,LPG (Propane) Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 -EPA_GHGI,LPG (Propane) Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 -EPA_GHGI,LPG (Propane) Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 -EPA_GHGI,LPG (Propane) Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 -EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 -EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 -EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 -EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 -EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 -EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23",EPA_GHGI_T_A_14 -EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,21,,,EPA_GHGI_T_A_14 -EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,2212,,,EPA_GHGI_T_A_14 -EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,23,,,EPA_GHGI_T_A_14 -EPA_GHGI,Industrial Other Coal Industrial - Manufacturing,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_A_14 -EPA_GHGI,Industrial Other Coal Industrial - Manufacturing,NAICS_2012_Code,32,,,EPA_GHGI_T_A_14 -EPA_GHGI,Industrial Other Coal Industrial - Manufacturing,NAICS_2012_Code,33,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23",EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,21,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,2212,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,23,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Industrial - Manufacturing,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Industrial - Manufacturing,NAICS_2012_Code,32,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Industrial - Manufacturing,NAICS_2012_Code,33,,,EPA_GHGI_T_A_14 -EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23, 31, 32, 33",EPA_GHGI_T_A_14 -EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,21,,,EPA_GHGI_T_A_14 -EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,2212,,,EPA_GHGI_T_A_14 -EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,23,,,EPA_GHGI_T_A_14 -EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,31,,,EPA_GHGI_T_A_14 -EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,32,,,EPA_GHGI_T_A_14 -EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,33,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,2213,,"2213, 42, 44, 45, 493, 5, 6, 7, 8, S00102, GSLGE, GSLGH",EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,42,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,44,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,45,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,493,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,51,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,52,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,53,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,54,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,55,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,56,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,61,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,62,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,71,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,72,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,81,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,2213,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,42,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,44,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,45,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,493,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,51,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,52,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,53,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,54,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,55,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,56,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,61,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,62,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,71,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,72,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,81,,,EPA_GHGI_T_A_14 -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,2213,,,EPA_GHGI_T_A_14 -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,42,,,EPA_GHGI_T_A_14 -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,44,,,EPA_GHGI_T_A_14 -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,45,,,EPA_GHGI_T_A_14 -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,493,,,EPA_GHGI_T_A_14 -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,51,,,EPA_GHGI_T_A_14 -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,52,,,EPA_GHGI_T_A_14 -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,53,,,EPA_GHGI_T_A_14 -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,54,,,EPA_GHGI_T_A_14 -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,55,,,EPA_GHGI_T_A_14 -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,56,,,EPA_GHGI_T_A_14 -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,61,,,EPA_GHGI_T_A_14 -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,62,,,EPA_GHGI_T_A_14 -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,71,,,EPA_GHGI_T_A_14 -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,72,,,EPA_GHGI_T_A_14 -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,81,,,EPA_GHGI_T_A_14 -EPA_GHGI,Total (All Fuels) Residential,NAICS_2012_Code,F01000,,F0100,EPA_GHGI_T_A_14 -EPA_GHGI,HCFC-22 Production,NAICS_2012_Code,325120,,325120,EPA_GHGI_T_4_50 -EPA_GHGI,Electronics Production,NAICS_2012_Code,334413,,334413,EPA_GHGI_T_4_94 -EPA_GHGI,Magnesium Production and Processing,NAICS_2012_Code,331410,,"331410, 331490, 331520",EPA_GHGI_T_4_84 -EPA_GHGI,Magnesium Production and Processing,NAICS_2012_Code,33149,,,EPA_GHGI_T_4_84 -EPA_GHGI,Magnesium Production and Processing,NAICS_2012_Code,33152,,,EPA_GHGI_T_4_84 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,11,,"All sectors, excluding transport",EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,21,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,22,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,23,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,31,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,32,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,33,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,42,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,44,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,45,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,49,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,51,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,52,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,53,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,54,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,55,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,56,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,61,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,62,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,71,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,72,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,81,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,92,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,F01000,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning - Households,NAICS_2012_Code,F01000,,Exclusive household portion,EPA_GHGI_T_4_101 -EPA_GHGI,Aerosols,,,,excluded,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,11,,All sectors,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,21,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,22,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,23,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,31,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,32,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,33,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,42,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,44,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,45,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,48,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,49,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,51,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,52,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,53,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,54,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,55,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,56,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,61,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,62,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,71,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,72,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,81,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,92,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,F01000,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,11,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,21,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,22,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,23,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,31,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,32,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,33,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,42,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,44,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,45,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,48,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,49,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,51,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,52,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,53,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,54,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,55,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,56,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,61,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,62,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,71,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,72,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,81,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,92,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,F01000,,,EPA_GHGI_T_4_101 -EPA_GHGI,Solvents,,,,excluded,EPA_GHGI_T_4_101 -EPA_GHGI,Fire Protection,,,,excluded,EPA_GHGI_T_4_101 -EPA_GHGI,Mobile AC - Heavy-Duty Vehicles,NAICS_2012_Code,484,,484000,EPA_GHGI_T_A_103 -EPA_GHGI,Mobile AC - Light-Duty Trucks,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_103 -EPA_GHGI,Refrigerated Transport - Medium- and Heavy-Duty Trucks,NAICS_2012_Code,484,,484000,EPA_GHGI_T_A_103 -EPA_GHGI,Mobile AC - Passenger Cars,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_103 -EPA_GHGI,Comfort Cooling for Trains and Buses - Rail,NAICS_2012_Code,482,,482000,EPA_GHGI_T_A_103 -EPA_GHGI,Refrigerated Transport - Rail,NAICS_2012_Code,482,,482000,EPA_GHGI_T_A_103 -EPA_GHGI,Comfort Cooling for Trains and Buses - School and Tour Buses,NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_103 -EPA_GHGI,Refrigerated Transport - Ships and Boats,NAICS_2012_Code,483,,483000,EPA_GHGI_T_A_103 -EPA_GHGI,Comfort Cooling for Trains and Buses - Transit Buses,,,,excluded,EPA_GHGI_T_A_103 -EPA_GHGI,Buses,NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_79 -EPA_GHGI,Buses - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_79 -EPA_GHGI,Buses - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,487,,48A000,EPA_GHGI_T_A_79 -EPA_GHGI,Buses - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,488,,,EPA_GHGI_T_A_79 -EPA_GHGI,Buses - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,S00201,,S00201,EPA_GHGI_T_A_79 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,481,,481000,EPA_GHGI_T_A_79 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,481,,481000,EPA_GHGI_T_A_79 -EPA_GHGI,Military Aircraft,NAICS_2012_Code,928110,,S00500,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks - Gasoline,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks - Gasoline,NAICS_2012_Code,492,,492000,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,484,,484000,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,484,,484000,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,92212,,S00203,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,92214,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,92216,,,EPA_GHGI_T_A_79 -EPA_GHGI,Motorcycles,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 -EPA_GHGI,Passenger Cars,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 -EPA_GHGI,Passenger Cars - Gasoline,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 -EPA_GHGI,Passenger Cars - Gasoline,NAICS_2012_Code,92,,S00600,EPA_GHGI_T_A_79 -EPA_GHGI,Passenger Cars - Gasoline,NAICS_2012_Code,491,,491000,EPA_GHGI_T_A_79 -EPA_GHGI,Passenger Cars - Gasoline,NAICS_2012_Code,92,,GSLGO,EPA_GHGI_T_A_79 -EPA_GHGI,Pipelines,NAICS_2012_Code,486,,486000,EPA_GHGI_T_A_79 -EPA_GHGI,Rail,NAICS_2012_Code,482,,482000,EPA_GHGI_T_A_79 -EPA_GHGI,Recreational Boats,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,4831,,483000,EPA_GHGI_T_A_79 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,4832,,4-digit to avoid data loss in BLS_QCEW,EPA_GHGI_T_A_79 -EPA_GHGI,Ships and Non-Recreational Boats,NAICS_2012_Code,483,,483000,EPA_GHGI_T_A_79 diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 1b703b97f..87a5fa265 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -188,15 +188,6 @@ EPA_GHGI: sector-like_activities: False activity_schema: sector_hierarchy: "flat" -GHGI2020: - data_format: FBA - class: - - Chemicals - - Energy - - Other - sector-like_activities: False - activity_schema: - sector_hierarchy: "flat" EPA_REI: class: - Employment diff --git a/flowsa/data_source_scripts/GHGI2020.py b/flowsa/data_source_scripts/GHGI2020.py deleted file mode 100644 index c8627c533..000000000 --- a/flowsa/data_source_scripts/GHGI2020.py +++ /dev/null @@ -1,850 +0,0 @@ -# EPA_GHGI.py (flowsa) -# !/usr/bin/env python3 -# coding=utf-8 -""" -Inventory of US EPA GHG -https://www.epa.gov/ghgemissions/inventory-us-greenhouse-gas-emissions-and-sinks -""" - -import io -import zipfile -import numpy as np -import pandas as pd -from flowsa.flowbyfunctions import assign_fips_location_system, \ - load_fba_w_standardized_units -from flowsa.dataclean import replace_NoneType_with_empty_cells -from flowsa.settings import log, externaldatapath -from flowsa.schema import flow_by_activity_fields -from flowsa.common import load_yaml_dict -from flowsa.data_source_scripts import EIA_MECS - - -SECTOR_DICT = {'Res.': 'Residential', - 'Comm.': 'Commercial', - 'Ind.': 'Industrial', - 'Trans.': 'Transportation', - 'Elec.': 'Electricity Power', - 'Terr.': 'U.S. Territory'} - -ANNEX_HEADERS = {"Total Consumption (TBtu) a": "Total Consumption (TBtu)", - "Adjustments (TBtu) b": "Adjustments (TBtu)", - "Adjusted Consumption (TBtu) a": "Adjusted Consumption (TBtu)", - "Emissions b (MMT CO2 Eq.) from Energy Use": - "Emissions (MMT CO2 Eq.) from Energy Use" - } - -# Tables for annual CO2 emissions from fossil fuel combustion -ANNEX_ENERGY_TABLES = ["A-10", "A-11", "A-12", "A-13", "A-14", "A-15", "A-16", - "A-17", "A-18", "A-19", "A-20"] - -SPECIAL_FORMAT = ["3-10", "3-22", "3-22b", "4-46", "5-29", - "A-93", "A-94", "A-118", ] - - -DROP_COLS = ["Unnamed: 0"] + list(pd.date_range( - start="1990", end="2010", freq='Y').year.astype(str)) - -YEARS = list(pd.date_range(start="2010", end="2020", freq='Y').year.astype(str)) - - -def ghg_url_helper(*, build_url, config, **_): - """ - This helper function uses the "build_url" input from flowbyactivity.py, - which is a base url for data imports that requires parts of the url text - string to be replaced with info specific to the data year. This function - does not parse the data, only modifies the urls from which data is - obtained. - :param build_url: string, base url - :param config: dictionary, items in FBA method yaml - :return: list, urls to call, concat, parse, format into Flow-By-Activity - format - """ - annex_url = config['url']['annex_url'] - return [build_url] - - -def cell_get_name(value, default_flow_name): - """ - Given a single string value (cell), separate the name and units. - :param value: str - :param default_flow_name: indicate return flow name string subset - :return: flow name for row - """ - if '(' not in value: - return default_flow_name.replace('__type__', value.strip()) - - spl = value.split(' ') - name = '' - found_units = False - for sub in spl: - if '(' not in sub and not found_units: - name = f'{name.strip()} {sub}' - else: - found_units = True - return name.strip() - - -def cell_get_units(value, default_units): - """ - Given a single string value (cell), separate the name and units. - :param value: str - :param default_units: indicate return units string subset - :return: unit for row - """ - if '(' not in value: - return default_units - - spl = value.split(' ') - name = '' - found_units = False - for sub in spl: - if ')' in sub: - found_units = False - if '(' in sub or found_units: - name = f'{name} {sub.replace("(", "").replace(")", "")} ' - found_units = True - return name.strip() - - -def series_separate_name_and_units(series, default_flow_name, default_units): - """ - Given a series (such as a df column), split the contents' strings into a name and units. - An example might be converting "Carbon Stored (MMT C)" into ["Carbon Stored", "MMT C"]. - - :param series: df column - :param default_flow_name: df column for flow name to be modified - :param default_units: df column for units to be modified - :return: str, flowname and units for each row in df - """ - names = series.apply(lambda x: cell_get_name(x, default_flow_name)) - units = series.apply(lambda x: cell_get_units(x, default_units)) - return {'names': names, 'units': units} - - -def annex_yearly_tables(data, table=None): - """Special handling of ANNEX Energy Tables""" - df = pd.read_csv(data, skiprows=1, encoding="ISO-8859-1", - header=[0, 1], thousands=",") - if table == "A-10": - # Extra row to drop in this table - df = df.drop([0]) - header_name = "" - newcols = [] # empty list to have new column names - for i in range(len(df.columns)): - fuel_type = str(df.iloc[0, i]) - for abbrev, full_name in SECTOR_DICT.items(): - fuel_type = fuel_type.replace(abbrev, full_name) - fuel_type = fuel_type.strip() - - col_name = df.columns[i][1] - if "Unnamed" in col_name: - column_name = header_name - elif col_name in ANNEX_HEADERS.keys(): - column_name = ANNEX_HEADERS[col_name] - header_name = ANNEX_HEADERS[col_name] - - newcols.append(f"{column_name} - {fuel_type}") - df.columns = newcols # assign column names - df = df.iloc[1:, :] # exclude first row - df.dropna(how='all', inplace=True) - df = df.reset_index(drop=True) - return df - - -def ghg_call(*, resp, url, year, config, **_): - """ - Convert response for calling url to pandas dataframe, begin parsing df - into FBA format - :param resp: df, response from url call - :param url: string, url - :param year: year - :param config: dictionary, items in FBA method yaml - :return: pandas dataframe of original source data - """ - df = None - with zipfile.ZipFile(io.BytesIO(resp.content), "r") as f: - frames = [] - if 'Annex' in url: - is_annex = True - t_tables = config['Annex'] - else: - is_annex = False - t_tables = config['Tables'] - for chapter, tables in t_tables.items(): - for table in tables: - tbl_year = tables[table].get('year') - if tbl_year is not None and tbl_year != year: - # Skip tables when the year does not align with target year - continue - - if is_annex: - path = f"Annex/{chapter}/Table {table}.csv" - else: - path = f"Chapter Tables/{chapter}/Table {table}.csv" - - # Handle special case of table 3-22 in external data folder - if table == "3-22b": - if str(year) == '2019': - # Skip 3-22b for year 2019 (use 3-22 instead) - continue - else: - df = pd.read_csv(f"{externaldatapath}/GHGI_Table_{table}.csv", - skiprows=2, encoding="ISO-8859-1", thousands=",") - else: - data = f.open(path) - - if table not in SPECIAL_FORMAT + ANNEX_ENERGY_TABLES: - # Default case - df = pd.read_csv(data, skiprows=2, encoding="ISO-8859-1", - thousands=",") - elif table in ['3-10', '4-46', '5-29', - 'A-93', 'A-94', 'A-118']: - # Skip single row - df = pd.read_csv(data, skiprows=1, encoding="ISO-8859-1", - thousands=",", decimal=".") - elif table == "3-22": - # Skip first two rows, as usual, but make headers the next 3 rows: - df = pd.read_csv(data, skiprows=2, encoding="ISO-8859-1", - header=[0, 1, 2], thousands=",") - # The next two rows are headers and the third is units: - new_headers = [] - for col in df.columns: - # unit = col[2] - new_header = 'Unnamed: 0' - if 'Unnamed' not in col[0]: - if 'Unnamed' not in col[1]: - new_header = f'{col[0]} {col[1]}' - else: - new_header = col[0] - if 'Unnamed' not in col[2]: - new_header += f' {col[2]}' - # unit = col[2] - elif 'Unnamed' in col[0] and 'Unnamed' not in col[2]: - new_header = col[2] - new_headers.append(new_header) - df.columns = new_headers - elif table in ANNEX_ENERGY_TABLES: - df = annex_yearly_tables(data, table) - - if df is not None and len(df.columns) > 1: - years = YEARS.copy() - years.remove(str(year)) - df = df.drop(columns=(DROP_COLS + years), errors='ignore') - df["SourceName"] = f"GHGI2020_{table.replace('-', '_')}" - frames.append(df) - else: - log.warning(f"Error in generating {table}") - return frames - - -def get_unnamed_cols(df): - """ - Get a list of all unnamed columns, used to drop them. - :param df: df being formatted - :return: list, unnamed columns - """ - return [col for col in df.columns if "Unnamed" in col] - - -def get_table_meta(source_name, config): - """Find and return table meta from source_name.""" - if "_A_" in source_name: - td = config['Annex'] - else: - td = config['Tables'] - for chapter in td.keys(): - for k, v in td[chapter].items(): - if source_name.endswith(k.replace("-", "_")): - return v - -def is_consumption(source_name, config): - """ - Determine whether the given source contains consumption or production data. - :param source_name: df - :return: True or False - """ - if 'consum' in get_table_meta(source_name, config)['desc'].lower(): - return True - return False - -def strip_char(text): - """ - Removes the footnote chars from the text - """ - text = text + " " - notes = [" a ", " b ", " c ", " d ", " e ", " f ", " g ", - " h ", " i ", " j ", " k ", " b,c ", " h,i ", " f,g "] - for i in notes: - if i in text: - text_split = text.split(i) - text = text_split[0] - return text.strip() - - -def ghg_parse(*, df_list, year, config, **_): - """ - Combine, parse, and format the provided dataframes - :param df_list: list of dataframes to concat and format - :param year: year - :param config: dictionary, items in FBA method yaml - :return: df, parsed and partially formatted to flowbyactivity - specifications - """ - cleaned_list = [] - for df in df_list: - source_name = df["SourceName"][0] - table_name = source_name.replace("GHGI2020_", "").replace('_', '-') - log.info(f'Processing {source_name}') - - # Specify to ignore errors in case one of the drop_cols is missing. - df = df.drop(columns=get_unnamed_cols(df), errors='ignore') - is_cons = is_consumption(source_name, config) - - # Rename to "ActivityProducedBy" or "ActivityConsumedBy": - if is_cons: - df = df.rename(columns={df.columns[0]: "ActivityConsumedBy"}) - df["ActivityProducedBy"] = 'None' - else: - df = df.rename(columns={df.columns[0]: "ActivityProducedBy"}) - df["ActivityConsumedBy"] = 'None' - - df["FlowType"] = "ELEMENTARY_FLOW" - df["Location"] = "00000" - - id_vars = ["SourceName", "ActivityConsumedBy", "ActivityProducedBy", - "FlowType", "Location"] - - df.set_index(id_vars) - - meta = get_table_meta(source_name, config) - - if table_name in ['3-22']: - df = df.melt(id_vars=id_vars, - var_name=meta.get('melt_var'), - value_name="FlowAmount") - df = df.rename(columns={"ActivityConsumedBy": "ActivityProducedBy", - "ActivityProducedBy": "ActivityConsumedBy"}) - name_unit = series_separate_name_and_units(df['FlowName'], - meta['activity'], - meta['unit']) - df['FlowName'] = name_unit['names'] - df['Unit'] = name_unit['units'] - df['Year'] = year - - elif table_name in ['4-14', '4-33', '4-50', '4-80']: - # When Year is the first column in the table, need to make this correction - df = df.rename(columns={'ActivityProducedBy': 'Year', - 'Year': 'ActivityProducedBy'}) - # Melt on custom defined variable - melt_var = meta.get('melt_var') - if melt_var in id_vars: - id_vars.remove(melt_var) - elif 'ActivityProducedBy' not in df: - df["ActivityProducedBy"] = 'None' - id_vars.append('Year') - df = df.melt(id_vars=id_vars, var_name=melt_var, - value_name="FlowAmount") - - elif table_name in ANNEX_ENERGY_TABLES: - df = df.melt(id_vars=id_vars, var_name="FlowName", - value_name="FlowAmount") - df["Year"] = year - for index, row in df.iterrows(): - col_name = row['FlowName'] - acb = row['ActivityConsumedBy'].strip() - name_split = col_name.split(" (") - source = name_split[1].split('- ')[1] - # Append column name after dash to activity - activity = f"{acb.strip()} {name_split[1].split('- ')[1]}" - - df.loc[index, 'Description'] = meta['desc'] - if name_split[0] == "Emissions": - df.loc[index, 'FlowName'] = meta['emission'] - df.loc[index, 'Unit'] = meta['emission_unit'] - df.loc[index, 'Class'] = meta['emission_class'] - df.loc[index, 'Compartment'] = meta['emission_compartment'] - df.loc[index, 'ActivityProducedBy'] = activity - df.loc[index, 'ActivityConsumedBy'] = "None" - else: # "Consumption" - df.loc[index, 'FlowName'] = acb - df.loc[index, 'FlowType'] = "TECHNOSPHERE_FLOW" - df.loc[index, 'Unit'] = meta['unit'] - df.loc[index, 'Class'] = meta['class'] - df.loc[index, 'ActivityProducedBy'] = "None" - df.loc[index, 'ActivityConsumedBy'] = source - - else: - # Standard years (one or more) as column headers - df = df.melt(id_vars=id_vars, var_name="Year", - value_name="FlowAmount") - - - # Dropping all rows with value "+": represents non-zero value - df["FlowAmount"].replace("\+", np.nan, inplace=True, regex=True) - # Dropping all rows with value "NE" - df["FlowAmount"].replace("NE", np.nan, inplace=True) - # Convert all empty cells to nan cells - df["FlowAmount"].replace("", np.nan, inplace=True) - # Table 3-10 has some NO (Not Occuring) values, dropping these. - df["FlowAmount"].replace("NO", np.nan, inplace=True) - # Table A-118 has some IE values, dropping these. - df["FlowAmount"].replace("IE", np.nan, inplace=True) - df["FlowAmount"].replace(r'NO ', np.nan, inplace=True) - - # Drop any nan rows - df.dropna(subset=['FlowAmount'], inplace=True) - - if table_name not in ANNEX_ENERGY_TABLES: - if 'Unit' not in df: - df.loc[df["SourceName"] == source_name, "Unit"] = meta.get("unit") - if 'FlowName' not in df: - df.loc[df["SourceName"] == source_name, "FlowName"] = meta.get("flow") - - df.loc[df["SourceName"] == source_name, "Class"] = meta.get("class") - df.loc[df["SourceName"] == source_name, "Description"] = meta.get("desc") - df.loc[df["SourceName"] == source_name, "Compartment"] = meta.get("compartment") - - if 'Year' not in df.columns: - df['Year'] = year - else: - df = df[df['Year'].astype(str).isin([year])] - - # Add DQ scores - df["DataReliability"] = 5 # tmp - df["DataCollection"] = 5 # tmp - # Fill in the rest of the Flow by fields so they show "None" instead of nan - df["MeasureofSpread"] = 'None' - df["DistributionType"] = 'None' - df["LocationSystem"] = 'None' - df = assign_fips_location_system(df, str(year)) - - # modified_activity_list = ["ES-5"] - multi_chem_names = ["2-1", "3-104", "4-46", "5-7", "5-29", "ES-5"] - source_No_activity = ["3-22", "3-22b"] - # Handle tables with 1 parent level category - source_activity_1 = ["3-7", "3-8", "3-9", "3-10", "3-14", "3-15", - "5-18", "5-19", "A-76", "A-77"] - # Tables with sub categories - source_activity_2 = ["3-38", "3-63", "A-103"] - - if table_name in multi_chem_names: - bool_apb = False - apbe_value = "" - flow_name_list = ["CO2", "CH4", "N2O", "NF3", "HFCs", "PFCs", - "SF6", "NF3", "CH4 a", "N2O b", "CO", "NOx"] - for index, row in df.iterrows(): - apb_value = row["ActivityProducedBy"] - if "CH4" in apb_value: - apb_value = "CH4" - elif "N2O" in apb_value and apb_value != "N2O from Product Uses": - apb_value = "N2O" - elif "CO2" in apb_value: - apb_value = "CO2" - - if apb_value in flow_name_list: - apbe_value = apb_value - df.loc[index, 'FlowName'] = apbe_value - df.loc[index, 'ActivityProducedBy'] = "All activities" - bool_apb = True - elif apb_value.startswith('LULUCF'): - df.loc[index, 'FlowName'] = 'CO2e' - df.loc[index, 'ActivityProducedBy'] = strip_char(apb_value) - elif apb_value.startswith('Total'): - df = df.drop(index) - else: - apb_txt = df.loc[index, 'ActivityProducedBy'] - apb_txt = strip_char(apb_txt) - df.loc[index, 'ActivityProducedBy'] = apb_txt - if bool_apb == True: - df.loc[index, 'FlowName'] = apbe_value - - elif table_name in source_No_activity: - apbe_value = "" - flow_name_list = ["Industry", "Transportation", "U.S. Territories"] - for index, row in df.iterrows(): - unit = row["Unit"] - if unit.strip() == "MMT CO2": - df.loc[index, 'Unit'] = "MMT CO2e" - if df.loc[index, 'Unit'] != "MMT CO2e": - df = df.drop(index) - else: - df.loc[index, 'FlowName'] = meta.get('flow') - # use .join and split to remove interior spaces - apb_value = " ".join(row["ActivityProducedBy"].split()) - apb_value = apb_value.replace("°", "") - if apb_value in flow_name_list: - # set header - apbe_value = apb_value - df.loc[index, 'ActivityProducedBy' - ] = f"{apbe_value} All activities" - else: - # apply header - apb_txt = strip_char(apb_value) - df.loc[index, 'ActivityProducedBy' - ] = f"{apbe_value} {apb_txt}" - if "Total" == apb_value or "Total " == apb_value: - df = df.drop(index) - - elif table_name in source_activity_1: - apbe_value = "" - activity_subtotal = ["Electric Power", "Industrial", "Commercial", - "Residential", "U.S. Territories", - "Transportation", - "Fuel Type/Vehicle Type", "Diesel On-Road", - "Alternative Fuel On-Road", "Non-Road", - "Gasoline On-Road", "Exploration", - "Production (Total)", "Refining", - "Crude Oil Transportation", - "Cropland", "Grassland"] - for index, row in df.iterrows(): - apb_value = strip_char(row["ActivityProducedBy"]) - if apb_value in activity_subtotal: - # set the header - apbe_value = apb_value - df.loc[index, 'ActivityProducedBy' - ] = f"All activities {apbe_value}" - else: - # apply the header - apb_txt = apb_value - if table_name == "3-10": - # Separate Flows and activities for this table - df.loc[index, 'ActivityProducedBy'] = apbe_value - df.loc[index, 'FlowName'] = apb_txt - else: - df.loc[index, 'ActivityProducedBy' - ] = f"{apb_txt} {apbe_value}" - if apb_value.startswith("Total"): - df = df.drop(index) - - elif table_name in source_activity_2: - bool_apb = False - apbe_value = "" - flow_name_list = ["Explorationb", "Production", "Processing", - "Transmission and Storage", "Distribution", - "Crude Oil Transportation", "Refining", - "Exploration", "Mobile AC", - "Refrigerated Transport", - "Comfort Cooling for Trains and Buses"] - for index, row in df.iterrows(): - apb_value = row["ActivityProducedBy"] - start_activity = row["FlowName"] - if apb_value.strip() in flow_name_list: - apbe_value = apb_value - if apbe_value == "Explorationb": - apbe_value = "Exploration" - df.loc[index, 'FlowName'] = start_activity - df.loc[index, 'ActivityProducedBy'] = apbe_value - bool_apb = True - else: - if bool_apb == True: - df.loc[index, 'FlowName'] = start_activity - apb_txt = df.loc[index, 'ActivityProducedBy'] - apb_txt = strip_char(apb_txt) - if apb_txt == "Gathering and Boostingc": - apb_txt = "Gathering and Boosting" - df.loc[index, 'ActivityProducedBy' - ] = f"{apbe_value} - {apb_txt}" - else: - apb_txt = df.loc[index, 'ActivityProducedBy'] - apb_txt = strip_char(apb_txt) - df.loc[index, 'ActivityProducedBy' - ] = f"{apb_txt} {apbe_value}" - if "Total" == apb_value or "Total " == apb_value: - df = df.drop(index) - - elif table_name == "A-79": - fuel_name = "" - A_79_unit_dict = {'Natural Gas': 'trillion cubic feet', - 'Electricity': 'million kilowatt-hours'} - df.loc[:, 'FlowType'] = 'TECHNOSPHERE_FLOW' - for index, row in df.iterrows(): - if row["ActivityConsumedBy"].startswith(' '): - # indicates subcategory - df.loc[index, 'ActivityConsumedBy'] = strip_char( - df.loc[index, 'ActivityConsumedBy']) - df.loc[index, 'FlowName'] = fuel_name - else: - # fuel header - fuel_name = df.loc[index, 'ActivityConsumedBy'] - fuel_name = strip_char(fuel_name) - df.loc[index, 'ActivityConsumedBy'] = "All activities" - df.loc[index, 'FlowName'] = fuel_name - if fuel_name in A_79_unit_dict.keys(): - df.loc[index, 'Unit'] = A_79_unit_dict[fuel_name] - - else: - if table_name in ["4-48"]: - # Assign activity as flow for technosphere flows - df.loc[:, 'FlowType'] = 'TECHNOSPHERE_FLOW' - df.loc[:, 'FlowName'] = df.loc[:, 'ActivityProducedBy'] - - elif table_name in ["4-84", "4-94", "4-99"]: - # Table with flow names as Rows - df.loc[:, 'FlowName'] = df.loc[:, 'ActivityProducedBy'] - df.loc[:, 'ActivityProducedBy'] = meta.get('activity') - - elif table_name in ["4-33", "4-50", "4-80"]: - # Table with units or flows as columns - df.loc[:, 'ActivityProducedBy'] = meta.get('activity') - df.loc[df['Unit'] == 'MMT CO2 Eq.', 'Unit'] = 'MMT CO2e' - df.loc[df['Unit'].str.contains('kt'), 'Unit'] = 'kt' - - elif table_name in ["4-14", "4-99"]: - # Remove notes from activity names - for index, row in df.iterrows(): - apb_value = strip_char(row["ActivityProducedBy"]) - if "(" in apb_value: - text_split = apb_value.split("(") - df.loc[index, 'ActivityProducedBy'] = text_split[0] - - elif table_name in ["A-101"]: - for index, row in df.iterrows(): - apb_value = strip_char(row["ActivityProducedBy"]) - df.loc[index, 'ActivityProducedBy'] = apb_value - - else: - for index, row in df.iterrows(): - if "CO2" in row['Unit']: - if table_name in ["3-42", "3-67"]: - df.loc[index, 'Unit'] = df.loc[index, 'Unit'] - else: - df.loc[index, 'Unit'] = "MMT CO2e" - - df['ActivityProducedBy'] = df['ActivityProducedBy'].str.strip() - df['ActivityConsumedBy'] = df['ActivityConsumedBy'].str.strip() - print(df.FlowName.unique()) - df['FlowName'] = df['FlowName'].str.strip() - - # Update location for terriory-based activities - df.loc[(df['ActivityProducedBy'].str.contains("U.S. Territor")) | - (df['ActivityConsumedBy'].str.contains("U.S. Territor")), - 'Location'] = "99000" - - df.drop(df.loc[df['ActivityProducedBy'] == "Total"].index, inplace=True) - df.drop(df.loc[df['FlowName'] == "Total"].index, inplace=True) - - df = df.loc[:, ~df.columns.duplicated()] - # Remove commas from numbers again in case any were missed: - df["FlowAmount"].replace(',', '', regex=True, inplace=True) - cleaned_list.append(df) - - return cleaned_list - - -def get_manufacturing_energy_ratios(year): - """Calculate energy ratio by fuel between GHGI and EIA MECS.""" - # flow correspondence between GHGI and MECS - flow_corr = {'Industrial Other Coal': 'Coal', - 'Natural Gas': 'Natural Gas', - } - - def closest_value(input_list, input_value): - difference = lambda input_list : abs(input_list - input_value) - return min(input_list, key=difference) - - mecs_year = closest_value(load_yaml_dict('EIA_MECS_Energy', - flowbytype='FBA').get('years'), - year) - - # Filter MECS for total national energy consumption for manufacturing sectors - mecs = load_fba_w_standardized_units(datasource='EIA_MECS_Energy', - year=mecs_year, - flowclass='Energy') - mecs = mecs.loc[(mecs['ActivityConsumedBy'] == '31-33') & - (mecs['Location'] == '00000') & - (mecs['Unit'] == 'MJ')].reset_index(drop=True) - - # Identify the GHGI table that matches EIA_MECS - for t, v in (load_yaml_dict('EPA_GHGI', 'FBA') - .get('Annex').get('Annex').items()): - if ((v.get('class') == 'Energy') - & ('Energy Consumption Data' in v.get('desc')) - & (v.get('year') == str(mecs_year))): - table = f"EPA_GHGI_T_{t.replace('-', '_')}" - break - else: - log.error('unable to identify corresponding GHGI table') - - ghgi = load_fba_w_standardized_units(datasource=table, - year=mecs_year, - flowclass='Energy') - ghgi = ghgi[ghgi['ActivityConsumedBy']=='Industrial'].reset_index(drop=True) - - pct_dict = {} - for ghgi_flow, mecs_flow in flow_corr.items(): - # Calculate percent energy contribution from MECS based on v - mecs_energy = mecs.loc[mecs['FlowName'] == mecs_flow, 'FlowAmount'].values[0] - ghgi_energy = ghgi.loc[ghgi['FlowName'] == ghgi_flow, 'FlowAmount'].values[0] - pct = np.minimum(mecs_energy / ghgi_energy, 1) - pct_dict[mecs_flow] = pct - - return pct_dict - - -def allocate_industrial_combustion(fba, *_, **__): - """ - Split industrial combustion emissions into two buckets to be further allocated. - - clean_fba_df_fxn. Calculate the percentage of fuel consumption captured in - EIA MECS relative to EPA GHGI. Create new activities to distinguish those - which use EIA MECS as allocation source and those that use alternate source. - """ - year = fba.config.get('year') or __['source_dict']['year'] - pct_dict = get_manufacturing_energy_ratios(year) - - # activities reflect flows in A_14 and 3_8 and 3_9 - activities_to_split = {'Industrial Other Coal Industrial': 'Coal', - 'Natural Gas Industrial': 'Natural Gas', - 'Coal Industrial': 'Coal', - 'Natural gas industrial': 'Natural Gas'} - - for activity, fuel in activities_to_split.items(): - df_subset = fba.loc[fba['ActivityProducedBy'] == activity].reset_index(drop=True) - if len(df_subset) == 0: - continue - df_subset['FlowAmount'] = df_subset['FlowAmount'] * pct_dict[fuel] - df_subset['ActivityProducedBy'] = f"{activity} - Manufacturing" - fba.loc[fba['ActivityProducedBy'] == activity, - 'FlowAmount'] = fba['FlowAmount'] * (1-pct_dict[fuel]) - fba = pd.concat([fba, df_subset], ignore_index=True) - - return fba - - -def split_HFCs_by_type(fba, **_): - """Speciates HFCs and PFCs for all activities based on T_4_99. - clean_fba_before_mapping_df_fxn""" - splits = load_fba_w_standardized_units(datasource='EPA_GHGI_T_4_99', - year=fba['Year'][0]) - splits['pct'] = splits['FlowAmount'] / splits['FlowAmount'].sum() - splits = splits[['FlowName', 'pct']] - - speciated_df = fba.apply(lambda x: [p * x['FlowAmount'] for p in splits['pct']], - axis=1, result_type='expand') - speciated_df.columns = splits['FlowName'] - speciated_df = pd.concat([fba, speciated_df], axis=1) - speciated_df = speciated_df.melt(id_vars=flow_by_activity_fields.keys(), - var_name='Flow') - speciated_df['FlowName'] = speciated_df['Flow'] - speciated_df['FlowAmount'] = speciated_df['value'] - speciated_df.drop(columns=['Flow', 'value'], inplace=True) - - return speciated_df - - -def subtract_HFC_transport_emissions(df): - """Remove the portion of transportation emissions which are sourced elsewhere.""" - transport_df = load_fba_w_standardized_units(datasource='EPA_GHGI_T_A_103', - year=df['Year'][0]) - activity_list = ['Mobile AC', 'Comfort Cooling for Trains and Buses', - 'Refrigerated Transport'] # Total of all sub categories - transport_df = transport_df[transport_df['ActivityProducedBy'].isin(activity_list)] - df.loc[df['ActivityProducedBy'] == 'Refrigeration/Air Conditioning', - 'FlowAmount'] = df['FlowAmount'] - transport_df['FlowAmount'].sum() - return df - - -def allocate_HFC_to_residential(df): - """Split HFC emissions into two buckets to be further allocated. - - Calculate the portion of Refrigerants applied to households based on production of - household: 335222 - industry: 333415 - """ - make_df = load_fba_w_standardized_units(datasource='BEA_Make_Detail_BeforeRedef', - year=2012) - household = make_df[(make_df['ActivityProducedBy'] == '335222') & - (make_df['ActivityConsumedBy'] == '335222') - ].reset_index()['FlowAmount'][0] - industry = make_df[(make_df['ActivityProducedBy'] == '333415') & - (make_df['ActivityConsumedBy'] == '333415') - ].reset_index()['FlowAmount'][0] - - activity = 'Refrigeration/Air Conditioning' - df_subset = df.loc[df['ActivityProducedBy'] == activity].reset_index(drop=True) - df_subset['FlowAmount'] = df_subset[ - 'FlowAmount'] * (household / (industry + household)) - df_subset['ActivityProducedBy'] = f"{activity} - Households" - df.loc[df['ActivityProducedBy'] == activity, - 'FlowAmount'] = df['FlowAmount'] * (industry / (industry + household)) - df = pd.concat([df, df_subset], ignore_index=True) - - return df - - -def split_HFC_foams(df): - """Split HFC emissions from foams into two buckets to be allocated separately. - - Calculate the portion for - Polystyrene: 326140 - Urethane: 326150 - """ - make_df = load_fba_w_standardized_units(datasource='BEA_Make_Detail_BeforeRedef', - year=2012) - polystyrene = make_df[(make_df['ActivityProducedBy'] == '326140') & - (make_df['ActivityConsumedBy'] == '326140') - ].reset_index()['FlowAmount'][0] - urethane = make_df[(make_df['ActivityProducedBy'] == '326150') & - (make_df['ActivityConsumedBy'] == '326150') - ].reset_index()['FlowAmount'][0] - - activity = 'Foams' - df_subset = df.loc[df['ActivityProducedBy'] == activity].reset_index(drop=True) - df_subset['FlowAmount'] = df_subset[ - 'FlowAmount'] * (polystyrene / (urethane + polystyrene)) - df_subset['ActivityProducedBy'] = f"{activity} - Polystyrene" - df.loc[df['ActivityProducedBy'] == activity, 'FlowAmount'] = df[ - 'FlowAmount'] * (urethane / (urethane + polystyrene)) - df.loc[df['ActivityProducedBy'] == activity, - 'ActivityProducedBy'] = f"{activity} - Urethane" - df = pd.concat([df, df_subset], ignore_index=True) - - return df - - -def clean_HFC_fba(fba, **_): - """Adjust HFC emissions for improved parsing. - clean_fba_before_mapping_df_fxn used in EPA_GHGI_T_4_101.""" - df = subtract_HFC_transport_emissions(fba) - df = allocate_HFC_to_residential(df) - df = split_HFC_foams(df) - df = split_HFCs_by_type(df) - return df - - -def remove_HFC_kt(fba, **_): - """Remove records of emissions in kt, data are also provided in MMT CO2e. - clean_fba_before_mapping_df_fxn used in EPA_GHGI_T_4_50.""" - return fba.loc[fba['Unit'] != 'kt'] - - -def adjust_transport_activities(df, **_): - """Update activity names for improved transportatin parsing. - clean_allocation_fba used in EPA_GHGI_T_A_14""" - activities = {'Gasoline': ['Light-Duty Trucks', - 'Passenger Cars'], - 'Distillate Fuel Oil (Diesel Fuel)': - ['Medium- and Heavy-Duty Trucks', - 'Buses'], - } - for k, v in activities.items(): - df.loc[(df['ActivityConsumedBy'].isin(v)) & - (df['FlowName'] == k), - 'ActivityConsumedBy'] = df['ActivityConsumedBy'] + f" - {k}" - return df - - -def keep_six_digit_naics(df_w_sec, **_): - """Keep only activities at the 6-digit NAICS level - clean_allocation_fba_w_sec used for EPA_GHGI_T_A_79""" - df_w_sec = replace_NoneType_with_empty_cells(df_w_sec) - df_w_sec = df_w_sec.loc[ - (df_w_sec['SectorProducedBy'].apply(lambda x: len(x) == 6)) | - (df_w_sec['SectorConsumedBy'].apply(lambda x: len(x) == 6))] - return df_w_sec - -if __name__ == "__main__": - import flowsa - # fba = flowsa.getFlowByActivity('EPA_GHGI_T_4_101', 2016) - # df = clean_HFC_fba(fba) - fba = flowsa.flowbyactivity.main(year=2016, source='EPA_GHGI') diff --git a/flowsa/methods/flowbyactivitymethods/GHGI2020_3_104.yaml b/flowsa/methods/flowbyactivitymethods/GHGI2020_3_104.yaml deleted file mode 100644 index 69ae09b6b..000000000 --- a/flowsa/methods/flowbyactivitymethods/GHGI2020_3_104.yaml +++ /dev/null @@ -1,41 +0,0 @@ -author: US Environmental Protection Agency -source_name: 'Inventory of US Greenhouse Gas Emissions and Sinks: 1990-2020' -source_url: https://www.epa.gov/ghgemissions/inventory-us-greenhouse-gas-emissions-and-sinks-1990-2020 -bib_id: EPA_GHGI -# api_name: EPA_GHGI -# api_key_required: false -format: csv -url: - base_url: https://www.epa.gov/system/files/other-files/2022-05/Main%20Chapter.zip - annex_url: https://www.epa.gov/system/files/other-files/2022-06/Annex.zip -url_replace_fxn: !script_function:GHGI2020 ghg_url_helper -call_response_fxn: !script_function:GHGI2020 ghg_call -parse_response_fxn: !script_function:GHGI2020 ghg_parse -years: -- 2010 -- 2011 -- 2012 -- 2013 -- 2014 -- 2015 -- 2016 -- 2017 -- 2018 -- 2019 - -Tables: - Ch 3 - Energy: - 3-104: - class: Chemicals - unit: MMT CO2e - compartment: air - desc: 'Table 3-104: CO2, CH4, and N2O Emissions from International Bunker Fuels (MMT CO2 Eq.)' - -Annex: - Annex 3: - A-103: - class: Chemicals - unit: MMT CO2e - compartment: air - flow: HFCs - desc: HFC Emissions from Transportation Sources (MMT CO2 Eq.) diff --git a/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml b/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml deleted file mode 100644 index 955de17ac..000000000 --- a/flowsa/methods/flowbysectormethods/GHGI_recursive_2016_m1.yaml +++ /dev/null @@ -1,822 +0,0 @@ -%YAML 1.1 - ---- -# m1 for the GHG national replicates the method used in the National GHG Industry Attribution Model -#(https://doi.org/10.23719/1517571), except that sector attribution is to 6-digit NAICS, -# rather than the BEA 2012 IO schema - -industry_spec: - default: NAICS_6 -year: &ghgi_year 2016 -target_naics_year: 2012 -geoscale: national - -sources_to_cache: - BLS_QCEW: - year: 2012 - selection_fields: - Class: Employment - clean_fba_before_mapping: !script_function:temp_data_source_functions estimate_suppressed_qcew - clean_fba: !script_function:temp_data_source_functions clean_qcew #todo: evaluate if necessary because already estimated suppressed data - -_attribution_sources: - EIA_MECS_Energy: &mecs_energy - year: 2014 - selection_fields: &mecs_energy_default_selection - Class: Energy - Unit: Trillion Btu - estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_mecs_energy - clean_fba: !script_function:temp_data_source_functions clean_mecs_energy_fba - clean_fba_w_sec: !script_function:temp_data_source_functions clean_mapped_mecs_energy_fba - attribution_method: proportional # cleaning fxns remove need for proportional-flagged - attribution_source: BLS_QCEW - BEA: &bea - year: 2012 - activity_to_sector_mapping: BEA_2012_Detail - attribution_method: proportional - attribution_source: BLS_QCEW - -source_names: - EPA_GHGI_T_2_1: #U.S. GHG emissions - fedefl_mapping: GHGI - activity_sets: - direct_attribution: - selection_fields: - PrimaryActivity: - - Iron and Steel Production & Metallurgical Coke Production #CO2, CH4 - - Cement Production #CO2 - - Lime Production #CO2 - - Ammonia Production #CO2 - - Incineration of Waste #CO2, #N2O - - Aluminum Production #CO2 - - Soda Ash Production #CO2 - - Ferroalloy Production #CO2, CH4 - - Titanium Dioxide Production #CO2 - - Zinc Production #CO2 - - Phosphoric Acid Production #CO2 - - Glass Production #CO2 - - Carbide Production and Consumption #CO2, CH4 - - Landfills #CH4 - - Coal Mining #CH4 - - Wastewater Treatment #CH4, N2O - - Rice Cultivation #CH4 - - Abandoned Oil and Gas Wells #CH4 - - Abandoned Underground Coal Mines #CH4 - - Anaerobic Digestion at Biogas Facilities #CH4 new activity - - Composting #CH4, N2O - - Nitric Acid Production #N2O - - Adipic Acid Production #N2O - - Caprolactam, Glyoxal, and Glyoxylic Acid Production #CH4 - - Electronics Industry #N2O - FlowName: - - CO2 - - CH4 - - N2O - attribution_method: direct - - electric_distribution: - selection_fields: - PrimaryActivity: Electrical Transmission and Distribution #SF6 - FlowName: SF6 - attribution_method: direct - - electric_production: &electricity_make - selection_fields: - PrimaryActivity: Electric Power #CO2 - attribution_method: proportional - attribution_source: - BEA_Make_Detail_BeforeRedef: - <<: *bea - primary_action_type: Produced - selection_fields: - ActivityConsumedBy: {'221100': ''} # Electricity - - liming: - selection_fields: - PrimaryActivity: Liming #CO2 - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'327400': ''} - - urea: - selection_fields: - PrimaryActivity: - - Urea Fertilization #CO2 - - Urea Consumption for Non-Agricultural Purposes #CO2 - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers - - carbonate_use: - selection_fields: - PrimaryActivity: Other Process Uses of Carbonates #CO2 - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals - - lead_production: - selection_fields: - PrimaryActivity: Lead Production #CO2 - attribution_method: proportional - attribution_source: - USGS_MYB_Lead: - year: 2016 - selection_fields: - ActivityProducedBy: - - Primary lead, refined content, domestic ores and base bullion - - Secondary lead, lead content - - nitrous_oxide_use: - selection_fields: - PrimaryActivity: N2O from Product Uses #N2O - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'325120': ''} # Industrial gases - -## Fossil Fuels - EPA_GHGI_T_3_63: &natgas #CH4 from Natural Gas Systems - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: - - Distribution - - Exploration - - Processing - - Production - - Transmission and Storage - attribution_method: direct - EPA_GHGI_T_3_65: *natgas #CO2 from Natural Gas Systems mimics CH4 - EPA_GHGI_T_3_67: *natgas #N2O from Natural Gas Systems, not used in original method, mimics CH4 - - EPA_GHGI_T_3_38: &petroleum #CH4 from Petroleum Systems - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: - - Crude Oil Transportation - - Exploration - - Production - - Refining - attribution_method: direct - EPA_GHGI_T_3_40: *petroleum #CO2 from Petroleum Systems mimics CH4 - EPA_GHGI_T_3_42: *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 - -## Agriculture - EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: - - Chickpeas - - Cotton - - Maize - - Rice - - Soybeans - - Wheat - attribution_method: direct - - EPA_GHGI_T_5_3: &animals #CH4 from Enteric Fermentation - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: - - American Bison - - Beef Cattle - - Dairy Cattle - - Goats - - Horses - - Mules and Asses - - Sheep - - Swine - - Poultry - attribution_method: direct - EPA_GHGI_T_5_7: *animals #CH4 and N2O from manure, mimics enteric fermentation - - EPA_GHGI_T_5_18: #Direct N2O emissions from agricultural soils - fedefl_mapping: GHGI - activity_sets: - fertilizer_use: &fertilizer # allocated based on fertilizer use - selection_fields: - PrimaryActivity: - - Organic Amendment Cropland - - Residue N Cropland - - Synthetic Fertilizer Cropland - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'325310': ''} - - cropland: # allocated based on USDA land area harvested - selection_fields: - PrimaryActivity: - - Mineralization and Asymbiotic Fixation Cropland - - Drained Organic Soils Cropland - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland: - year: 2017 - selection_fields: - Class: Land - FlowName: - - AREA HARVESTED - - AREA BEARING & NON-BEARING # Orchards - - AREA GROWN # Berry totals - - AREA IN PRODUCTION # Vegetable totals - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland_NAICS: - year: 2017 - selection_fields: - Class: Land - FlowName: AG LAND, CROPLAND, HARVESTED - - pasture: &pasture # allocated based on USDA Animal operation land (acres) - selection_fields: - PrimaryActivity: - - All activities Grassland - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland_NAICS: - year: 2017 - selection_fields: - Class: Land - FlowName: FARM OPERATIONS - clean_fba: !script_function:temp_data_source_functions clean_usda_cropland_naics - - EPA_GHGI_T_5_19: #Indirect N2O emissions from agricultural soils - fedefl_mapping: GHGI - activity_sets: - fertilizer_use: # allocated based on fertilizer use - <<: *fertilizer - selection_fields: - PrimaryActivity: - - Volatilization & Atm. Deposition Cropland - - Surface Leaching & Run-Off Cropland - pasture: # allocated based on USDA Animal operation land (acres) - <<: *pasture - -## Mobile Sources - EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion - fedefl_mapping: GHGI - activity_sets: - direct_attribution: - selection_fields: - PrimaryActivity: - - Passenger Cars Gasoline On-Road - - Light-Duty Trucks Gasoline On-Road - - Rail Non-Road - - Ships and Boats Non-Road - - Aircraft Non-Road - - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road - attribution_method: direct - - construction_and_mining: #this set is allocated by purchases of construction equipment - selection_fields: - PrimaryActivity: Construction/Mining Equipment Non-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment - - farm_non_road: #this set is allocated by purchases of farm machinery - selection_fields: - PrimaryActivity: Agricultural Equipment Non-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'333111': ''} # purchases of farm machinery - - other_non_road: #this set is allocated by purchases of petroleum refining - selection_fields: - PrimaryActivity: Other Non-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products - - alt_fuel_on_road: #this set is allocated by purchases of natural gas - selection_fields: - PrimaryActivity: - - All activities Alternative Fuel On-Road # corrected from "Alternative Fuel On-Road", which isn't in the source FBA. - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas - - EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 - # ^^^ TODO: double check this is working as intended. I had a situation where - # we were only getting the first activity set. - -## Major CO2 Sources - EPA_GHGI_T_A_14: # CO2 emissions from stationary combustion and transportation - fedefl_mapping: GHGI - clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion - activity_sets: - direct_attribution: #direct allocation - selection_fields: - PrimaryActivity: Total (All Fuels) Residential - attribution_method: direct - - non-manufacturing_coal: - selection_fields: - PrimaryActivity: - - Commercial Coal Commercial - - Industrial Other Coal Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal - - non-manufacturing_natural_gas: - selection_fields: - PrimaryActivity: - - Natural Gas Commercial - - Natural Gas Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas - - non-manufacturing_petroleum: # Petroleum - selection_fields: - PrimaryActivity: - - Total Petroleum Commercial - - Total Petroleum Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products - - manufacturing_coal: # Industrial Coal for Manufacturing - selection_fields: - PrimaryActivity: - - Industrial Other Coal Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Coal - - manufacturing_natural_gas: # Industrial Natural Gas for manufacturing - selection_fields: - PrimaryActivity: - - Natural Gas Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Natural Gas - - ### Transportation - natural_gas_transportation: - selection_fields: - PrimaryActivity: Natural Gas Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - selection_fields: - FlowName: Natural Gas - attribution_method: proportional - attribution_source: BLS_QCEW - - aviation_gas_transportation: - selection_fields: - PrimaryActivity: Aviation Gasoline Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - selection_fields: - FlowName: Aviation Gasoline - attribution_method: proportional - attribution_source: BLS_QCEW - - jet_fuel_transportation: - selection_fields: - PrimaryActivity: Jet Fuel Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - selection_fields: - FlowName: Jet Fuel - attribution_method: proportional - attribution_source: BLS_QCEW - - propane_transportation: - selection_fields: - PrimaryActivity: LPG (Propane) Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - selection_fields: - FlowName: LPG - attribution_method: proportional - attribution_source: BLS_QCEW - - residual_fuel_transportation: - selection_fields: - PrimaryActivity: Residual Fuel Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - selection_fields: - FlowName: Residual Fuel Oil - attribution_method: proportional - attribution_source: BLS_QCEW - - distillate_fuel_transportation: # industry_spec defined as default: NAICS_6 replaces previous clean_allocation_fba_w_sec - selection_fields: - PrimaryActivity: Distillate Fuel Oil Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - selection_fields: - FlowName: Distillate Fuel Oil (Diesel Fuel) # these selection fields replaces previous clean_allocation_fba - ActivityConsumedBy: - - Passenger Cars - - Light-Duty Trucks - - Medium- and Heavy-Duty Trucks - - Buses - - Rail - - Recreational Boats - - Ships and Non-Recreational Boats - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'324110': ''} # use of petroleum products - - gasoline_transportation: # industry_spec defined as default: NAICS_6 replaces previous clean_allocation_fba_w_sec - selection_fields: - PrimaryActivity: Motor Gasoline Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - selection_fields: - FlowName: Motor Gasoline - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'324110': ''} # use of petroleum products - -## Stationary Combustion - EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion - fedefl_mapping: GHGI - clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion - activity_sets: - direct_attribution: - selection_fields: - PrimaryActivity: - - Fuel Oil Residential - - Coal Residential - - Natural Gas Residential - - Wood Residential - attribution_method: direct - - electric_power: - # <<: *electricity_make - selection_fields: - PrimaryActivity: - - Coal Electric Power - - Natural Gas Electric Power - - Natural gas Electric Power # note lower case - - Fuel Oil Electric Power - - Wood Electric Power - attribution_method: proportional - attribution_source: - BEA_Make_Detail_BeforeRedef: - <<: *bea - primary_action_type: Produced - selection_fields: - ActivityConsumedBy: {'221100': ''} # Electricity - - fuel_oil: - selection_fields: - PrimaryActivity: - - Fuel Oil Commercial - - Fuel Oil Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products - - natural_gas: - selection_fields: - PrimaryActivity: - - Natural gas Commercial - - Natural gas Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas - - coal: - selection_fields: - PrimaryActivity: Coal Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal - - coal_manufacturing: - selection_fields: - PrimaryActivity: Coal Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Coal - - natural_gas_manufacturing: - selection_fields: - PrimaryActivity: Natural gas Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Natural Gas - - EPA_GHGI_T_3_9: - <<: *stationary_combustion # N2O emissions from stationary combustion - fedefl_mapping: GHGI - clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion - activity_sets: - direct_attribution: - selection_fields: - PrimaryActivity: - - Fuel Oil Residential - - Coal Residential - - Natural Gas Residential - - Wood Residential - attribution_method: direct - - electric_power: - # <<: *electricity_make - selection_fields: - PrimaryActivity: - - Coal Electric Power - - Natural Gas Electric Power - - Natural gas Electric Power # note lower case - - Fuel Oil Electric Power - - Wood Electric Power - attribution_method: proportional - attribution_source: - BEA_Make_Detail_BeforeRedef: - <<: *bea - primary_action_type: Produced - selection_fields: - ActivityConsumedBy: {'221100': ''} # Electricity - - fuel_oil: - selection_fields: - PrimaryActivity: - - Fuel Oil Commercial - - Fuel Oil Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products - - natural_gas: - selection_fields: - PrimaryActivity: - - Natural gas Commercial - - Natural gas Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas - - coal: - selection_fields: - PrimaryActivity: Coal Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal - - coal_manufacturing: - selection_fields: - PrimaryActivity: Coal Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Coal - - natural_gas_manufacturing: - selection_fields: - PrimaryActivity: Natural gas Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Natural Gas - -## Other sources - EPA_GHGI_T_4_46: #CO2 for selected petrochemicals - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: - - Acrylonitrile - - Carbon Black - - Ethylene - - Ethylene Dichloride - - Ethylene Oxide - - Methanol - attribution_method: direct - - EPA_GHGI_T_3_22b: #Fossil fuel for non-energy uses - fedefl_mapping: GHGI - activity_sets: - coal: - selection_fields: - PrimaryActivity: - - Industry Industrial Coking Coal - - Industry Industrial Other Coal - attribution_method: direct - - petroleum_feedstocks: # consumed petroleum products - selection_fields: - PrimaryActivity: - - Industry Asphalt & Road Oil - - Industry Distillate Fuel Oil - - Industry LPG - - Industry Lubricants - - Industry Miscellaneous Products - - Industry Naphtha (<401 F) - - Industry Other Oil (>401 F) - - Industry Pentanes Plus - - Industry Petroleum Coke - - Industry Special Naphtha - - Industry Still Gas - - Industry Waxes - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - FlowName: Other - Unit: Trillion Btu - - natural_gas_feedstocks: # consumed nat gas to chemical plants - selection_fields: - PrimaryActivity: Industry Natural Gas to Chemical Plants - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - FlowName: Natural Gas - Unit: Trillion Btu - - transportation_lubricants: - selection_fields: - PrimaryActivity: Transportation Lubricants - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: '324110' # use of petroleum products - -## Other Emissions - EPA_GHGI_T_4_50: # HFCs from HCFC-22 production - selection_fields: - Unit: MMT CO2e - PrimaryActivity: HCFC-22 Production - fedefl_mapping: GHGI - attribution_method: direct - - EPA_GHGI_T_4_94: # HFCs and other emissions from electronics manufacture - selection_fields: - FlowName: - C2F6: C2F6 - C3F8: C3F8 - CF4: CF4 - HFC-23: HFC-23 - c-C4F8: c-C4F8 - SF6: SF6 - NF3: NF3 - N2O[2]: N2O - fedefl_mapping: GHGI - attribution_method: direct - - EPA_GHGI_T_4_101: # HFCs and PFCs from ODS Substitutes - clean_fba_before_activity_sets: !script_function:temp_data_source_functions clean_hfc_fba # removes HFCs from transportation - fedefl_mapping: 'GHGI' - activity_sets: - household_refrigeration: - selection_fields: - PrimaryActivity: Refrigeration/Air Conditioning - Households - attribution_method: direct - - non-household_refrigeration: - selection_fields: - PrimaryActivity: Refrigeration/Air Conditioning - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'333415': ''} # Air conditioning equipment - - polystyrene_foam: - selection_fields: - PrimaryActivity: Foams - Polystyrene - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'326140': ''} # Polystyrene foam - - urethane_foam: - selection_fields: - PrimaryActivity: Foams - Urethane - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'326150': ''} # Urethane and other foams. - - EPA_GHGI_T_A_103: # HFCs from Transportation - clean_fba_before_mapping: !script_function:temp_data_source_functions split_hfcs_by_type - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: - Mobile AC - Passenger Cars: Passenger Cars - Mobile AC - Heavy-Duty Vehicles: Heavy-Duty Vehicles - Mobile AC - Light-Duty Trucks: Light-Duty Trucks - Comfort Cooling for Trains and Buses - School and Tour Buses: School and Tour Buses - Comfort Cooling for Trains and Buses - Rail: Rail - Refrigerated Transport - Medium- and Heavy-Duty Trucks: Medium- and Heavy-Duty Trucks - Refrigerated Transport - Rail: Rail - Refrigerated Transport - Ships and Boats: Ships and Boats - attribution_method: direct - - EPA_GHGI_T_4_80: # PFCs from aluminum production - fedefl_mapping: GHGI - attribution_method: direct - - EPA_GHGI_T_4_84: # HFCs, SF6, CO2 from magnesium production - fedefl_mapping: GHGI - attribution_method: proportional - attribution_source: - BEA_Make_Detail_BeforeRedef: - <<: *bea - selection_fields: - ActivityConsumedBy: {T008: ''} # Total Output diff --git a/flowsa/methods/flowbysectormethods/marine_shipping_adjustment.yaml b/flowsa/methods/flowbysectormethods/marine_shipping_adjustment.yaml index d904ad486..27f7ec77a 100644 --- a/flowsa/methods/flowbysectormethods/marine_shipping_adjustment.yaml +++ b/flowsa/methods/flowbysectormethods/marine_shipping_adjustment.yaml @@ -38,7 +38,7 @@ source_names: Description: Exports adjustment_factor: -1 - GHGI2020_3_104: + EPA_GHGI_T_3_104: selection_fields: ActivityProducedBy: Marine # fedefl_mapping: GHGI From 83cf45c2d78c87199d78964ce9a397a92e5d72ad Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 7 Apr 2023 21:04:57 -0400 Subject: [PATCH 0475/1127] reorder sources --- .../flowbysectormethods/GHG_national_m1.yaml | 91 +++++++++---------- 1 file changed, 45 insertions(+), 46 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml index dcab32769..ba5639b75 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml @@ -281,6 +281,49 @@ source_names: ## Mobile Sources + EPA_GHGI_T_3_13: #CO2 from mobile combustion + fedefl_mapping: GHGI + activity_sets: + direct_attribution: + selection_fields: + PrimaryActivity: + General Aviation Aircraft Aviation Gasoline: General Aviation Aircraft + General Aviation Aircraft Jet Fuel: General Aviation Aircraft + Commercial Aircraft Jet Fuel: Commercial Aircraft + Military Aircraft Jet Fuel: Military Aircraft + Buses Gasoline: Buses + Buses LPG: Buses + Buses Natural Gas: Buses + Pipeline Natural Gas: Pipeline Natural Gas + Motorcycles Gasoline: Motorcycles + Rail Distillate Fuel Oil: Rail + Recreational Boats Distillate Fuel Oil: Recreational Boats + Recreational Boats Gasoline: Recreational Boats + Ships and Non-Recreational Boats Distillate Fuel Oil: Ships and Non-Recreational Boats + Ships and Non-Recreational Boats Residual Fuel Oil: Ships and Non-Recreational Boats + Medium- and Heavy-Duty Trucks Gasoline: Medium- and Heavy-Duty Trucks + Medium- and Heavy-Duty Trucks LPG: Medium- and Heavy-Duty Trucks + Light-Duty Trucks LPG: Light-Duty Trucks - Households + Passenger Cars LPG: Passenger Cars - Households + attribution_method: direct + + petroleum_fuels: + selection_fields: + PrimaryActivity: + Medium- and Heavy-Duty Trucks Distillate Fuel Oil: Medium- and Heavy-Duty Trucks - Distillate Fuel Oil + Buses Distillate Fuel Oil: Buses - Distillate Fuel Oil + Passenger Cars Distillate Fuel Oil: Passenger Cars + Passenger Cars Gasoline: Passenger Cars + Light-Duty Trucks Distillate Fuel Oil: Light-Duty Trucks + Light-Duty Trucks Gasoline: Light-Duty Trucks + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion fedefl_mapping: GHGI activity_sets: @@ -355,8 +398,8 @@ source_names: EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 -## Major CO2 Sources - GHGI_CO2_stationary_combustion_and_transport: # CO2 emissions from stationary combustion and transportation +## Stationary Combustion + GHGI_CO2_stationary_combustion_and_transport: # CO2 emissions from stationary combustion fedefl_mapping: GHGI # year: # override this clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion @@ -442,51 +485,7 @@ source_names: selection_fields: ActivityProducedBy: {'324110': ''} # purchases of refinery products - ### Transportation - EPA_GHGI_T_3_13: #CO2 from mobile combustion - fedefl_mapping: GHGI - activity_sets: - direct_attribution: - selection_fields: - PrimaryActivity: - General Aviation Aircraft Aviation Gasoline: General Aviation Aircraft - General Aviation Aircraft Jet Fuel: General Aviation Aircraft - Commercial Aircraft Jet Fuel: Commercial Aircraft - Military Aircraft Jet Fuel: Military Aircraft - Buses Gasoline: Buses - Buses LPG: Buses - Buses Natural Gas: Buses - Pipeline Natural Gas: Pipeline Natural Gas - Motorcycles Gasoline: Motorcycles - Rail Distillate Fuel Oil: Rail - Recreational Boats Distillate Fuel Oil: Recreational Boats - Recreational Boats Gasoline: Recreational Boats - Ships and Non-Recreational Boats Distillate Fuel Oil: Ships and Non-Recreational Boats - Ships and Non-Recreational Boats Residual Fuel Oil: Ships and Non-Recreational Boats - Medium- and Heavy-Duty Trucks Gasoline: Medium- and Heavy-Duty Trucks - Medium- and Heavy-Duty Trucks LPG: Medium- and Heavy-Duty Trucks - Light-Duty Trucks LPG: Light-Duty Trucks - Households - Passenger Cars LPG: Passenger Cars - Households - attribution_method: direct - petroleum_fuels: - selection_fields: - PrimaryActivity: - Medium- and Heavy-Duty Trucks Distillate Fuel Oil: Medium- and Heavy-Duty Trucks - Distillate Fuel Oil - Buses Distillate Fuel Oil: Buses - Distillate Fuel Oil - Passenger Cars Distillate Fuel Oil: Passenger Cars - Passenger Cars Gasoline: Passenger Cars - Light-Duty Trucks Distillate Fuel Oil: Light-Duty Trucks - Light-Duty Trucks Gasoline: Light-Duty Trucks - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products - - -## Stationary Combustion EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion # year: #override this with ghgi_year clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion From 9ea90f97864b7a2851458e888057928e734fc7f7 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 10 Apr 2023 08:56:57 -0600 Subject: [PATCH 0476/1127] drop yamls that reference additional FBAs used in FBS - those FBAs now included in FBS yaml --- flowsa/bibliography.py | 19 +---- flowsa/common.py | 24 ------- .../fbs_methods_additional_fbas.yaml | 69 ------------------- .../functions_loading_fbas.yaml | 40 ----------- flowsa/metadata.py | 10 +-- 5 files changed, 2 insertions(+), 160 deletions(-) delete mode 100644 flowsa/data/bibliographyinfo/fbs_methods_additional_fbas.yaml delete mode 100644 flowsa/data/bibliographyinfo/functions_loading_fbas.yaml diff --git a/flowsa/bibliography.py b/flowsa/bibliography.py index 21687e8fd..4f3c3c3ec 100644 --- a/flowsa/bibliography.py +++ b/flowsa/bibliography.py @@ -10,9 +10,7 @@ from bibtexparser.bwriter import BibTexWriter from bibtexparser.bibdatabase import BibDatabase from flowsa.common import load_yaml_dict, \ - load_values_from_literature_citations_config, \ - load_fbs_methods_additional_fbas_config, \ - load_functions_loading_fbas_config, get_flowsa_base_name, \ + load_values_from_literature_citations_config, get_flowsa_base_name, \ sourceconfigpath, load_yaml_dict from flowsa.settings import outputpath, biboutputpath, log @@ -47,21 +45,6 @@ def generate_list_of_sources_in_fbs_method(methodname): if 'literature_sources' in attr: for source, date in attr['literature_sources'].items(): sources.append([source, date]) - # load any additional fbas that are called in a fbs method within fxns - try: - fbas = load_fbs_methods_additional_fbas_config()[methodname] - for s, acts_info in fbas.items(): - for acts, fxn_info in acts_info.items(): - for fxn, fba_info in fxn_info.items(): - for fba, y in fba_info.items(): - fxn_config = \ - load_functions_loading_fbas_config()[fxn][fba] - sources.append([fxn_config['source'], y]) - except KeyError: - # if no additional fbas than pass - log.info(f'There are no additional Flow-By-Activities ' - 'used in generating %s', methodname) - pass return sources diff --git a/flowsa/common.py b/flowsa/common.py index b010e8dfa..5891ba0ea 100644 --- a/flowsa/common.py +++ b/flowsa/common.py @@ -164,30 +164,6 @@ def load_values_from_literature_citations_config(): return config -def load_fbs_methods_additional_fbas_config(): - """ - Load the config file that contains information on where the - values from the literature come from - :return: dictionary of the values from the literature information - """ - sfile = f'{datapath}bibliographyinfo/fbs_methods_additional_fbas.yaml' - with open(sfile, 'r') as f: - config = yaml.safe_load(f) - return config - - -def load_functions_loading_fbas_config(): - """ - Load the config file that contains information on where the - values from the literature come from - :return: dictionary of the values from the literature information - """ - sfile = datapath + 'bibliographyinfo/functions_loading_fbas.yaml' - with open(sfile, 'r') as f: - config = yaml.safe_load(f) - return config - - def create_fill_na_dict(flow_by_fields): """ Dictionary for how to fill nan in different column types diff --git a/flowsa/data/bibliographyinfo/fbs_methods_additional_fbas.yaml b/flowsa/data/bibliographyinfo/fbs_methods_additional_fbas.yaml deleted file mode 100644 index f0b2a442e..000000000 --- a/flowsa/data/bibliographyinfo/fbs_methods_additional_fbas.yaml +++ /dev/null @@ -1,69 +0,0 @@ -CAP_HAP_national_2017: - EPA_NEI_Nonpoint: - activity_set_2: - disaggregate_cropland: - flowbyactivity_1: 2017 - disaggregate_pastureland: - flowbyactivity_1: 2017 -Land_national_2012: - USDA_ERS_MLU: - activity_set_1: - disaggregate_cropland: - flowbyactivity_1: 2012 - disaggregate_pastureland: - flowbyactivity_1: 2012 - activity_set_2: - disaggregate_cropland: - flowbyactivity_1: 2012 - disaggregate_pastureland: - flowbyactivity_1: 2012 -Water_national_2010_m1: - USGS_NWIS_WU: - activity_set_3: - disaggregate_cropland: - flowbyactivity_1: 2012 - disaggregate_pastureland: - flowbyactivity_1: 2012 -Water_national_2010_m2: - USGS_NWIS_WU: - activity_set_2: - convert_statcan_data_to_US_water_use: - 'flowbyactivity_1': 2011 - 'flowbyactivity_2': 2011 - activity_set_3: - convert_blackhurst_data_to_kg_per_year: - flowbyactivity_1: 2002 - convert_blackhurst_data_to_kg_per_employee: - flowbyactivity_1: 2002 - scale_blackhurst_results_to_usgs_values: - flowbyactivity_1: 2010 - activity_set_4: - disaggregate_cropland: - flowbyactivity_1: 2012 - disaggregate_pastureland: - flowbyactivity_1: 2012 -Water_national_2015_m1: - USGS_NWIS_WU: - activity_set_3: - disaggregate_cropland: - flowbyactivity_1: 2017 - disaggregate_pastureland: - flowbyactivity_1: 2017 -Water_national_2015_m2: - USGS_NWIS_WU: - activity_set_2: - convert_statcan_data_to_US_water_use: - 'flowbyactivity_1': 2015 - 'flowbyactivity_2': 2015 - activity_set_3: - convert_blackhurst_data_to_kg_per_year: - flowbyactivity_1: 2002 - convert_blackhurst_data_to_kg_per_employee: - flowbyactivity_1: 2002 - scale_blackhurst_results_to_usgs_values: - flowbyactivity_1: 2015 - activity_set_4: - disaggregate_cropland: - flowbyactivity_1: 2017 - disaggregate_pastureland: - flowbyactivity_1: 2017 diff --git a/flowsa/data/bibliographyinfo/functions_loading_fbas.yaml b/flowsa/data/bibliographyinfo/functions_loading_fbas.yaml deleted file mode 100644 index 3baf2d66b..000000000 --- a/flowsa/data/bibliographyinfo/functions_loading_fbas.yaml +++ /dev/null @@ -1,40 +0,0 @@ -assign_nonpoint_dqi: - flowbyactivity_1: - source: Census_CBP - year: - flowclass: -convert_blackhurst_data_to_kg_per_employee: - flowbyactivity_1: - source: BLS_QCEW - year: 2002 - flowclass: Employment -convert_blackhurst_data_to_kg_per_year: - flowbyactivity_1: - source: BEA_Make_AR - year: 2002 - flowclass: Money -convert_statcan_data_to_US_water_use: - flowbyactivity_1: - source: StatCan_GDP - year: __year__ - flowclass: Money - flowbyactivity_2: - source: BEA_GDP_GrossOutput - year: __year__ - flowclass: Money -disaggregate_cropland: - flowbyactivity_1: - source: USDA_CoA_Cropland_NAICS - year: __year__ - flowclass: Land -disaggregate_pastureland: - flowbyactivity_1: - source: USDA_CoA_Cropland_NAICS - year: __year__ - flowclass: Land -scale_blackhurst_results_to_usgs_values: - flowbyactivity_1: - source: USGS_NWIS_WU - year: __year__ - flowclass: Water - diff --git a/flowsa/metadata.py b/flowsa/metadata.py index 59ad3bcfb..c2c048d41 100644 --- a/flowsa/metadata.py +++ b/flowsa/metadata.py @@ -9,8 +9,7 @@ import pandas as pd from esupy.processed_data_mgmt import FileMeta, write_metadata_to_file, \ read_source_metadata -from flowsa.common import load_functions_loading_fbas_config, \ - load_fbs_methods_additional_fbas_config, return_true_source_catalog_name +from flowsa.common import return_true_source_catalog_name from flowsa.settings import paths, PKG, PKG_VERSION_NUMBER, WRITE_FORMAT, \ GIT_HASH, GIT_HASH_LONG, log @@ -95,13 +94,6 @@ def return_fbs_method_data(source_name, config): from flowsa.data_source_scripts.stewiFBS import add_stewi_metadata,\ add_stewicombo_metadata - # load the yaml that lists what additional fbas are - # used in creating the fbs - try: - add_fbas = load_fbs_methods_additional_fbas_config()[source_name] - except KeyError: - add_fbas = None - # Create empty dictionary for storing meta data meta = {} # subset the FBS dictionary into a dictionary of source names From f969a09fa28a431d34e86a0a6aa922ed7ee27808 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 10 Apr 2023 08:57:22 -0600 Subject: [PATCH 0477/1127] add data formats --- flowsa/data/source_catalog.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 1738be7f4..098f4eb36 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -110,6 +110,8 @@ Census_VIP: sector-like_activities: False activity_schema: sector_hierarchy: "flat" +CNHW_national_2018: + data_format: FBS EIA_CBECS_Land: data_format: FBA class: Land @@ -190,6 +192,7 @@ EPA_GHGI: activity_schema: sector_hierarchy: "flat" EPA_REI: + data_format: FBA class: - Employment - Money From 82d36e3f41f530f11dffb200e5aefb644825e12a Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 10 Apr 2023 08:58:08 -0600 Subject: [PATCH 0478/1127] comment out non-recursive function --- flowsa/data_source_scripts/USDA_IWMS.py | 62 ++++++++++++------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/flowsa/data_source_scripts/USDA_IWMS.py b/flowsa/data_source_scripts/USDA_IWMS.py index 5ee531eab..b44971077 100644 --- a/flowsa/data_source_scripts/USDA_IWMS.py +++ b/flowsa/data_source_scripts/USDA_IWMS.py @@ -122,37 +122,37 @@ def iwms_parse(*, df_list, year, **_): return df - -def disaggregate_iwms_to_6_digit_naics_for_water_withdrawal(df, attr, method, - **kwargs): - """ - Disaggregate the data in the USDA Irrigation and Water Management Survey - to 6-digit NAICS using Census of Agriculture 'Land in Farm' data - :param df: df, FBA format - :param attr: dictionary, attribute data from method yaml for activity set - :param method: dictionary, FBS method yaml - :return: df, FBA format with disaggregated NAICS - """ - - # define sector column to base df modifications - sector_column = 'SectorConsumedBy' - - # address double counting brought on by iwms categories - # applying to multiply NAICS - df.drop_duplicates(subset=['FlowName', 'FlowAmount', 'Compartment', - 'Location'], keep='first', inplace=True) - years = attr['allocation_source_year'] - 1 - df = df[~df[sector_column].isna()].reset_index(drop=True) - # drop aquaculture when disaggregating pastureland because water use for - # aquaculture calculated separately - df = disaggregate_pastureland(df, attr, method, years, sector_column, - download_FBA_if_missing=kwargs[ - 'download_FBA_if_missing'], - parameter_drop=['1125']) - df = disaggregate_cropland(df, attr, method, years, sector_column, - download_FBA_if_missing=kwargs['download_FBA_if_missing']) - - return df +# todo: delete +# def disaggregate_iwms_to_6_digit_naics_for_water_withdrawal(df, attr, method, +# **kwargs): +# """ +# Disaggregate the data in the USDA Irrigation and Water Management Survey +# to 6-digit NAICS using Census of Agriculture 'Land in Farm' data +# :param df: df, FBA format +# :param attr: dictionary, attribute data from method yaml for activity set +# :param method: dictionary, FBS method yaml +# :return: df, FBA format with disaggregated NAICS +# """ +# +# # define sector column to base df modifications +# sector_column = 'SectorConsumedBy' +# +# # address double counting brought on by iwms categories +# # applying to multiply NAICS +# df.drop_duplicates(subset=['FlowName', 'FlowAmount', 'Compartment', +# 'Location'], keep='first', inplace=True) +# years = attr['allocation_source_year'] - 1 +# df = df[~df[sector_column].isna()].reset_index(drop=True) +# # drop aquaculture when disaggregating pastureland because water use for +# # aquaculture calculated separately +# df = disaggregate_pastureland(df, attr, method, years, sector_column, +# download_FBA_if_missing=kwargs[ +# 'download_FBA_if_missing'], +# parameter_drop=['1125']) +# df = disaggregate_cropland(df, attr, method, years, sector_column, +# download_FBA_if_missing=kwargs['download_FBA_if_missing']) +# +# return df def iwms_aggregation(df_load, **kwargs): From 268acc9d4209f45e817c47b2025a0994da0843a6 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 5 Apr 2023 23:40:31 -0400 Subject: [PATCH 0479/1127] initial implementation of exclusion_fields --- flowsa/flowby.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index f79ace616..b7c26261d 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -425,9 +425,19 @@ def select_by_fields(self: FB, selection_fields: dict = None) -> FB: added using _FlowBy.add_primary_secondary_columns(), and the selection made based on 'PrimaryActivity' or 'PrimarySector', as specified. Selecting on secondary activities or sectors is not supported. + + Similarly, can use 'exclusion_fields' to remove particular data in the + same manner. ''' + exclusion_fields = self.config.get('exclusion_fields', {}) + exclusion_fields = {k: [v] if not isinstance(v, (list, dict)) else v + for k, v in exclusion_fields.items()} + for field, values in exclusion_fields.items(): + self = self.query(f'{field} not in @values') + selection_fields = (selection_fields or self.config.get('selection_fields')) + if selection_fields is None: return self From 961926c761af84db1af5aba291a0362d687aab6c Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 10 Apr 2023 15:19:41 -0400 Subject: [PATCH 0480/1127] initial update to write metadata, add v and githash to filenames --- flowsa/flowby.py | 10 ++++++++-- flowsa/metadata.py | 15 +++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index f79ace616..8281558ab 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -2100,8 +2100,14 @@ def generateFlowBySector( # aggregate to target sector fbs = fbs.sector_aggregation() - fbs.to_parquet(f'{settings.fbsoutputpath}{method}.parquet') - # TODO: Needs refinement + saving metadata + # Save fbs and metadata + log.info(f'FBS generation complete, saving {method} to file') + meta = metadata.set_fb_meta(method, 'FlowBySector') + esupy.processed_data_mgmt.write_df_to_file(fbs, settings.paths, meta) + metadata.write_metadata(source_name=method, + config={'source_names': sources}, + fb_meta=meta, + category='FlowBySector') return fbs diff --git a/flowsa/metadata.py b/flowsa/metadata.py index 59ad3bcfb..9ae1d5ec6 100644 --- a/flowsa/metadata.py +++ b/flowsa/metadata.py @@ -118,7 +118,7 @@ def return_fbs_method_data(source_name, config): meta['primary_source_meta'][k] = add_stewi_metadata( v['inventory_dict']) continue - if v['data_format'] in ('FBS', 'FBS_outside_flowsa'): + if v.get('data_format') in ('FBS', 'FBS_outside_flowsa'): meta['primary_source_meta'][k] = \ getMetadata(k, category='FlowBySector') continue @@ -130,17 +130,12 @@ def return_fbs_method_data(source_name, config): meta['primary_source_meta'][k]['allocation_source_meta'] = {} # subset activity data and allocate to sector for aset, attr in activities.items(): - if attr['allocation_method'] not in \ - (['direct', 'allocation_function']): + if attr.get('attribution_source'): # append fba meta + source = list(attr['attribution_source'].keys())[0] meta['primary_source_meta'][k]['allocation_source_meta'][ - attr['allocation_source']] = getMetadata( - attr['allocation_source'], attr['allocation_source_year']) - if 'helper_source' in attr: - meta['primary_source_meta'][k][ - 'allocation_source_meta'][attr['helper_source']] = \ - getMetadata(attr['helper_source'], - attr['helper_source_year']) + source] = getMetadata( + source, attr['attribution_source'][source].get('year')) if 'literature_sources' in attr: lit = attr['literature_sources'] for s, y in lit.items(): From 606f2020d23f14c2ea40da4d52e525ea35caaa17 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 10 Apr 2023 15:41:15 -0400 Subject: [PATCH 0481/1127] add AttributionSources field --- flowsa/flowby.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 8281558ab..fa1039e9a 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1053,6 +1053,11 @@ def attribute_flows_to_sectors( ) attribution_method = fba.config.get('attribution_method') + if attribution_method == 'direct' or attribution_method is None: + fba = fba.assign(AttributionSources='Direct') + else: + fba = fba.assign(AttributionSources=','.join( + [k for k in fba.config.get('attribution_source').keys()])) if attribution_method == 'proportional': attribution_fbs = fba.load_prepare_attribution_source() From 94cc2b8ce5ade2d04b6de47a5dad4f3f371b24aa Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 10 Apr 2023 13:55:32 -0600 Subject: [PATCH 0482/1127] move weighed_average() and substitute_nonexistent_values() to new flowsbyclean.py --- flowsa/flowby.py | 124 ----------------------------------- flowsa/flowbyclean.py | 147 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 147 insertions(+), 124 deletions(-) create mode 100644 flowsa/flowbyclean.py diff --git a/flowsa/flowby.py b/flowsa/flowby.py index b7c26261d..cb8c8ff7c 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1072,14 +1072,6 @@ def attribute_flows_to_sectors( attribution_fbs = fba.load_prepare_attribution_source() attributed_fba = fba.multiplication_attribution(attribution_fbs) - elif attribution_method == 'weighted_average': - attribution_fbs = fba.load_prepare_attribution_source() - attributed_fba = fba.weighted_average_attribution(attribution_fbs) - - elif attribution_method == 'substitute_nonexistent_values': - attribution_fbs = fba.load_prepare_attribution_source() - attributed_fba = fba.substitute_nonexistent_values(attribution_fbs) - else: if all(fba.groupby('group_id')['group_id'].agg('count') == 1): log.info('No attribution needed for %s at the given industry ' @@ -1668,122 +1660,6 @@ def multiplication_attribution( .reset_index(drop=True) ) - def weighted_average_attribution( - self: 'FlowByActivity', - other: 'FlowBySector' - ) -> 'FlowByActivity': - """ - This method determines weighted average - """ - - log.info('Taking weighted average of %s by %s.', - self.full_name, other.full_name) - fba_geoscale, other_geoscale, fba, other = self.harmonize_geoscale( - other) - - # merge dfs - merged = (fba - .merge(other, - how='left', - left_on=['PrimarySector', 'temp_location' - if 'temp_location' in fba - else 'Location'], - right_on=['PrimarySector', 'Location'], - suffixes=[None, '_other']) - .fillna({'FlowAmount_other': 0}) - ) - # drop rows where flow is 0 - merged = merged[merged['FlowAmount'] != 0] - # replace terms - for original, replacement in self.config.get( - 'replacement_dictionary').items(): - merged = merged.replace({original: replacement}) - - wt_flow = (merged - .groupby(['Class', 'MetaSources', 'Flowable', 'Unit', - 'FlowType', 'ActivityProducedBy', - 'ActivityConsumedBy', 'Context', 'Location', - 'LocationSystem', 'Year', 'MeasureofSpread', - 'Spread', 'DistributionType', 'Min', 'Max', - 'DataReliability', 'DataCollection', - 'SectorProducedBy', 'ProducedBySectorType', - 'SectorConsumedBy', 'ConsumedBySectorType', - 'SectorSourceName'], - dropna=False) - .apply(lambda x: np.average(x['FlowAmount'], - weights=x['FlowAmount_other'])) - .drop(columns='FlowAmount') # original flowamounts - .reset_index(name='FlowAmount') # new, weighted flows - ) - # set attributes todo: revise above code so don't lose attributes - attributes_to_save = { - attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] - } - for attr in attributes_to_save: - setattr(wt_flow, attr, attributes_to_save[attr]) - - # reset dropped information - wt_flow = (wt_flow - .reset_index(drop=True).reset_index() - .rename(columns={'index': 'group_id'}) - .assign(group_total=wt_flow.FlowAmount) - ) - - return wt_flow - - - def substitute_nonexistent_values( - self: 'FlowByActivity', - other: 'FlowBySector' - ) -> 'FlowByActivity': - """ - This method determines weighted average - """ - log.info('Substituting nonexistent values in %s with %s.', - self.full_name, other.full_name) - - fba = (self - .add_primary_secondary_columns('Sector') - .drop(columns=['group_id', 'group_total']) - ) - - other = other.add_primary_secondary_columns('Sector') - - # merge all possible national data with each state - state_geo = pd.concat([ - (geo.filtered_fips(self.config['geoscale'])[['FIPS']] - .assign(Location=location.US_FIPS)) - ]) - - other = (other - .merge(state_geo) - .drop(columns=['Location', 'FlowUUID']) - .rename(columns={'FIPS': 'Location', - 'FlowAmount': 'FlowAmount_other'}) - ) - - merged = (fba - .merge(other, - on=list(other.select_dtypes( - include=['object', 'int']).columns), - how='outer') - .assign(FlowAmount=lambda x: x.FlowAmount. - fillna(x.FlowAmount_other)) - .drop(columns=['PrimarySector', 'SecondarySector', - 'FlowAmount_other', 'group_id'], - errors='ignore') - .reset_index(drop=True).reset_index() - .rename(columns={'index': 'group_id'}) - ) - # replace float dtypes with new data - merged = (merged - .drop(merged.filter(regex='_x').columns, axis=1) - .rename(columns=lambda x: x.replace('_y', '')) - .assign(group_total=merged.FlowAmount) - ) - - return merged - def prepare_fbs(self: 'FlowByActivity') -> 'FlowBySector': if 'activity_sets' in self.config: diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py new file mode 100644 index 000000000..b2db750ad --- /dev/null +++ b/flowsa/flowbyclean.py @@ -0,0 +1,147 @@ +import numpy as np +import pandas as pd +from flowsa.flowsa_log import log +from flowsa import (flowby, geo, location) + + +def load_prepare_clean_source( + self: 'FlowByActivity' +) -> 'FlowBySector': + + (name, config), = self.config['clean_source'].items() + + clean_fbs = flowby.get_flowby_from_config( + name=name, + config={**{k: v for k, v in self.config.items() + if k in self.config['method_config_keys'] + or k == 'method_config_keys'}, + **flowby.get_catalog_info(name), + **config} + ).prepare_fbs() + return clean_fbs + + +def weighted_average( + fba: 'FlowByActivity', + **kwargs +) -> 'FlowByActivity': + """ + This method determines weighted average + """ + + # load secondary FBS + other = load_prepare_clean_source(fba) + + log.info('Taking weighted average of %s by %s.', + fba.full_name, other.full_name) + + fba_geoscale, other_geoscale, fba, other = fba.harmonize_geoscale( + other) + + # merge dfs + merged = (fba + .merge(other, + how='left', + left_on=['PrimarySector', 'temp_location' + if 'temp_location' in fba + else 'Location'], + right_on=['PrimarySector', 'Location'], + suffixes=[None, '_other']) + .fillna({'FlowAmount_other': 0}) + ) + # drop rows where flow is 0 + merged = merged[merged['FlowAmount'] != 0] + # replace terms + for original, replacement in fba.config.get( + 'replacement_dictionary').items(): + merged = merged.replace({original: replacement}) + + wt_flow = (merged + .groupby(['Class', 'Flowable', 'Unit', + 'FlowType', 'ActivityProducedBy', + 'ActivityConsumedBy', 'Context', 'Location', + 'LocationSystem', 'Year', 'MeasureofSpread', + 'Spread', 'DistributionType', 'Min', 'Max', + 'DataReliability', 'DataCollection', + 'SectorProducedBy', 'ProducedBySectorType', + 'SectorConsumedBy', 'ConsumedBySectorType', + 'SectorSourceName'], + dropna=False) + .apply(lambda x: np.average(x['FlowAmount'], + weights=x['FlowAmount_other'])) + .drop(columns='FlowAmount') # original flowamounts + .reset_index(name='FlowAmount') # new, weighted flows + ) + # set attributes todo: revise above code so don't lose attributes + attributes_to_save = { + attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] + } + for attr in attributes_to_save: + setattr(wt_flow, attr, attributes_to_save[attr]) + + # reset dropped information + wt_flow = (wt_flow + .reset_index(drop=True).reset_index() + .rename(columns={'index': 'group_id'}) + .assign(group_total=wt_flow.FlowAmount) + ) + + return wt_flow + + +def substitute_nonexistent_values( + fba: 'FlowByActivity', + **kwargs +) -> 'FlowByActivity': + """ + This method determines weighted average + """ + + # load secondary FBS + other = load_prepare_clean_source(fba) + other = (other + .add_primary_secondary_columns('Sector') + .drop(columns='MetaSources')) + + log.info('Substituting nonexistent values in %s with %s.', + fba.full_name, other.full_name) + + fba = (fba + .add_primary_secondary_columns('Sector') + .drop(columns=['group_id', 'group_total']) + ) + + # merge all possible national data with each state + state_geo = pd.concat([ + (geo.filtered_fips(fba.config['geoscale'])[['FIPS']] + .assign(Location=location.US_FIPS)) + ]) + + other = (other + .merge(state_geo) + .drop(columns=['Location', 'FlowUUID']) + .rename(columns={'FIPS': 'Location', + 'FlowAmount': 'FlowAmount_other'}) + ) + + merged = (fba + .merge(other, + on=list(other.select_dtypes( + include=['object', 'int']).columns), + how='outer') + .assign(FlowAmount=lambda x: x.FlowAmount. + fillna(x.FlowAmount_other)) + .drop(columns=['PrimarySector', 'SecondarySector', + 'FlowAmount_other', 'group_id'], + errors='ignore') + .reset_index(drop=True).reset_index() + .rename(columns={'index': 'group_id'}) + ) + # replace float dtypes with new data + merged = (merged + .drop(merged.filter(regex='_x').columns, axis=1) + .rename(columns=lambda x: x.replace('_y', '')) + .assign(group_total=merged.FlowAmount) + ) + + return merged From 1ef9e4856a403b9b23170ef9ee228c1478aca78e Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 10 Apr 2023 13:57:09 -0600 Subject: [PATCH 0483/1127] new '!clean_function:' to call on functions in flowbyclean.py --- flowsa/flowsa_yaml.py | 17 +++++++++++++++++ .../Water_national_2015_m1.yaml | 14 +++++++------- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/flowsa/flowsa_yaml.py b/flowsa/flowsa_yaml.py index 9a08fbfc8..df494fc1b 100644 --- a/flowsa/flowsa_yaml.py +++ b/flowsa/flowsa_yaml.py @@ -16,6 +16,7 @@ def __init__(self, stream: IO) -> None: self.add_multi_constructor('!include:', self.include) self.add_multi_constructor('!from_index:', self.from_index) self.add_multi_constructor('!script_function:', self.script_function) + self.add_multi_constructor('!clean_function:', self.clean_function) self.add_constructor('!external_config', self.external_config) self.external_paths_to_search = [] self.external_path_to_pass = None @@ -119,6 +120,22 @@ def script_function( return getattr(module, loader.construct_scalar(node)) + @staticmethod + def clean_function( + loader: 'FlowsaLoader', + module_name: str, + node: yaml.ScalarNode + ) -> Callable: + if not isinstance(node, yaml.ScalarNode): + raise TypeError('Can only tag scalar node with !clean_function:') + + # For security, this constructor does NOT search external config paths. + # If someone who understands security concerns better than I do feels + # it is safe to change this behavior, then go ahead. + module = importlib.import_module(f'flowsa.{module_name}') + return getattr(module, loader.construct_scalar(node)) + + def load(stream: IO, external_path: str = None) -> dict: loader = FlowsaLoader(stream) if external_path: diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index 316542515..fb48d4b2e 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -76,8 +76,8 @@ source_names: year: 2018 selection_fields: Class: Water - attribution_method: substitute_nonexistent_values - attribution_source: + clean_fba_w_sec: !clean_function:flowbyclean substitute_nonexistent_values + clean_source: USDA_IWMS: geoscale: national year: 2018 @@ -87,8 +87,8 @@ source_names: selection_fields: PrimaryActivity: ['SOYBEANS', 'CANOLA', 'FLAXSEED', 'MUSTARD, SEED', 'RAPESEED', 'SAFFLOWER', 'SESAME', - 'SUNFLOWER', 'CAMELINA', 'BEANS, DRY EDIBLE, (EXCL LIMA), - INCL CHICKPEAS', 'BEANS, DRY EDIBLE, (EXCL CHICKPEAS & + 'SUNFLOWER', 'CAMELINA', 'BEANS, DRY EDIBLE, (EXCL LIMA), + INCL CHICKPEAS', 'BEANS, DRY EDIBLE, (EXCL CHICKPEAS & LIMA)', 'BEANS, DRY EDIBLE, LIMA', 'CHICKPEAS', 'LENTILS', 'PEAS, DRY EDIBLE', 'PEAS, DRY, SOUTHERN (COWPEAS)', 'WHEAT', 'CORN', 'CORN, GRAIN', 'CORN, SILAGE', @@ -132,7 +132,7 @@ source_names: activity_sets: cropland_attribution-cropland-nonhay: selection_fields: - PrimaryActivity: ['BEANS, DRY EDIBLE, INCL + PrimaryActivity: ['BEANS, DRY EDIBLE, INCL CHICKPEAS', 'BERRY TOTALS', 'CORN, GRAIN', 'CORN, SILAGE', 'COTTON', 'CROPS, OTHER', 'HORTICULTURE TOTALS', 'ORCHARDS', @@ -144,12 +144,12 @@ source_names: selection_fields: PrimaryActivity: ['HAY & HAYLAGE, (EXCL ALFALFA)', 'HAY & HAYLAGE, ALFALFA'] - attribution_method: weighted_average + clean_fba_w_sec: !clean_function:flowbyclean weighted_average replacement_dictionary: {'HAY & HAYLAGE, (EXCL ALFALFA)': 'HAY & HAYLAGE', 'HAY & HAYLAGE, ALFALFA': 'HAY & HAYLAGE', '111940A': '111940', '111940B': '111940'} - attribution_source: + clean_source: USDA_IWMS: year: 2018 selection_fields: From 25cc9c1cd00b7d1b7f97503024b5506b80ef97b6 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 10 Apr 2023 16:07:53 -0400 Subject: [PATCH 0484/1127] avoid KeyError for sources with no activity sets --- flowsa/metadata.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flowsa/metadata.py b/flowsa/metadata.py index 9ae1d5ec6..44747d6d4 100644 --- a/flowsa/metadata.py +++ b/flowsa/metadata.py @@ -125,7 +125,9 @@ def return_fbs_method_data(source_name, config): # append source and year meta['primary_source_meta'][k] = getMetadata(k, v["year"]) # create dictionary of allocation datasets for different activities - activities = v['activity_sets'] + activities = v.get('activity_sets') + if activities is None: + continue # initiate nested dictionary meta['primary_source_meta'][k]['allocation_source_meta'] = {} # subset activity data and allocate to sector From eb9c14405eb73686fc8fecf239de2de76f4a8f31 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 10 Apr 2023 08:56:57 -0600 Subject: [PATCH 0485/1127] drop yamls that reference additional FBAs used in FBS - those FBAs now included in FBS yaml --- flowsa/bibliography.py | 19 +---- flowsa/common.py | 24 ------- .../fbs_methods_additional_fbas.yaml | 69 ------------------- .../functions_loading_fbas.yaml | 40 ----------- flowsa/metadata.py | 10 +-- 5 files changed, 2 insertions(+), 160 deletions(-) delete mode 100644 flowsa/data/bibliographyinfo/fbs_methods_additional_fbas.yaml delete mode 100644 flowsa/data/bibliographyinfo/functions_loading_fbas.yaml diff --git a/flowsa/bibliography.py b/flowsa/bibliography.py index 21687e8fd..4f3c3c3ec 100644 --- a/flowsa/bibliography.py +++ b/flowsa/bibliography.py @@ -10,9 +10,7 @@ from bibtexparser.bwriter import BibTexWriter from bibtexparser.bibdatabase import BibDatabase from flowsa.common import load_yaml_dict, \ - load_values_from_literature_citations_config, \ - load_fbs_methods_additional_fbas_config, \ - load_functions_loading_fbas_config, get_flowsa_base_name, \ + load_values_from_literature_citations_config, get_flowsa_base_name, \ sourceconfigpath, load_yaml_dict from flowsa.settings import outputpath, biboutputpath, log @@ -47,21 +45,6 @@ def generate_list_of_sources_in_fbs_method(methodname): if 'literature_sources' in attr: for source, date in attr['literature_sources'].items(): sources.append([source, date]) - # load any additional fbas that are called in a fbs method within fxns - try: - fbas = load_fbs_methods_additional_fbas_config()[methodname] - for s, acts_info in fbas.items(): - for acts, fxn_info in acts_info.items(): - for fxn, fba_info in fxn_info.items(): - for fba, y in fba_info.items(): - fxn_config = \ - load_functions_loading_fbas_config()[fxn][fba] - sources.append([fxn_config['source'], y]) - except KeyError: - # if no additional fbas than pass - log.info(f'There are no additional Flow-By-Activities ' - 'used in generating %s', methodname) - pass return sources diff --git a/flowsa/common.py b/flowsa/common.py index b010e8dfa..5891ba0ea 100644 --- a/flowsa/common.py +++ b/flowsa/common.py @@ -164,30 +164,6 @@ def load_values_from_literature_citations_config(): return config -def load_fbs_methods_additional_fbas_config(): - """ - Load the config file that contains information on where the - values from the literature come from - :return: dictionary of the values from the literature information - """ - sfile = f'{datapath}bibliographyinfo/fbs_methods_additional_fbas.yaml' - with open(sfile, 'r') as f: - config = yaml.safe_load(f) - return config - - -def load_functions_loading_fbas_config(): - """ - Load the config file that contains information on where the - values from the literature come from - :return: dictionary of the values from the literature information - """ - sfile = datapath + 'bibliographyinfo/functions_loading_fbas.yaml' - with open(sfile, 'r') as f: - config = yaml.safe_load(f) - return config - - def create_fill_na_dict(flow_by_fields): """ Dictionary for how to fill nan in different column types diff --git a/flowsa/data/bibliographyinfo/fbs_methods_additional_fbas.yaml b/flowsa/data/bibliographyinfo/fbs_methods_additional_fbas.yaml deleted file mode 100644 index f0b2a442e..000000000 --- a/flowsa/data/bibliographyinfo/fbs_methods_additional_fbas.yaml +++ /dev/null @@ -1,69 +0,0 @@ -CAP_HAP_national_2017: - EPA_NEI_Nonpoint: - activity_set_2: - disaggregate_cropland: - flowbyactivity_1: 2017 - disaggregate_pastureland: - flowbyactivity_1: 2017 -Land_national_2012: - USDA_ERS_MLU: - activity_set_1: - disaggregate_cropland: - flowbyactivity_1: 2012 - disaggregate_pastureland: - flowbyactivity_1: 2012 - activity_set_2: - disaggregate_cropland: - flowbyactivity_1: 2012 - disaggregate_pastureland: - flowbyactivity_1: 2012 -Water_national_2010_m1: - USGS_NWIS_WU: - activity_set_3: - disaggregate_cropland: - flowbyactivity_1: 2012 - disaggregate_pastureland: - flowbyactivity_1: 2012 -Water_national_2010_m2: - USGS_NWIS_WU: - activity_set_2: - convert_statcan_data_to_US_water_use: - 'flowbyactivity_1': 2011 - 'flowbyactivity_2': 2011 - activity_set_3: - convert_blackhurst_data_to_kg_per_year: - flowbyactivity_1: 2002 - convert_blackhurst_data_to_kg_per_employee: - flowbyactivity_1: 2002 - scale_blackhurst_results_to_usgs_values: - flowbyactivity_1: 2010 - activity_set_4: - disaggregate_cropland: - flowbyactivity_1: 2012 - disaggregate_pastureland: - flowbyactivity_1: 2012 -Water_national_2015_m1: - USGS_NWIS_WU: - activity_set_3: - disaggregate_cropland: - flowbyactivity_1: 2017 - disaggregate_pastureland: - flowbyactivity_1: 2017 -Water_national_2015_m2: - USGS_NWIS_WU: - activity_set_2: - convert_statcan_data_to_US_water_use: - 'flowbyactivity_1': 2015 - 'flowbyactivity_2': 2015 - activity_set_3: - convert_blackhurst_data_to_kg_per_year: - flowbyactivity_1: 2002 - convert_blackhurst_data_to_kg_per_employee: - flowbyactivity_1: 2002 - scale_blackhurst_results_to_usgs_values: - flowbyactivity_1: 2015 - activity_set_4: - disaggregate_cropland: - flowbyactivity_1: 2017 - disaggregate_pastureland: - flowbyactivity_1: 2017 diff --git a/flowsa/data/bibliographyinfo/functions_loading_fbas.yaml b/flowsa/data/bibliographyinfo/functions_loading_fbas.yaml deleted file mode 100644 index 3baf2d66b..000000000 --- a/flowsa/data/bibliographyinfo/functions_loading_fbas.yaml +++ /dev/null @@ -1,40 +0,0 @@ -assign_nonpoint_dqi: - flowbyactivity_1: - source: Census_CBP - year: - flowclass: -convert_blackhurst_data_to_kg_per_employee: - flowbyactivity_1: - source: BLS_QCEW - year: 2002 - flowclass: Employment -convert_blackhurst_data_to_kg_per_year: - flowbyactivity_1: - source: BEA_Make_AR - year: 2002 - flowclass: Money -convert_statcan_data_to_US_water_use: - flowbyactivity_1: - source: StatCan_GDP - year: __year__ - flowclass: Money - flowbyactivity_2: - source: BEA_GDP_GrossOutput - year: __year__ - flowclass: Money -disaggregate_cropland: - flowbyactivity_1: - source: USDA_CoA_Cropland_NAICS - year: __year__ - flowclass: Land -disaggregate_pastureland: - flowbyactivity_1: - source: USDA_CoA_Cropland_NAICS - year: __year__ - flowclass: Land -scale_blackhurst_results_to_usgs_values: - flowbyactivity_1: - source: USGS_NWIS_WU - year: __year__ - flowclass: Water - diff --git a/flowsa/metadata.py b/flowsa/metadata.py index 44747d6d4..28ee3c155 100644 --- a/flowsa/metadata.py +++ b/flowsa/metadata.py @@ -9,8 +9,7 @@ import pandas as pd from esupy.processed_data_mgmt import FileMeta, write_metadata_to_file, \ read_source_metadata -from flowsa.common import load_functions_loading_fbas_config, \ - load_fbs_methods_additional_fbas_config, return_true_source_catalog_name +from flowsa.common import return_true_source_catalog_name from flowsa.settings import paths, PKG, PKG_VERSION_NUMBER, WRITE_FORMAT, \ GIT_HASH, GIT_HASH_LONG, log @@ -95,13 +94,6 @@ def return_fbs_method_data(source_name, config): from flowsa.data_source_scripts.stewiFBS import add_stewi_metadata,\ add_stewicombo_metadata - # load the yaml that lists what additional fbas are - # used in creating the fbs - try: - add_fbas = load_fbs_methods_additional_fbas_config()[source_name] - except KeyError: - add_fbas = None - # Create empty dictionary for storing meta data meta = {} # subset the FBS dictionary into a dictionary of source names From 89ff2617b602d3dc1ab947cca9173354aad26aa0 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 11 Apr 2023 17:37:20 -0600 Subject: [PATCH 0486/1127] address year error in metadata --- flowsa/flowby.py | 3 ++- flowsa/metadata.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index fa1039e9a..375e83cde 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -2110,7 +2110,8 @@ def generateFlowBySector( meta = metadata.set_fb_meta(method, 'FlowBySector') esupy.processed_data_mgmt.write_df_to_file(fbs, settings.paths, meta) metadata.write_metadata(source_name=method, - config={'source_names': sources}, + config=common.load_yaml_dict( + method, 'FBS', external_config_path), fb_meta=meta, category='FlowBySector') diff --git a/flowsa/metadata.py b/flowsa/metadata.py index 28ee3c155..d49ca52f7 100644 --- a/flowsa/metadata.py +++ b/flowsa/metadata.py @@ -115,7 +115,8 @@ def return_fbs_method_data(source_name, config): getMetadata(k, category='FlowBySector') continue # append source and year - meta['primary_source_meta'][k] = getMetadata(k, v["year"]) + year = config['year'] if v.get('year') is None else v.get('year') + meta['primary_source_meta'][k] = getMetadata(k, year) # create dictionary of allocation datasets for different activities activities = v.get('activity_sets') if activities is None: From 96516db58399f68dc7f90b91fb9b17f8dbd2031d Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 11 Apr 2023 17:38:08 -0600 Subject: [PATCH 0487/1127] metadata - drop call to old FBA yaml that is no longer used and update "allocation" to "attribution" --- flowsa/metadata.py | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/flowsa/metadata.py b/flowsa/metadata.py index d49ca52f7..61f82a308 100644 --- a/flowsa/metadata.py +++ b/flowsa/metadata.py @@ -122,13 +122,13 @@ def return_fbs_method_data(source_name, config): if activities is None: continue # initiate nested dictionary - meta['primary_source_meta'][k]['allocation_source_meta'] = {} + meta['primary_source_meta'][k]['attribution_source_meta'] = {} # subset activity data and allocate to sector for aset, attr in activities.items(): if attr.get('attribution_source'): # append fba meta source = list(attr['attribution_source'].keys())[0] - meta['primary_source_meta'][k]['allocation_source_meta'][ + meta['primary_source_meta'][k]['attribution_source_meta'][ source] = getMetadata( source, attr['attribution_source'][source].get('year')) if 'literature_sources' in attr: @@ -137,23 +137,9 @@ def return_fbs_method_data(source_name, config): lit_meta = return_fba_method_meta(s, year=y) # append fba meta meta['primary_source_meta'][k][ - 'allocation_source_meta'][s] = lit_meta + 'attribution_source_meta'][s] = lit_meta # subset the additional fbas to the source and # activity set, if exists - if add_fbas is not None: - try: - fbas = add_fbas[k] - for acts, fxn_info in fbas.items(): - for fxn, fba_info in fxn_info.items(): - for fba, y in fba_info.items(): - fxn_config = \ - load_functions_loading_fbas_config()[fxn][fba] - meta['primary_source_meta'][k][ - 'allocation_source_meta'][ - fxn_config['source']] = getMetadata( - fxn_config['source'], y) - except KeyError: - pass return meta From ae7a3beccc4b9e8d95dd35f2bd05cb5132d359da Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 12 Apr 2023 10:30:42 -0400 Subject: [PATCH 0488/1127] consolidate with stewiFBS_common file --- .../CAP_HAP_national_2017.yaml | 18 ++----- .../CAP_HAP_state_2017.yaml | 19 ++------ .../CRHW_national_2017.yaml | 10 ++-- .../flowbysectormethods/CRHW_state_2017.yaml | 10 ++-- .../GRDREL_national_2017.yaml | 10 ++-- .../GRDREL_state_2017.yaml | 10 ++-- .../TRI_DMR_national_2017.yaml | 11 ++--- .../TRI_DMR_state_2017.yaml | 11 ++--- .../flowbysectormethods/stewiFBS_common.yaml | 48 +++++++++++++++++++ 9 files changed, 76 insertions(+), 71 deletions(-) create mode 100644 flowsa/methods/flowbysectormethods/stewiFBS_common.yaml diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index 30bda54a7..b42727498 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -275,18 +275,8 @@ source_names: selection_fields: ActivityProducedBy: {'324110': ''} # Petroleum - stewiFBS: - data_format: FBS_outside_flowsa - FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector - inventory_dict: {"NEI":"2017", "TRI":"2017"} + stewiFBS: !include:stewiFBS_common.yaml:CAP_HAP + inventory_dict: + NEI: 2017 + TRI: 2017 local_inventory_name: NEI_TRI_air_2017 - compartments: - - air - reassign_process_to_sectors: - - airplane_emissions - exclusion_fields: - FlowName: - - Carbon Dioxide - - Methane - - Nitrous Oxide - - Sulfur Hexafluoride diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml index b5d06983f..ab4c7a586 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml @@ -290,19 +290,8 @@ source_names: selection_fields: ActivityProducedBy: {'324': ''} # Petroleum 324110 - stewiFBS: - data_format: FBS_outside_flowsa - FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector - geoscale: state - inventory_dict: {"NEI":"2017", "TRI":"2017"} + stewiFBS: !include:stewiFBS_common.yaml:CAP_HAP + inventory_dict: + NEI: 2017 + TRI: 2017 local_inventory_name: NEI_TRI_air_2017 - compartments: - - air - reassign_process_to_sectors: - - airplane_emissions - exclusion_fields: - FlowName: - - Carbon Dioxide - - Methane - - Nitrous Oxide - - Sulfur Hexafluoride diff --git a/flowsa/methods/flowbysectormethods/CRHW_national_2017.yaml b/flowsa/methods/flowbysectormethods/CRHW_national_2017.yaml index ee1c43b5a..ed3c1aef0 100644 --- a/flowsa/methods/flowbysectormethods/CRHW_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CRHW_national_2017.yaml @@ -4,10 +4,6 @@ target_naics_year: 2012 year: 2017 geoscale: national source_names: - stewiFBS: - data_format: FBS_outside_flowsa - FBS_datapull_fxn: !script_function:stewiFBS stewi_to_sector - # Below are arguments needed by the stewicombo_to_sector function - inventory_dict: {"RCRAInfo":"2017"} - compartments: - - waste + stewiFBS: !include:stewiFBS_common.yaml:CRHW + inventory_dict: + RCRAInfo: 2017 diff --git a/flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml b/flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml index 3f71d9553..9f4aeae45 100644 --- a/flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CRHW_state_2017.yaml @@ -4,10 +4,6 @@ target_naics_year: 2012 year: 2017 geoscale: state source_names: - stewiFBS: - data_format: FBS_outside_flowsa - FBS_datapull_fxn: !script_function:stewiFBS stewi_to_sector - # Below are arguments needed by the stewicombo_to_sector function - inventory_dict: {"RCRAInfo":"2017"} - compartments: - - waste + stewiFBS: !include:stewiFBS_common.yaml:CRHW + inventory_dict: + RCRAInfo: 2017 diff --git a/flowsa/methods/flowbysectormethods/GRDREL_national_2017.yaml b/flowsa/methods/flowbysectormethods/GRDREL_national_2017.yaml index 7c3eef521..897e897b0 100644 --- a/flowsa/methods/flowbysectormethods/GRDREL_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/GRDREL_national_2017.yaml @@ -4,11 +4,7 @@ target_naics_year: 2012 year: 2017 geoscale: national source_names: - stewiFBS: - data_format: FBS_outside_flowsa - FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector - # Below are arguments needed by the stewicombo_to_sector function - inventory_dict: {"TRI":"2017"} + stewiFBS: !include:stewiFBS_common.yaml:GRDREL + inventory_dict: + TRI: 2017 local_inventory_name: TRI_GRDREL_2017 - compartments: - - soil diff --git a/flowsa/methods/flowbysectormethods/GRDREL_state_2017.yaml b/flowsa/methods/flowbysectormethods/GRDREL_state_2017.yaml index e797d4666..40d87017d 100644 --- a/flowsa/methods/flowbysectormethods/GRDREL_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/GRDREL_state_2017.yaml @@ -4,11 +4,7 @@ target_naics_year: 2012 year: 2017 geoscale: state source_names: - stewiFBS: - data_format: FBS_outside_flowsa - FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector - # Below are arguments needed by the stewicombo_to_sector function - inventory_dict: {"TRI":"2017"} + stewiFBS: !include:stewiFBS_common.yaml:GRDREL + inventory_dict: + TRI: 2017 local_inventory_name: TRI_GRDREL_2017 - compartments: - - soil diff --git a/flowsa/methods/flowbysectormethods/TRI_DMR_national_2017.yaml b/flowsa/methods/flowbysectormethods/TRI_DMR_national_2017.yaml index 2983ace36..578b05870 100644 --- a/flowsa/methods/flowbysectormethods/TRI_DMR_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/TRI_DMR_national_2017.yaml @@ -4,11 +4,8 @@ target_naics_year: 2012 year: 2017 geoscale: national source_names: - stewiFBS: - data_format: FBS_outside_flowsa - FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector - # Below are arguments needed by the stewicombo_to_sector function - inventory_dict: {"TRI":"2017", "DMR":"2017"} + stewiFBS: !include:stewiFBS_common.yaml:TRI_DMR + inventory_dict: + TRI: 2017 + DMR: 2017 local_inventory_name: TRI_DMR_2017 - compartments: - - water diff --git a/flowsa/methods/flowbysectormethods/TRI_DMR_state_2017.yaml b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2017.yaml index af03356d7..148c49b54 100644 --- a/flowsa/methods/flowbysectormethods/TRI_DMR_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2017.yaml @@ -4,11 +4,8 @@ target_naics_year: 2012 year: 2017 geoscale: state source_names: - stewiFBS: - data_format: FBS_outside_flowsa - FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector - # Below are arguments needed by the stewicombo_to_sector function - inventory_dict: {"TRI":"2017", "DMR":"2017"} + stewiFBS: !include:stewiFBS_common.yaml:TRI_DMR + inventory_dict: + TRI: 2017 + DMR: 2017 local_inventory_name: TRI_DMR_2017 - compartments: - - water diff --git a/flowsa/methods/flowbysectormethods/stewiFBS_common.yaml b/flowsa/methods/flowbysectormethods/stewiFBS_common.yaml new file mode 100644 index 000000000..a67c3b96c --- /dev/null +++ b/flowsa/methods/flowbysectormethods/stewiFBS_common.yaml @@ -0,0 +1,48 @@ + +GRDREL: + data_format: FBS_outside_flowsa + FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector + # Below are arguments needed by the stewicombo_to_sector function + inventory_dict: + TRI: 2017 + local_inventory_name: TRI_GRDREL_2017 + compartments: + - soil + +TRI_DMR: + data_format: FBS_outside_flowsa + FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector + # Below are arguments needed by the stewicombo_to_sector function + inventory_dict: + TRI: 2017 + DMR: 2017 + local_inventory_name: TRI_DMR_2017 + compartments: + - water + +CRHW: + data_format: FBS_outside_flowsa + FBS_datapull_fxn: !script_function:stewiFBS stewi_to_sector + # Below are arguments needed by the stewicombo_to_sector function + inventory_dict: + RCRAInfo: 2017 + compartments: + - waste + +CAP_HAP: + data_format: FBS_outside_flowsa + FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector + inventory_dict: + NEI: 2017 + TRI: 2017 + local_inventory_name: NEI_TRI_air_2017 + compartments: + - air + reassign_process_to_sectors: + - airplane_emissions + exclusion_fields: + FlowName: + - Carbon Dioxide + - Methane + - Nitrous Oxide + - Sulfur Hexafluoride From 25729ac79c6ec9424f04042727125bd8227c5cfb Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 12 Apr 2023 10:37:45 -0400 Subject: [PATCH 0489/1127] add `TRI_DMR_state_2019` as example stewi spec for other years --- .../flowbysectormethods/TRI_DMR_state_2019.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/TRI_DMR_state_2019.yaml diff --git a/flowsa/methods/flowbysectormethods/TRI_DMR_state_2019.yaml b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2019.yaml new file mode 100644 index 000000000..61b209b16 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2019.yaml @@ -0,0 +1,11 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +year: 2019 +geoscale: state +source_names: + stewiFBS: !include:stewiFBS_common.yaml:TRI_DMR + inventory_dict: + TRI: 2019 + DMR: 2019 + local_inventory_name: TRI_DMR_2019 From 410508f46c1b47179fb6de3de44f0966f26ce4db Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Apr 2023 08:37:58 -0600 Subject: [PATCH 0490/1127] add data_format to source_catalog --- flowsa/data/source_catalog.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 098f4eb36..1c2984565 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -177,6 +177,7 @@ EPA_CDDPath: activity_schema: sector_hierarchy: "flat" EPA_FactsAndFigures: + data_format: FBA class: - Other sector-like_activities: False @@ -235,6 +236,7 @@ EPA_NEI_Onroad: activity_schema: SCC sector_hierarchy: "flat" EPA_WARMer: + data_format: FBA class: - Chemicals - Energy @@ -251,6 +253,7 @@ EPA_WFR: activity_schema: None sector_hierarchy: "flat" NETL_EIA_PlantWater: + data_format: FBA class: - Water - Energy @@ -258,24 +261,28 @@ NETL_EIA_PlantWater: activity_schema: None sector_hierarchy: "flat" NOAA_FisheriesLandings: + data_format: FBA class: - Money sector-like_activities: False activity_schema: sector_hierarchy: "" StatCan_GDP: + data_format: FBA class: - Money sector-like_activities: True activity_schema: NAICS_2012_Code sector_hierarchy: "parent-completeChild" StatCan_IWS_MI: + data_format: FBA class: - Water sector-like_activities: True activity_schema: NAICS_2012_Code sector_hierarchy: "flat" StatCan_LFS: + data_format: FBA class: - Employment sector-like_activities: False @@ -358,18 +365,21 @@ USGS_MYB_Lead: activity_schema: sector_hierarchy: "" USGS_MYB_ManufacturedAbrasive: + data_format: FBA class: - Geological sector-like_activities: False activity_schema: sector_hierarchy: "" USGS_MYB_SodaAsh: + data_format: FBA class: - Geological sector-like_activities: False activity_schema: sector_hierarchy: "" USGS_MYB_Copper: + data_format: FBA class: - Geological sector-like_activities: False From 144ff6e7775a219570b371354d6d2311a3b5fbbc Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Apr 2023 09:39:58 -0600 Subject: [PATCH 0491/1127] initial efforts to transition food waste m2 to recursive method --- .../Food_Waste_national_2018_m2.yaml | 67 +++++++++---------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml index 101d974ff..26aaf83f4 100644 --- a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml +++ b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml @@ -1,49 +1,48 @@ # Attribute EPA's Wasted Food Report to sectors using the scoping memo for # attribution methodology -target_sector_level: NAICS_6 -target_subset_sector_level: {NAICS_7: ['562212', '562219']} -target_sector_source: NAICS_2012_Code -target_geoscale: national +industry_spec: + default: NAICS_6 + '562212': { default: NAICS_7 } + '562219': { default: NAICS_7 } +year: 2018 +target_naics_year: 2012 +geoscale: national + source_names: "CNHW_national_2018": - data_format: 'FBS' - activity_set_attribution: True selection_fields: - Flowable: - - Food - geoscale_to_use: national - clean_fbs_df_fxn: !script_function:EPA_WFR attribute_cnhw_food + Flowable: Food +# clean_fbs_df_fxn: !script_function:EPA_WFR attribute_cnhw_food activity_sets: wasted_food_report: - names: !from_index:CNHW_Food_asets.csv wasted_food_report - allocation_method: proportional - allocation_source: EPA_WFR - allocation_source_class: Other - allocation_source_year: 2018 - allocation_from_scale: national - allocation_merge_columns: [SectorProducedBy] + selection_fields: + PrimaryActivity: !from_index:CNHW_Food_asets.csv wasted_food_report + attribution_method: proportional + attribution_source: + EPA_WFR: + selection_fields: + Class: Other +# allocation_merge_columns: [SectorProducedBy] facts_and_figures: - names: !from_index:CNHW_Food_asets.csv facts_and_figures - allocation_method: proportional - allocation_source: EPA_FactsAndFigures - allocation_source_class: Other - allocation_flow: - - Food - allocation_source_year: 2018 - allocation_from_scale: national - allocation_merge_columns: [SectorProducedBy] + selection_fields: + PrimaryActivity: !from_index:CNHW_Food_asets.csv facts_and_figures + attribution_method: proportional + attribution_source: + EPA_FactsAndFigures: + selection_fields: + Class: Other + FlowName: Food +# allocation_merge_columns: [SectorProducedBy] # CNHW does not include residential food waste, so adding from EPA's # Wasted Food Report "EPA_WFR": - data_format: 'FBA' - class: Other - geoscale_to_use: national - year: 2018 + selection_fields: + Class: Other activity_sets: residential: - names: - - "Residential" - allocation_method: direct - allocation_from_scale: national + selection_fields: + PrimaryActivity: "Residential" + FlowName: {'Food': 'Food Waste'} # rename for consistency above + attribution_method: direct From 4b89947d854bc5a7c6763603bd544525b859165f Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 12 Apr 2023 12:24:47 -0400 Subject: [PATCH 0492/1127] update EIA MECS energy parse to incorporate suppressed data from `temp_data_source_functions` --- flowsa/data_source_scripts/EIA_MECS.py | 49 +++++-------------- .../temp_data_source_functions.py | 47 ------------------ .../EIA_MECS_Energy.yaml | 2 +- 3 files changed, 14 insertions(+), 84 deletions(-) diff --git a/flowsa/data_source_scripts/EIA_MECS.py b/flowsa/data_source_scripts/EIA_MECS.py index 7d990adb0..09f8c8540 100644 --- a/flowsa/data_source_scripts/EIA_MECS.py +++ b/flowsa/data_source_scripts/EIA_MECS.py @@ -404,10 +404,10 @@ def eia_mecs_energy_parse(*, df_list, source, year, **_): df = pd.concat(df_list, sort=True) # rename columns to match standard flowbyactivity format - df['Description'] = df["Table Name"] - df.loc[df['Subsector and Industry'] == 'Total', 'NAICS Code'] = '31-33' - df = df.drop(columns=['Table Name', 'Subsector and Industry']) - df = df.rename(columns={'NAICS Code': 'ActivityConsumedBy'}) + df = df.rename(columns={'NAICS Code': 'ActivityConsumedBy', + 'Table Name': 'Description'}) + df.loc[df['Subsector and Industry'] == 'Total', 'ActivityConsumedBy'] = '31-33' + df = df.drop(columns='Subsector and Industry') df['ActivityConsumedBy'] = df['ActivityConsumedBy'].str.strip() # add hardcoded data df["SourceName"] = source @@ -423,38 +423,15 @@ def eia_mecs_energy_parse(*, df_list, source, year, **_): df['DataCollection'] = 5 # tmp # drop rows that reflect subtotals (only necessary in 2014) - df.dropna(subset=['ActivityConsumedBy'], inplace=True) - - # replace withheld/unavailable data - # * = estimate is less than 0.5 - # W = withheld to avoid disclosing data for individual establishments - # Q = withheld because relative standard error is greater than 50 percent - # NA = not available - df.loc[df['FlowAmount'] == '*', 'FlowAmount'] = None - df.loc[df['FlowAmount'] == 'W', 'FlowAmount'] = WITHDRAWN_KEYWORD - df.loc[df['FlowAmount'] == 'Q', 'FlowAmount'] = WITHDRAWN_KEYWORD - df.loc[df['FlowAmount'] == 'S', 'FlowAmount'] = WITHDRAWN_KEYWORD - df.loc[df['FlowAmount'] == 'D', 'FlowAmount'] = None - df.loc[df['FlowAmount'] == 'NA', 'FlowAmount'] = None - df.loc[df['FlowAmount'] == '-', 'FlowAmount'] = None - # * = estimate is less than 0.5 - # W = withheld to avoid disclosing data for individual establishments - # Q = withheld because relative standard error is greater than 50 percent - # NA = not available - # X = not defined because relative standard error corresponds - # to a value of zero - # at least one 'empty' cell appears to contain a space - df.loc[df['Spread'] == '*', 'Spread'] = None - df.loc[df['Spread'] == 'W', 'Spread'] = WITHDRAWN_KEYWORD - df.loc[df['Spread'] == 'Q', 'Spread'] = WITHDRAWN_KEYWORD - df.loc[df['Spread'] == 'NA', 'Spread'] = None - df.loc[df['Spread'] == 'X', 'Spread'] = None - df.loc[df['Spread'] == ' ', 'Spread'] = None - df.loc[df['Spread'] == 'D', 'Spread'] = None - df.loc[df['Spread'] == '-', 'Spread'] = None - - # resolve issue of misprinted RSE - df['Spread'] = pd.to_numeric(df['Spread'], errors='coerce') + df = df.dropna(subset=['ActivityConsumedBy']) + + df = df.assign( + FlowAmount=df.FlowAmount.mask(df.FlowAmount.str.isnumeric() == False, + np.nan), + Suppressed=df.FlowAmount.where(df.FlowAmount.str.isnumeric() == False, + np.nan), + Spread=df.Spread.mask(df.Spread.str.isnumeric() == False, np.nan) + ) return df diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index 2b09667b0..7b754320a 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -167,53 +167,6 @@ def clean_usda_cropland_naics(fba: FlowByActivity, **kwargs): return filtered -def eia_mecs_energy_parse(*, df_list, source, year, **_): - """ - Combine, parse, and format the provided dataframes - :param df_list: list of dataframes to concat and format - :param year: year - :param source: source - :return: df, parsed and partially formatted to flowbyactivity - specifications - """ - from flowsa.location import assign_census_regions - - # concatenate dataframe list into single dataframe - df = pd.concat(df_list, sort=True) - - # rename columns to match standard flowbyactivity format - df = df.rename(columns={'NAICS Code': 'ActivityConsumedBy', - 'Table Name': 'Description'}) - df.loc[df['Subsector and Industry'] == 'Total', 'ActivityConsumedBy'] = '31-33' - df = df.drop(columns='Subsector and Industry') - df['ActivityConsumedBy'] = df['ActivityConsumedBy'].str.strip() - # add hardcoded data - df["SourceName"] = source - df["Compartment"] = None - df['FlowType'] = 'TECHNOSPHERE_FLOWS' - df['Year'] = year - df['MeasureofSpread'] = "RSE" - # assign location codes and location system - df.loc[df['Location'] == 'Total United States', 'Location'] = US_FIPS - df = assign_fips_location_system(df, year) - df = assign_census_regions(df) - df['DataReliability'] = 5 # tmp - df['DataCollection'] = 5 # tmp - - # drop rows that reflect subtotals (only necessary in 2014) - df.dropna(subset=['ActivityConsumedBy'], inplace=True) - - suppressed = df.assign( - FlowAmount=df.FlowAmount.mask(df.FlowAmount.str.isnumeric() == False, - np.nan), - Suppressed=df.FlowAmount.where(df.FlowAmount.str.isnumeric() == False, - np.nan), - Spread=df.Spread.mask(df.Spread.str.isnumeric() == False, np.nan) - ) - - return suppressed - - def estimate_suppressed_mecs_energy( fba: FlowByActivity, **kwargs diff --git a/flowsa/methods/flowbyactivitymethods/EIA_MECS_Energy.yaml b/flowsa/methods/flowbyactivitymethods/EIA_MECS_Energy.yaml index b6ac8ef21..e9ccd1335 100644 --- a/flowsa/methods/flowbyactivitymethods/EIA_MECS_Energy.yaml +++ b/flowsa/methods/flowbyactivitymethods/EIA_MECS_Energy.yaml @@ -9,7 +9,7 @@ url: base_url: https://www.eia.gov/consumption/manufacturing/data/__year__/xls/__table__.xlsx url_replace_fxn: !script_function:EIA_MECS eia_mecs_URL_helper call_response_fxn: !script_function:EIA_MECS eia_mecs_energy_call -parse_response_fxn: !script_function:temp_data_source_functions eia_mecs_energy_parse +parse_response_fxn: !script_function:EIA_MECS eia_mecs_energy_parse years: - 2010 - 2014 From 63bd8b67af6841b38d8263620f6c5e9bcf21136a Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Apr 2023 15:19:32 -0600 Subject: [PATCH 0493/1127] add metric tons to unit conversion --- flowsa/data/unit_conversion.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/data/unit_conversion.csv b/flowsa/data/unit_conversion.csv index 01daa5993..1528e8840 100644 --- a/flowsa/data/unit_conversion.csv +++ b/flowsa/data/unit_conversion.csv @@ -12,6 +12,7 @@ million Cubic metres/year,kg,1000000000 TON,kg,907.185 tons,kg,907.185 short tons,kg,907.185 +MT,kg,1000 LB,kg,0.45359 ACRE FEET / ACRE,kg/m2,304.8000006 gal/USD,kg/USD,3.79 From d5ef9209442c0550b9bba3e52124a4f3ea8c4d16 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Apr 2023 15:21:08 -0600 Subject: [PATCH 0494/1127] convert rei_waste_national to recursive method - results do not align with original method --- .../REI_waste_national_2012.yaml | 38 +++++++++++-------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml b/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml index c8c669265..d1e63c4d9 100644 --- a/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml +++ b/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml @@ -1,22 +1,30 @@ # Attribute REI's waste flows to SPB, SCB -target_sector_level: NAICS_6 -target_subset_sector_level: {NAICS_7: ['562212', '562219']} -target_sector_source: NAICS_2012_Code -target_geoscale: national +industry_spec: + default: NAICS_6 + '562212': { default: NAICS_7 } + '562219': { default: NAICS_7 } +year: 2012 +target_naics_year: 2012 +geoscale: national + source_names: "EPA_REI": - data_format: 'FBA' - class: Other selection_fields: - Description: - - useintersection - - makecol - geoscale_to_use: national - year: 2012 + PrimaryActivity: !from_index:EPA_REI_waste_2012_asets.csv waste + Class: Other + Description: makecol activity_sets: waste_flows: - names: !from_index:EPA_REI_waste_2012_asets.csv waste - allocation_method: allocation_function - allocation_source: !script_function:EPA_REI rei_waste_flows_attribution - allocation_from_scale: national + attribution_method: proportional #todo: want to use direct attribution before proportional + attribute_on: Flowable # FBA is mapped to FBS at this point, so FlowName is mapped to Flowable + fill_sector_column: SectorConsumedBy + attribution_source: + "EPA_REI": + selection_fields: + PrimaryActivity: !from_index:EPA_REI_waste_2012_asets.csv waste + Class: Other + Description: useintersection +# exclusion_fields: +# ActivityConsumedBy: ['Exports of goods and services', +# 'Imports of goods and services'] From 51c19f05190b85a0d8fcdb622b6ab3a6ac0c1f9c Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Apr 2023 15:23:09 -0600 Subject: [PATCH 0495/1127] enable proportional attribution on columns other than Sector cols --- flowsa/flowby.py | 159 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 114 insertions(+), 45 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 5042b911e..75f3197c8 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1519,11 +1519,19 @@ def harmonize_geoscale( ) fba = self.add_primary_secondary_columns('Sector') + + subset_cols = ['PrimarySector', 'Location', 'FlowAmount', 'Unit'] + groupby_cols = ['PrimarySector', 'Location', 'Unit'] + if self.config.get('attribute_on') is not None: + subset_cols = ['PrimarySector', 'Location', 'FlowAmount', 'Unit', + self.config.get('attribute_on')] + groupby_cols = ['PrimarySector', 'Location', 'Unit', + self.config.get('attribute_on')] other = ( other .add_primary_secondary_columns('Sector') - [['PrimarySector', 'Location', 'FlowAmount', 'Unit']] - .groupby(['PrimarySector', 'Location', 'Unit']) + [subset_cols] + .groupby(groupby_cols) .agg('sum') .reset_index() ) @@ -1545,48 +1553,108 @@ def proportionally_attribute( fba_geoscale, other_geoscale, fba, other = self.harmonize_geoscale(other) - groupby_cols = ['group_id'] - for rank in ['Primary', 'Secondary']: - counted = fba.assign(group_count=(fba.groupby(groupby_cols) - ['group_id'] - .transform('count'))) - directly_attributed = ( - counted - .query('group_count == 1') - .drop(columns='group_count') - ) - needs_attribution = ( - counted - .query('group_count > 1') - .drop(columns='group_count') + # attribute on sector columns + if self.config.get('attribute_on') is None: + groupby_cols = ['group_id'] + for rank in ['Primary', 'Secondary']: + counted = fba.assign(group_count=(fba.groupby(groupby_cols) + ['group_id'] + .transform('count'))) + directly_attributed = ( + counted + .query('group_count == 1') + .drop(columns='group_count') + ) + needs_attribution = ( + counted + .query('group_count > 1') + .drop(columns='group_count') + ) + + merged = ( + needs_attribution + .merge(other, + how='left', + left_on=[f'{rank}Sector', + 'temp_location' + if 'temp_location' in needs_attribution + else 'Location'], + right_on=['PrimarySector', 'Location'], + suffixes=[None, '_other']) + .fillna({'FlowAmount_other': 0}) + ) + + denominator_flag = ~merged.duplicated(subset=[*groupby_cols, + f'{rank}Sector']) + with_denominator = ( + merged + .assign(denominator=( + merged + .assign(FlowAmount_other=(merged.FlowAmount_other + * denominator_flag)) + .groupby(groupby_cols) + ['FlowAmount_other'] + .transform('sum'))) + ) + + non_zero_denominator = with_denominator.query(f'denominator != 0 ') + unattributable = with_denominator.query(f'denominator == 0 ') + + if not unattributable.empty: + log.warning( + 'Could not attribute activities %s in %s due to lack of ' + 'flows in attribution source %s for mapped %s sectors %s', + set(zip(unattributable.ActivityProducedBy, + unattributable.ActivityConsumedBy, + unattributable.Location)), + unattributable.full_name, + other.full_name, + rank, + set(unattributable[f'{rank}Sector']) + ) + + proportionally_attributed = ( + non_zero_denominator + .assign(FlowAmount=lambda x: (x.FlowAmount + * x.FlowAmount_other + / x.denominator)) + ) + + fba = pd.concat([directly_attributed, + proportionally_attributed], ignore_index=True) + # groupby_cols.append(rank) + + # else attribute on column specified in the FBS yaml + else: + + #todo: move this equal attribution into FBS method once + # refactored to allow multiple attribution methods + fba2 = fba.equally_attribute() + fba3 = (fba2.add_primary_secondary_columns('Sector')) + + groupby_cols = [self.config.get('attribute_on'), 'Unit'] + attribute_cols = self.config.get('attribute_on') + + other_with_denominator = ( + other + .assign(denominator=(other + .groupby(groupby_cols)['FlowAmount'] + .transform('sum'))) ) - merged = ( - needs_attribution - .merge(other, + with_denominator = ( + fba + .merge(other_with_denominator, how='left', - left_on=[f'{rank}Sector', + left_on=[attribute_cols, 'temp_location' - if 'temp_location' in needs_attribution + if 'temp_location' in fba else 'Location'], - right_on=['PrimarySector', 'Location'], + right_on=[attribute_cols, 'Location'], suffixes=[None, '_other']) .fillna({'FlowAmount_other': 0}) ) - denominator_flag = ~merged.duplicated(subset=[*groupby_cols, - f'{rank}Sector']) - with_denominator = ( - merged - .assign(denominator=( - merged - .assign(FlowAmount_other=(merged.FlowAmount_other - * denominator_flag)) - .groupby(groupby_cols) - ['FlowAmount_other'] - .transform('sum'))) - ) - non_zero_denominator = with_denominator.query(f'denominator != 0 ') unattributable = with_denominator.query(f'denominator == 0 ') @@ -1600,27 +1668,27 @@ def proportionally_attribute( unattributable.full_name, other.full_name, rank, - set(unattributable[f'{rank}Sector']) + set(unattributable[rank]) ) - proportionally_attributed = ( + fba = ( non_zero_denominator .assign(FlowAmount=lambda x: (x.FlowAmount * x.FlowAmount_other / x.denominator)) - .drop(columns=['PrimarySector_other', 'Location_other', - 'FlowAmount_other', 'denominator', - 'Unit_other'], - errors='ignore') ) - fba = pd.concat([directly_attributed, - proportionally_attributed], ignore_index=True) - groupby_cols.append(f'{rank}Sector') + + if self.config.get('fill_sector_column') is not None: + sector_col = self.config.get('fill_sector_column') + fba[sector_col] = fba['PrimarySector_other'] + return ( fba .drop(columns=['PrimarySector', 'SecondarySector', - 'temp_location'], + 'temp_location', 'PrimarySector_other', + 'Location_other', 'FlowAmount_other', 'denominator', + 'Unit_other'], errors='ignore') .reset_index(drop=True) ) @@ -2053,6 +2121,7 @@ def prepare_fbs(self: 'FlowBySector') -> 'FlowBySector': .select_by_fields() # TODO: Add a method to convert to proper industry spec. .convert_fips_to_geoscale() + .attribute_flows_to_sectors() # used to attribute activity sets .aggregate_flowby() # necessary after consolidating geoscale ) From 18d10a90f9c513c759a9f8cb2c9cc2a6574f42a0 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Apr 2023 16:38:19 -0600 Subject: [PATCH 0496/1127] update df names --- flowsa/flowby.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 75f3197c8..27e1b7be1 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1629,8 +1629,8 @@ def proportionally_attribute( #todo: move this equal attribution into FBS method once # refactored to allow multiple attribution methods - fba2 = fba.equally_attribute() - fba3 = (fba2.add_primary_secondary_columns('Sector')) + fba = fba.equally_attribute() + fba = (fba.add_primary_secondary_columns('Sector')) groupby_cols = [self.config.get('attribute_on'), 'Unit'] attribute_cols = self.config.get('attribute_on') From 28d8367d2971e64771107b9a47b107fd6a3fcc3c Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Apr 2023 17:00:33 -0600 Subject: [PATCH 0497/1127] comment out start of breaking FBS source data into activity sets --- flowsa/flowby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 27e1b7be1..2e46a110d 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -2121,7 +2121,7 @@ def prepare_fbs(self: 'FlowBySector') -> 'FlowBySector': .select_by_fields() # TODO: Add a method to convert to proper industry spec. .convert_fips_to_geoscale() - .attribute_flows_to_sectors() # used to attribute activity sets + # .attribute_flows_to_sectors() # used to attribute activity sets .aggregate_flowby() # necessary after consolidating geoscale ) From 725382d218407b4859dd14b5dcf5e46a20d09292 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Apr 2023 17:17:00 -0600 Subject: [PATCH 0498/1127] drop attributionsources col in substitute_nonexistent_values() --- flowsa/flowbyclean.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index b2db750ad..89b2935ba 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -101,7 +101,7 @@ def substitute_nonexistent_values( other = load_prepare_clean_source(fba) other = (other .add_primary_secondary_columns('Sector') - .drop(columns='MetaSources')) + .drop(columns=['MetaSources', 'AttributionSources'])) log.info('Substituting nonexistent values in %s with %s.', fba.full_name, other.full_name) From 725ffca2835218b5ad9db1e014493907c3d60000 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Apr 2023 17:17:00 -0600 Subject: [PATCH 0499/1127] drop attributionsources col in substitute_nonexistent_values() --- flowsa/flowbyclean.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index b2db750ad..89b2935ba 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -101,7 +101,7 @@ def substitute_nonexistent_values( other = load_prepare_clean_source(fba) other = (other .add_primary_secondary_columns('Sector') - .drop(columns='MetaSources')) + .drop(columns=['MetaSources', 'AttributionSources'])) log.info('Substituting nonexistent values in %s with %s.', fba.full_name, other.full_name) From e12c2e73bea45b2069c3c8916fd4847791a295f5 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 12 Apr 2023 21:07:13 -0400 Subject: [PATCH 0500/1127] consolidate `split_HFCS_by_type`, EPA_GHGI version is sufficient --- .../temp_data_source_functions.py | 14 -------------- .../methods/flowbysectormethods/SEEA_2016_v1.yaml | 2 +- .../flowbysectormethods/SEEA_2017_kg_v1.yaml | 2 +- .../methods/flowbysectormethods/SEEA_2017_v1.yaml | 2 +- .../methods/flowbysectormethods/SEEA_2017_v2.yaml | 2 +- 5 files changed, 4 insertions(+), 18 deletions(-) diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index 7b754320a..b51b940de 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -370,20 +370,6 @@ def clean_hfc_fba_for_seea(fba: FlowByActivity, **kwargs): return new_fba -def split_hfcs_by_type(fba: FlowByActivity, **kwargs): - attributes_to_save = { - attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] - } - - df = ghgi.split_HFCs_by_type(fba) - - new_fba = FlowByActivity(df) - for attr in attributes_to_save: - setattr(new_fba, attr, attributes_to_save[attr]) - - return new_fba - - def disaggregate_coa_cropland_to_6_digit_naics(fba: FlowByActivity): """ Disaggregate usda coa cropland to naics 6. Fragile implementation, should diff --git a/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml index 461371de4..5774f8189 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml @@ -777,7 +777,7 @@ source_names: EPA_GHGI_T_A_103: # HFCs from Transportation <<: *ghgi_parameters - # clean_fba_before_activity_sets: !script_function:temp_data_source_functions split_hfcs_by_type + # clean_fba_before_activity_sets: !script_function:EPA_GHGI split_hfcs_by_type activity_sets: passenger_cars: selection_fields: diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml index 5c3681ed5..400c6a982 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml @@ -806,7 +806,7 @@ source_names: EPA_GHGI_T_A_103: # HFCs from Transportation <<: *ghgi_parameters - # clean_fba_before_activity_sets: !script_function:temp_data_source_functions split_hfcs_by_type + # clean_fba_before_activity_sets: !script_function:EPA_GHGI split_hfcs_by_type activity_sets: passenger_cars: selection_fields: diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index 2b25270bc..a828b84b6 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -961,7 +961,7 @@ source_names: EPA_GHGI_T_A_103: # HFCs from Transportation <<: *ghgi_parameters - # clean_fba_before_activity_sets: !script_function:temp_data_source_functions split_hfcs_by_type + # clean_fba_before_activity_sets: !script_function:EPA_GHGI split_hfcs_by_type activity_sets: passenger_cars: selection_fields: diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml index 7282a1299..09c1f5dfb 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml @@ -941,7 +941,7 @@ source_names: ActivityProducedBy: '326150' # Urethane and other foams. EPA_GHGI_T_A_103: # HFCs from Transportation - # clean_fba_before_activity_sets: !script_function:temp_data_source_functions split_hfcs_by_type + # clean_fba_before_activity_sets: !script_function:EPA_GHGI split_hfcs_by_type activity_sets: passenger_cars: selection_fields: From f4565353aa08e72d60b6892550eb86df15ef7e15 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 12 Apr 2023 21:27:10 -0400 Subject: [PATCH 0501/1127] move MECS functions out of temp_data_source_functions --- flowsa/data_source_scripts/EIA_MECS.py | 152 +++++++++++++++++- .../temp_data_source_functions.py | 148 ----------------- .../CAP_HAP_national_2017.yaml | 6 +- .../CAP_HAP_state_2017.yaml | 4 +- .../flowbysectormethods/GHG_national_m1.yaml | 6 +- 5 files changed, 157 insertions(+), 159 deletions(-) diff --git a/flowsa/data_source_scripts/EIA_MECS.py b/flowsa/data_source_scripts/EIA_MECS.py index 09f8c8540..2943ff534 100644 --- a/flowsa/data_source_scripts/EIA_MECS.py +++ b/flowsa/data_source_scripts/EIA_MECS.py @@ -436,6 +436,155 @@ def eia_mecs_energy_parse(*, df_list, source, year, **_): return df +def estimate_suppressed_mecs_energy( + fba: FlowByActivity, + **kwargs + ) -> FlowByActivity: + ''' + Rough first pass at an estimation method, for testing purposes. This + will drop rows with 'D' or 'Q' values, on the grounds that as far as I can + tell we don't have any more information for them than we do for any + industry without its own line item in the MECS anyway. '*' is for value + less than 0.5 Trillion Btu and will be assumed to be 0.25 Trillion Btu + ''' + if 'Suppressed' not in fba.columns: + log.warning('The current MECS dataframe does not contain data ' + 'on estimation method and so suppressed data will ' + 'not be assessed.') + return fba + dropped = fba.query('Suppressed not in ["D", "Q"]') + unsuppressed = dropped.assign( + FlowAmount=dropped.FlowAmount.mask(dropped.Suppressed == '*', 0.25) + ) + + return unsuppressed.drop(columns='Suppressed') + +def clean_mecs_energy_fba(fba: FlowByActivity, **_) -> FlowByActivity: + ''' + This function helps address the unique structure of the EIA MECS dataset. + The MECS dataset contains rows at various levels of aggregation between + NAICS-3 and NAICS-6 (inclusive). Each aggregated row contains the total + for that level of aggregation, even if data are also reported for a less + aggregated subset of those industries. For example: + + ActivityConsumedBy | FlowAmount | ... + ------------------------------------- + 311 | 110 | + 3112 | 65 | + 311221 | 55 | + + where the 110 reported for 311 includes the 65 reported for 3112, which + includes the 55 reported for 211221. If we do not address this issue, there + will be double counting. Additionally, if we are trying to disaggregate + to the NAICS-6 level, all three rows shown above will be mapped to NAICS-6 + 311221 (with the first wo rows also being mapped to several other NAICS-6 + codes as well). We will then over attribute the (double-counted) flows to + those industries and groups of industries for which more specific detail + is provided. + + This function addresses the double counting issue. For each aggregated + industry group, all descendant (less aggregated) industries or industry + groups for which detailed information is given are subtracted from the + aggregated total. Using the example from above: + + ActivityConsumedBy | FlowAmount | ... + ------------------------------------- + 311 | 45 | + 3112 | 10 | + 311221 | 55 | + + Additionally, this function adds a column called "descendants", which for + each industry holds all the descendant industries or industry groups that + have detailed information provided in the dataset. After mapping to + industries, but before attribution is performed, this column is used by the + clean_mapped_mecs_energy_fba function to drop any row that is mapped + from an aggregated industry group to a less aggregated industry or industry + group THAT HAS DETAILED INFORMATION GIVEN IN THE MECS (and therefore has + its own row already) to avoid the over-attribution issue. + Again using the previous example: + + ActivityConsumedBy | FlowAmount | descendants | ... + --------------------------------------------------- + 311 | 45 | 3112 311221 | + 3112 | 10 | 311221 | + 311221 | 55 | | + + Note that this function is not useful if the desired aggregation level is + NAICS-2. In such a case, the MECS dataset can be filtered to include only + the rows with ActivityConsumedBy == "31-33", then disaggregated to 31, 32, + 33 using another dataset (such as the QCEW). + ''' + mecs = ( + fba + .query('ActivityConsumedBy != "31-33"') + .assign(descendants='') + ) + + for level in [5, 4, 3]: + descendants = ( + mecs + .drop(columns='descendants') + .query(f'ActivityConsumedBy.str.len() > {level}') + .assign( + parent=lambda x: x.ActivityConsumedBy.str.slice(stop=level) + ) + .groupby(['Flowable', 'Location', 'parent']) + .agg({'FlowAmount': 'sum', 'ActivityConsumedBy': ' '.join}) + .reset_index() + .rename(columns={'ActivityConsumedBy': 'descendants', + 'FlowAmount': 'descendant_flows', + 'parent': 'ActivityConsumedBy'}) + ) + + mecs = ( + mecs + .merge(descendants, + how='left', + on=['Flowable', 'Location', 'ActivityConsumedBy'], + suffixes=(None, '_y')) + .fillna({'descendant_flows': 0, 'descendants_y': ''}) + .assign( + descendants=lambda x: x.descendants.mask(x.descendants == '', + x.descendants_y), + FlowAmount=lambda x: (x.FlowAmount - x.descendant_flows).mask( + x.FlowAmount - x.descendant_flows < 0, 0) + ) + .drop(columns=['descendant_flows', 'descendants_y']) + ) + + return mecs + + +def clean_mapped_mecs_energy_fba(fba: FlowByActivity, **_) -> FlowByActivity: + ''' + This function finishes handling the over-attribution issue described in + the documentation for clean_mecs_energy_fba by dropping any row in the + MECS dataset which has been mapped to an industry or industry group which + is a subset (strict or otherwise) of an industry group listed in the + descendants columns. So, if 311 and 3112 both appear in the MECS datset, + 3112 will be listed as a descendant of 311 and this function will therefore + drop a row mapping 311 to 311221 (since more detailed information on 3112, + which contains 311221, is provided). If 31122 and 311221 do not appear in + the dataset, a row mapping 3112 to 311221 will not be dropped, since no + more detailed information on 311221 is given. Further attribution/ + disaggregation should be done using another datatset such as the QCEW. + ''' + mecs = ( + fba + .assign(to_keep=fba.apply( + lambda x: not any([str(x.SectorConsumedBy).startswith(d) + for d in x.descendants.split()]), + axis='columns' + )) + .query('to_keep') + .drop(columns=['descendants', 'to_keep']) + ) + + return mecs + + + + def clean_mapped_mecs_energy_fba_to_state( fba: FlowByActivity, **_ ) -> FlowByActivity: @@ -501,9 +650,6 @@ def mecs_land_fba_cleanup(fba, **_): :param fba: df, EIA MECS Land FBA format :return: df, EA MECS Land FBA """ - from flowsa.data_source_scripts.temp_data_source_functions import \ - clean_mecs_energy_fba - fba2 = clean_mecs_energy_fba(fba) # calculate the land area in addition to building footprint diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index b51b940de..e60569554 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -167,30 +167,6 @@ def clean_usda_cropland_naics(fba: FlowByActivity, **kwargs): return filtered -def estimate_suppressed_mecs_energy( - fba: FlowByActivity, - **kwargs -) -> FlowByActivity: - ''' - Rough first pass at an estimation method, for testing purposes. This - will drop rows with 'D' or 'Q' values, on the grounds that as far as I can - tell we don't have any more information for them than we do for any - industry without its own line item in the MECS anyway. '*' is for value - less than 0.5 Trillion Btu and will be assumed to be 0.25 Trillion Btu - ''' - if 'Suppressed' not in fba.columns: - log.warning('The current MECS dataframe does not contain data ' - 'on estimation method and so suppressed data will ' - 'not be assessed.') - return fba - dropped = fba.query('Suppressed not in ["D", "Q"]') - unsuppressed = dropped.assign( - FlowAmount=dropped.FlowAmount.mask(dropped.Suppressed == '*', 0.25) - ) - - return unsuppressed.drop(columns='Suppressed') - - def clean_mecs_energy_fba_for_bea_summary(fba: FlowByActivity, **kwargs): naics_3 = fba.query('ActivityConsumedBy.str.len() == 3') naics_4 = fba.query('ActivityConsumedBy.str.len() == 4 ' @@ -227,130 +203,6 @@ def clean_mapped_mecs_energy_fba_for_bea_summary( '& ActivityConsumedBy != SectorConsumedBy)') -def clean_mecs_energy_fba(fba: FlowByActivity, **_) -> FlowByActivity: - ''' - This function helps address the unique structure of the EIA MECS dataset. - The MECS dataset contains rows at various levels of aggregation between - NAICS-3 and NAICS-6 (inclusive). Each aggregated row contains the total - for that level of aggregation, even if data are also reported for a less - aggregated subset of those industries. For example: - - ActivityConsumedBy | FlowAmount | ... - ------------------------------------- - 311 | 110 | - 3112 | 65 | - 311221 | 55 | - - where the 110 reported for 311 includes the 65 reported for 3112, which - includes the 55 reported for 211221. If we do not address this issue, there - will be double counting. Additionally, if we are trying to disaggregate - to the NAICS-6 level, all three rows shown above will be mapped to NAICS-6 - 311221 (with the first wo rows also being mapped to several other NAICS-6 - codes as well). We will then over attribute the (double-counted) flows to - those industries and groups of industries for which more specific detail - is provided. - - This function addresses the double counting issue. For each aggregated - industry group, all descendant (less aggregated) industries or industry - groups for which detailed information is given are subtracted from the - aggregated total. Using the example from above: - - ActivityConsumedBy | FlowAmount | ... - ------------------------------------- - 311 | 45 | - 3112 | 10 | - 311221 | 55 | - - Additionally, this function adds a column called "descendants", which for - each industry holds all the descendant industries or industry groups that - have detailed information provided in the dataset. After mapping to - industries, but before attribution is performed, this column is used by the - clean_mapped_mecs_energy_fba function to drop any row that is mapped - from an aggregated industry group to a less aggregated industry or industry - group THAT HAS DETAILED INFORMATION GIVEN IN THE MECS (and therefore has - its own row already) to avoid the over-attribution issue. - Again using the previous example: - - ActivityConsumedBy | FlowAmount | descendants | ... - --------------------------------------------------- - 311 | 45 | 3112 311221 | - 3112 | 10 | 311221 | - 311221 | 55 | | - - Note that this function is not useful if the desired aggregation level is - NAICS-2. In such a case, the MECS dataset can be filtered to include only - the rows with ActivityConsumedBy == "31-33", then disaggregated to 31, 32, - 33 using another dataset (such as the QCEW). - ''' - mecs = ( - fba - .query('ActivityConsumedBy != "31-33"') - .assign(descendants='') - ) - - for level in [5, 4, 3]: - descendants = ( - mecs - .drop(columns='descendants') - .query(f'ActivityConsumedBy.str.len() > {level}') - .assign( - parent=lambda x: x.ActivityConsumedBy.str.slice(stop=level) - ) - .groupby(['Flowable', 'Location', 'parent']) - .agg({'FlowAmount': 'sum', 'ActivityConsumedBy': ' '.join}) - .reset_index() - .rename(columns={'ActivityConsumedBy': 'descendants', - 'FlowAmount': 'descendant_flows', - 'parent': 'ActivityConsumedBy'}) - ) - - mecs = ( - mecs - .merge(descendants, - how='left', - on=['Flowable', 'Location', 'ActivityConsumedBy'], - suffixes=(None, '_y')) - .fillna({'descendant_flows': 0, 'descendants_y': ''}) - .assign( - descendants=lambda x: x.descendants.mask(x.descendants == '', - x.descendants_y), - FlowAmount=lambda x: (x.FlowAmount - x.descendant_flows).mask( - x.FlowAmount - x.descendant_flows < 0, 0) - ) - .drop(columns=['descendant_flows', 'descendants_y']) - ) - - return mecs - - -def clean_mapped_mecs_energy_fba(fba: FlowByActivity, **_) -> FlowByActivity: - ''' - This function finishes handling the over-attribution issue described in - the documentation for clean_mecs_energy_fba by dropping any row in the - MECS dataset which has been mapped to an industry or industry group which - is a subset (strict or otherwise) of an industry group listed in the - descendants columns. So, if 311 and 3112 both appear in the MECS datset, - 3112 will be listed as a descendant of 311 and this function will therefore - drop a row mapping 311 to 311221 (since more detailed information on 3112, - which contains 311221, is provided). If 31122 and 311221 do not appear in - the dataset, a row mapping 3112 to 311221 will not be dropped, since no - more detailed information on 311221 is given. Further attribution/ - disaggregation should be done using another datatset such as the QCEW. - ''' - mecs = ( - fba - .assign(to_keep=fba.apply( - lambda x: not any([str(x.SectorConsumedBy).startswith(d) - for d in x.descendants.split()]), - axis='columns' - )) - .query('to_keep') - .drop(columns=['descendants', 'to_keep']) - ) - - return mecs - - def clean_hfc_fba_for_seea(fba: FlowByActivity, **kwargs): attributes_to_save = { attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index b42727498..3547690a1 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -15,9 +15,9 @@ sources_to_cache: Description: - Table 2.2 - Table 3.2 - estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_mecs_energy - clean_fba: !script_function:temp_data_source_functions clean_mecs_energy_fba - clean_fba_w_sec: !script_function:temp_data_source_functions clean_mapped_mecs_energy_fba + estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy + clean_fba: !script_function:EIA_MECS clean_mecs_energy_fba + clean_fba_w_sec: !script_function:EIA_MECS clean_mapped_mecs_energy_fba attribution_method: proportional attribution_source: Employment_national_2014: diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml index ab4c7a586..c15de32f3 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml @@ -21,8 +21,8 @@ sources_to_cache: - Table 3.2 exclusion_fields: Location: '00000' - estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_mecs_energy - clean_fba: !script_function:temp_data_source_functions clean_mecs_energy_fba + estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy + clean_fba: !script_function:EIA_MECS clean_mecs_energy_fba clean_fba_w_sec: !script_function:EIA_MECS clean_mapped_mecs_energy_fba_to_state attribution_method: proportional attribution_source: diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml index ba5639b75..007ac81be 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml @@ -28,9 +28,9 @@ attribution_sources: Description: - Table 2.2 # applies to Class Other - Table 3.2 # applies to Class Energy - estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_mecs_energy - clean_fba: !script_function:temp_data_source_functions clean_mecs_energy_fba - clean_fba_w_sec: !script_function:temp_data_source_functions clean_mapped_mecs_energy_fba + estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy + clean_fba: !script_function:EIA_MECS clean_mecs_energy_fba + clean_fba_w_sec: !script_function:EIA_MECS clean_mapped_mecs_energy_fba attribution_method: proportional # attribution_source: # Include in main method # BEA_Use_Detail_PRO_BeforeRedef: From d3aeb70fd4e4f17697122239b39653d652ecde33 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 12 Apr 2023 21:29:27 -0400 Subject: [PATCH 0502/1127] remove outdated code --- flowsa/data_source_scripts/EIA_MECS.py | 211 +------------------------ flowsa/data_source_scripts/EPA_GHGI.py | 115 -------------- 2 files changed, 6 insertions(+), 320 deletions(-) diff --git a/flowsa/data_source_scripts/EIA_MECS.py b/flowsa/data_source_scripts/EIA_MECS.py index 2943ff534..c8a88c784 100644 --- a/flowsa/data_source_scripts/EIA_MECS.py +++ b/flowsa/data_source_scripts/EIA_MECS.py @@ -13,12 +13,10 @@ import numpy as np import flowsa from flowsa.location import US_FIPS, get_region_and_division_codes -from flowsa.common import WITHDRAWN_KEYWORD, load_crosswalk -from flowsa.settings import vLogDetailed, log +from flowsa.common import WITHDRAWN_KEYWORD +from flowsa.settings import log from flowsa.flowby import FlowByActivity from flowsa.flowbyfunctions import assign_fips_location_system, sector_aggregation -from flowsa.dataclean import replace_strings_with_NoneType, \ - replace_NoneType_with_empty_cells from flowsa.data_source_scripts.EIA_CBECS_Land import \ calculate_total_facility_land_area @@ -588,10 +586,10 @@ def clean_mapped_mecs_energy_fba(fba: FlowByActivity, **_) -> FlowByActivity: def clean_mapped_mecs_energy_fba_to_state( fba: FlowByActivity, **_ ) -> FlowByActivity: - """clean_fba_w_sec fxn that replicates - clean_mapped_mecs_energy_fba but also updates regions to - states for state models""" - from flowsa.data_source_scripts.temp_data_source_functions import clean_mapped_mecs_energy_fba + """ + clean_fba_w_sec fxn that replicates clean_mapped_mecs_energy_fba but + also updates regions to states for state models. + """ fba = clean_mapped_mecs_energy_fba(fba) fba = update_regions_to_states(fba) return fba @@ -656,200 +654,3 @@ def mecs_land_fba_cleanup(fba, **_): fba3 = calculate_total_facility_land_area(fba2) return fba3 - -# todo: delete next fxn -# def mecs_land_fba_cleanup_for_land_2012_fbs(fba, **_): -# """ -# The 'land_national_2012' FlowBySector uses MECS 2014 data, set -# MECS year to 2012 -# :param fba: df, EIA MECS Land, FBA format -# :return: df, EIA MECS Land FBA modified -# """ -# -# fba = mecs_land_fba_cleanup(fba=fba) -# -# # reset the EIA MECS Land year from 2014 to 2012 to match -# # the USDA ERS MLU year -# vLogDetailed.info('Resetting year from 2014 to 2012') -# fba['Year'] = 2012 -# -# return fba - -# todo: delete -# def mecs_land_clean_allocation_mapped_fba_w_sec(df, attr, method): -# """ -# The mecs land dataset has varying levels of information for naics3-6. -# Iteratively determine which activities need allocated -# -# :param df: The mecs df with sectors after mapped to FEDEFL -# :param attr: dictionary, attribute data from method yaml for activity set -# :param method: string, methodname -# :return: df, with additional column flagging rows where sectors should -# be disaggregated -# """ -# -# sector_column = 'SectorConsumedBy' -# df = determine_flows_requiring_disaggregation( -# df, attr, method, sector_column) -# -# return df - - -# TODO confirm this function can be dropped and replaced -# def determine_flows_requiring_disaggregation( -# df_load, attr, method, sector_column): -# """ -# The MECS Land data provides FlowAmounts for NAICS3-6. We use BLS QCEW -# employment data to determine land use for different industries. To -# accurately estimate land use per industry, existing FlowAmounts for a -# particular NAICS level (NAICS6) for example, should be subtracted from -# the possible FlowAmounts for other NAICS6 that share the first 5 digits. -# For Example, there is data for '311', '3112', and '311221' in the 2014 -# dataset. FlowAmounts for allocation by employment for NAICS6 are based -# on the provided '3112' FlowAmounts. However, since there is data at one -# NAICS6 (311221), the FlowAmount for that NAICS6 should be subtracted -# from other NAICS6 to accurately depict the remaining 'FlowAmount' that -# requires a secondary source (Employment data) for allocation. -# :param df_load: df, EIA MECS Land FBA -# :param attr: dictionary, attribute data from method yaml for activity set -# :param method: dictionary, FBS method yaml -# :param sector_column: str, sector column to flag ('SectorProducedBy', -# 'SectorConsumedBy') -# :return: A dataframe with a column 'disaggregate_flag', if '1', -# row requires secondary source to calculate -# FlowAmount, if '0' FlowAmount does not require modifications -# """ -# -# from flowsa.sectormapping import add_sectors_to_flowbyactivity -# -# df_load = replace_NoneType_with_empty_cells(df_load) -# # drop rows where there is no value in sector column, which might occur if -# # sector-like activities have a "-" in them -# df_load = df_load[df_load[sector_column] != ''] -# -# # determine activity column -# if sector_column == 'SectorConsumedBy': -# activity_column = 'ActivityConsumedBy' -# else: -# activity_column = 'ActivityProducedBy' -# -# # original df - subset -# # subset cols of original df -# dfo = df_load[['FlowName', 'FlowAmount', 'Location', sector_column]] -# # min and max length -# min_length = min(df_load[sector_column].apply( -# lambda x: len(str(x))).unique()) -# max_length = max(df_load[sector_column].apply( -# lambda x: len(str(x))).unique()) -# # subset by sector length, creating a df -# for s in range(min_length, max_length + 1): -# df_name = 'dfo_naics' + str(s) -# vars()[df_name] = dfo[dfo[sector_column].apply( -# lambda x: len(x) == s)].reset_index(drop=True) -# vars()[df_name] = vars()[df_name].assign( -# SectorMatch=vars()[df_name][sector_column].apply( -# lambda x: x[:len(x) - 1])) -# # loop through the dfs, merging by sector match. If there is a match, -# # subtract the value, if there is not a match, drop last digit in -# # sectormatch, add row to the next df, and repeat -# df_merged = pd.DataFrame() -# df_not_merged = pd.DataFrame() -# for s in range(max_length, min_length, -1): -# df_name_1 = 'dfo_naics' + str(s - 1) -# df_name_2 = 'dfo_naics' + str(s) -# # concat df 1 with df_not_merged -# df2 = pd.concat([vars()[df_name_2], df_not_merged]) -# df2 = df2.rename( -# columns={'FlowAmount': 'SubtractFlow', sector_column: 'Sector'}) -# df_m = pd.merge( -# vars()[df_name_1][['FlowName', 'FlowAmount', 'Location', -# sector_column]], -# df2, left_on=['FlowName', 'Location', sector_column], -# right_on=['FlowName', 'Location', 'SectorMatch'], -# indicator=True, how='outer') -# # subset by merge and append to appropriate df -# df_both = df_m[df_m['_merge'] == 'both'] -# if len(df_both) != 0: -# # drop columns -# df_both1 = df_both.drop( -# columns=['Sector', 'SectorMatch', '_merge']) -# # aggregate before subtracting -# df_both2 = df_both1.groupby( -# ['FlowName', 'FlowAmount', 'Location', sector_column], -# as_index=False).agg({"SubtractFlow": sum}) -# df_both3 = df_both2.assign( -# FlowAmount=df_both2['FlowAmount'] - df_both2['SubtractFlow']) -# df_both3 = df_both3.drop(columns=['SubtractFlow']) -# # drop rows where 0 -# # df_both = df_both[df_both['FlowAmount'] != 0] -# df_merged = pd.concat([df_merged, df_both3], ignore_index=True) -# df_right = df_m[df_m['_merge'] == 'right_only'] -# if len(df_right) != 0: -# df_right = df_right.drop( -# columns=['FlowAmount', sector_column, '_merge']) -# df_right = df_right.rename(columns={'SubtractFlow': 'FlowAmount', -# 'Sector': sector_column}) -# # remove another digit from Sectormatch -# df_right = df_right.assign(SectorMatch=df_right[ -# sector_column].apply(lambda x: x[:(s - 2)])) -# # reorder -# df_right = df_right[['FlowName', 'FlowAmount', 'Location', -# sector_column, 'SectorMatch']] -# df_not_merged = pd.concat([df_not_merged, df_right], -# ignore_index=True) -# # rename the flowamount column -# df_merged = df_merged.rename(columns={'FlowAmount': 'FlowAmountNew', -# sector_column: activity_column}) -# # In the original EIA MECS df, some of the NAICS 6-digit codes sum -# # to a value greater than published NAICS3, due to rounding. In these -# # cases, the new FlowAmount is a negative number. Reset neg numbers to 0 -# df_merged.loc[df_merged['FlowAmountNew'] < 0, 'FlowAmountNew'] = 0 -# # in the original df, drop sector columns re-add sectors, this time with -# # sectors = 'aggregated' -# dfn = df_load.drop(columns=['SectorProducedBy', 'ProducedBySectorType', -# 'SectorConsumedBy', 'ConsumedBySectorType', -# 'SectorSourceName']) -# dfn = add_sectors_to_flowbyactivity( -# dfn, sectorsourcename=method['target_sector_source'], -# overwrite_sectorlevel='aggregated') -# # add column noting that these columns require an allocation ratio -# dfn = dfn.assign(disaggregate_flag=1) -# # create lists of sectors to drop -# list_original = df_load[activity_column].drop_duplicates().tolist() -# # drop values in original df -# dfn2 = dfn[~dfn[sector_column].isin(list_original)].sort_values( -# [activity_column, sector_column]).reset_index(drop=True) -# # drop the sectors that are duplicated by different naics being -# # mapped to naics6 -# if len(dfn2[dfn2.duplicated(subset=['FlowName', 'Location', sector_column], -# keep=False)]) > 0: -# dfn2.drop_duplicates(subset=['FlowName', 'Location', sector_column], -# keep='last', inplace=True) -# # want to allocate at NAICS6, so drop all other sectors -# dfn2 = \ -# dfn2[dfn2[sector_column].apply(lambda x: len(x) == 6)].reset_index( -# drop=True).sort_values([sector_column]) -# -# # merge revised flowamounts back with modified original df -# df_to_allocate = dfn2.merge(df_merged, how='left') -# # replace FlowAmount with newly calculated FlowAmount, -# # which represents Flows that are currently unaccounted for at NAICS6 -# df_to_allocate['FlowAmount'] = np.where( -# df_to_allocate['FlowAmountNew'].notnull(), -# df_to_allocate['FlowAmountNew'], df_to_allocate['FlowAmount']) -# # drop rows where flow amount = 0 - flows are captured through other NAICS6 -# df_to_allocate2 = df_to_allocate[df_to_allocate['FlowAmount'] != 0].drop( -# columns='FlowAmountNew').reset_index(drop=True) -# -# # merge the original df with modified -# # add column to original df for disaggregate_flag -# df_load = df_load.assign(disaggregate_flag=0) -# -# # concat the two dfs and sort -# df_c = pd.concat( -# [df_load, df_to_allocate2], ignore_index=True).sort_values( -# [sector_column]).reset_index(drop=True) -# -# df_c = replace_strings_with_NoneType(df_c).sort_values([sector_column]) -# -# return df_c diff --git a/flowsa/data_source_scripts/EPA_GHGI.py b/flowsa/data_source_scripts/EPA_GHGI.py index 86310ec2d..1e6101df4 100644 --- a/flowsa/data_source_scripts/EPA_GHGI.py +++ b/flowsa/data_source_scripts/EPA_GHGI.py @@ -12,11 +12,8 @@ import pandas as pd from flowsa.flowbyfunctions import assign_fips_location_system, \ load_fba_w_standardized_units -from flowsa.dataclean import replace_NoneType_with_empty_cells from flowsa.settings import log, externaldatapath from flowsa.schema import flow_by_activity_fields -from flowsa.common import load_yaml_dict -from flowsa.data_source_scripts import EIA_MECS from flowsa.flowby import FlowByActivity @@ -810,118 +807,6 @@ def split_HFCs_by_type(fba: FlowByActivity, **_) -> FlowByActivity: return new_fba -# # Fxn not actively used -# def subtract_HFC_transport_emissions(df, parameter_dict): -# """Remove the portion of transportation emissions which are sourced elsewhere.""" -# tbl = parameter_dict.get('transport_fba') -# transport_df = load_fba_w_standardized_units(datasource=tbl, -# year=df['Year'][0]) -# activity_list = parameter_dict.get('transport_activities') -# transport_df = transport_df[transport_df['ActivityProducedBy'].isin(activity_list)] -# df.loc[df['ActivityProducedBy'] == parameter_dict.get('ods_activity'), -# 'FlowAmount'] = df['FlowAmount'] - transport_df['FlowAmount'].sum() -# return df - -# # Fxn not actively used -# def allocate_HFC_to_residential(df, parameter_dict): -# """Split HFC emissions into two buckets to be further allocated. - -# Calculate the portion of Refrigerants applied to households based on production of -# household: 335222 -# industry: 333415 -# """ -# make_df = load_fba_w_standardized_units(datasource=parameter_dict.get('make_fba'), -# year=parameter_dict.get('make_year')) -# h_sec = parameter_dict.get('household_make') -# i_sec = parameter_dict.get('industry_make') -# household = make_df[(make_df['ActivityProducedBy'] == h_sec) & -# (make_df['ActivityConsumedBy'] == h_sec) -# ].reset_index()['FlowAmount'][0] -# industry = make_df[(make_df['ActivityProducedBy'] == i_sec) & -# (make_df['ActivityConsumedBy'] == i_sec) -# ].reset_index()['FlowAmount'][0] - -# activity = parameter_dict.get('ods_activity') -# df_subset = df.loc[df['ActivityProducedBy'] == activity].reset_index(drop=True) -# df_subset['FlowAmount'] = df_subset[ -# 'FlowAmount'] * (household / (industry + household)) -# df_subset['ActivityProducedBy'] = f"{activity} - Households" -# df.loc[df['ActivityProducedBy'] == activity, -# 'FlowAmount'] = df['FlowAmount'] * (industry / (industry + household)) -# df = pd.concat([df, df_subset], ignore_index=True) - -# return df - -# # Fxn not actively used -# def split_HFC_foams(df, parameter_dict): -# """Split HFC emissions from foams into two buckets to be allocated separately. - -# Calculate the portion for -# Polystyrene: 326140 -# Urethane: 326150 -# """ -# make_df = load_fba_w_standardized_units(datasource=parameter_dict.get('make_fba'), -# year=parameter_dict.get('make_year')) -# polys_sec = parameter_dict.get('polystyrene_make') -# ure_sec = parameter_dict.get('urethane_make') -# polystyrene = make_df[(make_df['ActivityProducedBy'] == polys_sec) & -# (make_df['ActivityConsumedBy'] == polys_sec) -# ].reset_index()['FlowAmount'][0] -# urethane = make_df[(make_df['ActivityProducedBy'] == ure_sec) & -# (make_df['ActivityConsumedBy'] == ure_sec) -# ].reset_index()['FlowAmount'][0] - -# activity = parameter_dict.get('foam_activity') -# df_subset = df.loc[df['ActivityProducedBy'] == activity].reset_index(drop=True) -# df_subset['FlowAmount'] = df_subset[ -# 'FlowAmount'] * (polystyrene / (urethane + polystyrene)) -# df_subset['ActivityProducedBy'] = f"{activity} - Polystyrene" -# df.loc[df['ActivityProducedBy'] == activity, 'FlowAmount'] = df[ -# 'FlowAmount'] * (urethane / (urethane + polystyrene)) -# df.loc[df['ActivityProducedBy'] == activity, -# 'ActivityProducedBy'] = f"{activity} - Urethane" -# df = pd.concat([df, df_subset], ignore_index=True) - -# return df - -# # Fxn not actively used -# def clean_HFC_fba(fba, source_dict, **_): -# """Adjust HFC emissions for improved parsing. -# clean_fba_before_mapping_df_fxn used in EPA_GHGI_T_4_102.""" -# parameter_dict = source_dict['clean_parameter'] -# df = subtract_HFC_transport_emissions(fba, parameter_dict) -# df = allocate_HFC_to_residential(df, parameter_dict) -# df = split_HFC_foams(df, parameter_dict) -# df = split_HFCs_by_type(df, source_dict) -# return df - - -# # No longer needed -# def adjust_transport_activities(df, **_): -# """Update activity names for improved transportatin parsing. -# clean_allocation_fba used in EPA_GHGI_T_A_14""" -# activities = {'Gasoline': ['Light-Duty Trucks', -# 'Passenger Cars'], -# 'Distillate Fuel Oil': -# ['Medium- and Heavy-Duty Trucks', -# 'Buses'], -# } -# for k, v in activities.items(): -# df.loc[(df['ActivityConsumedBy'].isin(v)) & -# (df['FlowName'] == k), -# 'ActivityConsumedBy'] = df['ActivityConsumedBy'] + f" - {k}" -# return df - -# # No longer needed -# def keep_six_digit_naics(df_w_sec, **_): -# """Keep only activities at the 6-digit NAICS level -# clean_allocation_fba_w_sec used for EPA_GHGI_T_A_73""" -# df_w_sec = replace_NoneType_with_empty_cells(df_w_sec) -# df_w_sec = df_w_sec.loc[ -# (df_w_sec['SectorProducedBy'].apply(lambda x: len(x) == 6)) | -# (df_w_sec['SectorConsumedBy'].apply(lambda x: len(x) == 6))] -# return df_w_sec - if __name__ == "__main__": import flowsa # fba = flowsa.getFlowByActivity('EPA_GHGI_T_4_101', 2016) From 5c5349fd846ce7d83685b9d6bc9f0099c34bff0b Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 13 Apr 2023 10:24:11 -0400 Subject: [PATCH 0503/1127] fix import error --- flowsa/flowbyclean.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index b2db750ad..0314dea7b 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -1,9 +1,11 @@ import numpy as np import pandas as pd +from flowsa.flowby import FlowByActivity, FlowBySector from flowsa.flowsa_log import log from flowsa import (flowby, geo, location) + def load_prepare_clean_source( self: 'FlowByActivity' ) -> 'FlowBySector': From b40e393f351870e838b4d8a489ae1dcd1a247f92 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 13 Apr 2023 10:53:28 -0400 Subject: [PATCH 0504/1127] add testing of additional FBS models --- examples/get_flows_by_sector.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/get_flows_by_sector.py b/examples/get_flows_by_sector.py index d4cbacd61..4c397978e 100644 --- a/examples/get_flows_by_sector.py +++ b/examples/get_flows_by_sector.py @@ -19,6 +19,12 @@ fbs_water = flowsa.getFlowBySector('Water_national_2015_m1', download_FBAs_if_missing=True) +fbs_TRI_DMR = flowsa.getFlowBySector('TRI_DMR_state_2017', + download_FBAs_if_missing=True) + +fbs_GHG = flowsa.getFlowBySector('GHG_national_2016_m1', + download_FBAs_if_missing=True) + # collapse the FBS - output has 'Sector' column instead of # 'SectorProducedBy' and 'SectorConsumedBy' columns fbs_water_collapsed = flowsa.collapse_FlowBySector('Water_national_2015_m1') From 6003d1f6a9565ba385928174ce6035f08068354e Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 13 Apr 2023 08:59:32 -0600 Subject: [PATCH 0505/1127] update rei_waste_national_2012 recursive fbs yaml --- flowsa/data_source_scripts/EPA_REI.py | 46 ++++--------------- .../REI_waste_national_2012.yaml | 7 +-- 2 files changed, 12 insertions(+), 41 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_REI.py b/flowsa/data_source_scripts/EPA_REI.py index 2d6740a8d..2bf243af3 100644 --- a/flowsa/data_source_scripts/EPA_REI.py +++ b/flowsa/data_source_scripts/EPA_REI.py @@ -8,6 +8,7 @@ from flowsa.location import US_FIPS from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.fbs_allocation import direct_allocation_method +from flowsa.flowby import FlowBySector def rei_url_helper(*, build_url, config, **_): @@ -163,44 +164,13 @@ def primary_factors_parse(*, df_list, year, **_): return df2 -def rei_waste_flows_attribution(*, flow_subset_mapped, k, names, method, **_): +def rei_waste_national_cleanup(fbs: FlowBySector, **_) -> FlowBySector: """ - Attribute REI waste data to include SPB and SCB. - todo: convert this function into yaml methods once we pull in Matthew's - updates - :param flow_subset_mapped: - :param k: - :param names: - :param attr: - :param fbs_list: - :param method: - :return: + Drop imports/exports from rei waste national FBS """ + fbs = (fbs + .query('SectorConsumedBy not in ("F04000", "F05000")') + .reset_index(drop=True) + ) - # subset data into activityproducedby and activityconsumedby datafarames - p = flow_subset_mapped[flow_subset_mapped['Description'] == 'makecol'] - c = flow_subset_mapped[flow_subset_mapped['Description'] == - 'useintersection'] - - # first directly attribute/equally attribute APB to sectors and drop ACB - # data - p2 = direct_allocation_method(p, k, names, method) - p2 = p2.drop(columns=['ActivityConsumedBy', 'SectorConsumedBy']) - - # then create attribution ratios to activityconsumedby based on flowable - c2 = c[['Flowable', 'FlowAmount', 'Unit', 'ActivityConsumedBy', - 'SectorConsumedBy']].assign(Denominator=c.groupby( - ['Flowable', 'Unit'])['FlowAmount'].transform('sum')) - c2 = c2.assign(AttributionRatio=c2['FlowAmount']/c2['Denominator']) - c2 = c2.sort_values(['Flowable', 'ActivityConsumedBy']) - # Drop imports and exports so that the quantity is not allocated to SCB - c2 = c2.query('SectorConsumedBy not in ("F04000", "F05000")').reset_index(drop=True) - - # merge data and recalculate flow amounts - df = p2.merge(c2[['Flowable', 'Unit', 'ActivityConsumedBy', - 'SectorConsumedBy', 'AttributionRatio']], - how='left') - df['FlowAmount'] = df['FlowAmount'] * df['AttributionRatio'] - df = df.drop(columns='AttributionRatio') - - return df + return fbs diff --git a/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml b/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml index d1e63c4d9..c215e7805 100644 --- a/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml +++ b/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml @@ -16,15 +16,16 @@ source_names: Description: makecol activity_sets: waste_flows: + exclusion_fields: + ActivityConsumedBy: ['Exports of goods and services', + 'Imports of goods and services'] attribution_method: proportional #todo: want to use direct attribution before proportional attribute_on: Flowable # FBA is mapped to FBS at this point, so FlowName is mapped to Flowable fill_sector_column: SectorConsumedBy + clean_fba_after_attribution: !script_function:EPA_REI rei_waste_national_cleanup attribution_source: "EPA_REI": selection_fields: PrimaryActivity: !from_index:EPA_REI_waste_2012_asets.csv waste Class: Other Description: useintersection -# exclusion_fields: -# ActivityConsumedBy: ['Exports of goods and services', -# 'Imports of goods and services'] From 7ae2bfe83fbc653ffabd67c89fcfce0f9ecf7f1c Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 13 Apr 2023 09:00:03 -0600 Subject: [PATCH 0506/1127] new FBS yaml option to "clean_fba_after_attribution" --- flowsa/flowby.py | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 5c8578396..2ce2c7f9f 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1800,6 +1800,7 @@ def prepare_fbs( .function_socket('clean_fba') .convert_to_geoscale() .attribute_flows_to_sectors(external_config_path=external_config_path) # recursive call to prepare_fbs + .function_socket('clean_fba_after_attribution') .drop(columns=['ActivityProducedBy', 'ActivityConsumedBy']) .aggregate_flowby() ) From 9d3003f19c846d324e1b3efd597846934b91c8fc Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 13 Apr 2023 11:00:11 -0400 Subject: [PATCH 0507/1127] test methods in correct file --- examples/get_flows_by_sector.py | 6 ------ flowsa/test_examples.py | 7 +++++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/get_flows_by_sector.py b/examples/get_flows_by_sector.py index 4c397978e..d4cbacd61 100644 --- a/examples/get_flows_by_sector.py +++ b/examples/get_flows_by_sector.py @@ -19,12 +19,6 @@ fbs_water = flowsa.getFlowBySector('Water_national_2015_m1', download_FBAs_if_missing=True) -fbs_TRI_DMR = flowsa.getFlowBySector('TRI_DMR_state_2017', - download_FBAs_if_missing=True) - -fbs_GHG = flowsa.getFlowBySector('GHG_national_2016_m1', - download_FBAs_if_missing=True) - # collapse the FBS - output has 'Sector' column instead of # 'SectorProducedBy' and 'SectorConsumedBy' columns fbs_water_collapsed = flowsa.collapse_FlowBySector('Water_national_2015_m1') diff --git a/flowsa/test_examples.py b/flowsa/test_examples.py index 1579044cc..c4097830f 100644 --- a/flowsa/test_examples.py +++ b/flowsa/test_examples.py @@ -18,6 +18,13 @@ def test_get_flows_by_sector(): download_FBAs_if_missing=True) + flowsa.getFlowBySector('TRI_DMR_state_2017', + download_FBAs_if_missing=True) + + flowsa.getFlowBySector('GHG_national_2016_m1', + download_FBAs_if_missing=True) + + def test_write_bibliography(): flowsa.writeFlowBySectorBibliography('Water_national_2015_m1') From bce2aa98858527934da702c4e1a46d9bcc6549b4 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 13 Apr 2023 09:33:49 -0600 Subject: [PATCH 0508/1127] comment out water methods and remove from test_generate_fbs() until converted to recursive method --- .../Water_national_2010_m1.yaml | 178 +++++++------- .../Water_national_2010_m2.yaml | 230 +++++++++--------- .../Water_national_2015_m2.yaml | 230 +++++++++--------- .../Water_national_2015_m3.yaml | 208 ++++++++-------- .../Water_state_2015_m1.yaml | 168 ++++++------- flowsa/test_FBS_against_remote.py | 7 +- 6 files changed, 513 insertions(+), 508 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2010_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2010_m1.yaml index 979929fdd..97961bf5f 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2010_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2010_m1.yaml @@ -1,89 +1,89 @@ -%YAML 1.2 - ---- - -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: national -source_names: - "USGS_NWIS_WU": - data_format: 'FBA' - class: Water - geoscale_to_use: state - year: 2010 - clean_fba_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup - clean_fba_w_sec_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_w_sectors_data_cleanup - activity_sets: - activity_set_1: - names: - - "Aquaculture" - - "Irrigation Golf Courses" - - "Public Supply" - - "Thermoelectric Power" - - "Domestic" - allocation_method: direct - allocation_source: None - allocation_source_class: None - allocation_source_year: None - allocation_flow: None - allocation_compartment: None - allocation_from_scale: state - activity_set_2: - names: - - "Industrial" - - "Mining" - allocation_method: proportional - allocation_source: "BLS_QCEW" - allocation_source_class: "Employment" - allocation_source_year: 2010 - allocation_flow: - - "Number of employees, Federal Government" - - "Number of employees, State Government" - - "Number of employees, Local Government" - - "Number of employees, Private" - allocation_compartment: None - allocation_from_scale: national - clean_allocation_fba_w_sec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec - activity_set_3: - names: - - "Irrigation Crop" - allocation_method: proportional - allocation_source: "USDA_CoA_Cropland" - allocation_source_class: "Land" - allocation_source_year: 2012 - allocation_flow: - - "AREA HARVESTED, IRRIGATED" - - "AREA IN PRODUCTION, IRRIGATED" - - "AREA, IRRIGATED" - - 'AREA BEARING & NON-BEARING, IRRIGATED' - - 'AREA GROWN, IRRIGATED' - allocation_compartment: None - allocation_from_scale: state - clean_allocation_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics_for_water_withdrawal - helper_source: "USDA_IWMS" - helper_method: multiplication - helper_source_class: "Water" - helper_source_year: 2013 - helper_flow: None - helper_from_scale: state - clean_helper_fba_wsec: !script_function:USDA_IWMS iwms_aggregation - activity_set_4: - names: - - "Livestock" - allocation_method: proportional - allocation_source: "USDA_CoA_Livestock" - allocation_source_class: "Other" - allocation_source_year: 2012 - allocation_flow: - - "HEAD" - - "NUMBER" - - "COLONIES" - allocation_compartment: - - "NOT SPECIFIED" - allocation_from_scale: state - helper_source: "USGS_WU_Coef" - helper_method: multiplication - helper_source_class: "Water" - helper_source_year: 2005 - helper_flow: None - helper_from_scale: national +#%YAML 1.2 +# +#--- +# +#target_sector_level: NAICS_6 +#target_sector_source: NAICS_2012_Code +#target_geoscale: national +#source_names: +# "USGS_NWIS_WU": +# data_format: 'FBA' +# class: Water +# geoscale_to_use: state +# year: 2010 +# clean_fba_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup +# clean_fba_w_sec_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_w_sectors_data_cleanup +# activity_sets: +# activity_set_1: +# names: +# - "Aquaculture" +# - "Irrigation Golf Courses" +# - "Public Supply" +# - "Thermoelectric Power" +# - "Domestic" +# allocation_method: direct +# allocation_source: None +# allocation_source_class: None +# allocation_source_year: None +# allocation_flow: None +# allocation_compartment: None +# allocation_from_scale: state +# activity_set_2: +# names: +# - "Industrial" +# - "Mining" +# allocation_method: proportional +# allocation_source: "BLS_QCEW" +# allocation_source_class: "Employment" +# allocation_source_year: 2010 +# allocation_flow: +# - "Number of employees, Federal Government" +# - "Number of employees, State Government" +# - "Number of employees, Local Government" +# - "Number of employees, Private" +# allocation_compartment: None +# allocation_from_scale: national +# clean_allocation_fba_w_sec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec +# activity_set_3: +# names: +# - "Irrigation Crop" +# allocation_method: proportional +# allocation_source: "USDA_CoA_Cropland" +# allocation_source_class: "Land" +# allocation_source_year: 2012 +# allocation_flow: +# - "AREA HARVESTED, IRRIGATED" +# - "AREA IN PRODUCTION, IRRIGATED" +# - "AREA, IRRIGATED" +# - 'AREA BEARING & NON-BEARING, IRRIGATED' +# - 'AREA GROWN, IRRIGATED' +# allocation_compartment: None +# allocation_from_scale: state +# clean_allocation_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics_for_water_withdrawal +# helper_source: "USDA_IWMS" +# helper_method: multiplication +# helper_source_class: "Water" +# helper_source_year: 2013 +# helper_flow: None +# helper_from_scale: state +# clean_helper_fba_wsec: !script_function:USDA_IWMS iwms_aggregation +# activity_set_4: +# names: +# - "Livestock" +# allocation_method: proportional +# allocation_source: "USDA_CoA_Livestock" +# allocation_source_class: "Other" +# allocation_source_year: 2012 +# allocation_flow: +# - "HEAD" +# - "NUMBER" +# - "COLONIES" +# allocation_compartment: +# - "NOT SPECIFIED" +# allocation_from_scale: state +# helper_source: "USGS_WU_Coef" +# helper_method: multiplication +# helper_source_class: "Water" +# helper_source_year: 2005 +# helper_flow: None +# helper_from_scale: national diff --git a/flowsa/methods/flowbysectormethods/Water_national_2010_m2.yaml b/flowsa/methods/flowbysectormethods/Water_national_2010_m2.yaml index e8b82ed05..31fc1273f 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2010_m2.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2010_m2.yaml @@ -1,115 +1,115 @@ -%YAML 1.1 - ---- - -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: national -source_names: - "USGS_NWIS_WU": - data_format: 'FBA' - class: Water - geoscale_to_use: state - year: 2010 - clean_fba_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup - clean_fba_w_sec_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_w_sectors_data_cleanup - activity_sets: - activity_set_1: - names: - - "Aquaculture" - - "Irrigation Golf Courses" - - "Public Supply" - - "Thermoelectric Power" - - "Domestic" - allocation_method: direct - allocation_source: None - allocation_source_class: None - allocation_source_year: None - allocation_flow: None - allocation_compartment: None - allocation_from_scale: state - activity_set_2: - names: - - "Industrial" - allocation_method: proportional - allocation_source: "StatCan_IWS_MI" - allocation_source_class: "Water" - allocation_source_year: 2011 - allocation_flow: - - "Water intake" - allocation_compartment: None - allocation_from_scale: national - clean_allocation_fba: !script_function:StatCan_IWS_MI convert_statcan_data_to_US_water_use - helper_source: "BLS_QCEW" - helper_method: proportional - helper_source_class: "Employment" - helper_source_year: 2011 - helper_flow: - - "Number of employees, Federal Government" - - "Number of employees, State Government" - - "Number of employees, Local Government" - - "Number of employees, Private" - helper_from_scale: national - clean_helper_fba_wsec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec - activity_set_3: - names: - - "Mining" - allocation_method: proportional - allocation_source: "Blackhurst_IO" - allocation_source_class: "Water" - allocation_source_year: 2002 - allocation_flow: - - 'Water Withdrawals IO Vector' - allocation_compartment: None - allocation_from_scale: national - clean_allocation_fba: !script_function:Blackhurst_IO convert_blackhurst_data_to_kg_per_year - clean_allocation_fba_w_sec: !script_function:Blackhurst_IO convert_blackhurst_data_to_kg_per_employee - helper_source: "BLS_QCEW" - helper_method: "multiplication and scaled" - helper_source_class: "Employment" - helper_source_year: 2010 - helper_flow: - - "Number of employees, Federal Government" - - "Number of employees, State Government" - - "Number of employees, Local Government" - - "Number of employees, Private" - helper_from_scale: national - clean_helper_fba_wsec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec - scale_helper_results: !script_function:Blackhurst_IO scale_blackhurst_results_to_usgs_values - activity_set_4: - names: - - "Irrigation Crop" - allocation_method: proportional - allocation_source: "USDA_IWMS" - allocation_source_class: "Land" - allocation_source_year: 2013 - allocation_flow: None - allocation_compartment: None - allocation_from_scale: state - clean_allocation_fba_w_sec: !script_function:USDA_IWMS disaggregate_iwms_to_6_digit_naics_for_water_withdrawal - helper_source: "USDA_IWMS" - helper_method: multiplication - helper_source_class: "Water" - helper_source_year: 2013 - helper_flow: None - helper_from_scale: state - activity_set_5: - names: - - "Livestock" - allocation_method: proportional - allocation_source: "USDA_CoA_Livestock" - allocation_source_class: "Other" - allocation_source_year: 2012 - allocation_flow: - - "HEAD" - - "NUMBER" - - "COLONIES" - allocation_compartment: - - "NOT SPECIFIED" - allocation_from_scale: state - helper_source: "USGS_WU_Coef" - helper_method: multiplication - helper_source_class: "Water" - helper_source_year: 2005 - helper_flow: None - helper_from_scale: national +#%YAML 1.1 +# +#--- +# +#target_sector_level: NAICS_6 +#target_sector_source: NAICS_2012_Code +#target_geoscale: national +#source_names: +# "USGS_NWIS_WU": +# data_format: 'FBA' +# class: Water +# geoscale_to_use: state +# year: 2010 +# clean_fba_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup +# clean_fba_w_sec_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_w_sectors_data_cleanup +# activity_sets: +# activity_set_1: +# names: +# - "Aquaculture" +# - "Irrigation Golf Courses" +# - "Public Supply" +# - "Thermoelectric Power" +# - "Domestic" +# allocation_method: direct +# allocation_source: None +# allocation_source_class: None +# allocation_source_year: None +# allocation_flow: None +# allocation_compartment: None +# allocation_from_scale: state +# activity_set_2: +# names: +# - "Industrial" +# allocation_method: proportional +# allocation_source: "StatCan_IWS_MI" +# allocation_source_class: "Water" +# allocation_source_year: 2011 +# allocation_flow: +# - "Water intake" +# allocation_compartment: None +# allocation_from_scale: national +# clean_allocation_fba: !script_function:StatCan_IWS_MI convert_statcan_data_to_US_water_use +# helper_source: "BLS_QCEW" +# helper_method: proportional +# helper_source_class: "Employment" +# helper_source_year: 2011 +# helper_flow: +# - "Number of employees, Federal Government" +# - "Number of employees, State Government" +# - "Number of employees, Local Government" +# - "Number of employees, Private" +# helper_from_scale: national +# clean_helper_fba_wsec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec +# activity_set_3: +# names: +# - "Mining" +# allocation_method: proportional +# allocation_source: "Blackhurst_IO" +# allocation_source_class: "Water" +# allocation_source_year: 2002 +# allocation_flow: +# - 'Water Withdrawals IO Vector' +# allocation_compartment: None +# allocation_from_scale: national +# clean_allocation_fba: !script_function:Blackhurst_IO convert_blackhurst_data_to_kg_per_year +# clean_allocation_fba_w_sec: !script_function:Blackhurst_IO convert_blackhurst_data_to_kg_per_employee +# helper_source: "BLS_QCEW" +# helper_method: "multiplication and scaled" +# helper_source_class: "Employment" +# helper_source_year: 2010 +# helper_flow: +# - "Number of employees, Federal Government" +# - "Number of employees, State Government" +# - "Number of employees, Local Government" +# - "Number of employees, Private" +# helper_from_scale: national +# clean_helper_fba_wsec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec +# scale_helper_results: !script_function:Blackhurst_IO scale_blackhurst_results_to_usgs_values +# activity_set_4: +# names: +# - "Irrigation Crop" +# allocation_method: proportional +# allocation_source: "USDA_IWMS" +# allocation_source_class: "Land" +# allocation_source_year: 2013 +# allocation_flow: None +# allocation_compartment: None +# allocation_from_scale: state +# clean_allocation_fba_w_sec: !script_function:USDA_IWMS disaggregate_iwms_to_6_digit_naics_for_water_withdrawal +# helper_source: "USDA_IWMS" +# helper_method: multiplication +# helper_source_class: "Water" +# helper_source_year: 2013 +# helper_flow: None +# helper_from_scale: state +# activity_set_5: +# names: +# - "Livestock" +# allocation_method: proportional +# allocation_source: "USDA_CoA_Livestock" +# allocation_source_class: "Other" +# allocation_source_year: 2012 +# allocation_flow: +# - "HEAD" +# - "NUMBER" +# - "COLONIES" +# allocation_compartment: +# - "NOT SPECIFIED" +# allocation_from_scale: state +# helper_source: "USGS_WU_Coef" +# helper_method: multiplication +# helper_source_class: "Water" +# helper_source_year: 2005 +# helper_flow: None +# helper_from_scale: national diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m2.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m2.yaml index a97ece017..a98c0fb0f 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m2.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m2.yaml @@ -1,115 +1,115 @@ -%YAML 1.1 - ---- - -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: national -source_names: - "USGS_NWIS_WU": - data_format: 'FBA' - class: Water - geoscale_to_use: state - year: 2015 - clean_fba_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup - clean_fba_w_sec_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_w_sectors_data_cleanup - activity_sets: - activity_set_1: - names: - - "Aquaculture" - - "Irrigation Golf Courses" - - "Public Supply" - - "Thermoelectric Power" - - "Domestic" - allocation_method: direct - allocation_source: None - allocation_source_class: None - allocation_source_year: None - allocation_flow: None - allocation_compartment: None - allocation_from_scale: state - activity_set_2: - names: - - "Industrial" - allocation_method: proportional - allocation_source: "StatCan_IWS_MI" - allocation_source_class: "Water" - allocation_source_year: 2015 - allocation_flow: - - "Water intake" - allocation_compartment: None - allocation_from_scale: national - clean_allocation_fba: !script_function:StatCan_IWS_MI convert_statcan_data_to_US_water_use - helper_source: "BLS_QCEW" - helper_method: proportional - helper_source_class: "Employment" - helper_source_year: 2015 - helper_flow: - - "Number of employees, Federal Government" - - "Number of employees, State Government" - - "Number of employees, Local Government" - - "Number of employees, Private" - helper_from_scale: national - clean_helper_fba_wsec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec - activity_set_3: - names: - - "Mining" - allocation_method: proportional - allocation_source: "Blackhurst_IO" - allocation_source_class: "Water" - allocation_source_year: 2002 - allocation_flow: - - 'Water Withdrawals IO Vector' - allocation_compartment: None - allocation_from_scale: national - clean_allocation_fba: !script_function:Blackhurst_IO convert_blackhurst_data_to_kg_per_year - clean_allocation_fba_w_sec: !script_function:Blackhurst_IO convert_blackhurst_data_to_kg_per_employee - helper_source: "BLS_QCEW" - helper_method: "multiplication and scaled" - helper_source_class: "Employment" - helper_source_year: 2015 - helper_flow: - - "Number of employees, Federal Government" - - "Number of employees, State Government" - - "Number of employees, Local Government" - - "Number of employees, Private" - helper_from_scale: national - clean_helper_fba_wsec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec - scale_helper_results: !script_function:Blackhurst_IO scale_blackhurst_results_to_usgs_values - activity_set_4: - names: - - "Irrigation Crop" - allocation_method: proportional - allocation_source: "USDA_IWMS" - allocation_source_class: "Land" - allocation_source_year: 2018 - allocation_flow: None - allocation_compartment: None - allocation_from_scale: state - clean_allocation_fba_w_sec: !script_function:USDA_IWMS disaggregate_iwms_to_6_digit_naics_for_water_withdrawal - helper_source: "USDA_IWMS" - helper_method: multiplication - helper_source_class: "Water" - helper_source_year: 2018 - helper_flow: None - helper_from_scale: state - activity_set_5: - names: - - "Livestock" - allocation_method: proportional - allocation_source: "USDA_CoA_Livestock" - allocation_source_class: "Other" - allocation_source_year: 2017 - allocation_flow: - - "HEAD" - - "NUMBER" - - "COLONIES" - allocation_compartment: - - "NOT SPECIFIED" - allocation_from_scale: state - helper_source: "USGS_WU_Coef" - helper_method: multiplication - helper_source_class: "Water" - helper_source_year: 2005 - helper_flow: None - helper_from_scale: national +#%YAML 1.1 +# +#--- +# +#target_sector_level: NAICS_6 +#target_sector_source: NAICS_2012_Code +#target_geoscale: national +#source_names: +# "USGS_NWIS_WU": +# data_format: 'FBA' +# class: Water +# geoscale_to_use: state +# year: 2015 +# clean_fba_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup +# clean_fba_w_sec_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_w_sectors_data_cleanup +# activity_sets: +# activity_set_1: +# names: +# - "Aquaculture" +# - "Irrigation Golf Courses" +# - "Public Supply" +# - "Thermoelectric Power" +# - "Domestic" +# allocation_method: direct +# allocation_source: None +# allocation_source_class: None +# allocation_source_year: None +# allocation_flow: None +# allocation_compartment: None +# allocation_from_scale: state +# activity_set_2: +# names: +# - "Industrial" +# allocation_method: proportional +# allocation_source: "StatCan_IWS_MI" +# allocation_source_class: "Water" +# allocation_source_year: 2015 +# allocation_flow: +# - "Water intake" +# allocation_compartment: None +# allocation_from_scale: national +# clean_allocation_fba: !script_function:StatCan_IWS_MI convert_statcan_data_to_US_water_use +# helper_source: "BLS_QCEW" +# helper_method: proportional +# helper_source_class: "Employment" +# helper_source_year: 2015 +# helper_flow: +# - "Number of employees, Federal Government" +# - "Number of employees, State Government" +# - "Number of employees, Local Government" +# - "Number of employees, Private" +# helper_from_scale: national +# clean_helper_fba_wsec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec +# activity_set_3: +# names: +# - "Mining" +# allocation_method: proportional +# allocation_source: "Blackhurst_IO" +# allocation_source_class: "Water" +# allocation_source_year: 2002 +# allocation_flow: +# - 'Water Withdrawals IO Vector' +# allocation_compartment: None +# allocation_from_scale: national +# clean_allocation_fba: !script_function:Blackhurst_IO convert_blackhurst_data_to_kg_per_year +# clean_allocation_fba_w_sec: !script_function:Blackhurst_IO convert_blackhurst_data_to_kg_per_employee +# helper_source: "BLS_QCEW" +# helper_method: "multiplication and scaled" +# helper_source_class: "Employment" +# helper_source_year: 2015 +# helper_flow: +# - "Number of employees, Federal Government" +# - "Number of employees, State Government" +# - "Number of employees, Local Government" +# - "Number of employees, Private" +# helper_from_scale: national +# clean_helper_fba_wsec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec +# scale_helper_results: !script_function:Blackhurst_IO scale_blackhurst_results_to_usgs_values +# activity_set_4: +# names: +# - "Irrigation Crop" +# allocation_method: proportional +# allocation_source: "USDA_IWMS" +# allocation_source_class: "Land" +# allocation_source_year: 2018 +# allocation_flow: None +# allocation_compartment: None +# allocation_from_scale: state +# clean_allocation_fba_w_sec: !script_function:USDA_IWMS disaggregate_iwms_to_6_digit_naics_for_water_withdrawal +# helper_source: "USDA_IWMS" +# helper_method: multiplication +# helper_source_class: "Water" +# helper_source_year: 2018 +# helper_flow: None +# helper_from_scale: state +# activity_set_5: +# names: +# - "Livestock" +# allocation_method: proportional +# allocation_source: "USDA_CoA_Livestock" +# allocation_source_class: "Other" +# allocation_source_year: 2017 +# allocation_flow: +# - "HEAD" +# - "NUMBER" +# - "COLONIES" +# allocation_compartment: +# - "NOT SPECIFIED" +# allocation_from_scale: state +# helper_source: "USGS_WU_Coef" +# helper_method: multiplication +# helper_source_class: "Water" +# helper_source_year: 2005 +# helper_flow: None +# helper_from_scale: national diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m3.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m3.yaml index d5e785068..bac8a4985 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m3.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m3.yaml @@ -1,104 +1,104 @@ -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: national -source_names: - "USGS_NWIS_WU": - data_format: 'FBA' - class: Water - geoscale_to_use: state - year: 2015 - clean_fba_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup - clean_fba_w_sec_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_w_sectors_data_cleanup - activity_sets: - activity_set_1: - names: - - "Aquaculture" - - "Irrigation Golf Courses" - - "Public Supply" - - "Domestic" - allocation_method: direct - allocation_source: None - allocation_source_class: None - allocation_source_year: None - allocation_flow: None - allocation_compartment: None - allocation_from_scale: state - activity_set_2: - names: - - "Thermoelectric Power" - allocation_method: proportional - allocation_source: "NETL_EIA_PlantWater" - allocation_source_class: "Water" - allocation_source_year: 2015 - allocation_flow: - - 'Fresh Water Withdrawal' - - 'Saline Water Withdrawal' - - 'Brackish Water Withdrawal' - allocation_compartment: - - 'Surface' - - 'Ground' - allocation_from_scale: national - clean_allocation_fba: !script_function:NETL_EIA_PlantWater clean_plantwater_fba - allocation_map_to_flow_list: True - allocation_merge_columns: - - 'Context' - - 'Flowable' - activity_set_3: - names: - - "Industrial" - - "Mining" - allocation_method: proportional - allocation_source: "BLS_QCEW" - allocation_source_class: "Employment" - allocation_source_year: 2015 - allocation_flow: - - "Number of employees, Federal Government" - - "Number of employees, State Government" - - "Number of employees, Local Government" - - "Number of employees, Private" - allocation_compartment: None - allocation_from_scale: national - clean_allocation_fba_w_sec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec - activity_set_4: - names: - - "Irrigation Crop" - allocation_method: proportional - allocation_source: "USDA_CoA_Cropland" - allocation_source_class: "Land" - allocation_source_year: 2017 - allocation_flow: - - "AREA HARVESTED, IRRIGATED" - - "AREA IN PRODUCTION, IRRIGATED" - - "AREA, IRRIGATED" - - 'AREA BEARING & NON-BEARING, IRRIGATED' - - 'AREA GROWN, IRRIGATED' - allocation_compartment: None - allocation_from_scale: state - clean_allocation_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics_for_water_withdrawal - helper_source: "USDA_IWMS" - helper_method: multiplication - helper_source_class: "Water" - helper_source_year: 2018 - helper_flow: None - helper_from_scale: state - clean_helper_fba_wsec: !script_function:USDA_IWMS iwms_aggregation - activity_set_5: - names: - - "Livestock" - allocation_method: proportional - allocation_source: "USDA_CoA_Livestock" - allocation_source_class: "Other" - allocation_source_year: 2017 - allocation_flow: - - "HEAD" - - "NUMBER" - - "COLONIES" - allocation_compartment: - - "NOT SPECIFIED" - allocation_from_scale: state - helper_source: "USGS_WU_Coef" - helper_method: multiplication - helper_source_class: "Water" - helper_source_year: 2005 - helper_flow: None - helper_from_scale: national +#target_sector_level: NAICS_6 +#target_sector_source: NAICS_2012_Code +#target_geoscale: national +#source_names: +# "USGS_NWIS_WU": +# data_format: 'FBA' +# class: Water +# geoscale_to_use: state +# year: 2015 +# clean_fba_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup +# clean_fba_w_sec_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_w_sectors_data_cleanup +# activity_sets: +# activity_set_1: +# names: +# - "Aquaculture" +# - "Irrigation Golf Courses" +# - "Public Supply" +# - "Domestic" +# allocation_method: direct +# allocation_source: None +# allocation_source_class: None +# allocation_source_year: None +# allocation_flow: None +# allocation_compartment: None +# allocation_from_scale: state +# activity_set_2: +# names: +# - "Thermoelectric Power" +# allocation_method: proportional +# allocation_source: "NETL_EIA_PlantWater" +# allocation_source_class: "Water" +# allocation_source_year: 2015 +# allocation_flow: +# - 'Fresh Water Withdrawal' +# - 'Saline Water Withdrawal' +# - 'Brackish Water Withdrawal' +# allocation_compartment: +# - 'Surface' +# - 'Ground' +# allocation_from_scale: national +# clean_allocation_fba: !script_function:NETL_EIA_PlantWater clean_plantwater_fba +# allocation_map_to_flow_list: True +# allocation_merge_columns: +# - 'Context' +# - 'Flowable' +# activity_set_3: +# names: +# - "Industrial" +# - "Mining" +# allocation_method: proportional +# allocation_source: "BLS_QCEW" +# allocation_source_class: "Employment" +# allocation_source_year: 2015 +# allocation_flow: +# - "Number of employees, Federal Government" +# - "Number of employees, State Government" +# - "Number of employees, Local Government" +# - "Number of employees, Private" +# allocation_compartment: None +# allocation_from_scale: national +# clean_allocation_fba_w_sec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec +# activity_set_4: +# names: +# - "Irrigation Crop" +# allocation_method: proportional +# allocation_source: "USDA_CoA_Cropland" +# allocation_source_class: "Land" +# allocation_source_year: 2017 +# allocation_flow: +# - "AREA HARVESTED, IRRIGATED" +# - "AREA IN PRODUCTION, IRRIGATED" +# - "AREA, IRRIGATED" +# - 'AREA BEARING & NON-BEARING, IRRIGATED' +# - 'AREA GROWN, IRRIGATED' +# allocation_compartment: None +# allocation_from_scale: state +# clean_allocation_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics_for_water_withdrawal +# helper_source: "USDA_IWMS" +# helper_method: multiplication +# helper_source_class: "Water" +# helper_source_year: 2018 +# helper_flow: None +# helper_from_scale: state +# clean_helper_fba_wsec: !script_function:USDA_IWMS iwms_aggregation +# activity_set_5: +# names: +# - "Livestock" +# allocation_method: proportional +# allocation_source: "USDA_CoA_Livestock" +# allocation_source_class: "Other" +# allocation_source_year: 2017 +# allocation_flow: +# - "HEAD" +# - "NUMBER" +# - "COLONIES" +# allocation_compartment: +# - "NOT SPECIFIED" +# allocation_from_scale: state +# helper_source: "USGS_WU_Coef" +# helper_method: multiplication +# helper_source_class: "Water" +# helper_source_year: 2005 +# helper_flow: None +# helper_from_scale: national diff --git a/flowsa/methods/flowbysectormethods/Water_state_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_state_2015_m1.yaml index d78578630..d266b5301 100644 --- a/flowsa/methods/flowbysectormethods/Water_state_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_state_2015_m1.yaml @@ -1,84 +1,84 @@ -!include:USEEIO_summary_target.yaml -target_geoscale: state -source_names: - "USGS_NWIS_WU": - data_format: 'FBA' - class: Water - geoscale_to_use: state - year: 2015 - clean_fba_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup - clean_fba_w_sec_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_w_sectors_data_cleanup - activity_sets: - activity_set_1: - names: - - "Aquaculture" - - "Irrigation Golf Courses" - - "Public Supply" - - "Thermoelectric Power" - - "Domestic" - allocation_method: direct - allocation_source: None - allocation_source_class: None - allocation_source_year: None - allocation_flow: None - allocation_compartment: None - allocation_from_scale: state - activity_set_2: - names: - - "Industrial" - - "Mining" - allocation_method: proportional - allocation_source: "BLS_QCEW" - allocation_source_class: "Employment" - allocation_source_year: 2015 - allocation_flow: - - "Number of employees, Federal Government" - - "Number of employees, State Government" - - "Number of employees, Local Government" - - "Number of employees, Private" - allocation_compartment: None - allocation_from_scale: state - clean_allocation_fba_w_sec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec - activity_set_3: - names: - - "Irrigation Crop" - allocation_method: proportional - allocation_source: "USDA_CoA_Cropland" - allocation_source_class: "Land" - allocation_source_year: 2017 - allocation_flow: - - "AREA HARVESTED, IRRIGATED" - - "AREA IN PRODUCTION, IRRIGATED" - - "AREA, IRRIGATED" - - 'AREA BEARING & NON-BEARING, IRRIGATED' - - 'AREA GROWN, IRRIGATED' - allocation_compartment: None - allocation_from_scale: state - clean_allocation_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics_for_water_withdrawal - helper_source: "USDA_IWMS" - helper_method: multiplication - helper_source_class: "Water" - helper_source_year: 2018 - helper_flow: None - helper_from_scale: state - clean_helper_fba_wsec: !script_function:USDA_IWMS iwms_aggregation - activity_set_4: - names: - - "Livestock" - allocation_method: proportional - allocation_source: "USDA_CoA_Livestock" - allocation_source_class: "Other" - allocation_source_year: 2017 - allocation_flow: - - "HEAD" - - "NUMBER" - - "COLONIES" - allocation_compartment: - - "NOT SPECIFIED" - allocation_from_scale: state - helper_source: "USGS_WU_Coef" - helper_method: multiplication - helper_source_class: "Water" - helper_source_year: 2005 - helper_flow: None - helper_from_scale: national +#!include:USEEIO_summary_target.yaml +#target_geoscale: state +#source_names: +# "USGS_NWIS_WU": +# data_format: 'FBA' +# class: Water +# geoscale_to_use: state +# year: 2015 +# clean_fba_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup +# clean_fba_w_sec_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_w_sectors_data_cleanup +# activity_sets: +# activity_set_1: +# names: +# - "Aquaculture" +# - "Irrigation Golf Courses" +# - "Public Supply" +# - "Thermoelectric Power" +# - "Domestic" +# allocation_method: direct +# allocation_source: None +# allocation_source_class: None +# allocation_source_year: None +# allocation_flow: None +# allocation_compartment: None +# allocation_from_scale: state +# activity_set_2: +# names: +# - "Industrial" +# - "Mining" +# allocation_method: proportional +# allocation_source: "BLS_QCEW" +# allocation_source_class: "Employment" +# allocation_source_year: 2015 +# allocation_flow: +# - "Number of employees, Federal Government" +# - "Number of employees, State Government" +# - "Number of employees, Local Government" +# - "Number of employees, Private" +# allocation_compartment: None +# allocation_from_scale: state +# clean_allocation_fba_w_sec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec +# activity_set_3: +# names: +# - "Irrigation Crop" +# allocation_method: proportional +# allocation_source: "USDA_CoA_Cropland" +# allocation_source_class: "Land" +# allocation_source_year: 2017 +# allocation_flow: +# - "AREA HARVESTED, IRRIGATED" +# - "AREA IN PRODUCTION, IRRIGATED" +# - "AREA, IRRIGATED" +# - 'AREA BEARING & NON-BEARING, IRRIGATED' +# - 'AREA GROWN, IRRIGATED' +# allocation_compartment: None +# allocation_from_scale: state +# clean_allocation_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics_for_water_withdrawal +# helper_source: "USDA_IWMS" +# helper_method: multiplication +# helper_source_class: "Water" +# helper_source_year: 2018 +# helper_flow: None +# helper_from_scale: state +# clean_helper_fba_wsec: !script_function:USDA_IWMS iwms_aggregation +# activity_set_4: +# names: +# - "Livestock" +# allocation_method: proportional +# allocation_source: "USDA_CoA_Livestock" +# allocation_source_class: "Other" +# allocation_source_year: 2017 +# allocation_flow: +# - "HEAD" +# - "NUMBER" +# - "COLONIES" +# allocation_compartment: +# - "NOT SPECIFIED" +# allocation_from_scale: state +# helper_source: "USGS_WU_Coef" +# helper_method: multiplication +# helper_source_class: "Water" +# helper_source_year: 2005 +# helper_flow: None +# helper_from_scale: national diff --git a/flowsa/test_FBS_against_remote.py b/flowsa/test_FBS_against_remote.py index 80ce00774..3d5def4b5 100644 --- a/flowsa/test_FBS_against_remote.py +++ b/flowsa/test_FBS_against_remote.py @@ -20,7 +20,12 @@ def test_generate_fbs(): 'Electricity_gen_emissions_national_2016', 'Employment_common', 'GHG_national_m1', - 'USEEIO_summary_target' + 'USEEIO_summary_target', + 'Water_national_2010_m1', # todo: add water tests after modify to recursive method + 'Water_national_2010_m2', + 'Water_national_2015_m2', + 'Water_national_2015_m3', + 'Water_state_2015_m1' ]: print("--------------------------------\n" f"Method: {m}\n" From 15f09e59d022c13e080defe57faa7f1a9d9e0f40 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 13 Apr 2023 10:42:56 -0600 Subject: [PATCH 0509/1127] comment coa_cropland fxns back in as used for SEEA FBS --- .../data_source_scripts/USDA_CoA_Cropland.py | 630 +++++++++--------- 1 file changed, 312 insertions(+), 318 deletions(-) diff --git a/flowsa/data_source_scripts/USDA_CoA_Cropland.py b/flowsa/data_source_scripts/USDA_CoA_Cropland.py index 19b1065b5..7737890aa 100644 --- a/flowsa/data_source_scripts/USDA_CoA_Cropland.py +++ b/flowsa/data_source_scripts/USDA_CoA_Cropland.py @@ -270,321 +270,315 @@ def coa_nonirrigated_cropland_fba_cleanup(fba, **kwargs): return fba -# todo: delete -# def disaggregate_coa_cropland_to_6_digit_naics( -# fba_w_sector, attr, method, **kwargs): -# """ -# Disaggregate usda coa cropland to naics 6 -# :param fba_w_sector: df, CoA cropland data, FBA format with sector columns -# :param attr: dictionary, attribute data from method yaml for activity set -# :param method: dictionary, FBS method yaml -# :param kwargs: dictionary, arguments that might be required for other -# functions. Currently includes data source name. -# :return: df, CoA cropland with disaggregated NAICS sectors -# """ -# -# # define the activity and sector columns to base modifications on -# # these definitions will vary dependent on class type -# sector_col = 'SectorConsumedBy' -# -# # drop rows without assigned sectors -# fba_w_sector = fba_w_sector[ -# ~fba_w_sector[sector_col].isna()].reset_index(drop=True) -# -# # modify the flowamounts related to the 6 naics 'orchards' are mapped to -# fba_w_sector = fba_w_sector.equally_attribute() -# # fba_w_sector = equal_allocation(fba_w_sector) -# -# # use ratios of usda 'land in farms' to determine animal use of -# # pasturelands at 6 digit naics -# fba_w_sector = disaggregate_pastureland( -# fba_w_sector, attr, method, year=attr['allocation_source_year'], -# sector_column=sector_col, -# download_FBA_if_missing=kwargs['download_FBA_if_missing']) -# -# # use ratios of usda 'harvested cropland' to determine missing 6 digit -# # naics -# fba_w_sector = disaggregate_cropland( -# fba_w_sector, attr, method, year=attr['allocation_source_year'], -# sector_column=sector_col, download_FBA_if_missing=kwargs[ -# 'download_FBA_if_missing']) -# -# return fba_w_sector - -# todo: delete -# def disaggregate_coa_cropland_to_6_digit_naics_for_water_withdrawal( -# fba_w_sector_load, attr, method, **kwargs): -# """ -# Disaggregate usda coa cropland to naics 6 -# :param fba_w_sector_load: df, CoA cropland data, FBA format with sector -# columns -# :param attr: dictionary, attribute data from method yaml for activity set -# :param method: dictionary, FBS method yaml -# :param kwargs: dictionary, arguments that might be required for other -# functions. Currently includes data source name. -# :return: df, CoA cropland with disaggregated NAICS sectors -# """ -# -# # define the activity and sector columns to base modifications on -# # these definitions will vary dependent on class type -# sector_col = 'SectorConsumedBy' -# -# # drop rows without assigned sectors -# fba_w_sector = fba_w_sector_load[~fba_w_sector_load[sector_col].isna()]\ -# .reset_index(drop=True) -# -# # modify the flowamounts related to the 6 naics 'orchards' are mapped to -# # fba_w_sector = equal_allocation(fba_w_sector) -# fba_w_sector = fba_w_sector.equally_attribute() -# -# # todo: add back in once suppression fxn modified to accept non-naics -# # like activities and mixed level final naics (naics6 and naics7) -# # then estimate any suppressed data by equally allocating parent to -# # child naics -# # groupcols = list(fba_w_sector3.select_dtypes( -# # include=['object', 'int']).columns) -# # fba_w_sector = equally_allocate_suppressed_parent_to_child_naics( -# # fba_w_sector, method, 'SectorConsumedBy', groupcols) -# -# # When using irrigated cropland, aggregate sectors to cropland and total -# # ag land. Doing this because published values for irrigated harvested -# # cropland do not include the water use for vegetables, woody crops, -# # berries. -# fba_w_sector = fba_w_sector[~fba_w_sector['ActivityConsumedBy'].isin( -# ['AG LAND', 'AG LAND, CROPLAND, HARVESTED'])].reset_index(drop=True) -# -# # use ratios of usda 'land in farms' to determine animal use of -# # pasturelands at 6 digit naics -# # todo: update download fba if missing to use default input (download_sources_ok) -# fba_w_sector = disaggregate_pastureland( -# fba_w_sector, attr, method, year=fba_w_sector.config['year'], -# sector_column=sector_col, download_FBA_if_missing=True, -# parameter_drop=['1125']) -# -# # use ratios of usda 'harvested cropland' to determine missing 6 digit -# # naics -# # todo: update download fba if missing to use default input (download_sources_ok) -# fba_w_sector = disaggregate_cropland( -# fba_w_sector, attr, method, year=fba_w_sector.config['year'], -# sector_column=sector_col, download_FBA_if_missing=True) -# -# return fba_w_sector - - -# def disaggregate_pastureland(fba_w_sector, attr, method, year, -# sector_column, download_FBA_if_missing, **kwargs): -# """ -# The USDA CoA Cropland irrigated pastureland data only links -# to the 3 digit NAICS '112'. This function uses state -# level CoA 'Land in Farms' to allocate the county level acreage data to -# 6 digit NAICS. -# :param fba_w_sector: df, the CoA Cropland dataframe after linked to sectors -# :param attr: dictionary, attribute data from method yaml for activity set -# :param method: string, methodname -# :param year: str, year of data being disaggregated -# :param sector_column: str, the sector column on which to make df -# modifications (SectorProducedBy or SectorConsumedBy) -# :param download_FBA_if_missing: bool, if True will attempt to load -# FBAS used in generating the FBS from remote server prior to -# generating if file not found locally -# :return: df, the CoA cropland dataframe with disaggregated pastureland data -# """ -# -# # tmp drop NoneTypes -# # fba_w_sector = replace_NoneType_with_empty_cells(fba_w_sector) -# -# # subset the coa data so only pastureland -# # p = fba_w_sector.loc[fba_w_sector[sector_column].apply( -# # lambda x: x[0:3]) == '112'].reset_index(drop=True) -# if len(p) != 0: -# # add temp loc column for state fips -# # p = p.assign(Location_tmp=p['Location'].apply(lambda x: x[0:2])) -# -# # todo: need to only attribute to target sectors here -# # load usda coa cropland naics -# # df_f = load_fba_w_standardized_units( -# # datasource='USDA_CoA_Cropland_NAICS', year=year, flowclass='Land', -# # download_FBA_if_missing=download_FBA_if_missing) -# # subset to land in farms data -# # df_f = df_f[df_f['FlowName'] == 'FARM OPERATIONS'] -# # subset to rows related to pastureland -# # df_f = df_f.loc[df_f['ActivityConsumedBy'].apply( -# # lambda x: x[0:3]) == '112'] -# # # drop rows with "&' -# # df_f = df_f[~df_f['ActivityConsumedBy'].str.contains('&')] -# # if 'parameter_drop' in kwargs: -# # # drop aquaculture because pastureland not used for aquaculture -# # # drop any activities at a more aggregated sector level because -# # # will need to be reaggregated after dropping a parameter to -# # # accurately calculate the allocation ratios -# # drop_list = [sub[ : -1] for sub in kwargs['parameter_drop']] -# # drop_list = drop_list + kwargs['parameter_drop'] -# # df_f = df_f[~df_f['ActivityConsumedBy'].isin(drop_list)] -# # create sector columns -# # df_f = add_sectors_to_flowbyactivity( -# # df_f, sectorsourcename=f"NAICS_{str(method['target_naics_year'])}_Code") -# # estimate suppressed data by equal allocation -# df_f = equally_allocate_suppressed_parent_to_child_naics( -# df_f, method, 'SectorConsumedBy', fba_wsec_default_grouping_fields) -# # create proportional ratios -# group_cols = [e for e in fba_wsec_default_grouping_fields if -# e not in ('ActivityProducedBy', 'ActivityConsumedBy')] -# df_f = allocate_by_sector(df_f, attr, 'proportional', group_cols) -# # tmp drop NoneTypes -# df_f = replace_NoneType_with_empty_cells(df_f) -# # drop naics = '11 -# df_f = df_f[df_f[sector_column] != '11'] -# # drop 000 in location -# df_f = df_f.assign(Location=df_f['Location'].apply(lambda x: x[0:2])) -# -# # check units before merge -# compare_df_units(p, df_f) -# # merge the coa pastureland data with land in farm data -# df = p.merge(df_f[[sector_column, 'Location', 'FlowAmountRatio']], -# how='left', left_on="Location_tmp", right_on="Location") -# # multiply the flowamount by the flowratio -# df.loc[:, 'FlowAmount'] = df['FlowAmount'] * df['FlowAmountRatio'] -# # drop columns and rename -# df = df.drop(columns=['Location_tmp', sector_column + '_x', -# 'Location_y', 'FlowAmountRatio']) -# df = df.rename(columns={sector_column + '_y': sector_column, -# "Location_x": 'Location'}) -# -# # drop rows where sector = 112 and then concat with -# # original fba_w_sector -# fba_w_sector = fba_w_sector[fba_w_sector[sector_column].apply( -# lambda x: x[0:3]) != '112'].reset_index(drop=True) -# fba_w_sector = pd.concat([fba_w_sector, df]).reset_index(drop=True) -# -# # fill empty cells with NoneType -# fba_w_sector = replace_strings_with_NoneType(fba_w_sector) -# -# return fba_w_sector - -# todo: delete -# def disaggregate_cropland(fba_w_sector, attr, method, year, -# sector_column, download_FBA_if_missing): -# """ -# In the event there are 4 (or 5) digit naics for cropland -# at the county level, use state level harvested cropland to -# create ratios -# :param fba_w_sector: df, CoA cropland data, FBA format with sector columns -# :param attr: dictionary, attribute data from method yaml for activity set -# :param method: string, method name -# :param year: str, year of data -# :param sector_column: str, the sector column on which to make -# df modifications (SectorProducedBy or SectorConsumedBy) -# :param download_FBA_if_missing: bool, if True will attempt to -# load FBAS used in generating the FBS from remote server prior to -# generating if file not found locally -# :return: df, CoA cropland data disaggregated -# """ -# -# # tmp drop NoneTypes -# # fba_w_sector = replace_NoneType_with_empty_cells(fba_w_sector) -# # -# # # drop pastureland data -# # crop = fba_w_sector.loc[fba_w_sector[sector_column].apply( -# # lambda x: x[0:3]) != '112'].reset_index(drop=True) -# # # drop sectors < 4 digits -# # crop = crop[crop[sector_column].apply( -# # lambda x: len(x) > 3)].reset_index(drop=True) -# # # create tmp location -# # crop = crop.assign(Location_tmp=crop['Location'].apply(lambda x: x[0:2])) -# # -# # # load the relevant state level harvested cropland by naics -# # naics = load_fba_w_standardized_units( -# # datasource="USDA_CoA_Cropland_NAICS", year=year, -# # flowclass='Land', download_FBA_if_missing=download_FBA_if_missing) -# # # subset the harvested cropland by naics -# # naics = naics[naics['FlowName'] == -# # 'AG LAND, CROPLAND, HARVESTED'].reset_index(drop=True) -# # # drop the activities that include '&' -# # naics = naics[~naics['ActivityConsumedBy'].str.contains( -# # '&')].reset_index(drop=True) -# # # add sectors -# # naics = add_sectors_to_flowbyactivity( -# # naics, sectorsourcename=f"NAICS_" -# # f"{str(method['target_naics_year'])}_Code") -# # # estimate suppressed data by equally allocating parent to child naics -# # naics = equally_allocate_suppressed_parent_to_child_naics( -# # naics, method, 'SectorConsumedBy', fba_wsec_default_grouping_fields) -# # -# # # aggregate sectors to create any missing naics levels -# # naics2 = sector_aggregation(naics) -# # # add missing naics5/6 when only one naics5/6 associated with a naics4 -# # naics3 = sector_disaggregation(naics2) -# # # create ratios -# # naics4 = sector_ratios(naics3, sector_column) -# # # create temporary sector column to match the two dfs on -# # naics4 = naics4.assign( -# # Location_tmp=naics4['Location'].apply(lambda x: x[0:2])) -# # # tmp drop Nonetypes -# # naics4 = replace_NoneType_with_empty_cells(naics4) -# # -# # # check units in prep for merge -# # compare_df_units(crop, naics4) -# # # for loop through naics lengths to determine -# # # naics 4 and 5 digits to disaggregate -# # for i in range(4, 6): -# # # subset df to sectors with length = i and length = i + 1 -# # crop_subset = crop.loc[crop[sector_column].apply( -# # lambda x: i + 1 >= len(x) >= i)] -# # crop_subset = crop_subset.assign( -# # Sector_tmp=crop_subset[sector_column].apply(lambda x: x[0:i])) -# # # if duplicates drop all rows -# # df = crop_subset.drop_duplicates( -# # subset=['Location', 'Sector_tmp'], -# # keep=False).reset_index(drop=True) -# # # drop sector temp column -# # df = df.drop(columns=["Sector_tmp"]) -# # # subset df to keep the sectors of length i -# # df_subset = df.loc[df[sector_column].apply(lambda x: len(x) == i)] -# # # subset the naics df where naics length is i + 1 -# # naics_subset = \ -# # naics4.loc[naics4[sector_column].apply( -# # lambda x: len(x) == i + 1)].reset_index(drop=True) -# # naics_subset = naics_subset.assign( -# # Sector_tmp=naics_subset[sector_column].apply(lambda x: x[0:i])) -# # # merge the two df based on locations -# # df_subset = pd.merge( -# # df_subset, naics_subset[[sector_column, 'FlowAmountRatio', -# # 'Sector_tmp', 'Location_tmp']], -# # how='left', left_on=[sector_column, 'Location_tmp'], -# # right_on=['Sector_tmp', 'Location_tmp']) -# # # create flow amounts for the new NAICS based on the flow ratio -# # df_subset.loc[:, 'FlowAmount'] = \ -# # df_subset['FlowAmount'] * df_subset['FlowAmountRatio'] -# # # drop rows of 0 and na -# # df_subset = df_subset[df_subset['FlowAmount'] != 0] -# # df_subset = df_subset[ -# # ~df_subset['FlowAmount'].isna()].reset_index(drop=True) -# # # drop columns -# # df_subset = df_subset.drop( -# # columns=[sector_column + '_x', 'FlowAmountRatio', 'Sector_tmp']) -# # # rename columns -# # df_subset = df_subset.rename( -# # columns={sector_column + '_y': sector_column}) -# # # tmp drop Nonetypes -# # df_subset = replace_NoneType_with_empty_cells(df_subset) -# # # add new rows of data to crop df -# # crop = pd.concat([crop, df_subset]).reset_index(drop=True) -# -# # clean up df -# crop = crop.drop(columns=['Location_tmp']) -# -# # equally allocate any further missing naics -# # crop = equally_allocate_parent_to_child_naics(crop, method) -# crop = crop.equally_attribute() -# -# # pasture data -# pasture = \ -# fba_w_sector.loc[fba_w_sector[sector_column].apply( -# lambda x: x[0:3]) == '112'].reset_index(drop=True) -# # concat crop and pasture -# fba_w_sector = pd.concat([pasture, crop]).reset_index(drop=True) -# -# # fill empty cells with NoneType -# fba_w_sector = replace_strings_with_NoneType(fba_w_sector) -# -# return fba_w_sector + +def disaggregate_coa_cropland_to_6_digit_naics( + fba_w_sector, attr, method, **kwargs): + """ + Disaggregate usda coa cropland to naics 6 + :param fba_w_sector: df, CoA cropland data, FBA format with sector columns + :param attr: dictionary, attribute data from method yaml for activity set + :param method: dictionary, FBS method yaml + :param kwargs: dictionary, arguments that might be required for other + functions. Currently includes data source name. + :return: df, CoA cropland with disaggregated NAICS sectors + """ + + # define the activity and sector columns to base modifications on + # these definitions will vary dependent on class type + sector_col = 'SectorConsumedBy' + + # drop rows without assigned sectors + fba_w_sector = fba_w_sector[ + ~fba_w_sector[sector_col].isna()].reset_index(drop=True) + + # modify the flowamounts related to the 6 naics 'orchards' are mapped to + fba_w_sector = equal_allocation(fba_w_sector) + + # use ratios of usda 'land in farms' to determine animal use of + # pasturelands at 6 digit naics + fba_w_sector = disaggregate_pastureland( + fba_w_sector, attr, method, year=attr['allocation_source_year'], + sector_column=sector_col, + download_FBA_if_missing=kwargs['download_FBA_if_missing']) + + # use ratios of usda 'harvested cropland' to determine missing 6 digit + # naics + fba_w_sector = disaggregate_cropland( + fba_w_sector, attr, method, year=attr['allocation_source_year'], + sector_column=sector_col, download_FBA_if_missing=kwargs[ + 'download_FBA_if_missing']) + + return fba_w_sector + + +def disaggregate_coa_cropland_to_6_digit_naics_for_water_withdrawal( + fba_w_sector_load, attr, method, **kwargs): + """ + Disaggregate usda coa cropland to naics 6 + :param fba_w_sector_load: df, CoA cropland data, FBA format with sector + columns + :param attr: dictionary, attribute data from method yaml for activity set + :param method: dictionary, FBS method yaml + :param kwargs: dictionary, arguments that might be required for other + functions. Currently includes data source name. + :return: df, CoA cropland with disaggregated NAICS sectors + """ + + # define the activity and sector columns to base modifications on + # these definitions will vary dependent on class type + sector_col = 'SectorConsumedBy' + + # drop rows without assigned sectors + fba_w_sector = fba_w_sector_load[~fba_w_sector_load[sector_col].isna()]\ + .reset_index(drop=True) + + # modify the flowamounts related to the 6 naics 'orchards' are mapped to + fba_w_sector = equal_allocation(fba_w_sector) + + # todo: add back in once suppression fxn modified to accept non-naics + # like activities and mixed level final naics (naics6 and naics7) + # then estimate any suppressed data by equally allocating parent to + # child naics + # groupcols = list(fba_w_sector3.select_dtypes( + # include=['object', 'int']).columns) + # fba_w_sector = equally_allocate_suppressed_parent_to_child_naics( + # fba_w_sector, method, 'SectorConsumedBy', groupcols) + + # When using irrigated cropland, aggregate sectors to cropland and total + # ag land. Doing this because published values for irrigated harvested + # cropland do not include the water use for vegetables, woody crops, + # berries. + fba_w_sector = fba_w_sector[~fba_w_sector['ActivityConsumedBy'].isin( + ['AG LAND', 'AG LAND, CROPLAND, HARVESTED'])].reset_index(drop=True) + + # use ratios of usda 'land in farms' to determine animal use of + # pasturelands at 6 digit naics + fba_w_sector = disaggregate_pastureland( + fba_w_sector, attr, method, year=attr['allocation_source_year'], + sector_column=sector_col, download_FBA_if_missing=kwargs[ + 'download_FBA_if_missing'], parameter_drop=['1125']) + + # use ratios of usda 'harvested cropland' to determine missing 6 digit + # naics + fba_w_sector = disaggregate_cropland( + fba_w_sector, attr, method, year=attr['allocation_source_year'], + sector_column=sector_col, download_FBA_if_missing=kwargs[ + 'download_FBA_if_missing']) + + return fba_w_sector + + +def disaggregate_pastureland(fba_w_sector, attr, method, year, + sector_column, download_FBA_if_missing, **kwargs): + """ + The USDA CoA Cropland irrigated pastureland data only links + to the 3 digit NAICS '112'. This function uses state + level CoA 'Land in Farms' to allocate the county level acreage data to + 6 digit NAICS. + :param fba_w_sector: df, the CoA Cropland dataframe after linked to sectors + :param attr: dictionary, attribute data from method yaml for activity set + :param method: string, methodname + :param year: str, year of data being disaggregated + :param sector_column: str, the sector column on which to make df + modifications (SectorProducedBy or SectorConsumedBy) + :param download_FBA_if_missing: bool, if True will attempt to load + FBAS used in generating the FBS from remote server prior to + generating if file not found locally + :return: df, the CoA cropland dataframe with disaggregated pastureland data + """ + + # tmp drop NoneTypes + fba_w_sector = replace_NoneType_with_empty_cells(fba_w_sector) + + # subset the coa data so only pastureland + p = fba_w_sector.loc[fba_w_sector[sector_column].apply( + lambda x: x[0:3]) == '112'].reset_index(drop=True) + if len(p) != 0: + # add temp loc column for state fips + p = p.assign(Location_tmp=p['Location'].apply(lambda x: x[0:2])) + + # load usda coa cropland naics + df_f = load_fba_w_standardized_units( + datasource='USDA_CoA_Cropland_NAICS', year=year, flowclass='Land', + download_FBA_if_missing=download_FBA_if_missing) + # subset to land in farms data + df_f = df_f[df_f['FlowName'] == 'FARM OPERATIONS'] + # subset to rows related to pastureland + df_f = df_f.loc[df_f['ActivityConsumedBy'].apply( + lambda x: x[0:3]) == '112'] + # drop rows with "&' + df_f = df_f[~df_f['ActivityConsumedBy'].str.contains('&')] + if 'parameter_drop' in kwargs: + # drop aquaculture because pastureland not used for aquaculture + # drop any activities at a more aggregated sector level because + # will need to be reaggregated after dropping a parameter to + # accurately calculate the allocation ratios + drop_list = [sub[ : -1] for sub in kwargs['parameter_drop']] + drop_list = drop_list + kwargs['parameter_drop'] + df_f = df_f[~df_f['ActivityConsumedBy'].isin(drop_list)] + # create sector columns + df_f = add_sectors_to_flowbyactivity( + df_f, sectorsourcename=method['target_sector_source']) + # estimate suppressed data by equal allocation + df_f = equally_allocate_suppressed_parent_to_child_naics( + df_f, method, 'SectorConsumedBy', fba_wsec_default_grouping_fields) + # create proportional ratios + group_cols = [e for e in fba_wsec_default_grouping_fields if + e not in ('ActivityProducedBy', 'ActivityConsumedBy')] + df_f = allocate_by_sector(df_f, attr, 'proportional', group_cols) + # tmp drop NoneTypes + df_f = replace_NoneType_with_empty_cells(df_f) + # drop naics = '11 + df_f = df_f[df_f[sector_column] != '11'] + # drop 000 in location + df_f = df_f.assign(Location=df_f['Location'].apply(lambda x: x[0:2])) + + # check units before merge + compare_df_units(p, df_f) + # merge the coa pastureland data with land in farm data + df = p.merge(df_f[[sector_column, 'Location', 'FlowAmountRatio']], + how='left', left_on="Location_tmp", right_on="Location") + # multiply the flowamount by the flowratio + df.loc[:, 'FlowAmount'] = df['FlowAmount'] * df['FlowAmountRatio'] + # drop columns and rename + df = df.drop(columns=['Location_tmp', sector_column + '_x', + 'Location_y', 'FlowAmountRatio']) + df = df.rename(columns={sector_column + '_y': sector_column, + "Location_x": 'Location'}) + + # drop rows where sector = 112 and then concat with + # original fba_w_sector + fba_w_sector = fba_w_sector[fba_w_sector[sector_column].apply( + lambda x: x[0:3]) != '112'].reset_index(drop=True) + fba_w_sector = pd.concat([fba_w_sector, df]).reset_index(drop=True) + + # fill empty cells with NoneType + fba_w_sector = replace_strings_with_NoneType(fba_w_sector) + + return fba_w_sector + + +def disaggregate_cropland(fba_w_sector, attr, method, year, + sector_column, download_FBA_if_missing): + """ + In the event there are 4 (or 5) digit naics for cropland + at the county level, use state level harvested cropland to + create ratios + :param fba_w_sector: df, CoA cropland data, FBA format with sector columns + :param attr: dictionary, attribute data from method yaml for activity set + :param method: string, method name + :param year: str, year of data + :param sector_column: str, the sector column on which to make + df modifications (SectorProducedBy or SectorConsumedBy) + :param download_FBA_if_missing: bool, if True will attempt to + load FBAS used in generating the FBS from remote server prior to + generating if file not found locally + :return: df, CoA cropland data disaggregated + """ + + # tmp drop NoneTypes + fba_w_sector = replace_NoneType_with_empty_cells(fba_w_sector) + + # drop pastureland data + crop = fba_w_sector.loc[fba_w_sector[sector_column].apply( + lambda x: x[0:3]) != '112'].reset_index(drop=True) + # drop sectors < 4 digits + crop = crop[crop[sector_column].apply( + lambda x: len(x) > 3)].reset_index(drop=True) + # create tmp location + crop = crop.assign(Location_tmp=crop['Location'].apply(lambda x: x[0:2])) + + # load the relevant state level harvested cropland by naics + naics = load_fba_w_standardized_units( + datasource="USDA_CoA_Cropland_NAICS", year=year, + flowclass='Land', download_FBA_if_missing=download_FBA_if_missing) + # subset the harvested cropland by naics + naics = naics[naics['FlowName'] == + 'AG LAND, CROPLAND, HARVESTED'].reset_index(drop=True) + # drop the activities that include '&' + naics = naics[~naics['ActivityConsumedBy'].str.contains( + '&')].reset_index(drop=True) + # add sectors + naics = add_sectors_to_flowbyactivity( + naics, sectorsourcename=method['target_sector_source']) + # estimate suppressed data by equally allocating parent to child naics + naics = equally_allocate_suppressed_parent_to_child_naics( + naics, method, 'SectorConsumedBy', fba_wsec_default_grouping_fields) + + # aggregate sectors to create any missing naics levels + naics2 = sector_aggregation(naics) + # add missing naics5/6 when only one naics5/6 associated with a naics4 + naics3 = sector_disaggregation(naics2) + # create ratios + naics4 = sector_ratios(naics3, sector_column) + # create temporary sector column to match the two dfs on + naics4 = naics4.assign( + Location_tmp=naics4['Location'].apply(lambda x: x[0:2])) + # tmp drop Nonetypes + naics4 = replace_NoneType_with_empty_cells(naics4) + + # check units in prep for merge + compare_df_units(crop, naics4) + # for loop through naics lengths to determine + # naics 4 and 5 digits to disaggregate + for i in range(4, 6): + # subset df to sectors with length = i and length = i + 1 + crop_subset = crop.loc[crop[sector_column].apply( + lambda x: i + 1 >= len(x) >= i)] + crop_subset = crop_subset.assign( + Sector_tmp=crop_subset[sector_column].apply(lambda x: x[0:i])) + # if duplicates drop all rows + df = crop_subset.drop_duplicates( + subset=['Location', 'Sector_tmp'], + keep=False).reset_index(drop=True) + # drop sector temp column + df = df.drop(columns=["Sector_tmp"]) + # subset df to keep the sectors of length i + df_subset = df.loc[df[sector_column].apply(lambda x: len(x) == i)] + # subset the naics df where naics length is i + 1 + naics_subset = \ + naics4.loc[naics4[sector_column].apply( + lambda x: len(x) == i + 1)].reset_index(drop=True) + naics_subset = naics_subset.assign( + Sector_tmp=naics_subset[sector_column].apply(lambda x: x[0:i])) + # merge the two df based on locations + df_subset = pd.merge( + df_subset, naics_subset[[sector_column, 'FlowAmountRatio', + 'Sector_tmp', 'Location_tmp']], + how='left', left_on=[sector_column, 'Location_tmp'], + right_on=['Sector_tmp', 'Location_tmp']) + # create flow amounts for the new NAICS based on the flow ratio + df_subset.loc[:, 'FlowAmount'] = \ + df_subset['FlowAmount'] * df_subset['FlowAmountRatio'] + # drop rows of 0 and na + df_subset = df_subset[df_subset['FlowAmount'] != 0] + df_subset = df_subset[ + ~df_subset['FlowAmount'].isna()].reset_index(drop=True) + # drop columns + df_subset = df_subset.drop( + columns=[sector_column + '_x', 'FlowAmountRatio', 'Sector_tmp']) + # rename columns + df_subset = df_subset.rename( + columns={sector_column + '_y': sector_column}) + # tmp drop Nonetypes + df_subset = replace_NoneType_with_empty_cells(df_subset) + # add new rows of data to crop df + crop = pd.concat([crop, df_subset]).reset_index(drop=True) + + # clean up df + crop = crop.drop(columns=['Location_tmp']) + + # equally allocate any further missing naics + crop = equally_allocate_parent_to_child_naics(crop, method) + + # pasture data + pasture = \ + fba_w_sector.loc[fba_w_sector[sector_column].apply( + lambda x: x[0:3]) == '112'].reset_index(drop=True) + # concat crop and pasture + fba_w_sector = pd.concat([pasture, crop]).reset_index(drop=True) + + # fill empty cells with NoneType + fba_w_sector = replace_strings_with_NoneType(fba_w_sector) + + return fba_w_sector \ No newline at end of file From 7667931703994d6f213a2d0a523e32a70f6309e4 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 13 Apr 2023 13:56:17 -0400 Subject: [PATCH 0510/1127] Undo all changes to main EPA_GHGI crosswalk --- .../NAICS_Crosswalk_EPA_GHGI.csv | 525 +++++++----------- 1 file changed, 190 insertions(+), 335 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv index 42d419412..6db661c3e 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv @@ -3,7 +3,7 @@ EPA_GHGI,Iron and Steel Production & Metallurgical Coke Production,NAICS_2012_Co EPA_GHGI,Cement Production,NAICS_2012_Code,32731,,327310,EPA_GHGI_T_2_1 EPA_GHGI,Lime Production,NAICS_2012_Code,3274,,327400,EPA_GHGI_T_2_1 EPA_GHGI,Ammonia Production,NAICS_2012_Code,32531,,325310,EPA_GHGI_T_2_1 -EPA_GHGI,Incineration of Waste,NAICS_2012_Code,562,,562000,EPA_GHGI_T_2_1 +EPA_GHGI,Incineration of Waste,NAICS_2012_Code,562213,,562000,EPA_GHGI_T_2_1 EPA_GHGI,Aluminum Production,NAICS_2012_Code,331313,,331313,"EPA_GHGI_T_2_1, EPA_GHGI_T_4_80" EPA_GHGI,Soda Ash Production,NAICS_2012_Code,32519,,325190,EPA_GHGI_T_2_1 EPA_GHGI,Ferroalloy Production,NAICS_2012_Code,3311,,331110,EPA_GHGI_T_2_1 @@ -12,7 +12,7 @@ EPA_GHGI,Zinc Production,NAICS_2012_Code,33142,,331420,EPA_GHGI_T_2_1 EPA_GHGI,Phosphoric Acid Production,NAICS_2012_Code,32531,,325310,EPA_GHGI_T_2_1 EPA_GHGI,Glass Production,NAICS_2012_Code,3272,,327200,EPA_GHGI_T_2_1 EPA_GHGI,Carbide Production and Consumption,NAICS_2012_Code,32518,,325180,EPA_GHGI_T_2_1 -EPA_GHGI,Landfills,NAICS_2012_Code,562,,562000,EPA_GHGI_T_2_1 +EPA_GHGI,Landfills,NAICS_2012_Code,562212,,562000,EPA_GHGI_T_2_1 EPA_GHGI,Urea Consumption for Non-Agricultural Purposes,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_2_1 EPA_GHGI,Urea Consumption for Non-Agricultural Purposes,NAICS_2012_Code,32,,,EPA_GHGI_T_2_1 EPA_GHGI,Urea Consumption for Non-Agricultural Purposes,NAICS_2012_Code,33,,,EPA_GHGI_T_2_1 @@ -25,7 +25,7 @@ EPA_GHGI,Coal Mining,NAICS_2012_Code,2121,,212100,EPA_GHGI_T_2_1 EPA_GHGI,Wastewater Treatment,NAICS_2012_Code,2213,,221300,EPA_GHGI_T_2_1 EPA_GHGI,Abandoned Oil and Gas Wells,NAICS_2012_Code,211,,211000,EPA_GHGI_T_2_1 EPA_GHGI,Abandoned Underground Coal Mines,NAICS_2012_Code,2121,,212100,EPA_GHGI_T_2_1 -EPA_GHGI,Composting,NAICS_2012_Code,562,,562000,EPA_GHGI_T_2_1 +EPA_GHGI,Composting,NAICS_2012_Code,562219,,562000,EPA_GHGI_T_2_1 EPA_GHGI,Nitric Acid Production,NAICS_2012_Code,32531,,325310,EPA_GHGI_T_2_1 EPA_GHGI,Adipic Acid Production,NAICS_2012_Code,32519,,325190,EPA_GHGI_T_2_1 EPA_GHGI,N2O from Product Uses,NAICS_2012_Code,621,,"621, 622, 623",EPA_GHGI_T_2_1 @@ -35,26 +35,27 @@ EPA_GHGI,"Caprolactam, Glyoxal, and Glyoxylic Acid Production",NAICS_2012_Code,3 EPA_GHGI,Electronics Industry,NAICS_2012_Code,334413,,"334413, name change from Semiconductor Manufacture",EPA_GHGI_T_2_1 EPA_GHGI,Electrical Transmission and Distribution,NAICS_2012_Code,2211,,221100,EPA_GHGI_T_2_1 EPA_GHGI,Electric Power,NAICS_2012_Code,2211,,"Commodity: 221100 (or I: 221100, S00101, S00202)",EPA_GHGI_T_2_1 +EPA_GHGI,Electric Power,NAICS_2012_Code,S00101,,,EPA_GHGI_T_2_1 +EPA_GHGI,Electric Power,NAICS_2012_Code,S00202,,,EPA_GHGI_T_2_1 EPA_GHGI,Liming,NAICS_2012_Code,111,,"111, 112",EPA_GHGI_T_2_1 EPA_GHGI,Liming,NAICS_2012_Code,112,,,EPA_GHGI_T_2_1 EPA_GHGI,Urea Fertilization,NAICS_2012_Code,111,,"111, 112",EPA_GHGI_T_2_1 EPA_GHGI,Urea Fertilization,NAICS_2012_Code,112,,,EPA_GHGI_T_2_1 EPA_GHGI,Rice Cultivation,NAICS_2012_Code,11116,,1111B0,EPA_GHGI_T_2_1 -EPA_GHGI,Anaerobic Digestion at Biogas Facilities,NAICS_2012_Code,562,,new in GHGI since 2018,EPA_GHGI_T_2_1 +EPA_GHGI,Anaerobic Digestion at Biogas Facilities,NAICS_2012_Code,562219,,new in GHGI since 2018,EPA_GHGI_T_2_1 EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,111,,"111, 112, 113, 114","EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,112,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,113,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,114,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,All activities Alternative Fuel On-Road,NAICS_2012_Code,485,,"485000, 486000, 48A000, 492000","EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,All activities Alternative Fuel On-Road,NAICS_2012_Code,486,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,All activities Alternative Fuel On-Road,NAICS_2012_Code,487,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,All activities Alternative Fuel On-Road,NAICS_2012_Code,488,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,All activities Alternative Fuel On-Road,NAICS_2012_Code,492,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,485,,"485000, 486000, 48A000, 492000","EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,486,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,487,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,488,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,492,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Construction/Mining Equipment Non-Road,NAICS_2012_Code,211,,"211000, 212100, 2122A0, 212230, 212310, 2123AO, 213111","EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Construction/Mining Equipment Non-Road,NAICS_2012_Code,212,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Construction/Mining Equipment Non-Road,NAICS_2012_Code,213111,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Light-Duty Trucks Gasoline On-Road,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses Diesel On-Road,NAICS_2012_Code,484,,484000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks and Buses,NAICS_2012_Code,484,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Other Non-Road,NAICS_2012_Code,485,,"485000, 48A000, 492000, 532100, 532400, 621900, 713900, 811100, 811300","EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Other Non-Road,NAICS_2012_Code,487,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Other Non-Road,NAICS_2012_Code,488,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" @@ -65,15 +66,14 @@ EPA_GHGI,Other Non-Road,NAICS_2012_Code,6219,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15 EPA_GHGI,Other Non-Road,NAICS_2012_Code,7139,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Other Non-Road,NAICS_2012_Code,8111,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Other Non-Road,NAICS_2012_Code,8113,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Passenger Cars Gasoline On-Road,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Aircraft Non-Road,NAICS_2012_Code,481,,481000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Rail Non-Road,NAICS_2012_Code,482,,482000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Ships and Boats Non-Road,NAICS_2012_Code,483,,483000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Exploration,NAICS_2012_Code,211111,,211000,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42, EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" EPA_GHGI,Production,NAICS_2012_Code,211111,,211000,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42, EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" EPA_GHGI,Crude Oil Transportation,NAICS_2012_Code,486110,,not mapped,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42" +EPA_GHGI,Transportation,NAICS_2012_Code,486110,,not mapped,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42" EPA_GHGI,Refining,NAICS_2012_Code,324110,,324110,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42" +EPA_GHGI,Crude Refining,NAICS_2012_Code,324110,,324110,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42" EPA_GHGI,Distribution,NAICS_2012_Code,221210,,221200,"EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" +EPA_GHGI,Distribution - Post-Meter,NAICS_2012_Code,221210,,,"EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" EPA_GHGI,Processing,NAICS_2012_Code,211111,,211000,"EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" EPA_GHGI,Transmission and Storage,NAICS_2012_Code,486210,,486000,"EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" EPA_GHGI,Chickpeas,NAICS_2012_Code,11113,,1111B0,EPA_GHGI_T_5_29 @@ -99,90 +99,13 @@ EPA_GHGI,Ethylene Oxide,NAICS_2012_Code,325199,,325411 (incorrect in original?), EPA_GHGI,Methanol,NAICS_2012_Code,325199,,325411 (incorrect in original?),EPA_GHGI_T_4_46 EPA_GHGI,Industry Industrial Coking Coal,NAICS_2012_Code,212210,,2122A0 (incorrect in original?),EPA_GHGI_T_3_22 EPA_GHGI,Industry Industrial Other Coal,NAICS_2012_Code,212210,,2122A0 (incorrect in original?),EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Products Non-energy,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Products Non-energy,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Products Non-energy,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Products Non-energy,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Products Non-energy,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Products Non-energy,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 +EPA_GHGI,Industry Petroleum Products Non-energy,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 EPA_GHGI,Industry Natural Gas to Chemical Plants,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 EPA_GHGI,Industry Natural Gas to Chemical Plants,NAICS_2012_Code,32,,,EPA_GHGI_T_3_22 EPA_GHGI,Industry Natural Gas to Chemical Plants,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 @@ -193,20 +116,27 @@ EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,92,,,EPA_GHGI_T_3_22 EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,F01000,,,EPA_GHGI_T_3_22 EPA_GHGI,Coal Electric Power,NAICS_2012_Code,2211,,"Commodity: 221100 (or I: 221100, S00101, S00202)","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Electric Power,NAICS_2012_Code,2211,,"Commodity: 221100 (or I: 221100, S00101, S00202)","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Electric Power,NAICS_2012_Code,2211,,"Commodity: 221100 (or I: 221100, S00101, S00202)",EPA_GHGI_T_3_8 -EPA_GHGI,Natural Gas Electric Power,NAICS_2012_Code,2211,,,EPA_GHGI_T_3_9 +EPA_GHGI,Natural Gas Electric Power,NAICS_2012_Code,2211,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Wood Electric Power,NAICS_2012_Code,2211,,"Commodity: 221100 (or I: 221100, S00101, S00202)","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Electric Power,NAICS_2012_Code,S00101,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Electric Power,NAICS_2012_Code,S00101,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural Gas Electric Power,NAICS_2012_Code,S00101,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Electric Power,NAICS_2012_Code,S00101,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Electric Power,NAICS_2012_Code,S00202,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Electric Power,NAICS_2012_Code,S00202,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Natural Gas Electric Power,NAICS_2012_Code,S00202,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Electric Power,NAICS_2012_Code,S00202,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Coal Residential,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Natural Gas Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Wood Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23, 31, 32, 33","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23, 31, 32, 33","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" @@ -214,10 +144,6 @@ EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_ EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Industrial,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Natural gas Industrial - Manufacturing,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Natural gas Industrial - Manufacturing,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Natural gas Industrial - Manufacturing,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" @@ -228,22 +154,25 @@ EPA_GHGI,Wood Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Wood Industrial,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Wood Industrial,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Wood Industrial,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,2213,,"2213, 42, 44, 45, 493, 5, 6, 7, 8, S00102, GSLGE, GSLGH","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,493,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,2213,,"2213, 42, 44, 45, 493, 5, 6, 7, 8, S00102, GSLGE, GSLGH","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,493,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,927110,,S00102,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,923110,,GSLGE,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Coal Commercial,NAICS_2012_Code,923120,,GSLGH,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,2213,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" @@ -260,22 +189,9 @@ EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_ EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,2213,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,493,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,927110,,S00102,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,923110,,GSLGE,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,923120,,GSLGH,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Wood Commercial,NAICS_2012_Code,2213,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Wood Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Wood Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" @@ -292,6 +208,9 @@ EPA_GHGI,Wood Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Wood Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Wood Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Wood Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,927110,,S00102,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,923110,,GSLGE,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" +EPA_GHGI,Wood Commercial,NAICS_2012_Code,923120,,GSLGH,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" EPA_GHGI,Drained Organic Soils Cropland,NAICS_2012_Code,1111,,"111, excl. 1114",EPA_GHGI_T_5_18 EPA_GHGI,Drained Organic Soils Cropland,NAICS_2012_Code,1112,,,EPA_GHGI_T_5_18 EPA_GHGI,Drained Organic Soils Cropland,NAICS_2012_Code,1113,,,EPA_GHGI_T_5_18 @@ -306,52 +225,10 @@ EPA_GHGI,Synthetic Fertilizer Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_18 EPA_GHGI,All activities Grassland,NAICS_2012_Code,112,,112,"EPA_GHGI_T_5_18, EPA_GHGI_T_5_19" EPA_GHGI,Volatilization & Atm. Deposition Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_19 EPA_GHGI,Surface Leaching & Run-Off Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_19 -EPA_GHGI,Natural Gas Transportation,NAICS_2012_Code,48,,"48, 491, 492, S00500, S00600, GSLGO, S00201, S00203, F01000",EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 -EPA_GHGI,Aviation Gasoline Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 -EPA_GHGI,Aviation Gasoline Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 -EPA_GHGI,Aviation Gasoline Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 -EPA_GHGI,Aviation Gasoline Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 -EPA_GHGI,Aviation Gasoline Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 -EPA_GHGI,Jet Fuel Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 -EPA_GHGI,Jet Fuel Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 -EPA_GHGI,Jet Fuel Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 -EPA_GHGI,Jet Fuel Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 -EPA_GHGI,Jet Fuel Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 -EPA_GHGI,LPG (Propane) Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 -EPA_GHGI,LPG (Propane) Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 -EPA_GHGI,LPG (Propane) Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 -EPA_GHGI,LPG (Propane) Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 -EPA_GHGI,LPG (Propane) Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 -EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_14 -EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,491,,,EPA_GHGI_T_A_14 -EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,492,,,EPA_GHGI_T_A_14 -EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_14 -EPA_GHGI,Residual Fuel Transportation,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_14 -EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23",EPA_GHGI_T_A_14 -EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,21,,,EPA_GHGI_T_A_14 -EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,2212,,,EPA_GHGI_T_A_14 -EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,23,,,EPA_GHGI_T_A_14 -EPA_GHGI,Industrial Other Coal Industrial - Manufacturing,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_A_14 -EPA_GHGI,Industrial Other Coal Industrial - Manufacturing,NAICS_2012_Code,32,,,EPA_GHGI_T_A_14 -EPA_GHGI,Industrial Other Coal Industrial - Manufacturing,NAICS_2012_Code,33,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23",EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,21,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,2212,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,23,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" EPA_GHGI,Natural Gas Industrial - Manufacturing,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_A_14 EPA_GHGI,Natural Gas Industrial - Manufacturing,NAICS_2012_Code,32,,,EPA_GHGI_T_A_14 EPA_GHGI,Natural Gas Industrial - Manufacturing,NAICS_2012_Code,33,,,EPA_GHGI_T_A_14 @@ -362,38 +239,25 @@ EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,23,,,EPA_GHGI_T_A_14 EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,31,,,EPA_GHGI_T_A_14 EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,32,,,EPA_GHGI_T_A_14 EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,33,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,2213,,"2213, 42, 44, 45, 493, 5, 6, 7, 8, S00102, GSLGE, GSLGH",EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,42,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,44,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,45,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,493,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,51,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,52,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,53,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,54,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,55,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,56,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,61,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,62,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,71,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,72,,,EPA_GHGI_T_A_14 -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,81,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,2213,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,42,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,44,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,45,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,493,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,51,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,52,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,53,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,54,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,55,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,56,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,61,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,62,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,71,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,72,,,EPA_GHGI_T_A_14 -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,81,,,EPA_GHGI_T_A_14 +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,2213,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,493,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,927110,,S00102,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,923110,,GSLGE,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" +EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,923120,,GSLGH,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9, EPA_GHGI_T_A_14" EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,2213,,,EPA_GHGI_T_A_14 EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,42,,,EPA_GHGI_T_A_14 EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,44,,,EPA_GHGI_T_A_14 @@ -410,125 +274,116 @@ EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,62,,,EPA_GHGI_T_A_14 EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,71,,,EPA_GHGI_T_A_14 EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,72,,,EPA_GHGI_T_A_14 EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,81,,,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,927110,,S00102,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,923110,,GSLGE,EPA_GHGI_T_A_14 +EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,923120,,GSLGH,EPA_GHGI_T_A_14 EPA_GHGI,Total (All Fuels) Residential,NAICS_2012_Code,F01000,,F0100,EPA_GHGI_T_A_14 EPA_GHGI,HCFC-22 Production,NAICS_2012_Code,325120,,325120,EPA_GHGI_T_4_50 EPA_GHGI,Electronics Production,NAICS_2012_Code,334413,,334413,EPA_GHGI_T_4_94 EPA_GHGI,Magnesium Production and Processing,NAICS_2012_Code,331410,,"331410, 331490, 331520",EPA_GHGI_T_4_84 EPA_GHGI,Magnesium Production and Processing,NAICS_2012_Code,33149,,,EPA_GHGI_T_4_84 EPA_GHGI,Magnesium Production and Processing,NAICS_2012_Code,33152,,,EPA_GHGI_T_4_84 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,11,,"All sectors, excluding transport",EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,21,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,22,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,23,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,31,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,32,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,33,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,42,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,44,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,45,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,49,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,51,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,52,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,53,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,54,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,55,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,56,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,61,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,62,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,71,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,72,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,81,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,92,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,F01000,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning - Households,NAICS_2012_Code,F01000,,Exclusive household portion,EPA_GHGI_T_4_101 +EPA_GHGI,Industrial Process Refrigeration,NAICS_2012_Code,11,,,EPA_GHGI_T_4_101 +EPA_GHGI,Industrial Process Refrigeration,NAICS_2012_Code,21,,,EPA_GHGI_T_4_101 +EPA_GHGI,Industrial Process Refrigeration,NAICS_2012_Code,2212,,,EPA_GHGI_T_4_101 +EPA_GHGI,Industrial Process Refrigeration,NAICS_2012_Code,23,,,EPA_GHGI_T_4_101 +EPA_GHGI,Industrial Process Refrigeration,NAICS_2012_Code,31,,,EPA_GHGI_T_4_101 +EPA_GHGI,Industrial Process Refrigeration,NAICS_2012_Code,32,,,EPA_GHGI_T_4_101 +EPA_GHGI,Industrial Process Refrigeration,NAICS_2012_Code,33,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Refrigeration,NAICS_2012_Code,2213,,Apply same mapping as Commercial elsewhere,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Refrigeration,NAICS_2012_Code,42,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Refrigeration,NAICS_2012_Code,44,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Refrigeration,NAICS_2012_Code,45,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Refrigeration,NAICS_2012_Code,493,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Refrigeration,NAICS_2012_Code,51,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Refrigeration,NAICS_2012_Code,52,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Refrigeration,NAICS_2012_Code,53,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Refrigeration,NAICS_2012_Code,54,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Refrigeration,NAICS_2012_Code,55,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Refrigeration,NAICS_2012_Code,56,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Refrigeration,NAICS_2012_Code,61,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Refrigeration,NAICS_2012_Code,62,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Refrigeration,NAICS_2012_Code,71,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Refrigeration,NAICS_2012_Code,72,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Refrigeration,NAICS_2012_Code,81,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Refrigeration,NAICS_2012_Code,927110,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Refrigeration,NAICS_2012_Code,923110,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Refrigeration,NAICS_2012_Code,923120,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Stationary Air Conditioning,NAICS_2012_Code,2213,,Apply same mapping as Commercial elsewhere,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Stationary Air Conditioning,NAICS_2012_Code,42,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Stationary Air Conditioning,NAICS_2012_Code,44,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Stationary Air Conditioning,NAICS_2012_Code,45,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Stationary Air Conditioning,NAICS_2012_Code,493,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Stationary Air Conditioning,NAICS_2012_Code,51,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Stationary Air Conditioning,NAICS_2012_Code,52,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Stationary Air Conditioning,NAICS_2012_Code,53,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Stationary Air Conditioning,NAICS_2012_Code,54,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Stationary Air Conditioning,NAICS_2012_Code,55,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Stationary Air Conditioning,NAICS_2012_Code,56,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Stationary Air Conditioning,NAICS_2012_Code,61,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Stationary Air Conditioning,NAICS_2012_Code,62,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Stationary Air Conditioning,NAICS_2012_Code,71,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Stationary Air Conditioning,NAICS_2012_Code,72,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Stationary Air Conditioning,NAICS_2012_Code,81,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Stationary Air Conditioning,NAICS_2012_Code,927110,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Stationary Air Conditioning,NAICS_2012_Code,923110,,,EPA_GHGI_T_4_101 +EPA_GHGI,Commercial Stationary Air Conditioning,NAICS_2012_Code,923120,,,EPA_GHGI_T_4_101 +EPA_GHGI,Domestic Refrigeration,NAICS_2012_Code,F01000,,,EPA_GHGI_T_4_101 +EPA_GHGI,Residential Stationary Air Conditioning,NAICS_2012_Code,F01000,,,EPA_GHGI_T_4_101 EPA_GHGI,Aerosols,,,,excluded,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,11,,All sectors,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,21,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,22,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,23,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,31,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,32,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,33,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,42,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,44,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,45,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,48,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,49,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,51,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,52,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,53,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,54,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,55,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,56,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,61,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,62,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,71,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,72,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,81,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,92,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,F01000,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,11,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,21,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,22,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,23,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,31,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,32,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,33,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,42,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,44,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,45,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,48,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,49,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,51,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,52,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,53,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,54,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,55,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,56,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,61,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,62,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,71,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,72,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,81,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,92,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,F01000,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams,NAICS_2012_Code,11,,All sectors,EPA_GHGI_T_4_101 +EPA_GHGI,Foams,NAICS_2012_Code,21,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams,NAICS_2012_Code,22,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams,NAICS_2012_Code,23,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams,NAICS_2012_Code,31,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams,NAICS_2012_Code,32,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams,NAICS_2012_Code,33,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams,NAICS_2012_Code,42,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams,NAICS_2012_Code,44,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams,NAICS_2012_Code,45,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams,NAICS_2012_Code,48,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams,NAICS_2012_Code,49,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams,NAICS_2012_Code,51,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams,NAICS_2012_Code,52,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams,NAICS_2012_Code,53,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams,NAICS_2012_Code,54,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams,NAICS_2012_Code,55,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams,NAICS_2012_Code,56,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams,NAICS_2012_Code,61,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams,NAICS_2012_Code,62,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams,NAICS_2012_Code,71,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams,NAICS_2012_Code,72,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams,NAICS_2012_Code,81,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams,NAICS_2012_Code,92,,,EPA_GHGI_T_4_101 +EPA_GHGI,Foams,NAICS_2012_Code,F01000,,,EPA_GHGI_T_4_101 EPA_GHGI,Solvents,,,,excluded,EPA_GHGI_T_4_101 EPA_GHGI,Fire Protection,,,,excluded,EPA_GHGI_T_4_101 -EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,484,,484000,EPA_GHGI_T_A_103 -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_A_103, EPA_GHGI_T_A_79" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,484,,484000,"EPA_GHGI_T_A_103, EPA_GHGI_T_A_79" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,488410,,,"EPA_GHGI_T_A_103, EPA_GHGI_T_A_79" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,922120,,,"EPA_GHGI_T_A_103, EPA_GHGI_T_A_79" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,922140,,,"EPA_GHGI_T_A_103, EPA_GHGI_T_A_79" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,922160,,,"EPA_GHGI_T_A_103, EPA_GHGI_T_A_79" -EPA_GHGI,Passenger Cars,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_A_103, EPA_GHGI_T_A_79" -EPA_GHGI,Rail,NAICS_2012_Code,482,,482000,"EPA_GHGI_T_A_103, EPA_GHGI_T_A_79" -EPA_GHGI,School and Tour Buses,NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_103 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,483,,483000,EPA_GHGI_T_A_103 -EPA_GHGI,Transit Buses,,,,excluded,EPA_GHGI_T_A_103 -EPA_GHGI,Buses,NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_79 -EPA_GHGI,Buses,NAICS_2012_Code,4871,,,EPA_GHGI_T_A_79 -EPA_GHGI,Buses - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_79 -EPA_GHGI,Buses - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,487,,48A000,EPA_GHGI_T_A_79 -EPA_GHGI,Buses - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,488,,,EPA_GHGI_T_A_79 -EPA_GHGI,Buses - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,S00201,,S00201,EPA_GHGI_T_A_79 -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,481,,481000,EPA_GHGI_T_A_79 -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,481,,481000,EPA_GHGI_T_A_79 -EPA_GHGI,Military Aircraft,NAICS_2012_Code,928110,,S00500,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks - Gasoline,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 -EPA_GHGI,Light-Duty Trucks - Gasoline,NAICS_2012_Code,492,,492000,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,484,,484000,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,92212,,S00203,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,92214,,,EPA_GHGI_T_A_79 -EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil (Diesel Fuel),NAICS_2012_Code,92216,,,EPA_GHGI_T_A_79 -EPA_GHGI,Motorcycles,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 -EPA_GHGI,Passenger Cars - Gasoline,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 -EPA_GHGI,Passenger Cars - Gasoline,NAICS_2012_Code,92,,S00600,EPA_GHGI_T_A_79 -EPA_GHGI,Passenger Cars - Gasoline,NAICS_2012_Code,491,,491000,EPA_GHGI_T_A_79 -EPA_GHGI,Passenger Cars - Gasoline,NAICS_2012_Code,92,,GSLGO,EPA_GHGI_T_A_79 -EPA_GHGI,Pipelines,NAICS_2012_Code,486,,486000,EPA_GHGI_T_A_79 -EPA_GHGI,Recreational Boats,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_A_79 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,4831,,483000,EPA_GHGI_T_A_79 -EPA_GHGI,Ships and Boats,NAICS_2012_Code,4832,,4-digit to avoid data loss in BLS_QCEW,EPA_GHGI_T_A_79 -EPA_GHGI,Ships and Non-Recreational Boats,NAICS_2012_Code,483,,483000,EPA_GHGI_T_A_79 -EPA_GHGI,Ships and Non-Recreational Boats,NAICS_2012_Code,4872,,483000,EPA_GHGI_T_A_79 +EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,484,,484000,EPA_GHGI_T_A_97 +EPA_GHGI,School and Tour Buses,NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_97 +EPA_GHGI,Transit Buses,,,,excluded,EPA_GHGI_T_A_97 +EPA_GHGI,Buses,NAICS_2012_Code,485,,485000,EPA_GHGI_T_3_13 +EPA_GHGI,Buses - Distillate Fuel Oil,NAICS_2012_Code,485,,485000,EPA_GHGI_T_3_13 +EPA_GHGI,Buses - Distillate Fuel Oil,NAICS_2012_Code,487,,48A000,EPA_GHGI_T_3_13 +EPA_GHGI,Buses - Distillate Fuel Oil,NAICS_2012_Code,488,,,EPA_GHGI_T_3_13 +EPA_GHGI,Buses - Distillate Fuel Oil,NAICS_2012_Code,S00201,,S00201,EPA_GHGI_T_3_13 +EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,481,,481000,EPA_GHGI_T_3_13 +EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,481,,481000,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Military Aircraft,NAICS_2012_Code,928110,,S00500,EPA_GHGI_T_3_13 +EPA_GHGI,Light-Duty Trucks - Households,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_13, EPA_GHGI_T_A_97" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,492,,492000,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,484,,484000,"EPA_GHGI_T_3_13, EPA_GHGI_T_A_97" +EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil,NAICS_2012_Code,484,,484000,EPA_GHGI_T_3_13 +EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil,NAICS_2012_Code,92212,,S00203,EPA_GHGI_T_3_13 +EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil,NAICS_2012_Code,92214,,,EPA_GHGI_T_3_13 +EPA_GHGI,Medium- and Heavy-Duty Trucks - Distillate Fuel Oil,NAICS_2012_Code,92216,,,EPA_GHGI_T_3_13 +EPA_GHGI,Motorcycles,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Passenger Cars - Households,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_13, EPA_GHGI_T_A_97" +EPA_GHGI,Passenger Cars,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Passenger Cars,NAICS_2012_Code,922,,"S00600, GSLGO","EPA_GHGI_T_3_13, EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Passenger Cars,NAICS_2012_Code,491,,491000,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" +EPA_GHGI,Pipeline Natural Gas,NAICS_2012_Code,486,,,EPA_GHGI_T_3_13 +EPA_GHGI,Rail,NAICS_2012_Code,482,,482000,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14, EPA_GHGI_T_3_15, EPA_GHGI_T_A_97" +EPA_GHGI,Recreational Boats,NAICS_2012_Code,F01000,,F01000,EPA_GHGI_T_3_13 +EPA_GHGI,Ships and Boats,NAICS_2012_Code,483,,483000,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15, EPA_GHGI_T_A_97" +EPA_GHGI,Ships and Non-Recreational Boats,NAICS_2012_Code,483,,483000,EPA_GHGI_T_3_13 From fc86aafafd663c4d4aae77a4ec504a3308d50b59 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 13 Apr 2023 13:39:30 -0600 Subject: [PATCH 0511/1127] drop repeated code --- flowsa/flowby.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 2ce2c7f9f..613cfcd96 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1572,11 +1572,9 @@ def proportionally_attribute( # skip over Secondary if not relevant if fba[f'{rank}Sector'].isna().all(): continue - groupby_cols = ['group_id'] - for rank in ['Primary', 'Secondary']: - counted = fba.assign(group_count=(fba.groupby(groupby_cols) - ['group_id'] - .transform('count'))) + counted = fba.assign(group_count=(fba.groupby(groupby_cols) + ['group_id'] + .transform('count'))) directly_attributed = ( counted .query('group_count == 1') @@ -1619,7 +1617,7 @@ def proportionally_attribute( if not unattributable.empty: log.warning( - 'Could not attribute activities in %s due to lack of ' + 'Could not attribute activities in %s due to lack of ' 'flows in attribution source %s for mapped %s sectors %s', #set(zip(unattributable.ActivityProducedBy, # unattributable.ActivityConsumedBy, From 2f4dc3cf10ab3bb8259bb8d25dd774c18dca0d01 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 13 Apr 2023 16:47:58 -0400 Subject: [PATCH 0512/1127] drop flowbysector.py and deprecated code --- flowsa/__init__.py | 1 - flowsa/data_source_scripts/BEA.py | 80 ---- flowsa/data_source_scripts/EPA_CDDPath.py | 1 - flowsa/dataclean.py | 89 ---- flowsa/fbs_allocation.py | 513 +--------------------- flowsa/flowbysector.py | 441 ------------------- flowsa/test_FBS_against_remote.py | 9 +- flowsa/test_single_FBS.py | 6 +- flowsa/validation.py | 195 +------- 9 files changed, 19 insertions(+), 1316 deletions(-) delete mode 100644 flowsa/flowbysector.py diff --git a/flowsa/__init__.py b/flowsa/__init__.py index 529c2d62c..9380f4b9b 100644 --- a/flowsa/__init__.py +++ b/flowsa/__init__.py @@ -28,7 +28,6 @@ from flowsa.validation import check_for_nonetypes_in_sector_col, \ check_for_negative_flowamounts import flowsa.flowbyactivity -import flowsa.flowbysector from flowsa.bibliography import generate_fbs_bibliography from flowsa.datavisualization import FBSscatterplot from .flowby import FlowByActivity, FlowBySector diff --git a/flowsa/data_source_scripts/BEA.py b/flowsa/data_source_scripts/BEA.py index 3d73450f9..cb449f0a8 100644 --- a/flowsa/data_source_scripts/BEA.py +++ b/flowsa/data_source_scripts/BEA.py @@ -16,7 +16,6 @@ from flowsa.schema import activity_fields from flowsa.settings import externaldatapath from flowsa.flowbyfunctions import assign_fips_location_system, aggregator -from flowsa.fbs_allocation import allocation_helper def bea_gdp_parse(*, year, **_): @@ -179,82 +178,3 @@ def subset_BEA_table(df_load, attr, **_): return df3 - -def subset_and_allocate_BEA_table(df, attr, **_): - """ - Temporary function to mimic use of 2nd helper allocation dataset - """ - - df = subset_BEA_table(df, attr) - v = {'geoscale_to_use': 'national'} - method2 = {'target_sector_source': 'NAICS_2012_Code'} - - import importlib - fxn = getattr(importlib.import_module( - 'flowsa.data_source_scripts.BLS_QCEW'), - "bls_clean_allocation_fba_w_sec") - - attr2 = {"helper_source": "BLS_QCEW", - "helper_method": "proportional", - "helper_source_class": "Employment", - "helper_source_year": 2012, - "helper_flow": ["Number of employees, Federal Government", - "Number of employees, State Government", - "Number of employees, Local Government", - "Number of employees, Private"], - "helper_from_scale": "national", - "allocation_from_scale": "national", - "clean_helper_fba_wsec": fxn} - df2 = allocation_helper(df, attr2, method2, v, False) - # Drop remaining rows with no sectors e.g. T001 and other final demands - df2 = df2.dropna(subset=['SectorConsumedBy']).reset_index(drop=True) - return df2 - - -def subset_and_equally_allocate_BEA_table(df, attr, **_): - """ - Temporary function to equally attribute BEA table. This function will - be unnecessary after merge with recursive branch - """ - # Necessary to run equal attribution before subsetting dataset by an - # activity because in some situations both the BEA ActivityConsumedBy - # and ActivityProducedBy values map to multiple sectors. The - # "subset_BEA_table()" fxn resets one of the activity columns to NaN. - # For example, for "Liming" in the GHG attribution model, - # the ActivityProducedBy 327500 maps to both 327410 and 327420 - so data - # is double counted, but subsetting the BEA table resets - # ActivityProducedBy to NaN and that double counting is lost. - - # equally attribute bea codes to each mapped sector - groupby_cols = ['group_id'] - for c in ['Produced', 'Consumed']: - df = ( - df - .assign( - **{f'_naics_{n}': df[f'Sector{c}By'].str.slice(stop=n) - for n in range(2, 7)}, - **{f'_unique_naics_{n}_by_group': lambda x, i=n: ( - x.groupby(groupby_cols if i == 2 - else [*groupby_cols, f'_naics_{i - 1}'], - dropna=False) - [[f'_naics_{i}']] - .transform('nunique', dropna=False) - ) - for n in range(2, 7)}, - FlowAmount=lambda x: reduce( - lambda x, y: x / y, - [x.FlowAmount, *[x[f'_unique_naics_{n}_by_group'] - for n in range(2, 7)]] - ) - ) - ) - groupby_cols.append(f'Sector{c}By') - - df = df.drop( - columns=[*[f'_naics_{n}' for n in range(2, 7)], - *[f'_unique_naics_{n}_by_group' for n in range(2, 7)]] - ) - - df2 = subset_BEA_table(df, attr) - - return df2 diff --git a/flowsa/data_source_scripts/EPA_CDDPath.py b/flowsa/data_source_scripts/EPA_CDDPath.py index bf9dbf7f3..5f596b008 100644 --- a/flowsa/data_source_scripts/EPA_CDDPath.py +++ b/flowsa/data_source_scripts/EPA_CDDPath.py @@ -244,5 +244,4 @@ def melt_and_apply_percentages(df, fbacol='ActivityConsumedBy'): flowsa.flowbyactivity.main(source='EPA_CDDPath', year=2018) fba = flowsa.getFlowByActivity(datasource='EPA_CDDPath', year=2018) - # flowsa.flowbysector.main(method='CDD_concrete_national_2014') # fbs = flowsa.getFlowBySector(methodname='CDD_concrete_national_2014') diff --git a/flowsa/dataclean.py b/flowsa/dataclean.py index 6485b4c31..8df1d466e 100644 --- a/flowsa/dataclean.py +++ b/flowsa/dataclean.py @@ -6,7 +6,6 @@ """ import numpy as np -from flowsa.settings import log from flowsa.literature_values import get_Canadian_to_USD_exchange_rate @@ -231,91 +230,3 @@ def standardize_units(df): return df - -def harmonize_FBS_columns(df): - """ - For FBS use in USEEIOR, harmonize the values in the columns - - LocationSystem: drop the year, so just 'FIPS' - - MeasureofSpread: tmp set to NoneType as values currently misleading - - Spread: tmp set to 0 as values currently misleading - - DistributionType: tmp set to NoneType as values currently misleading - - MetaSources: Combine strings for rows where - class/context/flowtype/flowable/etc. are equal - :param df: FBS dataframe with mixed values/strings in columns - :return: FBS df with harmonized values/strings in columns - """ - - # harmonize LocationSystem column - log.info('Drop year in LocationSystem') - if df['LocationSystem'].str.contains('FIPS').all(): - df = df.assign(LocationSystem='FIPS') - # harmonize MeasureofSpread - log.info('Reset MeasureofSpread to NoneType') - df = df.assign(MeasureofSpread=None) - # reset spread, as current values are misleading - log.info('Reset Spread to 0') - df = df.assign(Spread=0) - # harmonize Distributiontype - log.info('Reset DistributionType to NoneType') - df = df.assign(DistributionType=None) - - # harmonize metasources - log.info('Harmonize MetaSources') - df = replace_NoneType_with_empty_cells(df) - - # subset all string cols of the df and drop duplicates - string_cols = list(df.select_dtypes(include=['object']).columns) - df_sub = df[string_cols].drop_duplicates().reset_index(drop=True) - # sort df - df_sub = df_sub.sort_values(['MetaSources', 'SectorProducedBy', - 'SectorConsumedBy']).reset_index(drop=True) - - # new group cols - group_no_meta = [e for e in string_cols if e not in 'MetaSources'] - - # combine/sum columns that share the same data other than Metasources, - # combining MetaSources string in process - df_sub = df_sub.groupby( - group_no_meta)['MetaSources'].apply(', '.join).reset_index() - # drop the MetaSources col in original df and replace with the - # MetaSources col in df_sub - df = df.drop(columns='MetaSources') - harmonized_df = df.merge(df_sub, how='left') - harmonized_df = replace_strings_with_NoneType(harmonized_df) - - return harmonized_df - - -def reset_fbs_dq_scores(df): - """ - Set all Data Quality Scores to None - :param df: FBS dataframe with mixed values/strings in columns - :return: FBS df with the DQ scores set to null - """ - - # reset spread, as current values are misleading - log.info('Reset Spread to None') - df = df.assign(Spread=None) - # reset min, as current values are misleading - log.info('Reset Min to None') - df = df.assign(Min=None) - # reset min, as current values are misleading - log.info('Reset Max to None') - df = df.assign(Max=None) - # reset DR, as current values are misleading - log.info('Reset DataReliability to None') - df = df.assign(DataReliability=None) - # reset TC, as current values are misleading - log.info('Reset TemporalCorrelation to None') - df = df.assign(TemporalCorrelation=None) - # reset GC, as current values are misleading - log.info('Reset GeographicalCorrelation to None') - df = df.assign(GeographicalCorrelation=None) - # reset TC, as current values are misleading - log.info('Reset TechnologicalCorrelation to None') - df = df.assign(TechnologicalCorrelation=None) - # reset DC, as current values are misleading - log.info('Reset DataCollection to None') - df = df.assign(DataCollection=None) - - return df diff --git a/flowsa/fbs_allocation.py b/flowsa/fbs_allocation.py index 84a74f506..f9554c655 100644 --- a/flowsa/fbs_allocation.py +++ b/flowsa/fbs_allocation.py @@ -5,520 +5,15 @@ Functions to allocate data using additional data sources """ -import numpy as np -import pandas as pd import flowsa -from flowsa.common import fba_activity_fields, fbs_activity_fields, \ - fba_mapped_wsec_default_grouping_fields, fba_wsec_default_grouping_fields, \ - check_activities_sector_like, return_bea_codes_used_as_naics -from flowsa.location import US_FIPS -from flowsa.schema import activity_fields +from flowsa.common import fba_activity_fields from flowsa.settings import log -from flowsa.validation import check_allocation_ratios, \ - check_if_location_systems_match -from flowsa.flowbyfunctions import collapse_activity_fields, \ - sector_aggregation, sector_disaggregation, subset_df_by_geoscale, \ - load_fba_w_standardized_units, aggregator -from flowsa.allocation import allocate_by_sector, proportional_allocation_by_location_and_activity, \ - equally_allocate_parent_to_child_naics, equal_allocation -from flowsa.sectormapping import get_fba_allocation_subset, add_sectors_to_flowbyactivity -from flowsa.dataclean import replace_strings_with_NoneType +from flowsa.flowbyfunctions import subset_df_by_geoscale, \ + load_fba_w_standardized_units +from flowsa.sectormapping import add_sectors_to_flowbyactivity from flowsa.validation import check_if_data_exists_at_geoscale -def direct_allocation_method(fbs, k, names, method): - """ - Directly assign activities to sectors - :param fbs: df, FBA with flows converted using fedelemflowlist - :param k: str, source name - :param names: list, activity names in activity set - :param method: dictionary, FBS method yaml - :return: df with sector columns - """ - log.info('Directly assigning activities to sectors') - # for each activity, if activities are not sector like, - # check that there is no data loss - if check_activities_sector_like(fbs) is False: - activity_list = [] - n_allocated = [] - for n in names: - # avoid double counting by dropping n from the df after calling on - # n, in the event both ACB and APB values exist - fbs = fbs[~((fbs[fba_activity_fields[0]].isin(n_allocated)) | - (fbs[fba_activity_fields[1]].isin(n_allocated)) - )].reset_index(drop=True) - log.debug('Checking for %s at target sector level', n) - fbs_subset = \ - fbs[(fbs[fba_activity_fields[0]] == n) | - (fbs[fba_activity_fields[1]] == n)].reset_index(drop=True) - activity_list.append(fbs_subset) - n_allocated.append(n) - fbs = pd.concat(activity_list, ignore_index=True) - # check if an Activity maps to more than one sector, - # if so, equally allocate - fbs = equal_allocation(fbs) - return fbs - - -def function_allocation_method(flow_subset_mapped, k, names, attr, fbs_list, - method): - """ - Allocate df activities to sectors using a function identified - in the FBS method yaml - :param flow_subset_mapped: df, FBA with flows converted using - fedelemflowlist - :param k: str, source name - :param names: list, activity names in activity set - :param attr: dictionary, attribute data from method yaml for activity set - :param fbs_list: list, fbs dfs created running flowbysector.py - :return: df, FBS, with allocated activity columns to sectors - """ - log.info('Calling on function specified in method yaml to allocate ' - '%s to sectors', ', '.join(map(str, names))) - fbs = attr['allocation_source'](flow_subset_mapped=flow_subset_mapped, - k=k, names=names, attr=attr, - fbs_list=fbs_list, method=method) - return fbs - - -def dataset_allocation_method(flow_subset_mapped, attr, names, method, - k, v, aset, download_FBA_if_missing, - fbsconfigpath): - """ - Method of allocation using a specified data source - :param flow_subset_mapped: FBA subset mapped using federal - elementary flow list - :param attr: dictionary, attribute data from method yaml for activity set - :param names: list, activity names in activity set - :param method: dictionary, FBS method yaml - :param k: str, the datasource name - :param v: dictionary, the datasource parameters - :param aset: dictionary items for FBS method yaml - :param download_FBA_if_missing: bool, indicate if missing FBAs - should be downloaded from Data Commons - :return: df, allocated activity names - """ - - from flowsa.validation import compare_df_units - - # add parameters to dictionary if exist in method yaml - fba_dict = {} - if 'allocation_flow' in attr: - fba_dict['flowname_subset'] = attr['allocation_flow'] - if 'allocation_compartment' in attr: - fba_dict['compartment_subset'] = attr['allocation_compartment'] - if 'clean_allocation_fba' in attr: - fba_dict['clean_fba'] = attr['clean_allocation_fba'] - if 'clean_allocation_fba_w_sec' in attr: - fba_dict['clean_fba_w_sec'] = attr['clean_allocation_fba_w_sec'] - if 'allocation_selection_fields' in attr: - fba_dict['allocation_selection_fields'] = attr['allocation_selection_fields'] - - # load the allocation FBA - fba_allocation_wsec = \ - load_map_clean_fba(method, attr, - fba_sourcename=attr['allocation_source'], - df_year=attr['allocation_source_year'], - flowclass=attr['allocation_source_class'], - geoscale_from=attr['allocation_from_scale'], - geoscale_to=v['geoscale_to_use'], - download_FBA_if_missing=download_FBA_if_missing, - fbsconfigpath=fbsconfigpath, - **fba_dict) - - # subset fba datasets to only keep the sectors associated - # with activity subset - log.info("Subsetting %s for sectors in %s", attr['allocation_source'], k) - fba_allocation_subset = \ - get_fba_allocation_subset(fba_allocation_wsec, k, - names, sourceconfig=v, - flowSubsetMapped=flow_subset_mapped, - allocMethod=attr['allocation_method'], - fbsconfigpath=fbsconfigpath) - - # if there is an allocation helper dataset, modify allocation df - if 'helper_source' in attr: - log.info("Using the specified allocation help for subset of %s", - attr['allocation_source']) - fba_allocation_subset = \ - allocation_helper(fba_allocation_subset, attr, method, v, - download_FBA_if_missing=download_FBA_if_missing) - - if 'multiplication' in attr['allocation_method']: - # collapse activities col in prep for merge - flow_allocation = collapse_activity_fields(fba_allocation_subset) - flow_allocation = flow_allocation.rename( - columns={'FlowAmount': 'Multiplier'}) - # merge fba df w/flow allocation dataset - # check units - compare_df_units(flow_subset_mapped, flow_allocation) - for i, j in activity_fields.items(): - sector_col = j[1]["flowbysector"] - if flow_subset_mapped[sector_col].isnull().all(): - continue - fa_cols = ['Location', 'Sector', 'Multiplier'] - l_cols = ['Location', sector_col] - r_cols = ['Location', 'Sector'] - flow_subset_mapped2 = flow_subset_mapped.merge( - flow_allocation[fa_cols], left_on=l_cols, right_on=r_cols, - how='left') - - # calculate flow amounts for each sector - log.info("Calculating new flow amounts by multiplying") - flow_subset_mapped2['FlowAmount'] = \ - flow_subset_mapped2['FlowAmount'] * flow_subset_mapped2['Multiplier'] - # drop columns - fbs = flow_subset_mapped2.drop(columns=['Multiplier', 'Sector']) - - # else determine allocation ratios - else: - # create flow allocation ratios for each activity - flow_alloc_list = [] - if 'Context' in fba_allocation_subset.columns: - group_cols = fba_mapped_wsec_default_grouping_fields - else: - group_cols = fba_wsec_default_grouping_fields - group_cols = [e for e in group_cols if e not in - ('ActivityProducedBy', 'ActivityConsumedBy')] - n_allocated = [] - for n in names: - log.debug("Creating allocation ratios for %s", n) - # if n has already been called, drop all rows of data - # containing n to avoid double counting when there are two - # activities in each ACB and APB columns - fba_allocation_subset = fba_allocation_subset[ - ~((fba_allocation_subset[ - fba_activity_fields[0]].isin(n_allocated)) | - (fba_allocation_subset[fba_activity_fields[1]].isin(n_allocated)) - )].reset_index(drop=True) - fba_allocation_subset_2 = \ - get_fba_allocation_subset(fba_allocation_subset, k, - [n], sourceconfig=v, - flowSubsetMapped=flow_subset_mapped, - allocMethod=attr['allocation_method'], - fbsconfigpath=fbsconfigpath) - if len(fba_allocation_subset_2) == 0: - log.info("No data found to allocate %s", n) - else: - flow_alloc = \ - allocate_by_sector(fba_allocation_subset_2, attr, - attr['allocation_method'], group_cols, - flowSubsetMapped=flow_subset_mapped) - flow_alloc = flow_alloc.assign(FBA_Activity=n) - n_allocated.append(n) - flow_alloc_list.append(flow_alloc) - flow_allocation = pd.concat(flow_alloc_list, ignore_index=True) - - # generalize activity field names to enable link to main fba source - log.info("Generalizing activity columns in subset of %s", - attr['allocation_source']) - flow_allocation = collapse_activity_fields(flow_allocation) - - # check for issues with allocation ratios - check_allocation_ratios(flow_allocation, aset, method, attr) - - # create list of sectors in the flow allocation df, - # drop any rows of data in the flow df that aren't in list - sector_list = flow_allocation['Sector'].unique().tolist() - - # subset fba allocation table to the values in the activity - # list, based on overlapping sectors - flow_subset_mapped2 = flow_subset_mapped.loc[ - (flow_subset_mapped[fbs_activity_fields[0]].isin(sector_list)) | - (flow_subset_mapped[fbs_activity_fields[1]].isin(sector_list))] - - # check if fba and allocation dfs have the same LocationSystem - log.info("Checking if flowbyactivity and allocation " - "dataframes use the same location systems") - check_if_location_systems_match(flow_subset_mapped2, flow_allocation) - - # determine how to merge dfs based on location - if (attr['allocation_from_scale'] == 'state') and \ - (v['geoscale_to_use'] == 'county'): - flow_allocation['Location_tmp'] = flow_allocation['Location'].apply( - lambda x: x[0:2]) - flow_subset_mapped2['Location_tmp'] = flow_subset_mapped2[ - 'Location'].apply(lambda x: x[0:2]) - loc_col = ['Location_tmp'] - elif (attr['allocation_from_scale'] == 'national') and \ - (v['geoscale_to_use'] != 'national'): - loc_col = [] - else: - loc_col = ['Location'] - - # merge fba df w/flow allocation dataset - log.info("Merge %s and subset of %s", k, attr['allocation_source']) - for i, j in activity_fields.items(): - # check units - compare_df_units(flow_subset_mapped2, flow_allocation) - # create list of columns to merge on - if 'allocation_merge_columns' in attr: - fa_cols = loc_col + \ - ['Sector', 'FlowAmountRatio', 'FBA_Activity'] + \ - attr['allocation_merge_columns'] - l_cols = loc_col + \ - [j[1]["flowbysector"], j[0]["flowbyactivity"]] + \ - attr['allocation_merge_columns'] - r_cols = loc_col + \ - ['Sector', 'FBA_Activity'] + \ - attr['allocation_merge_columns'] - else: - fa_cols = loc_col + ['Sector', 'FlowAmountRatio', 'FBA_Activity'] - l_cols = loc_col + [j[1]["flowbysector"], j[0]["flowbyactivity"]] - r_cols = loc_col + ['Sector', 'FBA_Activity'] - - flow_subset_mapped2 = flow_subset_mapped2.merge( - flow_allocation[fa_cols], left_on=l_cols, right_on=r_cols, - how='left') - # drop location_tmp, if exists - flow_subset_mapped2 = flow_subset_mapped2.drop( - columns=['Location_tmp'], errors='ignore') - - # merge the flowamount columns - flow_subset_mapped2.loc[:, 'FlowAmountRatio'] =\ - flow_subset_mapped2['FlowAmountRatio_x'].fillna( - flow_subset_mapped2['FlowAmountRatio_y']) - # fill null rows with 0 because no allocation info - flow_subset_mapped2['FlowAmountRatio'] = \ - flow_subset_mapped2['FlowAmountRatio'].fillna(0) - - # drop rows where there is no allocation data - fbs = flow_subset_mapped2.dropna( - subset=['Sector_x', 'Sector_y'], how='all').reset_index(drop=True) - - # calculate flow amounts for each sector - log.info("Calculating new flow amounts using flow ratios") - fbs.loc[:, 'FlowAmount'] = fbs['FlowAmount'] * fbs['FlowAmountRatio'] - - # drop columns - log.info("Cleaning up new flow by sector") - fbs = fbs.drop(columns=['Sector_x', 'FlowAmountRatio_x', 'Sector_y', - 'FlowAmountRatio_y', 'FlowAmountRatio', - 'FBA_Activity_x', 'FBA_Activity_y', - 'disaggregate_flag', 'Description'], - errors='ignore') - - # if activities are source like, reset activity columns - sector_like_activities = check_activities_sector_like(flow_subset_mapped) - if sector_like_activities: - fbs = fbs.assign(ActivityProducedBy=fbs['SectorProducedBy'], - ActivityConsumedBy=fbs['SectorConsumedBy']) - - group_cols = list(fbs.select_dtypes(include=['object', 'int']).columns) - fbs2 = aggregator(fbs, group_cols) - - fbs3 = sector_aggregation(fbs2) - - return fbs3 - - -def allocation_helper(df_w_sector, attr, method, v, download_FBA_if_missing): - """ - Function to help allocate activity names using secondary df - :param df_w_sector: df, includes sector columns - :param attr: dictionary, attribute data from method yaml for activity set - :param method: dictionary, FBS method yaml - :param v: dictionary, the datasource parameters - :param download_FBA_if_missing: bool, indicate if missing FBAs - should be downloaded from Data Commons or run locally - :return: df, with modified fba allocation values - """ - from flowsa.validation import compare_df_units - - # add parameters to dictionary if exist in method yaml - fba_dict = {} - if 'helper_flow' in attr: - fba_dict['flowname_subset'] = attr['helper_flow'] - if 'clean_helper_fba' in attr: - fba_dict['clean_fba'] = attr['clean_helper_fba'] - if 'clean_helper_fba_wsec' in attr: - fba_dict['clean_fba_w_sec'] = attr['clean_helper_fba_wsec'] - if 'helper_activity_to_sector_mapping' in attr: - fba_dict['activity_to_sector_mapping'] = attr['helper_activity_to_sector_mapping'] - if 'helper_allocation_selection_fields' in attr: - fba_dict['allocation_selection_fields'] = attr['helper_allocation_selection_fields'] - - # load the allocation FBA - helper_allocation = \ - load_map_clean_fba(method, attr, - fba_sourcename=attr['helper_source'], - df_year=attr['helper_source_year'], - flowclass=attr['helper_source_class'], - geoscale_from=attr['helper_from_scale'], - geoscale_to=v['geoscale_to_use'], - download_FBA_if_missing=download_FBA_if_missing, - **fba_dict) - - # run sector disagg to capture any missing lower level naics - helper_allocation = sector_disaggregation(helper_allocation) - - # generalize activity field names to enable link to water withdrawal table - helper_allocation = collapse_activity_fields(helper_allocation) - # drop any rows not mapped - helper_allocation = \ - helper_allocation[helper_allocation['Sector'].notnull()] - # drop columns - helper_allocation = \ - helper_allocation.drop(columns=['Activity', 'Min', 'Max']) - - # rename column - helper_allocation = \ - helper_allocation.rename(columns={"FlowAmount": 'HelperFlow'}) - - # determine the df_w_sector column to merge on - df_w_sector = replace_strings_with_NoneType(df_w_sector) - sec_consumed_list = \ - df_w_sector['SectorConsumedBy'].drop_duplicates().values.tolist() - sec_produced_list = \ - df_w_sector['SectorProducedBy'].drop_duplicates().values.tolist() - # if a sector field column is not all 'none', that is the column to merge - if all(v is None for v in sec_consumed_list): - sector_col_to_merge = 'SectorProducedBy' - elif all(v is None for v in sec_produced_list): - sector_col_to_merge = 'SectorConsumedBy' - else: - log.error('There is not a clear sector column to base ' - 'merge with helper allocation dataset') - - # merge allocation df with helper df based on sectors, - # depending on geo scales of dfs - if (attr['helper_from_scale'] == 'state') and \ - (attr['allocation_from_scale'] == 'county'): - helper_allocation.loc[:, 'Location_tmp'] = \ - helper_allocation['Location'].apply(lambda x: x[0:2]) - df_w_sector.loc[:, 'Location_tmp'] = \ - df_w_sector['Location'].apply(lambda x: x[0:2]) - # merge_columns.append('Location_tmp') - compare_df_units(df_w_sector, helper_allocation) - modified_fba_allocation =\ - df_w_sector.merge( - helper_allocation[['Location_tmp', 'Sector', 'HelperFlow']], - how='left', - left_on=['Location_tmp', sector_col_to_merge], - right_on=['Location_tmp', 'Sector']) - modified_fba_allocation = \ - modified_fba_allocation.drop(columns=['Location_tmp']) - elif (attr['helper_from_scale'] == 'national') and \ - (attr['allocation_from_scale'] != 'national'): - compare_df_units(df_w_sector, helper_allocation) - modified_fba_allocation = \ - df_w_sector.merge(helper_allocation[['Sector', 'HelperFlow']], - how='left', - left_on=[sector_col_to_merge], - right_on=['Sector']) - else: - compare_df_units(df_w_sector, helper_allocation) - modified_fba_allocation =\ - df_w_sector.merge( - helper_allocation[['Location', 'Sector', 'HelperFlow']], - left_on=['Location', sector_col_to_merge], - right_on=['Location', 'Sector'], - how='left') - # load bea codes that sub for naics - bea = return_bea_codes_used_as_naics() - # replace sector column and helperflow value if the sector column to - # merge is in the bea list to prevent dropped data, - # unless these bea codes already are in the helper dataframe, then skip - if not modified_fba_allocation['Sector'].isin(bea).any(): - modified_fba_allocation['Sector'] = \ - np.where(modified_fba_allocation[sector_col_to_merge].isin(bea), - modified_fba_allocation[sector_col_to_merge], - modified_fba_allocation['Sector']) - modified_fba_allocation['HelperFlow'] = \ - np.where(modified_fba_allocation[sector_col_to_merge].isin(bea), - modified_fba_allocation['FlowAmount'], - modified_fba_allocation['HelperFlow']) - - # modify flow amounts using helper data - if 'multiplication' in attr['helper_method']: - # if missing values (na or 0), replace with national level values - replacement_values =\ - helper_allocation[helper_allocation['Location'] == - US_FIPS].reset_index(drop=True) - replacement_values = \ - replacement_values.rename( - columns={"HelperFlow": 'ReplacementValue'}) - compare_df_units(modified_fba_allocation, replacement_values) - modified_fba_allocation = modified_fba_allocation.merge( - replacement_values[['Sector', 'ReplacementValue']], how='left') - modified_fba_allocation.loc[:, 'HelperFlow'] = \ - modified_fba_allocation['HelperFlow'].fillna( - modified_fba_allocation['ReplacementValue']) - modified_fba_allocation.loc[:, 'HelperFlow'] =\ - np.where(modified_fba_allocation['HelperFlow'] == 0, - modified_fba_allocation['ReplacementValue'], - modified_fba_allocation['HelperFlow']) - - # replace non-existent helper flow values with a 0, - # so after multiplying, don't have incorrect value associated with - # new unit - modified_fba_allocation['HelperFlow'] =\ - modified_fba_allocation['HelperFlow'].fillna(value=0) - modified_fba_allocation.loc[:, 'FlowAmount'] = \ - modified_fba_allocation['FlowAmount'] * \ - modified_fba_allocation['HelperFlow'] - # drop columns - modified_fba_allocation =\ - modified_fba_allocation.drop( - columns=["HelperFlow", 'ReplacementValue', 'Sector']) - - elif attr['helper_method'] == 'proportional': - modified_fba_allocation =\ - proportional_allocation_by_location_and_activity( - modified_fba_allocation, sector_col_to_merge) - modified_fba_allocation['FlowAmountRatio'] =\ - modified_fba_allocation['FlowAmountRatio'].fillna(0) - modified_fba_allocation.loc[:, 'FlowAmount'] = \ - modified_fba_allocation['FlowAmount'] * \ - modified_fba_allocation['FlowAmountRatio'] - modified_fba_allocation =\ - modified_fba_allocation.drop( - columns=['FlowAmountRatio', 'HelperFlow', 'Sector']) - - elif attr['helper_method'] == 'proportional-flagged': - # calculate denominators based on activity and 'flagged' column - modified_fba_allocation =\ - modified_fba_allocation.assign( - Denominator=modified_fba_allocation.groupby( - ['FlowName', 'ActivityConsumedBy', 'Location', - 'disaggregate_flag'])['HelperFlow'].transform('sum')) - modified_fba_allocation = modified_fba_allocation.assign( - FlowAmountRatio=modified_fba_allocation['HelperFlow'] / - modified_fba_allocation['Denominator']) - # where disagg flag is 0, ensure flowamountratio is 1 - modified_fba_allocation['FlowAmountRatio'] = \ - modified_fba_allocation['FlowAmountRatio'].fillna(0) - modified_fba_allocation =\ - modified_fba_allocation.assign( - FlowAmount=modified_fba_allocation['FlowAmount'] * - modified_fba_allocation['FlowAmountRatio']) - modified_fba_allocation =\ - modified_fba_allocation.drop( - columns=['disaggregate_flag', 'Sector', 'HelperFlow', - 'Denominator', 'FlowAmountRatio']) - - # drop rows of 0 - modified_fba_allocation = modified_fba_allocation[ - modified_fba_allocation['FlowAmount'] != 0].reset_index(drop=True) - - modified_fba_allocation.loc[ - modified_fba_allocation['Unit'] == 'gal/employee', 'Unit'] = 'gal' - - # option to scale up fba values - if 'scaled' in attr['helper_method']: - log.info("Scaling %s to FBA values", attr['helper_source']) - modified_fba_allocation = attr["scale_helper_results"]( - modified_fba_allocation, - attr, - download_FBA_if_missing=download_FBA_if_missing - ) - - # run sector aggregation - modified_fba_allocation = sector_aggregation(modified_fba_allocation) - - return modified_fba_allocation - - def load_map_clean_fba(method, attr, fba_sourcename, df_year, flowclass, geoscale_from, geoscale_to, fbsconfigpath=None, **kwargs): diff --git a/flowsa/flowbysector.py b/flowsa/flowbysector.py deleted file mode 100644 index c7ab69356..000000000 --- a/flowsa/flowbysector.py +++ /dev/null @@ -1,441 +0,0 @@ -# flowbysector.py (flowsa) -# !/usr/bin/env python3 -# coding=utf-8 -""" -Produces a FlowBySector data frame based on a method file for the given class - -To run code, specify the "Run/Debug Configurations" Parameters to the -"flowsa/data/flowbysectormethods" yaml file name -you want to use. - -Example: "Parameters: --m Water_national_2015_m1" - -Files necessary to run FBS: -a. a method yaml in "flowsa/data/flowbysectormethods" -b. crosswalk(s) for the main dataset you are allocating and any datasets -used to allocate to sectors -c. a .py file in "flowsa/" for the main dataset you are allocating if -you need functions to clean up the FBA - before allocating to FBS - -""" - -import argparse -import pandas as pd -from esupy.processed_data_mgmt import write_df_to_file -import flowsa -from flowsa.allocation import equally_allocate_parent_to_child_naics -from flowsa.common import check_activities_sector_like, str2bool, \ - fba_activity_fields, rename_log_file, fba_fill_na_dict, fbs_fill_na_dict, \ - fbs_default_grouping_fields, fbs_grouping_fields_w_activities, \ - logoutputpath, load_yaml_dict -from flowsa.dataclean import clean_df, harmonize_FBS_columns, \ - reset_fbs_dq_scores -from flowsa.fbs_allocation import direct_allocation_method, \ - function_allocation_method, dataset_allocation_method -from flowsa.flowbyfunctions import agg_by_geoscale, sector_aggregation, \ - aggregator, subset_df_by_geoscale, sector_disaggregation, \ - update_geoscale, subset_df_by_sector_list, add_attribution_sources_col -from flowsa.location import merge_urb_cnty_pct -from flowsa.metadata import set_fb_meta, write_metadata -from flowsa.schema import flow_by_activity_fields, flow_by_sector_fields, \ - flow_by_sector_fields_w_activity -from flowsa.sectormapping import add_sectors_to_flowbyactivity, \ - map_fbs_flows, get_sector_list, append_material_code, \ - map_to_material_crosswalk -from flowsa.settings import log, vLog, paths -from flowsa.validation import compare_activity_to_sector_flowamounts, \ - compare_fba_geo_subset_and_fbs_output_totals, compare_geographic_totals,\ - replace_naics_w_naics_from_another_year, check_for_negative_flowamounts, \ - compare_child_to_parent_sectors_flowamounts, \ - check_if_data_exists_at_geoscale, calculate_flowamount_diff_between_dfs - - -def parse_args(): - """ - Make method parameters - :return: dictionary, 'method' - """ - ap = argparse.ArgumentParser() - ap.add_argument("-m", "--method", required=True, - help="Method for flow by sector file. A valid method " - "config file must exist with this name.") - ap.add_argument("-c", "--fbsconfigpath", - type=str2bool, required=False, - help="Option to specify where to find the FBS method " - "yaml.") - ap.add_argument("-d", "--download_FBAs_if_missing", - type=str2bool, required=False, - help="Option to download any FBAs not saved locally " - "rather than generating the FBAs in FLOWSA.") - args = vars(ap.parse_args()) - return args - - -def load_source_dataframe(method, sourcename, source_dict, - download_FBA_if_missing, fbsconfigpath=None): - """ - Load the source dataframe. Data can be a FlowbyActivity or - FlowBySector parquet stored in flowsa, or a FlowBySector - formatted dataframe from another package. - :param method: dictionary, FBS method - :param sourcename: str, The datasource name - :param source_dict: dictionary, The datasource parameters - :param download_FBA_if_missing: Bool, if True will download FBAs from - Data Commons. Default is False. - :param fbsconfigpath, str, optional path to an FBS method outside flowsa - repo - :return: df of identified parquet - """ - if source_dict.get('data_format') == 'FBA': - # if yaml specifies a geoscale to load, use parameter - # to filter dataframe - if 'source_fba_load_scale' in source_dict: - geo_level = source_dict['source_fba_load_scale'] - else: - geo_level = None - vLog.info("Retrieving Flow-By-Activity for datasource %s in year %s", - sourcename, str(source_dict['year'])) - flows_df = flowsa.getFlowByActivity( - datasource=sourcename, - year=source_dict['year'], - flowclass=source_dict['class'], - geographic_level=geo_level, - download_FBA_if_missing=download_FBA_if_missing) - elif source_dict.get('data_format') == 'FBS': - vLog.info("Retrieving flowbysector for datasource %s", sourcename) - flows_df = flowsa.getFlowBySector(sourcename) - selection_fields = source_dict.get('selection_fields') - if selection_fields is not None: - for k, v in selection_fields.items(): - flows_df = flows_df[flows_df[k].isin(v)].reset_index(drop=True) - elif source_dict.get('data_format') == 'FBS_outside_flowsa': - vLog.info("Retrieving flowbysector for datasource %s", sourcename) - fxn = source_dict.get("FBS_datapull_fxn") - if callable(fxn): - flows_df = fxn(source_dict, method, fbsconfigpath) - elif fxn: - raise flowsa.exceptions.FBSMethodConstructionError( - error_type='fxn_call') - else: - raise flowsa.exceptions.FBSMethodConstructionError( - message="Data format not specified in method " - f"file for {sourcename}") - - return flows_df - - -def main(**kwargs): - """ - Creates a flowbysector dataset - :param kwargs: dictionary of arguments: - "method": the name of method corresponding to flowbysector - "fbsconfigpath": - "download_FBAs_if_missing": - :return: parquet, FBS save to local folder - """ - if len(kwargs) == 0: - kwargs = parse_args() - - method_name = kwargs['method'] - fbsconfigpath = kwargs.get('fbsconfigpath') - download_FBA_if_missing = kwargs.get('download_FBAs_if_missing') - # assign arguments - vLog.info(f"Initiating flowbysector creation for {method_name}") - # call on method - method = load_yaml_dict(method_name, flowbytype='FBS', - filepath=fbsconfigpath) - # create dictionary of data and allocation datasets - try: - fb = method['source_names'] - except KeyError: - log.error("parameter 'source_names' not found in method. " - f"FBS for {method_name} can not be generated.") - return - # Create empty list for storing fbs files - fbs_list = [] - for k, v in fb.items(): - # pull fba data for allocation - flows = load_source_dataframe(method, k, v, download_FBA_if_missing, - fbsconfigpath) - - if v['data_format'] == 'FBA': - # ensure correct datatypes and that all fields exist - flows = clean_df(flows, flow_by_activity_fields, - fba_fill_na_dict, drop_description=False) - - # split data by urban and rural - if v.get('apply_urban_rural'): - vLog.info(f"Splitting {k} into urban and rural quantities " - "by FIPS.") - flows = merge_urb_cnty_pct(flows) - - # clean up fba before mapping, if specified in yaml - fxn = v.get("clean_fba_before_mapping_df_fxn") - if callable(fxn): - vLog.info(f"Cleaning up {k} FlowByActivity") - flows = fxn(fba=flows, source_dict=v) - elif fxn: - raise flowsa.exceptions.FBSMethodConstructionError( - error_type='fxn_call') - - # map flows to federal flow list or material flow list - flows_mapped, mapping_files = (map_fbs_flows( - flows, k, v, keep_fba_columns=True, - keep_unmapped_rows=v.get("keep_unmapped_rows", False))) - - # map to material crosswalk, if specified - if v.get('material_crosswalk') is not None: - flows_mapped = map_to_material_crosswalk(flows_mapped, k, v) - - # clean up fba, if specified in yaml - fxn = v.get("clean_fba_df_fxn") - if callable(fxn): - vLog.info(f"Cleaning up {k} FlowByActivity") - flows_mapped = fxn(fba=flows_mapped, source_dict=v, - method=method) - elif fxn: - raise flowsa.exceptions.FBSMethodConstructionError( - error_type='fxn_call') - - # master list of activity names read in from data source - ml_act = [] - # create dictionary of allocation datasets for different activities - activities = v['activity_sets'] - # subset activity data and allocate to sector - for aset, attr in activities.items(): - # subset by named activities - names = attr['names'] - - # to avoid double counting data from the same source, in - # the event there are values in both the APB and ACB - # columns, if an activity has already been read in and - # allocated, remove that activity from the mapped flows - # regardless of what activity set the data was read in - if v.get('retain_activity_names') is None: - flows_mapped = flows_mapped[ - ~((flows_mapped[fba_activity_fields[0]].isin(ml_act)) | - (flows_mapped[fba_activity_fields[1]].isin(ml_act)) - )].reset_index(drop=True) - ml_act.extend(names) - - vLog.info(f"Preparing to handle {aset} in {k}") - # subset fba data by activity - flows_subset = flows_mapped[ - (flows_mapped[fba_activity_fields[0]].isin(names)) | - (flows_mapped[fba_activity_fields[1]].isin(names) - )].reset_index(drop=True) - - # subset by flowname if exists - if 'source_flows' in attr: - flows_subset = flows_subset[flows_subset['FlowName'] - .isin(attr['source_flows'])] - if len(flows_subset) == 0: - log.warning(f"no data found for flows in {aset}") - continue - if len(flows_subset[flows_subset['FlowAmount'] != 0]) == 0: - log.warning(f"all flow data for {aset} is 0") - continue - flows_subset = flows_subset.reset_index(drop=True) - # if activities are sector-like, check sectors are valid - if check_activities_sector_like(flows_subset): - flows_subset2 = replace_naics_w_naics_from_another_year( - flows_subset, method['target_sector_source']) - - # check impact on df FlowAmounts - vLog.info('Calculate FlowAmount difference caused by ' - 'replacing NAICS Codes with %s, saving ' - 'difference in Validation log', - method['target_sector_source'],) - calculate_flowamount_diff_between_dfs( - flows_subset, flows_subset2) - else: - flows_subset2 = flows_subset.copy() - - # extract relevant geoscale data or aggregate existing data - geoscale_to_use = attr.get('geoscale_to_use') - if geoscale_to_use is None: - geoscale_to_use = v['geoscale_to_use'] - flows_subset_geo = subset_df_by_geoscale( - flows_subset2, geoscale_to_use, v['geoscale_to_use']) - # if loading data subnational geoscale, check for data loss - if attr['allocation_from_scale'] != 'national': - compare_geographic_totals( - flows_subset_geo, flows_mapped, k, attr, aset, names) - - # Add sectors to df activity, depending on level - # of specified sector aggregation - log.info("Adding sectors to %s", k) - flows_subset_wsec = add_sectors_to_flowbyactivity( - flows_subset_geo, v.get('activity_to_sector_mapping'), - sectorsourcename=method['target_sector_source'], - allocationmethod=attr['allocation_method'], - fbsconfigpath=fbsconfigpath) - # clean up fba with sectors, if specified in yaml - if "clean_fba_w_sec_df_fxn" in v: - vLog.info("Cleaning up %s FlowByActivity with sectors", k) - flows_subset_wsec = v["clean_fba_w_sec_df_fxn"]( - flows_subset_wsec, - attr=attr, - method=method - ) - # check for activities at geoscale - return any missing - # locations for an activity - check_if_data_exists_at_geoscale(flows_subset_geo, - attr['allocation_from_scale']) - # add column of data sources - flows_subset_wsec = add_attribution_sources_col( - flows_subset_wsec, attr) - - # rename SourceName to MetaSources and drop columns - flows_mapped_wsec = flows_subset_wsec.\ - rename(columns={'SourceName': 'MetaSources'}).\ - drop(columns=['FlowName', 'Compartment']) - - # if allocation method is "direct", then no need - # to create alloc ratios, else need to use allocation - # dataframe to create sector allocation ratios - if attr['allocation_method'] == 'direct': - fbs = direct_allocation_method( - flows_mapped_wsec, k, names, method) - # if allocation method for an activity set requires a specific - # function due to the complicated nature - # of the allocation, call on function here - elif attr['allocation_method'] == 'allocation_function': - fbs = function_allocation_method( - flows_mapped_wsec, k, names, attr, fbs_list, method) - else: - fbs = dataset_allocation_method( - flows_mapped_wsec, attr, names, method, k, v, aset, - download_FBA_if_missing, fbsconfigpath) - - # drop rows where flowamount = 0 - # (although this includes dropping suppressed data) - fbs = fbs[fbs['FlowAmount'] != 0].reset_index(drop=True) - - if len(fbs) == 0: - log.warning(f"after allocation, no data remain in FBS for " - f"activity set {aset}") - continue - - # define grouping columns dependent on sectors - # being activity-like or not - if check_activities_sector_like(fbs) is False: - groupingcols = fbs_grouping_fields_w_activities - groupingdict = flow_by_sector_fields_w_activity - else: - groupingcols = fbs_default_grouping_fields - groupingdict = flow_by_sector_fields - - # clean df - fbs = clean_df(fbs, groupingdict, fbs_fill_na_dict) - - # aggregate df geographically, if necessary - log.info("Aggregating flowbysector to %s level", - method['target_geoscale']) - - fbs_geo_agg = agg_by_geoscale( - fbs, geoscale_to_use, method['target_geoscale'], - groupingcols) - - # aggregate data to every sector level - log.info("Aggregating flowbysector to all sector levels") - fbs_sec_agg = sector_aggregation(fbs_geo_agg) - # add missing naics5/6 when only one naics5/6 - # associated with a naics4 - fbs_agg = sector_disaggregation(fbs_sec_agg) - - # check if any sector information is lost before reaching - # the target sector length, if so, - # allocate values equally to disaggregated sectors - vLog.info('Searching for and allocating FlowAmounts for any ' - 'parent NAICS dropped while subsetting the ' - 'dataframe') - fbs_agg_2 = equally_allocate_parent_to_child_naics( - fbs_agg, method) - - # compare child sectors to parent sectors flow amounts - compare_child_to_parent_sectors_flowamounts(fbs) - - # compare flowbysector with flowbyactivity - compare_activity_to_sector_flowamounts( - flows_mapped_wsec, fbs_agg_2, aset, method, v, attr) - - # return sector level specified in method yaml - # load the crosswalk linking sector lengths - secondary_sector_level = \ - method.get('target_subset_sector_level') - sector_list = get_sector_list( - method['target_sector_level'], - secondary_sector_level_dict=secondary_sector_level) - - # subset df, necessary because not all of the sectors are - # NAICS and can get duplicate rows - fbs_sector_subset = subset_df_by_sector_list( - fbs_agg_2, sector_list) - - # drop activity columns - fbs_sector_subset = fbs_sector_subset.drop( - ['ActivityProducedBy', 'ActivityConsumedBy'], axis=1, - errors='ignore') - - # save comparison of FBA total to FBS total for an activity set - compare_fba_geo_subset_and_fbs_output_totals( - flows_subset_geo, fbs_sector_subset, aset, k, v, attr, - method) - - if 'append_material_codes' in v: - fbs_sector_subset = append_material_code( - fbs_sector_subset, v, attr) - - log.info(f"Completed flowbysector for {aset}") - fbs_list.append(fbs_sector_subset) - else: - fxn = v.get("clean_fbs_df_fxn") - if callable(fxn): - flows = fxn(flows, method, k=k, v=v) - elif fxn: - raise flowsa.exceptions.FBSMethodConstructionError( - error_type='fxn_call') - flows = update_geoscale(flows, method['target_geoscale']) - # if the loaded flow dt is already in FBS format, - # append directly to list of FBS - log.info(f"Append {k} to FBS list") - # ensure correct field datatypes and add any missing fields - flows = clean_df(flows, flow_by_sector_fields, fbs_fill_na_dict) - fbs_list.append(flows) - # create single df of all activities - log.info("Concat data for all activities") - fbss = pd.concat(fbs_list, ignore_index=True, sort=False) - log.info("Clean final dataframe") - # add missing fields, ensure correct data type, - # add missing columns, reorder columns - fbss = clean_df(fbss, flow_by_sector_fields, fbs_fill_na_dict) - # prior to aggregating, replace MetaSources string with all sources - # that share context/flowable/sector values - fbss = harmonize_FBS_columns(fbss) - # aggregate df as activities might have data for - # the same specified sector length - fbss = aggregator(fbss, fbs_default_grouping_fields) - # sort df - log.info("Sort and store dataframe") - # ensure correct data types/order of columns - fbss = clean_df(fbss, flow_by_sector_fields, fbs_fill_na_dict) - fbss = fbss.sort_values(['SectorProducedBy', 'SectorConsumedBy', - 'Flowable', 'Context']).reset_index(drop=True) - # check for negative flow amounts - check_for_negative_flowamounts(fbss) - # tmp reset data quality scores - fbss = reset_fbs_dq_scores(fbss) - # save parquet file - meta = set_fb_meta(method_name, "FlowBySector") - write_df_to_file(fbss, paths, meta) - write_metadata(method_name, method, meta, "FlowBySector") - # rename the log file saved to local directory - rename_log_file(method_name, meta) - log.info('See the Validation log for detailed assessment of ' - f'model results in {logoutputpath}') - - -if __name__ == '__main__': - main() diff --git a/flowsa/test_FBS_against_remote.py b/flowsa/test_FBS_against_remote.py index 3d5def4b5..e3f4763a0 100644 --- a/flowsa/test_FBS_against_remote.py +++ b/flowsa/test_FBS_against_remote.py @@ -5,17 +5,17 @@ import pytest import os -import flowsa from flowsa import seeAvailableFlowByModels -from flowsa.settings import diffpath, memory_limit from flowsa.common import check_method_status +from flowsa.flowby import FlowBySector +from flowsa.settings import diffpath from flowsa.test_single_FBS import compare_single_FBS_against_remote @pytest.mark.generate_fbs def test_generate_fbs(): """Generate all FBS from methods in repo.""" - for m in flowsa.seeAvailableFlowByModels("FBS", print_method=False): + for m in seeAvailableFlowByModels("FBS", print_method=False): if m not in ['BEA_summary_target', 'Electricity_gen_emissions_national_2016', 'Employment_common', @@ -30,7 +30,8 @@ def test_generate_fbs(): print("--------------------------------\n" f"Method: {m}\n" "--------------------------------") - flowsa.flowbysector.main(method=m, download_FBAs_if_missing=True) + FlowBySector.genereateFlowBySector( + method=m, download_sources_ok=True) @pytest.mark.skip(reason="Perform targeted test for compare_FBS on PR") diff --git a/flowsa/test_single_FBS.py b/flowsa/test_single_FBS.py index 5c30424cb..aff767328 100644 --- a/flowsa/test_single_FBS.py +++ b/flowsa/test_single_FBS.py @@ -3,7 +3,7 @@ """ import pytest import os -import flowsa +from flowsa.flowby import FlowBySector from flowsa.metadata import set_fb_meta from flowsa.settings import paths, diffpath from flowsa.validation import compare_FBS_results @@ -18,8 +18,8 @@ def compare_single_FBS_against_remote(m, outdir=diffpath, if not downloaded: if run_single: # Run a single file even if no comparison available - flowsa.flowbysector.main(method=m, - download_FBAs_if_missing=True) + FlowBySector.genereateFlowBySector( + method=m, download_sources_ok=True) else: print(f"{m} not found in remote server. Skipping...") return diff --git a/flowsa/validation.py b/flowsa/validation.py index 01521703b..58d324d1b 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -8,59 +8,18 @@ import pandas as pd import numpy as np import flowsa +from flowsa.flowby import FlowBySector from flowsa.flowbyfunctions import aggregator, create_geoscale_list,\ subset_df_by_geoscale, sector_aggregation, collapse_fbs_sectors,\ subset_df_by_sector_lengths from flowsa.dataclean import replace_strings_with_NoneType, \ replace_NoneType_with_empty_cells from flowsa.common import sector_level_key, \ - load_crosswalk, SECTOR_SOURCE_NAME, fba_activity_fields, \ - fba_mapped_default_grouping_fields, check_activities_sector_like + load_crosswalk, fba_activity_fields, check_activities_sector_like from flowsa.location import US_FIPS, fips_number_key from flowsa.settings import log, vLog, vLogDetailed -def check_flow_by_fields(flowby_df, flowbyfields): - """ - Add in missing fields to have a complete and ordered - :param flowby_df: Either flowbyactivity or flowbysector df - :param flowbyfields: Either flow_by_activity_fields or - flow_by_sector_fields - :return: printout, column datatypes - """ - for k, v in flowbyfields.items(): - try: - vLog.debug("fba activity %s data type is %s", - k, str(flowby_df[k].values.dtype)) - vLog.debug("standard %s data type is %s", k, str(v[0]['dtype'])) - except: - vLog.debug("Failed to find field %s in fba", k) - - -def check_if_activities_match_sectors(fba): - """ - Checks if activities in flowbyactivity that appear to be like sectors - are actually sectors - :param fba: a flow by activity dataset - :return: A list of activities not marching the default sector list or - text indicating 100% match - """ - # Get list of activities in a flowbyactivity file - activities = [] - for f in fba_activity_fields: - activities.extend(fba[f]) - - # Get list of module default sectors - flowsa_sector_list = list(load_crosswalk('sector_timeseries')[ - SECTOR_SOURCE_NAME]) - activities_missing_sectors = set(activities) - set(flowsa_sector_list) - - if len(activities_missing_sectors) > 0: - vLog.debug("%s activities not matching sectors in default %s list", - str(len(activities_missing_sectors)), SECTOR_SOURCE_NAME) - return activities_missing_sectors - - def check_if_data_exists_at_geoscale(df_load, geoscale): """ Check if an activity or a sector exists at the specified geoscale @@ -117,143 +76,6 @@ def check_if_data_exists_at_geoscale(df_load, geoscale): geoscale, sn, y) -def check_if_data_exists_at_less_aggregated_geoscale( - df, geoscale, activityname): - """ - In the event data does not exist at specified geoscale, - check if data exists at less aggregated level - :param df: Either flowbyactivity or flowbysector dataframe - :param geoscale: national, state, or county - :param activityname: str, activity col names to check - :return: str, geoscale to use - """ - - if geoscale == 'national': - df = df[(df[fba_activity_fields[0]] == activityname) | ( - df[fba_activity_fields[1]] == activityname)] - fips = create_geoscale_list(df, 'state') - df = df[df['Location'].isin(fips)] - if len(df) == 0: - vLog.info("No flows found for %s at the state scale", activityname) - fips = create_geoscale_list(df, 'county') - df = df[df['Location'].isin(fips)] - if len(df) == 0: - vLog.info("No flows found for %s at the county scale", - activityname) - else: - vLog.info("Flow-By-Activity data exists for %s at " - "the county level", activityname) - new_geoscale_to_use = 'county' - return new_geoscale_to_use - else: - vLog.info("Flow-By-Activity data exists for %s at " - "the state level", activityname) - new_geoscale_to_use = 'state' - return new_geoscale_to_use - if geoscale == 'state': - df = df[(df[fba_activity_fields[0]] == activityname) | ( - df[fba_activity_fields[1]] == activityname)] - fips = create_geoscale_list(df, 'county') - df = df[df['Location'].isin(fips)] - if len(df) == 0: - vLog.info("No flows found for %s at the " - "county scale", activityname) - else: - vLog.info("Flow-By-Activity data exists for %s " - "at the county level", activityname) - new_geoscale_to_use = 'county' - return new_geoscale_to_use - - -def check_if_location_systems_match(df1, df2): - """ - Check if two dataframes share the same location system - :param df1: fba or fbs df - :param df2: fba or fbs df - :return: warning if Location Systems do not match between dfs - """ - - if df1["LocationSystem"].all() != df2["LocationSystem"].all(): - vLog.warning("LocationSystems do not match, " - "might lose county level data") - - -def check_allocation_ratios(flow_alloc_df_load, activity_set, config, attr): - """ - Check for issues with the flow allocation ratios - :param flow_alloc_df_load: df, includes 'FlowAmountRatio' column - :param activity_set: str, activity set - :param config: dictionary, method yaml - :param attr: dictionary, activity set info - :return: print out information regarding allocation ratios, - save csv of results to local directory - """ - # if in the attr dictionary, merge columns are identified, - # the merge columns need to be accounted for in the grouping/checking of - # allocation ratios - subset_cols = ['FBA_Activity', 'Location', 'SectorLength', 'FlowAmountRatio'] - groupcols = ['FBA_Activity', 'Location', 'SectorLength'] - if 'allocation_merge_columns' in attr: - subset_cols = subset_cols + attr['allocation_merge_columns'] - groupcols = groupcols + attr['allocation_merge_columns'] - - # create column of sector lengths - flow_alloc_df =\ - flow_alloc_df_load.assign( - SectorLength=flow_alloc_df_load['Sector'].str.len()) - # subset df - flow_alloc_df2 = flow_alloc_df[subset_cols] - # sum the flow amount ratios by location and sector length - flow_alloc_df3 = \ - flow_alloc_df2.groupby( - groupcols, dropna=False, as_index=False).agg( - {"FlowAmountRatio": sum}) - - # keep only rows of specified sector length - - # return sector level specified in method yaml - sector_level_list = [config.get('target_sector_level')] - # if secondary sector levels are identified, add to list of sectors to keep - if 'target_subset_sector_level' in config: - sector_level_dict = config.get('target_subset_sector_level') - for k, v in sector_level_dict.items(): - sector_level_list = sector_level_list + [k] - sector_subset_dict = dict((k, sector_level_key[k]) for k in - sector_level_list if k in sector_level_key) - sector_level_list = list(sector_subset_dict.values()) - - # subset df, necessary because not all of the sectors are - # NAICS and can get duplicate rows - flow_alloc_df4 = flow_alloc_df3[ - flow_alloc_df3['SectorLength'].isin(sector_level_list)].reset_index(drop=True) - # keep data where the flowamountratio is greater than or - # less than 1 by 0.005 - tolerance = 0.01 - flow_alloc_df5 = flow_alloc_df4[ - (flow_alloc_df4['FlowAmountRatio'] < 1 - tolerance) | - (flow_alloc_df4['FlowAmountRatio'] > 1 + tolerance)] - - if len(flow_alloc_df5) > 0: - vLog.info('There are %s instances within %s ' - 'where the allocation ratio for a location is greater ' - 'than or less than 1 by at least %s. See Validation Log', - len(flow_alloc_df5), sector_level_list, - str(tolerance)) - - # add to validation log - log.info('Save the summary table of flow allocation ratios for each ' - 'sector length for %s in validation log', activity_set) - # if df not empty, print, if empty, print string - if flow_alloc_df5.empty: - vLogDetailed.info('Flow allocation ratios for %s ' - 'all round to 1', activity_set) - - else: - vLogDetailed.info('Flow allocation ratios for %s: ' - '\n {}'.format(flow_alloc_df5.to_string()), - activity_set) - - def calculate_flowamount_diff_between_dfs(dfa_load, dfb_load): """ Calculate the differences in FlowAmounts between two dfs @@ -691,8 +513,7 @@ def compare_child_to_parent_sectors_flowamounts(df_load): :param df_load: df, contains sector columns :return: comparison of flow values """ - from flowsa.flowbyfunctions import return_primary_sector_column, \ - assign_sector_match_column + from flowsa.flowbyfunctions import assign_sector_match_column merge_cols = [e for e in df_load.columns if e in [ 'Class', 'SourceName', 'MetaSources', 'FlowName', 'Unit', @@ -715,7 +536,7 @@ def compare_child_to_parent_sectors_flowamounts(df_load): df = df.fillna('') df2 = df.groupby(agg_cols).agg( {'FlowAmount': 'sum'}).rename(columns={ - 'FlowAmount': f'ChildNAICSSum'}).reset_index() + 'FlowAmount': 'ChildNAICSSum'}).reset_index() dfagg = pd.concat([dfagg, df2], ignore_index=True) # merge new df with summed child naics to original df @@ -972,11 +793,9 @@ def compare_FBS_results(fbs1, fbs2, ignore_metasources=False, # load second file if compare_to_remote: # Generate the FBS locally and then immediately load - df2 = (flowsa.flowby.FlowBySector.generateFlowBySector( - method=fbs2, download_sources_ok=True) - .rename(columns={'FlowAmount': 'FlowAmount_fbs2'})) - # flowsa.flowbysector.main(method=fbs2, - # download_FBAs_if_missing=True) + df2 = (FlowBySector.generateFlowBySector( + method=fbs2, download_sources_ok=True) + .rename(columns={'FlowAmount': 'FlowAmount_fbs2'})) else: df2 = flowsa.getFlowBySector(fbs2).rename( columns={'FlowAmount': 'FlowAmount_fbs2'}) From b4b3d4b5fa4349f29c197a12e4dfe190019ae4d5 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 13 Apr 2023 17:00:53 -0400 Subject: [PATCH 0513/1127] move naics functions from `validation.py` to `naics.py` --- flowsa/data_source_scripts/stewiFBS.py | 2 +- flowsa/naics.py | 174 +++++++++++++++++++++++- flowsa/sectormapping.py | 2 +- flowsa/validation.py | 175 +------------------------ 4 files changed, 176 insertions(+), 177 deletions(-) diff --git a/flowsa/data_source_scripts/stewiFBS.py b/flowsa/data_source_scripts/stewiFBS.py index 97e9b7637..08cd20e91 100644 --- a/flowsa/data_source_scripts/stewiFBS.py +++ b/flowsa/data_source_scripts/stewiFBS.py @@ -17,7 +17,7 @@ from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.location import apply_county_FIPS, update_geoscale from flowsa.settings import log, process_adjustmentpath -from flowsa.validation import replace_naics_w_naics_from_another_year +from flowsa.naics import replace_naics_w_naics_from_another_year import stewicombo import stewi from stewicombo.overlaphandler import remove_default_flow_overlaps diff --git a/flowsa/naics.py b/flowsa/naics.py index fedc36084..8e9ba8328 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -1,6 +1,8 @@ from typing import Literal import pandas as pd -from . import settings +import numpy as np +from flowsa.flowbyfunctions import aggregator +from . import (common, dataclean, settings) naics_crosswalk = pd.read_csv( f'{settings.datapath}NAICS_Crosswalk_TimeSeries.csv', dtype='object' @@ -140,3 +142,173 @@ def year_crosswalk( .drop_duplicates() .reset_index(drop=True) ) + + +def check_if_sectors_are_naics(df_load, crosswalk_list, column_headers): + """ + Check if activity-like sectors are in fact sectors. + Also works for the Sector column + :param df_load: df with activity or sector columns + :param crosswalk_list: list, sectors found in crosswalk + :param column_headers: list, headers to check for sectors + :return: list, values that are not sectors + """ + + # create a df of non-sectors to export + non_sectors_df = [] + # create a df of just the non-sectors column + non_sectors_list = [] + # loop through the df headers and determine if value + # is not in crosswalk list + for c in column_headers: + # create df where sectors do not exist in master crosswalk + non_sectors = df_load[~df_load[c].isin(crosswalk_list)] + # drop rows where c is empty + non_sectors = non_sectors[non_sectors[c] != ''] + # subset to just the sector column + if len(non_sectors) != 0: + sectors = non_sectors[[c]].rename(columns={c: 'NonSectors'}) + non_sectors_df.append(non_sectors) + non_sectors_list.append(sectors) + + if len(non_sectors_df) != 0: + # concat the df and the df of sectors + ns_list = pd.concat(non_sectors_list, sort=False, ignore_index=True) + # print the NonSectors + non_sectors = ns_list['NonSectors'].drop_duplicates().tolist() + settings.vLog.debug('There are sectors that are not NAICS 2012 Codes') + settings.vLog.debug(non_sectors) + else: + settings.vLog.debug('All sectors are NAICS 2012 Codes') + + return non_sectors + + +def melt_naics_crosswalk(): + """ + Create a melt version of the naics 07 to 17 crosswalk to map + naics to naics 2012 + :return: df, naics crosswalk melted + """ + # load the mastercroswalk and subset by sectorsourcename, + # save values to list + cw_load = common.load_crosswalk('sector_timeseries') + + # create melt table of possible 2007 and 2017 naics that can + # be mapped to 2012 + cw_melt = cw_load.melt( + id_vars='NAICS_2012_Code', var_name='NAICS_year', value_name='NAICS') + # drop the naics year because not relevant for replacement purposes + cw_replacement = cw_melt.dropna(how='any') + cw_replacement = cw_replacement[ + ['NAICS_2012_Code', 'NAICS']].drop_duplicates() + # drop rows where contents are equal + cw_replacement = cw_replacement[ + cw_replacement['NAICS_2012_Code'] != cw_replacement['NAICS']] + # drop rows where length > 6 + cw_replacement = cw_replacement[cw_replacement['NAICS_2012_Code'].apply( + lambda x: len(x) < 7)].reset_index(drop=True) + # order by naics 2012 + cw_replacement = cw_replacement.sort_values( + ['NAICS', 'NAICS_2012_Code']).reset_index(drop=True) + + # create allocation ratios by determining number of + # NAICS 2012 to other naics when not a 1:1 ratio + cw_replacement_2 = cw_replacement.assign( + naics_count=cw_replacement.groupby( + ['NAICS'])['NAICS_2012_Code'].transform('count')) + cw_replacement_2 = cw_replacement_2.assign( + allocation_ratio=1/cw_replacement_2['naics_count']) + + return cw_replacement_2 + +def replace_naics_w_naics_from_another_year(df_load, sectorsourcename): + """ + Replace any non sectors with sectors. + :param df_load: df with sector columns or sector-like activities + :param sectorsourcename: str, sector source name (ex. NAICS_2012_Code) + :return: df, with non-sectors replaced with sectors + """ + # drop NoneType + df = dataclean.replace_NoneType_with_empty_cells(df_load).reset_index(drop=True) + + # load the mastercroswalk and subset by sectorsourcename, + # save values to list + cw_load = common.load_crosswalk('sector_timeseries') + cw = cw_load[sectorsourcename].drop_duplicates().tolist() + + # load melted crosswalk + cw_melt = melt_naics_crosswalk() + # drop the count column + cw_melt = cw_melt.drop(columns='naics_count') + + # determine which headers are in the df + if 'SectorConsumedBy' in df: + column_headers = ['SectorProducedBy', 'SectorConsumedBy'] + else: + column_headers = ['ActivityProducedBy', 'ActivityConsumedBy'] + + # check if there are any sectors that are not in the naics 2012 crosswalk + non_naics = check_if_sectors_are_naics(df, cw, column_headers) + + # loop through the df headers and determine if value is + # not in crosswalk list + if len(non_naics) != 0: + settings.vLog.debug('Checking if sectors represent a different ' + f'NAICS year, if so, replace with {sectorsourcename}') + for c in column_headers: + # merge df with the melted sector crosswalk + df = df.merge(cw_melt, left_on=c, right_on='NAICS', how='left') + # if there is a value in the sectorsourcename column, + # use that value to replace sector in column c if value in + # column c is in the non_naics list + df[c] = np.where( + (df[c] == df['NAICS']) & (df[c].isin(non_naics)), + df[sectorsourcename], df[c]) + # multiply the FlowAmount col by allocation_ratio + df.loc[df[c] == df[sectorsourcename], + 'FlowAmount'] = df['FlowAmount'] * df['allocation_ratio'] + # drop columns + df = df.drop( + columns=[sectorsourcename, 'NAICS', 'allocation_ratio']) + settings.vLog.debug(f'Replaced NAICS with {sectorsourcename}') + + # check if there are any sectors that are not in + # the naics 2012 crosswalk + settings.vLog.debug('Check again for non NAICS 2012 Codes') + nonsectors = check_if_sectors_are_naics(df, cw, column_headers) + if len(nonsectors) != 0: + settings.vLog.debug('Dropping non-NAICS from dataframe') + for c in column_headers: + # drop rows where column value is in the nonnaics list + df = df[~df[c].isin(nonsectors)] + # aggregate data + possible_column_headers = \ + ('FlowAmount', 'Spread', 'Min', 'Max', 'DataReliability', + 'TemporalCorrelation', 'GeographicalCorrelation', + 'TechnologicalCorrelation', 'DataCollection', 'Description') + # list of column headers to group aggregation by + groupby_cols = [e for e in df.columns.values.tolist() + if e not in possible_column_headers] + df = aggregator(df, groupby_cols) + + df = dataclean.replace_strings_with_NoneType(df) + # drop rows where both SectorConsumedBy and SectorProducedBy NoneType + if 'SectorConsumedBy' in df: + df_drop = df[(df['SectorConsumedBy'].isnull()) & + (df['SectorProducedBy'].isnull())] + if len(df_drop) != 0: + activities_dropped = pd.unique( + df_drop[['ActivityConsumedBy', + 'ActivityProducedBy']].values.ravel('K')) + activities_dropped = list(filter( + lambda x: x is not None, activities_dropped)) + settings.vLog.debug('Dropping rows where the Activity columns ' + f'contain {", ".join(activities_dropped)}') + df = df[~((df['SectorConsumedBy'].isnull()) & + (df['SectorProducedBy'].isnull()))].reset_index(drop=True) + else: + df = df[~((df['ActivityConsumedBy'].isnull()) & + (df['ActivityProducedBy'].isnull()))].reset_index(drop=True) + + return df diff --git a/flowsa/sectormapping.py b/flowsa/sectormapping.py index b07b8abeb..cc9c5cf7c 100644 --- a/flowsa/sectormapping.py +++ b/flowsa/sectormapping.py @@ -16,7 +16,6 @@ from flowsa.flowbyfunctions import fbs_activity_fields, load_crosswalk from flowsa.schema import activity_fields, dq_fields from flowsa.settings import log -from flowsa.validation import replace_naics_w_naics_from_another_year def get_activitytosector_mapping(source, fbsconfigpath=None): @@ -79,6 +78,7 @@ def add_sectors_to_flowbyactivity( repo :return: a df with activity fields mapped to 'sectors' """ + from flowsa.naics import replace_naics_w_naics_from_another_year # First check if source activities are NAICS like - # if so make it into a mapping file s = pd.unique(flowbyactivity_df['SourceName'])[0] diff --git a/flowsa/validation.py b/flowsa/validation.py index 58d324d1b..5f19f9b32 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -15,7 +15,7 @@ from flowsa.dataclean import replace_strings_with_NoneType, \ replace_NoneType_with_empty_cells from flowsa.common import sector_level_key, \ - load_crosswalk, fba_activity_fields, check_activities_sector_like + fba_activity_fields, check_activities_sector_like from flowsa.location import US_FIPS, fips_number_key from flowsa.settings import log, vLog, vLogDetailed @@ -598,179 +598,6 @@ def check_for_negative_flowamounts(df): return df -def check_if_sectors_are_naics(df_load, crosswalk_list, column_headers): - """ - Check if activity-like sectors are in fact sectors. - Also works for the Sector column - :param df_load: df with activity or sector columns - :param crosswalk_list: list, sectors found in crosswalk - :param column_headers: list, headers to check for sectors - :return: list, values that are not sectors - """ - - # create a df of non-sectors to export - non_sectors_df = [] - # create a df of just the non-sectors column - non_sectors_list = [] - # loop through the df headers and determine if value - # is not in crosswalk list - for c in column_headers: - # create df where sectors do not exist in master crosswalk - non_sectors = df_load[~df_load[c].isin(crosswalk_list)] - # drop rows where c is empty - non_sectors = non_sectors[non_sectors[c] != ''] - # subset to just the sector column - if len(non_sectors) != 0: - sectors = non_sectors[[c]].rename(columns={c: 'NonSectors'}) - non_sectors_df.append(non_sectors) - non_sectors_list.append(sectors) - - if len(non_sectors_df) != 0: - # concat the df and the df of sectors - ns_list = pd.concat(non_sectors_list, sort=False, ignore_index=True) - # print the NonSectors - non_sectors = ns_list['NonSectors'].drop_duplicates().tolist() - vLog.debug('There are sectors that are not NAICS 2012 Codes') - vLog.debug(non_sectors) - else: - vLog.debug('All sectors are NAICS 2012 Codes') - - return non_sectors - - -def melt_naics_crosswalk(): - """ - Create a melt version of the naics 07 to 17 crosswalk to map - naics to naics 2012 - :return: df, naics crosswalk melted - """ - # load the mastercroswalk and subset by sectorsourcename, - # save values to list - cw_load = load_crosswalk('sector_timeseries') - - # create melt table of possible 2007 and 2017 naics that can - # be mapped to 2012 - cw_melt = cw_load.melt( - id_vars='NAICS_2012_Code', var_name='NAICS_year', value_name='NAICS') - # drop the naics year because not relevant for replacement purposes - cw_replacement = cw_melt.dropna(how='any') - cw_replacement = cw_replacement[ - ['NAICS_2012_Code', 'NAICS']].drop_duplicates() - # drop rows where contents are equal - cw_replacement = cw_replacement[ - cw_replacement['NAICS_2012_Code'] != cw_replacement['NAICS']] - # drop rows where length > 6 - cw_replacement = cw_replacement[cw_replacement['NAICS_2012_Code'].apply( - lambda x: len(x) < 7)].reset_index(drop=True) - # order by naics 2012 - cw_replacement = cw_replacement.sort_values( - ['NAICS', 'NAICS_2012_Code']).reset_index(drop=True) - - # create allocation ratios by determining number of - # NAICS 2012 to other naics when not a 1:1 ratio - cw_replacement_2 = cw_replacement.assign( - naics_count=cw_replacement.groupby( - ['NAICS'])['NAICS_2012_Code'].transform('count')) - cw_replacement_2 = cw_replacement_2.assign( - allocation_ratio=1/cw_replacement_2['naics_count']) - - return cw_replacement_2 - - -def replace_naics_w_naics_from_another_year(df_load, sectorsourcename): - """ - Replace any non sectors with sectors. - :param df_load: df with sector columns or sector-like activities - :param sectorsourcename: str, sector source name (ex. NAICS_2012_Code) - :return: df, with non-sectors replaced with sectors - """ - # from flowsa.flowbyfunctions import aggregator - - # drop NoneType - df = replace_NoneType_with_empty_cells(df_load).reset_index(drop=True) - - # load the mastercroswalk and subset by sectorsourcename, - # save values to list - cw_load = load_crosswalk('sector_timeseries') - cw = cw_load[sectorsourcename].drop_duplicates().tolist() - - # load melted crosswalk - cw_melt = melt_naics_crosswalk() - # drop the count column - cw_melt = cw_melt.drop(columns='naics_count') - - # determine which headers are in the df - if 'SectorConsumedBy' in df: - column_headers = ['SectorProducedBy', 'SectorConsumedBy'] - else: - column_headers = ['ActivityProducedBy', 'ActivityConsumedBy'] - - # check if there are any sectors that are not in the naics 2012 crosswalk - non_naics = check_if_sectors_are_naics(df, cw, column_headers) - - # loop through the df headers and determine if value is - # not in crosswalk list - if len(non_naics) != 0: - vLog.debug('Checking if sectors represent a different ' - 'NAICS year, if so, replace with %s', sectorsourcename) - for c in column_headers: - # merge df with the melted sector crosswalk - df = df.merge(cw_melt, left_on=c, right_on='NAICS', how='left') - # if there is a value in the sectorsourcename column, - # use that value to replace sector in column c if value in - # column c is in the non_naics list - df[c] = np.where( - (df[c] == df['NAICS']) & (df[c].isin(non_naics)), - df[sectorsourcename], df[c]) - # multiply the FlowAmount col by allocation_ratio - df.loc[df[c] == df[sectorsourcename], - 'FlowAmount'] = df['FlowAmount'] * df['allocation_ratio'] - # drop columns - df = df.drop( - columns=[sectorsourcename, 'NAICS', 'allocation_ratio']) - vLog.debug('Replaced NAICS with %s', sectorsourcename) - - # check if there are any sectors that are not in - # the naics 2012 crosswalk - vLog.debug('Check again for non NAICS 2012 Codes') - nonsectors = check_if_sectors_are_naics(df, cw, column_headers) - if len(nonsectors) != 0: - vLog.debug('Dropping non-NAICS from dataframe') - for c in column_headers: - # drop rows where column value is in the nonnaics list - df = df[~df[c].isin(nonsectors)] - # aggregate data - possible_column_headers = \ - ('FlowAmount', 'Spread', 'Min', 'Max', 'DataReliability', - 'TemporalCorrelation', 'GeographicalCorrelation', - 'TechnologicalCorrelation', 'DataCollection', 'Description') - # list of column headers to group aggregation by - groupby_cols = [e for e in df.columns.values.tolist() - if e not in possible_column_headers] - df = aggregator(df, groupby_cols) - - df = replace_strings_with_NoneType(df) - # drop rows where both SectorConsumedBy and SectorProducedBy NoneType - if 'SectorConsumedBy' in df: - df_drop = df[(df['SectorConsumedBy'].isnull()) & - (df['SectorProducedBy'].isnull())] - if len(df_drop) != 0: - activities_dropped = pd.unique( - df_drop[['ActivityConsumedBy', - 'ActivityProducedBy']].values.ravel('K')) - activities_dropped = list(filter( - lambda x: x is not None, activities_dropped)) - vLog.debug('Dropping rows where the Activity columns contain %s', - ', '.join(activities_dropped)) - df = df[~((df['SectorConsumedBy'].isnull()) & - (df['SectorProducedBy'].isnull()))].reset_index(drop=True) - else: - df = df[~((df['ActivityConsumedBy'].isnull()) & - (df['ActivityProducedBy'].isnull()))].reset_index(drop=True) - - return df - - def compare_FBS_results(fbs1, fbs2, ignore_metasources=False, compare_to_remote=False): """ From e54cafc53a1cbcf891bcdfa8a4682b8ef45aa4ec Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 20 Apr 2023 08:45:13 -0600 Subject: [PATCH 0514/1127] add develop back to package requirements --- requirements.txt | 6 +++--- setup.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/requirements.txt b/requirements.txt index 09e443485..c9826077d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List#egg=fedelemflowlist -git+https://github.com/USEPA/esupy#egg=esupy -git+https://github.com/USEPA/standardizedinventories#egg=StEWI +git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git@develop#egg=fedelemflowlist +git+https://github.com/USEPA/esupy.git@develop#egg=esupy +git+https://github.com/USEPA/standardizedinventories.git@develop#egg=StEWI appdirs >= 1.4.3 # Storing user data bibtexparser>=1.2.0 # Generates bibtex kaleido == 0.1.0.post1; platform_system == "Windows" # export plotly.py figures as static images diff --git a/setup.py b/setup.py index 79a915031..662367452 100644 --- a/setup.py +++ b/setup.py @@ -12,9 +12,9 @@ include_package_data=True, python_requires=">=3.8", install_requires=[ - 'fedelemflowlist @ git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List#egg=fedelemflowlist', - 'esupy @ git+https://github.com/USEPA/esupy#egg=esupy', - 'StEWI @ git+https://github.com/USEPA/standardizedinventories#egg=StEWI', + 'fedelemflowlist @ git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git@develop#egg=fedelemflowlist', + 'esupy @ git+https://github.com/USEPA/esupy.git@develop#egg=esupy', + 'StEWI @ git+https://github.com/USEPA/standardizedinventories.git@develop#egg=StEWI', 'appdirs>=1.4.3', 'bibtexparser>=1.2.0', "kaleido==0.1.0.post1;platform_system=='Windows'", From 480737a3ffe5d9934d185d60d2575be0a01a59eb Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 21 Apr 2023 12:20:27 -0400 Subject: [PATCH 0515/1127] drop additional fbs_allocation fxns not used --- flowsa/data_source_scripts/EPA_REI.py | 2 +- flowsa/data_source_scripts/EPA_WFR.py | 123 --------------- flowsa/fbs_allocation.py | 147 ------------------ .../Food_Waste_national_2018_m2.yaml | 1 - 4 files changed, 1 insertion(+), 272 deletions(-) delete mode 100644 flowsa/fbs_allocation.py diff --git a/flowsa/data_source_scripts/EPA_REI.py b/flowsa/data_source_scripts/EPA_REI.py index 2d6740a8d..5b8e15044 100644 --- a/flowsa/data_source_scripts/EPA_REI.py +++ b/flowsa/data_source_scripts/EPA_REI.py @@ -7,7 +7,7 @@ import numpy as np from flowsa.location import US_FIPS from flowsa.flowbyfunctions import assign_fips_location_system -from flowsa.fbs_allocation import direct_allocation_method +# from flowsa.fbs_allocation import direct_allocation_method def rei_url_helper(*, build_url, config, **_): diff --git a/flowsa/data_source_scripts/EPA_WFR.py b/flowsa/data_source_scripts/EPA_WFR.py index c841cde05..466119f39 100644 --- a/flowsa/data_source_scripts/EPA_WFR.py +++ b/flowsa/data_source_scripts/EPA_WFR.py @@ -215,129 +215,6 @@ def reorder_df(df): return df -def attribute_cnhw_food(flows, method, k, v, *_): - """ - TODO: incorporate this method into flowbysector.py after brining in - Matthew's changes - cnhw is loaded as the primary data source, - flowbysector.py is not set up for an FBS to be used as a primary data - source - - Function is used to attribute CNHW food generation to waste management - paths using EPA WFR and Facts and Figures - :param flows: - :param method: - :return: - """ - from flowsa.fbs_allocation import load_map_clean_fba - from flowsa.settings import vLog, log - from flowsa.validation import compare_activity_to_sector_flowamounts, \ - compare_fba_geo_subset_and_fbs_output_totals - - # empty list for activity results - activity_list = [] - activities = v['activity_sets'] - # subset activity data and allocate to sector - for aset, attr in activities.items(): - # subset by named activities - names = attr['names'] - vLog.info(f"Preparing to handle {aset} in {k}") - # subset fba data by activity - flows_subset = flows[flows['SectorProducedBy'].isin( - names)].reset_index(drop=True) - - # load allocation df - # add parameters to dictionary if exist in method yaml - fba_dict = {} - if 'allocation_flow' in attr: - fba_dict['flowname_subset'] = attr['allocation_flow'] - if 'allocation_compartment' in attr: - fba_dict['compartment_subset'] = attr['allocation_compartment'] - if 'clean_allocation_fba' in attr: - fba_dict['clean_fba'] = attr['clean_allocation_fba'] - if 'clean_allocation_fba_w_sec' in attr: - fba_dict['clean_fba_w_sec'] = attr['clean_allocation_fba_w_sec'] - - # load the allocation FBA - fba_allocation_wsec = \ - load_map_clean_fba(method, attr, - fba_sourcename=attr['allocation_source'], - df_year=attr['allocation_source_year'], - flowclass=attr['allocation_source_class'], - geoscale_from=attr['allocation_from_scale'], - geoscale_to=v['geoscale_to_use'], - download_FBA_if_missing=True, - **fba_dict) - - # subset fba datasets to only keep the sectors associated - # with activity subset - if aset == 'wasted_food_report': - log.info("Subsetting %s for sectors in %s", - attr['allocation_source'], k) - fba_allocation_subset = fba_allocation_wsec[fba_allocation_wsec[ - 'SectorProducedBy'].isin(names)].reset_index(drop=True) - - # determine ratios of food waste by waste management pathway - fba_allocation_subset = fba_allocation_subset.assign( - Denominator=fba_allocation_subset.groupby( - ['SectorProducedBy'])['FlowAmount'].transform('sum')) - fba_allocation_subset = fba_allocation_subset.assign( - FlowAmountRatio=fba_allocation_subset['FlowAmount'] / - fba_allocation_subset['Denominator']) - - # merge the primary data source and allocation data source, - # but first drop primary df sectorconsumedby because empty - flows_subset2 = flows_subset.drop(columns='SectorConsumedBy') - fbs = flows_subset2.merge(fba_allocation_subset[['SectorProducedBy', - 'SectorConsumedBy', - 'FlowAmountRatio']], - how='left') - elif aset == 'facts_and_figures': - # determine ratios of food waste by waste management pathway - fba_allocation_wsec = fba_allocation_wsec.assign( - Denominator=fba_allocation_wsec.groupby( - ['FlowName'])['FlowAmount'].transform('sum')) - fba_allocation_wsec = fba_allocation_wsec.assign( - FlowAmountRatio=fba_allocation_wsec['FlowAmount'] / - fba_allocation_wsec['Denominator']) - - # merge the primary data source and allocation data source, - # but first drop primary df sectorconsumedby because empty - flows_subset2 = flows_subset.drop(columns='SectorConsumedBy') - # add temp merge col - df_list = [flows_subset2, fba_allocation_wsec] - for i, df in enumerate(df_list): - df_list[i]['merge_col'] = 1 - fbs = flows_subset2.merge(fba_allocation_wsec[['SectorConsumedBy', - 'FlowAmountRatio', - 'merge_col']], - how='left').drop(columns='merge_col') - - # calculate flow amounts for each sector - log.info("Calculating new flow amounts using flow ratios") - fbs['FlowAmount'] = fbs['FlowAmount'] * fbs['FlowAmountRatio'] - - # drop columns - fbs = fbs.drop(columns=['FlowAmountRatio']) - - # check before and after totals - # compare flowbysector with flowbyactivity - compare_activity_to_sector_flowamounts( - flows_subset, fbs, aset, method, v, attr) - compare_fba_geo_subset_and_fbs_output_totals( - flows_subset, fbs, aset, k, v, attr, method) - - activity_list.append(fbs) - - cnhw = pd.concat(activity_list) - - # for consistency with food waste m1 and with the data out of the EPA - # WFR which is used for residential food waste, update the flowable from - # 'Food' to 'Food Waste' - cnhw['Flowable'] = 'Food Waste' - - return cnhw - - def return_REI_fraction_foodwaste_treated_commodities(): """ Return dictionary of how the food waste is used after entering diff --git a/flowsa/fbs_allocation.py b/flowsa/fbs_allocation.py deleted file mode 100644 index f9554c655..000000000 --- a/flowsa/fbs_allocation.py +++ /dev/null @@ -1,147 +0,0 @@ -# fbs_allocation.py (flowsa) -# !/usr/bin/env python3 -# coding=utf-8 -""" -Functions to allocate data using additional data sources -""" - -import flowsa -from flowsa.common import fba_activity_fields -from flowsa.settings import log -from flowsa.flowbyfunctions import subset_df_by_geoscale, \ - load_fba_w_standardized_units -from flowsa.sectormapping import add_sectors_to_flowbyactivity -from flowsa.validation import check_if_data_exists_at_geoscale - - -def load_map_clean_fba(method, attr, fba_sourcename, df_year, flowclass, - geoscale_from, geoscale_to, fbsconfigpath=None, - **kwargs): - """ - Load, clean, and map a FlowByActivity df - :param method: dictionary, FBS method yaml - :param attr: dictionary, attribute data from method yaml for activity set - :param fba_sourcename: str, source name - :param df_year: str, year - :param flowclass: str, flowclass to subset df with - :param geoscale_from: str, geoscale to use - :param geoscale_to: str, geoscale to aggregate to - :param kwargs: dictionary, can include parameters: 'allocation_flow', - 'allocation_compartment','clean_allocation_fba', - 'clean_allocation_fba_w_sec' - :return: df, fba format - """ - from flowsa.sectormapping import get_activitytosector_mapping - # dictionary to load/standardize fba - kwargs_dict = {} - if 'download_FBA_if_missing' in kwargs: - kwargs_dict['download_FBA_if_missing'] = \ - kwargs['download_FBA_if_missing'] - if 'allocation_map_to_flow_list' in attr: - kwargs_dict['allocation_map_to_flow_list'] = \ - attr['allocation_map_to_flow_list'] - if 'allocation_fba_load_scale' in attr: - kwargs_dict['geographic_level'] = attr['allocation_fba_load_scale'] - - log.info("Loading allocation flowbyactivity %s for year %s", - fba_sourcename, str(df_year)) - fba = load_fba_w_standardized_units(datasource=fba_sourcename, - year=df_year, - flowclass=flowclass, - **kwargs_dict - ) - - # subset based on yaml settings - if 'flowname_subset' in kwargs: - if kwargs['flowname_subset'] != 'None': - fba = fba.loc[fba['FlowName'].isin(kwargs['flowname_subset'])] - if 'compartment_subset' in kwargs: - if kwargs['compartment_subset'] != 'None': - fba = \ - fba.loc[fba['Compartment'].isin(kwargs['compartment_subset'])] - if 'allocation_selection_fields' in kwargs: - selection_fields = attr.get('allocation_selection_fields') - for k, v in selection_fields.items(): - fba = fba[fba[k].isin(v)].reset_index(drop=True) - fba = (fba - .drop(columns='Description') - .reset_index(drop=True) - ) - - if len(fba) == 0: - raise flowsa.exceptions.FBSMethodConstructionError( - message='Allocation dataset is length 0; check flow or ' - 'compartment subset for errors') - - # load relevant activities if activities are not naics-like - try: - sm = get_activitytosector_mapping( - fba_sourcename, fbsconfigpath=fbsconfigpath) - sm_list = sm['Activity'].drop_duplicates().values.tolist() - # subset fba data by activities listed in the sector crosswalk - fba = fba[(fba[fba_activity_fields[0]].isin(sm_list)) | - (fba[fba_activity_fields[1]].isin(sm_list) - )].reset_index(drop=True) - except FileNotFoundError: - pass - - # check if allocation data exists at specified geoscale to use - log.info("Checking if allocation data exists at the %s level", - geoscale_from) - check_if_data_exists_at_geoscale(fba, geoscale_from) - - # aggregate geographically to the scale of the flowbyactivity source, - # if necessary - fba2 = subset_df_by_geoscale(fba, geoscale_from, geoscale_to) - - # cleanup the fba allocation df, if necessary - if 'clean_fba' in kwargs: - log.info("Cleaning %s", fba_sourcename) - fba2 = kwargs["clean_fba"]( - fba2, - attr=attr, - download_FBA_if_missing=kwargs['download_FBA_if_missing'] - ) - # reset index - fba2 = fba2.reset_index(drop=True) - try: - if kwargs.get('clean_fba_w_sec').__name__ in ('subset_and_equally_allocate_BEA_table'): - fba2 = fba2.assign(group_id=fba2.reset_index().index.astype(str)) - except AttributeError: - pass - - if len(fba2) == 0: - raise flowsa.exceptions.FBSMethodConstructionError( - message='Allocation dataset is length 0 after cleaning') - - # assign sector to allocation dataset - activity_to_sector_mapping = attr.get('activity_to_sector_mapping') - if 'activity_to_sector_mapping' in kwargs: - activity_to_sector_mapping = kwargs.get('activity_to_sector_mapping') - log.info("Adding sectors to %s", fba_sourcename) - - fba_wsec = add_sectors_to_flowbyactivity( - fba2, - sectorsourcename=method['target_sector_source'], - activity_to_sector_mapping=activity_to_sector_mapping, - overwrite_sectorlevel=attr.get( - 'activity_to_sector_aggregation_level'), - fbsconfigpath=fbsconfigpath - ) - - # call on fxn to further clean up/disaggregate the fba - # allocation data, if exists - if 'clean_fba_w_sec' in kwargs: - log.info("Further disaggregating sectors in %s", fba_sourcename) - fba_wsec = kwargs['clean_fba_w_sec']( - fba_wsec, - attr=attr, - method=method, - sourcename=fba_sourcename, - download_FBA_if_missing=kwargs['download_FBA_if_missing'] - ) - - # drop group_id, which are used in some clean_fba_w_sec fnxs - fba_wsec = fba_wsec.drop(columns=['group_id'], errors='ignore') - - return fba_wsec diff --git a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml index 26aaf83f4..c85a2c9a5 100644 --- a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml +++ b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml @@ -13,7 +13,6 @@ source_names: "CNHW_national_2018": selection_fields: Flowable: Food -# clean_fbs_df_fxn: !script_function:EPA_WFR attribute_cnhw_food activity_sets: wasted_food_report: selection_fields: From c7d1fde92ef7abb84eb5cef6a032974d6c5b2186 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 21 Apr 2023 12:23:40 -0400 Subject: [PATCH 0516/1127] delete eia mecs functions added back unnecessarily during conflict --- .../temp_data_source_functions.py | 71 ------------------- 1 file changed, 71 deletions(-) diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index c6c1f02e1..e60569554 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -167,77 +167,6 @@ def clean_usda_cropland_naics(fba: FlowByActivity, **kwargs): return filtered -def eia_mecs_energy_parse(*, df_list, source, year, **_): - """ - Combine, parse, and format the provided dataframes - :param df_list: list of dataframes to concat and format - :param year: year - :param source: source - :return: df, parsed and partially formatted to flowbyactivity - specifications - """ - from flowsa.location import assign_census_regions - - # concatenate dataframe list into single dataframe - df = pd.concat(df_list, sort=True) - - # rename columns to match standard flowbyactivity format - df = df.rename(columns={'NAICS Code': 'ActivityConsumedBy', - 'Table Name': 'Description'}) - df.loc[df['Subsector and Industry'] == 'Total', 'ActivityConsumedBy'] = '31-33' - df = df.drop(columns='Subsector and Industry') - df['ActivityConsumedBy'] = df['ActivityConsumedBy'].str.strip() - # add hardcoded data - df["SourceName"] = source - df["Compartment"] = None - df['FlowType'] = 'TECHNOSPHERE_FLOWS' - df['Year'] = year - df['MeasureofSpread'] = "RSE" - # assign location codes and location system - df.loc[df['Location'] == 'Total United States', 'Location'] = US_FIPS - df = assign_fips_location_system(df, year) - df = assign_census_regions(df) - df['DataReliability'] = 5 # tmp - df['DataCollection'] = 5 # tmp - - # drop rows that reflect subtotals (only necessary in 2014) - df.dropna(subset=['ActivityConsumedBy'], inplace=True) - - suppressed = df.assign( - FlowAmount=df.FlowAmount.mask(df.FlowAmount.str.isnumeric() == False, - np.nan), - Suppressed=df.FlowAmount.where(df.FlowAmount.str.isnumeric() == False, - np.nan), - Spread=df.Spread.mask(df.Spread.str.isnumeric() == False, np.nan) - ) - - return suppressed - - -def estimate_suppressed_mecs_energy( - fba: FlowByActivity, - **kwargs -) -> FlowByActivity: - ''' - Rough first pass at an estimation method, for testing purposes. This - will drop rows with 'D' or 'Q' values, on the grounds that as far as I can - tell we don't have any more information for them than we do for any - industry without its own line item in the MECS anyway. '*' is for value - less than 0.5 Trillion Btu and will be assumed to be 0.25 Trillion Btu - ''' - if 'Suppressed' not in fba.columns: - log.warning('The current MECS dataframe does not contain data ' - 'on estimation method and so suppressed data will ' - 'not be assessed.') - return fba - dropped = fba.query('Suppressed not in ["D", "Q"]') - unsuppressed = dropped.assign( - FlowAmount=dropped.FlowAmount.mask(dropped.Suppressed == '*', 0.25) - ) - - return unsuppressed.drop(columns='Suppressed') - - def clean_mecs_energy_fba_for_bea_summary(fba: FlowByActivity, **kwargs): naics_3 = fba.query('ActivityConsumedBy.str.len() == 3') naics_4 = fba.query('ActivityConsumedBy.str.len() == 4 ' From 7faf9debc76dd94c6f5db7a7047a7ec46fb3ecde Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 21 Apr 2023 12:32:01 -0400 Subject: [PATCH 0517/1127] consolidate temp fxns to BLS_QCEW --- flowsa/data_source_scripts/BLS_QCEW.py | 154 ++++++++++++++++-- .../temp_data_source_functions.py | 136 ---------------- .../Employment_common.yaml | 4 +- .../flowbysectormethods/SEEA_2016_v1.yaml | 2 +- .../flowbysectormethods/SEEA_2017_kg_v1.yaml | 2 +- .../flowbysectormethods/SEEA_2017_v1.yaml | 2 +- .../flowbysectormethods/SEEA_2017_v2.yaml | 2 +- .../marine_shipping_adjustment.yaml | 4 +- 8 files changed, 145 insertions(+), 161 deletions(-) diff --git a/flowsa/data_source_scripts/BLS_QCEW.py b/flowsa/data_source_scripts/BLS_QCEW.py index aa7aa7b3f..1c38397b5 100644 --- a/flowsa/data_source_scripts/BLS_QCEW.py +++ b/flowsa/data_source_scripts/BLS_QCEW.py @@ -19,6 +19,9 @@ from flowsa.location import US_FIPS from flowsa.flowbyfunctions import assign_fips_location_system, \ aggregator, equally_allocate_suppressed_parent_to_child_naics +from flowsa.flowby import FlowByActivity +from flowsa.flowsa_log import log +from flowsa.naics import industry_spec_key def BLS_QCEW_URL_helper(*, build_url, year, **_): @@ -136,23 +139,6 @@ def bls_qcew_parse(*, df_list, year, **_): return df2 -def clean_bls_qcew_fba_for_employment_sat_table(fba, **_): - """ - When creating the employment satellite table for use in useeior, - modify the flow name to match prior methodology for mapping/impact factors. - clean_fba_df_fxn - - :param fba: df, flowbyactivity - :return: df, flowbyactivity, with modified flow names - """ - - # rename flowname value - for c in ['FlowName', 'Flowable']: - fba[c] = fba[c].str.replace('Number of employees', 'Jobs') - - return fba - - def bls_clean_allocation_fba_w_sec(df_w_sec, **kwargs): """ clean up bls df with sectors by estimating suppresed data @@ -176,3 +162,137 @@ def bls_clean_allocation_fba_w_sec(df_w_sec, **kwargs): df2 = aggregator(df, groupcols) return df2 + + +def clean_qcew(fba: FlowByActivity, **kwargs): + #todo: check function method for state + if fba.config.get('geoscale') == 'national': + fba = fba.query('Location == "00000"') + + totals = ( + fba + .query('ActivityProducedBy.str.len() == 3') + [['Location', 'ActivityProducedBy', 'FlowAmount']] + .assign(ActivityProducedBy=lambda x: (x.ActivityProducedBy + .str.slice(stop=2))) + .groupby(['Location', 'ActivityProducedBy']).agg('sum') + .reset_index() + .rename(columns={'FlowAmount': 'new_total'}) + ) + + merged = fba.merge(totals, how='left') + + fixed = ( + merged + .assign(FlowAmount=merged.FlowAmount.mask( + (merged.ActivityProducedBy.str.len() == 2) + & (merged.FlowAmount == 0), + merged.new_total + )) + .drop(columns='new_total') + .reset_index(drop=True) + ) + + target_naics = set(industry_spec_key(fba.config['industry_spec']) + .target_naics) + filtered = ( + fixed + .assign(ActivityProducedBy=fixed.ActivityProducedBy.mask( + (fixed.ActivityProducedBy + '0').isin(target_naics), + fixed.ActivityProducedBy + '0' + )) + .query('ActivityProducedBy in @target_naics') + ) + + return filtered + + +def clean_qcew_for_fbs(fba: FlowByActivity, **kwargs): + """ + clean up bls df with sectors by estimating suppresed data + :param df_w_sec: df, FBA format BLS QCEW data + :param kwargs: additional arguments can include 'attr', a + dictionary of FBA method yaml parameters + :return: df, BLS QCEW FBA with estimated suppressed data + """ + fba['Flowable'] = 'Jobs' + return fba + + +def estimate_suppressed_qcew(fba: FlowByActivity) -> FlowByActivity: + if fba.config.get('geoscale') == 'national': + fba = fba.query('Location == "00000"') + else: + log.critical('At a subnational scale, this will take a long time.') + + indexed = ( + fba + .assign(n2=fba.ActivityProducedBy.str.slice(stop=2), + n3=fba.ActivityProducedBy.str.slice(stop=3), + n4=fba.ActivityProducedBy.str.slice(stop=4), + n5=fba.ActivityProducedBy.str.slice(stop=5), + n6=fba.ActivityProducedBy.str.slice(stop=6), + location=fba.Location, + category=fba.FlowName) + .replace({'FlowAmount': {0: np.nan}, + 'ActivityProducedBy': {'31-33': '3X', + '44-45': '4X', + '48-49': '4Y'}, + 'n2': {'31': '3X', '32': '3X', '33': '3X', + '44': '4X', '45': '4X', + '48': '4Y', '49': '4Y'}}) + .set_index(['n2', 'n3', 'n4', 'n5', 'n6', 'location', 'category'], + verify_integrity=True) + ) + + def fill_suppressed( + flows: pd.Series, + level: int, + full_naics: pd.Series + ) -> pd.Series: + parent = flows[full_naics.str.len() == level] + children = flows[full_naics.str.len() == level + 1] + null_children = children[children.isna()] + + if null_children.empty or parent.empty: + return flows + else: + value = max((parent[0] - children.sum()) / null_children.size, 0) + return flows.fillna(pd.Series(value, index=null_children.index)) + + unsuppressed = ( + indexed + .assign( + FlowAmount=lambda x: ( + x.groupby(level=['n2', + 'location', 'category'])['FlowAmount'] + .transform(fill_suppressed, 2, x.ActivityProducedBy))) + .assign( + FlowAmount=lambda x: ( + x.groupby(level=['n2', 'n3', + 'location', 'category'])['FlowAmount'] + .transform(fill_suppressed, 3, x.ActivityProducedBy))) + .assign( + FlowAmount=lambda x: ( + x.groupby(level=['n2', 'n3', 'n4', + 'location', 'category'])['FlowAmount'] + .transform(fill_suppressed, 4, x.ActivityProducedBy))) + .assign( + FlowAmount=lambda x: ( + x.groupby(level=['n2', 'n3', 'n4', 'n5', + 'location', 'category'])['FlowAmount'] + .transform(fill_suppressed, 5, x.ActivityProducedBy))) + .fillna({'FlowAmount': 0}) + .reset_index(drop=True) + ) + + aggregated = ( + unsuppressed + .assign(FlowName='Number of employees') + .replace({'ActivityProducedBy': {'3X': '31-33', + '4X': '44-45', + '4Y': '48-49'}}) + .aggregate_flowby() + ) + + return aggregated diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index e60569554..b28a4306f 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -6,142 +6,6 @@ from flowsa.data_source_scripts import EPA_GHGI as ghgi from flowsa.data_source_scripts import USDA_CoA_Cropland as coa from flowsa.flowby import FlowByActivity -from flowsa.location import US_FIPS -from flowsa.flowbyfunctions import assign_fips_location_system - - -def clean_qcew(fba: FlowByActivity, **kwargs): - #todo: check function method for state - if fba.config.get('geoscale') == 'national': - fba = fba.query('Location == "00000"') - - totals = ( - fba - .query('ActivityProducedBy.str.len() == 3') - [['Location', 'ActivityProducedBy', 'FlowAmount']] - .assign(ActivityProducedBy=lambda x: (x.ActivityProducedBy - .str.slice(stop=2))) - .groupby(['Location', 'ActivityProducedBy']).agg('sum') - .reset_index() - .rename(columns={'FlowAmount': 'new_total'}) - ) - - merged = fba.merge(totals, how='left') - - fixed = ( - merged - .assign(FlowAmount=merged.FlowAmount.mask( - (merged.ActivityProducedBy.str.len() == 2) - & (merged.FlowAmount == 0), - merged.new_total - )) - .drop(columns='new_total') - .reset_index(drop=True) - ) - - target_naics = set(naics.industry_spec_key(fba.config['industry_spec']) - .target_naics) - filtered = ( - fixed - .assign(ActivityProducedBy=fixed.ActivityProducedBy.mask( - (fixed.ActivityProducedBy + '0').isin(target_naics), - fixed.ActivityProducedBy + '0' - )) - .query('ActivityProducedBy in @target_naics') - ) - - return filtered - - -def clean_qcew_for_fbs(fba: FlowByActivity, **kwargs): - """ - clean up bls df with sectors by estimating suppresed data - :param df_w_sec: df, FBA format BLS QCEW data - :param kwargs: additional arguments can include 'attr', a - dictionary of FBA method yaml parameters - :return: df, BLS QCEW FBA with estimated suppressed data - """ - fba['Flowable'] = 'Jobs' - return fba - - -def estimate_suppressed_qcew(fba: FlowByActivity) -> FlowByActivity: - if fba.config.get('geoscale') == 'national': - fba = fba.query('Location == "00000"') - else: - log.critical('At a subnational scale, this will take a long time.') - - indexed = ( - fba - .assign(n2=fba.ActivityProducedBy.str.slice(stop=2), - n3=fba.ActivityProducedBy.str.slice(stop=3), - n4=fba.ActivityProducedBy.str.slice(stop=4), - n5=fba.ActivityProducedBy.str.slice(stop=5), - n6=fba.ActivityProducedBy.str.slice(stop=6), - location=fba.Location, - category=fba.FlowName) - .replace({'FlowAmount': {0: np.nan}, - 'ActivityProducedBy': {'31-33': '3X', - '44-45': '4X', - '48-49': '4Y'}, - 'n2': {'31': '3X', '32': '3X', '33': '3X', - '44': '4X', '45': '4X', - '48': '4Y', '49': '4Y'}}) - .set_index(['n2', 'n3', 'n4', 'n5', 'n6', 'location', 'category'], - verify_integrity=True) - ) - - def fill_suppressed( - flows: pd.Series, - level: int, - full_naics: pd.Series - ) -> pd.Series: - parent = flows[full_naics.str.len() == level] - children = flows[full_naics.str.len() == level + 1] - null_children = children[children.isna()] - - if null_children.empty or parent.empty: - return flows - else: - value = max((parent[0] - children.sum()) / null_children.size, 0) - return flows.fillna(pd.Series(value, index=null_children.index)) - - unsuppressed = ( - indexed - .assign( - FlowAmount=lambda x: ( - x.groupby(level=['n2', - 'location', 'category'])['FlowAmount'] - .transform(fill_suppressed, 2, x.ActivityProducedBy))) - .assign( - FlowAmount=lambda x: ( - x.groupby(level=['n2', 'n3', - 'location', 'category'])['FlowAmount'] - .transform(fill_suppressed, 3, x.ActivityProducedBy))) - .assign( - FlowAmount=lambda x: ( - x.groupby(level=['n2', 'n3', 'n4', - 'location', 'category'])['FlowAmount'] - .transform(fill_suppressed, 4, x.ActivityProducedBy))) - .assign( - FlowAmount=lambda x: ( - x.groupby(level=['n2', 'n3', 'n4', 'n5', - 'location', 'category'])['FlowAmount'] - .transform(fill_suppressed, 5, x.ActivityProducedBy))) - .fillna({'FlowAmount': 0}) - .reset_index(drop=True) - ) - - aggregated = ( - unsuppressed - .assign(FlowName='Number of employees') - .replace({'ActivityProducedBy': {'3X': '31-33', - '4X': '44-45', - '4Y': '48-49'}}) - .aggregate_flowby() - ) - - return aggregated def clean_usda_cropland_naics(fba: FlowByActivity, **kwargs): diff --git a/flowsa/methods/flowbysectormethods/Employment_common.yaml b/flowsa/methods/flowbysectormethods/Employment_common.yaml index fa55ed8f0..1e2bce309 100644 --- a/flowsa/methods/flowbysectormethods/Employment_common.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_common.yaml @@ -9,8 +9,8 @@ _bls_selection_fields_state: &bls_selection_fields_state Location: !include:Location_common.yaml:_state_location _bls_load_and_clean: &bls_load_and_clean - clean_fba_before_mapping: !script_function:temp_data_source_functions estimate_suppressed_qcew - clean_fba: !script_function:temp_data_source_functions clean_qcew_for_fbs + clean_fba_before_mapping: !script_function:BLS_QCEW estimate_suppressed_qcew + clean_fba: !script_function:BLS_QCEW clean_qcew_for_fbs bls_load_and_clean_national: <<: *bls_selection_fields_national diff --git a/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml index 5774f8189..8689fb0b1 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml @@ -64,7 +64,7 @@ sources_to_cache: selection_fields: Class: Employment year: 2012 - clean_fba: !script_function:temp_data_source_functions clean_qcew + clean_fba: !script_function:BLS_QCEW clean_qcew BTS_TSA: year: 2016 selection_fields: diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml index 400c6a982..b91595bf2 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml @@ -80,7 +80,7 @@ sources_to_cache: selection_fields: Class: Employment year: 2012 - clean_fba: !script_function:temp_data_source_functions clean_qcew + clean_fba: !script_function:BLS_QCEW clean_qcew BTS_TSA: year: 2017 selection_fields: diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index a828b84b6..4a4933425 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -229,7 +229,7 @@ sources_to_cache: selection_fields: Class: Employment year: 2012 - clean_fba: !script_function:temp_data_source_functions clean_qcew + clean_fba: !script_function:BLS_QCEW clean_qcew BTS_TSA: year: 2017 selection_fields: diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml index 09c1f5dfb..2c813e719 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml @@ -230,7 +230,7 @@ sources_to_cache: selection_fields: Class: Employment year: 2012 - clean_fba: !script_function:temp_data_source_functions clean_qcew + clean_fba: !script_function:BLS_QCEW clean_qcew source_names: # stewiFBS: diff --git a/flowsa/methods/flowbysectormethods/marine_shipping_adjustment.yaml b/flowsa/methods/flowbysectormethods/marine_shipping_adjustment.yaml index 27f7ec77a..147f95c0d 100644 --- a/flowsa/methods/flowbysectormethods/marine_shipping_adjustment.yaml +++ b/flowsa/methods/flowbysectormethods/marine_shipping_adjustment.yaml @@ -16,8 +16,8 @@ sources_to_cache: year: 2012 selection_fields: Class: Employment - clean_fba_before_mapping: !script_function:temp_data_source_functions estimate_suppressed_qcew - clean_fba: !script_function:temp_data_source_functions clean_qcew # todo: evaluate if necessary because already estimated suppressed data + clean_fba_before_mapping: !script_function:BLS_QCEW estimate_suppressed_qcew + clean_fba: !script_function:BLS_QCEW clean_qcew # todo: evaluate if necessary because already estimated suppressed data source_names: BEA_Marine_Bunker_Fuel: From b2e2a6a02e7e3762c19431f2668203722ad3c15c Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 21 Apr 2023 13:18:37 -0400 Subject: [PATCH 0518/1127] consolidate log functions to flowsa_log --- flowsa/__init__.py | 5 +- flowsa/allocation.py | 16 +-- flowsa/bibliography.py | 3 +- flowsa/common.py | 40 +----- flowsa/data_source_scripts/BLM_PLS.py | 2 +- flowsa/data_source_scripts/EIA_CBECS_Land.py | 56 ++++---- flowsa/data_source_scripts/EIA_MECS.py | 2 +- flowsa/data_source_scripts/EPA_CDDPath.py | 3 +- flowsa/data_source_scripts/EPA_GHGI.py | 3 +- flowsa/data_source_scripts/EPA_SIT.py | 3 +- flowsa/data_source_scripts/StateGHGI.py | 3 +- flowsa/data_source_scripts/USDA_ERS_MLU.py | 15 +- flowsa/data_source_scripts/USGS_MYB.py | 2 +- flowsa/data_source_scripts/USGS_NWIS_WU.py | 49 ++++--- flowsa/data_source_scripts/stewiFBS.py | 3 +- flowsa/datavisualization.py | 3 +- flowsa/flowbyactivity.py | 5 +- flowsa/flowbyfunctions.py | 29 ++-- flowsa/flowsa_log.py | 35 +++++ flowsa/location.py | 3 +- flowsa/naics.py | 21 +-- flowsa/sectormapping.py | 2 +- flowsa/settings.py | 99 +++++++------ flowsa/validation.py | 141 +++++++++---------- 24 files changed, 269 insertions(+), 274 deletions(-) diff --git a/flowsa/__init__.py b/flowsa/__init__.py index 9380f4b9b..dd9b0773b 100644 --- a/flowsa/__init__.py +++ b/flowsa/__init__.py @@ -20,7 +20,8 @@ from esupy.processed_data_mgmt import load_preprocessed_output, \ download_from_remote from flowsa.common import load_yaml_dict -from flowsa.settings import log, sourceconfigpath, flowbysectormethodpath, \ +from flowsa.flowsa_log import log +from flowsa.settings import sourceconfigpath, flowbysectormethodpath, \ paths, fbaoutputpath, fbsoutputpath, \ biboutputpath, DEFAULT_DOWNLOAD_IF_MISSING from flowsa.metadata import set_fb_meta @@ -99,7 +100,7 @@ def writeFlowBySectorBibliography(methodname): """ # Generate a single .bib file for a list of Flow-By-Sector method names # and save file to local directory - log.info('Write bibliography to %s%s.bib', biboutputpath, methodname) + log.info(f'Write bibliography to {biboutputpath}{methodname}.bib') generate_fbs_bibliography(methodname) diff --git a/flowsa/allocation.py b/flowsa/allocation.py index cb0146212..cb56d5bef 100644 --- a/flowsa/allocation.py +++ b/flowsa/allocation.py @@ -8,7 +8,7 @@ import pandas as pd from flowsa.common import fbs_activity_fields, sector_level_key, \ load_crosswalk, check_activities_sector_like -from flowsa.settings import log, vLogDetailed +from flowsa.flowsa_log import log, vlog from flowsa.dataclean import replace_NoneType_with_empty_cells, \ replace_strings_with_NoneType from flowsa.flowbyfunctions import sector_aggregation, aggregator, \ @@ -303,16 +303,16 @@ def equally_allocate_parent_to_child_naics( # append to df if len(rl) != 0: - vLogDetailed.warning('Data found at %s digit sectors not ' - 'represented in current data subset: ' - '{}'.format(' '.join(map(str, rl_list))), - str(i)) + vlog.warning('Data found at %s digit sectors not ' + 'represented in current data subset: ' + '{}'.format(' '.join(map(str, rl_list))), + str(i)) rows_lost = pd.concat([rows_lost, rl], ignore_index=True) if len(rows_lost) != 0: - vLogDetailed.info('Allocating FlowAmounts equally to ' - 'each %s associated with the sectors previously ' - 'dropped', sector_level) + vlog.info('Allocating FlowAmounts equally to each ' + f'{sector_level} associated with the sectors previously ' + 'dropped') # if activities are source-like, set col values as copies # of the sector columns if sector_like_activities: diff --git a/flowsa/bibliography.py b/flowsa/bibliography.py index 4f3c3c3ec..bdd75483f 100644 --- a/flowsa/bibliography.py +++ b/flowsa/bibliography.py @@ -12,7 +12,8 @@ from flowsa.common import load_yaml_dict, \ load_values_from_literature_citations_config, get_flowsa_base_name, \ sourceconfigpath, load_yaml_dict -from flowsa.settings import outputpath, biboutputpath, log +from flowsa.flowsa_log import log +from flowsa.settings import outputpath, biboutputpath def generate_list_of_sources_in_fbs_method(methodname): diff --git a/flowsa/common.py b/flowsa/common.py index fdb1d6b0b..45cd9b8ab 100644 --- a/flowsa/common.py +++ b/flowsa/common.py @@ -4,22 +4,21 @@ """Common variables and functions used across flowsa""" -import shutil import os from os import path import yaml import pandas as pd import numpy as np from dotenv import load_dotenv -from esupy.processed_data_mgmt import create_paths_if_missing import flowsa.flowsa_yaml as flowsa_yaml import flowsa.exceptions +from flowsa.flowsa_log import log from flowsa.schema import flow_by_activity_fields, flow_by_sector_fields, \ flow_by_sector_collapsed_fields, flow_by_activity_mapped_fields, \ flow_by_activity_wsec_fields, flow_by_activity_mapped_wsec_fields, \ activity_fields -from flowsa.settings import datapath, MODULEPATH, logoutputpath, \ - sourceconfigpath, log, flowbysectormethodpath, methodpath +from flowsa.settings import datapath, MODULEPATH, \ + sourceconfigpath, flowbysectormethodpath, methodpath # Sets default Sector Source Name @@ -271,39 +270,6 @@ def get_flowsa_base_name(filedirectory, filename, extension): return filename -def rename_log_file(filename, fb_meta): - """ - Rename the log file saved to local directory using df meta for df - :param filename: str, name of dataset - :param fb_meta: metadata for parquet - :return: modified log file name - """ - # original log file name - all log statements - log_file = f'{logoutputpath}{"flowsa.log"}' - # generate new log name - new_log_name = (f'{logoutputpath}{filename}_v' - f'{fb_meta.tool_version}' - f'{"_" + fb_meta.git_hash if fb_meta.git_hash else ""}' - f'.log') - # create log directory if missing - create_paths_if_missing(logoutputpath) - # rename the standard log file name (os.rename throws error if file - # already exists) - shutil.copy(log_file, new_log_name) - # original log file name - validation - log_file = f'{logoutputpath}{"validation_flowsa.log"}' - # generate new log name - new_log_name = (f'{logoutputpath}{filename}_v' - f'{fb_meta.tool_version}' - f'{"_" + fb_meta.git_hash if fb_meta.git_hash else ""}' - f'_validation.log') - # create log directory if missing - create_paths_if_missing(logoutputpath) - # rename the standard log file name (os.rename throws error if file - # already exists) - shutil.copy(log_file, new_log_name) - - def return_true_source_catalog_name(sourcename): """ Drop any extensions on source name until find the name in source catalog diff --git a/flowsa/data_source_scripts/BLM_PLS.py b/flowsa/data_source_scripts/BLM_PLS.py index 5890b548d..8666724cd 100644 --- a/flowsa/data_source_scripts/BLM_PLS.py +++ b/flowsa/data_source_scripts/BLM_PLS.py @@ -13,7 +13,7 @@ import pandas as pd from flowsa.location import get_all_state_FIPS_2 from flowsa.common import WITHDRAWN_KEYWORD -from flowsa.settings import log +from flowsa.flowsa_log import log def split(row, header, sub_header, next_line): diff --git a/flowsa/data_source_scripts/EIA_CBECS_Land.py b/flowsa/data_source_scripts/EIA_CBECS_Land.py index 2efb5259b..24601c94c 100644 --- a/flowsa/data_source_scripts/EIA_CBECS_Land.py +++ b/flowsa/data_source_scripts/EIA_CBECS_Land.py @@ -11,10 +11,9 @@ import pandas as pd import numpy as np from flowsa.location import US_FIPS, get_region_and_division_codes -from flowsa.common import WITHDRAWN_KEYWORD, \ - clean_str_and_capitalize, fba_mapped_default_grouping_fields -from flowsa.settings import vLogDetailed -from flowsa.flowbyfunctions import assign_fips_location_system, aggregator +from flowsa.common import WITHDRAWN_KEYWORD, clean_str_and_capitalize +from flowsa.flowbyfunctions import assign_fips_location_system +from flowsa.flowsa_log import vlog from flowsa.literature_values import \ get_commercial_and_manufacturing_floorspace_to_land_area_ratio from flowsa.validation import calculate_flowamount_diff_between_dfs @@ -249,8 +248,8 @@ def cbecs_land_fba_cleanup(fba, **_): # drop activities of 'all buildings' to avoid double counting fba2 = fba1[ fba1['ActivityConsumedBy'] != 'All buildings'].reset_index(drop=True) - vLogDetailed.info('Drop the principle building activity "All buildings" ' - 'to avoid double counting') + vlog.info('Drop the principle building activity "All buildings" ' + 'to avoid double counting') calculate_flowamount_diff_between_dfs(fba1, fba2) return fba2 @@ -269,24 +268,24 @@ def calculate_floorspace_based_on_number_of_floors(fba_load): # disaggregate mercentile to malls and non malls fba = disaggregate_eia_cbecs_mercentile(fba_load) - vLogDetailed.info('Calculate floorspace for mall and nonmall buildings ' - 'with different number of floors. Once calculated, ' - 'drop mercantile data from dataframe to avoid double ' - 'counting.') + vlog.info('Calculate floorspace for mall and nonmall buildings ' + 'with different number of floors. Once calculated, ' + 'drop mercantile data from dataframe to avoid double ' + 'counting.') calculate_flowamount_diff_between_dfs(fba_load, fba) # disaggregate other and vacant fba2 = disaggregate_eia_cbecs_vacant_and_other(fba) - vLogDetailed.info('Due to data suppression for floorspace by building ' - 'number of floors, some data is lost when dropping ' - 'floorspace for all buildings within a principle ' - 'building activity. To avoid this data loss, all ' - 'remaining floorspace for "All buildings" by number of ' - 'floors is allocated to "Vacant" and "Other" principle ' - 'building activities, as these activities are allocated ' - 'to all commercial building sectors. This assumption ' - 'results in a total floorspace increase for "Vacant" ' - 'and "Other" activities.') + vlog.info('Due to data suppression for floorspace by building ' + 'number of floors, some data is lost when dropping ' + 'floorspace for all buildings within a principle ' + 'building activity. To avoid this data loss, all ' + 'remaining floorspace for "All buildings" by number of ' + 'floors is allocated to "Vacant" and "Other" principle ' + 'building activities, as these activities are allocated ' + 'to all commercial building sectors. This assumption ' + 'results in a total floorspace increase for "Vacant" ' + 'and "Other" activities.') calculate_flowamount_diff_between_dfs(fba, fba2) # drop data for 'all buildings' @@ -303,12 +302,12 @@ def calculate_floorspace_based_on_number_of_floors(fba_load): # total floorspace fba3['FlowAmount'] = fba3['FlowAmount'] / fba3['DivisionFactor'] # sum values for single flowamount for each bulding type - vLogDetailed.info('Drop flows for "All Buildings" to avoid double ' - 'counting, as maintain floorspace by buildings based ' - 'on number of floors. Also dividing total floorspace ' - 'by number of floors to calculate a building footprint. ' - 'Calculates result in reduced FlowAmount for all ' - 'categories.') + vlog.info('Drop flows for "All Buildings" to avoid double ' + 'counting, as maintain floorspace by buildings based ' + 'on number of floors. Also dividing total floorspace ' + 'by number of floors to calculate a building footprint. ' + 'Calculates result in reduced FlowAmount for all ' + 'categories.') calculate_flowamount_diff_between_dfs(fba2, fba3) # rename the FlowAmounts and sum so total floorspace, rather than have # multiple rows based on floors @@ -316,7 +315,6 @@ def calculate_floorspace_based_on_number_of_floors(fba_load): lambda x: ','.join(x.split(',')[:-1]))) # modify the description fba3 = fba3.assign(Description='Building Footprint') - groupbycols = fba_mapped_default_grouping_fields fba4 = fba3.aggregate_flowby() return fba4 @@ -455,8 +453,8 @@ def calculate_total_facility_land_area(df): floor_space_to_land_area_ratio = \ get_commercial_and_manufacturing_floorspace_to_land_area_ratio() - vLogDetailed.info('Modifying FlowAmounts - Assuming the floor space to ' - 'land area ratio is 1:4') + vlog.info('Modifying FlowAmounts - Assuming the floor space to ' + 'land area ratio is 1:4') df = df.assign(FlowAmount=(df['FlowAmount'] / floor_space_to_land_area_ratio) - df['FlowAmount']) diff --git a/flowsa/data_source_scripts/EIA_MECS.py b/flowsa/data_source_scripts/EIA_MECS.py index c8a88c784..f133817db 100644 --- a/flowsa/data_source_scripts/EIA_MECS.py +++ b/flowsa/data_source_scripts/EIA_MECS.py @@ -14,7 +14,7 @@ import flowsa from flowsa.location import US_FIPS, get_region_and_division_codes from flowsa.common import WITHDRAWN_KEYWORD -from flowsa.settings import log +from flowsa.flowsa_log import log from flowsa.flowby import FlowByActivity from flowsa.flowbyfunctions import assign_fips_location_system, sector_aggregation from flowsa.data_source_scripts.EIA_CBECS_Land import \ diff --git a/flowsa/data_source_scripts/EPA_CDDPath.py b/flowsa/data_source_scripts/EPA_CDDPath.py index 5f596b008..abe72c729 100644 --- a/flowsa/data_source_scripts/EPA_CDDPath.py +++ b/flowsa/data_source_scripts/EPA_CDDPath.py @@ -14,7 +14,8 @@ import re import os from flowsa.location import US_FIPS -from flowsa.settings import externaldatapath, log +from flowsa.flowsa_log import log +from flowsa.settings import externaldatapath from flowsa.flowbyfunctions import assign_fips_location_system, aggregator from flowsa.dataclean import standardize_units from flowsa.schema import flow_by_activity_mapped_fields diff --git a/flowsa/data_source_scripts/EPA_GHGI.py b/flowsa/data_source_scripts/EPA_GHGI.py index 1e6101df4..ad7dd1c13 100644 --- a/flowsa/data_source_scripts/EPA_GHGI.py +++ b/flowsa/data_source_scripts/EPA_GHGI.py @@ -12,7 +12,8 @@ import pandas as pd from flowsa.flowbyfunctions import assign_fips_location_system, \ load_fba_w_standardized_units -from flowsa.settings import log, externaldatapath +from flowsa.flowsa_log import log +from flowsa.settings import externaldatapath from flowsa.schema import flow_by_activity_fields from flowsa.flowby import FlowByActivity diff --git a/flowsa/data_source_scripts/EPA_SIT.py b/flowsa/data_source_scripts/EPA_SIT.py index f40eb4a91..571f965a4 100644 --- a/flowsa/data_source_scripts/EPA_SIT.py +++ b/flowsa/data_source_scripts/EPA_SIT.py @@ -8,10 +8,11 @@ import pandas as pd import os -from flowsa.settings import externaldatapath, log +from flowsa.settings import externaldatapath from flowsa.flowby import FlowByActivity from flowsa.flowbyfunctions import assign_fips_location_system, \ load_fba_w_standardized_units +from flowsa.flowsa_log import log from flowsa.location import apply_county_FIPS from flowsa.schema import flow_by_activity_fields diff --git a/flowsa/data_source_scripts/StateGHGI.py b/flowsa/data_source_scripts/StateGHGI.py index e18c5aefa..6762e1708 100644 --- a/flowsa/data_source_scripts/StateGHGI.py +++ b/flowsa/data_source_scripts/StateGHGI.py @@ -7,9 +7,10 @@ import pandas as pd import os -from flowsa.settings import externaldatapath, log +from flowsa.settings import externaldatapath from flowsa.flowbyfunctions import assign_fips_location_system, \ load_fba_w_standardized_units +from flowsa.flowsa_log import log from flowsa.location import apply_county_FIPS from flowsa.common import load_yaml_dict diff --git a/flowsa/data_source_scripts/USDA_ERS_MLU.py b/flowsa/data_source_scripts/USDA_ERS_MLU.py index 4e259f163..6912b3981 100644 --- a/flowsa/data_source_scripts/USDA_ERS_MLU.py +++ b/flowsa/data_source_scripts/USDA_ERS_MLU.py @@ -12,7 +12,7 @@ import pandas as pd import numpy as np from flowsa.location import get_all_state_FIPS_2, US_FIPS -from flowsa.settings import vLogDetailed +from flowsa.flowsa_log import vlog from flowsa.flowbyfunctions import assign_fips_location_system, aggregator from flowsa.common import load_crosswalk from flowsa.literature_values import \ @@ -111,9 +111,9 @@ def allocate_usda_ers_mlu_land_in_urban_areas(*, flow_subset_mapped, # define sector column to base calculations sector_col = 'SectorConsumedBy' - vLogDetailed.info('Assuming total land use from MECS and CBECS included ' - 'in urban land area, so subtracting out calculated ' - 'MECS and CBECS land from MLU urban land area') + vlog.info('Assuming total land use from MECS and CBECS included ' + 'in urban land area, so subtracting out calculated ' + 'MECS and CBECS land from MLU urban land area') # read in the cbecs and mecs df from df_list for df_i in fbs_list: if (df_i['MetaSources'] == 'EIA_CBECS_Land').all(): @@ -314,10 +314,9 @@ def allocate_usda_ers_mlu_other_land(*, flow_subset_mapped, **_): # in df, where sector is a personal expenditure value, and # location = 00000, replace with rural res value - vLogDetailed.info('The only category for MLU other land use is rural land ' - 'occupation. All other land area in this category is ' - 'unassigned to sectors, resulting in unaccounted land ' - 'area.') + vlog.info('The only category for MLU other land use is rural land ' + 'occupation. All other land area in this category is ' + 'unassigned to sectors, resulting in unaccounted land area.') df['FlowAmount'] = np.where(df['SectorConsumedBy'].isin(household), rural_res, df['FlowAmount']) diff --git a/flowsa/data_source_scripts/USGS_MYB.py b/flowsa/data_source_scripts/USGS_MYB.py index ab559ec13..0c53976cc 100644 --- a/flowsa/data_source_scripts/USGS_MYB.py +++ b/flowsa/data_source_scripts/USGS_MYB.py @@ -3,7 +3,7 @@ import numpy as np import pandas as pd from string import digits -from flowsa.settings import log +from flowsa.flowsa_log import log from flowsa.common import WITHDRAWN_KEYWORD from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.location import US_FIPS diff --git a/flowsa/data_source_scripts/USGS_NWIS_WU.py b/flowsa/data_source_scripts/USGS_NWIS_WU.py index 6a7c3210e..0872e9163 100644 --- a/flowsa/data_source_scripts/USGS_NWIS_WU.py +++ b/flowsa/data_source_scripts/USGS_NWIS_WU.py @@ -11,8 +11,8 @@ import numpy as np from flowsa.location import abbrev_us_state, US_FIPS from flowsa.common import fba_activity_fields, capitalize_first_letter -from flowsa.settings import vLogDetailed from flowsa.flowbyfunctions import assign_fips_location_system, aggregator +from flowsa.flowsa_log import vlog from flowsa.validation import compare_df_units, \ calculate_flowamount_diff_between_dfs from flowsa.flowby import FlowByActivity @@ -361,7 +361,7 @@ def usgs_fba_data_cleanup(fba: FlowByActivity) -> FlowByActivity: :param fba: df, FBA format :return: df, modified FBA """ - vLogDetailed.info('Converting Bgal/d to Mgal/d') + vlog.info('Converting Bgal/d to Mgal/d') fba['FlowAmount'] = np.where(fba['Unit'] == 'Bgal/d', fba['FlowAmount'] * 1000, fba['FlowAmount']) fba['Unit'] = np.where(fba['Unit'] == 'Bgal/d', 'Mgal/d', fba['Unit']) @@ -369,23 +369,22 @@ def usgs_fba_data_cleanup(fba: FlowByActivity) -> FlowByActivity: # causes issues because linked with public supply # also drop closed-loop or once-through cooling (thermoelectric power) # to avoid double counting - vLogDetailed.info('Removing all rows for Commercial Data because does not ' - 'exist for all states and causes issues as information ' - 'on Public Supply deliveries.') + vlog.info('Removing all rows for Commercial Data because does not ' + 'exist for all states and causes issues as information ' + 'on Public Supply deliveries.') dfa = fba[~fba['Description'].str.lower().str.contains( 'commercial|closed-loop cooling|once-through')] calculate_flowamount_diff_between_dfs(fba, dfa) # calculated NET PUBLIC SUPPLY by subtracting out deliveries to domestic - vLogDetailed.info('Modify the public supply values to generate ' - 'NET public supply by subtracting out deliveries ' - 'to domestic') + vlog.info('Modify the public supply values to generate ' + 'NET public supply by subtracting out deliveries to domestic') dfb = calculate_net_public_supply(dfa) # check that golf + crop = total irrigation, if not, # assign all of total irrigation to crop - vLogDetailed.info('If states do not distinguish between golf and crop ' - 'irrigation as a subset of total irrigation, assign ' - 'all of total irrigation to crop') + vlog.info('If states do not distinguish between golf and crop ' + 'irrigation as a subset of total irrigation, assign ' + 'all of total irrigation to crop') dfc = check_golf_and_crop_irrigation_totals(dfb) # national @@ -393,9 +392,9 @@ def usgs_fba_data_cleanup(fba: FlowByActivity) -> FlowByActivity: # drop flowname = 'total' rows when possible to prevent double counting # subset data where flowname = total and where it does not - vLogDetailed.info('Drop rows where the FlowName is total to prevent' - 'double counting at the state and county levels. ' - 'Retain rows at national level') + vlog.info('Drop rows where the FlowName is total to prevent' + 'double counting at the state and county levels. ' + 'Retain rows at national level') df2 = dfc[dfc['FlowName'] == 'total'] # set conditions for data to keep when flowname = 'total c1 = df2['Location'] != US_FIPS @@ -455,16 +454,16 @@ def calculate_net_public_supply(df_load: FlowByActivity): "deliveries from public supply")] # calculate data drop - vLogDetailed.info('Dropping rows that contain "deliveries from public ' - 'supply" to avoid double counting with rows of "Public ' - 'Supply deliveries to"') + vlog.info('Dropping rows that contain "deliveries from public ' + 'supply" to avoid double counting with rows of "Public ' + 'Supply deliveries to"') calculate_flowamount_diff_between_dfs(df1, df1_sub) # drop county level values because cannot use county data - vLogDetailed.info('Dropping county level public supply withdrawals ' - 'because will end up with negative values due to ' - 'instances of water deliveries coming from surrounding ' - 'counties') + vlog.info('Dropping county level public supply withdrawals ' + 'because will end up with negative values due to ' + 'instances of water deliveries coming from surrounding ' + 'counties') df1_sub = df1_sub[df1_sub['Location'].apply( lambda x: x[2:6] == '000')].reset_index(drop=True) @@ -579,11 +578,11 @@ def check_golf_and_crop_irrigation_totals(df_load: FlowByActivity): df_check['Diff'] = df_check['Diff'].apply(lambda x: round(x, 2)) df_check2 = df_check[df_check['Diff'] != 0] if len(df_check2) > 0: - vLogDetailed.info('The golf and crop irrigation do not add up to ' - 'total irrigation.') + vlog.info('The golf and crop irrigation do not add up to ' + 'total irrigation.') else: - vLogDetailed.info('The golf and crop irrigation add up to total ' - 'irrigation.') + vlog.info('The golf and crop irrigation add up to total ' + 'irrigation.') return df_w_missing_crop2 else: return df_load diff --git a/flowsa/data_source_scripts/stewiFBS.py b/flowsa/data_source_scripts/stewiFBS.py index 08cd20e91..cca5c2e70 100644 --- a/flowsa/data_source_scripts/stewiFBS.py +++ b/flowsa/data_source_scripts/stewiFBS.py @@ -15,8 +15,9 @@ from esupy.processed_data_mgmt import read_source_metadata from flowsa.flowby import FlowBySector, FlowByActivity from flowsa.flowbyfunctions import assign_fips_location_system +from flowsa.flowsa_log import log from flowsa.location import apply_county_FIPS, update_geoscale -from flowsa.settings import log, process_adjustmentpath +from flowsa.settings import process_adjustmentpath from flowsa.naics import replace_naics_w_naics_from_another_year import stewicombo import stewi diff --git a/flowsa/datavisualization.py b/flowsa/datavisualization.py index da0602038..13eeed5a9 100644 --- a/flowsa/datavisualization.py +++ b/flowsa/datavisualization.py @@ -15,8 +15,9 @@ from flowsa.common import load_crosswalk, load_yaml_dict from flowsa.dataclean import replace_NoneType_with_empty_cells from flowsa.flowbyfunctions import sector_aggregation +from flowsa.flowsa_log import log from flowsa.sectormapping import get_sector_list -from flowsa.settings import log, datapath, plotoutputpath +from flowsa.settings import datapath, plotoutputpath import textwrap diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index 485214352..e14e536b0 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -15,8 +15,9 @@ from esupy.processed_data_mgmt import write_df_to_file from esupy.remote import make_url_request from flowsa.common import load_env_file_key, sourceconfigpath, \ - load_yaml_dict, rename_log_file, get_flowsa_base_name -from flowsa.settings import paths, log + load_yaml_dict, get_flowsa_base_name +from flowsa.settings import paths +from flowsa.flowsa_log import log, rename_log_file from flowsa.metadata import set_fb_meta, write_metadata from flowsa.flowbyfunctions import fba_fill_na_dict from flowsa.schema import flow_by_activity_fields diff --git a/flowsa/flowbyfunctions.py b/flowsa/flowbyfunctions.py index af81b7f1d..ded881970 100644 --- a/flowsa/flowbyfunctions.py +++ b/flowsa/flowbyfunctions.py @@ -17,11 +17,11 @@ fba_mapped_default_grouping_fields from flowsa.dataclean import clean_df, replace_strings_with_NoneType, \ replace_NoneType_with_empty_cells, standardize_units +from flowsa.flowsa_log import log, vlog from flowsa.location import US_FIPS, get_state_FIPS, \ get_county_FIPS, update_geoscale, fips_number_key from flowsa.schema import flow_by_activity_fields, flow_by_sector_fields, \ flow_by_sector_collapsed_fields, flow_by_activity_mapped_fields -from flowsa.settings import log, vLogDetailed, vLog def create_geoscale_list(df, geoscale, year='2015'): @@ -748,8 +748,8 @@ def equally_allocate_suppressed_parent_to_child_naics( compare_child_to_parent_sectors_flowamounts, \ compare_summation_at_sector_lengths_between_two_dfs - vLogDetailed.info('Estimating suppressed data by equally allocating ' - 'parent to child sectors.') + vlog.info('Estimating suppressed data by equally allocating ' + 'parent to child sectors.') df = sector_disaggregation(df_load) # equally allocate parent to child naics where child naics are not @@ -757,8 +757,8 @@ def equally_allocate_suppressed_parent_to_child_naics( # calculate the flow that has already been allocated. Must allocate to # NAICS_6 for suppressed data function to work correctly. if equally_allocate_parent_to_child: - vLogDetailed.info('Before estimating suppressed data, equally ' - 'allocate parent sectors to child sectors.') + vlog.info('Before estimating suppressed data, equally ' + 'allocate parent sectors to child sectors.') df = equally_allocate_parent_to_child_naics( df, method, overwritetargetsectorlevel='NAICS_6') @@ -927,16 +927,15 @@ def equally_allocate_suppressed_parent_to_child_naics( 'SectorConsumedMatch', 'sector_allocated', 'FlowRemainder']] negv = negv[col_subset].reset_index(drop=True) - vLog.info( + vlog.info( 'There are negative values when allocating suppressed ' 'parent data to child sector. The values are more than ' '%s%% of the total parent sector with a negative flow ' 'amount being allocated more than %s. Resetting flow ' 'values to be allocated to 0. See validation log for ' 'details.', str(percenttolerance), str(flowtolerance)) - vLogDetailed.info('Values where flow remainders are ' - 'negative, resetting to 0: ' - '\n {}'.format(negv.to_string())) + vlog.info('Values where flow remainders are negative, ' + 'resetting to 0: \n {}'.format(negv.to_string())) df_sup3['FlowRemainder'] = np.where(df_sup3["FlowRemainder"] < 0, 0, df_sup3['FlowRemainder']) df_sup3 = df_sup3.drop(columns=[ @@ -969,8 +968,8 @@ def equally_allocate_suppressed_parent_to_child_naics( # reindex columns dff = dff.reindex(df_load.columns, axis=1) - vLogDetailed.info('Checking results of allocating suppressed parent to ' - 'child sectors. ') + vlog.info('Checking results of allocating suppressed parent to ' + 'child sectors. ') compare_summation_at_sector_lengths_between_two_dfs(df_load, dff) compare_child_to_parent_sectors_flowamounts(dff) # todo: add third check comparing smallest child naics (6) to largest (2) @@ -1283,10 +1282,10 @@ def assign_columns_of_sector_levels_without_ambiguous_sectors( ['SectorProducedBy', 'SectorConsumedBy', 'SectorProducedByLength', 'SectorConsumedByLength' ]].drop_duplicates().reset_index(drop=True) - vLogDetailed.info('After assigning a column of sector lengths, ' - 'dropped data with the following sector ' - 'assignments due to ambiguous sector lengths ' - '%s: \n {}'.format(df_dropped.to_string())) + vlog.info('After assigning a column of sector lengths, ' + 'dropped data with the following sector ' + 'assignments due to ambiguous sector lengths ' + '%s: \n {}'.format(df_dropped.to_string())) dfc = dfc.sort_values(['SectorProducedByLength', 'SectorConsumedByLength']).reset_index(drop=True) return dfc diff --git a/flowsa/flowsa_log.py b/flowsa/flowsa_log.py index 48936fb42..6c20ed8b5 100644 --- a/flowsa/flowsa_log.py +++ b/flowsa/flowsa_log.py @@ -1,5 +1,7 @@ import logging +import shutil import sys +from esupy.processed_data_mgmt import create_paths_if_missing from .settings import logoutputpath try: @@ -71,3 +73,36 @@ def format(self, record): vlog = logging.getLogger('flowsa.validation') vlog.setLevel(logging.DEBUG) vlog.addHandler(validation_file_handler) + + +def rename_log_file(filename, fb_meta): + """ + Rename the log file saved to local directory using df meta for df + :param filename: str, name of dataset + :param fb_meta: metadata for parquet + :return: modified log file name + """ + # original log file name - all log statements + log_file = f'{logoutputpath}{"flowsa.log"}' + # generate new log name + new_log_name = (f'{logoutputpath}{filename}_v' + f'{fb_meta.tool_version}' + f'{"_" + fb_meta.git_hash if fb_meta.git_hash else ""}' + f'.log') + # create log directory if missing + create_paths_if_missing(logoutputpath) + # rename the standard log file name (os.rename throws error if file + # already exists) + shutil.copy(log_file, new_log_name) + # original log file name - validation + log_file = f'{logoutputpath}{"validation_flowsa.log"}' + # generate new log name + new_log_name = (f'{logoutputpath}{filename}_v' + f'{fb_meta.tool_version}' + f'{"_" + fb_meta.git_hash if fb_meta.git_hash else ""}' + f'_validation.log') + # create log directory if missing + create_paths_if_missing(logoutputpath) + # rename the standard log file name (os.rename throws error if file + # already exists) + shutil.copy(log_file, new_log_name) diff --git a/flowsa/location.py b/flowsa/location.py index 607370fb4..7ce87e303 100644 --- a/flowsa/location.py +++ b/flowsa/location.py @@ -9,7 +9,8 @@ import numpy as np import pycountry import urllib.error -from flowsa.settings import datapath, log +from flowsa.flowsa_log import log +from flowsa.settings import datapath from flowsa.common import clean_str_and_capitalize diff --git a/flowsa/naics.py b/flowsa/naics.py index 8e9ba8328..6113ab482 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -2,6 +2,7 @@ import pandas as pd import numpy as np from flowsa.flowbyfunctions import aggregator +from flowsa.flowsa_log import vlog from . import (common, dataclean, settings) naics_crosswalk = pd.read_csv( @@ -176,10 +177,10 @@ def check_if_sectors_are_naics(df_load, crosswalk_list, column_headers): ns_list = pd.concat(non_sectors_list, sort=False, ignore_index=True) # print the NonSectors non_sectors = ns_list['NonSectors'].drop_duplicates().tolist() - settings.vLog.debug('There are sectors that are not NAICS 2012 Codes') - settings.vLog.debug(non_sectors) + vlog.debug('There are sectors that are not NAICS 2012 Codes') + vlog.debug(non_sectors) else: - settings.vLog.debug('All sectors are NAICS 2012 Codes') + vlog.debug('All sectors are NAICS 2012 Codes') return non_sectors @@ -254,8 +255,8 @@ def replace_naics_w_naics_from_another_year(df_load, sectorsourcename): # loop through the df headers and determine if value is # not in crosswalk list if len(non_naics) != 0: - settings.vLog.debug('Checking if sectors represent a different ' - f'NAICS year, if so, replace with {sectorsourcename}') + vlog.debug('Checking if sectors represent a different ' + f'NAICS year, if so, replace with {sectorsourcename}') for c in column_headers: # merge df with the melted sector crosswalk df = df.merge(cw_melt, left_on=c, right_on='NAICS', how='left') @@ -271,14 +272,14 @@ def replace_naics_w_naics_from_another_year(df_load, sectorsourcename): # drop columns df = df.drop( columns=[sectorsourcename, 'NAICS', 'allocation_ratio']) - settings.vLog.debug(f'Replaced NAICS with {sectorsourcename}') + vlog.debug(f'Replaced NAICS with {sectorsourcename}') # check if there are any sectors that are not in # the naics 2012 crosswalk - settings.vLog.debug('Check again for non NAICS 2012 Codes') + vlog.debug('Check again for non NAICS 2012 Codes') nonsectors = check_if_sectors_are_naics(df, cw, column_headers) if len(nonsectors) != 0: - settings.vLog.debug('Dropping non-NAICS from dataframe') + vlog.debug('Dropping non-NAICS from dataframe') for c in column_headers: # drop rows where column value is in the nonnaics list df = df[~df[c].isin(nonsectors)] @@ -303,8 +304,8 @@ def replace_naics_w_naics_from_another_year(df_load, sectorsourcename): 'ActivityProducedBy']].values.ravel('K')) activities_dropped = list(filter( lambda x: x is not None, activities_dropped)) - settings.vLog.debug('Dropping rows where the Activity columns ' - f'contain {", ".join(activities_dropped)}') + vlog.debug('Dropping rows where the Activity columns ' + f'contain {", ".join(activities_dropped)}') df = df[~((df['SectorConsumedBy'].isnull()) & (df['SectorProducedBy'].isnull()))].reset_index(drop=True) else: diff --git a/flowsa/sectormapping.py b/flowsa/sectormapping.py index cc9c5cf7c..23f8ba58f 100644 --- a/flowsa/sectormapping.py +++ b/flowsa/sectormapping.py @@ -14,8 +14,8 @@ load_yaml_dict, fba_activity_fields, SECTOR_SOURCE_NAME from flowsa.dataclean import standardize_units from flowsa.flowbyfunctions import fbs_activity_fields, load_crosswalk +from flowsa.flowsa_log import log from flowsa.schema import activity_fields, dq_fields -from flowsa.settings import log def get_activitytosector_mapping(source, fbsconfigpath=None): diff --git a/flowsa/settings.py b/flowsa/settings.py index 296c5815f..93a6a104a 100644 --- a/flowsa/settings.py +++ b/flowsa/settings.py @@ -1,9 +1,6 @@ -import sys import os -import logging import subprocess from importlib.metadata import version -from pathlib import Path from esupy.processed_data_mgmt import Paths, create_paths_if_missing from esupy.util import get_git_hash @@ -50,54 +47,54 @@ ).replace('\\', '/') + '/scripts/' scriptsFBApath = scriptpath + 'FlowByActivity_Datasets/' -# define 4 logs, one for general information, one for major validation -# logs that are also included in the general info log, one for very specific -# validation that is only included in the validation log, and a console -# printout that includes general and validation, but not detailed validation - - -# format for logging .txt generated -formatter = logging.Formatter('%(asctime)s %(levelname)-8s %(message)s', - datefmt='%Y-%m-%d %H:%M:%S') - -# create loggers -# general logger -log = logging.getLogger('allLog') -log.setLevel(logging.DEBUG) -log.propagate = False -# log.propagate=False -# general validation logger -vLog = logging.getLogger('validationLog') -vLog.setLevel(logging.DEBUG) -vLog.propagate = False -# detailed validation logger -vLogDetailed = logging.getLogger('validationLogDetailed') -vLogDetailed.setLevel(logging.DEBUG) -vLogDetailed.propagate = False - -# create handlers -# create handler for overall logger -log_fh = logging.FileHandler(logoutputpath + 'flowsa.log', - mode='w', encoding='utf-8') -log_fh.setFormatter(formatter) -# create handler for general validation information -vLog_fh = logging.FileHandler(logoutputpath + 'validation_flowsa.log', - mode='w', encoding='utf-8') -vLog_fh.setFormatter(formatter) -# create console handler -ch = logging.StreamHandler(sys.stdout) -ch.setLevel(logging.INFO) -ch.setFormatter(formatter) - -# add handlers to various loggers -# general logger -log.addHandler(ch) # print to console -log.addHandler(log_fh) -vLog.addHandler(log_fh) -# validation logger -vLog.addHandler(ch) # print to console -vLog.addHandler(vLog_fh) -vLogDetailed.addHandler(vLog_fh) +# # define 4 logs, one for general information, one for major validation +# # logs that are also included in the general info log, one for very specific +# # validation that is only included in the validation log, and a console +# # printout that includes general and validation, but not detailed validation + + +# # format for logging .txt generated +# formatter = logging.Formatter('%(asctime)s %(levelname)-8s %(message)s', +# datefmt='%Y-%m-%d %H:%M:%S') + +# # create loggers +# # general logger +# log = logging.getLogger('allLog') +# log.setLevel(logging.DEBUG) +# log.propagate = False +# # log.propagate=False +# # general validation logger +# vLog = logging.getLogger('validationLog') +# vLog.setLevel(logging.DEBUG) +# vLog.propagate = False +# # detailed validation logger +# vLogDetailed = logging.getLogger('validationLogDetailed') +# vLogDetailed.setLevel(logging.DEBUG) +# vLogDetailed.propagate = False + +# # create handlers +# # create handler for overall logger +# log_fh = logging.FileHandler(logoutputpath + 'flowsa.log', +# mode='w', encoding='utf-8') +# log_fh.setFormatter(formatter) +# # create handler for general validation information +# vLog_fh = logging.FileHandler(logoutputpath + 'validation_flowsa.log', +# mode='w', encoding='utf-8') +# vLog_fh.setFormatter(formatter) +# # create console handler +# ch = logging.StreamHandler(sys.stdout) +# ch.setLevel(logging.INFO) +# ch.setFormatter(formatter) + +# # add handlers to various loggers +# # general logger +# log.addHandler(ch) # print to console +# log.addHandler(log_fh) +# vLog.addHandler(log_fh) +# # validation logger +# vLog.addHandler(ch) # print to console +# vLog.addHandler(vLog_fh) +# vLogDetailed.addHandler(vLog_fh) def return_pkg_version(): diff --git a/flowsa/validation.py b/flowsa/validation.py index 5f19f9b32..5ec54abd4 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -12,12 +12,12 @@ from flowsa.flowbyfunctions import aggregator, create_geoscale_list,\ subset_df_by_geoscale, sector_aggregation, collapse_fbs_sectors,\ subset_df_by_sector_lengths +from flowsa.flowsa_log import log, vlog from flowsa.dataclean import replace_strings_with_NoneType, \ replace_NoneType_with_empty_cells from flowsa.common import sector_level_key, \ fba_activity_fields, check_activities_sector_like from flowsa.location import US_FIPS, fips_number_key -from flowsa.settings import log, vLog, vLogDetailed def check_if_data_exists_at_geoscale(df_load, geoscale): @@ -63,17 +63,16 @@ def check_if_data_exists_at_geoscale(df_load, geoscale): y = df_load['Year'][0] if len(df1) == 0: - vLog.info( - "No flows found for activities in %s %s at the %s scale", - sn, y, geoscale) + vlog.info(f'No flows found for activities in {sn} {y} at the ' + f'{geoscale} scale') if len(df2) > 0: # if len(df2) > 1: df2 = df2.groupby( ['ActivityProducedBy', 'ActivityConsumedBy'], dropna=False).agg( lambda col: ','.join(col)).reset_index() - vLogDetailed.info("There are %s, activity combos that do not have " - "data in %s %s: \n {}".format(df2.to_string()), - geoscale, sn, y) + vlog.info("There are %s, activity combos that do not have " + "data in %s %s: \n {}".format(df2.to_string()), + geoscale, sn, y) def calculate_flowamount_diff_between_dfs(dfa_load, dfb_load): @@ -118,10 +117,10 @@ def calculate_flowamount_diff_between_dfs(dfa_load, dfb_load): # determine if any new data is negative dfn = df[df['FlowAmount_Modified'] < 0].reset_index(drop=True) if len(dfn) > 0: - vLog.info('There are negative FlowAmounts in new dataframe, ' + vlog.info('There are negative FlowAmounts in new dataframe, ' 'see Validation Log') - vLogDetailed.info('Negative FlowAmounts in new dataframe: ' - '\n {}'.format(dfn.to_string())) + vlog.info('Negative FlowAmounts in new dataframe: ' + '\n {}'.format(dfn.to_string())) # Because code will sometimes change terminology, aggregate # data by context and flowable to compare df differences @@ -146,7 +145,7 @@ def calculate_flowamount_diff_between_dfs(dfa_load, dfb_load): # drop rows where difference = 0 dfagg2 = dfagg[dfagg['FlowAmount_Difference'] != 0].reset_index(drop=True) if len(dfagg2) == 0: - vLogDetailed.info('No FlowAmount differences') + vlog.info('No FlowAmount differences') else: # subset df and aggregate, also print out the total # aggregate diff at the geoscale @@ -164,12 +163,12 @@ def calculate_flowamount_diff_between_dfs(dfa_load, dfb_load): # drop rows where difference = 0 dfagg5 = dfagg4[ dfagg4['FlowAmount_Difference'] != 0].reset_index(drop=True) - vLogDetailed.info('Total FlowAmount differences between dataframes: ' - '\n {}'.format(dfagg5.to_string(), index=False)) + vlog.info('Total FlowAmount differences between dataframes: ' + '\n {}'.format(dfagg5.to_string(), index=False)) # save detail output in log file - vLogDetailed.info('Total FlowAmount differences by Activity Columns: ' - '\n {}'.format(dfagg2.to_string(), index=False)) + vlog.info('Total FlowAmount differences by Activity Columns: ' + '\n {}'.format(dfagg2.to_string(), index=False)) def compare_activity_to_sector_flowamounts(fba_load, fbs_load, @@ -187,7 +186,7 @@ def compare_activity_to_sector_flowamounts(fba_load, fbs_load, """ data_format = v.get('data_format') if (data_format == 'FBA') & (check_activities_sector_like(fba_load)): - vLog.debug('Not comparing loaded FlowByActivity to FlowBySector ' + vlog.debug('Not comparing loaded FlowByActivity to FlowBySector ' 'ratios for a dataset with sector-like activities because ' 'if there are modifications to flowamounts for a sector, ' 'then the ratios will be different') @@ -276,7 +275,7 @@ def compare_activity_to_sector_flowamounts(fba_load, fbs_load, (comparison['Ratio'] > 1 + tolerance)] if len(comparison2) > 0: - vLog.info('There are %s combinations of flowable/context/sector ' + vlog.info('There are %s combinations of flowable/context/sector ' 'length where the flowbyactivity to flowbysector ratio ' 'is less than or greater than 1 by %s', len(comparison2), str(tolerance)) @@ -293,11 +292,11 @@ def compare_activity_to_sector_flowamounts(fba_load, fbs_load, activity_set) # if df not empty, print, if empty, print string if df_v.empty: - vLogDetailed.info('Ratios for %s all round to 1', activity_set) + vlog.info('Ratios for %s all round to 1', activity_set) else: - vLogDetailed.info('Comparison of FlowByActivity load to ' - 'FlowBySector ratios for %s: ' - '\n {}'.format(df_v.to_string()), activity_set) + vlog.info('Comparison of FlowByActivity load to ' + 'FlowBySector ratios for %s: ' + '\n {}'.format(df_v.to_string()), activity_set) def compare_fba_geo_subset_and_fbs_output_totals( @@ -321,7 +320,7 @@ def compare_fba_geo_subset_and_fbs_output_totals( totals by location, save results as csv in local directory """ - vLog.info('Comparing Flow-By-Activity subset by activity and geography to ' + vlog.info('Comparing Flow-By-Activity subset by activity and geography to ' 'the subset Flow-By-Sector FlowAmount total.') # determine from scale @@ -394,9 +393,8 @@ def compare_fba_geo_subset_and_fbs_output_totals( 'Location']].values.tolist() # loop through the contexts and print results of comparison - vLog.info('Comparing FBA %s %s subset to FBS results. ' - 'Details in Validation Log', activity_set, - source_attr['geoscale_to_use']) + vlog.info(f'Comparing FBA {activity_set} {source_attr["geoscale_to_use"]} ' + 'subset to FBS results. Details in Validation Log') for i, j, k in context_list: df_merge_subset = \ df_merge[(df_merge['Class'] == i) & @@ -404,9 +402,8 @@ def compare_fba_geo_subset_and_fbs_output_totals( (df_merge['Location'] == k)].reset_index(drop=True) diff_per = df_merge_subset['Percent_difference'][0] if np.isnan(diff_per): - vLog.info('FlowBySector FlowAmount for %s %s %s ' - 'does not exist in the FBS', - source_name, activity_set, i) + vlog.info(f'FlowBySector FlowAmount for {source_name} ' + f'{activity_set} {i} does not exist in the FBS') continue # make reporting more manageable if abs(diff_per) > 0.01: @@ -416,22 +413,19 @@ def compare_fba_geo_subset_and_fbs_output_totals( # diff_units = df_merge_subset['FBS_unit'][0] if diff_per > 0: - vLog.info('FlowBySector FlowAmount for %s %s %s %s at %s is ' - '%s%% ' - 'less than the FlowByActivity FlowAmount', - source_name, activity_set, i, j, k, str(abs( - diff_per))) + vlog.info(f'FlowBySector FlowAmount for {source_name} ' + f'{activity_set} {i} {j} at {k} is ' + f'{str(abs(diff_per))}% less than the ' + f'FlowByActivity FlowAmount') elif diff_per < 0: - vLog.info('FlowBySector FlowAmount for %s %s %s %s at %s is ' - '%s%% ' - 'more than the FlowByActivity FlowAmount', - source_name, activity_set, i, j, k, - str(abs(diff_per))) + vlog.info(f'FlowBySector FlowAmount for {source_name} ' + f'{activity_set} {i} {j} at {k} is ' + f'{str(abs(diff_per))}% more than the ' + f'FlowByActivity FlowAmount') elif diff_per == 0: - vLogDetailed.info('FlowBySector FlowAmount for %s %s %s %s at ' - '%s is equal to the FlowByActivity ' - 'FlowAmount', - source_name, activity_set, i, j, k) + vlog.info(f'FlowBySector FlowAmount for {source_name} ' + f'{activity_set} {i} {j} at {k} is equal to the ' + f'FlowByActivity FlowAmount') # subset the df to include in the validation log # only print rows where the percent difference does not round to 0 @@ -440,19 +434,17 @@ def compare_fba_geo_subset_and_fbs_output_totals( # log output log.info('Save the comparison of FlowByActivity load to FlowBySector ' - 'total FlowAmounts for %s in validation log file', - activity_set) + f'total FlowAmounts for {activity_set} in validation log file') # if df not empty, print, if empty, print string if df_v.empty: - vLogDetailed.info('Percent difference between loaded FBA and ' - 'output FBS for %s all round to 0', - activity_set) + vlog.info(f'Percent difference between loaded FBA and ' + f'output FBS for {activity_set} all round to 0') else: - vLogDetailed.info('Comparison of FBA load to FBS total ' - 'FlowAmounts for %s: ' - '\n {}'.format(df_v.to_string()), activity_set) + vlog.info('Comparison of FBA load to FBS total ' + 'FlowAmounts for %s: ' + '\n {}'.format(df_v.to_string()), activity_set) except: - vLog.info('Error occurred when comparing total FlowAmounts ' + vlog.info('Error occurred when comparing total FlowAmounts ' 'for FlowByActivity and FlowBySector') @@ -498,13 +490,13 @@ def compare_summation_at_sector_lengths_between_two_dfs(df1, df2): log.info('See validation log for cases where the second dataframe ' 'has flow amounts greater than the first dataframe at the ' 'same location/sector lengths.') - vLogDetailed.info('The second dataframe has flow amounts greater than ' - 'the first dataframe at the same sector lengths: ' - '\n {}'.format(dfm3.to_string())) + vlog.info('The second dataframe has flow amounts greater than ' + 'the first dataframe at the same sector lengths: ' + '\n {}'.format(dfm3.to_string())) else: - vLogDetailed.info('The second dataframe does not have flow amounts ' - 'greater than the first dataframe at any sector ' - 'length') + vlog.info('The second dataframe does not have flow amounts ' + 'greater than the first dataframe at any sector ' + 'length') def compare_child_to_parent_sectors_flowamounts(df_load): @@ -563,14 +555,14 @@ def compare_child_to_parent_sectors_flowamounts(df_load): (dfm['PercentDiff'] < - tolerance)].reset_index(drop=True) if len(dfm2) > 0: - log.info('See validation log for cases where child sectors sum to be ' - 'different than parent sectors by at least %s%%.', tolerance) - vLogDetailed.info('There are cases where child sectors sum to be ' - 'different than parent sectors by at least %s%%: ' - '\n {}'.format(dfm2.to_string()), tolerance) + log.info(f'See validation log for cases where child sectors sum to be ' + f'different than parent sectors by at least {tolerance}%.') + vlog.info('There are cases where child sectors sum to be ' + 'different than parent sectors by at least %s%%: ' + '\n {}'.format(dfm2.to_string()), tolerance) else: - vLogDetailed.info('No child sectors sum to be different than parent ' - 'sectors by at least %s%%.', tolerance) + vlog.info(f'No child sectors sum to be different than parent ' + f'sectors by at least {tolerance}%.') def check_for_nonetypes_in_sector_col(df): @@ -581,7 +573,7 @@ def check_for_nonetypes_in_sector_col(df): """ # if datatypes are strings, return warning message if df['Sector'].isnull().any(): - vLog.warning("There are NoneType values in the 'Sector' column") + vlog.warning("There are NoneType values in the 'Sector' column") return df @@ -593,7 +585,7 @@ def check_for_negative_flowamounts(df): """ # return a warning if there are negative flowamount values if (df['FlowAmount'].values < 0).any(): - vLog.warning('There are negative FlowAmounts') + vlog.warning('There are negative FlowAmounts') return df @@ -662,9 +654,9 @@ def compare_FBS_results(fbs1, fbs2, ignore_metasources=False, lambda x: round(abs(x), 2) != 0)].reset_index(drop=True) # if no differences, print, if differences, provide df subset if len(df_m) == 0: - vLog.debug('No differences between dataframes') + vlog.debug('No differences between dataframes') else: - vLog.debug('Differences exist between dataframes') + vlog.debug('Differences exist between dataframes') df_m = df_m.sort_values(['Location', 'SectorProducedBy', 'SectorConsumedBy', 'Flowable', 'Context', ]).reset_index(drop=True) @@ -740,15 +732,14 @@ def compare_geographic_totals( subnational_geoscale = (subnational_geoscale or attr['allocation_from_scale']) if len(df_m_sub) == 0: - vLog.info('No data loss greater than 1%% between national ' - 'level data and %s subset', - subnational_geoscale) + vlog.info(f'No data loss greater than 1%% between national ' + f'level data and {subnational_geoscale} subset') else: - vLog.info('There are data differences between published national' - ' values and %s subset, saving to validation log', - subnational_geoscale) + vlog.info(f'There are data differences between published national ' + f'values and {subnational_geoscale} subset, ' + f'saving to validation log') - vLogDetailed.info( + vlog.info( 'Comparison of National FlowAmounts to aggregated data ' 'subset for %s: \n {}'.format( df_m_sub.to_string()), activity_set) From ccffb7656994ceafdb4395cc1ee74a76a22ba06d Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 26 Apr 2023 11:52:31 -0600 Subject: [PATCH 0519/1127] update industry_spec formatting --- .../flowbysectormethods/BEA_summary_target.yaml | 3 +-- .../Food_Waste_national_2018_m1.yaml | 3 +-- .../Food_Waste_national_2018_m2.yaml | 3 +-- .../flowbysectormethods/SEEA_2016_v1.yaml | 3 +-- .../flowbysectormethods/SEEA_2017_kg_v1.yaml | 3 +-- .../flowbysectormethods/SEEA_2017_v1.yaml | 3 +-- .../flowbysectormethods/SEEA_2017_v2.yaml | 3 +-- .../USEEIO_summary_target.yaml | 4 +--- .../Water_national_2015_m1.yaml | 16 ++++------------ 9 files changed, 12 insertions(+), 29 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/BEA_summary_target.yaml b/flowsa/methods/flowbysectormethods/BEA_summary_target.yaml index a1053b6c6..d391a941d 100644 --- a/flowsa/methods/flowbysectormethods/BEA_summary_target.yaml +++ b/flowsa/methods/flowbysectormethods/BEA_summary_target.yaml @@ -8,8 +8,7 @@ industry_spec: default: NAICS_3 - '336': {default: NAICS_4} - '541': {default: NAICS_4} + NAICS_4: ['336', '541'] # Note 531, 532, 533, and 92* are not resolved at the 3 digit NAICS # but they do not resolve at higher resolution and so using 3-digit NAICS # is sufficient diff --git a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m1.yaml b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m1.yaml index 5a63d2403..78e0c5f48 100644 --- a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m1.yaml @@ -3,8 +3,7 @@ industry_spec: default: NAICS_6 - '562212': { default: NAICS_7 } - '562219': { default: NAICS_7 } + NAICS_7: ['562212', '562219'] year: 2018 target_naics_year: 2012 geoscale: national diff --git a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml index 26aaf83f4..2067d0a6f 100644 --- a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml +++ b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml @@ -3,8 +3,7 @@ industry_spec: default: NAICS_6 - '562212': { default: NAICS_7 } - '562219': { default: NAICS_7 } + NAICS_7: ['562212', '562219'] year: 2018 target_naics_year: 2012 geoscale: national diff --git a/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml index 5774f8189..6f0a99203 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml @@ -8,8 +8,7 @@ # !include:BEA_summary_target.yaml industry_spec: default: NAICS_3 - '336': {default: NAICS_4} - '541': {default: NAICS_4} + NAICS_4: ['336', '541'] # industry_spec: # default: NAICS_4 target_naics_year: 2012 diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml index 400c6a982..de4e01366 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml @@ -8,8 +8,7 @@ # !include:BEA_summary_target.yaml industry_spec: default: NAICS_3 - '336': {default: NAICS_4} - '541': {default: NAICS_4} + NAICS_4: ['336', '541'] # industry_spec: # default: NAICS_4 target_naics_year: 2012 diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml index a828b84b6..998045cbe 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml @@ -8,8 +8,7 @@ # !include:BEA_summary_target.yaml industry_spec: default: NAICS_3 - '336': {default: NAICS_4} - '541': {default: NAICS_4} + NAICS_4: ['336', '541'] non_naics: ACC # industry_spec: # default: NAICS_4 diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml index 09c1f5dfb..01306a5b9 100644 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml +++ b/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml @@ -4,8 +4,7 @@ # !include:BEA_summary_target.yaml industry_spec: default: NAICS_3 - '336': {default: NAICS_4} - '541': {default: NAICS_4} + NAICS_4: ['336', '541'] non_naics: ACC year: &year 2017 # industry_spec: diff --git a/flowsa/methods/flowbysectormethods/USEEIO_summary_target.yaml b/flowsa/methods/flowbysectormethods/USEEIO_summary_target.yaml index 2aba5703b..15dca4c73 100644 --- a/flowsa/methods/flowbysectormethods/USEEIO_summary_target.yaml +++ b/flowsa/methods/flowbysectormethods/USEEIO_summary_target.yaml @@ -8,9 +8,7 @@ industry_spec: default: NAICS_3 - '221': {default: NAICS_4} - '336': {default: NAICS_4} - '541': {default: NAICS_4} + NAICS_4: ['221', '336', '541'] # In USEEIO models 221 (Utilities) is disaggregated to 2211, 2212, and 2213 # '336' and '541' carry over from the BEA summary sectors target_naics_year: 2012 diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index fb48d4b2e..e42eed4d1 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -35,8 +35,7 @@ source_names: cropland_attribution: industry_spec: default: NAICS_6 - '111150': { default: NAICS_7 } - '111199': { default: NAICS_7 } + NAICS_7: ['111150', '111199'] selection_fields: PrimaryActivity: - "Irrigation Crop" @@ -125,9 +124,7 @@ source_names: USDA_IWMS: industry_spec: default: NAICS_6 - '111150': { default: NAICS_7 } - '111199': { default: NAICS_7 } - '111940': { default: NAICS_7 } # hay and haylage set to NAICS7 - will update to NAICS6 + NAICS_7: ['111150', '111199', '111940'] # hay and haylage set to NAICS7 - will update to NAICS6 <<: *usda_iwms activity_sets: cropland_attribution-cropland-nonhay: @@ -159,13 +156,8 @@ source_names: livestock_attribution: industry_spec: default: NAICS_6 - '112130': { default: NAICS_7 } - '112320': { default: NAICS_7 } - '112390': { default: NAICS_7 } - '112910': { default: NAICS_7 } - '112920': { default: NAICS_7 } - '112930': { default: NAICS_7 } - '112990': { default: NAICS_7 } + NAICS_7: ['112130', '112320', '112390', '112910', + '112920', '112930', '112990'] selection_fields: PrimaryActivity: - "Livestock" From 95740b5742f01310b23e4718f9809d3d01f05a0d Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 26 Apr 2023 11:53:59 -0600 Subject: [PATCH 0520/1127] update industry_spec_key() so it is not based on the string length of the sectors --- flowsa/naics.py | 112 ++++++++++++++++-------------------------------- 1 file changed, 37 insertions(+), 75 deletions(-) diff --git a/flowsa/naics.py b/flowsa/naics.py index fedc36084..7d96a5694 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -1,9 +1,10 @@ from typing import Literal +import numpy as np import pandas as pd from . import settings naics_crosswalk = pd.read_csv( - f'{settings.datapath}NAICS_Crosswalk_TimeSeries.csv', dtype='object' + f'{settings.datapath}NAICS_2012_Crosswalk.csv', dtype='object' ) @@ -11,7 +12,7 @@ def industry_spec_key( industry_spec: dict, year: Literal[2002, 2007, 2012, 2017] = 2012 ) -> pd.DataFrame: - ''' + """ Provides a key for mapping any set of NAICS codes to a given industry breakdown, specified in industry_spec. The key is a DataFrame with columns 'source_naics' and 'target_naics'; it is 1-to-many for any NAICS codes @@ -22,9 +23,8 @@ def industry_spec_key( example: industry_spec = {'default': 'NAICS_3', - '112': {'default': 'NAICS_4', - '1129': {'default': 'NAICS_6'}}, - '113': {'default': 'NAICS_4'}} + 'NAICS_4': ['112', '113'], + 'NAICS_6': ['1129'] This example specification would map any set of NAICS codes to the 3-digit level, except that codes in 112 and 113 would be mapped to the 4-digit @@ -44,77 +44,39 @@ def industry_spec_key( then any non-default keys must be NAICS codes with exactly 3 digits). 3. Each dictionary is applied only to those codes matching its parent key (with the root dictionary being applied to all codes). - ''' - naics_list = (naics_crosswalk - [[f'NAICS_{year}_Code']] - .rename(columns={f'NAICS_{year}_Code': 'source_naics'})) - - def _truncate( - _naics_list: pd.DataFrame, - _industry_spec: dict - ) -> pd.DataFrame: - ''' - Find target NAICS by truncating any source_naics longer than the target - _naics_level unless industry_spec specifies a longer level for it, in - which case send it (recursively) into this function to be truncated to - the correct length. - ''' - _naics_level = int(_industry_spec['default'][-1:]) - return pd.concat([ - (_naics_list - .query('source_naics.str.len() >= @_naics_level' - '& source_naics.str.slice(stop=@_naics_level) ' - 'not in @_industry_spec') - .assign(target_naics=lambda x: x.source_naics.str[:_naics_level]) - ), - *[ - _truncate( - (_naics_list - .query('source_naics.str.startswith(@naics)')), - _industry_spec[naics] - ) - for naics in _industry_spec if naics not in ['default', - 'non_naics'] - ] - ]) - - truncated_naics_list = _truncate(naics_list, industry_spec) - - naics_list = naics_list.merge(truncated_naics_list, how='left') + """ + + naics = naics_crosswalk.assign( + target_naics=naics_crosswalk[industry_spec['default']]) + for k, v in industry_spec.items(): + if k not in ['default', 'non_naics']: + for sector in v: + # find column index where sector is located + col = np.where(naics == sector)[1][0] + + naics['target_naics'] = np.where( + naics[naics.columns[col]] == sector, + naics[k], + naics['target_naics']) + + # melt the dataframe to include source naics + naics_key = naics.melt(id_vars="target_naics", value_name="source_naics") + # add user-specified non-naics _non_naics = industry_spec.get('non_naics', []) - - naics_key = pd.concat([ - naics_list.query('target_naics.notna()'), - *[ - (naics_list - .query('target_naics.isna()' - '& source_naics.str.len() == @length') - .drop(columns='target_naics') - .merge( - truncated_naics_list - .assign( - merge_key=truncated_naics_list.target_naics.str[:length]) - [['merge_key', 'target_naics']], - how='left', - left_on='source_naics', - right_on='merge_key') - .drop(columns='merge_key') - ) - for length in (naics_list.query('target_naics.isna()') - .source_naics.str.len().unique()) - ], - pd.DataFrame( - {'source_naics': _non_naics, 'target_naics': _non_naics}, - index=[0] if isinstance(_non_naics, str) else None - ) - ]) - - naics_key = ( - naics_key - .drop_duplicates() - .sort_values(by=['source_naics', 'target_naics']) - .reset_index(drop=True) - ) + naics_key = pd.concat([naics_key, + pd.DataFrame({'source_naics': _non_naics, + 'target_naics': _non_naics}, + index=[0] if + isinstance(_non_naics, str) + else None) + ]) + # drop source_naics that are more aggregated than target_naics, reorder + naics_key = (naics_key[['source_naics', 'target_naics']] + .dropna() + .drop_duplicates() + .sort_values(by=['source_naics', 'target_naics']) + .reset_index(drop=True) + ) return naics_key From b36ee10a20dcf6e67f87a0f64da9a8137d7c6a12 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 26 Apr 2023 11:54:24 -0600 Subject: [PATCH 0521/1127] drop comments in sector_aggregation() --- flowsa/flowby.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index ab146d5c4..792004023 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -2046,21 +2046,13 @@ def sector_aggregation(self): :return: """ naics_key = naics.industry_spec_key(self.config['industry_spec']) - # TODO fix error here causing special sectors (e.g. F010) to drop - # when doing a summary model because lenght does not align (target_naics) - # does not have the right number of digits - - # subset naics to those where the source_naics string length is longer - # than target_naics - naics_key_sub = naics_key.query( - 'source_naics.str.len() >= target_naics.str.len()') fbs = self for direction in ['ProducedBy', 'ConsumedBy']: fbs = ( fbs .rename(columns={f'Sector{direction}': 'source_naics'}) - .merge(naics_key_sub, + .merge(naics_key, how='left') .rename(columns={'target_naics': f'Sector{direction}'}) .drop(columns='source_naics') From 604702578c67180d2b8777575306a225a3daf720 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 26 Apr 2023 15:21:01 -0600 Subject: [PATCH 0522/1127] revise exclusion_fields to work for conditional situation based on multiple columns --- .../data_source_scripts/USDA_CoA_Cropland.py | 24 ------------------- flowsa/flowby.py | 7 +++++- .../Land_national_2012.yaml | 5 +++- 3 files changed, 10 insertions(+), 26 deletions(-) diff --git a/flowsa/data_source_scripts/USDA_CoA_Cropland.py b/flowsa/data_source_scripts/USDA_CoA_Cropland.py index 7737890aa..f2954a75b 100644 --- a/flowsa/data_source_scripts/USDA_CoA_Cropland.py +++ b/flowsa/data_source_scripts/USDA_CoA_Cropland.py @@ -247,30 +247,6 @@ def coa_cropland_parse(*, df_list, year, **_): return df -def coa_nonirrigated_cropland_fba_cleanup(fba, **kwargs): - """ - Cleanup coa cropland data for nonirrigated crops - :param fba: df, COA when using non-irrigated data - :return: df, COA nonirrigated data, modified - """ - - # when include 'area harvested' and 'area in production' in - # single dataframe, which is necessary to include woody crops, - # 'vegetable totals' are double counted - fba = fba[~((fba['Flowable'] == 'AREA IN PRODUCTION') & - (fba['ActivityConsumedBy'] == 'VEGETABLE TOTALS'))] - - # When using a mix of flow names, drop activities for ag land (naics 11) - # and ag land, cropland, harvested (naics 111),because published values - # for harvested cropland do not include data for vegetables, woody crops, - # berries. Values for sectors 11 and 111 will be aggregated from the - # dataframe later - fba = fba[~fba['ActivityConsumedBy'].isin( - ['AG LAND', 'AG LAND, CROPLAND, HARVESTED'])].reset_index(drop=True) - - return fba - - def disaggregate_coa_cropland_to_6_digit_naics( fba_w_sector, attr, method, **kwargs): """ diff --git a/flowsa/flowby.py b/flowsa/flowby.py index ab146d5c4..3da575880 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -449,7 +449,12 @@ def select_by_fields(self: FB, selection_fields: dict = None) -> FB: exclusion_fields = {k: [v] if not isinstance(v, (list, dict)) else v for k, v in exclusion_fields.items()} for field, values in exclusion_fields.items(): - self = self.query(f'{field} not in @values') + if field == 'conditional': + qry = ' and '.join(["{} == '{}'".format(k, v) for k, v in + exclusion_fields['conditional'].items()]) + self = self.query(f'~({qry})') + else: + self = self.query(f'{field} not in @values') selection_fields = (selection_fields or self.config.get('selection_fields')) diff --git a/flowsa/methods/flowbysectormethods/Land_national_2012.yaml b/flowsa/methods/flowbysectormethods/Land_national_2012.yaml index 19b06d33e..a1e2e69e3 100644 --- a/flowsa/methods/flowbysectormethods/Land_national_2012.yaml +++ b/flowsa/methods/flowbysectormethods/Land_national_2012.yaml @@ -88,7 +88,10 @@ source_names: - 'AREA BEARING & NON-BEARING' - 'AREA GROWN' Location: !include:Location_common.yaml:_state_location - clean_fba: !script_function:USDA_CoA_Cropland coa_nonirrigated_cropland_fba_cleanup + exclusion_fields: + conditional: {FlowName: 'AREA IN PRODUCTION', + ActivityConsumedBy: 'VEGETABLE TOTALS'} + ActivityConsumedBy: ['AG LAND', 'AG LAND, CROPLAND, HARVESTED'] attribution_method: proportional attribution_source: USDA_CoA_Cropland_NAICS: From 876c62417b181cd555d9d91772bbb942d71139b7 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 26 Apr 2023 22:10:08 -0400 Subject: [PATCH 0523/1127] pass exclusion_fields from activity_sets; uses lists in exclusion query --- flowsa/flowby.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 3da575880..fbe6aa42f 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -404,7 +404,11 @@ def convert_fips_to_geoscale( else: log.error(f'No FIPS level corresponds to {target_geoscale}') - def select_by_fields(self: FB, selection_fields: dict = None) -> FB: + def select_by_fields( + self: FB, + selection_fields: dict = None, + exclusion_fields: dict = None + ) -> FB: ''' Filter the calling FlowBy dataset according to the 'selection_fields' dictionary from the calling datasets config dictionary. If such a @@ -445,13 +449,17 @@ def select_by_fields(self: FB, selection_fields: dict = None) -> FB: Similarly, can use 'exclusion_fields' to remove particular data in the same manner. ''' - exclusion_fields = self.config.get('exclusion_fields', {}) + exclusion_fields = (exclusion_fields or + self.config.get('exclusion_fields', {})) exclusion_fields = {k: [v] if not isinstance(v, (list, dict)) else v for k, v in exclusion_fields.items()} for field, values in exclusion_fields.items(): if field == 'conditional': - qry = ' and '.join(["{} == '{}'".format(k, v) for k, v in - exclusion_fields['conditional'].items()]) + qry = ' & '.join( + ["({} in {})".format( + k, [v] if not isinstance(v, (list,dict)) else v) + for k, v in exclusion_fields['conditional'].items()] + ) self = self.query(f'~({qry})') else: self = self.query(f'{field} not in @values') @@ -1771,7 +1779,8 @@ def activity_sets(self) -> List['FlowByActivity']: .add_full_name( f'{parent_fba.full_name}{NAME_SEP_CHAR}{activity_set}') .select_by_fields( - selection_fields=activity_config.get('selection_fields')) + selection_fields=activity_config.get('selection_fields'), + exclusion_fields=activity_config.get('exclusion_fields')) ) child_fba.config = {**parent_config, **activity_config} From cc2146d05c2d325c92044e8e42107cba1d3e6990 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 26 Apr 2023 22:10:54 -0400 Subject: [PATCH 0524/1127] drop pesticides from NEI dataset using exclusion fields --- flowsa/data_source_scripts/EPA_NEI.py | 31 ------------------- .../CAP_HAP_national_2017.yaml | 12 ++++++- .../CAP_HAP_state_2017.yaml | 12 ++++++- 3 files changed, 22 insertions(+), 33 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_NEI.py b/flowsa/data_source_scripts/EPA_NEI.py index 00d08ef0d..062739d10 100644 --- a/flowsa/data_source_scripts/EPA_NEI.py +++ b/flowsa/data_source_scripts/EPA_NEI.py @@ -183,37 +183,6 @@ def clean_NEI_fba(fba: FlowByActivity, **_) -> FlowByActivity: return fba -def drop_pesticides(df): - """ - To avoid overlap with other datasets, emissions of pesticides - from pesticide application are removed. - :param df: df, FBA format - :return: df - """ - # Flow names reflect source data prior to FEDEFL mapping, using 'FlowName' - # instead of 'Flowable' - flowlist = [ - '2,4-Dichlorophenoxy Acetic Acid', - 'Captan', - 'Carbaryl', - 'Methyl Bromide', - 'Methyl Iodide', - 'Parathion', - 'Trifluralin', - ] - - activity_list = [ - '2461800001', - '2461800002', - '2461850000', - ] - - df = df.loc[~(df['FlowName'].isin(flowlist) & - df['ActivityProducedBy'].isin(activity_list))] - - return df - - def remove_flow_overlap(df, aggregate_flow, contributing_flows): """ Quantity of contributing flows is subtracted from aggregate flow and the diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index 3547690a1..bee044b65 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -182,9 +182,19 @@ source_names: ActivityProducedBy: {'325310': ''} # Fertilizers pesticides: - clean_fba_before_mapping: !script_function:EPA_NEI drop_pesticides selection_fields: PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv pesticides + exclusion_fields: + # To avoid overlap with other datasets, emissions of pesticides + # from pesticide application are removed. + FlowName: + - 2,4-Dichlorophenoxy Acetic Acid + - Captan + - Carbaryl + - Methyl Bromide + - Methyl Iodide + - Parathion + - Trifluralin attribution_method: proportional attribution_source: BEA_Use_Detail_PRO_BeforeRedef: diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml index c15de32f3..18df90431 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml @@ -197,9 +197,19 @@ source_names: ActivityProducedBy: {'325': ''} # Fertilizers 325310 pesticides: - clean_fba_before_mapping: !script_function:EPA_NEI drop_pesticides selection_fields: PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv pesticides + exclusion_fields: + # To avoid overlap with other datasets, emissions of pesticides + # from pesticide application are removed. + FlowName: + - 2,4-Dichlorophenoxy Acetic Acid + - Captan + - Carbaryl + - Methyl Bromide + - Methyl Iodide + - Parathion + - Trifluralin attribution_method: proportional attribution_source: stateio_Use_Summary: From 8706fd0eff682493ed7b6683d760be7517fda236 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 27 Apr 2023 13:23:44 -0400 Subject: [PATCH 0525/1127] Minor tweaks + can now specify a list of non-NAICS codes if needed --- flowsa/naics.py | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/flowsa/naics.py b/flowsa/naics.py index 7d96a5694..85c8c1990 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -3,10 +3,6 @@ import pandas as pd from . import settings -naics_crosswalk = pd.read_csv( - f'{settings.datapath}NAICS_2012_Crosswalk.csv', dtype='object' -) - def industry_spec_key( industry_spec: dict, @@ -45,31 +41,31 @@ def industry_spec_key( 3. Each dictionary is applied only to those codes matching its parent key (with the root dictionary being applied to all codes). """ + naics_crosswalk = pd.read_csv( + f'{settings.datapath}NAICS_2012_Crosswalk.csv', dtype='object' + ) naics = naics_crosswalk.assign( target_naics=naics_crosswalk[industry_spec['default']]) for k, v in industry_spec.items(): if k not in ['default', 'non_naics']: - for sector in v: - # find column index where sector is located - col = np.where(naics == sector)[1][0] - - naics['target_naics'] = np.where( - naics[naics.columns[col]] == sector, - naics[k], - naics['target_naics']) - + naics = naics.assign( + target_naics=naics.target_naics.mask( + naics.drop(columns='target_naics').isin(v).any(axis='columns'), + naics[k] + ) + ) # melt the dataframe to include source naics naics_key = naics.melt(id_vars="target_naics", value_name="source_naics") # add user-specified non-naics - _non_naics = industry_spec.get('non_naics', []) - naics_key = pd.concat([naics_key, - pd.DataFrame({'source_naics': _non_naics, - 'target_naics': _non_naics}, - index=[0] if - isinstance(_non_naics, str) - else None) - ]) + if 'non_naics' in industry_spec: + non_naics = industry_spec['non_naics'] + if isinstance(non_naics, str): + non_naics = [non_naics] + naics_key = pd.concat([naics_key, + pd.DataFrame({'source_naics': non_naics, + 'target_naics': non_naics})]) + # drop source_naics that are more aggregated than target_naics, reorder naics_key = (naics_key[['source_naics', 'target_naics']] .dropna() From 834e10879b5917f93dfaf0471f09979d81114ecb Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 27 Apr 2023 13:29:01 -0400 Subject: [PATCH 0526/1127] Tweaked tweaks from previous commit --- flowsa/naics.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/flowsa/naics.py b/flowsa/naics.py index 85c8c1990..9bb2e0ce2 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -47,13 +47,11 @@ def industry_spec_key( naics = naics_crosswalk.assign( target_naics=naics_crosswalk[industry_spec['default']]) - for k, v in industry_spec.items(): - if k not in ['default', 'non_naics']: - naics = naics.assign( - target_naics=naics.target_naics.mask( - naics.drop(columns='target_naics').isin(v).any(axis='columns'), - naics[k] - ) + for level, industries in industry_spec.items(): + if level not in ['default', 'non_naics']: + naics['target_naics'] = naics['target_naics'].mask( + naics.drop(columns='target_naics').isin(industries).any(axis='columns'), + naics[level] ) # melt the dataframe to include source naics naics_key = naics.melt(id_vars="target_naics", value_name="source_naics") From eaf215d7a8b5c10a098bd933dc3717171b3add69 Mon Sep 17 00:00:00 2001 From: matthewlchambers Date: Thu, 27 Apr 2023 13:33:04 -0400 Subject: [PATCH 0527/1127] Moved naics_crosswalk back outside the industry_spec_key function --- flowsa/naics.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/flowsa/naics.py b/flowsa/naics.py index 9bb2e0ce2..5389e75c0 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -3,6 +3,10 @@ import pandas as pd from . import settings +naics_crosswalk = pd.read_csv( + f'{settings.datapath}NAICS_2012_Crosswalk.csv', dtype='object' +) + def industry_spec_key( industry_spec: dict, @@ -41,9 +45,6 @@ def industry_spec_key( 3. Each dictionary is applied only to those codes matching its parent key (with the root dictionary being applied to all codes). """ - naics_crosswalk = pd.read_csv( - f'{settings.datapath}NAICS_2012_Crosswalk.csv', dtype='object' - ) naics = naics_crosswalk.assign( target_naics=naics_crosswalk[industry_spec['default']]) From d90ec9b1e5b34693a1d2d09a82059304dd0f7303 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 27 Apr 2023 16:33:40 -0400 Subject: [PATCH 0528/1127] refactor for pathlib --- flowsa/location.py | 6 ++--- flowsa/settings.py | 61 +++++++++++++++++++++------------------------- setup.py | 6 ++--- 3 files changed, 34 insertions(+), 39 deletions(-) diff --git a/flowsa/location.py b/flowsa/location.py index 607370fb4..2d1fba9f6 100644 --- a/flowsa/location.py +++ b/flowsa/location.py @@ -28,7 +28,7 @@ def read_stored_FIPS(year='2015'): :return: df, FIPS for specified year """ - FIPS_df = pd.read_csv(datapath + "FIPS_Crosswalk.csv", header=0, dtype=str) + FIPS_df = pd.read_csv(datapath / "FIPS_Crosswalk.csv", header=0, dtype=str) # subset columns by specified year df = FIPS_df[["State", "FIPS_" + year, "County_" + year]] # rename columns to drop data year @@ -314,7 +314,7 @@ def merge_urb_cnty_pct(df): return None years_xwalk = extract_fips_years( # from xwalk headers - pd.read_csv(datapath + 'FIPS_Crosswalk.csv', nrows=0).columns) + pd.read_csv(datapath / 'FIPS_Crosswalk.csv', nrows=0).columns) if not {year} <= set(years_xwalk): # compare data years as sets log.error('LocationSystem incompatible with FIPS_Crosswalk.csv') @@ -397,7 +397,7 @@ def shift_census_cnty_tbl(df, year): # i.e., join by ['FIPS_{decade}'] field ensures pct_pop_urb inheritance # merges identified by duplicated 'FIPS_{year}' codes (A-->C, B-->C) # e.g., 51019 & 51515 --> 51019 - fips_xwalk = pd.read_csv(datapath + 'FIPS_Crosswalk.csv', dtype=str, + fips_xwalk = pd.read_csv(datapath / 'FIPS_Crosswalk.csv', dtype=str, usecols=[f'FIPS_{decade}', f'FIPS_{year}']) df = pd.merge(df, fips_xwalk, how='left', on=f'FIPS_{decade}') diff --git a/flowsa/settings.py b/flowsa/settings.py index 296c5815f..225815048 100644 --- a/flowsa/settings.py +++ b/flowsa/settings.py @@ -4,51 +4,46 @@ import subprocess from importlib.metadata import version from pathlib import Path -from esupy.processed_data_mgmt import Paths, create_paths_if_missing +from esupy.processed_data_mgmt import Paths, mkdir_if_missing from esupy.util import get_git_hash -try: - MODULEPATH = \ - os.path.dirname(os.path.realpath(__file__)).replace('\\', '/') + '/' -except NameError: - MODULEPATH = 'flowsa/' -datapath = MODULEPATH + 'data/' -crosswalkpath = datapath + 'activitytosectormapping/' -externaldatapath = datapath + 'external_data/' -process_adjustmentpath = datapath + 'process_adjustments/' +MODULEPATH = Path(__file__).resolve().parent -methodpath = MODULEPATH + 'methods/' -sourceconfigpath = methodpath + 'flowbyactivitymethods/' -flowbysectormethodpath = methodpath + 'flowbysectormethods/' -flowbysectoractivitysetspath = methodpath + 'flowbysectoractivitysets/' +datapath = MODULEPATH / 'data' +crosswalkpath = datapath / 'activitytosectormapping' +externaldatapath = datapath / 'external_data' +process_adjustmentpath = datapath / 'process_adjustments' -datasourcescriptspath = MODULEPATH + 'data_source_scripts/' +methodpath = MODULEPATH / 'methods' +sourceconfigpath = methodpath / 'flowbyactivitymethods' +flowbysectormethodpath = methodpath / 'flowbysectormethods' +flowbysectoractivitysetspath = methodpath / 'flowbysectoractivitysets' + +datasourcescriptspath = MODULEPATH / 'data_source_scripts' # "Paths()" are a class defined in esupy paths = Paths() -paths.local_path = os.path.realpath(paths.local_path + "/flowsa") -outputpath = paths.local_path.replace('\\', '/') + '/' -fbaoutputpath = outputpath + 'FlowByActivity/' -fbsoutputpath = outputpath + 'FlowBySector/' -biboutputpath = outputpath + 'Bibliography/' -logoutputpath = outputpath + 'Log/' -diffpath = outputpath + 'FBSComparisons/' -plotoutputpath = outputpath + 'Plots/' -tableoutputpath = outputpath + 'DisplayTables/' +paths.local_path = paths.local_path / 'flowsa' +outputpath = paths.local_path +fbaoutputpath = outputpath / 'FlowByActivity' +fbsoutputpath = outputpath / 'FlowBySector' +biboutputpath = outputpath / 'Bibliography' +logoutputpath = outputpath / 'Log' +diffpath = outputpath / 'FBSComparisons' +plotoutputpath = outputpath / 'Plots' +tableoutputpath = outputpath / 'DisplayTables' # ensure directories exist -create_paths_if_missing(logoutputpath) -create_paths_if_missing(plotoutputpath) -create_paths_if_missing(tableoutputpath) +mkdir_if_missing(logoutputpath) +mkdir_if_missing(plotoutputpath) +mkdir_if_missing(tableoutputpath) DEFAULT_DOWNLOAD_IF_MISSING = False # paths to scripts -scriptpath = \ - os.path.dirname(os.path.dirname(os.path.abspath(__file__)) - ).replace('\\', '/') + '/scripts/' -scriptsFBApath = scriptpath + 'FlowByActivity_Datasets/' +scriptpath = MODULEPATH.parent / 'scripts' +scriptsFBApath = scriptpath / 'FlowByActivity_Datasets' # define 4 logs, one for general information, one for major validation # logs that are also included in the general info log, one for very specific @@ -77,11 +72,11 @@ # create handlers # create handler for overall logger -log_fh = logging.FileHandler(logoutputpath + 'flowsa.log', +log_fh = logging.FileHandler(logoutputpath / 'flowsa.log', mode='w', encoding='utf-8') log_fh.setFormatter(formatter) # create handler for general validation information -vLog_fh = logging.FileHandler(logoutputpath + 'validation_flowsa.log', +vLog_fh = logging.FileHandler(logoutputpath / 'validation_flowsa.log', mode='w', encoding='utf-8') vLog_fh.setFormatter(formatter) # create console handler diff --git a/setup.py b/setup.py index 662367452..9c93d737d 100644 --- a/setup.py +++ b/setup.py @@ -12,9 +12,9 @@ include_package_data=True, python_requires=">=3.8", install_requires=[ - 'fedelemflowlist @ git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git@develop#egg=fedelemflowlist', - 'esupy @ git+https://github.com/USEPA/esupy.git@develop#egg=esupy', - 'StEWI @ git+https://github.com/USEPA/standardizedinventories.git@develop#egg=StEWI', + 'fedelemflowlist @ git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git@path_refactor#egg=fedelemflowlist', + 'esupy @ git+https://github.com/USEPA/esupy.git@refactor_pathlib#egg=esupy', + 'StEWI @ git+https://github.com/USEPA/standardizedinventories.git@urban_rural_classify#egg=StEWI', 'appdirs>=1.4.3', 'bibtexparser>=1.2.0', "kaleido==0.1.0.post1;platform_system=='Windows'", From 92308613780f8274180e207dd9b29432d2d3dd60 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 28 Apr 2023 08:23:32 -0600 Subject: [PATCH 0529/1127] update package version to 2.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 662367452..e372f931f 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name='flowsa', - version='1.3.1', + version='2.0.0', packages=find_packages(), package_dir={'flowsa': 'flowsa'}, include_package_data=True, From 98e359510679211d3b5d6da69413a6abe1f6f0e7 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 28 Apr 2023 12:06:25 -0600 Subject: [PATCH 0530/1127] finalize land FBS recursive method --- flowsa/data_source_scripts/USDA_ERS_MLU.py | 50 +++++++------- .../Land_national_2012.yaml | 66 +++++++++---------- 2 files changed, 52 insertions(+), 64 deletions(-) diff --git a/flowsa/data_source_scripts/USDA_ERS_MLU.py b/flowsa/data_source_scripts/USDA_ERS_MLU.py index 4e259f163..857ed2598 100644 --- a/flowsa/data_source_scripts/USDA_ERS_MLU.py +++ b/flowsa/data_source_scripts/USDA_ERS_MLU.py @@ -22,6 +22,7 @@ get_urban_land_use_for_airports, \ get_urban_land_use_for_railroads, get_open_space_fraction_of_urban_area from flowsa.validation import compare_df_units +from flowsa.flowby import FlowByActivity def mlu_call(*, resp, **_): @@ -83,8 +84,8 @@ def mlu_parse(*, df_list, source, year, **_): return dfm3 -def allocate_usda_ers_mlu_land_in_urban_areas(*, flow_subset_mapped, - fbs_list, **_): +def allocate_usda_ers_mlu_land_in_urban_areas( + fba: FlowByActivity, **_) -> FlowByActivity: """ This function is used to allocate the USDA_ERS_MLU activity 'land in urban areas' to NAICS 2012 sectors. Allocation is dependent on @@ -106,8 +107,6 @@ def allocate_usda_ers_mlu_land_in_urban_areas(*, flow_subset_mapped, :return: df, allocated USDS ERS MLU Land, FBS format """ - df = flow_subset_mapped.copy() - # define sector column to base calculations sector_col = 'SectorConsumedBy' @@ -115,11 +114,8 @@ def allocate_usda_ers_mlu_land_in_urban_areas(*, flow_subset_mapped, 'in urban land area, so subtracting out calculated ' 'MECS and CBECS land from MLU urban land area') # read in the cbecs and mecs df from df_list - for df_i in fbs_list: - if (df_i['MetaSources'] == 'EIA_CBECS_Land').all(): - cbecs = df_i - elif (df_i['MetaSources'] == 'EIA_MECS_Land').all(): - mecs = df_i + cbecs = _['attr']['cache']['EIA_CBECS_Land'] + mecs = _['attr']['cache']['EIA_MECS_Land'] # load the federal highway administration fees dictionary fha_dict = get_transportation_sectors_based_on_FHA_fees() @@ -129,12 +125,12 @@ def allocate_usda_ers_mlu_land_in_urban_areas(*, flow_subset_mapped, # calculate total residential area from the American Housing Survey residential_land_area = get_area_of_urban_land_occupied_by_houses_2013() - df_residential = df[df[sector_col] == 'F01000'] + df_residential = fba[fba[sector_col] == 'F01000'] df_residential = df_residential.assign(FlowAmount=residential_land_area) # make an assumption about the percent of urban area that is open space openspace_multiplier = get_open_space_fraction_of_urban_area() - df_openspace = df[df[sector_col] == '712190'] + df_openspace = fba[fba[sector_col] == '712190'] df_openspace = df_openspace.assign( FlowAmount=df_openspace['FlowAmount'] * openspace_multiplier) @@ -150,10 +146,10 @@ def allocate_usda_ers_mlu_land_in_urban_areas(*, flow_subset_mapped, ['Location', 'Unit'], as_index=False).agg( {'FlowAmount': sum}).rename(columns={'FlowAmount': 'NonTransport'}) # compare units - compare_df_units(df, df_non_urban_transport_area) + compare_df_units(fba, df_non_urban_transport_area) # calculate total urban transportation by subtracting # calculated areas from total urban land - df_transport = df.merge(non_urban_transport_area_sum, how='left') + df_transport = fba.merge(non_urban_transport_area_sum, how='left') df_transport = df_transport.assign( FlowAmount=df_transport['FlowAmount'] - df_transport['NonTransport']) df_transport.drop(columns=['NonTransport'], inplace=True) @@ -200,15 +196,15 @@ def allocate_usda_ers_mlu_land_in_urban_areas(*, flow_subset_mapped, # aggregate because multiple rows to household data due to residential # land area and highway fee shares - groupcols = list(df.select_dtypes(include=['object', 'int']).columns) - allocated_urban_areas_df_2 = aggregator(allocated_urban_areas_df, - groupcols) + allocated_urban_areas_df_2 = allocated_urban_areas_df.aggregate_flowby() + allocated_urban_areas_df_2 = allocated_urban_areas_df_2.assign( + group_id=allocated_urban_areas_df_2.index.astype(str)) return allocated_urban_areas_df_2 def allocate_usda_ers_mlu_land_in_rural_transportation_areas( - *, flow_subset_mapped, **_): + fba: FlowByActivity, **_) -> FlowByActivity: """ This function is used to allocate the USDA_ERS_MLU activity 'land in urban areas' to NAICS 2012 sectors. Allocation @@ -229,8 +225,6 @@ def allocate_usda_ers_mlu_land_in_rural_transportation_areas( :return: df, allocated USDS ERS MLU Land, FBS format """ - df = flow_subset_mapped.copy() - # define sector column to base calculations sector_col = 'SectorConsumedBy' @@ -242,14 +236,14 @@ def allocate_usda_ers_mlu_land_in_rural_transportation_areas( # make an assumption about the percent of rural transport # area used by airports airport_multiplier = get_urban_land_use_for_airports() - df_airport = df[df[sector_col] == '488119'] + df_airport = fba[fba[sector_col] == '488119'] df_airport = df_airport.assign( FlowAmount=df_airport['FlowAmount'] * airport_multiplier) # make an assumption about the percent of urban transport # area used by railroads railroad_multiplier = get_urban_land_use_for_railroads() - df_railroad = df[df[sector_col] == '482112'] + df_railroad = fba[fba[sector_col] == '482112'] df_railroad = df_railroad.assign( FlowAmount=df_railroad['FlowAmount'] * railroad_multiplier) @@ -263,8 +257,8 @@ def allocate_usda_ers_mlu_land_in_rural_transportation_areas( {'FlowAmount': sum}).rename(columns={'FlowAmount': 'AirRail'}) # compare units - compare_df_units(df, air_rail_area) - df_highway = df.merge(air_rail_area_sum, how='left') + compare_df_units(fba, air_rail_area) + df_highway = fba.merge(air_rail_area_sum, how='left') df_highway = df_highway.assign( FlowAmount=df_highway['FlowAmount'] - df_highway['AirRail']) df_highway.drop(columns=['AirRail'], inplace=True) @@ -283,7 +277,8 @@ def allocate_usda_ers_mlu_land_in_rural_transportation_areas( return allocated_rural_trans -def allocate_usda_ers_mlu_other_land(*, flow_subset_mapped, **_): +def allocate_usda_ers_mlu_other_land( + fba: FlowByActivity, **_) -> FlowByActivity: """ Function only designed for national model @@ -303,7 +298,6 @@ def allocate_usda_ers_mlu_other_land(*, flow_subset_mapped, **_): set that calls on this fxn :return: df, allocated USDS ERS MLU Land, FBS format """ - df = flow_subset_mapped.copy() # land in rural residential lots rural_res = get_area_of_rural_land_occupied_by_houses_2013() @@ -318,7 +312,7 @@ def allocate_usda_ers_mlu_other_land(*, flow_subset_mapped, **_): 'occupation. All other land area in this category is ' 'unassigned to sectors, resulting in unaccounted land ' 'area.') - df['FlowAmount'] = np.where(df['SectorConsumedBy'].isin(household), - rural_res, df['FlowAmount']) + fba['FlowAmount'] = np.where(fba['SectorConsumedBy'].isin(household), + rural_res, fba['FlowAmount']) - return df + return fba diff --git a/flowsa/methods/flowbysectormethods/Land_national_2012.yaml b/flowsa/methods/flowbysectormethods/Land_national_2012.yaml index a1e2e69e3..3d4ee2f76 100644 --- a/flowsa/methods/flowbysectormethods/Land_national_2012.yaml +++ b/flowsa/methods/flowbysectormethods/Land_national_2012.yaml @@ -9,8 +9,8 @@ year: 2015 target_naics_year: 2012 geoscale: national -source_names: - EIA_CBECS_Land: # commercial land use +sources_to_cache: + EIA_CBECS_Land: &_eia_cbecs_land # commercial land use fedefl_mapping: EIA_CBECS_Land year: 2012 selection_fields: @@ -26,7 +26,7 @@ source_names: Employment_national_2012: data_format: FBS year: 2012 - "EIA_MECS_Land": # manufacturing land use + "EIA_MECS_Land": &_eia_mecs_land # manufacturing land use fedefl_mapping: EIA_MECS_Land year: 2014 selection_fields: @@ -44,6 +44,12 @@ source_names: Employment_national_2014: data_format: FBS year: 2014 + +source_names: + EIA_CBECS_Land: + <<: *_eia_cbecs_land + EIA_MECS_Land: + <<: *_eia_mecs_land "BLM_PLS": fedefl_mapping: BLM_PLS year: 2012 @@ -127,36 +133,24 @@ source_names: - 'Land in defense and industrial areas' - 'Land in rural parks and wildlife areas' attribution_method: direct -# rural_transportation: -# selection_fields: -# PrimaryActivity: -# - 'Land in rural transportation facilities' -# attribution_method: allocation_function -# attribution_source: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_land_in_rural_transportation_areas -# literature_sources: { -# "urban_land_use_for_airports": "2020", -# "urban_land_use_for_railroads": "2020", -# "transportation_sectors_based_on_FHA_fees": "1997"} -# geoscale: national -# urban: -# selection_fields: -# PrimaryActivity: -# - 'Land in urban areas' -# attribution_method: allocation_function -# attribution_source: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_land_in_urban_areas -# literature_sources: { -# "area_of_urban_land_occupied_by_houses_2013": "2017", -# "transportation_sectors_based_on_FHA_fees": "1997", -# "urban_land_use_for_airports": "2020", -# "urban_land_use_for_railroads": "2020", -# "open_space_fraction_of_urban_area": "2020"} -# geoscale: national -# other: -# selection_fields: -# PrimaryActivity: -# - 'Other land' -# attribution_method: allocation_function -# attribution_source: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_other_land -# literature_sources: { -# "area_of_rural_land_occupied_by_houses_2013": "2017" } -# geoscale: national + rural_transportation: + selection_fields: + PrimaryActivity: + - 'Land in rural transportation facilities' + clean_fba_w_sec: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_land_in_rural_transportation_areas + geoscale: national + attribution_method: direct + urban: + selection_fields: + PrimaryActivity: + - 'Land in urban areas' + clean_fba_w_sec: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_land_in_urban_areas + geoscale: national + attribution_method: direct + other: + selection_fields: + PrimaryActivity: + - 'Other land' + clean_fba_w_sec: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_other_land + geoscale: national + attribution_method: direct \ No newline at end of file From bae1aa5ff0ff680efbb8688f405bffdcb399f824 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 28 Apr 2023 12:47:26 -0600 Subject: [PATCH 0531/1127] drop duplicate code --- .../flowbysectormethods/Land_national_2012.yaml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Land_national_2012.yaml b/flowsa/methods/flowbysectormethods/Land_national_2012.yaml index 3d4ee2f76..81bfe1207 100644 --- a/flowsa/methods/flowbysectormethods/Land_national_2012.yaml +++ b/flowsa/methods/flowbysectormethods/Land_national_2012.yaml @@ -1,18 +1,16 @@ %YAML 1.2 -# 'EIA_CBECS_Land' and 'EIA_MECS_Land' must be listed prior to -# 'USDA_ERS_MLU' for FBS creation because the results of the two allocated -# datasets are used within USDA_ERS_MLU sector attribution +# Cache 'EIA_CBECS_Land' and 'EIA_MECS_Land' because the results of the +# two allocated datasets are used within USDA_ERS_MLU sector attribution --- industry_spec: default: NAICS_6 -year: 2015 target_naics_year: 2012 geoscale: national +year: 2012 sources_to_cache: EIA_CBECS_Land: &_eia_cbecs_land # commercial land use fedefl_mapping: EIA_CBECS_Land - year: 2012 selection_fields: Class: Land Location: !include:Location_common.yaml:_national_location @@ -25,7 +23,6 @@ sources_to_cache: attribution_source: Employment_national_2012: data_format: FBS - year: 2012 "EIA_MECS_Land": &_eia_mecs_land # manufacturing land use fedefl_mapping: EIA_MECS_Land year: 2014 @@ -52,7 +49,6 @@ source_names: <<: *_eia_mecs_land "BLM_PLS": fedefl_mapping: BLM_PLS - year: 2012 selection_fields: Class: Land Location: !include:Location_common.yaml:_national_location @@ -68,10 +64,8 @@ source_names: attribution_source: Employment_national_2012: data_format: FBS - year: 2012 "USDA_ERS_MLU": fedefl_mapping: USDA_ERS_MLU - year: 2012 selection_fields: Class: Land Location: !include:Location_common.yaml:_state_location @@ -84,7 +78,6 @@ source_names: attribution_method: proportional attribution_source: "USDA_CoA_Cropland": - year: 2012 selection_fields: Class: "Land" FlowName: @@ -121,7 +114,6 @@ source_names: attribution_method: proportional attribution_source: "USDA_CoA_Cropland_NAICS": - year: 2012 selection_fields: Class: "Land" FlowName: "FARM OPERATIONS" From 560ff693f66fddd6ff443fb97b3a34cf0163628f Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 28 Apr 2023 12:48:18 -0600 Subject: [PATCH 0532/1127] initial land state FBS - not working --- .../flowbysectormethods/Land_state_2012.yaml | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/Land_state_2012.yaml diff --git a/flowsa/methods/flowbysectormethods/Land_state_2012.yaml b/flowsa/methods/flowbysectormethods/Land_state_2012.yaml new file mode 100644 index 000000000..e93b850a3 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/Land_state_2012.yaml @@ -0,0 +1,152 @@ +# Cache 'EIA_CBECS_Land' and 'EIA_MECS_Land' because the results of the +# two allocated datasets are used within USDA_ERS_MLU sector attribution +--- + +!include:USEEIO_summary_target.yaml +year: 2012 +geoscale: state + +sources_to_cache: + # todo: need to attribute census regions to states + EIA_CBECS_Land: &_eia_cbecs_land # commercial land use + fedefl_mapping: EIA_CBECS_Land + year: 2012 + selection_fields: + Class: Land + Location: !include:Location_common.yaml:_state_location + clean_fba: !script_function:EIA_CBECS_Land cbecs_land_fba_cleanup + activity_sets: + cbecs_land: # all activities in eia cbecs land crosswalk + selection_fields: + PrimaryActivity: !from_index:EIA_CBECS_Land_2012_asets.csv cbecs_land + attribution_method: proportional + attribution_source: + Employment_state_2012: + data_format: FBS + year: 2012 + # todo: need to attribute national mecs data to states + "EIA_MECS_Land": &_eia_mecs_land # manufacturing land use + fedefl_mapping: EIA_MECS_Land + year: 2014 + selection_fields: + Class: Land + Location: !include:Location_common.yaml:_state_location + FlowName: "Approximate Enclosed Floorspace of All Buildings Onsite" + Year: {2014: 2012} # replace year to align with method year + clean_fba: !script_function:EIA_MECS mecs_land_fba_cleanup + activity_sets: + mecs_land: # all activities in eia mecs land crosswalk + selection_fields: + PrimaryActivity: !from_index:EIA_MECS_Land_2014_asets.csv mecs_land + attribution_method: proportional + attribution_source: + Employment_national_2014: + data_format: FBS + year: 2014 + +source_names: + EIA_CBECS_Land: + <<: *_eia_cbecs_land + EIA_MECS_Land: + <<: *_eia_mecs_land + BLM_PLS: + fedefl_mapping: BLM_PLS + selection_fields: + Class: Land + Location: !include:Location_common.yaml:_state_location + activity_sets: + general_mining: # all blm pls activities other than hardrock + selection_fields: + PrimaryActivity: !from_index:BLM_PLS_2012_asets.csv general_mining + attribution_method: direct + hardrock_mining: + selection_fields: + PrimaryActivity: !from_index:BLM_PLS_2012_asets.csv hardrock_mining + attribution_method: proportional + attribution_source: + Employment_state_2012: + data_format: FBS + USDA_ERS_MLU: + fedefl_mapping: USDA_ERS_MLU + selection_fields: + Class: Land + Location: !include:Location_common.yaml:_state_location + activity_sets: + cropland_crops: + selection_fields: + PrimaryActivity: + - 'Cropland used for crops' + - 'Cropland idled' + attribution_method: proportional + attribution_source: + "USDA_CoA_Cropland": + year: 2012 + selection_fields: + Class: "Land" + FlowName: + - "AREA HARVESTED" + - "AREA" + - "AREA IN PRODUCTION" + - 'AREA BEARING & NON-BEARING' + - 'AREA GROWN' + Location: !include:Location_common.yaml:_state_location + exclusion_fields: + conditional: {FlowName: 'AREA IN PRODUCTION', + ActivityConsumedBy: 'VEGETABLE TOTALS'} + ActivityConsumedBy: ['AG LAND', 'AG LAND, CROPLAND, HARVESTED'] + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + year: 2017 + selection_fields: + Class: Land + FlowName: + - "FARM OPERATIONS" + estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_sectors_equal_attribution + selection_fields_after_data_suppression_estimation: + PrimaryActivity: [ "112111", "112112", "11212", "1122", + "11231", "11232", "11233", "11234", + "11239", "11241", "11242", "11291", + "11292", "11293", "11299" ] + pastureland: + selection_fields: + PrimaryActivity: + - 'Cropland used for pasture' + - 'Forest-use land grazed' + - 'Grassland pasture and range' + attribution_method: proportional + attribution_source: + "USDA_CoA_Cropland_NAICS": + year: 2012 + selection_fields: + Class: "Land" + FlowName: "FARM OPERATIONS" + estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_sectors_equal_attribution + forest: + selection_fields: + PrimaryActivity: + - 'Forest-use land not grazed' + - 'Land in defense and industrial areas' + - 'Land in rural parks and wildlife areas' + attribution_method: direct + rural_transportation: + selection_fields: + PrimaryActivity: + - 'Land in rural transportation facilities' + clean_fba_w_sec: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_land_in_rural_transportation_areas + geoscale: national + attribution_method: direct + urban: + selection_fields: + PrimaryActivity: + - 'Land in urban areas' + clean_fba_w_sec: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_land_in_urban_areas + geoscale: national + attribution_method: direct + other: + selection_fields: + PrimaryActivity: + - 'Other land' + clean_fba_w_sec: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_other_land + geoscale: national + attribution_method: direct \ No newline at end of file From 6fdbefef11fd3ed439c266d3657a48c83ed798b4 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 28 Apr 2023 15:59:19 -0600 Subject: [PATCH 0533/1127] drop "sector-like_activities" from source_catalog and enable activity_schema to be dictionary --- flowsa/data/source_catalog.yaml | 201 +++++++++++++------------------- 1 file changed, 80 insertions(+), 121 deletions(-) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 3b1385c10..47518cf81 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -1,57 +1,50 @@ -Blackhurst_IO: +BEA_GDP: data_format: FBA class: - - Water - sector-like_activities: False - activity_schema: + - Money + activity_schema: BEA_2012_Detail_Code sector_hierarchy: "parent-completeChild" -BLM_PLS: - data_format: FBA - class: - - Land - sector-like_activities: False - activity_schema: - sector_hierarchy: "flat" -BEA_GDP: +BEA_GDP_GrossOutput: data_format: FBA class: - Money - sector-like_activities: False - # activity_schema: BEA_2012_Detail_Code + activity_schema: BEA_2012_Detail_Code sector_hierarchy: "parent-completeChild" -BEA_GDP_GrossOutput: +BEA_Make_Detail_BeforeRedef: data_format: FBA class: - Money - sector-like_activities: False - # activity_schema: BEA_2012_Detail_Code + activity_schema: BEA_2012_Detail_Code sector_hierarchy: "parent-completeChild" +BEA_Marine_Bunker_Fuel: + data_format: FBA + class: + - Energy + activity_schema: None + sector_hierarchy: "flat" BEA_Use: data_format: FBA class: - Money - sector-like_activities: False #update to true once alternate activity_schema in place -# activity_schema: BEA_2012_Detail_Code + activity_schema: BEA_2012_Detail_Code sector_hierarchy: "parent-completeChild" BEA_Use_Detail_PRO_BeforeRedef: data_format: FBA class: - Money - sector-like_activities: False #update to true once alternate activity_schema in place - # activity_schema: BEA_2012_Detail_Code + activity_schema: BEA_2012_Detail_Code sector_hierarchy: "parent-completeChild" -BEA_Make_Detail_BeforeRedef: +Blackhurst_IO: data_format: FBA class: - - Money - sector-like_activities: False #update to true once alternate activity_schema in place -# activity_schema: BEA_2012_Detail_Code - sector_hierarchy: "parent-completeChild" -BEA_Marine_Bunker_Fuel: + - Water + activity_schema: None + sector_hierarchy: "flat" +BLM_PLS: data_format: FBA class: - - Energy - sector-like_activities: False + - Land + activity_schema: None sector_hierarchy: "flat" BLS_QCEW: data_format: FBA @@ -59,28 +52,37 @@ BLS_QCEW: - Employment - Money - Other - sector-like_activities: True - activity_schema: NAICS_2012_Code + activity_schema: {2002: NAICS_2002_Code, + 2010: NAICS_2007_Code, + 2011: NAICS_2007_Code, + 2012: NAICS_2012_Code, + 2013: NAICS_2012_Code, + 2014: NAICS_2012_Code, + 2015: NAICS_2012_Code, + 2016: NAICS_2012_Code, + 2017: NAICS_2017_Code, + 2018: NAICS_2017_Code, + 2019: NAICS_2017_Code, + 2020: NAICS_2017_Code, + 2021: NAICS_2017_Code} sector_hierarchy: "parent-completeChild" -BTS_TSA: - data_format: FBA - sector-like_activities: False BTS_Airlines: data_format: FBA - sector-like_activities: False + activity_schema: None +BTS_TSA: + data_format: FBA + activity_schema: None CalRecycle_WasteCharacterization: data_format: FBA class: - Other - sector-like_activities: False - activity_schema: + activity_schema: None sector_hierarchy: "flat" Census_ASM: data_format: FBA class: - Money - sector-like_activities: True - activity_schema: None # Codes for 2018 are NAICS_2017_Code + activity_schema: {2018: NAICS_2017_Code} sector_hierarchy: "parent-completeChild" Census_CBP: data_format: FBA @@ -88,99 +90,85 @@ Census_CBP: - Employment - Money - Other - sector-like_activities: True activity_schema: NAICS_2012_Code sector_hierarchy: "parent-completeChild" Census_PEP_Population: data_format: FBA class: Other - sector-like_activities: False - activity_schema: - sector_hierarchy: "" + activity_schema: None Census_QWI: data_format: FBA class: - Employment - sector-like_activities: True activity_schema: NAICS_2012_Code sector_hierarchy: "parent-completeChild" Census_VIP: data_format: FBA class: Money - sector-like_activities: False - activity_schema: + activity_schema: None sector_hierarchy: "flat" CNHW_national_2018: data_format: FBS +EIA_AEO: + data_format: FBA + class: + - Energy + activity_schema: None + sector_hierarchy: "flat" EIA_CBECS_Land: data_format: FBA class: Land - sector-like_activities: False - activity_schema: + activity_schema: None sector_hierarchy: "flat" EIA_CBECS_Water: data_format: FBA class: Water - sector-like_activities: False - activity_schema: + activity_schema: None sector_hierarchy: "flat" -EIA_AEO: - data_format: FBA - class: - - Energy - sector-like_activities: False - # sector_hierarchy: "flat" EIA_MECS_Energy: data_format: FBA class: - Energy - Other - Money - sector-like_activities: True - activity_schema: NAICS_2012_Code + activity_schema: NAICS_2017_Code sector_hierarchy: "parent-completeChild" EIA_MECS_Land: data_format: FBA class: - Land - sector-like_activities: True activity_schema: NAICS_2012_Code sector_hierarchy: "parent-completeChild" EIA_MER: data_format: FBA class: - Energy - sector-like_activities: False - activity_schema: + activity_schema: None sector_hierarchy: "parent-completeChild" EIA_SEDS: data_format: FBA class: - Energy - Money - sector-like_activities: False - # sector_hierarchy: "flat" + sector_hierarchy: "flat" Employment_national: data_format: FBS class: - Employment - Money - Other - sector-like_activities: True activity_schema: NAICS_2012_Code sector_hierarchy: "parent-completeChild" EPA_CDDPath: data_format: FBA class: - Other - sector-like_activities: False - activity_schema: + activity_schema: None sector_hierarchy: "flat" EPA_FactsAndFigures: data_format: FBA class: - Other - sector-like_activities: False activity_schema: None sector_hierarchy: "flat" EPA_GHGI: @@ -189,8 +177,7 @@ EPA_GHGI: - Chemicals - Energy - Other - sector-like_activities: False - activity_schema: + activity_schema: None sector_hierarchy: "flat" EPA_REI: data_format: FBA @@ -198,28 +185,24 @@ EPA_REI: - Employment - Money - Other - sector-like_activities: False activity_schema: None sector_hierarchy: "parent-completeChild" EPA_StateGHGI: data_format: FBA class: - Chemicals - sector-like_activities: False - activity_schema: + activity_schema: None sector_hierarchy: "flat" EPA_SIT: data_format: FBA class: - Chemicals - sector-like_activities: False - activity_schema: + activity_schema: None sector_hierarchy: "flat" EPA_NEI_Nonpoint: data_format: FBA class: - Chemicals - sector-like_activities: False activity_schema: SCC fedefl_mapping: NEI sector_hierarchy: "flat" @@ -227,14 +210,12 @@ EPA_NEI_Nonroad: data_format: FBA class: - Chemicals - sector-like_activities: False activity_schema: SCC sector_hierarchy: "flat" EPA_NEI_Onroad: data_format: FBA class: - Chemicals - sector-like_activities: False activity_schema: SCC sector_hierarchy: "flat" EPA_WARMer: @@ -244,14 +225,12 @@ EPA_WARMer: - Energy - Money - Employment - sector-like_activities: False activity_schema: None sector_hierarchy: "flat" EPA_WFR: data_format: FBA class: - Other - sector-like_activities: False activity_schema: None sector_hierarchy: "flat" NETL_EIA_PlantWater: @@ -259,139 +238,119 @@ NETL_EIA_PlantWater: class: - Water - Energy - sector-like_activities: False activity_schema: None sector_hierarchy: "flat" NOAA_FisheriesLandings: data_format: FBA class: - Money - sector-like_activities: False - activity_schema: - sector_hierarchy: "" + activity_schema: None + sector_hierarchy: StatCan_GDP: data_format: FBA class: - Money - sector-like_activities: True activity_schema: NAICS_2012_Code sector_hierarchy: "parent-completeChild" StatCan_IWS_MI: data_format: FBA class: - Water - sector-like_activities: True activity_schema: NAICS_2012_Code sector_hierarchy: "flat" StatCan_LFS: data_format: FBA class: - Employment - sector-like_activities: False - activity_schema: + activity_schema: None sector_hierarchy: "flat" StateGHGI: data_format: FBA class: - Chemicals - sector-like_activities: False - activity_schema: + activity_schema: None sector_hierarchy: "flat" stateio: data_format: FBA class: - Money - sector-like_activities: False #update to true once alternate activity_schema in place - # activity_schema: BEA_2012_Summary_Code + activity_schema: BEA_2012_Summary_Code sector_hierarchy: "parent-completeChild" USDA_CoA_Cropland: data_format: FBA class: - Land - Other - sector-like_activities: False - activity_schema: + activity_schema: None sector_hierarchy: "parent-completeChild" USDA_CoA_Cropland_NAICS: data_format: FBA class: - Land - sector-like_activities: True activity_schema: NAICS_2012_Code sector_hierarchy: "parent-completeChild" USDA_CoA_Livestock: data_format: FBA class: - Other - sector-like_activities: False - activity_schema: + activity_schema: None sector_hierarchy: "parent-completeChild" USDA_ERS_FIWS: data_format: FBA class: - Money - sector-like_activities: False - activity_schema: - sector_hierarchy: "" + activity_schema: None + sector_hierarchy: USDA_ERS_MLU: data_format: FBA class: - Land - sector-like_activities: False - activity_schema: + activity_schema: None sector_hierarchy: "flat" USDA_IWMS: data_format: FBA class: - Water - sector-like_activities: False - activity_schema: + activity_schema: None sector_hierarchy: "flat" USGS_NWIS_WU: data_format: FBA class: - Water - sector-like_activities: False - activity_schema: + activity_schema: None sector_hierarchy: "flat" USGS_WU_Coef: data_format: FBA class: - Water - sector-like_activities: False - activity_schema: + activity_schema: None sector_hierarchy: "flat" write_FBA_California_Commercial_bySector: class: - Other - sector-like_activities: False - activity_schema: - sector_hierarchy: "" + activity_schema: None + sector_hierarchy: USGS_MYB_Lead: data_format: FBA class: - Geological - sector-like_activities: False - activity_schema: - sector_hierarchy: "" + activity_schema: None + sector_hierarchy: USGS_MYB_ManufacturedAbrasive: data_format: FBA class: - Geological - sector-like_activities: False - activity_schema: + activity_schema: None sector_hierarchy: "" USGS_MYB_SodaAsh: data_format: FBA class: - Geological - sector-like_activities: False - activity_schema: - sector_hierarchy: "" + activity_schema: None + sector_hierarchy: USGS_MYB_Copper: data_format: FBA class: - Geological - sector-like_activities: False - activity_schema: - sector_hierarchy: "" \ No newline at end of file + activity_schema: None + sector_hierarchy: \ No newline at end of file From 2e295eef0e205d0e7e6389cb874badc0246b8fde Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 28 Apr 2023 16:00:24 -0600 Subject: [PATCH 0534/1127] read activity_schema as a string or dictionary --- flowsa/flowby.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 7f8eb121f..7a372701f 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1186,13 +1186,16 @@ def map_to_sectors( """ naics_key = naics.industry_spec_key(self.config['industry_spec']) - if self.config['sector-like_activities']: + activity_schema = self.config['activity_schema'] if isinstance( + self.config['activity_schema'], str) else self.config.get( + 'activity_schema', {}).get(self.config['year']) + + if "NAICS" in activity_schema: log.info('Activities in %s are NAICS codes.', self.full_name) try: - source_year = int(self.config - .get('activity_schema', '')[6:10]) + source_year = int(activity_schema[6:10]) except ValueError: source_year = 2012 log.warning('No NAICS year given for NAICS activities in %s. ' From 30d44e4506e21d4268bbea0ed733ef3cb5231e96 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 2 May 2023 11:40:24 -0600 Subject: [PATCH 0535/1127] adjustments to split FBS primary source data into activity sets in an FBS method yaml - move 'FlowByActivity' fxns to 'FlowBy' fxns --- flowsa/flowby.py | 773 ++++++++++++++++++++++++----------------------- 1 file changed, 398 insertions(+), 375 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 7f8eb121f..135d9852d 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -595,6 +595,380 @@ def aggregate_flowby( # otherwise, columns of NaN will become float dtype. return aggregated + def attribute_flows_to_sectors( + self: FB, + external_config_path: str = None + ) -> FB: + """ + The calling FBA has its activities mapped to sectors, then its flows + attributed to those sectors, by the methods specified in the calling + FBA's configuration dictionary. + """ + grouped: 'FB' = ( + self + .reset_index(drop=True).reset_index() + .rename(columns={'index': 'group_id'}) + .assign(group_total=self.FlowAmount) + ) + if len(grouped)==0: + log.warning(f'No data remaining in {self.full_name}.') + return self + if self.config['data_format'] == 'FBA': + fb: 'FlowByActivity' = ( + grouped + .map_to_sectors(external_config_path=external_config_path) + .function_socket('clean_fba_w_sec', + attr=self.config, + method=self.config) + .rename(columns={'SourceName': 'MetaSources'}) + ) + elif self.config['data_format'] == 'FBS': + fb = grouped.copy() + + attribution_method = fb.config.get('attribution_method') + if attribution_method == 'direct' or attribution_method is None: + fb = fb.assign(AttributionSources='Direct') + else: + fb = fb.assign(AttributionSources=','.join( + [k for k in fb.config.get('attribution_source').keys()])) + + if attribution_method == 'proportional': + attribution_fbs = fb.load_prepare_attribution_source() + attributed_fb = fb.proportionally_attribute(attribution_fbs) + + elif attribution_method == 'multiplication': + attribution_fbs = fb.load_prepare_attribution_source() + attributed_fb = fb.multiplication_attribution(attribution_fbs) + + else: + if all(fb.groupby('group_id')['group_id'].agg('count') == 1): + log.info('No attribution needed for %s at the given industry ' + 'aggregation level', fb.full_name) + return fb.drop(columns=['group_id', 'group_total']) + + if attribution_method is None: + log.warning('No attribution method specified for %s. ' + 'Using equal attribution as default.', + fb.full_name) + elif attribution_method != 'direct': + log.error('Attribution method for %s not recognized: %s', + fb.full_name, attribution_method) + raise ValueError('Attribution method not recognized') + + attributed_fb = fb.equally_attribute() + + # if the attribution method is not multiplication, check that new df + # values equal original df values + if attribution_method not in ['multiplication', 'weighted_average', + 'substitute_nonexistent_values']: + # todo: add results from this if statement to validation log + validation_fb = attributed_fb.assign( + validation_total=(attributed_fb.groupby('group_id') + ['FlowAmount'].transform('sum')) + ) + if not np.allclose(validation_fb.group_total, + validation_fb.validation_total, + equal_nan=True): + errors = (validation_fb + .query('validation_total != group_total') + [['group_id', + 'ActivityProducedBy', 'ActivityConsumedBy', + 'SectorProducedBy', 'SectorConsumedBy', + 'FlowAmount', 'group_total', 'validation_total']]) + log.error('Errors in attributing flows from %s:\n%s', + self.full_name, errors) + + return attributed_fb.drop(columns=['group_id', 'group_total']) + + + def activity_sets(self) -> List['FB']: + ''' + This function breaks up an FBA dataset into its activity sets, if its + config dictionary specifies activity sets, and returns a list of the + resulting FBAs. Otherwise, it returns a list containing the calling + FBA. + + Activity sets are determined by the selection_field key under each + activity set name. An error will be logged if any rows from the calling + FBA are assigned to multiple activity sets. + ''' + if 'activity_sets' not in self.config: + return [self] + + log.info('Splitting %s into activity sets', self.full_name) + activities = self.config['activity_sets'] + parent_config = {k: v for k, v in self.config.items() + if k not in ['activity_sets', + 'clean_fba_before_activity_sets'] + and not k.startswith('_')} + parent_df = self.reset_index().rename(columns={'index': 'row'}) + + child_df_list = [] + assigned_rows = set() + for activity_set, activity_config in activities.items(): + log.info('Creating subset for %s', activity_set) + + child_df = ( + parent_df + .add_full_name( + f'{parent_df.full_name}{NAME_SEP_CHAR}{activity_set}') + .select_by_fields( + selection_fields=activity_config.get('selection_fields'), + exclusion_fields=activity_config.get('exclusion_fields')) + ) + + child_df.config = {**parent_config, **activity_config} + child_df = child_df.assign(SourceName=child_df.full_name) + + if set(child_df.row) & assigned_rows: + log.critical( + 'Some rows from %s assigned to multiple activity ' + 'sets. This will lead to double-counting:\n%s', + parent_df.full_name, + child_df.query( + f'row in {list(set(child_df.row) & assigned_rows)}' + ) + ) + # raise ValueError('Some rows in multiple activity sets') + + assigned_rows.update(child_df.row) + if not child_df.empty: + child_df_list.append(child_df.drop(columns='row')) + else: + log.error('Activity set %s is empty. Check activity set ' + 'definition!', child_df.full_name) + + if set(parent_df.row) - assigned_rows: + log.warning('Some rows from %s not assigned to an activity ' + 'set. Is this intentional?', parent_df.full_name) + unassigned = parent_df.query('row not in @assigned_rows') + + return child_df_list + + def load_prepare_attribution_source( + self: 'FlowByActivity' + ) -> 'FlowBySector': + attribution_source = self.config['attribution_source'] + + if isinstance(attribution_source, str): + name, config = attribution_source, {} + else: + (name, config), = attribution_source.items() + + if name in self.config['cache']: + attribution_fbs = self.config['cache'][name].copy() + attribution_fbs.config = { + **{k: attribution_fbs.config[k] + for k in attribution_fbs.config['method_config_keys']}, + **config + } + attribution_fbs = attribution_fbs.prepare_fbs() + else: + attribution_fbs = get_flowby_from_config( + name=name, + config={**{k: v for k, v in self.config.items() + if k in self.config['method_config_keys'] + or k == 'method_config_keys'}, + **get_catalog_info(name), + **config} + ).prepare_fbs() + return attribution_fbs + + + def proportionally_attribute( + self: 'FB', # flowbyactivity or flowbysector + other: 'FlowBySector' + ) -> 'FlowByActivity': + ''' + This method takes flows from the calling FBA which are mapped to + multiple sectors and attributes them to those sectors proportionally to + flows from other (an FBS). + ''' + + log.info('Attributing flows in %s using %s.', + self.full_name, other.full_name) + + fba_geoscale, other_geoscale, fba, other = self.harmonize_geoscale(other) + + groupby_cols = ['group_id'] + for rank in ['Primary', 'Secondary']: + # skip over Secondary if not relevant + if fba[f'{rank}Sector'].isna().all(): + continue + counted = fba.assign(group_count=(fba.groupby(groupby_cols) + ['group_id'] + .transform('count'))) + directly_attributed = ( + counted + .query('group_count == 1') + .drop(columns='group_count') + ) + needs_attribution = ( + counted + .query('group_count > 1') + .drop(columns='group_count') + ) + + merged = ( + needs_attribution + .merge(other, + how='left', + left_on=[f'{rank}Sector', + 'temp_location' + if 'temp_location' in needs_attribution + else 'Location'], + right_on=['PrimarySector', 'Location'], + suffixes=[None, '_other']) + .fillna({'FlowAmount_other': 0}) + ) + + denominator_flag = ~merged.duplicated(subset=[*groupby_cols, + f'{rank}Sector']) + with_denominator = ( + merged + .assign(denominator=( + merged + .assign(FlowAmount_other=(merged.FlowAmount_other + * denominator_flag)) + .groupby(groupby_cols) + ['FlowAmount_other'] + .transform('sum'))) + ) + + non_zero_denominator = with_denominator.query(f'denominator != 0 ') + unattributable = with_denominator.query(f'denominator == 0 ') + + if not unattributable.empty: + log.warning( + 'Could not attribute activities in %s due to lack of ' + 'flows in attribution source %s for mapped %s sectors %s', + # set(zip(unattributable.ActivityProducedBy, + # unattributable.ActivityConsumedBy, + # unattributable.Location)), + unattributable.full_name, + other.full_name, + rank, + sorted(set(unattributable[f'{rank}Sector'])) + ) + + proportionally_attributed = ( + non_zero_denominator + .assign(FlowAmount=lambda x: (x.FlowAmount + * x.FlowAmount_other + / x.denominator)) + .drop(columns=['PrimarySector_other', 'Location_other', + 'FlowAmount_other', 'denominator', + 'Unit_other'], + errors='ignore') + ) + fba = pd.concat([directly_attributed, + proportionally_attributed], ignore_index=True) + groupby_cols.append(f'{rank}Sector') + + return ( + fba + .drop(columns=['PrimarySector', 'SecondarySector', + 'temp_location'], + errors='ignore') + .reset_index(drop=True) + ) + + def harmonize_geoscale( + self: 'FB', + other: 'FlowBySector' + ) -> 'FlowByActivity': + + fba_geoscale = geo.scale.from_string(self.config['geoscale']) + other_geoscale = geo.scale.from_string(other.config['geoscale']) + + if other_geoscale < fba_geoscale: + log.info('Aggregating %s from %s to %s', other.full_name, + other_geoscale, fba_geoscale) + other = ( + other + .convert_fips_to_geoscale(fba_geoscale) + .aggregate_flowby() + ) + elif other_geoscale > fba_geoscale: + log.info('%s is %s, while %s is %s, so attributing %s to ' + '%s', other.full_name, other_geoscale, self.full_name, + fba_geoscale, other_geoscale, fba_geoscale) + self = ( + self + .assign(temp_location=self.Location) + .convert_fips_to_geoscale(other_geoscale, + column='temp_location') + ) + + fba = self.add_primary_secondary_columns('Sector') + other = ( + other + .add_primary_secondary_columns('Sector') + [['PrimarySector', 'Location', 'FlowAmount', 'Unit']] + .groupby(['PrimarySector', 'Location', 'Unit']) + .agg('sum') + .reset_index() + ) + + return fba_geoscale, other_geoscale, fba, other + + + def multiplication_attribution( + self: 'FB', + other: 'FlowBySector' + ) -> 'FlowByActivity': + """ + This method takes flows from the calling FBA which are mapped to + multiple sectors and multiplies them by flows from other (an FBS). + """ + + log.info('Multiplying flows in %s by %s.', + self.full_name, other.full_name) + fba_geoscale, other_geoscale, fba, other = self.harmonize_geoscale( + other) + + # todo: update units after multiplying + + # multiply using each dfs primary sector col + merged = (fba + .merge(other, + how='left', + left_on=['PrimarySector', 'temp_location' + if 'temp_location' in fba + else 'Location'], + right_on=['PrimarySector', 'Location'], + suffixes=[None, '_other']) + .fillna({'FlowAmount_other': 0}) + ) + + fba = (merged + .assign(FlowAmount=lambda x: (x.FlowAmount + * x.FlowAmount_other)) + .drop(columns=['PrimarySector_other', 'Location_other', + 'FlowAmount_other', 'denominator'], + errors='ignore') + ) + + # determine if any flows are lost because multiplied by 0 + fba_null = fba[fba['FlowAmount'] == 0] + if len(fba_null) > 0: + log.warning('FlowAmounts in %s are reset to 0 due to lack of ' + 'flows in attribution source %s for ' + 'ActivityProducedBy/ActivityConsumedBy/Location: %s', + fba.full_name, other.full_name, + set(zip(fba_null.ActivityProducedBy, + fba_null.ActivityConsumedBy, + fba_null.Location)) + ) + + return ( + fba + .drop(columns=['PrimarySector', 'SecondarySector', + 'temp_location'], + errors='ignore') + .reset_index(drop=True) + ) + def add_primary_secondary_columns( self: FB, col_type: Literal['Activity', 'Sector'] @@ -1038,124 +1412,13 @@ def convert_to_geoscale( validation.compare_geographic_totals( fba_at_target_geoscale, self, - self.source_name, self.config, - self.full_name.split('.')[-1], activities, - df_type='FBS', subnational_geoscale=target_geoscale - # ^^^ TODO: Rewrite validation to use fb metadata - ) - - return fba_at_target_geoscale - - def load_prepare_attribution_source( - self: 'FlowByActivity' - ) -> 'FlowBySector': - attribution_source = self.config['attribution_source'] - - if isinstance(attribution_source, str): - name, config = attribution_source, {} - else: - (name, config), = attribution_source.items() - - if name in self.config['cache']: - attribution_fbs = self.config['cache'][name].copy() - attribution_fbs.config = { - **{k: attribution_fbs.config[k] - for k in attribution_fbs.config['method_config_keys']}, - **config - } - attribution_fbs = attribution_fbs.prepare_fbs() - else: - attribution_fbs = get_flowby_from_config( - name=name, - config={**{k: v for k, v in self.config.items() - if k in self.config['method_config_keys'] - or k == 'method_config_keys'}, - **get_catalog_info(name), - **config} - ).prepare_fbs() - return attribution_fbs - - def attribute_flows_to_sectors( - self: 'FlowByActivity', - external_config_path: str = None - ) -> 'FlowByActivity': - """ - The calling FBA has its activities mapped to sectors, then its flows - attributed to those sectors, by the methods specified in the calling - FBA's configuration dictionary. - """ - grouped: 'FlowByActivity' = ( - self - .reset_index(drop=True).reset_index() - .rename(columns={'index': 'group_id'}) - .assign(group_total=self.FlowAmount) - ) - if len(grouped)==0: - log.warning(f'No data remaining in {self.full_name}.') - return self - fba: 'FlowByActivity' = ( - grouped - .map_to_sectors(external_config_path=external_config_path) - .function_socket('clean_fba_w_sec', - attr=self.config, - method=self.config) - .rename(columns={'SourceName': 'MetaSources'}) - ) - - attribution_method = fba.config.get('attribution_method') - if attribution_method == 'direct' or attribution_method is None: - fba = fba.assign(AttributionSources='Direct') - else: - fba = fba.assign(AttributionSources=','.join( - [k for k in fba.config.get('attribution_source').keys()])) - - if attribution_method == 'proportional': - attribution_fbs = fba.load_prepare_attribution_source() - attributed_fba = fba.proportionally_attribute(attribution_fbs) - - elif attribution_method == 'multiplication': - attribution_fbs = fba.load_prepare_attribution_source() - attributed_fba = fba.multiplication_attribution(attribution_fbs) - - else: - if all(fba.groupby('group_id')['group_id'].agg('count') == 1): - log.info('No attribution needed for %s at the given industry ' - 'aggregation level', fba.full_name) - return fba.drop(columns=['group_id', 'group_total']) - - if attribution_method is None: - log.warning('No attribution method specified for %s. ' - 'Using equal attribution as default.', - fba.full_name) - elif attribution_method != 'direct': - log.error('Attribution method for %s not recognized: %s', - fba.full_name, attribution_method) - raise ValueError('Attribution method not recognized') - - attributed_fba = fba.equally_attribute() - - # if the attribution method is not multiplication, check that new df - # values equal original df values - if attribution_method not in ['multiplication', 'weighted_average', - 'substitute_nonexistent_values']: - # todo: add results from this if statement to validation log - validation_fba = attributed_fba.assign( - validation_total=(attributed_fba.groupby('group_id') - ['FlowAmount'].transform('sum')) - ) - if not np.allclose(validation_fba.group_total, - validation_fba.validation_total, - equal_nan=True): - errors = (validation_fba - .query('validation_total != group_total') - [['group_id', - 'ActivityProducedBy', 'ActivityConsumedBy', - 'SectorProducedBy', 'SectorConsumedBy', - 'FlowAmount', 'group_total', 'validation_total']]) - log.error('Errors in attributing flows from %s:\n%s', - self.full_name, errors) + self.source_name, self.config, + self.full_name.split('.')[-1], activities, + df_type='FBS', subnational_geoscale=target_geoscale + # ^^^ TODO: Rewrite validation to use fb metadata + ) - return attributed_fba.drop(columns=['group_id', 'group_total']) + return fba_at_target_geoscale def map_to_sectors( self: 'FlowByActivity', @@ -1516,199 +1779,6 @@ def equally_attribute(self: 'FlowByActivity') -> 'FlowByActivity': *[f'_unique_naics_{n}_by_group' for n in range(2, 8)]] ) - def harmonize_geoscale( - self: 'FlowByActivity', - other: 'FlowBySector' - ) -> 'FlowByActivity': - - fba_geoscale = geo.scale.from_string(self.config['geoscale']) - other_geoscale = geo.scale.from_string(other.config['geoscale']) - - if other_geoscale < fba_geoscale: - log.info('Aggregating %s from %s to %s', other.full_name, - other_geoscale, fba_geoscale) - other = ( - other - .convert_fips_to_geoscale(fba_geoscale) - .aggregate_flowby() - ) - elif other_geoscale > fba_geoscale: - log.info('%s is %s, while %s is %s, so attributing %s to ' - '%s', other.full_name, other_geoscale, self.full_name, - fba_geoscale, other_geoscale, fba_geoscale) - self = ( - self - .assign(temp_location=self.Location) - .convert_fips_to_geoscale(other_geoscale, - column='temp_location') - ) - - fba = self.add_primary_secondary_columns('Sector') - other = ( - other - .add_primary_secondary_columns('Sector') - [['PrimarySector', 'Location', 'FlowAmount', 'Unit']] - .groupby(['PrimarySector', 'Location', 'Unit']) - .agg('sum') - .reset_index() - ) - - return fba_geoscale, other_geoscale, fba, other - - def proportionally_attribute( - self: 'FlowByActivity', - other: 'FlowBySector' - ) -> 'FlowByActivity': - ''' - This method takes flows from the calling FBA which are mapped to - multiple sectors and attributes them to those sectors proportionally to - flows from other (an FBS). - ''' - - log.info('Attributing flows in %s using %s.', - self.full_name, other.full_name) - - fba_geoscale, other_geoscale, fba, other = self.harmonize_geoscale(other) - - groupby_cols = ['group_id'] - for rank in ['Primary', 'Secondary']: - # skip over Secondary if not relevant - if fba[f'{rank}Sector'].isna().all(): - continue - counted = fba.assign(group_count=(fba.groupby(groupby_cols) - ['group_id'] - .transform('count'))) - directly_attributed = ( - counted - .query('group_count == 1') - .drop(columns='group_count') - ) - needs_attribution = ( - counted - .query('group_count > 1') - .drop(columns='group_count') - ) - - merged = ( - needs_attribution - .merge(other, - how='left', - left_on=[f'{rank}Sector', - 'temp_location' - if 'temp_location' in needs_attribution - else 'Location'], - right_on=['PrimarySector', 'Location'], - suffixes=[None, '_other']) - .fillna({'FlowAmount_other': 0}) - ) - - denominator_flag = ~merged.duplicated(subset=[*groupby_cols, - f'{rank}Sector']) - with_denominator = ( - merged - .assign(denominator=( - merged - .assign(FlowAmount_other=(merged.FlowAmount_other - * denominator_flag)) - .groupby(groupby_cols) - ['FlowAmount_other'] - .transform('sum'))) - ) - - non_zero_denominator = with_denominator.query(f'denominator != 0 ') - unattributable = with_denominator.query(f'denominator == 0 ') - - if not unattributable.empty: - log.warning( - 'Could not attribute activities in %s due to lack of ' - 'flows in attribution source %s for mapped %s sectors %s', - # set(zip(unattributable.ActivityProducedBy, - # unattributable.ActivityConsumedBy, - # unattributable.Location)), - unattributable.full_name, - other.full_name, - rank, - sorted(set(unattributable[f'{rank}Sector'])) - ) - - proportionally_attributed = ( - non_zero_denominator - .assign(FlowAmount=lambda x: (x.FlowAmount - * x.FlowAmount_other - / x.denominator)) - .drop(columns=['PrimarySector_other', 'Location_other', - 'FlowAmount_other', 'denominator', - 'Unit_other'], - errors='ignore') - ) - fba = pd.concat([directly_attributed, - proportionally_attributed], ignore_index=True) - groupby_cols.append(f'{rank}Sector') - - return ( - fba - .drop(columns=['PrimarySector', 'SecondarySector', - 'temp_location'], - errors='ignore') - .reset_index(drop=True) - ) - - def multiplication_attribution( - self: 'FlowByActivity', - other: 'FlowBySector' - ) -> 'FlowByActivity': - """ - This method takes flows from the calling FBA which are mapped to - multiple sectors and multiplies them by flows from other (an FBS). - """ - - log.info('Multiplying flows in %s by %s.', - self.full_name, other.full_name) - fba_geoscale, other_geoscale, fba, other = self.harmonize_geoscale( - other) - - # todo: update units after multiplying - - # multiply using each dfs primary sector col - merged = (fba - .merge(other, - how='left', - left_on=['PrimarySector', 'temp_location' - if 'temp_location' in fba - else 'Location'], - right_on=['PrimarySector', 'Location'], - suffixes=[None, '_other']) - .fillna({'FlowAmount_other': 0}) - ) - - fba = (merged - .assign(FlowAmount=lambda x: (x.FlowAmount - * x.FlowAmount_other)) - .drop(columns=['PrimarySector_other', 'Location_other', - 'FlowAmount_other', 'denominator'], - errors='ignore') - ) - - # determine if any flows are lost because multiplied by 0 - fba_null = fba[fba['FlowAmount'] == 0] - if len(fba_null) > 0: - log.warning('FlowAmounts in %s are reset to 0 due to lack of ' - 'flows in attribution source %s for ' - 'ActivityProducedBy/ActivityConsumedBy/Location: %s', - fba.full_name, other.full_name, - set(zip(fba_null.ActivityProducedBy, - fba_null.ActivityConsumedBy, - fba_null.Location)) - ) - - return ( - fba - .drop(columns=['PrimarySector', 'SecondarySector', - 'temp_location'], - errors='ignore') - .reset_index(drop=True) - ) - def prepare_fbs( self: 'FlowByActivity', @@ -1747,70 +1817,6 @@ def prepare_fbs( .aggregate_flowby() ) - def activity_sets(self) -> List['FlowByActivity']: - ''' - This function breaks up an FBA dataset into its activity sets, if its - config dictionary specifies activity sets, and returns a list of the - resulting FBAs. Otherwise, it returns a list containing the calling - FBA. - - Activity sets are determined by the selection_field key under each - activity set name. An error will be logged if any rows from the calling - FBA are assigned to multiple activity sets. - ''' - if 'activity_sets' not in self.config: - return [self] - - log.info('Splitting %s into activity sets', self.full_name) - activities = self.config['activity_sets'] - parent_config = {k: v for k, v in self.config.items() - if k not in ['activity_sets', - 'clean_fba_before_activity_sets'] - and not k.startswith('_')} - parent_fba = self.reset_index().rename(columns={'index': 'row'}) - - child_fba_list = [] - assigned_rows = set() - for activity_set, activity_config in activities.items(): - log.info('Creating FlowByActivity for %s', activity_set) - - child_fba = ( - parent_fba - .add_full_name( - f'{parent_fba.full_name}{NAME_SEP_CHAR}{activity_set}') - .select_by_fields( - selection_fields=activity_config.get('selection_fields'), - exclusion_fields=activity_config.get('exclusion_fields')) - ) - - child_fba.config = {**parent_config, **activity_config} - child_fba = child_fba.assign(SourceName=child_fba.full_name) - - if set(child_fba.row) & assigned_rows: - log.critical( - 'Some rows from %s assigned to multiple activity ' - 'sets. This will lead to double-counting:\n%s', - parent_fba.full_name, - child_fba.query( - f'row in {list(set(child_fba.row) & assigned_rows)}' - ) - ) - # raise ValueError('Some rows in multiple activity sets') - - assigned_rows.update(child_fba.row) - if not child_fba.empty: - child_fba_list.append(child_fba.drop(columns='row')) - else: - log.error('Activity set %s is empty. Check activity set ' - 'definition!', child_fba.full_name) - - if set(parent_fba.row) - assigned_rows: - log.warning('Some rows from %s not assigned to an activity ' - 'set. Is this intentional?', parent_fba.full_name) - unassigned = parent_fba.query('row not in @assigned_rows') - - return child_fba_list - def convert_units_and_flows( self: 'FlowByActivity' ) -> 'FlowByActivity': @@ -2079,15 +2085,32 @@ def prepare_fbs( self: 'FlowBySector', external_config_path: str = None ) -> 'FlowBySector': + if 'activity_sets' in self.config: + try: + return ( + pd.concat([ + fbs.prepare_fbs() + for fbs in ( + self + .select_by_fields() + .activity_sets() + ) + ]) + .reset_index(drop=True) + ) + except ValueError: + return FlowBySector(pd.DataFrame()) return ( self .function_socket('clean_fbs') .select_by_fields() - .sector_aggregation() # convert to proper industry spec. + .sector_aggregation() # convert to proper industry spec. .convert_fips_to_geoscale() + .attribute_flows_to_sectors() .aggregate_flowby() # necessary after consolidating geoscale ) + def display_tables( self: 'FlowBySector', display_tables: dict = None From 75ac58bdc7eea6fc7c67d04c88874869bbd74411 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 3 May 2023 14:08:24 -0400 Subject: [PATCH 0536/1127] add logging to FBS --- flowsa/flowby.py | 3 ++- flowsa/flowsa_log.py | 4 +--- flowsa/metadata.py | 3 ++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 7f8eb121f..a0067523b 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -7,7 +7,7 @@ from flowsa import (common, settings, metadata, sectormapping, literature_values, flowbyactivity, flowsa_yaml, validation, geo, naics, exceptions, location) -from flowsa.flowsa_log import log +from flowsa.flowsa_log import log, rename_log_file import esupy.processed_data_mgmt import esupy.dqi import fedelemflowlist @@ -2044,6 +2044,7 @@ def generateFlowBySector( log.info(f'FBS generation complete, saving {method} to file') meta = metadata.set_fb_meta(method, 'FlowBySector') esupy.processed_data_mgmt.write_df_to_file(fbs, settings.paths, meta) + rename_log_file(method, meta) metadata.write_metadata(source_name=method, config=common.load_yaml_dict( method, 'FBS', external_config_path), diff --git a/flowsa/flowsa_log.py b/flowsa/flowsa_log.py index 6c20ed8b5..c0bd0d4ec 100644 --- a/flowsa/flowsa_log.py +++ b/flowsa/flowsa_log.py @@ -95,14 +95,12 @@ def rename_log_file(filename, fb_meta): # already exists) shutil.copy(log_file, new_log_name) # original log file name - validation - log_file = f'{logoutputpath}{"validation_flowsa.log"}' + log_file = f'{logoutputpath}{"flowsa_validation.log"}' # generate new log name new_log_name = (f'{logoutputpath}{filename}_v' f'{fb_meta.tool_version}' f'{"_" + fb_meta.git_hash if fb_meta.git_hash else ""}' f'_validation.log') - # create log directory if missing - create_paths_if_missing(logoutputpath) # rename the standard log file name (os.rename throws error if file # already exists) shutil.copy(log_file, new_log_name) diff --git a/flowsa/metadata.py b/flowsa/metadata.py index 61f82a308..3aa84b360 100644 --- a/flowsa/metadata.py +++ b/flowsa/metadata.py @@ -10,8 +10,9 @@ from esupy.processed_data_mgmt import FileMeta, write_metadata_to_file, \ read_source_metadata from flowsa.common import return_true_source_catalog_name +from flowsa.flowsa_log import log from flowsa.settings import paths, PKG, PKG_VERSION_NUMBER, WRITE_FORMAT, \ - GIT_HASH, GIT_HASH_LONG, log + GIT_HASH, GIT_HASH_LONG def set_fb_meta(name_data, category): From ae1d71423682383cebe0d620154e8d1e3b5c1618 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 3 May 2023 14:14:25 -0400 Subject: [PATCH 0537/1127] skip validation log for FBA --- flowsa/flowsa_log.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flowsa/flowsa_log.py b/flowsa/flowsa_log.py index c0bd0d4ec..880808268 100644 --- a/flowsa/flowsa_log.py +++ b/flowsa/flowsa_log.py @@ -94,6 +94,10 @@ def rename_log_file(filename, fb_meta): # rename the standard log file name (os.rename throws error if file # already exists) shutil.copy(log_file, new_log_name) + + if fb_meta.category == 'FlowByActivity': + return + # original log file name - validation log_file = f'{logoutputpath}{"flowsa_validation.log"}' # generate new log name From 2a6d9ade579d1ea265c2e9577ef21f96a1954f5c Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 3 May 2023 14:16:34 -0400 Subject: [PATCH 0538/1127] temporary drop direct_allocation_method in EPA_REI --- flowsa/data_source_scripts/EPA_REI.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flowsa/data_source_scripts/EPA_REI.py b/flowsa/data_source_scripts/EPA_REI.py index 5b8e15044..7e0c5bcc2 100644 --- a/flowsa/data_source_scripts/EPA_REI.py +++ b/flowsa/data_source_scripts/EPA_REI.py @@ -184,7 +184,9 @@ def rei_waste_flows_attribution(*, flow_subset_mapped, k, names, method, **_): # first directly attribute/equally attribute APB to sectors and drop ACB # data - p2 = direct_allocation_method(p, k, names, method) + # p2 = direct_allocation_method(p, k, names, method) + p2 = p.copy() + ## TODO ^^ dropped direct_allocation_method - deprecated, temporary until REI method updated p2 = p2.drop(columns=['ActivityConsumedBy', 'SectorConsumedBy']) # then create attribution ratios to activityconsumedby based on flowable From 557237943da2d9b4aef0c8b859b1ca2e6dd8a8ff Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 3 May 2023 13:08:52 -0600 Subject: [PATCH 0539/1127] drop old epa_rei.py code --- flowsa/data_source_scripts/EPA_REI.py | 47 ++++--------------- .../REI_waste_national_2012.yaml | 2 +- 2 files changed, 9 insertions(+), 40 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_REI.py b/flowsa/data_source_scripts/EPA_REI.py index 2d6740a8d..5bf365038 100644 --- a/flowsa/data_source_scripts/EPA_REI.py +++ b/flowsa/data_source_scripts/EPA_REI.py @@ -7,7 +7,7 @@ import numpy as np from flowsa.location import US_FIPS from flowsa.flowbyfunctions import assign_fips_location_system -from flowsa.fbs_allocation import direct_allocation_method +from flowsa.flowby import FlowBySector def rei_url_helper(*, build_url, config, **_): @@ -163,44 +163,13 @@ def primary_factors_parse(*, df_list, year, **_): return df2 -def rei_waste_flows_attribution(*, flow_subset_mapped, k, names, method, **_): +def rei_waste_national_cleanup(fbs: FlowBySector, **_) -> FlowBySector: """ - Attribute REI waste data to include SPB and SCB. - todo: convert this function into yaml methods once we pull in Matthew's - updates - :param flow_subset_mapped: - :param k: - :param names: - :param attr: - :param fbs_list: - :param method: - :return: + Drop imports/exports from rei waste national FBS """ + fbs = (fbs + .query('SectorConsumedBy not in ("F04000", "F05000")') + .reset_index(drop=True) + ) - # subset data into activityproducedby and activityconsumedby datafarames - p = flow_subset_mapped[flow_subset_mapped['Description'] == 'makecol'] - c = flow_subset_mapped[flow_subset_mapped['Description'] == - 'useintersection'] - - # first directly attribute/equally attribute APB to sectors and drop ACB - # data - p2 = direct_allocation_method(p, k, names, method) - p2 = p2.drop(columns=['ActivityConsumedBy', 'SectorConsumedBy']) - - # then create attribution ratios to activityconsumedby based on flowable - c2 = c[['Flowable', 'FlowAmount', 'Unit', 'ActivityConsumedBy', - 'SectorConsumedBy']].assign(Denominator=c.groupby( - ['Flowable', 'Unit'])['FlowAmount'].transform('sum')) - c2 = c2.assign(AttributionRatio=c2['FlowAmount']/c2['Denominator']) - c2 = c2.sort_values(['Flowable', 'ActivityConsumedBy']) - # Drop imports and exports so that the quantity is not allocated to SCB - c2 = c2.query('SectorConsumedBy not in ("F04000", "F05000")').reset_index(drop=True) - - # merge data and recalculate flow amounts - df = p2.merge(c2[['Flowable', 'Unit', 'ActivityConsumedBy', - 'SectorConsumedBy', 'AttributionRatio']], - how='left') - df['FlowAmount'] = df['FlowAmount'] * df['AttributionRatio'] - df = df.drop(columns='AttributionRatio') - - return df + return fbs diff --git a/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml b/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml index c8c669265..8e9b164d1 100644 --- a/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml +++ b/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml @@ -18,5 +18,5 @@ source_names: waste_flows: names: !from_index:EPA_REI_waste_2012_asets.csv waste allocation_method: allocation_function - allocation_source: !script_function:EPA_REI rei_waste_flows_attribution + allocation_source: !script_function:EPA_REI rei_waste_national_cleanup allocation_from_scale: national From 768d00ce1c5c31ce5bcb9900603bb761d548df90 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 3 May 2023 15:09:45 -0400 Subject: [PATCH 0540/1127] drop old log code --- flowsa/settings.py | 49 ---------------------------------------------- 1 file changed, 49 deletions(-) diff --git a/flowsa/settings.py b/flowsa/settings.py index 93a6a104a..c1e3453c0 100644 --- a/flowsa/settings.py +++ b/flowsa/settings.py @@ -47,55 +47,6 @@ ).replace('\\', '/') + '/scripts/' scriptsFBApath = scriptpath + 'FlowByActivity_Datasets/' -# # define 4 logs, one for general information, one for major validation -# # logs that are also included in the general info log, one for very specific -# # validation that is only included in the validation log, and a console -# # printout that includes general and validation, but not detailed validation - - -# # format for logging .txt generated -# formatter = logging.Formatter('%(asctime)s %(levelname)-8s %(message)s', -# datefmt='%Y-%m-%d %H:%M:%S') - -# # create loggers -# # general logger -# log = logging.getLogger('allLog') -# log.setLevel(logging.DEBUG) -# log.propagate = False -# # log.propagate=False -# # general validation logger -# vLog = logging.getLogger('validationLog') -# vLog.setLevel(logging.DEBUG) -# vLog.propagate = False -# # detailed validation logger -# vLogDetailed = logging.getLogger('validationLogDetailed') -# vLogDetailed.setLevel(logging.DEBUG) -# vLogDetailed.propagate = False - -# # create handlers -# # create handler for overall logger -# log_fh = logging.FileHandler(logoutputpath + 'flowsa.log', -# mode='w', encoding='utf-8') -# log_fh.setFormatter(formatter) -# # create handler for general validation information -# vLog_fh = logging.FileHandler(logoutputpath + 'validation_flowsa.log', -# mode='w', encoding='utf-8') -# vLog_fh.setFormatter(formatter) -# # create console handler -# ch = logging.StreamHandler(sys.stdout) -# ch.setLevel(logging.INFO) -# ch.setFormatter(formatter) - -# # add handlers to various loggers -# # general logger -# log.addHandler(ch) # print to console -# log.addHandler(log_fh) -# vLog.addHandler(log_fh) -# # validation logger -# vLog.addHandler(ch) # print to console -# vLog.addHandler(vLog_fh) -# vLogDetailed.addHandler(vLog_fh) - def return_pkg_version(): # return version with git describe From c8eb87c261fa047b07f735be76dc4c68c3aef9dd Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 3 May 2023 15:15:51 -0400 Subject: [PATCH 0541/1127] consolidate some functions in geo and location --- flowsa/geo.py | 8 +++--- flowsa/location.py | 63 +++------------------------------------------- 2 files changed, 7 insertions(+), 64 deletions(-) diff --git a/flowsa/geo.py b/flowsa/geo.py index e3644d21f..d2872e3a8 100644 --- a/flowsa/geo.py +++ b/flowsa/geo.py @@ -82,10 +82,10 @@ def get_all_fips(year: Literal[2010, 2013, 2015] = 2015) -> pd.DataFrame: def filtered_fips( - geoscale: Literal['national', 'state', 'county', - scale.NATIONAL, scale.STATE, scale.COUNTY], - year: Literal[2010, 2013, 2015] = 2015 -) -> pd.DataFrame: + geoscale: Literal['national', 'state', 'county', + scale.NATIONAL, scale.STATE, scale.COUNTY], + year: Literal[2010, 2013, 2015] = 2015 + ) -> pd.DataFrame: if geoscale == 'national' or geoscale == scale.NATIONAL: return (get_all_fips(year).query('State.isnull()')) elif geoscale == 'state' or geoscale == scale.STATE: diff --git a/flowsa/location.py b/flowsa/location.py index 7ce87e303..360df3cee 100644 --- a/flowsa/location.py +++ b/flowsa/location.py @@ -10,6 +10,7 @@ import pycountry import urllib.error from flowsa.flowsa_log import log +from flowsa.get import get_all_fips from flowsa.settings import datapath from flowsa.common import clean_str_and_capitalize @@ -40,44 +41,6 @@ def read_stored_FIPS(year='2015'): return df -def getFIPS(state=None, county=None, year='2015'): - """ - Pass a state or state and county name to get the FIPS. - - :param state: str. A US State Name or Puerto Rico, any case accepted - :param county: str. A US county - :param year: str. '2010', '2013', '2015', default year is 2015 - :return: str. A five digit FIPS code - """ - FIPS_df = read_stored_FIPS(year) - - # default code - code = None - - if county is None: - if state is not None: - state = clean_str_and_capitalize(state) - code = FIPS_df.loc[(FIPS_df["State"] == state) - & (FIPS_df["County"].isna()), "FIPS"] - else: - log.error("To get state FIPS, state name must be passed in " - "'state' param") - else: - if state is None: - log.error("To get county FIPS, state name must be passed in " - "'state' param") - else: - state = clean_str_and_capitalize(state) - county = clean_str_and_capitalize(county) - code = FIPS_df.loc[(FIPS_df["State"] == state) - & (FIPS_df["County"] == county), "FIPS"] - if code.empty: - log.error("No FIPS code found") - else: - code = code.values[0] - - return code - def apply_county_FIPS(df, year='2015', source_state_abbrev=True): """ @@ -114,26 +77,6 @@ def apply_county_FIPS(df, year='2015', source_state_abbrev=True): return df -def update_geoscale(df, to_scale): - """ - Updates df['Location'] based on specified to_scale - :param df: df, requires Location column - :param to_scale: str, target geoscale - :return: df, with 5 digit fips - """ - # code for when the "Location" is a FIPS based system - if to_scale == 'state': - df = df.assign(Location = (df['Location'] - .apply(lambda x: str(x[0:2])) - .apply(lambda x: - x.ljust(3 + len(x), '0') - if len(x) < 5 else x)) - ) - elif to_scale == 'national': - df = df.assign(Location = US_FIPS) - return df - - def get_state_FIPS(year='2015', abbrev=False): """ Filters FIPS df for state codes only @@ -141,7 +84,7 @@ def get_state_FIPS(year='2015', abbrev=False): :return: FIPS df with only state level records """ - fips = read_stored_FIPS(year) + fips = get_all_fips(year) fips = fips.drop_duplicates(subset='State') fips = fips[fips['State'].notnull()] if abbrev: @@ -155,7 +98,7 @@ def get_county_FIPS(year='2015'): :param year: str, year of FIPS, defaults to 2015 :return: FIPS df with only county level records """ - fips = read_stored_FIPS(year) + fips = get_all_fips(year) fips = fips.drop_duplicates(subset='FIPS') fips = fips[fips['County'].notnull()] return fips From 96c26078f4a1aea0d624c543a37cbc424259dff1 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 3 May 2023 15:18:47 -0400 Subject: [PATCH 0542/1127] drop more deprecated functions --- flowsa/flowbyfunctions.py | 155 +------------------------------------- 1 file changed, 1 insertion(+), 154 deletions(-) diff --git a/flowsa/flowbyfunctions.py b/flowsa/flowbyfunctions.py index ded881970..cc9f509b6 100644 --- a/flowsa/flowbyfunctions.py +++ b/flowsa/flowbyfunctions.py @@ -9,7 +9,7 @@ import numpy as np from esupy.dqi import get_weighted_average import flowsa -from flowsa.common import fbs_activity_fields, sector_level_key, \ +from flowsa.common import \ load_crosswalk, fbs_fill_na_dict, check_activities_sector_like, \ fbs_collapsed_default_grouping_fields, fbs_collapsed_fill_na_dict, \ fba_activity_fields, fba_default_grouping_fields, \ @@ -474,33 +474,6 @@ def assign_fips_location_system(df, year_of_data): return df -def return_primary_sector_column(df_load): - """ - Determine sector column with values - :param fbs: fbs df with two sector columns - :return: string, primary sector column - """ - # determine the df_w_sector column to merge on - if 'Sector' in df_load.columns: - primary_sec_column = 'Sector' - else: - df = replace_strings_with_NoneType(df_load) - sec_consumed_list = \ - df['SectorConsumedBy'].drop_duplicates().values.tolist() - sec_produced_list = \ - df['SectorProducedBy'].drop_duplicates().values.tolist() - # if a sector field column is not all 'none', that is the column to - # merge - if all(v is None for v in sec_consumed_list): - primary_sec_column = 'SectorProducedBy' - elif all(v is None for v in sec_produced_list): - primary_sec_column = 'SectorConsumedBy' - else: - log.error('There are values in both SectorProducedBy and ' - 'SectorConsumedBy, cannot isolate Sector column') - return primary_sec_column - - def collapse_fbs_sectors(fbs): """ Collapses the Sector Produced/Consumed into a single column named "Sector" @@ -980,41 +953,6 @@ def equally_allocate_suppressed_parent_to_child_naics( return dff -def collapse_activity_fields(df): - """ - The 'activityconsumedby' and 'activityproducedby' columns from the - allocation dataset do not always align with - the dataframe being allocated. Generalize the allocation activity column. - :param df: df, FBA used to allocate another FBA - :return: df, single Activity column - """ - - df = replace_strings_with_NoneType(df) - - activity_consumed_list = \ - df['ActivityConsumedBy'].drop_duplicates().values.tolist() - activity_produced_list = \ - df['ActivityProducedBy'].drop_duplicates().values.tolist() - - # if an activity field column is all 'none', drop the column and - # rename renaming activity columns to generalize - if all(v is None for v in activity_consumed_list): - df = df.drop(columns=['ActivityConsumedBy', 'SectorConsumedBy']) - df = df.rename(columns={'ActivityProducedBy': 'Activity', - 'SectorProducedBy': 'Sector'}) - elif all(v is None for v in activity_produced_list): - df = df.drop(columns=['ActivityProducedBy', 'SectorProducedBy']) - df = df.rename(columns={'ActivityConsumedBy': 'Activity', - 'SectorConsumedBy': 'Sector'}) - else: - log.error('Cannot generalize dataframe') - - # drop other columns - df = df.drop(columns=['ProducedBySectorType', 'ConsumedBySectorType']) - - return df - - def load_fba_w_standardized_units(datasource, year, **kwargs): """ Standardize how a FBA is loaded for allocation purposes when @@ -1228,69 +1166,6 @@ def assign_columns_of_sector_levels(df_load): return dfc -def assign_columns_of_sector_levels_without_ambiguous_sectors( - df_load, ambiguous_sector_assignment=None): - - dfc = assign_columns_of_sector_levels(df_load) - - # check for duplicates. Rows might be duplicated if a sector is the same - # for multiple sector lengths - duplicate_cols = [e for e in dfc.columns if e not in [ - 'SectorProducedByLength', 'SectorConsumedByLength']] - duplicate_df = dfc[dfc.duplicated(subset=duplicate_cols, - keep=False)].reset_index(drop=True) - - if (len(duplicate_df) > 0) % (ambiguous_sector_assignment is not None): - log.info('Retaining data for %s and dropping remaining ' - 'rows. See validation log for data dropped', - ambiguous_sector_assignment) - # first drop all data in the duplicate_df from dfc - dfs1 = pd.concat([dfc, duplicate_df]).drop_duplicates(keep=False) - # drop sector length cols, drop duplicates, aggregate df to ensure - # keep the intended data, and then reassign column sectors, - # formatted this way because would like to avoid sector aggreggation - # on large dfs - dfs2 = duplicate_df.drop( - columns=['SectorProducedByLength', - 'SectorConsumedByLength']).drop_duplicates() - dfs2 = sector_aggregation(dfs2) - dfs2 = assign_columns_of_sector_levels(dfs2) - # then in the duplicate df, only keep the rows that match the - # parameter indicated in the function call - sectorlength = sector_level_key[ambiguous_sector_assignment] - dfs2 = dfs2[ - ((dfs2['SectorProducedByLength'] == sectorlength) & - (dfs2['SectorConsumedByLength'] == 0)) - | - ((dfs2['SectorProducedByLength'] == 0) & - (dfs2['SectorConsumedByLength'] == sectorlength)) - | - ((dfs2['SectorProducedByLength'] == sectorlength) & - (dfs2['SectorConsumedByLength'] == sectorlength)) - ].reset_index(drop=True) - if len(dfs2) == 0: - log.warning('Data is lost from dataframe because none of the ' - 'ambiguous sectors match %s', - ambiguous_sector_assignment) - # merge the two dfs - dfc = pd.concat([dfs1, dfs2]) - # print out what data was dropped - df_dropped = pd.merge( - duplicate_df, dfs2, how='left', indicator=True).query( - '_merge=="left_only"').drop('_merge', axis=1) - df_dropped = df_dropped[ - ['SectorProducedBy', 'SectorConsumedBy', - 'SectorProducedByLength', 'SectorConsumedByLength' - ]].drop_duplicates().reset_index(drop=True) - vlog.info('After assigning a column of sector lengths, ' - 'dropped data with the following sector ' - 'assignments due to ambiguous sector lengths ' - '%s: \n {}'.format(df_dropped.to_string())) - dfc = dfc.sort_values(['SectorProducedByLength', - 'SectorConsumedByLength']).reset_index(drop=True) - return dfc - - def assign_sector_match_column(df_load, sectorcolumn, sectorlength, sectorlengthmatch): @@ -1327,31 +1202,3 @@ def aggregate_and_subset_for_target_sectors(df, method): df_subset = subset_df_by_sector_list(df_agg, sector_list) return df_subset - - -def add_attribution_sources_col(df, attr): - """ - Add new column to FBS with the primary data source used for attribution - :param df: - :param attr: - :return: - """ - # first assume method is direct - replace with attribution source if not - # direct - df = df.assign(AttributionSources='Direct') - - # if allocation method is not direct, add data sources - if attr['allocation_method'] != 'direct': - sources = [] - key_list = ['allocation_source'] # , 'helper_source'] - for k in key_list: - s = attr.get(k) - if (s is not None) & (callable(s) is False): - sources.append(s) - if 'literature_sources' in attr: - sources.append('literature values') - # concat sources into single string - allocation_sources = ', '.join(sources) - # update data sources column with additional sources - df = df.assign(AttributionSources=allocation_sources) - return df From 9f198a73f2a939349cd5c9fe327f433acca7dcf9 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 3 May 2023 15:22:35 -0400 Subject: [PATCH 0543/1127] fix typo --- flowsa/location.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/location.py b/flowsa/location.py index 360df3cee..f8d54ce5a 100644 --- a/flowsa/location.py +++ b/flowsa/location.py @@ -10,7 +10,7 @@ import pycountry import urllib.error from flowsa.flowsa_log import log -from flowsa.get import get_all_fips +from flowsa.geo import get_all_fips from flowsa.settings import datapath from flowsa.common import clean_str_and_capitalize From d27434b967f685b25953c9887520a0779140257b Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 3 May 2023 15:27:54 -0400 Subject: [PATCH 0544/1127] deleted wrong function in c8eb87c --- flowsa/location.py | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/flowsa/location.py b/flowsa/location.py index f8d54ce5a..dbb4a34fd 100644 --- a/flowsa/location.py +++ b/flowsa/location.py @@ -22,26 +22,6 @@ "county": 5} -def read_stored_FIPS(year='2015'): - """ - Read fips based on year specified, year defaults to 2015 - :param year: str, '2010', '2013', or '2015', default year is 2015 - because most recent year of FIPS available - :return: df, FIPS for specified year - """ - - FIPS_df = pd.read_csv(datapath + "FIPS_Crosswalk.csv", header=0, dtype=str) - # subset columns by specified year - df = FIPS_df[["State", "FIPS_" + year, "County_" + year]] - # rename columns to drop data year - df.columns = ['State', 'FIPS', 'County'] - # sort df - df = df.sort_values(['FIPS']).reset_index(drop=True) - - return df - - - def apply_county_FIPS(df, year='2015', source_state_abbrev=True): """ Applies FIPS codes by county to dataframe containing columns with State @@ -77,6 +57,26 @@ def apply_county_FIPS(df, year='2015', source_state_abbrev=True): return df +def update_geoscale(df, to_scale): + """ + Updates df['Location'] based on specified to_scale + :param df: df, requires Location column + :param to_scale: str, target geoscale + :return: df, with 5 digit fips + """ + # code for when the "Location" is a FIPS based system + if to_scale == 'state': + df = df.assign(Location = (df['Location'] + .apply(lambda x: str(x[0:2])) + .apply(lambda x: + x.ljust(3 + len(x), '0') + if len(x) < 5 else x)) + ) + elif to_scale == 'national': + df = df.assign(Location = US_FIPS) + return df + + def get_state_FIPS(year='2015', abbrev=False): """ Filters FIPS df for state codes only From 7187523b76dcfcdb2ae6353a908a5f3f1c59f0d1 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 3 May 2023 15:36:00 -0400 Subject: [PATCH 0545/1127] fix import error --- flowsa/sectormapping.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/sectormapping.py b/flowsa/sectormapping.py index 23f8ba58f..0cf3d98b2 100644 --- a/flowsa/sectormapping.py +++ b/flowsa/sectormapping.py @@ -11,9 +11,9 @@ import flowsa from flowsa.common import get_flowsa_base_name, load_env_file_key, \ return_true_source_catalog_name, check_activities_sector_like, \ - load_yaml_dict, fba_activity_fields, SECTOR_SOURCE_NAME + load_yaml_dict, fba_activity_fields, SECTOR_SOURCE_NAME, fbs_activity_fields from flowsa.dataclean import standardize_units -from flowsa.flowbyfunctions import fbs_activity_fields, load_crosswalk +from flowsa.flowbyfunctions import load_crosswalk from flowsa.flowsa_log import log from flowsa.schema import activity_fields, dq_fields From 4680aad3234f6e5b432113accc0dd12e67003254 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 3 May 2023 16:40:54 -0400 Subject: [PATCH 0546/1127] initial update for generalized flow per employee function implemented for CNHW --- .../CalRecycle_WasteCharacterization.py | 158 ++++++++++-------- .../CNHW_national_2014.yaml | 12 +- 2 files changed, 96 insertions(+), 74 deletions(-) diff --git a/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py b/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py index 73b2289dd..111df7f4c 100644 --- a/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py +++ b/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py @@ -13,6 +13,7 @@ import os import pandas as pd import numpy as np +import flowsa.flowby from flowsa.flowbyfunctions import assign_fips_location_system, \ load_fba_w_standardized_units, \ aggregate_and_subset_for_target_sectors @@ -111,77 +112,90 @@ def calR_parse(*, year, **_): return output -def keep_generated_quantity(fba, **_): +def calculate_flow_per_employee(fbs, **_): """ - Function to clean CalRecycles FBA to remove quantities not - assigned as Generated - :param fba: df, FBA format - :return: df, modified CalRecycles FBA + Calculates FlowAmount per employee per year based on dataset name passed + in "clean_parameter" + clean_fbs function """ - fba = fba[fba['Description'] == 'Generated'].reset_index(drop=True) - # if no mapping performed, still update units - if 'tons' in fba['Unit'].values: - fba = standardize_units(fba) - return fba - - -def load_and_clean_employment_data_for_cnhw(fbs, year, method, - geographic_level='state'): - from flowsa.data_source_scripts.BLS_QCEW import \ - bls_clean_allocation_fba_w_sec - bls = load_fba_w_standardized_units(datasource='BLS_QCEW', - year=year, - flowclass='Employment', - geographic_level=geographic_level) - bls = add_sectors_to_flowbyactivity(bls) - # estimate suppressed employment data - bls = bls_clean_allocation_fba_w_sec(bls, method=method) - - # Subset BLS dataset - fbs_sectors = fbs['SectorProducedBy'].unique() - sector_list = list(filter(None, fbs_sectors)) - bls = get_fba_allocation_subset(bls, 'BLS_QCEW', sector_list) - bls = bls.rename(columns={'FlowAmount': 'Employees'}) - bls = bls[['Employees', 'Location', 'Year', 'SectorProducedBy']] - return bls - - -def apply_tons_per_employee_per_year_to_states(fbs, **_): - """ - Calculates tons per employee per year based on BLS_QCEW employees - by sector and applies that quantity to employees in all states - clean_fbs_df_fxn - """ - # load bls employment data for the year of CalRecycle data - bls = load_and_clean_employment_data_for_cnhw( - fbs, year=fbs['Year'].unique()[0], method=fbs.config) - # Calculate tons per employee per year per material and sector in CA - bls_CA = bls[bls['Location'] == '06000'] # California - # aggregate all employment prior to generating tpepy - bls_CA = (bls_CA.groupby(['Location', 'Year', 'SectorProducedBy']) - .agg({'Employees': 'sum'}) - .reset_index()) - tpepy = fbs.merge(bls_CA, how='inner') - tpepy['TPEPY'] = np.divide(tpepy['FlowAmount'], tpepy['Employees'], - out=np.zeros_like(tpepy['Employees']), - where=tpepy['Employees'] != 0) - tpepy = tpepy.drop(columns=['Employees', 'FlowAmount', 'Location', 'Year']) - - # Apply TPEPY back to all employees in all states for year identified in - # method, overwrite geoscale based on target geoscale identified in method - bls2 = load_and_clean_employment_data_for_cnhw( - fbs, year=fbs.config['year'], method=fbs.config, - geographic_level=fbs.config['geoscale']) - national_waste = tpepy.merge(bls2, how='left') - national_waste['Year'] = fbs.config['year'] - national_waste['FlowAmount'] = \ - national_waste['Employees'] * national_waste['TPEPY'] - national_waste = national_waste.drop(columns=['TPEPY', 'Employees']) - - df = aggregate_and_subset_for_target_sectors(national_waste, - national_waste.config) - # Ensure config remains on the dataframe - df.config = national_waste.config - df = replace_strings_with_NoneType(df) - - return df + bls = flowsa.flowby.get_flowby_from_config( + name=fbs.config.get('clean_parameter')['name'], + config={**{k: v for k, v in fbs.config.items() + if k in fbs.config['method_config_keys']}, + **fbs.config.get('clean_parameter')} + ) + cols = ['Location', 'Year', 'SectorProducedBy'] + fbs = (fbs.merge(bls.rename(columns={'FlowAmount': 'Employees'}) + .groupby(cols).agg({'Employees': 'sum'}) + .reset_index(), + how='inner', + on = cols) + .assign(FlowAmount = lambda x: + np.divide(x['FlowAmount'], x['Employees'], + out=np.zeros_like(x['Employees']), + where=x['Employees'] != 0)) + .assign(Unit = lambda x: x['Unit'] + ' per employee') + .drop(columns=['Employees']) + ) + return fbs + +# def load_and_clean_employment_data_for_cnhw(fbs, year, method, +# geographic_level='state'): +# from flowsa.data_source_scripts.BLS_QCEW import \ +# bls_clean_allocation_fba_w_sec +# bls = load_fba_w_standardized_units(datasource='BLS_QCEW', +# year=year, +# flowclass='Employment', +# geographic_level=geographic_level) +# bls = add_sectors_to_flowbyactivity(bls) +# # estimate suppressed employment data +# bls = bls_clean_allocation_fba_w_sec(bls, method=method) + +# # Subset BLS dataset +# fbs_sectors = fbs['SectorProducedBy'].unique() +# sector_list = list(filter(None, fbs_sectors)) +# bls = get_fba_allocation_subset(bls, 'BLS_QCEW', sector_list) +# bls = bls.rename(columns={'FlowAmount': 'Employees'}) +# bls = bls[['Employees', 'Location', 'Year', 'SectorProducedBy']] +# return bls + + +# def apply_tons_per_employee_per_year_to_states(fbs, **_): +# """ +# Calculates tons per employee per year based on BLS_QCEW employees +# by sector and applies that quantity to employees in all states +# clean_fbs_df_fxn +# """ +# # load bls employment data for the year of CalRecycle data +# bls = load_and_clean_employment_data_for_cnhw( +# fbs, year=fbs['Year'].unique()[0], method=fbs.config) +# # Calculate tons per employee per year per material and sector in CA +# bls_CA = bls[bls['Location'] == '06000'] # California +# # aggregate all employment prior to generating tpepy +# bls_CA = (bls_CA.groupby(['Location', 'Year', 'SectorProducedBy']) +# .agg({'Employees': 'sum'}) +# .reset_index()) +# tpepy = fbs.merge(bls_CA, how='inner') +# tpepy['TPEPY'] = np.divide(tpepy['FlowAmount'], tpepy['Employees'], +# out=np.zeros_like(tpepy['Employees']), +# where=tpepy['Employees'] != 0) +# tpepy = tpepy.drop(columns=['Employees', 'FlowAmount', 'Location', 'Year']) + +# # Apply TPEPY back to all employees in all states for year identified in +# # method, overwrite geoscale based on target geoscale identified in method +# bls2 = load_and_clean_employment_data_for_cnhw( +# fbs, year=fbs.config['year'], method=fbs.config, +# geographic_level=fbs.config['geoscale']) +# national_waste = tpepy.merge(bls2, how='left') +# national_waste['Year'] = fbs.config['year'] +# national_waste['FlowAmount'] = \ +# national_waste['Employees'] * national_waste['TPEPY'] +# national_waste = national_waste.drop(columns=['TPEPY', 'Employees']) + +# df = aggregate_and_subset_for_target_sectors(national_waste, +# national_waste.config) +# # Ensure config remains on the dataframe +# df.config = national_waste.config +# df = replace_strings_with_NoneType(df) + +# return df diff --git a/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml b/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml index e152b6244..ce0338fd1 100644 --- a/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml @@ -10,5 +10,13 @@ target_sector_level: NAICS_6 source_names: CNHW_CA_2014: data_format: FBS - clean_fbs: !script_function:CalRecycle_WasteCharacterization apply_tons_per_employee_per_year_to_states - year: 2014 + clean_fbs: !script_function:CalRecycle_WasteCharacterization calculate_flow_per_employee + clean_parameter: + name: Employment_state_2014 + data_format: FBS + attribution_method: multiplication + attribution_source: + Employment_state_2014: + year: 2014 + geoscale: state + attribution_method: direct From 82af6df727fdb3d34d3447d7e27e0a45a5eeacdd Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 3 May 2023 21:46:32 -0400 Subject: [PATCH 0547/1127] reset dq fields to None --- flowsa/flowby.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index a0067523b..07e474cdc 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -2040,6 +2040,14 @@ def generateFlowBySector( # aggregate to target sector fbs = fbs.sector_aggregation() + # set all data quality fields to none until implemented fully + log.info('Reset all data quality fields to None') + dq_cols = ['Spread', 'Min', 'Max', + 'DataReliability', 'TemporalCorrelation', + 'GeographicalCorrelation', 'TechnologicalCorrelation', + 'DataCollection'] + fbs = fbs.assign(**dict.fromkeys(dq_cols, None)) + # Save fbs and metadata log.info(f'FBS generation complete, saving {method} to file') meta = metadata.set_fb_meta(method, 'FlowBySector') From 74f86cb7b352742e32f87464c0376730de11b707 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 5 May 2023 10:30:20 -0400 Subject: [PATCH 0548/1127] update EPA_StateGHGI to use public posted zip file --- flowsa/data_source_scripts/EPA_StateGHGI.py | 31 ++++++++++++++----- .../flowbyactivitymethods/EPA_StateGHGI.yaml | 9 ++++-- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_StateGHGI.py b/flowsa/data_source_scripts/EPA_StateGHGI.py index aa94fd616..e9a646f45 100644 --- a/flowsa/data_source_scripts/EPA_StateGHGI.py +++ b/flowsa/data_source_scripts/EPA_StateGHGI.py @@ -5,20 +5,35 @@ Inventory of US GHGs from EPA disaggregated to States """ import pandas as pd -from flowsa.settings import externaldatapath +import io +from zipfile import ZipFile from flowsa.location import apply_county_FIPS from flowsa.flowbyfunctions import assign_fips_location_system import flowsa.exceptions -def epa_state_ghgi_parse(*, source, year, config, **_): +def epa_state_ghgi_call(*, resp, config, **_): + """ + Convert response for calling url to pandas dataframe + :param resp: response from url call + :param config: dictionary, items in FBA method yaml + :return: pandas dataframe of original source data + """ + with ZipFile(io.BytesIO(resp.content)) as z: + df = pd.read_excel(z.open(config['file']), + sheet_name=config['sheet']) + return df - try: - data_df = pd.read_excel(externaldatapath + config.get('file'), - sheet_name='Data by Econ Sect') - except FileNotFoundError: - raise FileNotFoundError('State GHGI data not yet available for ' - 'external users') +def epa_state_ghgi_parse(*, df_list, source, year, config, **_): + """ + Combine, parse, and format the provided dataframes + :param df_list: list of dataframes to concat and format + :param year: year + :param config: dictionary, items in FBA method yaml + :return: df, parsed and partially formatted to flowbyactivity + specifications + """ + data_df = pd.concat(df_list) activity_cols = ['ECON_SECTOR', 'ECON_SOURCE', 'SUBSECTOR', 'CATEGORY', 'FUEL', 'SUBCATEGORY1', diff --git a/flowsa/methods/flowbyactivitymethods/EPA_StateGHGI.yaml b/flowsa/methods/flowbyactivitymethods/EPA_StateGHGI.yaml index 43eb89bda..2be40a492 100644 --- a/flowsa/methods/flowbyactivitymethods/EPA_StateGHGI.yaml +++ b/flowsa/methods/flowbyactivitymethods/EPA_StateGHGI.yaml @@ -2,10 +2,13 @@ author: US Environmental Protection Agency source_name: 'State Greenhouse Gas Inventories' source_url: 'https://www.epa.gov/ghgemissions/state-ghg-emissions-and-removals' bib_id: '' -format: xlsx -url: None +format: zip # .zip file with .xlsx file +url: + base_url: 'https://www.epa.gov/system/files/other-files/2023-04/AllStateData%2BReadMe_042623_2.zip' +call_response_fxn: !script_function:EPA_StateGHGI epa_state_ghgi_call parse_response_fxn: !script_function:EPA_StateGHGI epa_state_ghgi_parse -file: "PowerUsers Combined Draft 03172023.xlsx" +file: 'AllStateGHGData_042623.xlsx' +sheet: 'Data by Econ Sect' years: - 2020 - 2019 From e29becfabd9af951ba068c7207e20d412f4fb7a1 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 9 May 2023 10:15:36 -0400 Subject: [PATCH 0549/1127] update NEI nonpoint data with 2020 --- flowsa/data_source_scripts/EPA_NEI.py | 15 +++++++++++++-- .../flowbyactivitymethods/EPA_NEI_Common.yaml | 6 ++++-- .../flowbyactivitymethods/EPA_NEI_Nonpoint.yaml | 3 +++ .../flowbyactivitymethods/EPA_NEI_Nonroad.yaml | 5 ++++- .../flowbyactivitymethods/EPA_NEI_Onroad.yaml | 5 ++++- 5 files changed, 28 insertions(+), 6 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_NEI.py b/flowsa/data_source_scripts/EPA_NEI.py index 062739d10..4ec138754 100644 --- a/flowsa/data_source_scripts/EPA_NEI.py +++ b/flowsa/data_source_scripts/EPA_NEI.py @@ -30,8 +30,14 @@ def epa_nei_url_helper(*, build_url, year, config, **_): version_dict = config['version_dict'] url = (build_url .replace('__year__', year) - .replace('__version__', version_dict[year])) - + .replace('__version__', version_dict[year]) + .replace('__suffix__', config['url'] + .get('suffix', {}) + .get(year, config['url'] + .get('suffix', {}) + .get('base', '')) + ) + ) return [url] @@ -214,3 +220,8 @@ def remove_flow_overlap(df, aggregate_flow, contributing_flows): df.loc[((df.FlowName == aggregate_flow) & (df.FlowAmount <= 0)), "FlowAmount"] = 0 return df + +if __name__ == '__main__': + import flowsa + flowsa.flowbyactivity.main(source='EPA_NEI_Onroad', year='2020') + fba = flowsa.getFlowByActivity('EPA_NEI_Onroad', '2020') diff --git a/flowsa/methods/flowbyactivitymethods/EPA_NEI_Common.yaml b/flowsa/methods/flowbyactivitymethods/EPA_NEI_Common.yaml index f45c01c98..df29a5e85 100644 --- a/flowsa/methods/flowbyactivitymethods/EPA_NEI_Common.yaml +++ b/flowsa/methods/flowbyactivitymethods/EPA_NEI_Common.yaml @@ -11,7 +11,9 @@ years: - 2011 - 2014 - 2017 +- 2020 version_dict: + '2020': '2020nei' '2017': '2017v1/2017neiApr' '2014': '2014v2/2014neiv2' '2011': '2011v2/2011neiv2' @@ -29,11 +31,11 @@ col_dict: '2014': <<: *col_dict "FlowName": "pollutant_desc" - '2017': - <<: *col_dict + '2017': &col_dict_2017 "FlowName": "pollutant desc" "FlowAmount": "total emissions" "ActivityProducedBy": "scc" "Location": "fips code" "Unit": "emissions uom" "Description": "pollutant code" + '2020': *col_dict_2017 diff --git a/flowsa/methods/flowbyactivitymethods/EPA_NEI_Nonpoint.yaml b/flowsa/methods/flowbyactivitymethods/EPA_NEI_Nonpoint.yaml index f18800f33..6f74011e9 100644 --- a/flowsa/methods/flowbyactivitymethods/EPA_NEI_Nonpoint.yaml +++ b/flowsa/methods/flowbyactivitymethods/EPA_NEI_Nonpoint.yaml @@ -3,3 +3,6 @@ bib_id: EPA_NEI_Nonpoint url: # no replacement needed in url because only single zip file base_url: ftp://newftp.epa.gov/air/nei/__year__/data_summaries/__version___nonpoint.zip parse_response_fxn: !script_function:EPA_NEI epa_nei_nonpoint_parse +version_dict: + !include:EPA_NEI_Common.yaml:version_dict + '2020': '2020neiMar' # 2020 NEI Nonpoint has unique URL diff --git a/flowsa/methods/flowbyactivitymethods/EPA_NEI_Nonroad.yaml b/flowsa/methods/flowbyactivitymethods/EPA_NEI_Nonroad.yaml index 91f9b297f..c1341b49c 100644 --- a/flowsa/methods/flowbyactivitymethods/EPA_NEI_Nonroad.yaml +++ b/flowsa/methods/flowbyactivitymethods/EPA_NEI_Nonroad.yaml @@ -1,5 +1,8 @@ !include:EPA_NEI_Common.yaml bib_id: EPA_NEI_Nonroad url: # no replacement needed in url because only single zip file - base_url: ftp://newftp.epa.gov/air/nei/__year__/data_summaries/__version___nonroad_byregions.zip + base_url: ftp://newftp.epa.gov/air/nei/__year__/data_summaries/__version_____suffix__.zip + suffix: + base: nonroad_byregions + '2020': nonroad_byregion parse_response_fxn: !script_function:EPA_NEI epa_nei_nonroad_parse diff --git a/flowsa/methods/flowbyactivitymethods/EPA_NEI_Onroad.yaml b/flowsa/methods/flowbyactivitymethods/EPA_NEI_Onroad.yaml index bc4ff5705..1a7bdf295 100644 --- a/flowsa/methods/flowbyactivitymethods/EPA_NEI_Onroad.yaml +++ b/flowsa/methods/flowbyactivitymethods/EPA_NEI_Onroad.yaml @@ -1,5 +1,8 @@ !include:EPA_NEI_Common.yaml bib_id: EPA_NEI_Onroad url: # no replacement needed in url because only single zip file - base_url: ftp://newftp.epa.gov/air/nei/__year__/data_summaries/__version___onroad_byregions.zip + base_url: ftp://newftp.epa.gov/air/nei/__year__/data_summaries/__version_____suffix__.zip + suffix: + base: onroad_byregions + '2020': onroad_byregion parse_response_fxn: !script_function:EPA_NEI epa_nei_onroad_parse From 6c63a8ee49c4c17b3a13a2ff124ecd9cf7a8bf01 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 9 May 2023 14:41:20 -0400 Subject: [PATCH 0550/1127] use CAP_HAP common method to align methods across years; add CAP_HAP_2020 --- .../flowbysectormethods/CAP_HAP_common.yaml | 294 ++++++++++++++++++ .../CAP_HAP_national_2017.yaml | 270 +--------------- .../CAP_HAP_national_2020.yaml | 57 ++++ 3 files changed, 368 insertions(+), 253 deletions(-) create mode 100644 flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml create mode 100644 flowsa/methods/flowbysectormethods/CAP_HAP_national_2020.yaml diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml new file mode 100644 index 000000000..79844fa19 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml @@ -0,0 +1,294 @@ +# This is the general method reference file. +# Year-specific CAP_HAP files import this file to define attribution rules +# that are further customized + +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: national + +sources_to_cache: + EIA_MECS_Energy: + # year: 2018 # Specify target MECS year + selection_fields: + Class: Energy + Unit: Trillion Btu + Location: '00000' + Description: + - Table 2.2 + - Table 3.2 + estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy + clean_fba: !script_function:EIA_MECS clean_mecs_energy_fba + clean_fba_w_sec: !script_function:EIA_MECS clean_mapped_mecs_energy_fba + attribution_method: proportional + # attribution_source: + # Employment_national_2018: # Use target MECS year + # data_format: FBS + # year: 2018 + +_attribution_sources: + BEA: &bea + year: 2012 + geoscale: national + activity_to_sector_mapping: BEA_2012_Detail + attribution_method: proportional + attribution_source: + Employment_national_2012: + data_format: FBS + year: 2012 + + USDA_CoA_Cropland: &cropland_allocation + year: 2017 + geoscale: state + selection_fields: + Class: Land + FlowName: AREA HARVESTED + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + year: 2017 + geoscale: state + selection_fields: + Class: Land + FlowName: AG LAND, CROPLAND, HARVESTED + + USDA_CoA_Livestock: &livestock_allocation + year: 2017 + geoscale: state + selection_fields: + Class: Other + FlowName: + - HEAD + - NUMBER + - COLONIES + Compartment: NOT SPECIFIED + +source_names: + EPA_NEI_Nonpoint: + geoscale: state + # year: 2017 # Replace with data year + primary_action_type: Produced + activity_to_sector_mapping: SCC + exclusion_fields: + FlowName: + - PM10-Primary from certain diesel engines + - PM25-Primary from certain diesel engines + - Carbon Dioxide + - Methane + - Nitrous Oxide + - Sulfur Hexafluoride + clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba + fedefl_mapping: NEI + drop_unmapped_rows: True + activity_sets: + direct_allocation: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv direct_allocation + attribution_method: direct + + cropland: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv cropland + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland: *cropland_allocation + + industry_combustion_coal: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_coal + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + selection_fields: + Flowable: Coal + + industry_combustion_coke: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_coke + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + selection_fields: + Flowable: Coke and Breeze + + industry_combustion_distillate: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_distillate + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + selection_fields: + Flowable: Distillate Fuel Oil + + industry_combustion_hgl: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_hgl + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + selection_fields: + Flowable: Hydrocarbon Gas Liquids, excluding natural gasoline + + industry_combustion_nat_gas: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_nat_gas + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + selection_fields: + Flowable: Natural Gas + + industry_combustion_other: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_other + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + selection_fields: + Flowable: Other + + industry_combustion_residual: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_residual + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + selection_fields: + Flowable: Residual Fuel Oil + + livestock: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv livestock + attribution_method: proportional + attribution_source: + USDA_CoA_Livestock: *livestock_allocation + + mobile_and_fuel_storage: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv mobile_and_fuel_storage + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # Petroleum + + fertilizers: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv fertilizers + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + + pesticides: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv pesticides + exclusion_fields: + # To avoid overlap with other datasets, emissions of pesticides + # from pesticide application are removed. + FlowName: + - 2,4-Dichlorophenoxy Acetic Acid + - Captan + - Carbaryl + - Methyl Bromide + - Methyl Iodide + - Parathion + - Trifluralin + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325320': ''} # Pesticides + + output_allocation: # Gross Output + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv output_allocation + attribution_method: proportional + # attribution_source: # document in primary method file + # BEA_GDP_GrossOutput: + # year: 2017 + # geoscale: national + # activity_to_sector_mapping: BEA_2012_Detail + # selection_fields: + # Class: Money + # FlowName: Gross Output + # attribution_method: proportional + # attribution_source: + # Employment_national_2017: + # data_format: FBS + # year: 2017 + + + EPA_NEI_Nonroad: + geoscale: state + # year: 2017 # Replace with data year + primary_action_type: Produced + activity_to_sector_mapping: SCC + exclusion_fields: + FlowName: + - PM10-Primary from certain diesel engines + - PM25-Primary from certain diesel engines + - Carbon Dioxide + - Methane + - Nitrous Oxide + - Sulfur Hexafluoride + clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba + fedefl_mapping: NEI + drop_unmapped_rows: True + activity_sets: + direct_allocation: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonroad_2017_asets.csv direct_allocation + attribution_method: direct + + offroad_vehicles_equipment: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonroad_2017_asets.csv offroad_vehicles_equipment + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # Petroleum + + EPA_NEI_Onroad: + geoscale: state + # year: 2017 # Replace with data year + primary_action_type: Produced + activity_to_sector_mapping: SCC + exclusion_fields: + FlowName: + - PM10-Primary from certain diesel engines + - PM25-Primary from certain diesel engines + - Carbon Dioxide + - Methane + - Nitrous Oxide + - Sulfur Hexafluoride + clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba + fedefl_mapping: NEI + drop_unmapped_rows: True + activity_sets: + direct_allocation: + selection_fields: + PrimaryActivity: !from_index:NEI_Onroad_2017_asets.csv direct_allocation + attribution_method: direct + + onroad_vehicles_gas_stations: + selection_fields: + PrimaryActivity: !from_index:NEI_Onroad_2017_asets.csv onroad_vehicles_gas_stations + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # Petroleum + + stewiFBS: !include:stewiFBS_common.yaml:CAP_HAP + inventory_dict: + NEI: 2017 + TRI: 2017 + local_inventory_name: NEI_TRI_air_2017 diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index bee044b65..12726253f 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -1,207 +1,28 @@ +# This is the 2017 target year method for CAP_HAP which builds off the generic +# method in CAP_HAP_common industry_spec: default: NAICS_6 -year: 2017 target_naics_year: 2012 geoscale: national +_emission_year: &year 2017 + sources_to_cache: EIA_MECS_Energy: - year: 2014 - selection_fields: - Class: Energy - Unit: Trillion Btu - Location: '00000' - Description: - - Table 2.2 - - Table 3.2 - estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy - clean_fba: !script_function:EIA_MECS clean_mecs_energy_fba - clean_fba_w_sec: !script_function:EIA_MECS clean_mapped_mecs_energy_fba - attribution_method: proportional + !include:CAP_HAP_common.yaml:sources_to_cache:EIA_MECS_Energy + year: 2018 attribution_source: - Employment_national_2014: + Employment_national_2018: data_format: FBS - year: 2014 - -_attribution_sources: - BEA: &bea - year: 2012 - geoscale: national - activity_to_sector_mapping: BEA_2012_Detail - attribution_method: proportional - attribution_source: - Employment_national_2012: - data_format: FBS - year: 2012 - - USDA_CoA_Cropland: &cropland_allocation - year: 2017 - geoscale: state - selection_fields: - Class: Land - FlowName: AREA HARVESTED - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland_NAICS: - year: 2017 - geoscale: state - selection_fields: - Class: Land - FlowName: AG LAND, CROPLAND, HARVESTED - - USDA_CoA_Livestock: &livestock_allocation - year: 2017 - geoscale: state - selection_fields: - Class: Other - FlowName: - - HEAD - - NUMBER - - COLONIES - Compartment: NOT SPECIFIED + year: 2018 source_names: EPA_NEI_Nonpoint: - geoscale: state - year: 2017 - primary_action_type: Produced - activity_to_sector_mapping: SCC - exclusion_fields: - FlowName: - - PM10-Primary from certain diesel engines - - PM25-Primary from certain diesel engines - - Carbon Dioxide - - Methane - - Nitrous Oxide - - Sulfur Hexafluoride - clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba - fedefl_mapping: NEI - drop_unmapped_rows: True + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint + year: *year activity_sets: - direct_allocation: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv direct_allocation - attribution_method: direct - - cropland: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv cropland - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland: *cropland_allocation - - industry_combustion_coal: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_coal - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - selection_fields: - Flowable: Coal - - industry_combustion_coke: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_coke - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - selection_fields: - Flowable: Coke and Breeze - - industry_combustion_distillate: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_distillate - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - selection_fields: - Flowable: Distillate Fuel Oil - - industry_combustion_hgl: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_hgl - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - selection_fields: - Flowable: Hydrocarbon Gas Liquids, excluding natural gasoline - - industry_combustion_nat_gas: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_nat_gas - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - selection_fields: - Flowable: Natural Gas - - industry_combustion_other: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_other - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - selection_fields: - Flowable: Other - - industry_combustion_residual: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_residual - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - selection_fields: - Flowable: Residual Fuel Oil - - livestock: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv livestock - attribution_method: proportional - attribution_source: - USDA_CoA_Livestock: *livestock_allocation - - mobile_and_fuel_storage: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv mobile_and_fuel_storage - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'324110': ''} # Petroleum - - fertilizers: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv fertilizers - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers - - pesticides: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv pesticides - exclusion_fields: - # To avoid overlap with other datasets, emissions of pesticides - # from pesticide application are removed. - FlowName: - - 2,4-Dichlorophenoxy Acetic Acid - - Captan - - Carbaryl - - Methyl Bromide - - Methyl Iodide - - Parathion - - Trifluralin - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'325320': ''} # Pesticides - + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets output_allocation: # Gross Output selection_fields: PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv output_allocation @@ -220,73 +41,16 @@ source_names: data_format: FBS year: 2017 - EPA_NEI_Nonroad: - geoscale: state - year: 2017 - primary_action_type: Produced - activity_to_sector_mapping: SCC - exclusion_fields: - FlowName: - - PM10-Primary from certain diesel engines - - PM25-Primary from certain diesel engines - - Carbon Dioxide - - Methane - - Nitrous Oxide - - Sulfur Hexafluoride - clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba - fedefl_mapping: NEI - drop_unmapped_rows: True - activity_sets: - direct_allocation: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonroad_2017_asets.csv direct_allocation - attribution_method: direct - - offroad_vehicles_equipment: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonroad_2017_asets.csv offroad_vehicles_equipment - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'324110': ''} # Petroleum + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad + year: *year EPA_NEI_Onroad: - geoscale: state - year: 2017 - primary_action_type: Produced - activity_to_sector_mapping: SCC - exclusion_fields: - FlowName: - - PM10-Primary from certain diesel engines - - PM25-Primary from certain diesel engines - - Carbon Dioxide - - Methane - - Nitrous Oxide - - Sulfur Hexafluoride - clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba - fedefl_mapping: NEI - drop_unmapped_rows: True - activity_sets: - direct_allocation: - selection_fields: - PrimaryActivity: !from_index:NEI_Onroad_2017_asets.csv direct_allocation - attribution_method: direct - - onroad_vehicles_gas_stations: - selection_fields: - PrimaryActivity: !from_index:NEI_Onroad_2017_asets.csv onroad_vehicles_gas_stations - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'324110': ''} # Petroleum + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad + year: *year stewiFBS: !include:stewiFBS_common.yaml:CAP_HAP inventory_dict: - NEI: 2017 - TRI: 2017 + NEI: *year + TRI: *year local_inventory_name: NEI_TRI_air_2017 diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2020.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2020.yaml new file mode 100644 index 000000000..ee8331030 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2020.yaml @@ -0,0 +1,57 @@ +# This is the 2020 target year method for CAP_HAP which builds off the generic +# method in CAP_HAP_common + +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: national + +_emission_year: &year 2020 + +sources_to_cache: + EIA_MECS_Energy: + !include:CAP_HAP_common.yaml:sources_to_cache:EIA_MECS_Energy + year: 2018 + attribution_source: + Employment_national_2018: + data_format: FBS + year: 2018 + +source_names: + EPA_NEI_Nonpoint: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint + year: *year + activity_sets: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets + output_allocation: # Gross Output + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv output_allocation + attribution_method: proportional + attribution_source: + BEA_GDP_GrossOutput: + year: 2020 + geoscale: national + activity_to_sector_mapping: BEA_2012_Detail + selection_fields: + Class: Money + FlowName: Gross Output + attribution_method: proportional + attribution_source: + Employment_national_2020: + data_format: FBS + year: 2020 + + + EPA_NEI_Nonroad: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad + year: *year + + EPA_NEI_Onroad: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad + year: *year + + stewiFBS: !include:stewiFBS_common.yaml:CAP_HAP + inventory_dict: + NEI: *year + TRI: *year + local_inventory_name: NEI_TRI_air_2020 From 84fdf9185c383bb892a6081ab725615fde0e7aa8 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 9 May 2023 14:44:27 -0400 Subject: [PATCH 0551/1127] drop year from aset file name --- ..._2017_asets.csv => NEI_Nonpoint_asets.csv} | 0 ...d_2017_asets.csv => NEI_Nonroad_asets.csv} | 0 ...ad_2017_asets.csv => NEI_Onroad_asets.csv} | 0 .../flowbysectormethods/CAP_HAP_common.yaml | 44 +++++++++---------- .../CAP_HAP_national_2017.yaml | 2 +- .../CAP_HAP_national_2020.yaml | 2 +- .../CAP_HAP_state_2017.yaml | 36 +++++++-------- 7 files changed, 42 insertions(+), 42 deletions(-) rename flowsa/methods/flowbysectoractivitysets/{NEI_Nonpoint_2017_asets.csv => NEI_Nonpoint_asets.csv} (100%) rename flowsa/methods/flowbysectoractivitysets/{NEI_Nonroad_2017_asets.csv => NEI_Nonroad_asets.csv} (100%) rename flowsa/methods/flowbysectoractivitysets/{NEI_Onroad_2017_asets.csv => NEI_Onroad_asets.csv} (100%) diff --git a/flowsa/methods/flowbysectoractivitysets/NEI_Nonpoint_2017_asets.csv b/flowsa/methods/flowbysectoractivitysets/NEI_Nonpoint_asets.csv similarity index 100% rename from flowsa/methods/flowbysectoractivitysets/NEI_Nonpoint_2017_asets.csv rename to flowsa/methods/flowbysectoractivitysets/NEI_Nonpoint_asets.csv diff --git a/flowsa/methods/flowbysectoractivitysets/NEI_Nonroad_2017_asets.csv b/flowsa/methods/flowbysectoractivitysets/NEI_Nonroad_asets.csv similarity index 100% rename from flowsa/methods/flowbysectoractivitysets/NEI_Nonroad_2017_asets.csv rename to flowsa/methods/flowbysectoractivitysets/NEI_Nonroad_asets.csv diff --git a/flowsa/methods/flowbysectoractivitysets/NEI_Onroad_2017_asets.csv b/flowsa/methods/flowbysectoractivitysets/NEI_Onroad_asets.csv similarity index 100% rename from flowsa/methods/flowbysectoractivitysets/NEI_Onroad_2017_asets.csv rename to flowsa/methods/flowbysectoractivitysets/NEI_Onroad_asets.csv diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml index 79844fa19..2c53a52c1 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml @@ -83,19 +83,19 @@ source_names: activity_sets: direct_allocation: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv direct_allocation + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv direct_allocation attribution_method: direct cropland: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv cropland + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv cropland attribution_method: proportional attribution_source: USDA_CoA_Cropland: *cropland_allocation industry_combustion_coal: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_coal + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv industry_combustion_coal attribution_method: proportional attribution_source: EIA_MECS_Energy: @@ -104,7 +104,7 @@ source_names: industry_combustion_coke: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_coke + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv industry_combustion_coke attribution_method: proportional attribution_source: EIA_MECS_Energy: @@ -113,7 +113,7 @@ source_names: industry_combustion_distillate: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_distillate + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv industry_combustion_distillate attribution_method: proportional attribution_source: EIA_MECS_Energy: @@ -122,7 +122,7 @@ source_names: industry_combustion_hgl: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_hgl + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv industry_combustion_hgl attribution_method: proportional attribution_source: EIA_MECS_Energy: @@ -131,7 +131,7 @@ source_names: industry_combustion_nat_gas: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_nat_gas + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv industry_combustion_nat_gas attribution_method: proportional attribution_source: EIA_MECS_Energy: @@ -140,7 +140,7 @@ source_names: industry_combustion_other: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_other + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv industry_combustion_other attribution_method: proportional attribution_source: EIA_MECS_Energy: @@ -149,7 +149,7 @@ source_names: industry_combustion_residual: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_residual + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv industry_combustion_residual attribution_method: proportional attribution_source: EIA_MECS_Energy: @@ -158,14 +158,14 @@ source_names: livestock: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv livestock + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv livestock attribution_method: proportional attribution_source: USDA_CoA_Livestock: *livestock_allocation mobile_and_fuel_storage: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv mobile_and_fuel_storage + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv mobile_and_fuel_storage attribution_method: proportional attribution_source: BEA_Use_Detail_PRO_BeforeRedef: @@ -175,7 +175,7 @@ source_names: fertilizers: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv fertilizers + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv fertilizers attribution_method: proportional attribution_source: BEA_Use_Detail_PRO_BeforeRedef: @@ -185,7 +185,7 @@ source_names: pesticides: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv pesticides + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv pesticides exclusion_fields: # To avoid overlap with other datasets, emissions of pesticides # from pesticide application are removed. @@ -206,7 +206,7 @@ source_names: output_allocation: # Gross Output selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv output_allocation + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv output_allocation attribution_method: proportional # attribution_source: # document in primary method file # BEA_GDP_GrossOutput: @@ -242,12 +242,12 @@ source_names: activity_sets: direct_allocation: selection_fields: - PrimaryActivity: !from_index:NEI_Nonroad_2017_asets.csv direct_allocation + PrimaryActivity: !from_index:NEI_Nonroad_asets.csv direct_allocation attribution_method: direct offroad_vehicles_equipment: selection_fields: - PrimaryActivity: !from_index:NEI_Nonroad_2017_asets.csv offroad_vehicles_equipment + PrimaryActivity: !from_index:NEI_Nonroad_asets.csv offroad_vehicles_equipment attribution_method: proportional attribution_source: BEA_Use_Detail_PRO_BeforeRedef: @@ -274,12 +274,12 @@ source_names: activity_sets: direct_allocation: selection_fields: - PrimaryActivity: !from_index:NEI_Onroad_2017_asets.csv direct_allocation + PrimaryActivity: !from_index:NEI_Onroad_asets.csv direct_allocation attribution_method: direct onroad_vehicles_gas_stations: selection_fields: - PrimaryActivity: !from_index:NEI_Onroad_2017_asets.csv onroad_vehicles_gas_stations + PrimaryActivity: !from_index:NEI_Onroad_asets.csv onroad_vehicles_gas_stations attribution_method: proportional attribution_source: BEA_Use_Detail_PRO_BeforeRedef: @@ -288,7 +288,7 @@ source_names: ActivityProducedBy: {'324110': ''} # Petroleum stewiFBS: !include:stewiFBS_common.yaml:CAP_HAP - inventory_dict: - NEI: 2017 - TRI: 2017 - local_inventory_name: NEI_TRI_air_2017 + # inventory_dict: assign in primary method + # NEI: 2017 + # TRI: 2017 + # local_inventory_name: NEI_TRI_air_2017 diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index 12726253f..b069323f3 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -25,7 +25,7 @@ source_names: !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets output_allocation: # Gross Output selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv output_allocation + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv output_allocation attribution_method: proportional attribution_source: BEA_GDP_GrossOutput: diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2020.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2020.yaml index ee8331030..9e7093f32 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2020.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2020.yaml @@ -25,7 +25,7 @@ source_names: !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets output_allocation: # Gross Output selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv output_allocation + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv output_allocation attribution_method: proportional attribution_source: BEA_GDP_GrossOutput: diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml index 18df90431..c4ef6194c 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml @@ -89,19 +89,19 @@ source_names: activity_sets: direct_allocation: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv direct_allocation + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv direct_allocation attribution_method: direct cropland: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv cropland + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv cropland attribution_method: proportional attribution_source: USDA_CoA_Cropland: *cropland_allocation industry_combustion_coal: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_coal + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv industry_combustion_coal attribution_method: proportional attribution_source: EIA_MECS_Energy: @@ -111,7 +111,7 @@ source_names: industry_combustion_coke: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_coke + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv industry_combustion_coke attribution_method: proportional attribution_source: EIA_MECS_Energy: @@ -121,7 +121,7 @@ source_names: industry_combustion_distillate: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_distillate + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv industry_combustion_distillate attribution_method: proportional attribution_source: EIA_MECS_Energy: @@ -131,7 +131,7 @@ source_names: industry_combustion_hgl: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_hgl + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv industry_combustion_hgl attribution_method: proportional attribution_source: EIA_MECS_Energy: @@ -141,7 +141,7 @@ source_names: industry_combustion_nat_gas: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_nat_gas + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv industry_combustion_nat_gas attribution_method: proportional attribution_source: EIA_MECS_Energy: @@ -151,7 +151,7 @@ source_names: industry_combustion_other: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_other + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv industry_combustion_other attribution_method: proportional attribution_source: EIA_MECS_Energy: @@ -161,7 +161,7 @@ source_names: industry_combustion_residual: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv industry_combustion_residual + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv industry_combustion_residual attribution_method: proportional attribution_source: EIA_MECS_Energy: @@ -171,14 +171,14 @@ source_names: livestock: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv livestock + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv livestock attribution_method: proportional attribution_source: USDA_CoA_Livestock: *livestock_allocation mobile_and_fuel_storage: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv mobile_and_fuel_storage + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv mobile_and_fuel_storage attribution_method: proportional attribution_source: stateio_Use_Summary: @@ -188,7 +188,7 @@ source_names: fertilizers: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv fertilizers + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv fertilizers attribution_method: proportional attribution_source: stateio_Use_Summary: @@ -198,7 +198,7 @@ source_names: pesticides: selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv pesticides + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv pesticides exclusion_fields: # To avoid overlap with other datasets, emissions of pesticides # from pesticide application are removed. @@ -219,7 +219,7 @@ source_names: output_allocation: # Gross Output selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_2017_asets.csv output_allocation + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv output_allocation attribution_method: proportional attribution_source: stateio_Industry_GO: @@ -255,12 +255,12 @@ source_names: activity_sets: direct_allocation: selection_fields: - PrimaryActivity: !from_index:NEI_Nonroad_2017_asets.csv direct_allocation + PrimaryActivity: !from_index:NEI_Nonroad_asets.csv direct_allocation attribution_method: direct offroad_vehicles_equipment: selection_fields: - PrimaryActivity: !from_index:NEI_Nonroad_2017_asets.csv offroad_vehicles_equipment + PrimaryActivity: !from_index:NEI_Nonroad_asets.csv offroad_vehicles_equipment attribution_method: proportional attribution_source: stateio_Use_Summary: @@ -287,12 +287,12 @@ source_names: activity_sets: direct_allocation: selection_fields: - PrimaryActivity: !from_index:NEI_Onroad_2017_asets.csv direct_allocation + PrimaryActivity: !from_index:NEI_Onroad_asets.csv direct_allocation attribution_method: direct onroad_vehicles_gas_stations: selection_fields: - PrimaryActivity: !from_index:NEI_Onroad_2017_asets.csv onroad_vehicles_gas_stations + PrimaryActivity: !from_index:NEI_Onroad_asets.csv onroad_vehicles_gas_stations attribution_method: proportional attribution_source: stateio_Use_Summary: From cb8d55dd5c135878b794522fff4eaab864126360 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 10 May 2023 10:50:50 -0400 Subject: [PATCH 0552/1127] update state method with common file --- .../CAP_HAP_state_2017.yaml | 191 ++---------------- 1 file changed, 18 insertions(+), 173 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml index c4ef6194c..68237d169 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml @@ -6,8 +6,9 @@ !include:USEEIO_summary_target.yaml -year: 2017 +target_naics_year: 2012 geoscale: state +_emission_year: &year 2017 sources_to_cache: EIA_MECS_Energy: @@ -43,139 +44,14 @@ _attribution_sources: geoscale: state year: 2012 - USDA_CoA_Cropland: &cropland_allocation - year: 2017 - geoscale: state - selection_fields: - Class: Land - FlowName: AREA HARVESTED - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland_NAICS: - year: 2017 - geoscale: state - selection_fields: - Class: Land - FlowName: AG LAND, CROPLAND, HARVESTED - - USDA_CoA_Livestock: &livestock_allocation - year: 2017 - geoscale: state - selection_fields: - Class: Other - FlowName: - - HEAD - - NUMBER - - COLONIES - Compartment: NOT SPECIFIED - source_names: EPA_NEI_Nonpoint: - geoscale: state - year: 2017 - primary_action_type: Produced - activity_to_sector_mapping: SCC - exclusion_fields: - FlowName: - - PM10-Primary from certain diesel engines - - PM25-Primary from certain diesel engines - - Carbon Dioxide - - Methane - - Nitrous Oxide - - Sulfur Hexafluoride - clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba - fedefl_mapping: NEI - drop_unmapped_rows: True - activity_sets: - direct_allocation: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv direct_allocation - attribution_method: direct - - cropland: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv cropland - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland: *cropland_allocation - - industry_combustion_coal: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv industry_combustion_coal - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - geoscale: national - selection_fields: - Flowable: Coal - - industry_combustion_coke: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv industry_combustion_coke - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - geoscale: national - selection_fields: - Flowable: Coke and Breeze - - industry_combustion_distillate: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv industry_combustion_distillate - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - geoscale: national - selection_fields: - Flowable: Distillate Fuel Oil - - industry_combustion_hgl: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv industry_combustion_hgl - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - geoscale: national - selection_fields: - Flowable: Hydrocarbon Gas Liquids, excluding natural gasoline - - industry_combustion_nat_gas: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv industry_combustion_nat_gas - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - geoscale: national - selection_fields: - Flowable: Natural Gas - - industry_combustion_other: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv industry_combustion_other - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - geoscale: national - selection_fields: - Flowable: Other - - industry_combustion_residual: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv industry_combustion_residual - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - geoscale: national - selection_fields: - Flowable: Residual Fuel Oil - - livestock: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv livestock - attribution_method: proportional - attribution_source: - USDA_CoA_Livestock: *livestock_allocation + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint + year: *year + # Update some activity sets from Common to use stateior instead of BEA + activity_sets: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets mobile_and_fuel_storage: selection_fields: PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv mobile_and_fuel_storage @@ -237,27 +113,11 @@ source_names: year: 2017 EPA_NEI_Nonroad: - geoscale: state - year: 2017 - primary_action_type: Produced - activity_to_sector_mapping: SCC - exclusion_fields: - FlowName: - - PM10-Primary from certain diesel engines - - PM25-Primary from certain diesel engines - - Carbon Dioxide - - Methane - - Nitrous Oxide - - Sulfur Hexafluoride - clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba - fedefl_mapping: NEI - drop_unmapped_rows: True + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad + year: *year + # Update some activity sets from Common to use stateior instead of BEA activity_sets: - direct_allocation: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonroad_asets.csv direct_allocation - attribution_method: direct - + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad:activity_sets offroad_vehicles_equipment: selection_fields: PrimaryActivity: !from_index:NEI_Nonroad_asets.csv offroad_vehicles_equipment @@ -269,27 +129,11 @@ source_names: ActivityProducedBy: {'324': ''} # Petroleum 324110 EPA_NEI_Onroad: - geoscale: state - year: 2017 - primary_action_type: Produced - activity_to_sector_mapping: SCC - exclusion_fields: - FlowName: - - PM10-Primary from certain diesel engines - - PM25-Primary from certain diesel engines - - Carbon Dioxide - - Methane - - Nitrous Oxide - - Sulfur Hexafluoride - clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba - fedefl_mapping: NEI - drop_unmapped_rows: True + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad + year: *year + # Update some activity sets from Common to use stateior instead of BEA activity_sets: - direct_allocation: - selection_fields: - PrimaryActivity: !from_index:NEI_Onroad_asets.csv direct_allocation - attribution_method: direct - + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad:activity_sets onroad_vehicles_gas_stations: selection_fields: PrimaryActivity: !from_index:NEI_Onroad_asets.csv onroad_vehicles_gas_stations @@ -300,8 +144,9 @@ source_names: selection_fields: ActivityProducedBy: {'324': ''} # Petroleum 324110 + stewiFBS: !include:stewiFBS_common.yaml:CAP_HAP inventory_dict: - NEI: 2017 - TRI: 2017 + NEI: *year + TRI: *year local_inventory_name: NEI_TRI_air_2017 From 2cd0e3e1add79093086e6230211821250e0a1330 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 10 May 2023 11:12:55 -0400 Subject: [PATCH 0553/1127] reset group_id and group_total after splitting across states; no further sector attribution needed --- flowsa/data_source_scripts/EIA_MECS.py | 33 ++++++++++++------- .../CAP_HAP_state_2017.yaml | 7 +--- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/flowsa/data_source_scripts/EIA_MECS.py b/flowsa/data_source_scripts/EIA_MECS.py index f133817db..a19762596 100644 --- a/flowsa/data_source_scripts/EIA_MECS.py +++ b/flowsa/data_source_scripts/EIA_MECS.py @@ -612,9 +612,9 @@ def update_regions_to_states(fba: FlowByActivity, **_) -> FlowByActivity: if len(x) < 5 else x)) # Allocate MECS based on employment FBS - year = fba.config.get('year') - hlp = flowsa.getFlowBySector(methodname=f'Employment_state_{year}', - download_FBS_if_missing=True) + hlp = flowsa.getFlowBySector( + methodname=fba.config.get('attribution_source'), + download_FBS_if_missing=True) # To match the various sector resolution of MECS, generate employment # dataset for all NAICS resolution by aggregating @@ -625,14 +625,25 @@ def update_regions_to_states(fba: FlowByActivity, **_) -> FlowByActivity: right_on = 'State_FIPS') hlp['Allocation'] = hlp['FlowAmount']/hlp.groupby( ['Region', 'SectorProducedBy']).FlowAmount.transform('sum') - ## TODO NEED TO ALSO ADJUST GROUP/GROUP TOTALS - fba = pd.merge(fba.rename(columns={'Location':'Region'}), - (hlp[['Region','Location','SectorProducedBy','Allocation']] - .rename(columns={'SectorProducedBy':'SectorConsumedBy'})), - how='left', on=['Region','SectorConsumedBy']) - fba['FlowAmount'] = fba['FlowAmount'] * fba['Allocation'] - fba = fba.drop(columns=['Allocation','Region']) - fba['LocationSystem'] = 'FIPS_2015' + + fba = pd.merge( + fba.rename(columns={'Location': 'Region'}), + (hlp[['Region', 'Location', 'SectorProducedBy', 'Allocation']] + .rename(columns={'SectorProducedBy': 'SectorConsumedBy'})), + how='left', on=['Region', 'SectorConsumedBy']) + fba = (fba.assign(FlowAmount = lambda x: x['FlowAmount'] * x['Allocation']) + .assign(LocationSystem = 'FIPS_2015') + .drop(columns=['Allocation', 'Region']) + ) + + # Rest group_id and group_total + fba = ( + fba + .drop(columns=['group_id', 'group_total']) + .reset_index(drop=True).reset_index() + .rename(columns={'index': 'group_id'}) + .assign(group_total=fba.FlowAmount) + ) # Check for data loss if (abs(1-(sum(fba['FlowAmount']) / diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml index 68237d169..fe1bf11ff 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml @@ -25,12 +25,7 @@ sources_to_cache: estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy clean_fba: !script_function:EIA_MECS clean_mecs_energy_fba clean_fba_w_sec: !script_function:EIA_MECS clean_mapped_mecs_energy_fba_to_state - attribution_method: proportional - attribution_source: - Employment_state_2018: - data_format: FBS - geoscale: state - year: 2018 + attribution_source: Employment_state_2018 _attribution_sources: stateio: &stateio From b1680cfa9a7bc0d9a93e7934fde2c718bd689e77 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 10 May 2023 11:53:35 -0400 Subject: [PATCH 0554/1127] revise PM Flow overlap to handle multiple contexts (replicates 2121c91); revise reassign_process_to_sectors to include compartment (replicates 83e47ab) --- flowsa/data_source_scripts/EPA_NEI.py | 23 +++++++++++++---------- flowsa/data_source_scripts/stewiFBS.py | 15 ++++++++------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_NEI.py b/flowsa/data_source_scripts/EPA_NEI.py index 4ec138754..a71009508 100644 --- a/flowsa/data_source_scripts/EPA_NEI.py +++ b/flowsa/data_source_scripts/EPA_NEI.py @@ -9,6 +9,7 @@ from zipfile import ZipFile from os import path import pandas as pd +import numpy as np from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.dataclean import standardize_units from flowsa.flowby import FlowByActivity @@ -172,17 +173,19 @@ def clean_NEI_fba(fba: FlowByActivity, **_) -> FlowByActivity: # rename FlowName and Flowable, and update UUID fba = remove_flow_overlap(fba, 'PM10 Primary (Filt + Cond)', ['PM2.5 Primary (Filt + Cond)']) - # # link to FEDEFL - # import fedelemflowlist - # mapping = fedelemflowlist.get_flowmapping('NEI') - # PM_df = mapping[['TargetFlowName', - # 'TargetFlowUUID']][mapping['SourceFlowName']=='PM10-PM2.5'] - # PM_list = PM_df.values.flatten().tolist() - PM_list = ['Particulate matter, > 2.5μm and ≤ 10μm', - 'a320e284-d276-3167-89b3-19d790081c08'] + + # Obtain UUIDs for new PM flows + import fedelemflowlist + mapping = fedelemflowlist.get_flowmapping('NEI') + PM_df = (mapping.query('SourceFlowName == "PM10-PM2.5"') + [['TargetFlowContext', 'TargetFlowUUID', 'TargetFlowName']] + .set_index('TargetFlowContext')) + PM_dict = PM_df.to_dict()['TargetFlowUUID'] + fba['FlowUUID'] = np.where(fba['FlowName'] == 'PM10 Primary (Filt + Cond)', + fba['Context'].map(PM_dict), + fba['FlowUUID']) fba.loc[(fba['FlowName'] == 'PM10 Primary (Filt + Cond)'), - ['FlowName', 'Flowable', 'FlowUUID']] = ['PM10-PM2.5', - PM_list[0], PM_list[1]] + ['FlowName', 'Flowable']] = ['PM10-PM2.5', PM_df['TargetFlowName'][0]] # Drop zero values to reduce size fba = fba.query('FlowAmount != 0').reset_index(drop=True) diff --git a/flowsa/data_source_scripts/stewiFBS.py b/flowsa/data_source_scripts/stewiFBS.py index cca5c2e70..29c497d58 100644 --- a/flowsa/data_source_scripts/stewiFBS.py +++ b/flowsa/data_source_scripts/stewiFBS.py @@ -175,9 +175,11 @@ def reassign_process_to_sectors(df, year, file_list, external_config_path): 'source_process']) # obtain and prepare SCC dataset + keep_sec_cntx = True if any('/' in s for s in df.Compartment.unique()) else False df_fbp = stewi.getInventory('NEI', year, stewiformat='flowbyprocess', - download_if_missing=True) + download_if_missing=True, + keep_sec_cntx=keep_sec_cntx) df_fbp = df_fbp[df_fbp['Process'].isin(df_adj['source_process'])] df_fbp = (df_fbp.assign(Source = 'NEI') .pipe(addChemicalMatches) @@ -197,13 +199,12 @@ def reassign_process_to_sectors(df, year, file_list, external_config_path): right_on=['source_naics', 'source_process']) # subtract emissions by SCC from specific facilities - df_emissions = ( - df_fbp.groupby(['FacilityID', 'FlowName']) - .agg({'FlowAmount': 'sum'}) - .rename(columns={'FlowAmount': 'Emissions'}) - ) + df_emissions = (df_fbp + .groupby(['FacilityID', 'FlowName', 'Compartment']) + .agg({'FlowAmount': 'sum'}) + .rename(columns={'FlowAmount': 'Emissions'})) df = (df.merge(df_emissions, how='left', - on=['FacilityID', 'FlowName']) + on=['FacilityID', 'FlowName', 'Compartment']) .assign(Emissions = lambda x: x['Emissions'].fillna(value=0)) .assign(FlowAmount = lambda x: x['FlowAmount'] - x['Emissions']) .drop(columns=['Emissions']) From ef94c4f0c9c2f6b2e3578e55fbeb4629810e21e7 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 10 May 2023 11:54:31 -0400 Subject: [PATCH 0555/1127] move common stewi method to CAP_HAP_common --- .../flowbysectormethods/CAP_HAP_common.yaml | 16 ++++++++++++++-- .../CAP_HAP_national_2017.yaml | 3 ++- .../CAP_HAP_national_2020.yaml | 3 ++- .../CAP_HAP_state_2017.yaml | 4 ++-- .../flowbysectormethods/stewiFBS_common.yaml | 18 ------------------ 5 files changed, 20 insertions(+), 24 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml index 2c53a52c1..3753ebe5e 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml @@ -287,8 +287,20 @@ source_names: selection_fields: ActivityProducedBy: {'324110': ''} # Petroleum - stewiFBS: !include:stewiFBS_common.yaml:CAP_HAP - # inventory_dict: assign in primary method + stewiFBS: + data_format: FBS_outside_flowsa + FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector + # inventory_dict: # assign in primary method # NEI: 2017 # TRI: 2017 # local_inventory_name: NEI_TRI_air_2017 + compartments: + - air + reassign_process_to_sectors: + - airplane_emissions + exclusion_fields: + FlowName: + - Carbon Dioxide + - Methane + - Nitrous Oxide + - Sulfur Hexafluoride diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml index b069323f3..011bcc8fa 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml @@ -49,7 +49,8 @@ source_names: !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad year: *year - stewiFBS: !include:stewiFBS_common.yaml:CAP_HAP + stewiFBS: + !include:CAP_HAP_common.yaml:source_names:stewiFBS inventory_dict: NEI: *year TRI: *year diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2020.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2020.yaml index 9e7093f32..b31f7925c 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2020.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2020.yaml @@ -50,7 +50,8 @@ source_names: !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad year: *year - stewiFBS: !include:stewiFBS_common.yaml:CAP_HAP + stewiFBS: + !include:CAP_HAP_common.yaml:source_names:stewiFBS inventory_dict: NEI: *year TRI: *year diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml index fe1bf11ff..40d126e0d 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml @@ -139,8 +139,8 @@ source_names: selection_fields: ActivityProducedBy: {'324': ''} # Petroleum 324110 - - stewiFBS: !include:stewiFBS_common.yaml:CAP_HAP + stewiFBS: + !include:CAP_HAP_common.yaml:source_names:stewiFBS inventory_dict: NEI: *year TRI: *year diff --git a/flowsa/methods/flowbysectormethods/stewiFBS_common.yaml b/flowsa/methods/flowbysectormethods/stewiFBS_common.yaml index a67c3b96c..4902b1d05 100644 --- a/flowsa/methods/flowbysectormethods/stewiFBS_common.yaml +++ b/flowsa/methods/flowbysectormethods/stewiFBS_common.yaml @@ -28,21 +28,3 @@ CRHW: RCRAInfo: 2017 compartments: - waste - -CAP_HAP: - data_format: FBS_outside_flowsa - FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector - inventory_dict: - NEI: 2017 - TRI: 2017 - local_inventory_name: NEI_TRI_air_2017 - compartments: - - air - reassign_process_to_sectors: - - airplane_emissions - exclusion_fields: - FlowName: - - Carbon Dioxide - - Methane - - Nitrous Oxide - - Sulfur Hexafluoride From bfb6ebb6a5a9bc9c8c9421927e0af6c2dd8ed5c0 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 10 May 2023 14:23:36 -0400 Subject: [PATCH 0556/1127] simplify name update for PM overlap --- flowsa/data_source_scripts/EPA_NEI.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_NEI.py b/flowsa/data_source_scripts/EPA_NEI.py index a71009508..aafbd1a6f 100644 --- a/flowsa/data_source_scripts/EPA_NEI.py +++ b/flowsa/data_source_scripts/EPA_NEI.py @@ -170,22 +170,13 @@ def clean_NEI_fba(fba: FlowByActivity, **_) -> FlowByActivity: :return: modified FBA """ # Remove the portion of PM10 that is PM2.5 to eliminate double counting, - # rename FlowName and Flowable, and update UUID + # rename resulting FlowName fba = remove_flow_overlap(fba, 'PM10 Primary (Filt + Cond)', ['PM2.5 Primary (Filt + Cond)']) - # Obtain UUIDs for new PM flows - import fedelemflowlist - mapping = fedelemflowlist.get_flowmapping('NEI') - PM_df = (mapping.query('SourceFlowName == "PM10-PM2.5"') - [['TargetFlowContext', 'TargetFlowUUID', 'TargetFlowName']] - .set_index('TargetFlowContext')) - PM_dict = PM_df.to_dict()['TargetFlowUUID'] - fba['FlowUUID'] = np.where(fba['FlowName'] == 'PM10 Primary (Filt + Cond)', - fba['Context'].map(PM_dict), - fba['FlowUUID']) - fba.loc[(fba['FlowName'] == 'PM10 Primary (Filt + Cond)'), - ['FlowName', 'Flowable']] = ['PM10-PM2.5', PM_df['TargetFlowName'][0]] + fba['FlowName'] = np.where(fba['FlowName'] == 'PM10 Primary (Filt + Cond)', + "PM10-PM2.5", + fba['FlowName']) # Drop zero values to reduce size fba = fba.query('FlowAmount != 0').reset_index(drop=True) From 8f07b39c454f26209784367bd5141cf08d268a9f Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 10 May 2023 14:24:59 -0400 Subject: [PATCH 0557/1127] stewiFBS exclusion fields get applied twice, first as FBA then as FBS. Catch errors when field name not in FBA/FBS --- flowsa/flowby.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 07e474cdc..32343266b 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -462,7 +462,11 @@ def select_by_fields( ) self = self.query(f'~({qry})') else: - self = self.query(f'{field} not in @values') + if field not in self: + log.warning(f'{field} not found, can not apply ' + 'exclusion_fields') + else: + self = self.query(f'{field} not in @values') selection_fields = (selection_fields or self.config.get('selection_fields')) From 2b2d5ff8b9066f9d503dd13389a0678283ad3d21 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 10 May 2023 16:02:15 -0400 Subject: [PATCH 0558/1127] add CAP_HAP_m2 which assigns urban/rural --- flowsa/data_source_scripts/EPA_NEI.py | 18 +++++++- flowsa/location.py | 2 +- .../CAP_HAP_national_2017_m2.yaml | 41 +++++++++++++++++++ 3 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m2.yaml diff --git a/flowsa/data_source_scripts/EPA_NEI.py b/flowsa/data_source_scripts/EPA_NEI.py index aafbd1a6f..4bbecac34 100644 --- a/flowsa/data_source_scripts/EPA_NEI.py +++ b/flowsa/data_source_scripts/EPA_NEI.py @@ -13,6 +13,8 @@ from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.dataclean import standardize_units from flowsa.flowby import FlowByActivity +from flowsa.flowsa_log import log +from flowsa.location import merge_urb_cnty_pct def epa_nei_url_helper(*, build_url, year, config, **_): @@ -169,6 +171,10 @@ def clean_NEI_fba(fba: FlowByActivity, **_) -> FlowByActivity: :param fba: df, FBA format :return: modified FBA """ + attributes_to_save = { + attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] + } + # Remove the portion of PM10 that is PM2.5 to eliminate double counting, # rename resulting FlowName fba = remove_flow_overlap(fba, 'PM10 Primary (Filt + Cond)', @@ -180,7 +186,17 @@ def clean_NEI_fba(fba: FlowByActivity, **_) -> FlowByActivity: # Drop zero values to reduce size fba = fba.query('FlowAmount != 0').reset_index(drop=True) - return fba + apply_urban_rural = fba.config.get('apply_urban_rural', False) + if apply_urban_rural: + log.info(f'Splitting {fba.full_name} into urban and rural ' + 'quantities by FIPS.') + fba = merge_urb_cnty_pct(fba) + + new_fba = FlowByActivity(fba) + for attr in attributes_to_save: + setattr(new_fba, attr, attributes_to_save[attr]) + + return new_fba def remove_flow_overlap(df, aggregate_flow, contributing_flows): diff --git a/flowsa/location.py b/flowsa/location.py index dbb4a34fd..f1cddd128 100644 --- a/flowsa/location.py +++ b/flowsa/location.py @@ -270,7 +270,7 @@ def merge_urb_cnty_pct(df): # find unmerged nan pct_pop_urb values pct_na = sum(df['pct_pop_urb'].isna()) if pct_na != 0: - log.error(f'WARNING {pct_na} FIPS codes did not merge successfully.\n' + log.error(f'WARNING {pct_na} records did not merge successfully.\n' 'In pct_pop_urb, "nan" values are not equal to 0%.') df = reshape_urb_rur_df(df) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m2.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m2.yaml new file mode 100644 index 000000000..2b00a00a0 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m2.yaml @@ -0,0 +1,41 @@ +# This method replicates m1 but incorporates more detailed secondary contexts +# e.g. urban/rural and stack height for flows + +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: national + +_emission_year: &year 2017 + +sources_to_cache: + EIA_MECS_Energy: + !include:CAP_HAP_common.yaml:sources_to_cache:EIA_MECS_Energy + year: 2018 + attribution_source: + Employment_national_2018: + data_format: FBS + year: 2018 + +source_names: + EPA_NEI_Nonpoint: + !include:CAP_HAP_national_2017.yaml:source_names:EPA_NEI_Nonpoint + apply_urban_rural: True + year: *year + + EPA_NEI_Nonroad: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad + apply_urban_rural: True + year: *year + + EPA_NEI_Onroad: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad + apply_urban_rural: True + year: *year + + stewiFBS: + !include:CAP_HAP_common.yaml:source_names:stewiFBS + inventory_dict: + NEI: *year + TRI: *year + local_inventory_name: NEI_TRI_air_seccntx_2017 From ce7e5fe1e0b7b6912a6826d3ae3531186210b946 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 10 May 2023 16:34:23 -0400 Subject: [PATCH 0559/1127] fix typo in action; drop dq_fields for comparison --- flowsa/test_single_FBS.py | 2 +- flowsa/validation.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/flowsa/test_single_FBS.py b/flowsa/test_single_FBS.py index aff767328..d16a3cc3e 100644 --- a/flowsa/test_single_FBS.py +++ b/flowsa/test_single_FBS.py @@ -18,7 +18,7 @@ def compare_single_FBS_against_remote(m, outdir=diffpath, if not downloaded: if run_single: # Run a single file even if no comparison available - FlowBySector.genereateFlowBySector( + FlowBySector.generateFlowBySector( method=m, download_sources_ok=True) else: print(f"{m} not found in remote server. Skipping...") diff --git a/flowsa/validation.py b/flowsa/validation.py index 5ec54abd4..e062c0b8d 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -18,6 +18,7 @@ from flowsa.common import sector_level_key, \ fba_activity_fields, check_activities_sector_like from flowsa.location import US_FIPS, fips_number_key +from flowsa.schema import dq_fields def check_if_data_exists_at_geoscale(df_load, geoscale): @@ -620,8 +621,8 @@ def compare_FBS_results(fbs1, fbs2, ignore_metasources=False, columns={'FlowAmount': 'FlowAmount_fbs2'}) df2 = replace_strings_with_NoneType(df2) # compare df - merge_cols = list(df2.select_dtypes(include=[ - 'object', 'int']).columns) + merge_cols = [c for c in df2.select_dtypes(include=[ + 'object', 'int']).columns if c not in dq_fields] if ignore_metasources: for e in ['MetaSources', 'AttributionSources']: try: From 08e227fafe1524132539e4d50b9f4664e2e7bea8 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 10 May 2023 16:44:34 -0400 Subject: [PATCH 0560/1127] allow specifying of impact method for `calculate_industry_coefficient` (replicates d6010a3) --- flowsa/validation.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/flowsa/validation.py b/flowsa/validation.py index e062c0b8d..1881fa3d9 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -794,8 +794,8 @@ def calculate_industry_coefficients(fbs_load, year,region, :param year: year for industry output dataset :param region: str, 'state' or 'national' :param io_level: str, 'summary' or 'detail' - :param impacts: bool, True to apply and aggregate on impacts - False to compare flow/contexts + :param impacts: bool or str, True to apply and aggregate on impacts using TRACI, + False to compare flow/contexts, str to pass alternate method """ from flowsa.sectormapping import map_to_BEA_sectors,\ get_BEA_industry_output @@ -806,9 +806,11 @@ def calculate_industry_coefficients(fbs_load, year,region, inventory = not(impacts) if impacts: + if isinstance(impacts, bool): + impacts = 'TRACI2.1' try: import lciafmt - fbs_summary = (lciafmt.apply_lcia_method(fbs, 'TRACI2.1') + fbs_summary = (lciafmt.apply_lcia_method(fbs, impacts) .rename(columns={'FlowAmount': 'InvAmount', 'Impact': 'FlowAmount'})) groupby_cols = ['Location', 'Sector', From 06409a3f1fb29c89f2e72cab6e0db1b38efe49ce Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 11 May 2023 15:19:22 -0400 Subject: [PATCH 0561/1127] additional pathlib fixes --- flowsa/common.py | 12 ++++++------ flowsa/data_source_scripts/BEA.py | 10 +++++----- flowsa/data_source_scripts/Blackhurst_IO.py | 2 +- flowsa/datavisualization.py | 6 +++--- flowsa/flowby.py | 6 +++--- flowsa/flowsa_log.py | 16 ++++++++-------- flowsa/geo.py | 2 +- flowsa/literature_values.py | 2 +- flowsa/location.py | 2 +- flowsa/naics.py | 2 +- flowsa/sectormapping.py | 2 +- 11 files changed, 31 insertions(+), 31 deletions(-) diff --git a/flowsa/common.py b/flowsa/common.py index 45cd9b8ab..a5ce430bf 100644 --- a/flowsa/common.py +++ b/flowsa/common.py @@ -81,7 +81,7 @@ def load_crosswalk(crosswalk_name): fn = cw_dict.get(crosswalk_name) - cw = pd.read_csv(f'{datapath}{fn}.csv', dtype="str") + cw = pd.read_csv(datapath / f'{fn}.csv', dtype="str") return cw @@ -156,8 +156,8 @@ def load_values_from_literature_citations_config(): values from the literature come from :return: dictionary of the values from the literature information """ - sfile = (f'{datapath}bibliographyinfo/' - f'values_from_literature_source_citations.yaml') + sfile = (datapath / 'bibliographyinfo' / + 'values_from_literature_source_citations.yaml') with open(sfile, 'r') as f: config = yaml.safe_load(f) return config @@ -254,7 +254,7 @@ def get_flowsa_base_name(filedirectory, filename, extension): If filename does not match filename within flowsa due to added extensions onto the filename, cycle through name, dropping strings after each underscore until the name is found - :param filedirectory: string, path to directory + :param filedirectory: Path object, path to directory :param filename: string, name of original file searching for :param extension: string, type of file, such as "yaml" or "py" :return: string, corrected file path name @@ -263,7 +263,7 @@ def get_flowsa_base_name(filedirectory, filename, extension): # underscore. Repeat this process until the file name exists or no # underscores are left. while '_' in filename: - if os.path.exists(f"{filedirectory}{filename}.{extension}"): + if (filedirectory / f"{filename}.{extension}").is_file(): break filename, _ = filename.rsplit('_', 1) @@ -326,7 +326,7 @@ def str2bool(v): def check_method_status(): """Read the current method status""" - yaml_path = methodpath + 'method_status.yaml' + yaml_path = methodpath / 'method_status.yaml' with open(yaml_path, 'r') as f: method_status = yaml.safe_load(f) return method_status diff --git a/flowsa/data_source_scripts/BEA.py b/flowsa/data_source_scripts/BEA.py index cb449f0a8..e496730e4 100644 --- a/flowsa/data_source_scripts/BEA.py +++ b/flowsa/data_source_scripts/BEA.py @@ -26,7 +26,7 @@ def bea_gdp_parse(*, year, **_): specifications """ # Read directly into a pandas df - df_raw = pd.read_csv(externaldatapath + "BEA_GDP_GrossOutput_IO.csv") + df_raw = pd.read_csv(externaldatapath / "BEA_GDP_GrossOutput_IO.csv") df = df_raw.rename(columns={'Unnamed: 0': 'ActivityProducedBy'}) @@ -61,8 +61,8 @@ def bea_use_detail_br_parse(*, year, **_): :return: df, parsed and partially formatted to flowbyactivity specifications """ - csv_load = f'{externaldatapath}BEA_{str(year)}' \ - f'_Detail_Use_PRO_BeforeRedef.csv' + csv_load = (externaldatapath / f'BEA_{str(year)}' + f'_Detail_Use_PRO_BeforeRedef.csv') df_raw = pd.read_csv(csv_load) df = bea_detail_parse(df_raw, year) @@ -79,8 +79,8 @@ def bea_make_detail_br_parse(*, year, **_): flowbyactivity specifications """ # Read directly into a pandas df - csv_load = f'{externaldatapath}BEA_{str(year)}' \ - f'_Detail_Make_BeforeRedef.csv' + csv_load = (externaldatapath / f'BEA_{str(year)}' + f'_Detail_Make_BeforeRedef.csv') df_raw = pd.read_csv(csv_load) df = bea_detail_parse(df_raw, year) diff --git a/flowsa/data_source_scripts/Blackhurst_IO.py b/flowsa/data_source_scripts/Blackhurst_IO.py index 0449153f8..41c7a2c2a 100644 --- a/flowsa/data_source_scripts/Blackhurst_IO.py +++ b/flowsa/data_source_scripts/Blackhurst_IO.py @@ -33,7 +33,7 @@ def bh_parse(*, df_list, **_): pages = range(5, 13) bh_df_list = [] for x in pages: - bh_df = read_pdf(f'{externaldatapath}Blackhurst_WatWithdrawalsforUSIndustrialSectorsSI.pdf', + bh_df = read_pdf(externaldatapath / 'Blackhurst_WatWithdrawalsforUSIndustrialSectorsSI.pdf', pages=x, stream=True)[0] bh_df_list.append(bh_df) diff --git a/flowsa/datavisualization.py b/flowsa/datavisualization.py index 13eeed5a9..161641e1c 100644 --- a/flowsa/datavisualization.py +++ b/flowsa/datavisualization.py @@ -285,7 +285,7 @@ def stackedBarChart(df, # create list of n colors based on number of allocation sources colors = df2[[stacking_col]].drop_duplicates() # add colors - vis = pd.read_csv(f'{datapath}VisualizationEssentials.csv').rename( + vis = pd.read_csv(datapath / 'VisualizationEssentials.csv').rename( columns={'AttributionSource': stacking_col}) colors = colors.merge(vis[[stacking_col, 'Color']], how='left') @@ -502,7 +502,7 @@ def generateSankeyData(methodname, df = df[df[f'Sector{s}By'].isin(sector_list)] # add sector names - sankeymappingfile = f'{datapath}VisualizationEssentials.csv' + sankeymappingfile = datapath / 'VisualizationEssentials.csv' df2 = addSectorNames(df, mappingfile=sankeymappingfile) # subset df and aggregate flows by sectors @@ -537,7 +537,7 @@ def generateSankeyData(methodname, }) # add colors - vis = pd.read_csv(f'{datapath}VisualizationEssentials.csv') + vis = pd.read_csv(datapath / 'VisualizationEssentials.csv') nodes = nodes.merge(vis[['Sector', 'Color']], how='left') # fill in any colors missing from the color dictionary with random colors nodes['Color'] = nodes['Color'].apply(lambda x: x if pd.notnull(x) else diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 32343266b..80a079a17 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -18,7 +18,7 @@ # ^^^ Used to separate source/activity set names as part of 'full_name' attr -with open(settings.datapath + 'flowby_config.yaml') as f: +with open(settings.datapath / 'flowby_config.yaml') as f: flowby_config = flowsa_yaml.load(f) # ^^^ Replaces schema.py @@ -294,7 +294,7 @@ def standardize_units(self: FB, year: int = None) -> FB: ) conversion_table = pd.concat([ - pd.read_csv(f'{settings.datapath}unit_conversion.csv'), + pd.read_csv(settings.datapath / 'unit_conversion.csv'), pd.Series({'old_unit': 'Canadian Dollar', 'new_unit': 'USD', 'conversion_factor': 1 / exchange_rate}).to_frame().T @@ -1849,7 +1849,7 @@ def convert_activity_to_emissions( ''' emissions_factors = ( pd.read_csv( - f'{settings.datapath}{self.config["emissions_factors"]}.csv') + settings.datapath / f'{self.config["emissions_factors"]}.csv') .drop(columns='source') ) diff --git a/flowsa/flowsa_log.py b/flowsa/flowsa_log.py index 880808268..29a0c0635 100644 --- a/flowsa/flowsa_log.py +++ b/flowsa/flowsa_log.py @@ -1,7 +1,7 @@ import logging import shutil import sys -from esupy.processed_data_mgmt import create_paths_if_missing +from esupy.processed_data_mgmt import mkdir_if_missing from .settings import logoutputpath try: @@ -49,13 +49,13 @@ def format(self, record): datefmt='%Y-%m-%d %H:%M:%S') log_file_handler = logging.FileHandler( - logoutputpath + 'flowsa.log', + logoutputpath / 'flowsa.log', mode='w', encoding='utf-8') log_file_handler.setLevel(logging.DEBUG) log_file_handler.setFormatter(file_formatter) validation_file_handler = logging.FileHandler( - logoutputpath + 'flowsa_validation.log', + logoutputpath / 'flowsa_validation.log', mode='w', encoding='utf-8') validation_file_handler.setLevel(logging.DEBUG) validation_file_handler.setFormatter(file_formatter) @@ -83,14 +83,14 @@ def rename_log_file(filename, fb_meta): :return: modified log file name """ # original log file name - all log statements - log_file = f'{logoutputpath}{"flowsa.log"}' + log_file = logoutputpath / "flowsa.log" # generate new log name - new_log_name = (f'{logoutputpath}{filename}_v' + new_log_name = (logoutputpath / f'{filename}_v' f'{fb_meta.tool_version}' f'{"_" + fb_meta.git_hash if fb_meta.git_hash else ""}' f'.log') # create log directory if missing - create_paths_if_missing(logoutputpath) + mkdir_if_missing(logoutputpath) # rename the standard log file name (os.rename throws error if file # already exists) shutil.copy(log_file, new_log_name) @@ -99,9 +99,9 @@ def rename_log_file(filename, fb_meta): return # original log file name - validation - log_file = f'{logoutputpath}{"flowsa_validation.log"}' + log_file = logoutputpath / "flowsa_validation.log" # generate new log name - new_log_name = (f'{logoutputpath}{filename}_v' + new_log_name = (logoutputpath / f'{filename}_v' f'{fb_meta.tool_version}' f'{"_" + fb_meta.git_hash if fb_meta.git_hash else ""}' f'_validation.log') diff --git a/flowsa/geo.py b/flowsa/geo.py index d2872e3a8..32f5bc939 100644 --- a/flowsa/geo.py +++ b/flowsa/geo.py @@ -72,7 +72,7 @@ def get_all_fips(year: Literal[2010, 2013, 2015] = 2015) -> pd.DataFrame: is Nan for national and each state level FIPS. ''' return (pd - .read_csv(settings.datapath + 'FIPS_Crosswalk.csv', + .read_csv(settings.datapath / 'FIPS_Crosswalk.csv', header=0, dtype=object) [['State', f'FIPS_{year}', f'County_{year}']] .rename(columns={f'FIPS_{year}': 'FIPS', diff --git a/flowsa/literature_values.py b/flowsa/literature_values.py index 77f10ac84..fd2bf949e 100644 --- a/flowsa/literature_values.py +++ b/flowsa/literature_values.py @@ -28,7 +28,7 @@ def get_US_urban_green_space_and_public_parks_ratio(): """ # load Larson's saved SI data - df = pd.read_csv(datapath + "Larson_UrbanPublicParks_SI.csv") + df = pd.read_csv(datapath / "Larson_UrbanPublicParks_SI.csv") # calculate a weighted value for ratio of urban land # that belongs to parks based on city populations diff --git a/flowsa/location.py b/flowsa/location.py index bf58a3429..448f759a2 100644 --- a/flowsa/location.py +++ b/flowsa/location.py @@ -182,7 +182,7 @@ def get_region_and_division_codes(): Load the Census Regions csv :return: pandas df of census regions """ - df = pd.read_csv(f"{datapath}Census_Regions_and_Divisions.csv", + df = pd.read_csv(datapath / "Census_Regions_and_Divisions.csv", dtype="str") return df diff --git a/flowsa/naics.py b/flowsa/naics.py index 5c777fceb..c6c5120a4 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -7,7 +7,7 @@ from . import (common, dataclean, settings) naics_crosswalk = pd.read_csv( - f'{settings.datapath}NAICS_2012_Crosswalk.csv', dtype='object' + settings.datapath / 'NAICS_2012_Crosswalk.csv', dtype='object' ) diff --git a/flowsa/sectormapping.py b/flowsa/sectormapping.py index 0cf3d98b2..3bbe5a680 100644 --- a/flowsa/sectormapping.py +++ b/flowsa/sectormapping.py @@ -43,7 +43,7 @@ def get_activitytosector_mapping(source, fbsconfigpath=None): crosswalkpath = external_mappingpath activity_mapping_source_name = get_flowsa_base_name( crosswalkpath, mapfn, 'csv') - mapping = pd.read_csv(f'{crosswalkpath}{activity_mapping_source_name}.csv', + mapping = pd.read_csv(crosswalkpath / f'{activity_mapping_source_name}.csv', dtype={'Activity': 'str', 'Sector': 'str'}) # some mapping tables will have data for multiple sources, while other # mapping tables are used for multiple sources (like EPA_NEI or BEA From c93a6731b143b2b4945eb8430385d22af4f1f86c Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 11 May 2023 15:21:20 -0400 Subject: [PATCH 0562/1127] update fxn call for overlaphandler --- flowsa/data_source_scripts/stewiFBS.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/data_source_scripts/stewiFBS.py b/flowsa/data_source_scripts/stewiFBS.py index 29c497d58..c1029df3c 100644 --- a/flowsa/data_source_scripts/stewiFBS.py +++ b/flowsa/data_source_scripts/stewiFBS.py @@ -21,7 +21,6 @@ from flowsa.naics import replace_naics_w_naics_from_another_year import stewicombo import stewi -from stewicombo.overlaphandler import remove_default_flow_overlaps from stewicombo.globals import addChemicalMatches, compile_metadata,\ set_stewicombo_meta import facilitymatcher @@ -183,7 +182,8 @@ def reassign_process_to_sectors(df, year, file_list, external_config_path): df_fbp = df_fbp[df_fbp['Process'].isin(df_adj['source_process'])] df_fbp = (df_fbp.assign(Source = 'NEI') .pipe(addChemicalMatches) - .pipe(remove_default_flow_overlaps, SCC=True) + .pipe(stewicombo.overlaphandler.remove_NEI_overlaps, + SCC=True) ) # merge in NAICS data From a7e3c28065787cd659e1f2ab9f749b18179b803c Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 11 May 2023 15:31:19 -0400 Subject: [PATCH 0563/1127] additional pathlib adjustments --- .../data_source_scripts/CalRecycle_WasteCharacterization.py | 2 +- flowsa/data_source_scripts/EIA_AEO.py | 2 +- flowsa/data_source_scripts/EPA_CDDPath.py | 4 ++-- flowsa/data_source_scripts/EPA_GHGI.py | 2 +- flowsa/data_source_scripts/EPA_SIT.py | 2 +- flowsa/data_source_scripts/NETL_EIA_PlantWater.py | 2 +- flowsa/data_source_scripts/NOAA_FisheriesLandings.py | 2 +- flowsa/data_source_scripts/StateGHGI.py | 4 ++-- flowsa/data_source_scripts/USGS_WU_Coef.py | 2 +- flowsa/data_source_scripts/stewiFBS.py | 2 +- flowsa/naics.py | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py b/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py index 73b2289dd..873d6deb4 100644 --- a/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py +++ b/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py @@ -90,7 +90,7 @@ def calR_parse(*, year, **_): if "California_Commercial_bySector_2014" in entry and \ "Map" not in entry: data["ActivityProducedBy"] = produced_by(entry) - dataframe = pd.read_csv(externaldatapath + "/" + entry, + dataframe = pd.read_csv(externaldatapath / entry, header=0, dtype=str) for col in dataframe.columns: if "Percent" in str(col): diff --git a/flowsa/data_source_scripts/EIA_AEO.py b/flowsa/data_source_scripts/EIA_AEO.py index a1a5a5ca8..2c192dbaf 100644 --- a/flowsa/data_source_scripts/EIA_AEO.py +++ b/flowsa/data_source_scripts/EIA_AEO.py @@ -170,7 +170,7 @@ def eia_aeo_parse(*, df_list, year, **_): def get_series_ids(): # load crosswalk of series IDs - filepath = externaldatapath + 'AEOseriesIDs.csv' + filepath = externaldatapath / 'AEOseriesIDs.csv' return pd.read_csv(filepath) diff --git a/flowsa/data_source_scripts/EPA_CDDPath.py b/flowsa/data_source_scripts/EPA_CDDPath.py index abe72c729..948433047 100644 --- a/flowsa/data_source_scripts/EPA_CDDPath.py +++ b/flowsa/data_source_scripts/EPA_CDDPath.py @@ -41,7 +41,7 @@ def call_cddpath_model(*, resp, year, config, **_): except KeyError: log.error('CDDPath filepath not provided in FBA method') raise - source_data = externaldatapath + file + source_data = externaldatapath / file if os.path.isfile(source_data): log.info(f"Reading from local file {file}") else: @@ -121,7 +121,7 @@ def combine_cdd_path(*, resp, year, config, **_): if df_csv is None: # if not available, default to 2014 ratios file = config['generation_by_source'].get('2014') - df_csv = pd.read_csv(externaldatapath + file, header=0, + df_csv = pd.read_csv(externaldatapath / file, header=0, names=['FlowName', 'ActivityProducedBy', 'FlowAmount']) df_csv['pct'] = (df_csv['FlowAmount']/ diff --git a/flowsa/data_source_scripts/EPA_GHGI.py b/flowsa/data_source_scripts/EPA_GHGI.py index ad7dd1c13..be75efdbb 100644 --- a/flowsa/data_source_scripts/EPA_GHGI.py +++ b/flowsa/data_source_scripts/EPA_GHGI.py @@ -191,7 +191,7 @@ def ghg_call(*, resp, url, year, config, **_): # Skip 3-22b for current year (use 3-22 instead) continue else: - df = pd.read_csv(f"{externaldatapath}/GHGI_Table_{table}.csv", + df = pd.read_csv(externaldatapath / f"GHGI_Table_{table}.csv", skiprows=2, encoding="ISO-8859-1", thousands=",") else: try: diff --git a/flowsa/data_source_scripts/EPA_SIT.py b/flowsa/data_source_scripts/EPA_SIT.py index 571f965a4..43439af71 100644 --- a/flowsa/data_source_scripts/EPA_SIT.py +++ b/flowsa/data_source_scripts/EPA_SIT.py @@ -28,7 +28,7 @@ def epa_sit_parse(*, source, year, config, **_): # for each Excel data file listed in the .yaml... for file in config['files']: log.info(f'Loading data from {file}...') - filepath = f"{externaldatapath}/SIT_data/{state}/{file}" + filepath = externaldatapath / f"SIT_data/{state}/{file}" # dictionary containing Excel sheet-specific information file_dict = config['files'][file]['file_dict'] diff --git a/flowsa/data_source_scripts/NETL_EIA_PlantWater.py b/flowsa/data_source_scripts/NETL_EIA_PlantWater.py index f2ee4620f..c86919cab 100644 --- a/flowsa/data_source_scripts/NETL_EIA_PlantWater.py +++ b/flowsa/data_source_scripts/NETL_EIA_PlantWater.py @@ -26,7 +26,7 @@ def netl_eia_parse(*, source, year, **_): # load the csv file DATA_FILE = f"NETL-EIA_powerplants_water_withdraw_consume_data_" \ f"{year}.csv" - df_load = pd.read_csv(f"{externaldatapath}{DATA_FILE}", + df_load = pd.read_csv(externaldatapath / DATA_FILE, index_col=0, low_memory=False) # subset df diff --git a/flowsa/data_source_scripts/NOAA_FisheriesLandings.py b/flowsa/data_source_scripts/NOAA_FisheriesLandings.py index bdb4906ad..157fe6cc2 100644 --- a/flowsa/data_source_scripts/NOAA_FisheriesLandings.py +++ b/flowsa/data_source_scripts/NOAA_FisheriesLandings.py @@ -35,7 +35,7 @@ def noaa_parse(*, year, **_): specifications """ # Read directly into a pandas df - df_raw = pd.read_csv(externaldatapath + "NOAA_FisheriesLandings.csv") + df_raw = pd.read_csv(externaldatapath / "NOAA_FisheriesLandings.csv") # read state fips from common.py df_state = get_state_FIPS().reset_index(drop=True) diff --git a/flowsa/data_source_scripts/StateGHGI.py b/flowsa/data_source_scripts/StateGHGI.py index 6762e1708..416e56e40 100644 --- a/flowsa/data_source_scripts/StateGHGI.py +++ b/flowsa/data_source_scripts/StateGHGI.py @@ -15,14 +15,14 @@ from flowsa.common import load_yaml_dict -data_path = f"{externaldatapath}/StateGHGI_data" +data_path = externaldatapath / "StateGHGI_data" def ME_biogenic_parse(*, source, year, config, **_): df0 = pd.DataFrame() filename = config['filename'] - filepath = f"{data_path}/{filename}" + filepath = data_path / filename # dictionary containing Excel sheet-specific information table_dicts = config['table_dict'] diff --git a/flowsa/data_source_scripts/USGS_WU_Coef.py b/flowsa/data_source_scripts/USGS_WU_Coef.py index 8a69225d1..41fde9f72 100644 --- a/flowsa/data_source_scripts/USGS_WU_Coef.py +++ b/flowsa/data_source_scripts/USGS_WU_Coef.py @@ -24,7 +24,7 @@ def usgs_coef_parse(*, year, **_): specifications """ # Read directly into a pandas df - df_raw = pd.read_csv(externaldatapath + "USGS_WU_Coef_Raw.csv") + df_raw = pd.read_csv(externaldatapath / "USGS_WU_Coef_Raw.csv") # rename columns to match flowbyactivity format df = df_raw.rename(columns={"Animal Type": "ActivityConsumedBy", diff --git a/flowsa/data_source_scripts/stewiFBS.py b/flowsa/data_source_scripts/stewiFBS.py index c1029df3c..8c0a60e5d 100644 --- a/flowsa/data_source_scripts/stewiFBS.py +++ b/flowsa/data_source_scripts/stewiFBS.py @@ -156,7 +156,7 @@ def reassign_process_to_sectors(df, year, file_list, external_config_path): """ df_adj = pd.DataFrame() for file in file_list: - fpath = f"{process_adjustmentpath}{file}.csv" + fpath = process_adjustmentpath / f"{file}.csv" if external_config_path: f_out_path = f"{external_config_path}process_adjustments/{file}.csv" if os.path.isfile(f_out_path): diff --git a/flowsa/naics.py b/flowsa/naics.py index c6c5120a4..eaa1a0ab5 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -92,7 +92,7 @@ def year_crosswalk( corresponding to NAICS codes for the source and target specifications. ''' return ( - pd.read_csv(f'{settings.datapath}NAICS_Crosswalk_TimeSeries.csv', + pd.read_csv(settings.datapath / 'NAICS_Crosswalk_TimeSeries.csv', dtype='object') .assign(source_naics=lambda x: x[f'NAICS_{source_year}_Code'], target_naics=lambda x: x[f'NAICS_{target_year}_Code']) From a9ee785ce3d85f4fded3c63917cf94a46997db7d Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 11 May 2023 16:23:44 -0400 Subject: [PATCH 0564/1127] more pathlib updates --- examples/generate_data_visualization.py | 4 ++-- examples/get_flows_by_activity.py | 2 +- flowsa/__init__.py | 2 +- flowsa/bibliography.py | 6 +++--- flowsa/datavisualization.py | 8 ++++---- flowsa/flowby.py | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/generate_data_visualization.py b/examples/generate_data_visualization.py index ae47f22ca..747989648 100644 --- a/examples/generate_data_visualization.py +++ b/examples/generate_data_visualization.py @@ -27,7 +27,7 @@ plot_title='Direct Resource Use for Livestock' ) # Can manually adjust the figure pop up before saving -plt.savefig(f"{plotoutputpath}livestock_resource_use.png", dpi=300) +plt.savefig(plotoutputpath / "livestock_resource_use.png", dpi=300) ########## Compare the results between water method 1 and method 2 ########## @@ -45,7 +45,7 @@ 'Mining Sectors' ) # Can manually adjust the figure pop up before saving -plt.savefig(f"{plotoutputpath}mining_water_comp.png", dpi=300) +plt.savefig(plotoutputpath / "mining_water_comp.png", dpi=300) ########## Compare food waste flows via Sankey ########## diff --git a/examples/get_flows_by_activity.py b/examples/get_flows_by_activity.py index 87a28e287..58a27184e 100644 --- a/examples/get_flows_by_activity.py +++ b/examples/get_flows_by_activity.py @@ -33,4 +33,4 @@ # save output to csv, maintain leading 0s in location col fba_usgs.Location = fba_usgs.Location.apply('="{}"'.format) -fba_usgs.to_csv(f"{fbaoutputpath}USGS_NWIS_WU_2015.csv", index=False) +fba_usgs.to_csv(fbaoutputpath / "USGS_NWIS_WU_2015.csv", index=False) diff --git a/flowsa/__init__.py b/flowsa/__init__.py index dd9b0773b..79e78c2c7 100644 --- a/flowsa/__init__.py +++ b/flowsa/__init__.py @@ -100,7 +100,7 @@ def writeFlowBySectorBibliography(methodname): """ # Generate a single .bib file for a list of Flow-By-Sector method names # and save file to local directory - log.info(f'Write bibliography to {biboutputpath}{methodname}.bib') + log.info(f'Write bibliography to {biboutputpath / methodname}.bib') generate_fbs_bibliography(methodname) diff --git a/flowsa/bibliography.py b/flowsa/bibliography.py index bdd75483f..92e883088 100644 --- a/flowsa/bibliography.py +++ b/flowsa/bibliography.py @@ -5,10 +5,10 @@ Functions to generate .bib file for a FlowBySector method """ -import os import pandas as pd from bibtexparser.bwriter import BibTexWriter from bibtexparser.bibdatabase import BibDatabase +from esupy.processed_data_mgmt import mkdir_if_missing from flowsa.common import load_yaml_dict, \ load_values_from_literature_citations_config, get_flowsa_base_name, \ sourceconfigpath, load_yaml_dict @@ -148,8 +148,8 @@ def generate_fbs_bibliography(methodname): # write out bibliography writer = BibTexWriter() # create directory if missing - os.makedirs(outputpath + '/Bibliography', exist_ok=True) - with open(f'{biboutputpath}{methodname}.bib', 'w') as bibfile: + mkdir_if_missing(outputpath / 'Bibliography') + with open(biboutputpath / f'{methodname}.bib', 'w') as bibfile: # loop through all entries in bib_list for b in bib_list: bibfile.write(writer.write(b)) diff --git a/flowsa/datavisualization.py b/flowsa/datavisualization.py index 161641e1c..9d1afec4b 100644 --- a/flowsa/datavisualization.py +++ b/flowsa/datavisualization.py @@ -357,8 +357,8 @@ def stackedBarChart(df, if (trace.name in names) else names.add(trace.name)) fig.show() - log.info(f'Saving file to %s', f"{plotoutputpath}{filename}.svg") - fig.write_image(f"{plotoutputpath}{filename}.svg", width=graphic_width, + log.info(f'Saving file to {plotoutputpath / filename}.svg') + fig.write_image(plotoutputpath / f"{filename}.svg", width=graphic_width, height=graphic_height) @@ -679,6 +679,6 @@ def generateSankeyDiagram(methodnames, height = plot_dimension[1] fig.show() - log.info(f'Saving file to %s', f"{plotoutputpath}{filename}.svg") - fig.write_image(f"{plotoutputpath}{filename}.svg", + log.info(f'Saving file to {plotoutputpath / filename}.svg') + fig.write_image(plotoutputpath / f"{filename}.svg", width=width, height=height) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 80a079a17..c0318c61a 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -2157,7 +2157,7 @@ def convert_industry_spec( for table_name, table_config in display_tables.items() } - tables_path = (f'{settings.tableoutputpath}{self.full_name}' + tables_path = (settings.tableoutputpath / f'{self.full_name}' f'_Display_Tables.xlsx') try: with ExcelWriter(tables_path) as writer: From 476c4b27cb281f71989e230e24943013902fa012 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 12 May 2023 14:32:28 -0400 Subject: [PATCH 0565/1127] reset log files after creating a FBS --- flowsa/flowby.py | 4 ++-- flowsa/flowbyactivity.py | 4 ++-- flowsa/flowsa_log.py | 40 +++++++++++++++++++++++++--------------- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 32343266b..c482a1012 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -7,7 +7,7 @@ from flowsa import (common, settings, metadata, sectormapping, literature_values, flowbyactivity, flowsa_yaml, validation, geo, naics, exceptions, location) -from flowsa.flowsa_log import log, rename_log_file +from flowsa.flowsa_log import log, reset_log_file import esupy.processed_data_mgmt import esupy.dqi import fedelemflowlist @@ -2056,7 +2056,7 @@ def generateFlowBySector( log.info(f'FBS generation complete, saving {method} to file') meta = metadata.set_fb_meta(method, 'FlowBySector') esupy.processed_data_mgmt.write_df_to_file(fbs, settings.paths, meta) - rename_log_file(method, meta) + reset_log_file(method, meta) metadata.write_metadata(source_name=method, config=common.load_yaml_dict( method, 'FBS', external_config_path), diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index e14e536b0..5ce137784 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -17,7 +17,7 @@ from flowsa.common import load_env_file_key, sourceconfigpath, \ load_yaml_dict, get_flowsa_base_name from flowsa.settings import paths -from flowsa.flowsa_log import log, rename_log_file +from flowsa.flowsa_log import log, reset_log_file from flowsa.metadata import set_fb_meta, write_metadata from flowsa.flowbyfunctions import fba_fill_na_dict from flowsa.schema import flow_by_activity_fields @@ -179,7 +179,7 @@ def process_data_frame(*, df, source, year, config): write_metadata(source, config, meta, "FlowByActivity", year=year) log.info("FBA generated and saved for %s", name_data) # rename the log file saved to local directory - rename_log_file(name_data, meta) + reset_log_file(name_data, meta) def main(**kwargs): diff --git a/flowsa/flowsa_log.py b/flowsa/flowsa_log.py index 880808268..e3242f836 100644 --- a/flowsa/flowsa_log.py +++ b/flowsa/flowsa_log.py @@ -48,24 +48,22 @@ def format(self, record): file_formatter = logging.Formatter('%(asctime)s %(levelname)-8s %(message)s', datefmt='%Y-%m-%d %H:%M:%S') -log_file_handler = logging.FileHandler( - logoutputpath + 'flowsa.log', - mode='w', encoding='utf-8') -log_file_handler.setLevel(logging.DEBUG) -log_file_handler.setFormatter(file_formatter) - -validation_file_handler = logging.FileHandler( - logoutputpath + 'flowsa_validation.log', - mode='w', encoding='utf-8') -validation_file_handler.setLevel(logging.DEBUG) -validation_file_handler.setFormatter(file_formatter) +def get_log_file_handler(name, level=logging.DEBUG): + h = logging.FileHandler( + logoutputpath + name, + mode='w', encoding='utf-8') + h.setLevel(level) + h.setFormatter(file_formatter) + return h + +log_file_handler = get_log_file_handler('flowsa.log', logging.INFO) +validation_file_handler = get_log_file_handler('flowsa_validation.log') console_handler = logging.StreamHandler(sys.stdout) console_handler.setLevel(logging.INFO) console_handler.setFormatter(console_formatter) log = logging.getLogger('flowsa') -log.setLevel(logging.DEBUG) log.addHandler(console_handler) log.addHandler(log_file_handler) log.propagate = False @@ -75,12 +73,12 @@ def format(self, record): vlog.addHandler(validation_file_handler) -def rename_log_file(filename, fb_meta): +def reset_log_file(filename, fb_meta): """ - Rename the log file saved to local directory using df meta for df + Rename the log file saved to local directory using df meta and + reset the log :param filename: str, name of dataset :param fb_meta: metadata for parquet - :return: modified log file name """ # original log file name - all log statements log_file = f'{logoutputpath}{"flowsa.log"}' @@ -95,6 +93,12 @@ def rename_log_file(filename, fb_meta): # already exists) shutil.copy(log_file, new_log_name) + # Reset log file + for h in log.handlers: + if isinstance(h, logging.FileHandler): + log.removeHandler(h) + log.addHandler(get_log_file_handler('flowsa.log', logging.INFO)) + if fb_meta.category == 'FlowByActivity': return @@ -108,3 +112,9 @@ def rename_log_file(filename, fb_meta): # rename the standard log file name (os.rename throws error if file # already exists) shutil.copy(log_file, new_log_name) + + # Reset validation log file + for h in vlog.handlers: + if isinstance(h, logging.FileHandler): + vlog.removeHandler(h) + vlog.addHandler(get_log_file_handler('flowsa_validation.log')) From abde60f05c611ea20316da988f2df6dceeb138a9 Mon Sep 17 00:00:00 2001 From: Eric Bell Date: Wed, 17 May 2023 15:26:04 -0400 Subject: [PATCH 0566/1127] Create flowbysector method for GHGRP 2019. --- .../methods/flowbysectormethods/GHGRP_2019.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/GHGRP_2019.yaml diff --git a/flowsa/methods/flowbysectormethods/GHGRP_2019.yaml b/flowsa/methods/flowbysectormethods/GHGRP_2019.yaml new file mode 100644 index 000000000..f386aa440 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHGRP_2019.yaml @@ -0,0 +1,15 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +year: 2019 +geoscale: state +source_names: + stewiFBS: + data_format: FBS_outside_flowsa + FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector + # Below are arguments needed by the stewicombo_to_sector function + inventory_dict: + GHGRP: 2019 + local_inventory_name: GHGRP_2019 + compartments: + - air From b72bb2c037ecd27495bd9691b451c012ca82d077 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 17 May 2023 22:47:34 -0400 Subject: [PATCH 0567/1127] use stateio dataset from year of FBS --- flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml index 40d126e0d..d38107f7b 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml @@ -29,15 +29,15 @@ sources_to_cache: _attribution_sources: stateio: &stateio - year: 2012 + year: *year geoscale: state activity_to_sector_mapping: BEA_2012_Summary attribution_method: proportional attribution_source: - Employment_state_2012: + Employment_state_2017: data_format: FBS geoscale: state - year: 2012 + year: *year source_names: EPA_NEI_Nonpoint: From 34c4cc1c02a5a7fcf384121944f879d5070791f3 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sun, 21 May 2023 11:43:58 -0400 Subject: [PATCH 0568/1127] add state models 2012-2020 as needed for stewi based data --- .../CAP_HAP_state_2014.yaml | 146 ++++++++++++++++++ .../CAP_HAP_state_2017.yaml | 5 +- .../CAP_HAP_state_2020.yaml | 146 ++++++++++++++++++ .../flowbysectormethods/CRHW_state_2013.yaml | 9 ++ .../flowbysectormethods/CRHW_state_2015.yaml | 9 ++ .../flowbysectormethods/CRHW_state_2019.yaml | 9 ++ .../GRDREL_national_2020.yaml | 10 ++ .../GRDREL_state_2012.yaml | 10 ++ .../GRDREL_state_2013.yaml | 10 ++ .../GRDREL_state_2014.yaml | 10 ++ .../GRDREL_state_2015.yaml | 10 ++ .../GRDREL_state_2016.yaml | 10 ++ .../GRDREL_state_2018.yaml | 10 ++ .../GRDREL_state_2019.yaml | 10 ++ .../GRDREL_state_2020.yaml | 10 ++ .../TRI_DMR_national_2020.yaml | 11 ++ .../TRI_DMR_state_2012.yaml | 11 ++ .../TRI_DMR_state_2013.yaml | 11 ++ .../TRI_DMR_state_2014.yaml | 11 ++ .../TRI_DMR_state_2015.yaml | 11 ++ .../TRI_DMR_state_2016.yaml | 11 ++ .../TRI_DMR_state_2018.yaml | 11 ++ .../TRI_DMR_state_2020.yaml | 11 ++ 23 files changed, 499 insertions(+), 3 deletions(-) create mode 100644 flowsa/methods/flowbysectormethods/CAP_HAP_state_2014.yaml create mode 100644 flowsa/methods/flowbysectormethods/CAP_HAP_state_2020.yaml create mode 100644 flowsa/methods/flowbysectormethods/CRHW_state_2013.yaml create mode 100644 flowsa/methods/flowbysectormethods/CRHW_state_2015.yaml create mode 100644 flowsa/methods/flowbysectormethods/CRHW_state_2019.yaml create mode 100644 flowsa/methods/flowbysectormethods/GRDREL_national_2020.yaml create mode 100644 flowsa/methods/flowbysectormethods/GRDREL_state_2012.yaml create mode 100644 flowsa/methods/flowbysectormethods/GRDREL_state_2013.yaml create mode 100644 flowsa/methods/flowbysectormethods/GRDREL_state_2014.yaml create mode 100644 flowsa/methods/flowbysectormethods/GRDREL_state_2015.yaml create mode 100644 flowsa/methods/flowbysectormethods/GRDREL_state_2016.yaml create mode 100644 flowsa/methods/flowbysectormethods/GRDREL_state_2018.yaml create mode 100644 flowsa/methods/flowbysectormethods/GRDREL_state_2019.yaml create mode 100644 flowsa/methods/flowbysectormethods/GRDREL_state_2020.yaml create mode 100644 flowsa/methods/flowbysectormethods/TRI_DMR_national_2020.yaml create mode 100644 flowsa/methods/flowbysectormethods/TRI_DMR_state_2012.yaml create mode 100644 flowsa/methods/flowbysectormethods/TRI_DMR_state_2013.yaml create mode 100644 flowsa/methods/flowbysectormethods/TRI_DMR_state_2014.yaml create mode 100644 flowsa/methods/flowbysectormethods/TRI_DMR_state_2015.yaml create mode 100644 flowsa/methods/flowbysectormethods/TRI_DMR_state_2016.yaml create mode 100644 flowsa/methods/flowbysectormethods/TRI_DMR_state_2018.yaml create mode 100644 flowsa/methods/flowbysectormethods/TRI_DMR_state_2020.yaml diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2014.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2014.yaml new file mode 100644 index 000000000..a9faafb0f --- /dev/null +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2014.yaml @@ -0,0 +1,146 @@ +## Method for CAPs and HAPs for states is similar to CAP_HAP for national model +# but uses summary level target and stateio economic data for allocation +# allocation for fuel use is TBD +# Note that EPA_Nonpoint already used some state level allocations for ag-related +# emissions + + +!include:USEEIO_summary_target.yaml +target_naics_year: 2012 +geoscale: state +_emission_year: &year 2014 + +sources_to_cache: + EIA_MECS_Energy: + year: 2014 + geoscale: state + selection_fields: + Class: Energy + Unit: Trillion Btu + Description: + - Table 2.2 + - Table 3.2 + exclusion_fields: + Location: '00000' + estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy + clean_fba: !script_function:EIA_MECS clean_mecs_energy_fba + clean_fba_w_sec: !script_function:EIA_MECS clean_mapped_mecs_energy_fba_to_state + attribution_source: Employment_state_2014 + +_attribution_sources: + stateio: &stateio + year: *year + geoscale: state + activity_to_sector_mapping: BEA_2012_Summary + attribution_method: proportional + attribution_source: + Employment_state_2014: + data_format: FBS + geoscale: state + year: *year + +source_names: + EPA_NEI_Nonpoint: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint + year: *year + + # Update some activity sets from Common to use stateior instead of BEA + activity_sets: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets + mobile_and_fuel_storage: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv mobile_and_fuel_storage + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *stateio + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum 324110 + + fertilizers: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv fertilizers + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *stateio + selection_fields: + ActivityProducedBy: {'325': ''} # Fertilizers 325310 + + pesticides: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv pesticides + exclusion_fields: + # To avoid overlap with other datasets, emissions of pesticides + # from pesticide application are removed. + FlowName: + - 2,4-Dichlorophenoxy Acetic Acid + - Captan + - Carbaryl + - Methyl Bromide + - Methyl Iodide + - Parathion + - Trifluralin + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *stateio + selection_fields: + ActivityProducedBy: {'325': ''} # Pesticides 325320 + + output_allocation: # Gross Output + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv output_allocation + attribution_method: proportional + attribution_source: + stateio_Industry_GO: + year: *year + geoscale: state + activity_to_sector_mapping: BEA_2012_Summary + selection_fields: + Class: Money + attribution_method: proportional + attribution_source: + Employment_state_2014: + data_format: FBS + geoscale: state + year: *year + + EPA_NEI_Nonroad: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad + year: *year + # Update some activity sets from Common to use stateior instead of BEA + activity_sets: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad:activity_sets + offroad_vehicles_equipment: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonroad_asets.csv offroad_vehicles_equipment + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *stateio + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum 324110 + + EPA_NEI_Onroad: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad + year: *year + # Update some activity sets from Common to use stateior instead of BEA + activity_sets: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad:activity_sets + onroad_vehicles_gas_stations: + selection_fields: + PrimaryActivity: !from_index:NEI_Onroad_asets.csv onroad_vehicles_gas_stations + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *stateio + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum 324110 + + stewiFBS: + !include:CAP_HAP_common.yaml:source_names:stewiFBS + inventory_dict: + NEI: *year + TRI: *year + local_inventory_name: NEI_TRI_air_2014 diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml index d38107f7b..caa4f8c52 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml @@ -94,18 +94,17 @@ source_names: attribution_method: proportional attribution_source: stateio_Industry_GO: - year: 2017 + year: *year geoscale: state activity_to_sector_mapping: BEA_2012_Summary selection_fields: Class: Money - FlowName: USD2017 attribution_method: proportional attribution_source: Employment_state_2017: data_format: FBS geoscale: state - year: 2017 + year: *year EPA_NEI_Nonroad: !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2020.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2020.yaml new file mode 100644 index 000000000..4db42257a --- /dev/null +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2020.yaml @@ -0,0 +1,146 @@ +## Method for CAPs and HAPs for states is similar to CAP_HAP for national model +# but uses summary level target and stateio economic data for allocation +# allocation for fuel use is TBD +# Note that EPA_Nonpoint already used some state level allocations for ag-related +# emissions + + +!include:USEEIO_summary_target.yaml +target_naics_year: 2012 +geoscale: state +_emission_year: &year 2020 + +sources_to_cache: + EIA_MECS_Energy: + year: 2018 + geoscale: state + selection_fields: + Class: Energy + Unit: Trillion Btu + Description: + - Table 2.2 + - Table 3.2 + exclusion_fields: + Location: '00000' + estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy + clean_fba: !script_function:EIA_MECS clean_mecs_energy_fba + clean_fba_w_sec: !script_function:EIA_MECS clean_mapped_mecs_energy_fba_to_state + attribution_source: Employment_state_2018 + +_attribution_sources: + stateio: &stateio + year: *year + geoscale: state + activity_to_sector_mapping: BEA_2012_Summary + attribution_method: proportional + attribution_source: + Employment_state_2020: + data_format: FBS + geoscale: state + year: *year + +source_names: + EPA_NEI_Nonpoint: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint + year: *year + + # Update some activity sets from Common to use stateior instead of BEA + activity_sets: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets + mobile_and_fuel_storage: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv mobile_and_fuel_storage + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *stateio + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum 324110 + + fertilizers: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv fertilizers + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *stateio + selection_fields: + ActivityProducedBy: {'325': ''} # Fertilizers 325310 + + pesticides: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv pesticides + exclusion_fields: + # To avoid overlap with other datasets, emissions of pesticides + # from pesticide application are removed. + FlowName: + - 2,4-Dichlorophenoxy Acetic Acid + - Captan + - Carbaryl + - Methyl Bromide + - Methyl Iodide + - Parathion + - Trifluralin + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *stateio + selection_fields: + ActivityProducedBy: {'325': ''} # Pesticides 325320 + + output_allocation: # Gross Output + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv output_allocation + attribution_method: proportional + attribution_source: + stateio_Industry_GO: + year: *year + geoscale: state + activity_to_sector_mapping: BEA_2012_Summary + selection_fields: + Class: Money + attribution_method: proportional + attribution_source: + Employment_state_2020: + data_format: FBS + geoscale: state + year: *year + + EPA_NEI_Nonroad: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad + year: *year + # Update some activity sets from Common to use stateior instead of BEA + activity_sets: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad:activity_sets + offroad_vehicles_equipment: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonroad_asets.csv offroad_vehicles_equipment + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *stateio + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum 324110 + + EPA_NEI_Onroad: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad + year: *year + # Update some activity sets from Common to use stateior instead of BEA + activity_sets: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad:activity_sets + onroad_vehicles_gas_stations: + selection_fields: + PrimaryActivity: !from_index:NEI_Onroad_asets.csv onroad_vehicles_gas_stations + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *stateio + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum 324110 + + stewiFBS: + !include:CAP_HAP_common.yaml:source_names:stewiFBS + inventory_dict: + NEI: *year + TRI: *year + local_inventory_name: NEI_TRI_air_2020 diff --git a/flowsa/methods/flowbysectormethods/CRHW_state_2013.yaml b/flowsa/methods/flowbysectormethods/CRHW_state_2013.yaml new file mode 100644 index 000000000..cad60cd6a --- /dev/null +++ b/flowsa/methods/flowbysectormethods/CRHW_state_2013.yaml @@ -0,0 +1,9 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +year: 2013 +geoscale: state +source_names: + stewiFBS: !include:stewiFBS_common.yaml:CRHW + inventory_dict: + RCRAInfo: 2013 diff --git a/flowsa/methods/flowbysectormethods/CRHW_state_2015.yaml b/flowsa/methods/flowbysectormethods/CRHW_state_2015.yaml new file mode 100644 index 000000000..5dd03d930 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/CRHW_state_2015.yaml @@ -0,0 +1,9 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +year: 2015 +geoscale: state +source_names: + stewiFBS: !include:stewiFBS_common.yaml:CRHW + inventory_dict: + RCRAInfo: 2015 diff --git a/flowsa/methods/flowbysectormethods/CRHW_state_2019.yaml b/flowsa/methods/flowbysectormethods/CRHW_state_2019.yaml new file mode 100644 index 000000000..879a60b0c --- /dev/null +++ b/flowsa/methods/flowbysectormethods/CRHW_state_2019.yaml @@ -0,0 +1,9 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +year: 2019 +geoscale: state +source_names: + stewiFBS: !include:stewiFBS_common.yaml:CRHW + inventory_dict: + RCRAInfo: 2019 diff --git a/flowsa/methods/flowbysectormethods/GRDREL_national_2020.yaml b/flowsa/methods/flowbysectormethods/GRDREL_national_2020.yaml new file mode 100644 index 000000000..fe238e3a7 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GRDREL_national_2020.yaml @@ -0,0 +1,10 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +year: 2020 +geoscale: national +source_names: + stewiFBS: !include:stewiFBS_common.yaml:GRDREL + inventory_dict: + TRI: 2020 + local_inventory_name: TRI_GRDREL_2020 diff --git a/flowsa/methods/flowbysectormethods/GRDREL_state_2012.yaml b/flowsa/methods/flowbysectormethods/GRDREL_state_2012.yaml new file mode 100644 index 000000000..4b1e5ba3e --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GRDREL_state_2012.yaml @@ -0,0 +1,10 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +year: 2012 +geoscale: state +source_names: + stewiFBS: !include:stewiFBS_common.yaml:GRDREL + inventory_dict: + TRI: 2012 + local_inventory_name: TRI_GRDREL_2012 diff --git a/flowsa/methods/flowbysectormethods/GRDREL_state_2013.yaml b/flowsa/methods/flowbysectormethods/GRDREL_state_2013.yaml new file mode 100644 index 000000000..bde583666 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GRDREL_state_2013.yaml @@ -0,0 +1,10 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +year: 2013 +geoscale: state +source_names: + stewiFBS: !include:stewiFBS_common.yaml:GRDREL + inventory_dict: + TRI: 2013 + local_inventory_name: TRI_GRDREL_2013 diff --git a/flowsa/methods/flowbysectormethods/GRDREL_state_2014.yaml b/flowsa/methods/flowbysectormethods/GRDREL_state_2014.yaml new file mode 100644 index 000000000..97466fa5b --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GRDREL_state_2014.yaml @@ -0,0 +1,10 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +year: 2014 +geoscale: state +source_names: + stewiFBS: !include:stewiFBS_common.yaml:GRDREL + inventory_dict: + TRI: 2014 + local_inventory_name: TRI_GRDREL_2014 diff --git a/flowsa/methods/flowbysectormethods/GRDREL_state_2015.yaml b/flowsa/methods/flowbysectormethods/GRDREL_state_2015.yaml new file mode 100644 index 000000000..fee423ae2 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GRDREL_state_2015.yaml @@ -0,0 +1,10 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +year: 2015 +geoscale: state +source_names: + stewiFBS: !include:stewiFBS_common.yaml:GRDREL + inventory_dict: + TRI: 2015 + local_inventory_name: TRI_GRDREL_2015 diff --git a/flowsa/methods/flowbysectormethods/GRDREL_state_2016.yaml b/flowsa/methods/flowbysectormethods/GRDREL_state_2016.yaml new file mode 100644 index 000000000..766202966 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GRDREL_state_2016.yaml @@ -0,0 +1,10 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +year: 2016 +geoscale: state +source_names: + stewiFBS: !include:stewiFBS_common.yaml:GRDREL + inventory_dict: + TRI: 2016 + local_inventory_name: TRI_GRDREL_2016 diff --git a/flowsa/methods/flowbysectormethods/GRDREL_state_2018.yaml b/flowsa/methods/flowbysectormethods/GRDREL_state_2018.yaml new file mode 100644 index 000000000..669eb5290 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GRDREL_state_2018.yaml @@ -0,0 +1,10 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +year: 2018 +geoscale: state +source_names: + stewiFBS: !include:stewiFBS_common.yaml:GRDREL + inventory_dict: + TRI: 2018 + local_inventory_name: TRI_GRDREL_2018 diff --git a/flowsa/methods/flowbysectormethods/GRDREL_state_2019.yaml b/flowsa/methods/flowbysectormethods/GRDREL_state_2019.yaml new file mode 100644 index 000000000..df93b3603 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GRDREL_state_2019.yaml @@ -0,0 +1,10 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +year: 2019 +geoscale: state +source_names: + stewiFBS: !include:stewiFBS_common.yaml:GRDREL + inventory_dict: + TRI: 2019 + local_inventory_name: TRI_GRDREL_2019 diff --git a/flowsa/methods/flowbysectormethods/GRDREL_state_2020.yaml b/flowsa/methods/flowbysectormethods/GRDREL_state_2020.yaml new file mode 100644 index 000000000..f4138366a --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GRDREL_state_2020.yaml @@ -0,0 +1,10 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +year: 2020 +geoscale: state +source_names: + stewiFBS: !include:stewiFBS_common.yaml:GRDREL + inventory_dict: + TRI: 2020 + local_inventory_name: TRI_GRDREL_2020 diff --git a/flowsa/methods/flowbysectormethods/TRI_DMR_national_2020.yaml b/flowsa/methods/flowbysectormethods/TRI_DMR_national_2020.yaml new file mode 100644 index 000000000..5353e4c89 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/TRI_DMR_national_2020.yaml @@ -0,0 +1,11 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +year: 2020 +geoscale: national +source_names: + stewiFBS: !include:stewiFBS_common.yaml:TRI_DMR + inventory_dict: + TRI: 2020 + DMR: 2020 + local_inventory_name: TRI_DMR_2020 diff --git a/flowsa/methods/flowbysectormethods/TRI_DMR_state_2012.yaml b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2012.yaml new file mode 100644 index 000000000..0f01c5fd9 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2012.yaml @@ -0,0 +1,11 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +year: 2012 +geoscale: state +source_names: + stewiFBS: !include:stewiFBS_common.yaml:TRI_DMR + inventory_dict: + TRI: 2012 + DMR: 2012 + local_inventory_name: TRI_DMR_2012 diff --git a/flowsa/methods/flowbysectormethods/TRI_DMR_state_2013.yaml b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2013.yaml new file mode 100644 index 000000000..7ea0d7326 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2013.yaml @@ -0,0 +1,11 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +year: 2013 +geoscale: state +source_names: + stewiFBS: !include:stewiFBS_common.yaml:TRI_DMR + inventory_dict: + TRI: 2013 + DMR: 2013 + local_inventory_name: TRI_DMR_2013 diff --git a/flowsa/methods/flowbysectormethods/TRI_DMR_state_2014.yaml b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2014.yaml new file mode 100644 index 000000000..4d97a7f49 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2014.yaml @@ -0,0 +1,11 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +year: 2014 +geoscale: state +source_names: + stewiFBS: !include:stewiFBS_common.yaml:TRI_DMR + inventory_dict: + TRI: 2014 + DMR: 2014 + local_inventory_name: TRI_DMR_2014 diff --git a/flowsa/methods/flowbysectormethods/TRI_DMR_state_2015.yaml b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2015.yaml new file mode 100644 index 000000000..8a91e4725 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2015.yaml @@ -0,0 +1,11 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +year: 2015 +geoscale: state +source_names: + stewiFBS: !include:stewiFBS_common.yaml:TRI_DMR + inventory_dict: + TRI: 2015 + DMR: 2015 + local_inventory_name: TRI_DMR_2015 diff --git a/flowsa/methods/flowbysectormethods/TRI_DMR_state_2016.yaml b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2016.yaml new file mode 100644 index 000000000..85e8da9a7 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2016.yaml @@ -0,0 +1,11 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +year: 2016 +geoscale: state +source_names: + stewiFBS: !include:stewiFBS_common.yaml:TRI_DMR + inventory_dict: + TRI: 2016 + DMR: 2016 + local_inventory_name: TRI_DMR_2016 diff --git a/flowsa/methods/flowbysectormethods/TRI_DMR_state_2018.yaml b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2018.yaml new file mode 100644 index 000000000..1e5631a76 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2018.yaml @@ -0,0 +1,11 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +year: 2018 +geoscale: state +source_names: + stewiFBS: !include:stewiFBS_common.yaml:TRI_DMR + inventory_dict: + TRI: 2018 + DMR: 2018 + local_inventory_name: TRI_DMR_2018 diff --git a/flowsa/methods/flowbysectormethods/TRI_DMR_state_2020.yaml b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2020.yaml new file mode 100644 index 000000000..53de2918b --- /dev/null +++ b/flowsa/methods/flowbysectormethods/TRI_DMR_state_2020.yaml @@ -0,0 +1,11 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +year: 2020 +geoscale: state +source_names: + stewiFBS: !include:stewiFBS_common.yaml:TRI_DMR + inventory_dict: + TRI: 2020 + DMR: 2020 + local_inventory_name: TRI_DMR_2020 From 0a2ef60141120ad5344f619ec19cd08ed32a3333 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 22 May 2023 10:38:46 -0600 Subject: [PATCH 0569/1127] not necessary to drop columns --- flowsa/flowbyclean.py | 1 - 1 file changed, 1 deletion(-) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index ac1529a8d..bd5d135ae 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -110,7 +110,6 @@ def substitute_nonexistent_values( fba = (fba .add_primary_secondary_columns('Sector') - .drop(columns=['group_id', 'group_total']) ) # merge all possible national data with each state From 2bc6b17898b8d6cde08b4d40cca6b67d6ffdbc53 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 22 May 2023 10:39:54 -0600 Subject: [PATCH 0570/1127] reviste water fbs method so attribution methods can be called in sequence --- .../Water_national_2015_m1.yaml | 294 ++++++++++-------- 1 file changed, 159 insertions(+), 135 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index e42eed4d1..ca0fd4da0 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -20,18 +20,22 @@ source_names: - "Public Supply" - "Thermoelectric Power" - "Domestic" - attribution_method: direct + attribute: + attribution_method: direct employment_attribution: selection_fields: PrimaryActivity: - "Industrial" - "Mining" - attribution_method: proportional - attribution_source: - Employment_national_2015: - geoscale: national - data_format: FBS - year: 2015 + attribute: + attribution_method: proportional + attribution_source: + Employment_national_2015: + geoscale: national + data_format: FBS + year: 2015 + attribute: + attribution_method: direct cropland_attribution: industry_spec: default: NAICS_6 @@ -39,120 +43,137 @@ source_names: selection_fields: PrimaryActivity: - "Irrigation Crop" - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland: - year: 2017 - selection_fields: - Class: "Land" - FlowName: - - "AREA HARVESTED, IRRIGATED" - - "AREA IN PRODUCTION, IRRIGATED" - - "AREA, IRRIGATED" - - 'AREA BEARING & NON-BEARING, IRRIGATED' - - 'AREA GROWN, IRRIGATED' - activity_sets: - cropland_attribution-pastureland: - selection_fields: - PrimaryActivity: 'AG LAND, (EXCL HARVESTED CROPLAND)' - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland_NAICS: - year: 2017 - selection_fields: - Class: Land - FlowName: - - "FARM OPERATIONS" - estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_sectors_equal_attribution - selection_fields_after_data_suppression_estimation: - PrimaryActivity: ["112111", "112112", "11212", "1122", - "11231", "11232", "11233", "11234", - "11239", "11241", "11242", "11291", - "11292", "11293", "11299"] - attribution_method: multiplication - attribution_source: - USDA_IWMS: &usda_iwms - year: 2018 - selection_fields: - Class: Water - clean_fba_w_sec: !clean_function:flowbyclean substitute_nonexistent_values - clean_source: - USDA_IWMS: - geoscale: national - year: 2018 - selection_fields: - Class: Water - cropland_attribution-cropland: + attribute: + - attribution_method: proportional + attribution_source: + USDA_CoA_Cropland: + year: 2017 selection_fields: - PrimaryActivity: ['SOYBEANS', 'CANOLA', 'FLAXSEED', - 'MUSTARD, SEED', 'RAPESEED', 'SAFFLOWER', 'SESAME', - 'SUNFLOWER', 'CAMELINA', 'BEANS, DRY EDIBLE, (EXCL LIMA), - INCL CHICKPEAS', 'BEANS, DRY EDIBLE, (EXCL CHICKPEAS & - LIMA)', 'BEANS, DRY EDIBLE, LIMA', 'CHICKPEAS', 'LENTILS', - 'PEAS, DRY EDIBLE', 'PEAS, DRY, SOUTHERN (COWPEAS)', - 'WHEAT', 'CORN', 'CORN, GRAIN', 'CORN, SILAGE', - 'POPCORN, SHELLED', 'RICE', 'BARLEY', 'BUCKWHEAT', - 'MILLET, PROSO', 'OATS', 'RYE', 'SORGHUM, GRAIN', - 'SORGHUM, SILAGE', 'SORGHUM, SYRUP', 'TRITICALE', 'WILD - RICE', 'VEGETABLE TOTALS', 'ORCHARDS', - 'BERRY TOTALS', 'CUT CHRISTMAS TREES', 'SHORT TERM WOODY - CROPS', 'TOBACCO', 'COTTON', 'SUGARCANE, SUGAR', - 'SUGARCANE, SEED', 'HAY & HAYLAGE', 'SUGARBEETS', - 'SUGARBEETS, SEED', 'PEANUTS', 'GRASSES & - LEGUMES TOTALS, SEED', 'HERBS, DRY', 'HOPS', - 'MINT, OIL', 'MISCANTHUS', 'MINT, TEA LEAVES', - 'FIELD CROPS, OTHER'] - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland_NAICS: - year: 2017 + Class: "Land" + FlowName: + - "AREA HARVESTED, IRRIGATED" + - "AREA IN PRODUCTION, IRRIGATED" + - "AREA, IRRIGATED" + - 'AREA BEARING & NON-BEARING, IRRIGATED' + - 'AREA GROWN, IRRIGATED' + activity_sets: + cropland_attribution-pastureland: selection_fields: - Class: Land - FlowName: - - "AG LAND, CROPLAND, HARVESTED" - PrimaryActivity: ["11111", "11112", "11113", "11114", - "11115", "11116", "11119", "111211", - "111219", "11131", - "11132", "111331", "111332", - "111333", "111334", "111335", - "111336", "111339", "11141", - "111421", "111422", "11191", "11192", - "11193", "11194", "11199"] - estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_sectors_equal_attribution - attribution_method: multiplication - attribution_source: - USDA_IWMS: - industry_spec: - default: NAICS_6 - NAICS_7: ['111150', '111199', '111940'] # hay and haylage set to NAICS7 - will update to NAICS6 - <<: *usda_iwms - activity_sets: - cropland_attribution-cropland-nonhay: - selection_fields: - PrimaryActivity: ['BEANS, DRY EDIBLE, INCL - CHICKPEAS', 'BERRY TOTALS', 'CORN, GRAIN', - 'CORN, SILAGE', 'COTTON', 'CROPS, OTHER', - 'HORTICULTURE TOTALS', 'ORCHARDS', - 'PASTURELAND', 'PEANUTS', 'POTATOES', 'RICE', - 'SMALL GRAINS, OTHER', 'SORGHUM, GRAIN', - 'SOYBEANS', 'SWEET CORN', 'TOMATOES', - 'VEGETABLE TOTALS', 'WHEAT'] - cropland_attribution-cropland-hay: - selection_fields: - PrimaryActivity: ['HAY & HAYLAGE, (EXCL ALFALFA)', - 'HAY & HAYLAGE, ALFALFA'] - clean_fba_w_sec: !clean_function:flowbyclean weighted_average - replacement_dictionary: {'HAY & HAYLAGE, (EXCL ALFALFA)': 'HAY & HAYLAGE', - 'HAY & HAYLAGE, ALFALFA': 'HAY & HAYLAGE', - '111940A': '111940', - '111940B': '111940'} - clean_source: - USDA_IWMS: + PrimaryActivity: 'AG LAND, (EXCL HARVESTED CROPLAND)' + attribute: + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + year: 2017 + selection_fields: + Class: Land + FlowName: + - "FARM OPERATIONS" + estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_sectors_equal_attribution + selection_fields_after_data_suppression_estimation: + PrimaryActivity: ["112111", "112112", "11212", "1122", + "11231", "11232", "11233", "11234", + "11239", "11241", "11242", "11291", + "11292", "11293", "11299"] + attribute: + attribution_method: multiplication + attribution_source: + USDA_IWMS: &usda_iwms + geoscale: state year: 2018 selection_fields: - Class: Land - PrimaryActivity: ['HAY & HAYLAGE, (EXCL ALFALFA)', 'HAY & HAYLAGE, ALFALFA'] - estimate_suppressed: !script_function:USDA_IWMS estimate_suppressed_iwms + Class: Water + attribute: + attribution_method: direct + clean_fba_after_attribution: !clean_function:flowbyclean substitute_nonexistent_values + clean_source: + USDA_IWMS: + geoscale: national + year: 2018 + selection_fields: + Class: Water + attribute: + attribution_method: direct + cropland_attribution-cropland: + selection_fields: + PrimaryActivity: ['SOYBEANS', 'CANOLA', 'FLAXSEED', + 'MUSTARD, SEED', 'RAPESEED', 'SAFFLOWER', 'SESAME', + 'SUNFLOWER', 'CAMELINA', 'BEANS, DRY EDIBLE, (EXCL LIMA), + INCL CHICKPEAS', 'BEANS, DRY EDIBLE, (EXCL CHICKPEAS & + LIMA)', 'BEANS, DRY EDIBLE, LIMA', 'CHICKPEAS', 'LENTILS', + 'PEAS, DRY EDIBLE', 'PEAS, DRY, SOUTHERN (COWPEAS)', + 'WHEAT', 'CORN', 'CORN, GRAIN', 'CORN, SILAGE', + 'POPCORN, SHELLED', 'RICE', 'BARLEY', 'BUCKWHEAT', + 'MILLET, PROSO', 'OATS', 'RYE', 'SORGHUM, GRAIN', + 'SORGHUM, SILAGE', 'SORGHUM, SYRUP', 'TRITICALE', 'WILD + RICE', 'VEGETABLE TOTALS', 'ORCHARDS', + 'BERRY TOTALS', 'CUT CHRISTMAS TREES', 'SHORT TERM WOODY + CROPS', 'TOBACCO', 'COTTON', 'SUGARCANE, SUGAR', + 'SUGARCANE, SEED', 'HAY & HAYLAGE', 'SUGARBEETS', + 'SUGARBEETS, SEED', 'PEANUTS', 'GRASSES & + LEGUMES TOTALS, SEED', 'HERBS, DRY', 'HOPS', + 'MINT, OIL', 'MISCANTHUS', 'MINT, TEA LEAVES', + 'FIELD CROPS, OTHER'] + attribute: + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + year: 2017 + selection_fields: + Class: Land + FlowName: + - "AG LAND, CROPLAND, HARVESTED" + PrimaryActivity: ["11111", "11112", "11113", "11114", + "11115", "11116", "11119", "111211", + "111219", "11131", + "11132", "111331", "111332", + "111333", "111334", "111335", + "111336", "111339", "11141", + "111421", "111422", "11191", "11192", + "11193", "11194", "11199"] + estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_sectors_equal_attribution + attribute: + attribution_method: direct + - attribution_method: multiplication + attribution_source: + USDA_IWMS: + industry_spec: + default: NAICS_6 + NAICS_7: ['111150', '111199', '111940'] # hay and haylage set to NAICS7 - will update to NAICS6 + <<: *usda_iwms + activity_sets: + cropland_attribution-cropland-nonhay: + selection_fields: + PrimaryActivity: ['BEANS, DRY EDIBLE, INCL + CHICKPEAS', 'BERRY TOTALS', 'CORN, GRAIN', + 'CORN, SILAGE', 'COTTON', 'CROPS, OTHER', + 'HORTICULTURE TOTALS', 'ORCHARDS', + 'PASTURELAND', 'PEANUTS', 'POTATOES', 'RICE', + 'SMALL GRAINS, OTHER', 'SORGHUM, GRAIN', + 'SOYBEANS', 'SWEET CORN', 'TOMATOES', + 'VEGETABLE TOTALS', 'WHEAT'] + attribute: + attribution_method: direct + cropland_attribution-cropland-hay: + selection_fields: + PrimaryActivity: ['HAY & HAYLAGE, (EXCL ALFALFA)', + 'HAY & HAYLAGE, ALFALFA'] + clean_fba_w_sec: !clean_function:flowbyclean weighted_average + replacement_dictionary: {'HAY & HAYLAGE, (EXCL ALFALFA)': 'HAY & HAYLAGE', + 'HAY & HAYLAGE, ALFALFA': 'HAY & HAYLAGE', + '111940A': '111940', + '111940B': '111940'} + clean_source: + USDA_IWMS: + year: 2018 + selection_fields: + Class: Land + PrimaryActivity: ['HAY & HAYLAGE, (EXCL ALFALFA)', 'HAY & HAYLAGE, ALFALFA'] + estimate_suppressed: !script_function:USDA_IWMS estimate_suppressed_iwms + attribute: + attribution_method: direct + attribute: + attribution_method: direct livestock_attribution: industry_spec: default: NAICS_6 @@ -161,21 +182,24 @@ source_names: selection_fields: PrimaryActivity: - "Livestock" - attribution_method: proportional - attribution_source: - USDA_CoA_Livestock: - year: 2017 - selection_fields: - Class: Other - FlowName: - - "HEAD" - - "NUMBER" - - "COLONIES" - Compartment: - - "NOT SPECIFIED" - attribution_method: multiplication - attribution_source: - USGS_WU_Coef: - year: 2005 - geoscale: national - attribution_method: direct + attribute: + attribution_method: proportional + attribution_source: + USDA_CoA_Livestock: + year: 2017 + selection_fields: + Class: Other + FlowName: + - "HEAD" + - "NUMBER" + - "COLONIES" + Compartment: + - "NOT SPECIFIED" + attribute: + attribution_method: multiplication + attribution_source: + USGS_WU_Coef: + year: 2005 + geoscale: national + attribute: + attribution_method: direct From 0afb568ca113f4e1271dd853fef161ed5891fc06 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 22 May 2023 11:19:18 -0600 Subject: [PATCH 0571/1127] update attribute_flows_to_sectors() to work for consecutive attribution methods --- flowsa/flowby.py | 167 ++++++++++++++++++++++++++--------------------- 1 file changed, 93 insertions(+), 74 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index af2970169..5ea26ee6e 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -608,79 +608,93 @@ def attribute_flows_to_sectors( attributed to those sectors, by the methods specified in the calling FBA's configuration dictionary. """ - grouped: 'FB' = ( - self - .reset_index(drop=True).reset_index() - .rename(columns={'index': 'group_id'}) - .assign(group_total=self.FlowAmount) - ) - if len(grouped)==0: - log.warning(f'No data remaining in {self.full_name}.') - return self - if self.config['data_format'] == 'FBA': - fb: 'FlowByActivity' = ( - grouped - .map_to_sectors(external_config_path=external_config_path) - .function_socket('clean_fba_w_sec', - attr=self.config, - method=self.config) - .rename(columns={'SourceName': 'MetaSources'}) - ) - elif self.config['data_format'] == 'FBS': - fb = grouped.copy() + attribute_config = self.config.get('attribute', None) - attribution_method = fb.config.get('attribution_method') - if attribution_method == 'direct' or attribution_method is None: - fb = fb.assign(AttributionSources='Direct') - else: - fb = fb.assign(AttributionSources=','.join( - [k for k in fb.config.get('attribution_source').keys()])) + if isinstance(attribute_config, dict): + attribute_config = [attribute_config] + if attribute_config is None: + log.error('Attribution method is missing') - if attribution_method == 'proportional': - attribution_fbs = fb.load_prepare_attribution_source() - attributed_fb = fb.proportionally_attribute(attribution_fbs) + for step_config in attribute_config: + grouped: 'FB' = ( + self + .reset_index(drop=True).reset_index() + .rename(columns={'index': 'group_id'}) + .assign(group_total=self.FlowAmount) + ) + if len(grouped)==0: + log.warning(f'No data remaining in {self.full_name}.') + return self + if self.config['data_format'] == 'FBA': + fb: 'FlowByActivity' = ( + grouped + .map_to_sectors(external_config_path=external_config_path) + .function_socket('clean_fba_w_sec', + attr=self.config, + method=self.config) + .rename(columns={'SourceName': 'MetaSources'}) + ) + elif self.config['data_format'] == 'FBS': + fb = grouped.copy() - elif attribution_method == 'multiplication': - attribution_fbs = fb.load_prepare_attribution_source() - attributed_fb = fb.multiplication_attribution(attribution_fbs) + attribution_method = step_config.get('attribution_method') + if attribution_method == 'direct': + fb = fb.assign(AttributionSources='Direct') + else: + fb = fb.assign(AttributionSources=','.join( + [k for k in step_config.get('attribution_source').keys()])) + + if attribution_method == 'proportional': + log.info(f'attributing {self.full_name} with ' + f'{attribute_config[0]["attribution_source"]}') + attribution_fbs = fb.load_prepare_attribution_source( + attribution_config=step_config + ) + attributed_fb = fb.proportionally_attribute(attribution_fbs) - else: - if all(fb.groupby('group_id')['group_id'].agg('count') == 1): - log.info('No attribution needed for %s at the given industry ' - 'aggregation level', fb.full_name) - return fb.drop(columns=['group_id', 'group_total']) - - if attribution_method is None: - log.warning('No attribution method specified for %s. ' - 'Using equal attribution as default.', - fb.full_name) - elif attribution_method != 'direct': - log.error('Attribution method for %s not recognized: %s', - fb.full_name, attribution_method) - raise ValueError('Attribution method not recognized') - - attributed_fb = fb.equally_attribute() - - # if the attribution method is not multiplication, check that new df - # values equal original df values - if attribution_method not in ['multiplication', 'weighted_average', - 'substitute_nonexistent_values']: - # todo: add results from this if statement to validation log - validation_fb = attributed_fb.assign( - validation_total=(attributed_fb.groupby('group_id') - ['FlowAmount'].transform('sum')) - ) - if not np.allclose(validation_fb.group_total, - validation_fb.validation_total, - equal_nan=True): - errors = (validation_fb - .query('validation_total != group_total') - [['group_id', - 'ActivityProducedBy', 'ActivityConsumedBy', - 'SectorProducedBy', 'SectorConsumedBy', - 'FlowAmount', 'group_total', 'validation_total']]) - log.error('Errors in attributing flows from %s:\n%s', - self.full_name, errors) + elif attribution_method == 'multiplication': + attribution_fbs = fb.load_prepare_attribution_source( + attribution_config=step_config + ) + attributed_fb = fb.multiplication_attribution(attribution_fbs) + + else: + if all(fb.groupby('group_id')['group_id'].agg('count') == 1): + log.info('No attribution needed for %s at the given industry ' + 'aggregation level', fb.full_name) + return fb.drop(columns=['group_id', 'group_total']) + + if attribution_method is None: + log.warning('No attribution method specified for %s. ' + 'Using equal attribution as default.', + fb.full_name) + elif attribution_method != 'direct': + log.error('Attribution method for %s not recognized: %s', + fb.full_name, attribution_method) + raise ValueError('Attribution method not recognized') + + attributed_fb = fb.equally_attribute() + + # if the attribution method is not multiplication, check that new df + # values equal original df values + if attribution_method not in ['multiplication', 'weighted_average', + 'substitute_nonexistent_values']: + # todo: add results from this if statement to validation log + validation_fb = attributed_fb.assign( + validation_total=(attributed_fb.groupby('group_id') + ['FlowAmount'].transform('sum')) + ) + if not np.allclose(validation_fb.group_total, + validation_fb.validation_total, + equal_nan=True): + errors = (validation_fb + .query('validation_total != group_total') + [['group_id', + 'ActivityProducedBy', 'ActivityConsumedBy', + 'SectorProducedBy', 'SectorConsumedBy', + 'FlowAmount', 'group_total', 'validation_total']]) + log.error('Errors in attributing flows from %s:\n%s', + self.full_name, errors) return attributed_fb.drop(columns=['group_id', 'group_total']) @@ -750,9 +764,14 @@ def activity_sets(self) -> List['FB']: return child_df_list def load_prepare_attribution_source( - self: 'FlowByActivity' + self: 'FlowByActivity', + attribution_config=None ) -> 'FlowBySector': - attribution_source = self.config['attribution_source'] + + if attribution_config is None: + attribution_source = self.config['attribute']['attribution_source'] + else: + attribution_source = attribution_config['attribution_source'] if isinstance(attribution_source, str): name, config = attribution_source, {} @@ -1843,7 +1862,8 @@ def proportionally_attribute( log.info('Attributing flows in %s using %s.', self.full_name, other.full_name) - fba_geoscale, other_geoscale, fba, other = self.harmonize_geoscale(other) + fba_geoscale, other_geoscale, fba, other = self.harmonize_geoscale( + other) # attribute on sector columns if self.config.get('attribute_on') is None: @@ -1975,8 +1995,7 @@ def proportionally_attribute( if self.config.get('fill_sector_column') is not None: sector_col = self.config.get('fill_sector_column') - fba[sector_col] = fba['PrimarySector_other'] - + fba[sector_col] = fba['PrimarySector_other'] return ( fba From 878a1742d3ba422461f656476e9e4f9fbc4372fa Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 22 May 2023 13:26:41 -0400 Subject: [PATCH 0572/1127] fix FIPS to string issue presenting in older NEI datasets which load as floats --- flowsa/data_source_scripts/EPA_NEI.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_NEI.py b/flowsa/data_source_scripts/EPA_NEI.py index 4bbecac34..fdce41fd0 100644 --- a/flowsa/data_source_scripts/EPA_NEI.py +++ b/flowsa/data_source_scripts/EPA_NEI.py @@ -74,19 +74,23 @@ def epa_nei_global_parse(*, df_list, source, year, config, **_): # rename columns to match flowbyactivity format col_dict = {value: key for (key, value) in config['col_dict'][year].items()} df = df.rename(columns=col_dict) + # drop all other columns + df = df.drop(columns=df.columns.difference( + list(config['col_dict'][year].keys()))) # make sure FIPS are string and 5 digits - df['Location'] = df['Location'].astype('str').apply('{:0>5}'.format) + df = (df.assign(Location=lambda x: + x['Location'].fillna(0) + .astype('int') + .astype('str') + .str.zfill(5)) + ) # remove records from certain FIPS excluded_fips = ['78', '85', '88'] df = df[~df['Location'].str[0:2].isin(excluded_fips)] excluded_fips2 = ['777'] df = df[~df['Location'].str[-3:].isin(excluded_fips2)] - # drop all other columns - df.drop(columns=df.columns.difference( - list(config['col_dict'][year].keys())), inplace=True) - # to align with other processed NEI data (Point from StEWI), units are # converted during FBA creation instead of maintained df = standardize_units(df) From fd6730035486e58c2f8e513085cd4227eaf87337 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 22 May 2023 17:14:52 -0600 Subject: [PATCH 0573/1127] drop old import statement --- flowsa/data_source_scripts/EPA_REI.py | 1 - 1 file changed, 1 deletion(-) diff --git a/flowsa/data_source_scripts/EPA_REI.py b/flowsa/data_source_scripts/EPA_REI.py index 2bf243af3..5bf365038 100644 --- a/flowsa/data_source_scripts/EPA_REI.py +++ b/flowsa/data_source_scripts/EPA_REI.py @@ -7,7 +7,6 @@ import numpy as np from flowsa.location import US_FIPS from flowsa.flowbyfunctions import assign_fips_location_system -from flowsa.fbs_allocation import direct_allocation_method from flowsa.flowby import FlowBySector From feb612cec061d07b801ad08f816be65901b11f87 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 22 May 2023 17:17:12 -0600 Subject: [PATCH 0574/1127] update flowby log statements --- flowsa/flowby.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 5ea26ee6e..572c25cd9 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -638,21 +638,28 @@ def attribute_flows_to_sectors( fb = grouped.copy() attribution_method = step_config.get('attribution_method') + if 'attribution_source' in step_config: + for k, v in step_config['attribution_source'].items(): + attribution_name = k + if attribution_method == 'direct': + log.info(f"Directly attributing {self.full_name} to " + f"target sectors.") fb = fb.assign(AttributionSources='Direct') else: fb = fb.assign(AttributionSources=','.join( [k for k in step_config.get('attribution_source').keys()])) if attribution_method == 'proportional': - log.info(f'attributing {self.full_name} with ' - f'{attribute_config[0]["attribution_source"]}') + log.info(f"Proportionally attributing {self.full_name} to " + f"target sectors with {attribution_name}") attribution_fbs = fb.load_prepare_attribution_source( attribution_config=step_config ) attributed_fb = fb.proportionally_attribute(attribution_fbs) elif attribution_method == 'multiplication': + log.info(f"Multiplying {self.full_name} by {attribution_name}") attribution_fbs = fb.load_prepare_attribution_source( attribution_config=step_config ) @@ -1937,14 +1944,11 @@ def proportionally_attribute( fba = pd.concat([directly_attributed, proportionally_attributed], ignore_index=True) - # groupby_cols.append(rank) # else attribute on column specified in the FBS yaml else: - #todo: move this equal attribution into FBS method once - # refactored to allow multiple attribution methods - fba = fba.equally_attribute() + log.info(f'Proportionally attributing on {attribute_cols}') fba = (fba.add_primary_secondary_columns('Sector')) groupby_cols = [self.config.get('attribute_on'), 'Unit'] From 50f3410c705256be54c58f33838f480d7bb6420d Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 22 May 2023 17:18:23 -0600 Subject: [PATCH 0575/1127] if multiple attribution methods, use config info for the specific attribution method --- flowsa/flowby.py | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 572c25cd9..fc818351f 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -656,7 +656,9 @@ def attribute_flows_to_sectors( attribution_fbs = fb.load_prepare_attribution_source( attribution_config=step_config ) - attributed_fb = fb.proportionally_attribute(attribution_fbs) + attributed_fb = fb.proportionally_attribute( + attribution_fbs, other_config=step_config + ) elif attribution_method == 'multiplication': log.info(f"Multiplying {self.full_name} by {attribution_name}") @@ -1811,7 +1813,8 @@ def equally_attribute(self: 'FlowByActivity') -> 'FlowByActivity': def harmonize_geoscale( self: 'FlowByActivity', - other: 'FlowBySector' + other: 'FlowBySector', + other_config: None ) -> 'FlowByActivity': fba_geoscale = geo.scale.from_string(self.config['geoscale']) @@ -1840,11 +1843,13 @@ def harmonize_geoscale( subset_cols = ['PrimarySector', 'Location', 'FlowAmount', 'Unit'] groupby_cols = ['PrimarySector', 'Location', 'Unit'] - if self.config.get('attribute_on') is not None: + attribution_cols = other_config.get('attribute_on', self.config.get( + 'attribute_on')) + if attribution_cols is not None: subset_cols = ['PrimarySector', 'Location', 'FlowAmount', 'Unit', - self.config.get('attribute_on')] + attribution_cols] groupby_cols = ['PrimarySector', 'Location', 'Unit', - self.config.get('attribute_on')] + attribution_cols] other = ( other .add_primary_secondary_columns('Sector') @@ -1858,7 +1863,8 @@ def harmonize_geoscale( def proportionally_attribute( self: 'FlowByActivity', - other: 'FlowBySector' + other: 'FlowBySector', + other_config=None ) -> 'FlowByActivity': ''' This method takes flows from the calling FBA which are mapped to @@ -1870,10 +1876,11 @@ def proportionally_attribute( self.full_name, other.full_name) fba_geoscale, other_geoscale, fba, other = self.harmonize_geoscale( - other) + other, other_config=other_config) # attribute on sector columns - if self.config.get('attribute_on') is None: + if other_config.get('attribute_on', + self.config.get('attribute_on')) is None: groupby_cols = ['group_id'] for rank in ['Primary', 'Secondary']: # skip over Secondary if not relevant @@ -1947,12 +1954,12 @@ def proportionally_attribute( # else attribute on column specified in the FBS yaml else: + attribute_cols = other_config.get('attribute_on', + self.config.get('attribute_on')) log.info(f'Proportionally attributing on {attribute_cols}') fba = (fba.add_primary_secondary_columns('Sector')) - - groupby_cols = [self.config.get('attribute_on'), 'Unit'] - attribute_cols = self.config.get('attribute_on') + groupby_cols = [attribute_cols, 'Unit'] other_with_denominator = ( other From 361d5a3752b47afcb3c1ac757534329f10c502b2 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 22 May 2023 17:21:03 -0600 Subject: [PATCH 0576/1127] update rei FBS to revised consecutive method --- .../REI_waste_national_2012.yaml | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml b/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml index c215e7805..f1248f41a 100644 --- a/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml +++ b/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml @@ -2,8 +2,7 @@ industry_spec: default: NAICS_6 - '562212': { default: NAICS_7 } - '562219': { default: NAICS_7 } + NAICS_7: ['562212', '562219'] year: 2012 target_naics_year: 2012 geoscale: national @@ -14,18 +13,22 @@ source_names: PrimaryActivity: !from_index:EPA_REI_waste_2012_asets.csv waste Class: Other Description: makecol + exclusion_fields: + ActivityConsumedBy: ['Exports of goods and services', + 'Imports of goods and services'] activity_sets: waste_flows: - exclusion_fields: - ActivityConsumedBy: ['Exports of goods and services', - 'Imports of goods and services'] - attribution_method: proportional #todo: want to use direct attribution before proportional - attribute_on: Flowable # FBA is mapped to FBS at this point, so FlowName is mapped to Flowable - fill_sector_column: SectorConsumedBy - clean_fba_after_attribution: !script_function:EPA_REI rei_waste_national_cleanup - attribution_source: - "EPA_REI": - selection_fields: - PrimaryActivity: !from_index:EPA_REI_waste_2012_asets.csv waste - Class: Other - Description: useintersection + attribute: + - attribution_method: direct + - attribution_method: proportional + attribute_on: Flowable # FBA is mapped to FBS at this point, so FlowName is mapped to Flowable + fill_sector_column: SectorConsumedBy + clean_fba_after_attribution: !script_function:EPA_REI rei_waste_national_cleanup + attribution_source: + "EPA_REI": + selection_fields: + PrimaryActivity: !from_index:EPA_REI_waste_2012_asets.csv waste + Class: Other + Description: useintersection + attribute: + attribution_method: direct From d4c09a18a87ddeae63278f09d4df4b7ecf9611e0 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 24 May 2023 12:42:11 -0400 Subject: [PATCH 0577/1127] add StateGHGI function to distribute stationary combustion emissions (CH4 and N2O) to specific fuels based on national ratios of CO2 to those gases by fuel --- flowsa/data_source_scripts/EPA_StateGHGI.py | 92 +++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/flowsa/data_source_scripts/EPA_StateGHGI.py b/flowsa/data_source_scripts/EPA_StateGHGI.py index e9a646f45..9442f919d 100644 --- a/flowsa/data_source_scripts/EPA_StateGHGI.py +++ b/flowsa/data_source_scripts/EPA_StateGHGI.py @@ -7,6 +7,8 @@ import pandas as pd import io from zipfile import ZipFile +from flowsa.flowby import FlowByActivity +from flowsa.flowsa_log import log from flowsa.location import apply_county_FIPS from flowsa.flowbyfunctions import assign_fips_location_system import flowsa.exceptions @@ -86,6 +88,96 @@ def tag_biogenic_activities(fba, source_dict, **_): return fba +def allocate_flows_by_fuel(fba: FlowByActivity, **_) -> FlowByActivity: + """ + clean_fba_before_activity_sets fxn to estimate CH4 and N2O emissions by + fuel type, using ratios derived from the national inventory as proxy + + returns a FBA that has increased in length x-times based on the number of + fuels; Fuel is added to "Description" field; total FlowAmount remains + unchanged. + """ + attributes_to_save = { + attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] + } + + year = fba.config.get('year') + # combine lists of activities from CO2 activity set + activity_list = [a for a in + fba.config['clean_parameter']['flow_ratio_source'] + for a in a] + source_fba = pd.concat([ + flowsa.getFlowByActivity(x, year) for x in + fba.config['clean_parameter']['fba_source'] + ], ignore_index=True) + + # align fuel names from National GHGI (keys) with StateGHGI (values) + fuels = {'Natural Gas': 'Natural Gas', + 'Coal': 'Coal', + 'Fuel Oil': 'Petroleum'} + + df_list = [] + for f in fuels.keys(): + df = (source_fba.query(f'ActivityProducedBy == "{f} Industrial"') + [['FlowName', 'FlowAmount']] + .assign(Fuel=f) + ) + df_list.append(df) + # calculate ratio of flow to CO2 for each fuel (in CO2e) + ratios = (pd.concat(df_list, ignore_index=True) + .pivot_table(columns='FlowName', + index='Fuel', + values='FlowAmount') + .assign(CH4=lambda x: x['CH4'] / x['CO2']) + .assign(N2O=lambda x: x['N2O'] / x['CO2']) + .drop(columns='CO2') + ) + + # prepare dataframe from StateGHGI including CO2 flows by fuel type + fba1 = (pd.concat([(flowsa.getFlowByActivity('EPA_StateGHGI', year) + .query('ActivityProducedBy in @activity_list')), + fba.copy()], + ignore_index=True) + .assign(Fuel=lambda x: x['ActivityProducedBy'] + .str.rsplit(' - ', n=1, expand=True)[1]) + ) + + # Derive state CH4 and N2O emissions by fuel type using fuel specific ratios + fba2 = (fba1.query('FlowName == "CO2"') + .assign(Fuel=lambda x: x['Fuel'].replace( + dict((v,k) for k,v in fuels.items()))) + .merge(ratios.reset_index()) + .assign(CH4=lambda x: x['CH4'] * x['FlowAmount']) + .assign(N2O=lambda x: x['N2O'] * x['FlowAmount']) + .melt(id_vars=['Location', 'Fuel'], + value_vars=['CH4', 'N2O'], + var_name='FlowName') + .pivot_table(columns='Fuel', + index=['Location', 'FlowName'], + values='value') + ) + fba2 = pd.DataFrame(fba2).div(fba2.sum(axis=1), axis=0) + + # Maintain source flow amount, merge in state ratios by fuel type + fba3 = (fba1.merge(fba2.reset_index()) + .melt(id_vars=[c for c in fba1 if c not in fuels.keys()], + value_vars=fuels.keys()) + .assign(Description=lambda x: x['variable'].replace(fuels)) + .assign(FlowAmount=lambda x: x['FlowAmount'] * x['value']) + .drop(columns=['Fuel', 'variable', 'value']) + ) + + if fba3.FlowAmount.sum() != fba.FlowAmount.sum(): + log.warning('Error: totals do not match when splitting CH4 and N2O by ' + 'fuel type') + + new_fba = FlowByActivity(fba3) + for attr in attributes_to_save: + setattr(new_fba, attr, attributes_to_save[attr]) + + return new_fba + + if __name__ == '__main__': import flowsa flowsa.flowbyactivity.main(source='EPA_StateGHGI', year='2017') From 95f137a4bbee642e10d644c05faa2d423b29528d Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 24 May 2023 15:47:31 -0600 Subject: [PATCH 0578/1127] drop 'Exports of goods and services', 'Imports of goods and services' in the cleaning fxn --- .../methods/flowbysectormethods/REI_waste_national_2012.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml b/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml index f1248f41a..273cd3b70 100644 --- a/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml +++ b/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml @@ -13,9 +13,6 @@ source_names: PrimaryActivity: !from_index:EPA_REI_waste_2012_asets.csv waste Class: Other Description: makecol - exclusion_fields: - ActivityConsumedBy: ['Exports of goods and services', - 'Imports of goods and services'] activity_sets: waste_flows: attribute: @@ -23,7 +20,6 @@ source_names: - attribution_method: proportional attribute_on: Flowable # FBA is mapped to FBS at this point, so FlowName is mapped to Flowable fill_sector_column: SectorConsumedBy - clean_fba_after_attribution: !script_function:EPA_REI rei_waste_national_cleanup attribution_source: "EPA_REI": selection_fields: @@ -32,3 +28,4 @@ source_names: Description: useintersection attribute: attribution_method: direct + clean_fba_after_attribution: !script_function:EPA_REI rei_waste_national_cleanup From 033d712d76e727653aab7d60bc604b8ff3afd39c Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 24 May 2023 15:52:02 -0600 Subject: [PATCH 0579/1127] reassign df to self so correct dataset is used in for loop --- flowsa/flowby.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index fc818351f..942e74d09 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -705,7 +705,19 @@ def attribute_flows_to_sectors( log.error('Errors in attributing flows from %s:\n%s', self.full_name, errors) - return attributed_fb.drop(columns=['group_id', 'group_total']) + # Drop columns created for disaggregation, plus any + # specified in the config file + self = ( + attributed_fb + .drop(columns=['group_id', 'group_total', 'group_count', 'FlowAmount_ds', 'factor'], errors='ignore') + .drop(columns=step_config.get('drop_columns', [])) + ) + # reset datatype to FBS because otherwise when we loop through + # to the next attribution method, the FBA will be re-cleaned and + # have additional sector columns appended + self.config['data_format'] = 'FBS' + + return self def activity_sets(self) -> List['FB']: From a694bca11320b146e665f3df7c11c063b9a2d956 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 24 May 2023 15:53:18 -0600 Subject: [PATCH 0580/1127] find correct sector_col to fill based on other config --- flowsa/flowby.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 942e74d09..801d58906 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -2016,8 +2016,9 @@ def proportionally_attribute( / x.denominator)) ) - if self.config.get('fill_sector_column') is not None: - sector_col = self.config.get('fill_sector_column') + sector_col = other_config.get('fill_sector_column', + self.config.get('fill_sector_column')) + if sector_col is not None: fba[sector_col] = fba['PrimarySector_other'] return ( From 3422204ca94d770fc74ea46bc17adb1f6d4a1465 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 30 May 2023 17:30:48 -0600 Subject: [PATCH 0581/1127] issue warning if all null values are not substituted --- flowsa/flowbyclean.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index bd5d135ae..ead33da7f 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -145,4 +145,8 @@ def substitute_nonexistent_values( .assign(group_total=merged.FlowAmount) ) + merged_null = merged[merged['FlowAmount'] == 0] + if len(merged_null) > 0: + log.warning('Not all null values were substituted') + return merged From b7aa33725e8cdc531b6b478f7c9c1f2ed9f18fd4 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 30 May 2023 17:31:55 -0600 Subject: [PATCH 0582/1127] if there isn't an attribution method, assume direct attribution --- flowsa/flowby.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 801d58906..7061d5208 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -613,7 +613,9 @@ def attribute_flows_to_sectors( if isinstance(attribute_config, dict): attribute_config = [attribute_config] if attribute_config is None: - log.error('Attribution method is missing') + log.warning('Attribution method is missing, assuming equal ' + 'attribution') + attribute_config = [{'attribution_method': 'direct'}] for step_config in attribute_config: grouped: 'FB' = ( From 0aa9fca4a5f8b0358f30cdf12fae61fb1a9cd4a0 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 30 May 2023 17:33:37 -0600 Subject: [PATCH 0583/1127] subset fb configuration instead of creating new "other_config" to feed into functions --- flowsa/flowby.py | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 7061d5208..9b5368cfc 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -639,6 +639,16 @@ def attribute_flows_to_sectors( elif self.config['data_format'] == 'FBS': fb = grouped.copy() + # subset the fb configuration so it only includes the + # attribution_method currently being assessed - rather than all + # consecutive attribution methods/info + parent_config = {k: v for k, v in self.config.items() + if k not in ['activity_sets', + 'clean_fba_before_activity_sets'] + and not k.startswith('_')} + + fb.config = {**parent_config, **step_config} + attribution_method = step_config.get('attribution_method') if 'attribution_source' in step_config: for k, v in step_config['attribution_source'].items(): @@ -658,9 +668,7 @@ def attribute_flows_to_sectors( attribution_fbs = fb.load_prepare_attribution_source( attribution_config=step_config ) - attributed_fb = fb.proportionally_attribute( - attribution_fbs, other_config=step_config - ) + attributed_fb = fb.proportionally_attribute(attribution_fbs) elif attribution_method == 'multiplication': log.info(f"Multiplying {self.full_name} by {attribution_name}") @@ -1827,8 +1835,7 @@ def equally_attribute(self: 'FlowByActivity') -> 'FlowByActivity': def harmonize_geoscale( self: 'FlowByActivity', - other: 'FlowBySector', - other_config: None + other: 'FlowBySector' ) -> 'FlowByActivity': fba_geoscale = geo.scale.from_string(self.config['geoscale']) @@ -1857,8 +1864,7 @@ def harmonize_geoscale( subset_cols = ['PrimarySector', 'Location', 'FlowAmount', 'Unit'] groupby_cols = ['PrimarySector', 'Location', 'Unit'] - attribution_cols = other_config.get('attribute_on', self.config.get( - 'attribute_on')) + attribution_cols = self.config.get('attribute_on') if attribution_cols is not None: subset_cols = ['PrimarySector', 'Location', 'FlowAmount', 'Unit', attribution_cols] @@ -1877,8 +1883,7 @@ def harmonize_geoscale( def proportionally_attribute( self: 'FlowByActivity', - other: 'FlowBySector', - other_config=None + other: 'FlowBySector' ) -> 'FlowByActivity': ''' This method takes flows from the calling FBA which are mapped to @@ -1890,11 +1895,10 @@ def proportionally_attribute( self.full_name, other.full_name) fba_geoscale, other_geoscale, fba, other = self.harmonize_geoscale( - other, other_config=other_config) + other) # attribute on sector columns - if other_config.get('attribute_on', - self.config.get('attribute_on')) is None: + if self.config.get('attribute_on') is None: groupby_cols = ['group_id'] for rank in ['Primary', 'Secondary']: # skip over Secondary if not relevant @@ -1968,8 +1972,7 @@ def proportionally_attribute( # else attribute on column specified in the FBS yaml else: - attribute_cols = other_config.get('attribute_on', - self.config.get('attribute_on')) + attribute_cols = self.config.get('attribute_on') log.info(f'Proportionally attributing on {attribute_cols}') fba = (fba.add_primary_secondary_columns('Sector')) @@ -2006,9 +2009,7 @@ def proportionally_attribute( unattributable.ActivityConsumedBy, unattributable.Location)), unattributable.full_name, - other.full_name, - rank, - set(unattributable[rank]) + other.full_name ) fba = ( @@ -2017,9 +2018,7 @@ def proportionally_attribute( * x.FlowAmount_other / x.denominator)) ) - - sector_col = other_config.get('fill_sector_column', - self.config.get('fill_sector_column')) + sector_col = self.config.get('fill_sector_column') if sector_col is not None: fba[sector_col] = fba['PrimarySector_other'] From 32b6bad0f1ad4f5c6bc72a143cd0d982c8848f20 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 30 May 2023 17:35:47 -0600 Subject: [PATCH 0584/1127] update warning message - remove extra parameters --- flowsa/flowby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 9b5368cfc..6b93d5647 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -2004,7 +2004,7 @@ def proportionally_attribute( if not unattributable.empty: log.warning( 'Could not attribute activities %s in %s due to lack of ' - 'flows in attribution source %s for mapped %s sectors %s', + 'flows in attribution source %s for mapped sectors', set(zip(unattributable.ActivityProducedBy, unattributable.ActivityConsumedBy, unattributable.Location)), From df41a5e61a90da6b3d6cba2c1e388080360a3c8a Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 30 May 2023 17:36:38 -0600 Subject: [PATCH 0585/1127] after proportionally attributing, drop rows where flowamount is 0 --- flowsa/flowby.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 6b93d5647..55eaf09f8 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -2022,6 +2022,16 @@ def proportionally_attribute( if sector_col is not None: fba[sector_col] = fba['PrimarySector_other'] + # drop rows where 'FlowAmount_other' is 0 because the primary + # activities are not attributed to those sectors. The values are 0 + # because the primary activities are initially assigned to all + # possible sectors and there is no data for those sectors in the + # attribution data set. We want to drop those rows here because + # otherwise if the data is further attributed (such as multiplied), + # it could appear that data is dropped elsewhere when the dataset is + # checked for null values + fba = fba[fba['FlowAmount_other'] != 0].reset_index(drop=True) + return ( fba .drop(columns=['PrimarySector', 'SecondarySector', From be8caf3f14706542af481e31caf81c8178a8d3f2 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 31 May 2023 15:26:24 -0400 Subject: [PATCH 0586/1127] overhaul FBS method readme file --- flowsa/methods/flowbysectormethods/README.md | 217 ++++++++----------- 1 file changed, 93 insertions(+), 124 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/README.md b/flowsa/methods/flowbysectormethods/README.md index d1f3fa368..0b59556fa 100644 --- a/flowsa/methods/flowbysectormethods/README.md +++ b/flowsa/methods/flowbysectormethods/README.md @@ -2,138 +2,107 @@ Description of parameters in flowbysectormethods yamls. All values are strings unless noted. +## Special notation +Flowsa FBA and FBS method files include custom yaml configurations as defined +in `flowsa_yaml.py` using the custom `FlowsaLoader` class. + +1. Include nodes from other method files using `!include` using the following +syntax: `!include:{method.yaml}:{node1}:{node2}` +``` +!include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint +``` + +2. Incorporate a list of items (e.g., activities for an activity_set) from csv +into a method file using the following syntax: `!from_index:{file_name}.csv` +``` +activity_sets: + direct_allocation: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv direct_allocation + attribution_method: direct +``` +3. Call on specific functions as a parameter using the following syntax: +`!script_function:{data_source_script file} {fxn name}` +``` +clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba +``` + ## Terms ### Target FBS output specifications -- _target_sector_level_: specify desired sector aggregation (NAICS_2, - NAICS_3, NAICS_4, NAICS_5, NAICS_6) -- _target_sector_source_: specify NAICS version 2007, 2012, 2017 (ex. - NAICS_2012_Code). At this time, only NAICS_2012_Code is supported. -- _target_geoscale_: level of geographic aggregation in output parquet - (national, state, or county) -- _download_if_missing_: (optional) Add and set to 'True' if you would like - to download all required FBAs from Data Commons rather than generating - FBAs locally. +- _industry_spec_: specify the `default` desired sector aggregation: + (`NAICS_2`, `NAICS_3`, `NAICS_4`, `NAICS_5`, `NAICS_6`). Further disaggregation + is possible, e.g.,: + +``` +industry_spec: + default: NAICS_3 + NAICS_4: ['221', '336', '541'] +``` + +- _year_: specify the target year of the FBS +- _target_naics_year_: specify NAICS version `2007`, `2012`, `2017`. + At this time, only NAICS_2012_Code is supported. +- _geoscale_: level of geographic aggregation in output parquet + (`national`, `state`, or `county`). -### Source specifications (in FBA format) -- _source_names_: The name of the FBS dataset or the FBA dataset requiring - allocation to sectors -- _data_format_: 'FBA', 'FBS', 'FBS_outside_flowsa', loads a FlowByActivity - or a FlowBySector parquet stored in flowsa, or calls on a specified - function to load data from outside flowsa in FBS format -- _class_: a text string in 'Class' column of flowbyactivity (ex. Water), - see class types in - [source_catalog.yaml](https://github.com/USEPA/flowsa/blob/master/flowsa/data/source_catalog.yaml) -- _geoscale_to_use_: the geoscale of the FBA set to use for sector allocation - (national, state, or county) -- _year_: year of available dataset (ex. 2015) -- _activity_to_sector_mapping_: (optional) name of activity to sector - mapping file, if not provided will use the source name -- _source_flows_: (list, optional, only usable with flowsa.flowby.FlowBySector - .getFlowBySector()). Specifies the 'Flowable'(s) from the FBS to use. - If not provided, all flows are used. -- _apply_urban_rural_: Assign flow quantities as urban or rural based on - population density by FIPS. -- _clean_fba_before_mapping_df_fxn_: (optional) calls on function in the - source.py file to clean up/modify the FBA data prior to mapping flows. - Function is called using the `!script_function:` tag. -- _clean_fba_df_fxn_: (optional) calls on function in the source.py file to - clean up/modify the FBA data prior to allocating data to sectors. - Function is called using the `!script_function:` tag. -- _clean_fba_w_sec_df_fxn_: (optional) calls on function in the source.py - file to clean up/modify the FBA dataframe, after sector columns are added - but prior to allocating data to sectors. Function is called using - the`!script_function:` tag. -- _fedefl_mapping_: (optional) name of mapping file in FEDEFL. If not - supplied will use the source_names -- _mfl_mapping_: (optional, should not be used if fedefl_mapping is used) - name of mapping file for Material Flow List. -- _keep_unmapped_rows_: (optional) default is False, if True will maintain any - flows not found in mapping files. -### Activity set specifications +### Source specifications +- _source_names_: The name of the dataset (FBA or FBS) to serve as primary data + +All sources are treated recursively. That is, there can be an unlimited number +of embedded sources. The source parameters below can be applied to sources at +any level, and are inherited from higher-level sources. + +- _year_: year of dataset (`2015`) +- _geoscale_: level of geographic aggregation in output parquet + (`national`, `state`, or `county`). +- _data_format: default is `FBA`, specify `FBS` or `FBS_outside_flowsa`. + `FBS_outside_flowsa` requires a second parameter, `FBS_datapull_fxn` which + supplies the name of the function to generate the FBS using the`!script_function:` tag. - _activity_sets_: A subset of the FBA dataset and the method and - allocation datasets used to create an FBS -- _names_: (list) specify the subset of the FBA to allocate based on values in the - Activity Produced/Consumed By fields. To use an external activity set . - csv file, use the tag `!from_index:file_name.csv`, then give the name (e.g., - `activity_set_1`) of the activity set as found in the csv file. -- _source_flows_: (list, optional) specify the 'FlowName'(s) from the FBA - to use. If not provided, all flows are used. -- _allocation_method_: currently written for 'direct', - 'allocation_function', 'proportional', and 'proportional-flagged'. See - descriptions below. -- _allocation_source_: The primary data source used to allocate main FBA for - specified activity to sectors -- _literature_sources_: (optional) Specific functions that contain values - from literature used to modify FBA data. -- _activity_to_sector_mapping_: (optional) name of activity to sector - mapping file, if not provided will use the source name -- _allocation_source_class_: specific 'FlowClass' found in the allocation - source flowbyactivity parquet -- _allocation_source_year_: specific to the allocation datasets, use the - year relevant to the main FBA dataframe -- _allocation_flow_: (list) the relevant 'FlowName' values, as found in the - source flowbyactivity parquet. Use 'None' to capture all flows. -- _allocation_compartment_: (list) the relevant 'Compartment' values, as - found in the source flowbyactivity parquet. Use 'None' to capture all - compartments. -- _allocation_from_scale_: national, state, or county - dependent on - allocation source, as not every level exits for sources -- _allocation_fba_load_scale_: (optional) Can indicate geographic level of - FBA to load, helpful when an FBA ia large -- _clean_allocation_fba_: (optional) Function to clean up the allocation - FBA, as defined in the source.py file. Function is called using - the`!script_function:` tag. -- _clean_allocation_fba_w_sec_: (optional) Function to clean up the - allocation FBA, after allocation activities are assigned SectorProducedBy - and SectorConsumedBy columns. Function is called using - the`!script_function:` tag. -- _allocation_map_to_flow_list_: (optional) If the allocation df and source - df need to be matched on Context and/or Flowable, set to 'True' -- _helper_source_: (optional) secondary df for sector allocation -- _helper_method_: currently written for 'multiplication', 'proportional', - and 'proportional-flagged' -- _helper_activity_to_sector_mapping_: (optional) name of activity to - sector mapping file, if not provided will use the source name -- _helper_source_class_: specific 'FlowClass' found in the allocation - source flowbyactivity parquet -- _helper_source_year_: specific to the allocation datasets, use the year - relevant to the main FBA dataframe -- _helper_flow_: (list) the relevant 'FlowName' values, as found in the - source flowbyactivity parquet -- _helper_from_scale_: national, state, or county - dependent on allocation - source, as not every level exits for sources -- _clean_helper_fba_: (optional) Function to clean up the helper FBA. - Function is called using the`!script_function:` tag. -- _clean_helper_fba_wsec_: (optional) Function to clean up the helper FBA, - after allocation activities are assigned SectorProducedBy and - SectorConsumedBy columns. Function is called using - the`!script_function:` tag. + allocation datasets used to create an FBS. +- _selection_fields_: A dictionary that allows subsetting source data by column. + See description in `flowby.select_by_fields()`. To use a list of data points not + supplied in the method, use the `!from_index:` tag, then give + the name (e.g., `activity_set_1`) of the activity set as found in the csv file. +- _exclusion_fielsd: A dictionary that allows subsetting source data by column. + See description in `flowby.select_by_fields()`. +- _attribution_method_: currently written for `direct`, `proportional`, + `multiplication`. +- _attribution_source_: The data source used to attribute the primary data source. + By default attribution is performed on the primary activity column. + +#### Optional cleaning functions +These parameters assign functions for additional processing of FlowBy objects. +They are called using the `!script_function:` tag. +Some functions allow for extra named parameters. -### Source specifications (in FBS format) -If source data format is specified as 'FBS': -- _source_names_: The name of the FBS dataset -- _data_format_: 'FBS', loads a FlowBySector -- _year_: year of available dataset (ex. 2015) -- _clean_fbs_df_fxn_: (optional) apply function to clean the FBS after it - is accessed. Function is called using the`!script_function:` tag. +- _clean_fba_before_activity_sets_: applied prior to splitting a data source + into activity sets. +- _clean_fba_before_mapping_: applied prior to flow mapping. +- _estimate_supressed_: +- _clean_fba_: applied prior to sector columns are added. +- _clean_fba_w_sec_: applied after sector columns are added but prior to + attributing data to sectors. +- _clean_fbs_: applied prior to attributing data to sectors for a FBS. + +#### Additional optional parameters +- _activity_to_sector_mapping_: name of activity to sector + mapping file, if not provided will use the source name +- _apply_urban_rural_: (bool) Assign flow quantities as urban or rural based on + population density by FIPS. +- _fedefl_mapping_: name of mapping file in FEDEFL. If not + supplied will use the source name +- _mfl_mapping_: name of mapping file for Material Flow List. Should not be + used if fedefl_mapping is used) +- _keep_unmapped_rows_: (bool) default is False, if True will maintain any + flows not found in mapping files. -### FBS_outside_flows specifications -If source data_format is specified as `FBS_outside_flowsa`: -- _FBS_datapull_fxn_: name of the function to generate the FBS. Function is - called using the`!script_function:` tag. -- _parameters_: (list) parameters to pass into the function ## Method Descriptions -- allocation_function: Activities are assigned to sectors using a specified - function - direct: Activities are directly assigned to sectors using the source to NAICS crosswalk -- multiplication: Multiply the values in the allocation data source with - values sharing the same sectors in the helper allocation data source -- proportional: Activities are proportionally allocated to sectors using - specified allocation data source -- proportional-flagged: Activities that are flagged (assigned a value of - '1') are proportionally allocated to sectors using a specified allocation - data source. Activities that are not flagged (assigned a value of '0') - are directly assigned to sectors. +- multiplication: Multiply the values in the primary source with + values sharing the same sectors in the attribution source +- proportional: Activities are proportionally attributed to sectors using + specified attribution data source From f265293b2757f4d4445a780b85a4ce98db1e9a0d Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 31 May 2023 15:30:36 -0400 Subject: [PATCH 0587/1127] minor formatting fix --- flowsa/methods/flowbysectormethods/README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/README.md b/flowsa/methods/flowbysectormethods/README.md index 0b59556fa..5aa657e24 100644 --- a/flowsa/methods/flowbysectormethods/README.md +++ b/flowsa/methods/flowbysectormethods/README.md @@ -47,16 +47,15 @@ industry_spec: ### Source specifications -- _source_names_: The name of the dataset (FBA or FBS) to serve as primary data - All sources are treated recursively. That is, there can be an unlimited number of embedded sources. The source parameters below can be applied to sources at any level, and are inherited from higher-level sources. +- _source_names_: The name of the dataset (FBA or FBS) to serve as primary data - _year_: year of dataset (`2015`) - _geoscale_: level of geographic aggregation in output parquet (`national`, `state`, or `county`). -- _data_format: default is `FBA`, specify `FBS` or `FBS_outside_flowsa`. +- _data_format_: default is `FBA`, specify `FBS` or `FBS_outside_flowsa`. `FBS_outside_flowsa` requires a second parameter, `FBS_datapull_fxn` which supplies the name of the function to generate the FBS using the`!script_function:` tag. - _activity_sets_: A subset of the FBA dataset and the method and @@ -65,7 +64,7 @@ any level, and are inherited from higher-level sources. See description in `flowby.select_by_fields()`. To use a list of data points not supplied in the method, use the `!from_index:` tag, then give the name (e.g., `activity_set_1`) of the activity set as found in the csv file. -- _exclusion_fielsd: A dictionary that allows subsetting source data by column. +- _exclusion_fields_: A dictionary that allows subsetting source data by column. See description in `flowby.select_by_fields()`. - _attribution_method_: currently written for `direct`, `proportional`, `multiplication`. @@ -94,7 +93,7 @@ Some functions allow for extra named parameters. - _fedefl_mapping_: name of mapping file in FEDEFL. If not supplied will use the source name - _mfl_mapping_: name of mapping file for Material Flow List. Should not be - used if fedefl_mapping is used) + used if fedefl_mapping is used - _keep_unmapped_rows_: (bool) default is False, if True will maintain any flows not found in mapping files. From 3b81314a3f7d96201962b6f6e59815402b756b6d Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 31 May 2023 16:57:35 -0400 Subject: [PATCH 0588/1127] update activity sets readme example --- flowsa/methods/flowbysectoractivitysets/README.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/flowsa/methods/flowbysectoractivitysets/README.md b/flowsa/methods/flowbysectoractivitysets/README.md index ba230f4d9..c8b994879 100644 --- a/flowsa/methods/flowbysectoractivitysets/README.md +++ b/flowsa/methods/flowbysectoractivitysets/README.md @@ -13,15 +13,14 @@ _ActivitySetColumnSubset_ is the value in the "activity_set" column to call on. See the example below. ``` -"EPA_NEI_Onroad": - data_format: 'FBA' - class: Chemicals - geoscale_to_use: national + EPA_NEI_Onroad: + geoscale: state year: 2017 - activity_to_sector_mapping: 'SCC' - clean_fba_df_fxn: !script_function:EPA_NEI clean_NEI_fba - fedefl_mapping: 'NEI' + fedefl_mapping: NEI activity_sets: direct_allocation: - names: !from_index:NEI_Onroad_2017_asets.csv direct_allocation + selection_fields: + PrimaryActivity: !from_index:NEI_Onroad_asets.csv direct_allocation + attribution_method: direct + ``` From 8a752d438c1f9cc018b5c3a4ea04c41acf0074d1 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 31 May 2023 15:20:20 -0600 Subject: [PATCH 0589/1127] add stewifbs to source_catalog --- flowsa/data/source_catalog.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 47518cf81..5417fd03c 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -276,6 +276,9 @@ stateio: - Money activity_schema: BEA_2012_Summary_Code sector_hierarchy: "parent-completeChild" +stewiFBS: + data_format: FBS + activity_schema: NAICS_2012_Code USDA_CoA_Cropland: data_format: FBA class: From befb2d3e657b825961a768ad827fbd0bbc43e54b Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 31 May 2023 15:34:46 -0600 Subject: [PATCH 0590/1127] check if fbs or fbs outside flowsa --- flowsa/flowby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 55eaf09f8..b9fd6b25a 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -636,7 +636,7 @@ def attribute_flows_to_sectors( method=self.config) .rename(columns={'SourceName': 'MetaSources'}) ) - elif self.config['data_format'] == 'FBS': + elif self.config['data_format'] in ['FBS', 'FBS_outside_flowsa']: fb = grouped.copy() # subset the fb configuration so it only includes the From 2870581c08c2c6453711dde32d7ecc337f707b85 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 1 Jun 2023 10:08:56 -0600 Subject: [PATCH 0591/1127] specify all columns to base attribution --- .../flowbysectormethods/REI_waste_national_2012.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml b/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml index 273cd3b70..766de2f49 100644 --- a/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml +++ b/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml @@ -18,14 +18,12 @@ source_names: attribute: - attribution_method: direct - attribution_method: proportional - attribute_on: Flowable # FBA is mapped to FBS at this point, so FlowName is mapped to Flowable + attribute_on: [Flowable, Unit, Location] # FBA is mapped to FBS at this point, so FlowName is mapped to Flowable fill_sector_column: SectorConsumedBy attribution_source: - "EPA_REI": + EPA_REI: selection_fields: PrimaryActivity: !from_index:EPA_REI_waste_2012_asets.csv waste Class: Other Description: useintersection - attribute: - attribution_method: direct clean_fba_after_attribution: !script_function:EPA_REI rei_waste_national_cleanup From da29f12b73af5f4fe0ff0185d0ddd04189e4e4a5 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 1 Jun 2023 16:08:09 -0600 Subject: [PATCH 0592/1127] drop year from chhw fbs in source_catalog --- flowsa/data/source_catalog.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 5417fd03c..8e7815d98 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -107,7 +107,7 @@ Census_VIP: class: Money activity_schema: None sector_hierarchy: "flat" -CNHW_national_2018: +CNHW_national: data_format: FBS EIA_AEO: data_format: FBA From 98616be44a593470eb07f7f57708075eb9c72a68 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 1 Jun 2023 16:09:27 -0600 Subject: [PATCH 0593/1127] add 'thousands of tons' to unit conversion csv --- flowsa/data/unit_conversion.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/data/unit_conversion.csv b/flowsa/data/unit_conversion.csv index 1528e8840..d8948f902 100644 --- a/flowsa/data/unit_conversion.csv +++ b/flowsa/data/unit_conversion.csv @@ -12,6 +12,7 @@ million Cubic metres/year,kg,1000000000 TON,kg,907.185 tons,kg,907.185 short tons,kg,907.185 +Thousands of Tons,kg,907185 MT,kg,1000 LB,kg,0.45359 ACRE FEET / ACRE,kg/m2,304.8000006 From 720dbeadfb9d55fd01d41d556b2374d08fcc38dd Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 1 Jun 2023 16:11:04 -0600 Subject: [PATCH 0594/1127] update food waste fbs --- .../Food_Waste_national_2018_m2.yaml | 44 +++++++++++-------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml index a6a601768..013ba6edf 100644 --- a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml +++ b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml @@ -9,33 +9,38 @@ target_naics_year: 2012 geoscale: national source_names: - "CNHW_national_2018": + CNHW_national_2018: selection_fields: - Flowable: Food + Flowable: {'Food': 'Food Waste'} activity_sets: wasted_food_report: selection_fields: - PrimaryActivity: !from_index:CNHW_Food_asets.csv wasted_food_report - attribution_method: proportional - attribution_source: - EPA_WFR: - selection_fields: - Class: Other -# allocation_merge_columns: [SectorProducedBy] + PrimarySector: !from_index:CNHW_Food_asets.csv wasted_food_report + attribute: + attribution_method: proportional + primary_action_type: Produced + attribute_on: [SectorProducedBy] + fill_columns: SectorConsumedBy + attribution_source: + EPA_WFR: + selection_fields: + Class: Other facts_and_figures: selection_fields: - PrimaryActivity: !from_index:CNHW_Food_asets.csv facts_and_figures - attribution_method: proportional - attribution_source: - EPA_FactsAndFigures: - selection_fields: - Class: Other - FlowName: Food -# allocation_merge_columns: [SectorProducedBy] + PrimarySector: !from_index:CNHW_Food_asets.csv facts_and_figures + attribute: + attribution_method: proportional + attribute_on: [Flowable] + fill_columns: SectorConsumedBy + attribution_source: + EPA_FactsAndFigures: + selection_fields: + Class: Other + FlowName: {'Food': 'Food Waste'} # CNHW does not include residential food waste, so adding from EPA's # Wasted Food Report - "EPA_WFR": + EPA_WFR: selection_fields: Class: Other activity_sets: @@ -43,4 +48,5 @@ source_names: selection_fields: PrimaryActivity: "Residential" FlowName: {'Food': 'Food Waste'} # rename for consistency above - attribution_method: direct + attribute: + attribution_method: direct From e927b0b8e220eb3a74a4ddce4a9f59103a1e3351 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 1 Jun 2023 16:12:09 -0600 Subject: [PATCH 0595/1127] rename parameter to fill_columns --- .../methods/flowbysectormethods/REI_waste_national_2012.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml b/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml index 766de2f49..3eddb52de 100644 --- a/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml +++ b/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml @@ -18,8 +18,8 @@ source_names: attribute: - attribution_method: direct - attribution_method: proportional - attribute_on: [Flowable, Unit, Location] # FBA is mapped to FBS at this point, so FlowName is mapped to Flowable - fill_sector_column: SectorConsumedBy + attribute_on: [Flowable] # FBA is mapped to FBS at this point, so FlowName is mapped to Flowable + fill_columns: SectorConsumedBy attribution_source: EPA_REI: selection_fields: From 7e8178cda188d76a8b1357ad3bba729efc332b04 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 1 Jun 2023 16:14:38 -0600 Subject: [PATCH 0596/1127] condense proportionally_attribute(), harmonize_geoscale(), multiplication_attribution() functions from two functions based on class to single flowby functions --- flowsa/flowby.py | 517 +++++++++++++++-------------------------------- 1 file changed, 166 insertions(+), 351 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index be42fbd4e..9dc1757dd 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -833,97 +833,162 @@ def proportionally_attribute( self: 'FB', # flowbyactivity or flowbysector other: 'FlowBySector' ) -> 'FlowByActivity': - ''' + """ This method takes flows from the calling FBA which are mapped to multiple sectors and attributes them to those sectors proportionally to flows from other (an FBS). - ''' + """ log.info('Attributing flows in %s using %s.', self.full_name, other.full_name) - fba_geoscale, other_geoscale, fba, other = self.harmonize_geoscale(other) + fb_geoscale, other_geoscale, fb, other = self.harmonize_geoscale(other) - groupby_cols = ['group_id'] - for rank in ['Primary', 'Secondary']: - # skip over Secondary if not relevant - if fba[f'{rank}Sector'].isna().all(): - continue - counted = fba.assign(group_count=(fba.groupby(groupby_cols) - ['group_id'] - .transform('count'))) - directly_attributed = ( - counted - .query('group_count == 1') - .drop(columns='group_count') - ) - needs_attribution = ( - counted - .query('group_count > 1') - .drop(columns='group_count') + # attribute on sector columns + if self.config.get('attribute_on') is None: + groupby_cols = ['group_id'] + for rank in ['Primary', 'Secondary']: + # skip over Secondary if not relevant + if fb[f'{rank}Sector'].isna().all(): + continue + counted = fb.assign(group_count=(fb.groupby(groupby_cols) + ['group_id'] + .transform('count'))) + directly_attributed = ( + counted + .query('group_count == 1') + .drop(columns='group_count') + ) + needs_attribution = ( + counted + .query('group_count > 1') + .drop(columns='group_count') + ) + + merged = ( + needs_attribution + .merge(other, + how='left', + left_on=[f'{rank}Sector', + 'temp_location' + if 'temp_location' in needs_attribution + else 'Location'], + right_on=['PrimarySector', 'Location'], + suffixes=[None, '_other']) + .fillna({'FlowAmount_other': 0}) + ) + + denominator_flag = ~merged.duplicated(subset=[*groupby_cols, + f'{rank}Sector']) + with_denominator = ( + merged + .assign(denominator=( + merged + .assign(FlowAmount_other=(merged.FlowAmount_other + * denominator_flag)) + .groupby(groupby_cols) + ['FlowAmount_other'] + .transform('sum'))) + ) + + non_zero_denominator = with_denominator.query(f'denominator != 0 ') + unattributable = with_denominator.query(f'denominator == 0 ') + + if not unattributable.empty: + log.warning( + 'Could not attribute activities in %s due to lack of ' + 'flows in attribution source %s for mapped %s sectors %s', + #set(zip(unattributable.ActivityProducedBy, + # unattributable.ActivityConsumedBy, + # unattributable.Location)), + unattributable.full_name, + other.full_name, + rank, + sorted(set(unattributable[f'{rank}Sector'])) + ) + + proportionally_attributed = ( + non_zero_denominator + .assign(FlowAmount=lambda x: (x.FlowAmount + * x.FlowAmount_other + / x.denominator)) + ) + + fb = pd.concat([directly_attributed, + proportionally_attributed], ignore_index=True) + + # else attribute on column specified in the FBS yaml + else: + attribute_cols = self.config.get('attribute_on') + + log.info(f'Proportionally attributing on {attribute_cols}') + fb = (fb.add_primary_secondary_columns('Sector')) + # todo: move these cols out of here and instead need to specify + # all columns in the FBS method + groupby_cols = attribute_cols + ['Unit', 'Location'] + + other_with_denominator = ( + other + .assign(denominator=(other + .groupby(groupby_cols)['FlowAmount'] + .transform('sum'))) ) - merged = ( - needs_attribution - .merge(other, + with_denominator = ( + fb + .merge(other_with_denominator, how='left', - left_on=[f'{rank}Sector', - 'temp_location' - if 'temp_location' in needs_attribution - else 'Location'], - right_on=['PrimarySector', 'Location'], + left_on=attribute_cols + ['temp_location' if + 'temp_location' in fb else + 'Location'], + right_on=attribute_cols + ['Location'], suffixes=[None, '_other']) .fillna({'FlowAmount_other': 0}) ) - denominator_flag = ~merged.duplicated(subset=[*groupby_cols, - f'{rank}Sector']) - with_denominator = ( - merged - .assign(denominator=( - merged - .assign(FlowAmount_other=(merged.FlowAmount_other - * denominator_flag)) - .groupby(groupby_cols) - ['FlowAmount_other'] - .transform('sum'))) - ) - non_zero_denominator = with_denominator.query(f'denominator != 0 ') unattributable = with_denominator.query(f'denominator == 0 ') if not unattributable.empty: log.warning( - 'Could not attribute activities in %s due to lack of ' - 'flows in attribution source %s for mapped %s sectors %s', - # set(zip(unattributable.ActivityProducedBy, - # unattributable.ActivityConsumedBy, - # unattributable.Location)), + 'Could not attribute activities %s in %s due to lack of ' + 'flows in attribution source %s for mapped sectors', + set(zip(unattributable.ActivityProducedBy, + unattributable.ActivityConsumedBy, + unattributable.Location)), unattributable.full_name, - other.full_name, - rank, - sorted(set(unattributable[f'{rank}Sector'])) + other.full_name ) - proportionally_attributed = ( + # todo: in rei we have negative flowamount_other numbers - add + # validation check, although neg numbers are expected + fb = ( non_zero_denominator .assign(FlowAmount=lambda x: (x.FlowAmount * x.FlowAmount_other / x.denominator)) - .drop(columns=['PrimarySector_other', 'Location_other', - 'FlowAmount_other', 'denominator', - 'Unit_other'], - errors='ignore') ) - fba = pd.concat([directly_attributed, - proportionally_attributed], ignore_index=True) - groupby_cols.append(f'{rank}Sector') + fill_col = self.config.get('fill_columns') + if fill_col is not None: + fb[fill_col] = fb[f'{fill_col}_other'] + + # drop rows where 'FlowAmount_other' is 0 because the primary + # activities are not attributed to those sectors. The values are 0 + # because the primary activities are initially assigned to all + # possible sectors and there is no data for those sectors in the + # attribution data set. We want to drop those rows here because + # otherwise if the data is further attributed (such as multiplied), + # it could appear that data is dropped elsewhere when the dataset is + # checked for null values + t = pd.DataFrame(fb) + fb = fb[fb['FlowAmount_other'] != 0].reset_index(drop=True) return ( - fba + fb .drop(columns=['PrimarySector', 'SecondarySector', - 'temp_location'], + 'temp_location', 'denominator'], errors='ignore') + .drop(fb.filter(regex='_other').columns, axis=1) .reset_index(drop=True) ) @@ -932,21 +997,21 @@ def harmonize_geoscale( other: 'FlowBySector' ) -> 'FlowByActivity': - fba_geoscale = geo.scale.from_string(self.config['geoscale']) + fb_geoscale = geo.scale.from_string(self.config['geoscale']) other_geoscale = geo.scale.from_string(other.config['geoscale']) - if other_geoscale < fba_geoscale: + if other_geoscale < fb_geoscale: log.info('Aggregating %s from %s to %s', other.full_name, - other_geoscale, fba_geoscale) + other_geoscale, fb_geoscale) other = ( other - .convert_fips_to_geoscale(fba_geoscale) + .convert_fips_to_geoscale(fb_geoscale) .aggregate_flowby() ) - elif other_geoscale > fba_geoscale: + elif other_geoscale > fb_geoscale: log.info('%s is %s, while %s is %s, so attributing %s to ' '%s', other.full_name, other_geoscale, self.full_name, - fba_geoscale, other_geoscale, fba_geoscale) + fb_geoscale, other_geoscale, fb_geoscale) self = ( self .assign(temp_location=self.Location) @@ -954,17 +1019,32 @@ def harmonize_geoscale( column='temp_location') ) - fba = self.add_primary_secondary_columns('Sector') + fb = self.add_primary_secondary_columns('Sector') + + subset_cols = ['PrimarySector', 'Location', 'FlowAmount', 'Unit'] + groupby_cols = ['PrimarySector', 'Location', 'Unit'] + attribution_cols = self.config.get('attribute_on') + if attribution_cols is not None: + subset_cols = subset_cols + attribution_cols + groupby_cols = subset_cols + attribution_cols + fill_cols = self.config.get('fill_columns') + if fill_cols is not None: + subset_cols = subset_cols + [fill_cols] + groupby_cols = groupby_cols + [fill_cols] + # ensure no duplicates + subset_cols = list(set(subset_cols)) + groupby_cols = list(set(groupby_cols)) + other = ( other .add_primary_secondary_columns('Sector') - [['PrimarySector', 'Location', 'FlowAmount', 'Unit']] - .groupby(['PrimarySector', 'Location', 'Unit']) + [subset_cols] + .groupby(groupby_cols) .agg('sum') .reset_index() ) - return fba_geoscale, other_geoscale, fba, other + return fb_geoscale, other_geoscale, fb, other def multiplication_attribution( @@ -978,45 +1058,45 @@ def multiplication_attribution( log.info('Multiplying flows in %s by %s.', self.full_name, other.full_name) - fba_geoscale, other_geoscale, fba, other = self.harmonize_geoscale( + fb_geoscale, other_geoscale, fb, other = self.harmonize_geoscale( other) # todo: update units after multiplying # multiply using each dfs primary sector col - merged = (fba + merged = (fb .merge(other, how='left', left_on=['PrimarySector', 'temp_location' - if 'temp_location' in fba + if 'temp_location' in fb else 'Location'], right_on=['PrimarySector', 'Location'], suffixes=[None, '_other']) .fillna({'FlowAmount_other': 0}) ) - fba = (merged - .assign(FlowAmount=lambda x: (x.FlowAmount - * x.FlowAmount_other)) - .drop(columns=['PrimarySector_other', 'Location_other', - 'FlowAmount_other', 'denominator'], - errors='ignore') - ) + fb = (merged + .assign(FlowAmount=lambda x: (x.FlowAmount + * x.FlowAmount_other)) + .drop(columns=['PrimarySector_other', 'Location_other', + 'FlowAmount_other', 'denominator'], + errors='ignore') + ) # determine if any flows are lost because multiplied by 0 - fba_null = fba[fba['FlowAmount'] == 0] - if len(fba_null) > 0: + fb_null = fb[fb['FlowAmount'] == 0] + if len(fb_null) > 0: log.warning('FlowAmounts in %s are reset to 0 due to lack of ' 'flows in attribution source %s for ' 'ActivityProducedBy/ActivityConsumedBy/Location: %s', - fba.full_name, other.full_name, - set(zip(fba_null.ActivityProducedBy, - fba_null.ActivityConsumedBy, - fba_null.Location)) + fb.full_name, other.full_name, + set(zip(fb_null.ActivityProducedBy, + fb_null.ActivityConsumedBy, + fb_null.Location)) ) return ( - fba + fb .drop(columns=['PrimarySector', 'SecondarySector', 'temp_location'], errors='ignore') @@ -1836,271 +1916,6 @@ def equally_attribute(self: 'FlowByActivity') -> 'FlowByActivity': *[f'_unique_naics_{n}_by_group' for n in range(2, 8)]] ) - def harmonize_geoscale( - self: 'FlowByActivity', - other: 'FlowBySector' - ) -> 'FlowByActivity': - - fba_geoscale = geo.scale.from_string(self.config['geoscale']) - other_geoscale = geo.scale.from_string(other.config['geoscale']) - - if other_geoscale < fba_geoscale: - log.info('Aggregating %s from %s to %s', other.full_name, - other_geoscale, fba_geoscale) - other = ( - other - .convert_fips_to_geoscale(fba_geoscale) - .aggregate_flowby() - ) - elif other_geoscale > fba_geoscale: - log.info('%s is %s, while %s is %s, so attributing %s to ' - '%s', other.full_name, other_geoscale, self.full_name, - fba_geoscale, other_geoscale, fba_geoscale) - self = ( - self - .assign(temp_location=self.Location) - .convert_fips_to_geoscale(other_geoscale, - column='temp_location') - ) - - fba = self.add_primary_secondary_columns('Sector') - - subset_cols = ['PrimarySector', 'Location', 'FlowAmount', 'Unit'] - groupby_cols = ['PrimarySector', 'Location', 'Unit'] - attribution_cols = self.config.get('attribute_on') - if attribution_cols is not None: - subset_cols = ['PrimarySector', 'Location', 'FlowAmount', 'Unit', - attribution_cols] - groupby_cols = ['PrimarySector', 'Location', 'Unit', - attribution_cols] - other = ( - other - .add_primary_secondary_columns('Sector') - [subset_cols] - .groupby(groupby_cols) - .agg('sum') - .reset_index() - ) - - return fba_geoscale, other_geoscale, fba, other - - def proportionally_attribute( - self: 'FlowByActivity', - other: 'FlowBySector' - ) -> 'FlowByActivity': - ''' - This method takes flows from the calling FBA which are mapped to - multiple sectors and attributes them to those sectors proportionally to - flows from other (an FBS). - ''' - - log.info('Attributing flows in %s using %s.', - self.full_name, other.full_name) - - fba_geoscale, other_geoscale, fba, other = self.harmonize_geoscale( - other) - - # attribute on sector columns - if self.config.get('attribute_on') is None: - groupby_cols = ['group_id'] - for rank in ['Primary', 'Secondary']: - # skip over Secondary if not relevant - if fba[f'{rank}Sector'].isna().all(): - continue - counted = fba.assign(group_count=(fba.groupby(groupby_cols) - ['group_id'] - .transform('count'))) - directly_attributed = ( - counted - .query('group_count == 1') - .drop(columns='group_count') - ) - needs_attribution = ( - counted - .query('group_count > 1') - .drop(columns='group_count') - ) - - merged = ( - needs_attribution - .merge(other, - how='left', - left_on=[f'{rank}Sector', - 'temp_location' - if 'temp_location' in needs_attribution - else 'Location'], - right_on=['PrimarySector', 'Location'], - suffixes=[None, '_other']) - .fillna({'FlowAmount_other': 0}) - ) - - denominator_flag = ~merged.duplicated(subset=[*groupby_cols, - f'{rank}Sector']) - with_denominator = ( - merged - .assign(denominator=( - merged - .assign(FlowAmount_other=(merged.FlowAmount_other - * denominator_flag)) - .groupby(groupby_cols) - ['FlowAmount_other'] - .transform('sum'))) - ) - - non_zero_denominator = with_denominator.query(f'denominator != 0 ') - unattributable = with_denominator.query(f'denominator == 0 ') - - if not unattributable.empty: - log.warning( - 'Could not attribute activities in %s due to lack of ' - 'flows in attribution source %s for mapped %s sectors %s', - #set(zip(unattributable.ActivityProducedBy, - # unattributable.ActivityConsumedBy, - # unattributable.Location)), - unattributable.full_name, - other.full_name, - rank, - sorted(set(unattributable[f'{rank}Sector'])) - ) - - proportionally_attributed = ( - non_zero_denominator - .assign(FlowAmount=lambda x: (x.FlowAmount - * x.FlowAmount_other - / x.denominator)) - ) - - fba = pd.concat([directly_attributed, - proportionally_attributed], ignore_index=True) - - # else attribute on column specified in the FBS yaml - else: - attribute_cols = self.config.get('attribute_on') - - log.info(f'Proportionally attributing on {attribute_cols}') - fba = (fba.add_primary_secondary_columns('Sector')) - groupby_cols = [attribute_cols, 'Unit'] - - other_with_denominator = ( - other - .assign(denominator=(other - .groupby(groupby_cols)['FlowAmount'] - .transform('sum'))) - ) - - with_denominator = ( - fba - .merge(other_with_denominator, - how='left', - left_on=[attribute_cols, - 'temp_location' - if 'temp_location' in fba - else 'Location'], - right_on=[attribute_cols, 'Location'], - suffixes=[None, '_other']) - .fillna({'FlowAmount_other': 0}) - ) - - non_zero_denominator = with_denominator.query(f'denominator != 0 ') - unattributable = with_denominator.query(f'denominator == 0 ') - - if not unattributable.empty: - log.warning( - 'Could not attribute activities %s in %s due to lack of ' - 'flows in attribution source %s for mapped sectors', - set(zip(unattributable.ActivityProducedBy, - unattributable.ActivityConsumedBy, - unattributable.Location)), - unattributable.full_name, - other.full_name - ) - - fba = ( - non_zero_denominator - .assign(FlowAmount=lambda x: (x.FlowAmount - * x.FlowAmount_other - / x.denominator)) - ) - sector_col = self.config.get('fill_sector_column') - if sector_col is not None: - fba[sector_col] = fba['PrimarySector_other'] - - # drop rows where 'FlowAmount_other' is 0 because the primary - # activities are not attributed to those sectors. The values are 0 - # because the primary activities are initially assigned to all - # possible sectors and there is no data for those sectors in the - # attribution data set. We want to drop those rows here because - # otherwise if the data is further attributed (such as multiplied), - # it could appear that data is dropped elsewhere when the dataset is - # checked for null values - fba = fba[fba['FlowAmount_other'] != 0].reset_index(drop=True) - - return ( - fba - .drop(columns=['PrimarySector', 'SecondarySector', - 'temp_location', 'PrimarySector_other', - 'Location_other', 'FlowAmount_other', 'denominator', - 'Unit_other'], - errors='ignore') - .reset_index(drop=True) - ) - - def multiplication_attribution( - self: 'FlowByActivity', - other: 'FlowBySector' - ) -> 'FlowByActivity': - """ - This method takes flows from the calling FBA which are mapped to - multiple sectors and multiplies them by flows from other (an FBS). - """ - - log.info('Multiplying flows in %s by %s.', - self.full_name, other.full_name) - fba_geoscale, other_geoscale, fba, other = self.harmonize_geoscale( - other) - - # todo: update units after multiplying - - # multiply using each dfs primary sector col - merged = (fba - .merge(other, - how='left', - left_on=['PrimarySector', 'temp_location' - if 'temp_location' in fba - else 'Location'], - right_on=['PrimarySector', 'Location'], - suffixes=[None, '_other']) - .fillna({'FlowAmount_other': 0}) - ) - - fba = (merged - .assign(FlowAmount=lambda x: (x.FlowAmount - * x.FlowAmount_other)) - .drop(columns=['PrimarySector_other', 'Location_other', - 'FlowAmount_other', 'denominator'], - errors='ignore') - ) - - # determine if any flows are lost because multiplied by 0 - fba_null = fba[fba['FlowAmount'] == 0] - if len(fba_null) > 0: - log.warning('FlowAmounts in %s are reset to 0 due to lack of ' - 'flows in attribution source %s for ' - 'ActivityProducedBy/ActivityConsumedBy/Location: %s', - fba.full_name, other.full_name, - set(zip(fba_null.ActivityProducedBy, - fba_null.ActivityConsumedBy, - fba_null.Location)) - ) - - return ( - fba - .drop(columns=['PrimarySector', 'SecondarySector', - 'temp_location'], - errors='ignore') - .reset_index(drop=True) - ) - def prepare_fbs( self: 'FlowByActivity', From a5ad4d7743a27c6f9f6d31d1276dc79cef4596c3 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 1 Jun 2023 16:18:01 -0600 Subject: [PATCH 0597/1127] rename replace_naics_w_naics_from_another_year() to convert_naics_year() --- flowsa/data_source_scripts/stewiFBS.py | 5 ++--- flowsa/naics.py | 3 ++- flowsa/sectormapping.py | 7 +++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/flowsa/data_source_scripts/stewiFBS.py b/flowsa/data_source_scripts/stewiFBS.py index 29c497d58..799ede0d2 100644 --- a/flowsa/data_source_scripts/stewiFBS.py +++ b/flowsa/data_source_scripts/stewiFBS.py @@ -18,7 +18,7 @@ from flowsa.flowsa_log import log from flowsa.location import apply_county_FIPS, update_geoscale from flowsa.settings import process_adjustmentpath -from flowsa.naics import replace_naics_w_naics_from_another_year +from flowsa.naics import convert_naics_year import stewicombo import stewi from stewicombo.overlaphandler import remove_default_flow_overlaps @@ -300,7 +300,6 @@ def prepare_stewi_fbs(df_load, config) -> 'FlowBySector': :param config: dictionary, FBS method data source configuration :return: FlowBySector """ - config['sector-like_activities'] = True config['fedefl_mapping'] = ([x for x in config.get('inventory_dict').keys() if x != 'RCRAInfo']) config['drop_unmapped_rows'] = True @@ -315,7 +314,7 @@ def prepare_stewi_fbs(df_load, config) -> 'FlowBySector': 'Source': 'SourceName'}) .assign(Class='Chemicals') .assign(ActivityConsumedBy='') - .pipe(replace_naics_w_naics_from_another_year, + .pipe(convert_naics_year, f"NAICS_{config['target_naics_year']}_Code") # ^^ Consider upating this old function .assign(FlowType=lambda x: np.where( diff --git a/flowsa/naics.py b/flowsa/naics.py index 5c777fceb..51b23549d 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -180,7 +180,8 @@ def melt_naics_crosswalk(): return cw_replacement_2 -def replace_naics_w_naics_from_another_year(df_load, sectorsourcename): + +def convert_naics_year(df_load, sectorsourcename): """ Replace any non sectors with sectors. :param df_load: df with sector columns or sector-like activities diff --git a/flowsa/sectormapping.py b/flowsa/sectormapping.py index 0cf3d98b2..151c7256c 100644 --- a/flowsa/sectormapping.py +++ b/flowsa/sectormapping.py @@ -78,7 +78,7 @@ def add_sectors_to_flowbyactivity( repo :return: a df with activity fields mapped to 'sectors' """ - from flowsa.naics import replace_naics_w_naics_from_another_year + from flowsa.naics import convert_naics_year # First check if source activities are NAICS like - # if so make it into a mapping file s = pd.unique(flowbyactivity_df['SourceName'])[0] @@ -158,9 +158,8 @@ def add_sectors_to_flowbyactivity( # if activities are sector-like check that the sectors are in the crosswalk if src_info['sector-like_activities']: - flowbyactivity_wsector_df =\ - replace_naics_w_naics_from_another_year(flowbyactivity_wsector_df, - sectorsourcename) + flowbyactivity_wsector_df = convert_naics_year( + flowbyactivity_wsector_df, sectorsourcename) return flowbyactivity_wsector_df From 387c9a1e052d26275cc13b1a52e0bae6eb8cd1e9 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 2 Jun 2023 15:55:53 -0600 Subject: [PATCH 0598/1127] revise weighted_average() so do not lose the data that does not require modification --- flowsa/flowbyclean.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index ead33da7f..fe57069b3 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -49,7 +49,7 @@ def weighted_average( else 'Location'], right_on=['PrimarySector', 'Location'], suffixes=[None, '_other']) - .fillna({'FlowAmount_other': 0}) + .fillna({'FlowAmount_other': fba['FlowAmount']}) ) # drop rows where flow is 0 merged = merged[merged['FlowAmount'] != 0] From 5025ecc988184536593822843aa8e294c6288a5f Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 2 Jun 2023 15:57:53 -0600 Subject: [PATCH 0599/1127] new attribution method "inheritance" - child sectors inherit parent values --- flowsa/flowby.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 9dc1757dd..c050d98e6 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -654,7 +654,7 @@ def attribute_flows_to_sectors( for k, v in step_config['attribution_source'].items(): attribution_name = k - if attribution_method == 'direct': + if attribution_method in ['direct', 'inheritance']: log.info(f"Directly attributing {self.full_name} to " f"target sectors.") fb = fb.assign(AttributionSources='Direct') @@ -677,6 +677,11 @@ def attribute_flows_to_sectors( ) attributed_fb = fb.multiplication_attribution(attribution_fbs) + elif attribution_method == 'inheritance': + log.info(f'Directly attributing {self.full_name} to sectors, child ' + 'sectors inherent parent values.') + attributed_fb = fb.copy() + else: if all(fb.groupby('group_id')['group_id'].agg('count') == 1): log.info('No attribution needed for %s at the given industry ' @@ -696,8 +701,7 @@ def attribute_flows_to_sectors( # if the attribution method is not multiplication, check that new df # values equal original df values - if attribution_method not in ['multiplication', 'weighted_average', - 'substitute_nonexistent_values']: + if attribution_method not in ['multiplication', 'inheritance']: # todo: add results from this if statement to validation log validation_fb = attributed_fb.assign( validation_total=(attributed_fb.groupby('group_id') @@ -980,7 +984,6 @@ def proportionally_attribute( # otherwise if the data is further attributed (such as multiplied), # it could appear that data is dropped elsewhere when the dataset is # checked for null values - t = pd.DataFrame(fb) fb = fb[fb['FlowAmount_other'] != 0].reset_index(drop=True) return ( From b657ae6672ee935cd0610034d70c85aa65a95baf Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 2 Jun 2023 15:59:06 -0600 Subject: [PATCH 0600/1127] account for cached data sources when finding attribution name --- flowsa/flowby.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index c050d98e6..e61f9b1ac 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -624,7 +624,7 @@ def attribute_flows_to_sectors( .rename(columns={'index': 'group_id'}) .assign(group_total=self.FlowAmount) ) - if len(grouped)==0: + if len(grouped) == 0: log.warning(f'No data remaining in {self.full_name}.') return self if self.config['data_format'] == 'FBA': @@ -651,16 +651,18 @@ def attribute_flows_to_sectors( attribution_method = step_config.get('attribution_method') if 'attribution_source' in step_config: - for k, v in step_config['attribution_source'].items(): - attribution_name = k + if isinstance(step_config['attribution_source'], str): + attribution_name = step_config['attribution_source'] + else: + for k, v in step_config['attribution_source'].items(): + attribution_name = k if attribution_method in ['direct', 'inheritance']: log.info(f"Directly attributing {self.full_name} to " f"target sectors.") fb = fb.assign(AttributionSources='Direct') else: - fb = fb.assign(AttributionSources=','.join( - [k for k in step_config.get('attribution_source').keys()])) + fb = fb.assign(AttributionSources=attribution_name) if attribution_method == 'proportional': log.info(f"Proportionally attributing {self.full_name} to " From d85b8987eab4bcadb3bd7f2f69b336c86134d4f2 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 2 Jun 2023 15:59:40 -0600 Subject: [PATCH 0601/1127] include source catlog data in the cached FBS --- flowsa/flowby.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index e61f9b1ac..d1657cc28 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -820,9 +820,10 @@ def load_prepare_attribution_source( attribution_fbs.config = { **{k: attribution_fbs.config[k] for k in attribution_fbs.config['method_config_keys']}, + **get_catalog_info(name), **config } - attribution_fbs = attribution_fbs.prepare_fbs() + # attribution_fbs = attribution_fbs.prepare_fbs() else: attribution_fbs = get_flowby_from_config( name=name, From 31dbc439f419a903569b714b520a455bfd78a10d Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 2 Jun 2023 16:00:45 -0600 Subject: [PATCH 0602/1127] move water application rate data to cached sources --- .../Water_national_2015_m1.yaml | 187 ++++++++---------- 1 file changed, 84 insertions(+), 103 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index ca0fd4da0..6cb346dc2 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -6,6 +6,39 @@ year: 2015 target_naics_year: 2012 geoscale: national +sources_to_cache: + USDA_IWMS: + industry_spec: + default: NAICS_6 + NAICS_7: ['111150', '111199', '111940'] # hay and haylage set to NAICS7 - will update to NAICS6 + geoscale: state + year: 2018 + selection_fields: + Class: Water + attribute: + - attribution_method: inheritance + clean_fba_after_attribution: !clean_function:flowbyclean substitute_nonexistent_values + clean_source: + USDA_IWMS: + geoscale: national + year: 2018 + selection_fields: + Class: Water + attribute: + attribution_method: inheritance + - attribution_method: direct + clean_fba_after_attribution: !clean_function:flowbyclean weighted_average + replacement_dictionary: {'HAY & HAYLAGE, (EXCL ALFALFA)': 'HAY & HAYLAGE', + 'HAY & HAYLAGE, ALFALFA': 'HAY & HAYLAGE', + '111940A': '111940', + '111940B': '111940'} + clean_source: + USDA_IWMS: + year: 2018 + selection_fields: + Class: Land + PrimaryActivity: ['HAY & HAYLAGE, (EXCL ALFALFA)', 'HAY & HAYLAGE, ALFALFA'] + source_names: "USGS_NWIS_WU": fedefl_mapping: USGS_NWIS_WU @@ -34,8 +67,6 @@ source_names: geoscale: national data_format: FBS year: 2015 - attribute: - attribution_method: direct cropland_attribution: industry_spec: default: NAICS_6 @@ -44,24 +75,24 @@ source_names: PrimaryActivity: - "Irrigation Crop" attribute: - - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland: - year: 2017 - selection_fields: - Class: "Land" - FlowName: - - "AREA HARVESTED, IRRIGATED" - - "AREA IN PRODUCTION, IRRIGATED" - - "AREA, IRRIGATED" - - 'AREA BEARING & NON-BEARING, IRRIGATED' - - 'AREA GROWN, IRRIGATED' - activity_sets: - cropland_attribution-pastureland: - selection_fields: - PrimaryActivity: 'AG LAND, (EXCL HARVESTED CROPLAND)' - attribute: - attribution_method: proportional + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland: + year: 2017 + selection_fields: + Class: "Land" + FlowName: + - "AREA HARVESTED, IRRIGATED" + - "AREA IN PRODUCTION, IRRIGATED" + - "AREA, IRRIGATED" + - 'AREA BEARING & NON-BEARING, IRRIGATED' + - 'AREA GROWN, IRRIGATED' + activity_sets: + cropland_attribution-pastureland: + selection_fields: + PrimaryActivity: 'AG LAND, (EXCL HARVESTED CROPLAND)' + attribute: + - attribution_method: proportional attribution_source: USDA_CoA_Cropland_NAICS: year: 2017 @@ -75,47 +106,29 @@ source_names: "11231", "11232", "11233", "11234", "11239", "11241", "11242", "11291", "11292", "11293", "11299"] - attribute: - attribution_method: multiplication - attribution_source: - USDA_IWMS: &usda_iwms - geoscale: state - year: 2018 - selection_fields: - Class: Water - attribute: - attribution_method: direct - clean_fba_after_attribution: !clean_function:flowbyclean substitute_nonexistent_values - clean_source: - USDA_IWMS: - geoscale: national - year: 2018 - selection_fields: - Class: Water - attribute: - attribution_method: direct - cropland_attribution-cropland: - selection_fields: - PrimaryActivity: ['SOYBEANS', 'CANOLA', 'FLAXSEED', - 'MUSTARD, SEED', 'RAPESEED', 'SAFFLOWER', 'SESAME', - 'SUNFLOWER', 'CAMELINA', 'BEANS, DRY EDIBLE, (EXCL LIMA), - INCL CHICKPEAS', 'BEANS, DRY EDIBLE, (EXCL CHICKPEAS & - LIMA)', 'BEANS, DRY EDIBLE, LIMA', 'CHICKPEAS', 'LENTILS', - 'PEAS, DRY EDIBLE', 'PEAS, DRY, SOUTHERN (COWPEAS)', - 'WHEAT', 'CORN', 'CORN, GRAIN', 'CORN, SILAGE', - 'POPCORN, SHELLED', 'RICE', 'BARLEY', 'BUCKWHEAT', - 'MILLET, PROSO', 'OATS', 'RYE', 'SORGHUM, GRAIN', - 'SORGHUM, SILAGE', 'SORGHUM, SYRUP', 'TRITICALE', 'WILD - RICE', 'VEGETABLE TOTALS', 'ORCHARDS', - 'BERRY TOTALS', 'CUT CHRISTMAS TREES', 'SHORT TERM WOODY - CROPS', 'TOBACCO', 'COTTON', 'SUGARCANE, SUGAR', - 'SUGARCANE, SEED', 'HAY & HAYLAGE', 'SUGARBEETS', - 'SUGARBEETS, SEED', 'PEANUTS', 'GRASSES & - LEGUMES TOTALS, SEED', 'HERBS, DRY', 'HOPS', - 'MINT, OIL', 'MISCANTHUS', 'MINT, TEA LEAVES', - 'FIELD CROPS, OTHER'] - attribute: - attribution_method: proportional + - attribution_method: multiplication + attribution_source: USDA_IWMS + cropland_attribution-cropland: + selection_fields: + PrimaryActivity: ['SOYBEANS', 'CANOLA', 'FLAXSEED', + 'MUSTARD, SEED', 'RAPESEED', 'SAFFLOWER', 'SESAME', + 'SUNFLOWER', 'CAMELINA', 'BEANS, DRY EDIBLE, (EXCL LIMA), + INCL CHICKPEAS', 'BEANS, DRY EDIBLE, (EXCL CHICKPEAS & + LIMA)', 'BEANS, DRY EDIBLE, LIMA', 'CHICKPEAS', 'LENTILS', + 'PEAS, DRY EDIBLE', 'PEAS, DRY, SOUTHERN (COWPEAS)', + 'WHEAT', 'CORN', 'CORN, GRAIN', 'CORN, SILAGE', + 'POPCORN, SHELLED', 'RICE', 'BARLEY', 'BUCKWHEAT', + 'MILLET, PROSO', 'OATS', 'RYE', 'SORGHUM, GRAIN', + 'SORGHUM, SILAGE', 'SORGHUM, SYRUP', 'TRITICALE', 'WILD + RICE', 'VEGETABLE TOTALS', 'BERRY TOTALS', 'CUT + CHRISTMAS TREES', 'SHORT TERM WOODY CROPS', 'TOBACCO', + 'COTTON', 'SUGARCANE, SUGAR', 'SUGARCANE, SEED', 'HAY + & HAYLAGE', 'SUGARBEETS', 'SUGARBEETS, SEED', + 'PEANUTS', 'GRASSES & LEGUMES TOTALS, SEED', 'HERBS, + DRY', 'HOPS', 'MINT, OIL', 'MISCANTHUS', 'MINT, TEA + LEAVES', 'FIELD CROPS, OTHER'] + attribute: + - attribution_method: proportional attribution_source: USDA_CoA_Cropland_NAICS: year: 2017 @@ -132,48 +145,16 @@ source_names: "111421", "111422", "11191", "11192", "11193", "11194", "11199"] estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_sectors_equal_attribution - attribute: - attribution_method: direct - - attribution_method: multiplication - attribution_source: - USDA_IWMS: - industry_spec: - default: NAICS_6 - NAICS_7: ['111150', '111199', '111940'] # hay and haylage set to NAICS7 - will update to NAICS6 - <<: *usda_iwms - activity_sets: - cropland_attribution-cropland-nonhay: - selection_fields: - PrimaryActivity: ['BEANS, DRY EDIBLE, INCL - CHICKPEAS', 'BERRY TOTALS', 'CORN, GRAIN', - 'CORN, SILAGE', 'COTTON', 'CROPS, OTHER', - 'HORTICULTURE TOTALS', 'ORCHARDS', - 'PASTURELAND', 'PEANUTS', 'POTATOES', 'RICE', - 'SMALL GRAINS, OTHER', 'SORGHUM, GRAIN', - 'SOYBEANS', 'SWEET CORN', 'TOMATOES', - 'VEGETABLE TOTALS', 'WHEAT'] - attribute: - attribution_method: direct - cropland_attribution-cropland-hay: - selection_fields: - PrimaryActivity: ['HAY & HAYLAGE, (EXCL ALFALFA)', - 'HAY & HAYLAGE, ALFALFA'] - clean_fba_w_sec: !clean_function:flowbyclean weighted_average - replacement_dictionary: {'HAY & HAYLAGE, (EXCL ALFALFA)': 'HAY & HAYLAGE', - 'HAY & HAYLAGE, ALFALFA': 'HAY & HAYLAGE', - '111940A': '111940', - '111940B': '111940'} - clean_source: - USDA_IWMS: - year: 2018 - selection_fields: - Class: Land - PrimaryActivity: ['HAY & HAYLAGE, (EXCL ALFALFA)', 'HAY & HAYLAGE, ALFALFA'] - estimate_suppressed: !script_function:USDA_IWMS estimate_suppressed_iwms - attribute: - attribution_method: direct - attribute: - attribution_method: direct + - attribution_method: multiplication + attribution_source: USDA_IWMS + cropland_attribution-orchards: + selection_fields: + PrimaryActivity: ORCHARDS + attribute: + # first directly attribute so orchards are equally attributed to related sectors + - attribution_method: direct + - attribution_method: multiplication + attribution_source: USDA_IWMS livestock_attribution: industry_spec: default: NAICS_6 From 9c0095a71c69a348c2964b606ff3db8f07082525 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 5 Jun 2023 16:16:36 -0600 Subject: [PATCH 0603/1127] correct which sectors are excluded when mapping string activities to sectors when activity mapping is parent-completeChild --- flowsa/flowby.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index d1657cc28..913bbd62f 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1762,9 +1762,8 @@ def map_to_sectors( existing_sectors['Activity'] == i] for j in existing_sectors_sub['Sector']: dig = len(str(j)) - n = existing_sectors_sub[ - existing_sectors_sub['Sector'].apply( - lambda x: x[0:dig]) == j] + n = existing_sectors[ + existing_sectors['Sector'].str.startswith(j)] if len(n) == 1: expanded_n = naics_key[naics_key['source_naics'] == j] @@ -1781,7 +1780,7 @@ def map_to_sectors( .drop(columns=['source_naics', 'target_naics']) ) - fba_w_naics = self + fba_w_naics = self.copy() for direction in ['ProducedBy', 'ConsumedBy']: fba_w_naics = ( fba_w_naics From 3ebacad7ce7dd863cf21a2c6b9f6884794df62c4 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 5 Jun 2023 16:18:58 -0600 Subject: [PATCH 0604/1127] update usgs_wu_coef attribution method to inheritance --- flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index 6cb346dc2..0297d9d27 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -183,4 +183,4 @@ source_names: year: 2005 geoscale: national attribute: - attribution_method: direct + attribution_method: inheritance From 64a80978005e795dfb90b8dea885044be0c327a6 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 6 Jun 2023 08:13:22 -0600 Subject: [PATCH 0605/1127] update epa_rei sector_hierarchy to flat --- flowsa/data/source_catalog.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 8e7815d98..e7b1528dc 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -186,7 +186,7 @@ EPA_REI: - Money - Other activity_schema: None - sector_hierarchy: "parent-completeChild" + sector_hierarchy: "flat" EPA_StateGHGI: data_format: FBA class: From 3e55fd8d48ae95477e505f0d2d5c53b030a83bb1 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 6 Jun 2023 08:14:53 -0600 Subject: [PATCH 0606/1127] update substutiute_nonexistent_values() to work for FBA or FBS --- flowsa/flowbyclean.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index fe57069b3..864c48eb9 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -92,29 +92,29 @@ def weighted_average( def substitute_nonexistent_values( - fba: 'FlowByActivity', + fb: 'FlowBy', **kwargs -) -> 'FlowByActivity': +) -> 'FlowBy': """ - This method determines weighted average + Fill missing values with data from another geoscale """ # load secondary FBS - other = load_prepare_clean_source(fba) + other = load_prepare_clean_source(fb) other = (other .add_primary_secondary_columns('Sector') .drop(columns=['MetaSources', 'AttributionSources'])) log.info('Substituting nonexistent values in %s with %s.', - fba.full_name, other.full_name) + fb.full_name, other.full_name) - fba = (fba + fb = (fb .add_primary_secondary_columns('Sector') ) # merge all possible national data with each state state_geo = pd.concat([ - (geo.filtered_fips(fba.config['geoscale'])[['FIPS']] + (geo.filtered_fips(fb.config['geoscale'])[['FIPS']] .assign(Location=location.US_FIPS)) ]) @@ -125,7 +125,7 @@ def substitute_nonexistent_values( 'FlowAmount': 'FlowAmount_other'}) ) - merged = (fba + merged = (fb .merge(other, on=list(other.select_dtypes( include=['object', 'int']).columns), From e5a04ebb2a5f293453d2dcbd74f086ed327f2126 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 6 Jun 2023 14:22:33 -0600 Subject: [PATCH 0607/1127] move temp fxns to flowbyclean.py --- .../temp_data_source_functions.py | 91 ---------------- flowsa/flowbyclean.py | 100 ++++++++++++++++++ 2 files changed, 100 insertions(+), 91 deletions(-) diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index b28a4306f..2fc5180bf 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -1,8 +1,6 @@ from flowsa import naics from flowsa import settings -from flowsa.flowsa_log import log import pandas as pd -import numpy as np from flowsa.data_source_scripts import EPA_GHGI as ghgi from flowsa.data_source_scripts import USDA_CoA_Cropland as coa from flowsa.flowby import FlowByActivity @@ -108,92 +106,3 @@ def disaggregate_coa_cropland_to_6_digit_naics(fba: FlowByActivity): setattr(new_fba, attr, attributes_to_save[attr]) return new_fba - -def return_primary_activity_column(fba: FlowByActivity) -> \ - FlowByActivity: - """ - Determine activitiy column with values - :param fba: fbs df with two sector columns - :return: string, primary sector column - """ - if fba['ActivityProducedBy'].isnull().all(): - primary_column = 'ActivityConsumedBy' - elif fba['ActivityConsumedBy'].isnull().all(): - primary_column = 'ActivityProducedBy' - else: - log.error('Could not determine primary activity column as there ' - 'are values in both ActivityProducedBy and ' - 'ActivityConsumedBy') - return primary_column - -def estimate_suppressed_sectors_equal_attribution(fba: FlowByActivity) -> \ - FlowByActivity: - - col = return_primary_activity_column(fba) - indexed = ( - fba - .assign(n2=fba[col].str.slice(stop=2), - n3=fba[col].str.slice(stop=3), - n4=fba[col].str.slice(stop=4), - n5=fba[col].str.slice(stop=5), - n6=fba[col].str.slice(stop=6), - n7=fba[col].str.slice(stop=7), - location=fba.Location, - category=fba.FlowName) - .replace({'FlowAmount': {0: np.nan}}) - .set_index(['n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'location', - 'category'], verify_integrity=True) - ) - - def fill_suppressed( - flows: pd.Series, - level: int, - full_naics: pd.Series - ) -> pd.Series: - parent = flows[full_naics.str.len() == level] - children = flows[full_naics.str.len() == level + 1] - null_children = children[children.isna()] - - if null_children.empty or parent.empty: - return flows - else: - value = max((parent[0] - children.sum()) / null_children.size, 0) - return flows.fillna(pd.Series(value, index=null_children.index)) - - unsuppressed = ( - indexed - .assign( - FlowAmount=lambda x: ( - x.groupby(level=['n2', - 'location', 'category'])['FlowAmount'] - .transform(fill_suppressed, 2, x.ActivityProducedBy))) - .assign( - FlowAmount=lambda x: ( - x.groupby(level=['n2', 'n3', - 'location', 'category'])['FlowAmount'] - .transform(fill_suppressed, 3, x.ActivityProducedBy))) - .assign( - FlowAmount=lambda x: ( - x.groupby(level=['n2', 'n3', 'n4', - 'location', 'category'])['FlowAmount'] - .transform(fill_suppressed, 4, x.ActivityProducedBy))) - .assign( - FlowAmount=lambda x: ( - x.groupby(level=['n2', 'n3', 'n4', 'n5', - 'location', 'category'])['FlowAmount'] - .transform(fill_suppressed, 5, x.ActivityProducedBy))) - .assign( - FlowAmount=lambda x: ( - x.groupby(level=['n2', 'n3', 'n4', 'n5', 'n6', - 'location', 'category'])['FlowAmount'] - .transform(fill_suppressed, 6, x.ActivityProducedBy))) - .fillna({'FlowAmount': 0}) - .reset_index(drop=True) - ) - - aggregated = ( - unsuppressed - .aggregate_flowby() - ) - - return aggregated diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index 864c48eb9..820ceffe5 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -5,6 +5,23 @@ from flowsa import (flowby, geo, location) +def return_primary_activity_column(fba: FlowByActivity) -> \ + FlowByActivity: + """ + Determine activitiy column with values + :param fba: fbs df with two sector columns + :return: string, primary sector column + """ + if fba['ActivityProducedBy'].isnull().all(): + primary_column = 'ActivityConsumedBy' + elif fba['ActivityConsumedBy'].isnull().all(): + primary_column = 'ActivityProducedBy' + else: + log.error('Could not determine primary activity column as there ' + 'are values in both ActivityProducedBy and ' + 'ActivityConsumedBy') + return primary_column + def load_prepare_clean_source( self: 'FlowByActivity' @@ -150,3 +167,86 @@ def substitute_nonexistent_values( log.warning('Not all null values were substituted') return merged + + +def estimate_suppressed_sectors_equal_attribution( + fba: FlowByActivity) -> FlowByActivity: + """ + + :param fba: + :return: + """ + + col = return_primary_activity_column(fba) + indexed = ( + fba + .assign(n2=fba[col].str.slice(stop=2), + n3=fba[col].str.slice(stop=3), + n4=fba[col].str.slice(stop=4), + n5=fba[col].str.slice(stop=5), + n6=fba[col].str.slice(stop=6), + n7=fba[col].str.slice(stop=7), + location=fba.Location, + category=fba.FlowName) + .replace({'FlowAmount': {0: np.nan}, + col: {'31-33': '3X', + '44-45': '4X', + '48-49': '4Y'}, + 'n2': {'31': '3X', '32': '3X', '33': '3X', + '44': '4X', '45': '4X', + '48': '4Y', '49': '4Y'}}) + .set_index(['n2', 'n3', 'n4', 'n5', 'n6', 'location', 'category'], + verify_integrity=True) + ) + + def fill_suppressed( + flows: pd.Series, + level: int, + full_naics: pd.Series + ) -> pd.Series: + parent = flows[full_naics.str.len() == level] + children = flows[full_naics.str.len() == level + 1] + null_children = children[children.isna()] + + if null_children.empty or parent.empty: + return flows + else: + value = max((parent[0] - children.sum()) / null_children.size, 0) + return flows.fillna(pd.Series(value, index=null_children.index)) + + unsuppressed = ( + indexed + .assign( + FlowAmount=lambda x: ( + x.groupby(level=['n2', + 'location', 'category'])['FlowAmount'] + .transform(fill_suppressed, 2, x[col]))) + .assign( + FlowAmount=lambda x: ( + x.groupby(level=['n2', 'n3', + 'location', 'category'])['FlowAmount'] + .transform(fill_suppressed, 3, x[col]))) + .assign( + FlowAmount=lambda x: ( + x.groupby(level=['n2', 'n3', 'n4', + 'location', 'category'])['FlowAmount'] + .transform(fill_suppressed, 4, x[col]))) + .assign( + FlowAmount=lambda x: ( + x.groupby(level=['n2', 'n3', 'n4', 'n5', + 'location', 'category'])['FlowAmount'] + .transform(fill_suppressed, 5, x[col]))) + .fillna({'FlowAmount': 0}) + .reset_index(drop=True) + ) + + aggregated = ( + unsuppressed + .replace({col: {'3X': '31-33', + '4X': '44-45', + '4Y': '48-49'}}) + .aggregate_flowby() + ) + + + return aggregated From 2a311787d73aa756608d5bc901d696a67bba5072 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 6 Jun 2023 14:23:30 -0600 Subject: [PATCH 0608/1127] simplify water_national_2015_m1 fbs --- .../Water_national_2015_m1.yaml | 48 +++++++------------ 1 file changed, 16 insertions(+), 32 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index 0297d9d27..e3954d864 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -87,6 +87,10 @@ source_names: - "AREA, IRRIGATED" - 'AREA BEARING & NON-BEARING, IRRIGATED' - 'AREA GROWN, IRRIGATED' + exclusion_fields: + ActivityConsumedBy: + - 'AG LAND' + - 'AG LAND, CROPLAND, HARVESTED' activity_sets: cropland_attribution-pastureland: selection_fields: @@ -100,33 +104,21 @@ source_names: Class: Land FlowName: - "FARM OPERATIONS" - estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_sectors_equal_attribution + estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution selection_fields_after_data_suppression_estimation: - PrimaryActivity: ["112111", "112112", "11212", "1122", - "11231", "11232", "11233", "11234", - "11239", "11241", "11242", "11291", - "11292", "11293", "11299"] + PrimaryActivity: [ + '112', '1121', '11211', '112111', '112112', + '11212', '1122', '1123', '11231', '11232', + '11233', '11234', '11239', '1124', '11241', + '11242', '1129', '11291', '11292', '11293', + '11299'] - attribution_method: multiplication attribution_source: USDA_IWMS cropland_attribution-cropland: - selection_fields: - PrimaryActivity: ['SOYBEANS', 'CANOLA', 'FLAXSEED', - 'MUSTARD, SEED', 'RAPESEED', 'SAFFLOWER', 'SESAME', - 'SUNFLOWER', 'CAMELINA', 'BEANS, DRY EDIBLE, (EXCL LIMA), - INCL CHICKPEAS', 'BEANS, DRY EDIBLE, (EXCL CHICKPEAS & - LIMA)', 'BEANS, DRY EDIBLE, LIMA', 'CHICKPEAS', 'LENTILS', - 'PEAS, DRY EDIBLE', 'PEAS, DRY, SOUTHERN (COWPEAS)', - 'WHEAT', 'CORN', 'CORN, GRAIN', 'CORN, SILAGE', - 'POPCORN, SHELLED', 'RICE', 'BARLEY', 'BUCKWHEAT', - 'MILLET, PROSO', 'OATS', 'RYE', 'SORGHUM, GRAIN', - 'SORGHUM, SILAGE', 'SORGHUM, SYRUP', 'TRITICALE', 'WILD - RICE', 'VEGETABLE TOTALS', 'BERRY TOTALS', 'CUT - CHRISTMAS TREES', 'SHORT TERM WOODY CROPS', 'TOBACCO', - 'COTTON', 'SUGARCANE, SUGAR', 'SUGARCANE, SEED', 'HAY - & HAYLAGE', 'SUGARBEETS', 'SUGARBEETS, SEED', - 'PEANUTS', 'GRASSES & LEGUMES TOTALS, SEED', 'HERBS, - DRY', 'HOPS', 'MINT, OIL', 'MISCANTHUS', 'MINT, TEA - LEAVES', 'FIELD CROPS, OTHER'] + exclusion_fields: + ActivityConsumedBy: + - 'AG LAND, (EXCL HARVESTED CROPLAND)' + - 'ORCHARDS' attribute: - attribution_method: proportional attribution_source: @@ -136,15 +128,7 @@ source_names: Class: Land FlowName: - "AG LAND, CROPLAND, HARVESTED" - PrimaryActivity: ["11111", "11112", "11113", "11114", - "11115", "11116", "11119", "111211", - "111219", "11131", - "11132", "111331", "111332", - "111333", "111334", "111335", - "111336", "111339", "11141", - "111421", "111422", "11191", "11192", - "11193", "11194", "11199"] - estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_sectors_equal_attribution + estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution - attribution_method: multiplication attribution_source: USDA_IWMS cropland_attribution-orchards: From ef18bf2f2ab0313682dbca6c93504060af7e36a3 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 6 Jun 2023 14:24:04 -0600 Subject: [PATCH 0609/1127] update employment fbs to include "attribute" --- flowsa/methods/flowbysectormethods/Employment_common.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flowsa/methods/flowbysectormethods/Employment_common.yaml b/flowsa/methods/flowbysectormethods/Employment_common.yaml index 1e2bce309..e13ec4d7c 100644 --- a/flowsa/methods/flowbysectormethods/Employment_common.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_common.yaml @@ -23,4 +23,5 @@ bls_load_and_clean_state: bls_allocation: selection_fields: PrimaryActivity: !from_index:BLS_QCEW_asets.csv qcew - attribution_method: direct + attribute: + attribution_method: direct From f4348074c25663bc08411083ce3258f760e192c5 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 6 Jun 2023 14:24:39 -0600 Subject: [PATCH 0610/1127] update land fbs to use "attribute" --- .../Land_national_2012.yaml | 131 ++++++++++-------- 1 file changed, 70 insertions(+), 61 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Land_national_2012.yaml b/flowsa/methods/flowbysectormethods/Land_national_2012.yaml index 81bfe1207..11ee945a8 100644 --- a/flowsa/methods/flowbysectormethods/Land_national_2012.yaml +++ b/flowsa/methods/flowbysectormethods/Land_national_2012.yaml @@ -18,12 +18,12 @@ sources_to_cache: activity_sets: cbecs_land: # all activities in eia cbecs land crosswalk selection_fields: - PrimaryActivity: !from_index:EIA_CBECS_Land_2012_asets.csv cbecs_land - attribution_method: proportional - attribution_source: - Employment_national_2012: - data_format: FBS - "EIA_MECS_Land": &_eia_mecs_land # manufacturing land use + PrimaryActivity: !from_index:EIA_CBECS_Land_2012_asets.csv cbecs_land + attribute: + attribution_method: proportional + attribution_source: Employment_national_2012 +# data_format: FBS + EIA_MECS_Land: &_eia_mecs_land # manufacturing land use fedefl_mapping: EIA_MECS_Land year: 2014 selection_fields: @@ -35,12 +35,13 @@ sources_to_cache: activity_sets: mecs_land: # all activities in eia mecs land crosswalk selection_fields: - PrimaryActivity: !from_index:EIA_MECS_Land_2014_asets.csv mecs_land - attribution_method: proportional - attribution_source: - Employment_national_2014: - data_format: FBS - year: 2014 + PrimaryActivity: !from_index:EIA_MECS_Land_2014_asets.csv mecs_land + attribute: + attribution_method: proportional + attribution_source: + Employment_national_2014: +# data_format: FBS + year: 2014 source_names: EIA_CBECS_Land: @@ -55,16 +56,17 @@ source_names: activity_sets: general_mining: # all blm pls activities other than hardrock selection_fields: - PrimaryActivity: !from_index:BLM_PLS_2012_asets.csv general_mining - attribution_method: direct + PrimaryActivity: !from_index:BLM_PLS_2012_asets.csv general_mining + attribute: + attribution_method: direct hardrock_mining: selection_fields: - PrimaryActivity: !from_index:BLM_PLS_2012_asets.csv hardrock_mining - attribution_method: proportional - attribution_source: - Employment_national_2012: - data_format: FBS - "USDA_ERS_MLU": + PrimaryActivity: !from_index:BLM_PLS_2012_asets.csv hardrock_mining + attribute: + attribution_method: proportional + attribution_source: Employment_national_2012 +# data_format: FBS + USDA_ERS_MLU: fedefl_mapping: USDA_ERS_MLU selection_fields: Class: Land @@ -75,74 +77,81 @@ source_names: PrimaryActivity: - 'Cropland used for crops' - 'Cropland idled' - attribution_method: proportional - attribution_source: - "USDA_CoA_Cropland": - selection_fields: - Class: "Land" - FlowName: - - "AREA HARVESTED" - - "AREA" - - "AREA IN PRODUCTION" - - 'AREA BEARING & NON-BEARING' - - 'AREA GROWN' - Location: !include:Location_common.yaml:_state_location - exclusion_fields: - conditional: {FlowName: 'AREA IN PRODUCTION', - ActivityConsumedBy: 'VEGETABLE TOTALS'} - ActivityConsumedBy: ['AG LAND', 'AG LAND, CROPLAND, HARVESTED'] - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland_NAICS: - year: 2017 - selection_fields: - Class: Land - FlowName: - - "FARM OPERATIONS" - estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_sectors_equal_attribution - selection_fields_after_data_suppression_estimation: - PrimaryActivity: [ "112111", "112112", "11212", "1122", - "11231", "11232", "11233", "11234", - "11239", "11241", "11242", "11291", - "11292", "11293", "11299" ] + attribute: + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland: + selection_fields: + Class: Land + FlowName: + - "AREA HARVESTED" + - "AREA" + - "AREA IN PRODUCTION" + - 'AREA BEARING & NON-BEARING' + - 'AREA GROWN' + Location: !include:Location_common.yaml:_state_location + exclusion_fields: + conditional: {FlowName: 'AREA IN PRODUCTION', + ActivityConsumedBy: 'VEGETABLE TOTALS'} + ActivityConsumedBy: ['AG LAND', 'AG LAND, CROPLAND, HARVESTED'] + attribute: + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + year: 2017 + selection_fields: + Class: Land + FlowName: + - "FARM OPERATIONS" + estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution + selection_fields_after_data_suppression_estimation: + PrimaryActivity: [ "112111", "112112", "11212", "1122", + "11231", "11232", "11233", "11234", + "11239", "11241", "11242", "11291", + "11292", "11293", "11299" ] pastureland: selection_fields: PrimaryActivity: - 'Cropland used for pasture' - 'Forest-use land grazed' - 'Grassland pasture and range' - attribution_method: proportional - attribution_source: - "USDA_CoA_Cropland_NAICS": - selection_fields: - Class: "Land" - FlowName: "FARM OPERATIONS" - estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_sectors_equal_attribution + attribute: + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + selection_fields: + Class: Land + FlowName: "FARM OPERATIONS" + estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution forest: selection_fields: PrimaryActivity: - 'Forest-use land not grazed' - 'Land in defense and industrial areas' - 'Land in rural parks and wildlife areas' - attribution_method: direct + attribute: + attribution_method: direct rural_transportation: selection_fields: PrimaryActivity: - 'Land in rural transportation facilities' clean_fba_w_sec: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_land_in_rural_transportation_areas geoscale: national - attribution_method: direct + attribute: + attribution_method: direct urban: selection_fields: PrimaryActivity: - 'Land in urban areas' clean_fba_w_sec: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_land_in_urban_areas geoscale: national - attribution_method: direct + attribute: + attribution_method: direct other: selection_fields: PrimaryActivity: - 'Other land' clean_fba_w_sec: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_other_land geoscale: national - attribution_method: direct \ No newline at end of file + attribute: + attribution_method: direct \ No newline at end of file From 92daa4a33ec90ea8af5f8a5fd0da82227cb06398 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 6 Jun 2023 14:25:05 -0600 Subject: [PATCH 0611/1127] indent clean_fba_after_attribution --- .../methods/flowbysectormethods/REI_waste_national_2012.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml b/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml index 3eddb52de..0b12fb8d8 100644 --- a/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml +++ b/flowsa/methods/flowbysectormethods/REI_waste_national_2012.yaml @@ -8,7 +8,7 @@ target_naics_year: 2012 geoscale: national source_names: - "EPA_REI": + EPA_REI: selection_fields: PrimaryActivity: !from_index:EPA_REI_waste_2012_asets.csv waste Class: Other @@ -26,4 +26,4 @@ source_names: PrimaryActivity: !from_index:EPA_REI_waste_2012_asets.csv waste Class: Other Description: useintersection - clean_fba_after_attribution: !script_function:EPA_REI rei_waste_national_cleanup + clean_fba_after_attribution: !script_function:EPA_REI rei_waste_national_cleanup From ff11589f2f7b4e4f34f7e9cfa70943a1e0f04d5e Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 6 Jun 2023 14:27:10 -0600 Subject: [PATCH 0612/1127] don't return fb if no attribution is required to allow fro continued modification of the fb --- flowsa/flowby.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 913bbd62f..7532a0b02 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -699,7 +699,12 @@ def attribute_flows_to_sectors( fb.full_name, attribution_method) raise ValueError('Attribution method not recognized') - attributed_fb = fb.equally_attribute() + if all(fb.groupby('group_id')['group_id'].agg('count') == 1): + log.info('No attribution needed for %s at the given industry ' + 'aggregation level', fb.full_name) + attributed_fb = fb.copy() + else: + attributed_fb = fb.equally_attribute() # if the attribution method is not multiplication, check that new df # values equal original df values From e32c97b24268a38090b4a81d0203f55e1eeac5ab Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 6 Jun 2023 14:28:11 -0600 Subject: [PATCH 0613/1127] move 'clean_fba_after_attribtuion' into the attribution for loop --- flowsa/flowby.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 7532a0b02..2ce5b456f 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -685,11 +685,6 @@ def attribute_flows_to_sectors( attributed_fb = fb.copy() else: - if all(fb.groupby('group_id')['group_id'].agg('count') == 1): - log.info('No attribution needed for %s at the given industry ' - 'aggregation level', fb.full_name) - return fb.drop(columns=['group_id', 'group_total']) - if attribution_method is None: log.warning('No attribution method specified for %s. ' 'Using equal attribution as default.', @@ -726,6 +721,10 @@ def attribute_flows_to_sectors( log.error('Errors in attributing flows from %s:\n%s', self.full_name, errors) + # run function to clean fbs after attribution + attributed_fb = attributed_fb.function_socket( + 'clean_fba_after_attribution') + # Drop columns created for disaggregation, plus any # specified in the config file self = ( @@ -1960,7 +1959,6 @@ def prepare_fbs( .function_socket('clean_fba') .convert_to_geoscale() .attribute_flows_to_sectors(external_config_path=external_config_path) # recursive call to prepare_fbs - .function_socket('clean_fba_after_attribution') .drop(columns=['ActivityProducedBy', 'ActivityConsumedBy']) .aggregate_flowby() ) From 8ceff32649cacb313e402f7af6cd2bc6a25ff6bc Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 6 Jun 2023 14:28:42 -0600 Subject: [PATCH 0614/1127] update land state to use function moved to flowbyclean --- flowsa/methods/flowbysectormethods/Land_state_2012.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Land_state_2012.yaml b/flowsa/methods/flowbysectormethods/Land_state_2012.yaml index e93b850a3..703c806d9 100644 --- a/flowsa/methods/flowbysectormethods/Land_state_2012.yaml +++ b/flowsa/methods/flowbysectormethods/Land_state_2012.yaml @@ -102,7 +102,7 @@ source_names: Class: Land FlowName: - "FARM OPERATIONS" - estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_sectors_equal_attribution + estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution selection_fields_after_data_suppression_estimation: PrimaryActivity: [ "112111", "112112", "11212", "1122", "11231", "11232", "11233", "11234", @@ -121,7 +121,7 @@ source_names: selection_fields: Class: "Land" FlowName: "FARM OPERATIONS" - estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_sectors_equal_attribution + estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution forest: selection_fields: PrimaryActivity: From 9ab7bfb13e512f1cfd3780efd1b7d3bc6e1ef2e5 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 6 Jun 2023 14:29:26 -0600 Subject: [PATCH 0615/1127] simplify substitute_nonexistent_values() --- flowsa/flowbyclean.py | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index 820ceffe5..f58c5be6b 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -118,17 +118,10 @@ def substitute_nonexistent_values( # load secondary FBS other = load_prepare_clean_source(fb) - other = (other - .add_primary_secondary_columns('Sector') - .drop(columns=['MetaSources', 'AttributionSources'])) log.info('Substituting nonexistent values in %s with %s.', fb.full_name, other.full_name) - fb = (fb - .add_primary_secondary_columns('Sector') - ) - # merge all possible national data with each state state_geo = pd.concat([ (geo.filtered_fips(fb.config['geoscale'])[['FIPS']] @@ -138,27 +131,29 @@ def substitute_nonexistent_values( other = (other .merge(state_geo) .drop(columns=['Location', 'FlowUUID']) - .rename(columns={'FIPS': 'Location', - 'FlowAmount': 'FlowAmount_other'}) + .rename(columns={'FIPS': 'Location'}) ) merged = (fb .merge(other, on=list(other.select_dtypes( include=['object', 'int']).columns), - how='outer') - .assign(FlowAmount=lambda x: x.FlowAmount. - fillna(x.FlowAmount_other)) - .drop(columns=['PrimarySector', 'SecondarySector', - 'FlowAmount_other', 'group_id'], - errors='ignore') - .reset_index(drop=True).reset_index() - .rename(columns={'index': 'group_id'}) + how='outer', + suffixes=(None, '_y')) ) - # replace float dtypes with new data + # fill in missing data + new_col_data = [col for col in merged if col.endswith('_y')] + for c in new_col_data: + original_col = c.replace('_y', '') + merged[original_col] = merged[original_col].fillna( + merged[c]) + + # reset grop id and group total, drop columns merged = (merged - .drop(merged.filter(regex='_x').columns, axis=1) - .rename(columns=lambda x: x.replace('_y', '')) + .drop(merged.filter(regex='_y').columns, axis=1) + .drop(columns=['group_id']) + .reset_index(drop=True).reset_index() + .rename(columns={'index': 'group_id'}) .assign(group_total=merged.FlowAmount) ) From ded04a4517ec4d146a2eb8e16875541b5d99ce19 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 7 Jun 2023 12:37:59 -0400 Subject: [PATCH 0616/1127] further consolidate CAP_HAP state method from common file --- .../flowbysectormethods/CAP_HAP_common.yaml | 16 +++++++++++ .../CAP_HAP_state_2014.yaml | 28 ++----------------- .../CAP_HAP_state_2017.yaml | 28 ++----------------- .../CAP_HAP_state_2020.yaml | 28 ++----------------- 4 files changed, 22 insertions(+), 78 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml index 3753ebe5e..f62c6143b 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml @@ -26,6 +26,22 @@ sources_to_cache: # data_format: FBS # year: 2018 + EIA_MECS_Energy_state: ## Version to use in state models + # year: 2018 # Specify target MECS year + geoscale: state + selection_fields: + Class: Energy + Unit: Trillion Btu + Description: + - Table 2.2 + - Table 3.2 + exclusion_fields: + Location: '00000' + estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy + clean_fba: !script_function:EIA_MECS clean_mecs_energy_fba + clean_fba_w_sec: !script_function:EIA_MECS clean_mapped_mecs_energy_fba_to_state + attribution_source: Employment_state_2018 ## Update to MECS year + _attribution_sources: BEA: &bea year: 2012 diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2014.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2014.yaml index a9faafb0f..6f26db7e2 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2014.yaml @@ -12,19 +12,8 @@ _emission_year: &year 2014 sources_to_cache: EIA_MECS_Energy: + !include:CAP_HAP_common.yaml:sources_to_cache:EIA_MECS_Energy_state year: 2014 - geoscale: state - selection_fields: - Class: Energy - Unit: Trillion Btu - Description: - - Table 2.2 - - Table 3.2 - exclusion_fields: - Location: '00000' - estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy - clean_fba: !script_function:EIA_MECS clean_mecs_energy_fba - clean_fba_w_sec: !script_function:EIA_MECS clean_mapped_mecs_energy_fba_to_state attribution_source: Employment_state_2014 _attribution_sources: @@ -68,20 +57,7 @@ source_names: ActivityProducedBy: {'325': ''} # Fertilizers 325310 pesticides: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv pesticides - exclusion_fields: - # To avoid overlap with other datasets, emissions of pesticides - # from pesticide application are removed. - FlowName: - - 2,4-Dichlorophenoxy Acetic Acid - - Captan - - Carbaryl - - Methyl Bromide - - Methyl Iodide - - Parathion - - Trifluralin - attribution_method: proportional + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:pesticides attribution_source: stateio_Use_Summary: <<: *stateio diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml index caa4f8c52..a858b526f 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml @@ -12,19 +12,8 @@ _emission_year: &year 2017 sources_to_cache: EIA_MECS_Energy: + !include:CAP_HAP_common.yaml:sources_to_cache:EIA_MECS_Energy_state year: 2018 - geoscale: state - selection_fields: - Class: Energy - Unit: Trillion Btu - Description: - - Table 2.2 - - Table 3.2 - exclusion_fields: - Location: '00000' - estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy - clean_fba: !script_function:EIA_MECS clean_mecs_energy_fba - clean_fba_w_sec: !script_function:EIA_MECS clean_mapped_mecs_energy_fba_to_state attribution_source: Employment_state_2018 _attribution_sources: @@ -68,20 +57,7 @@ source_names: ActivityProducedBy: {'325': ''} # Fertilizers 325310 pesticides: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv pesticides - exclusion_fields: - # To avoid overlap with other datasets, emissions of pesticides - # from pesticide application are removed. - FlowName: - - 2,4-Dichlorophenoxy Acetic Acid - - Captan - - Carbaryl - - Methyl Bromide - - Methyl Iodide - - Parathion - - Trifluralin - attribution_method: proportional + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:pesticides attribution_source: stateio_Use_Summary: <<: *stateio diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2020.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2020.yaml index 4db42257a..f258453d1 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2020.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2020.yaml @@ -12,19 +12,8 @@ _emission_year: &year 2020 sources_to_cache: EIA_MECS_Energy: + !include:CAP_HAP_common.yaml:sources_to_cache:EIA_MECS_Energy_state year: 2018 - geoscale: state - selection_fields: - Class: Energy - Unit: Trillion Btu - Description: - - Table 2.2 - - Table 3.2 - exclusion_fields: - Location: '00000' - estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy - clean_fba: !script_function:EIA_MECS clean_mecs_energy_fba - clean_fba_w_sec: !script_function:EIA_MECS clean_mapped_mecs_energy_fba_to_state attribution_source: Employment_state_2018 _attribution_sources: @@ -68,20 +57,7 @@ source_names: ActivityProducedBy: {'325': ''} # Fertilizers 325310 pesticides: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv pesticides - exclusion_fields: - # To avoid overlap with other datasets, emissions of pesticides - # from pesticide application are removed. - FlowName: - - 2,4-Dichlorophenoxy Acetic Acid - - Captan - - Carbaryl - - Methyl Bromide - - Methyl Iodide - - Parathion - - Trifluralin - attribution_method: proportional + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:pesticides attribution_source: stateio_Use_Summary: <<: *stateio From 3523ee667102db4afcb89516d1e03e7920e89a55 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 7 Jun 2023 23:49:14 -0400 Subject: [PATCH 0617/1127] add back develop tags --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 309a51b64..e372f931f 100644 --- a/setup.py +++ b/setup.py @@ -12,9 +12,9 @@ include_package_data=True, python_requires=">=3.8", install_requires=[ - 'fedelemflowlist @ git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git@path_refactor#egg=fedelemflowlist', - 'esupy @ git+https://github.com/USEPA/esupy.git@refactor_pathlib#egg=esupy', - 'StEWI @ git+https://github.com/USEPA/standardizedinventories.git@urban_rural_classify#egg=StEWI', + 'fedelemflowlist @ git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git@develop#egg=fedelemflowlist', + 'esupy @ git+https://github.com/USEPA/esupy.git@develop#egg=esupy', + 'StEWI @ git+https://github.com/USEPA/standardizedinventories.git@develop#egg=StEWI', 'appdirs>=1.4.3', 'bibtexparser>=1.2.0', "kaleido==0.1.0.post1;platform_system=='Windows'", From 7e3a6c3a1fe49d736e28c6fa03cc38766017797b Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 22 Jun 2023 12:37:58 -0400 Subject: [PATCH 0618/1127] drop outdated use of "inplace" --- flowsa/data_source_scripts/EPA_WFR.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_WFR.py b/flowsa/data_source_scripts/EPA_WFR.py index 466119f39..38de611e3 100644 --- a/flowsa/data_source_scripts/EPA_WFR.py +++ b/flowsa/data_source_scripts/EPA_WFR.py @@ -40,7 +40,7 @@ def epa_wfr_call(*, resp, **_): 'eight', 'K-12 Schools', 'Food Banks', 'Intermediate Amount Managed', 'Total Managed by Each Pathway'], - axis=1, inplace=False) + axis=1) else: df = df_l[0].set_axis( ['Management Pathway', 'Manufacturing/Processing', @@ -48,7 +48,7 @@ def epa_wfr_call(*, resp, **_): 'seven', 'K-12 Schools', 'Food Banks', 'Intermediate Amount Managed', 'Total Managed by Each Pathway'], - axis=1, inplace=False) + axis=1) df = drop_rows(df) df_list.append(df) for d in df_list: @@ -265,7 +265,7 @@ def foodwaste_use(fba: FlowByActivity) -> FlowByActivity: outputs = outputs.drop(columns='ActivityConsumedBy') outputs2 = outputs.aggregate_flowby() - # load fw treatment dictoinary + # load fw treatment dictionary fw_tmt = return_REI_fraction_foodwaste_treated_commodities() replace_keys = {'Animal meal, meat, fats, oils, and tallow': 'Bio-based Materials/Biochemical Processing', 'Anaerobic Digestion': 'Codigestion/Anaerobic Digestion', From 0a8e923d5f7cf0cc79e333e979b9e026ff3b0148 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 22 Jun 2023 12:39:16 -0400 Subject: [PATCH 0619/1127] recursive updates to food_waste_national m1 --- .../Food_Waste_national_2018_m1.yaml | 78 +++++++++++-------- 1 file changed, 45 insertions(+), 33 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m1.yaml b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m1.yaml index 78e0c5f48..f0d2db15f 100644 --- a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m1.yaml @@ -9,7 +9,7 @@ target_naics_year: 2012 geoscale: national source_names: - "EPA_WFR": + EPA_WFR: selection_fields: Class: Other # the below function adds in treated waste and uses REI data to proportionally attribute ABP to ACB @@ -30,7 +30,8 @@ source_names: - "Military Installations" - "Residential" - "Sports Venues" - attribution_method: direct + attribute: + attribution_method: direct employment: selection_fields: PrimaryActivity: @@ -41,38 +42,46 @@ source_names: - "Office Buildings" - "Restaurants/Food Services" - "Retail" - attribution_method: proportional - attribution_source: - Employment_national_2018: - data_format: FBS - year: 2018 + attribute: + attribution_method: proportional + # do not want to attribute the waste management pathways using employment data (SectorConsumedBy) + attribute_on: [SectorProducedBy] + attribution_source: + Employment_national_2018: + year: 2018 establishments: selection_fields: PrimaryActivity: - "Wholesale" - attribution_method: proportional - attribution_source: - "BLS_QCEW": - selection_fields: - Class: "Other" - Location: !include:Location_common.yaml:_national_location - estimate_suppressed: !script_function:temp_data_source_functions estimate_suppressed_sectors_equal_attribution - selection_fields_after_data_suppression_estimation: - FlowName: { - 'Number of establishments, Federal Government': 'Number of establishments', - 'Number of establishments, Local Government': 'Number of establishments', - 'Number of establishments, Private': 'Number of establishments', - 'Number of establishments, State Government': 'Number of establishments' - } # standardize after estimating suppressed + attribute: + attribution_method: proportional + # do not want to attribute the waste management pathways using employment data (SectorConsumedBy) + attribute_on: [SectorProducedBy] + attribution_source: + BLS_QCEW: + selection_fields: + Class: "Other" + Location: !include:Location_common.yaml:_national_location + estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution + selection_fields_after_data_suppression_estimation: + FlowName: { + 'Number of establishments, Federal Government': 'Number of establishments', + 'Number of establishments, Local Government': 'Number of establishments', + 'Number of establishments, Private': 'Number of establishments', + 'Number of establishments, State Government': 'Number of establishments' + } # standardize after estimating suppressed manufacturing: selection_fields: PrimaryActivity: - "Manufacturing/Processing" - attribution_method: proportional - attribution_source: - "Census_ASM": - selection_fields: - Class: "Money" + attribute: + attribution_method: proportional + # do not want to attribute the waste management pathways using employment data (SectorConsumedBy) + attribute_on: [SectorProducedBy] + attribution_source: + Census_ASM: + selection_fields: + Class: Money treated_waste_direct: primary_action_type: Consumed selection_fields: @@ -87,7 +96,8 @@ source_names: - 'Gasoline' - 'Natural gas' - 'Pesticide and other agricultural chemical manufacturing' - attribution_method: direct + attribute: + attribution_method: direct treated_waste_proportional: primary_action_type: Consumed selection_fields: @@ -99,9 +109,11 @@ source_names: - 'Wholesale Trade' - 'Services to buildings and dwellings' - 'Museums, historical sites, zoos, and parks' - attribution_method: proportional - attribution_source: - Employment_national_2018: - data_format: FBS - year: 2018 - primary_action_type: Produced + attribute: + attribution_method: proportional + # do not want to attribute the waste management pathways using employment data (SectorConsumedBy) + attribute_on: [SectorProducedBy] + attribution_source: + Employment_national_2018: + year: 2018 + primary_action_type: Produced From 42a41ad3535bec6d76f9890a0e2e1d0b15c62976 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 22 Jun 2023 12:42:39 -0400 Subject: [PATCH 0620/1127] updates to state land fbs --- .../flowbysectormethods/Land_state_2012.yaml | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Land_state_2012.yaml b/flowsa/methods/flowbysectormethods/Land_state_2012.yaml index 703c806d9..5056534cb 100644 --- a/flowsa/methods/flowbysectormethods/Land_state_2012.yaml +++ b/flowsa/methods/flowbysectormethods/Land_state_2012.yaml @@ -7,42 +7,39 @@ year: 2012 geoscale: state sources_to_cache: - # todo: need to attribute census regions to states + # Attribute national (instead of census regions) to states since regional + # data is only "all buildings" and not broken out by floors EIA_CBECS_Land: &_eia_cbecs_land # commercial land use fedefl_mapping: EIA_CBECS_Land - year: 2012 + geoscale: national selection_fields: Class: Land - Location: !include:Location_common.yaml:_state_location + Location: '00000' clean_fba: !script_function:EIA_CBECS_Land cbecs_land_fba_cleanup + clean_fba_w_sec: !clean_function:flowbyclean attribute_national_to_states + clean_source: Employment_state_2012 activity_sets: cbecs_land: # all activities in eia cbecs land crosswalk selection_fields: - PrimaryActivity: !from_index:EIA_CBECS_Land_2012_asets.csv cbecs_land - attribution_method: proportional - attribution_source: - Employment_state_2012: - data_format: FBS - year: 2012 - # todo: need to attribute national mecs data to states - "EIA_MECS_Land": &_eia_mecs_land # manufacturing land use + PrimaryActivity: !from_index:EIA_CBECS_Land_2012_asets.csv cbecs_land + attribution_method: direct + EIA_MECS_Land: &_eia_mecs_land # manufacturing land use fedefl_mapping: EIA_MECS_Land year: 2014 + geoscale: national selection_fields: Class: Land - Location: !include:Location_common.yaml:_state_location FlowName: "Approximate Enclosed Floorspace of All Buildings Onsite" Year: {2014: 2012} # replace year to align with method year + estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy clean_fba: !script_function:EIA_MECS mecs_land_fba_cleanup + clean_fba_w_sec: !clean_function:flowbyclean attribute_national_to_states + clean_source: Employment_state_2014 activity_sets: mecs_land: # all activities in eia mecs land crosswalk selection_fields: - PrimaryActivity: !from_index:EIA_MECS_Land_2014_asets.csv mecs_land - attribution_method: proportional - attribution_source: - Employment_national_2014: - data_format: FBS - year: 2014 + PrimaryActivity: !from_index:EIA_MECS_Land_2014_asets.csv mecs_land + attribution_method: direct source_names: EIA_CBECS_Land: From 5244dce874f0e2aeb706ae3dd5d0f1612c61acb7 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 22 Jun 2023 12:43:22 -0400 Subject: [PATCH 0621/1127] update indentation --- .../flowbysectormethods/Water_national_2015_m1.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index e3954d864..b9e1dde46 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -40,7 +40,7 @@ sources_to_cache: PrimaryActivity: ['HAY & HAYLAGE, (EXCL ALFALFA)', 'HAY & HAYLAGE, ALFALFA'] source_names: - "USGS_NWIS_WU": + USGS_NWIS_WU: fedefl_mapping: USGS_NWIS_WU geoscale: state clean_fba_before_activity_sets: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup @@ -48,11 +48,11 @@ source_names: direct_attribution: selection_fields: PrimaryActivity: - - "Aquaculture" - - "Irrigation Golf Courses" - - "Public Supply" - - "Thermoelectric Power" - - "Domestic" + - "Aquaculture" + - "Irrigation Golf Courses" + - "Public Supply" + - "Thermoelectric Power" + - "Domestic" attribute: attribution_method: direct employment_attribution: From 6d914da6937b091b585f5374ff905d9aca426af5 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 22 Jun 2023 12:43:55 -0400 Subject: [PATCH 0622/1127] begin converting water m2 to recursive method --- .../Water_national_2015_m2.yaml | 148 +++++++++--------- 1 file changed, 70 insertions(+), 78 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m2.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m2.yaml index a98c0fb0f..137e18c6a 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m2.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m2.yaml @@ -1,81 +1,73 @@ -#%YAML 1.1 -# -#--- -# -#target_sector_level: NAICS_6 -#target_sector_source: NAICS_2012_Code -#target_geoscale: national -#source_names: -# "USGS_NWIS_WU": -# data_format: 'FBA' -# class: Water -# geoscale_to_use: state -# year: 2015 -# clean_fba_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup -# clean_fba_w_sec_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_w_sectors_data_cleanup -# activity_sets: -# activity_set_1: -# names: -# - "Aquaculture" -# - "Irrigation Golf Courses" -# - "Public Supply" -# - "Thermoelectric Power" -# - "Domestic" -# allocation_method: direct -# allocation_source: None -# allocation_source_class: None -# allocation_source_year: None -# allocation_flow: None -# allocation_compartment: None -# allocation_from_scale: state -# activity_set_2: -# names: -# - "Industrial" -# allocation_method: proportional -# allocation_source: "StatCan_IWS_MI" -# allocation_source_class: "Water" -# allocation_source_year: 2015 -# allocation_flow: -# - "Water intake" -# allocation_compartment: None -# allocation_from_scale: national -# clean_allocation_fba: !script_function:StatCan_IWS_MI convert_statcan_data_to_US_water_use -# helper_source: "BLS_QCEW" -# helper_method: proportional -# helper_source_class: "Employment" -# helper_source_year: 2015 -# helper_flow: -# - "Number of employees, Federal Government" -# - "Number of employees, State Government" -# - "Number of employees, Local Government" -# - "Number of employees, Private" -# helper_from_scale: national -# clean_helper_fba_wsec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec -# activity_set_3: -# names: -# - "Mining" -# allocation_method: proportional -# allocation_source: "Blackhurst_IO" -# allocation_source_class: "Water" -# allocation_source_year: 2002 -# allocation_flow: -# - 'Water Withdrawals IO Vector' -# allocation_compartment: None -# allocation_from_scale: national -# clean_allocation_fba: !script_function:Blackhurst_IO convert_blackhurst_data_to_kg_per_year -# clean_allocation_fba_w_sec: !script_function:Blackhurst_IO convert_blackhurst_data_to_kg_per_employee -# helper_source: "BLS_QCEW" -# helper_method: "multiplication and scaled" -# helper_source_class: "Employment" -# helper_source_year: 2015 -# helper_flow: -# - "Number of employees, Federal Government" -# - "Number of employees, State Government" -# - "Number of employees, Local Government" -# - "Number of employees, Private" -# helper_from_scale: national -# clean_helper_fba_wsec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec -# scale_helper_results: !script_function:Blackhurst_IO scale_blackhurst_results_to_usgs_values +industry_spec: + default: NAICS_6 +year: 2015 +target_naics_year: 2012 +geoscale: national + +source_names: + USGS_NWIS_WU: + fedefl_mapping: USGS_NWIS_WU + geoscale: state + selection_fields: + Class: Water # not necessary to define + clean_fba_before_activity_sets: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup + activity_sets: +# direct_attribution: +# selection_fields: +# PrimaryActivity: +# - "Aquaculture" +# - "Irrigation Golf Courses" +# - "Public Supply" +# - "Thermoelectric Power" +# - "Domestic" +# attribute: +# attribution_method: direct + industrial: + selection_fields: + PrimaryActivity: + - "Industrial" + attribute: + attribution_method: proportional + attribution_source: + StatCan_IWS_MI: #todo: convert canadian data to to US FIPS + geoscale: national + selection_fields: + Class: Water + FlowName: "Water intake" + # todo: convert clean fba fxn into this yaml + clean_allocation_fba: !script_function:StatCan_IWS_MI convert_statcan_data_to_US_water_use + attribute: + attribution_method: proportional + attribution_source: + Employment_national_2015: + geoscale: national +# mining: +# selection_fields: +# PrimaryActivity: +# - "Mining" +# attribtute: +# attribution_method: proportional +# attribution_source: +# Blackhurst_IO: +# year: 2002 +# geoscale: national +# selection_fields: +# Class: Water +# FlowName: "Water Withdrawals IO Vector" +# attribute: +# attribution_method: multiplication +# attribution_source: +# BEA_Make_AR: +# year: 2002 +# selection_fields: +# Class: Money +# attribute: +# # todo: make sure attributing on location and activity +# attribution_method: proportional +# attribution_source: +# Employment_national_2002: +# geoscale: national +# clean_fba_after_attribution: !script_function:Blackhurst_IO scale_blackhurst_results_to_usgs_values # activity_set_4: # names: # - "Irrigation Crop" From 94de371c757c47f5a877512f50b1e2d0f1a75282 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 22 Jun 2023 12:49:31 -0400 Subject: [PATCH 0623/1127] add "download_sources_ok" to more of the fxns --- flowsa/flowby.py | 41 +++++++++++++++++++++++------------------ flowsa/flowbyclean.py | 14 +++++++++----- 2 files changed, 32 insertions(+), 23 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index b939aaf04..96f0db0e1 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -601,7 +601,8 @@ def aggregate_flowby( def attribute_flows_to_sectors( self: FB, - external_config_path: str = None + external_config_path: str = None, + download_sources_ok: bool = True ) -> FB: """ The calling FBA has its activities mapped to sectors, then its flows @@ -668,14 +669,16 @@ def attribute_flows_to_sectors( log.info(f"Proportionally attributing {self.full_name} to " f"target sectors with {attribution_name}") attribution_fbs = fb.load_prepare_attribution_source( - attribution_config=step_config + attribution_config=step_config, + download_sources_ok=download_sources_ok ) attributed_fb = fb.proportionally_attribute(attribution_fbs) elif attribution_method == 'multiplication': log.info(f"Multiplying {self.full_name} by {attribution_name}") attribution_fbs = fb.load_prepare_attribution_source( - attribution_config=step_config + attribution_config=step_config, + download_sources_ok=download_sources_ok ) attributed_fb = fb.multiplication_attribution(attribution_fbs) @@ -806,7 +809,8 @@ def activity_sets(self) -> List['FB']: def load_prepare_attribution_source( self: 'FlowByActivity', - attribution_config=None + attribution_config=None, + download_sources_ok: bool = True ) -> 'FlowBySector': if attribution_config is None: @@ -827,7 +831,6 @@ def load_prepare_attribution_source( **get_catalog_info(name), **config } - # attribution_fbs = attribution_fbs.prepare_fbs() else: attribution_fbs = get_flowby_from_config( name=name, @@ -835,8 +838,9 @@ def load_prepare_attribution_source( if k in self.config['method_config_keys'] or k == 'method_config_keys'}, **get_catalog_info(name), - **config} - ).prepare_fbs() + **config}, + download_sources_ok=download_sources_ok + ).prepare_fbs(download_sources_ok=download_sources_ok) return attribution_fbs @@ -1686,10 +1690,6 @@ def map_to_sectors( log.info('Converting NAICS codes to desired industry/sector ' 'aggregation structure.') fba_w_naics = self.copy() - # fba_w_naics = self.assign( - # ActivitySourceName=self.source_name, - # SectorType=np.nan - # ) ^^ I don't think these fields are necessary in this case for direction in ['ProducedBy', 'ConsumedBy']: fba_w_naics = ( fba_w_naics @@ -1928,13 +1928,15 @@ def equally_attribute(self: 'FlowByActivity') -> 'FlowByActivity': def prepare_fbs( self: 'FlowByActivity', - external_config_path: str = None + external_config_path: str = None, + download_sources_ok: bool = True ) -> 'FlowBySector': if 'activity_sets' in self.config: try: return ( pd.concat([ - fba.prepare_fbs(external_config_path=external_config_path) + fba.prepare_fbs( + external_config_path=external_config_path, download_sources_ok=download_sources_ok) for fba in ( self .select_by_fields() @@ -1958,7 +1960,8 @@ def prepare_fbs( .convert_units_and_flows() # and also map to flow lists .function_socket('clean_fba') .convert_to_geoscale() - .attribute_flows_to_sectors(external_config_path=external_config_path) # recursive call to prepare_fbs + .attribute_flows_to_sectors(external_config_path=external_config_path, + download_sources_ok=download_sources_ok) # recursive call to prepare_fbs .drop(columns=['ActivityProducedBy', 'ActivityConsumedBy']) .aggregate_flowby() ) @@ -2217,7 +2220,7 @@ def generateFlowBySector( }, external_config_path=external_config_path, download_sources_ok=download_sources_ok - ).prepare_fbs(external_config_path=external_config_path) + ).prepare_fbs(external_config_path=external_config_path, download_sources_ok=download_sources_ok) ) # ^^^ This is done with a for loop instead of a dict comprehension # so that later entries in method_config['sources_to_cache'] @@ -2237,7 +2240,7 @@ def generateFlowBySector( }, external_config_path=external_config_path, download_sources_ok=download_sources_ok - ).prepare_fbs(external_config_path=external_config_path) + ).prepare_fbs(external_config_path=external_config_path, download_sources_ok=download_sources_ok) for source_name, config in sources.items() ]) @@ -2302,7 +2305,8 @@ def sector_aggregation(self): def prepare_fbs( self: 'FlowBySector', - external_config_path: str = None + external_config_path: str = None, + download_sources_ok: bool = True ) -> 'FlowBySector': if 'activity_sets' in self.config: try: @@ -2325,7 +2329,8 @@ def prepare_fbs( .select_by_fields() .sector_aggregation() # convert to proper industry spec. .convert_fips_to_geoscale() - .attribute_flows_to_sectors() + .attribute_flows_to_sectors(external_config_path=external_config_path, + download_sources_ok=download_sources_ok) .aggregate_flowby() # necessary after consolidating geoscale ) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index f58c5be6b..a7e2b6641 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -24,7 +24,8 @@ def return_primary_activity_column(fba: FlowByActivity) -> \ def load_prepare_clean_source( - self: 'FlowByActivity' + self: 'FlowByActivity', + download_sources_ok: bool = True ) -> 'FlowBySector': (name, config), = self.config['clean_source'].items() @@ -35,13 +36,15 @@ def load_prepare_clean_source( if k in self.config['method_config_keys'] or k == 'method_config_keys'}, **flowby.get_catalog_info(name), - **config} - ).prepare_fbs() + **config}, + download_sources_ok=download_sources_ok + ).prepare_fbs(download_sources_ok=download_sources_ok) return clean_fbs def weighted_average( fba: 'FlowByActivity', + download_sources_ok: bool = True, **kwargs ) -> 'FlowByActivity': """ @@ -49,7 +52,7 @@ def weighted_average( """ # load secondary FBS - other = load_prepare_clean_source(fba) + other = load_prepare_clean_source(fba, download_sources_ok=download_sources_ok) log.info('Taking weighted average of %s by %s.', fba.full_name, other.full_name) @@ -110,6 +113,7 @@ def weighted_average( def substitute_nonexistent_values( fb: 'FlowBy', + download_sources_ok: bool = True, **kwargs ) -> 'FlowBy': """ @@ -117,7 +121,7 @@ def substitute_nonexistent_values( """ # load secondary FBS - other = load_prepare_clean_source(fb) + other = load_prepare_clean_source(fb, download_sources_ok) log.info('Substituting nonexistent values in %s with %s.', fb.full_name, other.full_name) From cd02acf2760a1052b00aebadf23561f9fca45a18 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 22 Jun 2023 12:52:22 -0400 Subject: [PATCH 0624/1127] map sectors to the NAICS year of the data - then convert to target sectors --- flowsa/flowby.py | 27 +++++++++++++++++++------- flowsa/naics.py | 50 ++++++++++++++---------------------------------- 2 files changed, 34 insertions(+), 43 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 96f0db0e1..b474f8090 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1632,12 +1632,14 @@ def map_to_sectors( # load master crosswalk cw = common.load_crosswalk('sector_timeseries') - sectors = (cw[[f'NAICS_{target_year}_Code']] + sectors = (cw[[activity_schema]] .drop_duplicates() .dropna() ) # create list of sectors that exist in original df, which, # if created when expanding sector list cannot be added + # todo: note, both naics6 and naics7 get mapped to naics6 - + # which could result in double counting... naics_df = pd.DataFrame([]) for i in existing_sectors['Sector']: dig = len(str(i)) @@ -1646,7 +1648,7 @@ def map_to_sectors( lambda x: x[0:dig]) == i] if len(n) == 1: expanded_n = sectors[ - sectors[f'NAICS_{target_year}_Code'].apply( + sectors[activity_schema].apply( lambda x: x[0:dig] == i)] expanded_n = expanded_n.assign(Sector=i) naics_df = pd.concat([naics_df, expanded_n]) @@ -1655,9 +1657,9 @@ def map_to_sectors( existing_sectors .merge(naics_df, how='left') .assign(Sector=lambda x: np.where( - x[f'NAICS_{target_year}_Code'].isna(), x['Sector'], - x[f'NAICS_{target_year}_Code'])) - .drop(columns=[f'NAICS_{target_year}_Code']) + x[activity_schema].isna(), x['Sector'], + x[activity_schema])) + .drop(columns=[activity_schema]) ) target_naics = set( @@ -1666,7 +1668,7 @@ def map_to_sectors( activity_to_target_naics_crosswalk = ( activity_to_source_naics_crosswalk - .query('Sector in @target_naics') + .query('Sector in @target_naics') ) fba_w_naics = self @@ -1700,7 +1702,15 @@ def map_to_sectors( .rename(columns={'target_naics': f'Sector{direction}'}) .drop(columns='source_naics') ) - + # if activity schema does not match target naics year, + # convert sectors to target sectors + if activity_schema != f"NAICS_{self.config['target_naics_year']}_Code": + log.info(f"Converting {activity_schema} to NAICS" + f"_{self.config['target_naics_year']}_Code") + fba_w_naics = naics.convert_naics_year( + fba_w_naics, + f"NAICS_{self.config['target_naics_year']}_Code", + activity_schema) else: log.info('Getting crosswalk between activities in %s and ' 'NAICS codes.', self.full_name) @@ -1895,6 +1905,9 @@ def equally_attribute(self: 'FlowByActivity') -> 'FlowByActivity': ''' fba = self.add_primary_secondary_columns('Sector') + # todo: update to use the sector length crosswalk instead of string + # length, or else will have issues with household/government + # attribution groupby_cols = ['group_id'] for rank in ['Primary', 'Secondary']: fba = ( diff --git a/flowsa/naics.py b/flowsa/naics.py index 89a5d39dc..29f8170e6 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -1,9 +1,8 @@ from typing import Literal -import numpy as np import pandas as pd import numpy as np from flowsa.flowbyfunctions import aggregator -from flowsa.flowsa_log import vlog +from flowsa.flowsa_log import vlog, log from . import (common, dataclean, settings) naics_crosswalk = pd.read_csv( @@ -122,7 +121,7 @@ def check_if_sectors_are_naics(df_load, crosswalk_list, column_headers): # create df where sectors do not exist in master crosswalk non_sectors = df_load[~df_load[c].isin(crosswalk_list)] # drop rows where c is empty - non_sectors = non_sectors[non_sectors[c] != ''] + non_sectors = non_sectors[~non_sectors[c].isna()] # subset to just the sector column if len(non_sectors) != 0: sectors = non_sectors[[c]].rename(columns={c: 'NonSectors'}) @@ -137,7 +136,7 @@ def check_if_sectors_are_naics(df_load, crosswalk_list, column_headers): vlog.debug('There are sectors that are not NAICS 2012 Codes') vlog.debug(non_sectors) else: - vlog.debug('All sectors are NAICS 2012 Codes') + log.info('Sectors do not require conversion') return non_sectors @@ -181,20 +180,18 @@ def melt_naics_crosswalk(): return cw_replacement_2 -def convert_naics_year(df_load, sectorsourcename): +def convert_naics_year(df, targetsectorsourcename, sectorsourcename): """ Replace any non sectors with sectors. :param df_load: df with sector columns or sector-like activities :param sectorsourcename: str, sector source name (ex. NAICS_2012_Code) :return: df, with non-sectors replaced with sectors """ - # drop NoneType - df = dataclean.replace_NoneType_with_empty_cells(df_load).reset_index(drop=True) - # load the mastercroswalk and subset by sectorsourcename, # save values to list - cw_load = common.load_crosswalk('sector_timeseries') - cw = cw_load[sectorsourcename].drop_duplicates().tolist() + cw_load = common.load_crosswalk('sector_timeseries')[[ + targetsectorsourcename, sectorsourcename]] + cw = cw_load[targetsectorsourcename].drop_duplicates().tolist() # load melted crosswalk cw_melt = melt_naics_crosswalk() @@ -214,7 +211,7 @@ def convert_naics_year(df_load, sectorsourcename): # not in crosswalk list if len(non_naics) != 0: vlog.debug('Checking if sectors represent a different ' - f'NAICS year, if so, replace with {sectorsourcename}') + f'NAICS year, if so, replace with {targetsectorsourcename}') for c in column_headers: # merge df with the melted sector crosswalk df = df.merge(cw_melt, left_on=c, right_on='NAICS', how='left') @@ -223,18 +220,18 @@ def convert_naics_year(df_load, sectorsourcename): # column c is in the non_naics list df[c] = np.where( (df[c] == df['NAICS']) & (df[c].isin(non_naics)), - df[sectorsourcename], df[c]) + df[targetsectorsourcename], df[c]) # multiply the FlowAmount col by allocation_ratio - df.loc[df[c] == df[sectorsourcename], + df.loc[df[c] == df[targetsectorsourcename], 'FlowAmount'] = df['FlowAmount'] * df['allocation_ratio'] # drop columns df = df.drop( - columns=[sectorsourcename, 'NAICS', 'allocation_ratio']) - vlog.debug(f'Replaced NAICS with {sectorsourcename}') + columns=[targetsectorsourcename, 'NAICS', 'allocation_ratio']) + vlog.debug(f'Replaced NAICS with {targetsectorsourcename}') # check if there are any sectors that are not in - # the naics 2012 crosswalk - vlog.debug('Check again for non NAICS 2012 Codes') + # the target sector crosswalk + vlog.debug(f'Check again for non {targetsectorsourcename}') nonsectors = check_if_sectors_are_naics(df, cw, column_headers) if len(nonsectors) != 0: vlog.debug('Dropping non-NAICS from dataframe') @@ -251,23 +248,4 @@ def convert_naics_year(df_load, sectorsourcename): if e not in possible_column_headers] df = aggregator(df, groupby_cols) - df = dataclean.replace_strings_with_NoneType(df) - # drop rows where both SectorConsumedBy and SectorProducedBy NoneType - if 'SectorConsumedBy' in df: - df_drop = df[(df['SectorConsumedBy'].isnull()) & - (df['SectorProducedBy'].isnull())] - if len(df_drop) != 0: - activities_dropped = pd.unique( - df_drop[['ActivityConsumedBy', - 'ActivityProducedBy']].values.ravel('K')) - activities_dropped = list(filter( - lambda x: x is not None, activities_dropped)) - vlog.debug('Dropping rows where the Activity columns ' - f'contain {", ".join(activities_dropped)}') - df = df[~((df['SectorConsumedBy'].isnull()) & - (df['SectorProducedBy'].isnull()))].reset_index(drop=True) - else: - df = df[~((df['ActivityConsumedBy'].isnull()) & - (df['ActivityProducedBy'].isnull()))].reset_index(drop=True) - return df From 07b36ce1a4a3a8fc631aee1a93d2c78899699dee Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 22 Jun 2023 12:53:12 -0400 Subject: [PATCH 0625/1127] new fxn attribute_national_to_states() --- flowsa/flowbyclean.py | 57 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index a7e2b6641..67d1da508 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -2,7 +2,7 @@ import pandas as pd from flowsa.flowby import FlowByActivity, FlowBySector from flowsa.flowsa_log import log -from flowsa import (flowby, geo, location) +from flowsa import (flowby, geo, location, getFlowBySector, flowbyfunctions) def return_primary_activity_column(fba: FlowByActivity) -> \ @@ -247,5 +247,58 @@ def fill_suppressed( .aggregate_flowby() ) - return aggregated + + +def attribute_national_to_states(fba: FlowByActivity, **_) -> FlowByActivity: + """ + Propogates national data to all states to enable for use in state methods. + Allocates sectors across states based on employment. + clean_allocation_fba_w_sec fxn + """ + fba_load = fba.copy() + log.info('Attributing national data to states') + + # Attribute data source based on attribution source + # todo: generalize so works for FBA or FBS + hlp = getFlowBySector( + methodname=fba.config.get('clean_source'), + download_FBS_if_missing=True) + + # To match the sector resolution of source data, generate employment + # dataset for all NAICS resolution by aggregating + hlp = flowbyfunctions.sector_aggregation(hlp) + + # For each region, generate ratios across states for a given sector + hlp['Allocation'] = hlp['FlowAmount']/hlp.groupby( + ['SectorProducedBy', 'SectorConsumedBy'], + dropna=False).FlowAmount.transform('sum') + + # add column to merge on + hlp = hlp.assign(Location_merge='00000') + + # todo: generalize so works for data sources other than employment FBS + fba = pd.merge( + fba.rename(columns={'Location': 'Location_merge'}), + (hlp[['Location_merge', 'Location', 'SectorProducedBy', 'Allocation']] + .rename(columns={'SectorProducedBy': 'SectorConsumedBy'})), + how='left', on=['Location_merge', 'SectorConsumedBy']) + fba = (fba.assign(FlowAmount=lambda x: x['FlowAmount'] * x['Allocation']) + .drop(columns=['Allocation', 'Location_merge']) + ) + + # Rest group_id and group_total + fba = ( + fba + .drop(columns=['group_id', 'group_total']) + .reset_index(drop=True).reset_index() + .rename(columns={'index': 'group_id'}) + .assign(group_total=fba.FlowAmount) + ) + + # Check for data loss + if (abs(1-(sum(fba['FlowAmount']) / + sum(fba_load['FlowAmount'])))) > 0.0005: + log.warning('Data loss upon census region mapping') + + return fba From 14507968251b21441cd0fc3421ad4ad491e94d0b Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 22 Jun 2023 12:53:54 -0400 Subject: [PATCH 0626/1127] drop use of fxns replace_NoneType_with_empty_cells and replace_strings_with_NoneType --- flowsa/flowbyfunctions.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/flowsa/flowbyfunctions.py b/flowsa/flowbyfunctions.py index cc9f509b6..565c61d1a 100644 --- a/flowsa/flowbyfunctions.py +++ b/flowsa/flowbyfunctions.py @@ -225,8 +225,7 @@ def sector_aggregation(df_load, return_all_possible_sector_combos=False, for SectorProducedBy and SectorConsumedBy :return: df, with aggregated sector values """ - # ensure None values are not strings - df = replace_NoneType_with_empty_cells(df_load) + df = df_load.copy() # determine grouping columns - based on datatype group_cols = list(df.select_dtypes(include=['object', 'int']).columns) @@ -290,10 +289,7 @@ def sector_aggregation(df_load, return_all_possible_sector_combos=False, df = df.assign(ActivityProducedBy=df['SectorProducedBy']) df = df.assign(ActivityConsumedBy=df['SectorConsumedBy']) - # replace null values - df = replace_strings_with_NoneType(df).reset_index(drop=True) - - return df + return df.reset_index(drop=True) def append_new_sectors(df, i, j, cw_load, group_cols): From 8c94884ef410a7274360b1e309e59ac969e1739b Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 22 Jun 2023 12:55:54 -0400 Subject: [PATCH 0627/1127] skip comparing geoscale totals if the df unit is a rate --- flowsa/validation.py | 109 ++++++++++++++++++++++--------------------- 1 file changed, 57 insertions(+), 52 deletions(-) diff --git a/flowsa/validation.py b/flowsa/validation.py index 1881fa3d9..622183d20 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -691,59 +691,64 @@ def compare_geographic_totals( drop=True).rename(columns={'FlowAmount': 'FlowAmount_nat'}) # if df len is not 0, continue with comparison if len(nat) != 0: - # subset national level data by activity set names - nat = nat[(nat[fba_activity_fields[0]].isin(activity_names)) | - (nat[fba_activity_fields[1]].isin(activity_names) - )].reset_index(drop=True) - nat = replace_strings_with_NoneType(nat) - # drop the geoscale in df_subset and sum - sub = df_subset.assign(Location=US_FIPS) - # depending on the datasource, might need to rename some - # strings for national comparison - sub = rename_column_values_for_comparison(sub, sourcename) - - # compare df - merge_cols = ['Class', 'SourceName', 'Unit', 'FlowType', - 'ActivityProducedBy', 'ActivityConsumedBy', - 'Location', 'LocationSystem', 'Year'] - - if df_type == 'FBA': - merge_cols.extend(['FlowName', 'Compartment']) + # if the unit is a rate, do not compare + if '/' in nat['Unit'][0]: + log.info(f"Skipping geoscale comparison because {nat['Unit'][0]} " + f"is a rate.") else: - merge_cols.extend(['Flowable', 'Context']) - - sub2 = aggregator(sub, merge_cols).rename( - columns={'FlowAmount': 'FlowAmount_sub'}) - - # compare units - compare_df_units(nat, sub2) - df_m = pd.merge(nat[merge_cols + ['FlowAmount_nat']], - sub2[merge_cols + ['FlowAmount_sub']], - how='outer') - df_m = df_m.assign( - FlowAmount_diff=df_m['FlowAmount_nat'] - df_m['FlowAmount_sub']) - df_m = df_m.assign(Percent_Diff=(abs(df_m['FlowAmount_diff'] / - df_m['FlowAmount_nat']) * 100)) - df_m = df_m[df_m['FlowAmount_diff'] != 0].reset_index(drop=True) - # subset the merged df to what to include in the validation df - # include data where percent difference is > 1 or where value is nan - df_m_sub = df_m[(df_m['Percent_Diff'] > 1) | - (df_m['Percent_Diff'].isna())].reset_index(drop=True) - - subnational_geoscale = (subnational_geoscale - or attr['allocation_from_scale']) - if len(df_m_sub) == 0: - vlog.info(f'No data loss greater than 1%% between national ' - f'level data and {subnational_geoscale} subset') - else: - vlog.info(f'There are data differences between published national ' - f'values and {subnational_geoscale} subset, ' - f'saving to validation log') - - vlog.info( - 'Comparison of National FlowAmounts to aggregated data ' - 'subset for %s: \n {}'.format( - df_m_sub.to_string()), activity_set) + # subset national level data by activity set names + nat = nat[(nat[fba_activity_fields[0]].isin(activity_names)) | + (nat[fba_activity_fields[1]].isin(activity_names) + )].reset_index(drop=True) + nat = replace_strings_with_NoneType(nat) + # drop the geoscale in df_subset and sum + sub = df_subset.assign(Location=US_FIPS) + # depending on the datasource, might need to rename some + # strings for national comparison + sub = rename_column_values_for_comparison(sub, sourcename) + + # compare df + merge_cols = ['Class', 'SourceName', 'Unit', 'FlowType', + 'ActivityProducedBy', 'ActivityConsumedBy', + 'Location', 'LocationSystem', 'Year'] + + if df_type == 'FBA': + merge_cols.extend(['FlowName', 'Compartment']) + else: + merge_cols.extend(['Flowable', 'Context']) + + sub2 = aggregator(sub, merge_cols).rename( + columns={'FlowAmount': 'FlowAmount_sub'}) + + # compare units + compare_df_units(nat, sub2) + df_m = pd.merge(nat[merge_cols + ['FlowAmount_nat']], + sub2[merge_cols + ['FlowAmount_sub']], + how='outer') + df_m = df_m.assign( + FlowAmount_diff=df_m['FlowAmount_nat'] - df_m['FlowAmount_sub']) + df_m = df_m.assign(Percent_Diff=(abs(df_m['FlowAmount_diff'] / + df_m['FlowAmount_nat']) * 100)) + df_m = df_m[df_m['FlowAmount_diff'] != 0].reset_index(drop=True) + # subset the merged df to what to include in the validation df + # include data where percent difference is > 1 or where value is nan + df_m_sub = df_m[(df_m['Percent_Diff'] > 1) | + (df_m['Percent_Diff'].isna())].reset_index(drop=True) + + subnational_geoscale = (subnational_geoscale + or attr['allocation_from_scale']) + if len(df_m_sub) == 0: + vlog.info(f'No data loss greater than 1%% between national ' + f'level data and {subnational_geoscale} subset') + else: + vlog.info(f'There are data differences between published national ' + f'values and {subnational_geoscale} subset, ' + f'saving to validation log') + + vlog.info( + 'Comparison of National FlowAmounts to aggregated data ' + 'subset for %s: \n {}'.format( + df_m_sub.to_string()), activity_set) def rename_column_values_for_comparison(df, sourcename): From de6f2d5d02a7bf81c8768e0e958ebe9cce661198 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 23 Jun 2023 16:03:48 -0400 Subject: [PATCH 0628/1127] update file paths --- flowsa/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/common.py b/flowsa/common.py index a5ce430bf..02cebb25c 100644 --- a/flowsa/common.py +++ b/flowsa/common.py @@ -53,12 +53,12 @@ def load_env_file_key(env_file, key): :return: str, value of the key stored in the env """ if env_file == 'API_Key': - load_dotenv(f'{MODULEPATH}API_Keys.env', verbose=True) + load_dotenv(f'{MODULEPATH}/API_Keys.env', verbose=True) value = os.getenv(key) if value is None: raise flowsa.exceptions.APIError(api_source=key) else: - load_dotenv(f'{MODULEPATH}external_paths.env', verbose=True) + load_dotenv(f'{MODULEPATH}/external_paths.env', verbose=True) value = os.getenv(key) if value is None: raise flowsa.exceptions.EnvError(key=key) From 1ad358eb4f19876bd0b416d9a102b6532f6787fd Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 23 Jun 2023 16:04:22 -0400 Subject: [PATCH 0629/1127] add employment national 2010 --- .../flowbysectormethods/Employment_national_2010.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/Employment_national_2010.yaml diff --git a/flowsa/methods/flowbysectormethods/Employment_national_2010.yaml b/flowsa/methods/flowbysectormethods/Employment_national_2010.yaml new file mode 100644 index 000000000..0304f87b4 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/Employment_national_2010.yaml @@ -0,0 +1,10 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: national + +source_names: + "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_national + year: 2010 + activity_sets: + qcew: !include:Employment_common.yaml:bls_allocation \ No newline at end of file From 4759419486591569bf8694e6a4577c4a44f4bba0 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 23 Jun 2023 17:12:23 -0400 Subject: [PATCH 0630/1127] add state employment and specify employment FBS only contains employment data --- flowsa/data/source_catalog.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index e7b1528dc..9d40450ed 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -153,10 +153,12 @@ EIA_SEDS: sector_hierarchy: "flat" Employment_national: data_format: FBS - class: - - Employment - - Money - - Other + class: Employment + activity_schema: NAICS_2012_Code + sector_hierarchy: "parent-completeChild" +Employment_state: + data_format: FBS + class: Employment activity_schema: NAICS_2012_Code sector_hierarchy: "parent-completeChild" EPA_CDDPath: From c68262961814fc5a08a4d2a6ab60ac4eff7585f7 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 23 Jun 2023 17:12:48 -0400 Subject: [PATCH 0631/1127] move water m1 into common file - working versions of recursive water m1 for 2010, 2015 national and 2015 state --- .../flowbysectormethods/Water_common.yaml | 228 ++++++++++++++++++ .../Water_national_2010_m1.yaml | 130 ++++------ .../Water_national_2015_m1.yaml | 153 +----------- .../Water_state_2015_m1.yaml | 125 ++++------ 4 files changed, 322 insertions(+), 314 deletions(-) create mode 100644 flowsa/methods/flowbysectormethods/Water_common.yaml diff --git a/flowsa/methods/flowbysectormethods/Water_common.yaml b/flowsa/methods/flowbysectormethods/Water_common.yaml new file mode 100644 index 000000000..7346119b3 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/Water_common.yaml @@ -0,0 +1,228 @@ +# This is the general method reference file for method 1 water attribution. +# Year- and geographic-specific Water files import this file to define +# attribution rules that are further customized + +# Do not use all activity sets for USGS_NWIS_WU because there are activity +# sets for 3 methods. Instead, specifically call each activity set. + +industry_spec: + default: NAICS_6 +# year: 2015 # specify in year-specific yaml +target_naics_year: 2012 +# geoscale: national # specify target geoscale in each method yaml + +sources_to_cache: + USDA_IWMS: + industry_spec: + default: NAICS_6 + NAICS_7: ['111150', '111199', '111940'] # hay and haylage set to NAICS7 - will update to NAICS6 + geoscale: state + # year: 2018 # specify in year-specific yaml + selection_fields: + Class: Water + attribute: + - attribution_method: inheritance + clean_fba_after_attribution: !clean_function:flowbyclean substitute_nonexistent_values + clean_source: + USDA_IWMS: + geoscale: national + # year: 2018 # specify in year-specific yaml + selection_fields: + Class: Water + attribute: + attribution_method: inheritance + - attribution_method: direct + clean_fba_after_attribution: !clean_function:flowbyclean weighted_average + replacement_dictionary: {'HAY & HAYLAGE, (EXCL ALFALFA)': 'HAY & HAYLAGE', + 'HAY & HAYLAGE, ALFALFA': 'HAY & HAYLAGE', + '111940A': '111940', + '111940B': '111940'} + clean_source: + USDA_IWMS: + # year: 2018 # specify in year-specific yaml + selection_fields: + Class: Land + PrimaryActivity: ['HAY & HAYLAGE, (EXCL ALFALFA)', 'HAY & HAYLAGE, ALFALFA'] + +source_names: + USGS_NWIS_WU: + fedefl_mapping: USGS_NWIS_WU + geoscale: state + clean_fba_before_activity_sets: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup + activity_sets: + + direct_attribution: # use in m1, m2, m3 + selection_fields: + PrimaryActivity: + - "Aquaculture" + - "Irrigation Golf Courses" + - "Public Supply" + - "Thermoelectric Power" + - "Domestic" + attribute: + attribution_method: direct + + + employment_attribution: # use in m1 + selection_fields: + PrimaryActivity: + - "Industrial" + - "Mining" + attribute: + attribution_method: proportional + # attribution_source: Employment_national_2015 # specify in year-specific yaml + + + industrial_attribution: # use in m2 (instead of employment_attribution) + selection_fields: + PrimaryActivity: + - "Industrial" + attribute: + attribution_method: proportional + attribution_source: + StatCan_IWS_MI: #todo: convert canadian data to to US FIPS + geoscale: national + selection_fields: + Class: Water + FlowName: "Water intake" + # todo: convert clean fba fxn into this yaml + clean_allocation_fba: !script_function:StatCan_IWS_MI convert_statcan_data_to_US_water_use + attribute: + attribution_method: proportional + attribution_source: + Employment_national_2015: + geoscale: national + + + mining_attribution: # use in m2 (instead of employment_attribution) + selection_fields: + PrimaryActivity: + - "Mining" + attribute: + attribution_method: proportional + attribution_source: + Blackhurst_IO: + year: 2002 + geoscale: national + selection_fields: + Class: Water + FlowName: "Water Withdrawals IO Vector" + attribute: + attribution_method: multiplication + attribution_source: + BEA_Make_AR: + year: 2002 + selection_fields: + Class: Money + attribute: + # todo: make sure attributing on location and activity + attribution_method: proportional + attribution_source: + Employment_national_2002: + geoscale: national + clean_fba_after_attribution: !script_function:Blackhurst_IO scale_blackhurst_results_to_usgs_values + + + cropland_attribution: # use in m1, m2 + industry_spec: + default: NAICS_6 + NAICS_7: ['111150', '111199'] + selection_fields: + PrimaryActivity: + - "Irrigation Crop" + attribute: + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland: + # year: 2017 # specify in year-specific yaml + selection_fields: + Class: "Land" + FlowName: + - "AREA HARVESTED, IRRIGATED" + - "AREA IN PRODUCTION, IRRIGATED" + - "AREA, IRRIGATED" + - 'AREA BEARING & NON-BEARING, IRRIGATED' + - 'AREA GROWN, IRRIGATED' + exclusion_fields: + ActivityConsumedBy: + - 'AG LAND' + - 'AG LAND, CROPLAND, HARVESTED' + activity_sets: + cropland_attribution-pastureland: + selection_fields: + PrimaryActivity: 'AG LAND, (EXCL HARVESTED CROPLAND)' + attribute: + - attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + # year: 2017 # specify in year-specific yaml + selection_fields: + Class: Land + FlowName: + - "FARM OPERATIONS" + estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution + selection_fields_after_data_suppression_estimation: + PrimaryActivity: [ + '112', '1121', '11211', '112111', '112112', + '11212', '1122', '1123', '11231', '11232', + '11233', '11234', '11239', '1124', '11241', + '11242', '1129', '11291', '11292', '11293', + '11299'] + - attribution_method: multiplication + attribution_source: USDA_IWMS + cropland_attribution-cropland: + exclusion_fields: + ActivityConsumedBy: + - 'AG LAND, (EXCL HARVESTED CROPLAND)' + - 'ORCHARDS' + attribute: + - attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + # year: 2017 # specify in year-specific yaml + selection_fields: + Class: Land + FlowName: + - "AG LAND, CROPLAND, HARVESTED" + estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution + - attribution_method: multiplication + attribution_source: USDA_IWMS + cropland_attribution-orchards: + selection_fields: + PrimaryActivity: ORCHARDS + attribute: + # first directly attribute so orchards are equally attributed to related sectors + - attribution_method: direct + - attribution_method: multiplication + attribution_source: USDA_IWMS + + + livestock_attribution: # use in m1, m2 + industry_spec: + default: NAICS_6 + NAICS_7: ['112130', '112320', '112390', '112910', + '112920', '112930', '112990'] + selection_fields: + PrimaryActivity: + - "Livestock" + attribute: + attribution_method: proportional + attribution_source: + USDA_CoA_Livestock: + # year: 2017 # specify in year-specific yaml + selection_fields: + Class: Other + FlowName: + - "HEAD" + - "NUMBER" + - "COLONIES" + Compartment: + - "NOT SPECIFIED" + attribute: + attribution_method: multiplication + attribution_source: + USGS_WU_Coef: + year: 2005 + geoscale: national + attribute: + attribution_method: inheritance diff --git a/flowsa/methods/flowbysectormethods/Water_national_2010_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2010_m1.yaml index 97961bf5f..536bcaf03 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2010_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2010_m1.yaml @@ -1,89 +1,41 @@ -#%YAML 1.2 -# -#--- -# -#target_sector_level: NAICS_6 -#target_sector_source: NAICS_2012_Code -#target_geoscale: national -#source_names: -# "USGS_NWIS_WU": -# data_format: 'FBA' -# class: Water -# geoscale_to_use: state -# year: 2010 -# clean_fba_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup -# clean_fba_w_sec_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_w_sectors_data_cleanup -# activity_sets: -# activity_set_1: -# names: -# - "Aquaculture" -# - "Irrigation Golf Courses" -# - "Public Supply" -# - "Thermoelectric Power" -# - "Domestic" -# allocation_method: direct -# allocation_source: None -# allocation_source_class: None -# allocation_source_year: None -# allocation_flow: None -# allocation_compartment: None -# allocation_from_scale: state -# activity_set_2: -# names: -# - "Industrial" -# - "Mining" -# allocation_method: proportional -# allocation_source: "BLS_QCEW" -# allocation_source_class: "Employment" -# allocation_source_year: 2010 -# allocation_flow: -# - "Number of employees, Federal Government" -# - "Number of employees, State Government" -# - "Number of employees, Local Government" -# - "Number of employees, Private" -# allocation_compartment: None -# allocation_from_scale: national -# clean_allocation_fba_w_sec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec -# activity_set_3: -# names: -# - "Irrigation Crop" -# allocation_method: proportional -# allocation_source: "USDA_CoA_Cropland" -# allocation_source_class: "Land" -# allocation_source_year: 2012 -# allocation_flow: -# - "AREA HARVESTED, IRRIGATED" -# - "AREA IN PRODUCTION, IRRIGATED" -# - "AREA, IRRIGATED" -# - 'AREA BEARING & NON-BEARING, IRRIGATED' -# - 'AREA GROWN, IRRIGATED' -# allocation_compartment: None -# allocation_from_scale: state -# clean_allocation_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics_for_water_withdrawal -# helper_source: "USDA_IWMS" -# helper_method: multiplication -# helper_source_class: "Water" -# helper_source_year: 2013 -# helper_flow: None -# helper_from_scale: state -# clean_helper_fba_wsec: !script_function:USDA_IWMS iwms_aggregation -# activity_set_4: -# names: -# - "Livestock" -# allocation_method: proportional -# allocation_source: "USDA_CoA_Livestock" -# allocation_source_class: "Other" -# allocation_source_year: 2012 -# allocation_flow: -# - "HEAD" -# - "NUMBER" -# - "COLONIES" -# allocation_compartment: -# - "NOT SPECIFIED" -# allocation_from_scale: state -# helper_source: "USGS_WU_Coef" -# helper_method: multiplication -# helper_source_class: "Water" -# helper_source_year: 2005 -# helper_flow: None -# helper_from_scale: national +# This is the 2010 target year method for water m1 which builds off the generic +# method in Water_common + +industry_spec: + default: NAICS_6 +year: 2010 +target_naics_year: 2012 +geoscale: national + +sources_to_cache: + USDA_IWMS: + !include:Water_common.yaml:sources_to_cache:USDA_IWMS + year: 2013 + +source_names: + USGS_NWIS_WU: + !include:Water_common.yaml:source_names:USGS_NWIS_WU + activity_sets: # do not import all activity sets from the common file because common file contains activity sets for multiple methods + direct_attribution: + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:direct_attribution + employment_attribution: + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:employment_attribution + attribute: + attribution_method: proportional + attribution_source: Employment_national_2010 + cropland_attribution: + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution + attribute: + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland: + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution:attribute:attribution_source:USDA_CoA_Cropland + year: 2012 + livestock_attribution: + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:livestock_attribution + attribute: + attribution_method: proportional + attribution_source: + USDA_CoA_Livestock: + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:livestock_attribution:attribute:attribution_source:USDA_CoA_Livestock + year: 2012 diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index b9e1dde46..917b279eb 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -1,4 +1,5 @@ -# Attribute USGS NWIS water withdrawal to sectors. +# This is the 2015 target year method for water m1 which builds off the generic +# method in Water_common industry_spec: default: NAICS_6 @@ -8,163 +9,33 @@ geoscale: national sources_to_cache: USDA_IWMS: - industry_spec: - default: NAICS_6 - NAICS_7: ['111150', '111199', '111940'] # hay and haylage set to NAICS7 - will update to NAICS6 - geoscale: state + !include:Water_common.yaml:sources_to_cache:USDA_IWMS year: 2018 - selection_fields: - Class: Water - attribute: - - attribution_method: inheritance - clean_fba_after_attribution: !clean_function:flowbyclean substitute_nonexistent_values - clean_source: - USDA_IWMS: - geoscale: national - year: 2018 - selection_fields: - Class: Water - attribute: - attribution_method: inheritance - - attribution_method: direct - clean_fba_after_attribution: !clean_function:flowbyclean weighted_average - replacement_dictionary: {'HAY & HAYLAGE, (EXCL ALFALFA)': 'HAY & HAYLAGE', - 'HAY & HAYLAGE, ALFALFA': 'HAY & HAYLAGE', - '111940A': '111940', - '111940B': '111940'} - clean_source: - USDA_IWMS: - year: 2018 - selection_fields: - Class: Land - PrimaryActivity: ['HAY & HAYLAGE, (EXCL ALFALFA)', 'HAY & HAYLAGE, ALFALFA'] source_names: USGS_NWIS_WU: - fedefl_mapping: USGS_NWIS_WU - geoscale: state - clean_fba_before_activity_sets: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup - activity_sets: + !include:Water_common.yaml:source_names:USGS_NWIS_WU + activity_sets: # do not import all activity sets from the common file because common file contains activity sets for multiple methods direct_attribution: - selection_fields: - PrimaryActivity: - - "Aquaculture" - - "Irrigation Golf Courses" - - "Public Supply" - - "Thermoelectric Power" - - "Domestic" - attribute: - attribution_method: direct + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:direct_attribution employment_attribution: - selection_fields: - PrimaryActivity: - - "Industrial" - - "Mining" + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:employment_attribution attribute: attribution_method: proportional - attribution_source: - Employment_national_2015: - geoscale: national - data_format: FBS - year: 2015 + attribution_source: Employment_national_2015 cropland_attribution: - industry_spec: - default: NAICS_6 - NAICS_7: ['111150', '111199'] - selection_fields: - PrimaryActivity: - - "Irrigation Crop" + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution attribute: attribution_method: proportional attribution_source: USDA_CoA_Cropland: + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution:attribute:attribution_source:USDA_CoA_Cropland year: 2017 - selection_fields: - Class: "Land" - FlowName: - - "AREA HARVESTED, IRRIGATED" - - "AREA IN PRODUCTION, IRRIGATED" - - "AREA, IRRIGATED" - - 'AREA BEARING & NON-BEARING, IRRIGATED' - - 'AREA GROWN, IRRIGATED' - exclusion_fields: - ActivityConsumedBy: - - 'AG LAND' - - 'AG LAND, CROPLAND, HARVESTED' - activity_sets: - cropland_attribution-pastureland: - selection_fields: - PrimaryActivity: 'AG LAND, (EXCL HARVESTED CROPLAND)' - attribute: - - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland_NAICS: - year: 2017 - selection_fields: - Class: Land - FlowName: - - "FARM OPERATIONS" - estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution - selection_fields_after_data_suppression_estimation: - PrimaryActivity: [ - '112', '1121', '11211', '112111', '112112', - '11212', '1122', '1123', '11231', '11232', - '11233', '11234', '11239', '1124', '11241', - '11242', '1129', '11291', '11292', '11293', - '11299'] - - attribution_method: multiplication - attribution_source: USDA_IWMS - cropland_attribution-cropland: - exclusion_fields: - ActivityConsumedBy: - - 'AG LAND, (EXCL HARVESTED CROPLAND)' - - 'ORCHARDS' - attribute: - - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland_NAICS: - year: 2017 - selection_fields: - Class: Land - FlowName: - - "AG LAND, CROPLAND, HARVESTED" - estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution - - attribution_method: multiplication - attribution_source: USDA_IWMS - cropland_attribution-orchards: - selection_fields: - PrimaryActivity: ORCHARDS - attribute: - # first directly attribute so orchards are equally attributed to related sectors - - attribution_method: direct - - attribution_method: multiplication - attribution_source: USDA_IWMS livestock_attribution: - industry_spec: - default: NAICS_6 - NAICS_7: ['112130', '112320', '112390', '112910', - '112920', '112930', '112990'] - selection_fields: - PrimaryActivity: - - "Livestock" + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:livestock_attribution attribute: attribution_method: proportional attribution_source: USDA_CoA_Livestock: + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:livestock_attribution:attribute:attribution_source:USDA_CoA_Livestock year: 2017 - selection_fields: - Class: Other - FlowName: - - "HEAD" - - "NUMBER" - - "COLONIES" - Compartment: - - "NOT SPECIFIED" - attribute: - attribution_method: multiplication - attribution_source: - USGS_WU_Coef: - year: 2005 - geoscale: national - attribute: - attribution_method: inheritance diff --git a/flowsa/methods/flowbysectormethods/Water_state_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_state_2015_m1.yaml index d266b5301..4e9f024a0 100644 --- a/flowsa/methods/flowbysectormethods/Water_state_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_state_2015_m1.yaml @@ -1,84 +1,41 @@ -#!include:USEEIO_summary_target.yaml -#target_geoscale: state -#source_names: -# "USGS_NWIS_WU": -# data_format: 'FBA' -# class: Water -# geoscale_to_use: state -# year: 2015 -# clean_fba_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup -# clean_fba_w_sec_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_w_sectors_data_cleanup -# activity_sets: -# activity_set_1: -# names: -# - "Aquaculture" -# - "Irrigation Golf Courses" -# - "Public Supply" -# - "Thermoelectric Power" -# - "Domestic" -# allocation_method: direct -# allocation_source: None -# allocation_source_class: None -# allocation_source_year: None -# allocation_flow: None -# allocation_compartment: None -# allocation_from_scale: state -# activity_set_2: -# names: -# - "Industrial" -# - "Mining" -# allocation_method: proportional -# allocation_source: "BLS_QCEW" -# allocation_source_class: "Employment" -# allocation_source_year: 2015 -# allocation_flow: -# - "Number of employees, Federal Government" -# - "Number of employees, State Government" -# - "Number of employees, Local Government" -# - "Number of employees, Private" -# allocation_compartment: None -# allocation_from_scale: state -# clean_allocation_fba_w_sec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec -# activity_set_3: -# names: -# - "Irrigation Crop" -# allocation_method: proportional -# allocation_source: "USDA_CoA_Cropland" -# allocation_source_class: "Land" -# allocation_source_year: 2017 -# allocation_flow: -# - "AREA HARVESTED, IRRIGATED" -# - "AREA IN PRODUCTION, IRRIGATED" -# - "AREA, IRRIGATED" -# - 'AREA BEARING & NON-BEARING, IRRIGATED' -# - 'AREA GROWN, IRRIGATED' -# allocation_compartment: None -# allocation_from_scale: state -# clean_allocation_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics_for_water_withdrawal -# helper_source: "USDA_IWMS" -# helper_method: multiplication -# helper_source_class: "Water" -# helper_source_year: 2018 -# helper_flow: None -# helper_from_scale: state -# clean_helper_fba_wsec: !script_function:USDA_IWMS iwms_aggregation -# activity_set_4: -# names: -# - "Livestock" -# allocation_method: proportional -# allocation_source: "USDA_CoA_Livestock" -# allocation_source_class: "Other" -# allocation_source_year: 2017 -# allocation_flow: -# - "HEAD" -# - "NUMBER" -# - "COLONIES" -# allocation_compartment: -# - "NOT SPECIFIED" -# allocation_from_scale: state -# helper_source: "USGS_WU_Coef" -# helper_method: multiplication -# helper_source_class: "Water" -# helper_source_year: 2005 -# helper_flow: None -# helper_from_scale: national +# This is the 2015 target year method for water m1 which builds off the generic +# method in Water_common + +industry_spec: + default: NAICS_6 +year: 2015 +target_naics_year: 2012 +geoscale: state + +sources_to_cache: + USDA_IWMS: + !include:Water_common.yaml:sources_to_cache:USDA_IWMS + year: 2018 + +source_names: + USGS_NWIS_WU: + !include:Water_common.yaml:source_names:USGS_NWIS_WU + activity_sets: # do not import all activity sets from the common file because common file contains activity sets for multiple methods + direct_attribution: + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:direct_attribution + employment_attribution: + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:employment_attribution + attribute: + attribution_method: proportional + attribution_source: Employment_state_2015 + cropland_attribution: + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution + attribute: + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland: + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution:attribute:attribution_source:USDA_CoA_Cropland + year: 2017 + livestock_attribution: + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:livestock_attribution + attribute: + attribution_method: proportional + attribution_source: + USDA_CoA_Livestock: + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:livestock_attribution:attribute:attribution_source:USDA_CoA_Livestock + year: 2017 From 6a2858de0835fcd68bfd600d310e7afac870e6cb Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 26 Jun 2023 14:23:40 -0400 Subject: [PATCH 0632/1127] add cnhw_ca to source_catalog --- flowsa/data/source_catalog.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 9d40450ed..2115020e2 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -107,6 +107,8 @@ Census_VIP: class: Money activity_schema: None sector_hierarchy: "flat" +CNHW_CA: + data_format: FBS CNHW_national: data_format: FBS EIA_AEO: From 16021d8a308a0e8f59ea3a78b611bb72d0893a47 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 26 Jun 2023 14:33:12 -0400 Subject: [PATCH 0633/1127] move calculate_flow_per_employee() to flowbyclean.py --- .../CalRecycle_WasteCharacterization.py | 98 +------------------ flowsa/flowbyclean.py | 30 ++++++ 2 files changed, 31 insertions(+), 97 deletions(-) diff --git a/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py b/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py index 4f0cc3853..b9cfad387 100644 --- a/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py +++ b/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py @@ -12,15 +12,8 @@ import os import pandas as pd -import numpy as np -import flowsa.flowby -from flowsa.flowbyfunctions import assign_fips_location_system, \ - load_fba_w_standardized_units, \ - aggregate_and_subset_for_target_sectors +from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.settings import externaldatapath -from flowsa.sectormapping import get_fba_allocation_subset, \ - add_sectors_to_flowbyactivity -from flowsa.dataclean import replace_strings_with_NoneType, standardize_units def produced_by(entry): @@ -110,92 +103,3 @@ def calR_parse(*, year, **_): ignore_index=True) output = assign_fips_location_system(output, year) return output - - -def calculate_flow_per_employee(fbs, **_): - """ - Calculates FlowAmount per employee per year based on dataset name passed - in "clean_parameter" - clean_fbs function - """ - bls = flowsa.flowby.get_flowby_from_config( - name=fbs.config.get('clean_parameter')['name'], - config={**{k: v for k, v in fbs.config.items() - if k in fbs.config['method_config_keys']}, - **fbs.config.get('clean_parameter')} - ) - cols = ['Location', 'Year', 'SectorProducedBy'] - fbs = (fbs.merge(bls.rename(columns={'FlowAmount': 'Employees'}) - .groupby(cols).agg({'Employees': 'sum'}) - .reset_index(), - how='inner', - on = cols) - .assign(FlowAmount = lambda x: - np.divide(x['FlowAmount'], x['Employees'], - out=np.zeros_like(x['Employees']), - where=x['Employees'] != 0)) - .assign(Unit = lambda x: x['Unit'] + ' per employee') - .drop(columns=['Employees']) - ) - return fbs - -# def load_and_clean_employment_data_for_cnhw(fbs, year, method, -# geographic_level='state'): -# from flowsa.data_source_scripts.BLS_QCEW import \ -# bls_clean_allocation_fba_w_sec -# bls = load_fba_w_standardized_units(datasource='BLS_QCEW', -# year=year, -# flowclass='Employment', -# geographic_level=geographic_level) -# bls = add_sectors_to_flowbyactivity(bls) -# # estimate suppressed employment data -# bls = bls_clean_allocation_fba_w_sec(bls, method=method) - -# # Subset BLS dataset -# fbs_sectors = fbs['SectorProducedBy'].unique() -# sector_list = list(filter(None, fbs_sectors)) -# bls = get_fba_allocation_subset(bls, 'BLS_QCEW', sector_list) -# bls = bls.rename(columns={'FlowAmount': 'Employees'}) -# bls = bls[['Employees', 'Location', 'Year', 'SectorProducedBy']] -# return bls - - -# def apply_tons_per_employee_per_year_to_states(fbs, **_): -# """ -# Calculates tons per employee per year based on BLS_QCEW employees -# by sector and applies that quantity to employees in all states -# clean_fbs_df_fxn -# """ -# # load bls employment data for the year of CalRecycle data -# bls = load_and_clean_employment_data_for_cnhw( -# fbs, year=fbs['Year'].unique()[0], method=fbs.config) -# # Calculate tons per employee per year per material and sector in CA -# bls_CA = bls[bls['Location'] == '06000'] # California -# # aggregate all employment prior to generating tpepy -# bls_CA = (bls_CA.groupby(['Location', 'Year', 'SectorProducedBy']) -# .agg({'Employees': 'sum'}) -# .reset_index()) -# tpepy = fbs.merge(bls_CA, how='inner') -# tpepy['TPEPY'] = np.divide(tpepy['FlowAmount'], tpepy['Employees'], -# out=np.zeros_like(tpepy['Employees']), -# where=tpepy['Employees'] != 0) -# tpepy = tpepy.drop(columns=['Employees', 'FlowAmount', 'Location', 'Year']) - -# # Apply TPEPY back to all employees in all states for year identified in -# # method, overwrite geoscale based on target geoscale identified in method -# bls2 = load_and_clean_employment_data_for_cnhw( -# fbs, year=fbs.config['year'], method=fbs.config, -# geographic_level=fbs.config['geoscale']) -# national_waste = tpepy.merge(bls2, how='left') -# national_waste['Year'] = fbs.config['year'] -# national_waste['FlowAmount'] = \ -# national_waste['Employees'] * national_waste['TPEPY'] -# national_waste = national_waste.drop(columns=['TPEPY', 'Employees']) - -# df = aggregate_and_subset_for_target_sectors(national_waste, -# national_waste.config) -# # Ensure config remains on the dataframe -# df.config = national_waste.config -# df = replace_strings_with_NoneType(df) - -# return df diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index 67d1da508..8766ef040 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -302,3 +302,33 @@ def attribute_national_to_states(fba: FlowByActivity, **_) -> FlowByActivity: log.warning('Data loss upon census region mapping') return fba + + +def calculate_flow_per_employee( + fbs: 'FlowBySector', + download_sources_ok: bool = True, + **_ +) -> 'FlowBySector': + """ + Calculates FlowAmount per employee per year based on dataset name passed + in "clean_parameter" + clean_fbs function + """ + bls = load_prepare_clean_source(fbs, + download_sources_ok=download_sources_ok) + cols = ['Location', 'Year', 'SectorProducedBy'] + fbs = (fbs + .merge(bls + .rename(columns={'FlowAmount': 'Employees'}) + .groupby(cols).agg({'Employees': 'sum'}) + .reset_index(), + how='inner', + on=cols) + .assign(FlowAmount=lambda x: np.divide( + x['FlowAmount'], x['Employees'], out=np.zeros_like( + x['Employees']), where=x['Employees'] != 0)) + .assign(Unit = lambda x: x['Unit'] + '/employee') + .drop(columns=['Employees']) + ) + + return fbs From e1c4faebc9d9dfd69dde6cc27a34b8c803356d7e Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 26 Jun 2023 14:34:03 -0400 Subject: [PATCH 0634/1127] update cnhw_national_2014 for recursive method --- .../flowbysectormethods/CNHW_national_2014.yaml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml b/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml index ce0338fd1..308c00ccc 100644 --- a/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml @@ -1,22 +1,19 @@ +# National Commercial Non-Haz Waste (CNHW) FBS for 2014 +# Extrapolates 2014 California data using employment data + industry_spec: default: NAICS_6 year: 2014 target_naics_year: 2012 geoscale: national -# Needed temporarily still for aggregate_and_subset_for_target_sectors -target_sector_level: NAICS_6 - source_names: CNHW_CA_2014: - data_format: FBS - clean_fbs: !script_function:CalRecycle_WasteCharacterization calculate_flow_per_employee - clean_parameter: - name: Employment_state_2014 - data_format: FBS + clean_fbs: !clean_function:flowbyclean calculate_flow_per_employee + clean_source: + Employment_state_2014: + geoscale: state attribution_method: multiplication attribution_source: Employment_state_2014: - year: 2014 geoscale: state - attribution_method: direct From 1ca7c807954b61c22ffedb8d7ea9c787827bbb71 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 26 Jun 2023 14:35:17 -0400 Subject: [PATCH 0635/1127] modify attribute_flows_to_sectors() to work for single or multiple non-recursive attribution methods --- flowsa/flowby.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index b474f8090..ee37f35f7 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -609,14 +609,19 @@ def attribute_flows_to_sectors( attributed to those sectors, by the methods specified in the calling FBA's configuration dictionary. """ - attribute_config = self.config.get('attribute', None) + + # look for the "attribute" key in the FBS yaml, which will exist if + # there are multiple, non-recursive attribution methods applied to a + # data source + if "attribute" in self.config: + attribute_config = self.config.get('attribute') + # if there is only a single attribution source (or if attribution is + # fully recursive), then load the config file as is + else: + attribute_config = self.config.copy() if isinstance(attribute_config, dict): attribute_config = [attribute_config] - if attribute_config is None: - log.warning('Attribution method is missing, assuming equal ' - 'attribution') - attribute_config = [{'attribution_method': 'direct'}] for step_config in attribute_config: grouped: 'FB' = ( @@ -650,7 +655,12 @@ def attribute_flows_to_sectors( fb.config = {**parent_config, **step_config} - attribution_method = step_config.get('attribution_method') + attribution_method = step_config.get('attribution_method', None) + if attribution_method is None: + log.warning('Attribution method is missing, assuming equal ' + 'attribution') + attribution_method = 'direct' + if 'attribution_source' in step_config: if isinstance(step_config['attribution_source'], str): attribution_name = step_config['attribution_source'] @@ -841,6 +851,7 @@ def load_prepare_attribution_source( **config}, download_sources_ok=download_sources_ok ).prepare_fbs(download_sources_ok=download_sources_ok) + return attribution_fbs From 5d158a3eba968740e9bbbf4c1d39e1b23857c881 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 26 Jun 2023 14:36:17 -0400 Subject: [PATCH 0636/1127] modify load_prepare_clean_source() to work if attribution method is an FBS and does not have an appended dictionary --- flowsa/flowbyclean.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index 8766ef040..d5abaa751 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -1,6 +1,6 @@ import numpy as np import pandas as pd -from flowsa.flowby import FlowByActivity, FlowBySector +from flowsa.flowby import FlowByActivity, FlowBySector, FB from flowsa.flowsa_log import log from flowsa import (flowby, geo, location, getFlowBySector, flowbyfunctions) @@ -24,11 +24,14 @@ def return_primary_activity_column(fba: FlowByActivity) -> \ def load_prepare_clean_source( - self: 'FlowByActivity', + self: 'FB', download_sources_ok: bool = True -) -> 'FlowBySector': +) -> 'FB': - (name, config), = self.config['clean_source'].items() + try: + (name, config), = self.config['clean_source'].items() + except AttributeError: + name, config = self.config['clean_source'], {} clean_fbs = flowby.get_flowby_from_config( name=name, From c5c4871ceab9426ab8b3b80e143103d2394e9407 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 26 Jun 2023 14:40:12 -0400 Subject: [PATCH 0637/1127] drop use of additional "attribute" key except when there are multiple non-recursive attribution methods --- .../Employment_common.yaml | 3 +- .../Food_Waste_national_2018_m1.yaml | 80 +++--- .../Food_Waste_national_2018_m2.yaml | 37 ++- .../Land_national_2012.yaml | 112 ++++---- .../flowbysectormethods/Water_common.yaml | 252 +++++++++--------- .../Water_national_2010_m1.yaml | 27 +- .../Water_national_2015_m1.yaml | 27 +- .../Water_state_2015_m1.yaml | 27 +- 8 files changed, 258 insertions(+), 307 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Employment_common.yaml b/flowsa/methods/flowbysectormethods/Employment_common.yaml index e13ec4d7c..1e2bce309 100644 --- a/flowsa/methods/flowbysectormethods/Employment_common.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_common.yaml @@ -23,5 +23,4 @@ bls_load_and_clean_state: bls_allocation: selection_fields: PrimaryActivity: !from_index:BLS_QCEW_asets.csv qcew - attribute: - attribution_method: direct + attribution_method: direct diff --git a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m1.yaml b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m1.yaml index f0d2db15f..388494d78 100644 --- a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m1.yaml @@ -30,8 +30,7 @@ source_names: - "Military Installations" - "Residential" - "Sports Venues" - attribute: - attribution_method: direct + attribution_method: direct employment: selection_fields: PrimaryActivity: @@ -42,46 +41,41 @@ source_names: - "Office Buildings" - "Restaurants/Food Services" - "Retail" - attribute: - attribution_method: proportional - # do not want to attribute the waste management pathways using employment data (SectorConsumedBy) - attribute_on: [SectorProducedBy] - attribution_source: - Employment_national_2018: - year: 2018 + attribution_method: proportional + # do not want to attribute the waste management pathways using employment data (SectorConsumedBy) + attribute_on: [SectorProducedBy] + attribution_source: Employment_national_2018 establishments: selection_fields: PrimaryActivity: - "Wholesale" - attribute: - attribution_method: proportional - # do not want to attribute the waste management pathways using employment data (SectorConsumedBy) - attribute_on: [SectorProducedBy] - attribution_source: - BLS_QCEW: - selection_fields: - Class: "Other" - Location: !include:Location_common.yaml:_national_location - estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution - selection_fields_after_data_suppression_estimation: - FlowName: { - 'Number of establishments, Federal Government': 'Number of establishments', - 'Number of establishments, Local Government': 'Number of establishments', - 'Number of establishments, Private': 'Number of establishments', - 'Number of establishments, State Government': 'Number of establishments' - } # standardize after estimating suppressed + attribution_method: proportional + # do not want to attribute the waste management pathways using employment data (SectorConsumedBy) + attribute_on: [SectorProducedBy] + attribution_source: + BLS_QCEW: + selection_fields: + Class: "Other" + Location: !include:Location_common.yaml:_national_location + estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution + selection_fields_after_data_suppression_estimation: + FlowName: { + 'Number of establishments, Federal Government': 'Number of establishments', + 'Number of establishments, Local Government': 'Number of establishments', + 'Number of establishments, Private': 'Number of establishments', + 'Number of establishments, State Government': 'Number of establishments' + } # standardize after estimating suppressed manufacturing: selection_fields: PrimaryActivity: - "Manufacturing/Processing" - attribute: - attribution_method: proportional - # do not want to attribute the waste management pathways using employment data (SectorConsumedBy) - attribute_on: [SectorProducedBy] - attribution_source: - Census_ASM: - selection_fields: - Class: Money + attribution_method: proportional + # do not want to attribute the waste management pathways using employment data (SectorConsumedBy) + attribute_on: [SectorProducedBy] + attribution_source: + Census_ASM: + selection_fields: + Class: Money treated_waste_direct: primary_action_type: Consumed selection_fields: @@ -96,8 +90,7 @@ source_names: - 'Gasoline' - 'Natural gas' - 'Pesticide and other agricultural chemical manufacturing' - attribute: - attribution_method: direct + attribution_method: direct treated_waste_proportional: primary_action_type: Consumed selection_fields: @@ -109,11 +102,10 @@ source_names: - 'Wholesale Trade' - 'Services to buildings and dwellings' - 'Museums, historical sites, zoos, and parks' - attribute: - attribution_method: proportional - # do not want to attribute the waste management pathways using employment data (SectorConsumedBy) - attribute_on: [SectorProducedBy] - attribution_source: - Employment_national_2018: - year: 2018 - primary_action_type: Produced + attribution_method: proportional + # do not want to attribute the waste management pathways using employment data (SectorConsumedBy) + attribute_on: [SectorProducedBy] + attribution_source: + Employment_national_2018: + year: 2018 + primary_action_type: Produced diff --git a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml index 013ba6edf..fc6a4a36c 100644 --- a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml +++ b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml @@ -16,27 +16,25 @@ source_names: wasted_food_report: selection_fields: PrimarySector: !from_index:CNHW_Food_asets.csv wasted_food_report - attribute: - attribution_method: proportional - primary_action_type: Produced - attribute_on: [SectorProducedBy] - fill_columns: SectorConsumedBy - attribution_source: - EPA_WFR: - selection_fields: - Class: Other + attribution_method: proportional + primary_action_type: Produced + attribute_on: [SectorProducedBy] + fill_columns: SectorConsumedBy + attribution_source: + EPA_WFR: + selection_fields: + Class: Other facts_and_figures: selection_fields: PrimarySector: !from_index:CNHW_Food_asets.csv facts_and_figures - attribute: - attribution_method: proportional - attribute_on: [Flowable] - fill_columns: SectorConsumedBy - attribution_source: - EPA_FactsAndFigures: - selection_fields: - Class: Other - FlowName: {'Food': 'Food Waste'} + attribution_method: proportional + attribute_on: [Flowable] + fill_columns: SectorConsumedBy + attribution_source: + EPA_FactsAndFigures: + selection_fields: + Class: Other + FlowName: {'Food': 'Food Waste'} # CNHW does not include residential food waste, so adding from EPA's # Wasted Food Report @@ -48,5 +46,4 @@ source_names: selection_fields: PrimaryActivity: "Residential" FlowName: {'Food': 'Food Waste'} # rename for consistency above - attribute: - attribution_method: direct + attribution_method: direct diff --git a/flowsa/methods/flowbysectormethods/Land_national_2012.yaml b/flowsa/methods/flowbysectormethods/Land_national_2012.yaml index 11ee945a8..87a8771b1 100644 --- a/flowsa/methods/flowbysectormethods/Land_national_2012.yaml +++ b/flowsa/methods/flowbysectormethods/Land_national_2012.yaml @@ -19,10 +19,8 @@ sources_to_cache: cbecs_land: # all activities in eia cbecs land crosswalk selection_fields: PrimaryActivity: !from_index:EIA_CBECS_Land_2012_asets.csv cbecs_land - attribute: - attribution_method: proportional - attribution_source: Employment_national_2012 -# data_format: FBS + attribution_method: proportional + attribution_source: Employment_national_2012 EIA_MECS_Land: &_eia_mecs_land # manufacturing land use fedefl_mapping: EIA_MECS_Land year: 2014 @@ -36,12 +34,8 @@ sources_to_cache: mecs_land: # all activities in eia mecs land crosswalk selection_fields: PrimaryActivity: !from_index:EIA_MECS_Land_2014_asets.csv mecs_land - attribute: - attribution_method: proportional - attribution_source: - Employment_national_2014: -# data_format: FBS - year: 2014 + attribution_method: proportional + attribution_source: Employment_national_2014 source_names: EIA_CBECS_Land: @@ -57,15 +51,12 @@ source_names: general_mining: # all blm pls activities other than hardrock selection_fields: PrimaryActivity: !from_index:BLM_PLS_2012_asets.csv general_mining - attribute: - attribution_method: direct + attribution_method: direct hardrock_mining: selection_fields: PrimaryActivity: !from_index:BLM_PLS_2012_asets.csv hardrock_mining - attribute: - attribution_method: proportional - attribution_source: Employment_national_2012 -# data_format: FBS + attribution_method: proportional + attribution_source: Employment_national_2012 USDA_ERS_MLU: fedefl_mapping: USDA_ERS_MLU selection_fields: @@ -77,81 +68,74 @@ source_names: PrimaryActivity: - 'Cropland used for crops' - 'Cropland idled' - attribute: - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland: - selection_fields: - Class: Land - FlowName: - - "AREA HARVESTED" - - "AREA" - - "AREA IN PRODUCTION" - - 'AREA BEARING & NON-BEARING' - - 'AREA GROWN' - Location: !include:Location_common.yaml:_state_location - exclusion_fields: - conditional: {FlowName: 'AREA IN PRODUCTION', - ActivityConsumedBy: 'VEGETABLE TOTALS'} - ActivityConsumedBy: ['AG LAND', 'AG LAND, CROPLAND, HARVESTED'] - attribute: - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland_NAICS: - year: 2017 - selection_fields: - Class: Land - FlowName: - - "FARM OPERATIONS" - estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution - selection_fields_after_data_suppression_estimation: - PrimaryActivity: [ "112111", "112112", "11212", "1122", - "11231", "11232", "11233", "11234", - "11239", "11241", "11242", "11291", - "11292", "11293", "11299" ] + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland: + selection_fields: + Class: Land + FlowName: + - "AREA HARVESTED" + - "AREA" + - "AREA IN PRODUCTION" + - 'AREA BEARING & NON-BEARING' + - 'AREA GROWN' + Location: !include:Location_common.yaml:_state_location + exclusion_fields: + conditional: {FlowName: 'AREA IN PRODUCTION', + ActivityConsumedBy: 'VEGETABLE TOTALS'} + ActivityConsumedBy: ['AG LAND', 'AG LAND, CROPLAND, HARVESTED'] + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + year: 2017 + selection_fields: + Class: Land + FlowName: + - "FARM OPERATIONS" + estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution + selection_fields_after_data_suppression_estimation: + PrimaryActivity: [ "112111", "112112", "11212", "1122", + "11231", "11232", "11233", "11234", + "11239", "11241", "11242", "11291", + "11292", "11293", "11299" ] pastureland: selection_fields: PrimaryActivity: - 'Cropland used for pasture' - 'Forest-use land grazed' - 'Grassland pasture and range' - attribute: - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland_NAICS: - selection_fields: - Class: Land - FlowName: "FARM OPERATIONS" - estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + selection_fields: + Class: Land + FlowName: "FARM OPERATIONS" + estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution forest: selection_fields: PrimaryActivity: - 'Forest-use land not grazed' - 'Land in defense and industrial areas' - 'Land in rural parks and wildlife areas' - attribute: - attribution_method: direct + attribution_method: direct rural_transportation: selection_fields: PrimaryActivity: - 'Land in rural transportation facilities' clean_fba_w_sec: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_land_in_rural_transportation_areas geoscale: national - attribute: - attribution_method: direct + attribution_method: direct urban: selection_fields: PrimaryActivity: - 'Land in urban areas' clean_fba_w_sec: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_land_in_urban_areas geoscale: national - attribute: - attribution_method: direct + attribution_method: direct other: selection_fields: PrimaryActivity: - 'Other land' clean_fba_w_sec: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_other_land geoscale: national - attribute: - attribution_method: direct \ No newline at end of file + attribution_method: direct \ No newline at end of file diff --git a/flowsa/methods/flowbysectormethods/Water_common.yaml b/flowsa/methods/flowbysectormethods/Water_common.yaml index 7346119b3..cdf7f9329 100644 --- a/flowsa/methods/flowbysectormethods/Water_common.yaml +++ b/flowsa/methods/flowbysectormethods/Water_common.yaml @@ -29,8 +29,7 @@ sources_to_cache: # year: 2018 # specify in year-specific yaml selection_fields: Class: Water - attribute: - attribution_method: inheritance + attribution_method: inheritance - attribution_method: direct clean_fba_after_attribution: !clean_function:flowbyclean weighted_average replacement_dictionary: {'HAY & HAYLAGE, (EXCL ALFALFA)': 'HAY & HAYLAGE', @@ -59,68 +58,61 @@ source_names: - "Public Supply" - "Thermoelectric Power" - "Domestic" - attribute: - attribution_method: direct + attribution_method: direct employment_attribution: # use in m1 selection_fields: PrimaryActivity: - - "Industrial" - - "Mining" - attribute: - attribution_method: proportional - # attribution_source: Employment_national_2015 # specify in year-specific yaml + - "Industrial" + - "Mining" + attribution_method: proportional +# attribution_source: Employment_national_2015 # specify in year-specific yaml industrial_attribution: # use in m2 (instead of employment_attribution) selection_fields: PrimaryActivity: - "Industrial" - attribute: - attribution_method: proportional - attribution_source: - StatCan_IWS_MI: #todo: convert canadian data to to US FIPS - geoscale: national - selection_fields: - Class: Water - FlowName: "Water intake" - # todo: convert clean fba fxn into this yaml - clean_allocation_fba: !script_function:StatCan_IWS_MI convert_statcan_data_to_US_water_use - attribute: - attribution_method: proportional - attribution_source: - Employment_national_2015: - geoscale: national + attribution_method: proportional + attribution_source: + StatCan_IWS_MI: #todo: convert canadian data to to US FIPS + geoscale: national + selection_fields: + Class: Water + FlowName: "Water intake" + # todo: convert clean fba fxn into this yaml + clean_allocation_fba: !script_function:StatCan_IWS_MI convert_statcan_data_to_US_water_use + attribution_method: proportional + attribution_source: + Employment_national_2015: + geoscale: national mining_attribution: # use in m2 (instead of employment_attribution) selection_fields: PrimaryActivity: - "Mining" - attribute: - attribution_method: proportional - attribution_source: - Blackhurst_IO: - year: 2002 - geoscale: national - selection_fields: - Class: Water - FlowName: "Water Withdrawals IO Vector" - attribute: - attribution_method: multiplication + attribution_method: proportional + attribution_source: + Blackhurst_IO: + year: 2002 + geoscale: national + selection_fields: + Class: Water + FlowName: "Water Withdrawals IO Vector" + attribution_method: multiplication + attribution_source: + BEA_Make_AR: + year: 2002 + selection_fields: + Class: Money + # todo: make sure attributing on location and activity + attribution_method: proportional attribution_source: - BEA_Make_AR: - year: 2002 - selection_fields: - Class: Money - attribute: - # todo: make sure attributing on location and activity - attribution_method: proportional - attribution_source: - Employment_national_2002: - geoscale: national - clean_fba_after_attribution: !script_function:Blackhurst_IO scale_blackhurst_results_to_usgs_values + Employment_national_2002: + geoscale: national + clean_fba_after_attribution: !script_function:Blackhurst_IO scale_blackhurst_results_to_usgs_values cropland_attribution: # use in m1, m2 @@ -130,71 +122,70 @@ source_names: selection_fields: PrimaryActivity: - "Irrigation Crop" - attribute: - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland: - # year: 2017 # specify in year-specific yaml - selection_fields: - Class: "Land" - FlowName: - - "AREA HARVESTED, IRRIGATED" - - "AREA IN PRODUCTION, IRRIGATED" - - "AREA, IRRIGATED" - - 'AREA BEARING & NON-BEARING, IRRIGATED' - - 'AREA GROWN, IRRIGATED' - exclusion_fields: - ActivityConsumedBy: - - 'AG LAND' - - 'AG LAND, CROPLAND, HARVESTED' - activity_sets: - cropland_attribution-pastureland: - selection_fields: - PrimaryActivity: 'AG LAND, (EXCL HARVESTED CROPLAND)' - attribute: - - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland_NAICS: - # year: 2017 # specify in year-specific yaml - selection_fields: - Class: Land - FlowName: - - "FARM OPERATIONS" - estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution - selection_fields_after_data_suppression_estimation: - PrimaryActivity: [ - '112', '1121', '11211', '112111', '112112', - '11212', '1122', '1123', '11231', '11232', - '11233', '11234', '11239', '1124', '11241', - '11242', '1129', '11291', '11292', '11293', - '11299'] - - attribution_method: multiplication - attribution_source: USDA_IWMS - cropland_attribution-cropland: - exclusion_fields: - ActivityConsumedBy: - - 'AG LAND, (EXCL HARVESTED CROPLAND)' - - 'ORCHARDS' - attribute: - - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland_NAICS: - # year: 2017 # specify in year-specific yaml - selection_fields: - Class: Land - FlowName: - - "AG LAND, CROPLAND, HARVESTED" - estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution - - attribution_method: multiplication - attribution_source: USDA_IWMS - cropland_attribution-orchards: - selection_fields: - PrimaryActivity: ORCHARDS - attribute: - # first directly attribute so orchards are equally attributed to related sectors - - attribution_method: direct - - attribution_method: multiplication - attribution_source: USDA_IWMS + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland: + # year: 2017 # specify in year-specific yaml + selection_fields: + Class: "Land" + FlowName: + - "AREA HARVESTED, IRRIGATED" + - "AREA IN PRODUCTION, IRRIGATED" + - "AREA, IRRIGATED" + - 'AREA BEARING & NON-BEARING, IRRIGATED' + - 'AREA GROWN, IRRIGATED' + exclusion_fields: + ActivityConsumedBy: + - 'AG LAND' + - 'AG LAND, CROPLAND, HARVESTED' + activity_sets: + cropland_attribution-pastureland: + selection_fields: + PrimaryActivity: 'AG LAND, (EXCL HARVESTED CROPLAND)' + attribute: + - attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + # year: 2017 # specify in year-specific yaml + selection_fields: + Class: Land + FlowName: + - "FARM OPERATIONS" + estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution + selection_fields_after_data_suppression_estimation: + PrimaryActivity: [ + '112', '1121', '11211', '112111', '112112', + '11212', '1122', '1123', '11231', '11232', + '11233', '11234', '11239', '1124', '11241', + '11242', '1129', '11291', '11292', '11293', + '11299'] + - attribution_method: multiplication + attribution_source: USDA_IWMS + cropland_attribution-cropland: + exclusion_fields: + ActivityConsumedBy: + - 'AG LAND, (EXCL HARVESTED CROPLAND)' + - 'ORCHARDS' + attribute: + - attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + # year: 2017 # specify in year-specific yaml + selection_fields: + Class: Land + FlowName: + - "AG LAND, CROPLAND, HARVESTED" + estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution + - attribution_method: multiplication + attribution_source: USDA_IWMS + cropland_attribution-orchards: + selection_fields: + PrimaryActivity: ORCHARDS + attribute: + # first directly attribute so orchards are equally attributed to related sectors + - attribution_method: direct + - attribution_method: multiplication + attribution_source: USDA_IWMS livestock_attribution: # use in m1, m2 @@ -205,24 +196,21 @@ source_names: selection_fields: PrimaryActivity: - "Livestock" - attribute: - attribution_method: proportional - attribution_source: - USDA_CoA_Livestock: - # year: 2017 # specify in year-specific yaml - selection_fields: - Class: Other - FlowName: - - "HEAD" - - "NUMBER" - - "COLONIES" - Compartment: - - "NOT SPECIFIED" - attribute: - attribution_method: multiplication - attribution_source: - USGS_WU_Coef: - year: 2005 - geoscale: national - attribute: - attribution_method: inheritance + attribution_method: proportional + attribution_source: + USDA_CoA_Livestock: + # year: 2017 # specify in year-specific yaml + selection_fields: + Class: Other + FlowName: + - "HEAD" + - "NUMBER" + - "COLONIES" + Compartment: + - "NOT SPECIFIED" + attribution_method: multiplication + attribution_source: + USGS_WU_Coef: + year: 2005 + geoscale: national + attribution_method: inheritance diff --git a/flowsa/methods/flowbysectormethods/Water_national_2010_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2010_m1.yaml index 536bcaf03..f545249c5 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2010_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2010_m1.yaml @@ -20,22 +20,19 @@ source_names: !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:direct_attribution employment_attribution: !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:employment_attribution - attribute: - attribution_method: proportional - attribution_source: Employment_national_2010 + attribution_method: proportional + attribution_source: Employment_national_2010 cropland_attribution: !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution - attribute: - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland: - !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution:attribute:attribution_source:USDA_CoA_Cropland - year: 2012 + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland: + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution:attribution_source:USDA_CoA_Cropland + year: 2012 livestock_attribution: !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:livestock_attribution - attribute: - attribution_method: proportional - attribution_source: - USDA_CoA_Livestock: - !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:livestock_attribution:attribute:attribution_source:USDA_CoA_Livestock - year: 2012 + attribution_method: proportional + attribution_source: + USDA_CoA_Livestock: + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:livestock_attribution:attribution_source:USDA_CoA_Livestock + year: 2012 diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index 917b279eb..c48ca8a56 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -20,22 +20,19 @@ source_names: !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:direct_attribution employment_attribution: !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:employment_attribution - attribute: - attribution_method: proportional - attribution_source: Employment_national_2015 + attribution_method: proportional + attribution_source: Employment_national_2015 cropland_attribution: !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution - attribute: - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland: - !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution:attribute:attribution_source:USDA_CoA_Cropland - year: 2017 + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland: + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution:attribution_source:USDA_CoA_Cropland + year: 2017 livestock_attribution: !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:livestock_attribution - attribute: - attribution_method: proportional - attribution_source: - USDA_CoA_Livestock: - !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:livestock_attribution:attribute:attribution_source:USDA_CoA_Livestock - year: 2017 + attribution_method: proportional + attribution_source: + USDA_CoA_Livestock: + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:livestock_attribution:attribution_source:USDA_CoA_Livestock + year: 2017 diff --git a/flowsa/methods/flowbysectormethods/Water_state_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_state_2015_m1.yaml index 4e9f024a0..e5cdba3b3 100644 --- a/flowsa/methods/flowbysectormethods/Water_state_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_state_2015_m1.yaml @@ -20,22 +20,19 @@ source_names: !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:direct_attribution employment_attribution: !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:employment_attribution - attribute: - attribution_method: proportional - attribution_source: Employment_state_2015 + attribution_method: proportional + attribution_source: Employment_state_2015 cropland_attribution: !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution - attribute: - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland: - !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution:attribute:attribution_source:USDA_CoA_Cropland - year: 2017 + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland: + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution:attribution_source:USDA_CoA_Cropland + year: 2017 livestock_attribution: !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:livestock_attribution - attribute: - attribution_method: proportional - attribution_source: - USDA_CoA_Livestock: - !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:livestock_attribution:attribute:attribution_source:USDA_CoA_Livestock - year: 2017 + attribution_method: proportional + attribution_source: + USDA_CoA_Livestock: + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:livestock_attribution:attribution_source:USDA_CoA_Livestock + year: 2017 From 2babd6276e4c830e29986ef00320beb16ec1d39d Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 26 Jun 2023 15:44:43 -0400 Subject: [PATCH 0638/1127] update FBS metadata to pull FBS attribution data --- flowsa/metadata.py | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/flowsa/metadata.py b/flowsa/metadata.py index 3aa84b360..97e3b44ac 100644 --- a/flowsa/metadata.py +++ b/flowsa/metadata.py @@ -94,6 +94,7 @@ def return_fbs_method_data(source_name, config): """ from flowsa.data_source_scripts.stewiFBS import add_stewi_metadata,\ add_stewicombo_metadata + from flowsa.flowby import get_catalog_info # Create empty dictionary for storing meta data meta = {} @@ -111,13 +112,14 @@ def return_fbs_method_data(source_name, config): meta['primary_source_meta'][k] = add_stewi_metadata( v['inventory_dict']) continue - if v.get('data_format') in ('FBS', 'FBS_outside_flowsa'): - meta['primary_source_meta'][k] = \ - getMetadata(k, category='FlowBySector') - continue + + cat = get_catalog_info(k)['data_format'].replace( + 'FBS', 'FlowBySector').replace('FBA', 'FlowByActivity') + # append source and year year = config['year'] if v.get('year') is None else v.get('year') - meta['primary_source_meta'][k] = getMetadata(k, year) + meta['primary_source_meta'][k] = getMetadata(k, year=year, + category=cat) # create dictionary of allocation datasets for different activities activities = v.get('activity_sets') if activities is None: @@ -128,10 +130,20 @@ def return_fbs_method_data(source_name, config): for aset, attr in activities.items(): if attr.get('attribution_source'): # append fba meta - source = list(attr['attribution_source'].keys())[0] + try: + source = list(attr['attribution_source'].keys())[0] + year = attr['attribution_source'][source].get('year') + except AttributeError: + source = attr['attribution_source'] + year = None + + cat = get_catalog_info(source)['data_format'].replace( + 'FBS', 'FlowBySector').replace('FBA', 'FlowByActivity') + meta['primary_source_meta'][k]['attribution_source_meta'][ source] = getMetadata( - source, attr['attribution_source'][source].get('year')) + source, year=year, category=cat) + if 'literature_sources' in attr: lit = attr['literature_sources'] for s, y in lit.items(): @@ -139,8 +151,6 @@ def return_fbs_method_data(source_name, config): # append fba meta meta['primary_source_meta'][k][ 'attribution_source_meta'][s] = lit_meta - # subset the additional fbas to the source and - # activity set, if exists return meta @@ -179,7 +189,7 @@ def return_fba_method_meta(sourcename, **kwargs): return fba_dict -def getMetadata(source, year=None, category='FlowByActivity'): +def getMetadata(source, year=None, category=None): """ Use the esupy package functions to return the metadata for a FBA or FBS used to generate a FBS @@ -190,6 +200,14 @@ def getMetadata(source, year=None, category='FlowByActivity'): """ from flowsa.flowbyactivity import set_fba_name + if category is None: + log.error('Category required, specify "FlowByActivity" or ' + '"FlowBySector"') + # if category is FBS ensure year is not added to source name when + # looking for metadata + if category == 'FlowBySector': + year=None + name = set_fba_name(source, year) meta = read_source_metadata(paths, set_fb_meta(name, category)) if meta is None: From e70a35907968261cc1f33e5bf57e6856ac20e6fc Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 26 Jun 2023 16:18:41 -0400 Subject: [PATCH 0639/1127] update FlowBy to FB --- flowsa/flowbyclean.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index d5abaa751..b1f3750ec 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -115,10 +115,10 @@ def weighted_average( def substitute_nonexistent_values( - fb: 'FlowBy', + fb: 'FB', download_sources_ok: bool = True, **kwargs -) -> 'FlowBy': +) -> 'FB': """ Fill missing values with data from another geoscale """ From 4023a7c5d551991bda71cdabe6e99dc60e72d31f Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 27 Jun 2023 16:01:01 -0400 Subject: [PATCH 0640/1127] updates to loading stewi data to work for revised convert_naics_year - fxn revised to work for new DataFrames --- flowsa/data_source_scripts/stewiFBS.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/flowsa/data_source_scripts/stewiFBS.py b/flowsa/data_source_scripts/stewiFBS.py index d9f2a66fc..a1cf314a6 100644 --- a/flowsa/data_source_scripts/stewiFBS.py +++ b/flowsa/data_source_scripts/stewiFBS.py @@ -306,6 +306,11 @@ def prepare_stewi_fbs(df_load, config) -> 'FlowBySector': if 'year' not in config: config['year'] = df_load['Year'][0] + # find activity schema + activity_schema = config['activity_schema'] if isinstance( + config['activity_schema'], str) else config.get( + 'activity_schema', {}).get(config['year']) + fbs = FlowByActivity( df_load .pipe(update_geoscale, config['geoscale']) @@ -313,10 +318,10 @@ def prepare_stewi_fbs(df_load, config) -> 'FlowBySector': .rename(columns={"NAICS": "ActivityProducedBy", 'Source': 'SourceName'}) .assign(Class='Chemicals') - .assign(ActivityConsumedBy='') + .assign(ActivityConsumedBy=np.nan) .pipe(convert_naics_year, - f"NAICS_{config['target_naics_year']}_Code") - # ^^ Consider upating this old function + f"NAICS_{config['target_naics_year']}_Code", + activity_schema) .assign(FlowType=lambda x: np.where( x['SourceName']=='RCRAInfo', 'WASTE_FLOW', 'ELEMENTARY_FLOW')) From 329ee230f99de0da3870698e61001ee2357a2d8f Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 27 Jun 2023 16:02:23 -0400 Subject: [PATCH 0641/1127] revise cnhw 2018 to use calculate_flow_per_employee() --- .../CNHW_national_2018.yaml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml b/flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml index 1a4778ade..553c0cddd 100644 --- a/flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml +++ b/flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml @@ -1,14 +1,19 @@ +# National Commercial Non-Haz Waste (CNHW) FBS for 2018 +# Extrapolates 2014 California data using employment data + industry_spec: default: NAICS_6 year: 2018 target_naics_year: 2012 geoscale: national -# Needed temporarily still for aggregate_and_subset_for_target_sectors -target_sector_level: NAICS_6 - source_names: - "CNHW_CA_2014": - data_format: 'FBS' - clean_fbs: !script_function:CalRecycle_WasteCharacterization apply_tons_per_employee_per_year_to_states - year: 2018 \ No newline at end of file + CNHW_CA_2014: + clean_fbs: !clean_function:flowbyclean calculate_flow_per_employee + clean_source: + Employment_state_2014: + geoscale: state + attribution_method: multiplication + attribution_source: + Employment_state_2018: + geoscale: state From c93adea4b4cebf69133a60657f860a36d0df9e8b Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 27 Jun 2023 16:03:09 -0400 Subject: [PATCH 0642/1127] in aggregator() don't drop columns that are all nans --- flowsa/flowbyfunctions.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/flowsa/flowbyfunctions.py b/flowsa/flowbyfunctions.py index 565c61d1a..a7a46a439 100644 --- a/flowsa/flowbyfunctions.py +++ b/flowsa/flowbyfunctions.py @@ -109,8 +109,6 @@ def aggregator(df, groupbycols, retain_zeros=True, flowcolname='FlowAmount'): .drop(columns='group_id', errors='ignore') .reset_index(drop=True) ) - # tmp replace null values with empty cells - df = replace_NoneType_with_empty_cells(df) # drop columns with flowamount = 0 if retain_zeros is False: @@ -131,7 +129,7 @@ def aggregator(df, groupbycols, retain_zeros=True, flowcolname='FlowAmount'): # check cols exist in df groupbycols = [c for c in groupbycols if c in df.columns] - df_dfg = df.groupby(groupbycols).agg({flowcolname: ['sum']}) + df_dfg = df.groupby(groupbycols, dropna=False).agg({flowcolname: ['sum']}) def is_identical(s): a = s.to_numpy() From 75319af6aaa4133f9993cf5432bc757d70b5f6ce Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 27 Jun 2023 16:24:42 -0400 Subject: [PATCH 0643/1127] exclude FBS files that include phrases "common" and "summary_target" from list of available methods --- flowsa/__init__.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/flowsa/__init__.py b/flowsa/__init__.py index 79e78c2c7..8c48c402b 100644 --- a/flowsa/__init__.py +++ b/flowsa/__init__.py @@ -125,18 +125,19 @@ def seeAvailableFlowByModels(flowbytype, print_method=True): # run through all files and append for file in os.listdir(fb_directory): if file.endswith(".yaml"): - # drop file extension - f = os.path.splitext(file)[0] - if flowbytype == 'FBA': - s = load_yaml_dict(f, 'FBA') - try: - years = s['years'] - except KeyError: - years = 'YAML missing information on years' - fb_dict.update({f: years}) - # else if FBS - else: - fb_df.append(f) + if all(s not in file for s in ["_common", "_summary_target"]): + # drop file extension + f = os.path.splitext(file)[0] + if flowbytype == 'FBA': + s = load_yaml_dict(f, 'FBA') + try: + years = s['years'] + except KeyError: + years = 'YAML missing information on years' + fb_dict.update({f: years}) + # else if FBS + else: + fb_df.append(f) # determine format of data to print if flowbytype == 'FBA': From 7303894bc92ef069ab6d4dffd19b3b29336a076c Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 27 Jun 2023 16:26:53 -0400 Subject: [PATCH 0644/1127] update convert_naics_year() to work for new FBA/FBS classes and older dataframe methods --- flowsa/naics.py | 58 +++++++++++++++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 21 deletions(-) diff --git a/flowsa/naics.py b/flowsa/naics.py index 29f8170e6..ea85226f4 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -180,17 +180,23 @@ def melt_naics_crosswalk(): return cw_replacement_2 -def convert_naics_year(df, targetsectorsourcename, sectorsourcename): +def convert_naics_year(df_load, targetsectorsourcename, sectorsourcename): """ Replace any non sectors with sectors. :param df_load: df with sector columns or sector-like activities :param sectorsourcename: str, sector source name (ex. NAICS_2012_Code) :return: df, with non-sectors replaced with sectors """ - # load the mastercroswalk and subset by sectorsourcename, + # todo: update this function to work better with recursive method + + # load the mastercrosswalk and subset by sectorsourcename, # save values to list - cw_load = common.load_crosswalk('sector_timeseries')[[ - targetsectorsourcename, sectorsourcename]] + if targetsectorsourcename == sectorsourcename: + cw_load = common.load_crosswalk('sector_timeseries')[[ + targetsectorsourcename]] + else: + cw_load = common.load_crosswalk('sector_timeseries')[[ + targetsectorsourcename, sectorsourcename]] cw = cw_load[targetsectorsourcename].drop_duplicates().tolist() # load melted crosswalk @@ -199,20 +205,22 @@ def convert_naics_year(df, targetsectorsourcename, sectorsourcename): cw_melt = cw_melt.drop(columns='naics_count') # determine which headers are in the df - if 'SectorConsumedBy' in df: + column_headers = ['ActivityProducedBy', 'ActivityConsumedBy'] + if 'SectorConsumedBy' in df_load: column_headers = ['SectorProducedBy', 'SectorConsumedBy'] - else: - column_headers = ['ActivityProducedBy', 'ActivityConsumedBy'] # check if there are any sectors that are not in the naics 2012 crosswalk - non_naics = check_if_sectors_are_naics(df, cw, column_headers) + non_naics = check_if_sectors_are_naics(df_load, cw, column_headers) # loop through the df headers and determine if value is # not in crosswalk list + df = df_load.copy() if len(non_naics) != 0: - vlog.debug('Checking if sectors represent a different ' - f'NAICS year, if so, replace with {targetsectorsourcename}') + log.info('Checking if sectors represent a different ' + f'NAICS year, if so, replace with {targetsectorsourcename}') for c in column_headers: + if df[c].isna().all(): + continue # merge df with the melted sector crosswalk df = df.merge(cw_melt, left_on=c, right_on='NAICS', how='left') # if there is a value in the sectorsourcename column, @@ -227,25 +235,33 @@ def convert_naics_year(df, targetsectorsourcename, sectorsourcename): # drop columns df = df.drop( columns=[targetsectorsourcename, 'NAICS', 'allocation_ratio']) - vlog.debug(f'Replaced NAICS with {targetsectorsourcename}') + log.info(f'Replaced NAICS with {targetsectorsourcename}') # check if there are any sectors that are not in - # the target sector crosswalk - vlog.debug(f'Check again for non {targetsectorsourcename}') + # the target sector crosswalk and if so, drop those sectors + log.info('Checking for unconverted NAICS - determine if rows should ' + 'be dropped.') nonsectors = check_if_sectors_are_naics(df, cw, column_headers) if len(nonsectors) != 0: vlog.debug('Dropping non-NAICS from dataframe') for c in column_headers: + if df[c].isna().all(): + continue # drop rows where column value is in the nonnaics list df = df[~df[c].isin(nonsectors)] # aggregate data - possible_column_headers = \ - ('FlowAmount', 'Spread', 'Min', 'Max', 'DataReliability', - 'TemporalCorrelation', 'GeographicalCorrelation', - 'TechnologicalCorrelation', 'DataCollection', 'Description') - # list of column headers to group aggregation by - groupby_cols = [e for e in df.columns.values.tolist() - if e not in possible_column_headers] - df = aggregator(df, groupby_cols) + if hasattr(df, 'aggregate_flowby'): + df = df.aggregate_flowby() + else: + # todo: drop except statement once all dataframes are converted + # to classes + possible_column_headers = \ + ('FlowAmount', 'Spread', 'Min', 'Max', 'DataReliability', + 'TemporalCorrelation', 'GeographicalCorrelation', + 'TechnologicalCorrelation', 'DataCollection', 'Description') + # list of column headers to group aggregation by + groupby_cols = [e for e in df.columns.values.tolist() + if e not in possible_column_headers] + df = aggregator(df, groupby_cols) return df From 773b0507fff4fe96dc16034ae1b333facdfd1c7f Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 27 Jun 2023 16:27:37 -0400 Subject: [PATCH 0645/1127] update FBS methods to exclude from generation/testing on github actions --- flowsa/test_FBS_against_remote.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/flowsa/test_FBS_against_remote.py b/flowsa/test_FBS_against_remote.py index e3f4763a0..c9bb2c96e 100644 --- a/flowsa/test_FBS_against_remote.py +++ b/flowsa/test_FBS_against_remote.py @@ -16,17 +16,16 @@ def test_generate_fbs(): """Generate all FBS from methods in repo.""" for m in seeAvailableFlowByModels("FBS", print_method=False): - if m not in ['BEA_summary_target', - 'Electricity_gen_emissions_national_2016', - 'Employment_common', - 'GHG_national_m1', - 'USEEIO_summary_target', - 'Water_national_2010_m1', # todo: add water tests after modify to recursive method - 'Water_national_2010_m2', - 'Water_national_2015_m2', - 'Water_national_2015_m3', - 'Water_state_2015_m1' - ]: + if m not in [ + 'Electricity_gen_emissions_national_2016', + 'GHG_national_m1', + 'GHGRP_2019', # remove after deleting method + 'marine_shipping_adjustment', # delete + 'SEEA_2016_v1', # delete + 'SEEA_2017_kg_v1', # delete + 'SEEA_2017_v1', # delete + 'SEEA_2017_v2' # delete + ]: print("--------------------------------\n" f"Method: {m}\n" "--------------------------------") From 9ec4d9eb1d7981ad1a8052657f93763b6eef2f6b Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Jul 2023 07:54:07 -0600 Subject: [PATCH 0646/1127] add bea_make_ar to source_catalog --- flowsa/data/source_catalog.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 2115020e2..106a7a593 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -10,6 +10,12 @@ BEA_GDP_GrossOutput: - Money activity_schema: BEA_2012_Detail_Code sector_hierarchy: "parent-completeChild" +BEA_Make_AR: + data_format: FBA + class: + - Money + activity_schema: BEA_2012_Detail_Code + sector_hierarchy: "parent-completeChild" BEA_Make_Detail_BeforeRedef: data_format: FBA class: From 4c09f34c30b2b9f1ba5bce368e0541c87dfe6c09 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Jul 2023 07:56:01 -0600 Subject: [PATCH 0647/1127] update reading csv to use f strings to avoid errors --- flowsa/data_source_scripts/BEA.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/flowsa/data_source_scripts/BEA.py b/flowsa/data_source_scripts/BEA.py index e496730e4..d4065a9be 100644 --- a/flowsa/data_source_scripts/BEA.py +++ b/flowsa/data_source_scripts/BEA.py @@ -9,7 +9,7 @@ Source csv files for BEA data are documented in scripts/write_BEA_Use_from_useeior.py """ -from functools import reduce + import pandas as pd from flowsa.location import US_FIPS from flowsa.common import fbs_activity_fields @@ -26,7 +26,7 @@ def bea_gdp_parse(*, year, **_): specifications """ # Read directly into a pandas df - df_raw = pd.read_csv(externaldatapath / "BEA_GDP_GrossOutput_IO.csv") + df_raw = pd.read_csv(f"{externaldatapath}/BEA_GDP_GrossOutput_IO.csv") df = df_raw.rename(columns={'Unnamed: 0': 'ActivityProducedBy'}) @@ -61,8 +61,8 @@ def bea_use_detail_br_parse(*, year, **_): :return: df, parsed and partially formatted to flowbyactivity specifications """ - csv_load = (externaldatapath / f'BEA_{str(year)}' - f'_Detail_Use_PRO_BeforeRedef.csv') + csv_load = (f"{externaldatapath}/BEA_{str(year)}" + f"_Detail_Use_PRO_BeforeRedef.csv") df_raw = pd.read_csv(csv_load) df = bea_detail_parse(df_raw, year) @@ -79,8 +79,8 @@ def bea_make_detail_br_parse(*, year, **_): flowbyactivity specifications """ # Read directly into a pandas df - csv_load = (externaldatapath / f'BEA_{str(year)}' - f'_Detail_Make_BeforeRedef.csv') + csv_load = (f"{externaldatapath}/BEA_{str(year)}" + f"_Detail_Make_BeforeRedef.csv") df_raw = pd.read_csv(csv_load) df = bea_detail_parse(df_raw, year) @@ -122,9 +122,8 @@ def bea_make_ar_parse(*, year, **_): :return: df, parsed and partially formatted to flowbyactivity specifications """ - # df = pd.concat(dataframe_list, sort=False) - df_load = pd.read_csv(externaldatapath + "BEA_" + year + - "_Make_AfterRedef.csv", dtype="str") + df_load = pd.read_csv(f"{externaldatapath}/BEA" + f"_{year}_Make_AfterRedef.csv", dtype="str") # strip whitespace df = df_load.apply(lambda x: x.str.strip()) # drop rows of data From db9505492a6ed99716389e337f9bc072a6395c5b Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Jul 2023 07:57:09 -0600 Subject: [PATCH 0648/1127] update scale_blackhurst_results_to_usgs_values() to recursive method --- flowsa/data_source_scripts/Blackhurst_IO.py | 23 +++++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/flowsa/data_source_scripts/Blackhurst_IO.py b/flowsa/data_source_scripts/Blackhurst_IO.py index 41c7a2c2a..47150db9d 100644 --- a/flowsa/data_source_scripts/Blackhurst_IO.py +++ b/flowsa/data_source_scripts/Blackhurst_IO.py @@ -19,6 +19,7 @@ from flowsa.sectormapping import add_sectors_to_flowbyactivity from flowsa.settings import externaldatapath from flowsa.validation import compare_df_units +from flowsa.flowby import FlowBySector def bh_parse(*, df_list, **_): @@ -156,8 +157,8 @@ def convert_blackhurst_data_to_kg_per_employee( return df_wratio -def scale_blackhurst_results_to_usgs_values( - df_load, attr, download_FBA_if_missing): +def scale_blackhurst_results_to_usgs_values(fbs: FlowBySector, **_) -> \ + FlowBySector: """ Scale the initial estimates for Blackhurst-based mining estimates to USGS values. Oil-based sectors are allocated a larger percentage of the @@ -172,18 +173,22 @@ def scale_blackhurst_results_to_usgs_values( downloaded from Data Commons :return: scaled fba results """ + from flowsa.flowbyclean import load_prepare_clean_source # determine national level published withdrawal data for usgs mining # in FBS method year - pv_load = load_fba_w_standardized_units( - datasource="USGS_NWIS_WU", year=str(attr['helper_source_year']), - flowclass='Water', download_FBA_if_missing=download_FBA_if_missing) + # pv_load = load_fba_w_standardized_units( + # datasource="USGS_NWIS_WU", year=fbs.config['year'], + # flowclass='Water', download_FBA_if_missing=download_FBA_if_missing) + # + # pv_sub = pv_load[(pv_load['ActivityConsumedBy'] == 'Mining') & + # (pv_load['Compartment'] == 'total') & + # (pv_load['FlowName'] == 'total')].reset_index(drop=True) + pv_sub = load_prepare_clean_source(fbs) + pv_sub_sum = pv_sub['FlowAmount'].sum() - pv_sub = pv_load[(pv_load['ActivityConsumedBy'] == 'Mining') & - (pv_load['Compartment'] == 'total') & - (pv_load['FlowName'] == 'total')].reset_index(drop=True) # rename the published value flow name and merge with Blackhurst data pv_sub = pv_sub.rename(columns={'FlowAmount': 'pv'}) - df = df_load.merge(pv_sub[['Location', 'pv']], how='left') + df = fbs.merge(pv_sub[['SectorConsumedBy', 'Location', 'pv']], how='left') # calculate the difference between published value and allocated value # for each naics length df = df.assign(nLen=df['SectorConsumedBy'].apply(lambda x: len(x))) From d44c9dadda46326a3fd043cb3d58845253f7b288 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Jul 2023 07:57:50 -0600 Subject: [PATCH 0649/1127] drop "descendants" column before returing df in clean_mecs_energy_fb() --- flowsa/data_source_scripts/EIA_MECS.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/data_source_scripts/EIA_MECS.py b/flowsa/data_source_scripts/EIA_MECS.py index a19762596..929326526 100644 --- a/flowsa/data_source_scripts/EIA_MECS.py +++ b/flowsa/data_source_scripts/EIA_MECS.py @@ -550,7 +550,7 @@ def clean_mecs_energy_fba(fba: FlowByActivity, **_) -> FlowByActivity: .drop(columns=['descendant_flows', 'descendants_y']) ) - return mecs + return mecs.drop(columns=['descendants']) def clean_mapped_mecs_energy_fba(fba: FlowByActivity, **_) -> FlowByActivity: From 5de669d0f00477add53eff213e9f138a62334002 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Jul 2023 07:59:28 -0600 Subject: [PATCH 0650/1127] comment out temp fxn disaggregate_coa_cropland_to_6_digit_naics() which appended attributes --- .../temp_data_source_functions.py | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index 2fc5180bf..8e32e0c10 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -83,26 +83,26 @@ def clean_hfc_fba_for_seea(fba: FlowByActivity, **kwargs): return new_fba - -def disaggregate_coa_cropland_to_6_digit_naics(fba: FlowByActivity): - """ - Disaggregate usda coa cropland to naics 6. Fragile implementation, should - be replaced. In particular, it will break things for any industry - specification other than {'default': 'NAICS_6'}. - :param fba: df, CoA cropland data, FBA format with sector columns - :return: df, CoA cropland with disaggregated NAICS sectors - """ - attributes_to_save = { - attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] - } - - df = coa.disaggregate_coa_cropland_to_6_digit_naics( - fba, fba.config, fba.config, - download_FBA_if_missing=settings.DEFAULT_DOWNLOAD_IF_MISSING - ) - - new_fba = FlowByActivity(df) - for attr in attributes_to_save: - setattr(new_fba, attr, attributes_to_save[attr]) - - return new_fba +# todo: delete after confirming no longer used in FBS methods +# def disaggregate_coa_cropland_to_6_digit_naics(fba: FlowByActivity): +# """ +# Disaggregate usda coa cropland to naics 6. Fragile implementation, should +# be replaced. In particular, it will break things for any industry +# specification other than {'default': 'NAICS_6'}. +# :param fba: df, CoA cropland data, FBA format with sector columns +# :return: df, CoA cropland with disaggregated NAICS sectors +# """ +# attributes_to_save = { +# attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] +# } +# +# df = coa.disaggregate_coa_cropland_to_6_digit_naics( +# fba, fba.config, fba.config, +# download_FBA_if_missing=settings.DEFAULT_DOWNLOAD_IF_MISSING +# ) +# +# new_fba = FlowByActivity(df) +# for attr in attributes_to_save: +# setattr(new_fba, attr, attributes_to_save[attr]) +# +# return new_fba From a4af5fb97838f318ad498c47d2863d155cb22e08 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Jul 2023 08:09:40 -0600 Subject: [PATCH 0651/1127] comment out non-recursive usda coa fxns - delete once confirmed water methods work correctly --- .../data_source_scripts/USDA_CoA_Cropland.py | 624 +++++++++--------- 1 file changed, 312 insertions(+), 312 deletions(-) diff --git a/flowsa/data_source_scripts/USDA_CoA_Cropland.py b/flowsa/data_source_scripts/USDA_CoA_Cropland.py index f2954a75b..75b3586ba 100644 --- a/flowsa/data_source_scripts/USDA_CoA_Cropland.py +++ b/flowsa/data_source_scripts/USDA_CoA_Cropland.py @@ -246,315 +246,315 @@ def coa_cropland_parse(*, df_list, year, **_): return df - -def disaggregate_coa_cropland_to_6_digit_naics( - fba_w_sector, attr, method, **kwargs): - """ - Disaggregate usda coa cropland to naics 6 - :param fba_w_sector: df, CoA cropland data, FBA format with sector columns - :param attr: dictionary, attribute data from method yaml for activity set - :param method: dictionary, FBS method yaml - :param kwargs: dictionary, arguments that might be required for other - functions. Currently includes data source name. - :return: df, CoA cropland with disaggregated NAICS sectors - """ - - # define the activity and sector columns to base modifications on - # these definitions will vary dependent on class type - sector_col = 'SectorConsumedBy' - - # drop rows without assigned sectors - fba_w_sector = fba_w_sector[ - ~fba_w_sector[sector_col].isna()].reset_index(drop=True) - - # modify the flowamounts related to the 6 naics 'orchards' are mapped to - fba_w_sector = equal_allocation(fba_w_sector) - - # use ratios of usda 'land in farms' to determine animal use of - # pasturelands at 6 digit naics - fba_w_sector = disaggregate_pastureland( - fba_w_sector, attr, method, year=attr['allocation_source_year'], - sector_column=sector_col, - download_FBA_if_missing=kwargs['download_FBA_if_missing']) - - # use ratios of usda 'harvested cropland' to determine missing 6 digit - # naics - fba_w_sector = disaggregate_cropland( - fba_w_sector, attr, method, year=attr['allocation_source_year'], - sector_column=sector_col, download_FBA_if_missing=kwargs[ - 'download_FBA_if_missing']) - - return fba_w_sector - - -def disaggregate_coa_cropland_to_6_digit_naics_for_water_withdrawal( - fba_w_sector_load, attr, method, **kwargs): - """ - Disaggregate usda coa cropland to naics 6 - :param fba_w_sector_load: df, CoA cropland data, FBA format with sector - columns - :param attr: dictionary, attribute data from method yaml for activity set - :param method: dictionary, FBS method yaml - :param kwargs: dictionary, arguments that might be required for other - functions. Currently includes data source name. - :return: df, CoA cropland with disaggregated NAICS sectors - """ - - # define the activity and sector columns to base modifications on - # these definitions will vary dependent on class type - sector_col = 'SectorConsumedBy' - - # drop rows without assigned sectors - fba_w_sector = fba_w_sector_load[~fba_w_sector_load[sector_col].isna()]\ - .reset_index(drop=True) - - # modify the flowamounts related to the 6 naics 'orchards' are mapped to - fba_w_sector = equal_allocation(fba_w_sector) - - # todo: add back in once suppression fxn modified to accept non-naics - # like activities and mixed level final naics (naics6 and naics7) - # then estimate any suppressed data by equally allocating parent to - # child naics - # groupcols = list(fba_w_sector3.select_dtypes( - # include=['object', 'int']).columns) - # fba_w_sector = equally_allocate_suppressed_parent_to_child_naics( - # fba_w_sector, method, 'SectorConsumedBy', groupcols) - - # When using irrigated cropland, aggregate sectors to cropland and total - # ag land. Doing this because published values for irrigated harvested - # cropland do not include the water use for vegetables, woody crops, - # berries. - fba_w_sector = fba_w_sector[~fba_w_sector['ActivityConsumedBy'].isin( - ['AG LAND', 'AG LAND, CROPLAND, HARVESTED'])].reset_index(drop=True) - - # use ratios of usda 'land in farms' to determine animal use of - # pasturelands at 6 digit naics - fba_w_sector = disaggregate_pastureland( - fba_w_sector, attr, method, year=attr['allocation_source_year'], - sector_column=sector_col, download_FBA_if_missing=kwargs[ - 'download_FBA_if_missing'], parameter_drop=['1125']) - - # use ratios of usda 'harvested cropland' to determine missing 6 digit - # naics - fba_w_sector = disaggregate_cropland( - fba_w_sector, attr, method, year=attr['allocation_source_year'], - sector_column=sector_col, download_FBA_if_missing=kwargs[ - 'download_FBA_if_missing']) - - return fba_w_sector - - -def disaggregate_pastureland(fba_w_sector, attr, method, year, - sector_column, download_FBA_if_missing, **kwargs): - """ - The USDA CoA Cropland irrigated pastureland data only links - to the 3 digit NAICS '112'. This function uses state - level CoA 'Land in Farms' to allocate the county level acreage data to - 6 digit NAICS. - :param fba_w_sector: df, the CoA Cropland dataframe after linked to sectors - :param attr: dictionary, attribute data from method yaml for activity set - :param method: string, methodname - :param year: str, year of data being disaggregated - :param sector_column: str, the sector column on which to make df - modifications (SectorProducedBy or SectorConsumedBy) - :param download_FBA_if_missing: bool, if True will attempt to load - FBAS used in generating the FBS from remote server prior to - generating if file not found locally - :return: df, the CoA cropland dataframe with disaggregated pastureland data - """ - - # tmp drop NoneTypes - fba_w_sector = replace_NoneType_with_empty_cells(fba_w_sector) - - # subset the coa data so only pastureland - p = fba_w_sector.loc[fba_w_sector[sector_column].apply( - lambda x: x[0:3]) == '112'].reset_index(drop=True) - if len(p) != 0: - # add temp loc column for state fips - p = p.assign(Location_tmp=p['Location'].apply(lambda x: x[0:2])) - - # load usda coa cropland naics - df_f = load_fba_w_standardized_units( - datasource='USDA_CoA_Cropland_NAICS', year=year, flowclass='Land', - download_FBA_if_missing=download_FBA_if_missing) - # subset to land in farms data - df_f = df_f[df_f['FlowName'] == 'FARM OPERATIONS'] - # subset to rows related to pastureland - df_f = df_f.loc[df_f['ActivityConsumedBy'].apply( - lambda x: x[0:3]) == '112'] - # drop rows with "&' - df_f = df_f[~df_f['ActivityConsumedBy'].str.contains('&')] - if 'parameter_drop' in kwargs: - # drop aquaculture because pastureland not used for aquaculture - # drop any activities at a more aggregated sector level because - # will need to be reaggregated after dropping a parameter to - # accurately calculate the allocation ratios - drop_list = [sub[ : -1] for sub in kwargs['parameter_drop']] - drop_list = drop_list + kwargs['parameter_drop'] - df_f = df_f[~df_f['ActivityConsumedBy'].isin(drop_list)] - # create sector columns - df_f = add_sectors_to_flowbyactivity( - df_f, sectorsourcename=method['target_sector_source']) - # estimate suppressed data by equal allocation - df_f = equally_allocate_suppressed_parent_to_child_naics( - df_f, method, 'SectorConsumedBy', fba_wsec_default_grouping_fields) - # create proportional ratios - group_cols = [e for e in fba_wsec_default_grouping_fields if - e not in ('ActivityProducedBy', 'ActivityConsumedBy')] - df_f = allocate_by_sector(df_f, attr, 'proportional', group_cols) - # tmp drop NoneTypes - df_f = replace_NoneType_with_empty_cells(df_f) - # drop naics = '11 - df_f = df_f[df_f[sector_column] != '11'] - # drop 000 in location - df_f = df_f.assign(Location=df_f['Location'].apply(lambda x: x[0:2])) - - # check units before merge - compare_df_units(p, df_f) - # merge the coa pastureland data with land in farm data - df = p.merge(df_f[[sector_column, 'Location', 'FlowAmountRatio']], - how='left', left_on="Location_tmp", right_on="Location") - # multiply the flowamount by the flowratio - df.loc[:, 'FlowAmount'] = df['FlowAmount'] * df['FlowAmountRatio'] - # drop columns and rename - df = df.drop(columns=['Location_tmp', sector_column + '_x', - 'Location_y', 'FlowAmountRatio']) - df = df.rename(columns={sector_column + '_y': sector_column, - "Location_x": 'Location'}) - - # drop rows where sector = 112 and then concat with - # original fba_w_sector - fba_w_sector = fba_w_sector[fba_w_sector[sector_column].apply( - lambda x: x[0:3]) != '112'].reset_index(drop=True) - fba_w_sector = pd.concat([fba_w_sector, df]).reset_index(drop=True) - - # fill empty cells with NoneType - fba_w_sector = replace_strings_with_NoneType(fba_w_sector) - - return fba_w_sector - - -def disaggregate_cropland(fba_w_sector, attr, method, year, - sector_column, download_FBA_if_missing): - """ - In the event there are 4 (or 5) digit naics for cropland - at the county level, use state level harvested cropland to - create ratios - :param fba_w_sector: df, CoA cropland data, FBA format with sector columns - :param attr: dictionary, attribute data from method yaml for activity set - :param method: string, method name - :param year: str, year of data - :param sector_column: str, the sector column on which to make - df modifications (SectorProducedBy or SectorConsumedBy) - :param download_FBA_if_missing: bool, if True will attempt to - load FBAS used in generating the FBS from remote server prior to - generating if file not found locally - :return: df, CoA cropland data disaggregated - """ - - # tmp drop NoneTypes - fba_w_sector = replace_NoneType_with_empty_cells(fba_w_sector) - - # drop pastureland data - crop = fba_w_sector.loc[fba_w_sector[sector_column].apply( - lambda x: x[0:3]) != '112'].reset_index(drop=True) - # drop sectors < 4 digits - crop = crop[crop[sector_column].apply( - lambda x: len(x) > 3)].reset_index(drop=True) - # create tmp location - crop = crop.assign(Location_tmp=crop['Location'].apply(lambda x: x[0:2])) - - # load the relevant state level harvested cropland by naics - naics = load_fba_w_standardized_units( - datasource="USDA_CoA_Cropland_NAICS", year=year, - flowclass='Land', download_FBA_if_missing=download_FBA_if_missing) - # subset the harvested cropland by naics - naics = naics[naics['FlowName'] == - 'AG LAND, CROPLAND, HARVESTED'].reset_index(drop=True) - # drop the activities that include '&' - naics = naics[~naics['ActivityConsumedBy'].str.contains( - '&')].reset_index(drop=True) - # add sectors - naics = add_sectors_to_flowbyactivity( - naics, sectorsourcename=method['target_sector_source']) - # estimate suppressed data by equally allocating parent to child naics - naics = equally_allocate_suppressed_parent_to_child_naics( - naics, method, 'SectorConsumedBy', fba_wsec_default_grouping_fields) - - # aggregate sectors to create any missing naics levels - naics2 = sector_aggregation(naics) - # add missing naics5/6 when only one naics5/6 associated with a naics4 - naics3 = sector_disaggregation(naics2) - # create ratios - naics4 = sector_ratios(naics3, sector_column) - # create temporary sector column to match the two dfs on - naics4 = naics4.assign( - Location_tmp=naics4['Location'].apply(lambda x: x[0:2])) - # tmp drop Nonetypes - naics4 = replace_NoneType_with_empty_cells(naics4) - - # check units in prep for merge - compare_df_units(crop, naics4) - # for loop through naics lengths to determine - # naics 4 and 5 digits to disaggregate - for i in range(4, 6): - # subset df to sectors with length = i and length = i + 1 - crop_subset = crop.loc[crop[sector_column].apply( - lambda x: i + 1 >= len(x) >= i)] - crop_subset = crop_subset.assign( - Sector_tmp=crop_subset[sector_column].apply(lambda x: x[0:i])) - # if duplicates drop all rows - df = crop_subset.drop_duplicates( - subset=['Location', 'Sector_tmp'], - keep=False).reset_index(drop=True) - # drop sector temp column - df = df.drop(columns=["Sector_tmp"]) - # subset df to keep the sectors of length i - df_subset = df.loc[df[sector_column].apply(lambda x: len(x) == i)] - # subset the naics df where naics length is i + 1 - naics_subset = \ - naics4.loc[naics4[sector_column].apply( - lambda x: len(x) == i + 1)].reset_index(drop=True) - naics_subset = naics_subset.assign( - Sector_tmp=naics_subset[sector_column].apply(lambda x: x[0:i])) - # merge the two df based on locations - df_subset = pd.merge( - df_subset, naics_subset[[sector_column, 'FlowAmountRatio', - 'Sector_tmp', 'Location_tmp']], - how='left', left_on=[sector_column, 'Location_tmp'], - right_on=['Sector_tmp', 'Location_tmp']) - # create flow amounts for the new NAICS based on the flow ratio - df_subset.loc[:, 'FlowAmount'] = \ - df_subset['FlowAmount'] * df_subset['FlowAmountRatio'] - # drop rows of 0 and na - df_subset = df_subset[df_subset['FlowAmount'] != 0] - df_subset = df_subset[ - ~df_subset['FlowAmount'].isna()].reset_index(drop=True) - # drop columns - df_subset = df_subset.drop( - columns=[sector_column + '_x', 'FlowAmountRatio', 'Sector_tmp']) - # rename columns - df_subset = df_subset.rename( - columns={sector_column + '_y': sector_column}) - # tmp drop Nonetypes - df_subset = replace_NoneType_with_empty_cells(df_subset) - # add new rows of data to crop df - crop = pd.concat([crop, df_subset]).reset_index(drop=True) - - # clean up df - crop = crop.drop(columns=['Location_tmp']) - - # equally allocate any further missing naics - crop = equally_allocate_parent_to_child_naics(crop, method) - - # pasture data - pasture = \ - fba_w_sector.loc[fba_w_sector[sector_column].apply( - lambda x: x[0:3]) == '112'].reset_index(drop=True) - # concat crop and pasture - fba_w_sector = pd.concat([pasture, crop]).reset_index(drop=True) - - # fill empty cells with NoneType - fba_w_sector = replace_strings_with_NoneType(fba_w_sector) - - return fba_w_sector \ No newline at end of file +# todo: delete +# def disaggregate_coa_cropland_to_6_digit_naics( +# fba_w_sector, attr, method, **kwargs): +# """ +# Disaggregate usda coa cropland to naics 6 +# :param fba_w_sector: df, CoA cropland data, FBA format with sector columns +# :param attr: dictionary, attribute data from method yaml for activity set +# :param method: dictionary, FBS method yaml +# :param kwargs: dictionary, arguments that might be required for other +# functions. Currently includes data source name. +# :return: df, CoA cropland with disaggregated NAICS sectors +# """ +# +# # define the activity and sector columns to base modifications on +# # these definitions will vary dependent on class type +# sector_col = 'SectorConsumedBy' +# +# # drop rows without assigned sectors +# fba_w_sector = fba_w_sector[ +# ~fba_w_sector[sector_col].isna()].reset_index(drop=True) +# +# # modify the flowamounts related to the 6 naics 'orchards' are mapped to +# fba_w_sector = equal_allocation(fba_w_sector) +# +# # use ratios of usda 'land in farms' to determine animal use of +# # pasturelands at 6 digit naics +# fba_w_sector = disaggregate_pastureland( +# fba_w_sector, attr, method, year=attr['allocation_source_year'], +# sector_column=sector_col, +# download_FBA_if_missing=kwargs['download_FBA_if_missing']) +# +# # use ratios of usda 'harvested cropland' to determine missing 6 digit +# # naics +# fba_w_sector = disaggregate_cropland( +# fba_w_sector, attr, method, year=attr['allocation_source_year'], +# sector_column=sector_col, download_FBA_if_missing=kwargs[ +# 'download_FBA_if_missing']) +# +# return fba_w_sector + +# todo: delete +# def disaggregate_coa_cropland_to_6_digit_naics_for_water_withdrawal( +# fba_w_sector_load, attr, method, **kwargs): +# """ +# Disaggregate usda coa cropland to naics 6 +# :param fba_w_sector_load: df, CoA cropland data, FBA format with sector +# columns +# :param attr: dictionary, attribute data from method yaml for activity set +# :param method: dictionary, FBS method yaml +# :param kwargs: dictionary, arguments that might be required for other +# functions. Currently includes data source name. +# :return: df, CoA cropland with disaggregated NAICS sectors +# """ +# +# # define the activity and sector columns to base modifications on +# # these definitions will vary dependent on class type +# sector_col = 'SectorConsumedBy' +# +# # drop rows without assigned sectors +# fba_w_sector = fba_w_sector_load[~fba_w_sector_load[sector_col].isna()]\ +# .reset_index(drop=True) +# +# # modify the flowamounts related to the 6 naics 'orchards' are mapped to +# fba_w_sector = equal_allocation(fba_w_sector) +# +# # todo: add back in once suppression fxn modified to accept non-naics +# # like activities and mixed level final naics (naics6 and naics7) +# # then estimate any suppressed data by equally allocating parent to +# # child naics +# # groupcols = list(fba_w_sector3.select_dtypes( +# # include=['object', 'int']).columns) +# # fba_w_sector = equally_allocate_suppressed_parent_to_child_naics( +# # fba_w_sector, method, 'SectorConsumedBy', groupcols) +# +# # When using irrigated cropland, aggregate sectors to cropland and total +# # ag land. Doing this because published values for irrigated harvested +# # cropland do not include the water use for vegetables, woody crops, +# # berries. +# fba_w_sector = fba_w_sector[~fba_w_sector['ActivityConsumedBy'].isin( +# ['AG LAND', 'AG LAND, CROPLAND, HARVESTED'])].reset_index(drop=True) +# +# # use ratios of usda 'land in farms' to determine animal use of +# # pasturelands at 6 digit naics +# fba_w_sector = disaggregate_pastureland( +# fba_w_sector, attr, method, year=attr['allocation_source_year'], +# sector_column=sector_col, download_FBA_if_missing=kwargs[ +# 'download_FBA_if_missing'], parameter_drop=['1125']) +# +# # use ratios of usda 'harvested cropland' to determine missing 6 digit +# # naics +# fba_w_sector = disaggregate_cropland( +# fba_w_sector, attr, method, year=attr['allocation_source_year'], +# sector_column=sector_col, download_FBA_if_missing=kwargs[ +# 'download_FBA_if_missing']) +# +# return fba_w_sector + +# todo: delete +# def disaggregate_pastureland(fba_w_sector, attr, method, year, +# sector_column, download_FBA_if_missing, **kwargs): +# """ +# The USDA CoA Cropland irrigated pastureland data only links +# to the 3 digit NAICS '112'. This function uses state +# level CoA 'Land in Farms' to allocate the county level acreage data to +# 6 digit NAICS. +# :param fba_w_sector: df, the CoA Cropland dataframe after linked to sectors +# :param attr: dictionary, attribute data from method yaml for activity set +# :param method: string, methodname +# :param year: str, year of data being disaggregated +# :param sector_column: str, the sector column on which to make df +# modifications (SectorProducedBy or SectorConsumedBy) +# :param download_FBA_if_missing: bool, if True will attempt to load +# FBAS used in generating the FBS from remote server prior to +# generating if file not found locally +# :return: df, the CoA cropland dataframe with disaggregated pastureland data +# """ +# +# # tmp drop NoneTypes +# fba_w_sector = replace_NoneType_with_empty_cells(fba_w_sector) +# +# # subset the coa data so only pastureland +# p = fba_w_sector.loc[fba_w_sector[sector_column].apply( +# lambda x: x[0:3]) == '112'].reset_index(drop=True) +# if len(p) != 0: +# # add temp loc column for state fips +# p = p.assign(Location_tmp=p['Location'].apply(lambda x: x[0:2])) +# +# # load usda coa cropland naics +# df_f = load_fba_w_standardized_units( +# datasource='USDA_CoA_Cropland_NAICS', year=year, flowclass='Land', +# download_FBA_if_missing=download_FBA_if_missing) +# # subset to land in farms data +# df_f = df_f[df_f['FlowName'] == 'FARM OPERATIONS'] +# # subset to rows related to pastureland +# df_f = df_f.loc[df_f['ActivityConsumedBy'].apply( +# lambda x: x[0:3]) == '112'] +# # drop rows with "&' +# df_f = df_f[~df_f['ActivityConsumedBy'].str.contains('&')] +# if 'parameter_drop' in kwargs: +# # drop aquaculture because pastureland not used for aquaculture +# # drop any activities at a more aggregated sector level because +# # will need to be reaggregated after dropping a parameter to +# # accurately calculate the allocation ratios +# drop_list = [sub[ : -1] for sub in kwargs['parameter_drop']] +# drop_list = drop_list + kwargs['parameter_drop'] +# df_f = df_f[~df_f['ActivityConsumedBy'].isin(drop_list)] +# # create sector columns +# df_f = add_sectors_to_flowbyactivity( +# df_f, sectorsourcename=method['target_sector_source']) +# # estimate suppressed data by equal allocation +# df_f = equally_allocate_suppressed_parent_to_child_naics( +# df_f, method, 'SectorConsumedBy', fba_wsec_default_grouping_fields) +# # create proportional ratios +# group_cols = [e for e in fba_wsec_default_grouping_fields if +# e not in ('ActivityProducedBy', 'ActivityConsumedBy')] +# df_f = allocate_by_sector(df_f, attr, 'proportional', group_cols) +# # tmp drop NoneTypes +# df_f = replace_NoneType_with_empty_cells(df_f) +# # drop naics = '11 +# df_f = df_f[df_f[sector_column] != '11'] +# # drop 000 in location +# df_f = df_f.assign(Location=df_f['Location'].apply(lambda x: x[0:2])) +# +# # check units before merge +# compare_df_units(p, df_f) +# # merge the coa pastureland data with land in farm data +# df = p.merge(df_f[[sector_column, 'Location', 'FlowAmountRatio']], +# how='left', left_on="Location_tmp", right_on="Location") +# # multiply the flowamount by the flowratio +# df.loc[:, 'FlowAmount'] = df['FlowAmount'] * df['FlowAmountRatio'] +# # drop columns and rename +# df = df.drop(columns=['Location_tmp', sector_column + '_x', +# 'Location_y', 'FlowAmountRatio']) +# df = df.rename(columns={sector_column + '_y': sector_column, +# "Location_x": 'Location'}) +# +# # drop rows where sector = 112 and then concat with +# # original fba_w_sector +# fba_w_sector = fba_w_sector[fba_w_sector[sector_column].apply( +# lambda x: x[0:3]) != '112'].reset_index(drop=True) +# fba_w_sector = pd.concat([fba_w_sector, df]).reset_index(drop=True) +# +# # fill empty cells with NoneType +# fba_w_sector = replace_strings_with_NoneType(fba_w_sector) +# +# return fba_w_sector + +# todo: delete +# def disaggregate_cropland(fba_w_sector, attr, method, year, +# sector_column, download_FBA_if_missing): +# """ +# In the event there are 4 (or 5) digit naics for cropland +# at the county level, use state level harvested cropland to +# create ratios +# :param fba_w_sector: df, CoA cropland data, FBA format with sector columns +# :param attr: dictionary, attribute data from method yaml for activity set +# :param method: string, method name +# :param year: str, year of data +# :param sector_column: str, the sector column on which to make +# df modifications (SectorProducedBy or SectorConsumedBy) +# :param download_FBA_if_missing: bool, if True will attempt to +# load FBAS used in generating the FBS from remote server prior to +# generating if file not found locally +# :return: df, CoA cropland data disaggregated +# """ +# +# # tmp drop NoneTypes +# fba_w_sector = replace_NoneType_with_empty_cells(fba_w_sector) +# +# # drop pastureland data +# crop = fba_w_sector.loc[fba_w_sector[sector_column].apply( +# lambda x: x[0:3]) != '112'].reset_index(drop=True) +# # drop sectors < 4 digits +# crop = crop[crop[sector_column].apply( +# lambda x: len(x) > 3)].reset_index(drop=True) +# # create tmp location +# crop = crop.assign(Location_tmp=crop['Location'].apply(lambda x: x[0:2])) +# +# # load the relevant state level harvested cropland by naics +# naics = load_fba_w_standardized_units( +# datasource="USDA_CoA_Cropland_NAICS", year=year, +# flowclass='Land', download_FBA_if_missing=download_FBA_if_missing) +# # subset the harvested cropland by naics +# naics = naics[naics['FlowName'] == +# 'AG LAND, CROPLAND, HARVESTED'].reset_index(drop=True) +# # drop the activities that include '&' +# naics = naics[~naics['ActivityConsumedBy'].str.contains( +# '&')].reset_index(drop=True) +# # add sectors +# naics = add_sectors_to_flowbyactivity( +# naics, sectorsourcename=method['target_sector_source']) +# # estimate suppressed data by equally allocating parent to child naics +# naics = equally_allocate_suppressed_parent_to_child_naics( +# naics, method, 'SectorConsumedBy', fba_wsec_default_grouping_fields) +# +# # aggregate sectors to create any missing naics levels +# naics2 = sector_aggregation(naics) +# # add missing naics5/6 when only one naics5/6 associated with a naics4 +# naics3 = sector_disaggregation(naics2) +# # create ratios +# naics4 = sector_ratios(naics3, sector_column) +# # create temporary sector column to match the two dfs on +# naics4 = naics4.assign( +# Location_tmp=naics4['Location'].apply(lambda x: x[0:2])) +# # tmp drop Nonetypes +# naics4 = replace_NoneType_with_empty_cells(naics4) +# +# # check units in prep for merge +# compare_df_units(crop, naics4) +# # for loop through naics lengths to determine +# # naics 4 and 5 digits to disaggregate +# for i in range(4, 6): +# # subset df to sectors with length = i and length = i + 1 +# crop_subset = crop.loc[crop[sector_column].apply( +# lambda x: i + 1 >= len(x) >= i)] +# crop_subset = crop_subset.assign( +# Sector_tmp=crop_subset[sector_column].apply(lambda x: x[0:i])) +# # if duplicates drop all rows +# df = crop_subset.drop_duplicates( +# subset=['Location', 'Sector_tmp'], +# keep=False).reset_index(drop=True) +# # drop sector temp column +# df = df.drop(columns=["Sector_tmp"]) +# # subset df to keep the sectors of length i +# df_subset = df.loc[df[sector_column].apply(lambda x: len(x) == i)] +# # subset the naics df where naics length is i + 1 +# naics_subset = \ +# naics4.loc[naics4[sector_column].apply( +# lambda x: len(x) == i + 1)].reset_index(drop=True) +# naics_subset = naics_subset.assign( +# Sector_tmp=naics_subset[sector_column].apply(lambda x: x[0:i])) +# # merge the two df based on locations +# df_subset = pd.merge( +# df_subset, naics_subset[[sector_column, 'FlowAmountRatio', +# 'Sector_tmp', 'Location_tmp']], +# how='left', left_on=[sector_column, 'Location_tmp'], +# right_on=['Sector_tmp', 'Location_tmp']) +# # create flow amounts for the new NAICS based on the flow ratio +# df_subset.loc[:, 'FlowAmount'] = \ +# df_subset['FlowAmount'] * df_subset['FlowAmountRatio'] +# # drop rows of 0 and na +# df_subset = df_subset[df_subset['FlowAmount'] != 0] +# df_subset = df_subset[ +# ~df_subset['FlowAmount'].isna()].reset_index(drop=True) +# # drop columns +# df_subset = df_subset.drop( +# columns=[sector_column + '_x', 'FlowAmountRatio', 'Sector_tmp']) +# # rename columns +# df_subset = df_subset.rename( +# columns={sector_column + '_y': sector_column}) +# # tmp drop Nonetypes +# df_subset = replace_NoneType_with_empty_cells(df_subset) +# # add new rows of data to crop df +# crop = pd.concat([crop, df_subset]).reset_index(drop=True) +# +# # clean up df +# crop = crop.drop(columns=['Location_tmp']) +# +# # equally allocate any further missing naics +# crop = equally_allocate_parent_to_child_naics(crop, method) +# +# # pasture data +# pasture = \ +# fba_w_sector.loc[fba_w_sector[sector_column].apply( +# lambda x: x[0:3]) == '112'].reset_index(drop=True) +# # concat crop and pasture +# fba_w_sector = pd.concat([pasture, crop]).reset_index(drop=True) +# +# # fill empty cells with NoneType +# fba_w_sector = replace_strings_with_NoneType(fba_w_sector) +# +# return fba_w_sector \ No newline at end of file From 1f4ea68124238376f5a8ed447253f76e9104d5b7 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Jul 2023 08:11:08 -0600 Subject: [PATCH 0652/1127] move aspects of clean_usgs fxn to water yaml --- flowsa/data_source_scripts/USGS_NWIS_WU.py | 36 ++++++++++--------- .../flowbysectormethods/Water_common.yaml | 9 +++++ 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/flowsa/data_source_scripts/USGS_NWIS_WU.py b/flowsa/data_source_scripts/USGS_NWIS_WU.py index 0872e9163..6773518e0 100644 --- a/flowsa/data_source_scripts/USGS_NWIS_WU.py +++ b/flowsa/data_source_scripts/USGS_NWIS_WU.py @@ -365,20 +365,23 @@ def usgs_fba_data_cleanup(fba: FlowByActivity) -> FlowByActivity: fba['FlowAmount'] = np.where(fba['Unit'] == 'Bgal/d', fba['FlowAmount'] * 1000, fba['FlowAmount']) fba['Unit'] = np.where(fba['Unit'] == 'Bgal/d', 'Mgal/d', fba['Unit']) + # drop wastewater data + # fba = fba[fba['FlowName'] != 'wastewater'] # drop rows of commercial data (because only exists for 3 states), # causes issues because linked with public supply # also drop closed-loop or once-through cooling (thermoelectric power) # to avoid double counting - vlog.info('Removing all rows for Commercial Data because does not ' - 'exist for all states and causes issues as information ' - 'on Public Supply deliveries.') - dfa = fba[~fba['Description'].str.lower().str.contains( - 'commercial|closed-loop cooling|once-through')] - calculate_flowamount_diff_between_dfs(fba, dfa) + # vlog.info('Removing all rows for Commercial Data because does not ' + # 'exist for all states and causes issues as information ' + # 'on Public Supply deliveries.') + # dfa = fba[~fba['Description'].str.lower().str.contains( + # 'commercial|closed-loop cooling|once-through')] + # calculate_flowamount_diff_between_dfs(fba, dfa) # calculated NET PUBLIC SUPPLY by subtracting out deliveries to domestic vlog.info('Modify the public supply values to generate ' 'NET public supply by subtracting out deliveries to domestic') - dfb = calculate_net_public_supply(dfa) + # dfb = calculate_net_public_supply(dfa) + dfb = calculate_net_public_supply(fba) # check that golf + crop = total irrigation, if not, # assign all of total irrigation to crop @@ -414,7 +417,7 @@ def usgs_fba_data_cleanup(fba: FlowByActivity) -> FlowByActivity: # In 2015, there is data for consumptive water use for # thermo and crop, drop because do not calculate consumptive water loss # for all water categories - dfd = dfd[dfd['Compartment'] != 'air'].reset_index(drop=True) + # dfd = dfd[dfd['Compartment'] != 'air'].reset_index(drop=True) return dfd @@ -448,16 +451,16 @@ def calculate_net_public_supply(df_load: FlowByActivity): 'Thermoelectric Power Closed-loop cooling', 'Thermoelectric Power Once-through cooling'])] # drop duplicate info of "Public Supply deliveries to" - df1_sub = df1_sub.loc[~df1_sub['Description'].str.contains( - "Public Supply total deliveries")] - df1_sub = df1_sub.loc[~df1_sub['Description'].str.contains( - "deliveries from public supply")] + # df1_sub = df1_sub.loc[~df1_sub['Description'].str.contains( + # "Public Supply total deliveries")] + # df1_sub = df1_sub.loc[~df1_sub['Description'].str.contains( + # "deliveries from public supply")] # calculate data drop - vlog.info('Dropping rows that contain "deliveries from public ' - 'supply" to avoid double counting with rows of "Public ' - 'Supply deliveries to"') - calculate_flowamount_diff_between_dfs(df1, df1_sub) + # vlog.info('Dropping rows that contain "deliveries from public ' + # 'supply" to avoid double counting with rows of "Public ' + # 'Supply deliveries to"') + # calculate_flowamount_diff_between_dfs(df1, df1_sub) # drop county level values because cannot use county data vlog.info('Dropping county level public supply withdrawals ' @@ -540,7 +543,6 @@ def check_golf_and_crop_irrigation_totals(df_load: FlowByActivity): :param df_load: df, USGS water use :return: df, FBA with reassigned irrigation water to crop and golf """ - # drop national data df = df_load[df_load['Location'] != '00000'] diff --git a/flowsa/methods/flowbysectormethods/Water_common.yaml b/flowsa/methods/flowbysectormethods/Water_common.yaml index cdf7f9329..7b5f10fd2 100644 --- a/flowsa/methods/flowbysectormethods/Water_common.yaml +++ b/flowsa/methods/flowbysectormethods/Water_common.yaml @@ -47,6 +47,15 @@ source_names: USGS_NWIS_WU: fedefl_mapping: USGS_NWIS_WU geoscale: state + exclusion_fields: + ActivityConsumedBy: + - Commercial + - Thermoelectric Power Closed-loop cooling + - Thermoelectric Power Once-through cooling + FlowName: wastewater + Compartment: air + Description: # prevent double counting with "Public Supply deliveries to" + - Domestic deliveries from public supply, in Mgal/d clean_fba_before_activity_sets: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup activity_sets: From 0650e8752ed9497a0d78031c3953b3def8f10616 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Jul 2023 08:11:50 -0600 Subject: [PATCH 0653/1127] add employment national 2002 fbs --- .../flowbysectormethods/Employment_national_2002.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/Employment_national_2002.yaml diff --git a/flowsa/methods/flowbysectormethods/Employment_national_2002.yaml b/flowsa/methods/flowbysectormethods/Employment_national_2002.yaml new file mode 100644 index 000000000..580169d22 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/Employment_national_2002.yaml @@ -0,0 +1,10 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: national + +source_names: + "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_national + year: 2002 + activity_sets: + qcew: !include:Employment_common.yaml:bls_allocation \ No newline at end of file From eb92732501e1b68032d07a61b891b9f3456186b5 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Jul 2023 08:15:14 -0600 Subject: [PATCH 0654/1127] update water m2 mining and industrial activity set methods - not working correctly --- .../flowbysectormethods/Water_common.yaml | 102 ++++++---- .../Water_national_2015_m2.yaml | 180 +++++++++--------- 2 files changed, 145 insertions(+), 137 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Water_common.yaml b/flowsa/methods/flowbysectormethods/Water_common.yaml index 7b5f10fd2..2ede550d7 100644 --- a/flowsa/methods/flowbysectormethods/Water_common.yaml +++ b/flowsa/methods/flowbysectormethods/Water_common.yaml @@ -25,7 +25,7 @@ sources_to_cache: clean_fba_after_attribution: !clean_function:flowbyclean substitute_nonexistent_values clean_source: USDA_IWMS: - geoscale: national + geoscale: national #todo: check should be national # year: 2018 # specify in year-specific yaml selection_fields: Class: Water @@ -79,49 +79,67 @@ source_names: # attribution_source: Employment_national_2015 # specify in year-specific yaml - industrial_attribution: # use in m2 (instead of employment_attribution) - selection_fields: - PrimaryActivity: - - "Industrial" - attribution_method: proportional - attribution_source: - StatCan_IWS_MI: #todo: convert canadian data to to US FIPS - geoscale: national - selection_fields: - Class: Water - FlowName: "Water intake" - # todo: convert clean fba fxn into this yaml - clean_allocation_fba: !script_function:StatCan_IWS_MI convert_statcan_data_to_US_water_use - attribution_method: proportional - attribution_source: - Employment_national_2015: - geoscale: national +# industrial_attribution: # use in m2 (instead of employment_attribution) +# selection_fields: +# PrimaryActivity: +# - "Industrial" +# attribution_method: proportional +# attribution_source: +# StatCan_IWS_MI: +## year: # select in method +# geoscale: national +# selection_fields: +# Class: Water +# FlowName: "Water intake" +# Location: {'124': '00000'} # replace canadian ISO with FIPS +# LocationSystem: {'ISO': 'FIPS_2015'} +# # todo: convert clean fba fxn into this yaml +## clean_allocation_fba: !script_function:StatCan_IWS_MI convert_statcan_data_to_US_water_use +# attribution_method: division +# attribution_source: +# StatCan_GDP: +## year: # select in method +# selection_fields: +# Class: Money +# Location: {'124': '00000'} # replace canadian ISO with FIPS +# LocationSystem: {'ISO': 'FIPS_2015'} +# attribution_method: multiplication +# attribution_source: +# BEA_GDP_GrossOutput: +## year: # select in method +# selection_fields: Money +# attribution_method: proportional +# attribution_source: +## Employment_national_2015: # select in method +# geoscale: national - mining_attribution: # use in m2 (instead of employment_attribution) - selection_fields: - PrimaryActivity: - - "Mining" - attribution_method: proportional - attribution_source: - Blackhurst_IO: - year: 2002 - geoscale: national - selection_fields: - Class: Water - FlowName: "Water Withdrawals IO Vector" - attribution_method: multiplication - attribution_source: - BEA_Make_AR: - year: 2002 - selection_fields: - Class: Money - # todo: make sure attributing on location and activity - attribution_method: proportional - attribution_source: - Employment_national_2002: - geoscale: national - clean_fba_after_attribution: !script_function:Blackhurst_IO scale_blackhurst_results_to_usgs_values +# mining_attribution: # use in m2 (instead of employment_attribution) +# geoscale: national +# selection_fields: +# PrimaryActivity: +# - "Mining" +# attribution_method: proportional +# attribution_source: +# Blackhurst_IO: +# year: 2002 +# geoscale: national +# selection_fields: +# Class: Water +# FlowName: "Water Withdrawals IO Vector" +# attribute: +# # convert to kg/year for 2002 +# - attribution_method: multiplication +# attribution_source: +# BEA_Make_AR: +# year: 2002 +# selection_fields: +# Class: Money +# attribution_method: proportional +# attribution_source: Employment_national_2002 +# # scale to year of USGS data +# - attribution_method: multiplication +## attribution_source: Employment_national_2015 # specify in method cropland_attribution: # use in m1, m2 diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m2.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m2.yaml index 137e18c6a..812f9519c 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m2.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m2.yaml @@ -1,107 +1,97 @@ +# This is the 2015 target year method for water m2 which builds off the generic +# method in Water_common + industry_spec: default: NAICS_6 -year: 2015 +year: &year 2015 target_naics_year: 2012 geoscale: national +sources_to_cache: + USDA_IWMS: + !include:Water_common.yaml:sources_to_cache:USDA_IWMS + year: 2018 + source_names: USGS_NWIS_WU: - fedefl_mapping: USGS_NWIS_WU - geoscale: state - selection_fields: - Class: Water # not necessary to define - clean_fba_before_activity_sets: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup - activity_sets: + !include:Water_common.yaml:source_names:USGS_NWIS_WU + activity_sets: # do not import all activity sets from the common file because common file contains activity sets for multiple methods # direct_attribution: -# selection_fields: -# PrimaryActivity: -# - "Aquaculture" -# - "Irrigation Golf Courses" -# - "Public Supply" -# - "Thermoelectric Power" -# - "Domestic" -# attribute: -# attribution_method: direct - industrial: +# !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:direct_attribution + mining_attribution: +# !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:mining_attribution + geoscale: national + selection_fields: + PrimaryActivity: + - "Mining" + attribution_method: proportional + attribution_source: + Blackhurst_IO: + year: 2002 + geoscale: national + selection_fields: + Class: Water + FlowName: "Water Withdrawals IO Vector" + attribute: + # convert to kg/year for 2002 + - attribution_method: multiplication + attribution_source: + BEA_Make_AR: + year: 2002 + selection_fields: + Class: Money + attribution_method: proportional + attribution_source: Employment_national_2002 + # scale to year of USGS data + - attribution_method: multiplication + attribution_source: Employment_national_2015 + industrial_attribution: +# !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:industrial_attribution selection_fields: PrimaryActivity: - "Industrial" - attribute: - attribution_method: proportional - attribution_source: - StatCan_IWS_MI: #todo: convert canadian data to to US FIPS - geoscale: national - selection_fields: - Class: Water - FlowName: "Water intake" - # todo: convert clean fba fxn into this yaml - clean_allocation_fba: !script_function:StatCan_IWS_MI convert_statcan_data_to_US_water_use - attribute: - attribution_method: proportional + attribution_method: proportional + attribution_source: + StatCan_IWS_MI: + year: 2015 + geoscale: national + selection_fields: + Class: Water + FlowName: "Water intake" + Location: {'124': '00000'} # replace canadian ISO with FIPS + LocationSystem: {'ISO': 'FIPS_2015'} + # todo: convert clean fba fxn into this yaml +# clean_allocation_fba: !script_function:StatCan_IWS_MI convert_statcan_data_to_US_water_use + attribution_method: division + attribution_source: + StatCan_GDP: + year: 2015 + selection_fields: + Class: Money + Location: {'124': '00000'} # replace canadian ISO with FIPS + LocationSystem: {'ISO': 'FIPS_2015'} + attribution_method: multiplication attribution_source: - Employment_national_2015: - geoscale: national -# mining: -# selection_fields: -# PrimaryActivity: -# - "Mining" -# attribtute: -# attribution_method: proportional -# attribution_source: -# Blackhurst_IO: -# year: 2002 -# geoscale: national -# selection_fields: -# Class: Water -# FlowName: "Water Withdrawals IO Vector" -# attribute: -# attribution_method: multiplication -# attribution_source: -# BEA_Make_AR: -# year: 2002 -# selection_fields: -# Class: Money -# attribute: -# # todo: make sure attributing on location and activity -# attribution_method: proportional -# attribution_source: -# Employment_national_2002: -# geoscale: national -# clean_fba_after_attribution: !script_function:Blackhurst_IO scale_blackhurst_results_to_usgs_values -# activity_set_4: -# names: -# - "Irrigation Crop" -# allocation_method: proportional -# allocation_source: "USDA_IWMS" -# allocation_source_class: "Land" -# allocation_source_year: 2018 -# allocation_flow: None -# allocation_compartment: None -# allocation_from_scale: state -# clean_allocation_fba_w_sec: !script_function:USDA_IWMS disaggregate_iwms_to_6_digit_naics_for_water_withdrawal -# helper_source: "USDA_IWMS" -# helper_method: multiplication -# helper_source_class: "Water" -# helper_source_year: 2018 -# helper_flow: None -# helper_from_scale: state -# activity_set_5: -# names: -# - "Livestock" -# allocation_method: proportional -# allocation_source: "USDA_CoA_Livestock" -# allocation_source_class: "Other" -# allocation_source_year: 2017 -# allocation_flow: -# - "HEAD" -# - "NUMBER" -# - "COLONIES" -# allocation_compartment: -# - "NOT SPECIFIED" -# allocation_from_scale: state -# helper_source: "USGS_WU_Coef" -# helper_method: multiplication -# helper_source_class: "Water" -# helper_source_year: 2005 -# helper_flow: None -# helper_from_scale: national + BEA_GDP_GrossOutput: + year: 2015 + activity_to_sector_mapping: BEA_2012_Detail + selection_fields: + Class: Money + attribution_method: proportional + attribution_source: + Employment_national_2015: + geoscale: national + cropland_attribution: + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland: + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution:attribution_source:USDA_CoA_Cropland + year: 2017 + livestock_attribution: + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:livestock_attribution + attribution_method: proportional + attribution_source: + USDA_CoA_Livestock: + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:livestock_attribution:attribution_source:USDA_CoA_Livestock + year: 2017 From 027477daa40bb7688e4f3a25d69f2348937f534f Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Jul 2023 08:16:18 -0600 Subject: [PATCH 0655/1127] specify employment attribution source in water m1 fbs yaml instead of water_common --- flowsa/methods/flowbysectormethods/Water_common.yaml | 4 +++- .../methods/flowbysectormethods/Water_national_2010_m1.yaml | 4 +++- .../methods/flowbysectormethods/Water_national_2015_m1.yaml | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Water_common.yaml b/flowsa/methods/flowbysectormethods/Water_common.yaml index 2ede550d7..30d4db991 100644 --- a/flowsa/methods/flowbysectormethods/Water_common.yaml +++ b/flowsa/methods/flowbysectormethods/Water_common.yaml @@ -76,7 +76,9 @@ source_names: - "Industrial" - "Mining" attribution_method: proportional -# attribution_source: Employment_national_2015 # specify in year-specific yaml +# attribution_source: # specify in year-specific yaml +# Employment_national_20XX: # specify in method +# geoscale: # specify in method # industrial_attribution: # use in m2 (instead of employment_attribution) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2010_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2010_m1.yaml index f545249c5..132927e2b 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2010_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2010_m1.yaml @@ -21,7 +21,9 @@ source_names: employment_attribution: !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:employment_attribution attribution_method: proportional - attribution_source: Employment_national_2010 + attribution_source: + Employment_national_2010: + geoscale: national cropland_attribution: !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution attribution_method: proportional diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index c48ca8a56..aa27b08e3 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -21,7 +21,9 @@ source_names: employment_attribution: !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:employment_attribution attribution_method: proportional - attribution_source: Employment_national_2015 + attribution_source: + Employment_national_2015: + geoscale: national cropland_attribution: !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution attribution_method: proportional From 4f19576423359b4a940a678e852785191dbbfd1f Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Jul 2023 08:18:09 -0600 Subject: [PATCH 0656/1127] add new attribution method - division and update units in the multiplication method --- flowsa/flowby.py | 93 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 89 insertions(+), 4 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index ee37f35f7..0d89375f5 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -692,6 +692,14 @@ def attribute_flows_to_sectors( ) attributed_fb = fb.multiplication_attribution(attribution_fbs) + elif attribution_method == 'division': + log.info(f"Dividing {self.full_name} by {attribution_name}") + attribution_fbs = fb.load_prepare_attribution_source( + attribution_config=step_config, + download_sources_ok=download_sources_ok + ) + attributed_fb = fb.division_attribution(attribution_fbs) + elif attribution_method == 'inheritance': log.info(f'Directly attributing {self.full_name} to sectors, child ' 'sectors inherent parent values.') @@ -1080,14 +1088,15 @@ def multiplication_attribution( This method takes flows from the calling FBA which are mapped to multiple sectors and multiplies them by flows from other (an FBS). """ + # determine units in each dataset + self_units = self['Unit'].drop_duplicates().tolist() + other_units = other['Unit'].drop_duplicates().tolist() - log.info('Multiplying flows in %s by %s.', - self.full_name, other.full_name) + log.info(f'Multiplying flows in {self.full_name} {self_units} by' + f' {other.full_name} {other_units}') fb_geoscale, other_geoscale, fb, other = self.harmonize_geoscale( other) - # todo: update units after multiplying - # multiply using each dfs primary sector col merged = (fb .merge(other, @@ -1120,6 +1129,81 @@ def multiplication_attribution( fb_null.Location)) ) + fb = fb[fb['FlowAmount'] != 0] + + # set new units, incorporating a check that units are correctly + # converted + if fb['Unit'].str.contains('/').all(): + fb['Denominator'] = fb['Unit'].str.split("/",1).str[1] + fb['Unit'] = fb['Unit'].str.split("/",1).str[0] + if fb['Unit_other'].equals(fb['Denominator']) is False: + log.warning('Check units being multiplied') + else: + log.info(f"Units reset to {fb['Unit'].drop_duplicates().tolist()}") + + return ( + fb + .drop(columns=['PrimarySector', 'SecondarySector', + 'temp_location', 'group_total', 'Unit_other', + 'Denominator'], + errors='ignore') + .reset_index(drop=True) + ) + + + def division_attribution( + self: 'FB', + other: 'FlowBySector' + ) -> 'FlowByActivity': + """ + This method takes flows from the calling FBA which are mapped to + multiple sectors and divides them by flows from other (an FBS). + """ + + # determine units in each dataset + self_units = self['Unit'].drop_duplicates().tolist() + other_units = other['Unit'].drop_duplicates().tolist() + + log.info(f'Dividing flows in {self.full_name} {self_units} by' + f' {other.full_name} {other_units}') + fb_geoscale, other_geoscale, fb, other = self.harmonize_geoscale( + other) + + # divide using each dfs primary sector col + merged = (fb + .merge(other, + how='left', + left_on=['PrimarySector', 'temp_location' + if 'temp_location' in fb + else 'Location'], + right_on=['PrimarySector', 'Location'], + suffixes=[None, '_other']) + .fillna({'FlowAmount_other': 0}) + ) + + fb = (merged + .assign(FlowAmount=lambda x: (x.FlowAmount + / x.FlowAmount_other)) + .drop(columns=['PrimarySector_other', 'Location_other', + 'FlowAmount_other', 'denominator'], + errors='ignore') + ) + + # determine if any flows are lost because multiplied by 0 + fb_null = fb[fb['FlowAmount'] == 0] + if len(fb_null) > 0: + log.warning('FlowAmounts in %s are reset to 0 due to lack of ' + 'flows in attribution source %s for ' + 'ActivityProducedBy/ActivityConsumedBy/Location: %s', + fb.full_name, other.full_name, + set(zip(fb_null.ActivityProducedBy, + fb_null.ActivityConsumedBy, + fb_null.Location)) + ) + + # set new units + fb['Unit'] = fb['Unit'] + '/' + fb['Unit_other'] + return ( fb .drop(columns=['PrimarySector', 'SecondarySector', @@ -1128,6 +1212,7 @@ def multiplication_attribution( .reset_index(drop=True) ) + def add_primary_secondary_columns( self: FB, col_type: Literal['Activity', 'Sector'] From 7835c1621be30dd44b18fa1ebb2d8b008ab98854 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Jul 2023 08:22:06 -0600 Subject: [PATCH 0657/1127] determine sector length using sector crosswalk instead of taking string length to account for household and gov't codes in equally_attribute() and estimate_suppressed_sectors_equal_attribution() --- flowsa/flowby.py | 12 +++---- flowsa/flowbyclean.py | 55 +++++++++++++++++++---------- flowsa/naics.py | 82 ++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 124 insertions(+), 25 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 0d89375f5..564d318ab 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1999,18 +1999,18 @@ def equally_attribute(self: 'FlowByActivity') -> 'FlowByActivity': SectorConsumedBy). If necessary, flow amounts are further (equally) subdivided based on the secondary sector. ''' + naics_key = naics.map_target_sectors_to_less_aggregated_sectors( + self.config['industry_spec']) + fba = self.add_primary_secondary_columns('Sector') - # todo: update to use the sector length crosswalk instead of string - # length, or else will have issues with household/government - # attribution groupby_cols = ['group_id'] for rank in ['Primary', 'Secondary']: fba = ( fba + .merge(naics_key, how='left', left_on=f'{rank}Sector', + right_on='target_naics') .assign( - **{f'_naics_{n}': fba[f'{rank}Sector'].str.slice(stop=n) - for n in range(2, 8)}, **{f'_unique_naics_{n}_by_group': lambda x, i=n: ( x.groupby(groupby_cols if i == 2 else [*groupby_cols, f'_naics_{i-1}'], @@ -2025,12 +2025,12 @@ def equally_attribute(self: 'FlowByActivity') -> 'FlowByActivity': for n in range(2, 8)]] ) ) + .drop(columns=naics_key.columns.values.tolist()) ) groupby_cols.append(f'{rank}Sector') return fba.drop( columns=['PrimarySector', 'SecondarySector', - *[f'_naics_{n}' for n in range(2, 8)], *[f'_unique_naics_{n}_by_group' for n in range(2, 8)]] ) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index b1f3750ec..464a04df4 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -3,7 +3,7 @@ from flowsa.flowby import FlowByActivity, FlowBySector, FB from flowsa.flowsa_log import log from flowsa import (flowby, geo, location, getFlowBySector, flowbyfunctions) - +from flowsa.naics import map_source_sectors_to_less_aggregated_sectors def return_primary_activity_column(fba: FlowByActivity) -> \ FlowByActivity: @@ -178,26 +178,40 @@ def estimate_suppressed_sectors_equal_attribution( :param fba: :return: """ + # todo: update function to work for any number of sector lengths + # todo: update to loop through both sector columns, see equally_attribute() + + naics_key = map_source_sectors_to_less_aggregated_sectors() + # forward fill + naics_key = naics_key.T.ffill().T col = return_primary_activity_column(fba) + + # todo: don't drop these grouped sectors, instead, incorporate into fxn + fba = fba[~fba[col].isin( + ['1125 & 1129', '11193 & 11194 & 11199'])].reset_index(drop=True) + indexed = ( fba - .assign(n2=fba[col].str.slice(stop=2), - n3=fba[col].str.slice(stop=3), - n4=fba[col].str.slice(stop=4), - n5=fba[col].str.slice(stop=5), - n6=fba[col].str.slice(stop=6), - n7=fba[col].str.slice(stop=7), - location=fba.Location, + .merge(naics_key, how='left', left_on=col, + right_on='source_naics') + .drop(columns='source_naics') + .assign(location=fba.Location, category=fba.FlowName) .replace({'FlowAmount': {0: np.nan}, - col: {'31-33': '3X', - '44-45': '4X', - '48-49': '4Y'}, - 'n2': {'31': '3X', '32': '3X', '33': '3X', - '44': '4X', '45': '4X', - '48': '4Y', '49': '4Y'}}) - .set_index(['n2', 'n3', 'n4', 'n5', 'n6', 'location', 'category'], + # col: {'1125 & 1129': '112X' #, + # '11193 & 11194 & 11199': '1119X', + # '31-33': '3X', + # '44-45': '4X', + # '48-49': '4Y'}, + # 'n2': {'31': '3X', '32': '3X', '33': '3X', + # '44': '4X', '45': '4X', + # '48': '4Y', '49': '4Y'}, + # 'n4': {'1125': '112X', '1129': '112X'}, + # 'n5': {'11193': '1119X', '11194': '1119X', '11199': '1119X'} + }) + .set_index(['n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'location', + 'category'], verify_integrity=True) ) @@ -238,15 +252,20 @@ def fill_suppressed( x.groupby(level=['n2', 'n3', 'n4', 'n5', 'location', 'category'])['FlowAmount'] .transform(fill_suppressed, 5, x[col]))) + .assign( + FlowAmount=lambda x: ( + x.groupby(level=['n2', 'n3', 'n4', 'n5', 'n6', + 'location', 'category'])['FlowAmount'] + .transform(fill_suppressed, 6, x[col]))) .fillna({'FlowAmount': 0}) .reset_index(drop=True) ) aggregated = ( unsuppressed - .replace({col: {'3X': '31-33', - '4X': '44-45', - '4Y': '48-49'}}) + # .replace({col: {'3X': '31-33', + # '4X': '44-45', + # '4Y': '48-49'}}) .aggregate_flowby() ) diff --git a/flowsa/naics.py b/flowsa/naics.py index ea85226f4..211b85880 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -67,7 +67,7 @@ def industry_spec_key( pd.DataFrame({'source_naics': non_naics, 'target_naics': non_naics})]) - # drop source_naics that are more aggregated than target_naics, reorder + # drop nans naics_key = (naics_key[['source_naics', 'target_naics']] .dropna() .drop_duplicates() @@ -78,6 +78,86 @@ def industry_spec_key( return naics_key +def map_target_sectors_to_less_aggregated_sectors( + industry_spec: dict, + year: Literal[2002, 2007, 2012, 2017] = 2012 +) -> pd.DataFrame: + """ + Map target NAICS to all possible other sector lengths + """ + + naics = naics_crosswalk.assign( + target_naics=naics_crosswalk[industry_spec['default']]) + for level, industries in industry_spec.items(): + if level not in ['default', 'non_naics']: + naics['target_naics'] = naics['target_naics'].mask( + naics.drop(columns='target_naics').isin(industries).any(axis='columns'), + naics[level] + ) + + # todo: add user-specified non-naics + # if 'non_naics' in industry_spec: + # non_naics = industry_spec['non_naics'] + # if isinstance(non_naics, str): + # non_naics = [non_naics] + # naics_key = pd.concat([naics_key, + # pd.DataFrame({'source_naics': non_naics, + # 'target_naics': non_naics})]) + + # drop source_naics that are more aggregated than target_naics, reorder + for n in (2, 7): + naics[f'NAICS_{n}'] = np.where( + naics[f'NAICS_{n}'].str.len() > naics['target_naics'].str.len(), + np.nan, + naics[f'NAICS_{n}']) + + # rename columns to align with previous code + naics = naics.rename(columns={'NAICS_2': '_naics_2', + 'NAICS_3': '_naics_3', + 'NAICS_4': '_naics_4', + 'NAICS_5': '_naics_5', + 'NAICS_6': '_naics_6', + 'NAICS_7': '_naics_7'} + ) + + return naics.drop_duplicates().reset_index(drop=True) + + +def map_source_sectors_to_less_aggregated_sectors( + year: Literal[2002, 2007, 2012, 2017] = 2012 +) -> pd.DataFrame: + """ + Map target NAICS to all possible other sector lengths + """ + naics = [] + for n in naics_crosswalk.columns.values.tolist(): + naics_sub = naics_crosswalk.assign(source_naics=naics_crosswalk[n]) + naics.append(naics_sub) + + # concat data into single dataframe + naics_key = pd.concat(naics, sort=False) + naics_key = naics_key.dropna(subset=['source_naics']) + + # drop source_naics that are more aggregated than target_naics, reorder + for n in range(2, 8): + naics_key[f'NAICS_{n}'] = np.where( + naics_key[f'NAICS_{n}'].str.len() > naics_key[ + 'source_naics'].str.len(), + np.nan, + naics_key[f'NAICS_{n}']) + + # rename columns to align with previous code + naics_key = naics_key.rename(columns={'NAICS_2': 'n2', + 'NAICS_3': 'n3', + 'NAICS_4': 'n4', + 'NAICS_5': 'n5', + 'NAICS_6': 'n6', + 'NAICS_7': 'n7'} + ) + + return naics_key.drop_duplicates() + + def year_crosswalk( source_year: Literal[2002, 2007, 2012, 2017], target_year: Literal[2002, 2007, 2012, 2017] From 4b1234e72143064a75d41950b1b27861843fbefb Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Jul 2023 13:39:00 -0600 Subject: [PATCH 0658/1127] remove sector-like_activities from readme --- flowsa/data/README.md | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/flowsa/data/README.md b/flowsa/data/README.md index 48c0408e6..1a6bec0ea 100644 --- a/flowsa/data/README.md +++ b/flowsa/data/README.md @@ -4,17 +4,8 @@ Flow-By-Activity. ## Term descriptions - _class_: list, classes such as "Water" found in the Flow-By-Activity -- _sector-like_activities_: 'True' or 'False', “sector-like activities” are - True when the Flow-By-Activity “ActivityProducedBy” and - “ActivityConsumedBy” columns are already NAICS based. For example, all - BLS QCEW data for employment and establishments are published by NAICS - codes. We deem these “sector-like” because we then implement checks to - determine if the activities are published in the identified NAICS year in the - Flow-By-Sector and if not, we have a crosswalk to map the sectors/NAICS - to NAICS year. -- _activity_schema_: 'None' if 'sector-like_activities' is False, otherwise - the year of the sector data - (ex. NAICS_2012_Code) +- _activity_schema_: 'None' if activities are not NAICS-based, + otherwise the year of the sector data (ex. NAICS_2012_Code) - _sector_hierarchy_: 'parent' or 'parent-completeChild' or 'parent-incompleteChild'. Some dataset crosswalks contain every level of relevant sectors (ex. NAICS for 2-6 digits), that is they are fully From 2b90ceeed0b0a5604ed59c6448086883be64e12e Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Jul 2023 13:39:34 -0600 Subject: [PATCH 0659/1127] update unit conversion for gallons/animals --- flowsa/data/unit_conversion.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/data/unit_conversion.csv b/flowsa/data/unit_conversion.csv index d8948f902..85812db30 100644 --- a/flowsa/data/unit_conversion.csv +++ b/flowsa/data/unit_conversion.csv @@ -4,7 +4,7 @@ Acres,m2,4046.856422 million sq ft,m2,92903 million square feet,m2,92903 square feet,m2,0.092903 -gallons/animal,kg/animal,3.79 +gallons/animal,kg/p,3.79 Mgal,kg,3790000 Bgal,kg,3790000000 gal,kg,3.79 @@ -17,7 +17,7 @@ MT,kg,1000 LB,kg,0.45359 ACRE FEET / ACRE,kg/m2,304.8000006 gal/USD,kg/USD,3.79 -Quadrillion Btu,MJ,1.05506E+12 +Quadrillion Btu,MJ,1.06E+12 Trillion Btu,MJ,1055055900 Tbtu,MJ,1055055900 MT CO2e,MMT CO2e,0.000001 From 80316acd2847d9fa9ad7b0820b10c454145df3e3 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Jul 2023 13:40:07 -0600 Subject: [PATCH 0660/1127] comment out old blackhurst_IO code --- flowsa/data_source_scripts/Blackhurst_IO.py | 320 ++++++++++---------- 1 file changed, 156 insertions(+), 164 deletions(-) diff --git a/flowsa/data_source_scripts/Blackhurst_IO.py b/flowsa/data_source_scripts/Blackhurst_IO.py index 47150db9d..0cde1e20a 100644 --- a/flowsa/data_source_scripts/Blackhurst_IO.py +++ b/flowsa/data_source_scripts/Blackhurst_IO.py @@ -7,19 +7,11 @@ Includes supporting functions for Blackhurst paper data. """ -import io from tabula.io import read_pdf import pandas as pd -import numpy as np -from flowsa.allocation import \ - proportional_allocation_by_location_and_activity from flowsa.location import US_FIPS -from flowsa.flowbyfunctions import assign_fips_location_system, \ - load_fba_w_standardized_units -from flowsa.sectormapping import add_sectors_to_flowbyactivity +from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.settings import externaldatapath -from flowsa.validation import compare_df_units -from flowsa.flowby import FlowBySector def bh_parse(*, df_list, **_): @@ -59,158 +51,158 @@ def bh_parse(*, df_list, **_): return df -def convert_blackhurst_data_to_kg_per_year(df, **kwargs): - """ - Load BEA Make After Redefinition data to convert Blackhurst IO - dataframe units to gallon per year - :param df: df, FBA format - :param kwargs: kwargs includes "attr" - dictionary, attribute - data from method yaml for activity set - :return: transformed fba df - """ - - # load the bea make table - bmt = load_fba_w_standardized_units( - datasource='BEA_Make_AR', - year=kwargs['attr']['allocation_source_year'], - flowclass='Money', - download_FBA_if_missing=kwargs['download_FBA_if_missing']) - # drop rows with flowamount = 0 - bmt = bmt[bmt['FlowAmount'] != 0] - - # check on units of dfs before merge - compare_df_units(df, bmt) - bh_df_revised = pd.merge( - df, bmt[['FlowAmount', 'ActivityProducedBy', 'Location']], - left_on=['ActivityConsumedBy', 'Location'], - right_on=['ActivityProducedBy', 'Location']) - - bh_df_revised.loc[:, 'FlowAmount'] = ((bh_df_revised['FlowAmount_x']) * - (bh_df_revised['FlowAmount_y'])) - bh_df_revised.loc[:, 'Unit'] = 'kg' - # drop columns - bh_df_revised = bh_df_revised.drop(columns=["FlowAmount_x", "FlowAmount_y", - 'ActivityProducedBy_y']) - bh_df_revised = bh_df_revised.rename(columns={"ActivityProducedBy_x": - "ActivityProducedBy"}) - - return bh_df_revised - - -def convert_blackhurst_data_to_kg_per_employee( - df_wsec, attr, method, **kwargs): - """ - Load BLS employment data and use to transform original units to - gallons per employee - :param df_wsec: df, includes sector columns - :param attr: dictionary, attribute data from method yaml for activity set - :param method: dictionary, FBS method yaml - :return: df, transformed fba dataframe with sector columns - """ - - # load 2002 employment data - bls = load_fba_w_standardized_units( - datasource='BLS_QCEW', year='2002', - flowclass='Employment', geographic_level='national', - download_FBA_if_missing=kwargs['download_FBA_if_missing']) - - # assign naics to allocation dataset - bls_wsec = add_sectors_to_flowbyactivity( - bls, sectorsourcename=method['target_sector_source']) - # drop rows where sector = None ( does not occur with mining) - bls_wsec = bls_wsec[~bls_wsec['SectorProducedBy'].isnull()] - bls_wsec = bls_wsec.rename(columns={'SectorProducedBy': 'Sector', - 'FlowAmount': 'HelperFlow'}) - - # check units before merge - compare_df_units(df_wsec, bls_wsec) - # merge the two dfs - df = pd.merge(df_wsec, - bls_wsec[['Location', 'Sector', 'HelperFlow']], - how='left', - left_on=['Location', 'SectorConsumedBy'], - right_on=['Location', 'Sector']) - # drop any rows where sector is None - df = df[~df['Sector'].isnull()] - # fill helperflow values with 0 - df['HelperFlow'] = df['HelperFlow'].fillna(0) - - # calculate proportional ratios - df_wratio = proportional_allocation_by_location_and_activity(df, 'Sector') - - df_wratio = df_wratio.rename(columns={'FlowAmountRatio': 'EmployeeRatio', - 'HelperFlow': 'Employees'}) - - # drop rows where helperflow = 0 - df_wratio = df_wratio[df_wratio['Employees'] != 0] - - # calculate gal/employee in 2002 - df_wratio.loc[:, 'FlowAmount'] = \ - (df_wratio['FlowAmount'] * df_wratio['EmployeeRatio']) / \ - df_wratio['Employees'] - df_wratio.loc[:, 'Unit'] = 'kg/p' - - # drop cols - df_wratio = df_wratio.drop( - columns=['Sector', 'Employees', 'EmployeeRatio']) - - return df_wratio - - -def scale_blackhurst_results_to_usgs_values(fbs: FlowBySector, **_) -> \ - FlowBySector: - """ - Scale the initial estimates for Blackhurst-based mining estimates to - USGS values. Oil-based sectors are allocated a larger percentage of the - difference between initial water withdrawal estimates and published USGS - values. - - This method is based off the Water Satellite Table created by Yang and - Ingwersen, 2017 - :param df_load: df, fba dataframe to be modified - :param attr: dictionary, attribute data from method yaml for activity set - :param download_FBA_if_missing: bool, indicate if missing FBAs should be - downloaded from Data Commons - :return: scaled fba results - """ - from flowsa.flowbyclean import load_prepare_clean_source - # determine national level published withdrawal data for usgs mining - # in FBS method year - # pv_load = load_fba_w_standardized_units( - # datasource="USGS_NWIS_WU", year=fbs.config['year'], - # flowclass='Water', download_FBA_if_missing=download_FBA_if_missing) - # - # pv_sub = pv_load[(pv_load['ActivityConsumedBy'] == 'Mining') & - # (pv_load['Compartment'] == 'total') & - # (pv_load['FlowName'] == 'total')].reset_index(drop=True) - pv_sub = load_prepare_clean_source(fbs) - pv_sub_sum = pv_sub['FlowAmount'].sum() - - # rename the published value flow name and merge with Blackhurst data - pv_sub = pv_sub.rename(columns={'FlowAmount': 'pv'}) - df = fbs.merge(pv_sub[['SectorConsumedBy', 'Location', 'pv']], how='left') - # calculate the difference between published value and allocated value - # for each naics length - df = df.assign(nLen=df['SectorConsumedBy'].apply(lambda x: len(x))) - # calculate initial FlowAmount accounted for - df = df.assign(av=df.groupby('nLen')['FlowAmount'].transform('sum')) - # calc difference - df = df.assign(vd=df['pv'] - df['av']) - - # subset df to scale into oil and non-oil sectors - df['sector_label'] = np.where(df['SectorConsumedBy'].apply( - lambda x: x[0:5] == '21111'), 'oil', 'nonoil') - df['ratio'] = np.where(df['sector_label'] == 'oil', 2 / 3, 1 / 3) - df['label_sum'] = df.groupby(['Location', 'nLen', 'sector_label'])[ - 'FlowAmount'].transform('sum') - - # calculate revised water withdrawal allocation - df_scaled = df.copy() - df_scaled.loc[:, 'FlowAmount'] = \ - df_scaled['FlowAmount'] + \ - (df_scaled['FlowAmount'] / df_scaled['label_sum']) * \ - (df_scaled['ratio'] * df_scaled['vd']) - df_scaled = df_scaled.drop(columns=['sector_label', 'ratio', 'nLen', - 'label_sum', 'pv', 'av', 'vd']) - - return df_scaled +# def convert_blackhurst_data_to_kg_per_year(df, **kwargs): +# """ +# Load BEA Make After Redefinition data to convert Blackhurst IO +# dataframe units to gallon per year +# :param df: df, FBA format +# :param kwargs: kwargs includes "attr" - dictionary, attribute +# data from method yaml for activity set +# :return: transformed fba df +# """ +# +# # load the bea make table +# bmt = load_fba_w_standardized_units( +# datasource='BEA_Make_AR', +# year=kwargs['attr']['allocation_source_year'], +# flowclass='Money', +# download_FBA_if_missing=kwargs['download_FBA_if_missing']) +# # drop rows with flowamount = 0 +# bmt = bmt[bmt['FlowAmount'] != 0] +# +# # check on units of dfs before merge +# compare_df_units(df, bmt) +# bh_df_revised = pd.merge( +# df, bmt[['FlowAmount', 'ActivityProducedBy', 'Location']], +# left_on=['ActivityConsumedBy', 'Location'], +# right_on=['ActivityProducedBy', 'Location']) +# +# bh_df_revised.loc[:, 'FlowAmount'] = ((bh_df_revised['FlowAmount_x']) * +# (bh_df_revised['FlowAmount_y'])) +# bh_df_revised.loc[:, 'Unit'] = 'kg' +# # drop columns +# bh_df_revised = bh_df_revised.drop(columns=["FlowAmount_x", "FlowAmount_y", +# 'ActivityProducedBy_y']) +# bh_df_revised = bh_df_revised.rename(columns={"ActivityProducedBy_x": +# "ActivityProducedBy"}) +# +# return bh_df_revised + + +# def convert_blackhurst_data_to_kg_per_employee( +# df_wsec, attr, method, **kwargs): +# """ +# Load BLS employment data and use to transform original units to +# gallons per employee +# :param df_wsec: df, includes sector columns +# :param attr: dictionary, attribute data from method yaml for activity set +# :param method: dictionary, FBS method yaml +# :return: df, transformed fba dataframe with sector columns +# """ +# +# # load 2002 employment data +# bls = load_fba_w_standardized_units( +# datasource='BLS_QCEW', year='2002', +# flowclass='Employment', geographic_level='national', +# download_FBA_if_missing=kwargs['download_FBA_if_missing']) +# +# # assign naics to allocation dataset +# bls_wsec = add_sectors_to_flowbyactivity( +# bls, sectorsourcename=method['target_sector_source']) +# # drop rows where sector = None ( does not occur with mining) +# bls_wsec = bls_wsec[~bls_wsec['SectorProducedBy'].isnull()] +# bls_wsec = bls_wsec.rename(columns={'SectorProducedBy': 'Sector', +# 'FlowAmount': 'HelperFlow'}) +# +# # check units before merge +# compare_df_units(df_wsec, bls_wsec) +# # merge the two dfs +# df = pd.merge(df_wsec, +# bls_wsec[['Location', 'Sector', 'HelperFlow']], +# how='left', +# left_on=['Location', 'SectorConsumedBy'], +# right_on=['Location', 'Sector']) +# # drop any rows where sector is None +# df = df[~df['Sector'].isnull()] +# # fill helperflow values with 0 +# df['HelperFlow'] = df['HelperFlow'].fillna(0) +# +# # calculate proportional ratios +# df_wratio = proportional_allocation_by_location_and_activity(df, 'Sector') +# +# df_wratio = df_wratio.rename(columns={'FlowAmountRatio': 'EmployeeRatio', +# 'HelperFlow': 'Employees'}) +# +# # drop rows where helperflow = 0 +# df_wratio = df_wratio[df_wratio['Employees'] != 0] +# +# # calculate gal/employee in 2002 +# df_wratio.loc[:, 'FlowAmount'] = \ +# (df_wratio['FlowAmount'] * df_wratio['EmployeeRatio']) / \ +# df_wratio['Employees'] +# df_wratio.loc[:, 'Unit'] = 'kg/p' +# +# # drop cols +# df_wratio = df_wratio.drop( +# columns=['Sector', 'Employees', 'EmployeeRatio']) +# +# return df_wratio + + +# def scale_blackhurst_results_to_usgs_values(fbs: FlowBySector, **_) -> \ +# FlowBySector: +# """ +# Scale the initial estimates for Blackhurst-based mining estimates to +# USGS values. Oil-based sectors are allocated a larger percentage of the +# difference between initial water withdrawal estimates and published USGS +# values. +# +# This method is based off the Water Satellite Table created by Yang and +# Ingwersen, 2017 +# :param df_load: df, fba dataframe to be modified +# :param attr: dictionary, attribute data from method yaml for activity set +# :param download_FBA_if_missing: bool, indicate if missing FBAs should be +# downloaded from Data Commons +# :return: scaled fba results +# """ +# from flowsa.flowbyclean import load_prepare_clean_source +# # determine national level published withdrawal data for usgs mining +# # in FBS method year +# # pv_load = load_fba_w_standardized_units( +# # datasource="USGS_NWIS_WU", year=fbs.config['year'], +# # flowclass='Water', download_FBA_if_missing=download_FBA_if_missing) +# # +# # pv_sub = pv_load[(pv_load['ActivityConsumedBy'] == 'Mining') & +# # (pv_load['Compartment'] == 'total') & +# # (pv_load['FlowName'] == 'total')].reset_index(drop=True) +# pv_sub = load_prepare_clean_source(fbs) +# pv_sub_sum = pv_sub['FlowAmount'].sum() +# +# # rename the published value flow name and merge with Blackhurst data +# pv_sub = pv_sub.rename(columns={'FlowAmount': 'pv'}) +# df = fbs.merge(pv_sub[['SectorConsumedBy', 'Location', 'pv']], how='left') +# # calculate the difference between published value and allocated value +# # for each naics length +# df = df.assign(nLen=df['SectorConsumedBy'].apply(lambda x: len(x))) +# # calculate initial FlowAmount accounted for +# df = df.assign(av=df.groupby('nLen')['FlowAmount'].transform('sum')) +# # calc difference +# df = df.assign(vd=df['pv'] - df['av']) +# +# # subset df to scale into oil and non-oil sectors +# df['sector_label'] = np.where(df['SectorConsumedBy'].apply( +# lambda x: x[0:5] == '21111'), 'oil', 'nonoil') +# df['ratio'] = np.where(df['sector_label'] == 'oil', 2 / 3, 1 / 3) +# df['label_sum'] = df.groupby(['Location', 'nLen', 'sector_label'])[ +# 'FlowAmount'].transform('sum') +# +# # calculate revised water withdrawal allocation +# df_scaled = df.copy() +# df_scaled.loc[:, 'FlowAmount'] = \ +# df_scaled['FlowAmount'] + \ +# (df_scaled['FlowAmount'] / df_scaled['label_sum']) * \ +# (df_scaled['ratio'] * df_scaled['vd']) +# df_scaled = df_scaled.drop(columns=['sector_label', 'ratio', 'nLen', +# 'label_sum', 'pv', 'av', 'vd']) +# +# return df_scaled From 13462037932f61711c97b0135f31bec2acfdc3da Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Jul 2023 13:41:17 -0600 Subject: [PATCH 0661/1127] drop obsolete usda coa import statements --- flowsa/data_source_scripts/BLS_QCEW.py | 49 +++++++++++++------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/flowsa/data_source_scripts/BLS_QCEW.py b/flowsa/data_source_scripts/BLS_QCEW.py index 1c38397b5..69dba7adf 100644 --- a/flowsa/data_source_scripts/BLS_QCEW.py +++ b/flowsa/data_source_scripts/BLS_QCEW.py @@ -17,8 +17,7 @@ import pandas as pd import numpy as np from flowsa.location import US_FIPS -from flowsa.flowbyfunctions import assign_fips_location_system, \ - aggregator, equally_allocate_suppressed_parent_to_child_naics +from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.flowby import FlowByActivity from flowsa.flowsa_log import log from flowsa.naics import industry_spec_key @@ -139,29 +138,29 @@ def bls_qcew_parse(*, df_list, year, **_): return df2 -def bls_clean_allocation_fba_w_sec(df_w_sec, **kwargs): - """ - clean up bls df with sectors by estimating suppresed data - :param df_w_sec: df, FBA format BLS QCEW data - :param kwargs: additional arguments can include 'attr', a - dictionary of FBA method yaml parameters - :return: df, BLS QCEW FBA with estimated suppressed data - """ - groupcols = list(df_w_sec.select_dtypes(include=['object', 'int']).columns) - # estimate supressed data - df = equally_allocate_suppressed_parent_to_child_naics( - df_w_sec, kwargs['method'], 'SectorProducedBy', groupcols) - - # for purposes of allocation, we do not need to differentiate between - # federal government, state government, local government, or private - # sectors. So after estimating the suppressed data (above), modify the - # flow names and aggregate data - col_list = [e for e in df_w_sec.columns if e in ['FlowName', 'Flowable']] - for c in col_list: - df[c] = df[c].str.split(',').str[0] - df2 = aggregator(df, groupcols) - - return df2 +# def bls_clean_allocation_fba_w_sec(df_w_sec, **kwargs): +# """ +# clean up bls df with sectors by estimating suppresed data +# :param df_w_sec: df, FBA format BLS QCEW data +# :param kwargs: additional arguments can include 'attr', a +# dictionary of FBA method yaml parameters +# :return: df, BLS QCEW FBA with estimated suppressed data +# """ +# groupcols = list(df_w_sec.select_dtypes(include=['object', 'int']).columns) +# # estimate supressed data +# df = equally_allocate_suppressed_parent_to_child_naics( +# df_w_sec, kwargs['method'], 'SectorProducedBy', groupcols) +# +# # for purposes of allocation, we do not need to differentiate between +# # federal government, state government, local government, or private +# # sectors. So after estimating the suppressed data (above), modify the +# # flow names and aggregate data +# col_list = [e for e in df_w_sec.columns if e in ['FlowName', 'Flowable']] +# for c in col_list: +# df[c] = df[c].str.split(',').str[0] +# df2 = aggregator(df, groupcols) +# +# return df2 def clean_qcew(fba: FlowByActivity, **kwargs): From 692edb75c8167b2cc5d493ff478f3259ce31d7b3 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Jul 2023 13:42:32 -0600 Subject: [PATCH 0662/1127] drop obsolete usda coa import statements --- flowsa/data_source_scripts/USDA_CoA_Cropland.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/flowsa/data_source_scripts/USDA_CoA_Cropland.py b/flowsa/data_source_scripts/USDA_CoA_Cropland.py index 75b3586ba..36c14c6e7 100644 --- a/flowsa/data_source_scripts/USDA_CoA_Cropland.py +++ b/flowsa/data_source_scripts/USDA_CoA_Cropland.py @@ -9,18 +9,9 @@ import json import numpy as np import pandas as pd -from flowsa.allocation import allocate_by_sector, \ - equally_allocate_parent_to_child_naics, equal_allocation -from flowsa.common import WITHDRAWN_KEYWORD, fba_wsec_default_grouping_fields -from flowsa.dataclean import replace_NoneType_with_empty_cells, \ - replace_strings_with_NoneType -from flowsa.flowbyfunctions import assign_fips_location_system, \ - sector_aggregation, sector_disaggregation, sector_ratios, \ - load_fba_w_standardized_units, \ - equally_allocate_suppressed_parent_to_child_naics +from flowsa.common import WITHDRAWN_KEYWORD +from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.location import US_FIPS, abbrev_us_state -from flowsa.sectormapping import add_sectors_to_flowbyactivity -from flowsa.validation import compare_df_units def CoA_Cropland_URL_helper(*, build_url, config, **_): From 141d32d3e04d830d09bd7db045307a1f85a1e236 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Jul 2023 13:43:41 -0600 Subject: [PATCH 0663/1127] delete allocation.py - obsolete code with recursive method --- flowsa/allocation.py | 409 ------------------------------------------- 1 file changed, 409 deletions(-) delete mode 100644 flowsa/allocation.py diff --git a/flowsa/allocation.py b/flowsa/allocation.py deleted file mode 100644 index cb56d5bef..000000000 --- a/flowsa/allocation.py +++ /dev/null @@ -1,409 +0,0 @@ -# allocation.py (flowsa) -# !/usr/bin/env python3 -# coding=utf-8 - -""" -Methods of allocating datasets -""" -import pandas as pd -from flowsa.common import fbs_activity_fields, sector_level_key, \ - load_crosswalk, check_activities_sector_like -from flowsa.flowsa_log import log, vlog -from flowsa.dataclean import replace_NoneType_with_empty_cells, \ - replace_strings_with_NoneType -from flowsa.flowbyfunctions import sector_aggregation, aggregator, \ - sector_disaggregation, subset_and_merge_df_by_sector_lengths - - -def allocate_by_sector(df_w_sectors, attr, allocation_method, - group_cols, **kwargs): - """ - Create an allocation ratio for df - :param df_w_sectors: df with column of sectors - :param attr: dictionary, attributes of activity set - :param allocation_method: currently written for 'proportional' - and 'proportional-flagged' - :param group_cols: columns on which to base aggregation and disaggregation - :return: df with FlowAmountRatio for each sector - """ - - # first determine if there is a special case with how - # the allocation ratios are created - if allocation_method == 'proportional-flagged': - # if the allocation method is flagged, subset sectors that are - # flagged/notflagged, where nonflagged sectors have flowamountratio=1 - if kwargs != {}: - if 'flowSubsetMapped' in kwargs: - fsm = kwargs['flowSubsetMapped'] - flagged = fsm[fsm['disaggregate_flag'] == 1] - if flagged['SectorProducedBy'].isna().all(): - sector_col = 'SectorConsumedBy' - else: - sector_col = 'SectorProducedBy' - flagged_names = flagged[sector_col].tolist() - - nonflagged = fsm[fsm['disaggregate_flag'] == 0] - nonflagged_names = nonflagged[sector_col].tolist() - - # subset the original df so rows of data that run through the - # proportional allocation process are - # sectors included in the flagged list - df_w_sectors_nonflagged = df_w_sectors.loc[ - (df_w_sectors[fbs_activity_fields[0]].isin( - nonflagged_names)) | - (df_w_sectors[fbs_activity_fields[1]].isin( - nonflagged_names))].reset_index(drop=True) - df_w_sectors_nonflagged = \ - df_w_sectors_nonflagged.assign(FlowAmountRatio=1) - - df_w_sectors = \ - df_w_sectors.loc[(df_w_sectors[fbs_activity_fields[0]] - .isin(flagged_names)) | - (df_w_sectors[fbs_activity_fields[1]] - .isin(flagged_names) - )].reset_index(drop=True) - else: - log.error('The proportional-flagged allocation ' - 'method requires a column "disaggregate_flag" ' - 'in the flow_subset_mapped df') - - # run sector aggregation fxn to determine total flowamount - # for each level of sector - if len(df_w_sectors) == 0: - return df_w_sectors_nonflagged - else: - df1 = sector_aggregation(df_w_sectors) - # run sector disaggregation to capture one-to-one - # naics4/5/6 relationships - df2 = sector_disaggregation(df1) - - # if statements for method of allocation - # either 'proportional' or 'proportional-flagged' - allocation_df = [] - if allocation_method in ('proportional', 'proportional-flagged'): - allocation_df = proportional_allocation(df2, attr) - else: - log.error('Must create function for specified ' - 'method of allocation') - - if allocation_method == 'proportional-flagged': - # drop rows where values are not in flagged names - allocation_df =\ - allocation_df.loc[(allocation_df[fbs_activity_fields[0]] - .isin(flagged_names)) | - (allocation_df[fbs_activity_fields[1]] - .isin(flagged_names) - )].reset_index(drop=True) - # concat the flagged and nonflagged dfs - allocation_df = \ - pd.concat([allocation_df, df_w_sectors_nonflagged], - ignore_index=True).sort_values(['SectorProducedBy', - 'SectorConsumedBy']) - - return allocation_df - - -def proportional_allocation(df, attr): - """ - Creates a proportional allocation based on all the most - aggregated sectors within a location - Ensure that sectors are at 2 digit level - can run sector_aggregation() - prior to using this function - :param df: df, includes sector columns - :param attr: dictionary, attributes for an activity set - :return: df, with 'FlowAmountRatio' column - """ - - # tmp drop NoneType - df = replace_NoneType_with_empty_cells(df) - - # determine if any additional columns beyond location and sector by which - # to base allocation ratios - if 'allocation_merge_columns' in attr: - groupby_cols = ['Location'] + attr['allocation_merge_columns'] - denom_subset_cols = ['Location', 'LocationSystem', 'Year', - 'Denominator'] + attr['allocation_merge_columns'] - else: - groupby_cols = ['Location'] - denom_subset_cols = ['Location', 'LocationSystem', 'Year', - 'Denominator'] - - cw_load = load_crosswalk('sector_length') - cw = cw_load['NAICS_2'].drop_duplicates() - denom_df = df.loc[(df['SectorProducedBy'].isin(cw)) | - (df['SectorConsumedBy'].isin(cw))] - - # generate denominator based on identified groupby cols - denom_df = denom_df.assign(Denominator=denom_df.groupby( - groupby_cols)['FlowAmount'].transform('sum')) - # subset select columns by which to generate ratios - denom_df_2 = denom_df[denom_subset_cols].drop_duplicates() - # merge the denominator column with fba_w_sector df - allocation_df = df.merge(denom_df_2, how='left') - # calculate ratio - allocation_df.loc[:, 'FlowAmountRatio'] = \ - allocation_df['FlowAmount'] / allocation_df['Denominator'] - allocation_df = allocation_df.drop(columns=['Denominator']).reset_index( - drop=True) - - # add nonetypes - allocation_df = replace_strings_with_NoneType(allocation_df) - - return allocation_df - - -def proportional_allocation_by_location_and_activity(df_load, sectorcolumn): - """ - Creates a proportional allocation within each aggregated - sector within a location - :param df_load: df with sector columns - :param sectorcolumn: str, sector column for which to create - allocation ratios - :return: df, with 'FlowAmountRatio' and 'HelperFlow' columns - """ - - # tmp replace NoneTypes with empty cells - df = replace_NoneType_with_empty_cells(df_load).reset_index(drop=True) - - # want to create denominator based on shortest length naics for each - # activity/location - grouping_cols = [e for e in ['FlowName', 'Location', 'Activity', - 'ActivityConsumedBy', 'ActivityProducedBy', - 'Class', 'SourceName', 'Unit', 'FlowType', - 'Compartment', 'Year'] - if e in df.columns.values.tolist()] - activity_cols = [e for e in ['Activity', 'ActivityConsumedBy', - 'ActivityProducedBy'] - if e in df.columns.values.tolist()] - # trim whitespace - df[sectorcolumn] = df[sectorcolumn].str.strip() - # to create the denominator dataframe first add a column that captures - # the sector length - denom_df = df.assign(sLen=df[sectorcolumn].str.len()) - denom_df = denom_df[denom_df['sLen'] == denom_df.groupby(activity_cols)[ - 'sLen'].transform(min)].drop(columns='sLen') - denom_df.loc[:, 'Denominator'] = \ - denom_df.groupby(grouping_cols)['HelperFlow'].transform('sum') - - # list of column headers, that if exist in df, should be aggregated - # using the weighted avg fxn - possible_column_headers = ('Location', 'LocationSystem', 'Year', - 'Activity', 'ActivityConsumedBy', - 'ActivityProducedBy') - # list of column headers that do exist in the df being aggregated - column_headers = [e for e in possible_column_headers - if e in denom_df.columns.values.tolist()] - merge_headers = column_headers.copy() - column_headers.append('Denominator') - # create subset of denominator values based on Locations and Activities - denom_df_2 = \ - denom_df[column_headers].drop_duplicates().reset_index(drop=True) - # merge the denominator column with fba_w_sector df - allocation_df = df.merge(denom_df_2, - how='left', - left_on=merge_headers, - right_on=merge_headers) - # calculate ratio - allocation_df.loc[:, 'FlowAmountRatio'] = \ - allocation_df['HelperFlow'] / allocation_df['Denominator'] - allocation_df = allocation_df.drop( - columns=['Denominator']).reset_index(drop=True) - # where parent NAICS are not found in the allocation dataset, make sure - # those child NAICS are not dropped - allocation_df['FlowAmountRatio'] = \ - allocation_df['FlowAmountRatio'].fillna(1) - # fill empty cols with NoneType - allocation_df = replace_strings_with_NoneType(allocation_df) - # fill na values with 0 - allocation_df['HelperFlow'] = allocation_df['HelperFlow'].fillna(0) - - return allocation_df - - -def equally_allocate_parent_to_child_naics( - df_load, method, overwritetargetsectorlevel=None): - """ - Determine rows of data that will be lost if subset data at - target sector level. - Equally allocate parent NAICS to child NAICS where child NAICS missing - :param df_load: df, FBS format - :param overwritetargetsectorlevel: str, optional, specify what sector - level to allocate to - :return: df, with all child NAICS at target sector level - """ - # determine which sector level to use, use the least aggregated level - sector_level = method.get('target_sector_level') - if overwritetargetsectorlevel is not None: - sector_level = overwritetargetsectorlevel - # if secondary sector levels are identified, set the sector level to the - # least aggregated - sector_level_list = [sector_level] - if 'target_subset_sector_level' in method: - sector_level_dict = method.get('target_subset_sector_level') - for k, v in sector_level_dict.items(): - sector_level_list = sector_level_list + [k] - sector_subset_dict = dict((k, sector_level_key[k]) for k in - sector_level_list if k in sector_level_key) - sector_level = max(sector_subset_dict, key=sector_subset_dict.get) - - # exclude nonsectors - df = replace_NoneType_with_empty_cells(df_load) - - # determine if activities are sector-like, if aggregating a df with a - # 'SourceName' - sector_like_activities = check_activities_sector_like(df_load) - - # if activities are source like, drop from df, - # add back in as copies of sector columns columns to keep - if sector_like_activities: - # subset df - df_cols = [e for e in df.columns if e not in - ('ActivityProducedBy', 'ActivityConsumedBy')] - df = df[df_cols] - - rows_lost = pd.DataFrame() - for i in range(2, sector_level_key[sector_level]): - dfm = subset_and_merge_df_by_sector_lengths(df, i, i+1) - # extract the rows that are not disaggregated to more - # specific sectors - rl = dfm.query('_merge=="left_only"').drop( - columns=['_merge', 'SPB_tmp', 'SCB_tmp']) - rl_list = rl[['SectorProducedBy', 'SectorConsumedBy']]\ - .drop_duplicates().values.tolist() - - # match sectors with target sector length sectors - # import cw and subset to current sector length - # and target sector length - cw_load = load_crosswalk('sector_length') - nlength = list(sector_level_key.keys() - )[list(sector_level_key.values()).index(i)] - cw = cw_load[[nlength, sector_level]].drop_duplicates() - # add column with counts - cw['sector_count'] = \ - cw.groupby(nlength)[nlength].transform('count') - - # merge df & conditionally replace sector produced/consumed columns - # merge dfs assigning sector length - sectype_list = ['Produced', 'Consumed'] - for sec in sectype_list: - rl = rl.merge(cw, how='left', left_on=[f'Sector{sec}By'], - right_on=nlength).rename( - columns={'sector_count': f'{sec}Count'}) - rl[f'Sector{sec}By'] = rl[sector_level] - rl = rl.drop(columns=[sector_level, nlength]) - - # create one sector count column, using max value - rl['sector_count'] = rl[['ProducedCount', 'ConsumedCount']].max(axis=1) - rl = rl.drop(columns=['ProducedCount', 'ConsumedCount']) - - # calculate new flow amounts, based on sector count, - # allocating equally to the new sector length codes - rl['FlowAmount'] = rl['FlowAmount'] / rl['sector_count'] - rl = rl.drop(columns=['sector_count']) - - # append to df - if len(rl) != 0: - vlog.warning('Data found at %s digit sectors not ' - 'represented in current data subset: ' - '{}'.format(' '.join(map(str, rl_list))), - str(i)) - rows_lost = pd.concat([rows_lost, rl], ignore_index=True) - - if len(rows_lost) != 0: - vlog.info('Allocating FlowAmounts equally to each ' - f'{sector_level} associated with the sectors previously ' - 'dropped') - # if activities are source-like, set col values as copies - # of the sector columns - if sector_like_activities: - rows_lost = rows_lost.assign(ActivityProducedBy= - rows_lost['SectorProducedBy']) - rows_lost = rows_lost.assign(ActivityConsumedBy= - rows_lost['SectorConsumedBy']) - # reindex columns - rows_lost = rows_lost.reindex(df_load.columns, axis=1) - - # add rows of missing data to the fbs sector subset - df_w_lost_data = pd.concat([df_load, rows_lost], ignore_index=True) - df_w_lost_data = replace_strings_with_NoneType(df_w_lost_data) - - return df_w_lost_data - - -def equal_allocation(fba_load): - """ - Allocate an Activity in a FBA equally to all mapped sectors. - Function only works if all mapped sectors are the same length - - :param fba_load: df, FBA with activity columns mapped to sectors - :param sector_level: string ('NAICS_X') used when assigning columns of - sector levels if there are ambiguous sectors (e.g., household and - government sectors) - :return: df, with FlowAmount equally allocated to all mapped sectors - """ - from flowsa.flowbyfunctions import assign_columns_of_sector_levels - - # aggregate df - aggcols = list(fba_load.select_dtypes(include=['object', 'int']).columns) - fba = aggregator(fba_load, aggcols) - - # first check that all sector lengths are the same - dfc = assign_columns_of_sector_levels(fba) - # if duplicated rows, keep assignment to most specific sectors because - # data should already be at final assignment lengths if equally - # allocating and because not manipulating the loaded dataset, but rather - # just checking that all sector lengths match for an activity - duplicate_cols = [e for e in dfc.columns if e not in [ - 'SectorProducedByLength', 'SectorConsumedByLength']] - duplicate_df = dfc[dfc.duplicated(duplicate_cols, keep=False)] - if len(duplicate_df) > 0: - log.info('Dropping rows duplicated due to assigning sector lengths ' - 'for ambiguous sectors. Keeping sector length assignments ' - 'to most specific sectors.') - sort_cols = ['Location', 'ActivityProducedBy', - 'ActivityConsumedBy', 'SectorProducedByLength', - 'SectorConsumedByLength', 'Class', - 'FlowName', 'Flowable', - 'SectorProducedBy', 'SectorConsumedBy' - ] - dfc = dfc.sort_values([e for e in sort_cols if e in dfc.columns]) - dfc = dfc.drop_duplicates(subset=duplicate_cols, keep="last") - - # Before equally allocating, check that each activity is being allocated - # to sectors of the same length - possible_headers = ['Class', 'FlowName', 'Flowable', 'ActivityProducedBy', - 'ActivityConsumedBy', 'Compartment', 'Context', - 'Location', 'SectorProducedByLength', - 'SectorConsumedByLength'] - dfsub = dfc[dfc.columns.intersection(possible_headers)].drop_duplicates() - - # create column list based on if df is FBA or FBS - duplicated_cols = [e for e in dfsub.columns if e in - ['FlowName', 'Flowable', 'ActivityProducedBy', - 'ActivityConsumedBy', 'Compartment', 'Context', - 'Location']] - df_dup = dfsub[dfsub.duplicated(duplicated_cols)] - if len(df_dup) > 1: - log.error('Cannot equally allocate because sector lengths vary. All ' - 'sectors must be the same sector level.') - return fba - - # create groupby cols by which to determine allocation - fba_cols = fba.select_dtypes([object]).columns.to_list() - groupcols = [e for e in fba_cols if e not in - ['SectorProducedBy', 'SectorConsumedBy', 'Description']] - # create counts of rows - df_count = fba.groupby( - groupcols, as_index=False, dropna=False).size() - df_count = replace_NoneType_with_empty_cells(df_count) - - # merge dfs, replace cells with empty strings to ensure merge occurs - # correctly - fba = replace_NoneType_with_empty_cells(fba) - dfm = fba.merge(df_count, how='outer', on=groupcols) - # calc new flowamounts - dfm['FlowAmount'] = dfm['FlowAmount'] / dfm['size'] - dfm = dfm.drop(columns='size') - dfm = replace_strings_with_NoneType(dfm) - - return dfm From 8e985b58febd9306bb7f30b17947b7820df719b8 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Jul 2023 13:45:08 -0600 Subject: [PATCH 0664/1127] comment out obsolete check_activities_sector_like() --- flowsa/common.py | 58 ++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/flowsa/common.py b/flowsa/common.py index 02cebb25c..627e82973 100644 --- a/flowsa/common.py +++ b/flowsa/common.py @@ -279,35 +279,35 @@ def return_true_source_catalog_name(sourcename): sourcename = sourcename.rsplit("_", 1)[0] return sourcename - -def check_activities_sector_like(df_load, sourcename=None): - """ - Check if the activities in a df are sector-like, - if cannot find the sourcename in the source catalog, drop extensions on the - source name - :param df_load: df, df to determine if activities are sector-like - :param source: str, optionial, can identify sourcename to use - """ - # identify sourcename - if sourcename is not None: - s = sourcename - else: - if 'SourceName' in df_load.columns: - s = pd.unique(df_load['SourceName'])[0] - elif 'MetaSources' in df_load.columns: - s = pd.unique(df_load['MetaSources'])[0] - - sourcename = return_true_source_catalog_name(s) - - try: - sectorLike = load_yaml_dict('source_catalog')[sourcename][ - 'sector-like_activities'] - except KeyError: - log.info(f'%s not found in {datapath}source_catalog.yaml, assuming ' - f'activities are not sector-like', sourcename) - sectorLike = False - - return sectorLike +# todo: delete +# def check_activities_sector_like(df_load, sourcename=None): +# """ +# Check if the activities in a df are sector-like, +# if cannot find the sourcename in the source catalog, drop extensions on the +# source name +# :param df_load: df, df to determine if activities are sector-like +# :param source: str, optionial, can identify sourcename to use +# """ +# # identify sourcename +# if sourcename is not None: +# s = sourcename +# else: +# if 'SourceName' in df_load.columns: +# s = pd.unique(df_load['SourceName'])[0] +# elif 'MetaSources' in df_load.columns: +# s = pd.unique(df_load['MetaSources'])[0] +# +# sourcename = return_true_source_catalog_name(s) +# +# try: +# sectorLike = load_yaml_dict('source_catalog')[sourcename][ +# 'sector-like_activities'] +# except KeyError: +# log.info(f'%s not found in {datapath}source_catalog.yaml, assuming ' +# f'activities are not sector-like', sourcename) +# sectorLike = False +# +# return sectorLike def str2bool(v): From 6249b9b36b3f8e09cad840d82cf8cbd9edade458 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Jul 2023 13:45:55 -0600 Subject: [PATCH 0665/1127] update units after multiplication depending on which df has the rate for a unit --- flowsa/flowby.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 564d318ab..75df2f3d5 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -27,8 +27,7 @@ def get_catalog_info(source_name: str) -> dict: ''' Retrieves the information on a given source from source_catalog.yaml. - Replaces (when used appropriately), common.check_activities_sector_like() - as well as various pieces of code that load the source_catalog yaml. + Replaces various pieces of code that load the source_catalog yaml. ''' source_catalog = common.load_yaml_dict('source_catalog') source_name = common.return_true_source_catalog_name(source_name) @@ -1133,13 +1132,21 @@ def multiplication_attribution( # set new units, incorporating a check that units are correctly # converted + rate = None if fb['Unit'].str.contains('/').all(): - fb['Denominator'] = fb['Unit'].str.split("/",1).str[1] - fb['Unit'] = fb['Unit'].str.split("/",1).str[0] - if fb['Unit_other'].equals(fb['Denominator']) is False: + rate = 'Unit' + other = 'Unit_other' + elif fb['Unit_other'].str.contains('/').all(): + rate = 'Unit_other' + other = 'Unit' + if rate is not None: + fb['Denominator'] = fb[rate].str.split("/",1).str[1] + fb[rate] = fb[rate].str.split("/",1).str[0] + if fb[other].equals(fb['Denominator']) is False: log.warning('Check units being multiplied') else: - log.info(f"Units reset to {fb['Unit'].drop_duplicates().tolist()}") + log.info(f"Units reset to" + f" {fb[rate].drop_duplicates().tolist()}") return ( fb From 3b8eb5b3bc1014d16f2f421507e0a6a7c9a3823a Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Jul 2023 14:23:47 -0600 Subject: [PATCH 0666/1127] comment ut additional obsolete code and import statements --- .../USDA_CoA_Cropland_NAICS.py | 6 +- flowsa/flowbyfunctions.py | 834 +++++++++--------- flowsa/sectormapping.py | 379 ++++---- 3 files changed, 608 insertions(+), 611 deletions(-) diff --git a/flowsa/data_source_scripts/USDA_CoA_Cropland_NAICS.py b/flowsa/data_source_scripts/USDA_CoA_Cropland_NAICS.py index 6592f4d4f..6abfb7514 100644 --- a/flowsa/data_source_scripts/USDA_CoA_Cropland_NAICS.py +++ b/flowsa/data_source_scripts/USDA_CoA_Cropland_NAICS.py @@ -11,10 +11,8 @@ import numpy as np import pandas as pd from flowsa.location import US_FIPS, abbrev_us_state -from flowsa.common import WITHDRAWN_KEYWORD, \ - fba_wsec_default_grouping_fields -from flowsa.flowbyfunctions import assign_fips_location_system, \ - equally_allocate_suppressed_parent_to_child_naics +from flowsa.common import WITHDRAWN_KEYWORD +from flowsa.flowbyfunctions import assign_fips_location_system def CoA_Cropland_NAICS_URL_helper(*, build_url, config, **_): diff --git a/flowsa/flowbyfunctions.py b/flowsa/flowbyfunctions.py index a7a46a439..a5bf96dae 100644 --- a/flowsa/flowbyfunctions.py +++ b/flowsa/flowbyfunctions.py @@ -10,7 +10,7 @@ from esupy.dqi import get_weighted_average import flowsa from flowsa.common import \ - load_crosswalk, fbs_fill_na_dict, check_activities_sector_like, \ + load_crosswalk, fbs_fill_na_dict, \ fbs_collapsed_default_grouping_fields, fbs_collapsed_fill_na_dict, \ fba_activity_fields, fba_default_grouping_fields, \ load_sector_length_cw_melt, fba_fill_na_dict, \ @@ -369,78 +369,78 @@ def append_new_sectors(df, i, j, cw_load, group_cols): return df -def sector_disaggregation(df_load): - """ - function to disaggregate sectors if there is only one - naics at a lower level works for lower than naics 4 - :param df_load: A FBS df, must have sector columns - :return: A FBS df with values for the missing naics5 and naics6 - """ - - # ensure None values are not strings - df = replace_NoneType_with_empty_cells(df_load) - - # determine if activities are sector-like, if aggregating - # a df with a 'SourceName' - sector_like_activities = check_activities_sector_like(df_load) - - # if activities are sector like, drop columns while running disag then - # add back in - if sector_like_activities: - df = df.drop(columns=['ActivityProducedBy', 'ActivityConsumedBy'], - errors='ignore') - df = df.reset_index(drop=True) - - # load naics 2 to naics 6 crosswalk - cw_load = load_crosswalk('sector_length') - - # appends missing naics levels to df - for i in range(2, 6): - dfm = subset_and_merge_df_by_sector_lengths( - df, i, i + 1, keep_paired_sectors_not_in_subset_list=True) - - # only keep values in left column, meaning there are no less - # aggregated naics in the df - dfm2 = dfm.query('_merge=="left_only"').drop( - columns=['_merge', 'SPB_tmp', 'SCB_tmp']) - - sector_merge = 'NAICS_' + str(i) - sector_add = 'NAICS_' + str(i + 1) - - # subset the df by naics length - cw = cw_load[[sector_merge, sector_add]].drop_duplicates() - # only keep the rows where there is only one value in sector_add for - # a value in sector_merge - cw = cw.drop_duplicates(subset=[sector_merge], keep=False).reset_index( - drop=True) - - # loop through and add additional naics - sectype_list = ['Produced', 'Consumed'] - for s in sectype_list: - # inner join - only keep rows where there are data in the crosswalk - dfm2 = dfm2.merge(cw, how='left', left_on=[f'Sector{s}By'], - right_on=sector_merge) - dfm2[f'Sector{s}By'] = np.where( - ~dfm2[sector_add].isnull(), dfm2[sector_add], - dfm2[f'Sector{s}By']) - dfm2 = dfm2.drop(columns=[sector_merge, sector_add]) - dfm3 = dfm2.dropna(subset=['SectorProducedBy', 'SectorConsumedBy'], - how='all') - dfm3 = dfm3.reset_index(drop=True) - dfm3 = replace_NoneType_with_empty_cells(dfm3) - df = pd.concat([df, dfm3], ignore_index=True) - - # drop duplicates that can arise if sectors are non-traditional naics - # (household and government) - df = df.drop_duplicates().reset_index(drop=True) - - # if activities are source-like, set col values - # as copies of the sector columns - if sector_like_activities: - df = df.assign(ActivityProducedBy=df['SectorProducedBy']) - df = df.assign(ActivityConsumedBy=df['SectorConsumedBy']) - - return df +# def sector_disaggregation(df_load): +# """ +# function to disaggregate sectors if there is only one +# naics at a lower level works for lower than naics 4 +# :param df_load: A FBS df, must have sector columns +# :return: A FBS df with values for the missing naics5 and naics6 +# """ +# +# # ensure None values are not strings +# df = replace_NoneType_with_empty_cells(df_load) +# +# # determine if activities are sector-like, if aggregating +# # a df with a 'SourceName' +# sector_like_activities = check_activities_sector_like(df_load) +# +# # if activities are sector like, drop columns while running disag then +# # add back in +# if sector_like_activities: +# df = df.drop(columns=['ActivityProducedBy', 'ActivityConsumedBy'], +# errors='ignore') +# df = df.reset_index(drop=True) +# +# # load naics 2 to naics 6 crosswalk +# cw_load = load_crosswalk('sector_length') +# +# # appends missing naics levels to df +# for i in range(2, 6): +# dfm = subset_and_merge_df_by_sector_lengths( +# df, i, i + 1, keep_paired_sectors_not_in_subset_list=True) +# +# # only keep values in left column, meaning there are no less +# # aggregated naics in the df +# dfm2 = dfm.query('_merge=="left_only"').drop( +# columns=['_merge', 'SPB_tmp', 'SCB_tmp']) +# +# sector_merge = 'NAICS_' + str(i) +# sector_add = 'NAICS_' + str(i + 1) +# +# # subset the df by naics length +# cw = cw_load[[sector_merge, sector_add]].drop_duplicates() +# # only keep the rows where there is only one value in sector_add for +# # a value in sector_merge +# cw = cw.drop_duplicates(subset=[sector_merge], keep=False).reset_index( +# drop=True) +# +# # loop through and add additional naics +# sectype_list = ['Produced', 'Consumed'] +# for s in sectype_list: +# # inner join - only keep rows where there are data in the crosswalk +# dfm2 = dfm2.merge(cw, how='left', left_on=[f'Sector{s}By'], +# right_on=sector_merge) +# dfm2[f'Sector{s}By'] = np.where( +# ~dfm2[sector_add].isnull(), dfm2[sector_add], +# dfm2[f'Sector{s}By']) +# dfm2 = dfm2.drop(columns=[sector_merge, sector_add]) +# dfm3 = dfm2.dropna(subset=['SectorProducedBy', 'SectorConsumedBy'], +# how='all') +# dfm3 = dfm3.reset_index(drop=True) +# dfm3 = replace_NoneType_with_empty_cells(dfm3) +# df = pd.concat([df, dfm3], ignore_index=True) +# +# # drop duplicates that can arise if sectors are non-traditional naics +# # (household and government) +# df = df.drop_duplicates().reset_index(drop=True) +# +# # if activities are source-like, set col values +# # as copies of the sector columns +# if sector_like_activities: +# df = df.assign(ActivityProducedBy=df['SectorProducedBy']) +# df = df.assign(ActivityConsumedBy=df['SectorConsumedBy']) +# +# return df def assign_fips_location_system(df, year_of_data): @@ -695,256 +695,256 @@ def dataframe_difference(df1, df2, which=None): return diff_df -def equally_allocate_suppressed_parent_to_child_naics( - df_load, method, sector_column, groupcols, - equally_allocate_parent_to_child=True): - """ - Estimate data suppression, by equally allocating parent NAICS - values to child NAICS - :param df_load: df with sector columns - :param method: dictionary, FBS method yaml - :param sector_column: str, column to estimate suppressed data for - :param groupcols: list, columns to group df by - :param equally_allocate_parent_to_child: default True, if True will - first equally allocate parent to child sectors if the child sector is - missing - :return: df, with estimated suppressed data - """ - from flowsa.allocation import equally_allocate_parent_to_child_naics - from flowsa.validation import \ - compare_child_to_parent_sectors_flowamounts, \ - compare_summation_at_sector_lengths_between_two_dfs - - vlog.info('Estimating suppressed data by equally allocating ' - 'parent to child sectors.') - df = sector_disaggregation(df_load) - - # equally allocate parent to child naics where child naics are not - # included in the dataset. This step is necessary to accurately - # calculate the flow that has already been allocated. Must allocate to - # NAICS_6 for suppressed data function to work correctly. - if equally_allocate_parent_to_child: - vlog.info('Before estimating suppressed data, equally ' - 'allocate parent sectors to child sectors.') - df = equally_allocate_parent_to_child_naics( - df, method, overwritetargetsectorlevel='NAICS_6') - - df = replace_NoneType_with_empty_cells(df) - df = df[df[sector_column] != ''] - - # determine if activities are sector-like, - # if aggregating a df with a 'SourceName' - sector_like_activities = check_activities_sector_like(df_load) - if sector_like_activities is False: - log.error('Function is not written to estimate suppressed data when ' - 'activities are not NAICS-like.') - - # if activities are source like, drop from df, - # add back in as copies of sector columns columns to keep - if sector_like_activities: - # subset df - df_cols = [e for e in df.columns if e not in - ('ActivityProducedBy', 'ActivityConsumedBy')] - df = df[df_cols] - # drop activity from groupby - groupcols = [e for e in groupcols if e - not in ['ActivityConsumedBy', 'ActivityProducedBy', - 'Description']] - - # load naics 2 to naics 6 crosswalk - cw_load = load_crosswalk('sector_length') - # only keep official naics - cw = cw_load.drop(columns=['NAICS_7']).drop_duplicates() - cw_melt = pd.melt(cw, - id_vars=["NAICS_6"], var_name="NAICS_Length", - value_name="NAICS_Match").drop( - columns=['NAICS_Length']).drop_duplicates() - - df_sup = df[df['FlowAmount'] == 0].reset_index(drop=True) - # merge the naics cw - new_naics = pd.merge(df_sup, cw_melt, how='left', - left_on=[sector_column], right_on=['NAICS_Match']) - # drop rows where match is null because no additional naics to add - new_naics = new_naics.dropna() - new_naics[sector_column] = new_naics['NAICS_6'].copy() - new_naics = new_naics.drop(columns=['NAICS_6', 'NAICS_Match']) - - # if a parent and child naics are both suppressed, can get situations - # where a naics6 code is duplicated because both the parent and child - # will match with the naics6. Therefore, drop duplicates - new_naics2 = new_naics.drop_duplicates() - - # merge the new naics with the existing df, if data already - # existed for a NAICS6, keep the original - dfm = pd.merge( - new_naics2[groupcols], df, how='left', on=groupcols, - indicator=True).query('_merge=="left_only"').drop('_merge', axis=1) - dfm = replace_NoneType_with_empty_cells(dfm) - dfm = dfm.fillna(0) - df = pd.concat([df, dfm], ignore_index=True) - # add length column and subset the data - # subtract out existing data at NAICS6 from total data - # at a length where no suppressed data - drop_col = 'SectorConsumedByLength' - if sector_column == 'SectorConsumedBy': - drop_col = 'SectorProducedByLength' - df = assign_columns_of_sector_levels(df).rename( - columns={f'{sector_column}Length': 'SectorLength'}).drop(columns=[ - drop_col]) - # df with non-suppressed data only - dfns = df[df['FlowAmount'] != 0].reset_index(drop=True) - - df_sup2 = pd.DataFrame() - cw_load = load_crosswalk('sector_length') - df_sup = df_sup.assign(SectorMatchFlow=np.nan) - merge_cols = list(df_sup.select_dtypes( - include=['object', 'int']).columns) - # also drop sector and description cols - merge_cols = [c for c in merge_cols - if c not in ['SectorConsumedBy', 'SectorProducedBy', - 'Description']] - # subset the df by length i - dfs = subset_df_by_sector_lengths(df_sup, [6]) - - counter = 1 - while dfs.isnull().values.any() and 6-counter > 1: - # subset the crosswalk by i and i-1 - cw = cw_load[[f'NAICS_6', - f'NAICS_{6-counter}']].drop_duplicates() - # merge df with the cw to determine which sector to look for in - # non-suppressed data - for s in ['Produced', 'Consumed']: - dfs = dfs.merge(cw, how='left', left_on=f'Sector{s}By', - right_on=f'NAICS_6').drop( - columns=f'NAICS_6').rename( - columns={f'NAICS_{6-counter}': f'Sector{s}Match'}) - dfs[f'Sector{s}Match'] = dfs[f'Sector{s}Match'].fillna('') - # merge with non suppressed data - dfs = dfs.merge(dfns, how='left', - left_on=merge_cols + ['SectorProducedMatch', - 'SectorConsumedMatch'], - right_on=merge_cols + ['SectorProducedBy', - 'SectorConsumedBy']) - dfs['SectorMatchFlow'].fillna(dfs['FlowAmount_y'], inplace=True) - # drop all columns from the non suppressed data - dfs = dfs[dfs.columns[~dfs.columns.str.endswith('_y')]] - dfs.columns = dfs.columns.str.replace('_x', '') - # subset the df into rows assigned a new value and those not - dfs_assigned = dfs[~dfs['SectorMatchFlow'].isnull()] - dfs = dfs[dfs['SectorMatchFlow'].isnull()].drop( - columns=['SectorProducedMatch', 'SectorConsumedMatch', - 'SectorLength']).reset_index(drop=True) - df_sup2 = pd.concat([df_sup2, dfs_assigned], ignore_index=True) - counter = counter + 1 - - # merge in the df where calculated how much flow has already been - # allocated to NAICS6 - mergecols = [e for e in groupcols if e not in - ['SectorProducedBy', 'SectorConsumedBy']] - mergecols = mergecols + ['SectorProducedMatch', 'SectorConsumedMatch'] - meltcols = mergecols + ['sector_allocated'] - - if len(df_sup2) > 0: - for ii in range(5, 1, -1): - # subset the df by length i - dfs = df_sup2[df_sup2['SectorLength'] == ii] - - dfns_sub = dfns[dfns['SectorLength'] == 6].reset_index(drop=True) - for s in ['Produced', 'Consumed']: - dfns_sub = assign_sector_match_column( - dfns_sub, f'Sector{s}By', 6, ii).rename( - columns={'sector_group': f'Sector{s}Match'}) - dfns_sub = dfns_sub.fillna('') - dfsum = dfns_sub.groupby(mergecols, as_index=False).agg( - {"FlowAmount": sum}).rename(columns={ - "FlowAmount": 'sector_allocated'}) - - df_sup3 = dfs.merge(dfsum[meltcols], on=mergecols, how='left') - df_sup3['sector_allocated'] = df_sup3['sector_allocated'].fillna(0) - # calc the remaining flow that can be allocated - df_sup3['FlowRemainder'] = df_sup3['SectorMatchFlow'] - \ - df_sup3['sector_allocated'] - # Due to rounding, there can be slight differences in data at - # sector levels, which can result in some minor negative values. - # If the percent of FlowRemainder is less than the assigned - # tolerance for negative numbers, or if the flowremainder is - # -1, reset the number to 0. If it is greater, issue a warning. - percenttolerance = 1 - flowtolerance = -1 - df_sup3 = df_sup3.assign(PercentOfAllocated= - (abs(df_sup3['FlowRemainder']) / df_sup3[ - 'SectorMatchFlow']) * 100) - df_sup3['FlowRemainder'] = np.where( - (df_sup3["FlowRemainder"] < 0) & - (df_sup3['PercentOfAllocated'] < percenttolerance), 0, - df_sup3['FlowRemainder']) - df_sup3['FlowRemainder'] = np.where( - df_sup3["FlowRemainder"].between(flowtolerance, 0), 0, - df_sup3['FlowRemainder']) - - # check for negative values - negv = df_sup3[df_sup3['FlowRemainder'] < 0] - if len(negv) > 0: - col_subset = [e for e in negv.columns if e in - ['Class', 'SourceName', 'FlowName', - 'Flowable', 'FlowAmount', 'Unit', - 'Compartment', 'Context', 'Location', 'Year', - 'SectorProducedBy', 'SectorConsumedBy', - 'SectorMatchFlow', 'SectorProducedMatch', - 'SectorConsumedMatch', 'sector_allocated', - 'FlowRemainder']] - negv = negv[col_subset].reset_index(drop=True) - vlog.info( - 'There are negative values when allocating suppressed ' - 'parent data to child sector. The values are more than ' - '%s%% of the total parent sector with a negative flow ' - 'amount being allocated more than %s. Resetting flow ' - 'values to be allocated to 0. See validation log for ' - 'details.', str(percenttolerance), str(flowtolerance)) - vlog.info('Values where flow remainders are negative, ' - 'resetting to 0: \n {}'.format(negv.to_string())) - df_sup3['FlowRemainder'] = np.where(df_sup3["FlowRemainder"] < 0, - 0, df_sup3['FlowRemainder']) - df_sup3 = df_sup3.drop(columns=[ - 'SectorMatchFlow', 'sector_allocated', 'PercentOfAllocated']) - # add count column used to divide the unallocated flows - sector_column_match = sector_column.replace('By', 'Match') - df_sup3 = df_sup3.assign(secCount=df_sup3.groupby(mergecols)[ - sector_column_match].transform('count')) - df_sup3 = df_sup3.assign(newFlow=df_sup3['FlowRemainder'] / - df_sup3['secCount']) - # reassign values and drop columns - df_sup3 = df_sup3.assign(FlowAmount=df_sup3['newFlow']) - df_sup3 = df_sup3.drop(columns=['SectorProducedMatch', - 'SectorConsumedMatch', - 'FlowRemainder', 'secCount', - 'newFlow']) - # reset SectorLength - df_sup3['SectorLength'] = 6 - # add to the df with no suppressed data - dfns = pd.concat([dfns, df_sup3], ignore_index=True) - - dfns = dfns.drop(columns=['SectorLength']) - dff = sector_aggregation(dfns) - - # if activities are source-like, set col values as copies - # of the sector columns - if sector_like_activities: - dff = dff.assign(ActivityProducedBy=dff['SectorProducedBy']) - dff = dff.assign(ActivityConsumedBy=dff['SectorConsumedBy']) - # reindex columns - dff = dff.reindex(df_load.columns, axis=1) - - vlog.info('Checking results of allocating suppressed parent to ' - 'child sectors. ') - compare_summation_at_sector_lengths_between_two_dfs(df_load, dff) - compare_child_to_parent_sectors_flowamounts(dff) - # todo: add third check comparing smallest child naics (6) to largest (2) - - # replace null values - dff = replace_strings_with_NoneType(dff).reset_index(drop=True) - - return dff +# def equally_allocate_suppressed_parent_to_child_naics( +# df_load, method, sector_column, groupcols, +# equally_allocate_parent_to_child=True): +# """ +# Estimate data suppression, by equally allocating parent NAICS +# values to child NAICS +# :param df_load: df with sector columns +# :param method: dictionary, FBS method yaml +# :param sector_column: str, column to estimate suppressed data for +# :param groupcols: list, columns to group df by +# :param equally_allocate_parent_to_child: default True, if True will +# first equally allocate parent to child sectors if the child sector is +# missing +# :return: df, with estimated suppressed data +# """ +# from flowsa.allocation import equally_allocate_parent_to_child_naics +# from flowsa.validation import \ +# compare_child_to_parent_sectors_flowamounts, \ +# compare_summation_at_sector_lengths_between_two_dfs +# +# vlog.info('Estimating suppressed data by equally allocating ' +# 'parent to child sectors.') +# df = sector_disaggregation(df_load) +# +# # equally allocate parent to child naics where child naics are not +# # included in the dataset. This step is necessary to accurately +# # calculate the flow that has already been allocated. Must allocate to +# # NAICS_6 for suppressed data function to work correctly. +# if equally_allocate_parent_to_child: +# vlog.info('Before estimating suppressed data, equally ' +# 'allocate parent sectors to child sectors.') +# df = equally_allocate_parent_to_child_naics( +# df, method, overwritetargetsectorlevel='NAICS_6') +# +# df = replace_NoneType_with_empty_cells(df) +# df = df[df[sector_column] != ''] +# +# # determine if activities are sector-like, +# # if aggregating a df with a 'SourceName' +# sector_like_activities = check_activities_sector_like(df_load) +# if sector_like_activities is False: +# log.error('Function is not written to estimate suppressed data when ' +# 'activities are not NAICS-like.') +# +# # if activities are source like, drop from df, +# # add back in as copies of sector columns columns to keep +# if sector_like_activities: +# # subset df +# df_cols = [e for e in df.columns if e not in +# ('ActivityProducedBy', 'ActivityConsumedBy')] +# df = df[df_cols] +# # drop activity from groupby +# groupcols = [e for e in groupcols if e +# not in ['ActivityConsumedBy', 'ActivityProducedBy', +# 'Description']] +# +# # load naics 2 to naics 6 crosswalk +# cw_load = load_crosswalk('sector_length') +# # only keep official naics +# cw = cw_load.drop(columns=['NAICS_7']).drop_duplicates() +# cw_melt = pd.melt(cw, +# id_vars=["NAICS_6"], var_name="NAICS_Length", +# value_name="NAICS_Match").drop( +# columns=['NAICS_Length']).drop_duplicates() +# +# df_sup = df[df['FlowAmount'] == 0].reset_index(drop=True) +# # merge the naics cw +# new_naics = pd.merge(df_sup, cw_melt, how='left', +# left_on=[sector_column], right_on=['NAICS_Match']) +# # drop rows where match is null because no additional naics to add +# new_naics = new_naics.dropna() +# new_naics[sector_column] = new_naics['NAICS_6'].copy() +# new_naics = new_naics.drop(columns=['NAICS_6', 'NAICS_Match']) +# +# # if a parent and child naics are both suppressed, can get situations +# # where a naics6 code is duplicated because both the parent and child +# # will match with the naics6. Therefore, drop duplicates +# new_naics2 = new_naics.drop_duplicates() +# +# # merge the new naics with the existing df, if data already +# # existed for a NAICS6, keep the original +# dfm = pd.merge( +# new_naics2[groupcols], df, how='left', on=groupcols, +# indicator=True).query('_merge=="left_only"').drop('_merge', axis=1) +# dfm = replace_NoneType_with_empty_cells(dfm) +# dfm = dfm.fillna(0) +# df = pd.concat([df, dfm], ignore_index=True) +# # add length column and subset the data +# # subtract out existing data at NAICS6 from total data +# # at a length where no suppressed data +# drop_col = 'SectorConsumedByLength' +# if sector_column == 'SectorConsumedBy': +# drop_col = 'SectorProducedByLength' +# df = assign_columns_of_sector_levels(df).rename( +# columns={f'{sector_column}Length': 'SectorLength'}).drop(columns=[ +# drop_col]) +# # df with non-suppressed data only +# dfns = df[df['FlowAmount'] != 0].reset_index(drop=True) +# +# df_sup2 = pd.DataFrame() +# cw_load = load_crosswalk('sector_length') +# df_sup = df_sup.assign(SectorMatchFlow=np.nan) +# merge_cols = list(df_sup.select_dtypes( +# include=['object', 'int']).columns) +# # also drop sector and description cols +# merge_cols = [c for c in merge_cols +# if c not in ['SectorConsumedBy', 'SectorProducedBy', +# 'Description']] +# # subset the df by length i +# dfs = subset_df_by_sector_lengths(df_sup, [6]) +# +# counter = 1 +# while dfs.isnull().values.any() and 6-counter > 1: +# # subset the crosswalk by i and i-1 +# cw = cw_load[[f'NAICS_6', +# f'NAICS_{6-counter}']].drop_duplicates() +# # merge df with the cw to determine which sector to look for in +# # non-suppressed data +# for s in ['Produced', 'Consumed']: +# dfs = dfs.merge(cw, how='left', left_on=f'Sector{s}By', +# right_on=f'NAICS_6').drop( +# columns=f'NAICS_6').rename( +# columns={f'NAICS_{6-counter}': f'Sector{s}Match'}) +# dfs[f'Sector{s}Match'] = dfs[f'Sector{s}Match'].fillna('') +# # merge with non suppressed data +# dfs = dfs.merge(dfns, how='left', +# left_on=merge_cols + ['SectorProducedMatch', +# 'SectorConsumedMatch'], +# right_on=merge_cols + ['SectorProducedBy', +# 'SectorConsumedBy']) +# dfs['SectorMatchFlow'].fillna(dfs['FlowAmount_y'], inplace=True) +# # drop all columns from the non suppressed data +# dfs = dfs[dfs.columns[~dfs.columns.str.endswith('_y')]] +# dfs.columns = dfs.columns.str.replace('_x', '') +# # subset the df into rows assigned a new value and those not +# dfs_assigned = dfs[~dfs['SectorMatchFlow'].isnull()] +# dfs = dfs[dfs['SectorMatchFlow'].isnull()].drop( +# columns=['SectorProducedMatch', 'SectorConsumedMatch', +# 'SectorLength']).reset_index(drop=True) +# df_sup2 = pd.concat([df_sup2, dfs_assigned], ignore_index=True) +# counter = counter + 1 +# +# # merge in the df where calculated how much flow has already been +# # allocated to NAICS6 +# mergecols = [e for e in groupcols if e not in +# ['SectorProducedBy', 'SectorConsumedBy']] +# mergecols = mergecols + ['SectorProducedMatch', 'SectorConsumedMatch'] +# meltcols = mergecols + ['sector_allocated'] +# +# if len(df_sup2) > 0: +# for ii in range(5, 1, -1): +# # subset the df by length i +# dfs = df_sup2[df_sup2['SectorLength'] == ii] +# +# dfns_sub = dfns[dfns['SectorLength'] == 6].reset_index(drop=True) +# for s in ['Produced', 'Consumed']: +# dfns_sub = assign_sector_match_column( +# dfns_sub, f'Sector{s}By', 6, ii).rename( +# columns={'sector_group': f'Sector{s}Match'}) +# dfns_sub = dfns_sub.fillna('') +# dfsum = dfns_sub.groupby(mergecols, as_index=False).agg( +# {"FlowAmount": sum}).rename(columns={ +# "FlowAmount": 'sector_allocated'}) +# +# df_sup3 = dfs.merge(dfsum[meltcols], on=mergecols, how='left') +# df_sup3['sector_allocated'] = df_sup3['sector_allocated'].fillna(0) +# # calc the remaining flow that can be allocated +# df_sup3['FlowRemainder'] = df_sup3['SectorMatchFlow'] - \ +# df_sup3['sector_allocated'] +# # Due to rounding, there can be slight differences in data at +# # sector levels, which can result in some minor negative values. +# # If the percent of FlowRemainder is less than the assigned +# # tolerance for negative numbers, or if the flowremainder is +# # -1, reset the number to 0. If it is greater, issue a warning. +# percenttolerance = 1 +# flowtolerance = -1 +# df_sup3 = df_sup3.assign(PercentOfAllocated= +# (abs(df_sup3['FlowRemainder']) / df_sup3[ +# 'SectorMatchFlow']) * 100) +# df_sup3['FlowRemainder'] = np.where( +# (df_sup3["FlowRemainder"] < 0) & +# (df_sup3['PercentOfAllocated'] < percenttolerance), 0, +# df_sup3['FlowRemainder']) +# df_sup3['FlowRemainder'] = np.where( +# df_sup3["FlowRemainder"].between(flowtolerance, 0), 0, +# df_sup3['FlowRemainder']) +# +# # check for negative values +# negv = df_sup3[df_sup3['FlowRemainder'] < 0] +# if len(negv) > 0: +# col_subset = [e for e in negv.columns if e in +# ['Class', 'SourceName', 'FlowName', +# 'Flowable', 'FlowAmount', 'Unit', +# 'Compartment', 'Context', 'Location', 'Year', +# 'SectorProducedBy', 'SectorConsumedBy', +# 'SectorMatchFlow', 'SectorProducedMatch', +# 'SectorConsumedMatch', 'sector_allocated', +# 'FlowRemainder']] +# negv = negv[col_subset].reset_index(drop=True) +# vlog.info( +# 'There are negative values when allocating suppressed ' +# 'parent data to child sector. The values are more than ' +# '%s%% of the total parent sector with a negative flow ' +# 'amount being allocated more than %s. Resetting flow ' +# 'values to be allocated to 0. See validation log for ' +# 'details.', str(percenttolerance), str(flowtolerance)) +# vlog.info('Values where flow remainders are negative, ' +# 'resetting to 0: \n {}'.format(negv.to_string())) +# df_sup3['FlowRemainder'] = np.where(df_sup3["FlowRemainder"] < 0, +# 0, df_sup3['FlowRemainder']) +# df_sup3 = df_sup3.drop(columns=[ +# 'SectorMatchFlow', 'sector_allocated', 'PercentOfAllocated']) +# # add count column used to divide the unallocated flows +# sector_column_match = sector_column.replace('By', 'Match') +# df_sup3 = df_sup3.assign(secCount=df_sup3.groupby(mergecols)[ +# sector_column_match].transform('count')) +# df_sup3 = df_sup3.assign(newFlow=df_sup3['FlowRemainder'] / +# df_sup3['secCount']) +# # reassign values and drop columns +# df_sup3 = df_sup3.assign(FlowAmount=df_sup3['newFlow']) +# df_sup3 = df_sup3.drop(columns=['SectorProducedMatch', +# 'SectorConsumedMatch', +# 'FlowRemainder', 'secCount', +# 'newFlow']) +# # reset SectorLength +# df_sup3['SectorLength'] = 6 +# # add to the df with no suppressed data +# dfns = pd.concat([dfns, df_sup3], ignore_index=True) +# +# dfns = dfns.drop(columns=['SectorLength']) +# dff = sector_aggregation(dfns) +# +# # if activities are source-like, set col values as copies +# # of the sector columns +# if sector_like_activities: +# dff = dff.assign(ActivityProducedBy=dff['SectorProducedBy']) +# dff = dff.assign(ActivityConsumedBy=dff['SectorConsumedBy']) +# # reindex columns +# dff = dff.reindex(df_load.columns, axis=1) +# +# vlog.info('Checking results of allocating suppressed parent to ' +# 'child sectors. ') +# compare_summation_at_sector_lengths_between_two_dfs(df_load, dff) +# compare_child_to_parent_sectors_flowamounts(dff) +# # todo: add third check comparing smallest child naics (6) to largest (2) +# +# # replace null values +# dff = replace_strings_with_NoneType(dff).reset_index(drop=True) +# +# return dff def load_fba_w_standardized_units(datasource, year, **kwargs): @@ -997,82 +997,82 @@ def load_fba_w_standardized_units(datasource, year, **kwargs): return fba -def subset_df_by_sector_lengths(df_load, sector_length_list, **_): - """ - :param df_load: - :param sector_length_list: list (int) of the naics sector lengths that - should be subset - :return: - """ - # subset the df by naics length - cw_load = load_sector_length_cw_melt() - cw = cw_load[cw_load['SectorLength'].isin(sector_length_list)] - sector_list = cw['Sector'].drop_duplicates().values.tolist() - - # if retaining values in adjacent sector columns that are not in the - # sector list, the sector length of those values should be less than the - # sector length of the approved list to prevent double counting when - # looping through all data and pulling the same data twice - sector_sub_list = [] - if _.get('keep_paired_sectors_not_in_subset_list'): - if _.get('keep_shorter_sector_lengths'): - v = min(sector_length_list) - possible_sector_subset_lengths = list(range(2, 8)) - sector_subset_length_list = [ - x for x in possible_sector_subset_lengths if x < v] - elif _.get('keep_shorter_sector_lengths') is False: - v = max(sector_length_list) - possible_sector_subset_lengths = list(range(2, 8)) - sector_subset_length_list = [ - x for x in possible_sector_subset_lengths if x > v] - else: - sector_subset_length_list = list(range(2, 8)) - - cw_sub = cw_load[cw_load['SectorLength'].isin( - sector_subset_length_list)] - sector_sub_list = cw_sub['Sector'].drop_duplicates().values.tolist() - - df = subset_df_by_sector_list( - df_load, sector_list, sector_sub_list=sector_sub_list, **_) - - return df - - -def subset_df_by_sector_list(df_load, sector_list, **_): - """ - :param df_load: - :param sector_list: - :param keep_paired_sectors_not_in_subset_list: bool, default False. If - True, then if values in both sector columns and one value is not in the - sector list, keep the column. Used for the purposes of sector - aggregation. Only for sectors where the paired sector has a sector - length less than sector in sector list, otherwise will get double - counting in sector_aggregation() and sector_disaggregation() - :param **_: optional parameters - :return: - """ - df = replace_NoneType_with_empty_cells(df_load) - - c1 = (df['SectorProducedBy'].isin(sector_list) & - (df['SectorConsumedBy'] == '')) - c2 = (df['SectorProducedBy'] == '') & \ - (df['SectorConsumedBy'].isin(sector_list)) - c3 = (df['SectorProducedBy'].isin(sector_list) & - df['SectorConsumedBy'].isin(sector_list)) - - if _.get('keep_paired_sectors_not_in_subset_list'): - # conditions if want to keep rows of data where one sector value is not - # in the sector list - c4 = (df['SectorProducedBy'].isin(sector_list) & - (df['SectorConsumedBy'].isin(_['sector_sub_list']))) - c5 = (df['SectorProducedBy'].isin(_['sector_sub_list'])) & \ - (df['SectorConsumedBy'].isin(sector_list)) - - df = df[c1 | c2 | c3 | c4 | c5].reset_index(drop=True) - else: - df = df[c1 | c2 | c3].reset_index(drop=True) - - return df +# def subset_df_by_sector_lengths(df_load, sector_length_list, **_): +# """ +# :param df_load: +# :param sector_length_list: list (int) of the naics sector lengths that +# should be subset +# :return: +# """ +# # subset the df by naics length +# cw_load = load_sector_length_cw_melt() +# cw = cw_load[cw_load['SectorLength'].isin(sector_length_list)] +# sector_list = cw['Sector'].drop_duplicates().values.tolist() +# +# # if retaining values in adjacent sector columns that are not in the +# # sector list, the sector length of those values should be less than the +# # sector length of the approved list to prevent double counting when +# # looping through all data and pulling the same data twice +# sector_sub_list = [] +# if _.get('keep_paired_sectors_not_in_subset_list'): +# if _.get('keep_shorter_sector_lengths'): +# v = min(sector_length_list) +# possible_sector_subset_lengths = list(range(2, 8)) +# sector_subset_length_list = [ +# x for x in possible_sector_subset_lengths if x < v] +# elif _.get('keep_shorter_sector_lengths') is False: +# v = max(sector_length_list) +# possible_sector_subset_lengths = list(range(2, 8)) +# sector_subset_length_list = [ +# x for x in possible_sector_subset_lengths if x > v] +# else: +# sector_subset_length_list = list(range(2, 8)) +# +# cw_sub = cw_load[cw_load['SectorLength'].isin( +# sector_subset_length_list)] +# sector_sub_list = cw_sub['Sector'].drop_duplicates().values.tolist() +# +# df = subset_df_by_sector_list( +# df_load, sector_list, sector_sub_list=sector_sub_list, **_) +# +# return df + + +# def subset_df_by_sector_list(df_load, sector_list, **_): +# """ +# :param df_load: +# :param sector_list: +# :param keep_paired_sectors_not_in_subset_list: bool, default False. If +# True, then if values in both sector columns and one value is not in the +# sector list, keep the column. Used for the purposes of sector +# aggregation. Only for sectors where the paired sector has a sector +# length less than sector in sector list, otherwise will get double +# counting in sector_aggregation() and sector_disaggregation() +# :param **_: optional parameters +# :return: +# """ +# df = replace_NoneType_with_empty_cells(df_load) +# +# c1 = (df['SectorProducedBy'].isin(sector_list) & +# (df['SectorConsumedBy'] == '')) +# c2 = (df['SectorProducedBy'] == '') & \ +# (df['SectorConsumedBy'].isin(sector_list)) +# c3 = (df['SectorProducedBy'].isin(sector_list) & +# df['SectorConsumedBy'].isin(sector_list)) +# +# if _.get('keep_paired_sectors_not_in_subset_list'): +# # conditions if want to keep rows of data where one sector value is not +# # in the sector list +# c4 = (df['SectorProducedBy'].isin(sector_list) & +# (df['SectorConsumedBy'].isin(_['sector_sub_list']))) +# c5 = (df['SectorProducedBy'].isin(_['sector_sub_list'])) & \ +# (df['SectorConsumedBy'].isin(sector_list)) +# +# df = df[c1 | c2 | c3 | c4 | c5].reset_index(drop=True) +# else: +# df = df[c1 | c2 | c3].reset_index(drop=True) +# +# return df def subset_and_merge_df_by_sector_lengths( @@ -1178,21 +1178,21 @@ def assign_sector_match_column(df_load, sectorcolumn, sectorlength, return df -def aggregate_and_subset_for_target_sectors(df, method): - """Helper function to create data at aggregated NAICS prior to - subsetting based on the target_sector_list. Designed for use when - FBS are the source data. - """ - from flowsa.sectormapping import get_sector_list - # return sector level specified in method yaml - # load the crosswalk linking sector lengths - secondary_sector_level = method.get('target_subset_sector_level') - sector_list = get_sector_list( - method.get('target_sector_level'), - secondary_sector_level_dict=secondary_sector_level) - - # subset df to get NAICS at the target level - df_agg = sector_aggregation(df) - df_subset = subset_df_by_sector_list(df_agg, sector_list) - - return df_subset +# def aggregate_and_subset_for_target_sectors(df, method): +# """Helper function to create data at aggregated NAICS prior to +# subsetting based on the target_sector_list. Designed for use when +# FBS are the source data. +# """ +# from flowsa.sectormapping import get_sector_list +# # return sector level specified in method yaml +# # load the crosswalk linking sector lengths +# secondary_sector_level = method.get('target_subset_sector_level') +# sector_list = get_sector_list( +# method.get('target_sector_level'), +# secondary_sector_level_dict=secondary_sector_level) +# +# # subset df to get NAICS at the target level +# df_agg = sector_aggregation(df) +# df_subset = subset_df_by_sector_list(df_agg, sector_list) +# +# return df_subset diff --git a/flowsa/sectormapping.py b/flowsa/sectormapping.py index d9ca1666e..2e4bc4b27 100644 --- a/flowsa/sectormapping.py +++ b/flowsa/sectormapping.py @@ -9,13 +9,12 @@ import numpy as np from esupy.mapping import apply_flow_mapping import flowsa -from flowsa.common import get_flowsa_base_name, load_env_file_key, \ - return_true_source_catalog_name, check_activities_sector_like, \ - load_yaml_dict, fba_activity_fields, SECTOR_SOURCE_NAME, fbs_activity_fields +from flowsa.common import get_flowsa_base_name, fba_activity_fields, \ + fbs_activity_fields from flowsa.dataclean import standardize_units from flowsa.flowbyfunctions import load_crosswalk from flowsa.flowsa_log import log -from flowsa.schema import activity_fields, dq_fields +from flowsa.schema import dq_fields def get_activitytosector_mapping(source, fbsconfigpath=None): @@ -59,109 +58,109 @@ def get_activitytosector_mapping(source, fbsconfigpath=None): return mapping -def add_sectors_to_flowbyactivity( - flowbyactivity_df, - activity_to_sector_mapping=None, - sectorsourcename=SECTOR_SOURCE_NAME, - allocationmethod=None, - overwrite_sectorlevel=None, - fbsconfigpath=None -): - """ - Add Sectors from the Activity fields and mapped them to Sector - from the crosswalk. No allocation is performed. - :param flowbyactivity_df: A standard flowbyactivity data frame - :param activity_to_sector_mapping: str, name for activity_to_sector mapping - :param sectorsourcename: A sector source name, using package default - :param allocationmethod: str, modifies function behavoir if = 'direct' - :param fbsconfigpath, str, opt ional path to an FBS method outside flowsa - repo - :return: a df with activity fields mapped to 'sectors' - """ - from flowsa.naics import convert_naics_year - # First check if source activities are NAICS like - - # if so make it into a mapping file - s = pd.unique(flowbyactivity_df['SourceName'])[0] - # load catalog info for source, first check for sourcename used - # in source catalog - ts = return_true_source_catalog_name(s) - src_info = load_yaml_dict('source_catalog')[ts] - # read the pre-determined level of sector aggregation of - # each crosswalk from the source catalog - levelofSectoragg = src_info['sector_hierarchy'] - # if the FBS activity set is 'direct', overwrite the - # levelofsectoragg, or if specified in fxn call - if allocationmethod == 'direct': - levelofSectoragg = 'parent-completeChild' - if overwrite_sectorlevel is not None: - levelofSectoragg = overwrite_sectorlevel - # if data are provided in NAICS format, use the mastercrosswalk - if src_info['sector-like_activities']: - cw = load_crosswalk('sector_timeseries') - sectors = cw.loc[:, [SECTOR_SOURCE_NAME]] - # Create mapping df that's just the sectors at first - mapping = sectors.drop_duplicates() - # Add the sector twice as activities so mapping is identical - mapping = mapping.assign(Activity=sectors[SECTOR_SOURCE_NAME]) - mapping = mapping.rename(columns={SECTOR_SOURCE_NAME: "Sector"}) - # add columns so can run expand_naics_list_fxn - # if sector-like_activities = True, missing columns, so add - mapping['ActivitySourceName'] = s - # tmp assignment - mapping['SectorType'] = None - # Include all digits of naics in mapping, if levelofNAICSagg - # is specified as "aggregated" - if levelofSectoragg == 'aggregated': - mapping = expand_naics_list(mapping, sectorsourcename) - else: - # if source data activities are text strings, or sector-like - # activities should be modified, call on the manually - # created source crosswalks - if activity_to_sector_mapping: - s = activity_to_sector_mapping - mapping = get_activitytosector_mapping(s, fbsconfigpath=fbsconfigpath) - # filter by SectorSourceName of interest - mapping = mapping[mapping['SectorSourceName'] == sectorsourcename] - # drop SectorSourceName - mapping = mapping.drop(columns=['SectorSourceName']) - # Include all digits of naics in mapping, if levelofNAICSagg - # is specified as "aggregated" - if levelofSectoragg == 'aggregated': - mapping = expand_naics_list(mapping, sectorsourcename) - # Merge in with flowbyactivity by - flowbyactivity_wsector_df = flowbyactivity_df.copy(deep=True) - for k, v in activity_fields.items(): - sector_direction = k - flowbyactivity_field = v[0]["flowbyactivity"] - flowbysector_field = v[1]["flowbysector"] - sector_type_field = sector_direction+'SectorType' - mappings_df_tmp = mapping.rename( - columns={'Activity': flowbyactivity_field, - 'Sector': flowbysector_field, - 'SectorType': sector_type_field}) - # column doesn't exist for sector-like activities, - # so ignore if error occurs - mappings_df_tmp = mappings_df_tmp.drop( - columns=['ActivitySourceName'], errors='ignore') - # Merge them in. Critical this is a left merge to - # preserve all unmapped rows - flowbyactivity_wsector_df = pd.merge( - flowbyactivity_wsector_df, mappings_df_tmp, how='left', - on=flowbyactivity_field) - for c in ['SectorProducedBy', 'ProducedBySectorType', - 'SectorConsumedBy', 'ConsumedBySectorType']: - flowbyactivity_wsector_df[c] = \ - flowbyactivity_wsector_df[c].replace({np.nan: None}) - # add sector source name - flowbyactivity_wsector_df = \ - flowbyactivity_wsector_df.assign(SectorSourceName=sectorsourcename) - - # if activities are sector-like check that the sectors are in the crosswalk - if src_info['sector-like_activities']: - flowbyactivity_wsector_df = convert_naics_year( - flowbyactivity_wsector_df, sectorsourcename) - - return flowbyactivity_wsector_df +# def add_sectors_to_flowbyactivity( +# flowbyactivity_df, +# activity_to_sector_mapping=None, +# sectorsourcename=SECTOR_SOURCE_NAME, +# allocationmethod=None, +# overwrite_sectorlevel=None, +# fbsconfigpath=None +# ): +# """ +# Add Sectors from the Activity fields and mapped them to Sector +# from the crosswalk. No allocation is performed. +# :param flowbyactivity_df: A standard flowbyactivity data frame +# :param activity_to_sector_mapping: str, name for activity_to_sector mapping +# :param sectorsourcename: A sector source name, using package default +# :param allocationmethod: str, modifies function behavoir if = 'direct' +# :param fbsconfigpath, str, opt ional path to an FBS method outside flowsa +# repo +# :return: a df with activity fields mapped to 'sectors' +# """ +# from flowsa.naics import convert_naics_year +# # First check if source activities are NAICS like - +# # if so make it into a mapping file +# s = pd.unique(flowbyactivity_df['SourceName'])[0] +# # load catalog info for source, first check for sourcename used +# # in source catalog +# ts = return_true_source_catalog_name(s) +# src_info = load_yaml_dict('source_catalog')[ts] +# # read the pre-determined level of sector aggregation of +# # each crosswalk from the source catalog +# levelofSectoragg = src_info['sector_hierarchy'] +# # if the FBS activity set is 'direct', overwrite the +# # levelofsectoragg, or if specified in fxn call +# if allocationmethod == 'direct': +# levelofSectoragg = 'parent-completeChild' +# if overwrite_sectorlevel is not None: +# levelofSectoragg = overwrite_sectorlevel +# # if data are provided in NAICS format, use the mastercrosswalk +# if src_info['sector-like_activities']: +# cw = load_crosswalk('sector_timeseries') +# sectors = cw.loc[:, [SECTOR_SOURCE_NAME]] +# # Create mapping df that's just the sectors at first +# mapping = sectors.drop_duplicates() +# # Add the sector twice as activities so mapping is identical +# mapping = mapping.assign(Activity=sectors[SECTOR_SOURCE_NAME]) +# mapping = mapping.rename(columns={SECTOR_SOURCE_NAME: "Sector"}) +# # add columns so can run expand_naics_list_fxn +# # if sector-like_activities = True, missing columns, so add +# mapping['ActivitySourceName'] = s +# # tmp assignment +# mapping['SectorType'] = None +# # Include all digits of naics in mapping, if levelofNAICSagg +# # is specified as "aggregated" +# if levelofSectoragg == 'aggregated': +# mapping = expand_naics_list(mapping, sectorsourcename) +# else: +# # if source data activities are text strings, or sector-like +# # activities should be modified, call on the manually +# # created source crosswalks +# if activity_to_sector_mapping: +# s = activity_to_sector_mapping +# mapping = get_activitytosector_mapping(s, fbsconfigpath=fbsconfigpath) +# # filter by SectorSourceName of interest +# mapping = mapping[mapping['SectorSourceName'] == sectorsourcename] +# # drop SectorSourceName +# mapping = mapping.drop(columns=['SectorSourceName']) +# # Include all digits of naics in mapping, if levelofNAICSagg +# # is specified as "aggregated" +# if levelofSectoragg == 'aggregated': +# mapping = expand_naics_list(mapping, sectorsourcename) +# # Merge in with flowbyactivity by +# flowbyactivity_wsector_df = flowbyactivity_df.copy(deep=True) +# for k, v in activity_fields.items(): +# sector_direction = k +# flowbyactivity_field = v[0]["flowbyactivity"] +# flowbysector_field = v[1]["flowbysector"] +# sector_type_field = sector_direction+'SectorType' +# mappings_df_tmp = mapping.rename( +# columns={'Activity': flowbyactivity_field, +# 'Sector': flowbysector_field, +# 'SectorType': sector_type_field}) +# # column doesn't exist for sector-like activities, +# # so ignore if error occurs +# mappings_df_tmp = mappings_df_tmp.drop( +# columns=['ActivitySourceName'], errors='ignore') +# # Merge them in. Critical this is a left merge to +# # preserve all unmapped rows +# flowbyactivity_wsector_df = pd.merge( +# flowbyactivity_wsector_df, mappings_df_tmp, how='left', +# on=flowbyactivity_field) +# for c in ['SectorProducedBy', 'ProducedBySectorType', +# 'SectorConsumedBy', 'ConsumedBySectorType']: +# flowbyactivity_wsector_df[c] = \ +# flowbyactivity_wsector_df[c].replace({np.nan: None}) +# # add sector source name +# flowbyactivity_wsector_df = \ +# flowbyactivity_wsector_df.assign(SectorSourceName=sectorsourcename) +# +# # if activities are sector-like check that the sectors are in the crosswalk +# if src_info['sector-like_activities']: +# flowbyactivity_wsector_df = convert_naics_year( +# flowbyactivity_wsector_df, sectorsourcename) +# +# return flowbyactivity_wsector_df def expand_naics_list(df, sectorsourcename): @@ -211,89 +210,89 @@ def expand_naics_list(df, sectorsourcename): return naics_expanded -def get_fba_allocation_subset(fba_allocation, source, activitynames, - sourceconfig=False, flowSubsetMapped=None, - allocMethod=None, fbsconfigpath=None): - """ - Subset the fba allocation data based on NAICS associated with activity - :param fba_allocation: df, FBA format - :param source: str, source name - :param activitynames: list, activity names in activity set - :param kwargs: can be the mapping file and method of allocation - :return: df, FBA subset - """ - # first determine if there are special cases that would modify the - # typical method of subset an example of a special case is when the - # allocation method is 'proportional-flagged' - subset_by_sector_cols = False - if flowSubsetMapped is not None: - fsm = flowSubsetMapped - if allocMethod is not None: - am = allocMethod - if am == 'proportional-flagged': - subset_by_sector_cols = True - - if check_activities_sector_like(fba_allocation, sourcename=source) is \ - False: - # read in source crosswalk - df = get_activitytosector_mapping( - sourceconfig.get('activity_to_sector_mapping', source), - fbsconfigpath=fbsconfigpath) - sec_source_name = df['SectorSourceName'][0] - df = expand_naics_list(df, sec_source_name) - # subset source crosswalk to only contain values - # pertaining to list of activity names - df = df.loc[df['Activity'].isin(activitynames)] - # turn column of sectors related to activity names into list - sector_list = pd.unique(df['Sector']).tolist() - # subset fba allocation table to the values in - # the activity list, based on overlapping sectors - if 'Sector' in fba_allocation: - fba_allocation_subset =\ - fba_allocation.loc[fba_allocation['Sector'].isin( - sector_list)].reset_index(drop=True) - else: - fba_allocation_subset = \ - fba_allocation.loc[ - (fba_allocation[fbs_activity_fields[0]].isin(sector_list) - ) | - (fba_allocation[fbs_activity_fields[1]].isin(sector_list) - )].reset_index(drop=True) - else: - if 'Sector' in fba_allocation: - fba_allocation_subset =\ - fba_allocation.loc[fba_allocation['Sector'].isin( - activitynames)].reset_index(drop=True) - elif subset_by_sector_cols: - # if it is a special case, then base the subset of data on - # sectors in the sector columns, not on activitynames - fsm_sub = fsm.loc[ - (fsm[fba_activity_fields[0]].isin(activitynames)) | - (fsm[fba_activity_fields[1]].isin(activitynames) - )].reset_index(drop=True) - part1 = fsm_sub[['SectorConsumedBy']] - part2 = fsm_sub[['SectorProducedBy']] - part1.columns = ['Sector'] - part2.columns = ['Sector'] - modified_activitynames = \ - pd.concat([part1, part2], ignore_index=True).drop_duplicates() - modified_activitynames = modified_activitynames[ - modified_activitynames['Sector'].notnull()] - modified_activitynames = modified_activitynames['Sector'].tolist() - fba_allocation_subset = fba_allocation.loc[ - (fba_allocation[fbs_activity_fields[0]].isin( - modified_activitynames)) | - (fba_allocation[fbs_activity_fields[1]].isin( - modified_activitynames) - )].reset_index(drop=True) - - else: - fba_allocation_subset = fba_allocation.loc[ - (fba_allocation[fbs_activity_fields[0]].isin(activitynames)) | - (fba_allocation[fbs_activity_fields[1]].isin(activitynames) - )].reset_index(drop=True) - - return fba_allocation_subset +# def get_fba_allocation_subset(fba_allocation, source, activitynames, +# sourceconfig=False, flowSubsetMapped=None, +# allocMethod=None, fbsconfigpath=None): +# """ +# Subset the fba allocation data based on NAICS associated with activity +# :param fba_allocation: df, FBA format +# :param source: str, source name +# :param activitynames: list, activity names in activity set +# :param kwargs: can be the mapping file and method of allocation +# :return: df, FBA subset +# """ +# # first determine if there are special cases that would modify the +# # typical method of subset an example of a special case is when the +# # allocation method is 'proportional-flagged' +# subset_by_sector_cols = False +# if flowSubsetMapped is not None: +# fsm = flowSubsetMapped +# if allocMethod is not None: +# am = allocMethod +# if am == 'proportional-flagged': +# subset_by_sector_cols = True +# +# if check_activities_sector_like(fba_allocation, sourcename=source) is \ +# False: +# # read in source crosswalk +# df = get_activitytosector_mapping( +# sourceconfig.get('activity_to_sector_mapping', source), +# fbsconfigpath=fbsconfigpath) +# sec_source_name = df['SectorSourceName'][0] +# df = expand_naics_list(df, sec_source_name) +# # subset source crosswalk to only contain values +# # pertaining to list of activity names +# df = df.loc[df['Activity'].isin(activitynames)] +# # turn column of sectors related to activity names into list +# sector_list = pd.unique(df['Sector']).tolist() +# # subset fba allocation table to the values in +# # the activity list, based on overlapping sectors +# if 'Sector' in fba_allocation: +# fba_allocation_subset =\ +# fba_allocation.loc[fba_allocation['Sector'].isin( +# sector_list)].reset_index(drop=True) +# else: +# fba_allocation_subset = \ +# fba_allocation.loc[ +# (fba_allocation[fbs_activity_fields[0]].isin(sector_list) +# ) | +# (fba_allocation[fbs_activity_fields[1]].isin(sector_list) +# )].reset_index(drop=True) +# else: +# if 'Sector' in fba_allocation: +# fba_allocation_subset =\ +# fba_allocation.loc[fba_allocation['Sector'].isin( +# activitynames)].reset_index(drop=True) +# elif subset_by_sector_cols: +# # if it is a special case, then base the subset of data on +# # sectors in the sector columns, not on activitynames +# fsm_sub = fsm.loc[ +# (fsm[fba_activity_fields[0]].isin(activitynames)) | +# (fsm[fba_activity_fields[1]].isin(activitynames) +# )].reset_index(drop=True) +# part1 = fsm_sub[['SectorConsumedBy']] +# part2 = fsm_sub[['SectorProducedBy']] +# part1.columns = ['Sector'] +# part2.columns = ['Sector'] +# modified_activitynames = \ +# pd.concat([part1, part2], ignore_index=True).drop_duplicates() +# modified_activitynames = modified_activitynames[ +# modified_activitynames['Sector'].notnull()] +# modified_activitynames = modified_activitynames['Sector'].tolist() +# fba_allocation_subset = fba_allocation.loc[ +# (fba_allocation[fbs_activity_fields[0]].isin( +# modified_activitynames)) | +# (fba_allocation[fbs_activity_fields[1]].isin( +# modified_activitynames) +# )].reset_index(drop=True) +# +# else: +# fba_allocation_subset = fba_allocation.loc[ +# (fba_allocation[fbs_activity_fields[0]].isin(activitynames)) | +# (fba_allocation[fbs_activity_fields[1]].isin(activitynames) +# )].reset_index(drop=True) +# +# return fba_allocation_subset def convert_units_to_annual(df): From 1018194245b786dc6121cf501607473ed75461c5 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Jul 2023 14:24:33 -0600 Subject: [PATCH 0667/1127] remove extra space --- flowsa/methods/flowbysectormethods/Water_common.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Water_common.yaml b/flowsa/methods/flowbysectormethods/Water_common.yaml index 30d4db991..2d7ffc9c5 100644 --- a/flowsa/methods/flowbysectormethods/Water_common.yaml +++ b/flowsa/methods/flowbysectormethods/Water_common.yaml @@ -25,7 +25,7 @@ sources_to_cache: clean_fba_after_attribution: !clean_function:flowbyclean substitute_nonexistent_values clean_source: USDA_IWMS: - geoscale: national #todo: check should be national + geoscale: national #todo: check if should be default national # year: 2018 # specify in year-specific yaml selection_fields: Class: Water @@ -33,7 +33,7 @@ sources_to_cache: - attribution_method: direct clean_fba_after_attribution: !clean_function:flowbyclean weighted_average replacement_dictionary: {'HAY & HAYLAGE, (EXCL ALFALFA)': 'HAY & HAYLAGE', - 'HAY & HAYLAGE, ALFALFA': 'HAY & HAYLAGE', + 'HAY & HAYLAGE, ALFALFA': 'HAY & HAYLAGE', '111940A': '111940', '111940B': '111940'} clean_source: From 05ad9f75d3cf745a1a32a08621b4468e62085ca5 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Jul 2023 14:25:15 -0600 Subject: [PATCH 0668/1127] update naics.py fxn descriptions --- flowsa/naics.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/flowsa/naics.py b/flowsa/naics.py index 211b85880..ee92a3c08 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -3,7 +3,7 @@ import numpy as np from flowsa.flowbyfunctions import aggregator from flowsa.flowsa_log import vlog, log -from . import (common, dataclean, settings) +from . import (common, settings) naics_crosswalk = pd.read_csv( settings.datapath / 'NAICS_2012_Crosswalk.csv', dtype='object' @@ -84,6 +84,7 @@ def map_target_sectors_to_less_aggregated_sectors( ) -> pd.DataFrame: """ Map target NAICS to all possible other sector lengths + flat hierarchy """ naics = naics_crosswalk.assign( @@ -127,7 +128,8 @@ def map_source_sectors_to_less_aggregated_sectors( year: Literal[2002, 2007, 2012, 2017] = 2012 ) -> pd.DataFrame: """ - Map target NAICS to all possible other sector lengths + Map source NAICS to all possible other sector lengths + parent-childhierarchy """ naics = [] for n in naics_crosswalk.columns.values.tolist(): From 10363e942f5ff4f60dce03ee02720d8c65b4c044 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 12 Jul 2023 14:26:33 -0600 Subject: [PATCH 0669/1127] use state level mining info in water m2 to keep the correct flow types --- flowsa/methods/flowbysectormethods/Water_national_2015_m2.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m2.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m2.yaml index 812f9519c..299160af1 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m2.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m2.yaml @@ -20,7 +20,6 @@ source_names: # !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:direct_attribution mining_attribution: # !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:mining_attribution - geoscale: national selection_fields: PrimaryActivity: - "Mining" From fed9c7f9ed3b65d88f2e94aeaa85afc6ce9f4e5d Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 13 Jul 2023 14:39:01 -0600 Subject: [PATCH 0670/1127] for cap_hap, call update_regions_to_states() as a 'clean_fba_after_attribution' parameter in the yaml and load employment data as 'clean_source' so can use load_prepare_clean_source() which will attribute employment data to target sectors --- flowsa/data_source_scripts/EIA_MECS.py | 22 ++++++++----------- .../flowbysectormethods/CAP_HAP_common.yaml | 4 ++-- .../CAP_HAP_state_2014.yaml | 2 +- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/flowsa/data_source_scripts/EIA_MECS.py b/flowsa/data_source_scripts/EIA_MECS.py index 929326526..e9f0f419f 100644 --- a/flowsa/data_source_scripts/EIA_MECS.py +++ b/flowsa/data_source_scripts/EIA_MECS.py @@ -16,7 +16,8 @@ from flowsa.common import WITHDRAWN_KEYWORD from flowsa.flowsa_log import log from flowsa.flowby import FlowByActivity -from flowsa.flowbyfunctions import assign_fips_location_system, sector_aggregation +from flowsa.flowbyclean import load_prepare_clean_source +from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.data_source_scripts.EIA_CBECS_Land import \ calculate_total_facility_land_area @@ -550,7 +551,7 @@ def clean_mecs_energy_fba(fba: FlowByActivity, **_) -> FlowByActivity: .drop(columns=['descendant_flows', 'descendants_y']) ) - return mecs.drop(columns=['descendants']) + return mecs def clean_mapped_mecs_energy_fba(fba: FlowByActivity, **_) -> FlowByActivity: @@ -595,7 +596,8 @@ def clean_mapped_mecs_energy_fba_to_state( return fba -def update_regions_to_states(fba: FlowByActivity, **_) -> FlowByActivity: +def update_regions_to_states(fba: FlowByActivity, + download_sources_ok: bool = True) -> FlowByActivity: """ Propogates regions to all states to enable for use in state methods. Allocates sectors across states based on employment. @@ -605,24 +607,18 @@ def update_regions_to_states(fba: FlowByActivity, **_) -> FlowByActivity: log.info('Updating census regions to states') region_map = get_region_and_division_codes() - region_map = region_map[['Region','State_FIPS']].drop_duplicates() + region_map = region_map[['Region', 'State_FIPS']].drop_duplicates() region_map.loc[:, 'State_FIPS'] = ( region_map['State_FIPS'].apply(lambda x: x.ljust(3 + len(x), '0') if len(x) < 5 else x)) # Allocate MECS based on employment FBS - hlp = flowsa.getFlowBySector( - methodname=fba.config.get('attribution_source'), - download_FBS_if_missing=True) - - # To match the various sector resolution of MECS, generate employment - # dataset for all NAICS resolution by aggregating - hlp = sector_aggregation(hlp) + hlp = load_prepare_clean_source(fba, download_sources_ok=download_sources_ok) # For each region, generate ratios across states for a given sector - hlp = hlp.merge(region_map, how = 'left', left_on = 'Location', - right_on = 'State_FIPS') + hlp = hlp.merge(region_map, how='left', left_on='Location', + right_on='State_FIPS') hlp['Allocation'] = hlp['FlowAmount']/hlp.groupby( ['Region', 'SectorProducedBy']).FlowAmount.transform('sum') diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml index f62c6143b..d163b916e 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml @@ -39,8 +39,8 @@ sources_to_cache: Location: '00000' estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy clean_fba: !script_function:EIA_MECS clean_mecs_energy_fba - clean_fba_w_sec: !script_function:EIA_MECS clean_mapped_mecs_energy_fba_to_state - attribution_source: Employment_state_2018 ## Update to MECS year + clean_fba_after_attribution: !script_function:EIA_MECS clean_mapped_mecs_energy_fba_to_state + clean_source: Employment_state_2018 ## Update to MECS year _attribution_sources: BEA: &bea diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2014.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2014.yaml index 6f26db7e2..c1eaebe28 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2014.yaml @@ -14,7 +14,7 @@ sources_to_cache: EIA_MECS_Energy: !include:CAP_HAP_common.yaml:sources_to_cache:EIA_MECS_Energy_state year: 2014 - attribution_source: Employment_state_2014 + clean_source: Employment_state_2014 _attribution_sources: stateio: &stateio From 10a6e22529e05c9486b41a5ceb9964bf19cd522c Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 13 Jul 2023 14:40:07 -0600 Subject: [PATCH 0671/1127] skip validation check if division --- flowsa/flowby.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 75df2f3d5..8673ebd02 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -721,9 +721,10 @@ def attribute_flows_to_sectors( else: attributed_fb = fb.equally_attribute() - # if the attribution method is not multiplication, check that new df - # values equal original df values - if attribution_method not in ['multiplication', 'inheritance']: + # depending on att method, check that new df values equal + # original df values + if attribution_method not in ['multiplication', 'inheritance', + 'division']: # todo: add results from this if statement to validation log validation_fb = attributed_fb.assign( validation_total=(attributed_fb.groupby('group_id') From 5f3060fcdbfcab4bab681b04863f53bc1c1f2d55 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 13 Jul 2023 14:41:25 -0600 Subject: [PATCH 0672/1127] comment out obsolete code --- flowsa/flowbyfunctions.py | 244 +++++++++++++++++++------------------- 1 file changed, 122 insertions(+), 122 deletions(-) diff --git a/flowsa/flowbyfunctions.py b/flowsa/flowbyfunctions.py index a5bf96dae..64e1399a8 100644 --- a/flowsa/flowbyfunctions.py +++ b/flowsa/flowbyfunctions.py @@ -150,46 +150,46 @@ def is_identical(s): return df_dfg - -def sector_ratios(df, sectorcolumn): - """ - Determine ratios of the less aggregated sectors within a - more aggregated sector - :param df: A df with sector columns - :param sectorcolumn: 'SectorConsumedBy' or 'SectorProducedBy' - :return: df, with 'FlowAmountRatio' column - """ - - # drop any null rows (can occur when activities are ranges) - df = df[~df[sectorcolumn].isnull()] - - # find the longest length sector - length = max(df[sectorcolumn].apply(lambda x: len(str(x))).unique()) - # for loop in reverse order longest length naics minus 1 to 2 - # appends missing naics levels to df - sec_ratios = [] - for i in range(length, 3, -1): - # subset df to sectors with length = i - df_subset = subset_df_by_sector_lengths(df, [i]) - # create column for sector grouping - df_subset = assign_sector_match_column(df_subset, sectorcolumn, i, i-1) - # subset df to create denominator - df_denom = df_subset[['FlowAmount', 'Location', 'sector_group']] - df_denom = df_denom.groupby(['Location', 'sector_group'], - as_index=False).agg({"FlowAmount": sum}) - df_denom = df_denom.rename(columns={"FlowAmount": "Denominator"}) - # merge the denominator column with fba_w_sector df - ratio_df = df_subset.merge(df_denom, how='left') - # calculate ratio - ratio_df.loc[:, 'FlowAmountRatio'] = \ - ratio_df['FlowAmount'] / ratio_df['Denominator'] - ratio_df = ratio_df.drop( - columns=['Denominator', 'sector_group']) - sec_ratios.append(ratio_df) - # concat list of dataframes (info on each page) - df_w_ratios = pd.concat(sec_ratios, ignore_index=True) - - return df_w_ratios +# todo: delete +# def sector_ratios(df, sectorcolumn): +# """ +# Determine ratios of the less aggregated sectors within a +# more aggregated sector +# :param df: A df with sector columns +# :param sectorcolumn: 'SectorConsumedBy' or 'SectorProducedBy' +# :return: df, with 'FlowAmountRatio' column +# """ +# +# # drop any null rows (can occur when activities are ranges) +# df = df[~df[sectorcolumn].isnull()] +# +# # find the longest length sector +# length = max(df[sectorcolumn].apply(lambda x: len(str(x))).unique()) +# # for loop in reverse order longest length naics minus 1 to 2 +# # appends missing naics levels to df +# sec_ratios = [] +# for i in range(length, 3, -1): +# # subset df to sectors with length = i +# df_subset = subset_df_by_sector_lengths(df, [i]) +# # create column for sector grouping +# df_subset = assign_sector_match_column(df_subset, sectorcolumn, i, i-1) +# # subset df to create denominator +# df_denom = df_subset[['FlowAmount', 'Location', 'sector_group']] +# df_denom = df_denom.groupby(['Location', 'sector_group'], +# as_index=False).agg({"FlowAmount": sum}) +# df_denom = df_denom.rename(columns={"FlowAmount": "Denominator"}) +# # merge the denominator column with fba_w_sector df +# ratio_df = df_subset.merge(df_denom, how='left') +# # calculate ratio +# ratio_df.loc[:, 'FlowAmountRatio'] = \ +# ratio_df['FlowAmount'] / ratio_df['Denominator'] +# ratio_df = ratio_df.drop( +# columns=['Denominator', 'sector_group']) +# sec_ratios.append(ratio_df) +# # concat list of dataframes (info on each page) +# df_w_ratios = pd.concat(sec_ratios, ignore_index=True) +# +# return df_w_ratios def remove_parent_sectors_from_crosswalk(cw_load, sector_list): @@ -206,88 +206,88 @@ def remove_parent_sectors_from_crosswalk(cw_load, sector_list): return cw_load - -def sector_aggregation(df_load, return_all_possible_sector_combos=False, - sectors_to_exclude_from_agg=None): - """ - Function that checks if a sector length exists, and if not, - sums the less aggregated sector - :param df_load: Either a flowbyactivity df with sectors or - a flowbysector df - :param return_all_possible_sector_combos: bool, default false, if set to - true, will return all possible combinations of sectors at each sector - length (ex. a 4 digit SectorProducedBy will have rows for 2-6 digit - SectorConsumedBy). This will result in a df with double counting. - :param sectors_to_exclude_from_agg: list or dict, sectors that should not be - aggregated beyond the sector level provided. Dictionary if separate lists - for SectorProducedBy and SectorConsumedBy - :return: df, with aggregated sector values - """ - df = df_load.copy() - - # determine grouping columns - based on datatype - group_cols = list(df.select_dtypes(include=['object', 'int']).columns) - sector_cols = ['SectorProducedBy', 'SectorConsumedBy'] - if 'Sector' in df.columns: - sector_cols = ['Sector'] - - if 'ActivityProducedBy' in df_load.columns: - # determine if activities are sector-like, if aggregating a df with a - # 'SourceName' - sector_like_activities = check_activities_sector_like(df_load) - # if activities are sector like, drop columns while running ag then - # add back in - if sector_like_activities: - # subset df - df_cols = [e for e in df.columns if e not in - ('ActivityProducedBy', 'ActivityConsumedBy')] - group_cols = [e for e in group_cols if e not in - ('ActivityProducedBy', 'ActivityConsumedBy')] - df = df[df_cols] - df = df.reset_index(drop=True) - - # load naics length crosswwalk - cw_load = load_crosswalk('sector_length') - # remove any parent sectors of sectors identified as those that should - # not be aggregated - if sectors_to_exclude_from_agg is not None: - # if sectors are in a dictionary create cw for sectorproducedby and - # sectorconsumedby otherwise single cr - if isinstance(sectors_to_exclude_from_agg, dict): - cws = {} - for s in sector_cols: - try: - cw = remove_parent_sectors_from_crosswalk( - cw_load, sectors_to_exclude_from_agg[s]) - cws[s] = cw - except KeyError: - cws[s] = cw_load - cw_load = cws.copy() - else: - cw_load = remove_parent_sectors_from_crosswalk( - cw_load, sectors_to_exclude_from_agg) - - # find the longest length sector - length = df[sector_cols].apply(lambda x: x.str.len()).max().max() - length = int(length) - # for loop in reverse order longest length NAICS minus 1 to 2 - # appends missing naics levels to df - for i in range(length, 2, -1): - if return_all_possible_sector_combos: - for j in range(1, i-1): - df = append_new_sectors(df, i, j, cw_load, group_cols) - else: - df = append_new_sectors(df, i, 1, cw_load, group_cols) - - if 'ActivityProducedBy' in df_load.columns: - # if activities are source-like, set col values as - # copies of the sector columns - if sector_like_activities & ('FlowAmount' in df.columns) & \ - ('ActivityProducedBy' in df_load.columns): - df = df.assign(ActivityProducedBy=df['SectorProducedBy']) - df = df.assign(ActivityConsumedBy=df['SectorConsumedBy']) - - return df.reset_index(drop=True) +# todo: delete +# def sector_aggregation(df_load, return_all_possible_sector_combos=False, +# sectors_to_exclude_from_agg=None): +# """ +# Function that checks if a sector length exists, and if not, +# sums the less aggregated sector +# :param df_load: Either a flowbyactivity df with sectors or +# a flowbysector df +# :param return_all_possible_sector_combos: bool, default false, if set to +# true, will return all possible combinations of sectors at each sector +# length (ex. a 4 digit SectorProducedBy will have rows for 2-6 digit +# SectorConsumedBy). This will result in a df with double counting. +# :param sectors_to_exclude_from_agg: list or dict, sectors that should not be +# aggregated beyond the sector level provided. Dictionary if separate lists +# for SectorProducedBy and SectorConsumedBy +# :return: df, with aggregated sector values +# """ +# df = df_load.copy() +# +# # determine grouping columns - based on datatype +# group_cols = list(df.select_dtypes(include=['object', 'int']).columns) +# sector_cols = ['SectorProducedBy', 'SectorConsumedBy'] +# if 'Sector' in df.columns: +# sector_cols = ['Sector'] +# +# if 'ActivityProducedBy' in df_load.columns: +# # determine if activities are sector-like, if aggregating a df with a +# # 'SourceName' +# sector_like_activities = check_activities_sector_like(df_load) +# # if activities are sector like, drop columns while running ag then +# # add back in +# if sector_like_activities: +# # subset df +# df_cols = [e for e in df.columns if e not in +# ('ActivityProducedBy', 'ActivityConsumedBy')] +# group_cols = [e for e in group_cols if e not in +# ('ActivityProducedBy', 'ActivityConsumedBy')] +# df = df[df_cols] +# df = df.reset_index(drop=True) +# +# # load naics length crosswwalk +# cw_load = load_crosswalk('sector_length') +# # remove any parent sectors of sectors identified as those that should +# # not be aggregated +# if sectors_to_exclude_from_agg is not None: +# # if sectors are in a dictionary create cw for sectorproducedby and +# # sectorconsumedby otherwise single cr +# if isinstance(sectors_to_exclude_from_agg, dict): +# cws = {} +# for s in sector_cols: +# try: +# cw = remove_parent_sectors_from_crosswalk( +# cw_load, sectors_to_exclude_from_agg[s]) +# cws[s] = cw +# except KeyError: +# cws[s] = cw_load +# cw_load = cws.copy() +# else: +# cw_load = remove_parent_sectors_from_crosswalk( +# cw_load, sectors_to_exclude_from_agg) +# +# # find the longest length sector +# length = df[sector_cols].apply(lambda x: x.str.len()).max().max() +# length = int(length) +# # for loop in reverse order longest length NAICS minus 1 to 2 +# # appends missing naics levels to df +# for i in range(length, 2, -1): +# if return_all_possible_sector_combos: +# for j in range(1, i-1): +# df = append_new_sectors(df, i, j, cw_load, group_cols) +# else: +# df = append_new_sectors(df, i, 1, cw_load, group_cols) +# +# if 'ActivityProducedBy' in df_load.columns: +# # if activities are source-like, set col values as +# # copies of the sector columns +# if sector_like_activities & ('FlowAmount' in df.columns) & \ +# ('ActivityProducedBy' in df_load.columns): +# df = df.assign(ActivityProducedBy=df['SectorProducedBy']) +# df = df.assign(ActivityConsumedBy=df['SectorConsumedBy']) +# +# return df.reset_index(drop=True) def append_new_sectors(df, i, j, cw_load, group_cols): From 10f6e748b7ba08e044f0add4ea431a06378ddf12 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 14 Jul 2023 08:51:10 -0600 Subject: [PATCH 0673/1127] clarify comment --- .../flowbysectormethods/Food_Waste_national_2018_m1.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m1.yaml b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m1.yaml index 388494d78..74b0c02b3 100644 --- a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m1.yaml @@ -42,7 +42,9 @@ source_names: - "Restaurants/Food Services" - "Retail" attribution_method: proportional - # do not want to attribute the waste management pathways using employment data (SectorConsumedBy) + # do not want to attribute the waste management pathways using +# employment data (SectorConsumedBy), only attribute the waste +# generation activities (SectorProducedBy) attribute_on: [SectorProducedBy] attribution_source: Employment_national_2018 establishments: From 3e30645250803a064844b0f8221c1a2078385186 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 14 Jul 2023 08:52:12 -0600 Subject: [PATCH 0674/1127] correct denominator calculation if attributing on specify column(s) --- flowsa/flowby.py | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 8673ebd02..8c85cf3c7 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -957,20 +957,10 @@ def proportionally_attribute( log.info(f'Proportionally attributing on {attribute_cols}') fb = (fb.add_primary_secondary_columns('Sector')) - # todo: move these cols out of here and instead need to specify - # all columns in the FBS method - groupby_cols = attribute_cols + ['Unit', 'Location'] - other_with_denominator = ( - other - .assign(denominator=(other - .groupby(groupby_cols)['FlowAmount'] - .transform('sum'))) - ) - - with_denominator = ( + merged = ( fb - .merge(other_with_denominator, + .merge(other, how='left', left_on=attribute_cols + ['temp_location' if 'temp_location' in fb else @@ -980,15 +970,22 @@ def proportionally_attribute( .fillna({'FlowAmount_other': 0}) ) - non_zero_denominator = with_denominator.query(f'denominator != 0 ') - unattributable = with_denominator.query(f'denominator == 0 ') + merged_with_denominator = ( + merged + .assign(denominator=(merged + .groupby('group_id')['FlowAmount_other'] + .transform('sum'))) + ) + + non_zero_denominator = merged_with_denominator.query(f'denominator != 0 ') + unattributable = merged_with_denominator.query(f'denominator == 0 ') if not unattributable.empty: log.warning( 'Could not attribute activities %s in %s due to lack of ' 'flows in attribution source %s for mapped sectors', - set(zip(unattributable.ActivityProducedBy, - unattributable.ActivityConsumedBy, + set(zip(unattributable.SectorProducedBy, + unattributable.SectorConsumedBy, unattributable.Location)), unattributable.full_name, other.full_name @@ -1002,9 +999,14 @@ def proportionally_attribute( * x.FlowAmount_other / x.denominator)) ) - fill_col = self.config.get('fill_columns') - if fill_col is not None: - fb[fill_col] = fb[f'{fill_col}_other'] + # if the fbs method yamls specifies that a column from in the + # primary data source should be replaced with data from the + # attribution source, fill here + fill_col = self.config.get('fill_columns') + if fill_col is not None: + log.info(f'Replacing {fill_col} values in primary data source ' + f'with those from attribution source.') + fb[fill_col] = fb[f'{fill_col}_other'] # drop rows where 'FlowAmount_other' is 0 because the primary # activities are not attributed to those sectors. The values are 0 From 16c4db04681c84f7db453aba3e827cf021bef95c Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 14 Jul 2023 08:52:46 -0600 Subject: [PATCH 0675/1127] drop 'suppressed' and 'descendants' columns after generating fbs --- flowsa/flowby.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 8c85cf3c7..34dbad55d 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -750,7 +750,9 @@ def attribute_flows_to_sectors( # specified in the config file self = ( attributed_fb - .drop(columns=['group_id', 'group_total', 'group_count', 'FlowAmount_ds', 'factor'], errors='ignore') + .drop(columns=['group_id', 'group_total', 'group_count', + 'FlowAmount_ds', 'factor', 'Suppressed', + 'descendants'], errors='ignore') .drop(columns=step_config.get('drop_columns', [])) ) # reset datatype to FBS because otherwise when we loop through From 6e51379102f09dd81e327c8a6928e1670d52bb64 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 14 Jul 2023 08:54:20 -0600 Subject: [PATCH 0676/1127] update estimate_suppressed_sectors_equal_attribution() to work when there are hyphenated sectors - for now, dropping hyphenated sectors --- flowsa/flowbyclean.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index 464a04df4..5223bcc4f 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -181,25 +181,24 @@ def estimate_suppressed_sectors_equal_attribution( # todo: update function to work for any number of sector lengths # todo: update to loop through both sector columns, see equally_attribute() + log.info('Estimating suppressed data by equally attributing parent to ' + 'child sectors.') naics_key = map_source_sectors_to_less_aggregated_sectors() # forward fill naics_key = naics_key.T.ffill().T col = return_primary_activity_column(fba) - # todo: don't drop these grouped sectors, instead, incorporate into fxn - fba = fba[~fba[col].isin( - ['1125 & 1129', '11193 & 11194 & 11199'])].reset_index(drop=True) - - indexed = ( + # todo: All hyphenated sectors are currently dropped, modify code so + # they are not + fba_m = ( fba .merge(naics_key, how='left', left_on=col, right_on='source_naics') - .drop(columns='source_naics') .assign(location=fba.Location, category=fba.FlowName) - .replace({'FlowAmount': {0: np.nan}, - # col: {'1125 & 1129': '112X' #, + .replace({'FlowAmount': {0: np.nan} #, + # col: {'1125 & 1129': '112X', # '11193 & 11194 & 11199': '1119X', # '31-33': '3X', # '44-45': '4X', @@ -210,11 +209,13 @@ def estimate_suppressed_sectors_equal_attribution( # 'n4': {'1125': '112X', '1129': '112X'}, # 'n5': {'11193': '1119X', '11194': '1119X', '11199': '1119X'} }) - .set_index(['n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'location', - 'category'], - verify_integrity=True) + .dropna(subset='source_naics') + .drop(columns='source_naics') ) + indexed = fba_m.set_index(['n2', 'n3', 'n4', 'n5', 'n6', 'n7', + 'location', 'category'], verify_integrity=True) + def fill_suppressed( flows: pd.Series, level: int, From a32ebf9e6adecd49e4efcb693b058651af5836cf Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 14 Jul 2023 08:57:35 -0600 Subject: [PATCH 0677/1127] update to use recursive method of returning FBS in datavis --- flowsa/datavisualization.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/flowsa/datavisualization.py b/flowsa/datavisualization.py index 9d1afec4b..7b0e071cd 100644 --- a/flowsa/datavisualization.py +++ b/flowsa/datavisualization.py @@ -14,7 +14,9 @@ import flowsa from flowsa.common import load_crosswalk, load_yaml_dict from flowsa.dataclean import replace_NoneType_with_empty_cells -from flowsa.flowbyfunctions import sector_aggregation +# todo: need to update fxn to use new sector_aggregation - datavis not +# currently working +# from flowsa.flowbyfunctions import sector_aggregation from flowsa.flowsa_log import log from flowsa.sectormapping import get_sector_list from flowsa.settings import datapath, plotoutputpath @@ -445,7 +447,9 @@ def generateSankeyData(methodname, :return: csv file for use in generating sankey diagram """ - df = flowsa.getFlowBySector(methodname, fbsconfigpath=fbsconfigpath) + df = flowsa.FlowBySector.getFlowBySector( + methodname, external_config_path=fbsconfigpath, download_sources_ok=True) + df = convert_units_for_graphics(df) # subset df From 4e0c632e83dbc02bfee5cda22941f1210c917323 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 14 Jul 2023 09:01:09 -0600 Subject: [PATCH 0678/1127] comment out obsolete code in validatiaon.py --- flowsa/validation.py | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/flowsa/validation.py b/flowsa/validation.py index 622183d20..cf30d3757 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -10,14 +10,10 @@ import flowsa from flowsa.flowby import FlowBySector from flowsa.flowbyfunctions import aggregator, create_geoscale_list,\ - subset_df_by_geoscale, sector_aggregation, collapse_fbs_sectors,\ - subset_df_by_sector_lengths + collapse_fbs_sectors from flowsa.flowsa_log import log, vlog -from flowsa.dataclean import replace_strings_with_NoneType, \ - replace_NoneType_with_empty_cells -from flowsa.common import sector_level_key, \ - fba_activity_fields, check_activities_sector_like -from flowsa.location import US_FIPS, fips_number_key +from flowsa.common import sector_level_key, fba_activity_fields +from flowsa.location import US_FIPS from flowsa.schema import dq_fields @@ -28,8 +24,6 @@ def check_if_data_exists_at_geoscale(df_load, geoscale): :param geoscale: national, state, or county """ - df_load = replace_NoneType_with_empty_cells(df_load) - # filter by geoscale depends on Location System fips_list = create_geoscale_list(df_load, geoscale) fips = pd.DataFrame(fips_list, columns=['FIPS']) @@ -107,12 +101,8 @@ def calculate_flowamount_diff_between_dfs(dfa_load, dfb_load): geoscale=np.where(vars()[df_name+'2']['Location'] == '00000', 'national', vars()[df_name+'2']['geoscale'])) # ensure all nan/nones filled/match - vars()[df_name + '2'] = \ - replace_strings_with_NoneType(vars()[df_name+'2']) df_list.append(vars()[df_name+'2']) # merge the two dataframes - for df in df_list: - replace_NoneType_with_empty_cells(df) df = df_list[0].merge(df_list[1], how='outer') # determine if any new data is negative @@ -150,9 +140,9 @@ def calculate_flowamount_diff_between_dfs(dfa_load, dfb_load): else: # subset df and aggregate, also print out the total # aggregate diff at the geoscale - dfagg3 = replace_strings_with_NoneType(dfagg).drop( - columns=['ActivityProducedBy', 'ActivityConsumedBy', - 'FlowAmount_Difference', 'Percent_Difference']) + dfagg3 = dfagg.drop(columns=[ + 'ActivityProducedBy', 'ActivityConsumedBy', + 'FlowAmount_Difference', 'Percent_Difference']) dfagg4 = dfagg3.groupby(flowcols + ['Unit', 'geoscale'], dropna=False, as_index=False).agg( {'FlowAmount_Original': sum, 'FlowAmount_Modified': sum}) @@ -220,8 +210,6 @@ def compare_activity_to_sector_flowamounts(fba_load, fbs_load, fbs = fbs_load[fbs_load.columns.intersection( col_subset_2)].reset_index(drop=True) - fbs = replace_NoneType_with_empty_cells(fbs) - # determine which for i in ['Produced', 'Consumed']: try: @@ -465,7 +453,6 @@ def compare_summation_at_sector_lengths_between_two_dfs(df1, df2): df_list = [] for df in [df1, df2]: - df = replace_NoneType_with_empty_cells(df) df = assign_columns_of_sector_levels(df) # sum flowamounts by sector length dfsum = df.groupby(agg_cols).agg({'FlowAmount': 'sum'}).reset_index() From 15cf99cbc382d5b105219aa8a84a3a416a87b54e Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 14 Jul 2023 09:09:46 -0600 Subject: [PATCH 0679/1127] comment out data vis fxns for now - need to update to work for recursive methods --- flowsa/datavisualization.py | 756 ++++++++++++++++++------------------ 1 file changed, 378 insertions(+), 378 deletions(-) diff --git a/flowsa/datavisualization.py b/flowsa/datavisualization.py index 7b0e071cd..8867a33bf 100644 --- a/flowsa/datavisualization.py +++ b/flowsa/datavisualization.py @@ -143,225 +143,225 @@ def FBSscatterplot(method_dict, plottype, sector_length_display=None, def customwrap(s, width=30): return "
".join(textwrap.wrap(s, width=width)) - -def stackedBarChart(df, - impact_cat=None, - selection_fields=None, - target_sector_level=None, - target_subset_sector_level=None, - stacking_col='AttributionSources', - generalize_AttributionSources=False, - plot_title=None, - index_cols=None, - orientation='h', - grouping_variable=None, - sector_variable='Sector', - subplot=None, - rows=1, - cols=1, - filename = 'flowsaBarChart', - graphic_width = 1200, - graphic_height = 1200 - ): - """ - Create a grouped, stacked barchart by sector code. If impact=True, - group data by context as well as sector - :param df: str or df, either an FBS methodname (ex. "Water_national_m1_2015") or a df - :param impact_cat: str, name of impact category to apply and aggregate on - impacts (e.g.: 'Global warming'). Use 'None' to aggregate by flow - :return: stacked, group bar plot - """ - # if the df provided is a string, load the fbs method, otherwise use the - # df provided - if (type(df)) == str: - df = flowsa.collapse_FlowBySector(df) - - if generalize_AttributionSources: - df['AttributionSources'] = np.where( - df['AttributionSources'] != 'Direct', - 'Allocated', - df['AttributionSources']) - - if selection_fields is not None: - for k, v in selection_fields.items(): - df = df[df[k].str.startswith(tuple(v))] - - # agg sectors for data visualization - if any(item is not None for item in [target_sector_level, - target_subset_sector_level]): - sector_list = get_sector_list( - target_sector_level, - secondary_sector_level_dict=target_subset_sector_level) - - # aggregate to all sector levels - df = sector_aggregation(df, sectors_to_exclude_from_agg=sector_list) - df = df[df['Sector'].isin(sector_list)] - df = df.reset_index(drop=True) - - # determine list of subplots - try: - plot_list = df[subplot].drop_duplicates().values.tolist() - except KeyError: - plot_list = None - - # convert units - df = convert_units_for_graphics(df) - - if index_cols is None: - index_cols = ["Location", "Sector", "Unit"] - if impact_cat: - try: - import lciafmt - df = (lciafmt.apply_lcia_method(df, 'TRACI2.1') - .rename(columns={'FlowAmount': 'InvAmount', - 'Impact': 'FlowAmount'})) - var = 'Indicator' - df = df[df['Indicator'] == impact_cat] - df_unit = df['Indicator unit'][0] - sort_cols = [sector_variable, stacking_col] - if len(df) == 0: - log.exception(f'Impact category: {impact_cat} not found') - return - except ImportError: - log.exception('lciafmt not installed') - return - except AttributeError: - log.exception('check lciafmt branch') - return - else: - if grouping_variable is None: - # combine the flowable and context columns for graphing - df['Flow'] = df['Flowable'] + ', ' + df['Context'] - var = 'Flow' - else: - var = grouping_variable - df_unit = df['Unit'][0] - sort_cols = [sector_variable, var, stacking_col] - index_cols = index_cols + [var] - - # if only single var in df, do not include in the graph on axis - var_count = df[var].nunique() - - # If 'AttributionSources' value is null, replace with 'Direct - try: - df['AttributionSources'] = df['AttributionSources'].fillna('Direct') - except KeyError: - pass - # aggregate by location/sector/unit and optionally 'context' - df2 = df.groupby(index_cols + [stacking_col], - as_index=False).agg({"FlowAmount": sum}) - - # fill in non existent data with 0s to enable accurate sorting of sectors - flows = (df2[['Location', 'Unit', var, 'Sector']] - .drop_duplicates() - ) - scv = df[stacking_col].unique().tolist() - flows[stacking_col] = [scv for _ in range(len(flows))] - flows = flows.explode(stacking_col) - - df2 = df2.merge(flows, how='outer') - df2['FlowAmount'] = df2['FlowAmount'].fillna(0) - # resort df - if subplot is not None: - df2[subplot] = pd.Categorical(df2[subplot], plot_list) - df2 = df2.sort_values([subplot] + sort_cols).reset_index(drop=True) - else: - df2 = df2.sort_values(sort_cols).reset_index(drop=True) - - # wrap the sector col - df2[sector_variable] = df2[sector_variable].apply( - lambda x: customwrap(x, width=12)) - - # establish subplots if necessary - try: - fig = make_subplots(rows=rows, cols=cols, subplot_titles=df2[ - subplot].drop_duplicates().values.tolist()) - except KeyError: - fig = go.Figure() - - fig.update_layout( - template="simple_white", - barmode="stack", - ) - - # create list of n colors based on number of allocation sources - colors = df2[[stacking_col]].drop_duplicates() - # add colors - vis = pd.read_csv(datapath / 'VisualizationEssentials.csv').rename( - columns={'AttributionSource': stacking_col}) - colors = colors.merge(vis[[stacking_col, 'Color']], how='left') - - # fill in any colors missing from the color dictionary with random colors - colors['Color'] = colors['Color'].apply(lambda x: x if pd.notnull(x) else - "#%06x" % random.randint(0, 0xFFFFFF)) - # merge back into df - df2 = df2.merge(colors, how='left') - - if subplot is None: - for r, c in zip(df2[stacking_col].unique(), df2['Color'].unique()): - plot_df = df2[df2[stacking_col] == r] - y_axis_col = plot_df[sector_variable] - # if there are more than one variable category add to y-axis - if var_count > 1: - y_axis_col = [plot_df[sector_variable], plot_df[var]] - fig.add_trace( - go.Bar(x=plot_df['FlowAmount'], - y=y_axis_col, name=r, - orientation='h', - marker_color=c - )) - fig.update_xaxes(title_text=f"FlowAmount ({df_unit})") - fig.update_yaxes(title_text="Sector", tickmode='linear') - else: - s = 0 - for row in range(1, rows + 1): - for col in range(1, cols + 1): - df3 = df2[df2[subplot] == plot_list[s]].reset_index(drop=True) - for r, c in zip(df3[stacking_col].unique(), df3['Color'].unique()): - plot_df = df3[df3[stacking_col] == r].reset_index(drop=True) - flow_col = plot_df['FlowAmount'] - sector_col = [plot_df[sector_variable], plot_df[var]] - if orientation == 'h': - x_data = flow_col - y_data = sector_col - xaxis_title = f"Flow Total ({plot_df['Unit'][0]})" - yaxis_title = "" - else: - x_data = sector_col - y_data = flow_col - xaxis_title = "" - yaxis_title = f"Flow Total ({plot_df['Unit'][0]})" - fig.add_trace( - go.Bar(x=x_data, y=y_data, name=r, - orientation=orientation, - marker_color=c, - ), - row=row, - col=col - ) - fig.update_xaxes(title_text=xaxis_title, row=row, col=col) - fig.update_yaxes(title_text=yaxis_title, row=row, col=col) - s = s + 1 - - if orientation == 'h': - fig.update_yaxes(autorange="reversed") - fig.update_layout(title=plot_title, - autosize=False, - template="simple_white", - font_size=10, margin_b=150 - ) - - # prevent duplicate legend entries - names = set() - fig.for_each_trace( - lambda trace: - trace.update(showlegend=False) - if (trace.name in names) else names.add(trace.name)) - - fig.show() - log.info(f'Saving file to {plotoutputpath / filename}.svg') - fig.write_image(plotoutputpath / f"{filename}.svg", width=graphic_width, - height=graphic_height) +# todo: update to work with recursive code - sector_aggregation() +# def stackedBarChart(df, +# impact_cat=None, +# selection_fields=None, +# target_sector_level=None, +# target_subset_sector_level=None, +# stacking_col='AttributionSources', +# generalize_AttributionSources=False, +# plot_title=None, +# index_cols=None, +# orientation='h', +# grouping_variable=None, +# sector_variable='Sector', +# subplot=None, +# rows=1, +# cols=1, +# filename = 'flowsaBarChart', +# graphic_width = 1200, +# graphic_height = 1200 +# ): +# """ +# Create a grouped, stacked barchart by sector code. If impact=True, +# group data by context as well as sector +# :param df: str or df, either an FBS methodname (ex. "Water_national_m1_2015") or a df +# :param impact_cat: str, name of impact category to apply and aggregate on +# impacts (e.g.: 'Global warming'). Use 'None' to aggregate by flow +# :return: stacked, group bar plot +# """ +# # if the df provided is a string, load the fbs method, otherwise use the +# # df provided +# if (type(df)) == str: +# df = flowsa.collapse_FlowBySector(df) +# +# if generalize_AttributionSources: +# df['AttributionSources'] = np.where( +# df['AttributionSources'] != 'Direct', +# 'Allocated', +# df['AttributionSources']) +# +# if selection_fields is not None: +# for k, v in selection_fields.items(): +# df = df[df[k].str.startswith(tuple(v))] +# +# # agg sectors for data visualization +# if any(item is not None for item in [target_sector_level, +# target_subset_sector_level]): +# sector_list = get_sector_list( +# target_sector_level, +# secondary_sector_level_dict=target_subset_sector_level) +# +# # aggregate to all sector levels +# df = sector_aggregation(df, sectors_to_exclude_from_agg=sector_list) +# df = df[df['Sector'].isin(sector_list)] +# df = df.reset_index(drop=True) +# +# # determine list of subplots +# try: +# plot_list = df[subplot].drop_duplicates().values.tolist() +# except KeyError: +# plot_list = None +# +# # convert units +# df = convert_units_for_graphics(df) +# +# if index_cols is None: +# index_cols = ["Location", "Sector", "Unit"] +# if impact_cat: +# try: +# import lciafmt +# df = (lciafmt.apply_lcia_method(df, 'TRACI2.1') +# .rename(columns={'FlowAmount': 'InvAmount', +# 'Impact': 'FlowAmount'})) +# var = 'Indicator' +# df = df[df['Indicator'] == impact_cat] +# df_unit = df['Indicator unit'][0] +# sort_cols = [sector_variable, stacking_col] +# if len(df) == 0: +# log.exception(f'Impact category: {impact_cat} not found') +# return +# except ImportError: +# log.exception('lciafmt not installed') +# return +# except AttributeError: +# log.exception('check lciafmt branch') +# return +# else: +# if grouping_variable is None: +# # combine the flowable and context columns for graphing +# df['Flow'] = df['Flowable'] + ', ' + df['Context'] +# var = 'Flow' +# else: +# var = grouping_variable +# df_unit = df['Unit'][0] +# sort_cols = [sector_variable, var, stacking_col] +# index_cols = index_cols + [var] +# +# # if only single var in df, do not include in the graph on axis +# var_count = df[var].nunique() +# +# # If 'AttributionSources' value is null, replace with 'Direct +# try: +# df['AttributionSources'] = df['AttributionSources'].fillna('Direct') +# except KeyError: +# pass +# # aggregate by location/sector/unit and optionally 'context' +# df2 = df.groupby(index_cols + [stacking_col], +# as_index=False).agg({"FlowAmount": sum}) +# +# # fill in non existent data with 0s to enable accurate sorting of sectors +# flows = (df2[['Location', 'Unit', var, 'Sector']] +# .drop_duplicates() +# ) +# scv = df[stacking_col].unique().tolist() +# flows[stacking_col] = [scv for _ in range(len(flows))] +# flows = flows.explode(stacking_col) +# +# df2 = df2.merge(flows, how='outer') +# df2['FlowAmount'] = df2['FlowAmount'].fillna(0) +# # resort df +# if subplot is not None: +# df2[subplot] = pd.Categorical(df2[subplot], plot_list) +# df2 = df2.sort_values([subplot] + sort_cols).reset_index(drop=True) +# else: +# df2 = df2.sort_values(sort_cols).reset_index(drop=True) +# +# # wrap the sector col +# df2[sector_variable] = df2[sector_variable].apply( +# lambda x: customwrap(x, width=12)) +# +# # establish subplots if necessary +# try: +# fig = make_subplots(rows=rows, cols=cols, subplot_titles=df2[ +# subplot].drop_duplicates().values.tolist()) +# except KeyError: +# fig = go.Figure() +# +# fig.update_layout( +# template="simple_white", +# barmode="stack", +# ) +# +# # create list of n colors based on number of allocation sources +# colors = df2[[stacking_col]].drop_duplicates() +# # add colors +# vis = pd.read_csv(datapath / 'VisualizationEssentials.csv').rename( +# columns={'AttributionSource': stacking_col}) +# colors = colors.merge(vis[[stacking_col, 'Color']], how='left') +# +# # fill in any colors missing from the color dictionary with random colors +# colors['Color'] = colors['Color'].apply(lambda x: x if pd.notnull(x) else +# "#%06x" % random.randint(0, 0xFFFFFF)) +# # merge back into df +# df2 = df2.merge(colors, how='left') +# +# if subplot is None: +# for r, c in zip(df2[stacking_col].unique(), df2['Color'].unique()): +# plot_df = df2[df2[stacking_col] == r] +# y_axis_col = plot_df[sector_variable] +# # if there are more than one variable category add to y-axis +# if var_count > 1: +# y_axis_col = [plot_df[sector_variable], plot_df[var]] +# fig.add_trace( +# go.Bar(x=plot_df['FlowAmount'], +# y=y_axis_col, name=r, +# orientation='h', +# marker_color=c +# )) +# fig.update_xaxes(title_text=f"FlowAmount ({df_unit})") +# fig.update_yaxes(title_text="Sector", tickmode='linear') +# else: +# s = 0 +# for row in range(1, rows + 1): +# for col in range(1, cols + 1): +# df3 = df2[df2[subplot] == plot_list[s]].reset_index(drop=True) +# for r, c in zip(df3[stacking_col].unique(), df3['Color'].unique()): +# plot_df = df3[df3[stacking_col] == r].reset_index(drop=True) +# flow_col = plot_df['FlowAmount'] +# sector_col = [plot_df[sector_variable], plot_df[var]] +# if orientation == 'h': +# x_data = flow_col +# y_data = sector_col +# xaxis_title = f"Flow Total ({plot_df['Unit'][0]})" +# yaxis_title = "" +# else: +# x_data = sector_col +# y_data = flow_col +# xaxis_title = "" +# yaxis_title = f"Flow Total ({plot_df['Unit'][0]})" +# fig.add_trace( +# go.Bar(x=x_data, y=y_data, name=r, +# orientation=orientation, +# marker_color=c, +# ), +# row=row, +# col=col +# ) +# fig.update_xaxes(title_text=xaxis_title, row=row, col=col) +# fig.update_yaxes(title_text=yaxis_title, row=row, col=col) +# s = s + 1 +# +# if orientation == 'h': +# fig.update_yaxes(autorange="reversed") +# fig.update_layout(title=plot_title, +# autosize=False, +# template="simple_white", +# font_size=10, margin_b=150 +# ) +# +# # prevent duplicate legend entries +# names = set() +# fig.for_each_trace( +# lambda trace: +# trace.update(showlegend=False) +# if (trace.name in names) else names.add(trace.name)) +# +# fig.show() +# log.info(f'Saving file to {plotoutputpath / filename}.svg') +# fig.write_image(plotoutputpath / f"{filename}.svg", width=graphic_width, +# height=graphic_height) def plot_state_coefficients(fbs_coeff, indicator=None, @@ -424,165 +424,165 @@ def convert_units_for_graphics(df): return df - -def generateSankeyData(methodname, - target_sector_level=None, - target_subset_sector_level=None, - use_sectordefinition=False, - sectors_to_include=None, - fbsconfigpath=None, - value_label_format='line_break'): - """ - Generate data used to create a sankey - :param methodname: str, FBS methodname - :param target_sector_level: numeric, sector length by which to - aggregate, default is 'None' which returns the max sector length in a - dataframe - :param target_subset_sector_level: numeric, sector length by which to - aggregate, default is 'None' which returns the max sector length in a - dataframe - :param sectors_to_include: list, sectors to include in output. Sectors - are subset by all sectors that "start with" the values in this list - :param fbsconfigpath, str, optional path to FBS method yaml - :return: csv file for use in generating sankey diagram - """ - - df = flowsa.FlowBySector.getFlowBySector( - methodname, external_config_path=fbsconfigpath, download_sources_ok=True) - - df = convert_units_for_graphics(df) - - # subset df - if sectors_to_include is not None: - df = df[df['Sector'].str.startswith(tuple(sectors_to_include))] - - method_dict = load_yaml_dict(methodname, flowbytype='FBS', - filepath=fbsconfigpath) - - if any(item is not None for item in [target_sector_level, - target_subset_sector_level]): - # subset by target sector levels, either those defined in - # function call or in method_dict - primary_sector_level = target_sector_level - if primary_sector_level is None: - primary_sector_level = method_dict['target_sector_level'] - # pull secondary sector level by methodname if specified, otherwise - # use singular sector level - try: - secondary_sector_level = target_subset_sector_level[methodname] - except KeyError: - secondary_sector_level = target_subset_sector_level - if secondary_sector_level is None: - secondary_sector_level = method_dict.get( - 'target_subset_sector_level') - # check if different rules for sector columns - if any([s in secondary_sector_level for s in - ['SectorProducedBy', 'SectorConsumedBy']]): - sector_list = {} - for s in ['Produced', 'Consumed']: - try: - sectors = get_sector_list( - primary_sector_level, - secondary_sector_level_dict=secondary_sector_level[f'Sector{s}By']) - sector_list[f'Sector{s}By'] = sectors - except KeyError: - sectors = get_sector_list( - primary_sector_level, - secondary_sector_level_dict=None) - sector_list[f'Sector{s}By'] = sectors - else: - sector_list = get_sector_list( - primary_sector_level, - secondary_sector_level_dict=secondary_sector_level) - - # aggregate to all sector levels - df = sector_aggregation(df, return_all_possible_sector_combos=True, - sectors_to_exclude_from_agg=sector_list) - df = replace_NoneType_with_empty_cells(df) - for s in ['Produced', 'Consumed']: - if isinstance(sector_list, dict): - df = df[df[f'Sector{s}By'].isin(sector_list[f'Sector{s}By'])] - else: - df = df[df[f'Sector{s}By'].isin(sector_list)] - - # add sector names - sankeymappingfile = datapath / 'VisualizationEssentials.csv' - df2 = addSectorNames(df, mappingfile=sankeymappingfile) - - # subset df and aggregate flows by sectors - df2 = df2[['SectorProducedBy', 'SectorConsumedBy', 'FlowAmount', 'Unit', - 'SectorProducedByName', 'SectorConsumedByName']] - df3 = df2.groupby(['SectorProducedBy', 'SectorConsumedBy', 'Unit', - 'SectorProducedByName', 'SectorConsumedByName'] - )['FlowAmount'].agg('sum').reset_index() - - # define which columns to use as source and target - if use_sectordefinition: - categories = ['SectorProducedByName', 'SectorConsumedByName'] - sources = 'SectorProducedByName' - targets = 'SectorConsumedByName' - sector_col = 'SectorName' - else: - categories = ['SectorProducedBy', 'SectorConsumedBy'] - sources = 'SectorProducedBy' - targets = 'SectorConsumedBy' - sector_col = 'Sector' - - # sort df by categories to help order how sectors appear in sankey - df3 = df3.sort_values(categories).reset_index(drop=True) - - # create new df with node information - nodes = pd.DataFrame( - {'Sector': list(pd.unique( - df3[['SectorProducedBy', 'SectorConsumedBy']].values.ravel('K'))), - 'SectorName': list( - pd.unique(df3[['SectorProducedByName', - 'SectorConsumedByName']].values.ravel('K'))) - }) - - # add colors - vis = pd.read_csv(datapath / 'VisualizationEssentials.csv') - nodes = nodes.merge(vis[['Sector', 'Color']], how='left') - # fill in any colors missing from the color dictionary with random colors - nodes['Color'] = nodes['Color'].apply(lambda x: x if pd.notnull(x) else - "#%06x" % random.randint(0, 0xFFFFFF)) - nodes = nodes.rename(columns={sector_col: 'node'}) - # add label - # determine flow amount labels - sum incoming and outgoing flow amounts, - # use outgoing flow values when exist, otherwise incoming flow totals - outgoing = df3[[sources, 'FlowAmount']] - outgoing = outgoing.groupby([sources]).agg( - {'FlowAmount': 'sum'}).reset_index() - outgoing = outgoing.rename(columns={sources: 'node', - 'FlowAmount': 'outgoing'}) - incoming = df3[[targets, 'FlowAmount']] - incoming = incoming.groupby([targets]).agg( - {'FlowAmount': 'sum'}).reset_index() - incoming = incoming.rename(columns={targets: 'node', - 'FlowAmount': 'incoming'}) - flow_labels = outgoing.merge(incoming, how='outer') - flow_labels = (flow_labels.fillna(0) - .assign(flow=np.where(flow_labels['outgoing'] > 0, - flow_labels['outgoing'], - flow_labels['incoming']))) - if value_label_format == 'line_break': - flow_labels['Label'] = flow_labels['node'] + '
' + \ - flow_labels['flow'].round(2).astype(str) - elif value_label_format == 'brackets': - flow_labels['Label'] = flow_labels['node'] + ' (' + \ - flow_labels['flow'].round(2).astype(str) + ')' - nodes = nodes.merge(flow_labels[['node', 'Label']], how='left') - - # create flow dataframe where source and target are converted to numeric - # indices - flows = pd.DataFrame() - label_list = list(pd.unique(df3[categories].values.ravel('K'))) - flows['source'] = df3[sources].apply(lambda x: label_list.index(x)) - flows['target'] = df3[targets].apply(lambda x: label_list.index(x)) - flows['value'] = df3['FlowAmount'] - flows['Unit'] = df3['Unit'] - - return nodes, flows +# todo: Need to update to work for recursive method - sector_aggregation() +# def generateSankeyData(methodname, +# target_sector_level=None, +# target_subset_sector_level=None, +# use_sectordefinition=False, +# sectors_to_include=None, +# fbsconfigpath=None, +# value_label_format='line_break'): +# """ +# Generate data used to create a sankey +# :param methodname: str, FBS methodname +# :param target_sector_level: numeric, sector length by which to +# aggregate, default is 'None' which returns the max sector length in a +# dataframe +# :param target_subset_sector_level: numeric, sector length by which to +# aggregate, default is 'None' which returns the max sector length in a +# dataframe +# :param sectors_to_include: list, sectors to include in output. Sectors +# are subset by all sectors that "start with" the values in this list +# :param fbsconfigpath, str, optional path to FBS method yaml +# :return: csv file for use in generating sankey diagram +# """ +# +# df = flowsa.FlowBySector.getFlowBySector( +# methodname, external_config_path=fbsconfigpath, download_sources_ok=True) +# +# df = convert_units_for_graphics(df) +# +# # subset df +# if sectors_to_include is not None: +# df = df[df['Sector'].str.startswith(tuple(sectors_to_include))] +# +# method_dict = load_yaml_dict(methodname, flowbytype='FBS', +# filepath=fbsconfigpath) +# +# if any(item is not None for item in [target_sector_level, +# target_subset_sector_level]): +# # subset by target sector levels, either those defined in +# # function call or in method_dict +# primary_sector_level = target_sector_level +# if primary_sector_level is None: +# primary_sector_level = method_dict['target_sector_level'] +# # pull secondary sector level by methodname if specified, otherwise +# # use singular sector level +# try: +# secondary_sector_level = target_subset_sector_level[methodname] +# except KeyError: +# secondary_sector_level = target_subset_sector_level +# if secondary_sector_level is None: +# secondary_sector_level = method_dict.get( +# 'target_subset_sector_level') +# # check if different rules for sector columns +# if any([s in secondary_sector_level for s in +# ['SectorProducedBy', 'SectorConsumedBy']]): +# sector_list = {} +# for s in ['Produced', 'Consumed']: +# try: +# sectors = get_sector_list( +# primary_sector_level, +# secondary_sector_level_dict=secondary_sector_level[f'Sector{s}By']) +# sector_list[f'Sector{s}By'] = sectors +# except KeyError: +# sectors = get_sector_list( +# primary_sector_level, +# secondary_sector_level_dict=None) +# sector_list[f'Sector{s}By'] = sectors +# else: +# sector_list = get_sector_list( +# primary_sector_level, +# secondary_sector_level_dict=secondary_sector_level) +# +# # aggregate to all sector levels +# df = sector_aggregation(df, return_all_possible_sector_combos=True, +# sectors_to_exclude_from_agg=sector_list) +# df = replace_NoneType_with_empty_cells(df) +# for s in ['Produced', 'Consumed']: +# if isinstance(sector_list, dict): +# df = df[df[f'Sector{s}By'].isin(sector_list[f'Sector{s}By'])] +# else: +# df = df[df[f'Sector{s}By'].isin(sector_list)] +# +# # add sector names +# sankeymappingfile = datapath / 'VisualizationEssentials.csv' +# df2 = addSectorNames(df, mappingfile=sankeymappingfile) +# +# # subset df and aggregate flows by sectors +# df2 = df2[['SectorProducedBy', 'SectorConsumedBy', 'FlowAmount', 'Unit', +# 'SectorProducedByName', 'SectorConsumedByName']] +# df3 = df2.groupby(['SectorProducedBy', 'SectorConsumedBy', 'Unit', +# 'SectorProducedByName', 'SectorConsumedByName'] +# )['FlowAmount'].agg('sum').reset_index() +# +# # define which columns to use as source and target +# if use_sectordefinition: +# categories = ['SectorProducedByName', 'SectorConsumedByName'] +# sources = 'SectorProducedByName' +# targets = 'SectorConsumedByName' +# sector_col = 'SectorName' +# else: +# categories = ['SectorProducedBy', 'SectorConsumedBy'] +# sources = 'SectorProducedBy' +# targets = 'SectorConsumedBy' +# sector_col = 'Sector' +# +# # sort df by categories to help order how sectors appear in sankey +# df3 = df3.sort_values(categories).reset_index(drop=True) +# +# # create new df with node information +# nodes = pd.DataFrame( +# {'Sector': list(pd.unique( +# df3[['SectorProducedBy', 'SectorConsumedBy']].values.ravel('K'))), +# 'SectorName': list( +# pd.unique(df3[['SectorProducedByName', +# 'SectorConsumedByName']].values.ravel('K'))) +# }) +# +# # add colors +# vis = pd.read_csv(datapath / 'VisualizationEssentials.csv') +# nodes = nodes.merge(vis[['Sector', 'Color']], how='left') +# # fill in any colors missing from the color dictionary with random colors +# nodes['Color'] = nodes['Color'].apply(lambda x: x if pd.notnull(x) else +# "#%06x" % random.randint(0, 0xFFFFFF)) +# nodes = nodes.rename(columns={sector_col: 'node'}) +# # add label +# # determine flow amount labels - sum incoming and outgoing flow amounts, +# # use outgoing flow values when exist, otherwise incoming flow totals +# outgoing = df3[[sources, 'FlowAmount']] +# outgoing = outgoing.groupby([sources]).agg( +# {'FlowAmount': 'sum'}).reset_index() +# outgoing = outgoing.rename(columns={sources: 'node', +# 'FlowAmount': 'outgoing'}) +# incoming = df3[[targets, 'FlowAmount']] +# incoming = incoming.groupby([targets]).agg( +# {'FlowAmount': 'sum'}).reset_index() +# incoming = incoming.rename(columns={targets: 'node', +# 'FlowAmount': 'incoming'}) +# flow_labels = outgoing.merge(incoming, how='outer') +# flow_labels = (flow_labels.fillna(0) +# .assign(flow=np.where(flow_labels['outgoing'] > 0, +# flow_labels['outgoing'], +# flow_labels['incoming']))) +# if value_label_format == 'line_break': +# flow_labels['Label'] = flow_labels['node'] + '
' + \ +# flow_labels['flow'].round(2).astype(str) +# elif value_label_format == 'brackets': +# flow_labels['Label'] = flow_labels['node'] + ' (' + \ +# flow_labels['flow'].round(2).astype(str) + ')' +# nodes = nodes.merge(flow_labels[['node', 'Label']], how='left') +# +# # create flow dataframe where source and target are converted to numeric +# # indices +# flows = pd.DataFrame() +# label_list = list(pd.unique(df3[categories].values.ravel('K'))) +# flows['source'] = df3[sources].apply(lambda x: label_list.index(x)) +# flows['target'] = df3[targets].apply(lambda x: label_list.index(x)) +# flows['value'] = df3['FlowAmount'] +# flows['Unit'] = df3['Unit'] +# +# return nodes, flows def generateSankeyDiagram(methodnames, From 7ba88c0af809e5a751c532df111ea39c818589d3 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 14 Jul 2023 11:17:18 -0400 Subject: [PATCH 0680/1127] return FBA and FBS calls as pandas dataframe from API --- flowsa/__init__.py | 64 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 47 insertions(+), 17 deletions(-) diff --git a/flowsa/__init__.py b/flowsa/__init__.py index 79e78c2c7..e32ab2bed 100644 --- a/flowsa/__init__.py +++ b/flowsa/__init__.py @@ -17,14 +17,11 @@ """ import os import pprint -from esupy.processed_data_mgmt import load_preprocessed_output, \ - download_from_remote +import pandas as pd from flowsa.common import load_yaml_dict from flowsa.flowsa_log import log from flowsa.settings import sourceconfigpath, flowbysectormethodpath, \ - paths, fbaoutputpath, fbsoutputpath, \ biboutputpath, DEFAULT_DOWNLOAD_IF_MISSING -from flowsa.metadata import set_fb_meta from flowsa.flowbyfunctions import collapse_fbs_sectors, filter_by_geoscale from flowsa.validation import check_for_nonetypes_in_sector_col, \ check_for_negative_flowamounts @@ -34,8 +31,25 @@ from .flowby import FlowByActivity, FlowBySector -def getFlowByActivity(datasource, year, flowclass=None, geographic_level=None, - download_FBA_if_missing=DEFAULT_DOWNLOAD_IF_MISSING): +def getFlowByActivity( + datasource, + year, + flowclass=None, + geographic_level=None, + download_FBA_if_missing=DEFAULT_DOWNLOAD_IF_MISSING + ) -> pd.DataFrame: + """ + Retrieves stored data in the FlowByActivity format + :param datasource: str, the code of the datasource. + :param year: int, a year, e.g. 2012 + :param flowclass: str or list, a 'Class' of the flow. Optional. E.g. + 'Water' or ['Employment', 'Chemicals'] + :param geographic_level: str, a geographic level of the data. + Optional. E.g. 'national', 'state', 'county'. + :param download_FBA_if_missing: bool, if True will attempt to load from + remote server prior to generating if file not found locally + :return: a pandas DataFrame in FlowByActivity format + """ fba = FlowByActivity.getFlowByActivity( full_name=datasource, config={}, @@ -51,16 +65,29 @@ def getFlowByActivity(datasource, year, flowclass=None, geographic_level=None, # if geographic level specified, only load rows in geo level if geographic_level is not None: fba = filter_by_geoscale(fba, geographic_level) - return fba + return pd.DataFrame(fba) def getFlowBySector( - methodname, - fbsconfigpath=None, - download_FBAs_if_missing=DEFAULT_DOWNLOAD_IF_MISSING, - download_FBS_if_missing=DEFAULT_DOWNLOAD_IF_MISSING, - **kwargs -) -> FlowBySector: + methodname, + fbsconfigpath=None, + download_FBAs_if_missing=DEFAULT_DOWNLOAD_IF_MISSING, + download_FBS_if_missing=DEFAULT_DOWNLOAD_IF_MISSING, + **kwargs + ) -> pd.DataFrame: + """ + Loads stored FlowBySector output or generates it if it doesn't exist, + then loads + :param methodname: string, Name of an available method for the given class + :param fbsconfigpath: str, path to the FBS method file if loading a file + from outside the flowsa repository + :param download_FBAs_if_missing: bool, if True will attempt to load FBAS + used in generating the FBS from remote server prior to generating if + file not found locally + :param download_FBS_if_missing: bool, if True will attempt to load from + remote server prior to generating if file not found locally + :return: dataframe in flow by sector format + """ fbs = FlowBySector.getFlowBySector( method=methodname, external_config_path=fbsconfigpath, @@ -68,12 +95,15 @@ def getFlowBySector( download_fbs_ok=download_FBS_if_missing, **kwargs ) - return fbs + return pd.DataFrame(fbs) -def collapse_FlowBySector(methodname, fbsconfigpath=None, - download_FBAs_if_missing=DEFAULT_DOWNLOAD_IF_MISSING, - download_FBS_if_missing=DEFAULT_DOWNLOAD_IF_MISSING): +def collapse_FlowBySector( + methodname, + fbsconfigpath=None, + download_FBAs_if_missing=DEFAULT_DOWNLOAD_IF_MISSING, + download_FBS_if_missing=DEFAULT_DOWNLOAD_IF_MISSING + ) -> pd.DataFrame: """ Returns fbs with one sector column in place of two :param methodname: string, Name of an available method for the given class From c7935f946e8d9e263d8feeef8496747909ec7f3d Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 14 Jul 2023 09:26:23 -0600 Subject: [PATCH 0681/1127] comment out additional datavis fxn until reformatted for recursive method --- flowsa/datavisualization.py | 204 ++++++++++++++++++------------------ 1 file changed, 102 insertions(+), 102 deletions(-) diff --git a/flowsa/datavisualization.py b/flowsa/datavisualization.py index 8867a33bf..42807ac8d 100644 --- a/flowsa/datavisualization.py +++ b/flowsa/datavisualization.py @@ -584,105 +584,105 @@ def convert_units_for_graphics(df): # # return nodes, flows - -def generateSankeyDiagram(methodnames, - target_sector_level=None, - target_subset_sector_level=None, - use_sectordefinition=False, - sectors_to_include=None, - fbsconfigpath=None, - plot_title=None, - orientation='horizonal', - domain_dict=None, - plot_dimension=None, - value_label_format='line_break', - subplot_titles=None, - filename='flowsaSankey'): - """ - Sankey diagram developed to map flows between sector produced by (source) - and sector consumed by (target). Sankey developed for subplot of 2 - diagrams. - :param methodnames: - :param target_sector_level: - :param target_subset_sector_level: - :param replace_SPB_with_sectordefinition: - :param replace_SCB_with_sectordefinition: - :param sectors_to_include: - :param fbsconfigpath: - :param plot_title: - :param orientation: - :param domain_dict: dict, manually set x and y coordinates of each subplot - :param plot_dimension: list, [width, height] - :param value_label_format: string, either 'line_break' or 'brackets' - :param subplot_titles: list, subplot titles - :return: - """ - if orientation == 'vertical': - rows = len(methodnames) - cols = 1 - else: - rows = 1 - cols = len(methodnames) - - fig = make_subplots(rows=rows, cols=cols, shared_yaxes=True, - subplot_titles=subplot_titles) - - for i, m in enumerate(methodnames): - # return dfs of nodes and flows for Sankey - nodes, flows = generateSankeyData( - m, target_sector_level, target_subset_sector_level, - use_sectordefinition, sectors_to_include, - fbsconfigpath, value_label_format=value_label_format) - - # define domain - if domain_dict is None: - if orientation == 'vertical': - domain = {'x': [0, 1], - 'y': [0 + (i / len(methodnames)) + 0.04, - ((i + 1) / len(methodnames)) - 0.04]} - else: - domain = {'x': [0 + (i / len(methodnames)) + 0.02, - ((i + 1) / len(methodnames)) - 0.02], - 'y': [0, 1]} - else: - domain = {'x': domain_dict[i]['x'], - 'y': domain_dict[i]['y']} - - fig.add_trace(go.Sankey( - arrangement="snap", - domain=domain, - valueformat=".1f", - valuesuffix=flows['Unit'][0], - # Define nodes - node=dict( - pad=15, - thickness=15, - line=dict(color="black", width=0.5), - label=nodes['Label'].values.tolist(), - color=nodes['Color'].values.tolist(), - ), - # Add links - link=dict(source=flows['source'].values.tolist(), - target=flows['target'].values.tolist(), - value=flows['value'].values.tolist(), - ), - )) - - fig.update_layout( - title_text=plot_title, font_size=10, margin_b=150) - - if plot_dimension is None: - if orientation == 'vertical': - width = 1400 - height = 1600 - else: - width = 1100 - height = 900 - else: - width = plot_dimension[0] - height = plot_dimension[1] - - fig.show() - log.info(f'Saving file to {plotoutputpath / filename}.svg') - fig.write_image(plotoutputpath / f"{filename}.svg", - width=width, height=height) +# todo: comment back in once reformatted for recursive method +# def generateSankeyDiagram(methodnames, +# target_sector_level=None, +# target_subset_sector_level=None, +# use_sectordefinition=False, +# sectors_to_include=None, +# fbsconfigpath=None, +# plot_title=None, +# orientation='horizonal', +# domain_dict=None, +# plot_dimension=None, +# value_label_format='line_break', +# subplot_titles=None, +# filename='flowsaSankey'): +# """ +# Sankey diagram developed to map flows between sector produced by (source) +# and sector consumed by (target). Sankey developed for subplot of 2 +# diagrams. +# :param methodnames: +# :param target_sector_level: +# :param target_subset_sector_level: +# :param replace_SPB_with_sectordefinition: +# :param replace_SCB_with_sectordefinition: +# :param sectors_to_include: +# :param fbsconfigpath: +# :param plot_title: +# :param orientation: +# :param domain_dict: dict, manually set x and y coordinates of each subplot +# :param plot_dimension: list, [width, height] +# :param value_label_format: string, either 'line_break' or 'brackets' +# :param subplot_titles: list, subplot titles +# :return: +# """ +# if orientation == 'vertical': +# rows = len(methodnames) +# cols = 1 +# else: +# rows = 1 +# cols = len(methodnames) +# +# fig = make_subplots(rows=rows, cols=cols, shared_yaxes=True, +# subplot_titles=subplot_titles) +# +# for i, m in enumerate(methodnames): +# # return dfs of nodes and flows for Sankey +# nodes, flows = generateSankeyData( +# m, target_sector_level, target_subset_sector_level, +# use_sectordefinition, sectors_to_include, +# fbsconfigpath, value_label_format=value_label_format) +# +# # define domain +# if domain_dict is None: +# if orientation == 'vertical': +# domain = {'x': [0, 1], +# 'y': [0 + (i / len(methodnames)) + 0.04, +# ((i + 1) / len(methodnames)) - 0.04]} +# else: +# domain = {'x': [0 + (i / len(methodnames)) + 0.02, +# ((i + 1) / len(methodnames)) - 0.02], +# 'y': [0, 1]} +# else: +# domain = {'x': domain_dict[i]['x'], +# 'y': domain_dict[i]['y']} +# +# fig.add_trace(go.Sankey( +# arrangement="snap", +# domain=domain, +# valueformat=".1f", +# valuesuffix=flows['Unit'][0], +# # Define nodes +# node=dict( +# pad=15, +# thickness=15, +# line=dict(color="black", width=0.5), +# label=nodes['Label'].values.tolist(), +# color=nodes['Color'].values.tolist(), +# ), +# # Add links +# link=dict(source=flows['source'].values.tolist(), +# target=flows['target'].values.tolist(), +# value=flows['value'].values.tolist(), +# ), +# )) +# +# fig.update_layout( +# title_text=plot_title, font_size=10, margin_b=150) +# +# if plot_dimension is None: +# if orientation == 'vertical': +# width = 1400 +# height = 1600 +# else: +# width = 1100 +# height = 900 +# else: +# width = plot_dimension[0] +# height = plot_dimension[1] +# +# fig.show() +# log.info(f'Saving file to {plotoutputpath / filename}.svg') +# fig.write_image(plotoutputpath / f"{filename}.svg", +# width=width, height=height) From 4601173469324d8203f07f88a1d5e6df8b6c4d6b Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 14 Jul 2023 09:43:22 -0600 Subject: [PATCH 0682/1127] comment out obsolete code in flowbyfunctions --- flowsa/flowbyfunctions.py | 250 +++++++++++++++++++------------------- 1 file changed, 125 insertions(+), 125 deletions(-) diff --git a/flowsa/flowbyfunctions.py b/flowsa/flowbyfunctions.py index 64e1399a8..472725982 100644 --- a/flowsa/flowbyfunctions.py +++ b/flowsa/flowbyfunctions.py @@ -588,79 +588,79 @@ def return_activity_from_scale(df, provided_from_scale): return df_existing - -def subset_df_by_geoscale(df, activity_from_scale, activity_to_scale): - """ - Subset a df by geoscale or agg to create data specified in method yaml - :param df: df, FBA format - :param activity_from_scale: str, identified geoscale by which to subset or - aggregate from ('national', 'state', 'county') - :param activity_to_scale: str, identified geoscale by which to subset or - aggregate to ('national', 'state', 'county') - :return: df, FBA, subset or aggregated to a single geoscale for all rows - """ - - # detect grouping cols by columns - if 'Context' in df.columns: - groupbycols = fba_mapped_default_grouping_fields - cols_to_keep = flow_by_activity_mapped_fields - else: - groupbycols = fba_default_grouping_fields - cols_to_keep = flow_by_activity_fields - - # method of subset dependent on LocationSystem - if df['LocationSystem'].str.contains('FIPS').all(): - df = df[df['LocationSystem'].str.contains( - 'FIPS')].reset_index(drop=True) - # determine 'activity_from_scale' for use in df - # geoscale subset, by activity - modified_from_scale = \ - return_activity_from_scale(df, activity_from_scale) - # add 'activity_from_scale' column to df - df2 = pd.merge(df, modified_from_scale) - - # list of unique 'from' geoscales - unique_geoscales = modified_from_scale[ - 'activity_from_scale'].drop_duplicates().values.tolist() - if len(unique_geoscales) > 1: - log.info('Dataframe has a mix of geographic levels: %s', - ', '.join(unique_geoscales)) - - # to scale - if fips_number_key[activity_from_scale] > \ - fips_number_key[activity_to_scale]: - to_scale = activity_to_scale - else: - to_scale = activity_from_scale - - df_subset_list = [] - # subset df based on activity 'from' scale - for i in unique_geoscales: - df3 = df2[df2['activity_from_scale'] == i] - # if desired geoscale doesn't exist, aggregate existing data - # if df is less aggregated than allocation df, aggregate - # fba activity to allocation geoscale - if fips_number_key[i] > fips_number_key[to_scale]: - log.info("Aggregating subset from %s to %s", i, to_scale) - df_sub = agg_by_geoscale(df3, i, to_scale, groupbycols) - # else filter relevant rows - else: - log.info("Subsetting %s data", i) - df_sub = filter_by_geoscale(df3, i) - df_subset_list.append(df_sub) - df_subset = pd.concat(df_subset_list, ignore_index=True) - - # drop unused columns - df_subset = clean_df(df_subset, cols_to_keep, - fba_fill_na_dict, drop_description=False) - - return df_subset - - # right now, the only other location system is for Statistics Canada data - else: - df = df[~df['LocationSystem'].str.contains('FIPS')].reset_index(drop=True) - - return df +# todo: delete +# def subset_df_by_geoscale(df, activity_from_scale, activity_to_scale): +# """ +# Subset a df by geoscale or agg to create data specified in method yaml +# :param df: df, FBA format +# :param activity_from_scale: str, identified geoscale by which to subset or +# aggregate from ('national', 'state', 'county') +# :param activity_to_scale: str, identified geoscale by which to subset or +# aggregate to ('national', 'state', 'county') +# :return: df, FBA, subset or aggregated to a single geoscale for all rows +# """ +# +# # detect grouping cols by columns +# if 'Context' in df.columns: +# groupbycols = fba_mapped_default_grouping_fields +# cols_to_keep = flow_by_activity_mapped_fields +# else: +# groupbycols = fba_default_grouping_fields +# cols_to_keep = flow_by_activity_fields +# +# # method of subset dependent on LocationSystem +# if df['LocationSystem'].str.contains('FIPS').all(): +# df = df[df['LocationSystem'].str.contains( +# 'FIPS')].reset_index(drop=True) +# # determine 'activity_from_scale' for use in df +# # geoscale subset, by activity +# modified_from_scale = \ +# return_activity_from_scale(df, activity_from_scale) +# # add 'activity_from_scale' column to df +# df2 = pd.merge(df, modified_from_scale) +# +# # list of unique 'from' geoscales +# unique_geoscales = modified_from_scale[ +# 'activity_from_scale'].drop_duplicates().values.tolist() +# if len(unique_geoscales) > 1: +# log.info('Dataframe has a mix of geographic levels: %s', +# ', '.join(unique_geoscales)) +# +# # to scale +# if fips_number_key[activity_from_scale] > \ +# fips_number_key[activity_to_scale]: +# to_scale = activity_to_scale +# else: +# to_scale = activity_from_scale +# +# df_subset_list = [] +# # subset df based on activity 'from' scale +# for i in unique_geoscales: +# df3 = df2[df2['activity_from_scale'] == i] +# # if desired geoscale doesn't exist, aggregate existing data +# # if df is less aggregated than allocation df, aggregate +# # fba activity to allocation geoscale +# if fips_number_key[i] > fips_number_key[to_scale]: +# log.info("Aggregating subset from %s to %s", i, to_scale) +# df_sub = agg_by_geoscale(df3, i, to_scale, groupbycols) +# # else filter relevant rows +# else: +# log.info("Subsetting %s data", i) +# df_sub = filter_by_geoscale(df3, i) +# df_subset_list.append(df_sub) +# df_subset = pd.concat(df_subset_list, ignore_index=True) +# +# # drop unused columns +# df_subset = clean_df(df_subset, cols_to_keep, +# fba_fill_na_dict, drop_description=False) +# +# return df_subset +# +# # right now, the only other location system is for Statistics Canada data +# else: +# df = df[~df['LocationSystem'].str.contains('FIPS')].reset_index(drop=True) +# +# return df def unique_activity_names(fba_df): @@ -1074,58 +1074,58 @@ def load_fba_w_standardized_units(datasource, year, **kwargs): # # return df - -def subset_and_merge_df_by_sector_lengths( - df, length1, length2, **_): - - sector_merge = 'NAICS_' + str(length1) - sector_add = 'NAICS_' + str(length2) - - # subset the df by naics length - cw_load = load_crosswalk("sector_length") - cw = cw_load[[sector_merge, sector_add]].drop_duplicates().reset_index( - drop=True) - - # df where either sector column is length or both columns are - df = df.reset_index(drop=True) - df1 = subset_df_by_sector_lengths(df, [length1], **_) - # second dataframe where length is length2 - df2 = subset_df_by_sector_lengths(df, [length2], **_) - - # merge the crosswalk to create new columns where sector length equals - # "length1" - df2 = df2.merge(cw, how='left', left_on=['SectorProducedBy'], - right_on=[sector_add]).rename( - columns={sector_merge: 'SPB_tmp'}).drop(columns=sector_add) - df2 = df2.merge(cw, how='left', - left_on=['SectorConsumedBy'], right_on=[sector_add] - ).rename( - columns={sector_merge: 'SCB_tmp'}).drop(columns=sector_add) - df2 = replace_NoneType_with_empty_cells(df2) - # if maintaining the values that do not match the sector length - # requirement, and if a column value is blank, replace with existing value - if _.get('keep_paired_sectors_not_in_subset_list'): - df2["SPB_tmp"] = np.where(df2["SPB_tmp"] == '', - df2["SectorProducedBy"], df2["SPB_tmp"]) - df2["SCB_tmp"] = np.where(df2["SCB_tmp"] == '', - df2["SectorConsumedBy"], df2["SCB_tmp"]) - - # merge the dfs - merge_cols = list(df1.select_dtypes(include=['object', 'int']).columns) - # also drop activity and description cols - merge_cols = [c for c in merge_cols - if c not in ['SectorConsumedBy', 'SectorProducedBy', - 'Description']] - - dfm = df1.merge(df2[merge_cols + ['SPB_tmp', 'SCB_tmp']], - how='outer', - left_on=merge_cols + ['SectorProducedBy', - 'SectorConsumedBy'], - right_on=merge_cols + ['SPB_tmp', 'SCB_tmp'], - indicator=True) - dfm = replace_NoneType_with_empty_cells(dfm) - - return dfm +# todo: delete +# def subset_and_merge_df_by_sector_lengths( +# df, length1, length2, **_): +# +# sector_merge = 'NAICS_' + str(length1) +# sector_add = 'NAICS_' + str(length2) +# +# # subset the df by naics length +# cw_load = load_crosswalk("sector_length") +# cw = cw_load[[sector_merge, sector_add]].drop_duplicates().reset_index( +# drop=True) +# +# # df where either sector column is length or both columns are +# df = df.reset_index(drop=True) +# df1 = subset_df_by_sector_lengths(df, [length1], **_) +# # second dataframe where length is length2 +# df2 = subset_df_by_sector_lengths(df, [length2], **_) +# +# # merge the crosswalk to create new columns where sector length equals +# # "length1" +# df2 = df2.merge(cw, how='left', left_on=['SectorProducedBy'], +# right_on=[sector_add]).rename( +# columns={sector_merge: 'SPB_tmp'}).drop(columns=sector_add) +# df2 = df2.merge(cw, how='left', +# left_on=['SectorConsumedBy'], right_on=[sector_add] +# ).rename( +# columns={sector_merge: 'SCB_tmp'}).drop(columns=sector_add) +# df2 = replace_NoneType_with_empty_cells(df2) +# # if maintaining the values that do not match the sector length +# # requirement, and if a column value is blank, replace with existing value +# if _.get('keep_paired_sectors_not_in_subset_list'): +# df2["SPB_tmp"] = np.where(df2["SPB_tmp"] == '', +# df2["SectorProducedBy"], df2["SPB_tmp"]) +# df2["SCB_tmp"] = np.where(df2["SCB_tmp"] == '', +# df2["SectorConsumedBy"], df2["SCB_tmp"]) +# +# # merge the dfs +# merge_cols = list(df1.select_dtypes(include=['object', 'int']).columns) +# # also drop activity and description cols +# merge_cols = [c for c in merge_cols +# if c not in ['SectorConsumedBy', 'SectorProducedBy', +# 'Description']] +# +# dfm = df1.merge(df2[merge_cols + ['SPB_tmp', 'SCB_tmp']], +# how='outer', +# left_on=merge_cols + ['SectorProducedBy', +# 'SectorConsumedBy'], +# right_on=merge_cols + ['SPB_tmp', 'SCB_tmp'], +# indicator=True) +# dfm = replace_NoneType_with_empty_cells(dfm) +# +# return dfm def assign_columns_of_sector_levels(df_load): From 1efdcb7d61946d9aec63edae3f04f70cb5f74030 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 14 Jul 2023 09:50:04 -0600 Subject: [PATCH 0683/1127] comment out validation fxns - some to be converted to recursive, others to be deleted --- flowsa/validation.py | 661 ++++++++++++++++++++++--------------------- 1 file changed, 337 insertions(+), 324 deletions(-) diff --git a/flowsa/validation.py b/flowsa/validation.py index cf30d3757..4948c79ec 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -161,75 +161,132 @@ def calculate_flowamount_diff_between_dfs(dfa_load, dfb_load): vlog.info('Total FlowAmount differences by Activity Columns: ' '\n {}'.format(dfagg2.to_string(), index=False)) - -def compare_activity_to_sector_flowamounts(fba_load, fbs_load, - activity_set, config, v, attr, **_): - """ - Function to compare the loaded flowbyactivity with the final flowbysector - by activityname (if exists) to target sector level - output, checking for data loss - :param fba_load: df, FBA loaded and mapped using FEDEFL - :param fbs_load: df, final FBS df - :param activity_set: str, activity set - :param config: dictionary, method yaml - :return: printout data differences between loaded FBA and FBS output, - save results as csv in local directory - """ - data_format = v.get('data_format') - if (data_format == 'FBA') & (check_activities_sector_like(fba_load)): - vlog.debug('Not comparing loaded FlowByActivity to FlowBySector ' - 'ratios for a dataset with sector-like activities because ' - 'if there are modifications to flowamounts for a sector, ' - 'then the ratios will be different') - else: - # subset fba df - col_subset = ['Class', 'MetaSources', 'Flowable', 'Unit', 'FlowType', - 'ActivityProducedBy', 'ActivityConsumedBy', - 'SectorProducedBy', 'SectorConsumedBy', 'Context', - 'Location', 'LocationSystem', 'Year', 'FlowAmount'] - fba = fba_load[fba_load.columns.intersection( - col_subset)].reset_index(drop=True) - # todo: modify so location subset is based on target geoscale - fba.loc[:, 'Location'] = US_FIPS - group_cols = [e for e in fba.columns if e in - ['ActivityProducedBy', 'ActivityConsumedBy', - 'SectorProducedBy', 'SectorConsumedBy', 'Flowable', - 'Unit', 'FlowType', 'Context', 'Location', - 'LocationSystem', 'Year']] - fba_agg = aggregator(fba, group_cols) - fba_agg.rename(columns={'FlowAmount': 'FBA_amount'}, inplace=True) - - # subset fbs df - col_subset_2 = ['Class', 'SectorSourceName', 'Flowable', 'Unit', - 'FlowType', 'SectorProducedBy', - 'ActivityProducedBy', 'ActivityConsumedBy', - 'Context', 'Location', 'LocationSystem', 'Year', - 'FlowAmount'] - if attr.get('allocation_merge_columns') is not None: - col_subset_2 = col_subset_2 + attr.get('allocation_merge_columns') - fbs = fbs_load[fbs_load.columns.intersection( - col_subset_2)].reset_index(drop=True) - - # determine which - for i in ['Produced', 'Consumed']: - try: - fbs[f'{i}Length'] = fbs[f'Sector{i}By'].str.len() - except KeyError: - pass - max_list = [e for e in fbs.columns if e in ['ProducedLength', - 'ConsumedLength']] - fbs['SectorLength'] = fbs[max_list].max(axis=1) - - fbs.loc[:, 'Location'] = US_FIPS - group_cols = ['Flowable', 'Unit', 'FlowType', 'Context', 'Location', - 'LocationSystem', 'Year', 'SectorLength'] - if v.get('data_format') == 'FBA': - group_cols = ['ActivityProducedBy', 'ActivityConsumedBy'] + \ - group_cols - else: - group_cols = attr.get('allocation_merge_columns') + group_cols - fbs_agg = aggregator(fbs, group_cols) - fbs_agg.rename(columns={'FlowAmount': 'FBS_amount'}, inplace=True) +# todo: convert this fxn to recursive method - important to check FBA to FBS +# flow totals +# def compare_activity_to_sector_flowamounts(fba_load, fbs_load, +# activity_set, config, v, attr, **_): +# """ +# Function to compare the loaded flowbyactivity with the final flowbysector +# by activityname (if exists) to target sector level +# output, checking for data loss +# :param fba_load: df, FBA loaded and mapped using FEDEFL +# :param fbs_load: df, final FBS df +# :param activity_set: str, activity set +# :param config: dictionary, method yaml +# :return: printout data differences between loaded FBA and FBS output, +# save results as csv in local directory +# """ +# data_format = v.get('data_format') +# if (data_format == 'FBA') & (check_activities_sector_like(fba_load)): +# vlog.debug('Not comparing loaded FlowByActivity to FlowBySector ' +# 'ratios for a dataset with sector-like activities because ' +# 'if there are modifications to flowamounts for a sector, ' +# 'then the ratios will be different') +# else: +# # subset fba df +# col_subset = ['Class', 'MetaSources', 'Flowable', 'Unit', 'FlowType', +# 'ActivityProducedBy', 'ActivityConsumedBy', +# 'SectorProducedBy', 'SectorConsumedBy', 'Context', +# 'Location', 'LocationSystem', 'Year', 'FlowAmount'] +# fba = fba_load[fba_load.columns.intersection( +# col_subset)].reset_index(drop=True) +# # todo: modify so location subset is based on target geoscale +# fba.loc[:, 'Location'] = US_FIPS +# group_cols = [e for e in fba.columns if e in +# ['ActivityProducedBy', 'ActivityConsumedBy', +# 'SectorProducedBy', 'SectorConsumedBy', 'Flowable', +# 'Unit', 'FlowType', 'Context', 'Location', +# 'LocationSystem', 'Year']] +# fba_agg = aggregator(fba, group_cols) +# fba_agg.rename(columns={'FlowAmount': 'FBA_amount'}, inplace=True) +# +# # subset fbs df +# col_subset_2 = ['Class', 'SectorSourceName', 'Flowable', 'Unit', +# 'FlowType', 'SectorProducedBy', +# 'ActivityProducedBy', 'ActivityConsumedBy', +# 'Context', 'Location', 'LocationSystem', 'Year', +# 'FlowAmount'] +# if attr.get('allocation_merge_columns') is not None: +# col_subset_2 = col_subset_2 + attr.get('allocation_merge_columns') +# fbs = fbs_load[fbs_load.columns.intersection( +# col_subset_2)].reset_index(drop=True) +# +# # determine which +# for i in ['Produced', 'Consumed']: +# try: +# fbs[f'{i}Length'] = fbs[f'Sector{i}By'].str.len() +# except KeyError: +# pass +# max_list = [e for e in fbs.columns if e in ['ProducedLength', +# 'ConsumedLength']] +# fbs['SectorLength'] = fbs[max_list].max(axis=1) +# +# fbs.loc[:, 'Location'] = US_FIPS +# group_cols = ['Flowable', 'Unit', 'FlowType', 'Context', 'Location', +# 'LocationSystem', 'Year', 'SectorLength'] +# if v.get('data_format') == 'FBA': +# group_cols = ['ActivityProducedBy', 'ActivityConsumedBy'] + \ +# group_cols +# else: +# group_cols = attr.get('allocation_merge_columns') + group_cols +# fbs_agg = aggregator(fbs, group_cols) +# fbs_agg.rename(columns={'FlowAmount': 'FBS_amount'}, inplace=True) +# +# # merge compare 1 and compare 2 +# if v.get('data_format') == 'FBA': +# merge_cols = ['ActivityProducedBy', 'ActivityConsumedBy', +# 'Flowable', 'Unit', 'FlowType', 'Context', +# 'Location', 'LocationSystem', 'Year'] +# else: +# merge_cols = attr.get('allocation_merge_columns') + \ +# ['Flowable', 'Unit', 'FlowType', 'Context', +# 'Location', 'LocationSystem', 'Year'] +# df_merge = fba_agg.merge(fbs_agg, left_on=merge_cols, +# right_on=merge_cols, how='left') +# df_merge['Ratio'] = df_merge['FBS_amount'] / df_merge['FBA_amount'] +# +# # reorder +# order_cols = ['SectorProducedBy', 'SectorConsumedBy', +# 'ActivityProducedBy', 'ActivityConsumedBy', +# 'Flowable', 'Unit', 'FlowType', 'Context', 'Location', +# 'LocationSystem', 'Year', 'SectorLength', +# 'FBA_amount', 'FBS_amount', 'Ratio'] +# df_merge = df_merge[df_merge.columns.intersection( +# order_cols)].reset_index(drop=True) +# +# # keep only rows of specified sector length +# # todo: update to also keep sub target list +# comparison = df_merge[ +# df_merge['SectorLength'] == sector_level_key[ +# config['target_sector_level']]].reset_index(drop=True) +# +# tolerance = 0.01 +# comparison2 = comparison[(comparison['Ratio'] < 1 - tolerance) | +# (comparison['Ratio'] > 1 + tolerance)] +# +# if len(comparison2) > 0: +# vlog.info('There are %s combinations of flowable/context/sector ' +# 'length where the flowbyactivity to flowbysector ratio ' +# 'is less than or greater than 1 by %s', +# len(comparison2), str(tolerance)) +# +# # include df subset in the validation log +# # only print rows where flowamount ratio is less t +# # han 1 (round flowamountratio) +# df_v = comparison2[comparison2['Ratio'].apply( +# lambda x: round(x, 3) < 1)].reset_index(drop=True) +# +# # save to validation log +# log.info('Save the comparison of FlowByActivity load ' +# 'to FlowBySector ratios for %s in validation log', +# activity_set) +# # if df not empty, print, if empty, print string +# if df_v.empty: +# vlog.info('Ratios for %s all round to 1', activity_set) +# else: +# vlog.info('Comparison of FlowByActivity load to ' +# 'FlowBySector ratios for %s: ' +# '\n {}'.format(df_v.to_string()), activity_set) # merge compare 1 and compare 2 if v.get('data_format') == 'FBA': @@ -244,197 +301,153 @@ def compare_activity_to_sector_flowamounts(fba_load, fbs_load, right_on=merge_cols, how='left') df_merge['Ratio'] = df_merge['FBS_amount'] / df_merge['FBA_amount'] - # reorder - order_cols = ['SectorProducedBy', 'SectorConsumedBy', - 'ActivityProducedBy', 'ActivityConsumedBy', - 'Flowable', 'Unit', 'FlowType', 'Context', 'Location', - 'LocationSystem', 'Year', 'SectorLength', - 'FBA_amount', 'FBS_amount', 'Ratio'] - df_merge = df_merge[df_merge.columns.intersection( - order_cols)].reset_index(drop=True) - - # keep only rows of specified sector length - # todo: update to also keep sub target list - comparison = df_merge[ - df_merge['SectorLength'] == sector_level_key[ - config['target_sector_level']]].reset_index(drop=True) - - tolerance = 0.01 - comparison2 = comparison[(comparison['Ratio'] < 1 - tolerance) | - (comparison['Ratio'] > 1 + tolerance)] - - if len(comparison2) > 0: - vlog.info('There are %s combinations of flowable/context/sector ' - 'length where the flowbyactivity to flowbysector ratio ' - 'is less than or greater than 1 by %s', - len(comparison2), str(tolerance)) - - # include df subset in the validation log - # only print rows where flowamount ratio is less t - # han 1 (round flowamountratio) - df_v = comparison2[comparison2['Ratio'].apply( - lambda x: round(x, 3) < 1)].reset_index(drop=True) - - # save to validation log - log.info('Save the comparison of FlowByActivity load ' - 'to FlowBySector ratios for %s in validation log', - activity_set) - # if df not empty, print, if empty, print string - if df_v.empty: - vlog.info('Ratios for %s all round to 1', activity_set) - else: - vlog.info('Comparison of FlowByActivity load to ' - 'FlowBySector ratios for %s: ' - '\n {}'.format(df_v.to_string()), activity_set) - - -def compare_fba_geo_subset_and_fbs_output_totals( - fba_load, fbs_load, activity_set, source_name, source_attr, - activity_attr, method): - """ - Function to compare the loaded flowbyactivity total after - subsetting by activity and geography with the final flowbysector output - total. Not a direct comparison of the loaded FBA because FBAs are - modified before being subset by activity for the target sector level - :param fba_load: df, FBA loaded, before being mapped - :param fbs_load: df, final FBS df at target sector level - :param activity_set: str, activity set - :param source_name: str, source name - :param source_attr: dictionary, attribute data from method yaml - for source data - :param activity_attr: dictionary, attribute data from method yaml - for activity set - :param method: dictionary, FBS method yaml - :return: printout data differences between loaded FBA and FBS output - totals by location, save results as csv in local directory - """ - - vlog.info('Comparing Flow-By-Activity subset by activity and geography to ' - 'the subset Flow-By-Sector FlowAmount total.') - - # determine from scale - if fips_number_key[source_attr['geoscale_to_use']] < \ - fips_number_key[activity_attr['allocation_from_scale']]: - from_scale = source_attr['geoscale_to_use'] - else: - from_scale = activity_attr['allocation_from_scale'] - - if source_attr['data_format'] == 'FBA': - # extract relevant geoscale data or aggregate existing data - fba = subset_df_by_geoscale(fba_load, from_scale, - method['target_geoscale']) - if check_activities_sector_like(fba_load): - # if activities are sector-like, run sector aggregation and then - # subset df to only keep NAICS2 - fba = fba[['Class', 'SourceName', 'FlowAmount', 'Unit', 'Context', - 'ActivityProducedBy', 'ActivityConsumedBy', 'Location', - 'LocationSystem']] - # rename the activity cols to sector cols for purposes of aggregation - fba = fba.rename(columns={'ActivityProducedBy': 'SectorProducedBy', - 'ActivityConsumedBy': 'SectorConsumedBy'}) - fba = sector_aggregation(fba) - # subset fba to only include NAICS2 - fba = replace_NoneType_with_empty_cells(fba) - fba = subset_df_by_sector_lengths(fba, [2]) - else: - fba = sector_aggregation(fba_load) - fba = subset_df_by_sector_lengths(fba, [2]) - # subset/agg dfs - col_subset = ['Class', 'FlowAmount', 'Unit', 'Context', - 'Location', 'LocationSystem'] - group_cols = ['Class', 'Unit', 'Context', 'Location', 'LocationSystem'] - # check units - compare_df_units(fba, fbs_load) - # fba - fba = fba[col_subset] - fba_agg = aggregator(fba, group_cols).reset_index(drop=True) - fba_agg.rename(columns={'FlowAmount': 'FBA_amount', - 'Unit': 'FBA_unit'}, inplace=True) - - # fbs - fbs = fbs_load[col_subset] - fbs_agg = aggregator(fbs, group_cols) - fbs_agg.rename(columns={'FlowAmount': 'FBS_amount', - 'Unit': 'FBS_unit'}, inplace=True) - - try: - # merge FBA and FBS totals - df_merge = fba_agg.merge(fbs_agg, how='left') - df_merge['FBS_amount'] = df_merge['FBS_amount'].fillna(0) - df_merge['FlowAmount_difference'] = \ - df_merge['FBA_amount'] - df_merge['FBS_amount'] - df_merge['Percent_difference'] = \ - (df_merge['FlowAmount_difference']/df_merge['FBA_amount']) * 100 - # cases where flow amount diff is 0 but because fba amount is 0, - # percent diff is null. Fill those cases with 0s - df_merge['Percent_difference'] = np.where( - (df_merge['FlowAmount_difference'] == 0) & - (df_merge['FBA_amount'] == 0), 0, df_merge['Percent_difference']) - # reorder - df_merge = df_merge[['Class', 'Context', 'Location', 'LocationSystem', - 'FBA_amount', 'FBA_unit', 'FBS_amount', - 'FBS_unit', 'FlowAmount_difference', - 'Percent_difference']] - df_merge = replace_NoneType_with_empty_cells(df_merge) - - # list of contexts and locations - context_list = df_merge[['Class', 'Context', - 'Location']].values.tolist() - - # loop through the contexts and print results of comparison - vlog.info(f'Comparing FBA {activity_set} {source_attr["geoscale_to_use"]} ' - 'subset to FBS results. Details in Validation Log') - for i, j, k in context_list: - df_merge_subset = \ - df_merge[(df_merge['Class'] == i) & - (df_merge['Context'] == j) & - (df_merge['Location'] == k)].reset_index(drop=True) - diff_per = df_merge_subset['Percent_difference'][0] - if np.isnan(diff_per): - vlog.info(f'FlowBySector FlowAmount for {source_name} ' - f'{activity_set} {i} does not exist in the FBS') - continue - # make reporting more manageable - if abs(diff_per) > 0.01: - diff_per = round(diff_per, 2) - else: - diff_per = round(diff_per, 6) - - # diff_units = df_merge_subset['FBS_unit'][0] - if diff_per > 0: - vlog.info(f'FlowBySector FlowAmount for {source_name} ' - f'{activity_set} {i} {j} at {k} is ' - f'{str(abs(diff_per))}% less than the ' - f'FlowByActivity FlowAmount') - elif diff_per < 0: - vlog.info(f'FlowBySector FlowAmount for {source_name} ' - f'{activity_set} {i} {j} at {k} is ' - f'{str(abs(diff_per))}% more than the ' - f'FlowByActivity FlowAmount') - elif diff_per == 0: - vlog.info(f'FlowBySector FlowAmount for {source_name} ' - f'{activity_set} {i} {j} at {k} is equal to the ' - f'FlowByActivity FlowAmount') - - # subset the df to include in the validation log - # only print rows where the percent difference does not round to 0 - df_v = df_merge[df_merge['Percent_difference'].apply( - lambda x: round(x, 3) != 0)].reset_index(drop=True) - - # log output - log.info('Save the comparison of FlowByActivity load to FlowBySector ' - f'total FlowAmounts for {activity_set} in validation log file') - # if df not empty, print, if empty, print string - if df_v.empty: - vlog.info(f'Percent difference between loaded FBA and ' - f'output FBS for {activity_set} all round to 0') - else: - vlog.info('Comparison of FBA load to FBS total ' - 'FlowAmounts for %s: ' - '\n {}'.format(df_v.to_string()), activity_set) - except: - vlog.info('Error occurred when comparing total FlowAmounts ' - 'for FlowByActivity and FlowBySector') +# def compare_fba_geo_subset_and_fbs_output_totals( +# fba_load, fbs_load, activity_set, source_name, source_attr, +# activity_attr, method): +# """ +# Function to compare the loaded flowbyactivity total after +# subsetting by activity and geography with the final flowbysector output +# total. Not a direct comparison of the loaded FBA because FBAs are +# modified before being subset by activity for the target sector level +# :param fba_load: df, FBA loaded, before being mapped +# :param fbs_load: df, final FBS df at target sector level +# :param activity_set: str, activity set +# :param source_name: str, source name +# :param source_attr: dictionary, attribute data from method yaml +# for source data +# :param activity_attr: dictionary, attribute data from method yaml +# for activity set +# :param method: dictionary, FBS method yaml +# :return: printout data differences between loaded FBA and FBS output +# totals by location, save results as csv in local directory +# """ +# +# vlog.info('Comparing Flow-By-Activity subset by activity and geography to ' +# 'the subset Flow-By-Sector FlowAmount total.') +# +# # determine from scale +# if fips_number_key[source_attr['geoscale_to_use']] < \ +# fips_number_key[activity_attr['allocation_from_scale']]: +# from_scale = source_attr['geoscale_to_use'] +# else: +# from_scale = activity_attr['allocation_from_scale'] +# +# if source_attr['data_format'] == 'FBA': +# # extract relevant geoscale data or aggregate existing data +# fba = subset_df_by_geoscale(fba_load, from_scale, +# method['target_geoscale']) +# if check_activities_sector_like(fba_load): +# # if activities are sector-like, run sector aggregation and then +# # subset df to only keep NAICS2 +# fba = fba[['Class', 'SourceName', 'FlowAmount', 'Unit', 'Context', +# 'ActivityProducedBy', 'ActivityConsumedBy', 'Location', +# 'LocationSystem']] +# # rename the activity cols to sector cols for purposes of aggregation +# fba = fba.rename(columns={'ActivityProducedBy': 'SectorProducedBy', +# 'ActivityConsumedBy': 'SectorConsumedBy'}) +# fba = sector_aggregation(fba) +# # subset fba to only include NAICS2 +# # fba = replace_NoneType_with_empty_cells(fba) +# fba = subset_df_by_sector_lengths(fba, [2]) +# else: +# fba = sector_aggregation(fba_load) +# fba = subset_df_by_sector_lengths(fba, [2]) +# # subset/agg dfs +# col_subset = ['Class', 'FlowAmount', 'Unit', 'Context', +# 'Location', 'LocationSystem'] +# group_cols = ['Class', 'Unit', 'Context', 'Location', 'LocationSystem'] +# # check units +# compare_df_units(fba, fbs_load) +# # fba +# fba = fba[col_subset] +# fba_agg = aggregator(fba, group_cols).reset_index(drop=True) +# fba_agg.rename(columns={'FlowAmount': 'FBA_amount', +# 'Unit': 'FBA_unit'}, inplace=True) +# +# # fbs +# fbs = fbs_load[col_subset] +# fbs_agg = aggregator(fbs, group_cols) +# fbs_agg.rename(columns={'FlowAmount': 'FBS_amount', +# 'Unit': 'FBS_unit'}, inplace=True) +# +# try: +# # merge FBA and FBS totals +# df_merge = fba_agg.merge(fbs_agg, how='left') +# df_merge['FBS_amount'] = df_merge['FBS_amount'].fillna(0) +# df_merge['FlowAmount_difference'] = \ +# df_merge['FBA_amount'] - df_merge['FBS_amount'] +# df_merge['Percent_difference'] = \ +# (df_merge['FlowAmount_difference']/df_merge['FBA_amount']) * 100 +# # cases where flow amount diff is 0 but because fba amount is 0, +# # percent diff is null. Fill those cases with 0s +# df_merge['Percent_difference'] = np.where( +# (df_merge['FlowAmount_difference'] == 0) & +# (df_merge['FBA_amount'] == 0), 0, df_merge['Percent_difference']) +# # reorder +# df_merge = df_merge[['Class', 'Context', 'Location', 'LocationSystem', +# 'FBA_amount', 'FBA_unit', 'FBS_amount', +# 'FBS_unit', 'FlowAmount_difference', +# 'Percent_difference']] +# # df_merge = replace_NoneType_with_empty_cells(df_merge) +# +# # list of contexts and locations +# context_list = df_merge[['Class', 'Context', +# 'Location']].values.tolist() +# +# # loop through the contexts and print results of comparison +# vlog.info(f'Comparing FBA {activity_set} {source_attr["geoscale_to_use"]} ' +# 'subset to FBS results. Details in Validation Log') +# for i, j, k in context_list: +# df_merge_subset = \ +# df_merge[(df_merge['Class'] == i) & +# (df_merge['Context'] == j) & +# (df_merge['Location'] == k)].reset_index(drop=True) +# diff_per = df_merge_subset['Percent_difference'][0] +# if np.isnan(diff_per): +# vlog.info(f'FlowBySector FlowAmount for {source_name} ' +# f'{activity_set} {i} does not exist in the FBS') +# continue +# # make reporting more manageable +# if abs(diff_per) > 0.01: +# diff_per = round(diff_per, 2) +# else: +# diff_per = round(diff_per, 6) +# +# # diff_units = df_merge_subset['FBS_unit'][0] +# if diff_per > 0: +# vlog.info(f'FlowBySector FlowAmount for {source_name} ' +# f'{activity_set} {i} {j} at {k} is ' +# f'{str(abs(diff_per))}% less than the ' +# f'FlowByActivity FlowAmount') +# elif diff_per < 0: +# vlog.info(f'FlowBySector FlowAmount for {source_name} ' +# f'{activity_set} {i} {j} at {k} is ' +# f'{str(abs(diff_per))}% more than the ' +# f'FlowByActivity FlowAmount') +# elif diff_per == 0: +# vlog.info(f'FlowBySector FlowAmount for {source_name} ' +# f'{activity_set} {i} {j} at {k} is equal to the ' +# f'FlowByActivity FlowAmount') +# +# # subset the df to include in the validation log +# # only print rows where the percent difference does not round to 0 +# df_v = df_merge[df_merge['Percent_difference'].apply( +# lambda x: round(x, 3) != 0)].reset_index(drop=True) +# +# # log output +# log.info('Save the comparison of FlowByActivity load to FlowBySector ' +# f'total FlowAmounts for {activity_set} in validation log file') +# # if df not empty, print, if empty, print string +# if df_v.empty: +# vlog.info(f'Percent difference between loaded FBA and ' +# f'output FBS for {activity_set} all round to 0') +# else: +# vlog.info('Comparison of FBA load to FBS total ' +# 'FlowAmounts for %s: ' +# '\n {}'.format(df_v.to_string()), activity_set) +# except: +# vlog.info('Error occurred when comparing total FlowAmounts ' +# 'for FlowByActivity and FlowBySector') def compare_summation_at_sector_lengths_between_two_dfs(df1, df2): @@ -487,70 +500,70 @@ def compare_summation_at_sector_lengths_between_two_dfs(df1, df2): 'length') -def compare_child_to_parent_sectors_flowamounts(df_load): - """ - Sum child sectors up to one sector and compare to parent sector values - :param df_load: df, contains sector columns - :return: comparison of flow values - """ - from flowsa.flowbyfunctions import assign_sector_match_column - - merge_cols = [e for e in df_load.columns if e in [ - 'Class', 'SourceName', 'MetaSources', 'FlowName', 'Unit', - 'FlowType', 'Flowable', 'ActivityProducedBy', 'ActivityConsumedBy', - 'Compartment', 'Context', 'Location', 'Year', 'Description']] - # determine if activities are sector-like - sector_like_activities = check_activities_sector_like(df_load) - # if activities are sector like, drop columns from merge group - if sector_like_activities: - merge_cols = [e for e in merge_cols if e not in ( - 'ActivityProducedBy', 'ActivityConsumedBy')] - - agg_cols = merge_cols + ['SectorProducedMatch', 'SectorConsumedMatch'] - dfagg = pd.DataFrame() - for i in range(3, 7): - df = subset_df_by_sector_lengths(df_load, [i]) - for s in ['Produced', 'Consumed']: - df = assign_sector_match_column(df, f'Sector{s}By', i, i-1).rename( - columns={'sector_group': f'Sector{s}Match'}) - df = df.fillna('') - df2 = df.groupby(agg_cols).agg( - {'FlowAmount': 'sum'}).rename(columns={ - 'FlowAmount': 'ChildNAICSSum'}).reset_index() - dfagg = pd.concat([dfagg, df2], ignore_index=True) - - # merge new df with summed child naics to original df - drop_cols = [e for e in df_load.columns if e in - ['MeasureofSpread', 'Spread', 'DistributionType', 'Min', - 'Max', 'DataReliability', 'DataCollection', 'Description', - 'SectorProducedMatch', 'SectorConsumedMatch']] - dfm = df_load.merge(dfagg, how='left', left_on=merge_cols + [ - 'SectorProducedBy', 'SectorConsumedBy'], right_on=agg_cols).drop( - columns=drop_cols) - dfm = dfm.assign(FlowDiff=dfm['ChildNAICSSum'] - dfm['FlowAmount']) - dfm['PercentDiff'] = (dfm['FlowDiff'] / dfm['FlowAmount']) * 100 - - cols_subset = [e for e in dfm.columns if e in [ - 'Class', 'SourceName', 'MetaSources', 'Flowable', 'FlowName', - 'Unit', 'FlowType', 'ActivityProducedBy', 'ActivityConsumedBy', - 'Context', 'Location', 'Year', 'SectorProducedBy', - 'SectorConsumedBy', 'FlowAmount', 'ChildNAICSSum', 'PercentDiff']] - dfm = dfm[cols_subset] - - # subset df where child sectors sum to be greater than parent sectors - tolerance = 1 - dfm2 = dfm[(dfm['PercentDiff'] > tolerance) | - (dfm['PercentDiff'] < - tolerance)].reset_index(drop=True) - - if len(dfm2) > 0: - log.info(f'See validation log for cases where child sectors sum to be ' - f'different than parent sectors by at least {tolerance}%.') - vlog.info('There are cases where child sectors sum to be ' - 'different than parent sectors by at least %s%%: ' - '\n {}'.format(dfm2.to_string()), tolerance) - else: - vlog.info(f'No child sectors sum to be different than parent ' - f'sectors by at least {tolerance}%.') +# def compare_child_to_parent_sectors_flowamounts(df_load): +# """ +# Sum child sectors up to one sector and compare to parent sector values +# :param df_load: df, contains sector columns +# :return: comparison of flow values +# """ +# from flowsa.flowbyfunctions import assign_sector_match_column +# +# merge_cols = [e for e in df_load.columns if e in [ +# 'Class', 'SourceName', 'MetaSources', 'FlowName', 'Unit', +# 'FlowType', 'Flowable', 'ActivityProducedBy', 'ActivityConsumedBy', +# 'Compartment', 'Context', 'Location', 'Year', 'Description']] +# # determine if activities are sector-like +# sector_like_activities = check_activities_sector_like(df_load) +# # if activities are sector like, drop columns from merge group +# if sector_like_activities: +# merge_cols = [e for e in merge_cols if e not in ( +# 'ActivityProducedBy', 'ActivityConsumedBy')] +# +# agg_cols = merge_cols + ['SectorProducedMatch', 'SectorConsumedMatch'] +# dfagg = pd.DataFrame() +# for i in range(3, 7): +# df = subset_df_by_sector_lengths(df_load, [i]) +# for s in ['Produced', 'Consumed']: +# df = assign_sector_match_column(df, f'Sector{s}By', i, i-1).rename( +# columns={'sector_group': f'Sector{s}Match'}) +# df = df.fillna('') +# df2 = df.groupby(agg_cols).agg( +# {'FlowAmount': 'sum'}).rename(columns={ +# 'FlowAmount': 'ChildNAICSSum'}).reset_index() +# dfagg = pd.concat([dfagg, df2], ignore_index=True) +# +# # merge new df with summed child naics to original df +# drop_cols = [e for e in df_load.columns if e in +# ['MeasureofSpread', 'Spread', 'DistributionType', 'Min', +# 'Max', 'DataReliability', 'DataCollection', 'Description', +# 'SectorProducedMatch', 'SectorConsumedMatch']] +# dfm = df_load.merge(dfagg, how='left', left_on=merge_cols + [ +# 'SectorProducedBy', 'SectorConsumedBy'], right_on=agg_cols).drop( +# columns=drop_cols) +# dfm = dfm.assign(FlowDiff=dfm['ChildNAICSSum'] - dfm['FlowAmount']) +# dfm['PercentDiff'] = (dfm['FlowDiff'] / dfm['FlowAmount']) * 100 +# +# cols_subset = [e for e in dfm.columns if e in [ +# 'Class', 'SourceName', 'MetaSources', 'Flowable', 'FlowName', +# 'Unit', 'FlowType', 'ActivityProducedBy', 'ActivityConsumedBy', +# 'Context', 'Location', 'Year', 'SectorProducedBy', +# 'SectorConsumedBy', 'FlowAmount', 'ChildNAICSSum', 'PercentDiff']] +# dfm = dfm[cols_subset] +# +# # subset df where child sectors sum to be greater than parent sectors +# tolerance = 1 +# dfm2 = dfm[(dfm['PercentDiff'] > tolerance) | +# (dfm['PercentDiff'] < - tolerance)].reset_index(drop=True) +# +# if len(dfm2) > 0: +# log.info(f'See validation log for cases where child sectors sum to be ' +# f'different than parent sectors by at least {tolerance}%.') +# vlog.info('There are cases where child sectors sum to be ' +# 'different than parent sectors by at least %s%%: ' +# '\n {}'.format(dfm2.to_string()), tolerance) +# else: +# vlog.info(f'No child sectors sum to be different than parent ' +# f'sectors by at least {tolerance}%.') def check_for_nonetypes_in_sector_col(df): From 60ecf4b1a3738668590a0860078e0619a52e5b9f Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 14 Jul 2023 10:00:13 -0600 Subject: [PATCH 0684/1127] drop use of replace_strings_with_nonetype() --- flowsa/validation.py | 1 - 1 file changed, 1 deletion(-) diff --git a/flowsa/validation.py b/flowsa/validation.py index 4948c79ec..fbba78355 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -700,7 +700,6 @@ def compare_geographic_totals( nat = nat[(nat[fba_activity_fields[0]].isin(activity_names)) | (nat[fba_activity_fields[1]].isin(activity_names) )].reset_index(drop=True) - nat = replace_strings_with_NoneType(nat) # drop the geoscale in df_subset and sum sub = df_subset.assign(Location=US_FIPS) # depending on the datasource, might need to rename some From 6c570ed58eeaca68823f376381bfdf94f69e8d2a Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 14 Jul 2023 10:04:39 -0600 Subject: [PATCH 0685/1127] drop old code --- flowsa/validation.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/flowsa/validation.py b/flowsa/validation.py index fbba78355..e185f0f4e 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -288,18 +288,6 @@ def calculate_flowamount_diff_between_dfs(dfa_load, dfb_load): # 'FlowBySector ratios for %s: ' # '\n {}'.format(df_v.to_string()), activity_set) - # merge compare 1 and compare 2 - if v.get('data_format') == 'FBA': - merge_cols = ['ActivityProducedBy', 'ActivityConsumedBy', - 'Flowable', 'Unit', 'FlowType', 'Context', - 'Location', 'LocationSystem', 'Year'] - else: - merge_cols = attr.get('allocation_merge_columns') + \ - ['Flowable', 'Unit', 'FlowType', 'Context', - 'Location', 'LocationSystem', 'Year'] - df_merge = fba_agg.merge(fbs_agg, left_on=merge_cols, - right_on=merge_cols, how='left') - df_merge['Ratio'] = df_merge['FBS_amount'] / df_merge['FBA_amount'] # def compare_fba_geo_subset_and_fbs_output_totals( # fba_load, fbs_load, activity_set, source_name, source_attr, From 4a43706c161692469579ff1bcd170983e8de5439 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 14 Jul 2023 10:09:25 -0600 Subject: [PATCH 0686/1127] maintain dataclean import statements --- flowsa/validation.py | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/validation.py b/flowsa/validation.py index e185f0f4e..d17d87cdc 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -13,6 +13,7 @@ collapse_fbs_sectors from flowsa.flowsa_log import log, vlog from flowsa.common import sector_level_key, fba_activity_fields +from flowsa.dataclean import replace_NoneType_with_empty_cells, replace_strings_with_NoneType from flowsa.location import US_FIPS from flowsa.schema import dq_fields From 5f56fe56a36b55315df6788afb08bd0a95069556 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 14 Jul 2023 10:16:26 -0600 Subject: [PATCH 0687/1127] delete SEEA FBS methods --- .../flowbysectormethods/SEEA_2016_v1.yaml | 839 -------------- .../flowbysectormethods/SEEA_2017_kg_v1.yaml | 870 -------------- .../flowbysectormethods/SEEA_2017_v1.yaml | 1024 ----------------- .../flowbysectormethods/SEEA_2017_v2.yaml | 1003 ---------------- 4 files changed, 3736 deletions(-) delete mode 100644 flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml delete mode 100644 flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml delete mode 100644 flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml delete mode 100644 flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml diff --git a/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml deleted file mode 100644 index a713547c8..000000000 --- a/flowsa/methods/flowbysectormethods/SEEA_2016_v1.yaml +++ /dev/null @@ -1,839 +0,0 @@ -%YAML 1.1 - ---- -# m2 for the GHG national replicates the method used in the National GHG Industry Attribution Model -#(https://doi.org/10.23719/1517571), except that sector attribution is to 6-digit NAICS, -# rather than the BEA 2012 IO schema - -# !include:BEA_summary_target.yaml -industry_spec: - default: NAICS_3 - NAICS_4: ['336', '541'] -# industry_spec: -# default: NAICS_4 -target_naics_year: 2012 -geoscale: national - -display_tables: !include:SEEA_2017_v1.yaml:display_tables - -_ghgi_parameters: &ghgi_parameters - geoscale: national - year: &year 2016 - -_attribution_sources: - BEA_Use_Detail_PRO_BeforeRedef: &bea_use - year: 2012 - activity_to_sector_mapping: BEA_2012_Detail - attribution_method: proportional - attribution_source: BLS_QCEW - EPA_GHGI_T_A_79: &t_a_79 - attribution_method: proportional - attribution_source: BLS_QCEW - EIA_MECS_Energy: &mecs_energy - year: 2014 - selection_fields: &mecs_energy_default_selection - Class: Energy - Unit: Trillion Btu - clean_fba: !script_function:temp_data_source_functions clean_mecs_energy_fba_for_bea_summary - clean_fba_w_sec: !script_function:temp_data_source_functions clean_mapped_mecs_energy_fba_for_bea_summary - attribution_method: proportional # cleaning fxns remove need for proportional-flagged IF industry_spec is BEA summary - attribution_source: BLS_QCEW - USDA_CoA_Cropland_NAICS: &usda_pasture # allocated based on USDA Animal operation land (acres) - selection_fields: - Class: - - Land - FlowName: - - FARM OPERATIONS - year: 2017 - clean_fba: !script_function:temp_data_source_functions clean_usda_cropland_naics - USDA_CoA_Cropland: &usda_cropland - selection_fields: - Class: - - Land - FlowName: - - AREA HARVESTED - - AREA BEARING & NON-BEARING # Orchards - - AREA GROWN # Berry totals - - AREA IN PRODUCTION # Vegetable totals - year: 2017 - clean_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics - -sources_to_cache: - BLS_QCEW: - selection_fields: - Class: Employment - year: 2012 - clean_fba: !script_function:BLS_QCEW clean_qcew - BTS_TSA: - year: 2016 - selection_fields: - Description: - - In-house truck transportation - - For-hire truck transportation - activity_to_sector_mapping: BTS_TSA - attribution_method: proportional - attribution_source: BLS_QCEW - -source_names: - EPA_GHGI_T_2_1: #U.S. GHG emissions - <<: *ghgi_parameters - activity_sets: - direct_attribution: - selection_fields: - PrimaryActivity: - - Iron and Steel Production & Metallurgical Coke Production #CO2, CH4 - - Cement Production #CO2 - - Lime Production #CO2 - - Ammonia Production #CO2 - - Incineration of Waste #CO2, #N2O - - Aluminum Production #CO2 - - Soda Ash Production #CO2 - - Ferroalloy Production #CO2, CH4 - - Titanium Dioxide Production #CO2 - - Zinc Production #CO2 - - Phosphoric Acid Production #CO2 - - Glass Production #CO2 - - Carbide Production and Consumption #CO2, CH4 - - Landfills #CH4 - - Coal Mining #CH4 - - Wastewater Treatment #CH4, N2O - - Rice Cultivation #CH4 - - Abandoned Oil and Gas Wells #CH4 - - Abandoned Underground Coal Mines #CH4 - - Anaerobic Digestion at Biogas Facilities #CH4 new activity - - Composting #CH4, N2O - - Nitric Acid Production #N2O - - Adipic Acid Production #N2O - - Caprolactam, Glyoxal, and Glyoxylic Acid Production #CH4 - - Electronics Industry #N2O - FlowName: # HFCs and other flows are attributed elsewhere - - CO2 - - CH4 - - N2O - attribution_method: direct - - electric_distribution: - selection_fields: - PrimaryActivity: Electrical Transmission and Distribution #SF6 - FlowName: SF6 - attribution_method: direct - - liming: - selection_fields: - PrimaryActivity: Liming #CO2 - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '327400' - - urea: - selection_fields: - PrimaryActivity: - - Urea Fertilization #CO2 - - Urea Consumption for Non-Agricultural Purposes #CO2 - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '325310' # Fertilizers - - carbonate_use: - selection_fields: - PrimaryActivity: Other Process Uses of Carbonates #CO2 - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '325180' # Other Basic Inorganic Chemicals - - lead_production: - selection_fields: - PrimaryActivity: Lead Production #CO2 - attribution_method: proportional - attribution_source: - USGS_MYB_Lead: - year: 2016 - selection_fields: - ActivityProducedBy: - - Primary lead, refined content, domestic ores and base bullion - - Secondary lead, lead content - - nitrous_oxide_use: - selection_fields: - PrimaryActivity: N2O from Product Uses #N2O - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '325120' # Industrial gases - -## Fossil Fuels - EPA_GHGI_T_3_63: &natgas #CH4 from Natural Gas Systems - <<: *ghgi_parameters - selection_fields: - PrimaryActivity: - - Distribution - - Exploration - - Processing - - Production - - Transmission and Storage - attribution_method: direct - EPA_GHGI_T_3_65: *natgas #CO2 from Natural Gas Systems mimics CH4 - EPA_GHGI_T_3_67: *natgas #N2O from Natural Gas Systems, not used in original method, mimics CH4 - - EPA_GHGI_T_3_38: &petroleum #CH4 from Petroleum Systems - <<: *ghgi_parameters - selection_fields: - PrimaryActivity: - - Crude Oil Transportation - - Exploration - - Production - - Refining - attribution_method: direct - EPA_GHGI_T_3_40: *petroleum #CO2 from Petroleum Systems mimics CH4 - EPA_GHGI_T_3_42: *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 - -## Stationary Combustion (note that CO2 is electric power only) - EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion - <<: *ghgi_parameters - clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion - activity_sets: - direct_attribution: - selection_fields: - PrimaryActivity: - - Fuel Oil Residential - - Coal Residential - - Natural Gas Residential - - Wood Residential - attribution_method: direct - electric_power: &stationary_electric - selection_fields: - PrimaryActivity: - - Coal Electric Power - - Natural Gas Electric Power - - Natural gas Electric Power # note lower case - - Fuel Oil Electric Power - - Geothermal Electric Power - - Wood Electric Power - activity_to_sector_mapping: EPA_GHGI_m2 - attribution_method: direct - fuel_oil: - selection_fields: - PrimaryActivity: - - Fuel Oil Commercial - - Fuel Oil Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # purchases of refinery products - natural_gas: - selection_fields: - PrimaryActivity: - - Natural gas Commercial - - Natural gas Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '221200' # purchases of natural gas - coal: - selection_fields: - PrimaryActivity: Coal Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '212100' # purchases of coal - coal_manufacturing: - selection_fields: - PrimaryActivity: Coal Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Coal - natural_gas_manufacturing: - selection_fields: - PrimaryActivity: Natural gas Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Natural Gas - EPA_GHGI_T_3_9: # N2O emissions from stationary combustion - <<: *stationary_combustion - EPA_GHGI_T_3_7: # CO2 emissions from stationary combustion (electricity only) - <<: [*ghgi_parameters, *stationary_electric] - -# ## Agriculture - EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues - <<: *ghgi_parameters - attribution_method: direct - selection_fields: - PrimaryActivity: - - Chickpeas - - Cotton - - Maize - - Rice - - Soybeans - - Wheat - - EPA_GHGI_T_5_3: &animals #CH4 from Enteric Fermentation - <<: *ghgi_parameters - attribution_method: direct - selection_fields: - PrimaryActivity: - - American Bison - - Beef Cattle - - Dairy Cattle - - Goats - - Horses - - Mules and Asses - - Sheep - - Swine - - Poultry - EPA_GHGI_T_5_7: *animals #CH4 and N2O from manure, mimics enteric fermentation - - EPA_GHGI_T_5_18: #Direct N2O emissions from agricultural soils - <<: *ghgi_parameters - activity_sets: - fertilizer_use: &fertilizer # allocated based on fertilizer use - selection_fields: - PrimaryActivity: - - Organic Amendment Cropland - - Residue N Cropland - - Synthetic Fertilizer Cropland - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: - - '325310' - cropland: - selection_fields: - PrimaryActivity: - - Mineralization and Asymbiotic Fixation Cropland - - Drained Organic Soils Cropland - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland: - <<: *usda_cropland - pasture: &pasture - selection_fields: - PrimaryActivity: - - All activities Grassland - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland_NAICS: - <<: *usda_pasture - EPA_GHGI_T_5_19: #Indirect N2O emissions from agricultural soils - <<: *ghgi_parameters - activity_sets: - fertilizer_use: # allocated based on fertilizer use - <<: *fertilizer - selection_fields: - PrimaryActivity: - - Volatilization & Atm. Deposition Cropland - - Surface Leaching & Run-Off Cropland - pasture: - <<: *pasture - -## Mobile Sources (N20 and CH4) - EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion - <<: *ghgi_parameters - activity_sets: - direct_attribution: # Some of these need to be separated and attributed differently - selection_fields: - PrimaryActivity: - - Passenger Cars Gasoline On-Road - - Rail Non-Road - - Ships and Boats Non-Road - # - Aircraft Non-Road - attribution_method: direct - - trucking: - adjustment_factor: 0.99 - selection_fields: - PrimaryActivity: - - Light-Duty Trucks Gasoline On-Road - - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road - activity_to_sector_mapping: EPA_GHGI_trucking - attribution_method: proportional - attribution_source: BTS_TSA - - construction_and_mining: - selection_fields: - PrimaryActivity: Construction/Mining Equipment Non-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333120' # purchases of construction/mining equipment - - farm_non_road: - selection_fields: - PrimaryActivity: Agricultural Equipment Non-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333111' # purchases of farm machinery - - other_non_road: # attributed by purchases of petroleum refinery products - selection_fields: - PrimaryActivity: Other Non-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # purchases of refinery products - - alt_fuel_on_road: # assumes natural gas is primary alternate fuel - selection_fields: - PrimaryActivity: - - All activities Alternative Fuel On-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '221200' # purchases of natural gas - EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 - -# Major CO2 Sources - EPA_GHGI_T_A_14: # (2016 specific table) CO2 emissions from stationary combustion and transportation - <<: *ghgi_parameters - clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion - activity_sets: - direct_attribution: - selection_fields: - PrimaryActivity: Total (All Fuels) Residential - attribution_method: direct - non-manufacturing_coal: - selection_fields: - PrimaryActivity: - - Commercial Coal Commercial - - Industrial Other Coal Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '212100' # purchases of coal - non-manufacturing_natural_gas: - selection_fields: - PrimaryActivity: - - Natural Gas Commercial - - Natural Gas Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '221200' # purchases of natural gas - non-manufacturing_petroleum: - selection_fields: - PrimaryActivity: - - Total Petroleum Commercial - - Total Petroleum Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # purchases of refinery products - manufacturing_coal: # Industrial Coal for Manufacturing - selection_fields: - PrimaryActivity: - - Industrial Other Coal Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Coal - manufacturing_natural_gas: # Industrial Natural Gas for manufacturing - selection_fields: - PrimaryActivity: - - Natural Gas Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Natural Gas - - ## Transportation - natural_gas_transportation: - selection_fields: - PrimaryActivity: Natural Gas Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - selection_fields: - FlowName: Natural Gas - - aviation_gas_transportation: - selection_fields: - PrimaryActivity: Aviation Gasoline Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - selection_fields: - FlowName: Aviation Gasoline - - # jet_fuel_transportation: - # selection_fields: - # PrimaryActivity: Jet Fuel Transportation - # attribution_method: proportional - # attribution_source: - # EPA_GHGI_T_A_79: - # <<: *t_a_79 - # selection_fields: - # FlowName: Jet Fuel - - propane_transportation: - selection_fields: - PrimaryActivity: LPG (Propane) Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - selection_fields: - FlowName: LPG - - residual_fuel_transportation: - selection_fields: - PrimaryActivity: Residual Fuel Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - selection_fields: - FlowName: Residual Fuel Oil - - distillate_fuel_transportation: - selection_fields: - PrimaryActivity: - - Distillate Fuel Oil Transportation - activity_to_sector_mapping: EPA_GHGI_trucking - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - activity_to_sector_mapping: EPA_GHGI - activity_sets: - direct_attribution: - selection_fields: - FlowName: Distillate Fuel Oil (Diesel Fuel) - PrimaryActivity: - - Passenger Cars - - Rail - - Recreational Boats - - Ships and Non-Recreational Boats - attribution_method: direct - trucking: - adjustment_factor: 0.99 - selection_fields: - FlowName: Distillate Fuel Oil (Diesel Fuel) - PrimaryActivity: - - Light-Duty Trucks - - Medium- and Heavy-Duty Trucks - activity_to_sector_mapping: EPA_GHGI_trucking - attribution_method: proportional - attribution_source: BTS_TSA - buses: - selection_fields: - FlowName: Distillate Fuel Oil (Diesel Fuel) - PrimaryActivity: Buses - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # use of petroleum products - - motor_gasoline_transportation: - selection_fields: - PrimaryActivity: - - Motor Gasoline Transportation - activity_to_sector_mapping: EPA_GHGI_trucking - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - activity_to_sector_mapping: EPA_GHGI - activity_sets: - direct_attribution: - selection_fields: - FlowName: Motor Gasoline - PrimaryActivity: - - Passenger Cars - - Motorcycles - - Recreational Boats - attribution_method: direct - trucking: - adjustment_factor: 0.99 - selection_fields: - FlowName: Motor Gasoline - PrimaryActivity: - - Light-Duty Trucks - - Medium- and Heavy-Duty Trucks - activity_to_sector_mapping: EPA_GHGI_trucking - attribution_method: proportional - attribution_source: BTS_TSA - buses: - selection_fields: - FlowName: Motor Gasoline - PrimaryActivity: Buses - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # use of petroleum products - -## Other sources - EPA_GHGI_T_4_46: #CO2 for selected petrochemicals - <<: *ghgi_parameters - selection_fields: - PrimaryActivity: - - Acrylonitrile - - Carbon Black - - Ethylene - - Ethylene Dichloride - - Ethylene Oxide - - Methanol - attribution_method: direct - - EPA_GHGI_T_3_22b: #Fossil fuel for non-energy uses - <<: *ghgi_parameters - activity_sets: - coal: - selection_fields: - PrimaryActivity: - - Industry Industrial Coking Coal - - Industry Industrial Other Coal - attribution_method: direct - - distillate_fuel_feedstocks: - selection_fields: - PrimaryActivity: Industry Distillate Fuel Oil - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: Distillate Fuel Oil - - hgl_feedstocks: - selection_fields: - PrimaryActivity: - - Industry LPG - - Industry Pentanes Plus - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: Hydrocarbon Gas Liquids, excluding natural gasoline - - petroleum_coke_feedstocks: - selection_fields: - PrimaryActivity: Industry Petroleum Coke - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: Coke and Breeze - - natural_gas_feedstocks: - selection_fields: - PrimaryActivity: - - Industry Still Gas - - Industry Natural Gas to Chemical Plants - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: Natural Gas - - other_petroleum_feedstocks: - selection_fields: - PrimaryActivity: - - Industry Asphalt & Road Oil - - Industry Lubricants - - Industry Miscellaneous Products - - Industry Naphtha (<401 F) - - Industry Other Oil (>401 F) - - Industry Special Naphtha - - Industry Waxes - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: Other - - transportation_lubricants: - selection_fields: - PrimaryActivity: Transportation Lubricants - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # use of petroleum products - - EPA_GHGI_T_4_50: # HFCs from HCFC-22 production - <<: *ghgi_parameters - selection_fields: - Unit: MMT CO2e - PrimaryActivity: HCFC-22 Production - attribution_method: direct - - EPA_GHGI_T_4_94: # HFCs and other emissions from electronics manufacture - <<: *ghgi_parameters - selection_fields: - FlowName: - SF6: SF6 - Total F-GHGs: HFCs and PFCs - NF3: NF3 - N2O[2]: N2O - attribution_method: direct - - EPA_GHGI_T_4_101: # HFCs and PFCs from ODS Substitutes - <<: *ghgi_parameters - clean_fba_before_activity_sets: !script_function:temp_data_source_functions clean_hfc_fba_for_seea # removes HFCs from transportation - activity_sets: - household_refrigeration: - selection_fields: - PrimaryActivity: Refrigeration/Air Conditioning - Households - attribution_method: direct - - non-household_refrigeration: - selection_fields: - PrimaryActivity: Refrigeration/Air Conditioning - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333415' # Air conditioning equipment - - polystyrene_foam: - selection_fields: - PrimaryActivity: Foams - Polystyrene - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '326140' # Polystyrene foam - - urethane_foam: - selection_fields: - PrimaryActivity: Foams - Urethane - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '326150' # Urethane and other foams. - - EPA_GHGI_T_A_103: # HFCs from Transportation - <<: *ghgi_parameters - # clean_fba_before_activity_sets: !script_function:EPA_GHGI split_hfcs_by_type - activity_sets: - passenger_cars: - selection_fields: - PrimaryActivity: Passenger Cars - attribution_method: direct - trucking: - selection_fields: - PrimaryActivity: - - Light-Duty Trucks - - Heavy-Duty Vehicles - adjustment_factor: 0.99 - activity_to_sector_mapping: EPA_GHGI_trucking - attribution_method: proportional - attribution_source: BTS_TSA - refrigerated_trucks: - selection_fields: - PrimaryActivity: Medium- and Heavy-Duty Trucks - activity_to_sector_mapping: EPA_GHGI_trucking - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333415' # purchases of refrigeration equipment - other_cooling: - selection_fields: - PrimaryActivity: - - School and Tour Buses - # - Transit Buses # crosswalk marks these as excluded; I'm not at all sure why - - Rail - - Ships and Boats - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333415' # purchases of refrigeration equipment - - EPA_GHGI_T_4_80: # PFCs from aluminum production - <<: *ghgi_parameters - selection_fields: - PrimaryActivity: Aluminum Production - attribution_method: direct - - EPA_GHGI_T_4_84: # HFCs, SF6, CO2 from magnesium production - <<: *ghgi_parameters - selection_fields: - PrimaryActivity: Magnesium Production and Processing - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: T008 # Gross output. - - BTS_Airlines: - selection_fields: - Year: *year - emissions_factors: BTS_Airlines_emissions_factors - activity_to_sector_mapping: EPA_GHGI diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml deleted file mode 100644 index c2b138a1f..000000000 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_kg_v1.yaml +++ /dev/null @@ -1,870 +0,0 @@ -%YAML 1.1 - ---- -# m2 for the GHG national replicates the method used in the National GHG Industry Attribution Model -#(https://doi.org/10.23719/1517571), except that sector attribution is to 6-digit NAICS, -# rather than the BEA 2012 IO schema - -# !include:BEA_summary_target.yaml -industry_spec: - default: NAICS_3 - NAICS_4: ['336', '541'] -# industry_spec: -# default: NAICS_4 -target_naics_year: 2012 -geoscale: national - -display_tables: - NAICS 2: - industry_spec: {default: NAICS_2} - replace_dict: - Industry: {'31': '31-33', '32': '31-33', '33': '31-33', - '44': '44-45', '45': '44-45', - '48': '48-49', '49': '48-49'} - Pollutant: {C2F6: F-GHGs, C3F8: F-GHGs, CF4: F-GHGs, - 'HFC, PFC and SF6 F-HTFs': F-GHGs, - HFC-134a: F-GHGs, HFC-23: F-GHGs, - HFCs: F-GHGs, HFCs and PFCs: F-GHGs, - Total F-GHGs: F-GHGs, c-C4F8: F-GHGs, - CO2: Carbon dioxide, CH4: Methane, - N2O: Nitrous oxide, 'N2O[2]': Nitrous oxide, - SF6: Sulfur hexafluoride, - NF3: Nitrogen trifluoride} - -_ghgi_parameters: &ghgi_parameters - geoscale: national - year: &year 2017 - fedefl_mapping: GHGI - -_attribution_sources: - BEA_Use_Detail_PRO_BeforeRedef: &bea_use - year: 2012 - activity_to_sector_mapping: BEA_2012_Detail - attribution_method: proportional - attribution_source: BLS_QCEW - EPA_GHGI_T_A_79: &t_a_79 - attribution_method: proportional - attribution_source: BLS_QCEW - EIA_MECS_Energy: &mecs_energy - year: 2014 - selection_fields: &mecs_energy_default_selection - Class: Energy - Unit: Trillion Btu - clean_fba: !script_function:temp_data_source_functions clean_mecs_energy_fba_for_bea_summary - clean_fba_w_sec: !script_function:temp_data_source_functions clean_mapped_mecs_energy_fba_for_bea_summary - attribution_method: proportional # cleaning fxns remove need for proportional-flagged IF industry_spec is BEA summary - attribution_source: BLS_QCEW - USDA_CoA_Cropland_NAICS: &usda_pasture # allocated based on USDA Animal operation land (acres) - selection_fields: - Class: - - Land - FlowName: - - FARM OPERATIONS - year: 2017 - clean_fba: !script_function:temp_data_source_functions clean_usda_cropland_naics - USDA_CoA_Cropland: &usda_cropland - selection_fields: - Class: - - Land - FlowName: - - AREA HARVESTED - - AREA BEARING & NON-BEARING # Orchards - - AREA GROWN # Berry totals - - AREA IN PRODUCTION # Vegetable totals - year: 2017 - clean_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics - -sources_to_cache: - BLS_QCEW: - selection_fields: - Class: Employment - year: 2012 - clean_fba: !script_function:BLS_QCEW clean_qcew - BTS_TSA: - year: 2017 - selection_fields: - Description: - - In-house truck transportation - - For-hire truck transportation - activity_to_sector_mapping: BTS_TSA - attribution_method: proportional - attribution_source: BLS_QCEW - -source_names: - # stewiFBS: - # data_format: FBS_outside_flowsa - # FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector - # inventory_dict: {'NEI': '2017'} - # local_inventory_name: NEI_TRI_air_2017 - # selection_fields: # Remember GHGs should not be drawn from NEI - # Flowable: - # Particulate matter, ≤ 2.5μm: PM 2.5 - # compartments: - # - air - # reassign_process_to_sectors: - # - airplane_emissions - - EPA_GHGI_T_2_1: #U.S. GHG emissions - <<: *ghgi_parameters - activity_sets: - direct_attribution: - selection_fields: - PrimaryActivity: - - Iron and Steel Production & Metallurgical Coke Production #CO2, CH4 - - Cement Production #CO2 - - Lime Production #CO2 - - Ammonia Production #CO2 - - Incineration of Waste #CO2, #N2O - - Aluminum Production #CO2 - - Soda Ash Production #CO2 - - Ferroalloy Production #CO2, CH4 - - Titanium Dioxide Production #CO2 - - Zinc Production #CO2 - - Phosphoric Acid Production #CO2 - - Glass Production #CO2 - - Carbide Production and Consumption #CO2, CH4 - - Landfills #CH4 - - Coal Mining #CH4 - - Wastewater Treatment #CH4, N2O - - Rice Cultivation #CH4 - - Abandoned Oil and Gas Wells #CH4 - - Abandoned Underground Coal Mines #CH4 - - Anaerobic Digestion at Biogas Facilities #CH4 new activity - - Composting #CH4, N2O - - Nitric Acid Production #N2O - - Adipic Acid Production #N2O - - Caprolactam, Glyoxal, and Glyoxylic Acid Production #CH4 - - Electronics Industry #N2O - FlowName: # HFCs and other flows are attributed elsewhere - - CO2 - - CH4 - - N2O - attribution_method: direct - - electric_distribution: - selection_fields: - PrimaryActivity: Electrical Transmission and Distribution #SF6 - FlowName: SF6 - attribution_method: direct - - liming: - selection_fields: - PrimaryActivity: Liming #CO2 - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '327400' - - urea: - selection_fields: - PrimaryActivity: - - Urea Fertilization #CO2 - - Urea Consumption for Non-Agricultural Purposes #CO2 - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '325310' # Fertilizers - - carbonate_use: - selection_fields: - PrimaryActivity: Other Process Uses of Carbonates #CO2 - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '325180' # Other Basic Inorganic Chemicals - - lead_production: - selection_fields: - PrimaryActivity: Lead Production #CO2 - attribution_method: proportional - attribution_source: - USGS_MYB_Lead: - year: 2016 - selection_fields: - ActivityProducedBy: - - Primary lead, refined content, domestic ores and base bullion - - Secondary lead, lead content - - nitrous_oxide_use: - selection_fields: - PrimaryActivity: N2O from Product Uses #N2O - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '325120' # Industrial gases - -## Fossil Fuels - EPA_GHGI_T_3_63: &natgas #CH4 from Natural Gas Systems - <<: *ghgi_parameters - selection_fields: - PrimaryActivity: - - Distribution - - Exploration - - Processing - - Production - - Transmission and Storage - attribution_method: direct - EPA_GHGI_T_3_65: *natgas #CO2 from Natural Gas Systems mimics CH4 - EPA_GHGI_T_3_67: *natgas #N2O from Natural Gas Systems, not used in original method, mimics CH4 - - EPA_GHGI_T_3_38: &petroleum #CH4 from Petroleum Systems - <<: *ghgi_parameters - selection_fields: - PrimaryActivity: - - Crude Oil Transportation - - Exploration - - Production - - Refining - attribution_method: direct - EPA_GHGI_T_3_40: *petroleum #CO2 from Petroleum Systems mimics CH4 - EPA_GHGI_T_3_42: *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 - -## Stationary Combustion (note that CO2 is electric power only) - EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion - <<: *ghgi_parameters - clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion - activity_sets: - direct_attribution: - selection_fields: - PrimaryActivity: - - Fuel Oil Residential - - Coal Residential - - Natural Gas Residential - - Wood Residential - attribution_method: direct - electric_power: &stationary_electric - selection_fields: - PrimaryActivity: - - Coal Electric Power - - Natural Gas Electric Power - - Natural gas Electric Power # note lower case - - Fuel Oil Electric Power - - Geothermal Electric Power - - Wood Electric Power - activity_to_sector_mapping: EPA_GHGI_m2 - attribution_method: direct - fuel_oil: - selection_fields: - PrimaryActivity: - - Fuel Oil Commercial - - Fuel Oil Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # purchases of refinery products - natural_gas: - selection_fields: - PrimaryActivity: - - Natural gas Commercial - - Natural gas Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '221200' # purchases of natural gas - coal: - selection_fields: - PrimaryActivity: Coal Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '212100' # purchases of coal - coal_manufacturing: - selection_fields: - PrimaryActivity: Coal Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Coal - natural_gas_manufacturing: - selection_fields: - PrimaryActivity: Natural gas Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Natural Gas - EPA_GHGI_T_3_9: # N2O emissions from stationary combustion - <<: *stationary_combustion - EPA_GHGI_T_3_7: # CO2 emissions from stationary combustion (electricity only) - <<: [*ghgi_parameters, *stationary_electric] - -# ## Agriculture - EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues - <<: *ghgi_parameters - attribution_method: direct - selection_fields: - PrimaryActivity: - - Chickpeas - - Cotton - - Maize - - Rice - - Soybeans - - Wheat - - EPA_GHGI_T_5_3: &animals #CH4 from Enteric Fermentation - <<: *ghgi_parameters - attribution_method: direct - selection_fields: - PrimaryActivity: - - American Bison - - Beef Cattle - - Dairy Cattle - - Goats - - Horses - - Mules and Asses - - Sheep - - Swine - - Poultry - EPA_GHGI_T_5_7: *animals #CH4 and N2O from manure, mimics enteric fermentation - - EPA_GHGI_T_5_18: #Direct N2O emissions from agricultural soils - <<: *ghgi_parameters - activity_sets: - fertilizer_use: &fertilizer # allocated based on fertilizer use - selection_fields: - PrimaryActivity: - - Organic Amendment Cropland - - Residue N Cropland - - Synthetic Fertilizer Cropland - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: - - '325310' - cropland: - selection_fields: - PrimaryActivity: - - Mineralization and Asymbiotic Fixation Cropland - - Drained Organic Soils Cropland - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland: - <<: *usda_cropland - pasture: &pasture - selection_fields: - PrimaryActivity: - - All activities Grassland - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland_NAICS: - <<: *usda_pasture - EPA_GHGI_T_5_19: #Indirect N2O emissions from agricultural soils - <<: *ghgi_parameters - activity_sets: - fertilizer_use: # allocated based on fertilizer use - <<: *fertilizer - selection_fields: - PrimaryActivity: - - Volatilization & Atm. Deposition Cropland - - Surface Leaching & Run-Off Cropland - pasture: - <<: *pasture - -## Mobile Sources (N20 and CH4) - EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion - <<: *ghgi_parameters - activity_sets: - direct_attribution: # Some of these need to be separated and attributed differently - selection_fields: - PrimaryActivity: - - Passenger Cars Gasoline On-Road - - Rail Non-Road - - Ships and Boats Non-Road - # - Aircraft Non-Road - attribution_method: direct - - trucking: - adjustment_factor: 0.99 - selection_fields: - PrimaryActivity: - - Light-Duty Trucks Gasoline On-Road - - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road - activity_to_sector_mapping: EPA_GHGI_trucking - attribution_method: proportional - attribution_source: BTS_TSA - - construction_and_mining: - selection_fields: - PrimaryActivity: Construction/Mining Equipment Non-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333120' # purchases of construction/mining equipment - - farm_non_road: - selection_fields: - PrimaryActivity: Agricultural Equipment Non-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333111' # purchases of farm machinery - - other_non_road: # attributed by purchases of petroleum refinery products - selection_fields: - PrimaryActivity: Other Non-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # purchases of refinery products - - alt_fuel_on_road: # assumes natural gas is primary alternate fuel - selection_fields: - PrimaryActivity: - - All activities Alternative Fuel On-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '221200' # purchases of natural gas - EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 - -# Major CO2 Sources - EPA_GHGI_T_A_13: # (2017 specific table) CO2 emissions from stationary combustion and transportation - <<: *ghgi_parameters - clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion - activity_sets: - direct_attribution: - selection_fields: - PrimaryActivity: Total (All Fuels) Residential - attribution_method: direct - non-manufacturing_coal: - selection_fields: - PrimaryActivity: - - Commercial Coal Commercial - - Industrial Other Coal Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '212100' # purchases of coal - non-manufacturing_natural_gas: - selection_fields: - PrimaryActivity: - - Natural Gas Commercial - - Natural Gas Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '221200' # purchases of natural gas - non-manufacturing_petroleum: - selection_fields: - PrimaryActivity: - - Total Petroleum Commercial - - Total Petroleum Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # purchases of refinery products - manufacturing_coal: # Industrial Coal for Manufacturing - selection_fields: - PrimaryActivity: - - Industrial Other Coal Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Coal - manufacturing_natural_gas: # Industrial Natural Gas for manufacturing - selection_fields: - PrimaryActivity: - - Natural Gas Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Natural Gas - - ## Transportation - natural_gas_transportation: - selection_fields: - PrimaryActivity: Natural Gas Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - selection_fields: - FlowName: Natural Gas - - aviation_gas_transportation: - selection_fields: - PrimaryActivity: Aviation Gasoline Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - selection_fields: - FlowName: Aviation Gasoline - - # jet_fuel_transportation: - # selection_fields: - # PrimaryActivity: Jet Fuel Transportation - # attribution_method: proportional - # attribution_source: - # EPA_GHGI_T_A_79: - # <<: *t_a_79 - # selection_fields: - # FlowName: Jet Fuel - - propane_transportation: - selection_fields: - PrimaryActivity: LPG (Propane) Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - selection_fields: - FlowName: LPG - - residual_fuel_transportation: - selection_fields: - PrimaryActivity: Residual Fuel Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - selection_fields: - FlowName: Residual Fuel Oil - - distillate_fuel_transportation: - selection_fields: - PrimaryActivity: - - Distillate Fuel Oil Transportation - activity_to_sector_mapping: EPA_GHGI_trucking - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - activity_to_sector_mapping: EPA_GHGI - activity_sets: - direct_attribution: - selection_fields: - FlowName: Distillate Fuel Oil (Diesel Fuel) - PrimaryActivity: - - Passenger Cars - - Rail - - Recreational Boats - - Ships and Non-Recreational Boats - attribution_method: direct - trucking: - adjustment_factor: 0.99 - selection_fields: - FlowName: Distillate Fuel Oil (Diesel Fuel) - PrimaryActivity: - - Light-Duty Trucks - - Medium- and Heavy-Duty Trucks - activity_to_sector_mapping: EPA_GHGI_trucking - attribution_method: proportional - attribution_source: BTS_TSA - buses: - selection_fields: - FlowName: Distillate Fuel Oil (Diesel Fuel) - PrimaryActivity: Buses - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # use of petroleum products - - motor_gasoline_transportation: - selection_fields: - PrimaryActivity: - - Motor Gasoline Transportation - activity_to_sector_mapping: EPA_GHGI_trucking - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - activity_to_sector_mapping: EPA_GHGI - activity_sets: - direct_attribution: - selection_fields: - FlowName: Motor Gasoline - PrimaryActivity: - - Passenger Cars - - Motorcycles - - Recreational Boats - attribution_method: direct - trucking: - adjustment_factor: 0.99 - selection_fields: - FlowName: Motor Gasoline - PrimaryActivity: - - Light-Duty Trucks - - Medium- and Heavy-Duty Trucks - activity_to_sector_mapping: EPA_GHGI_trucking - attribution_method: proportional - attribution_source: BTS_TSA - buses: - selection_fields: - FlowName: Motor Gasoline - PrimaryActivity: Buses - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # use of petroleum products - -## Other sources - EPA_GHGI_T_4_46: #CO2 for selected petrochemicals - <<: *ghgi_parameters - selection_fields: - PrimaryActivity: - - Acrylonitrile - - Carbon Black - - Ethylene - - Ethylene Dichloride - - Ethylene Oxide - - Methanol - attribution_method: direct - - EPA_GHGI_T_3_22b: #Fossil fuel for non-energy uses - <<: *ghgi_parameters - activity_sets: - coal: - selection_fields: - PrimaryActivity: - - Industry Industrial Coking Coal - - Industry Industrial Other Coal - attribution_method: direct - - distillate_fuel_feedstocks: - selection_fields: - PrimaryActivity: Industry Distillate Fuel Oil - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: Distillate Fuel Oil - - hgl_feedstocks: - selection_fields: - PrimaryActivity: - - Industry LPG - - Industry Pentanes Plus - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: Hydrocarbon Gas Liquids, excluding natural gasoline - - petroleum_coke_feedstocks: - selection_fields: - PrimaryActivity: Industry Petroleum Coke - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: Coke and Breeze - - natural_gas_feedstocks: - selection_fields: - PrimaryActivity: - - Industry Still Gas - - Industry Natural Gas to Chemical Plants - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: Natural Gas - - other_petroleum_feedstocks: - selection_fields: - PrimaryActivity: - - Industry Asphalt & Road Oil - - Industry Lubricants - - Industry Miscellaneous Products - - Industry Naphtha (<401 F) - - Industry Other Oil (>401 F) - - Industry Special Naphtha - - Industry Waxes - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: Other - - transportation_lubricants: - selection_fields: - PrimaryActivity: Transportation Lubricants - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # use of petroleum products - - EPA_GHGI_T_4_50: # HFCs from HCFC-22 production - <<: *ghgi_parameters - selection_fields: - Unit: MMT CO2e - PrimaryActivity: HCFC-22 Production - attribution_method: direct - - EPA_GHGI_T_4_94: # HFCs and other emissions from electronics manufacture - <<: *ghgi_parameters - selection_fields: - FlowName: - SF6: SF6 - Total F-GHGs: HFCs and PFCs - NF3: NF3 - N2O[2]: N2O - attribution_method: direct - - EPA_GHGI_T_4_101: # HFCs and PFCs from ODS Substitutes - <<: *ghgi_parameters - clean_fba_before_activity_sets: !script_function:temp_data_source_functions clean_hfc_fba_for_seea # removes HFCs from transportation - activity_sets: - household_refrigeration: - selection_fields: - PrimaryActivity: Refrigeration/Air Conditioning - Households - attribution_method: direct - - non-household_refrigeration: - selection_fields: - PrimaryActivity: Refrigeration/Air Conditioning - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333415' # Air conditioning equipment - - polystyrene_foam: - selection_fields: - PrimaryActivity: Foams - Polystyrene - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '326140' # Polystyrene foam - - urethane_foam: - selection_fields: - PrimaryActivity: Foams - Urethane - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '326150' # Urethane and other foams. - - EPA_GHGI_T_A_103: # HFCs from Transportation - <<: *ghgi_parameters - # clean_fba_before_activity_sets: !script_function:EPA_GHGI split_hfcs_by_type - activity_sets: - passenger_cars: - selection_fields: - PrimaryActivity: Passenger Cars - attribution_method: direct - trucking: - selection_fields: - PrimaryActivity: - - Light-Duty Trucks - - Heavy-Duty Vehicles - adjustment_factor: 0.99 - activity_to_sector_mapping: EPA_GHGI_trucking - attribution_method: proportional - attribution_source: BTS_TSA - refrigerated_trucks: - selection_fields: - PrimaryActivity: Medium- and Heavy-Duty Trucks - activity_to_sector_mapping: EPA_GHGI_trucking - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333415' # purchases of refrigeration equipment - other_cooling: - selection_fields: - PrimaryActivity: - - School and Tour Buses - # - Transit Buses # crosswalk marks these as excluded; I'm not at all sure why - - Rail - - Ships and Boats - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333415' # purchases of refrigeration equipment - - EPA_GHGI_T_4_80: # PFCs from aluminum production - <<: *ghgi_parameters - selection_fields: - PrimaryActivity: Aluminum Production - attribution_method: direct - - EPA_GHGI_T_4_84: # HFCs, SF6, CO2 from magnesium production - <<: *ghgi_parameters - selection_fields: - PrimaryActivity: Magnesium Production and Processing - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: T008 # Gross output. - - BTS_Airlines: - selection_fields: - Year: *year - emissions_factors: BTS_Airlines_emissions_factors - fedefl_mapping: GHGI - activity_to_sector_mapping: EPA_GHGI - attribution_method: direct diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml deleted file mode 100644 index 7d7650b2b..000000000 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v1.yaml +++ /dev/null @@ -1,1024 +0,0 @@ -%YAML 1.1 - ---- -# m2 for the GHG national replicates the method used in the National GHG Industry Attribution Model -#(https://doi.org/10.23719/1517571), except that sector attribution is to 6-digit NAICS, -# rather than the BEA 2012 IO schema - -# !include:BEA_summary_target.yaml -industry_spec: - default: NAICS_3 - NAICS_4: ['336', '541'] - non_naics: ACC -# industry_spec: -# default: NAICS_4 -target_naics_year: 2012 -geoscale: national - -display_tables: - NAICS 2: - industry_spec: {default: NAICS_2} - replace_dict: - Industry: - '31': 31-33 - '32': 31-33 - '33': 31-33 - '44': 44-45 - '45': 44-45 - '48': 48-49 - '49': 48-49 - Pollutant: - C2F6: F-GHGs - C3F8: F-GHGs - CF4: F-GHGs - HFC, PFC and SF6 F-HTFs: F-GHGs - HFC-134a: F-GHGs - HFC-23: F-GHGs - HFCs: F-GHGs - HFCs and PFCs: F-GHGs - Total F-GHGs: F-GHGs - c-C4F8: F-GHGs - CO2: Carbon dioxide - CH4: Methane - N2O: Nitrous oxide - N2O[2]: Nitrous oxide - SF6: Sulfur hexafluoride - NF3: Nitrogen trifluoride - BEA Summary: - replace_dict: - Industry: - '111': 111CA - '112': 111CA - '113': 113FF - '114': 113FF - '115': 113FF - '211': '211' - '212': '212' - '213': '213' - '221': '22' - '236': '23' - '237': '23' - '238': '23' - '311': 311FT - '312': 311FT - '313': 313TT - '314': 313TT - '315': 315AL - '316': 315AL - '321': '321' - '322': '322' - '323': '323' - '324': '324' - '325': '325' - '326': '326' - '327': '327' - '331': '331' - '332': '332' - '333': '333' - '334': '334' - '335': '335' - '3361': 3361MV - '3362': 3361MV - '3363': 3361MV - '3364': 3364OT - '3365': 3364OT - '3366': 3364OT - '3369': 3364OT - '337': '337' - '339': '339' - '423': '42' - '424': '42' - '425': '42' - '441': '441' - '442': 4A0 - '443': 4A0 - '444': 4A0 - '445': '445' - '446': 4A0 - '447': 4A0 - '448': 4A0 - '451': 4A0 - '452': '452' - '453': 4A0 - '454': 4A0 - '481': '481' - '482': '482' - '483': '483' - '484': '484' - '485': '485' - '486': '486' - '487': 487OS - '488': 487OS - '491': GFE - '492': 487OS - '493': '493' - '511': '511' - '512': '512' - '515': '513' - '517': '513' - '518': '514' - '519': '514' - '521': 521CI - '522': 521CI - '523': '523' - '524': '524' - '525': '525' - '531': ORE - '532': 532RL - '533': 532RL - '5411': '5411' - '5412': 5412OP - '5413': 5412OP - '5414': 5412OP - '5415': '5415' - '5416': 5412OP - '5417': 5412OP - '5418': 5412OP - '5419': 5412OP - '551': '55' - '561': '561' - '562': '562' - '611': '61' - '621': '621' - '622': '622' - '623': '623' - '624': '624' - '711': 711AS - '712': 711AS - '713': '713' - '721': '721' - '722': '722' - '811': '81' - '812': '81' - '813': '81' - '814': '81' - '921': GFGN - '922': GFGN - '923': GFGN - '924': GFGN - '925': GFGN - '926': GFGN - '927': GFE - '928': GFGN - F01: PCE - S00: G - Pollutant: - C2F6: F-GHGs - C3F8: F-GHGs - CF4: F-GHGs - HFC, PFC and SF6 F-HTFs: F-GHGs - HFC-134a: F-GHGs - HFC-23: F-GHGs - HFCs: F-GHGs - HFCs and PFCs: F-GHGs - Total F-GHGs: F-GHGs - c-C4F8: F-GHGs - CO2: Carbon dioxide - CH4: Methane - N2O: Nitrous oxide - N2O[2]: Nitrous oxide - SF6: Sulfur hexafluoride - NF3: Nitrogen trifluoride - -_ghgi_parameters: &ghgi_parameters - geoscale: national - year: &year 2017 - -_attribution_sources: - BEA_Use_Detail_PRO_BeforeRedef: &bea_use - year: 2012 - activity_to_sector_mapping: BEA_2012_Detail - attribution_method: proportional - attribution_source: BLS_QCEW - EPA_GHGI_T_A_79: &t_a_79 - <<: *ghgi_parameters - attribution_method: proportional - attribution_source: BLS_QCEW - EIA_MECS_Energy: &mecs_energy - year: 2014 - selection_fields: &mecs_energy_default_selection - Class: Energy - Unit: Trillion Btu - clean_fba: !script_function:temp_data_source_functions clean_mecs_energy_fba_for_bea_summary - clean_fba_w_sec: !script_function:temp_data_source_functions clean_mapped_mecs_energy_fba_for_bea_summary - attribution_method: proportional # cleaning fxns remove need for proportional-flagged IF industry_spec is BEA summary - attribution_source: BLS_QCEW - USDA_CoA_Cropland_NAICS: &usda_pasture # allocated based on USDA Animal operation land (acres) - selection_fields: - Class: - - Land - FlowName: - - FARM OPERATIONS - year: 2017 - clean_fba: !script_function:temp_data_source_functions clean_usda_cropland_naics - USDA_CoA_Cropland: &usda_cropland - selection_fields: - Class: - - Land - FlowName: - - AREA HARVESTED - - AREA BEARING & NON-BEARING # Orchards - - AREA GROWN # Berry totals - - AREA IN PRODUCTION # Vegetable totals - year: 2017 - clean_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics - -sources_to_cache: - BLS_QCEW: - selection_fields: - Class: Employment - year: 2012 - clean_fba: !script_function:BLS_QCEW clean_qcew - BTS_TSA: - year: 2017 - selection_fields: - Description: - - In-house truck transportation - - For-hire truck transportation - activity_to_sector_mapping: BTS_TSA - attribution_method: proportional - attribution_source: BLS_QCEW - -source_names: - # stewiFBS: - # data_format: FBS_outside_flowsa - # FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector - # inventory_dict: {'NEI': '2017'} - # local_inventory_name: NEI_TRI_air_2017 - # selection_fields: # Remember GHGs should not be drawn from NEI - # Flowable: - # Particulate matter, ≤ 2.5μm: PM 2.5 - # compartments: - # - air - # reassign_process_to_sectors: - # - airplane_emissions - - EPA_GHGI_T_2_1: #U.S. GHG emissions - <<: *ghgi_parameters - activity_sets: - direct_attribution: - selection_fields: - PrimaryActivity: - - Iron and Steel Production & Metallurgical Coke Production #CO2, CH4 - - Cement Production #CO2 - - Lime Production #CO2 - - Ammonia Production #CO2 - - Incineration of Waste #CO2, #N2O - - Aluminum Production #CO2 - - Soda Ash Production #CO2 - - Ferroalloy Production #CO2, CH4 - - Titanium Dioxide Production #CO2 - - Zinc Production #CO2 - - Phosphoric Acid Production #CO2 - - Glass Production #CO2 - - Carbide Production and Consumption #CO2, CH4 - # - Landfills #CH4 - - Coal Mining #CH4 - - Wastewater Treatment #CH4, N2O - - Rice Cultivation #CH4 - - Abandoned Oil and Gas Wells #CH4 - - Abandoned Underground Coal Mines #CH4 - - Anaerobic Digestion at Biogas Facilities #CH4 new activity - - Composting #CH4, N2O - - Nitric Acid Production #N2O - - Adipic Acid Production #N2O - - Caprolactam, Glyoxal, and Glyoxylic Acid Production #CH4 - - Electronics Industry #N2O - FlowName: # HFCs and other flows are attributed elsewhere - - CO2 - - CH4 - - N2O - attribution_method: direct - - waste_decomposition: - selection_fields: - PrimaryActivity: Landfills - activity_to_sector_mapping: EPA_GHGI_SEEA - attribution_method: direct - - electric_distribution: - selection_fields: - PrimaryActivity: Electrical Transmission and Distribution #SF6 - FlowName: SF6 - attribution_method: direct - - liming: - selection_fields: - PrimaryActivity: Liming #CO2 - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '327400' - - urea: - selection_fields: - PrimaryActivity: - - Urea Fertilization #CO2 - - Urea Consumption for Non-Agricultural Purposes #CO2 - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '325310' # Fertilizers - - carbonate_use: - selection_fields: - PrimaryActivity: Other Process Uses of Carbonates #CO2 - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '325180' # Other Basic Inorganic Chemicals - - lead_production: - selection_fields: - PrimaryActivity: Lead Production #CO2 - attribution_method: proportional - attribution_source: - USGS_MYB_Lead: - year: 2016 - selection_fields: - ActivityProducedBy: - - Primary lead, refined content, domestic ores and base bullion - - Secondary lead, lead content - - nitrous_oxide_use: - selection_fields: - PrimaryActivity: N2O from Product Uses #N2O - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '325120' # Industrial gases - -## Fossil Fuels - EPA_GHGI_T_3_63: &natgas #CH4 from Natural Gas Systems - <<: *ghgi_parameters - selection_fields: - PrimaryActivity: - - Distribution - - Exploration - - Processing - - Production - - Transmission and Storage - attribution_method: direct - EPA_GHGI_T_3_65: *natgas #CO2 from Natural Gas Systems mimics CH4 - EPA_GHGI_T_3_67: *natgas #N2O from Natural Gas Systems, not used in original method, mimics CH4 - - EPA_GHGI_T_3_38: &petroleum #CH4 from Petroleum Systems - <<: *ghgi_parameters - selection_fields: - PrimaryActivity: - - Crude Oil Transportation - - Exploration - - Production - - Refining - attribution_method: direct - EPA_GHGI_T_3_40: *petroleum #CO2 from Petroleum Systems mimics CH4 - EPA_GHGI_T_3_42: *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 - -## Stationary Combustion (note that CO2 is electric power only) - EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion - <<: *ghgi_parameters - clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion - activity_sets: - direct_attribution: - selection_fields: - PrimaryActivity: - - Fuel Oil Residential - - Coal Residential - - Natural Gas Residential - - Wood Residential - attribution_method: direct - electric_power: &stationary_electric - selection_fields: - PrimaryActivity: - - Coal Electric Power - - Natural Gas Electric Power - - Natural gas Electric Power # note lower case - - Fuel Oil Electric Power - - Geothermal Electric Power - - Wood Electric Power - activity_to_sector_mapping: EPA_GHGI_m2 - attribution_method: direct - fuel_oil: - selection_fields: - PrimaryActivity: - - Fuel Oil Commercial - - Fuel Oil Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # purchases of refinery products - natural_gas: - selection_fields: - PrimaryActivity: - - Natural gas Commercial - - Natural gas Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '221200' # purchases of natural gas - coal: - selection_fields: - PrimaryActivity: Coal Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '212100' # purchases of coal - coal_manufacturing: - selection_fields: - PrimaryActivity: Coal Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Coal - natural_gas_manufacturing: - selection_fields: - PrimaryActivity: Natural gas Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Natural Gas - EPA_GHGI_T_3_9: # N2O emissions from stationary combustion - <<: *stationary_combustion - EPA_GHGI_T_3_7: # CO2 emissions from stationary combustion (electricity only) - <<: [*ghgi_parameters, *stationary_electric] - -# ## Agriculture - EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues - <<: *ghgi_parameters - attribution_method: direct - selection_fields: - PrimaryActivity: - - Chickpeas - - Cotton - - Maize - - Rice - - Soybeans - - Wheat - - EPA_GHGI_T_5_3: &animals #CH4 from Enteric Fermentation - <<: *ghgi_parameters - attribution_method: direct - selection_fields: - PrimaryActivity: - - American Bison - - Beef Cattle - - Dairy Cattle - - Goats - - Horses - - Mules and Asses - - Sheep - - Swine - - Poultry - EPA_GHGI_T_5_7: *animals #CH4 and N2O from manure, mimics enteric fermentation - - EPA_GHGI_T_5_18: #Direct N2O emissions from agricultural soils - <<: *ghgi_parameters - activity_sets: - fertilizer_use: &fertilizer # allocated based on fertilizer use - selection_fields: - PrimaryActivity: - - Organic Amendment Cropland - - Residue N Cropland - - Synthetic Fertilizer Cropland - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: - - '325310' - cropland: - selection_fields: - PrimaryActivity: - - Mineralization and Asymbiotic Fixation Cropland - - Drained Organic Soils Cropland - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland: - <<: *usda_cropland - pasture: &pasture - selection_fields: - PrimaryActivity: - - All activities Grassland - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland_NAICS: - <<: *usda_pasture - EPA_GHGI_T_5_19: #Indirect N2O emissions from agricultural soils - <<: *ghgi_parameters - activity_sets: - fertilizer_use: # allocated based on fertilizer use - <<: *fertilizer - selection_fields: - PrimaryActivity: - - Volatilization & Atm. Deposition Cropland - - Surface Leaching & Run-Off Cropland - pasture: - <<: *pasture - -## Mobile Sources (N20 and CH4) - EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion - <<: *ghgi_parameters - activity_sets: - direct_attribution: # Some of these need to be separated and attributed differently - selection_fields: - PrimaryActivity: - - Passenger Cars Gasoline On-Road - - Rail Non-Road - - Ships and Boats Non-Road - # - Aircraft Non-Road - attribution_method: direct - - trucking: - adjustment_factor: 0.99 - selection_fields: - PrimaryActivity: - - Light-Duty Trucks Gasoline On-Road - - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road - activity_to_sector_mapping: EPA_GHGI_SEEA - attribution_method: proportional - attribution_source: BTS_TSA - - construction_and_mining: - selection_fields: - PrimaryActivity: Construction/Mining Equipment Non-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333120' # purchases of construction/mining equipment - - farm_non_road: - selection_fields: - PrimaryActivity: Agricultural Equipment Non-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333111' # purchases of farm machinery - - other_non_road: # attributed by purchases of petroleum refinery products - selection_fields: - PrimaryActivity: Other Non-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # purchases of refinery products - - alt_fuel_on_road: # assumes natural gas is primary alternate fuel - selection_fields: - PrimaryActivity: - - All activities Alternative Fuel On-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '221200' # purchases of natural gas - EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 - -# Major CO2 Sources - EPA_GHGI_T_A_13: # (2017 specific table) CO2 emissions from stationary combustion and transportation - <<: *ghgi_parameters - clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion - activity_sets: - direct_attribution: - selection_fields: - PrimaryActivity: Total (All Fuels) Residential - attribution_method: direct - non-manufacturing_coal: - selection_fields: - PrimaryActivity: - - Commercial Coal Commercial - - Industrial Other Coal Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '212100' # purchases of coal - non-manufacturing_natural_gas: - selection_fields: - PrimaryActivity: - - Natural Gas Commercial - - Natural Gas Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '221200' # purchases of natural gas - non-manufacturing_petroleum: - selection_fields: - PrimaryActivity: - - Total Petroleum Commercial - - Total Petroleum Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # purchases of refinery products - manufacturing_coal: # Industrial Coal for Manufacturing - selection_fields: - PrimaryActivity: - - Industrial Other Coal Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Coal - manufacturing_natural_gas: # Industrial Natural Gas for manufacturing - selection_fields: - PrimaryActivity: - - Natural Gas Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Natural Gas - - ## Transportation - natural_gas_transportation: - selection_fields: - PrimaryActivity: Natural Gas Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - selection_fields: - FlowName: Natural Gas - - aviation_gas_transportation: - selection_fields: - PrimaryActivity: Aviation Gasoline Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - selection_fields: - FlowName: Aviation Gasoline - - # jet_fuel_transportation: - # selection_fields: - # PrimaryActivity: Jet Fuel Transportation - # attribution_method: proportional - # attribution_source: - # EPA_GHGI_T_A_79: - # <<: *t_a_79 - # selection_fields: - # FlowName: Jet Fuel - - propane_transportation: - selection_fields: - PrimaryActivity: LPG (Propane) Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - selection_fields: - FlowName: LPG - - residual_fuel_transportation: - selection_fields: - PrimaryActivity: Residual Fuel Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - selection_fields: - FlowName: Residual Fuel Oil - - distillate_fuel_transportation: - selection_fields: - PrimaryActivity: - - Distillate Fuel Oil Transportation - activity_to_sector_mapping: EPA_GHGI_SEEA - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - activity_to_sector_mapping: EPA_GHGI - activity_sets: - direct_attribution: - selection_fields: - FlowName: Distillate Fuel Oil (Diesel Fuel) - PrimaryActivity: - - Passenger Cars - - Rail - - Recreational Boats - - Ships and Non-Recreational Boats - attribution_method: direct - trucking: - adjustment_factor: 0.99 - selection_fields: - FlowName: Distillate Fuel Oil (Diesel Fuel) - PrimaryActivity: - - Light-Duty Trucks - - Medium- and Heavy-Duty Trucks - activity_to_sector_mapping: EPA_GHGI_SEEA - attribution_method: proportional - attribution_source: BTS_TSA - buses: - selection_fields: - FlowName: Distillate Fuel Oil (Diesel Fuel) - PrimaryActivity: Buses - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # use of petroleum products - - motor_gasoline_transportation: - selection_fields: - PrimaryActivity: - - Motor Gasoline Transportation - activity_to_sector_mapping: EPA_GHGI_SEEA - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - activity_to_sector_mapping: EPA_GHGI - activity_sets: - direct_attribution: - selection_fields: - FlowName: Motor Gasoline - PrimaryActivity: - - Passenger Cars - - Motorcycles - - Recreational Boats - attribution_method: direct - trucking: - adjustment_factor: 0.99 - selection_fields: - FlowName: Motor Gasoline - PrimaryActivity: - - Light-Duty Trucks - - Medium- and Heavy-Duty Trucks - activity_to_sector_mapping: EPA_GHGI_SEEA - attribution_method: proportional - attribution_source: BTS_TSA - buses: - selection_fields: - FlowName: Motor Gasoline - PrimaryActivity: Buses - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # use of petroleum products - -## Other sources - EPA_GHGI_T_4_46: #CO2 for selected petrochemicals - <<: *ghgi_parameters - selection_fields: - PrimaryActivity: - - Acrylonitrile - - Carbon Black - - Ethylene - - Ethylene Dichloride - - Ethylene Oxide - - Methanol - attribution_method: direct - - EPA_GHGI_T_3_22b: #Fossil fuel for non-energy uses - <<: *ghgi_parameters - activity_sets: - coal: - selection_fields: - PrimaryActivity: - - Industry Industrial Coking Coal - - Industry Industrial Other Coal - attribution_method: direct - - distillate_fuel_feedstocks: - selection_fields: - PrimaryActivity: Industry Distillate Fuel Oil - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: Distillate Fuel Oil - - hgl_feedstocks: - selection_fields: - PrimaryActivity: - - Industry LPG - - Industry Pentanes Plus - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: Hydrocarbon Gas Liquids, excluding natural gasoline - - petroleum_coke_feedstocks: - selection_fields: - PrimaryActivity: Industry Petroleum Coke - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: Coke and Breeze - - natural_gas_feedstocks: - selection_fields: - PrimaryActivity: - - Industry Still Gas - - Industry Natural Gas to Chemical Plants - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: Natural Gas - - other_petroleum_feedstocks: - selection_fields: - PrimaryActivity: - - Industry Asphalt & Road Oil - - Industry Lubricants - - Industry Miscellaneous Products - - Industry Naphtha (<401 F) - - Industry Other Oil (>401 F) - - Industry Special Naphtha - - Industry Waxes - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: Other - - transportation_lubricants: - selection_fields: - PrimaryActivity: Transportation Lubricants - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # use of petroleum products - - EPA_GHGI_T_4_50: # HFCs from HCFC-22 production - <<: *ghgi_parameters - selection_fields: - Unit: MMT CO2e - PrimaryActivity: HCFC-22 Production - attribution_method: direct - - EPA_GHGI_T_4_94: # HFCs and other emissions from electronics manufacture - <<: *ghgi_parameters - selection_fields: - FlowName: - SF6: SF6 - Total F-GHGs: HFCs and PFCs - NF3: NF3 - N2O[2]: N2O - attribution_method: direct - - EPA_GHGI_T_4_101: # HFCs and PFCs from ODS Substitutes - <<: *ghgi_parameters - clean_fba_before_activity_sets: !script_function:temp_data_source_functions clean_hfc_fba_for_seea # removes HFCs from transportation - activity_sets: - household_refrigeration: - selection_fields: - PrimaryActivity: Refrigeration/Air Conditioning - Households - attribution_method: direct - - non-household_refrigeration: - selection_fields: - PrimaryActivity: Refrigeration/Air Conditioning - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333415' # Air conditioning equipment - - polystyrene_foam: - selection_fields: - PrimaryActivity: Foams - Polystyrene - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '326140' # Polystyrene foam - - urethane_foam: - selection_fields: - PrimaryActivity: Foams - Urethane - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '326150' # Urethane and other foams. - - EPA_GHGI_T_A_103: # HFCs from Transportation - <<: *ghgi_parameters - # clean_fba_before_activity_sets: !script_function:EPA_GHGI split_hfcs_by_type - activity_sets: - passenger_cars: - selection_fields: - PrimaryActivity: Passenger Cars - attribution_method: direct - trucking: - selection_fields: - PrimaryActivity: - - Light-Duty Trucks - - Heavy-Duty Vehicles - adjustment_factor: 0.99 - activity_to_sector_mapping: EPA_GHGI_SEEA - attribution_method: proportional - attribution_source: BTS_TSA - refrigerated_trucks: - selection_fields: - PrimaryActivity: Medium- and Heavy-Duty Trucks - activity_to_sector_mapping: EPA_GHGI_SEEA - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333415' # purchases of refrigeration equipment - other_cooling: - selection_fields: - PrimaryActivity: - - School and Tour Buses - # - Transit Buses # crosswalk marks these as excluded; I'm not at all sure why - - Rail - - Ships and Boats - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333415' # purchases of refrigeration equipment - - EPA_GHGI_T_4_80: # PFCs from aluminum production - <<: *ghgi_parameters - selection_fields: - PrimaryActivity: Aluminum Production - attribution_method: direct - - EPA_GHGI_T_4_84: # HFCs, SF6, CO2 from magnesium production - <<: *ghgi_parameters - selection_fields: - PrimaryActivity: Magnesium Production and Processing - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: T008 # Gross output. - - BTS_Airlines: - year: null - selection_fields: - Year: *year - emissions_factors: EPA_emissions_factors - activity_to_sector_mapping: EPA_GHGI diff --git a/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml b/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml deleted file mode 100644 index 2def7d0d0..000000000 --- a/flowsa/methods/flowbysectormethods/SEEA_2017_v2.yaml +++ /dev/null @@ -1,1003 +0,0 @@ -%YAML 1.1 - ---- -# !include:BEA_summary_target.yaml -industry_spec: - default: NAICS_3 - NAICS_4: ['336', '541'] - non_naics: ACC -year: &year 2017 -# industry_spec: -# default: NAICS_4 -target_naics_year: 2012 -geoscale: national - -display_tables: - NAICS 2: - industry_spec: {default: NAICS_2} - replace_dict: - Industry: - '31': 31-33 - '32': 31-33 - '33': 31-33 - '44': 44-45 - '45': 44-45 - '48': 48-49 - '49': 48-49 - Pollutant: - C2F6: F-GHGs - C3F8: F-GHGs - CF4: F-GHGs - HFC, PFC and SF6 F-HTFs: F-GHGs - HFC-134a: F-GHGs - HFC-23: F-GHGs - HFCs: F-GHGs - HFCs and PFCs: F-GHGs - Total F-GHGs: F-GHGs - c-C4F8: F-GHGs - CO2: Carbon dioxide - CH4: Methane - N2O: Nitrous oxide - N2O[2]: Nitrous oxide - SF6: Sulfur hexafluoride - NF3: Nitrogen trifluoride - BEA Summary: - replace_dict: - Industry: - '111': 111CA - '112': 111CA - '113': 113FF - '114': 113FF - '115': 113FF - '211': '211' - '212': '212' - '213': '213' - '221': '22' - '236': '23' - '237': '23' - '238': '23' - '311': 311FT - '312': 311FT - '313': 313TT - '314': 313TT - '315': 315AL - '316': 315AL - '321': '321' - '322': '322' - '323': '323' - '324': '324' - '325': '325' - '326': '326' - '327': '327' - '331': '331' - '332': '332' - '333': '333' - '334': '334' - '335': '335' - '3361': 3361MV - '3362': 3361MV - '3363': 3361MV - '3364': 3364OT - '3365': 3364OT - '3366': 3364OT - '3369': 3364OT - '337': '337' - '339': '339' - '423': '42' - '424': '42' - '425': '42' - '441': '441' - '442': 4A0 - '443': 4A0 - '444': 4A0 - '445': '445' - '446': 4A0 - '447': 4A0 - '448': 4A0 - '451': 4A0 - '452': '452' - '453': 4A0 - '454': 4A0 - '481': '481' - '482': '482' - '483': '483' - '484': '484' - '485': '485' - '486': '486' - '487': 487OS - '488': 487OS - '491': GFE - '492': 487OS - '493': '493' - '511': '511' - '512': '512' - '515': '513' - '517': '513' - '518': '514' - '519': '514' - '521': 521CI - '522': 521CI - '523': '523' - '524': '524' - '525': '525' - '531': ORE - '532': 532RL - '533': 532RL - '5411': '5411' - '5412': 5412OP - '5413': 5412OP - '5414': 5412OP - '5415': '5415' - '5416': 5412OP - '5417': 5412OP - '5418': 5412OP - '5419': 5412OP - '551': '55' - '561': '561' - '562': '562' - '611': '61' - '621': '621' - '622': '622' - '623': '623' - '624': '624' - '711': 711AS - '712': 711AS - '713': '713' - '721': '721' - '722': '722' - '811': '81' - '812': '81' - '813': '81' - '814': '81' - '921': GFGN - '922': GFGN - '923': GFGN - '924': GFGN - '925': GFGN - '926': GFGN - '927': GFE - '928': GFGN - F01: PCE - S00: G - Pollutant: - C2F6: F-GHGs - C3F8: F-GHGs - CF4: F-GHGs - HFC, PFC and SF6 F-HTFs: F-GHGs - HFC-134a: F-GHGs - HFC-23: F-GHGs - HFCs: F-GHGs - HFCs and PFCs: F-GHGs - Total F-GHGs: F-GHGs - c-C4F8: F-GHGs - CO2: Carbon dioxide - CH4: Methane - N2O: Nitrous oxide - N2O[2]: Nitrous oxide - SF6: Sulfur hexafluoride - NF3: Nitrogen trifluoride - -_attribution_sources: - BEA_Use_Detail_PRO_BeforeRedef: &bea_use - year: 2012 - activity_to_sector_mapping: BEA_2012_Detail - attribution_method: proportional - attribution_source: BLS_QCEW - EPA_GHGI_T_A_79: &t_a_79 - attribution_method: proportional - attribution_source: BLS_QCEW - EIA_MECS_Energy: &mecs_energy - year: 2014 - selection_fields: &mecs_energy_default_selection - Class: Energy - Unit: Trillion Btu - clean_fba: !script_function:temp_data_source_functions clean_mecs_energy_fba_for_bea_summary - clean_fba_w_sec: !script_function:temp_data_source_functions clean_mapped_mecs_energy_fba_for_bea_summary - attribution_method: proportional # cleaning fxns remove need for proportional-flagged IF industry_spec is BEA summary - attribution_source: BLS_QCEW - USDA_CoA_Cropland_NAICS: &usda_pasture # allocated based on USDA Animal operation land (acres) - selection_fields: - Class: - - Land - FlowName: - - FARM OPERATIONS - year: 2017 - clean_fba: !script_function:temp_data_source_functions clean_usda_cropland_naics - USDA_CoA_Cropland: &usda_cropland - selection_fields: - Class: - - Land - FlowName: - - AREA HARVESTED - - AREA BEARING & NON-BEARING # Orchards - - AREA GROWN # Berry totals - - AREA IN PRODUCTION # Vegetable totals - year: 2017 - clean_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics - BTS_TSA: &bts_tsa - year: 2017 - selection_fields: - Description: - - In-house truck transportation - - For-hire truck transportation - activity_to_sector_mapping: BTS_TSA - attribution_method: proportional - attribution_source: BLS_QCEW - -sources_to_cache: - BLS_QCEW: - selection_fields: - Class: Employment - year: 2012 - clean_fba: !script_function:BLS_QCEW clean_qcew - -source_names: - # stewiFBS: - # data_format: FBS_outside_flowsa - # FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector - # inventory_dict: {'NEI': '2017'} - # local_inventory_name: NEI_TRI_air_2017 - # selection_fields: # Remember GHGs should not be drawn from NEI - # Flowable: - # Particulate matter, ≤ 2.5μm: PM 2.5 - # compartments: - # - air - # reassign_process_to_sectors: - # - airplane_emissions - - EPA_GHGI_T_2_1: #U.S. GHG emissions - activity_sets: - direct_attribution: - selection_fields: - PrimaryActivity: - - Iron and Steel Production & Metallurgical Coke Production #CO2, CH4 - - Cement Production #CO2 - - Lime Production #CO2 - - Ammonia Production #CO2 - - Incineration of Waste #CO2, #N2O - - Aluminum Production #CO2 - - Soda Ash Production #CO2 - - Ferroalloy Production #CO2, CH4 - - Titanium Dioxide Production #CO2 - - Zinc Production #CO2 - - Phosphoric Acid Production #CO2 - - Glass Production #CO2 - - Carbide Production and Consumption #CO2, CH4 - # - Landfills #CH4 - - Coal Mining #CH4 - - Wastewater Treatment #CH4, N2O - - Rice Cultivation #CH4 - - Abandoned Oil and Gas Wells #CH4 - - Abandoned Underground Coal Mines #CH4 - - Anaerobic Digestion at Biogas Facilities #CH4 new activity - - Composting #CH4, N2O - - Nitric Acid Production #N2O - - Adipic Acid Production #N2O - - Caprolactam, Glyoxal, and Glyoxylic Acid Production #CH4 - - Electronics Industry #N2O - FlowName: # HFCs and other flows are attributed elsewhere - - CO2 - - CH4 - - N2O - attribution_method: direct - - waste_decomposition: - selection_fields: - PrimaryActivity: Landfills - activity_to_sector_mapping: EPA_GHGI_SEEA - attribution_method: direct - - electric_distribution: - selection_fields: - PrimaryActivity: Electrical Transmission and Distribution #SF6 - FlowName: SF6 - attribution_method: direct - - liming: - selection_fields: - PrimaryActivity: Liming #CO2 - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '327400' - - urea: - selection_fields: - PrimaryActivity: - - Urea Fertilization #CO2 - - Urea Consumption for Non-Agricultural Purposes #CO2 - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '325310' # Fertilizers - - carbonate_use: - selection_fields: - PrimaryActivity: Other Process Uses of Carbonates #CO2 - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '325180' # Other Basic Inorganic Chemicals - - lead_production: - selection_fields: - PrimaryActivity: Lead Production #CO2 - attribution_method: proportional - attribution_source: - USGS_MYB_Lead: - year: 2016 - selection_fields: - ActivityProducedBy: - - Primary lead, refined content, domestic ores and base bullion - - Secondary lead, lead content - - nitrous_oxide_use: - selection_fields: - PrimaryActivity: N2O from Product Uses #N2O - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '325120' # Industrial gases - -## Fossil Fuels - EPA_GHGI_T_3_63: &natgas #CH4 from Natural Gas Systems - selection_fields: - PrimaryActivity: - - Distribution - - Exploration - - Processing - - Production - - Transmission and Storage - attribution_method: direct - EPA_GHGI_T_3_65: *natgas #CO2 from Natural Gas Systems mimics CH4 - EPA_GHGI_T_3_67: *natgas #N2O from Natural Gas Systems, not used in original method, mimics CH4 - - EPA_GHGI_T_3_38: &petroleum #CH4 from Petroleum Systems - selection_fields: - PrimaryActivity: - - Crude Oil Transportation - - Exploration - - Production - - Refining - attribution_method: direct - EPA_GHGI_T_3_40: *petroleum #CO2 from Petroleum Systems mimics CH4 - EPA_GHGI_T_3_42: *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 - -# ## Agriculture - EPA_GHGI_T_5_29: #CH4, N2O, CO and NOx from field burning of residues - selection_fields: - PrimaryActivity: - - Chickpeas - - Cotton - - Maize - - Rice - - Soybeans - - Wheat - attribution_method: direct - - EPA_GHGI_T_5_3: &animals #CH4 from Enteric Fermentation - selection_fields: - PrimaryActivity: - - American Bison - - Beef Cattle - - Dairy Cattle - - Goats - - Horses - - Mules and Asses - - Sheep - - Swine - - Poultry - attribution_method: direct - EPA_GHGI_T_5_7: *animals #CH4 and N2O from manure, mimics enteric fermentation - - EPA_GHGI_T_5_18: #Direct N2O emissions from agricultural soils - activity_sets: - fertilizer_use: &fertilizer # allocated based on fertilizer use - selection_fields: - PrimaryActivity: - - Organic Amendment Cropland - - Residue N Cropland - - Synthetic Fertilizer Cropland - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: - - '325310' - cropland: - selection_fields: - PrimaryActivity: - - Mineralization and Asymbiotic Fixation Cropland - - Drained Organic Soils Cropland - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland: - <<: *usda_cropland - pasture: &pasture - selection_fields: - PrimaryActivity: - - All activities Grassland - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland_NAICS: - <<: *usda_pasture - EPA_GHGI_T_5_19: #Indirect N2O emissions from agricultural soils - activity_sets: - fertilizer_use: # allocated based on fertilizer use - <<: *fertilizer - selection_fields: - PrimaryActivity: - - Volatilization & Atm. Deposition Cropland - - Surface Leaching & Run-Off Cropland - pasture: - <<: *pasture - -## Mobile Sources (N2O and CH4) - EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion - activity_sets: - direct_attribution: # Some of these need to be separated and attributed differently - selection_fields: - PrimaryActivity: - - Passenger Cars Gasoline On-Road - - Rail Non-Road - - Ships and Boats Non-Road - # - Aircraft Non-Road - attribution_method: direct - - trucking: - adjustment_factor: 0.99 - selection_fields: - PrimaryActivity: - - Light-Duty Trucks Gasoline On-Road - - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road - activity_to_sector_mapping: EPA_GHGI_SEEA - attribution_method: proportional - attribution_source: - BTS_TSA: *bts_tsa - - construction_and_mining: - selection_fields: - PrimaryActivity: Construction/Mining Equipment Non-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333120' # purchases of construction/mining equipment - - farm_non_road: - selection_fields: - PrimaryActivity: Agricultural Equipment Non-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333111' # purchases of farm machinery - - other_non_road: # attributed by purchases of petroleum refinery products - selection_fields: - PrimaryActivity: Other Non-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # purchases of refinery products - - alt_fuel_on_road: # assumes natural gas is primary alternate fuel - selection_fields: - PrimaryActivity: - - All activities Alternative Fuel On-Road - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '221200' # purchases of natural gas - EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 - -# Major CO2 Sources - EPA_GHGI_T_A_13: # (2017 specific table) CO2 emissions from stationary combustion and transportation - clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion - activity_sets: - direct_attribution: - selection_fields: - PrimaryActivity: Total (All Fuels) Residential - attribution_method: direct - non-manufacturing_coal: - selection_fields: - PrimaryActivity: - - Commercial Coal Commercial - - Industrial Other Coal Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '212100' # purchases of coal - non-manufacturing_natural_gas: - selection_fields: - PrimaryActivity: - - Natural Gas Commercial - - Natural Gas Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '221200' # purchases of natural gas - non-manufacturing_petroleum: - selection_fields: - PrimaryActivity: - - Total Petroleum Commercial - - Total Petroleum Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # purchases of refinery products - manufacturing_coal: # Industrial Coal for Manufacturing - selection_fields: - PrimaryActivity: - - Industrial Other Coal Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Coal - manufacturing_natural_gas: # Industrial Natural Gas for manufacturing - selection_fields: - PrimaryActivity: - - Natural Gas Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Natural Gas - - ## Transportation - natural_gas_transportation: - selection_fields: - PrimaryActivity: Natural Gas Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - selection_fields: - FlowName: Natural Gas - - aviation_gas_transportation: - selection_fields: - PrimaryActivity: Aviation Gasoline Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - selection_fields: - FlowName: Aviation Gasoline - - # jet_fuel_transportation: - # selection_fields: - # PrimaryActivity: Jet Fuel Transportation - # attribution_method: proportional - # attribution_source: - # EPA_GHGI_T_A_79: - # <<: *t_a_79 - # selection_fields: - # FlowName: Jet Fuel - - propane_transportation: - selection_fields: - PrimaryActivity: LPG (Propane) Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - selection_fields: - FlowName: LPG - - residual_fuel_transportation: - selection_fields: - PrimaryActivity: Residual Fuel Transportation - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - selection_fields: - FlowName: Residual Fuel Oil - - distillate_fuel_transportation: - selection_fields: - PrimaryActivity: - - Distillate Fuel Oil Transportation - activity_to_sector_mapping: EPA_GHGI_SEEA - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - activity_to_sector_mapping: EPA_GHGI - activity_sets: - direct_attribution: - selection_fields: - FlowName: Distillate Fuel Oil (Diesel Fuel) - PrimaryActivity: - - Passenger Cars - - Rail - - Recreational Boats - - Ships and Non-Recreational Boats - attribution_method: direct - trucking: - adjustment_factor: 0.99 - # ^^^ This is wrong. As is, it's just shifting attribution toward other transportation modes rather than making a true residency adjustment - selection_fields: - FlowName: Distillate Fuel Oil (Diesel Fuel) - PrimaryActivity: - - Light-Duty Trucks - - Medium- and Heavy-Duty Trucks - activity_to_sector_mapping: EPA_GHGI_SEEA - attribution_method: proportional - attribution_source: - BTS_TSA: *bts_tsa - buses: - selection_fields: - FlowName: Distillate Fuel Oil (Diesel Fuel) - PrimaryActivity: Buses - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # use of petroleum products - - motor_gasoline_transportation: - selection_fields: - PrimaryActivity: - - Motor Gasoline Transportation - activity_to_sector_mapping: EPA_GHGI_SEEA - attribution_method: proportional - attribution_source: - EPA_GHGI_T_A_79: - <<: *t_a_79 - activity_to_sector_mapping: EPA_GHGI - activity_sets: - direct_attribution: - selection_fields: - FlowName: Motor Gasoline - PrimaryActivity: - - Passenger Cars - - Motorcycles - - Recreational Boats - attribution_method: direct - trucking: - adjustment_factor: 0.99 - selection_fields: - FlowName: Motor Gasoline - PrimaryActivity: - - Light-Duty Trucks - - Medium- and Heavy-Duty Trucks - activity_to_sector_mapping: EPA_GHGI_SEEA - attribution_method: proportional - attribution_source: - BTS_TSA: *bts_tsa - buses: - selection_fields: - FlowName: Motor Gasoline - PrimaryActivity: Buses - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # use of petroleum products - -# ## Stationary Combustion (note that CO2 is electric power only) - EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion - clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion - activity_sets: - direct_attribution: - selection_fields: - PrimaryActivity: - - Fuel Oil Residential - - Coal Residential - - Natural Gas Residential - - Wood Residential - attribution_method: direct - electric_power: &stationary_electric - selection_fields: - PrimaryActivity: - - Coal Electric Power - - Natural Gas Electric Power - - Natural gas Electric Power # note lower case - - Fuel Oil Electric Power - - Geothermal Electric Power - - Wood Electric Power - activity_to_sector_mapping: EPA_GHGI_m2 - attribution_method: direct - fuel_oil: - selection_fields: - PrimaryActivity: - - Fuel Oil Commercial - - Fuel Oil Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # purchases of refinery products - natural_gas: - selection_fields: - PrimaryActivity: - - Natural gas Commercial - - Natural gas Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '221200' # purchases of natural gas - coal: - selection_fields: - PrimaryActivity: Coal Industrial - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '212100' # purchases of coal - coal_manufacturing: - selection_fields: - PrimaryActivity: Coal Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Coal - natural_gas_manufacturing: - selection_fields: - PrimaryActivity: Natural gas Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Natural Gas - EPA_GHGI_T_3_9: # N2O emissions from stationary combustion - <<: *stationary_combustion - EPA_GHGI_T_3_7: # CO2 emissions from stationary combustion (electricity only) - <<: *stationary_electric - -## Other sources - EPA_GHGI_T_4_46: #CO2 for selected petrochemicals - selection_fields: - PrimaryActivity: - - Acrylonitrile - - Carbon Black - - Ethylene - - Ethylene Dichloride - - Ethylene Oxide - - Methanol - attribution_method: direct - - EPA_GHGI_T_3_22b: #Fossil fuel for non-energy uses - activity_sets: - coal: - selection_fields: - PrimaryActivity: - - Industry Industrial Coking Coal - - Industry Industrial Other Coal - attribution_method: direct - - distillate_fuel_feedstocks: - selection_fields: - PrimaryActivity: Industry Distillate Fuel Oil - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: Distillate Fuel Oil - - hgl_feedstocks: - selection_fields: - PrimaryActivity: - - Industry LPG - - Industry Pentanes Plus - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: Hydrocarbon Gas Liquids, excluding natural gasoline - - petroleum_coke_feedstocks: - selection_fields: - PrimaryActivity: Industry Petroleum Coke - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: Coke and Breeze - - natural_gas_feedstocks: - selection_fields: - PrimaryActivity: - - Industry Still Gas - - Industry Natural Gas to Chemical Plants - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: Natural Gas - - other_petroleum_feedstocks: - selection_fields: - PrimaryActivity: - - Industry Asphalt & Road Oil - - Industry Lubricants - - Industry Miscellaneous Products - - Industry Naphtha (<401 F) - - Industry Other Oil (>401 F) - - Industry Special Naphtha - - Industry Waxes - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: Other - - transportation_lubricants: - selection_fields: - PrimaryActivity: Transportation Lubricants - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '324110' # use of petroleum products - - EPA_GHGI_T_4_50: # HFCs from HCFC-22 production - selection_fields: - Unit: MMT CO2e - PrimaryActivity: HCFC-22 Production - attribution_method: direct - - EPA_GHGI_T_4_94: # HFCs and other emissions from electronics manufacture - selection_fields: - FlowName: - SF6: SF6 - Total F-GHGs: HFCs and PFCs - NF3: NF3 - N2O[2]: N2O - attribution_method: direct - - EPA_GHGI_T_4_101: # HFCs and PFCs from ODS Substitutes - clean_fba_before_activity_sets: !script_function:temp_data_source_functions clean_hfc_fba_for_seea # removes HFCs from transportation - activity_sets: - household_refrigeration: - selection_fields: - PrimaryActivity: Refrigeration/Air Conditioning - Households - attribution_method: direct - - non-household_refrigeration: - selection_fields: - PrimaryActivity: Refrigeration/Air Conditioning - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333415' # Air conditioning equipment - - polystyrene_foam: - selection_fields: - PrimaryActivity: Foams - Polystyrene - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '326140' # Polystyrene foam - - urethane_foam: - selection_fields: - PrimaryActivity: Foams - Urethane - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '326150' # Urethane and other foams. - - EPA_GHGI_T_A_103: # HFCs from Transportation - # clean_fba_before_activity_sets: !script_function:EPA_GHGI split_hfcs_by_type - activity_sets: - passenger_cars: - selection_fields: - PrimaryActivity: Passenger Cars - attribution_method: direct - trucking: - selection_fields: - PrimaryActivity: - - Light-Duty Trucks - - Heavy-Duty Vehicles - adjustment_factor: 0.99 - activity_to_sector_mapping: EPA_GHGI_SEEA - attribution_method: proportional - attribution_source: - BTS_TSA: *bts_tsa - refrigerated_trucks: - selection_fields: - PrimaryActivity: Medium- and Heavy-Duty Trucks - activity_to_sector_mapping: EPA_GHGI_SEEA - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333415' # purchases of refrigeration equipment - other_cooling: - selection_fields: - PrimaryActivity: - - School and Tour Buses - # - Transit Buses # crosswalk marks these as excluded; I'm not at all sure why - - Rail - - Ships and Boats - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: '333415' # purchases of refrigeration equipment - - EPA_GHGI_T_4_80: # PFCs from aluminum production - selection_fields: - PrimaryActivity: Aluminum Production - attribution_method: direct - - EPA_GHGI_T_4_84: # HFCs, SF6, CO2 from magnesium production - selection_fields: - PrimaryActivity: Magnesium Production and Processing - attribution_method: proportional - attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - <<: *bea_use - selection_fields: - ActivityProducedBy: T008 # Gross output. - - BTS_Airlines: - year: null - selection_fields: - Year: *year - emissions_factors: EPA_emissions_factors - activity_to_sector_mapping: EPA_GHGI From f5060c85a8cda7cd0a2f41865ec62dddfc996774 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 14 Jul 2023 10:32:57 -0600 Subject: [PATCH 0688/1127] 7/11/23 - prop_att --- flowsa/validation.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/flowsa/validation.py b/flowsa/validation.py index d17d87cdc..ffbdba2e9 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -598,7 +598,6 @@ def compare_FBS_results(fbs1, fbs2, ignore_metasources=False, df1 = flowsa.getFlowBySector(fbs1, download_FBS_if_missing=compare_to_remote ).rename(columns={'FlowAmount': 'FlowAmount_fbs1'}) - df1 = replace_strings_with_NoneType(df1) # load second file if compare_to_remote: # Generate the FBS locally and then immediately load @@ -608,21 +607,19 @@ def compare_FBS_results(fbs1, fbs2, ignore_metasources=False, else: df2 = flowsa.getFlowBySector(fbs2).rename( columns={'FlowAmount': 'FlowAmount_fbs2'}) - df2 = replace_strings_with_NoneType(df2) # compare df merge_cols = [c for c in df2.select_dtypes(include=[ 'object', 'int']).columns if c not in dq_fields] if ignore_metasources: - for e in ['MetaSources', 'AttributionSources']: + # todo: update this list + for e in ['MetaSources', 'AttributionSources', 'SourceName', + 'SectorSourceName', 'ProducedBySectorType', + 'ConsumedBySectorType', 'Unit_other', 'AllocationSources', + 'FlowName']: try: merge_cols.remove(e) except ValueError: pass - # todo: remove merge_col edit once the added columns from DataVis branch - # are pulled into master 12/1/22 - # ignore additional columns on merge if they do not exist in first - # dataframe (version on Data commons if comparing to remote) - merge_cols = [e for e in merge_cols if e in df1.columns] # aggregate dfs before merge - might have duplicate sectors due to # dropping metasources/attribution sources @@ -630,8 +627,16 @@ def compare_FBS_results(fbs1, fbs2, ignore_metasources=False, .agg({'FlowAmount_fbs1': 'sum'}).reset_index()) df2 = (df2.groupby(merge_cols, dropna=False) .agg({'FlowAmount_fbs2': 'sum'}).reset_index()) + # convert sector columns to object to avoid valueErrors + cols = ['SectorProducedBy', 'SectorConsumedBy'] + for c in cols: + df1[c] = df1[c].astype(str) + df2[c] = df2[c].astype(str) + for c in ['SectorSourceName']: + df1 = df1.drop(columns=c, errors='ignore') + df2 = df2.drop(columns=c, errors='ignore') # check units - compare_df_units(df1, df2) + # compare_df_units(df1, df2) df_m = pd.DataFrame( pd.merge(df1[merge_cols + ['FlowAmount_fbs1']], df2[merge_cols + ['FlowAmount_fbs2']], From 506cb8f01ca371ef5b8a2bf7fe9785540d981cd5 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 14 Jul 2023 11:34:04 -0600 Subject: [PATCH 0689/1127] don't specify number of splits --- flowsa/flowby.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 34dbad55d..0eb5dd56b 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1145,8 +1145,8 @@ def multiplication_attribution( rate = 'Unit_other' other = 'Unit' if rate is not None: - fb['Denominator'] = fb[rate].str.split("/",1).str[1] - fb[rate] = fb[rate].str.split("/",1).str[0] + fb['Denominator'] = fb[rate].str.split("/").str[1] + fb[rate] = fb[rate].str.split("/").str[0] if fb[other].equals(fb['Denominator']) is False: log.warning('Check units being multiplied') else: From f401833b61ed2f2b95239768907fdf9174e4d0d6 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sun, 16 Jul 2023 22:31:01 -0400 Subject: [PATCH 0690/1127] fix error causing sectors to not be assigned to stewi datasets --- flowsa/flowby.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 0eb5dd56b..d90882746 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -632,7 +632,7 @@ def attribute_flows_to_sectors( if len(grouped) == 0: log.warning(f'No data remaining in {self.full_name}.') return self - if self.config['data_format'] == 'FBA': + if self.config['data_format'] in ['FBA', 'FBS_outside_flowsa']: fb: 'FlowByActivity' = ( grouped .map_to_sectors(external_config_path=external_config_path) @@ -641,7 +641,7 @@ def attribute_flows_to_sectors( method=self.config) .rename(columns={'SourceName': 'MetaSources'}) ) - elif self.config['data_format'] in ['FBS', 'FBS_outside_flowsa']: + elif self.config['data_format'] in ['FBS']: fb = grouped.copy() # subset the fb configuration so it only includes the From 80aab0681ba2027d749552d0aa73a786b6b6fbea Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 17 Jul 2023 10:44:11 -0400 Subject: [PATCH 0691/1127] update CNHW_state to use new flowbyclean fxn --- flowsa/flowbyclean.py | 15 ++++++++++----- .../flowbysectormethods/CNHW_state_2014.yaml | 14 +++++++++++--- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index 5223bcc4f..26ab3f234 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -26,8 +26,10 @@ def return_primary_activity_column(fba: FlowByActivity) -> \ def load_prepare_clean_source( self: 'FB', download_sources_ok: bool = True -) -> 'FB': - + ) -> 'FB': + """ + Add doc string + """ try: (name, config), = self.config['clean_source'].items() except AttributeError: @@ -49,7 +51,7 @@ def weighted_average( fba: 'FlowByActivity', download_sources_ok: bool = True, **kwargs -) -> 'FlowByActivity': + ) -> 'FlowByActivity': """ This method determines weighted average """ @@ -118,7 +120,7 @@ def substitute_nonexistent_values( fb: 'FB', download_sources_ok: bool = True, **kwargs -) -> 'FB': + ) -> 'FB': """ Fill missing values with data from another geoscale """ @@ -331,7 +333,7 @@ def calculate_flow_per_employee( fbs: 'FlowBySector', download_sources_ok: bool = True, **_ -) -> 'FlowBySector': + ) -> 'FlowBySector': """ Calculates FlowAmount per employee per year based on dataset name passed in "clean_parameter" @@ -341,6 +343,9 @@ def calculate_flow_per_employee( download_sources_ok=download_sources_ok) cols = ['Location', 'Year', 'SectorProducedBy'] fbs = (fbs + .sector_aggregation() + .aggregate_flowby() + # ^^ handles updated industry specs .merge(bls .rename(columns={'FlowAmount': 'Employees'}) .groupby(cols).agg({'Employees': 'sum'}) diff --git a/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml b/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml index 12fcf65e6..dedec3d27 100644 --- a/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml @@ -1,11 +1,19 @@ +# National Commercial Non-Haz Waste (CNHW) FBS for 2014 +# Extrapolates 2014 California data using employment data + !include:USEEIO_summary_target.yaml year: 2014 geoscale: state source_names: CNHW_CA_2014: - data_format: FBS - clean_fbs: !script_function:CalRecycle_WasteCharacterization apply_tons_per_employee_per_year_to_states - year: 2014 + clean_fbs: !clean_function:flowbyclean calculate_flow_per_employee + clean_source: + Employment_state_2014: + geoscale: state + attribution_method: multiplication + attribution_source: + Employment_state_2014: + geoscale: state From 1d43af69ef25dad1140d5603a8376b42b95070c4 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 17 Jul 2023 09:25:13 -0600 Subject: [PATCH 0692/1127] add cnhw_state to source_catalog --- flowsa/data/source_catalog.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 106a7a593..0f17b9e3e 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -117,6 +117,8 @@ CNHW_CA: data_format: FBS CNHW_national: data_format: FBS +CNHW_state: + data_format: FBS EIA_AEO: data_format: FBA class: From 97ccbb25455cee3c953b582e7830de4b43667853 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 17 Jul 2023 09:26:27 -0600 Subject: [PATCH 0693/1127] add option to specify attribute_on cols and fill_columns for attribution method "multiplication" --- flowsa/flowby.py | 21 +++++++++++++++---- .../flowbysectormethods/CNHW_state_2014.yaml | 6 +++--- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index d90882746..080968b16 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1101,18 +1101,31 @@ def multiplication_attribution( fb_geoscale, other_geoscale, fb, other = self.harmonize_geoscale( other) + if self.config['attribute_on'] is not None: + left_merge = self.config['attribute_on'] + right_merge = self.config['attribute_on'] + else: + left_merge = ['PrimarySector', 'temp_location' + if 'temp_location' in fb + else 'Location'] + right_merge = ['PrimarySector', 'Location'] + # multiply using each dfs primary sector col merged = (fb .merge(other, how='left', - left_on=['PrimarySector', 'temp_location' - if 'temp_location' in fb - else 'Location'], - right_on=['PrimarySector', 'Location'], + left_on=left_merge, + right_on=right_merge, suffixes=[None, '_other']) .fillna({'FlowAmount_other': 0}) ) + fill_col = self.config.get('fill_columns') + if fill_col is not None: + log.info(f'Replacing {fill_col} values in primary data source ' + f'with those from attribution source.') + merged[fill_col] = merged[f'{fill_col}_other'] + fb = (merged .assign(FlowAmount=lambda x: (x.FlowAmount * x.FlowAmount_other)) diff --git a/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml b/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml index dedec3d27..c601044b6 100644 --- a/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml @@ -8,10 +8,10 @@ geoscale: state source_names: CNHW_CA_2014: clean_fbs: !clean_function:flowbyclean calculate_flow_per_employee - clean_source: - Employment_state_2014: - geoscale: state + clean_source: Employment_state_2014 attribution_method: multiplication + attribute_on: ['SectorProducedBy'] + fill_columns: Location attribution_source: Employment_state_2014: geoscale: state From fc32085225fc47d6a5fce22d265126623112393b Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 17 Jul 2023 09:37:50 -0600 Subject: [PATCH 0694/1127] fix key error caused by returning config parameter --- flowsa/flowby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 080968b16..4351f903e 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1101,7 +1101,7 @@ def multiplication_attribution( fb_geoscale, other_geoscale, fb, other = self.harmonize_geoscale( other) - if self.config['attribute_on'] is not None: + if self.config.get('attribute_on') is not None: left_merge = self.config['attribute_on'] right_merge = self.config['attribute_on'] else: From ce810989567358e8309d765d09bacd6b3fd8f83e Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 17 Jul 2023 09:59:13 -0600 Subject: [PATCH 0695/1127] delete additional methods that will not be published with flowsav2.0 - electricity_gen, ghgrp_2019, marine_shipping_adjustment --- ...ectricity_gen_emissions_national_2016.yaml | 7 --- .../flowbysectormethods/GHGRP_2019.yaml | 15 ------ .../marine_shipping_adjustment.yaml | 47 ------------------- flowsa/methods/method_status.yaml | 11 ----- flowsa/test_FBS_against_remote.py | 20 ++------ 5 files changed, 5 insertions(+), 95 deletions(-) delete mode 100644 flowsa/methods/flowbysectormethods/Electricity_gen_emissions_national_2016.yaml delete mode 100644 flowsa/methods/flowbysectormethods/GHGRP_2019.yaml delete mode 100644 flowsa/methods/flowbysectormethods/marine_shipping_adjustment.yaml diff --git a/flowsa/methods/flowbysectormethods/Electricity_gen_emissions_national_2016.yaml b/flowsa/methods/flowbysectormethods/Electricity_gen_emissions_national_2016.yaml deleted file mode 100644 index e2dcf7e03..000000000 --- a/flowsa/methods/flowbysectormethods/Electricity_gen_emissions_national_2016.yaml +++ /dev/null @@ -1,7 +0,0 @@ -target_sector_level: NAICS_6 -target_sector_source: NAICS_2012_Code -target_geoscale: national -source_names: - "elciFBS": - data_format: 'FBS_outside_flowsa' - FBS_datapull_fxn: !script_function:elciFBS get_elci_emissions diff --git a/flowsa/methods/flowbysectormethods/GHGRP_2019.yaml b/flowsa/methods/flowbysectormethods/GHGRP_2019.yaml deleted file mode 100644 index f386aa440..000000000 --- a/flowsa/methods/flowbysectormethods/GHGRP_2019.yaml +++ /dev/null @@ -1,15 +0,0 @@ -industry_spec: - default: NAICS_6 -target_naics_year: 2012 -year: 2019 -geoscale: state -source_names: - stewiFBS: - data_format: FBS_outside_flowsa - FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector - # Below are arguments needed by the stewicombo_to_sector function - inventory_dict: - GHGRP: 2019 - local_inventory_name: GHGRP_2019 - compartments: - - air diff --git a/flowsa/methods/flowbysectormethods/marine_shipping_adjustment.yaml b/flowsa/methods/flowbysectormethods/marine_shipping_adjustment.yaml deleted file mode 100644 index 147f95c0d..000000000 --- a/flowsa/methods/flowbysectormethods/marine_shipping_adjustment.yaml +++ /dev/null @@ -1,47 +0,0 @@ -%YAML 1.1 - ---- -# m1 for the GHG national replicates the method used in the National GHG Industry Attribution Model -#(https://doi.org/10.23719/1517571), except that sector attribution is to 6-digit NAICS, -# rather than the BEA 2012 IO schema - -industry_spec: - default: NAICS_6 -year: 2017 -target_naics_year: 2012 -geoscale: national - -sources_to_cache: - BLS_QCEW: - year: 2012 - selection_fields: - Class: Employment - clean_fba_before_mapping: !script_function:BLS_QCEW estimate_suppressed_qcew - clean_fba: !script_function:BLS_QCEW clean_qcew # todo: evaluate if necessary because already estimated suppressed data - -source_names: - BEA_Marine_Bunker_Fuel: - external_data_path: !include:external_data.yaml:BEA_Marine_Bunker_Fuel - year: null - emissions_factors: EPA_emissions_factors - activity_to_sector_mapping: EPA_GHGI_SEEA - attribution_method: proportional - attribution_source: BLS_QCEW - activity_sets: - imports: - selection_fields: - Year: 2017 - Description: Imports - exports: - selection_fields: - Year: 2017 - Description: Exports - adjustment_factor: -1 - - EPA_GHGI_T_3_104: - selection_fields: - ActivityProducedBy: Marine - # fedefl_mapping: GHGI - activity_to_sector_mapping: EPA_GHGI_SEEA - attribution_method: proportional - attribution_source: BLS_QCEW diff --git a/flowsa/methods/method_status.yaml b/flowsa/methods/method_status.yaml index 6e350c814..095cc9e48 100644 --- a/flowsa/methods/method_status.yaml +++ b/flowsa/methods/method_status.yaml @@ -22,18 +22,7 @@ BTS_Airlines: Status: Private data Type: FileNotFoundError - # Flow By Sector CNHW_state_2014: Active: True Status: Memory Error # Skip during GH-action testing - -marine_shipping_adjustment: - Active: True - Status: Private data - Type: FileNoutFoundError - -SEEA_2017_kg_v1: - Active: False - Status: Method error - Type: ParserError diff --git a/flowsa/test_FBS_against_remote.py b/flowsa/test_FBS_against_remote.py index c9bb2c96e..338e7b203 100644 --- a/flowsa/test_FBS_against_remote.py +++ b/flowsa/test_FBS_against_remote.py @@ -16,21 +16,11 @@ def test_generate_fbs(): """Generate all FBS from methods in repo.""" for m in seeAvailableFlowByModels("FBS", print_method=False): - if m not in [ - 'Electricity_gen_emissions_national_2016', - 'GHG_national_m1', - 'GHGRP_2019', # remove after deleting method - 'marine_shipping_adjustment', # delete - 'SEEA_2016_v1', # delete - 'SEEA_2017_kg_v1', # delete - 'SEEA_2017_v1', # delete - 'SEEA_2017_v2' # delete - ]: - print("--------------------------------\n" - f"Method: {m}\n" - "--------------------------------") - FlowBySector.genereateFlowBySector( - method=m, download_sources_ok=True) + print("--------------------------------\n" + f"Method: {m}\n" + "--------------------------------") + FlowBySector.genereateFlowBySector( + method=m, download_sources_ok=True) @pytest.mark.skip(reason="Perform targeted test for compare_FBS on PR") From 29a2f0734905374a65686ddf158249e7cba96d96 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 17 Jul 2023 10:05:14 -0600 Subject: [PATCH 0696/1127] rename ghg_national_m1 to ghg_national_m1_common to standardize naming convention for "common" method files --- .../GHG_national_2016_m1.yaml | 82 +++++++++--------- .../GHG_national_2017_m1.yaml | 84 +++++++++---------- .../GHG_national_2018_m1.yaml | 82 +++++++++--------- .../GHG_national_2019_m1.yaml | 82 +++++++++--------- .../GHG_national_2020_m1.yaml | 82 +++++++++--------- ...al_m1.yaml => GHG_national_m1_common.yaml} | 0 6 files changed, 206 insertions(+), 206 deletions(-) rename flowsa/methods/flowbysectormethods/{GHG_national_m1.yaml => GHG_national_m1_common.yaml} (100%) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml index 86cbfd85d..e053ad269 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml @@ -4,7 +4,7 @@ # MECS year is 2018 # CoA year is 2017 -!include:GHG_national_m1.yaml +!include:GHG_national_m1_common.yaml ghgi_year: &ghgi_year 2016 mecs_year: &mecs_year 2018 @@ -15,124 +15,124 @@ _industrial_allocation_dict: &industrial_dict source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_2_1 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year activity_sets: # Update USGS year for these activity_sets - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets lead: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead year: *ghgi_year "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_68 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_70 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 year: *ghgi_year "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_72 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 year: *ghgi_year "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_42 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 year: *ghgi_year "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_44 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 year: *ghgi_year "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_46 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 year: *ghgi_year "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_28 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 year: *ghgi_year "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_3 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 year: *ghgi_year "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_6 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 year: *ghgi_year "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_17 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 year: *ghgi_year "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_18 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 year: *ghgi_year "EPA_GHGI_T_3_13": #CO2 from mobile combustion - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_13 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 year: *ghgi_year "EPA_GHGI_T_3_14": #CH4 from mobile combustion - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_14 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 year: *ghgi_year "EPA_GHGI_T_3_15": #N2O from mobile combustion duplicates method for CH4 - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_15 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_15 year: *ghgi_year "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_46 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 year: *ghgi_year "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_50 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 year: *ghgi_year "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_96 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 year: *ghgi_year "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_102 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 year: *ghgi_year "EPA_GHGI_T_A_97": # HFCs from Transportation - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_A_97 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 year: *ghgi_year "EPA_GHGI_T_4_80": # PFCs from aluminum production - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_80 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 year: *ghgi_year "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_86 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_86 year: *ghgi_year "EPA_GHGI_T_3_22b": #Fossil fuel for non-energy uses - !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions year: *ghgi_year activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets petroleum: - !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum year: *mecs_year natural_gas: - !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas year: *mecs_year ### Major CO2 Sources "EPA_GHGI_T_A_9": # CO2 emissions from stationary combustion. This table number changes with year - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport year: *ghgi_year clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets coal_manufacturing: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing year: *mecs_year "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 year: *ghgi_year clean_parameter: *industrial_dict activity_sets: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets coal_manufacturing: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing year: *mecs_year ng_manufacturing: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing year: *mecs_year "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9 year: *ghgi_year clean_parameter: *industrial_dict activity_sets: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets coal_manufacturing: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing year: *mecs_year ng_manufacturing: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing year: *mecs_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml index 6d327fdb5..03f51c13b 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml @@ -1,10 +1,10 @@ -# This is a 2017 target year specific implementation of GHG_national_m1 +# This is a 2017 target year specific implementation of GHG_national_m1_common # All parameters add year specific data when needed to implement for 2017 # GHGI FBA table names match the 2022 GHGI Report # MECS year is 2018 # CoA year is 2017 -!include:GHG_national_m1.yaml +!include:GHG_national_m1_common.yaml ghgi_year: &ghgi_year 2017 mecs_year: &mecs_year 2018 @@ -15,124 +15,124 @@ _industrial_allocation_dict: &industrial_dict source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_2_1 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year activity_sets: # Update USGS year for these activity_sets - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets lead: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead year: *ghgi_year "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_68 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_70 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 year: *ghgi_year "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_72 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 year: *ghgi_year "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_42 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 year: *ghgi_year "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_44 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 year: *ghgi_year "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_46 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 year: *ghgi_year "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_28 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 year: *ghgi_year "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_3 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 year: *ghgi_year "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_6 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 year: *ghgi_year "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_17 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 year: *ghgi_year "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_18 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 year: *ghgi_year "EPA_GHGI_T_3_13": #CO2 from mobile combustion - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_13 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 year: *ghgi_year "EPA_GHGI_T_3_14": #CH4 from mobile combustion - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_14 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 year: *ghgi_year "EPA_GHGI_T_3_15": #N2O from mobile combustion duplicates method for CH4 - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_15 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_15 year: *ghgi_year "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_46 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 year: *ghgi_year "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_50 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 year: *ghgi_year "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_96 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 year: *ghgi_year "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_102 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 year: *ghgi_year "EPA_GHGI_T_A_97": # HFCs from Transportation - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_A_97 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 year: *ghgi_year "EPA_GHGI_T_4_80": # PFCs from aluminum production - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_80 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 year: *ghgi_year "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_86 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_86 year: *ghgi_year "EPA_GHGI_T_3_22b": #Fossil fuel for non-energy uses - !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions year: *ghgi_year activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets petroleum: - !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum year: *mecs_year natural_gas: - !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas year: *mecs_year ### Major CO2 Sources "EPA_GHGI_T_A_8": # CO2 emissions from stationary combustion - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport year: *ghgi_year # Table A_8 is specific to 2017 clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets coal_manufacturing: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing year: *mecs_year "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 year: *ghgi_year clean_parameter: *industrial_dict activity_sets: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets coal_manufacturing: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing year: *mecs_year ng_manufacturing: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing year: *mecs_year "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9 year: *ghgi_year clean_parameter: *industrial_dict activity_sets: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets coal_manufacturing: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing year: *mecs_year ng_manufacturing: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing year: *mecs_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml index c028f6ff0..de44d4108 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml @@ -4,7 +4,7 @@ # MECS year is 2018 # CoA year is 2017 -!include:GHG_national_m1.yaml +!include:GHG_national_m1_common.yaml ghgi_year: &ghgi_year 2018 mecs_year: &mecs_year 2018 @@ -15,124 +15,124 @@ _industrial_allocation_dict: &industrial_dict source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_2_1 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year activity_sets: # Update USGS year for these activity_sets - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets lead: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead year: *ghgi_year "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_68 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_70 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 year: *ghgi_year "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_72 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 year: *ghgi_year "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_42 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 year: *ghgi_year "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_44 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 year: *ghgi_year "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_46 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 year: *ghgi_year "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_28 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 year: *ghgi_year "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_3 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 year: *ghgi_year "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_6 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 year: *ghgi_year "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_17 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 year: *ghgi_year "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_18 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 year: *ghgi_year "EPA_GHGI_T_3_13": #CO2 from mobile combustion - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_13 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 year: *ghgi_year "EPA_GHGI_T_3_14": #CH4 from mobile combustion - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_14 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 year: *ghgi_year "EPA_GHGI_T_3_15": #N2O from mobile combustion duplicates method for CH4 - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_15 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_15 year: *ghgi_year "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_46 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 year: *ghgi_year "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_50 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 year: *ghgi_year "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_96 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 year: *ghgi_year "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_102 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 year: *ghgi_year "EPA_GHGI_T_A_97": # HFCs from Transportation - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_A_97 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 year: *ghgi_year "EPA_GHGI_T_4_80": # PFCs from aluminum production - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_80 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 year: *ghgi_year "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_86 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_86 year: *ghgi_year "EPA_GHGI_T_3_22b": #Fossil fuel for non-energy uses - !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions year: *ghgi_year activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets petroleum: - !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum year: *mecs_year natural_gas: - !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas year: *mecs_year ### Major CO2 Sources "EPA_GHGI_T_A_7": # CO2 emissions from stationary combustion. This table number varies by GHG year - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport year: *ghgi_year # Table A_7 is specific to 2018 clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets coal_manufacturing: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing year: *mecs_year "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 year: *ghgi_year clean_parameter: *industrial_dict activity_sets: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets coal_manufacturing: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing year: *mecs_year ng_manufacturing: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing year: *mecs_year "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9 year: *ghgi_year clean_parameter: *industrial_dict activity_sets: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets coal_manufacturing: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing year: *mecs_year ng_manufacturing: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing year: *mecs_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml index bb044458b..c58e68b45 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml @@ -4,7 +4,7 @@ # MECS year is 2018 # CoA year is 2017 -!include:GHG_national_m1.yaml +!include:GHG_national_m1_common.yaml ghgi_year: &ghgi_year 2019 mecs_year: &mecs_year 2018 @@ -15,124 +15,124 @@ _industrial_allocation_dict: &industrial_dict source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_2_1 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year activity_sets: # Update USGS year for these activity_sets - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets lead: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead year: *ghgi_year "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_68 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_70 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 year: *ghgi_year "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_72 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 year: *ghgi_year "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_42 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 year: *ghgi_year "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_44 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 year: *ghgi_year "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_46 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 year: *ghgi_year "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_28 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 year: *ghgi_year "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_3 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 year: *ghgi_year "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_6 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 year: *ghgi_year "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_17 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 year: *ghgi_year "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_18 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 year: *ghgi_year "EPA_GHGI_T_3_13": #CO2 from mobile combustion - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_13 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 year: *ghgi_year "EPA_GHGI_T_3_14": #CH4 from mobile combustion - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_14 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 year: *ghgi_year "EPA_GHGI_T_3_15": #N2O from mobile combustion duplicates method for CH4 - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_15 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_15 year: *ghgi_year "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_46 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 year: *ghgi_year "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_50 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 year: *ghgi_year "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_96 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 year: *ghgi_year "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_102 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 year: *ghgi_year "EPA_GHGI_T_A_97": # HFCs from Transportation - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_A_97 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 year: *ghgi_year "EPA_GHGI_T_4_80": # PFCs from aluminum production - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_80 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 year: *ghgi_year "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_86 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_86 year: *ghgi_year "EPA_GHGI_T_3_22b": #Fossil fuel for non-energy uses - !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions year: *ghgi_year activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets petroleum: - !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum year: *mecs_year natural_gas: - !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas year: *mecs_year ### Major CO2 Sources "EPA_GHGI_T_A_6": # CO2 emissions from stationary combustion. This table number varies by GHG year. - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport year: *ghgi_year clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets coal_manufacturing: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing year: *mecs_year "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 year: *ghgi_year clean_parameter: *industrial_dict activity_sets: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets coal_manufacturing: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing year: *mecs_year ng_manufacturing: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing year: *mecs_year "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9 year: *ghgi_year clean_parameter: *industrial_dict activity_sets: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets coal_manufacturing: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing year: *mecs_year ng_manufacturing: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing year: *mecs_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml index a020b7373..1be323b8d 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml @@ -4,7 +4,7 @@ # MECS year is 2018 # CoA year is 2017 -!include:GHG_national_m1.yaml +!include:GHG_national_m1_common.yaml ghgi_year: &ghgi_year 2020 mecs_year: &mecs_year 2018 @@ -15,125 +15,125 @@ _industrial_allocation_dict: &industrial_dict source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_2_1 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year activity_sets: # Update USGS year for these activity_sets - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets lead: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead year: 2019 # latest year "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_68 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_70 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 year: *ghgi_year "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_72 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 year: *ghgi_year "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_42 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 year: *ghgi_year "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_44 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 year: *ghgi_year "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_46 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 year: *ghgi_year "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_28 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 year: *ghgi_year "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_3 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 year: *ghgi_year "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_6 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 year: *ghgi_year "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_17 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 year: *ghgi_year "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_5_18 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 year: *ghgi_year "EPA_GHGI_T_3_13": #CO2 from mobile combustion - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_13 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 year: *ghgi_year "EPA_GHGI_T_3_14": #CH4 from mobile combustion - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_14 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 year: *ghgi_year "EPA_GHGI_T_3_15": #N2O from mobile combustion duplicates method for CH4 - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_15 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_15 year: *ghgi_year "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_46 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 year: *ghgi_year "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_50 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 year: *ghgi_year "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_96 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 year: *ghgi_year "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_102 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 year: *ghgi_year "EPA_GHGI_T_A_97": # HFCs from Transportation - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_A_97 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 year: *ghgi_year "EPA_GHGI_T_4_80": # PFCs from aluminum production - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_80 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 year: *ghgi_year "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_4_86 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_86 year: *ghgi_year "EPA_GHGI_T_3_22": #Fossil fuel for non-energy uses - !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions year: *ghgi_year activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets petroleum: - !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum year: *mecs_year natural_gas: - !include:GHG_national_m1.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas year: *mecs_year ## Major CO2 Sources "EPA_GHGI_T_A_5": # CO2 emissions from stationary combustion. This table number varies by GHG year. - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport year: *ghgi_year clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets coal_manufacturing: - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m1.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing year: *mecs_year "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 year: *ghgi_year clean_parameter: *industrial_dict activity_sets: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets coal_manufacturing: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing year: *mecs_year ng_manufacturing: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing year: *mecs_year "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9 year: *ghgi_year clean_parameter: *industrial_dict activity_sets: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets coal_manufacturing: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing year: *mecs_year ng_manufacturing: - !include:GHG_national_m1.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing year: *mecs_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml similarity index 100% rename from flowsa/methods/flowbysectormethods/GHG_national_m1.yaml rename to flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml From 3e18d77116695048961c2654dfa8d0aa33392998 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 17 Jul 2023 10:39:46 -0600 Subject: [PATCH 0697/1127] drop additional method status updates, as FBA/FBS run correctly --- flowsa/methods/method_status.yaml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/flowsa/methods/method_status.yaml b/flowsa/methods/method_status.yaml index 095cc9e48..110a753b3 100644 --- a/flowsa/methods/method_status.yaml +++ b/flowsa/methods/method_status.yaml @@ -12,17 +12,9 @@ USGS_MYB_Phosphate: Status: Error in source data links Type: HTTPError -Blackhurst_IO: - Active: True - Status: Error in HTTP request during testing only - Type: HTTPError - BTS_Airlines: Active: True Status: Private data Type: FileNotFoundError -# Flow By Sector -CNHW_state_2014: - Active: True - Status: Memory Error # Skip during GH-action testing + From f3f8105bcfc9aba0a4edd5dacb09b4d9e3aafb24 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 17 Jul 2023 19:59:04 -0600 Subject: [PATCH 0698/1127] move where sectors are mapped to correct sector year and then drop all non-sectors before mapping to target sectors in case there are true sectors at NAICS5 but not real sectors at NAICS6 (like for BLS QCEW) --- flowsa/flowby.py | 45 +++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 4351f903e..6a13ab007 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1736,10 +1736,27 @@ def map_to_sectors( log.info('NAICS Activities in %s use NAICS year %s.', self.full_name, source_year) + # if activity schema does not match target naics year, + # convert sectors to target sectors + if activity_schema != f"NAICS_{self.config['target_naics_year']}_Code": + log.info(f"Converting {activity_schema} to NAICS" + f"_{self.config['target_naics_year']}_Code") + self = self.convert_naics_year( + self, + f"NAICS_{self.config['target_naics_year']}_Code", + activity_schema) + if self.config.get('sector_hierarchy') == 'parent-completeChild': log.info('NAICS are a mix of parent-completeChild, assigning ' 'activity columns directly to sector columns') + # load master crosswalk + cw = common.load_crosswalk('sector_timeseries') + sectors = (cw[[activity_schema]] + .drop_duplicates() + .dropna() + ) + # existing naics existing_sectors = pd.DataFrame() existing_sectors['Sector'] = ( @@ -1751,12 +1768,12 @@ def map_to_sectors( ) existing_sectors['Activity'] = existing_sectors['Sector'] - # load master crosswalk - cw = common.load_crosswalk('sector_timeseries') - sectors = (cw[[activity_schema]] - .drop_duplicates() - .dropna() - ) + # drop all sectors that are not sectors because BLS QCEW + # often has non-traditional NAICS6, but the parent NAICS5 do + # map correctly to sectors + existing_sectors = existing_sectors[existing_sectors[ + 'Sector'].isin(sectors[activity_schema].values)] + # create list of sectors that exist in original df, which, # if created when expanding sector list cannot be added # todo: note, both naics6 and naics7 get mapped to naics6 - @@ -1783,9 +1800,10 @@ def map_to_sectors( .drop(columns=[activity_schema]) ) - target_naics = set( - naics.industry_spec_key(self.config['industry_spec']) - .target_naics) + target_naics = list(naics + .industry_spec_key(self.config['industry_spec']) + .target_naics + .drop_duplicates()) activity_to_target_naics_crosswalk = ( activity_to_source_naics_crosswalk @@ -1823,15 +1841,6 @@ def map_to_sectors( .rename(columns={'target_naics': f'Sector{direction}'}) .drop(columns='source_naics') ) - # if activity schema does not match target naics year, - # convert sectors to target sectors - if activity_schema != f"NAICS_{self.config['target_naics_year']}_Code": - log.info(f"Converting {activity_schema} to NAICS" - f"_{self.config['target_naics_year']}_Code") - fba_w_naics = naics.convert_naics_year( - fba_w_naics, - f"NAICS_{self.config['target_naics_year']}_Code", - activity_schema) else: log.info('Getting crosswalk between activities in %s and ' 'NAICS codes.', self.full_name) From bb9f3095f57b3636d83f2a994108687665780384 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 17 Jul 2023 20:40:54 -0600 Subject: [PATCH 0699/1127] correct attribute error --- flowsa/flowby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 6a13ab007..2a7a62261 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1741,7 +1741,7 @@ def map_to_sectors( if activity_schema != f"NAICS_{self.config['target_naics_year']}_Code": log.info(f"Converting {activity_schema} to NAICS" f"_{self.config['target_naics_year']}_Code") - self = self.convert_naics_year( + self = self.naics.convert_naics_year( self, f"NAICS_{self.config['target_naics_year']}_Code", activity_schema) From f98113f8bf5f5a42731ccb155b088142ee99a4a7 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 17 Jul 2023 21:03:06 -0600 Subject: [PATCH 0700/1127] correct attribute error, take 2 --- flowsa/flowby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 2a7a62261..dbc61678d 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1741,7 +1741,7 @@ def map_to_sectors( if activity_schema != f"NAICS_{self.config['target_naics_year']}_Code": log.info(f"Converting {activity_schema} to NAICS" f"_{self.config['target_naics_year']}_Code") - self = self.naics.convert_naics_year( + self = naics.convert_naics_year( self, f"NAICS_{self.config['target_naics_year']}_Code", activity_schema) From f2c78cdbc0a5cec488d194f7e9d392e516b00564 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 18 Jul 2023 10:55:28 -0600 Subject: [PATCH 0701/1127] map to target naics rather than naics in activity schema --- flowsa/flowby.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index dbc61678d..4bb750315 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1752,7 +1752,7 @@ def map_to_sectors( # load master crosswalk cw = common.load_crosswalk('sector_timeseries') - sectors = (cw[[activity_schema]] + sectors = (cw[[f"NAICS_{self.config['target_naics_year']}_Code"]] .drop_duplicates() .dropna() ) @@ -1772,7 +1772,7 @@ def map_to_sectors( # often has non-traditional NAICS6, but the parent NAICS5 do # map correctly to sectors existing_sectors = existing_sectors[existing_sectors[ - 'Sector'].isin(sectors[activity_schema].values)] + 'Sector'].isin(sectors[f"NAICS_{self.config['target_naics_year']}_Code"].values)] # create list of sectors that exist in original df, which, # if created when expanding sector list cannot be added @@ -1786,7 +1786,7 @@ def map_to_sectors( lambda x: x[0:dig]) == i] if len(n) == 1: expanded_n = sectors[ - sectors[activity_schema].apply( + sectors[f"NAICS_{self.config['target_naics_year']}_Code"].apply( lambda x: x[0:dig] == i)] expanded_n = expanded_n.assign(Sector=i) naics_df = pd.concat([naics_df, expanded_n]) @@ -1795,9 +1795,9 @@ def map_to_sectors( existing_sectors .merge(naics_df, how='left') .assign(Sector=lambda x: np.where( - x[activity_schema].isna(), x['Sector'], - x[activity_schema])) - .drop(columns=[activity_schema]) + x[f"NAICS_{self.config['target_naics_year']}_Code"].isna(), x['Sector'], + x[f"NAICS_{self.config['target_naics_year']}_Code"])) + .drop(columns=[f"NAICS_{self.config['target_naics_year']}_Code"]) ) target_naics = list(naics From 5a2613d38a61a21f9ccdca5cd5e89f3b5540bcbf Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 18 Jul 2023 12:03:07 -0600 Subject: [PATCH 0702/1127] in aggregate_flowby() reset the group total column after aggregating and add validation check that the original df and new aggregated df flowamounts are equal --- flowsa/flowby.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 4bb750315..990e64d64 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -596,6 +596,18 @@ def aggregate_flowby( ) # ^^^ Need to convert back to correct dtypes after aggregating; # otherwise, columns of NaN will become float dtype. + + # reset the group total after aggregating + if 'group_total' in self.columns: + aggregated = aggregated.assign(group_total=aggregated[ + 'FlowAmount']) + + # check flowamounts equal after aggregating + if self['FlowAmount'].sum() != aggregated['FlowAmount'].sum(): + log.warning('There is an error in aggregating dataframe, as new ' + 'flow totals do not match original dataframe ' + 'flowtotals') + return aggregated def attribute_flows_to_sectors( From 7331eb1ad63ab89dffc1cd21942ba67b0200e2c7 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 18 Jul 2023 12:04:11 -0600 Subject: [PATCH 0703/1127] in convert_naics_year, drop code that was included during transition to recursive method and reset index columns --- flowsa/naics.py | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/flowsa/naics.py b/flowsa/naics.py index ee92a3c08..d4613acbf 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -332,18 +332,9 @@ def convert_naics_year(df_load, targetsectorsourcename, sectorsourcename): # drop rows where column value is in the nonnaics list df = df[~df[c].isin(nonsectors)] # aggregate data - if hasattr(df, 'aggregate_flowby'): - df = df.aggregate_flowby() - else: - # todo: drop except statement once all dataframes are converted - # to classes - possible_column_headers = \ - ('FlowAmount', 'Spread', 'Min', 'Max', 'DataReliability', - 'TemporalCorrelation', 'GeographicalCorrelation', - 'TechnologicalCorrelation', 'DataCollection', 'Description') - # list of column headers to group aggregation by - groupby_cols = [e for e in df.columns.values.tolist() - if e not in possible_column_headers] - df = aggregator(df, groupby_cols) - - return df + df = df.aggregate_flowby() + + return (df + .reset_index(drop=True).reset_index() + .rename(columns={'index': 'group_id'}) + ) From d7fa50345ba593b9c5915dd53e5305404a05cfc2 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 18 Jul 2023 12:23:01 -0600 Subject: [PATCH 0704/1127] revert dropping code as not all FBS methods are converted to classes --- flowsa/naics.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/flowsa/naics.py b/flowsa/naics.py index d4613acbf..ab5e51c32 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -332,7 +332,19 @@ def convert_naics_year(df_load, targetsectorsourcename, sectorsourcename): # drop rows where column value is in the nonnaics list df = df[~df[c].isin(nonsectors)] # aggregate data - df = df.aggregate_flowby() + if hasattr(df, 'aggregate_flowby'): + df = df.aggregate_flowby() + else: + # todo: drop else statement once all dataframes are converted + # to classes + possible_column_headers = \ + ('FlowAmount', 'Spread', 'Min', 'Max', 'DataReliability', + 'TemporalCorrelation', 'GeographicalCorrelation', + 'TechnologicalCorrelation', 'DataCollection', 'Description') + # list of column headers to group aggregation by + groupby_cols = [e for e in df.columns.values.tolist() + if e not in possible_column_headers] + df = aggregator(df, groupby_cols) return (df .reset_index(drop=True).reset_index() From a628dbbae3c25cc77e08f7bf3f8d0a424bb02730 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 19 Jul 2023 10:37:24 -0600 Subject: [PATCH 0705/1127] if units are rates or ratios, skip aggregate_flowby() --- flowsa/flowby.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 990e64d64..2689aae9a 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -553,6 +553,13 @@ def aggregate_flowby( all columns of 'float' data type will be used, except 'FlowAmount'. :return: FlowBy, with aggregated columns """ + # if units are rates or ratios, do not aggregate + if self['Unit'].str.contains('/').any(): + log.info(f"At least one row is a rate or ratio with units " + f"{self['Unit'].unique().tolist()}, returning df " + f"without aggregating") + return self + if columns_to_group_by is None: columns_to_group_by = self.groupby_cols if columns_to_average is None: From ab817f61386ecc7866d477a139b6525bace2101f Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 19 Jul 2023 10:38:45 -0600 Subject: [PATCH 0706/1127] update the warning for differences in aggregate_flowby() to be based on a percentage --- flowsa/flowby.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 2689aae9a..83a058a1b 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -610,10 +610,13 @@ def aggregate_flowby( 'FlowAmount']) # check flowamounts equal after aggregating - if self['FlowAmount'].sum() != aggregated['FlowAmount'].sum(): - log.warning('There is an error in aggregating dataframe, as new ' + self_flow = self['FlowAmount'].sum() + agg_flow = aggregated['FlowAmount'].sum() + percent_diff = int(((agg_flow - self_flow) * 100) / self_flow) + if percent_diff > 0: + log.warning(f'There is an error in aggregating dataframe, as new ' 'flow totals do not match original dataframe ' - 'flowtotals') + 'flowtotals, there is a {percent_diff}% difference.') return aggregated From 099106a0b79bc969d8be51138d1f9e87daa94d88 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 19 Jul 2023 10:39:45 -0600 Subject: [PATCH 0707/1127] use "update" to update config dictionary --- flowsa/flowby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 83a058a1b..1067c8266 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -780,7 +780,7 @@ def attribute_flows_to_sectors( # reset datatype to FBS because otherwise when we loop through # to the next attribution method, the FBA will be re-cleaned and # have additional sector columns appended - self.config['data_format'] = 'FBS' + self.config.update({'data_format': 'FBS'}) return self From 0745551f37471e57a3a1ab4699a15f55bf1c93e1 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 19 Jul 2023 10:51:17 -0600 Subject: [PATCH 0708/1127] update substitute_nonexistent_values() to left merge and fill missing values differently depending on column dtype --- flowsa/flowbyclean.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index 26ab3f234..0246b85ba 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -147,15 +147,20 @@ def substitute_nonexistent_values( .merge(other, on=list(other.select_dtypes( include=['object', 'int']).columns), - how='outer', + how='left', suffixes=(None, '_y')) ) # fill in missing data new_col_data = [col for col in merged if col.endswith('_y')] for c in new_col_data: original_col = c.replace('_y', '') - merged[original_col] = merged[original_col].fillna( - merged[c]) + if merged[original_col].dtype != 'string': + merged[original_col] = np.where(merged[original_col] == 0, + merged[c], + merged[original_col]) + else: + merged[original_col] = merged[original_col].fillna( + merged[c]) # reset grop id and group total, drop columns merged = (merged From 20564ca98bd0fcbc3daa7b10b056d8c094feec5e Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 20 Jul 2023 13:18:35 -0600 Subject: [PATCH 0709/1127] test code causing gh actions to fail --- flowsa/flowby.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 1067c8266..6400792ce 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -605,18 +605,20 @@ def aggregate_flowby( # otherwise, columns of NaN will become float dtype. # reset the group total after aggregating - if 'group_total' in self.columns: - aggregated = aggregated.assign(group_total=aggregated[ - 'FlowAmount']) + # todo: see if this code is the problem + # if 'group_total' in self.columns: + # aggregated = aggregated.assign(group_total=aggregated[ + # 'FlowAmount']) # check flowamounts equal after aggregating - self_flow = self['FlowAmount'].sum() - agg_flow = aggregated['FlowAmount'].sum() - percent_diff = int(((agg_flow - self_flow) * 100) / self_flow) - if percent_diff > 0: - log.warning(f'There is an error in aggregating dataframe, as new ' - 'flow totals do not match original dataframe ' - 'flowtotals, there is a {percent_diff}% difference.') + # todo: see if this code is the problem + # self_flow = self['FlowAmount'].sum() + # agg_flow = aggregated['FlowAmount'].sum() + # percent_diff = int(((agg_flow - self_flow) * 100) / self_flow) + # if percent_diff > 0: + # log.warning(f'There is an error in aggregating dataframe, as new ' + # 'flow totals do not match original dataframe ' + # 'flowtotals, there is a {percent_diff}% difference.') return aggregated From 68f2c5e7a69e99e43663b7b5f85c68fd06f053b9 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 21 Jul 2023 16:41:47 -0600 Subject: [PATCH 0710/1127] update eia_mecs sector_hierarchy to "parent-incompleteChild" --- flowsa/data/README.md | 16 ++++++++++------ flowsa/data/source_catalog.yaml | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/flowsa/data/README.md b/flowsa/data/README.md index 1a6bec0ea..f9e36778d 100644 --- a/flowsa/data/README.md +++ b/flowsa/data/README.md @@ -6,9 +6,13 @@ Flow-By-Activity. - _class_: list, classes such as "Water" found in the Flow-By-Activity - _activity_schema_: 'None' if activities are not NAICS-based, otherwise the year of the sector data (ex. NAICS_2012_Code) -- _sector_hierarchy_: 'parent' or 'parent-completeChild' or - 'parent-incompleteChild'. Some dataset crosswalks contain every level of - relevant sectors (ex. NAICS for 2-6 digits), that is they are fully - disaggregated. Other datasets only contain information for the highest - relevant sector level, in which case, the dataset is marked as showing - aggregated sectors only (e.g., USGS_WU_Coef crosswalk). \ No newline at end of file +- _sector_hierarchy_: 'flat' or 'parent-completeChild' or + 'parent-incompleteChild'. Some datasets only contain information for the + highest relevant sector level, in which case, the dataset is marked as showing + aggregated sectors only (e.g., USGS_WU_Coef crosswalk) (flat).Some dataset + crosswalks contain every level of relevant sectors (ex. NAICS for 2-6 + digits), that is they are fully disaggregated, containing all parent and + child data/relationships (parent-completeChild). The third option, + parent-incompleteChild represents data that contain some information for + parents and children, but it is a mix of what data is available (e.g., + EIA_MECS_Energy) \ No newline at end of file diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 0f17b9e3e..e1bd74cd2 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -142,13 +142,13 @@ EIA_MECS_Energy: - Other - Money activity_schema: NAICS_2017_Code - sector_hierarchy: "parent-completeChild" + sector_hierarchy: "parent-incompleteChild" EIA_MECS_Land: data_format: FBA class: - Land activity_schema: NAICS_2012_Code - sector_hierarchy: "parent-completeChild" + sector_hierarchy: "parent-incompleteChild" EIA_MER: data_format: FBA class: From 84a223e47290da78df59b7c85c9390f86b061ec3 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 21 Jul 2023 16:45:51 -0600 Subject: [PATCH 0711/1127] move and rename clean_mecs_energy_fba() and clean_mapped_mecs_energy_fba() --- flowsa/data_source_scripts/EIA_MECS.py | 125 ---------------- flowsa/flowbyclean.py | 140 +++++++++++++++++- .../flowbysectormethods/CAP_HAP_common.yaml | 8 +- .../GHG_national_m1_common.yaml | 5 +- 4 files changed, 144 insertions(+), 134 deletions(-) diff --git a/flowsa/data_source_scripts/EIA_MECS.py b/flowsa/data_source_scripts/EIA_MECS.py index e9f0f419f..e2cc69abe 100644 --- a/flowsa/data_source_scripts/EIA_MECS.py +++ b/flowsa/data_source_scripts/EIA_MECS.py @@ -458,131 +458,6 @@ def estimate_suppressed_mecs_energy( return unsuppressed.drop(columns='Suppressed') -def clean_mecs_energy_fba(fba: FlowByActivity, **_) -> FlowByActivity: - ''' - This function helps address the unique structure of the EIA MECS dataset. - The MECS dataset contains rows at various levels of aggregation between - NAICS-3 and NAICS-6 (inclusive). Each aggregated row contains the total - for that level of aggregation, even if data are also reported for a less - aggregated subset of those industries. For example: - - ActivityConsumedBy | FlowAmount | ... - ------------------------------------- - 311 | 110 | - 3112 | 65 | - 311221 | 55 | - - where the 110 reported for 311 includes the 65 reported for 3112, which - includes the 55 reported for 211221. If we do not address this issue, there - will be double counting. Additionally, if we are trying to disaggregate - to the NAICS-6 level, all three rows shown above will be mapped to NAICS-6 - 311221 (with the first wo rows also being mapped to several other NAICS-6 - codes as well). We will then over attribute the (double-counted) flows to - those industries and groups of industries for which more specific detail - is provided. - - This function addresses the double counting issue. For each aggregated - industry group, all descendant (less aggregated) industries or industry - groups for which detailed information is given are subtracted from the - aggregated total. Using the example from above: - - ActivityConsumedBy | FlowAmount | ... - ------------------------------------- - 311 | 45 | - 3112 | 10 | - 311221 | 55 | - - Additionally, this function adds a column called "descendants", which for - each industry holds all the descendant industries or industry groups that - have detailed information provided in the dataset. After mapping to - industries, but before attribution is performed, this column is used by the - clean_mapped_mecs_energy_fba function to drop any row that is mapped - from an aggregated industry group to a less aggregated industry or industry - group THAT HAS DETAILED INFORMATION GIVEN IN THE MECS (and therefore has - its own row already) to avoid the over-attribution issue. - Again using the previous example: - - ActivityConsumedBy | FlowAmount | descendants | ... - --------------------------------------------------- - 311 | 45 | 3112 311221 | - 3112 | 10 | 311221 | - 311221 | 55 | | - - Note that this function is not useful if the desired aggregation level is - NAICS-2. In such a case, the MECS dataset can be filtered to include only - the rows with ActivityConsumedBy == "31-33", then disaggregated to 31, 32, - 33 using another dataset (such as the QCEW). - ''' - mecs = ( - fba - .query('ActivityConsumedBy != "31-33"') - .assign(descendants='') - ) - - for level in [5, 4, 3]: - descendants = ( - mecs - .drop(columns='descendants') - .query(f'ActivityConsumedBy.str.len() > {level}') - .assign( - parent=lambda x: x.ActivityConsumedBy.str.slice(stop=level) - ) - .groupby(['Flowable', 'Location', 'parent']) - .agg({'FlowAmount': 'sum', 'ActivityConsumedBy': ' '.join}) - .reset_index() - .rename(columns={'ActivityConsumedBy': 'descendants', - 'FlowAmount': 'descendant_flows', - 'parent': 'ActivityConsumedBy'}) - ) - - mecs = ( - mecs - .merge(descendants, - how='left', - on=['Flowable', 'Location', 'ActivityConsumedBy'], - suffixes=(None, '_y')) - .fillna({'descendant_flows': 0, 'descendants_y': ''}) - .assign( - descendants=lambda x: x.descendants.mask(x.descendants == '', - x.descendants_y), - FlowAmount=lambda x: (x.FlowAmount - x.descendant_flows).mask( - x.FlowAmount - x.descendant_flows < 0, 0) - ) - .drop(columns=['descendant_flows', 'descendants_y']) - ) - - return mecs - - -def clean_mapped_mecs_energy_fba(fba: FlowByActivity, **_) -> FlowByActivity: - ''' - This function finishes handling the over-attribution issue described in - the documentation for clean_mecs_energy_fba by dropping any row in the - MECS dataset which has been mapped to an industry or industry group which - is a subset (strict or otherwise) of an industry group listed in the - descendants columns. So, if 311 and 3112 both appear in the MECS datset, - 3112 will be listed as a descendant of 311 and this function will therefore - drop a row mapping 311 to 311221 (since more detailed information on 3112, - which contains 311221, is provided). If 31122 and 311221 do not appear in - the dataset, a row mapping 3112 to 311221 will not be dropped, since no - more detailed information on 311221 is given. Further attribution/ - disaggregation should be done using another datatset such as the QCEW. - ''' - mecs = ( - fba - .assign(to_keep=fba.apply( - lambda x: not any([str(x.SectorConsumedBy).startswith(d) - for d in x.descendants.split()]), - axis='columns' - )) - .query('to_keep') - .drop(columns=['descendants', 'to_keep']) - ) - - return mecs - - - def clean_mapped_mecs_energy_fba_to_state( fba: FlowByActivity, **_ diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index 0246b85ba..696b2bd14 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -1,8 +1,10 @@ import numpy as np import pandas as pd -from flowsa.flowby import FlowByActivity, FlowBySector, FB +from flowsa.flowby import FlowBySector, FB, get_catalog_info, \ + get_flowby_from_config from flowsa.flowsa_log import log -from flowsa import (flowby, geo, location, getFlowBySector, flowbyfunctions) +from flowsa import (geo, location, getFlowBySector, flowbyfunctions, + FlowByActivity) from flowsa.naics import map_source_sectors_to_less_aggregated_sectors def return_primary_activity_column(fba: FlowByActivity) -> \ @@ -35,12 +37,12 @@ def load_prepare_clean_source( except AttributeError: name, config = self.config['clean_source'], {} - clean_fbs = flowby.get_flowby_from_config( + clean_fbs = get_flowby_from_config( name=name, config={**{k: v for k, v in self.config.items() if k in self.config['method_config_keys'] or k == 'method_config_keys'}, - **flowby.get_catalog_info(name), + **get_catalog_info(name), **config}, download_sources_ok=download_sources_ok ).prepare_fbs(download_sources_ok=download_sources_ok) @@ -365,3 +367,133 @@ def calculate_flow_per_employee( ) return fbs + + +def define_parentincompletechild_descendants( + fba: FlowByActivity, activity_col='ActivityConsumedBy', **_) -> \ + FlowByActivity: + ''' + This function helps address the unique structure of the EIA MECS dataset. + The MECS dataset contains rows at various levels of aggregation between + NAICS-3 and NAICS-6 (inclusive). Each aggregated row contains the total + for that level of aggregation, even if data are also reported for a less + aggregated subset of those industries. For example: + + ActivityConsumedBy | FlowAmount | ... + ------------------------------------- + 311 | 110 | + 3112 | 65 | + 311221 | 55 | + + where the 110 reported for 311 includes the 65 reported for 3112, which + includes the 55 reported for 211221. If we do not address this issue, there + will be double counting. Additionally, if we are trying to disaggregate + to the NAICS-6 level, all three rows shown above will be mapped to NAICS-6 + 311221 (with the first wo rows also being mapped to several other NAICS-6 + codes as well). We will then over attribute the (double-counted) flows to + those industries and groups of industries for which more specific detail + is provided. + + This function addresses the double counting issue. For each aggregated + industry group, all descendant (less aggregated) industries or industry + groups for which detailed information is given are subtracted from the + aggregated total. Using the example from above: + + ActivityConsumedBy | FlowAmount | ... + ------------------------------------- + 311 | 45 | + 3112 | 10 | + 311221 | 55 | + + Additionally, this function adds a column called "descendants", which for + each industry holds all the descendant industries or industry groups that + have detailed information provided in the dataset. After mapping to + industries, but before attribution is performed, this column is used by the + drop_parentincompletechild_descendants function to drop any row that is mapped + from an aggregated industry group to a less aggregated industry or industry + group THAT HAS DETAILED INFORMATION GIVEN IN THE MECS (and therefore has + its own row already) to avoid the over-attribution issue. + Again using the previous example: + + ActivityConsumedBy | FlowAmount | descendants | ... + --------------------------------------------------- + 311 | 45 | 3112 311221 | + 3112 | 10 | 311221 | + 311221 | 55 | | + + Note that this function is not useful if the desired aggregation level is + NAICS-2. In such a case, the MECS dataset can be filtered to include only + the rows with ActivityConsumedBy == "31-33", then disaggregated to 31, 32, + 33 using another dataset (such as the QCEW). + ''' + fba = ( + fba + .query(f'{activity_col} != "31-33"') + .assign(descendants='') + ) + + for level in [5, 4, 3]: + descendants = ( + fba + .drop(columns='descendants') + .query(f'{activity_col}.str.len() > {level}') + .assign( + parent=lambda x: x[activity_col].str.slice(stop=level) + ) + .groupby(['Flowable', 'Location', 'parent']) + .agg({'FlowAmount': 'sum', activity_col: ' '.join}) + .reset_index() + .rename(columns={activity_col: 'descendants', + 'FlowAmount': 'descendant_flows', + 'parent': 'ActivityConsumedBy'}) + ) + + fba = ( + fba + .merge(descendants, + how='left', + on=['Flowable', 'Location', 'ActivityConsumedBy'], + suffixes=(None, '_y')) + .fillna({'descendant_flows': 0, 'descendants_y': ''}) + .assign( + descendants=lambda x: x.descendants.mask(x.descendants == '', + x.descendants_y), + FlowAmount=lambda x: (x.FlowAmount - + x.descendant_flows).mask( + x.FlowAmount - x.descendant_flows < 0, 0) + ) + .drop(columns=['descendant_flows', 'descendants_y']) + ) + + return fba + + +def drop_parentincompletechild_descendants( + fba: FlowByActivity, sector_col='SectorConsumedBy', **_) -> \ + FlowByActivity: + ''' + This function finishes handling the over-attribution issue described in + the documentation for define_parentincompletechild_descendants by dropping any row in the + MECS dataset which has been mapped to an industry or industry group which + is a subset (strict or otherwise) of an industry group listed in the + descendants columns. So, if 311 and 3112 both appear in the MECS datset, + 3112 will be listed as a descendant of 311 and this function will therefore + drop a row mapping 311 to 311221 (since more detailed information on 3112, + which contains 311221, is provided). If 31122 and 311221 do not appear in + the dataset, a row mapping 3112 to 311221 will not be dropped, since no + more detailed information on 311221 is given. Further attribution/ + disaggregation should be done using another datatset such as the QCEW. + ''' + + fba2 = ( + fba + .assign(to_keep=fba.apply( + lambda x: not any([str(x[sector_col]).startswith(d) for d in + x.descendants.split()]), + axis='columns' + )) + .query('to_keep') + .drop(columns=['descendants', 'to_keep']) + ) + + return fba2 diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml index d163b916e..302980033 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml @@ -18,8 +18,9 @@ sources_to_cache: - Table 2.2 - Table 3.2 estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy - clean_fba: !script_function:EIA_MECS clean_mecs_energy_fba - clean_fba_w_sec: !script_function:EIA_MECS clean_mapped_mecs_energy_fba + # todo: delete below code now that mecs reassigned to "parent-incompleteChild" +# clean_fba: !script_function:EIA_MECS define_parentincompletechild_descendants +# clean_fba_w_sec: !script_function:EIA_MECS drop_parentincompletechild_descendants attribution_method: proportional # attribution_source: # Employment_national_2018: # Use target MECS year @@ -38,7 +39,8 @@ sources_to_cache: exclusion_fields: Location: '00000' estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy - clean_fba: !script_function:EIA_MECS clean_mecs_energy_fba + # todo: delete below code now that mecs reassigned to "parent-incompleteChild" +# clean_fba: !script_function:EIA_MECS define_parentincompletechild_descendants clean_fba_after_attribution: !script_function:EIA_MECS clean_mapped_mecs_energy_fba_to_state clean_source: Employment_state_2018 ## Update to MECS year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml index 007ac81be..ea793a915 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml @@ -29,8 +29,9 @@ attribution_sources: - Table 2.2 # applies to Class Other - Table 3.2 # applies to Class Energy estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy - clean_fba: !script_function:EIA_MECS clean_mecs_energy_fba - clean_fba_w_sec: !script_function:EIA_MECS clean_mapped_mecs_energy_fba + # todo: delete below code now that mecs reassigned to "parent-incompleteChild" +# clean_fba: !script_function:EIA_MECS define_parentincompletechild_descendants +# clean_fba_w_sec: !script_function:EIA_MECS drop_parentincompletechild_descendants attribution_method: proportional # attribution_source: # Include in main method # BEA_Use_Detail_PRO_BeforeRedef: From 8f13be3830c2485b933a13c03754381fef81e967 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 21 Jul 2023 16:47:10 -0600 Subject: [PATCH 0712/1127] simplify eia_mecs fxns now that moved mapping fxns --- flowsa/data_source_scripts/EIA_MECS.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/flowsa/data_source_scripts/EIA_MECS.py b/flowsa/data_source_scripts/EIA_MECS.py index e2cc69abe..90c2d6cef 100644 --- a/flowsa/data_source_scripts/EIA_MECS.py +++ b/flowsa/data_source_scripts/EIA_MECS.py @@ -11,7 +11,6 @@ import pandas as pd import numpy as np -import flowsa from flowsa.location import US_FIPS, get_region_and_division_codes from flowsa.common import WITHDRAWN_KEYWORD from flowsa.flowsa_log import log @@ -463,10 +462,11 @@ def clean_mapped_mecs_energy_fba_to_state( fba: FlowByActivity, **_ ) -> FlowByActivity: """ - clean_fba_w_sec fxn that replicates clean_mapped_mecs_energy_fba but + clean_fba_w_sec fxn that replicates drop_parentincompletechild_descendants but also updates regions to states for state models. """ - fba = clean_mapped_mecs_energy_fba(fba) + # todo: delete commented out code because incorporated into mapping fxn + # fba = drop_parentincompletechild_descendants(fba) fba = update_regions_to_states(fba) return fba @@ -530,9 +530,7 @@ def mecs_land_fba_cleanup(fba, **_): :param fba: df, EIA MECS Land FBA format :return: df, EA MECS Land FBA """ - fba2 = clean_mecs_energy_fba(fba) - # calculate the land area in addition to building footprint - fba3 = calculate_total_facility_land_area(fba2) + fba = calculate_total_facility_land_area(fba) - return fba3 + return fba From ab7af6c4037598a97154559acc9aa20423755ff0 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 21 Jul 2023 16:49:01 -0600 Subject: [PATCH 0713/1127] update map_to_sectors() to address parent-incompleteChild sector hierarchies --- flowsa/flowby.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 6400792ce..8db44e79f 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1740,6 +1740,10 @@ def map_to_sectors( :param external_config_path: str, an external path to search for a crosswalk. """ + from flowsa.flowbyclean import \ + define_parentincompletechild_descendants, \ + drop_parentincompletechild_descendants + naics_key = naics.industry_spec_key(self.config['industry_spec']) activity_schema = self.config['activity_schema'] if isinstance( @@ -1849,13 +1853,18 @@ def map_to_sectors( 'Activity'], errors='ignore') ) - else: + else: # either "flat" or "parent-inComplete" # if sector-like activities are aggregated, then map all # sectors to target sector level log.info('Converting NAICS codes to desired industry/sector ' 'aggregation structure.') fba_w_naics = self.copy() for direction in ['ProducedBy', 'ConsumedBy']: + if self.config.get('sector_hierarchy') == 'parent-incompleteChild': + # add descendants column + fba_w_naics = \ + define_parentincompletechild_descendants( + fba_w_naics, activity_col=f'Activity{direction}') fba_w_naics = ( fba_w_naics .merge(naics_key, @@ -1865,6 +1874,10 @@ def map_to_sectors( .rename(columns={'target_naics': f'Sector{direction}'}) .drop(columns='source_naics') ) + if self.config.get('sector_hierarchy') == 'parent-incompleteChild': + # add descendants column + fba_w_naics = drop_parentincompletechild_descendants( + fba_w_naics, sector_col=f'Sector{direction}') else: log.info('Getting crosswalk between activities in %s and ' 'NAICS codes.', self.full_name) From 8c4ec9070b8123fe3bdc2a86ff6155dc41bc7b4d Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 21 Jul 2023 16:50:39 -0600 Subject: [PATCH 0714/1127] specify to use state usda_ers_mlu data --- flowsa/methods/flowbysectormethods/Land_national_2012.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/methods/flowbysectormethods/Land_national_2012.yaml b/flowsa/methods/flowbysectormethods/Land_national_2012.yaml index 87a8771b1..cf03499fd 100644 --- a/flowsa/methods/flowbysectormethods/Land_national_2012.yaml +++ b/flowsa/methods/flowbysectormethods/Land_national_2012.yaml @@ -59,6 +59,7 @@ source_names: attribution_source: Employment_national_2012 USDA_ERS_MLU: fedefl_mapping: USDA_ERS_MLU + geoscale: state selection_fields: Class: Land Location: !include:Location_common.yaml:_state_location From 7e945af5ded7f23a1ea685a28d0171c644f1107d Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 24 Jul 2023 09:52:50 -0600 Subject: [PATCH 0715/1127] test assigning group_id as cause for gha error --- flowsa/naics.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/flowsa/naics.py b/flowsa/naics.py index ab5e51c32..366472980 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -346,7 +346,4 @@ def convert_naics_year(df_load, targetsectorsourcename, sectorsourcename): if e not in possible_column_headers] df = aggregator(df, groupby_cols) - return (df - .reset_index(drop=True).reset_index() - .rename(columns={'index': 'group_id'}) - ) + return df From 2e4443f1cfc6da1db65ae6178e0e4afc8352a3cc Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 24 Jul 2023 12:58:54 -0400 Subject: [PATCH 0716/1127] assign group_id in some cases --- flowsa/naics.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flowsa/naics.py b/flowsa/naics.py index 366472980..6127bc83e 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -333,7 +333,9 @@ def convert_naics_year(df_load, targetsectorsourcename, sectorsourcename): df = df[~df[c].isin(nonsectors)] # aggregate data if hasattr(df, 'aggregate_flowby'): - df = df.aggregate_flowby() + df = (df.aggregate_flowby() + .reset_index(drop=True).reset_index() + .rename(columns={'index': 'group_id'})) else: # todo: drop else statement once all dataframes are converted # to classes From e65aa6c55c08163e4ae3c65537c933899d1096a2 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 24 Jul 2023 11:28:21 -0600 Subject: [PATCH 0717/1127] update attribute_national_to_state() to use recursive functions --- flowsa/flowbyclean.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index 696b2bd14..cbd935412 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -292,14 +292,11 @@ def attribute_national_to_states(fba: FlowByActivity, **_) -> FlowByActivity: log.info('Attributing national data to states') # Attribute data source based on attribution source - # todo: generalize so works for FBA or FBS - hlp = getFlowBySector( - methodname=fba.config.get('clean_source'), - download_FBS_if_missing=True) + hlp = load_prepare_clean_source(fba) # To match the sector resolution of source data, generate employment # dataset for all NAICS resolution by aggregating - hlp = flowbyfunctions.sector_aggregation(hlp) + hlp = hlp.aggregate_flowby() # For each region, generate ratios across states for a given sector hlp['Allocation'] = hlp['FlowAmount']/hlp.groupby( From cbc0768359d02baf719b60feea424c089a7937f8 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 24 Jul 2023 14:11:09 -0600 Subject: [PATCH 0718/1127] add 'all buildings' and 'mercantile' to cbecs activty sets --- .../flowbysectoractivitysets/EIA_CBECS_Land_2012_asets.csv | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flowsa/methods/flowbysectoractivitysets/EIA_CBECS_Land_2012_asets.csv b/flowsa/methods/flowbysectoractivitysets/EIA_CBECS_Land_2012_asets.csv index 32066e60d..1f7646887 100644 --- a/flowsa/methods/flowbysectoractivitysets/EIA_CBECS_Land_2012_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/EIA_CBECS_Land_2012_asets.csv @@ -1,4 +1,5 @@ activity_set,name,note +cbecs_land,All buildings, cbecs_land,Education, cbecs_land,Enclosed and strip malls, cbecs_land,Food sales, @@ -6,6 +7,7 @@ cbecs_land,Food service, cbecs_land,Health care In-Patient, cbecs_land,Health care Out-Patient, cbecs_land,Lodging, +cbecs_land,Mercantile, cbecs_land,Office, cbecs_land,Other, cbecs_land,Public assembly, From 14aab738799d9610d0897f50dd9f3c7c66505537 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 24 Jul 2023 14:11:36 -0600 Subject: [PATCH 0719/1127] drop logging statement --- flowsa/data_source_scripts/EIA_CBECS_Land.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/flowsa/data_source_scripts/EIA_CBECS_Land.py b/flowsa/data_source_scripts/EIA_CBECS_Land.py index 24601c94c..75b238355 100644 --- a/flowsa/data_source_scripts/EIA_CBECS_Land.py +++ b/flowsa/data_source_scripts/EIA_CBECS_Land.py @@ -248,9 +248,6 @@ def cbecs_land_fba_cleanup(fba, **_): # drop activities of 'all buildings' to avoid double counting fba2 = fba1[ fba1['ActivityConsumedBy'] != 'All buildings'].reset_index(drop=True) - vlog.info('Drop the principle building activity "All buildings" ' - 'to avoid double counting') - calculate_flowamount_diff_between_dfs(fba1, fba2) return fba2 @@ -309,10 +306,9 @@ def calculate_floorspace_based_on_number_of_floors(fba_load): 'Calculates result in reduced FlowAmount for all ' 'categories.') calculate_flowamount_diff_between_dfs(fba2, fba3) - # rename the FlowAmounts and sum so total floorspace, rather than have + # rename the Flowable and sum so total floorspace, rather than have # multiple rows based on floors - fba3 = fba3.assign(FlowName=fba3['Flowable'].apply( - lambda x: ','.join(x.split(',')[:-1]))) + fba3 = fba3.assign(Flowable='Land use') # modify the description fba3 = fba3.assign(Description='Building Footprint') fba4 = fba3.aggregate_flowby() From 2143d9227321a1123382ef35dee57368efc6d286 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 24 Jul 2023 14:13:32 -0600 Subject: [PATCH 0720/1127] readd validation checks --- flowsa/flowby.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 8db44e79f..0384141f0 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -605,20 +605,18 @@ def aggregate_flowby( # otherwise, columns of NaN will become float dtype. # reset the group total after aggregating - # todo: see if this code is the problem - # if 'group_total' in self.columns: - # aggregated = aggregated.assign(group_total=aggregated[ - # 'FlowAmount']) + if 'group_total' in self.columns: + aggregated = aggregated.assign(group_total=aggregated[ + 'FlowAmount']) # check flowamounts equal after aggregating - # todo: see if this code is the problem - # self_flow = self['FlowAmount'].sum() - # agg_flow = aggregated['FlowAmount'].sum() - # percent_diff = int(((agg_flow - self_flow) * 100) / self_flow) - # if percent_diff > 0: - # log.warning(f'There is an error in aggregating dataframe, as new ' - # 'flow totals do not match original dataframe ' - # 'flowtotals, there is a {percent_diff}% difference.') + self_flow = self['FlowAmount'].sum() + agg_flow = aggregated['FlowAmount'].sum() + percent_diff = int(((agg_flow - self_flow) * 100) / self_flow) + if percent_diff > 0: + log.warning(f'There is an error in aggregating dataframe, as new ' + 'flow totals do not match original dataframe ' + 'flowtotals, there is a {percent_diff}% difference.') return aggregated From 5a78597686297b11b1644400284dadfbfe9a2f76 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 25 Jul 2023 12:43:02 -0600 Subject: [PATCH 0721/1127] update state water target sectors --- flowsa/methods/flowbysectormethods/Water_state_2015_m1.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Water_state_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_state_2015_m1.yaml index e5cdba3b3..7cdfcf9e8 100644 --- a/flowsa/methods/flowbysectormethods/Water_state_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_state_2015_m1.yaml @@ -1,10 +1,8 @@ # This is the 2015 target year method for water m1 which builds off the generic # method in Water_common -industry_spec: - default: NAICS_6 +!include:USEEIO_summary_target.yaml year: 2015 -target_naics_year: 2012 geoscale: state sources_to_cache: From 4dd43e0d6aad32034a6abb5fd0e133548acf0034 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 25 Jul 2023 12:44:41 -0600 Subject: [PATCH 0722/1127] update how naics-like activities are mapped to sectors to work for when activities are aggregated or disaggregated --- flowsa/flowby.py | 46 +++++++++++++--------------------------------- 1 file changed, 13 insertions(+), 33 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 0384141f0..2d631b8d4 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -723,7 +723,7 @@ def attribute_flows_to_sectors( elif attribution_method == 'inheritance': log.info(f'Directly attributing {self.full_name} to sectors, child ' - 'sectors inherent parent values.') + 'sectors inherit parent values.') attributed_fb = fb.copy() else: @@ -1792,7 +1792,6 @@ def map_to_sectors( .drop_duplicates() .reset_index(drop=True) ) - existing_sectors['Activity'] = existing_sectors['Sector'] # drop all sectors that are not sectors because BLS QCEW # often has non-traditional NAICS6, but the parent NAICS5 do @@ -1800,40 +1799,21 @@ def map_to_sectors( existing_sectors = existing_sectors[existing_sectors[ 'Sector'].isin(sectors[f"NAICS_{self.config['target_naics_year']}_Code"].values)] - # create list of sectors that exist in original df, which, - # if created when expanding sector list cannot be added - # todo: note, both naics6 and naics7 get mapped to naics6 - - # which could result in double counting... - naics_df = pd.DataFrame([]) + # drop parent sectors + existing_sectors_df = pd.DataFrame([]) for i in existing_sectors['Sector']: - dig = len(str(i)) n = existing_sectors[ existing_sectors['Sector'].apply( - lambda x: x[0:dig]) == i] + lambda x: x[0:len(str(i))] == i)] if len(n) == 1: - expanded_n = sectors[ - sectors[f"NAICS_{self.config['target_naics_year']}_Code"].apply( - lambda x: x[0:dig] == i)] - expanded_n = expanded_n.assign(Sector=i) - naics_df = pd.concat([naics_df, expanded_n]) - - activity_to_source_naics_crosswalk = ( - existing_sectors - .merge(naics_df, how='left') - .assign(Sector=lambda x: np.where( - x[f"NAICS_{self.config['target_naics_year']}_Code"].isna(), x['Sector'], - x[f"NAICS_{self.config['target_naics_year']}_Code"])) - .drop(columns=[f"NAICS_{self.config['target_naics_year']}_Code"]) - ) - - target_naics = list(naics - .industry_spec_key(self.config['industry_spec']) - .target_naics - .drop_duplicates()) + existing_sectors_df = pd.concat( + [existing_sectors_df, n]) + existing_sectors_list = existing_sectors_df[ + 'Sector'].values.tolist() activity_to_target_naics_crosswalk = ( - activity_to_source_naics_crosswalk - .query('Sector in @target_naics') + naics_key + .query('source_naics in @existing_sectors_list') ) fba_w_naics = self @@ -1843,12 +1823,12 @@ def map_to_sectors( .merge(activity_to_target_naics_crosswalk, how='left', left_on=f'Activity{direction}', - right_on='Activity') - .rename(columns={'Sector': f'Sector{direction}', + right_on='source_naics') + .rename(columns={'target_naics': f'Sector{direction}', 'SectorType': f'{direction}SectorType'}) .drop(columns=['ActivitySourceName', 'SectorSourceName', - 'Activity'], + 'source_naics'], errors='ignore') ) else: # either "flat" or "parent-inComplete" From 6f0cac6b35ff4b8f9d65c9bc8229ddf336b2458c Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 25 Jul 2023 15:12:08 -0600 Subject: [PATCH 0723/1127] update state land method --- .../flowbysectormethods/Land_state_2012.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Land_state_2012.yaml b/flowsa/methods/flowbysectormethods/Land_state_2012.yaml index 5056534cb..c6c574dec 100644 --- a/flowsa/methods/flowbysectormethods/Land_state_2012.yaml +++ b/flowsa/methods/flowbysectormethods/Land_state_2012.yaml @@ -60,9 +60,7 @@ source_names: selection_fields: PrimaryActivity: !from_index:BLM_PLS_2012_asets.csv hardrock_mining attribution_method: proportional - attribution_source: - Employment_state_2012: - data_format: FBS + attribution_source: Employment_state_2012 USDA_ERS_MLU: fedefl_mapping: USDA_ERS_MLU selection_fields: @@ -127,23 +125,26 @@ source_names: - 'Land in rural parks and wildlife areas' attribution_method: direct rural_transportation: + # first attribute to NAICS_6 because of clean_fba_w_sec multipliers + industry_spec: + default: NAICS_6 selection_fields: PrimaryActivity: - 'Land in rural transportation facilities' clean_fba_w_sec: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_land_in_rural_transportation_areas - geoscale: national attribution_method: direct urban: + # first attribute to NAICS_6 because of clean_fba_w_sec multipliers + industry_spec: + default: NAICS_6 selection_fields: PrimaryActivity: - 'Land in urban areas' clean_fba_w_sec: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_land_in_urban_areas - geoscale: national attribution_method: direct other: selection_fields: PrimaryActivity: - 'Other land' clean_fba_w_sec: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_other_land - geoscale: national attribution_method: direct \ No newline at end of file From bf393e86362edffec11059c6433e19461be43ae2 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 25 Jul 2023 15:13:11 -0600 Subject: [PATCH 0724/1127] put validation statement in try/except statement --- flowsa/flowby.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 2d631b8d4..e5d6835e0 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -610,13 +610,16 @@ def aggregate_flowby( 'FlowAmount']) # check flowamounts equal after aggregating - self_flow = self['FlowAmount'].sum() - agg_flow = aggregated['FlowAmount'].sum() - percent_diff = int(((agg_flow - self_flow) * 100) / self_flow) - if percent_diff > 0: - log.warning(f'There is an error in aggregating dataframe, as new ' - 'flow totals do not match original dataframe ' - 'flowtotals, there is a {percent_diff}% difference.') + try: + self_flow = self['FlowAmount'].sum() + agg_flow = aggregated['FlowAmount'].sum() + percent_diff = int(((agg_flow - self_flow) * 100) / self_flow) + if percent_diff > 0: + log.warning(f'There is an error in aggregating dataframe, as new ' + 'flow totals do not match original dataframe ' + 'flowtotals, there is a {percent_diff}% difference.') + except: + log.warning('Dataframe is empty.') return aggregated From 3a1b5783ae046652f78498359f16eccb802950ba Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 26 Jul 2023 14:27:55 -0400 Subject: [PATCH 0725/1127] fix path error for diff file --- flowsa/test_single_FBS.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/test_single_FBS.py b/flowsa/test_single_FBS.py index d16a3cc3e..e44aa2a2f 100644 --- a/flowsa/test_single_FBS.py +++ b/flowsa/test_single_FBS.py @@ -33,7 +33,7 @@ def compare_single_FBS_against_remote(m, outdir=diffpath, inplace=True) if len(df) > 0: print(f"Saving differences in {m} to csv") - df.to_csv(f"{outdir}{m}_diff.csv", index=False) + df.to_csv(f"{outdir}/{m}_diff.csv", index=False) else: print(f"***No differences found in {m}***") From 9dfdc37c120891392b2aedee296ff5891641d341 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 26 Jul 2023 12:34:00 -0600 Subject: [PATCH 0726/1127] exclude 'group_id' from groupby_cols --- flowsa/flowby.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index e5d6835e0..f1743512c 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -213,7 +213,8 @@ def flow_col(self) -> str: @property def groupby_cols(self) -> List[str]: return [x for x in self - if self[x].dtype in ['int', 'object'] and x != 'Description'] + if self[x].dtype in ['int', 'object'] and x not in + ['Description', 'group_id']] @classmethod def _getFlowBy( From f665d0e27c42b50cebf81d9014013ca2a0f577d1 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 26 Jul 2023 12:51:07 -0600 Subject: [PATCH 0727/1127] ony warn that rows are not mapped to sectors if the activities are not naics-like --- flowsa/flowby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index f1743512c..187892ea1 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -2007,7 +2007,7 @@ def map_to_sectors( # warn if any activities are not mapped to sectors not_mapped = fba_w_naics[fba_w_naics[['SectorProducedBy', 'SectorConsumedBy']].isna().all(1)] - if len(not_mapped) > 0: + if (len(not_mapped) > 0) & ("NAICS" not in activity_schema): not_mapped = (not_mapped [['ActivityProducedBy', 'ActivityConsumedBy']] .drop_duplicates()) From 6d053d31006d78e73f90c3c2d4a5b63e0880657a Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 26 Jul 2023 12:52:30 -0600 Subject: [PATCH 0728/1127] move code to drop rows not mapped to sectors outside if statement --- flowsa/flowby.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 187892ea1..32c349fe7 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -2016,8 +2016,9 @@ def map_to_sectors( set(zip(not_mapped.ActivityProducedBy, not_mapped.ActivityConsumedBy)) ) - fba_w_naics = fba_w_naics.dropna(subset=[ - 'SectorProducedBy', 'SectorConsumedBy'], how='all') + # drop rows of data that are not mapped to sectors + fba_w_naics = fba_w_naics.dropna(subset=[ + 'SectorProducedBy', 'SectorConsumedBy'], how='all') return ( fba_w_naics From 75d7c6d0c3c3ea1522828f3b97eafa57090d02cd Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 27 Jul 2023 21:50:31 -0400 Subject: [PATCH 0729/1127] split validation function to allow comparing specific dataframes more easily --- flowsa/validation.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/flowsa/validation.py b/flowsa/validation.py index ffbdba2e9..7fe84304e 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -583,7 +583,7 @@ def check_for_negative_flowamounts(df): def compare_FBS_results(fbs1, fbs2, ignore_metasources=False, compare_to_remote=False): """ - Compare a parquet on Data Commons to a parquet stored locally + Compare results for two methods :param fbs1: str, name of method 1 :param fbs2: str, name of method 2 :param ignore_metasources: bool, True to compare fbs without @@ -596,18 +596,23 @@ def compare_FBS_results(fbs1, fbs2, ignore_metasources=False, # load first file df1 = flowsa.getFlowBySector(fbs1, - download_FBS_if_missing=compare_to_remote - ).rename(columns={'FlowAmount': 'FlowAmount_fbs1'}) + download_FBS_if_missing=compare_to_remote) # load second file if compare_to_remote: # Generate the FBS locally and then immediately load - df2 = (FlowBySector.generateFlowBySector( - method=fbs2, download_sources_ok=True) - .rename(columns={'FlowAmount': 'FlowAmount_fbs2'})) + df2 = FlowBySector.generateFlowBySector( + method=fbs2, download_sources_ok=True) else: - df2 = flowsa.getFlowBySector(fbs2).rename( - columns={'FlowAmount': 'FlowAmount_fbs2'}) - # compare df + df2 = flowsa.getFlowBySector(fbs2) + df_m = compare_FBS(df1, df2) + + return df_m + + +def compare_FBS(df1, df2, ignore_metasources=False): + "Assess differences between two FBS dataframes." + df1 = df1.rename(columns={'FlowAmount': 'FlowAmount_fbs1'}) + df2 = df2.rename(columns={'FlowAmount': 'FlowAmount_fbs2'}) merge_cols = [c for c in df2.select_dtypes(include=[ 'object', 'int']).columns if c not in dq_fields] if ignore_metasources: @@ -655,7 +660,6 @@ def compare_FBS_results(fbs1, fbs2, ignore_metasources=False, df_m = df_m.sort_values(['Location', 'SectorProducedBy', 'SectorConsumedBy', 'Flowable', 'Context', ]).reset_index(drop=True) - return df_m From f302bc776f6adcf3285aca2e94850272793ff24e Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 27 Jul 2023 21:51:23 -0400 Subject: [PATCH 0730/1127] fix error causing extra column in CAP_HAP --- flowsa/data_source_scripts/stewiFBS.py | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/data_source_scripts/stewiFBS.py b/flowsa/data_source_scripts/stewiFBS.py index a1cf314a6..c7bacf101 100644 --- a/flowsa/data_source_scripts/stewiFBS.py +++ b/flowsa/data_source_scripts/stewiFBS.py @@ -184,6 +184,7 @@ def reassign_process_to_sectors(df, year, file_list, external_config_path): .pipe(addChemicalMatches) .pipe(stewicombo.overlaphandler.remove_NEI_overlaps, SCC=True) + .drop(columns=['_CompartmentPrimary'], errors='ignore') ) # merge in NAICS data From 3a46236964b2503a2c3cbdc7ba5be4104ca736f3 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 28 Jul 2023 13:19:43 -0400 Subject: [PATCH 0731/1127] update BEA Detail datasets to use `flat`, drop duplicate entries --- flowsa/data/source_catalog.yaml | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index e1bd74cd2..65c0db0d1 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -1,45 +1,33 @@ -BEA_GDP: - data_format: FBA - class: - - Money - activity_schema: BEA_2012_Detail_Code - sector_hierarchy: "parent-completeChild" BEA_GDP_GrossOutput: data_format: FBA class: - Money activity_schema: BEA_2012_Detail_Code - sector_hierarchy: "parent-completeChild" + sector_hierarchy: "flat" BEA_Make_AR: data_format: FBA class: - Money activity_schema: BEA_2012_Detail_Code - sector_hierarchy: "parent-completeChild" + sector_hierarchy: "flat" BEA_Make_Detail_BeforeRedef: data_format: FBA class: - Money activity_schema: BEA_2012_Detail_Code - sector_hierarchy: "parent-completeChild" + sector_hierarchy: "flat" BEA_Marine_Bunker_Fuel: data_format: FBA class: - Energy activity_schema: None sector_hierarchy: "flat" -BEA_Use: - data_format: FBA - class: - - Money - activity_schema: BEA_2012_Detail_Code - sector_hierarchy: "parent-completeChild" BEA_Use_Detail_PRO_BeforeRedef: data_format: FBA class: - Money activity_schema: BEA_2012_Detail_Code - sector_hierarchy: "parent-completeChild" + sector_hierarchy: "flat" Blackhurst_IO: data_format: FBA class: From fe7b5eeae54811e4b113710b367a924d8986f7de Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 28 Jul 2023 13:22:23 -0400 Subject: [PATCH 0732/1127] fix confusing logging messages --- flowsa/flowby.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 32c349fe7..aff608423 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -680,12 +680,7 @@ def attribute_flows_to_sectors( fb.config = {**parent_config, **step_config} - attribution_method = step_config.get('attribution_method', None) - if attribution_method is None: - log.warning('Attribution method is missing, assuming equal ' - 'attribution') - attribution_method = 'direct' - + attribution_method = step_config.get('attribution_method', 'direct') if 'attribution_source' in step_config: if isinstance(step_config['attribution_source'], str): attribution_name = step_config['attribution_source'] @@ -694,8 +689,6 @@ def attribute_flows_to_sectors( attribution_name = k if attribution_method in ['direct', 'inheritance']: - log.info(f"Directly attributing {self.full_name} to " - f"target sectors.") fb = fb.assign(AttributionSources='Direct') else: fb = fb.assign(AttributionSources=attribution_name) @@ -731,7 +724,7 @@ def attribute_flows_to_sectors( attributed_fb = fb.copy() else: - if attribution_method is None: + if step_config.get('attribution_method') is None: log.warning('No attribution method specified for %s. ' 'Using equal attribution as default.', fb.full_name) @@ -745,6 +738,8 @@ def attribute_flows_to_sectors( 'aggregation level', fb.full_name) attributed_fb = fb.copy() else: + log.info(f"Equally attributing {self.full_name} to " + f"target sectors.") attributed_fb = fb.equally_attribute() # depending on att method, check that new df values equal From 19eb2ef99a010ca78490bcb87b2d0f22b43957a8 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 28 Jul 2023 14:07:13 -0400 Subject: [PATCH 0733/1127] drop pipeline transport as sector for on-road alternative fuels --- flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv | 1 - 1 file changed, 1 deletion(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv index 6db661c3e..79c5272be 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI.csv @@ -48,7 +48,6 @@ EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,112,,,"EPA_GHGI_T_3_14, EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,113,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,114,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,485,,"485000, 486000, 48A000, 492000","EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,486,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,487,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,488,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" EPA_GHGI,Alternative Fuel On-Road,NAICS_2012_Code,492,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" From 61bdcc96133e8ecb1c9a57ecf6c930fb5d153a06 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 28 Jul 2023 12:16:00 -0600 Subject: [PATCH 0734/1127] drop taro from crosswalk as taro does not sum to its parent "vegetable totals" --- .../NAICS_Crosswalk_USDA_CoA_Cropland.csv | 1 - scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ACUP.py | 1 - .../write_Crosswalk_USDA_CoA_Cropland.py | 1 - 3 files changed, 3 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_USDA_CoA_Cropland.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_USDA_CoA_Cropland.csv index 1d9468eb3..03e486139 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_USDA_CoA_Cropland.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_USDA_CoA_Cropland.csv @@ -35,7 +35,6 @@ USDA_CoA_Cropland,TRITICALE,NAICS_2012_Code,111199I, USDA_CoA_Cropland,WILD RICE,NAICS_2012_Code,111199J, USDA_CoA_Cropland,EMMER & SPELT,NAICS_2012_Code,111199K, USDA_CoA_Cropland,VEGETABLE TOTALS,NAICS_2012_Code,1112, -USDA_CoA_Cropland,TARO,NAICS_2012_Code,111219, USDA_CoA_Cropland,ORCHARDS,NAICS_2012_Code,111310, USDA_CoA_Cropland,ORCHARDS,NAICS_2012_Code,111320, USDA_CoA_Cropland,ORCHARDS,NAICS_2012_Code,111331, diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ACUP.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ACUP.py index c14328f5a..f963a8263 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ACUP.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ACUP.py @@ -77,7 +77,6 @@ def assign_naics(df): # coa equivalent to vegetable and melon farming: 1112 df.loc[df['Activity'] == 'VEGETABLE TOTALS', 'Sector'] = '1112' # this category includes melons - df.loc[df['Activity'] == 'TARO', 'Sector'] = '111219' # coa aggregates to fruit and tree nut farming: 1113 # in 2017, pineapples included in "orchards" category. diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_CoA_Cropland.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_CoA_Cropland.py index a53f7c07d..a5b58419a 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_CoA_Cropland.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_CoA_Cropland.py @@ -92,7 +92,6 @@ def assign_naics(df): # coa equivalent to vegetable and melon farming: 1112 df.loc[df['Activity'] == 'VEGETABLE TOTALS', 'Sector'] = '1112' - df.loc[df['Activity'] == 'TARO', 'Sector'] = '111219' # coa aggregates to fruit and tree nut farming: 1113 # in 2017, pineapples included in "orchards" category. From e48bc3f7ccdff3ee0a3f921422690fd2ac8c0172 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 28 Jul 2023 15:08:07 -0400 Subject: [PATCH 0735/1127] further revise order of log messages --- flowsa/flowby.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index aff608423..441c7421a 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -723,21 +723,21 @@ def attribute_flows_to_sectors( 'sectors inherit parent values.') attributed_fb = fb.copy() - else: - if step_config.get('attribution_method') is None: - log.warning('No attribution method specified for %s. ' - 'Using equal attribution as default.', - fb.full_name) - elif attribution_method != 'direct': - log.error('Attribution method for %s not recognized: %s', - fb.full_name, attribution_method) - raise ValueError('Attribution method not recognized') + elif attribution_method != 'direct': + log.error('Attribution method for %s not recognized: %s', + fb.full_name, attribution_method) + raise ValueError('Attribution method not recognized') + else: if all(fb.groupby('group_id')['group_id'].agg('count') == 1): log.info('No attribution needed for %s at the given industry ' 'aggregation level', fb.full_name) attributed_fb = fb.copy() else: + if step_config.get('attribution_method') is None: + log.warning('No attribution method specified for %s. ' + 'Using equal attribution as default.', + fb.full_name) log.info(f"Equally attributing {self.full_name} to " f"target sectors.") attributed_fb = fb.equally_attribute() From 84b74950a086d7038a2e5eff028fe9aefe966a7b Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sat, 29 Jul 2023 20:59:00 -0400 Subject: [PATCH 0736/1127] fix error in ignore_metasources not getting passed --- flowsa/validation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/validation.py b/flowsa/validation.py index 7fe84304e..be50307d9 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -604,7 +604,7 @@ def compare_FBS_results(fbs1, fbs2, ignore_metasources=False, method=fbs2, download_sources_ok=True) else: df2 = flowsa.getFlowBySector(fbs2) - df_m = compare_FBS(df1, df2) + df_m = compare_FBS(df1, df2, ignore_metasources=ignore_metasources) return df_m From a52db57a4f69feb1e4b7aa336a86a81eeae63c04 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sat, 29 Jul 2023 21:01:51 -0400 Subject: [PATCH 0737/1127] specify _m1 for base CAP_HAP method to avoid errors in accessing from data commons --- .github/workflows/compare_single_FBS.yml | 2 +- flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml | 5 ----- ..._HAP_national_2017.yaml => CAP_HAP_national_2017_m1.yaml} | 0 .../flowbysectormethods/CAP_HAP_national_2017_m2.yaml | 2 +- ..._HAP_national_2020.yaml => CAP_HAP_national_2020_m1.yaml} | 0 5 files changed, 2 insertions(+), 7 deletions(-) rename flowsa/methods/flowbysectormethods/{CAP_HAP_national_2017.yaml => CAP_HAP_national_2017_m1.yaml} (100%) rename flowsa/methods/flowbysectormethods/{CAP_HAP_national_2020.yaml => CAP_HAP_national_2020_m1.yaml} (100%) diff --git a/.github/workflows/compare_single_FBS.yml b/.github/workflows/compare_single_FBS.yml index a563ab0f0..7a002bd3a 100644 --- a/.github/workflows/compare_single_FBS.yml +++ b/.github/workflows/compare_single_FBS.yml @@ -8,7 +8,7 @@ on: method: description: "FBS" required: true - default: "CAP_HAP_national_2017" + default: "CAP_HAP_national_2017_m1" jobs: build: diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml index 302980033..1d668a76e 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml @@ -18,9 +18,6 @@ sources_to_cache: - Table 2.2 - Table 3.2 estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy - # todo: delete below code now that mecs reassigned to "parent-incompleteChild" -# clean_fba: !script_function:EIA_MECS define_parentincompletechild_descendants -# clean_fba_w_sec: !script_function:EIA_MECS drop_parentincompletechild_descendants attribution_method: proportional # attribution_source: # Employment_national_2018: # Use target MECS year @@ -39,8 +36,6 @@ sources_to_cache: exclusion_fields: Location: '00000' estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy - # todo: delete below code now that mecs reassigned to "parent-incompleteChild" -# clean_fba: !script_function:EIA_MECS define_parentincompletechild_descendants clean_fba_after_attribution: !script_function:EIA_MECS clean_mapped_mecs_energy_fba_to_state clean_source: Employment_state_2018 ## Update to MECS year diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m1.yaml similarity index 100% rename from flowsa/methods/flowbysectormethods/CAP_HAP_national_2017.yaml rename to flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m1.yaml diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m2.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m2.yaml index 2b00a00a0..cc67eb5f0 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m2.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m2.yaml @@ -19,7 +19,7 @@ sources_to_cache: source_names: EPA_NEI_Nonpoint: - !include:CAP_HAP_national_2017.yaml:source_names:EPA_NEI_Nonpoint + !include:CAP_HAP_national_2017_m1.yaml:source_names:EPA_NEI_Nonpoint apply_urban_rural: True year: *year diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2020.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2020_m1.yaml similarity index 100% rename from flowsa/methods/flowbysectormethods/CAP_HAP_national_2020.yaml rename to flowsa/methods/flowbysectormethods/CAP_HAP_national_2020_m1.yaml From 7019a73fda4ef833268abcb1004a833a5338154d Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 2 Aug 2023 10:48:54 -0600 Subject: [PATCH 0738/1127] update land fbs fxn calls to reset group ids --- flowsa/data_source_scripts/USDA_ERS_MLU.py | 48 +++++++++++++++------- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/flowsa/data_source_scripts/USDA_ERS_MLU.py b/flowsa/data_source_scripts/USDA_ERS_MLU.py index 3cec84768..14df61974 100644 --- a/flowsa/data_source_scripts/USDA_ERS_MLU.py +++ b/flowsa/data_source_scripts/USDA_ERS_MLU.py @@ -23,6 +23,7 @@ get_urban_land_use_for_railroads, get_open_space_fraction_of_urban_area from flowsa.validation import compare_df_units from flowsa.flowby import FlowByActivity +from flowsa.naics import industry_spec_key def mlu_call(*, resp, **_): @@ -119,9 +120,17 @@ def allocate_usda_ers_mlu_land_in_urban_areas( # load the federal highway administration fees dictionary fha_dict = get_transportation_sectors_based_on_FHA_fees() - df_fha = pd.DataFrame.from_dict( - fha_dict, orient='index').rename( - columns={'NAICS_2012_Code': sector_col}) + df_fha = pd.DataFrame.from_dict(fha_dict, orient='index') + # set new group_id column + df_fha = df_fha.assign(group_id=range(4, len(df_fha) + 4)) + # map to target sectors + naics_key = industry_spec_key(fba.config['industry_spec']) + df_fha = (df_fha + .merge(naics_key, how='left', left_on='NAICS_2012_Code', + right_on='source_naics') + .drop(columns=['NAICS_2012_Code', 'source_naics']) + .rename(columns={'target_naics': sector_col}) + ) # calculate total residential area from the American Housing Survey residential_land_area = get_area_of_urban_land_occupied_by_houses_2013() @@ -133,6 +142,8 @@ def allocate_usda_ers_mlu_land_in_urban_areas( df_openspace = fba[fba[sector_col] == '712190'] df_openspace = df_openspace.assign( FlowAmount=df_openspace['FlowAmount'] * openspace_multiplier) + # reset gorup_id + df_openspace['group_id'] = 1 # sum all uses of urban area that are NOT transportation # first concat dfs for residential, openspace, commercial, @@ -160,6 +171,8 @@ def allocate_usda_ers_mlu_land_in_urban_areas( df_airport = df_transport[df_transport[sector_col] == '488119'] df_airport = df_airport.assign( FlowAmount=df_airport['FlowAmount'] * airport_multiplier) + # reset gorup_id + df_airport['group_id'] = 2 # make an assumption about the percent of urban transport # area used by railroads @@ -167,6 +180,8 @@ def allocate_usda_ers_mlu_land_in_urban_areas( df_railroad = df_transport[df_transport[sector_col] == '482112'] df_railroad = df_railroad.assign( FlowAmount=df_railroad['FlowAmount'] * railroad_multiplier) + # reset gorup_id + df_railroad['group_id'] = 3 # further allocate the remaining urban transportation area using # Federal Highway Administration fees @@ -180,7 +195,7 @@ def allocate_usda_ers_mlu_land_in_urban_areas( df_highway = df_transport.merge(air_rail_area_sum, how='left') df_highway = df_highway.assign( FlowAmount=df_highway['FlowAmount'] - df_highway['AirRail']) - df_highway.drop(columns=['AirRail'], inplace=True) + df_highway.drop(columns=['AirRail', 'group_id'], inplace=True) # add fed highway administration fees df_highway2 = df_highway.merge(df_fha, how='left') @@ -194,13 +209,7 @@ def allocate_usda_ers_mlu_land_in_urban_areas( [df_residential, df_openspace, df_airport, df_railroad, df_highway2], ignore_index=True, sort=False).reset_index(drop=True) - # aggregate because multiple rows to household data due to residential - # land area and highway fee shares - allocated_urban_areas_df_2 = allocated_urban_areas_df.aggregate_flowby() - allocated_urban_areas_df_2 = allocated_urban_areas_df_2.assign( - group_id=allocated_urban_areas_df_2.index.astype(str)) - - return allocated_urban_areas_df_2 + return allocated_urban_areas_df def allocate_usda_ers_mlu_land_in_rural_transportation_areas( @@ -230,8 +239,17 @@ def allocate_usda_ers_mlu_land_in_rural_transportation_areas( # load the federal highway administration fees dictionary fha_dict = get_transportation_sectors_based_on_FHA_fees() - df_fha = pd.DataFrame.from_dict(fha_dict, orient='index').rename( - columns={'NAICS_2012_Code': sector_col}) + df_fha = pd.DataFrame.from_dict(fha_dict, orient='index') + # set new group_id column + df_fha = df_fha.assign(group_id=range(2, len(df_fha) + 2)) + # map to target sectors + naics_key = industry_spec_key(fba.config['industry_spec']) + df_fha = (df_fha + .merge(naics_key, how='left', left_on='NAICS_2012_Code', + right_on='source_naics') + .drop(columns=['NAICS_2012_Code', 'source_naics']) + .rename(columns={'target_naics': sector_col}) + ) # make an assumption about the percent of rural transport # area used by airports @@ -246,6 +264,8 @@ def allocate_usda_ers_mlu_land_in_rural_transportation_areas( df_railroad = fba[fba[sector_col] == '482112'] df_railroad = df_railroad.assign( FlowAmount=df_railroad['FlowAmount'] * railroad_multiplier) + # reset gorup_id + df_railroad['group_id'] = 1 # further allocate the remaining urban transportation area # using Federal Highway Administration fees @@ -261,7 +281,7 @@ def allocate_usda_ers_mlu_land_in_rural_transportation_areas( df_highway = fba.merge(air_rail_area_sum, how='left') df_highway = df_highway.assign( FlowAmount=df_highway['FlowAmount'] - df_highway['AirRail']) - df_highway.drop(columns=['AirRail'], inplace=True) + df_highway.drop(columns=['AirRail', 'group_id'], inplace=True) # add fed highway administration fees df_highway2 = df_highway.merge(df_fha, how='left') From 1659a1dc17adfe88708d23d4464738159381ea34 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 2 Aug 2023 21:49:14 -0400 Subject: [PATCH 0739/1127] specify version number for stateio datasets --- flowsa/data_source_scripts/stateio.py | 5 ++--- flowsa/methods/flowbyactivitymethods/stateio_Common.yaml | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/flowsa/data_source_scripts/stateio.py b/flowsa/data_source_scripts/stateio.py index 1bd9eaf74..c7ecd0514 100644 --- a/flowsa/data_source_scripts/stateio.py +++ b/flowsa/data_source_scripts/stateio.py @@ -20,13 +20,12 @@ def parse_statior(*, source, year, config, **_): """parse_response_fxn for stateio make and use tables""" # Prepare meta for downloading stateior datasets name = config.get('datatype') - fname = f"{name}_{year}" + fname = f"{name}_{year}_{config.get('version')}" meta = set_fb_meta(fname, "") meta.tool = 'stateio' meta.ext = 'rds' stateio_paths = Paths() - stateio_paths.local_path = os.path.realpath(stateio_paths.local_path + - "/stateio") + stateio_paths.local_path = stateio_paths.local_path / "stateio" # Download and load the latest version from remote download_from_remote(meta, stateio_paths) states = load_preprocessed_output(meta, stateio_paths) diff --git a/flowsa/methods/flowbyactivitymethods/stateio_Common.yaml b/flowsa/methods/flowbyactivitymethods/stateio_Common.yaml index aa7fd8406..6d580e935 100644 --- a/flowsa/methods/flowbyactivitymethods/stateio_Common.yaml +++ b/flowsa/methods/flowbyactivitymethods/stateio_Common.yaml @@ -18,4 +18,5 @@ years: - 2018 - 2019 - 2020 +version: 0.2.1 # datatype: 'State_Summary_Make' # Update for each dataset From 26e3918dc6cdcb333deab313ea5b59800962ffc2 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 2 Aug 2023 22:08:38 -0400 Subject: [PATCH 0740/1127] update url for EPA_StateGHGI --- flowsa/methods/flowbyactivitymethods/EPA_StateGHGI.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/methods/flowbyactivitymethods/EPA_StateGHGI.yaml b/flowsa/methods/flowbyactivitymethods/EPA_StateGHGI.yaml index 2be40a492..dba0b49e9 100644 --- a/flowsa/methods/flowbyactivitymethods/EPA_StateGHGI.yaml +++ b/flowsa/methods/flowbyactivitymethods/EPA_StateGHGI.yaml @@ -4,7 +4,7 @@ source_url: 'https://www.epa.gov/ghgemissions/state-ghg-emissions-and-removals' bib_id: '' format: zip # .zip file with .xlsx file url: - base_url: 'https://www.epa.gov/system/files/other-files/2023-04/AllStateData%2BReadMe_042623_2.zip' + base_url: 'https://www.epa.gov/system/files/other-files/2023-05/AllStateData-ReadMe_042623.zip' call_response_fxn: !script_function:EPA_StateGHGI epa_state_ghgi_call parse_response_fxn: !script_function:EPA_StateGHGI epa_state_ghgi_parse file: 'AllStateGHGData_042623.xlsx' From a50b3eca4ed04ef830c585103342eab0756e22f9 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 2 Aug 2023 22:25:11 -0400 Subject: [PATCH 0741/1127] move GHG_state methods and data to flowsa --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 277 ++++++++++++++++++ .../EPA_StateGHGI_asets.csv | 153 ++++++++++ .../flowbysectormethods/GHG_state_2012.yaml | 97 ++++++ .../flowbysectormethods/GHG_state_2013.yaml | 97 ++++++ .../flowbysectormethods/GHG_state_2014.yaml | 97 ++++++ .../flowbysectormethods/GHG_state_2015.yaml | 97 ++++++ .../flowbysectormethods/GHG_state_2016.yaml | 97 ++++++ .../flowbysectormethods/GHG_state_2017.yaml | 97 ++++++ .../flowbysectormethods/GHG_state_2018.yaml | 97 ++++++ .../flowbysectormethods/GHG_state_2019.yaml | 97 ++++++ .../flowbysectormethods/GHG_state_2020.yaml | 97 ++++++ .../flowbysectormethods/GHG_state_common.yaml | 271 +++++++++++++++++ 12 files changed, 1574 insertions(+) create mode 100644 flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv create mode 100644 flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv create mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2012.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2013.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2014.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2015.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2016.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2017.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2018.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2019.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2020.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_state_common.yaml diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv new file mode 100644 index 000000000..4cbaf2210 --- /dev/null +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -0,0 +1,277 @@ +ActivitySourceName,Activity,SectorSourceName,Sector,SectorType,Notes +EPA_State_GHGI,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Direct - Cropland,NAICS_2012_Code,111,,direct +EPA_State_GHGI,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Direct - Grassland,NAICS_2012_Code,112,,direct +EPA_State_GHGI,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Indirect - Cropland,NAICS_2012_Code,111,,direct +EPA_State_GHGI,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Indirect - Grassland,NAICS_2012_Code,112,,direct +EPA_State_GHGI,Agriculture - Enteric Fermentation - American Bison,NAICS_2012_Code,1129,,direct +EPA_State_GHGI,Agriculture - Enteric Fermentation - Beef Cattle,NAICS_2012_Code,1121,,direct +EPA_State_GHGI,Agriculture - Enteric Fermentation - Dairy Cattle,NAICS_2012_Code,1121,,direct +EPA_State_GHGI,Agriculture - Enteric Fermentation - Goats,NAICS_2012_Code,1124,,direct +EPA_State_GHGI,Agriculture - Enteric Fermentation - Horses,NAICS_2012_Code,1129,,direct +EPA_State_GHGI,Agriculture - Enteric Fermentation - Mules and Asses,NAICS_2012_Code,1129,,direct +EPA_State_GHGI,Agriculture - Enteric Fermentation - Sheep,NAICS_2012_Code,1124,,direct +EPA_State_GHGI,Agriculture - Enteric Fermentation - Swine,NAICS_2012_Code,1122,,direct +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Barley,NAICS_2012_Code,1111,,direct +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Chickpeas,NAICS_2012_Code,1111,,direct +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Cotton,NAICS_2012_Code,1119,,direct +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Dry Beans,NAICS_2012_Code,1111,,direct +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Grass Hay,NAICS_2012_Code,1119,,direct +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Legume Hay,NAICS_2012_Code,1119,,direct +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Lentils,NAICS_2012_Code,1111,,direct +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Maize,NAICS_2012_Code,1111,,direct +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Oats,NAICS_2012_Code,1111,,direct +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Other Small Grains,NAICS_2012_Code,1111,,direct +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Peanuts,NAICS_2012_Code,1119,,direct +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Peas,NAICS_2012_Code,1112,,direct +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Potatoes,NAICS_2012_Code,1112,,direct +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Rice,NAICS_2012_Code,1111,,direct +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Sorghum,NAICS_2012_Code,1111,,direct +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Soybeans,NAICS_2012_Code,1111,,direct +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Sugarbeets,NAICS_2012_Code,1119,,direct +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Sunflower,NAICS_2012_Code,1111,,direct +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Tobacco,NAICS_2012_Code,1119,,direct +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Vegetables,NAICS_2012_Code,1112,,direct +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Wheat,NAICS_2012_Code,1111,,direct +EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Dolomite",NAICS_2012_Code,3274,,direct +EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Limestone",NAICS_2012_Code,3274,,direct +EPA_State_GHGI,Agriculture - Manure Management - American Bison,NAICS_2012_Code,1129,,direct +EPA_State_GHGI,Agriculture - Manure Management - Beef Cattle,NAICS_2012_Code,1121,,direct +EPA_State_GHGI,Agriculture - Manure Management - Bison,NAICS_2012_Code,1129,,direct +EPA_State_GHGI,Agriculture - Manure Management - Dairy Cattle,NAICS_2012_Code,1121,,direct +EPA_State_GHGI,Agriculture - Manure Management - Dairy Heifers,NAICS_2012_Code,1121,,direct +EPA_State_GHGI,Agriculture - Manure Management - Goats,NAICS_2012_Code,1124,,direct +EPA_State_GHGI,Agriculture - Manure Management - Horses,NAICS_2012_Code,1129,,direct +EPA_State_GHGI,Agriculture - Manure Management - Mules and Asses,NAICS_2012_Code,1129,,direct +EPA_State_GHGI,Agriculture - Manure Management - Poultry,NAICS_2012_Code,1123,,direct +EPA_State_GHGI,Agriculture - Manure Management - Sheep,NAICS_2012_Code,1124,,direct +EPA_State_GHGI,Agriculture - Manure Management - Swine,NAICS_2012_Code,1122,,direct +EPA_State_GHGI,Agriculture - Rice Cultivation,NAICS_2012_Code,1111,,direct +EPA_State_GHGI,"Agriculture - Urea Fertilization - CO2 emissions from liming, urea application and other carbon-containing fertilizers",NAICS_2012_Code,111,,ag +EPA_State_GHGI,"Agriculture - Urea Fertilization - CO2 emissions from liming, urea application and other carbon-containing fertilizers",NAICS_2012_Code,112,,ag +EPA_State_GHGI,Industry - Abandoned Oil and Gas Wells - Fugitive - Abandoned Wells,NAICS_2012_Code,2111,,direct +EPA_State_GHGI,Industry - Abandoned Underground Coal Mines - Fugitive - Coal Mining - Abandoned Coal Mines - Liberated,NAICS_2012_Code,2121,,direct +EPA_State_GHGI,Industry - Abandoned Underground Coal Mines - Fugitive - Coal Mining - Abandoned Coal Mines - Recovered &Used,NAICS_2012_Code,2121,,direct +EPA_State_GHGI,Industry - Coal Mining - Fugitive - CO2 From Methane Flaring,NAICS_2012_Code,2121,,direct +EPA_State_GHGI,Industry - Coal Mining - Fugitive - Underground Recovered &Used,NAICS_2012_Code,2121,,direct +EPA_State_GHGI,Industry - Coal Mining - Fugitive - Post-Mining (Surface),NAICS_2012_Code,2121,,direct +EPA_State_GHGI,Industry - Coal Mining - Fugitive - Post-Mining (Underground),NAICS_2012_Code,2121,,direct +EPA_State_GHGI,Industry - Coal Mining - Fugitive - Surface Mining,NAICS_2012_Code,2121,,direct +EPA_State_GHGI,Industry - Coal Mining - Fugitive - Underground Liberated,NAICS_2012_Code,2121,,direct +EPA_State_GHGI,Industry - Coal Mining - Fugitive - Underground Recovered &Used For Energy,NAICS_2012_Code,2121,,direct +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,2213,,use_table_gas +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,42,,use_table_gas +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,44,,use_table_gas +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,45,,use_table_gas +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,493,,use_table_gas +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,51,,use_table_gas +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,52,,use_table_gas +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,53,,use_table_gas +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,54,,use_table_gas +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,55,,use_table_gas +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,56,,use_table_gas +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,61,,use_table_gas +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,62,,use_table_gas +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,71,,use_table_gas +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,72,,use_table_gas +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,81,,use_table_gas +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,2213,,use_table_coal +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,42,,use_table_coal +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,44,,use_table_coal +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,45,,use_table_coal +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,493,,use_table_coal +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,51,,use_table_coal +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,52,,use_table_coal +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,53,,use_table_coal +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,54,,use_table_coal +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,55,,use_table_coal +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,56,,use_table_coal +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,61,,use_table_coal +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,62,,use_table_coal +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,71,,use_table_coal +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,72,,use_table_coal +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,81,,use_table_coal +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,2213,,use_table_gas +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,42,,use_table_gas +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,44,,use_table_gas +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,45,,use_table_gas +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,493,,use_table_gas +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,51,,use_table_gas +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,52,,use_table_gas +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,53,,use_table_gas +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,54,,use_table_gas +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,55,,use_table_gas +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,56,,use_table_gas +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,61,,use_table_gas +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,62,,use_table_gas +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,71,,use_table_gas +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,72,,use_table_gas +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,81,,use_table_gas +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,2213,,use_table_pet +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,42,,use_table_pet +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,44,,use_table_pet +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,45,,use_table_pet +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,493,,use_table_pet +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,51,,use_table_pet +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,52,,use_table_pet +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,53,,use_table_pet +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,54,,use_table_pet +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,55,,use_table_pet +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,56,,use_table_pet +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,61,,use_table_pet +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,62,,use_table_pet +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,71,,use_table_pet +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,72,,use_table_pet +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,81,,use_table_pet +EPA_State_GHGI,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation,NAICS_2012_Code,2211,,direct +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Coal,NAICS_2012_Code,2211,,direct +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Geothermal,NAICS_2012_Code,2211,,direct +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Natural Gas,NAICS_2012_Code,2211,,direct +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum,NAICS_2012_Code,2211,,direct +EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,31,,industrial_ch4_n2o +EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,32,,industrial_ch4_n2o +EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,33,,industrial_ch4_n2o +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,31,,industrial_coal +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,32,,industrial_coal +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,33,,industrial_coal +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,31,,industrial_gas +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,32,,industrial_gas +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,33,,industrial_gas +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,NAICS_2012_Code,31,,industrial_petroleum +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,NAICS_2012_Code,32,,industrial_petroleum +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,NAICS_2012_Code,33,,industrial_petroleum +EPA_State_GHGI,Residential - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,F010,,direct +EPA_State_GHGI,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,F010,,direct +EPA_State_GHGI,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,F010,,direct +EPA_State_GHGI,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,F010,,direct +EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,482,,direct +EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,486,,transport_ng +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway,NAICS_2012_Code,48,,transport_petroleum +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway,NAICS_2012_Code,491,,transport_petroleum +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway,NAICS_2012_Code,492,,transport_petroleum +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway,NAICS_2012_Code,F010,,transport_petroleum +EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,48,,transport_petroleum +EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,491,,transport_petroleum +EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,492,,transport_petroleum +EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,F010,,transport_petroleum +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,NAICS_2012_Code,484,,transport_diesel +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,NAICS_2012_Code,F010,,transport_gasoline +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Non-Highway,NAICS_2012_Code,481,,transport_nonroad +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Non-Highway,NAICS_2012_Code,482,,transport_nonroad +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Non-Highway,NAICS_2012_Code,483,,transport_nonroad +EPA_State_GHGI,U.S. Territories - Stationary Combustion - Fossil Fuel Combustion - US Territories,,,,exclude - territories +EPA_State_GHGI,U.S. Territories - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - US Territories - Coal,,,,exclude - territories +EPA_State_GHGI,U.S. Territories - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - US Territories - Natural Gas,,,,exclude - territories +EPA_State_GHGI,U.S. Territories - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - US Territories - Petroleum,,,,exclude - territories +EPA_State_GHGI,Electric Power Industry - Incineration of Waste - Incineration,NAICS_2012_Code,562213,,direct +EPA_State_GHGI,Industry - Natural Gas Systems - Fugitive,NAICS_2012_Code,2111,,direct +EPA_State_GHGI,Industry - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - Industrial,NAICS_2012_Code,31,,industrial_neu +EPA_State_GHGI,Industry - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - Industrial,NAICS_2012_Code,32,,industrial_neu +EPA_State_GHGI,Industry - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - Industrial,NAICS_2012_Code,33,,industrial_neu +EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,48,,transport_petroleum +EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,491,,transport_petroleum +EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,492,,transport_petroleum +EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,F010,,transport_petroleum +EPA_State_GHGI,U.S. Territories - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - US Territories,,,,exclude - territories +EPA_State_GHGI,Industry - Petroleum Systems - Fugitive,NAICS_2012_Code,2111,,direct (or 3241?) +EPA_State_GHGI,Agriculture - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,NAICS_2012_Code,111,,use_table_pet +EPA_State_GHGI,Agriculture - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,NAICS_2012_Code,112,,use_table_pet +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,481,,transport_nonroad +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,482,,transport_nonroad +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,483,,transport_nonroad +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,NAICS_2012_Code,481,,transport_nonroad +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,NAICS_2012_Code,482,,transport_nonroad +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,NAICS_2012_Code,483,,transport_nonroad +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,481,,transport_nonroad +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,482,,transport_nonroad +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,483,,transport_nonroad +EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,2213,,ods_substitutes +EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,42,,ods_substitutes +EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,44,,ods_substitutes +EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,45,,ods_substitutes +EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,493,,ods_substitutes +EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,51,,ods_substitutes +EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,52,,ods_substitutes +EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,53,,ods_substitutes +EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,54,,ods_substitutes +EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,55,,ods_substitutes +EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,56,,ods_substitutes +EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,61,,ods_substitutes +EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,62,,ods_substitutes +EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,71,,ods_substitutes +EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,72,,ods_substitutes +EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,81,,ods_substitutes +EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,31,,ods_substitutes +EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,32,,ods_substitutes +EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,33,,ods_substitutes +EPA_State_GHGI,Residential - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Residential,NAICS_2012_Code,F010,,direct_ods +EPA_State_GHGI,Transportation - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Transportation,NAICS_2012_Code,F010,,direct_ods +EPA_State_GHGI,Industry - Adipic Acid Production - Chemical Industry,NAICS_2012_Code,3251,,direct +EPA_State_GHGI,Industry - Ammonia Production - Chemical Industry,NAICS_2012_Code,3313,,direct +EPA_State_GHGI,"Industry - Caprolactam, Glyoxal,and Glyoxylic Acid Production - Chemical Industry - Caprolactam Production",NAICS_2012_Code,3251,,direct +EPA_State_GHGI,Industry - Nitric Acid Production - Chemical Industry,NAICS_2012_Code,3253,,direct +EPA_State_GHGI,Industry - Petrochemical Production - Chemical Industry - Acrylonitrile,NAICS_2012_Code,3251,,direct +EPA_State_GHGI,Industry - Petrochemical Production - Chemical Industry - Carbon Black,NAICS_2012_Code,3251,,direct +EPA_State_GHGI,Industry - Petrochemical Production - Chemical Industry - Ethylene,NAICS_2012_Code,3241,,direct +EPA_State_GHGI,Industry - Petrochemical Production - Chemical Industry - Ethylene Dichloride,NAICS_2012_Code,3251,,direct +EPA_State_GHGI,Industry - Petrochemical Production - Chemical Industry - Ethylene Oxide,NAICS_2012_Code,3251,,direct +EPA_State_GHGI,Industry - Petrochemical Production - Chemical Industry - Methanol,NAICS_2012_Code,3251,,direct +EPA_State_GHGI,Industry - Phosphoric Acid Production - Chemical Industry,NAICS_2012_Code,3253,,direct +EPA_State_GHGI,Industry - Carbide Production and Consumption - Chemical Industry - Silicon Carbide Production and Consumption,NAICS_2012_Code,3251,,direct +EPA_State_GHGI,Industry - Soda Ash Production - Chemical Industry,NAICS_2012_Code,3251,,direct +EPA_State_GHGI,Industry - Titanium Dioxide Production - Chemical Industry,NAICS_2012_Code,3251,,direct +EPA_State_GHGI,Industry - Urea Consumption for Non-Agricultural Purposes - Chemical Industry - Urea Consumption for Non-Agricultural Uses,NAICS_2012_Code,31,,use_table_chem +EPA_State_GHGI,Industry - Urea Consumption for Non-Agricultural Purposes - Chemical Industry - Urea Consumption for Non-Agricultural Uses,NAICS_2012_Code,32,,use_table_chem +EPA_State_GHGI,Industry - Urea Consumption for Non-Agricultural Purposes - Chemical Industry - Urea Consumption for Non-Agricultural Uses,NAICS_2012_Code,33,,use_table_chem +EPA_State_GHGI,Industry - Electronics Industry - Micro-Electro-Mechanical Devices,NAICS_2012_Code,3332,,direct +EPA_State_GHGI,Industry - Electronics Industry - Photovoltaics,NAICS_2012_Code,334413,,direct +EPA_State_GHGI,Industry - Electronics Industry - Semiconductor Manufacture,NAICS_2012_Code,3332,,direct +EPA_State_GHGI,Industry - Electronics Industry - Semiconductor Manufacture - Heat Transfer Fluids,NAICS_2012_Code,3332,,direct +EPA_State_GHGI,Industry - Aluminum Production - Metal Industry,NAICS_2012_Code,3313,,direct +EPA_State_GHGI,Industry - Ferroalloy Production - Metal Industry,NAICS_2012_Code,3311,,direct +EPA_State_GHGI,Industry - Iron and Steel Production - Metal Industry - Iron Production,NAICS_2012_Code,3311,,direct +EPA_State_GHGI,Industry - Iron and Steel Production - Metal Industry - Metallurgical Coke Production,NAICS_2012_Code,3311,,direct +EPA_State_GHGI,Industry - Iron and Steel Production - Metal Industry - Other Activities,NAICS_2012_Code,3311,,direct +EPA_State_GHGI,Industry - Iron and Steel Production - Metal Industry - Pellet Production,NAICS_2012_Code,3311,,direct +EPA_State_GHGI,Industry - Iron and Steel Production - Metal Industry - Sinter Production,NAICS_2012_Code,3311,,direct +EPA_State_GHGI,Industry - Iron and Steel Production - Metal Industry - Steel Production,NAICS_2012_Code,3311,,direct +EPA_State_GHGI,Industry - Lead Production - Metal Industry,NAICS_2012_Code,3314,,direct +EPA_State_GHGI,Industry - Magnesium Production and Processing - Metal Industry,NAICS_2012_Code,331,,direct +EPA_State_GHGI,Industry - Zinc Production - Metal Industry,NAICS_2012_Code,3314,,direct +EPA_State_GHGI,Industry - Carbon Dioxide Consumption - Mineral Industry,,,,exclude +EPA_State_GHGI,Industry - Cement Production - Mineral Industry - Cement Manufacture,NAICS_2012_Code,3273,,direct +EPA_State_GHGI,Industry - Glass Production - Mineral Industry,NAICS_2012_Code,3272,,direct +EPA_State_GHGI,Industry - Lime Production - Mineral Industry - Lime Manufacture,NAICS_2012_Code,3274,,direct +EPA_State_GHGI,Industry - Other Process Uses of Carbonates - Mineral Industry,NAICS_2012_Code,31,,use_table_chem +EPA_State_GHGI,Industry - Other Process Uses of Carbonates - Mineral Industry,NAICS_2012_Code,32,,use_table_chem +EPA_State_GHGI,Industry - Other Process Uses of Carbonates - Mineral Industry,NAICS_2012_Code,33,,use_table_chem +EPA_State_GHGI,Electric Power Industry - Electrical Transmission and Distribution - Other product manufacture and use - Electric Power Systems,NAICS_2012_Code,22112,,direct +EPA_State_GHGI,Electric Power Industry - Electrical Transmission and Distribution - Other product manufacture and use - Equipment OEM,NAICS_2012_Code,22112,,direct +EPA_State_GHGI,Industry - HCFC-22 Production - Production and Use of Fluorinated Gases,NAICS_2012_Code,325120,,direct +EPA_State_GHGI,Commercial - Composting,NAICS_2012_Code,562219,,direct +EPA_State_GHGI,Commercial - Anaerobic Digestion at Biogas Facility - Anaerobic Digestion at Biogas Facilities,NAICS_2012_Code,5622,,direct +EPA_State_GHGI,Industry - Landfills - Industrial - Landfills - Industrial Landfill - Industrial Waste Landfills Net Emissions,NAICS_2012_Code,562212,,direct +EPA_State_GHGI,Commercial - Landfills - Municipal - Landfills - MSW Landfill - MSW Landfills Net Emissions,NAICS_2012_Code,562212,,direct +EPA_State_GHGI,Industry - Wastewater Treatment - Wastewater Treatment and Discharge - Industrial,NAICS_2012_Code,2213,,direct +EPA_State_GHGI,Commercial - Wastewater Treatment - Wastewater Treatment and Discharge - Domestic,NAICS_2012_Code,2213,,direct +EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,111,,transport_machinery +EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,112,,transport_machinery +EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,113,,transport_machinery +EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,114,,transport_machinery +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,31,,industrial_petroleum +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,32,,industrial_petroleum +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,33,,industrial_petroleum +EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,111,,transport_machinery +EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,112,,transport_machinery +EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,113,,transport_machinery +EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,114,,transport_machinery +EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,NAICS_2012_Code,23,,transport_machinery +EPA_State_GHGI,Electric Power Industry - Other Process Uses of Carbonates - Mineral Industry,NAICS_2012_Code,2211,,direct +EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,31,,transport_nonroad +EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,32,,transport_nonroad +EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,33,,transport_nonroad +EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,NAICS_2012_Code,31,,industrial_ch4_n2o +EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,NAICS_2012_Code,32,,industrial_ch4_n2o +EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,NAICS_2012_Code,33,,industrial_ch4_n2o +EPA_State_GHGI,Industry - N2O from Product Uses - Other product manufacture and use,NAICS_2012_Code,621,,use_table_chem +EPA_State_GHGI,Industry - N2O from Product Uses - Other product manufacture and use,NAICS_2012_Code,622,,use_table_chem +EPA_State_GHGI,Industry - N2O from Product Uses - Other product manufacture and use,NAICS_2012_Code,623,,use_table_chem diff --git a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv new file mode 100644 index 000000000..7c7ee367f --- /dev/null +++ b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv @@ -0,0 +1,153 @@ +activity_set,name,note +direct,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Direct - Cropland,EPA_GHGI_T_5_18 +direct,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Direct - Grassland,EPA_GHGI_T_5_18 +direct,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Indirect - Cropland,EPA_GHGI_T_5_19 +direct,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Indirect - Grassland,EPA_GHGI_T_5_19 +direct,Agriculture - Enteric Fermentation - American Bison,EPA_GHGI_T_5_3 +direct,Agriculture - Enteric Fermentation - Beef Cattle,EPA_GHGI_T_5_3 +direct,Agriculture - Enteric Fermentation - Dairy Cattle,EPA_GHGI_T_5_3 +direct,Agriculture - Enteric Fermentation - Goats,EPA_GHGI_T_5_3 +direct,Agriculture - Enteric Fermentation - Horses,EPA_GHGI_T_5_3 +direct,Agriculture - Enteric Fermentation - Mules and Asses,EPA_GHGI_T_5_3 +direct,Agriculture - Enteric Fermentation - Sheep,EPA_GHGI_T_5_3 +direct,Agriculture - Enteric Fermentation - Swine,EPA_GHGI_T_5_3 +direct,Agriculture - Field Burning of Agricultural Residues - Barley,EPA_GHGI_T_5_29 +direct,Agriculture - Field Burning of Agricultural Residues - Chickpeas,EPA_GHGI_T_5_29 +direct,Agriculture - Field Burning of Agricultural Residues - Cotton,EPA_GHGI_T_5_29 +direct,Agriculture - Field Burning of Agricultural Residues - Dry Beans,EPA_GHGI_T_5_29 +direct,Agriculture - Field Burning of Agricultural Residues - Grass Hay,EPA_GHGI_T_5_29 +direct,Agriculture - Field Burning of Agricultural Residues - Legume Hay,EPA_GHGI_T_5_29 +direct,Agriculture - Field Burning of Agricultural Residues - Lentils,EPA_GHGI_T_5_29 +direct,Agriculture - Field Burning of Agricultural Residues - Maize,EPA_GHGI_T_5_29 +direct,Agriculture - Field Burning of Agricultural Residues - Oats,EPA_GHGI_T_5_29 +direct,Agriculture - Field Burning of Agricultural Residues - Other Small Grains,EPA_GHGI_T_5_29 +direct,Agriculture - Field Burning of Agricultural Residues - Peanuts,EPA_GHGI_T_5_29 +direct,Agriculture - Field Burning of Agricultural Residues - Peas,EPA_GHGI_T_5_29 +direct,Agriculture - Field Burning of Agricultural Residues - Potatoes,EPA_GHGI_T_5_29 +direct,Agriculture - Field Burning of Agricultural Residues - Rice,EPA_GHGI_T_5_29 +direct,Agriculture - Field Burning of Agricultural Residues - Sorghum,EPA_GHGI_T_5_29 +direct,Agriculture - Field Burning of Agricultural Residues - Soybeans,EPA_GHGI_T_5_29 +direct,Agriculture - Field Burning of Agricultural Residues - Sugarbeets,EPA_GHGI_T_5_29 +direct,Agriculture - Field Burning of Agricultural Residues - Sunflower,EPA_GHGI_T_5_29 +direct,Agriculture - Field Burning of Agricultural Residues - Tobacco,EPA_GHGI_T_5_29 +direct,Agriculture - Field Burning of Agricultural Residues - Vegetables,EPA_GHGI_T_5_29 +direct,Agriculture - Field Burning of Agricultural Residues - Wheat,EPA_GHGI_T_5_29 +direct,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Dolomite",EPA_GHGI_T_2_1 +direct,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Limestone",EPA_GHGI_T_2_1 +direct,Agriculture - Manure Management - American Bison,EPA_GHGI_T_2_1 +direct,Agriculture - Manure Management - Beef Cattle,EPA_GHGI_T_5_7 +direct,Agriculture - Manure Management - Bison,EPA_GHGI_T_5_7 +direct,Agriculture - Manure Management - Dairy Cattle,EPA_GHGI_T_5_7 +direct,Agriculture - Manure Management - Dairy Heifers,EPA_GHGI_T_5_7 +direct,Agriculture - Manure Management - Goats,EPA_GHGI_T_5_7 +direct,Agriculture - Manure Management - Horses,EPA_GHGI_T_5_7 +direct,Agriculture - Manure Management - Mules and Asses,EPA_GHGI_T_5_7 +direct,Agriculture - Manure Management - Poultry,EPA_GHGI_T_5_7 +direct,Agriculture - Manure Management - Sheep,EPA_GHGI_T_5_7 +direct,Agriculture - Manure Management - Swine,EPA_GHGI_T_5_7 +direct,Agriculture - Rice Cultivation,EPA_GHGI_T_2_1 +ag,"Agriculture - Urea Fertilization - CO2 emissions from liming, urea application and other carbon-containing fertilizers",EPA_GHGI_T_2_1 +direct,Industry - Abandoned Oil and Gas Wells - Fugitive - Abandoned Wells, +direct,Industry - Abandoned Underground Coal Mines - Fugitive - Coal Mining - Abandoned Coal Mines - Liberated,EPA_GHGI_T_2_1 +direct,Industry - Abandoned Underground Coal Mines - Fugitive - Coal Mining - Abandoned Coal Mines - Recovered &Used,EPA_GHGI_T_2_1 +direct,Industry - Coal Mining - Fugitive - CO2 From Methane Flaring,EPA_GHGI_T_2_1 +direct,Industry - Coal Mining - Fugitive - Underground Recovered &Used,EPA_GHGI_T_2_1 +direct,Industry - Coal Mining - Fugitive - Post-Mining (Surface),EPA_GHGI_T_2_1 +direct,Industry - Coal Mining - Fugitive - Post-Mining (Underground),EPA_GHGI_T_2_1 +direct,Industry - Coal Mining - Fugitive - Surface Mining,EPA_GHGI_T_2_1 +direct,Industry - Coal Mining - Fugitive - Underground Liberated,EPA_GHGI_T_2_1 +direct,Industry - Coal Mining - Fugitive - Underground Recovered &Used For Energy,EPA_GHGI_T_2_1 +use_table_gas,Commercial - Stationary Combustion - Fossil Fuel Combustion, +use_table_coal,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,EPA_GHGI_T_A_14 +use_table_gas,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,EPA_GHGI_T_A_14 +use_table_pet,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,EPA_GHGI_T_A_14 +direct,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation, +direct,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Coal, +direct,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Geothermal, +direct,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Natural Gas, +direct,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum, +industrial_ch4_n2o,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial, +industrial_coal,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,EPA_GHGI_T_A_14 +industrial_gas,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,EPA_GHGI_T_A_14 +industrial_petroleum,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,EPA_GHGI_T_A_14 +direct,Residential - Stationary Combustion - Fossil Fuel Combustion, +direct,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal, +direct,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas, +direct,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum, +direct,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal, +transport_ng,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,EPA_GHGI_T_A_14 +transport_petroleum,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway, +transport_petroleum,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,EPA_GHGI_T_A_14 +transport_diesel,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,EPA_GHGI_T_3_14 +transport_gasoline,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,EPA_GHGI_T_3_14 +transport_nonroad,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Non-Highway,EPA_GHGI_T_3_14 +exclude,U.S. Territories - Stationary Combustion - Fossil Fuel Combustion - US Territories, +exclude,U.S. Territories - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - US Territories - Coal, +exclude,U.S. Territories - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - US Territories - Natural Gas, +exclude,U.S. Territories - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - US Territories - Petroleum, +direct,Electric Power Industry - Incineration of Waste - Incineration,EPA_GHGI_T_2_1 +direct,Industry - Natural Gas Systems - Fugitive,EPA_GHGI_T_3_63 +industrial_neu,Industry - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - Industrial,EPA_GHGI_T_A_14 +transport_petroleum,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels, +exclude,U.S. Territories - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - US Territories, +direct,Industry - Petroleum Systems - Fugitive,EPA_GHGI_T_3_38 +use_table_pet,Agriculture - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary, +transport_nonroad,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,negative emissions; align with 'Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Non-Highway' to avoid double counting +transport_nonroad,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,negative emissions; align with 'Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Non-Highway' to avoid double counting +transport_nonroad,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,negative emissions; align with 'Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Non-Highway' to avoid double counting +ods_substitutes,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,EPA_GHGI_T_4_102 +ods_substitutes,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,EPA_GHGI_T_4_102 +direct_ods,Residential - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Residential,EPA_GHGI_T_4_102 +direct_ods,Transportation - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Transportation,EPA_GHGI_T_4_102 +direct,Industry - Adipic Acid Production - Chemical Industry,EPA_GHGI_T_2_1 +direct,Industry - Ammonia Production - Chemical Industry,EPA_GHGI_T_2_1 +direct,"Industry - Caprolactam, Glyoxal,and Glyoxylic Acid Production - Chemical Industry - Caprolactam Production",EPA_GHGI_T_2_1 +direct,Industry - Nitric Acid Production - Chemical Industry,EPA_GHGI_T_2_1 +direct,Industry - Petrochemical Production - Chemical Industry - Acrylonitrile,EPA_GHGI_T_4_46 +direct,Industry - Petrochemical Production - Chemical Industry - Carbon Black,EPA_GHGI_T_4_46 +direct,Industry - Petrochemical Production - Chemical Industry - Ethylene,EPA_GHGI_T_4_46 +direct,Industry - Petrochemical Production - Chemical Industry - Ethylene Dichloride,EPA_GHGI_T_4_46 +direct,Industry - Petrochemical Production - Chemical Industry - Ethylene Oxide,EPA_GHGI_T_4_46 +direct,Industry - Petrochemical Production - Chemical Industry - Methanol,EPA_GHGI_T_4_46 +direct,Industry - Phosphoric Acid Production - Chemical Industry,EPA_GHGI_T_2_1 +direct,Industry - Carbide Production and Consumption - Chemical Industry - Silicon Carbide Production and Consumption,EPA_GHGI_T_2_1 +direct,Industry - Soda Ash Production - Chemical Industry,EPA_GHGI_T_2_1 +direct,Industry - Titanium Dioxide Production - Chemical Industry,EPA_GHGI_T_2_1 +use_table_chem,Industry - Urea Consumption for Non-Agricultural Purposes - Chemical Industry - Urea Consumption for Non-Agricultural Uses,EPA_GHGI_T_2_1 +direct,Industry - Electronics Industry - Micro-Electro-Mechanical Devices, +direct,Industry - Electronics Industry - Photovoltaics, +direct,Industry - Electronics Industry - Semiconductor Manufacture, +direct,Industry - Electronics Industry - Semiconductor Manufacture - Heat Transfer Fluids, +direct,Industry - Aluminum Production - Metal Industry,EPA_GHGI_T_2_1 +direct,Industry - Ferroalloy Production - Metal Industry,EPA_GHGI_T_2_1 +direct,Industry - Iron and Steel Production - Metal Industry - Iron Production,EPA_GHGI_T_2_1 +direct,Industry - Iron and Steel Production - Metal Industry - Metallurgical Coke Production,EPA_GHGI_T_2_1 +direct,Industry - Iron and Steel Production - Metal Industry - Other Activities,EPA_GHGI_T_2_1 +direct,Industry - Iron and Steel Production - Metal Industry - Pellet Production,EPA_GHGI_T_2_1 +direct,Industry - Iron and Steel Production - Metal Industry - Sinter Production,EPA_GHGI_T_2_1 +direct,Industry - Iron and Steel Production - Metal Industry - Steel Production,EPA_GHGI_T_2_1 +direct,Industry - Lead Production - Metal Industry,EPA_GHGI_T_2_1 +direct,Industry - Magnesium Production and Processing - Metal Industry,EPA_GHGI_T_4_84 +direct,Industry - Zinc Production - Metal Industry,EPA_GHGI_T_2_1 +exclude,Industry - Carbon Dioxide Consumption - Mineral Industry,Excluded from national model +direct,Industry - Cement Production - Mineral Industry - Cement Manufacture,EPA_GHGI_T_2_1 +direct,Industry - Glass Production - Mineral Industry,EPA_GHGI_T_2_1 +direct,Industry - Lime Production - Mineral Industry - Lime Manufacture,EPA_GHGI_T_2_1 +use_table_chem,Industry - Other Process Uses of Carbonates - Mineral Industry,EPA_GHGI_T_2_1 +direct,Electric Power Industry - Electrical Transmission and Distribution - Other product manufacture and use - Electric Power Systems, +direct,Electric Power Industry - Electrical Transmission and Distribution - Other product manufacture and use - Equipment OEM, +direct,Industry - HCFC-22 Production - Production and Use of Fluorinated Gases,EPA_GHGI_T_4_50 +direct,Commercial - Composting,EPA_GHGI_T_2_1 +direct,Commercial - Anaerobic Digestion at Biogas Facility - Anaerobic Digestion at Biogas Facilities,EPA_GHGI_T_2_1 +direct,Industry - Landfills - Industrial - Landfills - Industrial Landfill - Industrial Waste Landfills Net Emissions,EPA_GHGI_T_2_1 +direct,Commercial - Landfills - Municipal - Landfills - MSW Landfill - MSW Landfills Net Emissions,EPA_GHGI_T_2_1 +direct,Industry - Wastewater Treatment - Wastewater Treatment and Discharge - Industrial,EPA_GHGI_T_2_1 +direct,Commercial - Wastewater Treatment - Wastewater Treatment and Discharge - Domestic,EPA_GHGI_T_2_1 +transport_machinery,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,EPA_GHGI_T_3_14 +industrial_petroleum,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,negative emissions; align with 'Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum' to avoid double counting +transport_machinery,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,EPA_GHGI_T_3_13 +transport_machinery,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,EPA_GHGI_T_3_14 +direct,Electric Power Industry - Other Process Uses of Carbonates - Mineral Industry, +transport_nonroad,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other, +industrial_ch4_n2o,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,negative emissions; align with 'Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial' to avoid double counting +use_table_chem,Industry - N2O from Product Uses - Other product manufacture and use,EPA_GHGI_T_2_1 diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml new file mode 100644 index 000000000..e0e46abf8 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml @@ -0,0 +1,97 @@ +## GHG emissions by state from EPA disaggregated inventories + +!include:USEEIO_summary_target.yaml +year: &ghg_year 2012 +geoscale: state + +_allocation_types: + _use_allocation: &use_table_allocation + year: *ghg_year + geoscale: state + activity_to_sector_mapping: BEA_2012_Summary + # selection_fields: + # ActivityProducedBy: {'324': ''} # Petroleum 324110 + attribution_method: proportional + attribution_source: + Employment_state_2012: + data_format: FBS + geoscale: state + year: *ghg_year + +sources_to_cache: + EIA_MECS_Energy: + !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy + year: 2014 + clean_source: Employment_state_2014 + +source_names: + EPA_StateGHGI: # U.S. GHG emissions by state + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI + year: *ghg_year + activity_sets: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets + + ## List these activity sets separately to access the correct use table year + use_table_coal: # commercial coal combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) + + use_table_pet: # commercial petroleum combustion; mobile ag equipment + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + use_table_gas: # commercial gas combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'22': ''} # Electricity and natural gas + + use_table_chem: # other process use of carbonates + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'325': ''} # Use of chemicals + + transport_petroleum: # C02 from petroleum highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + transport_nonroad: # CH4, N2O from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + transport_machinery: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'333': ''} # Machinery + + ods_substitutes: # CO2e from ODS substitutes + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml new file mode 100644 index 000000000..c9ab9d64d --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml @@ -0,0 +1,97 @@ +## GHG emissions by state from EPA disaggregated inventories + +!include:USEEIO_summary_target.yaml +year: &ghg_year 2013 +geoscale: state + +_allocation_types: + _use_allocation: &use_table_allocation + year: *ghg_year + geoscale: state + activity_to_sector_mapping: BEA_2012_Summary + # selection_fields: + # ActivityProducedBy: {'324': ''} # Petroleum 324110 + attribution_method: proportional + attribution_source: + Employment_state_2013: + data_format: FBS + geoscale: state + year: *ghg_year + +sources_to_cache: + EIA_MECS_Energy: + !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy + year: 2014 + clean_source: Employment_state_2014 + +source_names: + EPA_StateGHGI: # U.S. GHG emissions by state + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI + year: *ghg_year + activity_sets: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets + + ## List these activity sets separately to access the correct use table year + use_table_coal: # commercial coal combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) + + use_table_pet: # commercial petroleum combustion; mobile ag equipment + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + use_table_gas: # commercial gas combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'22': ''} # Electricity and natural gas + + use_table_chem: # other process use of carbonates + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'325': ''} # Use of chemicals + + transport_petroleum: # C02 from petroleum highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + transport_nonroad: # CH4, N2O from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + transport_machinery: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'333': ''} # Machinery + + ods_substitutes: # CO2e from ODS substitutes + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml new file mode 100644 index 000000000..85a0492b9 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml @@ -0,0 +1,97 @@ +## GHG emissions by state from EPA disaggregated inventories + +!include:USEEIO_summary_target.yaml +year: &ghg_year 2014 +geoscale: state + +_allocation_types: + _use_allocation: &use_table_allocation + year: *ghg_year + geoscale: state + activity_to_sector_mapping: BEA_2012_Summary + # selection_fields: + # ActivityProducedBy: {'324': ''} # Petroleum 324110 + attribution_method: proportional + attribution_source: + Employment_state_2014: + data_format: FBS + geoscale: state + year: *ghg_year + +sources_to_cache: + EIA_MECS_Energy: + !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy + year: 2014 + clean_source: Employment_state_2014 + +source_names: + EPA_StateGHGI: # U.S. GHG emissions by state + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI + year: *ghg_year + activity_sets: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets + + ## List these activity sets separately to access the correct use table year + use_table_coal: # commercial coal combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) + + use_table_pet: # commercial petroleum combustion; mobile ag equipment + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + use_table_gas: # commercial gas combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'22': ''} # Electricity and natural gas + + use_table_chem: # other process use of carbonates + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'325': ''} # Use of chemicals + + transport_petroleum: # C02 from petroleum highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + transport_nonroad: # CH4, N2O from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + transport_machinery: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'333': ''} # Machinery + + ods_substitutes: # CO2e from ODS substitutes + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml new file mode 100644 index 000000000..1964f3c5c --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml @@ -0,0 +1,97 @@ +## GHG emissions by state from EPA disaggregated inventories + +!include:USEEIO_summary_target.yaml +year: &ghg_year 2015 +geoscale: state + +_allocation_types: + _use_allocation: &use_table_allocation + year: *ghg_year + geoscale: state + activity_to_sector_mapping: BEA_2012_Summary + # selection_fields: + # ActivityProducedBy: {'324': ''} # Petroleum 324110 + attribution_method: proportional + attribution_source: + Employment_state_2015: + data_format: FBS + geoscale: state + year: *ghg_year + +sources_to_cache: + EIA_MECS_Energy: + !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy + year: 2014 + clean_source: Employment_state_2014 + +source_names: + EPA_StateGHGI: # U.S. GHG emissions by state + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI + year: *ghg_year + activity_sets: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets + + ## List these activity sets separately to access the correct use table year + use_table_coal: # commercial coal combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) + + use_table_pet: # commercial petroleum combustion; mobile ag equipment + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + use_table_gas: # commercial gas combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'22': ''} # Electricity and natural gas + + use_table_chem: # other process use of carbonates + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'325': ''} # Use of chemicals + + transport_petroleum: # C02 from petroleum highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + transport_nonroad: # CH4, N2O from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + transport_machinery: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'333': ''} # Machinery + + ods_substitutes: # CO2e from ODS substitutes + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2016.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2016.yaml new file mode 100644 index 000000000..ead3a1d50 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_state_2016.yaml @@ -0,0 +1,97 @@ +## GHG emissions by state from EPA disaggregated inventories + +!include:USEEIO_summary_target.yaml +year: &ghg_year 2016 +geoscale: state + +_allocation_types: + _use_allocation: &use_table_allocation + year: *ghg_year + geoscale: state + activity_to_sector_mapping: BEA_2012_Summary + # selection_fields: + # ActivityProducedBy: {'324': ''} # Petroleum 324110 + attribution_method: proportional + attribution_source: + Employment_state_2016: + data_format: FBS + geoscale: state + year: *ghg_year + +sources_to_cache: + EIA_MECS_Energy: + !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy + year: 2018 + clean_source: Employment_state_2018 + +source_names: + EPA_StateGHGI: # U.S. GHG emissions by state + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI + year: *ghg_year + activity_sets: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets + + ## List these activity sets separately to access the correct use table year + use_table_coal: # commercial coal combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) + + use_table_pet: # commercial petroleum combustion; mobile ag equipment + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + use_table_gas: # commercial gas combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'22': ''} # Electricity and natural gas + + use_table_chem: # other process use of carbonates + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'325': ''} # Use of chemicals + + transport_petroleum: # C02 from petroleum highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + transport_nonroad: # CH4, N2O from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + transport_machinery: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'333': ''} # Machinery + + ods_substitutes: # CO2e from ODS substitutes + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2017.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2017.yaml new file mode 100644 index 000000000..e5689db93 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_state_2017.yaml @@ -0,0 +1,97 @@ +## GHG emissions by state from EPA disaggregated inventories + +!include:USEEIO_summary_target.yaml +year: &ghg_year 2017 +geoscale: state + +_allocation_types: + _use_allocation: &use_table_allocation + year: *ghg_year + geoscale: state + activity_to_sector_mapping: BEA_2012_Summary + # selection_fields: + # ActivityProducedBy: {'324': ''} # Petroleum 324110 + attribution_method: proportional + attribution_source: + Employment_state_2017: + data_format: FBS + geoscale: state + year: *ghg_year + +sources_to_cache: + EIA_MECS_Energy: + !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy + year: 2018 + clean_source: Employment_state_2018 + +source_names: + EPA_StateGHGI: # U.S. GHG emissions by state + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI + year: *ghg_year + activity_sets: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets + + ## List these activity sets separately to access the correct use table year + use_table_coal: # commercial coal combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) + + use_table_pet: # commercial petroleum combustion; mobile ag equipment + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + use_table_gas: # commercial gas combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'22': ''} # Electricity and natural gas + + use_table_chem: # other process use of carbonates + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'325': ''} # Use of chemicals + + transport_petroleum: # C02 from petroleum highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + transport_nonroad: # CH4, N2O from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + transport_machinery: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'333': ''} # Machinery + + ods_substitutes: # CO2e from ODS substitutes + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2018.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2018.yaml new file mode 100644 index 000000000..f588807f6 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_state_2018.yaml @@ -0,0 +1,97 @@ +## GHG emissions by state from EPA disaggregated inventories + +!include:USEEIO_summary_target.yaml +year: &ghg_year 2018 +geoscale: state + +_allocation_types: + _use_allocation: &use_table_allocation + year: *ghg_year + geoscale: state + activity_to_sector_mapping: BEA_2012_Summary + # selection_fields: + # ActivityProducedBy: {'324': ''} # Petroleum 324110 + attribution_method: proportional + attribution_source: + Employment_state_2018: + data_format: FBS + geoscale: state + year: *ghg_year + +sources_to_cache: + EIA_MECS_Energy: + !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy + year: 2018 + clean_source: Employment_state_2018 + +source_names: + EPA_StateGHGI: # U.S. GHG emissions by state + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI + year: *ghg_year + activity_sets: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets + + ## List these activity sets separately to access the correct use table year + use_table_coal: # commercial coal combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) + + use_table_pet: # commercial petroleum combustion; mobile ag equipment + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + use_table_gas: # commercial gas combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'22': ''} # Electricity and natural gas + + use_table_chem: # other process use of carbonates + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'325': ''} # Use of chemicals + + transport_petroleum: # C02 from petroleum highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + transport_nonroad: # CH4, N2O from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + transport_machinery: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'333': ''} # Machinery + + ods_substitutes: # CO2e from ODS substitutes + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml new file mode 100644 index 000000000..3ed30526b --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml @@ -0,0 +1,97 @@ +## GHG emissions by state from EPA disaggregated inventories + +!include:USEEIO_summary_target.yaml +year: &ghg_year 2019 +geoscale: state + +_allocation_types: + _use_allocation: &use_table_allocation + year: *ghg_year + geoscale: state + activity_to_sector_mapping: BEA_2012_Summary + # selection_fields: + # ActivityProducedBy: {'324': ''} # Petroleum 324110 + attribution_method: proportional + attribution_source: + Employment_state_2019: + data_format: FBS + geoscale: state + year: *ghg_year + +sources_to_cache: + EIA_MECS_Energy: + !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy + year: 2018 + clean_source: Employment_state_2018 + +source_names: + EPA_StateGHGI: # U.S. GHG emissions by state + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI + year: *ghg_year + activity_sets: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets + + ## List these activity sets separately to access the correct use table year + use_table_coal: # commercial coal combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) + + use_table_pet: # commercial petroleum combustion; mobile ag equipment + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + use_table_gas: # commercial gas combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'22': ''} # Electricity and natural gas + + use_table_chem: # other process use of carbonates + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'325': ''} # Use of chemicals + + transport_petroleum: # C02 from petroleum highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + transport_nonroad: # CH4, N2O from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + transport_machinery: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'333': ''} # Machinery + + ods_substitutes: # CO2e from ODS substitutes + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2020.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2020.yaml new file mode 100644 index 000000000..4d1fcfc66 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_state_2020.yaml @@ -0,0 +1,97 @@ +## GHG emissions by state from EPA disaggregated inventories + +!include:USEEIO_summary_target.yaml +year: &ghg_year 2020 +geoscale: state + +_allocation_types: + _use_allocation: &use_table_allocation + year: *ghg_year + geoscale: state + activity_to_sector_mapping: BEA_2012_Summary + # selection_fields: + # ActivityProducedBy: {'324': ''} # Petroleum 324110 + attribution_method: proportional + attribution_source: + Employment_state_2020: + data_format: FBS + geoscale: state + year: *ghg_year + +sources_to_cache: + EIA_MECS_Energy: + !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy + year: 2018 + clean_source: Employment_state_2018 + +source_names: + EPA_StateGHGI: # U.S. GHG emissions by state + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI + year: *ghg_year + activity_sets: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets + + ## List these activity sets separately to access the correct use table year + use_table_coal: # commercial coal combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) + + use_table_pet: # commercial petroleum combustion; mobile ag equipment + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + use_table_gas: # commercial gas combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'22': ''} # Electricity and natural gas + + use_table_chem: # other process use of carbonates + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'325': ''} # Use of chemicals + + transport_petroleum: # C02 from petroleum highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + transport_nonroad: # CH4, N2O from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + transport_machinery: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'333': ''} # Machinery + + ods_substitutes: # CO2e from ODS substitutes + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml new file mode 100644 index 000000000..94d09da65 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml @@ -0,0 +1,271 @@ +# This is the general method reference file for state models. +# Year-specific GHG files import this file to define attribution rules +# that are further customized + +!include:USEEIO_summary_target.yaml +# year: &ghg_year 2019 +geoscale: state + +_allocation_types: + _use_allocation: &use_table_allocation + # year: *ghg_year + geoscale: state + activity_to_sector_mapping: BEA_2012_Summary + # selection_fields: + # ActivityProducedBy: {'324': ''} # Petroleum 324110 + attribution_method: proportional + attribution_source: + Employment_state_2019: ## Update this to match the target year + data_format: FBS + geoscale: state + # year: *ghg_year + + +sources_to_cache: + EIA_MECS_Energy: + year: 2018 + geoscale: state + selection_fields: + # Class: Energy # Define class for each application of cached source + Unit: Trillion Btu + Description: + - Table 2.2 + - Table 3.2 + # Flowable: Natural gas # Define class for each application of cached source + exclusion_fields: + Location: '00000' + estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy + clean_fba_after_attribution: !script_function:EIA_MECS clean_mapped_mecs_energy_fba_to_state + clean_source: Employment_state_2018 ## Update to MECS year + +source_names: + EPA_StateGHGI: # U.S. GHG emissions by state + geoscale: state + # year: *ghg_year + keep_unmapped_rows: True + fedefl_mapping: 'GHGI' + activity_sets: + direct: + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct + attribution_method: direct + + direct_ods: + clean_fba_before_mapping: !script_function:EPA_GHGI split_HFCs_by_type + clean_parameter: + # Proportions of specific HFCs are assigned based on national total + flow_fba: EPA_GHGI_T_4_100 + #TODO reconsider mapping for transportation HFCS + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct_ods + attribution_method: direct + + use_table_coal: # commercial coal combustion + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_coal + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) + + use_table_pet: # commercial petroleum combustion; mobile ag equipment + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_pet + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + use_table_gas: # commercial gas combustion + # This allocaiton is problematic because 22 includes electricity + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_gas + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'22': ''} # Electricity and natural gas + + industrial_coal: # CO2 from industrial coal combustion + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv industrial_coal + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + selection_fields: + Class: Energy + Flowable: Coal + + industrial_petroleum: # CO2 from industrial petroleum combustion + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv industrial_petroleum + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + selection_fields: + Class: Energy + Flowable: + - Distillate Fuel Oil + - Residual Fuel Oil + # - "Other" Should this be included? + + industrial_gas: # CO2 from industrial gas combustion + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv industrial_gas + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + selection_fields: + Class: Energy + Flowable: Natural Gas + + industrial_ch4_n2o: # CH4 and N2O from industrial combustion + clean_fba_before_activity_sets: !script_function:EPA_StateGHGI allocate_flows_by_fuel + clean_parameter: + flow_ratio_source: + - !from_index:EPA_StateGHGI_asets.csv industrial_coal + - !from_index:EPA_StateGHGI_asets.csv industrial_petroleum + - !from_index:EPA_StateGHGI_asets.csv industrial_gas + fba_source: # National tables for identifyng CH4 and N2O ratios to CO2 + - EPA_GHGI_T_3_7 + - EPA_GHGI_T_3_8 + - EPA_GHGI_T_3_9 + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv industrial_ch4_n2o + activity_sets: + coal: + selection_fields: + Description: Coal + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + selection_fields: + Class: Energy + Flowable: Coal + petroleum: + selection_fields: + Description: Petroleum + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + selection_fields: + Class: Energy + Flowable: + - Distillate Fuel Oil + - Residual Fuel Oil + gas: + selection_fields: + Description: Natural Gas + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + selection_fields: + Class: Energy + Flowable: Natural Gas + + industrial_neu: # CO2 from non energy use of fossil fuels - industrial + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv industrial_neu + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + selection_fields: + Class: Other # nonfuel consumption + Flowable: Total + + use_table_chem: # other process use of carbonates + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_chem + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'325': ''} # Use of chemicals + + ag: # emissions from urea fertilization + # allocated between crops and animals based on USDA land area + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ag + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + year: 2017 + geoscale: state + selection_fields: + Class: Land + FlowName: AG LAND, CROPLAND, HARVESTED # land in active use + + transport_petroleum: # C02 from petroleum highway + # state inventory assumes all petroleum is "highway" + # Allocate to all transport types and households by fuel consumption + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_petroleum + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + transport_ng: # C02 from natural gas transportation + # National inventory shows all ng transport emissions coming from pipelines + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_ng + attribution_method: direct + + transport_diesel: # CH4, N2O from diesel highway + # Assigned to truck transport to align with national inventory + # Medium- and Heavy-Duty Trucks and Buses + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_diesel + attribution_method: direct + + transport_gasoline: # CH4, N2O from gasoline highway + # Assigned to households to align with national inventory + # Light-Duty Trucks + # Passenger Cars + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_gasoline + attribution_method: direct + + transport_nonroad: # CH4, N2O from petroleum non-highway + # National inventory distinguishes by vehicle type (ship, rail, equipment, etc.) + # Allocate to ships, rail, air by fuel use + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + + transport_machinery: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_machinery + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'333': ''} # Machinery + + ods_substitutes: # CO2e from ODS substitutes + clean_fba_before_mapping: !script_function:EPA_GHGI split_HFCs_by_type + clean_parameter: + # Proportions of specific HFCs are assigned based on national total + flow_fba: EPA_GHGI_T_4_100 + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ods_substitutes + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment From f2933ac6acb66b66df33917ab8e1481f9629bdb1 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 2 Aug 2023 23:03:58 -0400 Subject: [PATCH 0742/1127] update NEI urls --- flowsa/methods/flowbyactivitymethods/EPA_NEI_Nonpoint.yaml | 2 +- flowsa/methods/flowbyactivitymethods/EPA_NEI_Nonroad.yaml | 2 +- flowsa/methods/flowbyactivitymethods/EPA_NEI_Onroad.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/flowsa/methods/flowbyactivitymethods/EPA_NEI_Nonpoint.yaml b/flowsa/methods/flowbyactivitymethods/EPA_NEI_Nonpoint.yaml index 6f74011e9..39971c732 100644 --- a/flowsa/methods/flowbyactivitymethods/EPA_NEI_Nonpoint.yaml +++ b/flowsa/methods/flowbyactivitymethods/EPA_NEI_Nonpoint.yaml @@ -1,7 +1,7 @@ !include:EPA_NEI_Common.yaml bib_id: EPA_NEI_Nonpoint url: # no replacement needed in url because only single zip file - base_url: ftp://newftp.epa.gov/air/nei/__year__/data_summaries/__version___nonpoint.zip + base_url: https://gaftp.epa.gov/air/nei/__year__/data_summaries/__version___nonpoint.zip parse_response_fxn: !script_function:EPA_NEI epa_nei_nonpoint_parse version_dict: !include:EPA_NEI_Common.yaml:version_dict diff --git a/flowsa/methods/flowbyactivitymethods/EPA_NEI_Nonroad.yaml b/flowsa/methods/flowbyactivitymethods/EPA_NEI_Nonroad.yaml index c1341b49c..3bea7d7e9 100644 --- a/flowsa/methods/flowbyactivitymethods/EPA_NEI_Nonroad.yaml +++ b/flowsa/methods/flowbyactivitymethods/EPA_NEI_Nonroad.yaml @@ -1,7 +1,7 @@ !include:EPA_NEI_Common.yaml bib_id: EPA_NEI_Nonroad url: # no replacement needed in url because only single zip file - base_url: ftp://newftp.epa.gov/air/nei/__year__/data_summaries/__version_____suffix__.zip + base_url: https://gaftp.epa.gov/air/nei/__year__/data_summaries/__version_____suffix__.zip suffix: base: nonroad_byregions '2020': nonroad_byregion diff --git a/flowsa/methods/flowbyactivitymethods/EPA_NEI_Onroad.yaml b/flowsa/methods/flowbyactivitymethods/EPA_NEI_Onroad.yaml index 1a7bdf295..b37b4d0b9 100644 --- a/flowsa/methods/flowbyactivitymethods/EPA_NEI_Onroad.yaml +++ b/flowsa/methods/flowbyactivitymethods/EPA_NEI_Onroad.yaml @@ -1,7 +1,7 @@ !include:EPA_NEI_Common.yaml bib_id: EPA_NEI_Onroad url: # no replacement needed in url because only single zip file - base_url: ftp://newftp.epa.gov/air/nei/__year__/data_summaries/__version_____suffix__.zip + base_url: https://gaftp.epa.gov/air/nei/__year__/data_summaries/__version_____suffix__.zip suffix: base: onroad_byregions '2020': onroad_byregion From 17bd0dbb06ff644bc7c425c09585274b0e3a57da Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 2 Aug 2023 23:56:56 -0400 Subject: [PATCH 0743/1127] fix parameter for CAP_HAP state --- flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml | 2 +- flowsa/methods/flowbysectormethods/CAP_HAP_state_2020.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml index a858b526f..b2a4761a2 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml @@ -14,7 +14,7 @@ sources_to_cache: EIA_MECS_Energy: !include:CAP_HAP_common.yaml:sources_to_cache:EIA_MECS_Energy_state year: 2018 - attribution_source: Employment_state_2018 + clean_source: Employment_state_2018 _attribution_sources: stateio: &stateio diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2020.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2020.yaml index f258453d1..ff3ee74a4 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2020.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2020.yaml @@ -14,7 +14,7 @@ sources_to_cache: EIA_MECS_Energy: !include:CAP_HAP_common.yaml:sources_to_cache:EIA_MECS_Energy_state year: 2018 - attribution_source: Employment_state_2018 + clean_source: Employment_state_2018 _attribution_sources: stateio: &stateio From 90be5761166d6f5f941986e2c13457d219d52f49 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 3 Aug 2023 16:20:34 -0400 Subject: [PATCH 0744/1127] add test for single FBA --- flowsa/test_single_FBA.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 flowsa/test_single_FBA.py diff --git a/flowsa/test_single_FBA.py b/flowsa/test_single_FBA.py new file mode 100644 index 000000000..065dd77f4 --- /dev/null +++ b/flowsa/test_single_FBA.py @@ -0,0 +1,13 @@ +""" +Targeted generation of FBA +""" +import flowsa + +if __name__ == "__main__": + import argparse + parser = argparse.ArgumentParser() + parser.add_argument('--source', help='FBA source name') + parser.add_argument('--year', help='FBA year') + args = vars(parser.parse_args()) + + flowsa.flowbyactivity.main(source=args['source'], year=args['year']) From 25984f0b5ac6a4ae8cdde2b368a9bce4b3c138d5 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Sun, 6 Aug 2023 22:27:26 -0600 Subject: [PATCH 0745/1127] update how suppressed employment data is estimated to account for published grandchildren values --- flowsa/data_source_scripts/BLS_QCEW.py | 103 ++++++++++++++++--------- 1 file changed, 68 insertions(+), 35 deletions(-) diff --git a/flowsa/data_source_scripts/BLS_QCEW.py b/flowsa/data_source_scripts/BLS_QCEW.py index 69dba7adf..eeabb4d8c 100644 --- a/flowsa/data_source_scripts/BLS_QCEW.py +++ b/flowsa/data_source_scripts/BLS_QCEW.py @@ -224,6 +224,48 @@ def estimate_suppressed_qcew(fba: FlowByActivity) -> FlowByActivity: else: log.critical('At a subnational scale, this will take a long time.') + fba = (fba + .assign(Unattributed=fba.FlowAmount.copy(), + Attributed=0) + .assign(descendants='') + ) + + for level in [5, 4, 3, 2]: + descendants = ( + fba + .drop(columns='descendants') + .query(f'ActivityProducedBy.str.len() > {level}') + .assign( + parent=lambda x: x.ActivityProducedBy.str.slice(stop=level) + ) + .groupby(['FlowName', 'Location', 'parent']) + .agg({'Unattributed': 'sum', 'ActivityProducedBy': ' '.join}) + .reset_index() + .rename(columns={'ActivityProducedBy': 'descendants', + 'Unattributed': 'descendant_flows', + 'parent': 'ActivityProducedBy'}) + ) + + fba = ( + fba + .merge(descendants, + how='left', + on=['FlowName', 'Location', 'ActivityProducedBy'], + suffixes=(None, '_y')) + .fillna({'descendant_flows': 0, 'descendants_y': ''}) + .assign( + descendants=lambda x: x.descendants.mask(x.descendants == '', + x.descendants_y), + Unattributed=lambda x: (x.Unattributed - + x.descendant_flows).mask( + x.Unattributed - x.descendant_flows < 0, 0), + Attributed=lambda x: (x.Attributed + + x.descendant_flows) + ) + .drop(columns=['descendant_flows', 'descendants_y']) + ) + fba = fba.drop(columns=['descendants']) + indexed = ( fba .assign(n2=fba.ActivityProducedBy.str.slice(stop=2), @@ -245,48 +287,39 @@ def estimate_suppressed_qcew(fba: FlowByActivity) -> FlowByActivity: ) def fill_suppressed( - flows: pd.Series, - level: int, - full_naics: pd.Series - ) -> pd.Series: - parent = flows[full_naics.str.len() == level] - children = flows[full_naics.str.len() == level + 1] - null_children = children[children.isna()] + flows, level: int, activity + ): + parent = flows[flows[activity].str.len() == level] + children = flows[flows[activity].str.len() == level + 1] + null_children = children[children['FlowAmount'].isna()] if null_children.empty or parent.empty: return flows else: - value = max((parent[0] - children.sum()) / null_children.size, 0) - return flows.fillna(pd.Series(value, index=null_children.index)) - - unsuppressed = ( - indexed - .assign( - FlowAmount=lambda x: ( - x.groupby(level=['n2', - 'location', 'category'])['FlowAmount'] - .transform(fill_suppressed, 2, x.ActivityProducedBy))) - .assign( - FlowAmount=lambda x: ( - x.groupby(level=['n2', 'n3', - 'location', 'category'])['FlowAmount'] - .transform(fill_suppressed, 3, x.ActivityProducedBy))) - .assign( - FlowAmount=lambda x: ( - x.groupby(level=['n2', 'n3', 'n4', - 'location', 'category'])['FlowAmount'] - .transform(fill_suppressed, 4, x.ActivityProducedBy))) - .assign( - FlowAmount=lambda x: ( - x.groupby(level=['n2', 'n3', 'n4', 'n5', - 'location', 'category'])['FlowAmount'] - .transform(fill_suppressed, 5, x.ActivityProducedBy))) - .fillna({'FlowAmount': 0}) - .reset_index(drop=True) - ) + value = max(parent['Unattributed'][0] / len(null_children), 0) + # update the null children by adding the unattributed data to + # the attributed data + null_children = ( + null_children + .assign(FlowAmount=value+null_children['Attributed']) + .assign(Unattributed=value) + ) + flows.update(null_children) + + return flows + + unsuppressed = indexed.copy() + for level in [2, 3, 4, 5, 6]: + groupcols = ["{}{}".format("n", i) for i in range(2, level+1)] + [ + 'location', 'category'] + unsuppressed = unsuppressed.groupby( + level=groupcols).apply( + fill_suppressed, level, 'ActivityProducedBy') aggregated = ( unsuppressed + .fillna({'FlowAmount': 0}) + .drop(columns=['Unattributed', 'Attributed']) .assign(FlowName='Number of employees') .replace({'ActivityProducedBy': {'3X': '31-33', '4X': '44-45', From 3e78f56ac1390a08161398398e1d791d56ce756b Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 7 Aug 2023 11:13:04 -0600 Subject: [PATCH 0746/1127] maintain dtypes after estimating suppressed bls data --- flowsa/data_source_scripts/BLS_QCEW.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flowsa/data_source_scripts/BLS_QCEW.py b/flowsa/data_source_scripts/BLS_QCEW.py index eeabb4d8c..b7e1ab66c 100644 --- a/flowsa/data_source_scripts/BLS_QCEW.py +++ b/flowsa/data_source_scripts/BLS_QCEW.py @@ -315,6 +315,8 @@ def fill_suppressed( unsuppressed = unsuppressed.groupby( level=groupcols).apply( fill_suppressed, level, 'ActivityProducedBy') + # ensure correct dtype + unsuppressed = unsuppressed.astype(indexed.dtypes.to_dict()) aggregated = ( unsuppressed From 176d84efbd93a44ec46646980f27cd4cc8935b7c Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 8 Aug 2023 11:40:13 -0600 Subject: [PATCH 0747/1127] update land national FBS yaml to correctly attribute cropland data --- .../Land_national_2012.yaml | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Land_national_2012.yaml b/flowsa/methods/flowbysectormethods/Land_national_2012.yaml index cf03499fd..5412b54b3 100644 --- a/flowsa/methods/flowbysectormethods/Land_national_2012.yaml +++ b/flowsa/methods/flowbysectormethods/Land_national_2012.yaml @@ -62,9 +62,11 @@ source_names: geoscale: state selection_fields: Class: Land - Location: !include:Location_common.yaml:_state_location activity_sets: cropland_crops: + industry_spec: + default: NAICS_6 + NAICS_7: ['111150', '111199'] selection_fields: PrimaryActivity: - 'Cropland used for crops' @@ -80,25 +82,26 @@ source_names: - "AREA IN PRODUCTION" - 'AREA BEARING & NON-BEARING' - 'AREA GROWN' - Location: !include:Location_common.yaml:_state_location exclusion_fields: conditional: {FlowName: 'AREA IN PRODUCTION', ActivityConsumedBy: 'VEGETABLE TOTALS'} - ActivityConsumedBy: ['AG LAND', 'AG LAND, CROPLAND, HARVESTED'] - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland_NAICS: - year: 2017 + ActivityConsumedBy: ['AG LAND, CROPLAND, HARVESTED'] + activity_sets: + cropland_attribution-cropland: + exclusion_fields: + ActivityConsumedBy: 'ORCHARDS' + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + selection_fields: + Class: Land + FlowName: + - "AG LAND, CROPLAND, HARVESTED" + estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution + cropland_attribution-orchards: selection_fields: - Class: Land - FlowName: - - "FARM OPERATIONS" - estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution - selection_fields_after_data_suppression_estimation: - PrimaryActivity: [ "112111", "112112", "11212", "1122", - "11231", "11232", "11233", "11234", - "11239", "11241", "11242", "11291", - "11292", "11293", "11299" ] + PrimaryActivity: ORCHARDS + attribution_method: direct pastureland: selection_fields: PrimaryActivity: From cde78d4ddc1321a3a18210ad880b01a2ffd46dbb Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 8 Aug 2023 11:45:01 -0600 Subject: [PATCH 0748/1127] drop ag land = '11' as this value is not the summation of crop and pastureland. Add new pastureland for non-irrigated pastureland --- .../NAICS_Crosswalk_USDA_CoA_Cropland.csv | 2 +- .../write_Crosswalk_USDA_CoA_Cropland.py | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_USDA_CoA_Cropland.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_USDA_CoA_Cropland.csv index 03e486139..ac6030920 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_USDA_CoA_Cropland.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_USDA_CoA_Cropland.csv @@ -1,5 +1,4 @@ ActivitySourceName,Activity,SectorSourceName,Sector,SectorType -USDA_CoA_Cropland,AG LAND,NAICS_2012_Code,11, USDA_CoA_Cropland,"AG LAND, CROPLAND, HARVESTED",NAICS_2012_Code,111, USDA_CoA_Cropland,SOYBEANS,NAICS_2012_Code,11111, USDA_CoA_Cropland,CANOLA,NAICS_2012_Code,111120A, @@ -66,3 +65,4 @@ USDA_CoA_Cropland,"MINT, TEA LEAVES",NAICS_2012_Code,111998K, USDA_CoA_Cropland,SWITCHGRASS,NAICS_2012_Code,111998L, USDA_CoA_Cropland,"FIELD CROPS, OTHER",NAICS_2012_Code,111998M, USDA_CoA_Cropland,"AG LAND, (EXCL HARVESTED CROPLAND)",NAICS_2012_Code,112, +USDA_CoA_Cropland,"AG LAND, PASTURELAND, (EXCL CROPLAND & WOODLAND)",NAICS_2012_Code,112, diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_CoA_Cropland.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_CoA_Cropland.py index a5b58419a..f86463483 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_CoA_Cropland.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_CoA_Cropland.py @@ -28,16 +28,17 @@ def assign_naics(df): # assign sector source name df['SectorSourceName'] = 'NAICS_2012_Code' - # coa equivalent to agriculture, forestry, fishing, and hunting - df.loc[df['Activity'] == 'AG LAND', 'Sector'] = '11' - # coa equivalent to crop production: 111 df.loc[df['Activity'] == 'AG LAND, CROPLAND, HARVESTED', 'Sector'] = '111' # coa equivalent to Animal Production and Aquaculture: 112 + # use below for IRRIGATED df.loc[df['Activity'] == 'AG LAND, (EXCL HARVESTED CROPLAND)', 'Sector'] = '112' + # use below for NON IRRIGATED + df.loc[df['Activity'] == 'AG LAND, PASTURELAND, (EXCL CROPLAND & WOODLAND)', + 'Sector'] = '112' # coa equivalent to soybean farming: 11111 df.loc[df['Activity'] == 'SOYBEANS', 'Sector'] = '11111' @@ -103,10 +104,6 @@ def assign_naics(df): [['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111332']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), ignore_index=True, sort=True) - df = df.append(pd.DataFrame( - [['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111333']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) df = df.append(pd.DataFrame( [['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111335']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', @@ -130,6 +127,10 @@ def assign_naics(df): columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), ignore_index=True, sort=True) df.loc[df['Activity'] == 'BERRY TOTALS', 'Sector'] = '111334' + df = df.append(pd.DataFrame( + [['USDA_CoA_Cropland', 'BERRY TOTALS', 'NAICS_2012_Code', '111333']], + columns=['ActivitySourceName', 'Activity', 'SectorSourceName', + 'Sector']), ignore_index=True, sort=True) df.loc[df['Activity'] == 'PINEAPPLES', 'Sector'] = '111339' # coa aggregates to greenhouse nursery and floriculture production: 1114 @@ -194,5 +195,5 @@ def assign_naics(df): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"{datasource}.csv", index=False) From 1679d31dfae161ab948047be14c58d05745906ed Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 8 Aug 2023 11:46:16 -0600 Subject: [PATCH 0749/1127] drop try/except statement because should always run correctly --- flowsa/flowby.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 441c7421a..8fa3f3f92 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -611,16 +611,13 @@ def aggregate_flowby( 'FlowAmount']) # check flowamounts equal after aggregating - try: - self_flow = self['FlowAmount'].sum() - agg_flow = aggregated['FlowAmount'].sum() - percent_diff = int(((agg_flow - self_flow) * 100) / self_flow) - if percent_diff > 0: - log.warning(f'There is an error in aggregating dataframe, as new ' - 'flow totals do not match original dataframe ' - 'flowtotals, there is a {percent_diff}% difference.') - except: - log.warning('Dataframe is empty.') + self_flow = self['FlowAmount'].sum() + agg_flow = aggregated['FlowAmount'].sum() + percent_diff = int(((agg_flow - self_flow) * 100) / self_flow) + if percent_diff > 0: + log.warning(f'There is an error in aggregating dataframe, as new ' + 'flow totals do not match original dataframe ' + 'flowtotals, there is a {percent_diff}% difference.') return aggregated From fc7af91db5caf15edbeb8f29f0c6651d13122d0f Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 8 Aug 2023 11:48:21 -0600 Subject: [PATCH 0750/1127] add additional valdiation check to compare total df flow amounts before/after attribution --- flowsa/flowby.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 8fa3f3f92..1279de043 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -759,6 +759,14 @@ def attribute_flows_to_sectors( 'FlowAmount', 'group_total', 'validation_total']]) log.error('Errors in attributing flows from %s:\n%s', self.full_name, errors) + # calculate the percent change in df caused by attribution + fbsum = (fb[['group_id', 'group_total']] + .drop_duplicates())['group_total'].sum() + attsum = (validation_fb[['group_id', 'validation_total']] + .drop_duplicates())['validation_total'].sum() + percent_change = ((attsum - fbsum)/fbsum)*100 + log.info(f"Percent change in dataset after attribution is" + f" {percent_change}") # run function to clean fbs after attribution attributed_fb = attributed_fb.function_socket( @@ -2395,7 +2403,8 @@ def generateFlowBySector( }, external_config_path=external_config_path, download_sources_ok=download_sources_ok - ).prepare_fbs(external_config_path=external_config_path, download_sources_ok=download_sources_ok) + ).prepare_fbs(external_config_path=external_config_path, + download_sources_ok=download_sources_ok) for source_name, config in sources.items() ]) From fa6cf89f975394f6e30b5abe733aeefc5ba479f1 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 8 Aug 2023 11:51:25 -0600 Subject: [PATCH 0751/1127] update estimate_suppressed_sectors_equal_attribution() to account for any grandchild sectors and to first check that any 1:1 parent:child relationships are captured in the df (these are excluded from usda_coa_cropland_naics) --- flowsa/flowbyclean.py | 156 +++++++++++++++++++++++++++++------------- 1 file changed, 110 insertions(+), 46 deletions(-) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index cbd935412..7d388166c 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -183,30 +183,105 @@ def substitute_nonexistent_values( def estimate_suppressed_sectors_equal_attribution( fba: FlowByActivity) -> FlowByActivity: """ - + Method to estimate suppressed data only works for activity-like sectors :param fba: :return: """ + from flowsa.naics import map_source_sectors_to_less_aggregated_sectors # todo: update function to work for any number of sector lengths # todo: update to loop through both sector columns, see equally_attribute() log.info('Estimating suppressed data by equally attributing parent to ' 'child sectors.') - naics_key = map_source_sectors_to_less_aggregated_sectors() + naics_key = map_source_sectors_to_more_aggregated_sectors() # forward fill naics_key = naics_key.T.ffill().T col = return_primary_activity_column(fba) + # determine if there are any 1:1 parent:child sectors that are missing, + # if so, add them (true for usda_coa_cropland_naics df) + cw_melt = map_source_sectors_to_less_aggregated_sectors() + cw_melt = cw_melt.assign(count=(cw_melt + .groupby(['source_naics', 'SectorLength']) + ['source_naics'] + .transform('count'))) + cw = (cw_melt + .query("count==1") + .drop(columns=['SectorLength', 'count']) + ) + # create new df with activity col values reassigned to their child sectors + fba2 = (fba + .merge(cw, left_on=col, right_on='source_naics', how='left') + .assign(**{f"{col}": lambda x: x.Sector}) + .drop(columns=['source_naics', 'Sector']) + .query(f"~{col}.isna()") + ) + fba2 = fba2.astype(fba.dtypes.to_dict()) + + fba3 = (fba + .merge(fba2, indicator=True, how='outer') + .query('_merge!="both"') + .drop('_merge', axis=1) + ) + + fba3 = (fba3 + .assign(Unattributed=fba3.FlowAmount.copy(), + Attributed=0) + .assign(descendants='') + ) + + # drop rows that contain "&" and "-" + fba3 = (fba3 + .query(f"~{col}.str.contains('&')") + .query(f"~{col}.str.contains('-')") + ) + + for level in [6, 5, 4, 3, 2]: + descendants = pd.DataFrame( + fba3 + .drop(columns='descendants') + .query(f'{col}.str.len() > {level}') + .assign( + parent=lambda x: x[col].str.slice(stop=level) + ) + .groupby(['FlowName', 'Location', 'parent']) + .agg({'Unattributed': 'sum', col: ' '.join}) + .reset_index() + .rename(columns={col: 'descendants', + 'Unattributed': 'descendant_flows', + 'parent': col}) + ) + fba3 = ( + fba3 + .merge(descendants, + how='left', + on=['FlowName', 'Location', col], + suffixes=(None, '_y')) + .fillna({'descendant_flows': 0, 'descendants_y': ''}) + .assign( + descendants=lambda x: x.descendants.mask(x.descendants == '', + x.descendants_y), + Unattributed=lambda x: (x.Unattributed - + x.descendant_flows).mask( + x.Unattributed - x.descendant_flows < 0, 0), + Attributed=lambda x: (x.Attributed + + x.descendant_flows) + ) + .drop(columns=['descendant_flows', 'descendants_y']) + ) + + fba3 = fba3.drop(columns=['descendants']) + # todo: All hyphenated sectors are currently dropped, modify code so # they are not fba_m = ( - fba + fba3 .merge(naics_key, how='left', left_on=col, right_on='source_naics') - .assign(location=fba.Location, - category=fba.FlowName) - .replace({'FlowAmount': {0: np.nan} #, + .assign(location=fba3.Location, + category=fba3.FlowName) + .replace({'FlowAmount': {0: np.nan} #, # col: {'1125 & 1129': '112X', # '11193 & 11194 & 11199': '1119X', # '31-33': '3X', @@ -226,59 +301,48 @@ def estimate_suppressed_sectors_equal_attribution( 'location', 'category'], verify_integrity=True) def fill_suppressed( - flows: pd.Series, - level: int, - full_naics: pd.Series - ) -> pd.Series: - parent = flows[full_naics.str.len() == level] - children = flows[full_naics.str.len() == level + 1] - null_children = children[children.isna()] + flows, level: int, activity + ): + parent = flows[flows[activity].str.len() == level] + children = flows[flows[activity].str.len() == level + 1] + null_children = children[children['FlowAmount'].isna()] if null_children.empty or parent.empty: return flows else: - value = max((parent[0] - children.sum()) / null_children.size, 0) - return flows.fillna(pd.Series(value, index=null_children.index)) - - unsuppressed = ( - indexed - .assign( - FlowAmount=lambda x: ( - x.groupby(level=['n2', - 'location', 'category'])['FlowAmount'] - .transform(fill_suppressed, 2, x[col]))) - .assign( - FlowAmount=lambda x: ( - x.groupby(level=['n2', 'n3', - 'location', 'category'])['FlowAmount'] - .transform(fill_suppressed, 3, x[col]))) - .assign( - FlowAmount=lambda x: ( - x.groupby(level=['n2', 'n3', 'n4', - 'location', 'category'])['FlowAmount'] - .transform(fill_suppressed, 4, x[col]))) - .assign( - FlowAmount=lambda x: ( - x.groupby(level=['n2', 'n3', 'n4', 'n5', - 'location', 'category'])['FlowAmount'] - .transform(fill_suppressed, 5, x[col]))) - .assign( - FlowAmount=lambda x: ( - x.groupby(level=['n2', 'n3', 'n4', 'n5', 'n6', - 'location', 'category'])['FlowAmount'] - .transform(fill_suppressed, 6, x[col]))) - .fillna({'FlowAmount': 0}) - .reset_index(drop=True) - ) + value = max(parent['Unattributed'][0] / len(null_children), 0) + # update the null children by adding the unattributed data to + # the attributed data + null_children = ( + null_children + .assign(FlowAmount=value+null_children['Attributed']) + .assign(Unattributed=value) + ) + flows.update(null_children) + return flows + + unsuppressed = indexed.copy() + for level in [2, 3, 4, 5, 6]: + groupcols = ["{}{}".format("n", i) for i in range(2, level+1)] + [ + 'location', 'category'] + unsuppressed = unsuppressed.groupby( + level=groupcols).apply( + fill_suppressed, level, col) + # ensure correct dtype + unsuppressed = unsuppressed.astype(indexed.dtypes.to_dict()) aggregated = ( unsuppressed + .fillna({'FlowAmount': 0}) + .drop(columns=['Unattributed', 'Attributed']) # .replace({col: {'3X': '31-33', # '4X': '44-45', # '4Y': '48-49'}}) .aggregate_flowby() ) + compare_summation_at_sector_lengths_between_two_dfs(fba, aggregated) + return aggregated From 6b755aef3b140407624b2f1cd39926c2ee550f21 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 8 Aug 2023 11:52:09 -0600 Subject: [PATCH 0752/1127] add kg/employee to kg/p conversion --- flowsa/data/unit_conversion.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/data/unit_conversion.csv b/flowsa/data/unit_conversion.csv index 85812db30..561d4be8c 100644 --- a/flowsa/data/unit_conversion.csv +++ b/flowsa/data/unit_conversion.csv @@ -23,3 +23,4 @@ Tbtu,MJ,1055055900 MT CO2e,MMT CO2e,0.000001 employees,p,1 Thousand USD,USD,1000 +kg/employee,kg/p,1 From ad2745ce4005a44f1cf50bf26b0f71410535d600 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 8 Aug 2023 11:54:45 -0600 Subject: [PATCH 0753/1127] generalize activity col used in define_parentincompletechild_descendants() --- flowsa/flowbyclean.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index 7d388166c..7e4cea41e 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -506,14 +506,14 @@ def define_parentincompletechild_descendants( .reset_index() .rename(columns={activity_col: 'descendants', 'FlowAmount': 'descendant_flows', - 'parent': 'ActivityConsumedBy'}) + 'parent': activity_col}) ) fba = ( fba .merge(descendants, how='left', - on=['Flowable', 'Location', 'ActivityConsumedBy'], + on=['Flowable', 'Location', activity_col], suffixes=(None, '_y')) .fillna({'descendant_flows': 0, 'descendants_y': ''}) .assign( From 0e7fbe8d58efa9de067f1d30eb11122fe5238729 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 8 Aug 2023 11:55:14 -0600 Subject: [PATCH 0754/1127] update import statements --- flowsa/flowbyclean.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index 7e4cea41e..809450a18 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -5,7 +5,8 @@ from flowsa.flowsa_log import log from flowsa import (geo, location, getFlowBySector, flowbyfunctions, FlowByActivity) -from flowsa.naics import map_source_sectors_to_less_aggregated_sectors +from flowsa.naics import map_source_sectors_to_more_aggregated_sectors +from flowsa.validation import compare_summation_at_sector_lengths_between_two_dfs def return_primary_activity_column(fba: FlowByActivity) -> \ FlowByActivity: From fe4081b03d21111dcb446a1b05b32c7d3a4307c2 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 8 Aug 2023 11:55:57 -0600 Subject: [PATCH 0755/1127] update compare_summation_at_sector_lengths() to work for recursive method --- flowsa/validation.py | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/flowsa/validation.py b/flowsa/validation.py index be50307d9..af8a237af 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -447,17 +447,30 @@ def compare_summation_at_sector_lengths_between_two_dfs(df1, df2): :return: df, comparison of sector summation results by region and printout if any child naics sum greater than parent naics """ - from flowsa.flowbyfunctions import assign_columns_of_sector_levels + from flowsa.common import load_sector_length_cw_melt - agg_cols = ['Class', 'SourceName', 'FlowName', 'Unit', 'FlowType', - 'Compartment', 'Location', 'Year', 'SectorProducedByLength', - 'SectorConsumedByLength'] + # determine if activity or sector col + col = 'Sector' + if 'ActivityProducedBy' in df1.columns: + col = 'Activity' + + cw = load_sector_length_cw_melt() + + agg_cols = list(df2.select_dtypes(include=['object', 'int']).columns) + \ + ['SectorProducedByLength', 'SectorConsumedByLength'] + agg_cols = [e for e in agg_cols if e not in [f'{col}ProducedBy', + f'{col}ConsumedBy']] df_list = [] for df in [df1, df2]: - df = assign_columns_of_sector_levels(df) + # merge df assigning sector lengths + for s in ['Produced', 'Consumed']: + df = df.merge(cw, how='left', left_on=f'{col}{s}By', + right_on='Sector').drop(columns=['Sector']).rename( + columns={'SectorLength': f'Sector{s}ByLength'}) + df[f'Sector{s}ByLength'] = df[f'Sector{s}ByLength'].fillna(0) # sum flowamounts by sector length - dfsum = df.groupby(agg_cols).agg({'FlowAmount': 'sum'}).reset_index() + dfsum = df.groupby(agg_cols, dropna=False).agg({'FlowAmount': 'sum'}).reset_index() df_list.append(dfsum) df_list[0] = df_list[0].rename(columns={'FlowAmount': 'df1'}) From 057e028b53ff4050611c318746ddc163c5e94e8d Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 8 Aug 2023 11:57:04 -0600 Subject: [PATCH 0756/1127] rename map_source_sectors_to_less_aggregated_sectors() to def map_source_sectors_to_more_aggregated_sectors() to more accurately capture fxn purpose --- flowsa/naics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/naics.py b/flowsa/naics.py index 6127bc83e..9725904b7 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -124,7 +124,7 @@ def map_target_sectors_to_less_aggregated_sectors( return naics.drop_duplicates().reset_index(drop=True) -def map_source_sectors_to_less_aggregated_sectors( +def map_source_sectors_to_more_aggregated_sectors( year: Literal[2002, 2007, 2012, 2017] = 2012 ) -> pd.DataFrame: """ From 29adf42ad401854e99a289ad9d4fba33e71d0203 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 8 Aug 2023 11:57:27 -0600 Subject: [PATCH 0757/1127] new fxn map_source_sectors_to_less_aggregated_sectors() --- flowsa/naics.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/flowsa/naics.py b/flowsa/naics.py index 9725904b7..8d79b68d6 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -160,6 +160,43 @@ def map_source_sectors_to_more_aggregated_sectors( return naics_key.drop_duplicates() +def map_source_sectors_to_less_aggregated_sectors( + year: Literal[2002, 2007, 2012, 2017] = 2012 +) -> pd.DataFrame: + """ + Map source NAICS to all possible other sector lengths + parent-childhierarchy + """ + naics = [] + for n in naics_crosswalk.columns.values.tolist(): + naics_sub = naics_crosswalk.assign(source_naics=naics_crosswalk[n]) + naics.append(naics_sub) + + # concat data into single dataframe + naics_key = pd.concat(naics, sort=False) + naics_key = naics_key.dropna(subset=['source_naics']) + + # drop source_naics that are more aggregated than target_naics, reorder + for n in range(2, 8): + naics_key[f'NAICS_{n}'] = np.where( + naics_key[f'NAICS_{n}'].str.len() < naics_key[ + 'source_naics'].str.len(), + np.nan, + naics_key[f'NAICS_{n}']) + + cw_melt = naics_key.melt(id_vars="source_naics", + var_name="SectorLength", + value_name='Sector' + ).drop_duplicates().reset_index(drop=True) + + cw_melt = (cw_melt + .query("source_naics != Sector") + .query("~Sector.isna()") + ).drop_duplicates().reset_index(drop=True) + + return cw_melt + + def year_crosswalk( source_year: Literal[2002, 2007, 2012, 2017], target_year: Literal[2002, 2007, 2012, 2017] From de5779a82e80180f5a73dfc349f2e1a062156c60 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 8 Aug 2023 11:58:34 -0600 Subject: [PATCH 0758/1127] revise substitute_nonexistent_values() to work correctly --- flowsa/flowbyclean.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index 809450a18..ab88ed772 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -150,8 +150,9 @@ def substitute_nonexistent_values( .merge(other, on=list(other.select_dtypes( include=['object', 'int']).columns), - how='left', + how='outer', suffixes=(None, '_y')) + .fillna({'FlowAmount': 0}) ) # fill in missing data new_col_data = [col for col in merged if col.endswith('_y')] @@ -165,7 +166,7 @@ def substitute_nonexistent_values( merged[original_col] = merged[original_col].fillna( merged[c]) - # reset grop id and group total, drop columns + # reset group id and group total, drop columns merged = (merged .drop(merged.filter(regex='_y').columns, axis=1) .drop(columns=['group_id']) From fb518c323b46c27e7659c6d72178d5f6dcd3dd21 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 8 Aug 2023 14:49:29 -0600 Subject: [PATCH 0759/1127] account for activity ranges --- flowsa/data_source_scripts/BLS_QCEW.py | 51 +++++++++++++++----------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/flowsa/data_source_scripts/BLS_QCEW.py b/flowsa/data_source_scripts/BLS_QCEW.py index b7e1ab66c..53ab64b90 100644 --- a/flowsa/data_source_scripts/BLS_QCEW.py +++ b/flowsa/data_source_scripts/BLS_QCEW.py @@ -224,20 +224,32 @@ def estimate_suppressed_qcew(fba: FlowByActivity) -> FlowByActivity: else: log.critical('At a subnational scale, this will take a long time.') - fba = (fba - .assign(Unattributed=fba.FlowAmount.copy(), - Attributed=0) - .assign(descendants='') - ) + fba2 = (fba + .assign(Unattributed=fba.FlowAmount.copy(), + Attributed=0) + .assign(descendants='') + .replace({'ActivityProducedBy': {'31-33': '3X', + '44-45': '4X', + '48-49': '4Y'}}) + ) for level in [5, 4, 3, 2]: - descendants = ( - fba + descendants = pd.DataFrame( + fba2 .drop(columns='descendants') .query(f'ActivityProducedBy.str.len() > {level}') .assign( parent=lambda x: x.ActivityProducedBy.str.slice(stop=level) ) + # replace parent values if parent is a range + .replace({'parent': {'31': '3X', + '32': '3X', + '33': '3X', + '44': '4X', + '45': '4X', + '48': '4Y', + '49': '4Y' + }}) .groupby(['FlowName', 'Location', 'parent']) .agg({'Unattributed': 'sum', 'ActivityProducedBy': ' '.join}) .reset_index() @@ -246,8 +258,8 @@ def estimate_suppressed_qcew(fba: FlowByActivity) -> FlowByActivity: 'parent': 'ActivityProducedBy'}) ) - fba = ( - fba + fba2 = ( + fba2 .merge(descendants, how='left', on=['FlowName', 'Location', 'ActivityProducedBy'], @@ -264,21 +276,18 @@ def estimate_suppressed_qcew(fba: FlowByActivity) -> FlowByActivity: ) .drop(columns=['descendant_flows', 'descendants_y']) ) - fba = fba.drop(columns=['descendants']) + fba2 = fba2.drop(columns=['descendants']) indexed = ( - fba - .assign(n2=fba.ActivityProducedBy.str.slice(stop=2), - n3=fba.ActivityProducedBy.str.slice(stop=3), - n4=fba.ActivityProducedBy.str.slice(stop=4), - n5=fba.ActivityProducedBy.str.slice(stop=5), - n6=fba.ActivityProducedBy.str.slice(stop=6), - location=fba.Location, - category=fba.FlowName) + fba2 + .assign(n2=fba2.ActivityProducedBy.str.slice(stop=2), + n3=fba2.ActivityProducedBy.str.slice(stop=3), + n4=fba2.ActivityProducedBy.str.slice(stop=4), + n5=fba2.ActivityProducedBy.str.slice(stop=5), + n6=fba2.ActivityProducedBy.str.slice(stop=6), + location=fba2.Location, + category=fba2.FlowName) .replace({'FlowAmount': {0: np.nan}, - 'ActivityProducedBy': {'31-33': '3X', - '44-45': '4X', - '48-49': '4Y'}, 'n2': {'31': '3X', '32': '3X', '33': '3X', '44': '4X', '45': '4X', '48': '4Y', '49': '4Y'}}) From f15610048d6a1ddee3327247c27257078496e4a4 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 8 Aug 2023 16:51:01 -0600 Subject: [PATCH 0760/1127] reset index in estimate suppressed fxns before aggregating --- flowsa/data_source_scripts/BLS_QCEW.py | 3 +-- flowsa/flowbyclean.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/flowsa/data_source_scripts/BLS_QCEW.py b/flowsa/data_source_scripts/BLS_QCEW.py index 53ab64b90..18ff86c60 100644 --- a/flowsa/data_source_scripts/BLS_QCEW.py +++ b/flowsa/data_source_scripts/BLS_QCEW.py @@ -324,11 +324,10 @@ def fill_suppressed( unsuppressed = unsuppressed.groupby( level=groupcols).apply( fill_suppressed, level, 'ActivityProducedBy') - # ensure correct dtype - unsuppressed = unsuppressed.astype(indexed.dtypes.to_dict()) aggregated = ( unsuppressed + .reset_index(drop=True) .fillna({'FlowAmount': 0}) .drop(columns=['Unattributed', 'Attributed']) .assign(FlowName='Number of employees') diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index ab88ed772..d3955f978 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -330,11 +330,10 @@ def fill_suppressed( unsuppressed = unsuppressed.groupby( level=groupcols).apply( fill_suppressed, level, col) - # ensure correct dtype - unsuppressed = unsuppressed.astype(indexed.dtypes.to_dict()) aggregated = ( unsuppressed + .reset_index(drop=True) .fillna({'FlowAmount': 0}) .drop(columns=['Unattributed', 'Attributed']) # .replace({col: {'3X': '31-33', From 0ad2c013dc931564c4b5abc7b45ccca0ccbf877e Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 9 Aug 2023 08:14:51 -0600 Subject: [PATCH 0761/1127] update allocate_usda_ers_mlu_other() for state land method --- flowsa/data_source_scripts/USDA_ERS_MLU.py | 24 +++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/flowsa/data_source_scripts/USDA_ERS_MLU.py b/flowsa/data_source_scripts/USDA_ERS_MLU.py index 14df61974..edc89c9ed 100644 --- a/flowsa/data_source_scripts/USDA_ERS_MLU.py +++ b/flowsa/data_source_scripts/USDA_ERS_MLU.py @@ -12,7 +12,7 @@ import pandas as pd import numpy as np from flowsa.location import get_all_state_FIPS_2, US_FIPS -from flowsa.flowsa_log import vlog +from flowsa.flowsa_log import vlog, log from flowsa.flowbyfunctions import assign_fips_location_system, aggregator from flowsa.common import load_crosswalk from flowsa.literature_values import \ @@ -319,6 +319,9 @@ def allocate_usda_ers_mlu_other_land( :return: df, allocated USDS ERS MLU Land, FBS format """ + log.info('The only category for MLU other land use is rural land ' + 'occupation. All other land area in this category is ' + 'unassigned to sectors, resulting in unaccounted land area.') # land in rural residential lots rural_res = get_area_of_rural_land_occupied_by_houses_2013() @@ -326,12 +329,19 @@ def allocate_usda_ers_mlu_other_land( household = load_crosswalk('household') household = household['Code'].drop_duplicates().tolist() + # if it is state data, take weighted avg using land area + if fba.config['geoscale'] == 'state': + fba = (fba + .assign(rural_res=rural_res, + total_area=fba['FlowAmount'].sum(), + FlowAmount=lambda x: x['FlowAmount']/x[ + 'total_area'] * x['rural_res'] + ) + ) # in df, where sector is a personal expenditure value, and # location = 00000, replace with rural res value - vlog.info('The only category for MLU other land use is rural land ' - 'occupation. All other land area in this category is ' - 'unassigned to sectors, resulting in unaccounted land area.') - fba['FlowAmount'] = np.where(fba['SectorConsumedBy'].isin(household), - rural_res, fba['FlowAmount']) + elif fba.config['geoscale'] == 'national': + fba['FlowAmount'] = np.where(fba['SectorConsumedBy'].isin(household), + rural_res, fba['FlowAmount']) - return fba + return fba.drop(columns=['rurl_res', 'total_area'], errors='ignore') From f8e570cb6b920ac6b8e6e65decd1d29f1ed2097d Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 9 Aug 2023 08:15:53 -0600 Subject: [PATCH 0762/1127] update state water and land FBS methods - work correctly --- .../flowbysectormethods/Land_state_2012.yaml | 61 +++++++++---------- .../Water_state_2015_m1.yaml | 7 +++ 2 files changed, 37 insertions(+), 31 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Land_state_2012.yaml b/flowsa/methods/flowbysectormethods/Land_state_2012.yaml index c6c574dec..a1bcfddb6 100644 --- a/flowsa/methods/flowbysectormethods/Land_state_2012.yaml +++ b/flowsa/methods/flowbysectormethods/Land_state_2012.yaml @@ -17,7 +17,9 @@ sources_to_cache: Location: '00000' clean_fba: !script_function:EIA_CBECS_Land cbecs_land_fba_cleanup clean_fba_w_sec: !clean_function:flowbyclean attribute_national_to_states - clean_source: Employment_state_2012 + clean_source: + Employment_state_2012: + geoscale: state activity_sets: cbecs_land: # all activities in eia cbecs land crosswalk selection_fields: @@ -34,7 +36,9 @@ sources_to_cache: estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy clean_fba: !script_function:EIA_MECS mecs_land_fba_cleanup clean_fba_w_sec: !clean_function:flowbyclean attribute_national_to_states - clean_source: Employment_state_2014 + clean_source: + Employment_state_2014: + geoscale: state activity_sets: mecs_land: # all activities in eia mecs land crosswalk selection_fields: @@ -65,58 +69,53 @@ source_names: fedefl_mapping: USDA_ERS_MLU selection_fields: Class: Land - Location: !include:Location_common.yaml:_state_location activity_sets: cropland_crops: + industry_spec: + default: NAICS_6 + NAICS_7: ['111150', '111199'] selection_fields: PrimaryActivity: - 'Cropland used for crops' - 'Cropland idled' attribution_method: proportional attribution_source: - "USDA_CoA_Cropland": - year: 2012 + USDA_CoA_Cropland: selection_fields: - Class: "Land" + Class: Land FlowName: - "AREA HARVESTED" - "AREA" - "AREA IN PRODUCTION" - 'AREA BEARING & NON-BEARING' - 'AREA GROWN' - Location: !include:Location_common.yaml:_state_location exclusion_fields: conditional: {FlowName: 'AREA IN PRODUCTION', ActivityConsumedBy: 'VEGETABLE TOTALS'} - ActivityConsumedBy: ['AG LAND', 'AG LAND, CROPLAND, HARVESTED'] - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland_NAICS: - year: 2017 + ActivityConsumedBy: ['AG LAND, CROPLAND, HARVESTED'] + activity_sets: + cropland_attribution-cropland: + exclusion_fields: + ActivityConsumedBy: 'ORCHARDS' + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + selection_fields: + Class: Land + FlowName: + - "AG LAND, CROPLAND, HARVESTED" + estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution + cropland_attribution-orchards: selection_fields: - Class: Land - FlowName: - - "FARM OPERATIONS" - estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution - selection_fields_after_data_suppression_estimation: - PrimaryActivity: [ "112111", "112112", "11212", "1122", - "11231", "11232", "11233", "11234", - "11239", "11241", "11242", "11291", - "11292", "11293", "11299" ] + PrimaryActivity: ORCHARDS + attribution_method: direct pastureland: selection_fields: PrimaryActivity: - 'Cropland used for pasture' - 'Forest-use land grazed' - 'Grassland pasture and range' - attribution_method: proportional - attribution_source: - "USDA_CoA_Cropland_NAICS": - year: 2012 - selection_fields: - Class: "Land" - FlowName: "FARM OPERATIONS" - estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution + attribution_method: direct forest: selection_fields: PrimaryActivity: @@ -144,7 +143,7 @@ source_names: attribution_method: direct other: selection_fields: - PrimaryActivity: - - 'Other land' + PrimaryActivity: 'Other land' + Location: !include:Location_common.yaml:_state_location clean_fba_w_sec: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_other_land attribution_method: direct \ No newline at end of file diff --git a/flowsa/methods/flowbysectormethods/Water_state_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_state_2015_m1.yaml index 7cdfcf9e8..61fb0f41b 100644 --- a/flowsa/methods/flowbysectormethods/Water_state_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_state_2015_m1.yaml @@ -18,6 +18,13 @@ source_names: !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:direct_attribution employment_attribution: !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:employment_attribution + # First attribute employment FBS to NAICS6 and aggregate to NAICS3/4 + # at the end because we only want to capture the relevant employment + # sectors. For example, "Industrial" accounts for sector "1133", but + # if we map to NAICS3/4, then the employment will include all child + # NAICS of "113" instead of only "1133" + industry_spec: + default: NAICS_6 attribution_method: proportional attribution_source: Employment_state_2015 cropland_attribution: From 372aab5be7d8746d4633132a22fa86e44bb40294 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 9 Aug 2023 08:17:50 -0600 Subject: [PATCH 0763/1127] in equally_attribute() also group by "location" for special circumstances that appear in state land FBS - does not impact other FBS methods --- flowsa/flowby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 1279de043..e4a05f971 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -2058,7 +2058,7 @@ def equally_attribute(self: 'FlowByActivity') -> 'FlowByActivity': fba = self.add_primary_secondary_columns('Sector') - groupby_cols = ['group_id'] + groupby_cols = ['group_id', 'Location'] for rank in ['Primary', 'Secondary']: fba = ( fba From 10a02f1498189a555534e5dd2e72fef117f79f19 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 9 Aug 2023 15:17:00 -0600 Subject: [PATCH 0764/1127] drop duplicates when looking for 1:1 parent to child sectors that can arise if multiple generations of 1:1 --- flowsa/flowbyclean.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index d3955f978..b4daa34d5 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -218,8 +218,8 @@ def estimate_suppressed_sectors_equal_attribution( .assign(**{f"{col}": lambda x: x.Sector}) .drop(columns=['source_naics', 'Sector']) .query(f"~{col}.isna()") + .drop_duplicates() # duplicates if multiple generations of 1:1 ) - fba2 = fba2.astype(fba.dtypes.to_dict()) fba3 = (fba .merge(fba2, indicator=True, how='outer') @@ -235,12 +235,12 @@ def estimate_suppressed_sectors_equal_attribution( # drop rows that contain "&" and "-" fba3 = (fba3 - .query(f"~{col}.str.contains('&')") - .query(f"~{col}.str.contains('-')") - ) + .query(f"~{col}.str.contains('&')") + .query(f"~{col}.str.contains('-')") + ) for level in [6, 5, 4, 3, 2]: - descendants = pd.DataFrame( + descendants = ( fba3 .drop(columns='descendants') .query(f'{col}.str.len() > {level}') @@ -265,7 +265,7 @@ def estimate_suppressed_sectors_equal_attribution( descendants=lambda x: x.descendants.mask(x.descendants == '', x.descendants_y), Unattributed=lambda x: (x.Unattributed - - x.descendant_flows).mask( + x.descendant_flows).mask( x.Unattributed - x.descendant_flows < 0, 0), Attributed=lambda x: (x.Attributed + x.descendant_flows) From beda9c64f3b25c8e94a67c78ea0b9d4b57c146dc Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 9 Aug 2023 15:22:33 -0600 Subject: [PATCH 0765/1127] comment out data vis fxns until revised for v2.0 --- examples/generate_data_visualization.py | 152 ++++++++++++------------ flowsa/__init__.py | 37 +++--- 2 files changed, 96 insertions(+), 93 deletions(-) diff --git a/examples/generate_data_visualization.py b/examples/generate_data_visualization.py index 747989648..a5fafdd3e 100644 --- a/examples/generate_data_visualization.py +++ b/examples/generate_data_visualization.py @@ -3,6 +3,8 @@ # coding=utf-8 """ +Data visualization will be revised at a later date to work for flowsav2.0 + Generate plots to explore Flow-By-Sector model outputs """ @@ -13,85 +15,85 @@ ########## Produce facet graph of resources associated with cropland sectors ########## -sectors = ['112'] -sector_length_display = 6 -plottype = 'facet_graph' -method_dict = {'Water Withdrawal 2015': 'Water_national_2015_m1', - 'Land Use 2012': 'Land_national_2012', - 'Employment 2017': 'Employment_national_2017'} - - -dv.FBSscatterplot(method_dict, plottype, - sector_length_display=sector_length_display, - sectors_to_include=sectors, - plot_title='Direct Resource Use for Livestock' - ) -# Can manually adjust the figure pop up before saving -plt.savefig(plotoutputpath / "livestock_resource_use.png", dpi=300) - - -########## Compare the results between water method 1 and method 2 ########## -sectors = ['21'] -sector_length_display = 6 -plottype = 'method_comparison' -method_dict = {'Water Withdrawal 2015 M1': 'Water_national_2015_m1', - 'Water Withdrawal 2015 M2': 'Water_national_2015_m2'} - -flowsa.generateFBSplot(method_dict, plottype, - sector_length_display=sector_length_display, - sectors_to_include=sectors, - plot_title='Comparison of 2015 National Water ' - 'Withdrawals Method 1 and Method 2 for ' - 'Mining Sectors' - ) -# Can manually adjust the figure pop up before saving -plt.savefig(plotoutputpath / "mining_water_comp.png", dpi=300) +# sectors = ['112'] +# sector_length_display = 6 +# plottype = 'facet_graph' +# method_dict = {'Water Withdrawal 2015': 'Water_national_2015_m1', +# 'Land Use 2012': 'Land_national_2012', +# 'Employment 2017': 'Employment_national_2017'} +# +# +# dv.FBSscatterplot(method_dict, plottype, +# sector_length_display=sector_length_display, +# sectors_to_include=sectors, +# plot_title='Direct Resource Use for Livestock' +# ) +# # Can manually adjust the figure pop up before saving +# plt.savefig(plotoutputpath / "livestock_resource_use.png", dpi=300) +# +# +# ########## Compare the results between water method 1 and method 2 ########## +# sectors = ['21'] +# sector_length_display = 6 +# plottype = 'method_comparison' +# method_dict = {'Water Withdrawal 2015 M1': 'Water_national_2015_m1', +# 'Water Withdrawal 2015 M2': 'Water_national_2015_m2'} +# +# flowsa.generateFBSplot(method_dict, plottype, +# sector_length_display=sector_length_display, +# sectors_to_include=sectors, +# plot_title='Comparison of 2015 National Water ' +# 'Withdrawals Method 1 and Method 2 for ' +# 'Mining Sectors' +# ) +# # Can manually adjust the figure pop up before saving +# plt.savefig(plotoutputpath / "mining_water_comp.png", dpi=300) ########## Compare food waste flows via Sankey ########## -methodnames = ['Food_Waste_national_2018_m1', 'Food_Waste_national_2018_m2'] -target_sector_level = 'NAICS_2' -target_subset_sector_level = { - 'Food_Waste_national_2018_m1': {'NAICS_4': ['2212'], - 'NAICS_6': ['62421', '31111', '32411', - '56221', '62421', '115112', - '22132'], - 'NAICS_7': ['562212', '562219'] - }, - 'Food_Waste_national_2018_m2': { - 'SectorConsumedBy': {'NAICS_6': ['115112', '22132','311119', - '32411', '562213','62421'], - 'NAICS_7': ['562212', '562219'] - }} -} -# set domain to scale sankey diagrams -domain_dict = {0: {'x': [0.01, 0.49], 'y': [0, 1]}, - 1: {'x': [.51, 0.99], 'y': [.12, .88]} - } - -dv.generateSankeyDiagram( - methodnames, - target_sector_level=target_sector_level, - target_subset_sector_level=target_subset_sector_level, - use_sectordefinition=True, - sectors_to_include=None, - fbsconfigpath=None, - orientation='horizontal', - domain_dict=domain_dict, - value_label_format='brackets', - subplot_titles=['m1', 'm2'], - filename='FoodWasteSankey' -) +# methodnames = ['Food_Waste_national_2018_m1', 'Food_Waste_national_2018_m2'] +# target_sector_level = 'NAICS_2' +# target_subset_sector_level = { +# 'Food_Waste_national_2018_m1': {'NAICS_4': ['2212'], +# 'NAICS_6': ['62421', '31111', '32411', +# '56221', '62421', '115112', +# '22132'], +# 'NAICS_7': ['562212', '562219'] +# }, +# 'Food_Waste_national_2018_m2': { +# 'SectorConsumedBy': {'NAICS_6': ['115112', '22132','311119', +# '32411', '562213','62421'], +# 'NAICS_7': ['562212', '562219'] +# }} +# } +# # set domain to scale sankey diagrams +# domain_dict = {0: {'x': [0.01, 0.49], 'y': [0, 1]}, +# 1: {'x': [.51, 0.99], 'y': [.12, .88]} +# } +# +# dv.generateSankeyDiagram( +# methodnames, +# target_sector_level=target_sector_level, +# target_subset_sector_level=target_subset_sector_level, +# use_sectordefinition=True, +# sectors_to_include=None, +# fbsconfigpath=None, +# orientation='horizontal', +# domain_dict=domain_dict, +# value_label_format='brackets', +# subplot_titles=['m1', 'm2'], +# filename='FoodWasteSankey' +# ) ####### GHG Bar Chart ############ # Option 1 - GHG emissions by GHG -dv.stackedBarChart('GHG_national_2018_m1', - selection_fields={'Sector': ['111110', '112120', '325312']}, - filename='GHGEmissions') - -# Option 2 - specify indicator, much have LCIAformatter installed -# https://github.com/USEPA/LCIAformatter -dv.stackedBarChart('GHG_national_2018_m1', impact_cat='Global warming', - selection_fields={'Sector': ['111110', '112120', '325312']}, - filename='GHGEmissionsGlobalWarming') +# dv.stackedBarChart('GHG_national_2018_m1', +# selection_fields={'Sector': ['111110', '112120', '325312']}, +# filename='GHGEmissions') +# +# # Option 2 - specify indicator, much have LCIAformatter installed +# # https://github.com/USEPA/LCIAformatter +# dv.stackedBarChart('GHG_national_2018_m1', impact_cat='Global warming', +# selection_fields={'Sector': ['111110', '112120', '325312']}, +# filename='GHGEmissionsGlobalWarming') diff --git a/flowsa/__init__.py b/flowsa/__init__.py index 2a9b46d10..0a9bd2d61 100644 --- a/flowsa/__init__.py +++ b/flowsa/__init__.py @@ -181,21 +181,22 @@ def seeAvailableFlowByModels(flowbytype, print_method=True): return data_print -def generateFBSplot(method_dict, plottype, sector_length_display=None, - sectors_to_include=None, plot_title=None): - """ - Plot the results of FBS models. Graphic can either be a faceted - scatterplot or a method comparison - :param method_dict: dictionary, key is the label, value is the FBS - methodname - :param plottype: str, 'facet_graph' or 'method_comparison' - :param sector_length_display: numeric, sector length by which to - aggregate, default is 'None' which returns the max sector length in a - dataframe - :param sectors_to_include: list, sectors to include in output. Sectors - are subset by all sectors that "start with" the values in this list - :return: graphic displaying results of FBS models - """ - - FBSscatterplot(method_dict, plottype, sector_length_display, - sectors_to_include, plot_title) +# todo: revise data vis fxns for recursive method +# def generateFBSplot(method_dict, plottype, sector_length_display=None, +# sectors_to_include=None, plot_title=None): +# """ +# Plot the results of FBS models. Graphic can either be a faceted +# scatterplot or a method comparison +# :param method_dict: dictionary, key is the label, value is the FBS +# methodname +# :param plottype: str, 'facet_graph' or 'method_comparison' +# :param sector_length_display: numeric, sector length by which to +# aggregate, default is 'None' which returns the max sector length in a +# dataframe +# :param sectors_to_include: list, sectors to include in output. Sectors +# are subset by all sectors that "start with" the values in this list +# :return: graphic displaying results of FBS models +# """ +# +# FBSscatterplot(method_dict, plottype, sector_length_display, +# sectors_to_include, plot_title) From 71f7f2a46f7b57b4c33c38745dd95851ac8b922f Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 11 Aug 2023 07:39:20 -0600 Subject: [PATCH 0766/1127] use PrimarySector/SecondarySector in 'attribute_on' instead of SectorConsumed/ProducedBy because of where 'attribute_on' is called on in proportionally_attribute --- .../Food_Waste_national_2018_m1.yaml | 20 +++++++++---------- .../Food_Waste_national_2018_m2.yaml | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m1.yaml b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m1.yaml index 74b0c02b3..3249e8ca9 100644 --- a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m1.yaml @@ -32,6 +32,7 @@ source_names: - "Sports Venues" attribution_method: direct employment: + primary_action_type: Produced selection_fields: PrimaryActivity: - "Correctional Facilities" @@ -42,18 +43,19 @@ source_names: - "Restaurants/Food Services" - "Retail" attribution_method: proportional - # do not want to attribute the waste management pathways using +# do not want to attribute the waste management pathways using # employment data (SectorConsumedBy), only attribute the waste # generation activities (SectorProducedBy) - attribute_on: [SectorProducedBy] + attribute_on: [PrimarySector] attribution_source: Employment_national_2018 establishments: + primary_action_type: Produced selection_fields: PrimaryActivity: - "Wholesale" attribution_method: proportional # do not want to attribute the waste management pathways using employment data (SectorConsumedBy) - attribute_on: [SectorProducedBy] + attribute_on: [PrimarySector] attribution_source: BLS_QCEW: selection_fields: @@ -68,12 +70,13 @@ source_names: 'Number of establishments, State Government': 'Number of establishments' } # standardize after estimating suppressed manufacturing: + primary_action_type: Produced selection_fields: PrimaryActivity: - "Manufacturing/Processing" attribution_method: proportional # do not want to attribute the waste management pathways using employment data (SectorConsumedBy) - attribute_on: [SectorProducedBy] + attribute_on: [PrimarySector] attribution_source: Census_ASM: selection_fields: @@ -105,9 +108,6 @@ source_names: - 'Services to buildings and dwellings' - 'Museums, historical sites, zoos, and parks' attribution_method: proportional - # do not want to attribute the waste management pathways using employment data (SectorConsumedBy) - attribute_on: [SectorProducedBy] - attribution_source: - Employment_national_2018: - year: 2018 - primary_action_type: Produced + # do not want to attribute the waste management pathways using employment data (SectorProducedBy) + attribute_on: ['PrimarySector'] # In this case, only SectorConsumedBy + attribution_source: Employment_national_2018 diff --git a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml index fc6a4a36c..88f9f17a2 100644 --- a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml +++ b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml @@ -18,7 +18,7 @@ source_names: PrimarySector: !from_index:CNHW_Food_asets.csv wasted_food_report attribution_method: proportional primary_action_type: Produced - attribute_on: [SectorProducedBy] + attribute_on: [PrimarySector] fill_columns: SectorConsumedBy attribution_source: EPA_WFR: From 0d9d3bac20cd9ed8323d90a207ff82cad0976396 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 11 Aug 2023 07:42:31 -0600 Subject: [PATCH 0767/1127] drop redundant fxn call --- flowsa/flowby.py | 1 - 1 file changed, 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index e4a05f971..a5bdc6c93 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -984,7 +984,6 @@ def proportionally_attribute( attribute_cols = self.config.get('attribute_on') log.info(f'Proportionally attributing on {attribute_cols}') - fb = (fb.add_primary_secondary_columns('Sector')) merged = ( fb From 4fa8ac5f67b1df516a8fbd3ad1fadd160cad64c7 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 11 Aug 2023 07:44:08 -0600 Subject: [PATCH 0768/1127] reassign census_pep_population ACB to 'FO1000' for households --- flowsa/data/source_catalog.yaml | 3 ++- flowsa/data_source_scripts/Census_PEP_Population.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 65c0db0d1..f40767c95 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -89,7 +89,8 @@ Census_CBP: Census_PEP_Population: data_format: FBA class: Other - activity_schema: None + activity_schema: NAICS_2012_Code + sector_hierarchy: "flat" Census_QWI: data_format: FBA class: diff --git a/flowsa/data_source_scripts/Census_PEP_Population.py b/flowsa/data_source_scripts/Census_PEP_Population.py index 94ee64083..498d8c09a 100644 --- a/flowsa/data_source_scripts/Census_PEP_Population.py +++ b/flowsa/data_source_scripts/Census_PEP_Population.py @@ -158,7 +158,7 @@ def census_pop_parse(*, df_list, year, **_): df['SourceName'] = 'Census_PEP_Population' df['FlowName'] = 'Population' df['Unit'] = 'p' - df['ActivityConsumedBy'] = 'All' + df['ActivityConsumedBy'] = 'F01000' # attribute to household # temporary data quality scores df['DataReliability'] = 5 # tmp df['DataCollection'] = 5 # tmp From 76c2a6e9f61835200abb409336866e689f44813e Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 11 Aug 2023 11:43:19 -0400 Subject: [PATCH 0769/1127] update metadata handling for cached sources --- flowsa/metadata.py | 45 ++++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/flowsa/metadata.py b/flowsa/metadata.py index 97e3b44ac..321d14e84 100644 --- a/flowsa/metadata.py +++ b/flowsa/metadata.py @@ -113,11 +113,12 @@ def return_fbs_method_data(source_name, config): v['inventory_dict']) continue - cat = get_catalog_info(k)['data_format'].replace( - 'FBS', 'FlowBySector').replace('FBA', 'FlowByActivity') + cat = (get_catalog_info(k)['data_format'] + .replace('FBS', 'FlowBySector') + .replace('FBA', 'FlowByActivity')) # append source and year - year = config['year'] if v.get('year') is None else v.get('year') + year = v.get('year', config['year']) meta['primary_source_meta'][k] = getMetadata(k, year=year, category=cat) # create dictionary of allocation datasets for different activities @@ -125,23 +126,32 @@ def return_fbs_method_data(source_name, config): if activities is None: continue # initiate nested dictionary - meta['primary_source_meta'][k]['attribution_source_meta'] = {} + attr_source_meta = {} # subset activity data and allocate to sector for aset, attr in activities.items(): - if attr.get('attribution_source'): + attr_dict = attr.get('attribution_source') + if attr_dict: # append fba meta try: - source = list(attr['attribution_source'].keys())[0] - year = attr['attribution_source'][source].get('year') + source = list(attr_dict.keys())[0] + # Check first for cached source + if source in config.get('sources_to_cache', ()): + year = (config.get('sources_to_cache') + .get(source) + .get('year', v.get('year')) + ) + else: + year = attr_dict[source].get('year', v.get('year')) except AttributeError: - source = attr['attribution_source'] + source = attr_dict year = None + if source in attr_source_meta.keys(): + continue + cat = (get_catalog_info(source)['data_format'] + .replace('FBS', 'FlowBySector') + .replace('FBA', 'FlowByActivity')) - cat = get_catalog_info(source)['data_format'].replace( - 'FBS', 'FlowBySector').replace('FBA', 'FlowByActivity') - - meta['primary_source_meta'][k]['attribution_source_meta'][ - source] = getMetadata( + attr_source_meta[source] = getMetadata( source, year=year, category=cat) if 'literature_sources' in attr: @@ -149,8 +159,13 @@ def return_fbs_method_data(source_name, config): for s, y in lit.items(): lit_meta = return_fba_method_meta(s, year=y) # append fba meta - meta['primary_source_meta'][k][ - 'attribution_source_meta'][s] = lit_meta + attr_source_meta[s] = lit_meta + if 'attribution_source_meta' in meta['primary_source_meta'][k]: + meta['primary_source_meta'][k][ + 'attribution_source_meta'].update(attr_source_meta) + else: + meta['primary_source_meta'][k][ + 'attribution_source_meta'] = attr_source_meta return meta From d6e4da770e50963dea7da9f86e70bff7966c0c22 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 11 Aug 2023 11:43:35 -0400 Subject: [PATCH 0770/1127] add variable NAICS year for MECS_Energy --- flowsa/data/source_catalog.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index f40767c95..e2af0fbfd 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -130,7 +130,10 @@ EIA_MECS_Energy: - Energy - Other - Money - activity_schema: NAICS_2017_Code + activity_schema: {2010: NAICS_2007_Code, + 2014: NAICS_2012_Code, + 2018: NAICS_2017_Code, + } sector_hierarchy: "parent-incompleteChild" EIA_MECS_Land: data_format: FBA From 3195dcf85a9a4a95371941e51278fad85cfd09f3 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 11 Aug 2023 12:27:53 -0400 Subject: [PATCH 0771/1127] Reset group_total after adjusting for descendents to avoid incorrect validation errors --- flowsa/flowbyclean.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index b4daa34d5..81d443fbb 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -526,6 +526,15 @@ def define_parentincompletechild_descendants( ) .drop(columns=['descendant_flows', 'descendants_y']) ) + # Reset group_total after adjusting for descendents + fba = (fba + .drop(columns='group_total') + .merge((fba.groupby('group_id') + .agg({'FlowAmount':sum}) + .rename(columns={'FlowAmount': 'group_total'}) + ), + on='group_id', how='left', validate='m:1') + ) return fba From e0b7e272b0ab1682d868b6886399582ac1ec7ea8 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 11 Aug 2023 13:04:17 -0400 Subject: [PATCH 0772/1127] avoid validation when no attribution performed --- flowsa/flowby.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index a5bdc6c93..67cddb468 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -631,7 +631,7 @@ def attribute_flows_to_sectors( attributed to those sectors, by the methods specified in the calling FBA's configuration dictionary. """ - + validate = True # look for the "attribute" key in the FBS yaml, which will exist if # there are multiple, non-recursive attribution methods applied to a # data source @@ -730,6 +730,7 @@ def attribute_flows_to_sectors( log.info('No attribution needed for %s at the given industry ' 'aggregation level', fb.full_name) attributed_fb = fb.copy() + validate = False else: if step_config.get('attribution_method') is None: log.warning('No attribution method specified for %s. ' @@ -741,8 +742,8 @@ def attribute_flows_to_sectors( # depending on att method, check that new df values equal # original df values - if attribution_method not in ['multiplication', 'inheritance', - 'division']: + if validate and attribution_method not in [ + 'multiplication', 'inheritance', 'division']: # todo: add results from this if statement to validation log validation_fb = attributed_fb.assign( validation_total=(attributed_fb.groupby('group_id') From 551dd85fde492359c2c66a7e769a0e840f9d0290 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 11 Aug 2023 14:04:29 -0400 Subject: [PATCH 0773/1127] drop duplicates to avoid duplicate listing when aggregating on 3 or 4 digit sector lists --- flowsa/flowby.py | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 67cddb468..712116413 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1941,6 +1941,7 @@ def map_to_sectors( right_on=['Activity', 'source_naics']) .assign(Sector=lambda x: x['target_naics']) .drop(columns=['source_naics', 'target_naics']) + .drop_duplicates() ) fba_w_naics = self.copy() From 9af68315644aff51023b77b12218128b86f6b2b2 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 11 Aug 2023 14:37:11 -0400 Subject: [PATCH 0774/1127] update validation and log statements, only display dfs in validation log file --- flowsa/flowby.py | 45 ++++++++++++++++++++++++++++++-------------- flowsa/validation.py | 2 +- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 712116413..ea0132ace 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -6,8 +6,8 @@ from copy import deepcopy from flowsa import (common, settings, metadata, sectormapping, literature_values, flowbyactivity, flowsa_yaml, - validation, geo, naics, exceptions, location) -from flowsa.flowsa_log import log, reset_log_file + validation, geo, naics, exceptions, location, schema) +from flowsa.flowsa_log import log, vlog, reset_log_file import esupy.processed_data_mgmt import esupy.dqi import fedelemflowlist @@ -756,7 +756,7 @@ def attribute_flows_to_sectors( .query('validation_total != group_total') [['group_id', 'ActivityProducedBy', 'ActivityConsumedBy', - 'SectorProducedBy', 'SectorConsumedBy', + 'SectorProducedBy', 'SectorConsumedBy', 'Location', 'FlowAmount', 'group_total', 'validation_total']]) log.error('Errors in attributing flows from %s:\n%s', self.full_name, errors) @@ -765,9 +765,13 @@ def attribute_flows_to_sectors( .drop_duplicates())['group_total'].sum() attsum = (validation_fb[['group_id', 'validation_total']] .drop_duplicates())['validation_total'].sum() - percent_change = ((attsum - fbsum)/fbsum)*100 - log.info(f"Percent change in dataset after attribution is" - f" {percent_change}") + percent_change = round(((attsum - fbsum)/fbsum)*100,3) + if percent_change == 0: + log.info(f"No change in {self.full_name} FlowAmount after " + "attribution.") + else: + log.info(f"Percent change in {self.full_name} after " + f"attribution is {percent_change}%") # run function to clean fbs after attribution attributed_fb = attributed_fb.function_socket( @@ -958,17 +962,29 @@ def proportionally_attribute( unattributable = with_denominator.query(f'denominator == 0 ') if not unattributable.empty: - log.warning( + vlog.warning( 'Could not attribute activities in %s due to lack of ' - 'flows in attribution source %s for mapped %s sectors %s', - #set(zip(unattributable.ActivityProducedBy, - # unattributable.ActivityConsumedBy, - # unattributable.Location)), + 'flows in attribution source %s for mapped %s sectors %s. ' + 'See validation_log for details.', unattributable.full_name, other.full_name, rank, sorted(set(unattributable[f'{rank}Sector'])) ) + if other_geoscale.aggregation_level < 5: + # if other_geoscale < 5: + vlog.warning('This can occur when combining datasets ' + 'at a sub-national level when activities ' + 'do not align for some locations.') + vlog.debug( + 'Unattributed activities: \n {}'.format( + unattributable + .drop(columns=schema.dq_fields + + ['LocationSystem', 'SectorSourceName', 'FlowType', + 'ProducedBySectorType', 'ConsumedBySectorType', + 'denominator', 'Suppressed'], + errors='ignore') + .to_string())) proportionally_attributed = ( non_zero_denominator @@ -2014,8 +2030,9 @@ def map_to_sectors( .drop_duplicates()) log.warning('Activities in %s are not mapped to sectors: %s', not_mapped.full_name, - set(zip(not_mapped.ActivityProducedBy, - not_mapped.ActivityConsumedBy)) + sorted( + set(not_mapped.ActivityProducedBy.dropna()) + .union(set(not_mapped.ActivityConsumedBy.dropna()))) ) # drop rows of data that are not mapped to sectors fba_w_naics = fba_w_naics.dropna(subset=[ @@ -2112,7 +2129,7 @@ def prepare_fbs( ) except ValueError: return FlowBySector(pd.DataFrame()) - + log.info(f'Processing FlowBySector for {self.full_name}') # Primary FlowBySector generation approach: return FlowBySector( self diff --git a/flowsa/validation.py b/flowsa/validation.py index af8a237af..4c6cc4cd8 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -755,7 +755,7 @@ def compare_geographic_totals( f'values and {subnational_geoscale} subset, ' f'saving to validation log') - vlog.info( + vlog.debug( 'Comparison of National FlowAmounts to aggregated data ' 'subset for %s: \n {}'.format( df_m_sub.to_string()), activity_set) From 30103827d11fee19f6a5436ac8597221049a491e Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sun, 13 Aug 2023 21:53:55 -0400 Subject: [PATCH 0775/1127] fix error in assigning MECS year --- .../GHG_national_2016_m1.yaml | 40 +++++++++++++++---- .../GHG_national_2017_m1.yaml | 40 +++++++++++++++---- .../GHG_national_2018_m1.yaml | 40 +++++++++++++++---- .../GHG_national_2019_m1.yaml | 40 +++++++++++++++---- .../GHG_national_2020_m1.yaml | 40 +++++++++++++++---- .../GHG_national_m1_common.yaml | 5 +-- 6 files changed, 162 insertions(+), 43 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml index e053ad269..c7f418bfc 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml @@ -92,10 +92,16 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets petroleum: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum:attribution_source:EIA_MECS_Energy + year: *mecs_year natural_gas: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas:attribution_source:EIA_MECS_Energy + year: *mecs_year ### Major CO2 Sources "EPA_GHGI_T_A_9": # CO2 emissions from stationary combustion. This table number changes with year @@ -106,10 +112,16 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 @@ -119,10 +131,16 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year ng_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9 @@ -132,7 +150,13 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year ng_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml index 03f51c13b..228443cda 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml @@ -92,10 +92,16 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets petroleum: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum:attribution_source:EIA_MECS_Energy + year: *mecs_year natural_gas: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas:attribution_source:EIA_MECS_Energy + year: *mecs_year ### Major CO2 Sources "EPA_GHGI_T_A_8": # CO2 emissions from stationary combustion @@ -106,10 +112,16 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 @@ -119,10 +131,16 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year ng_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9 @@ -132,7 +150,13 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year ng_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml index de44d4108..9a6491312 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml @@ -92,10 +92,16 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets petroleum: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum:attribution_source:EIA_MECS_Energy + year: *mecs_year natural_gas: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas:attribution_source:EIA_MECS_Energy + year: *mecs_year ### Major CO2 Sources "EPA_GHGI_T_A_7": # CO2 emissions from stationary combustion. This table number varies by GHG year @@ -106,10 +112,16 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 @@ -119,10 +131,16 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year ng_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9 @@ -132,7 +150,13 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year ng_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year \ No newline at end of file diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml index c58e68b45..e0f6893f4 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml @@ -92,10 +92,16 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets petroleum: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum:attribution_source:EIA_MECS_Energy + year: *mecs_year natural_gas: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas:attribution_source:EIA_MECS_Energy + year: *mecs_year ### Major CO2 Sources "EPA_GHGI_T_A_6": # CO2 emissions from stationary combustion. This table number varies by GHG year. @@ -106,10 +112,16 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 @@ -119,10 +131,16 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year ng_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9 @@ -132,7 +150,13 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year ng_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml index 1be323b8d..42838d1ac 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml @@ -92,10 +92,16 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets petroleum: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum:attribution_source:EIA_MECS_Energy + year: *mecs_year natural_gas: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas:attribution_source:EIA_MECS_Energy + year: *mecs_year ## Major CO2 Sources "EPA_GHGI_T_A_5": # CO2 emissions from stationary combustion. This table number varies by GHG year. @@ -106,10 +112,16 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion @@ -120,10 +132,16 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year ng_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9 @@ -133,7 +151,13 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year ng_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing - year: *mecs_year + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml index ea793a915..946d03229 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml @@ -28,10 +28,9 @@ attribution_sources: Description: - Table 2.2 # applies to Class Other - Table 3.2 # applies to Class Energy + exclusion_fields: + ActivityConsumedBy: '31-33' estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy - # todo: delete below code now that mecs reassigned to "parent-incompleteChild" -# clean_fba: !script_function:EIA_MECS define_parentincompletechild_descendants -# clean_fba_w_sec: !script_function:EIA_MECS drop_parentincompletechild_descendants attribution_method: proportional # attribution_source: # Include in main method # BEA_Use_Detail_PRO_BeforeRedef: From 26bcaf61a3ad940649d350268638dca7174b70b3 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sun, 13 Aug 2023 22:35:51 -0400 Subject: [PATCH 0776/1127] specify equal attribution in method instead of using that as default --- flowsa/flowby.py | 7 ++++++- .../flowbysectormethods/GHG_national_m1_common.yaml | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index ea0132ace..725f334d4 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -685,7 +685,7 @@ def attribute_flows_to_sectors( for k, v in step_config['attribution_source'].items(): attribution_name = k - if attribution_method in ['direct', 'inheritance']: + if attribution_method in ['direct', 'inheritance', 'equal']: fb = fb.assign(AttributionSources='Direct') else: fb = fb.assign(AttributionSources=attribution_name) @@ -720,6 +720,11 @@ def attribute_flows_to_sectors( 'sectors inherit parent values.') attributed_fb = fb.copy() + elif attribution_method == 'equal': + log.info(f"Equally attributing {self.full_name} to " + f"target sectors.") + attributed_fb = fb.equally_attribute() + elif attribution_method != 'direct': log.error('Attribution method for %s not recognized: %s', fb.full_name, attribution_method) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml index 946d03229..5fd62d385 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml @@ -16,6 +16,12 @@ attribution_sources: _BEA: &bea year: 2012 activity_to_sector_mapping: BEA_2012_Detail + exclusion_fields: + # Drop irrelevant final demand and total sectors + ActivityConsumedBy: ['F03000', 'F04000', 'F05000', + 'T001', 'T004', 'T007'] + ActivityProducedBy: ['T007'] + attribution_method: equal _mecs_energy: EIA_MECS_Energy: &mecs_energy From 7c8f629b2e6492b6ff530a440c3eb76af232e24b Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sun, 13 Aug 2023 22:43:38 -0400 Subject: [PATCH 0777/1127] fix error in assigning year for USGS_MYB for metadata for 2020 --- flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml | 5 ++++- flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml | 5 ++++- flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml | 5 ++++- flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml | 5 ++++- flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml | 5 ++++- 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml index c7f418bfc..64bb82c8b 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml @@ -21,7 +21,10 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets lead: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead - year: *ghgi_year + attribution_source: + USGS_MYB_Lead: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead + year: *ghgi_year "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml index 228443cda..373a71292 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml @@ -21,7 +21,10 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets lead: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead - year: *ghgi_year + attribution_source: + USGS_MYB_Lead: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead + year: *ghgi_year "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml index 9a6491312..80389fb03 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml @@ -21,7 +21,10 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets lead: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead - year: *ghgi_year + attribution_source: + USGS_MYB_Lead: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead + year: *ghgi_year "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml index e0f6893f4..e3dc7b20c 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml @@ -21,7 +21,10 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets lead: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead - year: *ghgi_year + attribution_source: + USGS_MYB_Lead: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead + year: *ghgi_year "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml index 42838d1ac..52e01746d 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml @@ -21,7 +21,10 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets lead: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead - year: 2019 # latest year + attribution_source: + USGS_MYB_Lead: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead + year: 2019 # latest year available "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year From 661508aadaa4644511432eb8f4ea331a6f696f55 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 15 Aug 2023 09:38:27 -0600 Subject: [PATCH 0778/1127] delete unused temp_data_source_functions.py fxns --- .../temp_data_source_functions.py | 51 ------------------- 1 file changed, 51 deletions(-) diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index 8e32e0c10..73c6880f3 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -1,34 +1,7 @@ -from flowsa import naics -from flowsa import settings -import pandas as pd from flowsa.data_source_scripts import EPA_GHGI as ghgi -from flowsa.data_source_scripts import USDA_CoA_Cropland as coa from flowsa.flowby import FlowByActivity -def clean_usda_cropland_naics(fba: FlowByActivity, **kwargs): - if fba.config['industry_spec']['default'] == 'NAICS_2': - naics_2 = ( - fba - .query('ActivityProducedBy.str.len() == 3') - .assign(ActivityProducedBy=lambda x: (x.ActivityProducedBy - .str.slice(stop=2))) - .groupby(fba.groupby_cols).agg('sum') - .reset_index() - ) - fba = pd.concat([naics_2, fba]).reset_index(drop=True) - - target_naics = set( - naics.industry_spec_key(fba.config['industry_spec']) - .target_naics - .str.replace('0', '') - ) | {'1122', '1125'} - - filtered = fba.query('ActivityConsumedBy in @target_naics') - - return filtered - - def clean_mecs_energy_fba_for_bea_summary(fba: FlowByActivity, **kwargs): naics_3 = fba.query('ActivityConsumedBy.str.len() == 3') naics_4 = fba.query('ActivityConsumedBy.str.len() == 4 ' @@ -82,27 +55,3 @@ def clean_hfc_fba_for_seea(fba: FlowByActivity, **kwargs): setattr(new_fba, attr, attributes_to_save[attr]) return new_fba - -# todo: delete after confirming no longer used in FBS methods -# def disaggregate_coa_cropland_to_6_digit_naics(fba: FlowByActivity): -# """ -# Disaggregate usda coa cropland to naics 6. Fragile implementation, should -# be replaced. In particular, it will break things for any industry -# specification other than {'default': 'NAICS_6'}. -# :param fba: df, CoA cropland data, FBA format with sector columns -# :return: df, CoA cropland with disaggregated NAICS sectors -# """ -# attributes_to_save = { -# attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] -# } -# -# df = coa.disaggregate_coa_cropland_to_6_digit_naics( -# fba, fba.config, fba.config, -# download_FBA_if_missing=settings.DEFAULT_DOWNLOAD_IF_MISSING -# ) -# -# new_fba = FlowByActivity(df) -# for attr in attributes_to_save: -# setattr(new_fba, attr, attributes_to_save[attr]) -# -# return new_fba From 62f7958edd5bf167029283e7303ad112a118bdea Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 15 Aug 2023 09:39:17 -0600 Subject: [PATCH 0779/1127] when calling USDA_CoA_Cropland_NAICS as an attribution source, estimate suppressed data --- flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml | 1 + flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml | 3 ++- flowsa/methods/flowbysectormethods/GHG_state_common.yaml | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml index 1d668a76e..f955fbde1 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml @@ -64,6 +64,7 @@ _attribution_sources: selection_fields: Class: Land FlowName: AG LAND, CROPLAND, HARVESTED + estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution USDA_CoA_Livestock: &livestock_allocation year: 2017 diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml index 5fd62d385..10a8759ef 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml @@ -60,6 +60,7 @@ attribution_sources: selection_fields: Class: Land FlowName: AG LAND, CROPLAND, HARVESTED + estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution _animal_land_allocation: &animal_land_allocation USDA_CoA_Cropland_NAICS: @@ -67,7 +68,7 @@ attribution_sources: selection_fields: Class: Land FlowName: FARM OPERATIONS - clean_fba: !script_function:temp_data_source_functions clean_usda_cropland_naics + estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution source_names: EPA_GHGI_T_2_1: #U.S. GHG emissions diff --git a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml index 94d09da65..a1777863b 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml @@ -200,6 +200,7 @@ source_names: selection_fields: Class: Land FlowName: AG LAND, CROPLAND, HARVESTED # land in active use + estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution transport_petroleum: # C02 from petroleum highway # state inventory assumes all petroleum is "highway" From e764e52f020b7e2e5aeed6aa20dabc5bfd5161c1 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 15 Aug 2023 13:32:32 -0400 Subject: [PATCH 0780/1127] correct implementation of use table for state ghg method --- .../flowbysectormethods/GHG_state_2012.yaml | 38 ++++++++----------- .../flowbysectormethods/GHG_state_2013.yaml | 38 ++++++++----------- .../flowbysectormethods/GHG_state_2014.yaml | 38 ++++++++----------- .../flowbysectormethods/GHG_state_2015.yaml | 38 ++++++++----------- .../flowbysectormethods/GHG_state_2016.yaml | 38 ++++++++----------- .../flowbysectormethods/GHG_state_2017.yaml | 38 ++++++++----------- .../flowbysectormethods/GHG_state_2018.yaml | 38 ++++++++----------- .../flowbysectormethods/GHG_state_2019.yaml | 38 ++++++++----------- .../flowbysectormethods/GHG_state_2020.yaml | 38 ++++++++----------- .../flowbysectormethods/GHG_state_common.yaml | 8 +--- 10 files changed, 146 insertions(+), 204 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml index e0e46abf8..206485d1d 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml @@ -4,20 +4,6 @@ year: &ghg_year 2012 geoscale: state -_allocation_types: - _use_allocation: &use_table_allocation - year: *ghg_year - geoscale: state - activity_to_sector_mapping: BEA_2012_Summary - # selection_fields: - # ActivityProducedBy: {'324': ''} # Petroleum 324110 - attribution_method: proportional - attribution_source: - Employment_state_2012: - data_format: FBS - geoscale: state - year: *ghg_year - sources_to_cache: EIA_MECS_Energy: !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy @@ -36,7 +22,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) @@ -44,7 +31,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -52,7 +40,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas @@ -60,7 +49,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'325': ''} # Use of chemicals @@ -68,7 +58,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -76,7 +67,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -84,7 +76,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Machinery @@ -92,6 +85,7 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml index c9ab9d64d..7c01e9f33 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml @@ -4,20 +4,6 @@ year: &ghg_year 2013 geoscale: state -_allocation_types: - _use_allocation: &use_table_allocation - year: *ghg_year - geoscale: state - activity_to_sector_mapping: BEA_2012_Summary - # selection_fields: - # ActivityProducedBy: {'324': ''} # Petroleum 324110 - attribution_method: proportional - attribution_source: - Employment_state_2013: - data_format: FBS - geoscale: state - year: *ghg_year - sources_to_cache: EIA_MECS_Energy: !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy @@ -36,7 +22,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) @@ -44,7 +31,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -52,7 +40,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas @@ -60,7 +49,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'325': ''} # Use of chemicals @@ -68,7 +58,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -76,7 +67,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -84,7 +76,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Machinery @@ -92,6 +85,7 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml index 85a0492b9..ce59bd22d 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml @@ -4,20 +4,6 @@ year: &ghg_year 2014 geoscale: state -_allocation_types: - _use_allocation: &use_table_allocation - year: *ghg_year - geoscale: state - activity_to_sector_mapping: BEA_2012_Summary - # selection_fields: - # ActivityProducedBy: {'324': ''} # Petroleum 324110 - attribution_method: proportional - attribution_source: - Employment_state_2014: - data_format: FBS - geoscale: state - year: *ghg_year - sources_to_cache: EIA_MECS_Energy: !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy @@ -36,7 +22,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) @@ -44,7 +31,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -52,7 +40,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas @@ -60,7 +49,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'325': ''} # Use of chemicals @@ -68,7 +58,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -76,7 +67,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -84,7 +76,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Machinery @@ -92,6 +85,7 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml index 1964f3c5c..3e7663766 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml @@ -4,20 +4,6 @@ year: &ghg_year 2015 geoscale: state -_allocation_types: - _use_allocation: &use_table_allocation - year: *ghg_year - geoscale: state - activity_to_sector_mapping: BEA_2012_Summary - # selection_fields: - # ActivityProducedBy: {'324': ''} # Petroleum 324110 - attribution_method: proportional - attribution_source: - Employment_state_2015: - data_format: FBS - geoscale: state - year: *ghg_year - sources_to_cache: EIA_MECS_Energy: !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy @@ -36,7 +22,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) @@ -44,7 +31,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -52,7 +40,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas @@ -60,7 +49,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'325': ''} # Use of chemicals @@ -68,7 +58,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -76,7 +67,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -84,7 +76,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Machinery @@ -92,6 +85,7 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2016.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2016.yaml index ead3a1d50..c793f316d 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2016.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2016.yaml @@ -4,20 +4,6 @@ year: &ghg_year 2016 geoscale: state -_allocation_types: - _use_allocation: &use_table_allocation - year: *ghg_year - geoscale: state - activity_to_sector_mapping: BEA_2012_Summary - # selection_fields: - # ActivityProducedBy: {'324': ''} # Petroleum 324110 - attribution_method: proportional - attribution_source: - Employment_state_2016: - data_format: FBS - geoscale: state - year: *ghg_year - sources_to_cache: EIA_MECS_Energy: !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy @@ -36,7 +22,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) @@ -44,7 +31,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -52,7 +40,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas @@ -60,7 +49,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'325': ''} # Use of chemicals @@ -68,7 +58,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -76,7 +67,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -84,7 +76,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Machinery @@ -92,6 +85,7 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2017.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2017.yaml index e5689db93..f4484ac06 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2017.yaml @@ -4,20 +4,6 @@ year: &ghg_year 2017 geoscale: state -_allocation_types: - _use_allocation: &use_table_allocation - year: *ghg_year - geoscale: state - activity_to_sector_mapping: BEA_2012_Summary - # selection_fields: - # ActivityProducedBy: {'324': ''} # Petroleum 324110 - attribution_method: proportional - attribution_source: - Employment_state_2017: - data_format: FBS - geoscale: state - year: *ghg_year - sources_to_cache: EIA_MECS_Energy: !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy @@ -36,7 +22,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) @@ -44,7 +31,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -52,7 +40,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas @@ -60,7 +49,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'325': ''} # Use of chemicals @@ -68,7 +58,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -76,7 +67,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -84,7 +76,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Machinery @@ -92,6 +85,7 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2018.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2018.yaml index f588807f6..e70548330 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2018.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2018.yaml @@ -4,20 +4,6 @@ year: &ghg_year 2018 geoscale: state -_allocation_types: - _use_allocation: &use_table_allocation - year: *ghg_year - geoscale: state - activity_to_sector_mapping: BEA_2012_Summary - # selection_fields: - # ActivityProducedBy: {'324': ''} # Petroleum 324110 - attribution_method: proportional - attribution_source: - Employment_state_2018: - data_format: FBS - geoscale: state - year: *ghg_year - sources_to_cache: EIA_MECS_Energy: !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy @@ -36,7 +22,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) @@ -44,7 +31,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -52,7 +40,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas @@ -60,7 +49,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'325': ''} # Use of chemicals @@ -68,7 +58,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -76,7 +67,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -84,7 +76,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Machinery @@ -92,6 +85,7 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml index 3ed30526b..033014523 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml @@ -4,20 +4,6 @@ year: &ghg_year 2019 geoscale: state -_allocation_types: - _use_allocation: &use_table_allocation - year: *ghg_year - geoscale: state - activity_to_sector_mapping: BEA_2012_Summary - # selection_fields: - # ActivityProducedBy: {'324': ''} # Petroleum 324110 - attribution_method: proportional - attribution_source: - Employment_state_2019: - data_format: FBS - geoscale: state - year: *ghg_year - sources_to_cache: EIA_MECS_Energy: !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy @@ -36,7 +22,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) @@ -44,7 +31,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -52,7 +40,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas @@ -60,7 +49,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'325': ''} # Use of chemicals @@ -68,7 +58,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -76,7 +67,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -84,7 +76,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Machinery @@ -92,6 +85,7 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2020.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2020.yaml index 4d1fcfc66..e035d48f8 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2020.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2020.yaml @@ -4,20 +4,6 @@ year: &ghg_year 2020 geoscale: state -_allocation_types: - _use_allocation: &use_table_allocation - year: *ghg_year - geoscale: state - activity_to_sector_mapping: BEA_2012_Summary - # selection_fields: - # ActivityProducedBy: {'324': ''} # Petroleum 324110 - attribution_method: proportional - attribution_source: - Employment_state_2020: - data_format: FBS - geoscale: state - year: *ghg_year - sources_to_cache: EIA_MECS_Energy: !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy @@ -36,7 +22,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) @@ -44,7 +31,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -52,7 +40,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas @@ -60,7 +49,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'325': ''} # Use of chemicals @@ -68,7 +58,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -76,7 +67,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -84,7 +76,8 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Machinery @@ -92,6 +85,7 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes attribution_source: stateio_Use_Summary: - <<: *use_table_allocation + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml index 94d09da65..67bd82a6e 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml @@ -13,12 +13,8 @@ _allocation_types: activity_to_sector_mapping: BEA_2012_Summary # selection_fields: # ActivityProducedBy: {'324': ''} # Petroleum 324110 - attribution_method: proportional - attribution_source: - Employment_state_2019: ## Update this to match the target year - data_format: FBS - geoscale: state - # year: *ghg_year + exclusion_fields: + ActivityConsumedBy: ['F030', 'F040', 'F050', 'F051'] sources_to_cache: From fe4ebf16e4e889702f3b8cae27763b6b915086f5 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 18 Aug 2023 11:59:46 -0400 Subject: [PATCH 0781/1127] use an attribution method of employment for EIA MECS to better resolve a few needed sectors to 4 digit NAICS --- flowsa/methods/flowbysectormethods/GHG_state_2012.yaml | 4 ++++ flowsa/methods/flowbysectormethods/GHG_state_2013.yaml | 4 ++++ flowsa/methods/flowbysectormethods/GHG_state_2014.yaml | 4 ++++ flowsa/methods/flowbysectormethods/GHG_state_2015.yaml | 4 ++++ flowsa/methods/flowbysectormethods/GHG_state_2016.yaml | 4 ++++ flowsa/methods/flowbysectormethods/GHG_state_2017.yaml | 4 ++++ flowsa/methods/flowbysectormethods/GHG_state_2018.yaml | 4 ++++ flowsa/methods/flowbysectormethods/GHG_state_2019.yaml | 4 ++++ flowsa/methods/flowbysectormethods/GHG_state_2020.yaml | 4 ++++ .../methods/flowbysectormethods/GHG_state_common.yaml | 10 +++++++++- 10 files changed, 45 insertions(+), 1 deletion(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml index 206485d1d..68e2a4f5d 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml @@ -8,6 +8,10 @@ sources_to_cache: EIA_MECS_Energy: !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy year: 2014 + attribution_source: + Employment_state_2014: # Update to MECS year + geoscale: national + year: 2014 clean_source: Employment_state_2014 source_names: diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml index 7c01e9f33..08551dc3f 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml @@ -8,6 +8,10 @@ sources_to_cache: EIA_MECS_Energy: !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy year: 2014 + attribution_source: + Employment_state_2014: # Update to MECS year + geoscale: national + year: 2014 clean_source: Employment_state_2014 source_names: diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml index ce59bd22d..d349410cc 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml @@ -8,6 +8,10 @@ sources_to_cache: EIA_MECS_Energy: !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy year: 2014 + attribution_source: + Employment_state_2014: # Update to MECS year + geoscale: national + year: 2014 clean_source: Employment_state_2014 source_names: diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml index 3e7663766..81cda7e94 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml @@ -8,6 +8,10 @@ sources_to_cache: EIA_MECS_Energy: !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy year: 2014 + attribution_source: + Employment_state_2014: # Update to MECS year + geoscale: national + year: 2014 clean_source: Employment_state_2014 source_names: diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2016.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2016.yaml index c793f316d..f863955d1 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2016.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2016.yaml @@ -8,6 +8,10 @@ sources_to_cache: EIA_MECS_Energy: !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy year: 2018 + attribution_source: + Employment_state_2018: # Update to MECS year + geoscale: national + year: 2018 clean_source: Employment_state_2018 source_names: diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2017.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2017.yaml index f4484ac06..2476d08d9 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2017.yaml @@ -8,6 +8,10 @@ sources_to_cache: EIA_MECS_Energy: !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy year: 2018 + attribution_source: + Employment_state_2018: # Update to MECS year + geoscale: national + year: 2018 clean_source: Employment_state_2018 source_names: diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2018.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2018.yaml index e70548330..16c577a59 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2018.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2018.yaml @@ -8,6 +8,10 @@ sources_to_cache: EIA_MECS_Energy: !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy year: 2018 + attribution_source: + Employment_state_2018: # Update to MECS year + geoscale: national + year: 2018 clean_source: Employment_state_2018 source_names: diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml index 033014523..fca1f31c5 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml @@ -8,6 +8,10 @@ sources_to_cache: EIA_MECS_Energy: !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy year: 2018 + attribution_source: + Employment_state_2018: # Update to MECS year + geoscale: national + year: 2018 clean_source: Employment_state_2018 source_names: diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2020.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2020.yaml index e035d48f8..ad31eff69 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2020.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2020.yaml @@ -8,6 +8,10 @@ sources_to_cache: EIA_MECS_Energy: !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy year: 2018 + attribution_source: + Employment_state_2018: # Update to MECS year + geoscale: national + year: 2018 clean_source: Employment_state_2018 source_names: diff --git a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml index 6c6430a8a..976784d3c 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml @@ -8,13 +8,16 @@ geoscale: state _allocation_types: _use_allocation: &use_table_allocation + ## No attribution supplied (will use equal) because target level for modeling + ## is BEA summary level. # year: *ghg_year geoscale: state activity_to_sector_mapping: BEA_2012_Summary # selection_fields: # ActivityProducedBy: {'324': ''} # Petroleum 324110 exclusion_fields: - ActivityConsumedBy: ['F030', 'F040', 'F050', 'F051'] + ActivityConsumedBy: ['F030', 'F040', 'F050', 'F051', + 'F02E', 'F06E', 'F07E', 'F10E'] sources_to_cache: @@ -31,6 +34,11 @@ sources_to_cache: exclusion_fields: Location: '00000' estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy + attribution_method: proportional + attribution_source: # Required to attribute a few sectors to full target sector level + Employment_state_2018: # Update to MECS year + geoscale: national # Uses national at this stage prior to attributing to states + year: 2018 clean_fba_after_attribution: !script_function:EIA_MECS clean_mapped_mecs_energy_fba_to_state clean_source: Employment_state_2018 ## Update to MECS year From 7b3034fec0c27e535192143ced4d0dbcfdc68abb Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 18 Aug 2023 12:00:22 -0400 Subject: [PATCH 0782/1127] stateio datasets should be "flat" to avoid dropped sectors with many:many matches (e.g., gov't) --- flowsa/data/source_catalog.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index e2af0fbfd..8d0201c49 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -279,7 +279,7 @@ stateio: class: - Money activity_schema: BEA_2012_Summary_Code - sector_hierarchy: "parent-completeChild" + sector_hierarchy: "flat" stewiFBS: data_format: FBS activity_schema: NAICS_2012_Code From ed7b308e7ae9c1830d7aa0b48cc9670445bc0ffc Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 18 Aug 2023 12:08:54 -0400 Subject: [PATCH 0783/1127] exclude more BEA sectors to avoid unnecessary warnings --- flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml index 10a8759ef..f32e3bc25 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml @@ -18,7 +18,8 @@ attribution_sources: activity_to_sector_mapping: BEA_2012_Detail exclusion_fields: # Drop irrelevant final demand and total sectors - ActivityConsumedBy: ['F03000', 'F04000', 'F05000', + ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', + 'F06E00', 'F07E00', 'F10E00', 'T001', 'T004', 'T007'] ActivityProducedBy: ['T007'] attribution_method: equal From dbb133244b587de52ebb4832c0bb307de814f9a0 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 18 Aug 2023 12:35:32 -0400 Subject: [PATCH 0784/1127] avoid key error --- flowsa/metadata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/metadata.py b/flowsa/metadata.py index 321d14e84..51a4afb20 100644 --- a/flowsa/metadata.py +++ b/flowsa/metadata.py @@ -118,7 +118,7 @@ def return_fbs_method_data(source_name, config): .replace('FBA', 'FlowByActivity')) # append source and year - year = v.get('year', config['year']) + year = v.get('year', config.get('year')) meta['primary_source_meta'][k] = getMetadata(k, year=year, category=cat) # create dictionary of allocation datasets for different activities From 13b8ed60b0fbd00b19b59bad6c7a09cdd4da00dd Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 18 Aug 2023 12:42:48 -0400 Subject: [PATCH 0785/1127] futher attribute EIA_MECS using employment to ensure best possible attribution (see fe4ebf16); drop attribution of stateio data; other method simplifications --- .../flowbysectormethods/CAP_HAP_common.yaml | 5 ++++ .../CAP_HAP_state_2014.yaml | 26 ++++++++----------- .../CAP_HAP_state_2017.yaml | 26 ++++++++----------- .../CAP_HAP_state_2020.yaml | 26 ++++++++----------- 4 files changed, 38 insertions(+), 45 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml index f955fbde1..a3fb54a5b 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml @@ -36,6 +36,11 @@ sources_to_cache: exclusion_fields: Location: '00000' estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy + attribution_method: proportional + attribution_source: # Required to attribute a few sectors to full target sector level + Employment_state_2018: # Update to MECS year + geoscale: national # Uses national at this stage prior to attributing to states + year: 2018 clean_fba_after_attribution: !script_function:EIA_MECS clean_mapped_mecs_energy_fba_to_state clean_source: Employment_state_2018 ## Update to MECS year diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2014.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2014.yaml index c1eaebe28..170bbed2d 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2014.yaml @@ -14,6 +14,10 @@ sources_to_cache: EIA_MECS_Energy: !include:CAP_HAP_common.yaml:sources_to_cache:EIA_MECS_Energy_state year: 2014 + attribution_source: + Employment_state_2014: # Update to MECS year + geoscale: national + year: 2014 clean_source: Employment_state_2014 _attribution_sources: @@ -21,12 +25,12 @@ _attribution_sources: year: *year geoscale: state activity_to_sector_mapping: BEA_2012_Summary - attribution_method: proportional - attribution_source: - Employment_state_2014: - data_format: FBS - geoscale: state - year: *year + exclusion_fields: + ActivityConsumedBy: ['F030', 'F040', 'F050', 'F051', + 'F02E', 'F06E', 'F07E', 'F10E'] + attribution_method: equal + ## No attribution supplied (will use equal) because target level for + ## modeling is BEA summary level. source_names: EPA_NEI_Nonpoint: @@ -70,17 +74,9 @@ source_names: attribution_method: proportional attribution_source: stateio_Industry_GO: - year: *year - geoscale: state - activity_to_sector_mapping: BEA_2012_Summary + <<: *stateio selection_fields: Class: Money - attribution_method: proportional - attribution_source: - Employment_state_2014: - data_format: FBS - geoscale: state - year: *year EPA_NEI_Nonroad: !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml index b2a4761a2..cc3826cd8 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml @@ -14,6 +14,10 @@ sources_to_cache: EIA_MECS_Energy: !include:CAP_HAP_common.yaml:sources_to_cache:EIA_MECS_Energy_state year: 2018 + attribution_source: + Employment_state_2018: # Update to MECS year + geoscale: national + year: 2018 clean_source: Employment_state_2018 _attribution_sources: @@ -21,12 +25,12 @@ _attribution_sources: year: *year geoscale: state activity_to_sector_mapping: BEA_2012_Summary - attribution_method: proportional - attribution_source: - Employment_state_2017: - data_format: FBS - geoscale: state - year: *year + exclusion_fields: + ActivityConsumedBy: ['F030', 'F040', 'F050', 'F051', + 'F02E', 'F06E', 'F07E', 'F10E'] + attribution_method: equal + ## No attribution supplied (will use equal) because target level for + ## modeling is BEA summary level. source_names: EPA_NEI_Nonpoint: @@ -70,17 +74,9 @@ source_names: attribution_method: proportional attribution_source: stateio_Industry_GO: - year: *year - geoscale: state - activity_to_sector_mapping: BEA_2012_Summary + <<: *stateio selection_fields: Class: Money - attribution_method: proportional - attribution_source: - Employment_state_2017: - data_format: FBS - geoscale: state - year: *year EPA_NEI_Nonroad: !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2020.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2020.yaml index ff3ee74a4..aae0a66df 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2020.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2020.yaml @@ -14,6 +14,10 @@ sources_to_cache: EIA_MECS_Energy: !include:CAP_HAP_common.yaml:sources_to_cache:EIA_MECS_Energy_state year: 2018 + attribution_source: + Employment_state_2018: # Update to MECS year + geoscale: national + year: 2018 clean_source: Employment_state_2018 _attribution_sources: @@ -21,12 +25,12 @@ _attribution_sources: year: *year geoscale: state activity_to_sector_mapping: BEA_2012_Summary - attribution_method: proportional - attribution_source: - Employment_state_2020: - data_format: FBS - geoscale: state - year: *year + exclusion_fields: + ActivityConsumedBy: ['F030', 'F040', 'F050', 'F051', + 'F02E', 'F06E', 'F07E', 'F10E'] + attribution_method: equal + ## No attribution supplied (will use equal) because target level for + ## modeling is BEA summary level. source_names: EPA_NEI_Nonpoint: @@ -70,17 +74,9 @@ source_names: attribution_method: proportional attribution_source: stateio_Industry_GO: - year: *year - geoscale: state - activity_to_sector_mapping: BEA_2012_Summary + <<: *stateio selection_fields: Class: Money - attribution_method: proportional - attribution_source: - Employment_state_2020: - data_format: FBS - geoscale: state - year: *year EPA_NEI_Nonroad: !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad From 3196b631425e35046b7facfa062f955756b5aa76 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 18 Aug 2023 12:43:06 -0400 Subject: [PATCH 0786/1127] specify equal attribution (instead of using it by default) --- flowsa/methods/flowbysectormethods/GHG_state_common.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml index 976784d3c..0036b91b9 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml @@ -8,8 +8,6 @@ geoscale: state _allocation_types: _use_allocation: &use_table_allocation - ## No attribution supplied (will use equal) because target level for modeling - ## is BEA summary level. # year: *ghg_year geoscale: state activity_to_sector_mapping: BEA_2012_Summary @@ -18,7 +16,9 @@ _allocation_types: exclusion_fields: ActivityConsumedBy: ['F030', 'F040', 'F050', 'F051', 'F02E', 'F06E', 'F07E', 'F10E'] - + attribution_method: equal + ## No attribution supplied (will use equal) because target level for + ## modeling is BEA summary level. sources_to_cache: EIA_MECS_Energy: From 7aa3e47bce1ada8e4a3e4ea8dad21a33c92d2f33 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 18 Aug 2023 13:56:43 -0400 Subject: [PATCH 0787/1127] ensure `Year` remains as an int after handling suppressed data --- flowsa/flowbyclean.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index 81d443fbb..35a7abc08 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -325,12 +325,13 @@ def fill_suppressed( unsuppressed = indexed.copy() for level in [2, 3, 4, 5, 6]: - groupcols = ["{}{}".format("n", i) for i in range(2, level+1)] + [ - 'location', 'category'] - unsuppressed = unsuppressed.groupby( - level=groupcols).apply( - fill_suppressed, level, col) - + groupcols = (["{}{}".format("n", i) for i in range(2, level+1)] + + ['location', 'category']) + unsuppressed = (unsuppressed + .groupby(level=groupcols) + .apply(fill_suppressed, level, col) + ) + unsuppressed['Year'] = unsuppressed['Year'].astype('int') aggregated = ( unsuppressed .reset_index(drop=True) From 2eb6d8e3f9c333dca042aa5b5d3c093f148b90c0 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 21 Aug 2023 10:49:04 -0400 Subject: [PATCH 0788/1127] avoid triggering warning on rounding error --- flowsa/data_source_scripts/EPA_StateGHGI.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/data_source_scripts/EPA_StateGHGI.py b/flowsa/data_source_scripts/EPA_StateGHGI.py index 9442f919d..a42f0cefd 100644 --- a/flowsa/data_source_scripts/EPA_StateGHGI.py +++ b/flowsa/data_source_scripts/EPA_StateGHGI.py @@ -167,7 +167,7 @@ def allocate_flows_by_fuel(fba: FlowByActivity, **_) -> FlowByActivity: .drop(columns=['Fuel', 'variable', 'value']) ) - if fba3.FlowAmount.sum() != fba.FlowAmount.sum(): + if round(fba3.FlowAmount.sum(), 6) != round(fba.FlowAmount.sum(), 6): log.warning('Error: totals do not match when splitting CH4 and N2O by ' 'fuel type') From 836e65abdaa77d7e040ee4847337737cc68d6942 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 21 Aug 2023 13:01:50 -0400 Subject: [PATCH 0789/1127] add retired nonroad SCCs (needed for 2014); add note field to SCC crosswalk for better transparency --- .../NAICS_Crosswalk_SCC.csv | 2617 +++++++++++------ .../NEI_Nonroad_asets.csv | 188 ++ 2 files changed, 1882 insertions(+), 923 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_SCC.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_SCC.csv index fdb654992..dc65a7c39 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_SCC.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_SCC.csv @@ -1,923 +1,1694 @@ -ActivitySourceName,Activity,SectorSourceName,Sector,SectorType -SCC,2801000000,NAICS_2012_Code,111, -SCC,2801000001,NAICS_2012_Code,111, -SCC,2801000002,NAICS_2012_Code,111, -SCC,2801000003,NAICS_2012_Code,111, -SCC,2801000004,NAICS_2012_Code,111, -SCC,2801000005,NAICS_2012_Code,111, -SCC,2801000006,NAICS_2012_Code,111, -SCC,2801000007,NAICS_2012_Code,111, -SCC,2801000008,NAICS_2012_Code,111, -SCC,2801500000,NAICS_2012_Code,111, -SCC,2801500111,NAICS_2012_Code,111940, -SCC,2801500112,NAICS_2012_Code,111940, -SCC,2801500120,NAICS_2012_Code,111219, -SCC,2801500130,NAICS_2012_Code,111199, -SCC,2801500141,NAICS_2012_Code,111130, -SCC,2801500142,NAICS_2012_Code,111130, -SCC,2801500150,NAICS_2012_Code,111150, -SCC,2801500151,NAICS_2012_Code,111140, -SCC,2801500151,NAICS_2012_Code,111150, -SCC,2801500152,NAICS_2012_Code,111110, -SCC,2801500152,NAICS_2012_Code,111150, -SCC,2801500160,NAICS_2012_Code,111920, -SCC,2801500161,NAICS_2012_Code,111920, -SCC,2801500161,NAICS_2012_Code,111110, -SCC,2801500170,NAICS_2012_Code,111940, -SCC,2801500171,NAICS_2012_Code,115112, -SCC,2801500181,NAICS_2012_Code,111940, -SCC,2801500182,NAICS_2012_Code,111940, -SCC,2801500191,NAICS_2012_Code,111199, -SCC,2801500192,NAICS_2012_Code,111199, -SCC,2801500201,NAICS_2012_Code,111130, -SCC,2801500202,NAICS_2012_Code,111130, -SCC,2801500210,NAICS_2012_Code,111339, -SCC,2801500220,NAICS_2012_Code,111160, -SCC,2801500230,NAICS_2012_Code,111120, -SCC,2801500240,NAICS_2012_Code,111199, -SCC,2801500250,NAICS_2012_Code,111930, -SCC,2801500261,NAICS_2012_Code,111140, -SCC,2801500262,NAICS_2012_Code,111140, -SCC,2801500263,NAICS_2012_Code,111140, -SCC,2801500263,NAICS_2012_Code,111920, -SCC,2801500264,NAICS_2012_Code,111140, -SCC,2801500264,NAICS_2012_Code,111920, -SCC,2801500300,NAICS_2012_Code,1113, -SCC,2801500310,NAICS_2012_Code,111335, -SCC,2801500320,NAICS_2012_Code,111331, -SCC,2801500330,NAICS_2012_Code,111339, -SCC,2801500340,NAICS_2012_Code,111998, -SCC,2801500350,NAICS_2012_Code,111339, -SCC,2801500360,NAICS_2012_Code,111310, -SCC,2801500360,NAICS_2012_Code,111320, -SCC,2801500370,NAICS_2012_Code,111339, -SCC,2801500380,NAICS_2012_Code,111339, -SCC,2801500390,NAICS_2012_Code,111339, -SCC,2801500400,NAICS_2012_Code,111998, -SCC,2801500410,NAICS_2012_Code,111339, -SCC,2801500420,NAICS_2012_Code,111339, -SCC,2801500430,NAICS_2012_Code,111339, -SCC,2801500440,NAICS_2012_Code,111335, -SCC,2801500450,NAICS_2012_Code,111335, -SCC,2102001000,NAICS_2012_Code,31, -SCC,2102001000,NAICS_2012_Code,32, -SCC,2102001000,NAICS_2012_Code,33, -SCC,2102002000,NAICS_2012_Code,31, -SCC,2102002000,NAICS_2012_Code,32, -SCC,2102002000,NAICS_2012_Code,33, -SCC,2102004000,NAICS_2012_Code,31, -SCC,2102004000,NAICS_2012_Code,32, -SCC,2102004000,NAICS_2012_Code,33, -SCC,2102004001,NAICS_2012_Code,31, -SCC,2102004001,NAICS_2012_Code,32, -SCC,2102004001,NAICS_2012_Code,33, -SCC,2102004002,NAICS_2012_Code,31, -SCC,2102004002,NAICS_2012_Code,32, -SCC,2102004002,NAICS_2012_Code,33, -SCC,2102005000,NAICS_2012_Code,31, -SCC,2102005000,NAICS_2012_Code,32, -SCC,2102005000,NAICS_2012_Code,33, -SCC,2102006000,NAICS_2012_Code,31, -SCC,2102006000,NAICS_2012_Code,32, -SCC,2102006000,NAICS_2012_Code,33, -SCC,2102007000,NAICS_2012_Code,31, -SCC,2102007000,NAICS_2012_Code,32, -SCC,2102007000,NAICS_2012_Code,33, -SCC,2102008000,NAICS_2012_Code,31, -SCC,2102008000,NAICS_2012_Code,32, -SCC,2102008000,NAICS_2012_Code,33, -SCC,2102009000,NAICS_2012_Code,31, -SCC,2102009000,NAICS_2012_Code,32, -SCC,2102009000,NAICS_2012_Code,33, -SCC,2102010000,NAICS_2012_Code,31, -SCC,2102010000,NAICS_2012_Code,32, -SCC,2102010000,NAICS_2012_Code,33, -SCC,2102011000,NAICS_2012_Code,31, -SCC,2102011000,NAICS_2012_Code,32, -SCC,2102011000,NAICS_2012_Code,33, -SCC,2102012000,NAICS_2012_Code,31, -SCC,2102012000,NAICS_2012_Code,32, -SCC,2102012000,NAICS_2012_Code,33, -SCC,2104001000,NAICS_2012_Code,F01000, -SCC,2104002000,NAICS_2012_Code,F01000, -SCC,2104004000,NAICS_2012_Code,F01000, -SCC,2104006000,NAICS_2012_Code,F01000, -SCC,2104007000,NAICS_2012_Code,F01000, -SCC,2104008100,NAICS_2012_Code,F01000, -SCC,2104008110,NAICS_2012_Code,F01000, -SCC,2104008120,NAICS_2012_Code,F01000, -SCC,2104008130,NAICS_2012_Code,F01000, -SCC,2104008200,NAICS_2012_Code,F01000, -SCC,2104008210,NAICS_2012_Code,F01000, -SCC,2104008220,NAICS_2012_Code,F01000, -SCC,2104008230,NAICS_2012_Code,F01000, -SCC,2104008300,NAICS_2012_Code,F01000, -SCC,2104008310,NAICS_2012_Code,F01000, -SCC,2104008320,NAICS_2012_Code,F01000, -SCC,2104008330,NAICS_2012_Code,F01000, -SCC,2104008340,NAICS_2012_Code,F01000, -SCC,2104008400,NAICS_2012_Code,F01000, -SCC,2104008410,NAICS_2012_Code,F01000, -SCC,2104008420,NAICS_2012_Code,F01000, -SCC,2104008500,NAICS_2012_Code,F01000, -SCC,2104008510,NAICS_2012_Code,F01000, -SCC,2104008520,NAICS_2012_Code,F01000, -SCC,2104008530,NAICS_2012_Code,F01000, -SCC,2104008540,NAICS_2012_Code,F01000, -SCC,2104008550,NAICS_2012_Code,F01000, -SCC,2104008600,NAICS_2012_Code,F01000, -SCC,2104008610,NAICS_2012_Code,F01000, -SCC,2104008620,NAICS_2012_Code,F01000, -SCC,2104008630,NAICS_2012_Code,F01000, -SCC,2104008640,NAICS_2012_Code,F01000, -SCC,2104008700,NAICS_2012_Code,F01000, -SCC,2104009000,NAICS_2012_Code,F01000, -SCC,2104010000,NAICS_2012_Code,F01000, -SCC,2104011000,NAICS_2012_Code,F01000, -SCC,2310000220,NAICS_2012_Code,211111, -SCC,2310000230,NAICS_2012_Code,211111, -SCC,2310000440,NAICS_2012_Code,211111, -SCC,2310000551,NAICS_2012_Code,211111, -SCC,2310000552,NAICS_2012_Code,211111, -SCC,2310000553,NAICS_2012_Code,211111, -SCC,2310000660,NAICS_2012_Code,211111, -SCC,2310001000,NAICS_2012_Code,211111, -SCC,2310002000,NAICS_2012_Code,211111, -SCC,2310002301,NAICS_2012_Code,211111, -SCC,2310002305,NAICS_2012_Code,211111, -SCC,2310002401,NAICS_2012_Code,211111, -SCC,2310002411,NAICS_2012_Code,211111, -SCC,2310002421,NAICS_2012_Code,211111, -SCC,2310010000,NAICS_2012_Code,211111, -SCC,2310010100,NAICS_2012_Code,211111, -SCC,2310010200,NAICS_2012_Code,211111, -SCC,2310010300,NAICS_2012_Code,211111, -SCC,2310010700,NAICS_2012_Code,211111, -SCC,2310010800,NAICS_2012_Code,211111, -SCC,2310011001,NAICS_2012_Code,211111, -SCC,2310011020,NAICS_2012_Code,211111, -SCC,2310011100,NAICS_2012_Code,211111, -SCC,2310011201,NAICS_2012_Code,211111, -SCC,2310011450,NAICS_2012_Code,211111, -SCC,2310011500,NAICS_2012_Code,211111, -SCC,2310011501,NAICS_2012_Code,211111, -SCC,2310011502,NAICS_2012_Code,211111, -SCC,2310011503,NAICS_2012_Code,211111, -SCC,2310011504,NAICS_2012_Code,211111, -SCC,2310011505,NAICS_2012_Code,211111, -SCC,2310011506,NAICS_2012_Code,211111, -SCC,2310011600,NAICS_2012_Code,211111, -SCC,2310012000,NAICS_2012_Code,211111, -SCC,2310012020,NAICS_2012_Code,211111, -SCC,2310012201,NAICS_2012_Code,211111, -SCC,2310012511,NAICS_2012_Code,211111, -SCC,2310012512,NAICS_2012_Code,211111, -SCC,2310012515,NAICS_2012_Code,211111, -SCC,2310012516,NAICS_2012_Code,211111, -SCC,2310012521,NAICS_2012_Code,211111, -SCC,2310012522,NAICS_2012_Code,211111, -SCC,2310012525,NAICS_2012_Code,211111, -SCC,2310012526,NAICS_2012_Code,211111, -SCC,2310020000,NAICS_2012_Code,211111, -SCC,2310020600,NAICS_2012_Code,211111, -SCC,2310020700,NAICS_2012_Code,211111, -SCC,2310020800,NAICS_2012_Code,211111, -SCC,2310021010,NAICS_2012_Code,211111, -SCC,2310021011,NAICS_2012_Code,211111, -SCC,2310021030,NAICS_2012_Code,211111, -SCC,2310021100,NAICS_2012_Code,211111, -SCC,2310021101,NAICS_2012_Code,211111, -SCC,2310021102,NAICS_2012_Code,211111, -SCC,2310021103,NAICS_2012_Code,211111, -SCC,2310021109,NAICS_2012_Code,211111, -SCC,2310021201,NAICS_2012_Code,211111, -SCC,2310021202,NAICS_2012_Code,211111, -SCC,2310021203,NAICS_2012_Code,211111, -SCC,2310021209,NAICS_2012_Code,211111, -SCC,2310021251,NAICS_2012_Code,211111, -SCC,2310021300,NAICS_2012_Code,211111, -SCC,2310021301,NAICS_2012_Code,211111, -SCC,2310021302,NAICS_2012_Code,211111, -SCC,2310021303,NAICS_2012_Code,211111, -SCC,2310021309,NAICS_2012_Code,211111, -SCC,2310021310,NAICS_2012_Code,211111, -SCC,2310021351,NAICS_2012_Code,211111, -SCC,2310021400,NAICS_2012_Code,211111, -SCC,2310021401,NAICS_2012_Code,211111, -SCC,2310021402,NAICS_2012_Code,211111, -SCC,2310021403,NAICS_2012_Code,211111, -SCC,2310021409,NAICS_2012_Code,211111, -SCC,2310021410,NAICS_2012_Code,211111, -SCC,2310021411,NAICS_2012_Code,211111, -SCC,2310021412,NAICS_2012_Code,211111, -SCC,2310021450,NAICS_2012_Code,211111, -SCC,2310021500,NAICS_2012_Code,211111, -SCC,2310021501,NAICS_2012_Code,211111, -SCC,2310021502,NAICS_2012_Code,211111, -SCC,2310021503,NAICS_2012_Code,211111, -SCC,2310021504,NAICS_2012_Code,211111, -SCC,2310021505,NAICS_2012_Code,211111, -SCC,2310021506,NAICS_2012_Code,211111, -SCC,2310021509,NAICS_2012_Code,211111, -SCC,2310021600,NAICS_2012_Code,211111, -SCC,2310021601,NAICS_2012_Code,211111, -SCC,2310021602,NAICS_2012_Code,211111, -SCC,2310021603,NAICS_2012_Code,211111, -SCC,2310021604,NAICS_2012_Code,211111, -SCC,2310021605,NAICS_2012_Code,211111, -SCC,2310021700,NAICS_2012_Code,211111, -SCC,2310021801,NAICS_2012_Code,211111, -SCC,2310021802,NAICS_2012_Code,211111, -SCC,2310021803,NAICS_2012_Code,211111, -SCC,2310022000,NAICS_2012_Code,211111, -SCC,2310022010,NAICS_2012_Code,211111, -SCC,2310022051,NAICS_2012_Code,211111, -SCC,2310022090,NAICS_2012_Code,211111, -SCC,2310022101,NAICS_2012_Code,211111, -SCC,2310022102,NAICS_2012_Code,211111, -SCC,2310022103,NAICS_2012_Code,211111, -SCC,2310022105,NAICS_2012_Code,211111, -SCC,2310022109,NAICS_2012_Code,211111, -SCC,2310022201,NAICS_2012_Code,211111, -SCC,2310022202,NAICS_2012_Code,211111, -SCC,2310022203,NAICS_2012_Code,211111, -SCC,2310022300,NAICS_2012_Code,211111, -SCC,2310022301,NAICS_2012_Code,211111, -SCC,2310022302,NAICS_2012_Code,211111, -SCC,2310022303,NAICS_2012_Code,211111, -SCC,2310022401,NAICS_2012_Code,211111, -SCC,2310022402,NAICS_2012_Code,211111, -SCC,2310022403,NAICS_2012_Code,211111, -SCC,2310022409,NAICS_2012_Code,211111, -SCC,2310022410,NAICS_2012_Code,211111, -SCC,2310022420,NAICS_2012_Code,211111, -SCC,2310022501,NAICS_2012_Code,211111, -SCC,2310022502,NAICS_2012_Code,211111, -SCC,2310022505,NAICS_2012_Code,211111, -SCC,2310022506,NAICS_2012_Code,211111, -SCC,2310023000,NAICS_2012_Code,211111, -SCC,2310023010,NAICS_2012_Code,211111, -SCC,2310023030,NAICS_2012_Code,211111, -SCC,2310023100,NAICS_2012_Code,211111, -SCC,2310023102,NAICS_2012_Code,211111, -SCC,2310023202,NAICS_2012_Code,211111, -SCC,2310023251,NAICS_2012_Code,211111, -SCC,2310023300,NAICS_2012_Code,211111, -SCC,2310023302,NAICS_2012_Code,211111, -SCC,2310023310,NAICS_2012_Code,211111, -SCC,2310023351,NAICS_2012_Code,211111, -SCC,2310023400,NAICS_2012_Code,211111, -SCC,2310023401,NAICS_2012_Code,211111, -SCC,2310023410,NAICS_2012_Code,211111, -SCC,2310023509,NAICS_2012_Code,211111, -SCC,2310023511,NAICS_2012_Code,211111, -SCC,2310023512,NAICS_2012_Code,211111, -SCC,2310023513,NAICS_2012_Code,211111, -SCC,2310023515,NAICS_2012_Code,211111, -SCC,2310023516,NAICS_2012_Code,211111, -SCC,2310023600,NAICS_2012_Code,211111, -SCC,2310023601,NAICS_2012_Code,211111, -SCC,2310023602,NAICS_2012_Code,211111, -SCC,2310023603,NAICS_2012_Code,211111, -SCC,2310023604,NAICS_2012_Code,211111, -SCC,2310023605,NAICS_2012_Code,211111, -SCC,2310023606,NAICS_2012_Code,211111, -SCC,2310030000,NAICS_2012_Code,211111, -SCC,2310030210,NAICS_2012_Code,211111, -SCC,2310030220,NAICS_2012_Code,211111, -SCC,2310030230,NAICS_2012_Code,211111, -SCC,2310030300,NAICS_2012_Code,211111, -SCC,2310030400,NAICS_2012_Code,211111, -SCC,2310030401,NAICS_2012_Code,211111, -SCC,2310111100,NAICS_2012_Code,211111, -SCC,2310111401,NAICS_2012_Code,211111, -SCC,2310111700,NAICS_2012_Code,211111, -SCC,2310111701,NAICS_2012_Code,211111, -SCC,2310111702,NAICS_2012_Code,211111, -SCC,2310112000,NAICS_2012_Code,211111, -SCC,2310112100,NAICS_2012_Code,211111, -SCC,2310112401,NAICS_2012_Code,211111, -SCC,2310112700,NAICS_2012_Code,211111, -SCC,2310112701,NAICS_2012_Code,211111, -SCC,2310112702,NAICS_2012_Code,211111, -SCC,2310121100,NAICS_2012_Code,211111, -SCC,2310121401,NAICS_2012_Code,211111, -SCC,2310121700,NAICS_2012_Code,211111, -SCC,2310121701,NAICS_2012_Code,211111, -SCC,2310121702,NAICS_2012_Code,211111, -SCC,2310122000,NAICS_2012_Code,211111, -SCC,2310122100,NAICS_2012_Code,211111, -SCC,2310122401,NAICS_2012_Code,211111, -SCC,2310122700,NAICS_2012_Code,211111, -SCC,2310122701,NAICS_2012_Code,211111, -SCC,2310122702,NAICS_2012_Code,211111, -SCC,2310300220,NAICS_2012_Code,211111, -SCC,2310321010,NAICS_2012_Code,211111, -SCC,2310321100,NAICS_2012_Code,211111, -SCC,2310321400,NAICS_2012_Code,211111, -SCC,2310321603,NAICS_2012_Code,211111, -SCC,2310400220,NAICS_2012_Code,211111, -SCC,2310421010,NAICS_2012_Code,211111, -SCC,2310421100,NAICS_2012_Code,211111, -SCC,2310421400,NAICS_2012_Code,211111, -SCC,2310421603,NAICS_2012_Code,211111, -SCC,2805001000,NAICS_2012_Code,112112, -SCC,2805001010,NAICS_2012_Code,112120, -SCC,2805001100,NAICS_2012_Code,112112, -SCC,2805001200,NAICS_2012_Code,112112, -SCC,2805001300,NAICS_2012_Code,112112, -SCC,2805002000,NAICS_2012_Code,112111, -SCC,2805003000,NAICS_2012_Code,112111, -SCC,2805003100,NAICS_2012_Code,112111, -SCC,2805018000,NAICS_2012_Code,112120, -SCC,2805019000,NAICS_2012_Code,112120, -SCC,2805019100,NAICS_2012_Code,112120, -SCC,2805019200,NAICS_2012_Code,112120, -SCC,2805019300,NAICS_2012_Code,112120, -SCC,2805020001,NAICS_2012_Code,112120, -SCC,2805020002,NAICS_2012_Code,112112, -SCC,2805020003,NAICS_2012_Code,112112, -SCC,2805020004,NAICS_2012_Code,112112, -SCC,2805021100,NAICS_2012_Code,112120, -SCC,2805021200,NAICS_2012_Code,112120, -SCC,2805021300,NAICS_2012_Code,112120, -SCC,2805022100,NAICS_2012_Code,112120, -SCC,2805022200,NAICS_2012_Code,112120, -SCC,2805022300,NAICS_2012_Code,112120, -SCC,2805023100,NAICS_2012_Code,112120, -SCC,2805023200,NAICS_2012_Code,112120, -SCC,2805023300,NAICS_2012_Code,112120, -SCC,2805001040,NAICS_2012_Code,112210, -SCC,2805025000,NAICS_2012_Code,112210, -SCC,2805039000,NAICS_2012_Code,112210, -SCC,2805039100,NAICS_2012_Code,112210, -SCC,2805039200,NAICS_2012_Code,112210, -SCC,2805039300,NAICS_2012_Code,112210, -SCC,2805047100,NAICS_2012_Code,112210, -SCC,2805047300,NAICS_2012_Code,112210, -SCC,2805053100,NAICS_2012_Code,112210, -SCC,2805001020,NAICS_2012_Code,112320, -SCC,2805001030,NAICS_2012_Code,112310, -SCC,2805001050,NAICS_2012_Code,112330, -SCC,2805007000,NAICS_2012_Code,112310, -SCC,2805007100,NAICS_2012_Code,112310, -SCC,2805007300,NAICS_2012_Code,112310, -SCC,2805008100,NAICS_2012_Code,112310, -SCC,2805008200,NAICS_2012_Code,112310, -SCC,2805008300,NAICS_2012_Code,112310, -SCC,2805009000,NAICS_2012_Code,112320, -SCC,2805009100,NAICS_2012_Code,112320, -SCC,2805009200,NAICS_2012_Code,112320, -SCC,2805009300,NAICS_2012_Code,112320, -SCC,2805010000,NAICS_2012_Code,112330, -SCC,2805010100,NAICS_2012_Code,112330, -SCC,2805010200,NAICS_2012_Code,112330, -SCC,2805010300,NAICS_2012_Code,112330, -SCC,2805030000,NAICS_2012_Code,1123, -SCC,2805030007,NAICS_2012_Code,112390, -SCC,2805030008,NAICS_2012_Code,112390, -SCC,2805035000,NAICS_2012_Code,112920, -SCC,2805040000,NAICS_2012_Code,112410, -SCC,2805045000,NAICS_2012_Code,112420, -SCC,2275085000,NAICS_2012_Code,481, -SCC,2275087000,NAICS_2012_Code,481, -SCC,2280002101,NAICS_2012_Code,483, -SCC,2280002102,NAICS_2012_Code,483, -SCC,2280002103,NAICS_2012_Code,483, -SCC,2280002104,NAICS_2012_Code,483, -SCC,2280002201,NAICS_2012_Code,483, -SCC,2280002202,NAICS_2012_Code,483, -SCC,2280002203,NAICS_2012_Code,483, -SCC,2280002204,NAICS_2012_Code,483, -SCC,2280003103,NAICS_2012_Code,483, -SCC,2280003104,NAICS_2012_Code,483, -SCC,2280003203,NAICS_2012_Code,483, -SCC,2280003204,NAICS_2012_Code,483, -SCC,2285002006,NAICS_2012_Code,482, -SCC,2285002007,NAICS_2012_Code,482, -SCC,2285002008,NAICS_2012_Code,482, -SCC,2285002009,NAICS_2012_Code,482, -SCC,2285002010,NAICS_2012_Code,482, -SCC,2501011011,NAICS_2012_Code,F01000, -SCC,2501011012,NAICS_2012_Code,F01000, -SCC,2501011013,NAICS_2012_Code,F01000, -SCC,2501011014,NAICS_2012_Code,F01000, -SCC,2501011015,NAICS_2012_Code,F01000, -SCC,2806010000,NAICS_2012_Code,F01000, -SCC,2806015000,NAICS_2012_Code,F01000, -SCC,2810003000,NAICS_2012_Code,F01000, -SCC,2810010000,NAICS_2012_Code,F01000, -SCC,2810025000,NAICS_2012_Code,F01000, -SCC,2862002000,NAICS_2012_Code,F01000, -SCC,2301000000,NAICS_2012_Code,325, -SCC,2301010000,NAICS_2012_Code,325, -SCC,2301010010,NAICS_2012_Code,325, -SCC,2301020000,NAICS_2012_Code,32522, -SCC,2301030000,NAICS_2012_Code,3254, -SCC,2301040000,NAICS_2012_Code,325190, -SCC,2301050001,NAICS_2012_Code,325211, -SCC,2301050002,NAICS_2012_Code,325211, -SCC,2302000000,NAICS_2012_Code,311, -SCC,2302002000,NAICS_2012_Code,722, -SCC,2302002100,NAICS_2012_Code,722, -SCC,2302002200,NAICS_2012_Code,722, -SCC,2302003000,NAICS_2012_Code,722, -SCC,2302003100,NAICS_2012_Code,722, -SCC,2302003200,NAICS_2012_Code,722, -SCC,2302003299,NAICS_2012_Code,722, -SCC,2302010000,NAICS_2012_Code,31161, -SCC,2302040000,NAICS_2012_Code,3112, -SCC,2302050000,NAICS_2012_Code,31181, -SCC,2302070000,NAICS_2012_Code,3121, -SCC,2302070001,NAICS_2012_Code,312120, -SCC,2302070005,NAICS_2012_Code,312130, -SCC,2302070010,NAICS_2012_Code,312140, -SCC,2302080000,NAICS_2012_Code,311, -SCC,2302080002,NAICS_2012_Code,311, -SCC,2303000000,NAICS_2012_Code,331, -SCC,2303020000,NAICS_2012_Code,33151, -SCC,2304000000,NAICS_2012_Code,332, -SCC,2304050000,NAICS_2012_Code,33152, -SCC,2305000000,NAICS_2012_Code,2122, -SCC,2305000000,NAICS_2012_Code,2123, -SCC,2306000000,NAICS_2012_Code,324110, -SCC,2306010000,NAICS_2012_Code,324121, -SCC,2306010100,NAICS_2012_Code,324121, -SCC,2307000000,NAICS_2012_Code,321, -SCC,2307010000,NAICS_2012_Code,113310, -SCC,2307020000,NAICS_2012_Code,321113, -SCC,2307030000,NAICS_2012_Code,3212, -SCC,2307030000,NAICS_2012_Code,3219, -SCC,2307060000,NAICS_2012_Code,32199, -SCC,2308000000,NAICS_2012_Code,326, -SCC,2309000000,NAICS_2012_Code,332, -SCC,2311010000,NAICS_2012_Code,2361, -SCC,2311020000,NAICS_2012_Code,236210, -SCC,2311030000,NAICS_2012_Code,237310, -SCC,2312000000,NAICS_2012_Code,333, -SCC,2325000000,NAICS_2012_Code,2122, -SCC,2325000000,NAICS_2012_Code,2123, -SCC,2325010000,NAICS_2012_Code,21231, -SCC,2325020000,NAICS_2012_Code,21231, -SCC,2325030000,NAICS_2012_Code,21232, -SCC,2325040000,NAICS_2012_Code,212325, -SCC,2325050000,NAICS_2012_Code,212393, -SCC,2325060000,NAICS_2012_Code,212231, -SCC,2399000000,NAICS_2012_Code,31, -SCC,2399000000,NAICS_2012_Code,32, -SCC,2399000000,NAICS_2012_Code,33, -SCC,2399010000,NAICS_2012_Code,31, -SCC,2399010000,NAICS_2012_Code,32, -SCC,2399010000,NAICS_2012_Code,33, -SCC,2420000000,NAICS_2012_Code,8123, -SCC,2420000055,NAICS_2012_Code,8123, -SCC,2420000999,NAICS_2012_Code,8123, -SCC,2501000000,NAICS_2012_Code,324110, -SCC,2501000030,NAICS_2012_Code,324110, -SCC,2501000060,NAICS_2012_Code,324110, -SCC,2501000090,NAICS_2012_Code,324110, -SCC,2501000120,NAICS_2012_Code,324110, -SCC,2501000150,NAICS_2012_Code,324110, -SCC,2501000180,NAICS_2012_Code,324110, -SCC,2501000900,NAICS_2012_Code,324110, -SCC,2501010000,NAICS_2012_Code,324110, -SCC,2501010030,NAICS_2012_Code,324110, -SCC,2501010060,NAICS_2012_Code,324110, -SCC,2501010090,NAICS_2012_Code,324110, -SCC,2501010120,NAICS_2012_Code,324110, -SCC,2501010150,NAICS_2012_Code,324110, -SCC,2501010180,NAICS_2012_Code,324110, -SCC,2501010900,NAICS_2012_Code,324110, -SCC,2501012011,NAICS_2012_Code,4471, -SCC,2501012012,NAICS_2012_Code,4471, -SCC,2501012013,NAICS_2012_Code,4471, -SCC,2501012014,NAICS_2012_Code,4471, -SCC,2501012015,NAICS_2012_Code,4471, -SCC,2501013010,NAICS_2012_Code,4471, -SCC,2501050000,NAICS_2012_Code,4247, -SCC,2501050030,NAICS_2012_Code,4247, -SCC,2501050060,NAICS_2012_Code,4247, -SCC,2501050090,NAICS_2012_Code,4247, -SCC,2501050120,NAICS_2012_Code,4247, -SCC,2501050150,NAICS_2012_Code,4247, -SCC,2501050180,NAICS_2012_Code,4247, -SCC,2501050900,NAICS_2012_Code,4247, -SCC,2501055120,NAICS_2012_Code,4247, -SCC,2501060050,NAICS_2012_Code,4471, -SCC,2501060051,NAICS_2012_Code,4471, -SCC,2501060052,NAICS_2012_Code,4471, -SCC,2501060053,NAICS_2012_Code,4471, -SCC,2501060201,NAICS_2012_Code,4471, -SCC,2501070050,NAICS_2012_Code,4471, -SCC,2501070051,NAICS_2012_Code,4471, -SCC,2501070052,NAICS_2012_Code,4471, -SCC,2501070053,NAICS_2012_Code,4471, -SCC,2501070201,NAICS_2012_Code,4471, -SCC,2501080050,NAICS_2012_Code,4881, -SCC,2501080100,NAICS_2012_Code,4881, -SCC,2501080201,NAICS_2012_Code,4881, -SCC,2501995000,NAICS_2012_Code,324110, -SCC,2501995030,NAICS_2012_Code,324110, -SCC,2501995060,NAICS_2012_Code,324110, -SCC,2501995090,NAICS_2012_Code,324110, -SCC,2501995120,NAICS_2012_Code,324110, -SCC,2501995150,NAICS_2012_Code,324110, -SCC,2501995180,NAICS_2012_Code,324110, -SCC,2505000000,NAICS_2012_Code,324110, -SCC,2505000030,NAICS_2012_Code,324110, -SCC,2505000060,NAICS_2012_Code,324110, -SCC,2505000090,NAICS_2012_Code,324110, -SCC,2505000120,NAICS_2012_Code,324110, -SCC,2505000150,NAICS_2012_Code,324110, -SCC,2505000180,NAICS_2012_Code,324110, -SCC,2505000900,NAICS_2012_Code,324110, -SCC,2505010000,NAICS_2012_Code,4882, -SCC,2505010030,NAICS_2012_Code,4882, -SCC,2505010060,NAICS_2012_Code,4882, -SCC,2505010090,NAICS_2012_Code,4882, -SCC,2505010120,NAICS_2012_Code,4882, -SCC,2505010150,NAICS_2012_Code,4882, -SCC,2505010180,NAICS_2012_Code,4882, -SCC,2505010900,NAICS_2012_Code,4882, -SCC,2505020000,NAICS_2012_Code,4883, -SCC,2505020030,NAICS_2012_Code,4883, -SCC,2505020041,NAICS_2012_Code,4883, -SCC,2505020060,NAICS_2012_Code,4883, -SCC,2505020090,NAICS_2012_Code,4883, -SCC,2505020091,NAICS_2012_Code,4883, -SCC,2505020092,NAICS_2012_Code,4883, -SCC,2505020093,NAICS_2012_Code,4883, -SCC,2505020120,NAICS_2012_Code,4883, -SCC,2505020121,NAICS_2012_Code,4883, -SCC,2505020150,NAICS_2012_Code,4883, -SCC,2505020180,NAICS_2012_Code,4883, -SCC,2505020182,NAICS_2012_Code,4883, -SCC,2505020900,NAICS_2012_Code,4883, -SCC,2505030000,NAICS_2012_Code,4884, -SCC,2505030030,NAICS_2012_Code,4884, -SCC,2505030060,NAICS_2012_Code,4884, -SCC,2505030090,NAICS_2012_Code,4884, -SCC,2505030120,NAICS_2012_Code,4884, -SCC,2505030150,NAICS_2012_Code,4884, -SCC,2505030180,NAICS_2012_Code,4884, -SCC,2505030900,NAICS_2012_Code,4884, -SCC,2505040000,NAICS_2012_Code,486, -SCC,2505040030,NAICS_2012_Code,486110, -SCC,2505040060,NAICS_2012_Code,486910, -SCC,2505040090,NAICS_2012_Code,486910, -SCC,2505040120,NAICS_2012_Code,486910, -SCC,2505040150,NAICS_2012_Code,486910, -SCC,2505040180,NAICS_2012_Code,486910, -SCC,2530000000,NAICS_2012_Code,493, -SCC,2530010000,NAICS_2012_Code,493, -SCC,2530050000,NAICS_2012_Code,493, -SCC,2801700000,NAICS_2012_Code,111, -SCC,2801700001,NAICS_2012_Code,111, -SCC,2801700002,NAICS_2012_Code,111, -SCC,2801700003,NAICS_2012_Code,111, -SCC,2801700004,NAICS_2012_Code,111, -SCC,2801700005,NAICS_2012_Code,111, -SCC,2801700006,NAICS_2012_Code,111, -SCC,2801700007,NAICS_2012_Code,111, -SCC,2801700010,NAICS_2012_Code,111, -SCC,2801700011,NAICS_2012_Code,111, -SCC,2801700012,NAICS_2012_Code,111, -SCC,2801700013,NAICS_2012_Code,111, -SCC,2801700014,NAICS_2012_Code,111, -SCC,2801700015,NAICS_2012_Code,111, -SCC,2801700099,NAICS_2012_Code,111, -SCC,2103001000,NAICS_2012_Code,42, -SCC,2103002000,NAICS_2012_Code,42, -SCC,2103004000,NAICS_2012_Code,42, -SCC,2103004001,NAICS_2012_Code,42, -SCC,2103004002,NAICS_2012_Code,42, -SCC,2103005000,NAICS_2012_Code,42, -SCC,2103006000,NAICS_2012_Code,42, -SCC,2103007000,NAICS_2012_Code,42, -SCC,2103008000,NAICS_2012_Code,42, -SCC,2103010000,NAICS_2012_Code,42, -SCC,2103011000,NAICS_2012_Code,42, -SCC,2103001000,NAICS_2012_Code,44, -SCC,2103001000,NAICS_2012_Code,45, -SCC,2103001000,NAICS_2012_Code,493, -SCC,2103002000,NAICS_2012_Code,44, -SCC,2103002000,NAICS_2012_Code,45, -SCC,2103002000,NAICS_2012_Code,493, -SCC,2103004000,NAICS_2012_Code,44, -SCC,2103004000,NAICS_2012_Code,45, -SCC,2103004000,NAICS_2012_Code,493, -SCC,2103004001,NAICS_2012_Code,44, -SCC,2103004001,NAICS_2012_Code,45, -SCC,2103004001,NAICS_2012_Code,493, -SCC,2103004002,NAICS_2012_Code,44, -SCC,2103004002,NAICS_2012_Code,45, -SCC,2103004002,NAICS_2012_Code,493, -SCC,2103005000,NAICS_2012_Code,44, -SCC,2103005000,NAICS_2012_Code,45, -SCC,2103005000,NAICS_2012_Code,493, -SCC,2103006000,NAICS_2012_Code,44, -SCC,2103006000,NAICS_2012_Code,45, -SCC,2103006000,NAICS_2012_Code,493, -SCC,2103007000,NAICS_2012_Code,44, -SCC,2103007000,NAICS_2012_Code,45, -SCC,2103007000,NAICS_2012_Code,493, -SCC,2103008000,NAICS_2012_Code,44, -SCC,2103008000,NAICS_2012_Code,45, -SCC,2103008000,NAICS_2012_Code,493, -SCC,2103010000,NAICS_2012_Code,44, -SCC,2103010000,NAICS_2012_Code,45, -SCC,2103010000,NAICS_2012_Code,493, -SCC,2103011000,NAICS_2012_Code,44, -SCC,2103011000,NAICS_2012_Code,45, -SCC,2103011000,NAICS_2012_Code,493, -SCC,2601000000,NAICS_2012_Code,562213, -SCC,2601010000,NAICS_2012_Code,562213, -SCC,2601020000,NAICS_2012_Code,562213, -SCC,2610030000,NAICS_2012_Code,F01000, -SCC,2620000000,NAICS_2012_Code,562212, -SCC,2620010000,NAICS_2012_Code,562212, -SCC,2620020000,NAICS_2012_Code,562212, -SCC,2620030000,NAICS_2012_Code,562212, -SCC,2620030001,NAICS_2012_Code,562212, -SCC,2630010000,NAICS_2012_Code,221320, -SCC,2630020000,NAICS_2012_Code,221320, -SCC,2630020001,NAICS_2012_Code,221320, -SCC,2630020010,NAICS_2012_Code,221320, -SCC,2630030000,NAICS_2012_Code,221320, -SCC,2630050000,NAICS_2012_Code,221320, -SCC,2635000000,NAICS_2012_Code,562910, -SCC,2640000000,NAICS_2012_Code,562211, -SCC,2650000000,NAICS_2012_Code,562920, -SCC,2650000001,NAICS_2012_Code,562920, -SCC,2650000002,NAICS_2012_Code,562920, -SCC,2650000003,NAICS_2012_Code,562920, -SCC,2650000004,NAICS_2012_Code,562920, -SCC,2650000005,NAICS_2012_Code,562920, -SCC,2660000000,NAICS_2012_Code,562219, -SCC,2670001000,NAICS_2012_Code,562211, -SCC,2670002000,NAICS_2012_Code,562211, -SCC,2670003000,NAICS_2012_Code,562211, -SCC,2680001000,NAICS_2012_Code,562219, -SCC,2680002000,NAICS_2012_Code,562219, -SCC,2680003000,NAICS_2012_Code,562219, -SCC,2680003010,NAICS_2012_Code,562219, -SCC,2461800001,NAICS_2012_Code,111, -SCC,2461800002,NAICS_2012_Code,111, -SCC,2461850000,NAICS_2012_Code,111, -SCC,2201000062,NAICS_2012_Code,4471, -SCC,2201110080,NAICS_2012_Code,F01000, -SCC,2201210080,NAICS_2012_Code,F01000, -SCC,2201310080,NAICS_2012_Code,F01000, -SCC,2201320080,NAICS_2012_Code,484, -SCC,2201410080,NAICS_2012_Code,485210, -SCC,2201420080,NAICS_2012_Code,485113, -SCC,2201430080,NAICS_2012_Code,485410, -SCC,2201510080,NAICS_2012_Code,562111, -SCC,2201520080,NAICS_2012_Code,484, -SCC,2201530080,NAICS_2012_Code,484, -SCC,2201540080,NAICS_2012_Code,F01000, -SCC,2201610080,NAICS_2012_Code,484, -SCC,2201620080,NAICS_2012_Code,484, -SCC,2202000062,NAICS_2012_Code,4471, -SCC,2202110080,NAICS_2012_Code,F01000, -SCC,2202210080,NAICS_2012_Code,F01000, -SCC,2202310080,NAICS_2012_Code,F01000, -SCC,2202320080,NAICS_2012_Code,484, -SCC,2202410080,NAICS_2012_Code,485210, -SCC,2202420080,NAICS_2012_Code,485113, -SCC,2202430080,NAICS_2012_Code,485410, -SCC,2202510080,NAICS_2012_Code,562111, -SCC,2202520080,NAICS_2012_Code,484, -SCC,2202530080,NAICS_2012_Code,484, -SCC,2202540080,NAICS_2012_Code,F01000, -SCC,2202610080,NAICS_2012_Code,484, -SCC,2202620080,NAICS_2012_Code,484, -SCC,2203000062,NAICS_2012_Code,4471, -SCC,2203110080,NAICS_2012_Code,F01000, -SCC,2203210080,NAICS_2012_Code,F01000, -SCC,2203310080,NAICS_2012_Code,F01000, -SCC,2203320080,NAICS_2012_Code,484, -SCC,2203410080,NAICS_2012_Code,485210, -SCC,2203420080,NAICS_2012_Code,485113, -SCC,2203430080,NAICS_2012_Code,485410, -SCC,2203510080,NAICS_2012_Code,562111, -SCC,2203520080,NAICS_2012_Code,484, -SCC,2203530080,NAICS_2012_Code,484, -SCC,2203540080,NAICS_2012_Code,F01000, -SCC,2203610080,NAICS_2012_Code,484, -SCC,2203620080,NAICS_2012_Code,484, -SCC,2204000062,NAICS_2012_Code,4471, -SCC,2204110080,NAICS_2012_Code,F01000, -SCC,2204210080,NAICS_2012_Code,F01000, -SCC,2204310080,NAICS_2012_Code,F01000, -SCC,2204320080,NAICS_2012_Code,484, -SCC,2204410080,NAICS_2012_Code,485210, -SCC,2204420080,NAICS_2012_Code,485113, -SCC,2204430080,NAICS_2012_Code,485410, -SCC,2204510080,NAICS_2012_Code,562111, -SCC,2204520080,NAICS_2012_Code,484, -SCC,2204530080,NAICS_2012_Code,484, -SCC,2204540080,NAICS_2012_Code,F01000, -SCC,2204610080,NAICS_2012_Code,484, -SCC,2204620080,NAICS_2012_Code,484, -SCC,2205000062,NAICS_2012_Code,4471, -SCC,2205110080,NAICS_2012_Code,F01000, -SCC,2205210080,NAICS_2012_Code,F01000, -SCC,2205310080,NAICS_2012_Code,F01000, -SCC,2205320080,NAICS_2012_Code,484, -SCC,2205410080,NAICS_2012_Code,485210, -SCC,2205420080,NAICS_2012_Code,485113, -SCC,2205430080,NAICS_2012_Code,485410, -SCC,2205510080,NAICS_2012_Code,562111, -SCC,2205520080,NAICS_2012_Code,484, -SCC,2205530080,NAICS_2012_Code,484, -SCC,2205540080,NAICS_2012_Code,F01000, -SCC,2205610080,NAICS_2012_Code,484, -SCC,2205620080,NAICS_2012_Code,484, -SCC,2209000062,NAICS_2012_Code,4471, -SCC,2209110080,NAICS_2012_Code,F01000, -SCC,2209210080,NAICS_2012_Code,F01000, -SCC,2209310080,NAICS_2012_Code,F01000, -SCC,2209320080,NAICS_2012_Code,484, -SCC,2209410080,NAICS_2012_Code,485210, -SCC,2209420080,NAICS_2012_Code,485113, -SCC,2209430080,NAICS_2012_Code,485410, -SCC,2209510080,NAICS_2012_Code,562111, -SCC,2209520080,NAICS_2012_Code,484, -SCC,2209530080,NAICS_2012_Code,484, -SCC,2209540080,NAICS_2012_Code,F01000, -SCC,2209610080,NAICS_2012_Code,484, -SCC,2209620080,NAICS_2012_Code,484, -SCC,2260001020,NAICS_2012_Code,F01000, -SCC,2260001022,NAICS_2012_Code,F01000, -SCC,2260001060,NAICS_2012_Code,F01000, -SCC,2260002022,NAICS_2012_Code,23, -SCC,2260003022,NAICS_2012_Code,31, -SCC,2260003022,NAICS_2012_Code,32, -SCC,2260003022,NAICS_2012_Code,33, -SCC,2260004020,NAICS_2012_Code,F01000, -SCC,2260004021,NAICS_2012_Code,561730, -SCC,2260004022,NAICS_2012_Code,561730, -SCC,2260004033,NAICS_2012_Code,F01000, -SCC,2260004035,NAICS_2012_Code,F01000, -SCC,2260004036,NAICS_2012_Code,561730, -SCC,2260004044,NAICS_2012_Code,561730, -SCC,2260005022,NAICS_2012_Code,112, -SCC,2260005022,NAICS_2012_Code,111, -SCC,2260007022,NAICS_2012_Code,113, -SCC,2265001022,NAICS_2012_Code,F01000, -SCC,2265001050,NAICS_2012_Code,F01000, -SCC,2265001060,NAICS_2012_Code,F01000, -SCC,2265002022,NAICS_2012_Code,23, -SCC,2265003022,NAICS_2012_Code,31, -SCC,2265003022,NAICS_2012_Code,32, -SCC,2265003022,NAICS_2012_Code,33, -SCC,2265003060,NAICS_2012_Code,31, -SCC,2265003060,NAICS_2012_Code,32, -SCC,2265003060,NAICS_2012_Code,33, -SCC,2265004022,NAICS_2012_Code,561730, -SCC,2265004033,NAICS_2012_Code,F01000, -SCC,2265004035,NAICS_2012_Code,F01000, -SCC,2265004036,NAICS_2012_Code,561730, -SCC,2265004044,NAICS_2012_Code,561730, -SCC,2265005022,NAICS_2012_Code,112, -SCC,2265005022,NAICS_2012_Code,111, -SCC,2265007022,NAICS_2012_Code,113, -SCC,2265010010,NAICS_2012_Code,31, -SCC,2265010010,NAICS_2012_Code,32, -SCC,2265010010,NAICS_2012_Code,33, -SCC,2267001060,NAICS_2012_Code,F01000, -SCC,2267002022,NAICS_2012_Code,23, -SCC,2267003022,NAICS_2012_Code,31, -SCC,2267003022,NAICS_2012_Code,32, -SCC,2267003022,NAICS_2012_Code,33, -SCC,2267004022,NAICS_2012_Code,561730, -SCC,2267004033,NAICS_2012_Code,F01000, -SCC,2267004044,NAICS_2012_Code,561730, -SCC,2267005022,NAICS_2012_Code,112, -SCC,2267005022,NAICS_2012_Code,111, -SCC,2267007022,NAICS_2012_Code,113, -SCC,2268002022,NAICS_2012_Code,23, -SCC,2268003022,NAICS_2012_Code,31, -SCC,2268003022,NAICS_2012_Code,32, -SCC,2268003022,NAICS_2012_Code,33, -SCC,2268003060,NAICS_2012_Code,31, -SCC,2268003060,NAICS_2012_Code,32, -SCC,2268003060,NAICS_2012_Code,33, -SCC,2268004022,NAICS_2012_Code,561730, -SCC,2268004033,NAICS_2012_Code,F01000, -SCC,2268004044,NAICS_2012_Code,561730, -SCC,2268005022,NAICS_2012_Code,112, -SCC,2268005022,NAICS_2012_Code,111, -SCC,2268007022,NAICS_2012_Code,113, -SCC,2268010010,NAICS_2012_Code,31, -SCC,2268010010,NAICS_2012_Code,32, -SCC,2268010010,NAICS_2012_Code,33, -SCC,2270001060,NAICS_2012_Code,F01000, -SCC,2270002022,NAICS_2012_Code,23, -SCC,2270003022,NAICS_2012_Code,31, -SCC,2270003022,NAICS_2012_Code,32, -SCC,2270003022,NAICS_2012_Code,33, -SCC,2270003060,NAICS_2012_Code,31, -SCC,2270003060,NAICS_2012_Code,32, -SCC,2270003060,NAICS_2012_Code,33, -SCC,2270004022,NAICS_2012_Code,561730, -SCC,2270004033,NAICS_2012_Code,F01000, -SCC,2270004036,NAICS_2012_Code,561730, -SCC,2270004044,NAICS_2012_Code,561730, -SCC,2270005022,NAICS_2012_Code,112, -SCC,2270005022,NAICS_2012_Code,111, -SCC,2270007022,NAICS_2012_Code,113, -SCC,2270009010,NAICS_2012_Code,212, -SCC,2270010010,NAICS_2012_Code,211111, -SCC,2282005022,NAICS_2012_Code,F01000, -SCC,2282010005,NAICS_2012_Code,F01000, -SCC,2282020022,NAICS_2012_Code,F01000, -SCC,2285002015,NAICS_2012_Code,4821, -SCC,2285004015,NAICS_2012_Code,4821, -SCC,2285006015,NAICS_2012_Code,4821, -SCC,2260006022,NAICS_2012_Code,42, -SCC,2265006022,NAICS_2012_Code,42, -SCC,2267006022,NAICS_2012_Code,42, -SCC,2268006022,NAICS_2012_Code,42, -SCC,2270006022,NAICS_2012_Code,42, -SCC,2260006022,NAICS_2012_Code,44, -SCC,2265006022,NAICS_2012_Code,44, -SCC,2267006022,NAICS_2012_Code,44, -SCC,2268006022,NAICS_2012_Code,44, -SCC,2270006022,NAICS_2012_Code,44, -SCC,2260006022,NAICS_2012_Code,45, -SCC,2265006022,NAICS_2012_Code,45, -SCC,2267006022,NAICS_2012_Code,45, -SCC,2268006022,NAICS_2012_Code,45, -SCC,2270006022,NAICS_2012_Code,45, -SCC,2260006022,NAICS_2012_Code,493, -SCC,2265006022,NAICS_2012_Code,493, -SCC,2267006022,NAICS_2012_Code,493, -SCC,2268006022,NAICS_2012_Code,493, -SCC,2270006022,NAICS_2012_Code,493, -SCC,2260006022,NAICS_2012_Code,51, -SCC,2265006022,NAICS_2012_Code,51, -SCC,2267006022,NAICS_2012_Code,51, -SCC,2268006022,NAICS_2012_Code,51, -SCC,2270006022,NAICS_2012_Code,51, -SCC,2260006022,NAICS_2012_Code,52, -SCC,2265006022,NAICS_2012_Code,52, -SCC,2267006022,NAICS_2012_Code,52, -SCC,2268006022,NAICS_2012_Code,52, -SCC,2270006022,NAICS_2012_Code,52, -SCC,2260006022,NAICS_2012_Code,53, -SCC,2265006022,NAICS_2012_Code,53, -SCC,2267006022,NAICS_2012_Code,53, -SCC,2268006022,NAICS_2012_Code,53, -SCC,2270006022,NAICS_2012_Code,53, -SCC,2260006022,NAICS_2012_Code,54, -SCC,2265006022,NAICS_2012_Code,54, -SCC,2267006022,NAICS_2012_Code,54, -SCC,2268006022,NAICS_2012_Code,54, -SCC,2270006022,NAICS_2012_Code,54, -SCC,2260006022,NAICS_2012_Code,55, -SCC,2265006022,NAICS_2012_Code,55, -SCC,2267006022,NAICS_2012_Code,55, -SCC,2268006022,NAICS_2012_Code,55, -SCC,2270006022,NAICS_2012_Code,55, -SCC,2260006022,NAICS_2012_Code,56, -SCC,2265006022,NAICS_2012_Code,56, -SCC,2267006022,NAICS_2012_Code,56, -SCC,2268006022,NAICS_2012_Code,56, -SCC,2270006022,NAICS_2012_Code,56, -SCC,2260006022,NAICS_2012_Code,61, -SCC,2265006022,NAICS_2012_Code,61, -SCC,2267006022,NAICS_2012_Code,61, -SCC,2268006022,NAICS_2012_Code,61, -SCC,2270006022,NAICS_2012_Code,61, -SCC,2260006022,NAICS_2012_Code,62, -SCC,2265006022,NAICS_2012_Code,62, -SCC,2267006022,NAICS_2012_Code,62, -SCC,2268006022,NAICS_2012_Code,62, -SCC,2270006022,NAICS_2012_Code,62, -SCC,2260006022,NAICS_2012_Code,71, -SCC,2265006022,NAICS_2012_Code,71, -SCC,2267006022,NAICS_2012_Code,71, -SCC,2268006022,NAICS_2012_Code,71, -SCC,2270006022,NAICS_2012_Code,71, -SCC,2260006022,NAICS_2012_Code,72, -SCC,2265006022,NAICS_2012_Code,72, -SCC,2267006022,NAICS_2012_Code,72, -SCC,2268006022,NAICS_2012_Code,72, -SCC,2270006022,NAICS_2012_Code,72, -SCC,2260006022,NAICS_2012_Code,81, -SCC,2265006022,NAICS_2012_Code,81, -SCC,2267006022,NAICS_2012_Code,81, -SCC,2268006022,NAICS_2012_Code,81, -SCC,2270006022,NAICS_2012_Code,81, -SCC,2260005022,NAICS_2012_Code,115, -SCC,2265005022,NAICS_2012_Code,115, -SCC,2267005022,NAICS_2012_Code,115, -SCC,2268005022,NAICS_2012_Code,115, -SCC,2270005022,NAICS_2012_Code,115, -SCC,2260006022,NAICS_2012_Code,92, -SCC,2265006022,NAICS_2012_Code,92, -SCC,2267006022,NAICS_2012_Code,92, -SCC,2268006022,NAICS_2012_Code,92, -SCC,2270006022,NAICS_2012_Code,92, +ActivitySourceName,Activity,SectorSourceName,Sector,SectorType,Notes +SCC,2801000000,NAICS_2012_Code,111,,Agriculture - Crops +SCC,2801000001,NAICS_2012_Code,111,,Agriculture - Crops +SCC,2801000002,NAICS_2012_Code,111,,Agriculture - Crops +SCC,2801000003,NAICS_2012_Code,111,,Agriculture - Crops +SCC,2801000004,NAICS_2012_Code,111,,Agriculture - Crops +SCC,2801000005,NAICS_2012_Code,111,,Agriculture - Crops +SCC,2801000006,NAICS_2012_Code,111,,Agriculture - Crops +SCC,2801000007,NAICS_2012_Code,111,,Agriculture - Crops +SCC,2801000008,NAICS_2012_Code,111,,Agriculture - Crops +SCC,2801500000,NAICS_2012_Code,111,,Agriculture - Field Burning +SCC,2801500111,NAICS_2012_Code,111940,,Agriculture - Field Burning +SCC,2801500112,NAICS_2012_Code,111940,,Agriculture - Field Burning +SCC,2801500120,NAICS_2012_Code,111219,,Agriculture - Field Burning +SCC,2801500130,NAICS_2012_Code,111199,,Agriculture - Field Burning +SCC,2801500141,NAICS_2012_Code,111130,,Agriculture - Field Burning +SCC,2801500142,NAICS_2012_Code,111130,,Agriculture - Field Burning +SCC,2801500150,NAICS_2012_Code,111150,,Agriculture - Field Burning +SCC,2801500151,NAICS_2012_Code,111140,,Agriculture - Field Burning +SCC,2801500151,NAICS_2012_Code,111150,,Agriculture - Field Burning +SCC,2801500152,NAICS_2012_Code,111110,,Agriculture - Field Burning +SCC,2801500152,NAICS_2012_Code,111150,,Agriculture - Field Burning +SCC,2801500160,NAICS_2012_Code,111920,,Agriculture - Field Burning +SCC,2801500161,NAICS_2012_Code,111920,,Agriculture - Field Burning +SCC,2801500161,NAICS_2012_Code,111110,,Agriculture - Field Burning +SCC,2801500170,NAICS_2012_Code,111940,,Agriculture - Field Burning +SCC,2801500171,NAICS_2012_Code,115112,,Agriculture - Field Burning +SCC,2801500181,NAICS_2012_Code,111940,,Agriculture - Field Burning +SCC,2801500182,NAICS_2012_Code,111940,,Agriculture - Field Burning +SCC,2801500191,NAICS_2012_Code,111199,,Agriculture - Field Burning +SCC,2801500192,NAICS_2012_Code,111199,,Agriculture - Field Burning +SCC,2801500201,NAICS_2012_Code,111130,,Agriculture - Field Burning +SCC,2801500202,NAICS_2012_Code,111130,,Agriculture - Field Burning +SCC,2801500210,NAICS_2012_Code,111339,,Agriculture - Field Burning +SCC,2801500220,NAICS_2012_Code,111160,,Agriculture - Field Burning +SCC,2801500230,NAICS_2012_Code,111120,,Agriculture - Field Burning +SCC,2801500240,NAICS_2012_Code,111199,,Agriculture - Field Burning +SCC,2801500250,NAICS_2012_Code,111930,,Agriculture - Field Burning +SCC,2801500261,NAICS_2012_Code,111140,,Agriculture - Field Burning +SCC,2801500262,NAICS_2012_Code,111140,,Agriculture - Field Burning +SCC,2801500263,NAICS_2012_Code,111140,,Agriculture - Field Burning +SCC,2801500263,NAICS_2012_Code,111920,,Agriculture - Field Burning +SCC,2801500264,NAICS_2012_Code,111140,,Agriculture - Field Burning +SCC,2801500264,NAICS_2012_Code,111920,,Agriculture - Field Burning +SCC,2801500300,NAICS_2012_Code,1113,,Agriculture - Field Burning +SCC,2801500310,NAICS_2012_Code,111335,,Agriculture - Field Burning +SCC,2801500320,NAICS_2012_Code,111331,,Agriculture - Field Burning +SCC,2801500330,NAICS_2012_Code,111339,,Agriculture - Field Burning +SCC,2801500340,NAICS_2012_Code,111998,,Agriculture - Field Burning +SCC,2801500350,NAICS_2012_Code,111339,,Agriculture - Field Burning +SCC,2801500360,NAICS_2012_Code,111310,,Agriculture - Field Burning +SCC,2801500360,NAICS_2012_Code,111320,,Agriculture - Field Burning +SCC,2801500370,NAICS_2012_Code,111339,,Agriculture - Field Burning +SCC,2801500380,NAICS_2012_Code,111339,,Agriculture - Field Burning +SCC,2801500390,NAICS_2012_Code,111339,,Agriculture - Field Burning +SCC,2801500400,NAICS_2012_Code,111998,,Agriculture - Field Burning +SCC,2801500410,NAICS_2012_Code,111339,,Agriculture - Field Burning +SCC,2801500420,NAICS_2012_Code,111339,,Agriculture - Field Burning +SCC,2801500430,NAICS_2012_Code,111339,,Agriculture - Field Burning +SCC,2801500440,NAICS_2012_Code,111335,,Agriculture - Field Burning +SCC,2801500450,NAICS_2012_Code,111335,,Agriculture - Field Burning +SCC,2102001000,NAICS_2012_Code,31,,Fuel Combustion - Industry +SCC,2102001000,NAICS_2012_Code,32,,Fuel Combustion - Industry +SCC,2102001000,NAICS_2012_Code,33,,Fuel Combustion - Industry +SCC,2102002000,NAICS_2012_Code,31,,Fuel Combustion - Industry +SCC,2102002000,NAICS_2012_Code,32,,Fuel Combustion - Industry +SCC,2102002000,NAICS_2012_Code,33,,Fuel Combustion - Industry +SCC,2102004000,NAICS_2012_Code,31,,Fuel Combustion - Industry +SCC,2102004000,NAICS_2012_Code,32,,Fuel Combustion - Industry +SCC,2102004000,NAICS_2012_Code,33,,Fuel Combustion - Industry +SCC,2102004001,NAICS_2012_Code,31,,Fuel Combustion - Industry +SCC,2102004001,NAICS_2012_Code,32,,Fuel Combustion - Industry +SCC,2102004001,NAICS_2012_Code,33,,Fuel Combustion - Industry +SCC,2102004002,NAICS_2012_Code,31,,Fuel Combustion - Industry +SCC,2102004002,NAICS_2012_Code,32,,Fuel Combustion - Industry +SCC,2102004002,NAICS_2012_Code,33,,Fuel Combustion - Industry +SCC,2102005000,NAICS_2012_Code,31,,Fuel Combustion - Industry +SCC,2102005000,NAICS_2012_Code,32,,Fuel Combustion - Industry +SCC,2102005000,NAICS_2012_Code,33,,Fuel Combustion - Industry +SCC,2102006000,NAICS_2012_Code,31,,Fuel Combustion - Industry +SCC,2102006000,NAICS_2012_Code,32,,Fuel Combustion - Industry +SCC,2102006000,NAICS_2012_Code,33,,Fuel Combustion - Industry +SCC,2102007000,NAICS_2012_Code,31,,Fuel Combustion - Industry +SCC,2102007000,NAICS_2012_Code,32,,Fuel Combustion - Industry +SCC,2102007000,NAICS_2012_Code,33,,Fuel Combustion - Industry +SCC,2102008000,NAICS_2012_Code,31,,Fuel Combustion - Industry +SCC,2102008000,NAICS_2012_Code,32,,Fuel Combustion - Industry +SCC,2102008000,NAICS_2012_Code,33,,Fuel Combustion - Industry +SCC,2102009000,NAICS_2012_Code,31,,Fuel Combustion - Industry +SCC,2102009000,NAICS_2012_Code,32,,Fuel Combustion - Industry +SCC,2102009000,NAICS_2012_Code,33,,Fuel Combustion - Industry +SCC,2102010000,NAICS_2012_Code,31,,Fuel Combustion - Industry +SCC,2102010000,NAICS_2012_Code,32,,Fuel Combustion - Industry +SCC,2102010000,NAICS_2012_Code,33,,Fuel Combustion - Industry +SCC,2102011000,NAICS_2012_Code,31,,Fuel Combustion - Industry +SCC,2102011000,NAICS_2012_Code,32,,Fuel Combustion - Industry +SCC,2102011000,NAICS_2012_Code,33,,Fuel Combustion - Industry +SCC,2102012000,NAICS_2012_Code,31,,Fuel Combustion - Industry +SCC,2102012000,NAICS_2012_Code,32,,Fuel Combustion - Industry +SCC,2102012000,NAICS_2012_Code,33,,Fuel Combustion - Industry +SCC,2104001000,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104002000,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104004000,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104006000,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104007000,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008100,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008110,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008120,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008130,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008200,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008210,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008220,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008230,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008300,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008310,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008320,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008330,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008340,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008400,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008410,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008420,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008500,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008510,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008520,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008530,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008540,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008550,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008600,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008610,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008620,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008630,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008640,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104008700,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104009000,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104010000,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2104011000,NAICS_2012_Code,F01000,,Fuel Combustion - Residential +SCC,2310000220,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310000230,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310000440,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310000551,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310000552,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310000553,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310000660,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310001000,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310002000,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310002301,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310002305,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310002401,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310002411,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310002421,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310010000,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310010100,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310010200,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310010300,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310010700,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310010800,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310011001,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310011020,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310011100,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310011201,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310011450,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310011500,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310011501,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310011502,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310011503,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310011504,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310011505,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310011506,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310011600,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310012000,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310012020,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310012201,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310012511,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310012512,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310012515,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310012516,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310012521,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310012522,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310012525,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310012526,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310020000,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310020600,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310020700,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310020800,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021010,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021011,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021030,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021100,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021101,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021102,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021103,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021109,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021201,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021202,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021203,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021209,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021251,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021300,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021301,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021302,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021303,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021309,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021310,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021351,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021400,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021401,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021402,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021403,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021409,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021410,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021411,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021412,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021450,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021500,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021501,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021502,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021503,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021504,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021505,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021506,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021509,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021600,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021601,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021602,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021603,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021604,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021605,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021700,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021801,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021802,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310021803,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022000,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022010,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022051,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022090,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022101,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022102,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022103,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022105,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022109,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022201,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022202,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022203,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022300,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022301,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022302,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022303,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022401,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022402,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022403,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022409,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022410,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022420,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022501,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022502,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022505,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310022506,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023000,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023010,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023030,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023100,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023102,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023202,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023251,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023300,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023302,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023310,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023351,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023400,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023401,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023410,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023509,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023511,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023512,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023513,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023515,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023516,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023600,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023601,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023602,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023603,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023604,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023605,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310023606,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310030000,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310030210,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310030220,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310030230,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310030300,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310030400,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310030401,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310111100,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310111401,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310111700,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310111701,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310111702,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310112000,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310112100,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310112401,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310112700,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310112701,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310112702,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310121100,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310121401,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310121700,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310121701,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310121702,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310122000,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310122100,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310122401,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310122700,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310122701,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310122702,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310300220,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310321010,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310321100,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310321400,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310321603,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310400220,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310421010,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310421100,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310421400,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310421603,NAICS_2012_Code,211111,,Oil and Gas +SCC,2805001000,NAICS_2012_Code,112112,,Agriculture - Livestock +SCC,2805001010,NAICS_2012_Code,112120,,Agriculture - Livestock +SCC,2805001100,NAICS_2012_Code,112112,,Agriculture - Livestock +SCC,2805001200,NAICS_2012_Code,112112,,Agriculture - Livestock +SCC,2805001300,NAICS_2012_Code,112112,,Agriculture - Livestock +SCC,2805002000,NAICS_2012_Code,112111,,Agriculture - Livestock +SCC,2805003000,NAICS_2012_Code,112111,,Agriculture - Livestock +SCC,2805003100,NAICS_2012_Code,112111,,Agriculture - Livestock +SCC,2805018000,NAICS_2012_Code,112120,,Agriculture - Livestock +SCC,2805019000,NAICS_2012_Code,112120,,Agriculture - Livestock +SCC,2805019100,NAICS_2012_Code,112120,,Agriculture - Livestock +SCC,2805019200,NAICS_2012_Code,112120,,Agriculture - Livestock +SCC,2805019300,NAICS_2012_Code,112120,,Agriculture - Livestock +SCC,2805020001,NAICS_2012_Code,112120,,Agriculture - Livestock +SCC,2805020002,NAICS_2012_Code,112112,,Agriculture - Livestock +SCC,2805020003,NAICS_2012_Code,112112,,Agriculture - Livestock +SCC,2805020004,NAICS_2012_Code,112112,,Agriculture - Livestock +SCC,2805021100,NAICS_2012_Code,112120,,Agriculture - Livestock +SCC,2805021200,NAICS_2012_Code,112120,,Agriculture - Livestock +SCC,2805021300,NAICS_2012_Code,112120,,Agriculture - Livestock +SCC,2805022100,NAICS_2012_Code,112120,,Agriculture - Livestock +SCC,2805022200,NAICS_2012_Code,112120,,Agriculture - Livestock +SCC,2805022300,NAICS_2012_Code,112120,,Agriculture - Livestock +SCC,2805023100,NAICS_2012_Code,112120,,Agriculture - Livestock +SCC,2805023200,NAICS_2012_Code,112120,,Agriculture - Livestock +SCC,2805023300,NAICS_2012_Code,112120,,Agriculture - Livestock +SCC,2805001040,NAICS_2012_Code,112210,,Agriculture - Livestock +SCC,2805025000,NAICS_2012_Code,112210,,Agriculture - Livestock +SCC,2805039000,NAICS_2012_Code,112210,,Agriculture - Livestock +SCC,2805039100,NAICS_2012_Code,112210,,Agriculture - Livestock +SCC,2805039200,NAICS_2012_Code,112210,,Agriculture - Livestock +SCC,2805039300,NAICS_2012_Code,112210,,Agriculture - Livestock +SCC,2805047100,NAICS_2012_Code,112210,,Agriculture - Livestock +SCC,2805047300,NAICS_2012_Code,112210,,Agriculture - Livestock +SCC,2805053100,NAICS_2012_Code,112210,,Agriculture - Livestock +SCC,2805001020,NAICS_2012_Code,112320,,Agriculture - Livestock +SCC,2805001030,NAICS_2012_Code,112310,,Agriculture - Livestock +SCC,2805001050,NAICS_2012_Code,112330,,Agriculture - Livestock +SCC,2805007000,NAICS_2012_Code,112310,,Agriculture - Livestock +SCC,2805007100,NAICS_2012_Code,112310,,Agriculture - Livestock +SCC,2805007300,NAICS_2012_Code,112310,,Agriculture - Livestock +SCC,2805008100,NAICS_2012_Code,112310,,Agriculture - Livestock +SCC,2805008200,NAICS_2012_Code,112310,,Agriculture - Livestock +SCC,2805008300,NAICS_2012_Code,112310,,Agriculture - Livestock +SCC,2805009000,NAICS_2012_Code,112320,,Agriculture - Livestock +SCC,2805009100,NAICS_2012_Code,112320,,Agriculture - Livestock +SCC,2805009200,NAICS_2012_Code,112320,,Agriculture - Livestock +SCC,2805009300,NAICS_2012_Code,112320,,Agriculture - Livestock +SCC,2805010000,NAICS_2012_Code,112330,,Agriculture - Livestock +SCC,2805010100,NAICS_2012_Code,112330,,Agriculture - Livestock +SCC,2805010200,NAICS_2012_Code,112330,,Agriculture - Livestock +SCC,2805010300,NAICS_2012_Code,112330,,Agriculture - Livestock +SCC,2805030000,NAICS_2012_Code,1123,,Agriculture - Livestock +SCC,2805030007,NAICS_2012_Code,112390,,Agriculture - Livestock +SCC,2805030008,NAICS_2012_Code,112390,,Agriculture - Livestock +SCC,2805035000,NAICS_2012_Code,112920,,Agriculture - Livestock +SCC,2805040000,NAICS_2012_Code,112410,,Agriculture - Livestock +SCC,2805045000,NAICS_2012_Code,112420,,Agriculture - Livestock +SCC,2275085000,NAICS_2012_Code,481,,Mobile Sources +SCC,2275087000,NAICS_2012_Code,481,,Mobile Sources +SCC,2280002101,NAICS_2012_Code,483,,Mobile Sources +SCC,2280002102,NAICS_2012_Code,483,,Mobile Sources +SCC,2280002103,NAICS_2012_Code,483,,Mobile Sources +SCC,2280002104,NAICS_2012_Code,483,,Mobile Sources +SCC,2280002201,NAICS_2012_Code,483,,Mobile Sources +SCC,2280002202,NAICS_2012_Code,483,,Mobile Sources +SCC,2280002203,NAICS_2012_Code,483,,Mobile Sources +SCC,2280002204,NAICS_2012_Code,483,,Mobile Sources +SCC,2280003103,NAICS_2012_Code,483,,Mobile Sources +SCC,2280003104,NAICS_2012_Code,483,,Mobile Sources +SCC,2280003203,NAICS_2012_Code,483,,Mobile Sources +SCC,2280003204,NAICS_2012_Code,483,,Mobile Sources +SCC,2285002006,NAICS_2012_Code,482,,Mobile Sources +SCC,2285002007,NAICS_2012_Code,482,,Mobile Sources +SCC,2285002008,NAICS_2012_Code,482,,Mobile Sources +SCC,2285002009,NAICS_2012_Code,482,,Mobile Sources +SCC,2285002010,NAICS_2012_Code,482,,Mobile Sources +SCC,2501011011,NAICS_2012_Code,F01000,,Residential +SCC,2501011012,NAICS_2012_Code,F01000,,Residential +SCC,2501011013,NAICS_2012_Code,F01000,,Residential +SCC,2501011014,NAICS_2012_Code,F01000,,Residential +SCC,2501011015,NAICS_2012_Code,F01000,,Residential +SCC,2806010000,NAICS_2012_Code,F01000,,Residential +SCC,2806015000,NAICS_2012_Code,F01000,,Residential +SCC,2810003000,NAICS_2012_Code,F01000,,Residential +SCC,2810010000,NAICS_2012_Code,F01000,,Residential +SCC,2810025000,NAICS_2012_Code,F01000,,Residential +SCC,2862002000,NAICS_2012_Code,F01000,,Residential +SCC,2301000000,NAICS_2012_Code,325,,Industrial processes +SCC,2301010000,NAICS_2012_Code,325,,Industrial processes +SCC,2301010010,NAICS_2012_Code,325,,Industrial processes +SCC,2301020000,NAICS_2012_Code,32522,,Industrial processes +SCC,2301030000,NAICS_2012_Code,3254,,Industrial processes +SCC,2301040000,NAICS_2012_Code,325190,,Industrial processes +SCC,2301050001,NAICS_2012_Code,325211,,Industrial processes +SCC,2301050002,NAICS_2012_Code,325211,,Industrial processes +SCC,2302000000,NAICS_2012_Code,311,,Industrial processes +SCC,2302002000,NAICS_2012_Code,722,,Industrial processes +SCC,2302002100,NAICS_2012_Code,722,,Industrial processes +SCC,2302002200,NAICS_2012_Code,722,,Industrial processes +SCC,2302003000,NAICS_2012_Code,722,,Industrial processes +SCC,2302003100,NAICS_2012_Code,722,,Industrial processes +SCC,2302003200,NAICS_2012_Code,722,,Industrial processes +SCC,2302003299,NAICS_2012_Code,722,,Industrial processes +SCC,2302010000,NAICS_2012_Code,31161,,Industrial processes +SCC,2302040000,NAICS_2012_Code,3112,,Industrial processes +SCC,2302050000,NAICS_2012_Code,31181,,Industrial processes +SCC,2302070000,NAICS_2012_Code,3121,,Industrial processes +SCC,2302070001,NAICS_2012_Code,312120,,Industrial processes +SCC,2302070005,NAICS_2012_Code,312130,,Industrial processes +SCC,2302070010,NAICS_2012_Code,312140,,Industrial processes +SCC,2302080000,NAICS_2012_Code,311,,Industrial processes +SCC,2302080002,NAICS_2012_Code,311,,Industrial processes +SCC,2303000000,NAICS_2012_Code,331,,Industrial processes +SCC,2303020000,NAICS_2012_Code,33151,,Industrial processes +SCC,2304000000,NAICS_2012_Code,332,,Industrial processes +SCC,2304050000,NAICS_2012_Code,33152,,Industrial processes +SCC,2305000000,NAICS_2012_Code,2122,,Industrial processes +SCC,2305000000,NAICS_2012_Code,2123,,Industrial processes +SCC,2306000000,NAICS_2012_Code,324110,,Industrial processes +SCC,2306010000,NAICS_2012_Code,324121,,Industrial processes +SCC,2306010100,NAICS_2012_Code,324121,,Industrial processes +SCC,2307000000,NAICS_2012_Code,321,,Industrial processes +SCC,2307010000,NAICS_2012_Code,113310,,Industrial processes +SCC,2307020000,NAICS_2012_Code,321113,,Industrial processes +SCC,2307030000,NAICS_2012_Code,3212,,Industrial processes +SCC,2307030000,NAICS_2012_Code,3219,,Industrial processes +SCC,2307060000,NAICS_2012_Code,32199,,Industrial processes +SCC,2308000000,NAICS_2012_Code,326,,Industrial processes +SCC,2309000000,NAICS_2012_Code,332,,Industrial processes +SCC,2311010000,NAICS_2012_Code,2361,,Industrial processes +SCC,2311020000,NAICS_2012_Code,236210,,Industrial processes +SCC,2311030000,NAICS_2012_Code,237310,,Industrial processes +SCC,2312000000,NAICS_2012_Code,333,,Industrial processes +SCC,2325000000,NAICS_2012_Code,2122,,Industrial processes +SCC,2325000000,NAICS_2012_Code,2123,,Industrial processes +SCC,2325010000,NAICS_2012_Code,21231,,Industrial processes +SCC,2325020000,NAICS_2012_Code,21231,,Industrial processes +SCC,2325030000,NAICS_2012_Code,21232,,Industrial processes +SCC,2325040000,NAICS_2012_Code,212325,,Industrial processes +SCC,2325050000,NAICS_2012_Code,212393,,Industrial processes +SCC,2325060000,NAICS_2012_Code,212231,,Industrial processes +SCC,2399000000,NAICS_2012_Code,31,,Industrial processes +SCC,2399000000,NAICS_2012_Code,32,,Industrial processes +SCC,2399000000,NAICS_2012_Code,33,,Industrial processes +SCC,2399010000,NAICS_2012_Code,31,,Industrial processes +SCC,2399010000,NAICS_2012_Code,32,,Industrial processes +SCC,2399010000,NAICS_2012_Code,33,,Industrial processes +SCC,2420000000,NAICS_2012_Code,8123,,Other Industry +SCC,2420000055,NAICS_2012_Code,8123,,Other Industry +SCC,2420000999,NAICS_2012_Code,8123,,Other Industry +SCC,2501000000,NAICS_2012_Code,324110,,Fuel Storage +SCC,2501000030,NAICS_2012_Code,324110,,Fuel Storage +SCC,2501000060,NAICS_2012_Code,324110,,Fuel Storage +SCC,2501000090,NAICS_2012_Code,324110,,Fuel Storage +SCC,2501000120,NAICS_2012_Code,324110,,Fuel Storage +SCC,2501000150,NAICS_2012_Code,324110,,Fuel Storage +SCC,2501000180,NAICS_2012_Code,324110,,Fuel Storage +SCC,2501000900,NAICS_2012_Code,324110,,Fuel Storage +SCC,2501010000,NAICS_2012_Code,324110,,Fuel Storage +SCC,2501010030,NAICS_2012_Code,324110,,Fuel Storage +SCC,2501010060,NAICS_2012_Code,324110,,Fuel Storage +SCC,2501010090,NAICS_2012_Code,324110,,Fuel Storage +SCC,2501010120,NAICS_2012_Code,324110,,Fuel Storage +SCC,2501010150,NAICS_2012_Code,324110,,Fuel Storage +SCC,2501010180,NAICS_2012_Code,324110,,Fuel Storage +SCC,2501010900,NAICS_2012_Code,324110,,Fuel Storage +SCC,2501012011,NAICS_2012_Code,4471,,Fuel Storage +SCC,2501012012,NAICS_2012_Code,4471,,Fuel Storage +SCC,2501012013,NAICS_2012_Code,4471,,Fuel Storage +SCC,2501012014,NAICS_2012_Code,4471,,Fuel Storage +SCC,2501012015,NAICS_2012_Code,4471,,Fuel Storage +SCC,2501013010,NAICS_2012_Code,4471,,Fuel Storage +SCC,2501050000,NAICS_2012_Code,4247,,Fuel Storage +SCC,2501050030,NAICS_2012_Code,4247,,Fuel Storage +SCC,2501050060,NAICS_2012_Code,4247,,Fuel Storage +SCC,2501050090,NAICS_2012_Code,4247,,Fuel Storage +SCC,2501050120,NAICS_2012_Code,4247,,Fuel Storage +SCC,2501050150,NAICS_2012_Code,4247,,Fuel Storage +SCC,2501050180,NAICS_2012_Code,4247,,Fuel Storage +SCC,2501050900,NAICS_2012_Code,4247,,Fuel Storage +SCC,2501055120,NAICS_2012_Code,4247,,Fuel Storage +SCC,2501060050,NAICS_2012_Code,4471,,Fuel Storage +SCC,2501060051,NAICS_2012_Code,4471,,Fuel Storage +SCC,2501060052,NAICS_2012_Code,4471,,Fuel Storage +SCC,2501060053,NAICS_2012_Code,4471,,Fuel Storage +SCC,2501060201,NAICS_2012_Code,4471,,Fuel Storage +SCC,2501070050,NAICS_2012_Code,4471,,Fuel Storage +SCC,2501070051,NAICS_2012_Code,4471,,Fuel Storage +SCC,2501070052,NAICS_2012_Code,4471,,Fuel Storage +SCC,2501070053,NAICS_2012_Code,4471,,Fuel Storage +SCC,2501070201,NAICS_2012_Code,4471,,Fuel Storage +SCC,2501080050,NAICS_2012_Code,4881,,Fuel Storage +SCC,2501080100,NAICS_2012_Code,4881,,Fuel Storage +SCC,2501080201,NAICS_2012_Code,4881,,Fuel Storage +SCC,2501995000,NAICS_2012_Code,324110,,Fuel Storage +SCC,2501995030,NAICS_2012_Code,324110,,Fuel Storage +SCC,2501995060,NAICS_2012_Code,324110,,Fuel Storage +SCC,2501995090,NAICS_2012_Code,324110,,Fuel Storage +SCC,2501995120,NAICS_2012_Code,324110,,Fuel Storage +SCC,2501995150,NAICS_2012_Code,324110,,Fuel Storage +SCC,2501995180,NAICS_2012_Code,324110,,Fuel Storage +SCC,2505000000,NAICS_2012_Code,324110,,Fuel Storage +SCC,2505000030,NAICS_2012_Code,324110,,Fuel Storage +SCC,2505000060,NAICS_2012_Code,324110,,Fuel Storage +SCC,2505000090,NAICS_2012_Code,324110,,Fuel Storage +SCC,2505000120,NAICS_2012_Code,324110,,Fuel Storage +SCC,2505000150,NAICS_2012_Code,324110,,Fuel Storage +SCC,2505000180,NAICS_2012_Code,324110,,Fuel Storage +SCC,2505000900,NAICS_2012_Code,324110,,Fuel Storage +SCC,2505010000,NAICS_2012_Code,4882,,Fuel Storage +SCC,2505010030,NAICS_2012_Code,4882,,Fuel Storage +SCC,2505010060,NAICS_2012_Code,4882,,Fuel Storage +SCC,2505010090,NAICS_2012_Code,4882,,Fuel Storage +SCC,2505010120,NAICS_2012_Code,4882,,Fuel Storage +SCC,2505010150,NAICS_2012_Code,4882,,Fuel Storage +SCC,2505010180,NAICS_2012_Code,4882,,Fuel Storage +SCC,2505010900,NAICS_2012_Code,4882,,Fuel Storage +SCC,2505020000,NAICS_2012_Code,4883,,Fuel Storage +SCC,2505020030,NAICS_2012_Code,4883,,Fuel Storage +SCC,2505020041,NAICS_2012_Code,4883,,Fuel Storage +SCC,2505020060,NAICS_2012_Code,4883,,Fuel Storage +SCC,2505020090,NAICS_2012_Code,4883,,Fuel Storage +SCC,2505020091,NAICS_2012_Code,4883,,Fuel Storage +SCC,2505020092,NAICS_2012_Code,4883,,Fuel Storage +SCC,2505020093,NAICS_2012_Code,4883,,Fuel Storage +SCC,2505020120,NAICS_2012_Code,4883,,Fuel Storage +SCC,2505020121,NAICS_2012_Code,4883,,Fuel Storage +SCC,2505020150,NAICS_2012_Code,4883,,Fuel Storage +SCC,2505020180,NAICS_2012_Code,4883,,Fuel Storage +SCC,2505020182,NAICS_2012_Code,4883,,Fuel Storage +SCC,2505020900,NAICS_2012_Code,4883,,Fuel Storage +SCC,2505030000,NAICS_2012_Code,4884,,Fuel Storage +SCC,2505030030,NAICS_2012_Code,4884,,Fuel Storage +SCC,2505030060,NAICS_2012_Code,4884,,Fuel Storage +SCC,2505030090,NAICS_2012_Code,4884,,Fuel Storage +SCC,2505030120,NAICS_2012_Code,4884,,Fuel Storage +SCC,2505030150,NAICS_2012_Code,4884,,Fuel Storage +SCC,2505030180,NAICS_2012_Code,4884,,Fuel Storage +SCC,2505030900,NAICS_2012_Code,4884,,Fuel Storage +SCC,2505040000,NAICS_2012_Code,486,,Fuel Storage +SCC,2505040030,NAICS_2012_Code,486110,,Fuel Storage +SCC,2505040060,NAICS_2012_Code,486910,,Fuel Storage +SCC,2505040090,NAICS_2012_Code,486910,,Fuel Storage +SCC,2505040120,NAICS_2012_Code,486910,,Fuel Storage +SCC,2505040150,NAICS_2012_Code,486910,,Fuel Storage +SCC,2505040180,NAICS_2012_Code,486910,,Fuel Storage +SCC,2530000000,NAICS_2012_Code,493,,Fuel Storage +SCC,2530010000,NAICS_2012_Code,493,,Fuel Storage +SCC,2530050000,NAICS_2012_Code,493,,Fuel Storage +SCC,2801700000,NAICS_2012_Code,111,,Agriculture - Fertilizer +SCC,2801700001,NAICS_2012_Code,111,,Agriculture - Fertilizer +SCC,2801700002,NAICS_2012_Code,111,,Agriculture - Fertilizer +SCC,2801700003,NAICS_2012_Code,111,,Agriculture - Fertilizer +SCC,2801700004,NAICS_2012_Code,111,,Agriculture - Fertilizer +SCC,2801700005,NAICS_2012_Code,111,,Agriculture - Fertilizer +SCC,2801700006,NAICS_2012_Code,111,,Agriculture - Fertilizer +SCC,2801700007,NAICS_2012_Code,111,,Agriculture - Fertilizer +SCC,2801700010,NAICS_2012_Code,111,,Agriculture - Fertilizer +SCC,2801700011,NAICS_2012_Code,111,,Agriculture - Fertilizer +SCC,2801700012,NAICS_2012_Code,111,,Agriculture - Fertilizer +SCC,2801700013,NAICS_2012_Code,111,,Agriculture - Fertilizer +SCC,2801700014,NAICS_2012_Code,111,,Agriculture - Fertilizer +SCC,2801700015,NAICS_2012_Code,111,,Agriculture - Fertilizer +SCC,2801700099,NAICS_2012_Code,111,,Agriculture - Fertilizer +SCC,2103001000,NAICS_2012_Code,42,,Fuel Combustion - Institutional/Commercial +SCC,2103002000,NAICS_2012_Code,42,,Fuel Combustion - Institutional/Commercial +SCC,2103004000,NAICS_2012_Code,42,,Fuel Combustion - Institutional/Commercial +SCC,2103004001,NAICS_2012_Code,42,,Fuel Combustion - Institutional/Commercial +SCC,2103004002,NAICS_2012_Code,42,,Fuel Combustion - Institutional/Commercial +SCC,2103005000,NAICS_2012_Code,42,,Fuel Combustion - Institutional/Commercial +SCC,2103006000,NAICS_2012_Code,42,,Fuel Combustion - Institutional/Commercial +SCC,2103007000,NAICS_2012_Code,42,,Fuel Combustion - Institutional/Commercial +SCC,2103008000,NAICS_2012_Code,42,,Fuel Combustion - Institutional/Commercial +SCC,2103010000,NAICS_2012_Code,42,,Fuel Combustion - Institutional/Commercial +SCC,2103011000,NAICS_2012_Code,42,,Fuel Combustion - Institutional/Commercial +SCC,2103001000,NAICS_2012_Code,44,,Fuel Combustion - Institutional/Commercial +SCC,2103001000,NAICS_2012_Code,45,,Fuel Combustion - Institutional/Commercial +SCC,2103001000,NAICS_2012_Code,493,,Fuel Combustion - Institutional/Commercial +SCC,2103002000,NAICS_2012_Code,44,,Fuel Combustion - Institutional/Commercial +SCC,2103002000,NAICS_2012_Code,45,,Fuel Combustion - Institutional/Commercial +SCC,2103002000,NAICS_2012_Code,493,,Fuel Combustion - Institutional/Commercial +SCC,2103004000,NAICS_2012_Code,44,,Fuel Combustion - Institutional/Commercial +SCC,2103004000,NAICS_2012_Code,45,,Fuel Combustion - Institutional/Commercial +SCC,2103004000,NAICS_2012_Code,493,,Fuel Combustion - Institutional/Commercial +SCC,2103004001,NAICS_2012_Code,44,,Fuel Combustion - Institutional/Commercial +SCC,2103004001,NAICS_2012_Code,45,,Fuel Combustion - Institutional/Commercial +SCC,2103004001,NAICS_2012_Code,493,,Fuel Combustion - Institutional/Commercial +SCC,2103004002,NAICS_2012_Code,44,,Fuel Combustion - Institutional/Commercial +SCC,2103004002,NAICS_2012_Code,45,,Fuel Combustion - Institutional/Commercial +SCC,2103004002,NAICS_2012_Code,493,,Fuel Combustion - Institutional/Commercial +SCC,2103005000,NAICS_2012_Code,44,,Fuel Combustion - Institutional/Commercial +SCC,2103005000,NAICS_2012_Code,45,,Fuel Combustion - Institutional/Commercial +SCC,2103005000,NAICS_2012_Code,493,,Fuel Combustion - Institutional/Commercial +SCC,2103006000,NAICS_2012_Code,44,,Fuel Combustion - Institutional/Commercial +SCC,2103006000,NAICS_2012_Code,45,,Fuel Combustion - Institutional/Commercial +SCC,2103006000,NAICS_2012_Code,493,,Fuel Combustion - Institutional/Commercial +SCC,2103007000,NAICS_2012_Code,44,,Fuel Combustion - Institutional/Commercial +SCC,2103007000,NAICS_2012_Code,45,,Fuel Combustion - Institutional/Commercial +SCC,2103007000,NAICS_2012_Code,493,,Fuel Combustion - Institutional/Commercial +SCC,2103008000,NAICS_2012_Code,44,,Fuel Combustion - Institutional/Commercial +SCC,2103008000,NAICS_2012_Code,45,,Fuel Combustion - Institutional/Commercial +SCC,2103008000,NAICS_2012_Code,493,,Fuel Combustion - Institutional/Commercial +SCC,2103010000,NAICS_2012_Code,44,,Fuel Combustion - Institutional/Commercial +SCC,2103010000,NAICS_2012_Code,45,,Fuel Combustion - Institutional/Commercial +SCC,2103010000,NAICS_2012_Code,493,,Fuel Combustion - Institutional/Commercial +SCC,2103011000,NAICS_2012_Code,44,,Fuel Combustion - Institutional/Commercial +SCC,2103011000,NAICS_2012_Code,45,,Fuel Combustion - Institutional/Commercial +SCC,2103011000,NAICS_2012_Code,493,,Fuel Combustion - Institutional/Commercial +SCC,2601000000,NAICS_2012_Code,562213,,Waste Treatment +SCC,2601010000,NAICS_2012_Code,562213,,Waste Treatment +SCC,2601020000,NAICS_2012_Code,562213,,Waste Treatment +SCC,2610030000,NAICS_2012_Code,F01000,,Waste Treatment +SCC,2620000000,NAICS_2012_Code,562212,,Waste Treatment +SCC,2620010000,NAICS_2012_Code,562212,,Waste Treatment +SCC,2620020000,NAICS_2012_Code,562212,,Waste Treatment +SCC,2620030000,NAICS_2012_Code,562212,,Waste Treatment +SCC,2620030001,NAICS_2012_Code,562212,,Waste Treatment +SCC,2630010000,NAICS_2012_Code,221320,,Waste Treatment +SCC,2630020000,NAICS_2012_Code,221320,,Waste Treatment +SCC,2630020001,NAICS_2012_Code,221320,,Waste Treatment +SCC,2630020010,NAICS_2012_Code,221320,,Waste Treatment +SCC,2630030000,NAICS_2012_Code,221320,,Waste Treatment +SCC,2630050000,NAICS_2012_Code,221320,,Waste Treatment +SCC,2635000000,NAICS_2012_Code,562910,,Waste Treatment +SCC,2640000000,NAICS_2012_Code,562211,,Waste Treatment +SCC,2650000000,NAICS_2012_Code,562920,,Waste Treatment +SCC,2650000001,NAICS_2012_Code,562920,,Waste Treatment +SCC,2650000002,NAICS_2012_Code,562920,,Waste Treatment +SCC,2650000003,NAICS_2012_Code,562920,,Waste Treatment +SCC,2650000004,NAICS_2012_Code,562920,,Waste Treatment +SCC,2650000005,NAICS_2012_Code,562920,,Waste Treatment +SCC,2660000000,NAICS_2012_Code,562219,,Waste Treatment +SCC,2670001000,NAICS_2012_Code,562211,,Waste Treatment +SCC,2670002000,NAICS_2012_Code,562211,,Waste Treatment +SCC,2670003000,NAICS_2012_Code,562211,,Waste Treatment +SCC,2680001000,NAICS_2012_Code,562219,,Waste Treatment +SCC,2680002000,NAICS_2012_Code,562219,,Waste Treatment +SCC,2680003000,NAICS_2012_Code,562219,,Waste Treatment +SCC,2680003010,NAICS_2012_Code,562219,,Waste Treatment +SCC,2461800001,NAICS_2012_Code,111,,Pesticides +SCC,2461800002,NAICS_2012_Code,111,,Pesticides +SCC,2461850000,NAICS_2012_Code,111,,Pesticides +SCC,2201000062,NAICS_2012_Code,4471,,Highway Vehicles +SCC,2201110080,NAICS_2012_Code,F01000,,Highway Vehicles +SCC,2201210080,NAICS_2012_Code,F01000,,Highway Vehicles +SCC,2201310080,NAICS_2012_Code,F01000,,Highway Vehicles +SCC,2201320080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2201410080,NAICS_2012_Code,485210,,Highway Vehicles +SCC,2201420080,NAICS_2012_Code,485113,,Highway Vehicles +SCC,2201430080,NAICS_2012_Code,485410,,Highway Vehicles +SCC,2201510080,NAICS_2012_Code,562111,,Highway Vehicles +SCC,2201520080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2201530080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2201540080,NAICS_2012_Code,F01000,,Highway Vehicles +SCC,2201610080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2201620080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2202000062,NAICS_2012_Code,4471,,Highway Vehicles +SCC,2202110080,NAICS_2012_Code,F01000,,Highway Vehicles +SCC,2202210080,NAICS_2012_Code,F01000,,Highway Vehicles +SCC,2202310080,NAICS_2012_Code,F01000,,Highway Vehicles +SCC,2202320080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2202410080,NAICS_2012_Code,485210,,Highway Vehicles +SCC,2202420080,NAICS_2012_Code,485113,,Highway Vehicles +SCC,2202430080,NAICS_2012_Code,485410,,Highway Vehicles +SCC,2202510080,NAICS_2012_Code,562111,,Highway Vehicles +SCC,2202520080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2202530080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2202540080,NAICS_2012_Code,F01000,,Highway Vehicles +SCC,2202610080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2202620080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2203000062,NAICS_2012_Code,4471,,Highway Vehicles +SCC,2203110080,NAICS_2012_Code,F01000,,Highway Vehicles +SCC,2203210080,NAICS_2012_Code,F01000,,Highway Vehicles +SCC,2203310080,NAICS_2012_Code,F01000,,Highway Vehicles +SCC,2203320080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2203410080,NAICS_2012_Code,485210,,Highway Vehicles +SCC,2203420080,NAICS_2012_Code,485113,,Highway Vehicles +SCC,2203430080,NAICS_2012_Code,485410,,Highway Vehicles +SCC,2203510080,NAICS_2012_Code,562111,,Highway Vehicles +SCC,2203520080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2203530080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2203540080,NAICS_2012_Code,F01000,,Highway Vehicles +SCC,2203610080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2203620080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2204000062,NAICS_2012_Code,4471,,Highway Vehicles +SCC,2204110080,NAICS_2012_Code,F01000,,Highway Vehicles +SCC,2204210080,NAICS_2012_Code,F01000,,Highway Vehicles +SCC,2204310080,NAICS_2012_Code,F01000,,Highway Vehicles +SCC,2204320080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2204410080,NAICS_2012_Code,485210,,Highway Vehicles +SCC,2204420080,NAICS_2012_Code,485113,,Highway Vehicles +SCC,2204430080,NAICS_2012_Code,485410,,Highway Vehicles +SCC,2204510080,NAICS_2012_Code,562111,,Highway Vehicles +SCC,2204520080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2204530080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2204540080,NAICS_2012_Code,F01000,,Highway Vehicles +SCC,2204610080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2204620080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2205000062,NAICS_2012_Code,4471,,Highway Vehicles +SCC,2205110080,NAICS_2012_Code,F01000,,Highway Vehicles +SCC,2205210080,NAICS_2012_Code,F01000,,Highway Vehicles +SCC,2205310080,NAICS_2012_Code,F01000,,Highway Vehicles +SCC,2205320080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2205410080,NAICS_2012_Code,485210,,Highway Vehicles +SCC,2205420080,NAICS_2012_Code,485113,,Highway Vehicles +SCC,2205430080,NAICS_2012_Code,485410,,Highway Vehicles +SCC,2205510080,NAICS_2012_Code,562111,,Highway Vehicles +SCC,2205520080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2205530080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2205540080,NAICS_2012_Code,F01000,,Highway Vehicles +SCC,2205610080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2205620080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2209000062,NAICS_2012_Code,4471,,Highway Vehicles +SCC,2209110080,NAICS_2012_Code,F01000,,Highway Vehicles +SCC,2209210080,NAICS_2012_Code,F01000,,Highway Vehicles +SCC,2209310080,NAICS_2012_Code,F01000,,Highway Vehicles +SCC,2209320080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2209410080,NAICS_2012_Code,485210,,Highway Vehicles +SCC,2209420080,NAICS_2012_Code,485113,,Highway Vehicles +SCC,2209430080,NAICS_2012_Code,485410,,Highway Vehicles +SCC,2209510080,NAICS_2012_Code,562111,,Highway Vehicles +SCC,2209520080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2209530080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2209540080,NAICS_2012_Code,F01000,,Highway Vehicles +SCC,2209610080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2209620080,NAICS_2012_Code,484,,Highway Vehicles +SCC,2260001020,NAICS_2012_Code,F01000,,"Residential (Recreational equipment, lawn and garden)" +SCC,2260001022,NAICS_2012_Code,F01000,,"Residential (Recreational equipment, lawn and garden)" +SCC,2260001060,NAICS_2012_Code,F01000,,"Residential (Recreational equipment, lawn and garden)" +SCC,2260002022,NAICS_2012_Code,23,,Construction equipment +SCC,2260003022,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2260003022,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2260003022,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2260004020,NAICS_2012_Code,F01000,,"Residential (Recreational equipment, lawn and garden)" +SCC,2260004021,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2260004022,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2260004033,NAICS_2012_Code,F01000,,"Residential (Recreational equipment, lawn and garden)" +SCC,2260004035,NAICS_2012_Code,F01000,,"Residential (Recreational equipment, lawn and garden)" +SCC,2260004036,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2260004044,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2260005022,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2260005022,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2260007022,NAICS_2012_Code,113,,Logging equipment +SCC,2265001022,NAICS_2012_Code,F01000,,"Residential (Recreational equipment, lawn and garden)" +SCC,2265001050,NAICS_2012_Code,F01000,,"Residential (Recreational equipment, lawn and garden)" +SCC,2265001060,NAICS_2012_Code,F01000,,"Residential (Recreational equipment, lawn and garden)" +SCC,2265002022,NAICS_2012_Code,23,,Construction equipment +SCC,2265003022,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2265003022,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2265003022,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2265003060,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2265003060,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2265003060,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2265004022,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2265004033,NAICS_2012_Code,F01000,,"Residential (Recreational equipment, lawn and garden)" +SCC,2265004035,NAICS_2012_Code,F01000,,"Residential (Recreational equipment, lawn and garden)" +SCC,2265004036,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2265004044,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2265005022,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2265005022,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2265007022,NAICS_2012_Code,113,,Logging equipment +SCC,2265010010,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2265010010,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2265010010,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2267001060,NAICS_2012_Code,F01000,,"Residential (Recreational equipment, lawn and garden)" +SCC,2267002022,NAICS_2012_Code,23,,Construction equipment +SCC,2267003022,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2267003022,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2267003022,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2267004022,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2267004033,NAICS_2012_Code,F01000,,"Residential (Recreational equipment, lawn and garden)" +SCC,2267004044,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2267005022,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2267005022,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2267007022,NAICS_2012_Code,113,,Logging equipment +SCC,2268002022,NAICS_2012_Code,23,,Construction equipment +SCC,2268003022,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2268003022,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2268003022,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2268003060,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2268003060,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2268003060,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2268004022,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2268004033,NAICS_2012_Code,F01000,,"Residential (Recreational equipment, lawn and garden)" +SCC,2268004044,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2268005022,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2268005022,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2268007022,NAICS_2012_Code,113,,Logging equipment +SCC,2268010010,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2268010010,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2268010010,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2270001060,NAICS_2012_Code,F01000,,"Residential (Recreational equipment, lawn and garden)" +SCC,2270002022,NAICS_2012_Code,23,,Construction equipment +SCC,2270003022,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2270003022,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2270003022,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2270003060,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2270003060,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2270003060,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2270004022,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2270004033,NAICS_2012_Code,F01000,,"Residential (Recreational equipment, lawn and garden)" +SCC,2270004036,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2270004044,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2270005022,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2270005022,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2270007022,NAICS_2012_Code,113,,Logging equipment +SCC,2270009010,NAICS_2012_Code,212,,Mining equipment +SCC,2270010010,NAICS_2012_Code,211111,,Oil and Gas +SCC,2282005022,NAICS_2012_Code,F01000,,"Residential (Recreational equipment, lawn and garden)" +SCC,2282010005,NAICS_2012_Code,F01000,,"Residential (Recreational equipment, lawn and garden)" +SCC,2282020022,NAICS_2012_Code,F01000,,"Residential (Recreational equipment, lawn and garden)" +SCC,2285002015,NAICS_2012_Code,4821,,Railroad maintenance +SCC,2285004015,NAICS_2012_Code,4821,,Railroad maintenance +SCC,2285006015,NAICS_2012_Code,4821,,Railroad maintenance +SCC,2260006022,NAICS_2012_Code,42,,Commercial Equipment +SCC,2265006022,NAICS_2012_Code,42,,Commercial Equipment +SCC,2267006022,NAICS_2012_Code,42,,Commercial Equipment +SCC,2268006022,NAICS_2012_Code,42,,Commercial Equipment +SCC,2270006022,NAICS_2012_Code,42,,Commercial Equipment +SCC,2260006022,NAICS_2012_Code,44,,Commercial Equipment +SCC,2265006022,NAICS_2012_Code,44,,Commercial Equipment +SCC,2267006022,NAICS_2012_Code,44,,Commercial Equipment +SCC,2268006022,NAICS_2012_Code,44,,Commercial Equipment +SCC,2270006022,NAICS_2012_Code,44,,Commercial Equipment +SCC,2260006022,NAICS_2012_Code,45,,Commercial Equipment +SCC,2265006022,NAICS_2012_Code,45,,Commercial Equipment +SCC,2267006022,NAICS_2012_Code,45,,Commercial Equipment +SCC,2268006022,NAICS_2012_Code,45,,Commercial Equipment +SCC,2270006022,NAICS_2012_Code,45,,Commercial Equipment +SCC,2260006022,NAICS_2012_Code,493,,Commercial Equipment +SCC,2265006022,NAICS_2012_Code,493,,Commercial Equipment +SCC,2267006022,NAICS_2012_Code,493,,Commercial Equipment +SCC,2268006022,NAICS_2012_Code,493,,Commercial Equipment +SCC,2270006022,NAICS_2012_Code,493,,Commercial Equipment +SCC,2260006022,NAICS_2012_Code,51,,Commercial Equipment +SCC,2265006022,NAICS_2012_Code,51,,Commercial Equipment +SCC,2267006022,NAICS_2012_Code,51,,Commercial Equipment +SCC,2268006022,NAICS_2012_Code,51,,Commercial Equipment +SCC,2270006022,NAICS_2012_Code,51,,Commercial Equipment +SCC,2260006022,NAICS_2012_Code,52,,Commercial Equipment +SCC,2265006022,NAICS_2012_Code,52,,Commercial Equipment +SCC,2267006022,NAICS_2012_Code,52,,Commercial Equipment +SCC,2268006022,NAICS_2012_Code,52,,Commercial Equipment +SCC,2270006022,NAICS_2012_Code,52,,Commercial Equipment +SCC,2260006022,NAICS_2012_Code,53,,Commercial Equipment +SCC,2265006022,NAICS_2012_Code,53,,Commercial Equipment +SCC,2267006022,NAICS_2012_Code,53,,Commercial Equipment +SCC,2268006022,NAICS_2012_Code,53,,Commercial Equipment +SCC,2270006022,NAICS_2012_Code,53,,Commercial Equipment +SCC,2260006022,NAICS_2012_Code,54,,Commercial Equipment +SCC,2265006022,NAICS_2012_Code,54,,Commercial Equipment +SCC,2267006022,NAICS_2012_Code,54,,Commercial Equipment +SCC,2268006022,NAICS_2012_Code,54,,Commercial Equipment +SCC,2270006022,NAICS_2012_Code,54,,Commercial Equipment +SCC,2260006022,NAICS_2012_Code,55,,Commercial Equipment +SCC,2265006022,NAICS_2012_Code,55,,Commercial Equipment +SCC,2267006022,NAICS_2012_Code,55,,Commercial Equipment +SCC,2268006022,NAICS_2012_Code,55,,Commercial Equipment +SCC,2270006022,NAICS_2012_Code,55,,Commercial Equipment +SCC,2260006022,NAICS_2012_Code,56,,Commercial Equipment +SCC,2265006022,NAICS_2012_Code,56,,Commercial Equipment +SCC,2267006022,NAICS_2012_Code,56,,Commercial Equipment +SCC,2268006022,NAICS_2012_Code,56,,Commercial Equipment +SCC,2270006022,NAICS_2012_Code,56,,Commercial Equipment +SCC,2260006022,NAICS_2012_Code,61,,Commercial Equipment +SCC,2265006022,NAICS_2012_Code,61,,Commercial Equipment +SCC,2267006022,NAICS_2012_Code,61,,Commercial Equipment +SCC,2268006022,NAICS_2012_Code,61,,Commercial Equipment +SCC,2270006022,NAICS_2012_Code,61,,Commercial Equipment +SCC,2260006022,NAICS_2012_Code,62,,Commercial Equipment +SCC,2265006022,NAICS_2012_Code,62,,Commercial Equipment +SCC,2267006022,NAICS_2012_Code,62,,Commercial Equipment +SCC,2268006022,NAICS_2012_Code,62,,Commercial Equipment +SCC,2270006022,NAICS_2012_Code,62,,Commercial Equipment +SCC,2260006022,NAICS_2012_Code,71,,Commercial Equipment +SCC,2265006022,NAICS_2012_Code,71,,Commercial Equipment +SCC,2267006022,NAICS_2012_Code,71,,Commercial Equipment +SCC,2268006022,NAICS_2012_Code,71,,Commercial Equipment +SCC,2270006022,NAICS_2012_Code,71,,Commercial Equipment +SCC,2260006022,NAICS_2012_Code,72,,Commercial Equipment +SCC,2265006022,NAICS_2012_Code,72,,Commercial Equipment +SCC,2267006022,NAICS_2012_Code,72,,Commercial Equipment +SCC,2268006022,NAICS_2012_Code,72,,Commercial Equipment +SCC,2270006022,NAICS_2012_Code,72,,Commercial Equipment +SCC,2260006022,NAICS_2012_Code,81,,Commercial Equipment +SCC,2265006022,NAICS_2012_Code,81,,Commercial Equipment +SCC,2267006022,NAICS_2012_Code,81,,Commercial Equipment +SCC,2268006022,NAICS_2012_Code,81,,Commercial Equipment +SCC,2270006022,NAICS_2012_Code,81,,Commercial Equipment +SCC,2260005022,NAICS_2012_Code,115,,Agricultural off-highway vehicles +SCC,2265005022,NAICS_2012_Code,115,,Agricultural off-highway vehicles +SCC,2267005022,NAICS_2012_Code,115,,Agricultural off-highway vehicles +SCC,2268005022,NAICS_2012_Code,115,,Agricultural off-highway vehicles +SCC,2270005022,NAICS_2012_Code,115,,Agricultural off-highway vehicles +SCC,2260006022,NAICS_2012_Code,92,,Commercial Equipment +SCC,2265006022,NAICS_2012_Code,92,,Commercial Equipment +SCC,2267006022,NAICS_2012_Code,92,,Commercial Equipment +SCC,2268006022,NAICS_2012_Code,92,,Commercial Equipment +SCC,2270006022,NAICS_2012_Code,92,,Commercial Equipment +SCC,2260004016,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2260004026,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2260004031,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2260004071,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2265004011,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2265004016,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2265004026,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2265004031,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2265004041,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2265004046,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2265004051,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2265004056,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2265004066,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2265004071,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2265004076,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2267004066,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2270004031,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2270004046,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2270004056,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2270004066,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2270004071,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2270004076,NAICS_2012_Code,561730,,Lawn and Garden Equipment +SCC,2260001010,NAICS_2012_Code,F01000,,"Recreational equipment, lawn and garden" +SCC,2260001030,NAICS_2012_Code,F01000,,"Recreational equipment, lawn and garden" +SCC,2260004015,NAICS_2012_Code,F01000,,"Recreational equipment, lawn and garden" +SCC,2260004025,NAICS_2012_Code,F01000,,"Recreational equipment, lawn and garden" +SCC,2260004030,NAICS_2012_Code,F01000,,"Recreational equipment, lawn and garden" +SCC,2265001010,NAICS_2012_Code,F01000,,"Recreational equipment, lawn and garden" +SCC,2265001030,NAICS_2012_Code,F01000,,"Recreational equipment, lawn and garden" +SCC,2265004010,NAICS_2012_Code,F01000,,"Recreational equipment, lawn and garden" +SCC,2265004015,NAICS_2012_Code,F01000,,"Recreational equipment, lawn and garden" +SCC,2265004025,NAICS_2012_Code,F01000,,"Recreational equipment, lawn and garden" +SCC,2265004030,NAICS_2012_Code,F01000,,"Recreational equipment, lawn and garden" +SCC,2265004040,NAICS_2012_Code,F01000,,"Recreational equipment, lawn and garden" +SCC,2265004055,NAICS_2012_Code,F01000,,"Recreational equipment, lawn and garden" +SCC,2265004075,NAICS_2012_Code,F01000,,"Recreational equipment, lawn and garden" +SCC,2282005010,NAICS_2012_Code,F01000,,"Recreational equipment, lawn and garden" +SCC,2282005015,NAICS_2012_Code,F01000,,"Recreational equipment, lawn and garden" +SCC,2282020005,NAICS_2012_Code,F01000,,"Recreational equipment, lawn and garden" +SCC,2282020010,NAICS_2012_Code,F01000,,"Recreational equipment, lawn and garden" +SCC,2265004050,NAICS_2012_Code,F01000,,"Recreational equipment, lawn and garden" +SCC,2260005035,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2260005035,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2260005035,NAICS_2012_Code,113,,Agricultural off-highway vehicles +SCC,2265005010,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2265005010,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2265005010,NAICS_2012_Code,113,,Agricultural off-highway vehicles +SCC,2265005015,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2265005015,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2265005015,NAICS_2012_Code,113,,Agricultural off-highway vehicles +SCC,2265005020,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2265005020,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2265005020,NAICS_2012_Code,113,,Agricultural off-highway vehicles +SCC,2265005025,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2265005025,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2265005025,NAICS_2012_Code,113,,Agricultural off-highway vehicles +SCC,2265005030,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2265005030,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2265005030,NAICS_2012_Code,113,,Agricultural off-highway vehicles +SCC,2265005035,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2265005035,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2265005035,NAICS_2012_Code,113,,Agricultural off-highway vehicles +SCC,2265005040,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2265005040,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2265005040,NAICS_2012_Code,113,,Agricultural off-highway vehicles +SCC,2265005045,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2265005045,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2265005045,NAICS_2012_Code,113,,Agricultural off-highway vehicles +SCC,2265005055,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2265005055,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2265005055,NAICS_2012_Code,113,,Agricultural off-highway vehicles +SCC,2265005060,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2265005060,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2265005060,NAICS_2012_Code,113,,Agricultural off-highway vehicles +SCC,2267005055,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2267005055,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2267005055,NAICS_2012_Code,113,,Agricultural off-highway vehicles +SCC,2267005060,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2267005060,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2267005060,NAICS_2012_Code,113,,Agricultural off-highway vehicles +SCC,2268005055,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2268005055,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2268005055,NAICS_2012_Code,113,,Agricultural off-highway vehicles +SCC,2268005060,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2268005060,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2268005060,NAICS_2012_Code,113,,Agricultural off-highway vehicles +SCC,2270005010,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2270005010,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2270005010,NAICS_2012_Code,113,,Agricultural off-highway vehicles +SCC,2270005015,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2270005015,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2270005015,NAICS_2012_Code,113,,Agricultural off-highway vehicles +SCC,2270005020,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2270005020,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2270005020,NAICS_2012_Code,113,,Agricultural off-highway vehicles +SCC,2270005025,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2270005025,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2270005025,NAICS_2012_Code,113,,Agricultural off-highway vehicles +SCC,2270005030,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2270005030,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2270005030,NAICS_2012_Code,113,,Agricultural off-highway vehicles +SCC,2270005035,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2270005035,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2270005035,NAICS_2012_Code,113,,Agricultural off-highway vehicles +SCC,2270005040,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2270005040,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2270005040,NAICS_2012_Code,113,,Agricultural off-highway vehicles +SCC,2270005045,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2270005045,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2270005045,NAICS_2012_Code,113,,Agricultural off-highway vehicles +SCC,2270005055,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2270005055,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2270005055,NAICS_2012_Code,113,,Agricultural off-highway vehicles +SCC,2270005060,NAICS_2012_Code,111,,Agricultural off-highway vehicles +SCC,2270005060,NAICS_2012_Code,112,,Agricultural off-highway vehicles +SCC,2270005060,NAICS_2012_Code,113,,Agricultural off-highway vehicles +SCC,2260003030,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2260003030,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2260003030,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2260003040,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2260003040,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2260003040,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2265003010,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2265003010,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2265003010,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2265003020,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2265003020,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2265003020,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2265003030,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2265003030,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2265003030,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2265003040,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2265003040,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2265003040,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2265003050,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2265003050,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2265003050,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2265003070,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2265003070,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2265003070,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2267003010,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2267003010,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2267003010,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2267003020,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2267003020,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2267003020,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2267003030,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2267003030,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2267003030,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2267003040,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2267003040,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2267003040,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2267003050,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2267003050,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2267003050,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2267003070,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2267003070,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2267003070,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2268003020,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2268003020,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2268003020,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2268003030,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2268003030,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2268003030,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2268003040,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2268003040,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2268003040,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2268003070,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2268003070,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2268003070,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2270003010,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2270003010,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2270003010,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2270003020,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2270003020,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2270003020,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2270003030,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2270003030,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2270003030,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2270003040,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2270003040,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2270003040,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2270003050,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2270003050,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2270003050,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2270003070,NAICS_2012_Code,31,,Industrial off-highway vehicles +SCC,2270003070,NAICS_2012_Code,32,,Industrial off-highway vehicles +SCC,2270003070,NAICS_2012_Code,33,,Industrial off-highway vehicles +SCC,2260007005,NAICS_2012_Code,113,,Logging equipment +SCC,2265007010,NAICS_2012_Code,113,,Logging equipment +SCC,2265007015,NAICS_2012_Code,113,,Logging equipment +SCC,2270007015,NAICS_2012_Code,113,,Logging equipment +SCC,2270007010,NAICS_2012_Code,113,,Logging equipment +SCC,2260002006,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2260002006,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2260002009,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2260002009,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2260002021,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2260002021,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2260002027,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2260002027,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2260002039,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2260002039,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2260002054,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2260002054,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2265002003,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2265002003,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2265002006,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2265002006,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2265002009,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2265002009,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2265002015,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2265002015,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2265002021,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2265002021,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2265002024,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2265002024,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2265002027,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2265002027,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2265002030,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2265002030,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2265002033,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2265002033,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2265002039,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2265002039,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2265002042,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2265002042,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2265002045,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2265002045,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2265002054,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2265002054,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2265002057,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2265002057,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2265002060,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2265002060,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2265002066,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2265002066,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2265002072,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2265002072,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2265002078,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2265002078,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2265002081,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2265002081,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2267002003,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2267002003,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2267002015,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2267002015,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2267002021,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2267002021,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2267002024,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2267002024,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2267002030,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2267002030,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2267002033,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2267002033,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2267002039,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2267002039,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2267002045,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2267002045,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2267002054,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2267002054,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2267002057,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2267002057,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2267002060,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2267002060,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2267002066,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2267002066,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2267002072,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2267002072,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2267002081,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2267002081,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2268002081,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2268002081,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2270002003,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2270002003,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2270002006,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2270002006,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2270002009,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2270002009,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2270002015,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2270002015,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2270002018,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2270002018,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2270002021,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2270002021,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2270002024,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2270002024,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2270002027,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2270002027,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2270002030,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2270002030,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2270002033,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2270002033,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2270002036,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2270002036,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2270002039,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2270002039,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2270002042,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2270002042,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2270002045,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2270002045,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2270002048,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2270002048,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2270002051,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2270002051,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2270002054,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2270002054,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2270002057,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2270002057,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2270002060,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2270002060,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2270002066,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2270002066,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2270002069,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2270002069,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2270002072,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2270002072,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2270002075,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2270002075,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2270002078,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2270002078,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2270002081,NAICS_2012_Code,23,,Construction and mining equipment +SCC,2270002081,NAICS_2012_Code,212,,Construction and mining equipment +SCC,2260006005,NAICS_2012_Code,42,,Commercial Equipment +SCC,2260006005,NAICS_2012_Code,44,,Commercial Equipment +SCC,2260006005,NAICS_2012_Code,45,,Commercial Equipment +SCC,2260006005,NAICS_2012_Code,51,,Commercial Equipment +SCC,2260006005,NAICS_2012_Code,52,,Commercial Equipment +SCC,2260006005,NAICS_2012_Code,53,,Commercial Equipment +SCC,2260006005,NAICS_2012_Code,54,,Commercial Equipment +SCC,2260006005,NAICS_2012_Code,55,,Commercial Equipment +SCC,2260006005,NAICS_2012_Code,56,,Commercial Equipment +SCC,2260006005,NAICS_2012_Code,61,,Commercial Equipment +SCC,2260006005,NAICS_2012_Code,62,,Commercial Equipment +SCC,2260006005,NAICS_2012_Code,71,,Commercial Equipment +SCC,2260006005,NAICS_2012_Code,72,,Commercial Equipment +SCC,2260006005,NAICS_2012_Code,81,,Commercial Equipment +SCC,2260006005,NAICS_2012_Code,92,,Commercial Equipment +SCC,2260006005,NAICS_2012_Code,493,,Commercial Equipment +SCC,2260006010,NAICS_2012_Code,42,,Commercial Equipment +SCC,2260006010,NAICS_2012_Code,44,,Commercial Equipment +SCC,2260006010,NAICS_2012_Code,45,,Commercial Equipment +SCC,2260006010,NAICS_2012_Code,51,,Commercial Equipment +SCC,2260006010,NAICS_2012_Code,52,,Commercial Equipment +SCC,2260006010,NAICS_2012_Code,53,,Commercial Equipment +SCC,2260006010,NAICS_2012_Code,54,,Commercial Equipment +SCC,2260006010,NAICS_2012_Code,55,,Commercial Equipment +SCC,2260006010,NAICS_2012_Code,56,,Commercial Equipment +SCC,2260006010,NAICS_2012_Code,61,,Commercial Equipment +SCC,2260006010,NAICS_2012_Code,62,,Commercial Equipment +SCC,2260006010,NAICS_2012_Code,71,,Commercial Equipment +SCC,2260006010,NAICS_2012_Code,72,,Commercial Equipment +SCC,2260006010,NAICS_2012_Code,81,,Commercial Equipment +SCC,2260006010,NAICS_2012_Code,92,,Commercial Equipment +SCC,2260006010,NAICS_2012_Code,493,,Commercial Equipment +SCC,2260006015,NAICS_2012_Code,42,,Commercial Equipment +SCC,2260006015,NAICS_2012_Code,44,,Commercial Equipment +SCC,2260006015,NAICS_2012_Code,45,,Commercial Equipment +SCC,2260006015,NAICS_2012_Code,51,,Commercial Equipment +SCC,2260006015,NAICS_2012_Code,52,,Commercial Equipment +SCC,2260006015,NAICS_2012_Code,53,,Commercial Equipment +SCC,2260006015,NAICS_2012_Code,54,,Commercial Equipment +SCC,2260006015,NAICS_2012_Code,55,,Commercial Equipment +SCC,2260006015,NAICS_2012_Code,56,,Commercial Equipment +SCC,2260006015,NAICS_2012_Code,61,,Commercial Equipment +SCC,2260006015,NAICS_2012_Code,62,,Commercial Equipment +SCC,2260006015,NAICS_2012_Code,71,,Commercial Equipment +SCC,2260006015,NAICS_2012_Code,72,,Commercial Equipment +SCC,2260006015,NAICS_2012_Code,81,,Commercial Equipment +SCC,2260006015,NAICS_2012_Code,92,,Commercial Equipment +SCC,2260006015,NAICS_2012_Code,493,,Commercial Equipment +SCC,2260006035,NAICS_2012_Code,42,,Commercial Equipment +SCC,2260006035,NAICS_2012_Code,44,,Commercial Equipment +SCC,2260006035,NAICS_2012_Code,45,,Commercial Equipment +SCC,2260006035,NAICS_2012_Code,51,,Commercial Equipment +SCC,2260006035,NAICS_2012_Code,52,,Commercial Equipment +SCC,2260006035,NAICS_2012_Code,53,,Commercial Equipment +SCC,2260006035,NAICS_2012_Code,54,,Commercial Equipment +SCC,2260006035,NAICS_2012_Code,55,,Commercial Equipment +SCC,2260006035,NAICS_2012_Code,56,,Commercial Equipment +SCC,2260006035,NAICS_2012_Code,61,,Commercial Equipment +SCC,2260006035,NAICS_2012_Code,62,,Commercial Equipment +SCC,2260006035,NAICS_2012_Code,71,,Commercial Equipment +SCC,2260006035,NAICS_2012_Code,72,,Commercial Equipment +SCC,2260006035,NAICS_2012_Code,81,,Commercial Equipment +SCC,2260006035,NAICS_2012_Code,92,,Commercial Equipment +SCC,2260006035,NAICS_2012_Code,493,,Commercial Equipment +SCC,2265006005,NAICS_2012_Code,42,,Commercial Equipment +SCC,2265006005,NAICS_2012_Code,44,,Commercial Equipment +SCC,2265006005,NAICS_2012_Code,45,,Commercial Equipment +SCC,2265006005,NAICS_2012_Code,51,,Commercial Equipment +SCC,2265006005,NAICS_2012_Code,52,,Commercial Equipment +SCC,2265006005,NAICS_2012_Code,53,,Commercial Equipment +SCC,2265006005,NAICS_2012_Code,54,,Commercial Equipment +SCC,2265006005,NAICS_2012_Code,55,,Commercial Equipment +SCC,2265006005,NAICS_2012_Code,56,,Commercial Equipment +SCC,2265006005,NAICS_2012_Code,61,,Commercial Equipment +SCC,2265006005,NAICS_2012_Code,62,,Commercial Equipment +SCC,2265006005,NAICS_2012_Code,71,,Commercial Equipment +SCC,2265006005,NAICS_2012_Code,72,,Commercial Equipment +SCC,2265006005,NAICS_2012_Code,81,,Commercial Equipment +SCC,2265006005,NAICS_2012_Code,92,,Commercial Equipment +SCC,2265006005,NAICS_2012_Code,493,,Commercial Equipment +SCC,2265006010,NAICS_2012_Code,42,,Commercial Equipment +SCC,2265006010,NAICS_2012_Code,44,,Commercial Equipment +SCC,2265006010,NAICS_2012_Code,45,,Commercial Equipment +SCC,2265006010,NAICS_2012_Code,51,,Commercial Equipment +SCC,2265006010,NAICS_2012_Code,52,,Commercial Equipment +SCC,2265006010,NAICS_2012_Code,53,,Commercial Equipment +SCC,2265006010,NAICS_2012_Code,54,,Commercial Equipment +SCC,2265006010,NAICS_2012_Code,55,,Commercial Equipment +SCC,2265006010,NAICS_2012_Code,56,,Commercial Equipment +SCC,2265006010,NAICS_2012_Code,61,,Commercial Equipment +SCC,2265006010,NAICS_2012_Code,62,,Commercial Equipment +SCC,2265006010,NAICS_2012_Code,71,,Commercial Equipment +SCC,2265006010,NAICS_2012_Code,72,,Commercial Equipment +SCC,2265006010,NAICS_2012_Code,81,,Commercial Equipment +SCC,2265006010,NAICS_2012_Code,92,,Commercial Equipment +SCC,2265006010,NAICS_2012_Code,493,,Commercial Equipment +SCC,2265006015,NAICS_2012_Code,42,,Commercial Equipment +SCC,2265006015,NAICS_2012_Code,44,,Commercial Equipment +SCC,2265006015,NAICS_2012_Code,45,,Commercial Equipment +SCC,2265006015,NAICS_2012_Code,51,,Commercial Equipment +SCC,2265006015,NAICS_2012_Code,52,,Commercial Equipment +SCC,2265006015,NAICS_2012_Code,53,,Commercial Equipment +SCC,2265006015,NAICS_2012_Code,54,,Commercial Equipment +SCC,2265006015,NAICS_2012_Code,55,,Commercial Equipment +SCC,2265006015,NAICS_2012_Code,56,,Commercial Equipment +SCC,2265006015,NAICS_2012_Code,61,,Commercial Equipment +SCC,2265006015,NAICS_2012_Code,62,,Commercial Equipment +SCC,2265006015,NAICS_2012_Code,71,,Commercial Equipment +SCC,2265006015,NAICS_2012_Code,72,,Commercial Equipment +SCC,2265006015,NAICS_2012_Code,81,,Commercial Equipment +SCC,2265006015,NAICS_2012_Code,92,,Commercial Equipment +SCC,2265006015,NAICS_2012_Code,493,,Commercial Equipment +SCC,2265006025,NAICS_2012_Code,42,,Commercial Equipment +SCC,2265006025,NAICS_2012_Code,44,,Commercial Equipment +SCC,2265006025,NAICS_2012_Code,45,,Commercial Equipment +SCC,2265006025,NAICS_2012_Code,51,,Commercial Equipment +SCC,2265006025,NAICS_2012_Code,52,,Commercial Equipment +SCC,2265006025,NAICS_2012_Code,53,,Commercial Equipment +SCC,2265006025,NAICS_2012_Code,54,,Commercial Equipment +SCC,2265006025,NAICS_2012_Code,55,,Commercial Equipment +SCC,2265006025,NAICS_2012_Code,56,,Commercial Equipment +SCC,2265006025,NAICS_2012_Code,61,,Commercial Equipment +SCC,2265006025,NAICS_2012_Code,62,,Commercial Equipment +SCC,2265006025,NAICS_2012_Code,71,,Commercial Equipment +SCC,2265006025,NAICS_2012_Code,72,,Commercial Equipment +SCC,2265006025,NAICS_2012_Code,81,,Commercial Equipment +SCC,2265006025,NAICS_2012_Code,92,,Commercial Equipment +SCC,2265006025,NAICS_2012_Code,493,,Commercial Equipment +SCC,2265006030,NAICS_2012_Code,42,,Commercial Equipment +SCC,2265006030,NAICS_2012_Code,44,,Commercial Equipment +SCC,2265006030,NAICS_2012_Code,45,,Commercial Equipment +SCC,2265006030,NAICS_2012_Code,51,,Commercial Equipment +SCC,2265006030,NAICS_2012_Code,52,,Commercial Equipment +SCC,2265006030,NAICS_2012_Code,53,,Commercial Equipment +SCC,2265006030,NAICS_2012_Code,54,,Commercial Equipment +SCC,2265006030,NAICS_2012_Code,55,,Commercial Equipment +SCC,2265006030,NAICS_2012_Code,56,,Commercial Equipment +SCC,2265006030,NAICS_2012_Code,61,,Commercial Equipment +SCC,2265006030,NAICS_2012_Code,62,,Commercial Equipment +SCC,2265006030,NAICS_2012_Code,71,,Commercial Equipment +SCC,2265006030,NAICS_2012_Code,72,,Commercial Equipment +SCC,2265006030,NAICS_2012_Code,81,,Commercial Equipment +SCC,2265006030,NAICS_2012_Code,92,,Commercial Equipment +SCC,2265006030,NAICS_2012_Code,493,,Commercial Equipment +SCC,2265006035,NAICS_2012_Code,42,,Commercial Equipment +SCC,2265006035,NAICS_2012_Code,44,,Commercial Equipment +SCC,2265006035,NAICS_2012_Code,45,,Commercial Equipment +SCC,2265006035,NAICS_2012_Code,51,,Commercial Equipment +SCC,2265006035,NAICS_2012_Code,52,,Commercial Equipment +SCC,2265006035,NAICS_2012_Code,53,,Commercial Equipment +SCC,2265006035,NAICS_2012_Code,54,,Commercial Equipment +SCC,2265006035,NAICS_2012_Code,55,,Commercial Equipment +SCC,2265006035,NAICS_2012_Code,56,,Commercial Equipment +SCC,2265006035,NAICS_2012_Code,61,,Commercial Equipment +SCC,2265006035,NAICS_2012_Code,62,,Commercial Equipment +SCC,2265006035,NAICS_2012_Code,71,,Commercial Equipment +SCC,2265006035,NAICS_2012_Code,72,,Commercial Equipment +SCC,2265006035,NAICS_2012_Code,81,,Commercial Equipment +SCC,2265006035,NAICS_2012_Code,92,,Commercial Equipment +SCC,2265006035,NAICS_2012_Code,493,,Commercial Equipment +SCC,2267006005,NAICS_2012_Code,42,,Commercial Equipment +SCC,2267006005,NAICS_2012_Code,44,,Commercial Equipment +SCC,2267006005,NAICS_2012_Code,45,,Commercial Equipment +SCC,2267006005,NAICS_2012_Code,51,,Commercial Equipment +SCC,2267006005,NAICS_2012_Code,52,,Commercial Equipment +SCC,2267006005,NAICS_2012_Code,53,,Commercial Equipment +SCC,2267006005,NAICS_2012_Code,54,,Commercial Equipment +SCC,2267006005,NAICS_2012_Code,55,,Commercial Equipment +SCC,2267006005,NAICS_2012_Code,56,,Commercial Equipment +SCC,2267006005,NAICS_2012_Code,61,,Commercial Equipment +SCC,2267006005,NAICS_2012_Code,62,,Commercial Equipment +SCC,2267006005,NAICS_2012_Code,71,,Commercial Equipment +SCC,2267006005,NAICS_2012_Code,72,,Commercial Equipment +SCC,2267006005,NAICS_2012_Code,81,,Commercial Equipment +SCC,2267006005,NAICS_2012_Code,92,,Commercial Equipment +SCC,2267006005,NAICS_2012_Code,493,,Commercial Equipment +SCC,2267006010,NAICS_2012_Code,42,,Commercial Equipment +SCC,2267006010,NAICS_2012_Code,44,,Commercial Equipment +SCC,2267006010,NAICS_2012_Code,45,,Commercial Equipment +SCC,2267006010,NAICS_2012_Code,51,,Commercial Equipment +SCC,2267006010,NAICS_2012_Code,52,,Commercial Equipment +SCC,2267006010,NAICS_2012_Code,53,,Commercial Equipment +SCC,2267006010,NAICS_2012_Code,54,,Commercial Equipment +SCC,2267006010,NAICS_2012_Code,55,,Commercial Equipment +SCC,2267006010,NAICS_2012_Code,56,,Commercial Equipment +SCC,2267006010,NAICS_2012_Code,61,,Commercial Equipment +SCC,2267006010,NAICS_2012_Code,62,,Commercial Equipment +SCC,2267006010,NAICS_2012_Code,71,,Commercial Equipment +SCC,2267006010,NAICS_2012_Code,72,,Commercial Equipment +SCC,2267006010,NAICS_2012_Code,81,,Commercial Equipment +SCC,2267006010,NAICS_2012_Code,92,,Commercial Equipment +SCC,2267006010,NAICS_2012_Code,493,,Commercial Equipment +SCC,2267006015,NAICS_2012_Code,42,,Commercial Equipment +SCC,2267006015,NAICS_2012_Code,44,,Commercial Equipment +SCC,2267006015,NAICS_2012_Code,45,,Commercial Equipment +SCC,2267006015,NAICS_2012_Code,51,,Commercial Equipment +SCC,2267006015,NAICS_2012_Code,52,,Commercial Equipment +SCC,2267006015,NAICS_2012_Code,53,,Commercial Equipment +SCC,2267006015,NAICS_2012_Code,54,,Commercial Equipment +SCC,2267006015,NAICS_2012_Code,55,,Commercial Equipment +SCC,2267006015,NAICS_2012_Code,56,,Commercial Equipment +SCC,2267006015,NAICS_2012_Code,61,,Commercial Equipment +SCC,2267006015,NAICS_2012_Code,62,,Commercial Equipment +SCC,2267006015,NAICS_2012_Code,71,,Commercial Equipment +SCC,2267006015,NAICS_2012_Code,72,,Commercial Equipment +SCC,2267006015,NAICS_2012_Code,81,,Commercial Equipment +SCC,2267006015,NAICS_2012_Code,92,,Commercial Equipment +SCC,2267006015,NAICS_2012_Code,493,,Commercial Equipment +SCC,2267006025,NAICS_2012_Code,42,,Commercial Equipment +SCC,2267006025,NAICS_2012_Code,44,,Commercial Equipment +SCC,2267006025,NAICS_2012_Code,45,,Commercial Equipment +SCC,2267006025,NAICS_2012_Code,51,,Commercial Equipment +SCC,2267006025,NAICS_2012_Code,52,,Commercial Equipment +SCC,2267006025,NAICS_2012_Code,53,,Commercial Equipment +SCC,2267006025,NAICS_2012_Code,54,,Commercial Equipment +SCC,2267006025,NAICS_2012_Code,55,,Commercial Equipment +SCC,2267006025,NAICS_2012_Code,56,,Commercial Equipment +SCC,2267006025,NAICS_2012_Code,61,,Commercial Equipment +SCC,2267006025,NAICS_2012_Code,62,,Commercial Equipment +SCC,2267006025,NAICS_2012_Code,71,,Commercial Equipment +SCC,2267006025,NAICS_2012_Code,72,,Commercial Equipment +SCC,2267006025,NAICS_2012_Code,81,,Commercial Equipment +SCC,2267006025,NAICS_2012_Code,92,,Commercial Equipment +SCC,2267006025,NAICS_2012_Code,493,,Commercial Equipment +SCC,2267006030,NAICS_2012_Code,42,,Commercial Equipment +SCC,2267006030,NAICS_2012_Code,44,,Commercial Equipment +SCC,2267006030,NAICS_2012_Code,45,,Commercial Equipment +SCC,2267006030,NAICS_2012_Code,51,,Commercial Equipment +SCC,2267006030,NAICS_2012_Code,52,,Commercial Equipment +SCC,2267006030,NAICS_2012_Code,53,,Commercial Equipment +SCC,2267006030,NAICS_2012_Code,54,,Commercial Equipment +SCC,2267006030,NAICS_2012_Code,55,,Commercial Equipment +SCC,2267006030,NAICS_2012_Code,56,,Commercial Equipment +SCC,2267006030,NAICS_2012_Code,61,,Commercial Equipment +SCC,2267006030,NAICS_2012_Code,62,,Commercial Equipment +SCC,2267006030,NAICS_2012_Code,71,,Commercial Equipment +SCC,2267006030,NAICS_2012_Code,72,,Commercial Equipment +SCC,2267006030,NAICS_2012_Code,81,,Commercial Equipment +SCC,2267006030,NAICS_2012_Code,92,,Commercial Equipment +SCC,2267006030,NAICS_2012_Code,493,,Commercial Equipment +SCC,2267006035,NAICS_2012_Code,42,,Commercial Equipment +SCC,2267006035,NAICS_2012_Code,44,,Commercial Equipment +SCC,2267006035,NAICS_2012_Code,45,,Commercial Equipment +SCC,2267006035,NAICS_2012_Code,51,,Commercial Equipment +SCC,2267006035,NAICS_2012_Code,52,,Commercial Equipment +SCC,2267006035,NAICS_2012_Code,53,,Commercial Equipment +SCC,2267006035,NAICS_2012_Code,54,,Commercial Equipment +SCC,2267006035,NAICS_2012_Code,55,,Commercial Equipment +SCC,2267006035,NAICS_2012_Code,56,,Commercial Equipment +SCC,2267006035,NAICS_2012_Code,61,,Commercial Equipment +SCC,2267006035,NAICS_2012_Code,62,,Commercial Equipment +SCC,2267006035,NAICS_2012_Code,71,,Commercial Equipment +SCC,2267006035,NAICS_2012_Code,72,,Commercial Equipment +SCC,2267006035,NAICS_2012_Code,81,,Commercial Equipment +SCC,2267006035,NAICS_2012_Code,92,,Commercial Equipment +SCC,2267006035,NAICS_2012_Code,493,,Commercial Equipment +SCC,2268006005,NAICS_2012_Code,42,,Commercial Equipment +SCC,2268006005,NAICS_2012_Code,44,,Commercial Equipment +SCC,2268006005,NAICS_2012_Code,45,,Commercial Equipment +SCC,2268006005,NAICS_2012_Code,51,,Commercial Equipment +SCC,2268006005,NAICS_2012_Code,52,,Commercial Equipment +SCC,2268006005,NAICS_2012_Code,53,,Commercial Equipment +SCC,2268006005,NAICS_2012_Code,54,,Commercial Equipment +SCC,2268006005,NAICS_2012_Code,55,,Commercial Equipment +SCC,2268006005,NAICS_2012_Code,56,,Commercial Equipment +SCC,2268006005,NAICS_2012_Code,61,,Commercial Equipment +SCC,2268006005,NAICS_2012_Code,62,,Commercial Equipment +SCC,2268006005,NAICS_2012_Code,71,,Commercial Equipment +SCC,2268006005,NAICS_2012_Code,72,,Commercial Equipment +SCC,2268006005,NAICS_2012_Code,81,,Commercial Equipment +SCC,2268006005,NAICS_2012_Code,92,,Commercial Equipment +SCC,2268006005,NAICS_2012_Code,493,,Commercial Equipment +SCC,2268006010,NAICS_2012_Code,42,,Commercial Equipment +SCC,2268006010,NAICS_2012_Code,44,,Commercial Equipment +SCC,2268006010,NAICS_2012_Code,45,,Commercial Equipment +SCC,2268006010,NAICS_2012_Code,51,,Commercial Equipment +SCC,2268006010,NAICS_2012_Code,52,,Commercial Equipment +SCC,2268006010,NAICS_2012_Code,53,,Commercial Equipment +SCC,2268006010,NAICS_2012_Code,54,,Commercial Equipment +SCC,2268006010,NAICS_2012_Code,55,,Commercial Equipment +SCC,2268006010,NAICS_2012_Code,56,,Commercial Equipment +SCC,2268006010,NAICS_2012_Code,61,,Commercial Equipment +SCC,2268006010,NAICS_2012_Code,62,,Commercial Equipment +SCC,2268006010,NAICS_2012_Code,71,,Commercial Equipment +SCC,2268006010,NAICS_2012_Code,72,,Commercial Equipment +SCC,2268006010,NAICS_2012_Code,81,,Commercial Equipment +SCC,2268006010,NAICS_2012_Code,92,,Commercial Equipment +SCC,2268006010,NAICS_2012_Code,493,,Commercial Equipment +SCC,2268006015,NAICS_2012_Code,42,,Commercial Equipment +SCC,2268006015,NAICS_2012_Code,44,,Commercial Equipment +SCC,2268006015,NAICS_2012_Code,45,,Commercial Equipment +SCC,2268006015,NAICS_2012_Code,51,,Commercial Equipment +SCC,2268006015,NAICS_2012_Code,52,,Commercial Equipment +SCC,2268006015,NAICS_2012_Code,53,,Commercial Equipment +SCC,2268006015,NAICS_2012_Code,54,,Commercial Equipment +SCC,2268006015,NAICS_2012_Code,55,,Commercial Equipment +SCC,2268006015,NAICS_2012_Code,56,,Commercial Equipment +SCC,2268006015,NAICS_2012_Code,61,,Commercial Equipment +SCC,2268006015,NAICS_2012_Code,62,,Commercial Equipment +SCC,2268006015,NAICS_2012_Code,71,,Commercial Equipment +SCC,2268006015,NAICS_2012_Code,72,,Commercial Equipment +SCC,2268006015,NAICS_2012_Code,81,,Commercial Equipment +SCC,2268006015,NAICS_2012_Code,92,,Commercial Equipment +SCC,2268006015,NAICS_2012_Code,493,,Commercial Equipment +SCC,2268006020,NAICS_2012_Code,42,,Commercial Equipment +SCC,2268006020,NAICS_2012_Code,44,,Commercial Equipment +SCC,2268006020,NAICS_2012_Code,45,,Commercial Equipment +SCC,2268006020,NAICS_2012_Code,51,,Commercial Equipment +SCC,2268006020,NAICS_2012_Code,52,,Commercial Equipment +SCC,2268006020,NAICS_2012_Code,53,,Commercial Equipment +SCC,2268006020,NAICS_2012_Code,54,,Commercial Equipment +SCC,2268006020,NAICS_2012_Code,55,,Commercial Equipment +SCC,2268006020,NAICS_2012_Code,56,,Commercial Equipment +SCC,2268006020,NAICS_2012_Code,61,,Commercial Equipment +SCC,2268006020,NAICS_2012_Code,62,,Commercial Equipment +SCC,2268006020,NAICS_2012_Code,71,,Commercial Equipment +SCC,2268006020,NAICS_2012_Code,72,,Commercial Equipment +SCC,2268006020,NAICS_2012_Code,81,,Commercial Equipment +SCC,2268006020,NAICS_2012_Code,92,,Commercial Equipment +SCC,2268006020,NAICS_2012_Code,493,,Commercial Equipment +SCC,2268006035,NAICS_2012_Code,42,,Commercial Equipment +SCC,2268006035,NAICS_2012_Code,44,,Commercial Equipment +SCC,2268006035,NAICS_2012_Code,45,,Commercial Equipment +SCC,2268006035,NAICS_2012_Code,51,,Commercial Equipment +SCC,2268006035,NAICS_2012_Code,52,,Commercial Equipment +SCC,2268006035,NAICS_2012_Code,53,,Commercial Equipment +SCC,2268006035,NAICS_2012_Code,54,,Commercial Equipment +SCC,2268006035,NAICS_2012_Code,55,,Commercial Equipment +SCC,2268006035,NAICS_2012_Code,56,,Commercial Equipment +SCC,2268006035,NAICS_2012_Code,61,,Commercial Equipment +SCC,2268006035,NAICS_2012_Code,62,,Commercial Equipment +SCC,2268006035,NAICS_2012_Code,71,,Commercial Equipment +SCC,2268006035,NAICS_2012_Code,72,,Commercial Equipment +SCC,2268006035,NAICS_2012_Code,81,,Commercial Equipment +SCC,2268006035,NAICS_2012_Code,92,,Commercial Equipment +SCC,2268006035,NAICS_2012_Code,493,,Commercial Equipment +SCC,2270006005,NAICS_2012_Code,42,,Commercial Equipment +SCC,2270006005,NAICS_2012_Code,44,,Commercial Equipment +SCC,2270006005,NAICS_2012_Code,45,,Commercial Equipment +SCC,2270006005,NAICS_2012_Code,51,,Commercial Equipment +SCC,2270006005,NAICS_2012_Code,52,,Commercial Equipment +SCC,2270006005,NAICS_2012_Code,53,,Commercial Equipment +SCC,2270006005,NAICS_2012_Code,54,,Commercial Equipment +SCC,2270006005,NAICS_2012_Code,55,,Commercial Equipment +SCC,2270006005,NAICS_2012_Code,56,,Commercial Equipment +SCC,2270006005,NAICS_2012_Code,61,,Commercial Equipment +SCC,2270006005,NAICS_2012_Code,62,,Commercial Equipment +SCC,2270006005,NAICS_2012_Code,71,,Commercial Equipment +SCC,2270006005,NAICS_2012_Code,72,,Commercial Equipment +SCC,2270006005,NAICS_2012_Code,81,,Commercial Equipment +SCC,2270006005,NAICS_2012_Code,92,,Commercial Equipment +SCC,2270006005,NAICS_2012_Code,493,,Commercial Equipment +SCC,2270006010,NAICS_2012_Code,42,,Commercial Equipment +SCC,2270006010,NAICS_2012_Code,44,,Commercial Equipment +SCC,2270006010,NAICS_2012_Code,45,,Commercial Equipment +SCC,2270006010,NAICS_2012_Code,51,,Commercial Equipment +SCC,2270006010,NAICS_2012_Code,52,,Commercial Equipment +SCC,2270006010,NAICS_2012_Code,53,,Commercial Equipment +SCC,2270006010,NAICS_2012_Code,54,,Commercial Equipment +SCC,2270006010,NAICS_2012_Code,55,,Commercial Equipment +SCC,2270006010,NAICS_2012_Code,56,,Commercial Equipment +SCC,2270006010,NAICS_2012_Code,61,,Commercial Equipment +SCC,2270006010,NAICS_2012_Code,62,,Commercial Equipment +SCC,2270006010,NAICS_2012_Code,71,,Commercial Equipment +SCC,2270006010,NAICS_2012_Code,72,,Commercial Equipment +SCC,2270006010,NAICS_2012_Code,81,,Commercial Equipment +SCC,2270006010,NAICS_2012_Code,92,,Commercial Equipment +SCC,2270006010,NAICS_2012_Code,493,,Commercial Equipment +SCC,2270006015,NAICS_2012_Code,42,,Commercial Equipment +SCC,2270006015,NAICS_2012_Code,44,,Commercial Equipment +SCC,2270006015,NAICS_2012_Code,45,,Commercial Equipment +SCC,2270006015,NAICS_2012_Code,51,,Commercial Equipment +SCC,2270006015,NAICS_2012_Code,52,,Commercial Equipment +SCC,2270006015,NAICS_2012_Code,53,,Commercial Equipment +SCC,2270006015,NAICS_2012_Code,54,,Commercial Equipment +SCC,2270006015,NAICS_2012_Code,55,,Commercial Equipment +SCC,2270006015,NAICS_2012_Code,56,,Commercial Equipment +SCC,2270006015,NAICS_2012_Code,61,,Commercial Equipment +SCC,2270006015,NAICS_2012_Code,62,,Commercial Equipment +SCC,2270006015,NAICS_2012_Code,71,,Commercial Equipment +SCC,2270006015,NAICS_2012_Code,72,,Commercial Equipment +SCC,2270006015,NAICS_2012_Code,81,,Commercial Equipment +SCC,2270006015,NAICS_2012_Code,92,,Commercial Equipment +SCC,2270006015,NAICS_2012_Code,493,,Commercial Equipment +SCC,2270006020,NAICS_2012_Code,42,,Commercial Equipment +SCC,2270006020,NAICS_2012_Code,44,,Commercial Equipment +SCC,2270006020,NAICS_2012_Code,45,,Commercial Equipment +SCC,2270006020,NAICS_2012_Code,51,,Commercial Equipment +SCC,2270006020,NAICS_2012_Code,52,,Commercial Equipment +SCC,2270006020,NAICS_2012_Code,53,,Commercial Equipment +SCC,2270006020,NAICS_2012_Code,54,,Commercial Equipment +SCC,2270006020,NAICS_2012_Code,55,,Commercial Equipment +SCC,2270006020,NAICS_2012_Code,56,,Commercial Equipment +SCC,2270006020,NAICS_2012_Code,61,,Commercial Equipment +SCC,2270006020,NAICS_2012_Code,62,,Commercial Equipment +SCC,2270006020,NAICS_2012_Code,71,,Commercial Equipment +SCC,2270006020,NAICS_2012_Code,72,,Commercial Equipment +SCC,2270006020,NAICS_2012_Code,81,,Commercial Equipment +SCC,2270006020,NAICS_2012_Code,92,,Commercial Equipment +SCC,2270006020,NAICS_2012_Code,493,,Commercial Equipment +SCC,2270006025,NAICS_2012_Code,42,,Commercial Equipment +SCC,2270006025,NAICS_2012_Code,44,,Commercial Equipment +SCC,2270006025,NAICS_2012_Code,45,,Commercial Equipment +SCC,2270006025,NAICS_2012_Code,51,,Commercial Equipment +SCC,2270006025,NAICS_2012_Code,52,,Commercial Equipment +SCC,2270006025,NAICS_2012_Code,53,,Commercial Equipment +SCC,2270006025,NAICS_2012_Code,54,,Commercial Equipment +SCC,2270006025,NAICS_2012_Code,55,,Commercial Equipment +SCC,2270006025,NAICS_2012_Code,56,,Commercial Equipment +SCC,2270006025,NAICS_2012_Code,61,,Commercial Equipment +SCC,2270006025,NAICS_2012_Code,62,,Commercial Equipment +SCC,2270006025,NAICS_2012_Code,71,,Commercial Equipment +SCC,2270006025,NAICS_2012_Code,72,,Commercial Equipment +SCC,2270006025,NAICS_2012_Code,81,,Commercial Equipment +SCC,2270006025,NAICS_2012_Code,92,,Commercial Equipment +SCC,2270006025,NAICS_2012_Code,493,,Commercial Equipment +SCC,2270006030,NAICS_2012_Code,42,,Commercial Equipment +SCC,2270006030,NAICS_2012_Code,44,,Commercial Equipment +SCC,2270006030,NAICS_2012_Code,45,,Commercial Equipment +SCC,2270006030,NAICS_2012_Code,51,,Commercial Equipment +SCC,2270006030,NAICS_2012_Code,52,,Commercial Equipment +SCC,2270006030,NAICS_2012_Code,53,,Commercial Equipment +SCC,2270006030,NAICS_2012_Code,54,,Commercial Equipment +SCC,2270006030,NAICS_2012_Code,55,,Commercial Equipment +SCC,2270006030,NAICS_2012_Code,56,,Commercial Equipment +SCC,2270006030,NAICS_2012_Code,61,,Commercial Equipment +SCC,2270006030,NAICS_2012_Code,62,,Commercial Equipment +SCC,2270006030,NAICS_2012_Code,71,,Commercial Equipment +SCC,2270006030,NAICS_2012_Code,72,,Commercial Equipment +SCC,2270006030,NAICS_2012_Code,81,,Commercial Equipment +SCC,2270006030,NAICS_2012_Code,92,,Commercial Equipment +SCC,2270006030,NAICS_2012_Code,493,,Commercial Equipment +SCC,2270006035,NAICS_2012_Code,42,,Commercial Equipment +SCC,2270006035,NAICS_2012_Code,44,,Commercial Equipment +SCC,2270006035,NAICS_2012_Code,45,,Commercial Equipment +SCC,2270006035,NAICS_2012_Code,51,,Commercial Equipment +SCC,2270006035,NAICS_2012_Code,52,,Commercial Equipment +SCC,2270006035,NAICS_2012_Code,53,,Commercial Equipment +SCC,2270006035,NAICS_2012_Code,54,,Commercial Equipment +SCC,2270006035,NAICS_2012_Code,55,,Commercial Equipment +SCC,2270006035,NAICS_2012_Code,56,,Commercial Equipment +SCC,2270006035,NAICS_2012_Code,61,,Commercial Equipment +SCC,2270006035,NAICS_2012_Code,62,,Commercial Equipment +SCC,2270006035,NAICS_2012_Code,71,,Commercial Equipment +SCC,2270006035,NAICS_2012_Code,72,,Commercial Equipment +SCC,2270006035,NAICS_2012_Code,81,,Commercial Equipment +SCC,2270006035,NAICS_2012_Code,92,,Commercial Equipment +SCC,2270006035,NAICS_2012_Code,493,,Commercial Equipment diff --git a/flowsa/methods/flowbysectoractivitysets/NEI_Nonroad_asets.csv b/flowsa/methods/flowbysectoractivitysets/NEI_Nonroad_asets.csv index a99d7f71c..1dc90ad9c 100644 --- a/flowsa/methods/flowbysectoractivitysets/NEI_Nonroad_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/NEI_Nonroad_asets.csv @@ -13,6 +13,28 @@ direct_allocation,2268004044,Lawn and Garden Equipment direct_allocation,2270004022,Lawn and Garden Equipment direct_allocation,2270004036,Lawn and Garden Equipment direct_allocation,2270004044,Lawn and Garden Equipment +direct_allocation,2260004016,Lawn and Garden Equipment +direct_allocation,2260004026,Lawn and Garden Equipment +direct_allocation,2260004031,Lawn and Garden Equipment +direct_allocation,2260004071,Lawn and Garden Equipment +direct_allocation,2265004011,Lawn and Garden Equipment +direct_allocation,2265004016,Lawn and Garden Equipment +direct_allocation,2265004026,Lawn and Garden Equipment +direct_allocation,2265004031,Lawn and Garden Equipment +direct_allocation,2265004041,Lawn and Garden Equipment +direct_allocation,2265004046,Lawn and Garden Equipment +direct_allocation,2265004051,Lawn and Garden Equipment +direct_allocation,2265004056,Lawn and Garden Equipment +direct_allocation,2265004066,Lawn and Garden Equipment +direct_allocation,2265004071,Lawn and Garden Equipment +direct_allocation,2265004076,Lawn and Garden Equipment +direct_allocation,2267004066,Lawn and Garden Equipment +direct_allocation,2270004031,Lawn and Garden Equipment +direct_allocation,2270004046,Lawn and Garden Equipment +direct_allocation,2270004056,Lawn and Garden Equipment +direct_allocation,2270004066,Lawn and Garden Equipment +direct_allocation,2270004071,Lawn and Garden Equipment +direct_allocation,2270004076,Lawn and Garden Equipment direct_allocation,2260001020,"Recreational equipment, lawn and garden" direct_allocation,2260001022,"Recreational equipment, lawn and garden" direct_allocation,2260001060,"Recreational equipment, lawn and garden" @@ -32,12 +54,56 @@ direct_allocation,2270004033,"Recreational equipment, lawn and garden" direct_allocation,2282005022,"Recreational equipment, lawn and garden" direct_allocation,2282010005,"Recreational equipment, lawn and garden" direct_allocation,2282020022,"Recreational equipment, lawn and garden" +direct_allocation,2260001010,"Recreational equipment, lawn and garden" +direct_allocation,2260001030,"Recreational equipment, lawn and garden" +direct_allocation,2260004015,"Recreational equipment, lawn and garden" +direct_allocation,2260004025,"Recreational equipment, lawn and garden" +direct_allocation,2260004030,"Recreational equipment, lawn and garden" +direct_allocation,2265001010,"Recreational equipment, lawn and garden" +direct_allocation,2265001030,"Recreational equipment, lawn and garden" +direct_allocation,2265004010,"Recreational equipment, lawn and garden" +direct_allocation,2265004015,"Recreational equipment, lawn and garden" +direct_allocation,2265004025,"Recreational equipment, lawn and garden" +direct_allocation,2265004030,"Recreational equipment, lawn and garden" +direct_allocation,2265004040,"Recreational equipment, lawn and garden" +direct_allocation,2265004055,"Recreational equipment, lawn and garden" +direct_allocation,2265004075,"Recreational equipment, lawn and garden" +direct_allocation,2282005010,"Recreational equipment, lawn and garden" +direct_allocation,2282005015,"Recreational equipment, lawn and garden" +direct_allocation,2282020005,"Recreational equipment, lawn and garden" +direct_allocation,2282020010,"Recreational equipment, lawn and garden" +direct_allocation,2265004050,"Recreational equipment, lawn and garden" direct_allocation,2270010010,Oil and gas equipement offroad_vehicles_equipment,2260005022,Agricultural off-highway vehicles offroad_vehicles_equipment,2265005022,Agricultural off-highway vehicles offroad_vehicles_equipment,2267005022,Agricultural off-highway vehicles offroad_vehicles_equipment,2268005022,Agricultural off-highway vehicles offroad_vehicles_equipment,2270005022,Agricultural off-highway vehicles +offroad_vehicles_equipment,2260005035,Agricultural off-highway vehicles +offroad_vehicles_equipment,2265005010,Agricultural off-highway vehicles +offroad_vehicles_equipment,2265005015,Agricultural off-highway vehicles +offroad_vehicles_equipment,2265005020,Agricultural off-highway vehicles +offroad_vehicles_equipment,2265005025,Agricultural off-highway vehicles +offroad_vehicles_equipment,2265005030,Agricultural off-highway vehicles +offroad_vehicles_equipment,2265005035,Agricultural off-highway vehicles +offroad_vehicles_equipment,2265005040,Agricultural off-highway vehicles +offroad_vehicles_equipment,2265005045,Agricultural off-highway vehicles +offroad_vehicles_equipment,2265005055,Agricultural off-highway vehicles +offroad_vehicles_equipment,2265005060,Agricultural off-highway vehicles +offroad_vehicles_equipment,2267005055,Agricultural off-highway vehicles +offroad_vehicles_equipment,2267005060,Agricultural off-highway vehicles +offroad_vehicles_equipment,2268005055,Agricultural off-highway vehicles +offroad_vehicles_equipment,2268005060,Agricultural off-highway vehicles +offroad_vehicles_equipment,2270005010,Agricultural off-highway vehicles +offroad_vehicles_equipment,2270005015,Agricultural off-highway vehicles +offroad_vehicles_equipment,2270005020,Agricultural off-highway vehicles +offroad_vehicles_equipment,2270005025,Agricultural off-highway vehicles +offroad_vehicles_equipment,2270005030,Agricultural off-highway vehicles +offroad_vehicles_equipment,2270005035,Agricultural off-highway vehicles +offroad_vehicles_equipment,2270005040,Agricultural off-highway vehicles +offroad_vehicles_equipment,2270005045,Agricultural off-highway vehicles +offroad_vehicles_equipment,2270005055,Agricultural off-highway vehicles +offroad_vehicles_equipment,2270005060,Agricultural off-highway vehicles offroad_vehicles_equipment,2260002022,Construction equipment offroad_vehicles_equipment,2265002022,Construction equipment offroad_vehicles_equipment,2267002022,Construction equipment @@ -53,12 +119,106 @@ offroad_vehicles_equipment,2268003060,Industrial off-highway vehicles offroad_vehicles_equipment,2268010010,Industrial off-highway vehicles offroad_vehicles_equipment,2270003022,Industrial off-highway vehicles offroad_vehicles_equipment,2270003060,Industrial off-highway vehicles +offroad_vehicles_equipment,2260003030,Industrial off-highway vehicles +offroad_vehicles_equipment,2260003040,Industrial off-highway vehicles +offroad_vehicles_equipment,2265003010,Industrial off-highway vehicles +offroad_vehicles_equipment,2265003020,Industrial off-highway vehicles +offroad_vehicles_equipment,2265003030,Industrial off-highway vehicles +offroad_vehicles_equipment,2265003040,Industrial off-highway vehicles +offroad_vehicles_equipment,2265003050,Industrial off-highway vehicles +offroad_vehicles_equipment,2265003070,Industrial off-highway vehicles +offroad_vehicles_equipment,2267003010,Industrial off-highway vehicles +offroad_vehicles_equipment,2267003020,Industrial off-highway vehicles +offroad_vehicles_equipment,2267003030,Industrial off-highway vehicles +offroad_vehicles_equipment,2267003040,Industrial off-highway vehicles +offroad_vehicles_equipment,2267003050,Industrial off-highway vehicles +offroad_vehicles_equipment,2267003070,Industrial off-highway vehicles +offroad_vehicles_equipment,2268003020,Industrial off-highway vehicles +offroad_vehicles_equipment,2268003030,Industrial off-highway vehicles +offroad_vehicles_equipment,2268003040,Industrial off-highway vehicles +offroad_vehicles_equipment,2268003070,Industrial off-highway vehicles +offroad_vehicles_equipment,2270003010,Industrial off-highway vehicles +offroad_vehicles_equipment,2270003020,Industrial off-highway vehicles +offroad_vehicles_equipment,2270003030,Industrial off-highway vehicles +offroad_vehicles_equipment,2270003040,Industrial off-highway vehicles +offroad_vehicles_equipment,2270003050,Industrial off-highway vehicles +offroad_vehicles_equipment,2270003070,Industrial off-highway vehicles offroad_vehicles_equipment,2260007022,Logging equipment offroad_vehicles_equipment,2265007022,Logging equipment offroad_vehicles_equipment,2267007022,Logging equipment offroad_vehicles_equipment,2268007022,Logging equipment offroad_vehicles_equipment,2270007022,Logging equipment +offroad_vehicles_equipment,2260007005,Logging equipment +offroad_vehicles_equipment,2265007010,Logging equipment +offroad_vehicles_equipment,2265007015,Logging equipment +offroad_vehicles_equipment,2270007015,Logging equipment +offroad_vehicles_equipment,2270007010,Logging equipment offroad_vehicles_equipment,2270009010,Mining equipment +offroad_vehicles_equipment,2260002006,Construction and mining equipment +offroad_vehicles_equipment,2260002009,Construction and mining equipment +offroad_vehicles_equipment,2260002021,Construction and mining equipment +offroad_vehicles_equipment,2260002027,Construction and mining equipment +offroad_vehicles_equipment,2260002039,Construction and mining equipment +offroad_vehicles_equipment,2260002054,Construction and mining equipment +offroad_vehicles_equipment,2265002003,Construction and mining equipment +offroad_vehicles_equipment,2265002006,Construction and mining equipment +offroad_vehicles_equipment,2265002009,Construction and mining equipment +offroad_vehicles_equipment,2265002015,Construction and mining equipment +offroad_vehicles_equipment,2265002021,Construction and mining equipment +offroad_vehicles_equipment,2265002024,Construction and mining equipment +offroad_vehicles_equipment,2265002027,Construction and mining equipment +offroad_vehicles_equipment,2265002030,Construction and mining equipment +offroad_vehicles_equipment,2265002033,Construction and mining equipment +offroad_vehicles_equipment,2265002039,Construction and mining equipment +offroad_vehicles_equipment,2265002042,Construction and mining equipment +offroad_vehicles_equipment,2265002045,Construction and mining equipment +offroad_vehicles_equipment,2265002054,Construction and mining equipment +offroad_vehicles_equipment,2265002057,Construction and mining equipment +offroad_vehicles_equipment,2265002060,Construction and mining equipment +offroad_vehicles_equipment,2265002066,Construction and mining equipment +offroad_vehicles_equipment,2265002072,Construction and mining equipment +offroad_vehicles_equipment,2265002078,Construction and mining equipment +offroad_vehicles_equipment,2265002081,Construction and mining equipment +offroad_vehicles_equipment,2267002003,Construction and mining equipment +offroad_vehicles_equipment,2267002015,Construction and mining equipment +offroad_vehicles_equipment,2267002021,Construction and mining equipment +offroad_vehicles_equipment,2267002024,Construction and mining equipment +offroad_vehicles_equipment,2267002030,Construction and mining equipment +offroad_vehicles_equipment,2267002033,Construction and mining equipment +offroad_vehicles_equipment,2267002039,Construction and mining equipment +offroad_vehicles_equipment,2267002045,Construction and mining equipment +offroad_vehicles_equipment,2267002054,Construction and mining equipment +offroad_vehicles_equipment,2267002057,Construction and mining equipment +offroad_vehicles_equipment,2267002060,Construction and mining equipment +offroad_vehicles_equipment,2267002066,Construction and mining equipment +offroad_vehicles_equipment,2267002072,Construction and mining equipment +offroad_vehicles_equipment,2267002081,Construction and mining equipment +offroad_vehicles_equipment,2268002081,Construction and mining equipment +offroad_vehicles_equipment,2270002003,Construction and mining equipment +offroad_vehicles_equipment,2270002006,Construction and mining equipment +offroad_vehicles_equipment,2270002009,Construction and mining equipment +offroad_vehicles_equipment,2270002015,Construction and mining equipment +offroad_vehicles_equipment,2270002018,Construction and mining equipment +offroad_vehicles_equipment,2270002021,Construction and mining equipment +offroad_vehicles_equipment,2270002024,Construction and mining equipment +offroad_vehicles_equipment,2270002027,Construction and mining equipment +offroad_vehicles_equipment,2270002030,Construction and mining equipment +offroad_vehicles_equipment,2270002033,Construction and mining equipment +offroad_vehicles_equipment,2270002036,Construction and mining equipment +offroad_vehicles_equipment,2270002039,Construction and mining equipment +offroad_vehicles_equipment,2270002042,Construction and mining equipment +offroad_vehicles_equipment,2270002045,Construction and mining equipment +offroad_vehicles_equipment,2270002048,Construction and mining equipment +offroad_vehicles_equipment,2270002051,Construction and mining equipment +offroad_vehicles_equipment,2270002054,Construction and mining equipment +offroad_vehicles_equipment,2270002057,Construction and mining equipment +offroad_vehicles_equipment,2270002060,Construction and mining equipment +offroad_vehicles_equipment,2270002066,Construction and mining equipment +offroad_vehicles_equipment,2270002069,Construction and mining equipment +offroad_vehicles_equipment,2270002072,Construction and mining equipment +offroad_vehicles_equipment,2270002075,Construction and mining equipment +offroad_vehicles_equipment,2270002078,Construction and mining equipment +offroad_vehicles_equipment,2270002081,Construction and mining equipment offroad_vehicles_equipment,2285002015,Railroad maintenance offroad_vehicles_equipment,2285004015,Railroad maintenance offroad_vehicles_equipment,2285006015,Railroad maintenance @@ -67,3 +227,31 @@ offroad_vehicles_equipment,2265006022,Commercial Equipment offroad_vehicles_equipment,2267006022,Commercial Equipment offroad_vehicles_equipment,2268006022,Commercial Equipment offroad_vehicles_equipment,2270006022,Commercial Equipment +offroad_vehicles_equipment,2260006005,Commercial Equipment +offroad_vehicles_equipment,2260006010,Commercial Equipment +offroad_vehicles_equipment,2260006015,Commercial Equipment +offroad_vehicles_equipment,2260006035,Commercial Equipment +offroad_vehicles_equipment,2265006005,Commercial Equipment +offroad_vehicles_equipment,2265006010,Commercial Equipment +offroad_vehicles_equipment,2265006015,Commercial Equipment +offroad_vehicles_equipment,2265006025,Commercial Equipment +offroad_vehicles_equipment,2265006030,Commercial Equipment +offroad_vehicles_equipment,2265006035,Commercial Equipment +offroad_vehicles_equipment,2267006005,Commercial Equipment +offroad_vehicles_equipment,2267006010,Commercial Equipment +offroad_vehicles_equipment,2267006015,Commercial Equipment +offroad_vehicles_equipment,2267006025,Commercial Equipment +offroad_vehicles_equipment,2267006030,Commercial Equipment +offroad_vehicles_equipment,2267006035,Commercial Equipment +offroad_vehicles_equipment,2268006005,Commercial Equipment +offroad_vehicles_equipment,2268006010,Commercial Equipment +offroad_vehicles_equipment,2268006015,Commercial Equipment +offroad_vehicles_equipment,2268006020,Commercial Equipment +offroad_vehicles_equipment,2270006005,Commercial Equipment +offroad_vehicles_equipment,2270006010,Commercial Equipment +offroad_vehicles_equipment,2270006015,Commercial Equipment +offroad_vehicles_equipment,2270006025,Commercial Equipment +offroad_vehicles_equipment,2270006030,Commercial Equipment +offroad_vehicles_equipment,2270006035,Commercial Equipment +offroad_vehicles_equipment,2268006035,Commercial Equipment +offroad_vehicles_equipment,2270006020,Commercial Equipment From adaed2fceadb145e52ae6bc529b039dba48dc912 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 21 Aug 2023 13:12:27 -0400 Subject: [PATCH 0790/1127] add additional nonpoint retired SCCs for NEI 2014 --- .../NAICS_Crosswalk_SCC.csv | 14 ++++++++++++++ .../NEI_Nonpoint_asets.csv | 13 +++++++++++++ 2 files changed, 27 insertions(+) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_SCC.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_SCC.csv index dc65a7c39..a0fcd8d91 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_SCC.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_SCC.csv @@ -321,6 +321,10 @@ SCC,2310421010,NAICS_2012_Code,211111,,Oil and Gas SCC,2310421100,NAICS_2012_Code,211111,,Oil and Gas SCC,2310421400,NAICS_2012_Code,211111,,Oil and Gas SCC,2310421603,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310000330,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310000550,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310011000,NAICS_2012_Code,211111,,Oil and Gas +SCC,2310000000,NAICS_2012_Code,211111,,Oil and Gas SCC,2805001000,NAICS_2012_Code,112112,,Agriculture - Livestock SCC,2805001010,NAICS_2012_Code,112120,,Agriculture - Livestock SCC,2805001100,NAICS_2012_Code,112112,,Agriculture - Livestock @@ -393,6 +397,10 @@ SCC,2280003103,NAICS_2012_Code,483,,Mobile Sources SCC,2280003104,NAICS_2012_Code,483,,Mobile Sources SCC,2280003203,NAICS_2012_Code,483,,Mobile Sources SCC,2280003204,NAICS_2012_Code,483,,Mobile Sources +SCC,2280002100,NAICS_2012_Code,483,,Mobile Sources +SCC,2280002200,NAICS_2012_Code,483,,Mobile Sources +SCC,2280003200,NAICS_2012_Code,483,,Mobile Sources +SCC,2280003100,NAICS_2012_Code,483,,Mobile Sources SCC,2285002006,NAICS_2012_Code,482,,Mobile Sources SCC,2285002007,NAICS_2012_Code,482,,Mobile Sources SCC,2285002008,NAICS_2012_Code,482,,Mobile Sources @@ -451,7 +459,9 @@ SCC,2307030000,NAICS_2012_Code,3219,,Industrial processes SCC,2307060000,NAICS_2012_Code,32199,,Industrial processes SCC,2308000000,NAICS_2012_Code,326,,Industrial processes SCC,2309000000,NAICS_2012_Code,332,,Industrial processes +SCC,2311000000,NAICS_2012_Code,23,,Industrial processes SCC,2311010000,NAICS_2012_Code,2361,,Industrial processes +SCC,2311010070,NAICS_2012_Code,2361,,Industrial processes SCC,2311020000,NAICS_2012_Code,236210,,Industrial processes SCC,2311030000,NAICS_2012_Code,237310,,Industrial processes SCC,2312000000,NAICS_2012_Code,333,,Industrial processes @@ -463,6 +473,10 @@ SCC,2325030000,NAICS_2012_Code,21232,,Industrial processes SCC,2325040000,NAICS_2012_Code,212325,,Industrial processes SCC,2325050000,NAICS_2012_Code,212393,,Industrial processes SCC,2325060000,NAICS_2012_Code,212231,,Industrial processes +SCC,2305070000,NAICS_2012_Code,3273,,Industrial processes +SCC,2305070000,NAICS_2012_Code,3274,,Industrial processes +SCC,2305080000,NAICS_2012_Code,21231,,Industrial processes +SCC,2309100200,NAICS_2012_Code,332,,Industrial processes SCC,2399000000,NAICS_2012_Code,31,,Industrial processes SCC,2399000000,NAICS_2012_Code,32,,Industrial processes SCC,2399000000,NAICS_2012_Code,33,,Industrial processes diff --git a/flowsa/methods/flowbysectoractivitysets/NEI_Nonpoint_asets.csv b/flowsa/methods/flowbysectoractivitysets/NEI_Nonpoint_asets.csv index a91eb89fe..811262349 100644 --- a/flowsa/methods/flowbysectoractivitysets/NEI_Nonpoint_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/NEI_Nonpoint_asets.csv @@ -300,6 +300,10 @@ direct_allocation,2310421010,Oil and Gas direct_allocation,2310421100,Oil and Gas direct_allocation,2310421400,Oil and Gas direct_allocation,2310421603,Oil and Gas +direct_allocation,2310000330,Oil and Gas +direct_allocation,2310000550,Oil and Gas +direct_allocation,2310011000,Oil and Gas +direct_allocation,2310000000,Oil and Gas direct_allocation,2805001010,Agriculture - Livestock direct_allocation,2805018000,Agriculture - Livestock direct_allocation,2805019000,Agriculture - Livestock @@ -430,6 +434,10 @@ mobile_and_fuel_storage,2285002007,Mobile Sources mobile_and_fuel_storage,2285002008,Mobile Sources mobile_and_fuel_storage,2285002009,Mobile Sources mobile_and_fuel_storage,2285002010,Mobile Sources +mobile_and_fuel_storage,2280002100,Mobile Sources +mobile_and_fuel_storage,2280002200,Mobile Sources +mobile_and_fuel_storage,2280003200,Mobile Sources +mobile_and_fuel_storage,2280003100,Mobile Sources mobile_and_fuel_storage,2501012011,Fuel Storage mobile_and_fuel_storage,2501012012,Fuel Storage mobile_and_fuel_storage,2501012013,Fuel Storage @@ -537,6 +545,8 @@ output_allocation,2307060000,Industrial processes output_allocation,2308000000,Industrial processes output_allocation,2309000000,Industrial processes output_allocation,2311010000,Industrial processes +output_allocation,2311010070,Industrial processes +output_allocation,2311000000,Industrial processes output_allocation,2312000000,Industrial processes output_allocation,2325000000,Industrial processes output_allocation,2325010000,Industrial processes @@ -547,6 +557,9 @@ output_allocation,2399010000,Industrial processes output_allocation,2420000000,Industrial processes output_allocation,2420000055,Industrial processes output_allocation,2420000999,Industrial processes +output_allocation,2305070000,Industrial processes +output_allocation,2305080000,Industrial processes +output_allocation,2309100200,Industrial processes output_allocation,2103001000,Fuel Combustion - Institutional/Commercial output_allocation,2103002000,Fuel Combustion - Institutional/Commercial output_allocation,2103004000,Fuel Combustion - Institutional/Commercial From eee26ca81830d4c32cdb1cdc11717a7ac85f277a Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 22 Aug 2023 12:19:09 -0600 Subject: [PATCH 0791/1127] drop support for water m2 and m3 --- .../flowbysectormethods/Water_common.yaml | 76 +----------- .../Water_national_2010_m2.yaml | 115 ------------------ .../Water_national_2015_m2.yaml | 96 --------------- .../Water_national_2015_m3.yaml | 104 ---------------- 4 files changed, 6 insertions(+), 385 deletions(-) delete mode 100644 flowsa/methods/flowbysectormethods/Water_national_2010_m2.yaml delete mode 100644 flowsa/methods/flowbysectormethods/Water_national_2015_m2.yaml delete mode 100644 flowsa/methods/flowbysectormethods/Water_national_2015_m3.yaml diff --git a/flowsa/methods/flowbysectormethods/Water_common.yaml b/flowsa/methods/flowbysectormethods/Water_common.yaml index 2d7ffc9c5..4ea2842fc 100644 --- a/flowsa/methods/flowbysectormethods/Water_common.yaml +++ b/flowsa/methods/flowbysectormethods/Water_common.yaml @@ -25,7 +25,7 @@ sources_to_cache: clean_fba_after_attribution: !clean_function:flowbyclean substitute_nonexistent_values clean_source: USDA_IWMS: - geoscale: national #todo: check if should be default national + geoscale: national # year: 2018 # specify in year-specific yaml selection_fields: Class: Water @@ -59,7 +59,7 @@ source_names: clean_fba_before_activity_sets: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup activity_sets: - direct_attribution: # use in m1, m2, m3 + direct_attribution: selection_fields: PrimaryActivity: - "Aquaculture" @@ -70,7 +70,7 @@ source_names: attribution_method: direct - employment_attribution: # use in m1 + employment_attribution: selection_fields: PrimaryActivity: - "Industrial" @@ -81,76 +81,12 @@ source_names: # geoscale: # specify in method -# industrial_attribution: # use in m2 (instead of employment_attribution) -# selection_fields: -# PrimaryActivity: -# - "Industrial" -# attribution_method: proportional -# attribution_source: -# StatCan_IWS_MI: -## year: # select in method -# geoscale: national -# selection_fields: -# Class: Water -# FlowName: "Water intake" -# Location: {'124': '00000'} # replace canadian ISO with FIPS -# LocationSystem: {'ISO': 'FIPS_2015'} -# # todo: convert clean fba fxn into this yaml -## clean_allocation_fba: !script_function:StatCan_IWS_MI convert_statcan_data_to_US_water_use -# attribution_method: division -# attribution_source: -# StatCan_GDP: -## year: # select in method -# selection_fields: -# Class: Money -# Location: {'124': '00000'} # replace canadian ISO with FIPS -# LocationSystem: {'ISO': 'FIPS_2015'} -# attribution_method: multiplication -# attribution_source: -# BEA_GDP_GrossOutput: -## year: # select in method -# selection_fields: Money -# attribution_method: proportional -# attribution_source: -## Employment_national_2015: # select in method -# geoscale: national - - -# mining_attribution: # use in m2 (instead of employment_attribution) -# geoscale: national -# selection_fields: -# PrimaryActivity: -# - "Mining" -# attribution_method: proportional -# attribution_source: -# Blackhurst_IO: -# year: 2002 -# geoscale: national -# selection_fields: -# Class: Water -# FlowName: "Water Withdrawals IO Vector" -# attribute: -# # convert to kg/year for 2002 -# - attribution_method: multiplication -# attribution_source: -# BEA_Make_AR: -# year: 2002 -# selection_fields: -# Class: Money -# attribution_method: proportional -# attribution_source: Employment_national_2002 -# # scale to year of USGS data -# - attribution_method: multiplication -## attribution_source: Employment_national_2015 # specify in method - - - cropland_attribution: # use in m1, m2 + cropland_attribution: industry_spec: default: NAICS_6 NAICS_7: ['111150', '111199'] selection_fields: - PrimaryActivity: - - "Irrigation Crop" + PrimaryActivity: "Irrigation Crop" attribution_method: proportional attribution_source: USDA_CoA_Cropland: @@ -217,7 +153,7 @@ source_names: attribution_source: USDA_IWMS - livestock_attribution: # use in m1, m2 + livestock_attribution: industry_spec: default: NAICS_6 NAICS_7: ['112130', '112320', '112390', '112910', diff --git a/flowsa/methods/flowbysectormethods/Water_national_2010_m2.yaml b/flowsa/methods/flowbysectormethods/Water_national_2010_m2.yaml deleted file mode 100644 index 31fc1273f..000000000 --- a/flowsa/methods/flowbysectormethods/Water_national_2010_m2.yaml +++ /dev/null @@ -1,115 +0,0 @@ -#%YAML 1.1 -# -#--- -# -#target_sector_level: NAICS_6 -#target_sector_source: NAICS_2012_Code -#target_geoscale: national -#source_names: -# "USGS_NWIS_WU": -# data_format: 'FBA' -# class: Water -# geoscale_to_use: state -# year: 2010 -# clean_fba_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup -# clean_fba_w_sec_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_w_sectors_data_cleanup -# activity_sets: -# activity_set_1: -# names: -# - "Aquaculture" -# - "Irrigation Golf Courses" -# - "Public Supply" -# - "Thermoelectric Power" -# - "Domestic" -# allocation_method: direct -# allocation_source: None -# allocation_source_class: None -# allocation_source_year: None -# allocation_flow: None -# allocation_compartment: None -# allocation_from_scale: state -# activity_set_2: -# names: -# - "Industrial" -# allocation_method: proportional -# allocation_source: "StatCan_IWS_MI" -# allocation_source_class: "Water" -# allocation_source_year: 2011 -# allocation_flow: -# - "Water intake" -# allocation_compartment: None -# allocation_from_scale: national -# clean_allocation_fba: !script_function:StatCan_IWS_MI convert_statcan_data_to_US_water_use -# helper_source: "BLS_QCEW" -# helper_method: proportional -# helper_source_class: "Employment" -# helper_source_year: 2011 -# helper_flow: -# - "Number of employees, Federal Government" -# - "Number of employees, State Government" -# - "Number of employees, Local Government" -# - "Number of employees, Private" -# helper_from_scale: national -# clean_helper_fba_wsec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec -# activity_set_3: -# names: -# - "Mining" -# allocation_method: proportional -# allocation_source: "Blackhurst_IO" -# allocation_source_class: "Water" -# allocation_source_year: 2002 -# allocation_flow: -# - 'Water Withdrawals IO Vector' -# allocation_compartment: None -# allocation_from_scale: national -# clean_allocation_fba: !script_function:Blackhurst_IO convert_blackhurst_data_to_kg_per_year -# clean_allocation_fba_w_sec: !script_function:Blackhurst_IO convert_blackhurst_data_to_kg_per_employee -# helper_source: "BLS_QCEW" -# helper_method: "multiplication and scaled" -# helper_source_class: "Employment" -# helper_source_year: 2010 -# helper_flow: -# - "Number of employees, Federal Government" -# - "Number of employees, State Government" -# - "Number of employees, Local Government" -# - "Number of employees, Private" -# helper_from_scale: national -# clean_helper_fba_wsec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec -# scale_helper_results: !script_function:Blackhurst_IO scale_blackhurst_results_to_usgs_values -# activity_set_4: -# names: -# - "Irrigation Crop" -# allocation_method: proportional -# allocation_source: "USDA_IWMS" -# allocation_source_class: "Land" -# allocation_source_year: 2013 -# allocation_flow: None -# allocation_compartment: None -# allocation_from_scale: state -# clean_allocation_fba_w_sec: !script_function:USDA_IWMS disaggregate_iwms_to_6_digit_naics_for_water_withdrawal -# helper_source: "USDA_IWMS" -# helper_method: multiplication -# helper_source_class: "Water" -# helper_source_year: 2013 -# helper_flow: None -# helper_from_scale: state -# activity_set_5: -# names: -# - "Livestock" -# allocation_method: proportional -# allocation_source: "USDA_CoA_Livestock" -# allocation_source_class: "Other" -# allocation_source_year: 2012 -# allocation_flow: -# - "HEAD" -# - "NUMBER" -# - "COLONIES" -# allocation_compartment: -# - "NOT SPECIFIED" -# allocation_from_scale: state -# helper_source: "USGS_WU_Coef" -# helper_method: multiplication -# helper_source_class: "Water" -# helper_source_year: 2005 -# helper_flow: None -# helper_from_scale: national diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m2.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m2.yaml deleted file mode 100644 index 299160af1..000000000 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m2.yaml +++ /dev/null @@ -1,96 +0,0 @@ -# This is the 2015 target year method for water m2 which builds off the generic -# method in Water_common - -industry_spec: - default: NAICS_6 -year: &year 2015 -target_naics_year: 2012 -geoscale: national - -sources_to_cache: - USDA_IWMS: - !include:Water_common.yaml:sources_to_cache:USDA_IWMS - year: 2018 - -source_names: - USGS_NWIS_WU: - !include:Water_common.yaml:source_names:USGS_NWIS_WU - activity_sets: # do not import all activity sets from the common file because common file contains activity sets for multiple methods -# direct_attribution: -# !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:direct_attribution - mining_attribution: -# !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:mining_attribution - selection_fields: - PrimaryActivity: - - "Mining" - attribution_method: proportional - attribution_source: - Blackhurst_IO: - year: 2002 - geoscale: national - selection_fields: - Class: Water - FlowName: "Water Withdrawals IO Vector" - attribute: - # convert to kg/year for 2002 - - attribution_method: multiplication - attribution_source: - BEA_Make_AR: - year: 2002 - selection_fields: - Class: Money - attribution_method: proportional - attribution_source: Employment_national_2002 - # scale to year of USGS data - - attribution_method: multiplication - attribution_source: Employment_national_2015 - industrial_attribution: -# !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:industrial_attribution - selection_fields: - PrimaryActivity: - - "Industrial" - attribution_method: proportional - attribution_source: - StatCan_IWS_MI: - year: 2015 - geoscale: national - selection_fields: - Class: Water - FlowName: "Water intake" - Location: {'124': '00000'} # replace canadian ISO with FIPS - LocationSystem: {'ISO': 'FIPS_2015'} - # todo: convert clean fba fxn into this yaml -# clean_allocation_fba: !script_function:StatCan_IWS_MI convert_statcan_data_to_US_water_use - attribution_method: division - attribution_source: - StatCan_GDP: - year: 2015 - selection_fields: - Class: Money - Location: {'124': '00000'} # replace canadian ISO with FIPS - LocationSystem: {'ISO': 'FIPS_2015'} - attribution_method: multiplication - attribution_source: - BEA_GDP_GrossOutput: - year: 2015 - activity_to_sector_mapping: BEA_2012_Detail - selection_fields: - Class: Money - attribution_method: proportional - attribution_source: - Employment_national_2015: - geoscale: national - cropland_attribution: - !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland: - !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution:attribution_source:USDA_CoA_Cropland - year: 2017 - livestock_attribution: - !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:livestock_attribution - attribution_method: proportional - attribution_source: - USDA_CoA_Livestock: - !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:livestock_attribution:attribution_source:USDA_CoA_Livestock - year: 2017 diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m3.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m3.yaml deleted file mode 100644 index bac8a4985..000000000 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m3.yaml +++ /dev/null @@ -1,104 +0,0 @@ -#target_sector_level: NAICS_6 -#target_sector_source: NAICS_2012_Code -#target_geoscale: national -#source_names: -# "USGS_NWIS_WU": -# data_format: 'FBA' -# class: Water -# geoscale_to_use: state -# year: 2015 -# clean_fba_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup -# clean_fba_w_sec_df_fxn: !script_function:USGS_NWIS_WU usgs_fba_w_sectors_data_cleanup -# activity_sets: -# activity_set_1: -# names: -# - "Aquaculture" -# - "Irrigation Golf Courses" -# - "Public Supply" -# - "Domestic" -# allocation_method: direct -# allocation_source: None -# allocation_source_class: None -# allocation_source_year: None -# allocation_flow: None -# allocation_compartment: None -# allocation_from_scale: state -# activity_set_2: -# names: -# - "Thermoelectric Power" -# allocation_method: proportional -# allocation_source: "NETL_EIA_PlantWater" -# allocation_source_class: "Water" -# allocation_source_year: 2015 -# allocation_flow: -# - 'Fresh Water Withdrawal' -# - 'Saline Water Withdrawal' -# - 'Brackish Water Withdrawal' -# allocation_compartment: -# - 'Surface' -# - 'Ground' -# allocation_from_scale: national -# clean_allocation_fba: !script_function:NETL_EIA_PlantWater clean_plantwater_fba -# allocation_map_to_flow_list: True -# allocation_merge_columns: -# - 'Context' -# - 'Flowable' -# activity_set_3: -# names: -# - "Industrial" -# - "Mining" -# allocation_method: proportional -# allocation_source: "BLS_QCEW" -# allocation_source_class: "Employment" -# allocation_source_year: 2015 -# allocation_flow: -# - "Number of employees, Federal Government" -# - "Number of employees, State Government" -# - "Number of employees, Local Government" -# - "Number of employees, Private" -# allocation_compartment: None -# allocation_from_scale: national -# clean_allocation_fba_w_sec: !script_function:BLS_QCEW bls_clean_allocation_fba_w_sec -# activity_set_4: -# names: -# - "Irrigation Crop" -# allocation_method: proportional -# allocation_source: "USDA_CoA_Cropland" -# allocation_source_class: "Land" -# allocation_source_year: 2017 -# allocation_flow: -# - "AREA HARVESTED, IRRIGATED" -# - "AREA IN PRODUCTION, IRRIGATED" -# - "AREA, IRRIGATED" -# - 'AREA BEARING & NON-BEARING, IRRIGATED' -# - 'AREA GROWN, IRRIGATED' -# allocation_compartment: None -# allocation_from_scale: state -# clean_allocation_fba_w_sec: !script_function:USDA_CoA_Cropland disaggregate_coa_cropland_to_6_digit_naics_for_water_withdrawal -# helper_source: "USDA_IWMS" -# helper_method: multiplication -# helper_source_class: "Water" -# helper_source_year: 2018 -# helper_flow: None -# helper_from_scale: state -# clean_helper_fba_wsec: !script_function:USDA_IWMS iwms_aggregation -# activity_set_5: -# names: -# - "Livestock" -# allocation_method: proportional -# allocation_source: "USDA_CoA_Livestock" -# allocation_source_class: "Other" -# allocation_source_year: 2017 -# allocation_flow: -# - "HEAD" -# - "NUMBER" -# - "COLONIES" -# allocation_compartment: -# - "NOT SPECIFIED" -# allocation_from_scale: state -# helper_source: "USGS_WU_Coef" -# helper_method: multiplication -# helper_source_class: "Water" -# helper_source_year: 2005 -# helper_flow: None -# helper_from_scale: national From 79c01814501b3674a451149112069db3cc488786 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 22 Aug 2023 12:25:31 -0600 Subject: [PATCH 0792/1127] drop water m2 blackhurst IO code --- flowsa/data_source_scripts/Blackhurst_IO.py | 157 -------------------- 1 file changed, 157 deletions(-) diff --git a/flowsa/data_source_scripts/Blackhurst_IO.py b/flowsa/data_source_scripts/Blackhurst_IO.py index 0cde1e20a..6fb7bfed3 100644 --- a/flowsa/data_source_scripts/Blackhurst_IO.py +++ b/flowsa/data_source_scripts/Blackhurst_IO.py @@ -49,160 +49,3 @@ def bh_parse(*, df_list, **_): df['DataCollection'] = 5 # tmp return df - - -# def convert_blackhurst_data_to_kg_per_year(df, **kwargs): -# """ -# Load BEA Make After Redefinition data to convert Blackhurst IO -# dataframe units to gallon per year -# :param df: df, FBA format -# :param kwargs: kwargs includes "attr" - dictionary, attribute -# data from method yaml for activity set -# :return: transformed fba df -# """ -# -# # load the bea make table -# bmt = load_fba_w_standardized_units( -# datasource='BEA_Make_AR', -# year=kwargs['attr']['allocation_source_year'], -# flowclass='Money', -# download_FBA_if_missing=kwargs['download_FBA_if_missing']) -# # drop rows with flowamount = 0 -# bmt = bmt[bmt['FlowAmount'] != 0] -# -# # check on units of dfs before merge -# compare_df_units(df, bmt) -# bh_df_revised = pd.merge( -# df, bmt[['FlowAmount', 'ActivityProducedBy', 'Location']], -# left_on=['ActivityConsumedBy', 'Location'], -# right_on=['ActivityProducedBy', 'Location']) -# -# bh_df_revised.loc[:, 'FlowAmount'] = ((bh_df_revised['FlowAmount_x']) * -# (bh_df_revised['FlowAmount_y'])) -# bh_df_revised.loc[:, 'Unit'] = 'kg' -# # drop columns -# bh_df_revised = bh_df_revised.drop(columns=["FlowAmount_x", "FlowAmount_y", -# 'ActivityProducedBy_y']) -# bh_df_revised = bh_df_revised.rename(columns={"ActivityProducedBy_x": -# "ActivityProducedBy"}) -# -# return bh_df_revised - - -# def convert_blackhurst_data_to_kg_per_employee( -# df_wsec, attr, method, **kwargs): -# """ -# Load BLS employment data and use to transform original units to -# gallons per employee -# :param df_wsec: df, includes sector columns -# :param attr: dictionary, attribute data from method yaml for activity set -# :param method: dictionary, FBS method yaml -# :return: df, transformed fba dataframe with sector columns -# """ -# -# # load 2002 employment data -# bls = load_fba_w_standardized_units( -# datasource='BLS_QCEW', year='2002', -# flowclass='Employment', geographic_level='national', -# download_FBA_if_missing=kwargs['download_FBA_if_missing']) -# -# # assign naics to allocation dataset -# bls_wsec = add_sectors_to_flowbyactivity( -# bls, sectorsourcename=method['target_sector_source']) -# # drop rows where sector = None ( does not occur with mining) -# bls_wsec = bls_wsec[~bls_wsec['SectorProducedBy'].isnull()] -# bls_wsec = bls_wsec.rename(columns={'SectorProducedBy': 'Sector', -# 'FlowAmount': 'HelperFlow'}) -# -# # check units before merge -# compare_df_units(df_wsec, bls_wsec) -# # merge the two dfs -# df = pd.merge(df_wsec, -# bls_wsec[['Location', 'Sector', 'HelperFlow']], -# how='left', -# left_on=['Location', 'SectorConsumedBy'], -# right_on=['Location', 'Sector']) -# # drop any rows where sector is None -# df = df[~df['Sector'].isnull()] -# # fill helperflow values with 0 -# df['HelperFlow'] = df['HelperFlow'].fillna(0) -# -# # calculate proportional ratios -# df_wratio = proportional_allocation_by_location_and_activity(df, 'Sector') -# -# df_wratio = df_wratio.rename(columns={'FlowAmountRatio': 'EmployeeRatio', -# 'HelperFlow': 'Employees'}) -# -# # drop rows where helperflow = 0 -# df_wratio = df_wratio[df_wratio['Employees'] != 0] -# -# # calculate gal/employee in 2002 -# df_wratio.loc[:, 'FlowAmount'] = \ -# (df_wratio['FlowAmount'] * df_wratio['EmployeeRatio']) / \ -# df_wratio['Employees'] -# df_wratio.loc[:, 'Unit'] = 'kg/p' -# -# # drop cols -# df_wratio = df_wratio.drop( -# columns=['Sector', 'Employees', 'EmployeeRatio']) -# -# return df_wratio - - -# def scale_blackhurst_results_to_usgs_values(fbs: FlowBySector, **_) -> \ -# FlowBySector: -# """ -# Scale the initial estimates for Blackhurst-based mining estimates to -# USGS values. Oil-based sectors are allocated a larger percentage of the -# difference between initial water withdrawal estimates and published USGS -# values. -# -# This method is based off the Water Satellite Table created by Yang and -# Ingwersen, 2017 -# :param df_load: df, fba dataframe to be modified -# :param attr: dictionary, attribute data from method yaml for activity set -# :param download_FBA_if_missing: bool, indicate if missing FBAs should be -# downloaded from Data Commons -# :return: scaled fba results -# """ -# from flowsa.flowbyclean import load_prepare_clean_source -# # determine national level published withdrawal data for usgs mining -# # in FBS method year -# # pv_load = load_fba_w_standardized_units( -# # datasource="USGS_NWIS_WU", year=fbs.config['year'], -# # flowclass='Water', download_FBA_if_missing=download_FBA_if_missing) -# # -# # pv_sub = pv_load[(pv_load['ActivityConsumedBy'] == 'Mining') & -# # (pv_load['Compartment'] == 'total') & -# # (pv_load['FlowName'] == 'total')].reset_index(drop=True) -# pv_sub = load_prepare_clean_source(fbs) -# pv_sub_sum = pv_sub['FlowAmount'].sum() -# -# # rename the published value flow name and merge with Blackhurst data -# pv_sub = pv_sub.rename(columns={'FlowAmount': 'pv'}) -# df = fbs.merge(pv_sub[['SectorConsumedBy', 'Location', 'pv']], how='left') -# # calculate the difference between published value and allocated value -# # for each naics length -# df = df.assign(nLen=df['SectorConsumedBy'].apply(lambda x: len(x))) -# # calculate initial FlowAmount accounted for -# df = df.assign(av=df.groupby('nLen')['FlowAmount'].transform('sum')) -# # calc difference -# df = df.assign(vd=df['pv'] - df['av']) -# -# # subset df to scale into oil and non-oil sectors -# df['sector_label'] = np.where(df['SectorConsumedBy'].apply( -# lambda x: x[0:5] == '21111'), 'oil', 'nonoil') -# df['ratio'] = np.where(df['sector_label'] == 'oil', 2 / 3, 1 / 3) -# df['label_sum'] = df.groupby(['Location', 'nLen', 'sector_label'])[ -# 'FlowAmount'].transform('sum') -# -# # calculate revised water withdrawal allocation -# df_scaled = df.copy() -# df_scaled.loc[:, 'FlowAmount'] = \ -# df_scaled['FlowAmount'] + \ -# (df_scaled['FlowAmount'] / df_scaled['label_sum']) * \ -# (df_scaled['ratio'] * df_scaled['vd']) -# df_scaled = df_scaled.drop(columns=['sector_label', 'ratio', 'nLen', -# 'label_sum', 'pv', 'av', 'vd']) -# -# return df_scaled From 9f350afd9834697b9a624546e2affd523f92cfcb Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 22 Aug 2023 14:32:55 -0400 Subject: [PATCH 0793/1127] add S00203 to BEA crosswalks, tweak sorting approach for consistent regeneration --- .../NAICS_Crosswalk_BEA_2012_Detail.csv | 367 +++++++++--------- .../NAICS_Crosswalk_BEA_2012_Summary.csv | 65 ++-- .../write_Crosswalk_BEA_2012.py | 4 +- 3 files changed, 219 insertions(+), 217 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_BEA_2012_Detail.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_BEA_2012_Detail.csv index 2640b2f48..6ebadd7ff 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_BEA_2012_Detail.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_BEA_2012_Detail.csv @@ -108,9 +108,9 @@ BEA_2012_Detail_Code,221300,NAICS_2012_Code,221320, BEA_2012_Detail_Code,221300,NAICS_2012_Code,221330, BEA_2012_Detail_Code,233411,NAICS_2012_Code,236115, BEA_2012_Detail_Code,233412,NAICS_2012_Code,236116, -BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,236117, -BEA_2012_Detail_Code,233412,NAICS_2012_Code,236117, BEA_2012_Detail_Code,233411,NAICS_2012_Code,236117, +BEA_2012_Detail_Code,233412,NAICS_2012_Code,236117, +BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,236117, BEA_2012_Detail_Code,230302,NAICS_2012_Code,236118, BEA_2012_Detail_Code,230301,NAICS_2012_Code,236210, BEA_2012_Detail_Code,233230,NAICS_2012_Code,236210, @@ -121,227 +121,227 @@ BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,236220, BEA_2012_Detail_Code,233240,NAICS_2012_Code,237110, BEA_2012_Detail_Code,233240,NAICS_2012_Code,237120, BEA_2012_Detail_Code,233240,NAICS_2012_Code,237130, -BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,237210, -BEA_2012_Detail_Code,233412,NAICS_2012_Code,237210, -BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,237210, -BEA_2012_Detail_Code,2332C0,NAICS_2012_Code,237210, -BEA_2012_Detail_Code,233411,NAICS_2012_Code,237210, -BEA_2012_Detail_Code,233262,NAICS_2012_Code,237210, -BEA_2012_Detail_Code,233240,NAICS_2012_Code,237210, -BEA_2012_Detail_Code,233230,NAICS_2012_Code,237210, BEA_2012_Detail_Code,233210,NAICS_2012_Code,237210, +BEA_2012_Detail_Code,233230,NAICS_2012_Code,237210, +BEA_2012_Detail_Code,233240,NAICS_2012_Code,237210, +BEA_2012_Detail_Code,233262,NAICS_2012_Code,237210, BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,237210, +BEA_2012_Detail_Code,2332C0,NAICS_2012_Code,237210, +BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,237210, +BEA_2012_Detail_Code,233411,NAICS_2012_Code,237210, +BEA_2012_Detail_Code,233412,NAICS_2012_Code,237210, +BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,237210, BEA_2012_Detail_Code,2332C0,NAICS_2012_Code,237310, BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,237990, -BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238110, -BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238110, -BEA_2012_Detail_Code,233412,NAICS_2012_Code,238110, -BEA_2012_Detail_Code,233411,NAICS_2012_Code,238110, -BEA_2012_Detail_Code,233262,NAICS_2012_Code,238110, -BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238110, -BEA_2012_Detail_Code,233230,NAICS_2012_Code,238110, -BEA_2012_Detail_Code,233210,NAICS_2012_Code,238110, -BEA_2012_Detail_Code,230302,NAICS_2012_Code,238110, BEA_2012_Detail_Code,230301,NAICS_2012_Code,238110, +BEA_2012_Detail_Code,230302,NAICS_2012_Code,238110, +BEA_2012_Detail_Code,233210,NAICS_2012_Code,238110, +BEA_2012_Detail_Code,233230,NAICS_2012_Code,238110, BEA_2012_Detail_Code,233240,NAICS_2012_Code,238110, +BEA_2012_Detail_Code,233262,NAICS_2012_Code,238110, +BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238110, +BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238110, +BEA_2012_Detail_Code,233411,NAICS_2012_Code,238110, +BEA_2012_Detail_Code,233412,NAICS_2012_Code,238110, +BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238110, +BEA_2012_Detail_Code,230301,NAICS_2012_Code,238120, +BEA_2012_Detail_Code,230302,NAICS_2012_Code,238120, +BEA_2012_Detail_Code,233210,NAICS_2012_Code,238120, +BEA_2012_Detail_Code,233230,NAICS_2012_Code,238120, +BEA_2012_Detail_Code,233240,NAICS_2012_Code,238120, BEA_2012_Detail_Code,233262,NAICS_2012_Code,238120, -BEA_2012_Detail_Code,233412,NAICS_2012_Code,238120, -BEA_2012_Detail_Code,233411,NAICS_2012_Code,238120, -BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238120, BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238120, -BEA_2012_Detail_Code,233230,NAICS_2012_Code,238120, +BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238120, +BEA_2012_Detail_Code,233411,NAICS_2012_Code,238120, +BEA_2012_Detail_Code,233412,NAICS_2012_Code,238120, BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238120, -BEA_2012_Detail_Code,233210,NAICS_2012_Code,238120, -BEA_2012_Detail_Code,230302,NAICS_2012_Code,238120, -BEA_2012_Detail_Code,230301,NAICS_2012_Code,238120, -BEA_2012_Detail_Code,233240,NAICS_2012_Code,238120, -BEA_2012_Detail_Code,233411,NAICS_2012_Code,238130, -BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238130, -BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238130, -BEA_2012_Detail_Code,233412,NAICS_2012_Code,238130, +BEA_2012_Detail_Code,230301,NAICS_2012_Code,238130, +BEA_2012_Detail_Code,230302,NAICS_2012_Code,238130, +BEA_2012_Detail_Code,233210,NAICS_2012_Code,238130, +BEA_2012_Detail_Code,233230,NAICS_2012_Code,238130, +BEA_2012_Detail_Code,233240,NAICS_2012_Code,238130, BEA_2012_Detail_Code,233262,NAICS_2012_Code,238130, BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238130, -BEA_2012_Detail_Code,233240,NAICS_2012_Code,238130, -BEA_2012_Detail_Code,233230,NAICS_2012_Code,238130, -BEA_2012_Detail_Code,233210,NAICS_2012_Code,238130, -BEA_2012_Detail_Code,230302,NAICS_2012_Code,238130, -BEA_2012_Detail_Code,230301,NAICS_2012_Code,238130, -BEA_2012_Detail_Code,233412,NAICS_2012_Code,238140, -BEA_2012_Detail_Code,233411,NAICS_2012_Code,238140, -BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238140, -BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238140, -BEA_2012_Detail_Code,233262,NAICS_2012_Code,238140, -BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238140, -BEA_2012_Detail_Code,233230,NAICS_2012_Code,238140, -BEA_2012_Detail_Code,233210,NAICS_2012_Code,238140, -BEA_2012_Detail_Code,230302,NAICS_2012_Code,238140, +BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238130, +BEA_2012_Detail_Code,233411,NAICS_2012_Code,238130, +BEA_2012_Detail_Code,233412,NAICS_2012_Code,238130, +BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238130, BEA_2012_Detail_Code,230301,NAICS_2012_Code,238140, +BEA_2012_Detail_Code,230302,NAICS_2012_Code,238140, +BEA_2012_Detail_Code,233210,NAICS_2012_Code,238140, +BEA_2012_Detail_Code,233230,NAICS_2012_Code,238140, BEA_2012_Detail_Code,233240,NAICS_2012_Code,238140, -BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238150, -BEA_2012_Detail_Code,233412,NAICS_2012_Code,238150, -BEA_2012_Detail_Code,233411,NAICS_2012_Code,238150, -BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238150, -BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238150, -BEA_2012_Detail_Code,233240,NAICS_2012_Code,238150, -BEA_2012_Detail_Code,233230,NAICS_2012_Code,238150, -BEA_2012_Detail_Code,233210,NAICS_2012_Code,238150, -BEA_2012_Detail_Code,230302,NAICS_2012_Code,238150, +BEA_2012_Detail_Code,233262,NAICS_2012_Code,238140, +BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238140, +BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238140, +BEA_2012_Detail_Code,233411,NAICS_2012_Code,238140, +BEA_2012_Detail_Code,233412,NAICS_2012_Code,238140, +BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238140, BEA_2012_Detail_Code,230301,NAICS_2012_Code,238150, +BEA_2012_Detail_Code,230302,NAICS_2012_Code,238150, +BEA_2012_Detail_Code,233210,NAICS_2012_Code,238150, +BEA_2012_Detail_Code,233230,NAICS_2012_Code,238150, +BEA_2012_Detail_Code,233240,NAICS_2012_Code,238150, BEA_2012_Detail_Code,233262,NAICS_2012_Code,238150, -BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238160, -BEA_2012_Detail_Code,233412,NAICS_2012_Code,238160, -BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238160, -BEA_2012_Detail_Code,233262,NAICS_2012_Code,238160, -BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238160, -BEA_2012_Detail_Code,233230,NAICS_2012_Code,238160, -BEA_2012_Detail_Code,233240,NAICS_2012_Code,238160, +BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238150, +BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238150, +BEA_2012_Detail_Code,233411,NAICS_2012_Code,238150, +BEA_2012_Detail_Code,233412,NAICS_2012_Code,238150, +BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238150, BEA_2012_Detail_Code,230301,NAICS_2012_Code,238160, -BEA_2012_Detail_Code,233411,NAICS_2012_Code,238160, BEA_2012_Detail_Code,230302,NAICS_2012_Code,238160, BEA_2012_Detail_Code,233210,NAICS_2012_Code,238160, -BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238170, -BEA_2012_Detail_Code,233412,NAICS_2012_Code,238170, -BEA_2012_Detail_Code,233411,NAICS_2012_Code,238170, -BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238170, -BEA_2012_Detail_Code,233262,NAICS_2012_Code,238170, -BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238170, -BEA_2012_Detail_Code,233230,NAICS_2012_Code,238170, -BEA_2012_Detail_Code,233210,NAICS_2012_Code,238170, -BEA_2012_Detail_Code,230302,NAICS_2012_Code,238170, +BEA_2012_Detail_Code,233230,NAICS_2012_Code,238160, +BEA_2012_Detail_Code,233240,NAICS_2012_Code,238160, +BEA_2012_Detail_Code,233262,NAICS_2012_Code,238160, +BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238160, +BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238160, +BEA_2012_Detail_Code,233411,NAICS_2012_Code,238160, +BEA_2012_Detail_Code,233412,NAICS_2012_Code,238160, +BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238160, BEA_2012_Detail_Code,230301,NAICS_2012_Code,238170, +BEA_2012_Detail_Code,230302,NAICS_2012_Code,238170, +BEA_2012_Detail_Code,233210,NAICS_2012_Code,238170, +BEA_2012_Detail_Code,233230,NAICS_2012_Code,238170, BEA_2012_Detail_Code,233240,NAICS_2012_Code,238170, -BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238190, -BEA_2012_Detail_Code,233412,NAICS_2012_Code,238190, -BEA_2012_Detail_Code,233411,NAICS_2012_Code,238190, -BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238190, -BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238190, -BEA_2012_Detail_Code,233240,NAICS_2012_Code,238190, +BEA_2012_Detail_Code,233262,NAICS_2012_Code,238170, +BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238170, +BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238170, +BEA_2012_Detail_Code,233411,NAICS_2012_Code,238170, +BEA_2012_Detail_Code,233412,NAICS_2012_Code,238170, +BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238170, +BEA_2012_Detail_Code,230301,NAICS_2012_Code,238190, +BEA_2012_Detail_Code,230302,NAICS_2012_Code,238190, BEA_2012_Detail_Code,233210,NAICS_2012_Code,238190, BEA_2012_Detail_Code,233230,NAICS_2012_Code,238190, -BEA_2012_Detail_Code,230302,NAICS_2012_Code,238190, -BEA_2012_Detail_Code,230301,NAICS_2012_Code,238190, +BEA_2012_Detail_Code,233240,NAICS_2012_Code,238190, BEA_2012_Detail_Code,233262,NAICS_2012_Code,238190, -BEA_2012_Detail_Code,233412,NAICS_2012_Code,238210, -BEA_2012_Detail_Code,233411,NAICS_2012_Code,238210, -BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238210, -BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238210, -BEA_2012_Detail_Code,233262,NAICS_2012_Code,238210, -BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238210, -BEA_2012_Detail_Code,233210,NAICS_2012_Code,238210, -BEA_2012_Detail_Code,230302,NAICS_2012_Code,238210, +BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238190, +BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238190, +BEA_2012_Detail_Code,233411,NAICS_2012_Code,238190, +BEA_2012_Detail_Code,233412,NAICS_2012_Code,238190, +BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238190, BEA_2012_Detail_Code,230301,NAICS_2012_Code,238210, -BEA_2012_Detail_Code,233240,NAICS_2012_Code,238210, +BEA_2012_Detail_Code,230302,NAICS_2012_Code,238210, +BEA_2012_Detail_Code,233210,NAICS_2012_Code,238210, BEA_2012_Detail_Code,233230,NAICS_2012_Code,238210, -BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238220, -BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238220, -BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238220, -BEA_2012_Detail_Code,233412,NAICS_2012_Code,238220, -BEA_2012_Detail_Code,233262,NAICS_2012_Code,238220, -BEA_2012_Detail_Code,233411,NAICS_2012_Code,238220, -BEA_2012_Detail_Code,233230,NAICS_2012_Code,238220, +BEA_2012_Detail_Code,233240,NAICS_2012_Code,238210, +BEA_2012_Detail_Code,233262,NAICS_2012_Code,238210, +BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238210, +BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238210, +BEA_2012_Detail_Code,233411,NAICS_2012_Code,238210, +BEA_2012_Detail_Code,233412,NAICS_2012_Code,238210, +BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238210, BEA_2012_Detail_Code,230301,NAICS_2012_Code,238220, BEA_2012_Detail_Code,230302,NAICS_2012_Code,238220, -BEA_2012_Detail_Code,233240,NAICS_2012_Code,238220, BEA_2012_Detail_Code,233210,NAICS_2012_Code,238220, -BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238290, -BEA_2012_Detail_Code,233412,NAICS_2012_Code,238290, -BEA_2012_Detail_Code,233411,NAICS_2012_Code,238290, -BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238290, -BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238290, -BEA_2012_Detail_Code,233230,NAICS_2012_Code,238290, -BEA_2012_Detail_Code,233210,NAICS_2012_Code,238290, -BEA_2012_Detail_Code,230302,NAICS_2012_Code,238290, +BEA_2012_Detail_Code,233230,NAICS_2012_Code,238220, +BEA_2012_Detail_Code,233240,NAICS_2012_Code,238220, +BEA_2012_Detail_Code,233262,NAICS_2012_Code,238220, +BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238220, +BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238220, +BEA_2012_Detail_Code,233411,NAICS_2012_Code,238220, +BEA_2012_Detail_Code,233412,NAICS_2012_Code,238220, +BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238220, BEA_2012_Detail_Code,230301,NAICS_2012_Code,238290, +BEA_2012_Detail_Code,230302,NAICS_2012_Code,238290, +BEA_2012_Detail_Code,233210,NAICS_2012_Code,238290, +BEA_2012_Detail_Code,233230,NAICS_2012_Code,238290, BEA_2012_Detail_Code,233240,NAICS_2012_Code,238290, BEA_2012_Detail_Code,233262,NAICS_2012_Code,238290, -BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238310, -BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238310, -BEA_2012_Detail_Code,233412,NAICS_2012_Code,238310, -BEA_2012_Detail_Code,233411,NAICS_2012_Code,238310, -BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238310, -BEA_2012_Detail_Code,233262,NAICS_2012_Code,238310, -BEA_2012_Detail_Code,233230,NAICS_2012_Code,238310, -BEA_2012_Detail_Code,233210,NAICS_2012_Code,238310, -BEA_2012_Detail_Code,230302,NAICS_2012_Code,238310, +BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238290, +BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238290, +BEA_2012_Detail_Code,233411,NAICS_2012_Code,238290, +BEA_2012_Detail_Code,233412,NAICS_2012_Code,238290, +BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238290, BEA_2012_Detail_Code,230301,NAICS_2012_Code,238310, +BEA_2012_Detail_Code,230302,NAICS_2012_Code,238310, +BEA_2012_Detail_Code,233210,NAICS_2012_Code,238310, +BEA_2012_Detail_Code,233230,NAICS_2012_Code,238310, BEA_2012_Detail_Code,233240,NAICS_2012_Code,238310, -BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238320, -BEA_2012_Detail_Code,233412,NAICS_2012_Code,238320, -BEA_2012_Detail_Code,233411,NAICS_2012_Code,238320, -BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238320, -BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238320, -BEA_2012_Detail_Code,233262,NAICS_2012_Code,238320, -BEA_2012_Detail_Code,233230,NAICS_2012_Code,238320, -BEA_2012_Detail_Code,233210,NAICS_2012_Code,238320, -BEA_2012_Detail_Code,230302,NAICS_2012_Code,238320, +BEA_2012_Detail_Code,233262,NAICS_2012_Code,238310, +BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238310, +BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238310, +BEA_2012_Detail_Code,233411,NAICS_2012_Code,238310, +BEA_2012_Detail_Code,233412,NAICS_2012_Code,238310, +BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238310, BEA_2012_Detail_Code,230301,NAICS_2012_Code,238320, +BEA_2012_Detail_Code,230302,NAICS_2012_Code,238320, +BEA_2012_Detail_Code,233210,NAICS_2012_Code,238320, +BEA_2012_Detail_Code,233230,NAICS_2012_Code,238320, BEA_2012_Detail_Code,233240,NAICS_2012_Code,238320, -BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238330, -BEA_2012_Detail_Code,233412,NAICS_2012_Code,238330, -BEA_2012_Detail_Code,233411,NAICS_2012_Code,238330, -BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238330, -BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238330, +BEA_2012_Detail_Code,233262,NAICS_2012_Code,238320, +BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238320, +BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238320, +BEA_2012_Detail_Code,233411,NAICS_2012_Code,238320, +BEA_2012_Detail_Code,233412,NAICS_2012_Code,238320, +BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238320, +BEA_2012_Detail_Code,230301,NAICS_2012_Code,238330, +BEA_2012_Detail_Code,230302,NAICS_2012_Code,238330, +BEA_2012_Detail_Code,233210,NAICS_2012_Code,238330, BEA_2012_Detail_Code,233230,NAICS_2012_Code,238330, BEA_2012_Detail_Code,233240,NAICS_2012_Code,238330, -BEA_2012_Detail_Code,233210,NAICS_2012_Code,238330, -BEA_2012_Detail_Code,230302,NAICS_2012_Code,238330, -BEA_2012_Detail_Code,230301,NAICS_2012_Code,238330, BEA_2012_Detail_Code,233262,NAICS_2012_Code,238330, -BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238340, -BEA_2012_Detail_Code,233412,NAICS_2012_Code,238340, -BEA_2012_Detail_Code,233411,NAICS_2012_Code,238340, -BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238340, -BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238340, -BEA_2012_Detail_Code,233262,NAICS_2012_Code,238340, -BEA_2012_Detail_Code,233230,NAICS_2012_Code,238340, -BEA_2012_Detail_Code,233210,NAICS_2012_Code,238340, -BEA_2012_Detail_Code,230302,NAICS_2012_Code,238340, +BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238330, +BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238330, +BEA_2012_Detail_Code,233411,NAICS_2012_Code,238330, +BEA_2012_Detail_Code,233412,NAICS_2012_Code,238330, +BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238330, BEA_2012_Detail_Code,230301,NAICS_2012_Code,238340, +BEA_2012_Detail_Code,230302,NAICS_2012_Code,238340, +BEA_2012_Detail_Code,233210,NAICS_2012_Code,238340, +BEA_2012_Detail_Code,233230,NAICS_2012_Code,238340, BEA_2012_Detail_Code,233240,NAICS_2012_Code,238340, -BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238350, -BEA_2012_Detail_Code,233412,NAICS_2012_Code,238350, -BEA_2012_Detail_Code,233411,NAICS_2012_Code,238350, -BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238350, -BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238350, +BEA_2012_Detail_Code,233262,NAICS_2012_Code,238340, +BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238340, +BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238340, +BEA_2012_Detail_Code,233411,NAICS_2012_Code,238340, +BEA_2012_Detail_Code,233412,NAICS_2012_Code,238340, +BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238340, +BEA_2012_Detail_Code,230301,NAICS_2012_Code,238350, +BEA_2012_Detail_Code,230302,NAICS_2012_Code,238350, +BEA_2012_Detail_Code,233210,NAICS_2012_Code,238350, BEA_2012_Detail_Code,233230,NAICS_2012_Code,238350, BEA_2012_Detail_Code,233240,NAICS_2012_Code,238350, -BEA_2012_Detail_Code,233210,NAICS_2012_Code,238350, -BEA_2012_Detail_Code,230302,NAICS_2012_Code,238350, -BEA_2012_Detail_Code,230301,NAICS_2012_Code,238350, BEA_2012_Detail_Code,233262,NAICS_2012_Code,238350, -BEA_2012_Detail_Code,233412,NAICS_2012_Code,238390, -BEA_2012_Detail_Code,233411,NAICS_2012_Code,238390, -BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238390, -BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238390, -BEA_2012_Detail_Code,233262,NAICS_2012_Code,238390, -BEA_2012_Detail_Code,233230,NAICS_2012_Code,238390, -BEA_2012_Detail_Code,233210,NAICS_2012_Code,238390, -BEA_2012_Detail_Code,230302,NAICS_2012_Code,238390, +BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238350, +BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238350, +BEA_2012_Detail_Code,233411,NAICS_2012_Code,238350, +BEA_2012_Detail_Code,233412,NAICS_2012_Code,238350, +BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238350, BEA_2012_Detail_Code,230301,NAICS_2012_Code,238390, -BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238390, +BEA_2012_Detail_Code,230302,NAICS_2012_Code,238390, +BEA_2012_Detail_Code,233210,NAICS_2012_Code,238390, +BEA_2012_Detail_Code,233230,NAICS_2012_Code,238390, BEA_2012_Detail_Code,233240,NAICS_2012_Code,238390, -BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238910, +BEA_2012_Detail_Code,233262,NAICS_2012_Code,238390, +BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238390, +BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238390, +BEA_2012_Detail_Code,233411,NAICS_2012_Code,238390, +BEA_2012_Detail_Code,233412,NAICS_2012_Code,238390, +BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238390, +BEA_2012_Detail_Code,230301,NAICS_2012_Code,238910, +BEA_2012_Detail_Code,230302,NAICS_2012_Code,238910, +BEA_2012_Detail_Code,233210,NAICS_2012_Code,238910, +BEA_2012_Detail_Code,233230,NAICS_2012_Code,238910, +BEA_2012_Detail_Code,233240,NAICS_2012_Code,238910, +BEA_2012_Detail_Code,233262,NAICS_2012_Code,238910, BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238910, -BEA_2012_Detail_Code,233412,NAICS_2012_Code,238910, +BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238910, BEA_2012_Detail_Code,233411,NAICS_2012_Code,238910, -BEA_2012_Detail_Code,233262,NAICS_2012_Code,238910, +BEA_2012_Detail_Code,233412,NAICS_2012_Code,238910, BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238910, -BEA_2012_Detail_Code,233230,NAICS_2012_Code,238910, -BEA_2012_Detail_Code,233210,NAICS_2012_Code,238910, -BEA_2012_Detail_Code,230302,NAICS_2012_Code,238910, -BEA_2012_Detail_Code,230301,NAICS_2012_Code,238910, -BEA_2012_Detail_Code,233240,NAICS_2012_Code,238910, -BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238990, -BEA_2012_Detail_Code,233412,NAICS_2012_Code,238990, -BEA_2012_Detail_Code,233411,NAICS_2012_Code,238990, -BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238990, -BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238990, -BEA_2012_Detail_Code,233240,NAICS_2012_Code,238990, -BEA_2012_Detail_Code,233230,NAICS_2012_Code,238990, -BEA_2012_Detail_Code,233210,NAICS_2012_Code,238990, -BEA_2012_Detail_Code,230302,NAICS_2012_Code,238990, BEA_2012_Detail_Code,230301,NAICS_2012_Code,238990, +BEA_2012_Detail_Code,230302,NAICS_2012_Code,238990, +BEA_2012_Detail_Code,233210,NAICS_2012_Code,238990, +BEA_2012_Detail_Code,233230,NAICS_2012_Code,238990, +BEA_2012_Detail_Code,233240,NAICS_2012_Code,238990, BEA_2012_Detail_Code,233262,NAICS_2012_Code,238990, +BEA_2012_Detail_Code,2332A0,NAICS_2012_Code,238990, +BEA_2012_Detail_Code,2332D0,NAICS_2012_Code,238990, +BEA_2012_Detail_Code,233411,NAICS_2012_Code,238990, +BEA_2012_Detail_Code,233412,NAICS_2012_Code,238990, +BEA_2012_Detail_Code,2334A0,NAICS_2012_Code,238990, BEA_2012_Detail_Code,311111,NAICS_2012_Code,311111, BEA_2012_Detail_Code,311119,NAICS_2012_Code,311119, BEA_2012_Detail_Code,311210,NAICS_2012_Code,311211, @@ -982,21 +982,21 @@ BEA_2012_Detail_Code,531ORE,NAICS_2012_Code,531110, BEA_2012_Detail_Code,531HSO,NAICS_2012_Code,531120, BEA_2012_Detail_Code,531HST,NAICS_2012_Code,531120, BEA_2012_Detail_Code,531ORE,NAICS_2012_Code,531120, +BEA_2012_Detail_Code,531HSO,NAICS_2012_Code,531130, BEA_2012_Detail_Code,531HST,NAICS_2012_Code,531130, BEA_2012_Detail_Code,531ORE,NAICS_2012_Code,531130, -BEA_2012_Detail_Code,531HSO,NAICS_2012_Code,531130, BEA_2012_Detail_Code,531HSO,NAICS_2012_Code,531190, BEA_2012_Detail_Code,531HST,NAICS_2012_Code,531190, BEA_2012_Detail_Code,531ORE,NAICS_2012_Code,531190, BEA_2012_Detail_Code,531HSO,NAICS_2012_Code,531210, BEA_2012_Detail_Code,531HST,NAICS_2012_Code,531210, BEA_2012_Detail_Code,531ORE,NAICS_2012_Code,531210, -BEA_2012_Detail_Code,531ORE,NAICS_2012_Code,531311, BEA_2012_Detail_Code,531HSO,NAICS_2012_Code,531311, BEA_2012_Detail_Code,531HST,NAICS_2012_Code,531311, +BEA_2012_Detail_Code,531ORE,NAICS_2012_Code,531311, +BEA_2012_Detail_Code,531HSO,NAICS_2012_Code,531312, BEA_2012_Detail_Code,531HST,NAICS_2012_Code,531312, BEA_2012_Detail_Code,531ORE,NAICS_2012_Code,531312, -BEA_2012_Detail_Code,531HSO,NAICS_2012_Code,531312, BEA_2012_Detail_Code,531HSO,NAICS_2012_Code,531320, BEA_2012_Detail_Code,531HST,NAICS_2012_Code,531320, BEA_2012_Detail_Code,531ORE,NAICS_2012_Code,531320, @@ -1005,8 +1005,8 @@ BEA_2012_Detail_Code,531HST,NAICS_2012_Code,531390, BEA_2012_Detail_Code,531ORE,NAICS_2012_Code,531390, BEA_2012_Detail_Code,531HSO,NAICS_2012_Code,532111, BEA_2012_Detail_Code,532100,NAICS_2012_Code,532111, -BEA_2012_Detail_Code,532100,NAICS_2012_Code,532112, BEA_2012_Detail_Code,531HSO,NAICS_2012_Code,532112, +BEA_2012_Detail_Code,532100,NAICS_2012_Code,532112, BEA_2012_Detail_Code,531HSO,NAICS_2012_Code,532120, BEA_2012_Detail_Code,532100,NAICS_2012_Code,532120, BEA_2012_Detail_Code,531HSO,NAICS_2012_Code,532210, @@ -1015,8 +1015,8 @@ BEA_2012_Detail_Code,531HSO,NAICS_2012_Code,532220, BEA_2012_Detail_Code,532A00,NAICS_2012_Code,532220, BEA_2012_Detail_Code,531HSO,NAICS_2012_Code,532230, BEA_2012_Detail_Code,532A00,NAICS_2012_Code,532230, -BEA_2012_Detail_Code,532A00,NAICS_2012_Code,532291, BEA_2012_Detail_Code,531HSO,NAICS_2012_Code,532291, +BEA_2012_Detail_Code,532A00,NAICS_2012_Code,532291, BEA_2012_Detail_Code,531HSO,NAICS_2012_Code,532292, BEA_2012_Detail_Code,532A00,NAICS_2012_Code,532292, BEA_2012_Detail_Code,531HSO,NAICS_2012_Code,532299, @@ -1025,8 +1025,8 @@ BEA_2012_Detail_Code,531HSO,NAICS_2012_Code,532310, BEA_2012_Detail_Code,532A00,NAICS_2012_Code,532310, BEA_2012_Detail_Code,531HSO,NAICS_2012_Code,532411, BEA_2012_Detail_Code,532400,NAICS_2012_Code,532411, -BEA_2012_Detail_Code,532400,NAICS_2012_Code,532412, BEA_2012_Detail_Code,531HSO,NAICS_2012_Code,532412, +BEA_2012_Detail_Code,532400,NAICS_2012_Code,532412, BEA_2012_Detail_Code,531HSO,NAICS_2012_Code,532420, BEA_2012_Detail_Code,532400,NAICS_2012_Code,532420, BEA_2012_Detail_Code,531HSO,NAICS_2012_Code,532490, @@ -1273,8 +1273,8 @@ BEA_2012_Detail_Code,813B00,NAICS_2012_Code,813930, BEA_2012_Detail_Code,813B00,NAICS_2012_Code,813940, BEA_2012_Detail_Code,813B00,NAICS_2012_Code,813990, BEA_2012_Detail_Code,814000,NAICS_2012_Code,814110, -BEA_2012_Detail_Code,S00600,NAICS_2012_Code,921110, BEA_2012_Detail_Code,GSLGO,NAICS_2012_Code,921110, +BEA_2012_Detail_Code,S00600,NAICS_2012_Code,921110, BEA_2012_Detail_Code,GSLGO,NAICS_2012_Code,921120, BEA_2012_Detail_Code,S00600,NAICS_2012_Code,921120, BEA_2012_Detail_Code,GSLGO,NAICS_2012_Code,921130, @@ -1284,8 +1284,8 @@ BEA_2012_Detail_Code,S00600,NAICS_2012_Code,921140, BEA_2012_Detail_Code,GSLGO,NAICS_2012_Code,921150, BEA_2012_Detail_Code,GSLGO,NAICS_2012_Code,921190, BEA_2012_Detail_Code,S00600,NAICS_2012_Code,921190, -BEA_2012_Detail_Code,S00600,NAICS_2012_Code,922110, BEA_2012_Detail_Code,GSLGO,NAICS_2012_Code,922110, +BEA_2012_Detail_Code,S00600,NAICS_2012_Code,922110, BEA_2012_Detail_Code,GSLGO,NAICS_2012_Code,922120, BEA_2012_Detail_Code,S00600,NAICS_2012_Code,922120, BEA_2012_Detail_Code,GSLGO,NAICS_2012_Code,922130, @@ -1294,8 +1294,8 @@ BEA_2012_Detail_Code,GSLGO,NAICS_2012_Code,922140, BEA_2012_Detail_Code,S00600,NAICS_2012_Code,922140, BEA_2012_Detail_Code,GSLGO,NAICS_2012_Code,922150, BEA_2012_Detail_Code,S00600,NAICS_2012_Code,922150, -BEA_2012_Detail_Code,S00600,NAICS_2012_Code,922160, BEA_2012_Detail_Code,GSLGO,NAICS_2012_Code,922160, +BEA_2012_Detail_Code,S00600,NAICS_2012_Code,922160, BEA_2012_Detail_Code,GSLGO,NAICS_2012_Code,922190, BEA_2012_Detail_Code,S00600,NAICS_2012_Code,922190, BEA_2012_Detail_Code,GSLGE,NAICS_2012_Code,923110, @@ -1305,8 +1305,8 @@ BEA_2012_Detail_Code,S00600,NAICS_2012_Code,923120, BEA_2012_Detail_Code,GSLGO,NAICS_2012_Code,923130, BEA_2012_Detail_Code,S00600,NAICS_2012_Code,923130, BEA_2012_Detail_Code,S00600,NAICS_2012_Code,923140, -BEA_2012_Detail_Code,S00600,NAICS_2012_Code,924110, BEA_2012_Detail_Code,GSLGO,NAICS_2012_Code,924110, +BEA_2012_Detail_Code,S00600,NAICS_2012_Code,924110, BEA_2012_Detail_Code,GSLGO,NAICS_2012_Code,924120, BEA_2012_Detail_Code,S00600,NAICS_2012_Code,924120, BEA_2012_Detail_Code,GSLGO,NAICS_2012_Code,925110, @@ -1329,3 +1329,4 @@ BEA_2012_Detail_Code,F01000,NAICS_2012_Code,F01000, BEA_2012_Detail_Code,S00101,NAICS_2012_Code,S00101, BEA_2012_Detail_Code,S00201,NAICS_2012_Code,S00201, BEA_2012_Detail_Code,S00202,NAICS_2012_Code,S00202, +BEA_2012_Detail_Code,S00203,NAICS_2012_Code,S00203, diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_BEA_2012_Summary.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_BEA_2012_Summary.csv index 9179537c3..d98ff1c4f 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_BEA_2012_Summary.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_BEA_2012_Summary.csv @@ -781,8 +781,8 @@ BEA_2012_Summary_Code,HS,NAICS_2012_Code,531190, BEA_2012_Summary_Code,ORE,NAICS_2012_Code,531190, BEA_2012_Summary_Code,HS,NAICS_2012_Code,531210, BEA_2012_Summary_Code,ORE,NAICS_2012_Code,531210, -BEA_2012_Summary_Code,ORE,NAICS_2012_Code,531311, BEA_2012_Summary_Code,HS,NAICS_2012_Code,531311, +BEA_2012_Summary_Code,ORE,NAICS_2012_Code,531311, BEA_2012_Summary_Code,HS,NAICS_2012_Code,531312, BEA_2012_Summary_Code,ORE,NAICS_2012_Code,531312, BEA_2012_Summary_Code,HS,NAICS_2012_Code,531320, @@ -791,32 +791,32 @@ BEA_2012_Summary_Code,HS,NAICS_2012_Code,531390, BEA_2012_Summary_Code,ORE,NAICS_2012_Code,531390, BEA_2012_Summary_Code,532RL,NAICS_2012_Code,532111, BEA_2012_Summary_Code,HS,NAICS_2012_Code,532111, -BEA_2012_Summary_Code,HS,NAICS_2012_Code,532112, BEA_2012_Summary_Code,532RL,NAICS_2012_Code,532112, -BEA_2012_Summary_Code,HS,NAICS_2012_Code,532120, +BEA_2012_Summary_Code,HS,NAICS_2012_Code,532112, BEA_2012_Summary_Code,532RL,NAICS_2012_Code,532120, -BEA_2012_Summary_Code,HS,NAICS_2012_Code,532210, +BEA_2012_Summary_Code,HS,NAICS_2012_Code,532120, BEA_2012_Summary_Code,532RL,NAICS_2012_Code,532210, -BEA_2012_Summary_Code,HS,NAICS_2012_Code,532220, +BEA_2012_Summary_Code,HS,NAICS_2012_Code,532210, BEA_2012_Summary_Code,532RL,NAICS_2012_Code,532220, +BEA_2012_Summary_Code,HS,NAICS_2012_Code,532220, BEA_2012_Summary_Code,532RL,NAICS_2012_Code,532230, BEA_2012_Summary_Code,HS,NAICS_2012_Code,532230, -BEA_2012_Summary_Code,HS,NAICS_2012_Code,532291, BEA_2012_Summary_Code,532RL,NAICS_2012_Code,532291, -BEA_2012_Summary_Code,HS,NAICS_2012_Code,532292, +BEA_2012_Summary_Code,HS,NAICS_2012_Code,532291, BEA_2012_Summary_Code,532RL,NAICS_2012_Code,532292, -BEA_2012_Summary_Code,HS,NAICS_2012_Code,532299, +BEA_2012_Summary_Code,HS,NAICS_2012_Code,532292, BEA_2012_Summary_Code,532RL,NAICS_2012_Code,532299, +BEA_2012_Summary_Code,HS,NAICS_2012_Code,532299, BEA_2012_Summary_Code,532RL,NAICS_2012_Code,532310, BEA_2012_Summary_Code,HS,NAICS_2012_Code,532310, -BEA_2012_Summary_Code,HS,NAICS_2012_Code,532411, BEA_2012_Summary_Code,532RL,NAICS_2012_Code,532411, -BEA_2012_Summary_Code,HS,NAICS_2012_Code,532412, +BEA_2012_Summary_Code,HS,NAICS_2012_Code,532411, BEA_2012_Summary_Code,532RL,NAICS_2012_Code,532412, -BEA_2012_Summary_Code,HS,NAICS_2012_Code,532420, +BEA_2012_Summary_Code,HS,NAICS_2012_Code,532412, BEA_2012_Summary_Code,532RL,NAICS_2012_Code,532420, -BEA_2012_Summary_Code,HS,NAICS_2012_Code,532490, +BEA_2012_Summary_Code,HS,NAICS_2012_Code,532420, BEA_2012_Summary_Code,532RL,NAICS_2012_Code,532490, +BEA_2012_Summary_Code,HS,NAICS_2012_Code,532490, BEA_2012_Summary_Code,532RL,NAICS_2012_Code,533110, BEA_2012_Summary_Code,HS,NAICS_2012_Code,533110, BEA_2012_Summary_Code,5411,NAICS_2012_Code,541110, @@ -1059,55 +1059,55 @@ BEA_2012_Summary_Code,81,NAICS_2012_Code,813930, BEA_2012_Summary_Code,81,NAICS_2012_Code,813940, BEA_2012_Summary_Code,81,NAICS_2012_Code,813990, BEA_2012_Summary_Code,81,NAICS_2012_Code,814110, -BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,921110, BEA_2012_Summary_Code,GFGN,NAICS_2012_Code,921110, -BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,921120, +BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,921110, BEA_2012_Summary_Code,GFGN,NAICS_2012_Code,921120, +BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,921120, BEA_2012_Summary_Code,GFGN,NAICS_2012_Code,921130, BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,921130, -BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,921140, BEA_2012_Summary_Code,GFGN,NAICS_2012_Code,921140, +BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,921140, BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,921150, -BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,921190, BEA_2012_Summary_Code,GFGN,NAICS_2012_Code,921190, -BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,922110, +BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,921190, BEA_2012_Summary_Code,GFGN,NAICS_2012_Code,922110, -BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,922120, +BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,922110, BEA_2012_Summary_Code,GFGN,NAICS_2012_Code,922120, -BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,922130, +BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,922120, BEA_2012_Summary_Code,GFGN,NAICS_2012_Code,922130, -BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,922140, +BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,922130, BEA_2012_Summary_Code,GFGN,NAICS_2012_Code,922140, -BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,922150, +BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,922140, BEA_2012_Summary_Code,GFGN,NAICS_2012_Code,922150, +BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,922150, BEA_2012_Summary_Code,GFGN,NAICS_2012_Code,922160, BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,922160, -BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,922190, BEA_2012_Summary_Code,GFGN,NAICS_2012_Code,922190, -BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,923110, +BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,922190, BEA_2012_Summary_Code,GFGN,NAICS_2012_Code,923110, -BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,923120, +BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,923110, BEA_2012_Summary_Code,GFGN,NAICS_2012_Code,923120, -BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,923130, +BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,923120, BEA_2012_Summary_Code,GFGN,NAICS_2012_Code,923130, +BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,923130, BEA_2012_Summary_Code,GFGN,NAICS_2012_Code,923140, -BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,924110, BEA_2012_Summary_Code,GFGN,NAICS_2012_Code,924110, -BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,924120, +BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,924110, BEA_2012_Summary_Code,GFGN,NAICS_2012_Code,924120, -BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,925110, +BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,924120, BEA_2012_Summary_Code,GFGN,NAICS_2012_Code,925110, +BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,925110, BEA_2012_Summary_Code,GFGN,NAICS_2012_Code,925120, BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,925120, -BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,926110, BEA_2012_Summary_Code,GFGN,NAICS_2012_Code,926110, +BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,926110, BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,926120, -BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,926130, BEA_2012_Summary_Code,GFGN,NAICS_2012_Code,926130, -BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,926140, +BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,926130, BEA_2012_Summary_Code,GFGN,NAICS_2012_Code,926140, -BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,926150, +BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,926140, BEA_2012_Summary_Code,GFGN,NAICS_2012_Code,926150, +BEA_2012_Summary_Code,GSLG,NAICS_2012_Code,926150, BEA_2012_Summary_Code,GFE,NAICS_2012_Code,927110, BEA_2012_Summary_Code,GFGD,NAICS_2012_Code,928110, BEA_2012_Summary_Code,GFGN,NAICS_2012_Code,928120, @@ -1115,3 +1115,4 @@ BEA_2012_Summary_Code,F010,NAICS_2012_Code,F01000, BEA_2012_Summary_Code,GFE,NAICS_2012_Code,S00101, BEA_2012_Summary_Code,GSLE,NAICS_2012_Code,S00201, BEA_2012_Summary_Code,GSLE,NAICS_2012_Code,S00202, +BEA_2012_Summary_Code,GSLE,NAICS_2012_Code,S00203, diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_2012.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_2012.py index 292486b32..7455459df 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_2012.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_2012.py @@ -25,13 +25,13 @@ def write_BEA_crosswalk(level='Detail'): # assign sector type df['SectorType'] = None # sort df - df = df.sort_values('Sector') + df = df.sort_values(['Sector', 'Activity']) # reset index df.reset_index(drop=True, inplace=True) # set order df = df[['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector', 'SectorType']] # save as csv - df.to_csv(datapath + "activitytosectormapping/" + + df.to_csv(datapath / "activitytosectormapping" / f"NAICS_Crosswalk_BEA_2012_{level}.csv", index=False) if __name__ == '__main__': From f953c1143f5cc2f31909d543820a710c1a2c1cea Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 22 Aug 2023 16:22:00 -0400 Subject: [PATCH 0794/1127] update stackedBarChart with recursive code --- flowsa/datavisualization.py | 434 ++++++++++++++++++------------------ 1 file changed, 215 insertions(+), 219 deletions(-) diff --git a/flowsa/datavisualization.py b/flowsa/datavisualization.py index 42807ac8d..c014c8bab 100644 --- a/flowsa/datavisualization.py +++ b/flowsa/datavisualization.py @@ -143,225 +143,221 @@ def FBSscatterplot(method_dict, plottype, sector_length_display=None, def customwrap(s, width=30): return "
".join(textwrap.wrap(s, width=width)) -# todo: update to work with recursive code - sector_aggregation() -# def stackedBarChart(df, -# impact_cat=None, -# selection_fields=None, -# target_sector_level=None, -# target_subset_sector_level=None, -# stacking_col='AttributionSources', -# generalize_AttributionSources=False, -# plot_title=None, -# index_cols=None, -# orientation='h', -# grouping_variable=None, -# sector_variable='Sector', -# subplot=None, -# rows=1, -# cols=1, -# filename = 'flowsaBarChart', -# graphic_width = 1200, -# graphic_height = 1200 -# ): -# """ -# Create a grouped, stacked barchart by sector code. If impact=True, -# group data by context as well as sector -# :param df: str or df, either an FBS methodname (ex. "Water_national_m1_2015") or a df -# :param impact_cat: str, name of impact category to apply and aggregate on -# impacts (e.g.: 'Global warming'). Use 'None' to aggregate by flow -# :return: stacked, group bar plot -# """ -# # if the df provided is a string, load the fbs method, otherwise use the -# # df provided -# if (type(df)) == str: -# df = flowsa.collapse_FlowBySector(df) -# -# if generalize_AttributionSources: -# df['AttributionSources'] = np.where( -# df['AttributionSources'] != 'Direct', -# 'Allocated', -# df['AttributionSources']) -# -# if selection_fields is not None: -# for k, v in selection_fields.items(): -# df = df[df[k].str.startswith(tuple(v))] -# -# # agg sectors for data visualization -# if any(item is not None for item in [target_sector_level, -# target_subset_sector_level]): -# sector_list = get_sector_list( -# target_sector_level, -# secondary_sector_level_dict=target_subset_sector_level) -# -# # aggregate to all sector levels -# df = sector_aggregation(df, sectors_to_exclude_from_agg=sector_list) -# df = df[df['Sector'].isin(sector_list)] -# df = df.reset_index(drop=True) -# -# # determine list of subplots -# try: -# plot_list = df[subplot].drop_duplicates().values.tolist() -# except KeyError: -# plot_list = None -# -# # convert units -# df = convert_units_for_graphics(df) -# -# if index_cols is None: -# index_cols = ["Location", "Sector", "Unit"] -# if impact_cat: -# try: -# import lciafmt -# df = (lciafmt.apply_lcia_method(df, 'TRACI2.1') -# .rename(columns={'FlowAmount': 'InvAmount', -# 'Impact': 'FlowAmount'})) -# var = 'Indicator' -# df = df[df['Indicator'] == impact_cat] -# df_unit = df['Indicator unit'][0] -# sort_cols = [sector_variable, stacking_col] -# if len(df) == 0: -# log.exception(f'Impact category: {impact_cat} not found') -# return -# except ImportError: -# log.exception('lciafmt not installed') -# return -# except AttributeError: -# log.exception('check lciafmt branch') -# return -# else: -# if grouping_variable is None: -# # combine the flowable and context columns for graphing -# df['Flow'] = df['Flowable'] + ', ' + df['Context'] -# var = 'Flow' -# else: -# var = grouping_variable -# df_unit = df['Unit'][0] -# sort_cols = [sector_variable, var, stacking_col] -# index_cols = index_cols + [var] -# -# # if only single var in df, do not include in the graph on axis -# var_count = df[var].nunique() -# -# # If 'AttributionSources' value is null, replace with 'Direct -# try: -# df['AttributionSources'] = df['AttributionSources'].fillna('Direct') -# except KeyError: -# pass -# # aggregate by location/sector/unit and optionally 'context' -# df2 = df.groupby(index_cols + [stacking_col], -# as_index=False).agg({"FlowAmount": sum}) -# -# # fill in non existent data with 0s to enable accurate sorting of sectors -# flows = (df2[['Location', 'Unit', var, 'Sector']] -# .drop_duplicates() -# ) -# scv = df[stacking_col].unique().tolist() -# flows[stacking_col] = [scv for _ in range(len(flows))] -# flows = flows.explode(stacking_col) -# -# df2 = df2.merge(flows, how='outer') -# df2['FlowAmount'] = df2['FlowAmount'].fillna(0) -# # resort df -# if subplot is not None: -# df2[subplot] = pd.Categorical(df2[subplot], plot_list) -# df2 = df2.sort_values([subplot] + sort_cols).reset_index(drop=True) -# else: -# df2 = df2.sort_values(sort_cols).reset_index(drop=True) -# -# # wrap the sector col -# df2[sector_variable] = df2[sector_variable].apply( -# lambda x: customwrap(x, width=12)) -# -# # establish subplots if necessary -# try: -# fig = make_subplots(rows=rows, cols=cols, subplot_titles=df2[ -# subplot].drop_duplicates().values.tolist()) -# except KeyError: -# fig = go.Figure() -# -# fig.update_layout( -# template="simple_white", -# barmode="stack", -# ) -# -# # create list of n colors based on number of allocation sources -# colors = df2[[stacking_col]].drop_duplicates() -# # add colors -# vis = pd.read_csv(datapath / 'VisualizationEssentials.csv').rename( -# columns={'AttributionSource': stacking_col}) -# colors = colors.merge(vis[[stacking_col, 'Color']], how='left') -# -# # fill in any colors missing from the color dictionary with random colors -# colors['Color'] = colors['Color'].apply(lambda x: x if pd.notnull(x) else -# "#%06x" % random.randint(0, 0xFFFFFF)) -# # merge back into df -# df2 = df2.merge(colors, how='left') -# -# if subplot is None: -# for r, c in zip(df2[stacking_col].unique(), df2['Color'].unique()): -# plot_df = df2[df2[stacking_col] == r] -# y_axis_col = plot_df[sector_variable] -# # if there are more than one variable category add to y-axis -# if var_count > 1: -# y_axis_col = [plot_df[sector_variable], plot_df[var]] -# fig.add_trace( -# go.Bar(x=plot_df['FlowAmount'], -# y=y_axis_col, name=r, -# orientation='h', -# marker_color=c -# )) -# fig.update_xaxes(title_text=f"FlowAmount ({df_unit})") -# fig.update_yaxes(title_text="Sector", tickmode='linear') -# else: -# s = 0 -# for row in range(1, rows + 1): -# for col in range(1, cols + 1): -# df3 = df2[df2[subplot] == plot_list[s]].reset_index(drop=True) -# for r, c in zip(df3[stacking_col].unique(), df3['Color'].unique()): -# plot_df = df3[df3[stacking_col] == r].reset_index(drop=True) -# flow_col = plot_df['FlowAmount'] -# sector_col = [plot_df[sector_variable], plot_df[var]] -# if orientation == 'h': -# x_data = flow_col -# y_data = sector_col -# xaxis_title = f"Flow Total ({plot_df['Unit'][0]})" -# yaxis_title = "" -# else: -# x_data = sector_col -# y_data = flow_col -# xaxis_title = "" -# yaxis_title = f"Flow Total ({plot_df['Unit'][0]})" -# fig.add_trace( -# go.Bar(x=x_data, y=y_data, name=r, -# orientation=orientation, -# marker_color=c, -# ), -# row=row, -# col=col -# ) -# fig.update_xaxes(title_text=xaxis_title, row=row, col=col) -# fig.update_yaxes(title_text=yaxis_title, row=row, col=col) -# s = s + 1 -# -# if orientation == 'h': -# fig.update_yaxes(autorange="reversed") -# fig.update_layout(title=plot_title, -# autosize=False, -# template="simple_white", -# font_size=10, margin_b=150 -# ) -# -# # prevent duplicate legend entries -# names = set() -# fig.for_each_trace( -# lambda trace: -# trace.update(showlegend=False) -# if (trace.name in names) else names.add(trace.name)) -# -# fig.show() -# log.info(f'Saving file to {plotoutputpath / filename}.svg') -# fig.write_image(plotoutputpath / f"{filename}.svg", width=graphic_width, -# height=graphic_height) + +def stackedBarChart(df, + impact_cat=None, + selection_fields=None, + industry_spec = None, + stacking_col='AttributionSources', + generalize_AttributionSources=False, + plot_title=None, + index_cols=None, + orientation='h', + grouping_variable=None, + sector_variable='Sector', + subplot=None, + rows=1, + cols=1, + filename = 'flowsaBarChart', + graphic_width = 1200, + graphic_height = 1200 + ): + """ + Create a grouped, stacked barchart by sector code. If impact=True, + group data by context as well as sector + :param df: str or df, either an FBS methodname (ex. "Water_national_m1_2015") or a df + :param impact_cat: str, name of impact category to apply and aggregate on + impacts (e.g.: 'Global warming'). Use 'None' to aggregate by flow + :param industry_spec, dict e.g. {'default': 'NAICS_3', + 'NAICS_4': ['112', '113'], + 'NAICS_6': ['1129']} + :return: stacked, group bar plot + """ + # if the df provided is a string, load the fbs method, otherwise use the + # df provided + if (type(df)) == str: + df = flowsa.getFlowBySector(df) + + if generalize_AttributionSources: + df['AttributionSources'] = np.where( + df['AttributionSources'] != 'Direct', + 'Allocated', + df['AttributionSources']) + + if selection_fields is not None: + for k, v in selection_fields.items(): + df = df[df[k].str.startswith(tuple(v))] + + df = flowsa.FlowBySector(df) + # agg sectors for data visualization + df.config['industry_spec'] = industry_spec + df = df.sector_aggregation() + df = flowsa.flowbyfunctions.collapse_fbs_sectors(df) + + # determine list of subplots + try: + plot_list = df[subplot].drop_duplicates().values.tolist() + except KeyError: + plot_list = None + + # convert units + df = convert_units_for_graphics(df) + + if index_cols is None: + index_cols = ["Location", "Sector", "Unit"] + if impact_cat: + try: + import lciafmt + df = (lciafmt.apply_lcia_method(df, 'TRACI2.1') + .rename(columns={'FlowAmount': 'InvAmount', + 'Impact': 'FlowAmount'})) + var = 'Indicator' + df = df[df['Indicator'] == impact_cat] + df_unit = df['Indicator unit'][0] + sort_cols = [sector_variable, stacking_col] + if len(df) == 0: + log.exception(f'Impact category: {impact_cat} not found') + return + except ImportError: + log.exception('lciafmt not installed') + return + except AttributeError: + log.exception('check lciafmt branch') + return + else: + if grouping_variable is None: + # combine the flowable and context columns for graphing + df['Flow'] = df['Flowable'] + ', ' + df['Context'] + var = 'Flow' + else: + var = grouping_variable + df_unit = df['Unit'][0] + sort_cols = [sector_variable, var, stacking_col] + index_cols = index_cols + [var] + + # if only single var in df, do not include in the graph on axis + var_count = df[var].nunique() + + # If 'AttributionSources' value is null, replace with 'Direct + try: + df['AttributionSources'] = df['AttributionSources'].fillna('Direct') + except KeyError: + pass + # aggregate by location/sector/unit and optionally 'context' + df2 = df.groupby(index_cols + [stacking_col], + as_index=False).agg({"FlowAmount": sum}) + + # fill in non existent data with 0s to enable accurate sorting of sectors + flows = (df2[['Location', 'Unit', var, 'Sector']] + .drop_duplicates() + ) + scv = df[stacking_col].unique().tolist() + flows[stacking_col] = [scv for _ in range(len(flows))] + flows = flows.explode(stacking_col) + + df2 = df2.merge(flows, how='outer') + df2['FlowAmount'] = df2['FlowAmount'].fillna(0) + # resort df + if subplot is not None: + df2[subplot] = pd.Categorical(df2[subplot], plot_list) + df2 = df2.sort_values([subplot] + sort_cols).reset_index(drop=True) + else: + df2 = df2.sort_values(sort_cols).reset_index(drop=True) + + # wrap the sector col + df2[sector_variable] = df2[sector_variable].apply( + lambda x: customwrap(x, width=12)) + + # establish subplots if necessary + try: + fig = make_subplots(rows=rows, cols=cols, subplot_titles=df2[ + subplot].drop_duplicates().values.tolist()) + except KeyError: + fig = go.Figure() + + fig.update_layout( + template="simple_white", + barmode="stack", + ) + + # create list of n colors based on number of allocation sources + colors = df2[[stacking_col]].drop_duplicates() + # add colors + vis = pd.read_csv(datapath / 'VisualizationEssentials.csv').rename( + columns={'AttributionSource': stacking_col}) + colors = colors.merge(vis[[stacking_col, 'Color']], how='left') + + # fill in any colors missing from the color dictionary with random colors + colors['Color'] = colors['Color'].apply(lambda x: x if pd.notnull(x) else + "#%06x" % random.randint(0, 0xFFFFFF)) + # merge back into df + df2 = df2.merge(colors, how='left') + + if subplot is None: + for r, c in zip(df2[stacking_col].unique(), df2['Color'].unique()): + plot_df = df2[df2[stacking_col] == r] + y_axis_col = plot_df[sector_variable] + # if there are more than one variable category add to y-axis + if var_count > 1: + y_axis_col = [plot_df[sector_variable], plot_df[var]] + fig.add_trace( + go.Bar(x=plot_df['FlowAmount'], + y=y_axis_col, name=r, + orientation='h', + marker_color=c + )) + fig.update_xaxes(title_text=f"FlowAmount ({df_unit})") + fig.update_yaxes(title_text="Sector", tickmode='linear') + else: + s = 0 + for row in range(1, rows + 1): + for col in range(1, cols + 1): + df3 = df2[df2[subplot] == plot_list[s]].reset_index(drop=True) + for r, c in zip(df3[stacking_col].unique(), df3['Color'].unique()): + plot_df = df3[df3[stacking_col] == r].reset_index(drop=True) + flow_col = plot_df['FlowAmount'] + sector_col = [plot_df[sector_variable], plot_df[var]] + if orientation == 'h': + x_data = flow_col + y_data = sector_col + xaxis_title = f"Flow Total ({plot_df['Unit'][0]})" + yaxis_title = "" + else: + x_data = sector_col + y_data = flow_col + xaxis_title = "" + yaxis_title = f"Flow Total ({plot_df['Unit'][0]})" + fig.add_trace( + go.Bar(x=x_data, y=y_data, name=r, + orientation=orientation, + marker_color=c, + ), + row=row, + col=col + ) + fig.update_xaxes(title_text=xaxis_title, row=row, col=col) + fig.update_yaxes(title_text=yaxis_title, row=row, col=col) + s = s + 1 + + if orientation == 'h': + fig.update_yaxes(autorange="reversed") + fig.update_layout(title=plot_title, + autosize=False, + template="simple_white", + font_size=10, margin_b=150 + ) + + # prevent duplicate legend entries + names = set() + fig.for_each_trace( + lambda trace: + trace.update(showlegend=False) + if (trace.name in names) else names.add(trace.name)) + + fig.show() + log.info(f'Saving file to {plotoutputpath / filename}.svg') + fig.write_image(plotoutputpath / f"{filename}.svg", width=graphic_width, + height=graphic_height) def plot_state_coefficients(fbs_coeff, indicator=None, From 9344e15139f877f70b14d706c1ceb55798a690cd Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 22 Aug 2023 16:24:21 -0400 Subject: [PATCH 0795/1127] fix indentations --- flowsa/datavisualization.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flowsa/datavisualization.py b/flowsa/datavisualization.py index c014c8bab..5be70e85c 100644 --- a/flowsa/datavisualization.py +++ b/flowsa/datavisualization.py @@ -210,7 +210,7 @@ def stackedBarChart(df, import lciafmt df = (lciafmt.apply_lcia_method(df, 'TRACI2.1') .rename(columns={'FlowAmount': 'InvAmount', - 'Impact': 'FlowAmount'})) + 'Impact': 'FlowAmount'})) var = 'Indicator' df = df[df['Indicator'] == impact_cat] df_unit = df['Indicator unit'][0] @@ -245,12 +245,12 @@ def stackedBarChart(df, pass # aggregate by location/sector/unit and optionally 'context' df2 = df.groupby(index_cols + [stacking_col], - as_index=False).agg({"FlowAmount": sum}) + as_index=False).agg({"FlowAmount": sum}) # fill in non existent data with 0s to enable accurate sorting of sectors flows = (df2[['Location', 'Unit', var, 'Sector']] - .drop_duplicates() - ) + .drop_duplicates() + ) scv = df[stacking_col].unique().tolist() flows[stacking_col] = [scv for _ in range(len(flows))] flows = flows.explode(stacking_col) From 4661ea1d9554bb7ec818bfd74b3bf90c0d8de3bf Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 23 Aug 2023 09:00:53 -0600 Subject: [PATCH 0796/1127] remove non-recursive functions --- flowsa/common.py | 30 -- flowsa/data_source_scripts/EIA_MECS.py | 2 - .../data_source_scripts/USDA_CoA_Cropland.py | 313 ------------------ .../USDA_CoA_Cropland_NAICS.py | 16 - flowsa/data_source_scripts/USDA_IWMS.py | 32 -- flowsa/data_source_scripts/USGS_NWIS_WU.py | 80 ----- flowsa/flowbyfunctions.py | 246 -------------- 7 files changed, 719 deletions(-) diff --git a/flowsa/common.py b/flowsa/common.py index 627e82973..ba4ed04cd 100644 --- a/flowsa/common.py +++ b/flowsa/common.py @@ -279,36 +279,6 @@ def return_true_source_catalog_name(sourcename): sourcename = sourcename.rsplit("_", 1)[0] return sourcename -# todo: delete -# def check_activities_sector_like(df_load, sourcename=None): -# """ -# Check if the activities in a df are sector-like, -# if cannot find the sourcename in the source catalog, drop extensions on the -# source name -# :param df_load: df, df to determine if activities are sector-like -# :param source: str, optionial, can identify sourcename to use -# """ -# # identify sourcename -# if sourcename is not None: -# s = sourcename -# else: -# if 'SourceName' in df_load.columns: -# s = pd.unique(df_load['SourceName'])[0] -# elif 'MetaSources' in df_load.columns: -# s = pd.unique(df_load['MetaSources'])[0] -# -# sourcename = return_true_source_catalog_name(s) -# -# try: -# sectorLike = load_yaml_dict('source_catalog')[sourcename][ -# 'sector-like_activities'] -# except KeyError: -# log.info(f'%s not found in {datapath}source_catalog.yaml, assuming ' -# f'activities are not sector-like', sourcename) -# sectorLike = False -# -# return sectorLike - def str2bool(v): """ diff --git a/flowsa/data_source_scripts/EIA_MECS.py b/flowsa/data_source_scripts/EIA_MECS.py index 90c2d6cef..d4eb0f8b0 100644 --- a/flowsa/data_source_scripts/EIA_MECS.py +++ b/flowsa/data_source_scripts/EIA_MECS.py @@ -465,8 +465,6 @@ def clean_mapped_mecs_energy_fba_to_state( clean_fba_w_sec fxn that replicates drop_parentincompletechild_descendants but also updates regions to states for state models. """ - # todo: delete commented out code because incorporated into mapping fxn - # fba = drop_parentincompletechild_descendants(fba) fba = update_regions_to_states(fba) return fba diff --git a/flowsa/data_source_scripts/USDA_CoA_Cropland.py b/flowsa/data_source_scripts/USDA_CoA_Cropland.py index 36c14c6e7..6cd841213 100644 --- a/flowsa/data_source_scripts/USDA_CoA_Cropland.py +++ b/flowsa/data_source_scripts/USDA_CoA_Cropland.py @@ -236,316 +236,3 @@ def coa_cropland_parse(*, df_list, year, **_): df['DataCollection'] = 2 return df - -# todo: delete -# def disaggregate_coa_cropland_to_6_digit_naics( -# fba_w_sector, attr, method, **kwargs): -# """ -# Disaggregate usda coa cropland to naics 6 -# :param fba_w_sector: df, CoA cropland data, FBA format with sector columns -# :param attr: dictionary, attribute data from method yaml for activity set -# :param method: dictionary, FBS method yaml -# :param kwargs: dictionary, arguments that might be required for other -# functions. Currently includes data source name. -# :return: df, CoA cropland with disaggregated NAICS sectors -# """ -# -# # define the activity and sector columns to base modifications on -# # these definitions will vary dependent on class type -# sector_col = 'SectorConsumedBy' -# -# # drop rows without assigned sectors -# fba_w_sector = fba_w_sector[ -# ~fba_w_sector[sector_col].isna()].reset_index(drop=True) -# -# # modify the flowamounts related to the 6 naics 'orchards' are mapped to -# fba_w_sector = equal_allocation(fba_w_sector) -# -# # use ratios of usda 'land in farms' to determine animal use of -# # pasturelands at 6 digit naics -# fba_w_sector = disaggregate_pastureland( -# fba_w_sector, attr, method, year=attr['allocation_source_year'], -# sector_column=sector_col, -# download_FBA_if_missing=kwargs['download_FBA_if_missing']) -# -# # use ratios of usda 'harvested cropland' to determine missing 6 digit -# # naics -# fba_w_sector = disaggregate_cropland( -# fba_w_sector, attr, method, year=attr['allocation_source_year'], -# sector_column=sector_col, download_FBA_if_missing=kwargs[ -# 'download_FBA_if_missing']) -# -# return fba_w_sector - -# todo: delete -# def disaggregate_coa_cropland_to_6_digit_naics_for_water_withdrawal( -# fba_w_sector_load, attr, method, **kwargs): -# """ -# Disaggregate usda coa cropland to naics 6 -# :param fba_w_sector_load: df, CoA cropland data, FBA format with sector -# columns -# :param attr: dictionary, attribute data from method yaml for activity set -# :param method: dictionary, FBS method yaml -# :param kwargs: dictionary, arguments that might be required for other -# functions. Currently includes data source name. -# :return: df, CoA cropland with disaggregated NAICS sectors -# """ -# -# # define the activity and sector columns to base modifications on -# # these definitions will vary dependent on class type -# sector_col = 'SectorConsumedBy' -# -# # drop rows without assigned sectors -# fba_w_sector = fba_w_sector_load[~fba_w_sector_load[sector_col].isna()]\ -# .reset_index(drop=True) -# -# # modify the flowamounts related to the 6 naics 'orchards' are mapped to -# fba_w_sector = equal_allocation(fba_w_sector) -# -# # todo: add back in once suppression fxn modified to accept non-naics -# # like activities and mixed level final naics (naics6 and naics7) -# # then estimate any suppressed data by equally allocating parent to -# # child naics -# # groupcols = list(fba_w_sector3.select_dtypes( -# # include=['object', 'int']).columns) -# # fba_w_sector = equally_allocate_suppressed_parent_to_child_naics( -# # fba_w_sector, method, 'SectorConsumedBy', groupcols) -# -# # When using irrigated cropland, aggregate sectors to cropland and total -# # ag land. Doing this because published values for irrigated harvested -# # cropland do not include the water use for vegetables, woody crops, -# # berries. -# fba_w_sector = fba_w_sector[~fba_w_sector['ActivityConsumedBy'].isin( -# ['AG LAND', 'AG LAND, CROPLAND, HARVESTED'])].reset_index(drop=True) -# -# # use ratios of usda 'land in farms' to determine animal use of -# # pasturelands at 6 digit naics -# fba_w_sector = disaggregate_pastureland( -# fba_w_sector, attr, method, year=attr['allocation_source_year'], -# sector_column=sector_col, download_FBA_if_missing=kwargs[ -# 'download_FBA_if_missing'], parameter_drop=['1125']) -# -# # use ratios of usda 'harvested cropland' to determine missing 6 digit -# # naics -# fba_w_sector = disaggregate_cropland( -# fba_w_sector, attr, method, year=attr['allocation_source_year'], -# sector_column=sector_col, download_FBA_if_missing=kwargs[ -# 'download_FBA_if_missing']) -# -# return fba_w_sector - -# todo: delete -# def disaggregate_pastureland(fba_w_sector, attr, method, year, -# sector_column, download_FBA_if_missing, **kwargs): -# """ -# The USDA CoA Cropland irrigated pastureland data only links -# to the 3 digit NAICS '112'. This function uses state -# level CoA 'Land in Farms' to allocate the county level acreage data to -# 6 digit NAICS. -# :param fba_w_sector: df, the CoA Cropland dataframe after linked to sectors -# :param attr: dictionary, attribute data from method yaml for activity set -# :param method: string, methodname -# :param year: str, year of data being disaggregated -# :param sector_column: str, the sector column on which to make df -# modifications (SectorProducedBy or SectorConsumedBy) -# :param download_FBA_if_missing: bool, if True will attempt to load -# FBAS used in generating the FBS from remote server prior to -# generating if file not found locally -# :return: df, the CoA cropland dataframe with disaggregated pastureland data -# """ -# -# # tmp drop NoneTypes -# fba_w_sector = replace_NoneType_with_empty_cells(fba_w_sector) -# -# # subset the coa data so only pastureland -# p = fba_w_sector.loc[fba_w_sector[sector_column].apply( -# lambda x: x[0:3]) == '112'].reset_index(drop=True) -# if len(p) != 0: -# # add temp loc column for state fips -# p = p.assign(Location_tmp=p['Location'].apply(lambda x: x[0:2])) -# -# # load usda coa cropland naics -# df_f = load_fba_w_standardized_units( -# datasource='USDA_CoA_Cropland_NAICS', year=year, flowclass='Land', -# download_FBA_if_missing=download_FBA_if_missing) -# # subset to land in farms data -# df_f = df_f[df_f['FlowName'] == 'FARM OPERATIONS'] -# # subset to rows related to pastureland -# df_f = df_f.loc[df_f['ActivityConsumedBy'].apply( -# lambda x: x[0:3]) == '112'] -# # drop rows with "&' -# df_f = df_f[~df_f['ActivityConsumedBy'].str.contains('&')] -# if 'parameter_drop' in kwargs: -# # drop aquaculture because pastureland not used for aquaculture -# # drop any activities at a more aggregated sector level because -# # will need to be reaggregated after dropping a parameter to -# # accurately calculate the allocation ratios -# drop_list = [sub[ : -1] for sub in kwargs['parameter_drop']] -# drop_list = drop_list + kwargs['parameter_drop'] -# df_f = df_f[~df_f['ActivityConsumedBy'].isin(drop_list)] -# # create sector columns -# df_f = add_sectors_to_flowbyactivity( -# df_f, sectorsourcename=method['target_sector_source']) -# # estimate suppressed data by equal allocation -# df_f = equally_allocate_suppressed_parent_to_child_naics( -# df_f, method, 'SectorConsumedBy', fba_wsec_default_grouping_fields) -# # create proportional ratios -# group_cols = [e for e in fba_wsec_default_grouping_fields if -# e not in ('ActivityProducedBy', 'ActivityConsumedBy')] -# df_f = allocate_by_sector(df_f, attr, 'proportional', group_cols) -# # tmp drop NoneTypes -# df_f = replace_NoneType_with_empty_cells(df_f) -# # drop naics = '11 -# df_f = df_f[df_f[sector_column] != '11'] -# # drop 000 in location -# df_f = df_f.assign(Location=df_f['Location'].apply(lambda x: x[0:2])) -# -# # check units before merge -# compare_df_units(p, df_f) -# # merge the coa pastureland data with land in farm data -# df = p.merge(df_f[[sector_column, 'Location', 'FlowAmountRatio']], -# how='left', left_on="Location_tmp", right_on="Location") -# # multiply the flowamount by the flowratio -# df.loc[:, 'FlowAmount'] = df['FlowAmount'] * df['FlowAmountRatio'] -# # drop columns and rename -# df = df.drop(columns=['Location_tmp', sector_column + '_x', -# 'Location_y', 'FlowAmountRatio']) -# df = df.rename(columns={sector_column + '_y': sector_column, -# "Location_x": 'Location'}) -# -# # drop rows where sector = 112 and then concat with -# # original fba_w_sector -# fba_w_sector = fba_w_sector[fba_w_sector[sector_column].apply( -# lambda x: x[0:3]) != '112'].reset_index(drop=True) -# fba_w_sector = pd.concat([fba_w_sector, df]).reset_index(drop=True) -# -# # fill empty cells with NoneType -# fba_w_sector = replace_strings_with_NoneType(fba_w_sector) -# -# return fba_w_sector - -# todo: delete -# def disaggregate_cropland(fba_w_sector, attr, method, year, -# sector_column, download_FBA_if_missing): -# """ -# In the event there are 4 (or 5) digit naics for cropland -# at the county level, use state level harvested cropland to -# create ratios -# :param fba_w_sector: df, CoA cropland data, FBA format with sector columns -# :param attr: dictionary, attribute data from method yaml for activity set -# :param method: string, method name -# :param year: str, year of data -# :param sector_column: str, the sector column on which to make -# df modifications (SectorProducedBy or SectorConsumedBy) -# :param download_FBA_if_missing: bool, if True will attempt to -# load FBAS used in generating the FBS from remote server prior to -# generating if file not found locally -# :return: df, CoA cropland data disaggregated -# """ -# -# # tmp drop NoneTypes -# fba_w_sector = replace_NoneType_with_empty_cells(fba_w_sector) -# -# # drop pastureland data -# crop = fba_w_sector.loc[fba_w_sector[sector_column].apply( -# lambda x: x[0:3]) != '112'].reset_index(drop=True) -# # drop sectors < 4 digits -# crop = crop[crop[sector_column].apply( -# lambda x: len(x) > 3)].reset_index(drop=True) -# # create tmp location -# crop = crop.assign(Location_tmp=crop['Location'].apply(lambda x: x[0:2])) -# -# # load the relevant state level harvested cropland by naics -# naics = load_fba_w_standardized_units( -# datasource="USDA_CoA_Cropland_NAICS", year=year, -# flowclass='Land', download_FBA_if_missing=download_FBA_if_missing) -# # subset the harvested cropland by naics -# naics = naics[naics['FlowName'] == -# 'AG LAND, CROPLAND, HARVESTED'].reset_index(drop=True) -# # drop the activities that include '&' -# naics = naics[~naics['ActivityConsumedBy'].str.contains( -# '&')].reset_index(drop=True) -# # add sectors -# naics = add_sectors_to_flowbyactivity( -# naics, sectorsourcename=method['target_sector_source']) -# # estimate suppressed data by equally allocating parent to child naics -# naics = equally_allocate_suppressed_parent_to_child_naics( -# naics, method, 'SectorConsumedBy', fba_wsec_default_grouping_fields) -# -# # aggregate sectors to create any missing naics levels -# naics2 = sector_aggregation(naics) -# # add missing naics5/6 when only one naics5/6 associated with a naics4 -# naics3 = sector_disaggregation(naics2) -# # create ratios -# naics4 = sector_ratios(naics3, sector_column) -# # create temporary sector column to match the two dfs on -# naics4 = naics4.assign( -# Location_tmp=naics4['Location'].apply(lambda x: x[0:2])) -# # tmp drop Nonetypes -# naics4 = replace_NoneType_with_empty_cells(naics4) -# -# # check units in prep for merge -# compare_df_units(crop, naics4) -# # for loop through naics lengths to determine -# # naics 4 and 5 digits to disaggregate -# for i in range(4, 6): -# # subset df to sectors with length = i and length = i + 1 -# crop_subset = crop.loc[crop[sector_column].apply( -# lambda x: i + 1 >= len(x) >= i)] -# crop_subset = crop_subset.assign( -# Sector_tmp=crop_subset[sector_column].apply(lambda x: x[0:i])) -# # if duplicates drop all rows -# df = crop_subset.drop_duplicates( -# subset=['Location', 'Sector_tmp'], -# keep=False).reset_index(drop=True) -# # drop sector temp column -# df = df.drop(columns=["Sector_tmp"]) -# # subset df to keep the sectors of length i -# df_subset = df.loc[df[sector_column].apply(lambda x: len(x) == i)] -# # subset the naics df where naics length is i + 1 -# naics_subset = \ -# naics4.loc[naics4[sector_column].apply( -# lambda x: len(x) == i + 1)].reset_index(drop=True) -# naics_subset = naics_subset.assign( -# Sector_tmp=naics_subset[sector_column].apply(lambda x: x[0:i])) -# # merge the two df based on locations -# df_subset = pd.merge( -# df_subset, naics_subset[[sector_column, 'FlowAmountRatio', -# 'Sector_tmp', 'Location_tmp']], -# how='left', left_on=[sector_column, 'Location_tmp'], -# right_on=['Sector_tmp', 'Location_tmp']) -# # create flow amounts for the new NAICS based on the flow ratio -# df_subset.loc[:, 'FlowAmount'] = \ -# df_subset['FlowAmount'] * df_subset['FlowAmountRatio'] -# # drop rows of 0 and na -# df_subset = df_subset[df_subset['FlowAmount'] != 0] -# df_subset = df_subset[ -# ~df_subset['FlowAmount'].isna()].reset_index(drop=True) -# # drop columns -# df_subset = df_subset.drop( -# columns=[sector_column + '_x', 'FlowAmountRatio', 'Sector_tmp']) -# # rename columns -# df_subset = df_subset.rename( -# columns={sector_column + '_y': sector_column}) -# # tmp drop Nonetypes -# df_subset = replace_NoneType_with_empty_cells(df_subset) -# # add new rows of data to crop df -# crop = pd.concat([crop, df_subset]).reset_index(drop=True) -# -# # clean up df -# crop = crop.drop(columns=['Location_tmp']) -# -# # equally allocate any further missing naics -# crop = equally_allocate_parent_to_child_naics(crop, method) -# -# # pasture data -# pasture = \ -# fba_w_sector.loc[fba_w_sector[sector_column].apply( -# lambda x: x[0:3]) == '112'].reset_index(drop=True) -# # concat crop and pasture -# fba_w_sector = pd.concat([pasture, crop]).reset_index(drop=True) -# -# # fill empty cells with NoneType -# fba_w_sector = replace_strings_with_NoneType(fba_w_sector) -# -# return fba_w_sector \ No newline at end of file diff --git a/flowsa/data_source_scripts/USDA_CoA_Cropland_NAICS.py b/flowsa/data_source_scripts/USDA_CoA_Cropland_NAICS.py index 6abfb7514..bd6d475a2 100644 --- a/flowsa/data_source_scripts/USDA_CoA_Cropland_NAICS.py +++ b/flowsa/data_source_scripts/USDA_CoA_Cropland_NAICS.py @@ -151,19 +151,3 @@ def coa_cropland_NAICS_parse(*, df_list, year, **_): df['DataReliability'] = 5 # tmp df['DataCollection'] = 2 return df - -# todo: delete -# def coa_cropland_naics_fba_wsec_cleanup(fba_w_sector, **kwargs): -# """ -# Clean up the land fba for use in allocation -# :param fba_w_sector: df, coa cropland naics flowbyactivity -# with sector columns -# :param kwargs: dictionary, requires df sourcename -# :return: df, flowbyactivity with modified values -# """ -# -# method = kwargs.get('method') -# df = equally_allocate_suppressed_parent_to_child_naics( -# fba_w_sector, method, 'SectorConsumedBy', -# fba_wsec_default_grouping_fields) -# return df diff --git a/flowsa/data_source_scripts/USDA_IWMS.py b/flowsa/data_source_scripts/USDA_IWMS.py index b44971077..58aefebfa 100644 --- a/flowsa/data_source_scripts/USDA_IWMS.py +++ b/flowsa/data_source_scripts/USDA_IWMS.py @@ -122,38 +122,6 @@ def iwms_parse(*, df_list, year, **_): return df -# todo: delete -# def disaggregate_iwms_to_6_digit_naics_for_water_withdrawal(df, attr, method, -# **kwargs): -# """ -# Disaggregate the data in the USDA Irrigation and Water Management Survey -# to 6-digit NAICS using Census of Agriculture 'Land in Farm' data -# :param df: df, FBA format -# :param attr: dictionary, attribute data from method yaml for activity set -# :param method: dictionary, FBS method yaml -# :return: df, FBA format with disaggregated NAICS -# """ -# -# # define sector column to base df modifications -# sector_column = 'SectorConsumedBy' -# -# # address double counting brought on by iwms categories -# # applying to multiply NAICS -# df.drop_duplicates(subset=['FlowName', 'FlowAmount', 'Compartment', -# 'Location'], keep='first', inplace=True) -# years = attr['allocation_source_year'] - 1 -# df = df[~df[sector_column].isna()].reset_index(drop=True) -# # drop aquaculture when disaggregating pastureland because water use for -# # aquaculture calculated separately -# df = disaggregate_pastureland(df, attr, method, years, sector_column, -# download_FBA_if_missing=kwargs[ -# 'download_FBA_if_missing'], -# parameter_drop=['1125']) -# df = disaggregate_cropland(df, attr, method, years, sector_column, -# download_FBA_if_missing=kwargs['download_FBA_if_missing']) -# -# return df - def iwms_aggregation(df_load, **kwargs): """ diff --git a/flowsa/data_source_scripts/USGS_NWIS_WU.py b/flowsa/data_source_scripts/USGS_NWIS_WU.py index 6773518e0..fb6349a53 100644 --- a/flowsa/data_source_scripts/USGS_NWIS_WU.py +++ b/flowsa/data_source_scripts/USGS_NWIS_WU.py @@ -639,83 +639,3 @@ def subset_and_merge_irrigation_types(df: FlowByActivity): df_m2['Diff'] = df_m2['FlowAmount'] - df_m2['subset_sum'] return df_m2 - -# todo: delete -# def usgs_fba_w_sectors_data_cleanup(df_wsec: FlowByActivity, attr, **kwargs) -> FlowByActivity: -# """ -# Call on functions to modify the fba with sectors df before being allocated -# to sectors used in flowbysector.py -# :param df_wsec: an FBA dataframe with sectors -# :param attr: dictionary, attribute data from method yaml for activity set -# :param kwargs: includes "method", a parameter required in other -# 'clean_fba_w_sec_df_fxn' function calls when building a FBS -# :return: df, FBA modified -# """ -# -# df = modify_sector_length(df_wsec) -# -# return df - -# todo: delete -# def modify_sector_length(df_wsec: FlowByActivity): -# """ -# After assigning sectors to activities, modify the sector length of an -# activity, to match the assigned sector in another sector column ( -# SectorConsumedBy/SectorProducedBy). This is helpful for sector -# aggregation. The USGS NWIS WU "Public Supply" should be modified to -# match sector length. -# :param df_wsec: a df that includes columns for SectorProducedBy -# and SectorConsumedBy -# :return: df, FBA with sector columns modified -# """ -# -# # the activity(ies) whose sector length should be modified -# activities = ["Public Supply"] -# -# # subset data -# df1 = df_wsec.loc[ -# (df_wsec['SectorProducedBy'].isnull()) | -# (df_wsec['SectorConsumedBy'].isnull())].reset_index(drop=True) -# df2 = df_wsec.loc[ -# (df_wsec['SectorProducedBy'].notnull()) & -# (df_wsec['SectorConsumedBy'].notnull())].reset_index(drop=True) -# -# # concat data into single dataframe -# if len(df2) != 0: -# df2.loc[:, 'LengthToModify'] = np.where( -# df2['ActivityProducedBy'].isin(activities), -# df2['SectorProducedBy'].str.len(), 0) -# df2.loc[:, 'LengthToModify'] = np.where( -# df2['ActivityConsumedBy'].isin(activities), -# df2['SectorConsumedBy'].str.len(), df2['LengthToModify']) -# df2.loc[:, 'TargetLength'] = np.where( -# df2['ActivityProducedBy'].isin(activities), -# df2['SectorConsumedBy'].str.len(), 0) -# df2.loc[:, 'TargetLength'] = np.where( -# df2['ActivityConsumedBy'].isin(activities), -# df2['SectorProducedBy'].str.len(), df2['TargetLength']) -# -# df2.loc[:, 'SectorProducedBy'] = df2.apply( -# lambda x: x['SectorProducedBy'][:x['TargetLength']] -# if x['LengthToModify'] > x['TargetLength'] -# else x['SectorProducedBy'], axis=1) -# df2.loc[:, 'SectorConsumedBy'] = df2.apply( -# lambda x: x['SectorConsumedBy'][:x['TargetLength']] -# if x['LengthToModify'] > x['TargetLength'] -# else x['SectorConsumedBy'], axis=1) -# -# df2.loc[:, 'SectorProducedBy'] = df2.apply( -# lambda x: x['SectorProducedBy'].ljust(x['TargetLength'], '0') -# if x['LengthToModify'] < x['TargetLength'] -# else x['SectorProducedBy'], axis=1) -# df2.loc[:, 'SectorConsumedBy'] = df2.apply( -# lambda x: x['SectorConsumedBy'].ljust(x['TargetLength'], '0') -# if x['LengthToModify'] < x['TargetLength'] -# else x['SectorConsumedBy'], axis=1) -# -# df2 = df2.drop(columns=["LengthToModify", 'TargetLength']) -# -# df = pd.concat([df1, df2]) -# return df -# else: -# return df1 diff --git a/flowsa/flowbyfunctions.py b/flowsa/flowbyfunctions.py index 472725982..aecbd8cc3 100644 --- a/flowsa/flowbyfunctions.py +++ b/flowsa/flowbyfunctions.py @@ -150,47 +150,6 @@ def is_identical(s): return df_dfg -# todo: delete -# def sector_ratios(df, sectorcolumn): -# """ -# Determine ratios of the less aggregated sectors within a -# more aggregated sector -# :param df: A df with sector columns -# :param sectorcolumn: 'SectorConsumedBy' or 'SectorProducedBy' -# :return: df, with 'FlowAmountRatio' column -# """ -# -# # drop any null rows (can occur when activities are ranges) -# df = df[~df[sectorcolumn].isnull()] -# -# # find the longest length sector -# length = max(df[sectorcolumn].apply(lambda x: len(str(x))).unique()) -# # for loop in reverse order longest length naics minus 1 to 2 -# # appends missing naics levels to df -# sec_ratios = [] -# for i in range(length, 3, -1): -# # subset df to sectors with length = i -# df_subset = subset_df_by_sector_lengths(df, [i]) -# # create column for sector grouping -# df_subset = assign_sector_match_column(df_subset, sectorcolumn, i, i-1) -# # subset df to create denominator -# df_denom = df_subset[['FlowAmount', 'Location', 'sector_group']] -# df_denom = df_denom.groupby(['Location', 'sector_group'], -# as_index=False).agg({"FlowAmount": sum}) -# df_denom = df_denom.rename(columns={"FlowAmount": "Denominator"}) -# # merge the denominator column with fba_w_sector df -# ratio_df = df_subset.merge(df_denom, how='left') -# # calculate ratio -# ratio_df.loc[:, 'FlowAmountRatio'] = \ -# ratio_df['FlowAmount'] / ratio_df['Denominator'] -# ratio_df = ratio_df.drop( -# columns=['Denominator', 'sector_group']) -# sec_ratios.append(ratio_df) -# # concat list of dataframes (info on each page) -# df_w_ratios = pd.concat(sec_ratios, ignore_index=True) -# -# return df_w_ratios - def remove_parent_sectors_from_crosswalk(cw_load, sector_list): """ @@ -588,80 +547,6 @@ def return_activity_from_scale(df, provided_from_scale): return df_existing -# todo: delete -# def subset_df_by_geoscale(df, activity_from_scale, activity_to_scale): -# """ -# Subset a df by geoscale or agg to create data specified in method yaml -# :param df: df, FBA format -# :param activity_from_scale: str, identified geoscale by which to subset or -# aggregate from ('national', 'state', 'county') -# :param activity_to_scale: str, identified geoscale by which to subset or -# aggregate to ('national', 'state', 'county') -# :return: df, FBA, subset or aggregated to a single geoscale for all rows -# """ -# -# # detect grouping cols by columns -# if 'Context' in df.columns: -# groupbycols = fba_mapped_default_grouping_fields -# cols_to_keep = flow_by_activity_mapped_fields -# else: -# groupbycols = fba_default_grouping_fields -# cols_to_keep = flow_by_activity_fields -# -# # method of subset dependent on LocationSystem -# if df['LocationSystem'].str.contains('FIPS').all(): -# df = df[df['LocationSystem'].str.contains( -# 'FIPS')].reset_index(drop=True) -# # determine 'activity_from_scale' for use in df -# # geoscale subset, by activity -# modified_from_scale = \ -# return_activity_from_scale(df, activity_from_scale) -# # add 'activity_from_scale' column to df -# df2 = pd.merge(df, modified_from_scale) -# -# # list of unique 'from' geoscales -# unique_geoscales = modified_from_scale[ -# 'activity_from_scale'].drop_duplicates().values.tolist() -# if len(unique_geoscales) > 1: -# log.info('Dataframe has a mix of geographic levels: %s', -# ', '.join(unique_geoscales)) -# -# # to scale -# if fips_number_key[activity_from_scale] > \ -# fips_number_key[activity_to_scale]: -# to_scale = activity_to_scale -# else: -# to_scale = activity_from_scale -# -# df_subset_list = [] -# # subset df based on activity 'from' scale -# for i in unique_geoscales: -# df3 = df2[df2['activity_from_scale'] == i] -# # if desired geoscale doesn't exist, aggregate existing data -# # if df is less aggregated than allocation df, aggregate -# # fba activity to allocation geoscale -# if fips_number_key[i] > fips_number_key[to_scale]: -# log.info("Aggregating subset from %s to %s", i, to_scale) -# df_sub = agg_by_geoscale(df3, i, to_scale, groupbycols) -# # else filter relevant rows -# else: -# log.info("Subsetting %s data", i) -# df_sub = filter_by_geoscale(df3, i) -# df_subset_list.append(df_sub) -# df_subset = pd.concat(df_subset_list, ignore_index=True) -# -# # drop unused columns -# df_subset = clean_df(df_subset, cols_to_keep, -# fba_fill_na_dict, drop_description=False) -# -# return df_subset -# -# # right now, the only other location system is for Statistics Canada data -# else: -# df = df[~df['LocationSystem'].str.contains('FIPS')].reset_index(drop=True) -# -# return df - def unique_activity_names(fba_df): """ @@ -997,137 +882,6 @@ def load_fba_w_standardized_units(datasource, year, **kwargs): return fba -# def subset_df_by_sector_lengths(df_load, sector_length_list, **_): -# """ -# :param df_load: -# :param sector_length_list: list (int) of the naics sector lengths that -# should be subset -# :return: -# """ -# # subset the df by naics length -# cw_load = load_sector_length_cw_melt() -# cw = cw_load[cw_load['SectorLength'].isin(sector_length_list)] -# sector_list = cw['Sector'].drop_duplicates().values.tolist() -# -# # if retaining values in adjacent sector columns that are not in the -# # sector list, the sector length of those values should be less than the -# # sector length of the approved list to prevent double counting when -# # looping through all data and pulling the same data twice -# sector_sub_list = [] -# if _.get('keep_paired_sectors_not_in_subset_list'): -# if _.get('keep_shorter_sector_lengths'): -# v = min(sector_length_list) -# possible_sector_subset_lengths = list(range(2, 8)) -# sector_subset_length_list = [ -# x for x in possible_sector_subset_lengths if x < v] -# elif _.get('keep_shorter_sector_lengths') is False: -# v = max(sector_length_list) -# possible_sector_subset_lengths = list(range(2, 8)) -# sector_subset_length_list = [ -# x for x in possible_sector_subset_lengths if x > v] -# else: -# sector_subset_length_list = list(range(2, 8)) -# -# cw_sub = cw_load[cw_load['SectorLength'].isin( -# sector_subset_length_list)] -# sector_sub_list = cw_sub['Sector'].drop_duplicates().values.tolist() -# -# df = subset_df_by_sector_list( -# df_load, sector_list, sector_sub_list=sector_sub_list, **_) -# -# return df - - -# def subset_df_by_sector_list(df_load, sector_list, **_): -# """ -# :param df_load: -# :param sector_list: -# :param keep_paired_sectors_not_in_subset_list: bool, default False. If -# True, then if values in both sector columns and one value is not in the -# sector list, keep the column. Used for the purposes of sector -# aggregation. Only for sectors where the paired sector has a sector -# length less than sector in sector list, otherwise will get double -# counting in sector_aggregation() and sector_disaggregation() -# :param **_: optional parameters -# :return: -# """ -# df = replace_NoneType_with_empty_cells(df_load) -# -# c1 = (df['SectorProducedBy'].isin(sector_list) & -# (df['SectorConsumedBy'] == '')) -# c2 = (df['SectorProducedBy'] == '') & \ -# (df['SectorConsumedBy'].isin(sector_list)) -# c3 = (df['SectorProducedBy'].isin(sector_list) & -# df['SectorConsumedBy'].isin(sector_list)) -# -# if _.get('keep_paired_sectors_not_in_subset_list'): -# # conditions if want to keep rows of data where one sector value is not -# # in the sector list -# c4 = (df['SectorProducedBy'].isin(sector_list) & -# (df['SectorConsumedBy'].isin(_['sector_sub_list']))) -# c5 = (df['SectorProducedBy'].isin(_['sector_sub_list'])) & \ -# (df['SectorConsumedBy'].isin(sector_list)) -# -# df = df[c1 | c2 | c3 | c4 | c5].reset_index(drop=True) -# else: -# df = df[c1 | c2 | c3].reset_index(drop=True) -# -# return df - -# todo: delete -# def subset_and_merge_df_by_sector_lengths( -# df, length1, length2, **_): -# -# sector_merge = 'NAICS_' + str(length1) -# sector_add = 'NAICS_' + str(length2) -# -# # subset the df by naics length -# cw_load = load_crosswalk("sector_length") -# cw = cw_load[[sector_merge, sector_add]].drop_duplicates().reset_index( -# drop=True) -# -# # df where either sector column is length or both columns are -# df = df.reset_index(drop=True) -# df1 = subset_df_by_sector_lengths(df, [length1], **_) -# # second dataframe where length is length2 -# df2 = subset_df_by_sector_lengths(df, [length2], **_) -# -# # merge the crosswalk to create new columns where sector length equals -# # "length1" -# df2 = df2.merge(cw, how='left', left_on=['SectorProducedBy'], -# right_on=[sector_add]).rename( -# columns={sector_merge: 'SPB_tmp'}).drop(columns=sector_add) -# df2 = df2.merge(cw, how='left', -# left_on=['SectorConsumedBy'], right_on=[sector_add] -# ).rename( -# columns={sector_merge: 'SCB_tmp'}).drop(columns=sector_add) -# df2 = replace_NoneType_with_empty_cells(df2) -# # if maintaining the values that do not match the sector length -# # requirement, and if a column value is blank, replace with existing value -# if _.get('keep_paired_sectors_not_in_subset_list'): -# df2["SPB_tmp"] = np.where(df2["SPB_tmp"] == '', -# df2["SectorProducedBy"], df2["SPB_tmp"]) -# df2["SCB_tmp"] = np.where(df2["SCB_tmp"] == '', -# df2["SectorConsumedBy"], df2["SCB_tmp"]) -# -# # merge the dfs -# merge_cols = list(df1.select_dtypes(include=['object', 'int']).columns) -# # also drop activity and description cols -# merge_cols = [c for c in merge_cols -# if c not in ['SectorConsumedBy', 'SectorProducedBy', -# 'Description']] -# -# dfm = df1.merge(df2[merge_cols + ['SPB_tmp', 'SCB_tmp']], -# how='outer', -# left_on=merge_cols + ['SectorProducedBy', -# 'SectorConsumedBy'], -# right_on=merge_cols + ['SPB_tmp', 'SCB_tmp'], -# indicator=True) -# dfm = replace_NoneType_with_empty_cells(dfm) -# -# return dfm - - def assign_columns_of_sector_levels(df_load): """ Add additional column capturing the sector level in the two columns From 2594eb18a285c6c8efbb6156a8dda9f34814a10b Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 23 Aug 2023 09:43:09 -0600 Subject: [PATCH 0797/1127] update the FBS readme --- flowsa/methods/flowbysectormethods/README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/flowsa/methods/flowbysectormethods/README.md b/flowsa/methods/flowbysectormethods/README.md index 5aa657e24..39c02e436 100644 --- a/flowsa/methods/flowbysectormethods/README.md +++ b/flowsa/methods/flowbysectormethods/README.md @@ -67,7 +67,7 @@ any level, and are inherited from higher-level sources. - _exclusion_fields_: A dictionary that allows subsetting source data by column. See description in `flowby.select_by_fields()`. - _attribution_method_: currently written for `direct`, `proportional`, - `multiplication`. + `multiplication`, `equal`, `inheritance`. See "Method Descriptions" below. - _attribution_source_: The data source used to attribute the primary data source. By default attribution is performed on the primary activity column. @@ -83,8 +83,16 @@ Some functions allow for extra named parameters. - _clean_fba_: applied prior to sector columns are added. - _clean_fba_w_sec_: applied after sector columns are added but prior to attributing data to sectors. +- _clean_fba_after_attribution_: applied after activities are attributed to sectors, but before applying any additional attribution methods - _clean_fbs_: applied prior to attributing data to sectors for a FBS. +##### Defined cleaning functions +- _attribute_national_to_states()_: Propogates national data to all states to enable for use in state methods. Allocates sectors across states based on employment. +- _calculate_flow_per_employee()_: Calculates FlowAmount per employee per year based on dataset name passed in "clean_parameter" +- _estimate_suppressed_sectors_equal_attribution()_: Equally attribute known parent values to child values based on sector-length. +- _substitute_nonexistent_values()_: Fill missing values with data from another geoscale. See Water_national_2015_m1 for an example. +- _weighted_average()_: Determine the weighted average of provided values. See Water_national_2015_m1 for an example. + #### Additional optional parameters - _activity_to_sector_mapping_: name of activity to sector mapping file, if not provided will use the source name @@ -96,6 +104,8 @@ Some functions allow for extra named parameters. used if fedefl_mapping is used - _keep_unmapped_rows_: (bool) default is False, if True will maintain any flows not found in mapping files. +- _attribute_on_: (list) specify which columns in the primary dataset should be used for attribution. See REI_waste_national_2012.yaml for an example. +- _fill_columns_: (str) indicate if there is a column in the primary dataset that should be filled with the values in the attribution data source. See REI_waste_national_2012.yaml for an example. ## Method Descriptions @@ -105,3 +115,5 @@ Some functions allow for extra named parameters. values sharing the same sectors in the attribution source - proportional: Activities are proportionally attributed to sectors using specified attribution data source +- equal: Equally attribute parent values to child values until reach target sector length +- inheritance: Assign parent values to all child values. Usefull in situations where value is a rate, such as kg/m2. From b09407583eb5302a1198e20f9483464a74b3a0fd Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 23 Aug 2023 09:45:44 -0600 Subject: [PATCH 0798/1127] text wrapping --- flowsa/methods/flowbysectormethods/README.md | 47 +++++++++++++------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/README.md b/flowsa/methods/flowbysectormethods/README.md index 39c02e436..6b11bc1de 100644 --- a/flowsa/methods/flowbysectormethods/README.md +++ b/flowsa/methods/flowbysectormethods/README.md @@ -30,8 +30,8 @@ clean_fba_before_activity_sets: !script_function:EPA_NEI clean_NEI_fba ## Terms ### Target FBS output specifications - _industry_spec_: specify the `default` desired sector aggregation: - (`NAICS_2`, `NAICS_3`, `NAICS_4`, `NAICS_5`, `NAICS_6`). Further disaggregation - is possible, e.g.,: + (`NAICS_2`, `NAICS_3`, `NAICS_4`, `NAICS_5`, `NAICS_6`). Further + disaggregation is possible, e.g.,: ``` industry_spec: @@ -57,18 +57,20 @@ any level, and are inherited from higher-level sources. (`national`, `state`, or `county`). - _data_format_: default is `FBA`, specify `FBS` or `FBS_outside_flowsa`. `FBS_outside_flowsa` requires a second parameter, `FBS_datapull_fxn` which - supplies the name of the function to generate the FBS using the`!script_function:` tag. + supplies the name of the function to generate the FBS using the`! + script_function:` tag. - _activity_sets_: A subset of the FBA dataset and the method and allocation datasets used to create an FBS. - _selection_fields_: A dictionary that allows subsetting source data by column. - See description in `flowby.select_by_fields()`. To use a list of data points not - supplied in the method, use the `!from_index:` tag, then give + See description in `flowby.select_by_fields()`. To use a list of data + points not supplied in the method, use the `!from_index:` tag, then give the name (e.g., `activity_set_1`) of the activity set as found in the csv file. - _exclusion_fields_: A dictionary that allows subsetting source data by column. See description in `flowby.select_by_fields()`. - _attribution_method_: currently written for `direct`, `proportional`, `multiplication`, `equal`, `inheritance`. See "Method Descriptions" below. -- _attribution_source_: The data source used to attribute the primary data source. +- _attribution_source_: The data source used to attribute the primary data + source. By default attribution is performed on the primary activity column. #### Optional cleaning functions @@ -83,15 +85,22 @@ Some functions allow for extra named parameters. - _clean_fba_: applied prior to sector columns are added. - _clean_fba_w_sec_: applied after sector columns are added but prior to attributing data to sectors. -- _clean_fba_after_attribution_: applied after activities are attributed to sectors, but before applying any additional attribution methods +- _clean_fba_after_attribution_: applied after activities are attributed to + sectors, but before applying any additional attribution methods - _clean_fbs_: applied prior to attributing data to sectors for a FBS. ##### Defined cleaning functions -- _attribute_national_to_states()_: Propogates national data to all states to enable for use in state methods. Allocates sectors across states based on employment. -- _calculate_flow_per_employee()_: Calculates FlowAmount per employee per year based on dataset name passed in "clean_parameter" -- _estimate_suppressed_sectors_equal_attribution()_: Equally attribute known parent values to child values based on sector-length. -- _substitute_nonexistent_values()_: Fill missing values with data from another geoscale. See Water_national_2015_m1 for an example. -- _weighted_average()_: Determine the weighted average of provided values. See Water_national_2015_m1 for an example. +- _attribute_national_to_states()_: Propogates national data to all states + to enable for use in state methods. Allocates sectors across states based + on employment. +- _calculate_flow_per_employee()_: Calculates FlowAmount per employee per + year based on dataset name passed in "clean_parameter" +- _estimate_suppressed_sectors_equal_attribution()_: Equally attribute + known parent values to child values based on sector-length. +- _substitute_nonexistent_values()_: Fill missing values with data from + another geoscale. See Water_national_2015_m1 for an example. +- _weighted_average()_: Determine the weighted average of provided values. + See Water_national_2015_m1 for an example. #### Additional optional parameters - _activity_to_sector_mapping_: name of activity to sector @@ -104,8 +113,12 @@ Some functions allow for extra named parameters. used if fedefl_mapping is used - _keep_unmapped_rows_: (bool) default is False, if True will maintain any flows not found in mapping files. -- _attribute_on_: (list) specify which columns in the primary dataset should be used for attribution. See REI_waste_national_2012.yaml for an example. -- _fill_columns_: (str) indicate if there is a column in the primary dataset that should be filled with the values in the attribution data source. See REI_waste_national_2012.yaml for an example. +- _attribute_on_: (list) specify which columns in the primary dataset + should be used for attribution. See REI_waste_national_2012.yaml for an + example. +- _fill_columns_: (str) indicate if there is a column in the primary + dataset that should be filled with the values in the attribution data + source. See REI_waste_national_2012.yaml for an example. ## Method Descriptions @@ -115,5 +128,7 @@ Some functions allow for extra named parameters. values sharing the same sectors in the attribution source - proportional: Activities are proportionally attributed to sectors using specified attribution data source -- equal: Equally attribute parent values to child values until reach target sector length -- inheritance: Assign parent values to all child values. Usefull in situations where value is a rate, such as kg/m2. +- equal: Equally attribute parent values to child values until reach target + sector length +- inheritance: Assign parent values to all child values. Usefull in + situations where value is a rate, such as kg/m2. From fcc146900770e95cdf82a74dacc0d8bf8a4efd35 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 23 Aug 2023 12:00:59 -0400 Subject: [PATCH 0799/1127] drop SEEA crosswalk --- .../NAICS_Crosswalk_EPA_GHGI_SEEA.csv | 668 ------------------ 1 file changed, 668 deletions(-) delete mode 100644 flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv deleted file mode 100644 index 1d3e425a4..000000000 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_GHGI_SEEA.csv +++ /dev/null @@ -1,668 +0,0 @@ -ActivitySourceName,Activity,SectorSourceName,Sector,SectorType,Notes,Table -EPA_GHGI,Iron and Steel Production & Metallurgical Coke Production,NAICS_2012_Code,3311,,331110,EPA_GHGI_T_2_1 -EPA_GHGI,Cement Production,NAICS_2012_Code,32731,,327310,EPA_GHGI_T_2_1 -EPA_GHGI,Lime Production,NAICS_2012_Code,3274,,327400,EPA_GHGI_T_2_1 -EPA_GHGI,Ammonia Production,NAICS_2012_Code,32531,,325310,EPA_GHGI_T_2_1 -EPA_GHGI,Incineration of Waste,NAICS_2012_Code,562,,562000,EPA_GHGI_T_2_1 -EPA_GHGI,Aluminum Production,NAICS_2012_Code,331313,,331313,"EPA_GHGI_T_2_1, EPA_GHGI_T_4_80" -EPA_GHGI,Soda Ash Production,NAICS_2012_Code,32519,,325190,EPA_GHGI_T_2_1 -EPA_GHGI,Ferroalloy Production,NAICS_2012_Code,3311,,331110,EPA_GHGI_T_2_1 -EPA_GHGI,Titanium Dioxide Production,NAICS_2012_Code,32519,,325190,EPA_GHGI_T_2_1 -EPA_GHGI,Zinc Production,NAICS_2012_Code,33142,,331420,EPA_GHGI_T_2_1 -EPA_GHGI,Phosphoric Acid Production,NAICS_2012_Code,32531,,325310,EPA_GHGI_T_2_1 -EPA_GHGI,Glass Production,NAICS_2012_Code,3272,,327200,EPA_GHGI_T_2_1 -EPA_GHGI,Carbide Production and Consumption,NAICS_2012_Code,32518,,325180,EPA_GHGI_T_2_1 -EPA_GHGI,Coal Mining,NAICS_2012_Code,2121,,212100,EPA_GHGI_T_2_1 -EPA_GHGI,Wastewater Treatment,NAICS_2012_Code,2213,,221300,EPA_GHGI_T_2_1 -EPA_GHGI,Rice Cultivation,NAICS_2012_Code,11116,,1111B0,EPA_GHGI_T_2_1 -EPA_GHGI,Abandoned Oil and Gas Wells,NAICS_2012_Code,211,,211000,EPA_GHGI_T_2_1 -EPA_GHGI,Abandoned Underground Coal Mines,NAICS_2012_Code,2121,,212100,EPA_GHGI_T_2_1 -EPA_GHGI,Anaerobic Digestion at Biogas Facilities,NAICS_2012_Code,562,,new in GHGI since 2018,EPA_GHGI_T_2_1 -EPA_GHGI,Composting,NAICS_2012_Code,562,,562000,EPA_GHGI_T_2_1 -EPA_GHGI,Nitric Acid Production,NAICS_2012_Code,32531,,325310,EPA_GHGI_T_2_1 -EPA_GHGI,Adipic Acid Production,NAICS_2012_Code,32519,,325190,EPA_GHGI_T_2_1 -EPA_GHGI,"Caprolactam, Glyoxal, and Glyoxylic Acid Production",NAICS_2012_Code,32519,,325190,EPA_GHGI_T_2_1 -EPA_GHGI,Electronics Industry,NAICS_2012_Code,334413,,,EPA_GHGI_T_2_1 -EPA_GHGI,Landfills,NAICS_2012_Code,ACC,,,EPA_GHGI_T_2_1 -EPA_GHGI,Electrical Transmission and Distribution,NAICS_2012_Code,2211,,221100,EPA_GHGI_T_2_1 -EPA_GHGI,Liming,NAICS_2012_Code,111,,,EPA_GHGI_T_2_1 -EPA_GHGI,Liming,NAICS_2012_Code,112,,,EPA_GHGI_T_2_1 -EPA_GHGI,Urea Fertilization,NAICS_2012_Code,111,,,EPA_GHGI_T_2_1 -EPA_GHGI,Urea Fertilization,NAICS_2012_Code,112,,,EPA_GHGI_T_2_1 -EPA_GHGI,Urea Consumption for Non-Agricultural Purposes,NAICS_2012_Code,31,,,EPA_GHGI_T_2_1 -EPA_GHGI,Urea Consumption for Non-Agricultural Purposes,NAICS_2012_Code,32,,,EPA_GHGI_T_2_1 -EPA_GHGI,Urea Consumption for Non-Agricultural Purposes,NAICS_2012_Code,33,,,EPA_GHGI_T_2_1 -EPA_GHGI,Other Process Uses of Carbonates,NAICS_2012_Code,31,,,EPA_GHGI_T_2_1 -EPA_GHGI,Other Process Uses of Carbonates,NAICS_2012_Code,32,,,EPA_GHGI_T_2_1 -EPA_GHGI,Other Process Uses of Carbonates,NAICS_2012_Code,33,,,EPA_GHGI_T_2_1 -EPA_GHGI,Lead Production,NAICS_2012_Code,3314,,,EPA_GHGI_T_2_1 -EPA_GHGI,N2O from Product Uses,NAICS_2012_Code,621,,,EPA_GHGI_T_2_1 -EPA_GHGI,N2O from Product Uses,NAICS_2012_Code,622,,,EPA_GHGI_T_2_1 -EPA_GHGI,N2O from Product Uses,NAICS_2012_Code,623,,,EPA_GHGI_T_2_1 -EPA_GHGI,Distribution,NAICS_2012_Code,221210,,221200,"EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" -EPA_GHGI,Exploration,NAICS_2012_Code,211111,,211000,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42, EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" -EPA_GHGI,Processing,NAICS_2012_Code,211111,,211000,"EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" -EPA_GHGI,Production,NAICS_2012_Code,211111,,211000,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42, EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" -EPA_GHGI,Transmission and Storage,NAICS_2012_Code,486210,,486000,"EPA_GHGI_T_3_63, EPA_GHGI_T_3_65, EPA_GHGI_T_3_67" -EPA_GHGI,Crude Oil Transportation,NAICS_2012_Code,486110,,not mapped,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42" -EPA_GHGI,Refining,NAICS_2012_Code,324110,,324110,"EPA_GHGI_T_3_38, EPA_GHGI_T_3_40, EPA_GHGI_T_3_42" -EPA_GHGI,Chickpeas,NAICS_2012_Code,11113,,1111B0,EPA_GHGI_T_5_29 -EPA_GHGI,Cotton,NAICS_2012_Code,11192,,111900,EPA_GHGI_T_5_29 -EPA_GHGI,Maize,NAICS_2012_Code,11115,,1111B0,EPA_GHGI_T_5_29 -EPA_GHGI,Rice,NAICS_2012_Code,11116,,1111B0,EPA_GHGI_T_5_29 -EPA_GHGI,Soybeans,NAICS_2012_Code,11111,,1111A0,EPA_GHGI_T_5_29 -EPA_GHGI,Wheat,NAICS_2012_Code,11114,,1111B0,EPA_GHGI_T_5_29 -EPA_GHGI,American Bison,NAICS_2012_Code,11299,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" -EPA_GHGI,Beef Cattle,NAICS_2012_Code,11211,,1121A0,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" -EPA_GHGI,Dairy Cattle,NAICS_2012_Code,11212,,112120,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" -EPA_GHGI,Goats,NAICS_2012_Code,11242,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" -EPA_GHGI,Horses,NAICS_2012_Code,11292,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" -EPA_GHGI,Mules and Asses,NAICS_2012_Code,11292,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" -EPA_GHGI,Sheep,NAICS_2012_Code,11241,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" -EPA_GHGI,Swine,NAICS_2012_Code,1122,,112A00,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" -EPA_GHGI,Poultry,NAICS_2012_Code,1123,,112300,"EPA_GHGI_T_5_3, EPA_GHGI_T_5_7" -EPA_GHGI,Organic Amendment Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_18 -EPA_GHGI,Residue N Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_18 -EPA_GHGI,Synthetic Fertilizer Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_18 -EPA_GHGI,Mineralization and Asymbiotic Fixation Cropland,NAICS_2012_Code,1111,,"111, excl. 1114",EPA_GHGI_T_5_18 -EPA_GHGI,Mineralization and Asymbiotic Fixation Cropland,NAICS_2012_Code,1112,,,EPA_GHGI_T_5_18 -EPA_GHGI,Mineralization and Asymbiotic Fixation Cropland,NAICS_2012_Code,1113,,,EPA_GHGI_T_5_18 -EPA_GHGI,Mineralization and Asymbiotic Fixation Cropland,NAICS_2012_Code,1119,,,EPA_GHGI_T_5_18 -EPA_GHGI,Drained Organic Soils Cropland,NAICS_2012_Code,1111,,"111, excl. 1114",EPA_GHGI_T_5_18 -EPA_GHGI,Drained Organic Soils Cropland,NAICS_2012_Code,1112,,,EPA_GHGI_T_5_18 -EPA_GHGI,Drained Organic Soils Cropland,NAICS_2012_Code,1113,,,EPA_GHGI_T_5_18 -EPA_GHGI,Drained Organic Soils Cropland,NAICS_2012_Code,1119,,,EPA_GHGI_T_5_18 -EPA_GHGI,All activities Grassland,NAICS_2012_Code,112,,112,"EPA_GHGI_T_5_18, EPA_GHGI_T_5_19" -EPA_GHGI,Volatilization & Atm. Deposition Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_19 -EPA_GHGI,Surface Leaching & Run-Off Cropland,NAICS_2012_Code,111,,111,EPA_GHGI_T_5_19 -EPA_GHGI,Passenger Cars,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Motorcycles,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Rail,NAICS_2012_Code,482,,482000,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Recreational Boats,NAICS_2012_Code,F01000,,F01000,EOA_GHGI_T_3_13 -EPA_GHGI,Military Aircraft,NAICS_2012_Code,928110,,S00500,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Pipelines,NAICS_2012_Code,486,,486000,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,22,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,48,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,49,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Light-Duty Trucks,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,22,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,48,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,49,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Medium- and Heavy-Duty Trucks,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Ships and Boats,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Ships and Boats,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Ships and Boats,NAICS_2012_Code,22,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Ships and Boats,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Ships and Boats,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Ships and Boats,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Ships and Boats,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Ships and Boats,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Ships and Boats,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Ships and Boats,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Ships and Boats,NAICS_2012_Code,48,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Ships and Boats,NAICS_2012_Code,49,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Ships and Boats,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Ships and Boats,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Ships and Boats,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Ships and Boats,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Ships and Boats,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Ships and Boats,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Ships and Boats,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Ships and Boats,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Ships and Boats,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Ships and Boats,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Ships and Boats,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Ships and Boats,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,22,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,48,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,49,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,General Aviation Aircraft,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Buses,NAICS_2012_Code,485,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Buses,NAICS_2012_Code,4871,,,"EPA_GHGI_T_3_13, EPA_GHGI_T_3_14" -EPA_GHGI,Construction/Mining Equipment Non-Road,NAICS_2012_Code,211,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Construction/Mining Equipment Non-Road,NAICS_2012_Code,212,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Construction/Mining Equipment Non-Road,NAICS_2012_Code,213111,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,111,,"111, 112, 113, 114","EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,112,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,113,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Agricultural Equipment Non-Road,NAICS_2012_Code,114,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Other Non-Road,NAICS_2012_Code,485,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Other Non-Road,NAICS_2012_Code,487,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Other Non-Road,NAICS_2012_Code,488,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Other Non-Road,NAICS_2012_Code,492,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Other Non-Road,NAICS_2012_Code,5321,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Other Non-Road,NAICS_2012_Code,5324,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Other Non-Road,NAICS_2012_Code,6219,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Other Non-Road,NAICS_2012_Code,7139,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Other Non-Road,NAICS_2012_Code,8111,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Other Non-Road,NAICS_2012_Code,8113,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,All activities Alternative Fuel On-Road,NAICS_2012_Code,485,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,All activities Alternative Fuel On-Road,NAICS_2012_Code,486,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,All activities Alternative Fuel On-Road,NAICS_2012_Code,487,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,All activities Alternative Fuel On-Road,NAICS_2012_Code,488,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,All activities Alternative Fuel On-Road,NAICS_2012_Code,492,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,11,,,BTS_Airlines -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,21,,,BTS_Airlines -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,22,,,BTS_Airlines -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,23,,,BTS_Airlines -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,31,,,BTS_Airlines -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,32,,,BTS_Airlines -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,33,,,BTS_Airlines -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,42,,,BTS_Airlines -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,44,,,BTS_Airlines -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,45,,,BTS_Airlines -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,48,,,BTS_Airlines -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,49,,,BTS_Airlines -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,51,,,BTS_Airlines -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,52,,,BTS_Airlines -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,53,,,BTS_Airlines -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,54,,,BTS_Airlines -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,55,,,BTS_Airlines -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,56,,,BTS_Airlines -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,61,,,BTS_Airlines -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,62,,,BTS_Airlines -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,71,,,BTS_Airlines -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,72,,,BTS_Airlines -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,81,,,BTS_Airlines -EPA_GHGI,Commercial Aircraft,NAICS_2012_Code,92,,,BTS_Airlines -EPA_GHGI,Total (All Fuels) Residential,NAICS_2012_Code,F01000,,,EPA_GHGI_T_A_X -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,2213,,,EPA_GHGI_T_A_X -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,42,,,EPA_GHGI_T_A_X -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,44,,,EPA_GHGI_T_A_X -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,45,,,EPA_GHGI_T_A_X -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,493,,,EPA_GHGI_T_A_X -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,51,,,EPA_GHGI_T_A_X -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,52,,,EPA_GHGI_T_A_X -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,53,,,EPA_GHGI_T_A_X -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,54,,,EPA_GHGI_T_A_X -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,55,,,EPA_GHGI_T_A_X -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,56,,,EPA_GHGI_T_A_X -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,61,,,EPA_GHGI_T_A_X -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,62,,,EPA_GHGI_T_A_X -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,71,,,EPA_GHGI_T_A_X -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,72,,,EPA_GHGI_T_A_X -EPA_GHGI,Commercial Coal Commercial,NAICS_2012_Code,81,,,EPA_GHGI_T_A_X -EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,11,,,EPA_GHGI_T_A_X -EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,21,,,EPA_GHGI_T_A_X -EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,2212,,,EPA_GHGI_T_A_X -EPA_GHGI,Industrial Other Coal Industrial,NAICS_2012_Code,23,,,EPA_GHGI_T_A_X -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,2213,,,EPA_GHGI_T_A_X -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,42,,,EPA_GHGI_T_A_X -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,44,,,EPA_GHGI_T_A_X -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,45,,,EPA_GHGI_T_A_X -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,493,,,EPA_GHGI_T_A_X -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,51,,,EPA_GHGI_T_A_X -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,52,,,EPA_GHGI_T_A_X -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,53,,,EPA_GHGI_T_A_X -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,54,,,EPA_GHGI_T_A_X -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,55,,,EPA_GHGI_T_A_X -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,56,,,EPA_GHGI_T_A_X -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,61,,,EPA_GHGI_T_A_X -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,62,,,EPA_GHGI_T_A_X -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,71,,,EPA_GHGI_T_A_X -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,72,,,EPA_GHGI_T_A_X -EPA_GHGI,Natural Gas Commercial,NAICS_2012_Code,81,,,EPA_GHGI_T_A_X -EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,11,,,EPA_GHGI_T_A_X -EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,21,,,EPA_GHGI_T_A_X -EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,2212,,,EPA_GHGI_T_A_X -EPA_GHGI,Natural Gas Industrial,NAICS_2012_Code,23,,,EPA_GHGI_T_A_X -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,2213,,,EPA_GHGI_T_A_X -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,42,,,EPA_GHGI_T_A_X -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,44,,,EPA_GHGI_T_A_X -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,45,,,EPA_GHGI_T_A_X -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,493,,,EPA_GHGI_T_A_X -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,51,,,EPA_GHGI_T_A_X -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,52,,,EPA_GHGI_T_A_X -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,53,,,EPA_GHGI_T_A_X -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,54,,,EPA_GHGI_T_A_X -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,55,,,EPA_GHGI_T_A_X -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,56,,,EPA_GHGI_T_A_X -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,61,,,EPA_GHGI_T_A_X -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,62,,,EPA_GHGI_T_A_X -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,71,,,EPA_GHGI_T_A_X -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,72,,,EPA_GHGI_T_A_X -EPA_GHGI,Total Petroleum Commercial,NAICS_2012_Code,81,,,EPA_GHGI_T_A_X -EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,11,,,EPA_GHGI_T_A_X -EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,21,,,EPA_GHGI_T_A_X -EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,2212,,,EPA_GHGI_T_A_X -EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,23,,,EPA_GHGI_T_A_X -EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,31,,,EPA_GHGI_T_A_X -EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,32,,,EPA_GHGI_T_A_X -EPA_GHGI,Total Petroleum Industrial,NAICS_2012_Code,33,,,EPA_GHGI_T_A_X -EPA_GHGI,Industrial Other Coal Industrial - Manufacturing,NAICS_2012_Code,31,,,EPA_GHGI_T_A_X -EPA_GHGI,Industrial Other Coal Industrial - Manufacturing,NAICS_2012_Code,32,,,EPA_GHGI_T_A_X -EPA_GHGI,Industrial Other Coal Industrial - Manufacturing,NAICS_2012_Code,33,,,EPA_GHGI_T_A_X -EPA_GHGI,Natural Gas Industrial - Manufacturing,NAICS_2012_Code,31,,,EPA_GHGI_T_A_X -EPA_GHGI,Natural Gas Industrial - Manufacturing,NAICS_2012_Code,32,,,EPA_GHGI_T_A_X -EPA_GHGI,Natural Gas Industrial - Manufacturing,NAICS_2012_Code,33,,,EPA_GHGI_T_A_X -EPA_GHGI,Fuel Oil Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Residential,NAICS_2012_Code,F01000,,F01000,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural Gas Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Residential,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Electric Power,NAICS_2012_Code,2211,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Electric Power,NAICS_2012_Code,2211,,,EPA_GHGI_T_3_8 -EPA_GHGI,Natural Gas Electric Power,NAICS_2012_Code,2211,,,EPA_GHGI_T_3_9 -EPA_GHGI,Fuel Oil Electric Power,NAICS_2012_Code,2211,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Wood Electric Power,NAICS_2012_Code,2211,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,2213,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,493,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Commercial,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Fuel Oil Industrial,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial,NAICS_2012_Code,11,,"11, 21, 2212, 23, 31, 32, 33","EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial,NAICS_2012_Code,2212,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Coal Industrial - Manufacturing,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Industrial - Manufacturing,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Industrial - Manufacturing,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Natural gas Industrial - Manufacturing,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_8, EPA_GHGI_T_3_9" -EPA_GHGI,Electric Power,NAICS_2012_Code,2211,,,EPA_GHGI_T_3_7 -EPA_GHGI,Acrylonitrile,NAICS_2012_Code,325199,,,EPA_GHGI_T_4_46 -EPA_GHGI,Carbon Black,NAICS_2012_Code,325180,,,EPA_GHGI_T_4_46 -EPA_GHGI,Ethylene,NAICS_2012_Code,324110,,,EPA_GHGI_T_4_46 -EPA_GHGI,Ethylene Dichloride,NAICS_2012_Code,325120,,,EPA_GHGI_T_4_46 -EPA_GHGI,Ethylene Oxide,NAICS_2012_Code,325199,,,EPA_GHGI_T_4_46 -EPA_GHGI,Methanol,NAICS_2012_Code,325199,,,EPA_GHGI_T_4_46 -EPA_GHGI,Industry Industrial Coking Coal,NAICS_2012_Code,212210,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Industrial Other Coal,NAICS_2012_Code,212210,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Distillate Fuel Oil,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry LPG,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Pentanes Plus,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Petroleum Coke,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Still Gas,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Natural Gas to Chemical Plants,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Natural Gas to Chemical Plants,NAICS_2012_Code,32,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Natural Gas to Chemical Plants,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,31,,"31, 32, 33",EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Asphalt & Road Oil,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Lubricants,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Miscellaneous Products,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Naphtha (<401 F),NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Other Oil (>401 F),NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Special Naphtha,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,31,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,324110,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,324199,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,325,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,326,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,327,,,EPA_GHGI_T_3_22 -EPA_GHGI,Industry Waxes,NAICS_2012_Code,33,,,EPA_GHGI_T_3_22 -EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,48,,,EPA_GHGI_T_3_22 -EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,491,,,EPA_GHGI_T_3_22 -EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,492,,,EPA_GHGI_T_3_22 -EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,92,,,EPA_GHGI_T_3_22 -EPA_GHGI,Transportation Lubricants,NAICS_2012_Code,F01000,,,EPA_GHGI_T_3_22 -EPA_GHGI,HCFC-22 Production,NAICS_2012_Code,325120,,325120,EPA_GHGI_T_4_50 -EPA_GHGI,Electronics Production,NAICS_2012_Code,334413,,334413,EPA_GHGI_T_4_94 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,11,,"All sectors, excluding transport",EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,21,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,22,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,23,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,31,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,32,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,33,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,42,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,44,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,45,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,49,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,51,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,52,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,53,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,54,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,55,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,56,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,61,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,62,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,71,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,72,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,81,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,92,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning,NAICS_2012_Code,F01000,,,EPA_GHGI_T_4_101 -EPA_GHGI,Refrigeration/Air Conditioning - Households,NAICS_2012_Code,F01000,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,11,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,21,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,22,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,23,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,31,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,32,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,33,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,42,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,44,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,45,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,48,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,49,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,51,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,52,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,53,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,54,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,55,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,56,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,61,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,62,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,71,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,72,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,81,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,92,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Polystyrene,NAICS_2012_Code,F01000,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,11,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,21,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,22,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,23,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,31,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,32,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,33,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,42,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,44,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,45,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,48,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,49,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,51,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,52,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,53,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,54,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,55,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,56,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,61,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,62,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,71,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,72,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,81,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,92,,,EPA_GHGI_T_4_101 -EPA_GHGI,Foams - Urethane,NAICS_2012_Code,F01000,,,EPA_GHGI_T_4_101 -EPA_GHGI,School and Tour Buses,NAICS_2012_Code,485,,485000,EPA_GHGI_T_A_103 -EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,11,,,EPA_GHGI_T_A_103 -EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,21,,,EPA_GHGI_T_A_103 -EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,22,,,EPA_GHGI_T_A_103 -EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,23,,,EPA_GHGI_T_A_103 -EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,31,,,EPA_GHGI_T_A_103 -EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,32,,,EPA_GHGI_T_A_103 -EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,33,,,EPA_GHGI_T_A_103 -EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,42,,,EPA_GHGI_T_A_103 -EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,44,,,EPA_GHGI_T_A_103 -EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,45,,,EPA_GHGI_T_A_103 -EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,48,,,EPA_GHGI_T_A_103 -EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,49,,,EPA_GHGI_T_A_103 -EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,51,,,EPA_GHGI_T_A_103 -EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,52,,,EPA_GHGI_T_A_103 -EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,53,,,EPA_GHGI_T_A_103 -EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,54,,,EPA_GHGI_T_A_103 -EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,55,,,EPA_GHGI_T_A_103 -EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,56,,,EPA_GHGI_T_A_103 -EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,61,,,EPA_GHGI_T_A_103 -EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,62,,,EPA_GHGI_T_A_103 -EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,71,,,EPA_GHGI_T_A_103 -EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,72,,,EPA_GHGI_T_A_103 -EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,81,,,EPA_GHGI_T_A_103 -EPA_GHGI,Heavy-Duty Vehicles,NAICS_2012_Code,92,,,EPA_GHGI_T_A_103 -EPA_GHGI,Magnesium Production and Processing,NAICS_2012_Code,331410,,"331410, 331490, 331520",EPA_GHGI_T_4_84 -EPA_GHGI,Magnesium Production and Processing,NAICS_2012_Code,33149,,,EPA_GHGI_T_4_84 -EPA_GHGI,Magnesium Production and Processing,NAICS_2012_Code,33152,,,EPA_GHGI_T_4_84 -EPA_GHGI,Marine Shipping,NAICS_2012_Code,11,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,21,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,22,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,23,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,31,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,32,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,33,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,42,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,44,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,45,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,48,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,49,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,51,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,52,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,53,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,54,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,55,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,56,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,61,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,62,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,71,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,72,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,81,,,BEA_Bunker_Fuel -EPA_GHGI,Marine Shipping,NAICS_2012_Code,92,,,BEA_Bunker_Fuel -EPA_GHGI,Marine,NAICS_2012_Code,11,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,21,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,22,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,23,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,31,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,32,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,33,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,42,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,44,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,45,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,48,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,49,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,51,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,52,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,53,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,54,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,55,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,56,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,61,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,62,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,71,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,72,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,81,,,GHGI2020_3_104 -EPA_GHGI,Marine,NAICS_2012_Code,92,,,GHGI2020_3_104 -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,22,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,48,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,49,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Distillate Fuel Oil Transportation,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,F01000,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,11,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,21,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,22,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,23,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,31,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,32,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,33,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,42,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,44,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,45,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,48,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,49,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,51,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,52,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,53,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,54,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,55,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,56,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,61,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,62,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,71,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,72,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,81,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Motor Gasoline Transportation,NAICS_2012_Code,92,,,"EPA_GHGI_T_3_14, EPA_GHGI_T_3_15" -EPA_GHGI,Aviation,NAICS_2012_Code,11,,,EPA_GHGI_T_A_103 -EPA_GHGI,Aviation,NAICS_2012_Code,21,,,EPA_GHGI_T_A_103 -EPA_GHGI,Aviation,NAICS_2012_Code,22,,,EPA_GHGI_T_A_103 -EPA_GHGI,Aviation,NAICS_2012_Code,23,,,EPA_GHGI_T_A_103 -EPA_GHGI,Aviation,NAICS_2012_Code,31,,,EPA_GHGI_T_A_103 -EPA_GHGI,Aviation,NAICS_2012_Code,32,,,EPA_GHGI_T_A_103 -EPA_GHGI,Aviation,NAICS_2012_Code,33,,,EPA_GHGI_T_A_103 -EPA_GHGI,Aviation,NAICS_2012_Code,42,,,EPA_GHGI_T_A_103 -EPA_GHGI,Aviation,NAICS_2012_Code,44,,,EPA_GHGI_T_A_103 -EPA_GHGI,Aviation,NAICS_2012_Code,45,,,EPA_GHGI_T_A_103 -EPA_GHGI,Aviation,NAICS_2012_Code,48,,,EPA_GHGI_T_A_103 -EPA_GHGI,Aviation,NAICS_2012_Code,49,,,EPA_GHGI_T_A_103 -EPA_GHGI,Aviation,NAICS_2012_Code,51,,,EPA_GHGI_T_A_103 -EPA_GHGI,Aviation,NAICS_2012_Code,52,,,EPA_GHGI_T_A_103 -EPA_GHGI,Aviation,NAICS_2012_Code,53,,,EPA_GHGI_T_A_103 -EPA_GHGI,Aviation,NAICS_2012_Code,54,,,EPA_GHGI_T_A_103 -EPA_GHGI,Aviation,NAICS_2012_Code,55,,,EPA_GHGI_T_A_103 -EPA_GHGI,Aviation,NAICS_2012_Code,56,,,EPA_GHGI_T_A_103 -EPA_GHGI,Aviation,NAICS_2012_Code,61,,,EPA_GHGI_T_A_103 -EPA_GHGI,Aviation,NAICS_2012_Code,62,,,EPA_GHGI_T_A_103 -EPA_GHGI,Aviation,NAICS_2012_Code,71,,,EPA_GHGI_T_A_103 -EPA_GHGI,Aviation,NAICS_2012_Code,72,,,EPA_GHGI_T_A_103 -EPA_GHGI,Aviation,NAICS_2012_Code,81,,,EPA_GHGI_T_A_103 -EPA_GHGI,Aviation,NAICS_2012_Code,92,,,EPA_GHGI_T_A_103 From 4952935cb27a17b16e0d155e12b55d00a049d7b8 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 23 Aug 2023 12:05:07 -0400 Subject: [PATCH 0800/1127] update CNHW_national to use flow per employee or flows per person --- flowsa/data/source_catalog.yaml | 1 - flowsa/flowbyclean.py | 7 ++- .../CNHW_national_2014.yaml | 43 +++++++++++++++---- .../CNHW_national_2018.yaml | 43 +++++++++++++++---- 4 files changed, 75 insertions(+), 19 deletions(-) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 8d0201c49..09fcde5fd 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -89,7 +89,6 @@ Census_CBP: Census_PEP_Population: data_format: FBA class: Other - activity_schema: NAICS_2012_Code sector_hierarchy: "flat" Census_QWI: data_format: FBA diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index 35a7abc08..ddeeb4049 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -405,13 +405,16 @@ def calculate_flow_per_employee( **_ ) -> 'FlowBySector': """ - Calculates FlowAmount per employee per year based on dataset name passed - in "clean_parameter" + Calculates FlowAmount per employee (or other metric) per year based on + dataset name passed in "clean_parameter" clean_fbs function """ bls = load_prepare_clean_source(fbs, download_sources_ok=download_sources_ok) cols = ['Location', 'Year', 'SectorProducedBy'] + if bls['SectorProducedBy'].isna().all(): + bls = bls.assign(SectorProducedBy = bls['SectorConsumedBy']) + ## TODO ^^ need to account for mismatched of ProducedBy/ConsumedBy fbs = (fbs .sector_aggregation() .aggregate_flowby() diff --git a/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml b/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml index 308c00ccc..c7c8fe621 100644 --- a/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml @@ -9,11 +9,38 @@ geoscale: national source_names: CNHW_CA_2014: - clean_fbs: !clean_function:flowbyclean calculate_flow_per_employee - clean_source: - Employment_state_2014: - geoscale: state - attribution_method: multiplication - attribution_source: - Employment_state_2014: - geoscale: state + activity_sets: + employment: + exclusion_fields: + SectorProducedBy: + - F01000 + clean_fbs: !clean_function:flowbyclean calculate_flow_per_employee + clean_source: + Employment_state_2014: + geoscale: state + attribution_method: multiplication + attribution_source: + Employment_state_2014: + geoscale: state + population: # Requires an alternate dataset for Households (F01000) + selection_fields: + SectorProducedBy: + - F01000 + clean_fbs: !clean_function:flowbyclean calculate_flow_per_employee + clean_source: + Census_PEP_Population: + year: 2014 + geoscale: state + activity_schema: NAICS_2012_Code # Update based on use of F01000 + selection_fields: + ActivityConsumedBy: + All: F01000 # Change to align with field in CNHW_CA + attribution_method: multiplication + attribution_source: + Census_PEP_Population: + year: 2014 + geoscale: state + activity_schema: NAICS_2012_Code # Update based on use of F01000 + selection_fields: + ActivityConsumedBy: + All: F01000 # Change to align with field in CNHW_CA diff --git a/flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml b/flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml index 553c0cddd..497117e51 100644 --- a/flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml +++ b/flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml @@ -9,11 +9,38 @@ geoscale: national source_names: CNHW_CA_2014: - clean_fbs: !clean_function:flowbyclean calculate_flow_per_employee - clean_source: - Employment_state_2014: - geoscale: state - attribution_method: multiplication - attribution_source: - Employment_state_2018: - geoscale: state + activity_sets: + employment: + exclusion_fields: + SectorProducedBy: + - F01000 + clean_fbs: !clean_function:flowbyclean calculate_flow_per_employee + clean_source: + Employment_state_2014: + geoscale: state + attribution_method: multiplication + attribution_source: + Employment_state_2018: + geoscale: state + population: # Requires an alternate dataset for Households (F01000) + selection_fields: + SectorProducedBy: + - F01000 + clean_fbs: !clean_function:flowbyclean calculate_flow_per_employee + clean_source: + Census_PEP_Population: + year: 2014 + geoscale: state + activity_schema: NAICS_2012_Code # Update based on use of F01000 + selection_fields: + ActivityConsumedBy: + All: F01000 # Change to align with field in CNHW_CA + attribution_method: multiplication + attribution_source: + Census_PEP_Population: + year: 2018 + geoscale: state + activity_schema: NAICS_2012_Code # Update based on use of F01000 + selection_fields: + ActivityConsumedBy: + All: F01000 # Change to align with field in CNHW_CA From 81dd6f983c07279580d49e03877304b1e2db4b1c Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 23 Aug 2023 13:40:18 -0600 Subject: [PATCH 0801/1127] for consistency with employment, assign population to APB --- flowsa/data_source_scripts/Census_PEP_Population.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/data_source_scripts/Census_PEP_Population.py b/flowsa/data_source_scripts/Census_PEP_Population.py index 498d8c09a..4f1cf9f30 100644 --- a/flowsa/data_source_scripts/Census_PEP_Population.py +++ b/flowsa/data_source_scripts/Census_PEP_Population.py @@ -158,7 +158,7 @@ def census_pop_parse(*, df_list, year, **_): df['SourceName'] = 'Census_PEP_Population' df['FlowName'] = 'Population' df['Unit'] = 'p' - df['ActivityConsumedBy'] = 'F01000' # attribute to household + df['ActivityProducedBy'] = 'F01000' # attribute to household # temporary data quality scores df['DataReliability'] = 5 # tmp df['DataCollection'] = 5 # tmp From 7106598d5a703915e1149df55c8fcfd028310c6f Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 23 Aug 2023 14:38:21 -0600 Subject: [PATCH 0802/1127] 2020 and 2021 census pep population not working worrectly - API urls changed --- .../methods/flowbyactivitymethods/Census_PEP_Population.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/methods/flowbyactivitymethods/Census_PEP_Population.yaml b/flowsa/methods/flowbyactivitymethods/Census_PEP_Population.yaml index 3b5e8ec28..65963876c 100644 --- a/flowsa/methods/flowbyactivitymethods/Census_PEP_Population.yaml +++ b/flowsa/methods/flowbyactivitymethods/Census_PEP_Population.yaml @@ -41,5 +41,5 @@ years: - 2017 - 2018 - 2019 -- 2020 -- 2021 +#- 2020 +#- 2021 From ddf48788ab3b550e436b5d6f533d79a1cbd339d0 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 23 Aug 2023 16:51:03 -0400 Subject: [PATCH 0803/1127] change `calculate_flow_per_employee` to `calculate_flow_per_person` --- flowsa/flowbyclean.py | 16 ++++++++-------- flowsa/methods/flowbysectormethods/README.md | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index ddeeb4049..59a0630b8 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -399,13 +399,13 @@ def attribute_national_to_states(fba: FlowByActivity, **_) -> FlowByActivity: return fba -def calculate_flow_per_employee( +def calculate_flow_per_person( fbs: 'FlowBySector', download_sources_ok: bool = True, **_ ) -> 'FlowBySector': """ - Calculates FlowAmount per employee (or other metric) per year based on + Calculates FlowAmount per person (or other metric) per year based on dataset name passed in "clean_parameter" clean_fbs function """ @@ -420,16 +420,16 @@ def calculate_flow_per_employee( .aggregate_flowby() # ^^ handles updated industry specs .merge(bls - .rename(columns={'FlowAmount': 'Employees'}) - .groupby(cols).agg({'Employees': 'sum'}) + .rename(columns={'FlowAmount': 'persons'}) + .groupby(cols).agg({'persons': 'sum'}) .reset_index(), how='inner', on=cols) .assign(FlowAmount=lambda x: np.divide( - x['FlowAmount'], x['Employees'], out=np.zeros_like( - x['Employees']), where=x['Employees'] != 0)) - .assign(Unit = lambda x: x['Unit'] + '/employee') - .drop(columns=['Employees']) + x['FlowAmount'], x['persons'], out=np.zeros_like( + x['persons']), where=x['persons'] != 0)) + .assign(Unit = lambda x: x['Unit'] + '/p') + .drop(columns=['persons']) ) return fbs diff --git a/flowsa/methods/flowbysectormethods/README.md b/flowsa/methods/flowbysectormethods/README.md index 6b11bc1de..d11de17bc 100644 --- a/flowsa/methods/flowbysectormethods/README.md +++ b/flowsa/methods/flowbysectormethods/README.md @@ -93,7 +93,7 @@ Some functions allow for extra named parameters. - _attribute_national_to_states()_: Propogates national data to all states to enable for use in state methods. Allocates sectors across states based on employment. -- _calculate_flow_per_employee()_: Calculates FlowAmount per employee per +- _calculate_flow_per_person()_: Calculates FlowAmount per person per year based on dataset name passed in "clean_parameter" - _estimate_suppressed_sectors_equal_attribution()_: Equally attribute known parent values to child values based on sector-length. From 1b432f070aedc8153c82a9a7f8eaccefdf03747b Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 23 Aug 2023 16:52:25 -0400 Subject: [PATCH 0804/1127] simplify CNHW method with latest Census_PEP; update state method --- flowsa/data/source_catalog.yaml | 1 + .../CNHW_national_2014.yaml | 12 +---- .../CNHW_national_2018.yaml | 16 ++----- .../flowbysectormethods/CNHW_state_2014.yaml | 46 +++++++++++++++---- 4 files changed, 43 insertions(+), 32 deletions(-) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 09fcde5fd..8d0201c49 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -89,6 +89,7 @@ Census_CBP: Census_PEP_Population: data_format: FBA class: Other + activity_schema: NAICS_2012_Code sector_hierarchy: "flat" Census_QWI: data_format: FBA diff --git a/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml b/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml index c7c8fe621..3976a48cb 100644 --- a/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml @@ -14,7 +14,7 @@ source_names: exclusion_fields: SectorProducedBy: - F01000 - clean_fbs: !clean_function:flowbyclean calculate_flow_per_employee + clean_fbs: !clean_function:flowbyclean calculate_flow_per_person clean_source: Employment_state_2014: geoscale: state @@ -26,21 +26,13 @@ source_names: selection_fields: SectorProducedBy: - F01000 - clean_fbs: !clean_function:flowbyclean calculate_flow_per_employee + clean_fbs: !clean_function:flowbyclean calculate_flow_per_person clean_source: Census_PEP_Population: year: 2014 geoscale: state - activity_schema: NAICS_2012_Code # Update based on use of F01000 - selection_fields: - ActivityConsumedBy: - All: F01000 # Change to align with field in CNHW_CA attribution_method: multiplication attribution_source: Census_PEP_Population: year: 2014 geoscale: state - activity_schema: NAICS_2012_Code # Update based on use of F01000 - selection_fields: - ActivityConsumedBy: - All: F01000 # Change to align with field in CNHW_CA diff --git a/flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml b/flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml index 497117e51..0df962e8a 100644 --- a/flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml +++ b/flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml @@ -14,9 +14,9 @@ source_names: exclusion_fields: SectorProducedBy: - F01000 - clean_fbs: !clean_function:flowbyclean calculate_flow_per_employee + clean_fbs: !clean_function:flowbyclean calculate_flow_per_person clean_source: - Employment_state_2014: + Employment_state_2014: # aligns with CA 2014 data geoscale: state attribution_method: multiplication attribution_source: @@ -26,21 +26,13 @@ source_names: selection_fields: SectorProducedBy: - F01000 - clean_fbs: !clean_function:flowbyclean calculate_flow_per_employee + clean_fbs: !clean_function:flowbyclean calculate_flow_per_person clean_source: Census_PEP_Population: - year: 2014 + year: 2014 # aligns with CA 2014 data geoscale: state - activity_schema: NAICS_2012_Code # Update based on use of F01000 - selection_fields: - ActivityConsumedBy: - All: F01000 # Change to align with field in CNHW_CA attribution_method: multiplication attribution_source: Census_PEP_Population: year: 2018 geoscale: state - activity_schema: NAICS_2012_Code # Update based on use of F01000 - selection_fields: - ActivityConsumedBy: - All: F01000 # Change to align with field in CNHW_CA diff --git a/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml b/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml index c601044b6..8546e4bec 100644 --- a/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml @@ -7,13 +7,39 @@ geoscale: state source_names: CNHW_CA_2014: - clean_fbs: !clean_function:flowbyclean calculate_flow_per_employee - clean_source: Employment_state_2014 - attribution_method: multiplication - attribute_on: ['SectorProducedBy'] - fill_columns: Location - attribution_source: - Employment_state_2014: - geoscale: state - - + activity_sets: + employment: + exclusion_fields: + SectorProducedBy: + - F01000 + clean_fbs: !clean_function:flowbyclean calculate_flow_per_person + clean_source: + Employment_state_2014: + geoscale: state + attribution_method: multiplication + # To avoid matching Location, which is filled from attribution source, + # only attribute on SectorProducedBy + attribute_on: ['SectorProducedBy'] + fill_columns: Location + attribution_source: + Employment_state_2014: + geoscale: state + population: # Requires an alternate dataset for Households (F01000) + selection_fields: + SectorProducedBy: + - F01000 + - F010 + clean_fbs: !clean_function:flowbyclean calculate_flow_per_person + clean_source: + Census_PEP_Population: + year: 2014 + geoscale: state + attribution_method: multiplication + # To avoid matching Location, which is filled from attribution source, + # only attribute on SectorProducedBy + attribute_on: ['SectorProducedBy'] + fill_columns: Location + attribution_source: + Census_PEP_Population: + year: 2014 + geoscale: state From 7bcff37290fe43e230564bee414937397c8f45bd Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 23 Aug 2023 17:27:52 -0400 Subject: [PATCH 0805/1127] update Year from attribution column --- flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml b/flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml index 0df962e8a..e57efc228 100644 --- a/flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml +++ b/flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml @@ -19,6 +19,7 @@ source_names: Employment_state_2014: # aligns with CA 2014 data geoscale: state attribution_method: multiplication + fill_columns: Year attribution_source: Employment_state_2018: geoscale: state @@ -32,6 +33,7 @@ source_names: year: 2014 # aligns with CA 2014 data geoscale: state attribution_method: multiplication + fill_columns: Year attribution_source: Census_PEP_Population: year: 2018 From 9826ef2316179af5d1df8fbbf47022298f2b2a77 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 23 Aug 2023 20:13:45 -0400 Subject: [PATCH 0806/1127] ensure that no new int columns get dropped as type int64 --- flowsa/flowby.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 725f334d4..aece3ec79 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -213,8 +213,8 @@ def flow_col(self) -> str: @property def groupby_cols(self) -> List[str]: return [x for x in self - if self[x].dtype in ['int', 'object'] and x not in - ['Description', 'group_id']] + if self[x].dtype in ['int', 'object', 'int32', 'int64'] + and x not in ['Description', 'group_id']] @classmethod def _getFlowBy( @@ -1216,9 +1216,10 @@ def multiplication_attribution( return ( fb .drop(columns=['PrimarySector', 'SecondarySector', - 'temp_location', 'group_total', 'Unit_other', + 'temp_location', 'group_total', 'Denominator'], errors='ignore') + .drop(fb.filter(regex='_other').columns, axis=1) .reset_index(drop=True) ) From dc1eb9fe0d81b732ee1d07615800472026cd2522 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 23 Aug 2023 21:42:44 -0400 Subject: [PATCH 0807/1127] update CNHWC national to recursive approach --- flowsa/data_source_scripts/EPA_CDDPath.py | 15 ------------ .../CNHWC_national_2014.yaml | 23 +++++++++++++------ 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_CDDPath.py b/flowsa/data_source_scripts/EPA_CDDPath.py index 948433047..b401da37c 100644 --- a/flowsa/data_source_scripts/EPA_CDDPath.py +++ b/flowsa/data_source_scripts/EPA_CDDPath.py @@ -170,21 +170,6 @@ def call_generation_by_source(file_dict): return df2 -def assign_wood_to_engineering(fba, **_): - """clean_fba_df_fxn that reclassifies Wood from 'Other' to - 'Other - Wood' so that its mapping can be adjusted to only use - 237990/Heavy engineering NAICS according to method in Meyer et al. 2020 - :param fba: df, FBA of CDDPath - :return: df, CDDPath FBA with wood reassigned - """ - # Update wood to a new activity for improved mapping - fba.loc[((fba.FlowName == 'Wood') & - (fba.ActivityProducedBy == 'Other')), - 'ActivityProducedBy'] = 'Other - Wood' - - return fba - - def keep_activity_consumed_by(fba, **_): """clean_allocation_fba""" fba['ActivityProducedBy'] = None diff --git a/flowsa/methods/flowbysectormethods/CNHWC_national_2014.yaml b/flowsa/methods/flowbysectormethods/CNHWC_national_2014.yaml index 350d14639..66a0dabe8 100644 --- a/flowsa/methods/flowbysectormethods/CNHWC_national_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CNHWC_national_2014.yaml @@ -8,17 +8,26 @@ source_names: EPA_CDDPath: geoscale: national year: 2014 - clean_fba_before_mapping: !script_function:EPA_CDDPath assign_wood_to_engineering # mfl_mapping: 'EPA_CDDPath' activity_sets: - construction_spending: + construction_spending_wood: selection_fields: - PrimaryActivity: - - Buildings - - Other - - Other - Wood - - Roads and Bridges + # reclassifies Wood from 'Other' to 'Other - Wood' so that its + # mapping can be adjusted to only use 237990/Heavy engineering + # NAICS according to method in Meyer et al. 2020 + FlowName: Wood + ActivityProducedBy: + Other: 'Other - Wood' + attribution_method: direct + attribute_on: ['SectorProducedBy'] + construction_spending: + # All other data + exclusion_fields: + conditional: + FlowName: Wood + ActivityProducedBy: Other attribution_method: proportional + attribute_on: ['SectorProducedBy'] attribution_source: Census_VIP: year: 2014 From 107bd63ba37799145a381f830a4ac85f219299ef Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 23 Aug 2023 22:17:52 -0400 Subject: [PATCH 0808/1127] drop all ACB --- .../CNHWC_national_2014.yaml | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/flowsa/methods/flowbysectormethods/CNHWC_national_2014.yaml b/flowsa/methods/flowbysectormethods/CNHWC_national_2014.yaml index 66a0dabe8..65df7edd4 100644 --- a/flowsa/methods/flowbysectormethods/CNHWC_national_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CNHWC_national_2014.yaml @@ -18,6 +18,13 @@ source_names: FlowName: Wood ActivityProducedBy: Other: 'Other - Wood' + ActivityConsumedBy: + # reset all ActivityConsumedBy to drop for this method + Compost: '' + Fuel: '' + Landfill: '' + Mulch: '' + Remanufacture: '' attribution_method: direct attribute_on: ['SectorProducedBy'] construction_spending: @@ -26,6 +33,26 @@ source_names: conditional: FlowName: Wood ActivityProducedBy: Other + selection_fields: + ActivityConsumedBy: + # reset all ActivityConsumedBy to drop for this method + Aggregate: '' + Aggregate- Drain Rock: '' + Aggregate- Other Construction: '' + Aggregate- Road Base: '' + Agricultural: '' + Compost: '' + Compost/Mulch: '' + Fill Material: '' + Fuel: '' + General Recycled: '' + HMA/WMA: '' + Landfill: '' + Landfill Cover: '' + Mulch: '' + Other: '' + Remanufacture: '' + Road Base: '' attribution_method: proportional attribute_on: ['SectorProducedBy'] attribution_source: From f21a6834ade548cde49ff4a111ce1fb7fa271715 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 24 Aug 2023 12:46:33 -0600 Subject: [PATCH 0809/1127] set FBA and FBS columns as required --- flowsa/schema.py | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/flowsa/schema.py b/flowsa/schema.py index 83b1f9c7f..b8d68a03f 100644 --- a/flowsa/schema.py +++ b/flowsa/schema.py @@ -14,17 +14,17 @@ 'Suppressed': [{'dtype': 'object'}, {'required': False}], 'Unit': [{'dtype': 'str'}, {'required': True}], 'FlowType': [{'dtype': 'str'}, {'required': True}], - 'ActivityProducedBy': [{'dtype': 'str'}, {'required': False}], - 'ActivityConsumedBy': [{'dtype': 'str'}, {'required': False}], - 'Compartment': [{'dtype': 'str'}, {'required': False}], + 'ActivityProducedBy': [{'dtype': 'str'}, {'required': True}], + 'ActivityConsumedBy': [{'dtype': 'str'}, {'required': True}], + 'Compartment': [{'dtype': 'str'}, {'required': True}], 'Location': [{'dtype': 'str'}, {'required': True}], 'LocationSystem': [{'dtype': 'str'}, {'required': True}], 'Year': [{'dtype': 'int'}, {'required': True}], - 'MeasureofSpread': [{'dtype': 'str'}, {'required': False}], - 'Spread': [{'dtype': 'float'}, {'required': False}], - 'DistributionType': [{'dtype': 'str'}, {'required': False}], - 'Min': [{'dtype': 'float'}, {'required': False}], - 'Max': [{'dtype': 'float'}, {'required': False}], + 'MeasureofSpread': [{'dtype': 'str'}, {'required': True}], + 'Spread': [{'dtype': 'float'}, {'required': True}], + 'DistributionType': [{'dtype': 'str'}, {'required': True}], + 'Min': [{'dtype': 'float'}, {'required': True}], + 'Max': [{'dtype': 'float'}, {'required': True}], 'DataReliability': [{'dtype': 'float'}, {'required': True}], 'DataCollection': [{'dtype': 'float'}, {'required': True}], 'Description': [{'dtype': 'str'}, {'required': True}] @@ -32,9 +32,9 @@ flow_by_sector_fields = \ {'Flowable': [{'dtype': 'str'}, {'required': True}], 'Class': [{'dtype': 'str'}, {'required': True}], - 'SectorProducedBy': [{'dtype': 'str'}, {'required': False}], - 'SectorConsumedBy': [{'dtype': 'str'}, {'required': False}], - 'SectorSourceName': [{'dtype': 'str'}, {'required': False}], + 'SectorProducedBy': [{'dtype': 'str'}, {'required': True}], + 'SectorConsumedBy': [{'dtype': 'str'}, {'required': True}], + 'SectorSourceName': [{'dtype': 'str'}, {'required': True}], 'Context': [{'dtype': 'str'}, {'required': True}], 'Location': [{'dtype': 'str'}, {'required': True}], 'LocationSystem': [{'dtype': 'str'}, {'required': True}], @@ -42,20 +42,20 @@ 'Unit': [{'dtype': 'str'}, {'required': True}], 'FlowType': [{'dtype': 'str'}, {'required': True}], 'Year': [{'dtype': 'int'}, {'required': True}], - 'ProducedBySectorType': [{'dtype': 'str'}, {'required': False}], - 'ConsumedBySectorType': [{'dtype': 'str'}, {'required': False}], - 'MeasureofSpread': [{'dtype': 'str'}, {'required': False}], - 'Spread': [{'dtype': 'float'}, {'required': False}], - 'DistributionType': [{'dtype': 'str'}, {'required': False}], - 'Min': [{'dtype': 'float'}, {'required': False}], - 'Max': [{'dtype': 'float'}, {'required': False}], + 'ProducedBySectorType': [{'dtype': 'str'}, {'required': True}], + 'ConsumedBySectorType': [{'dtype': 'str'}, {'required': True}], + 'MeasureofSpread': [{'dtype': 'str'}, {'required': True}], + 'Spread': [{'dtype': 'float'}, {'required': True}], + 'DistributionType': [{'dtype': 'str'}, {'required': True}], + 'Min': [{'dtype': 'float'}, {'required': True}], + 'Max': [{'dtype': 'float'}, {'required': True}], 'DataReliability': [{'dtype': 'float'}, {'required': True}], 'TemporalCorrelation': [{'dtype': 'float'}, {'required': True}], 'GeographicalCorrelation': [{'dtype': 'float'}, {'required': True}], 'TechnologicalCorrelation': [{'dtype': 'float'}, {'required': True}], 'DataCollection': [{'dtype': 'float'}, {'required': True}], 'MetaSources': [{'dtype': 'str'}, {'required': True}], - 'AttributionSources': [{'dtype': 'str'}, {'required': False}], + 'AttributionSources': [{'dtype': 'str'}, {'required': True}], 'FlowUUID': [{'dtype': 'str'}, {'required': True}] } flow_by_sector_fields_w_activity = flow_by_sector_fields.copy() From 4cc71b7f8ed894b430c8bd73f58a8ce5ae639e15 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 24 Aug 2023 12:47:27 -0600 Subject: [PATCH 0810/1127] only add FBA/FBS columns if they are required (do not add 'suppressed' to FBAs) --- flowsa/dataclean.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/flowsa/dataclean.py b/flowsa/dataclean.py index 8df1d466e..2af81bbe6 100644 --- a/flowsa/dataclean.py +++ b/flowsa/dataclean.py @@ -71,16 +71,20 @@ def add_missing_flow_by_fields(flowby_partial_df, flowbyfields): or flow_by_sector_collapsed_fields :return: df, with all required columns """ - for k in flowbyfields.keys(): - if k not in flowby_partial_df.columns: - flowby_partial_df[k] = None + # add required columns identified in schema.py + for col, param in flowbyfields.items(): + for required, response in param[1].items(): + if response and col not in flowby_partial_df.columns: + flowby_partial_df[col] = None # convert data types to match those defined in flow_by_activity_fields for k, v in flowbyfields.items(): - flowby_partial_df.loc[:, k] = \ - flowby_partial_df[k].astype(v[0]['dtype']) + if k in flowby_partial_df.columns: + flowby_partial_df.loc[:, k] = \ + flowby_partial_df[k].astype(v[0]['dtype']) # Resort it so order is correct - flowby_partial_df = flowby_partial_df[flowbyfields.keys()] - return flowby_partial_df + cols = [e for e in flowbyfields.keys() if e in flowby_partial_df.columns] + flowby_df = flowby_partial_df[cols] + return flowby_df def standardize_units(df): From cd532c466c24575e3bf7da0a86dc9440fa188991 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 24 Aug 2023 13:53:24 -0600 Subject: [PATCH 0811/1127] in FBAs, set all empty cells to np.nan instead of None --- flowsa/common.py | 8 +++----- flowsa/dataclean.py | 17 +++++++++++------ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/flowsa/common.py b/flowsa/common.py index ba4ed04cd..cea996701 100644 --- a/flowsa/common.py +++ b/flowsa/common.py @@ -171,11 +171,9 @@ def create_fill_na_dict(flow_by_fields): """ fill_na_dict = {} for k, v in flow_by_fields.items(): - if v[0]['dtype'] == 'str': - fill_na_dict[k] = "" - elif v[0]['dtype'] == 'int': - fill_na_dict[k] = 0 - elif v[0]['dtype'] == 'float': + if v[0]['dtype'] in ['str', 'object']: + fill_na_dict[k] = np.nan + else: fill_na_dict[k] = 0 return fill_na_dict diff --git a/flowsa/dataclean.py b/flowsa/dataclean.py index 2af81bbe6..16332da86 100644 --- a/flowsa/dataclean.py +++ b/flowsa/dataclean.py @@ -23,16 +23,12 @@ def clean_df(df, flowbyfields, fill_na_dict, drop_description=True): df = df.reset_index(drop=True) # ensure correct data types df = add_missing_flow_by_fields(df, flowbyfields) - # fill null values - df = df.fillna(value=fill_na_dict) # drop description field, if exists if 'Description' in df.columns and drop_description is True: df = df.drop(columns='Description') if flowbyfields == 'flow_by_sector_fields': # harmonize units across dfs df = standardize_units(df) - # if datatypes are strings, ensure that Null values remain NoneType - df = replace_strings_with_NoneType(df) return df @@ -75,12 +71,21 @@ def add_missing_flow_by_fields(flowby_partial_df, flowbyfields): for col, param in flowbyfields.items(): for required, response in param[1].items(): if response and col not in flowby_partial_df.columns: - flowby_partial_df[col] = None + flowby_partial_df[col] = np.nan + # convert all None, 'nan' to np.nan + flowby_partial_df = (flowby_partial_df + .replace('None', np.nan) + .replace('nan', np.nan)) # convert data types to match those defined in flow_by_activity_fields for k, v in flowbyfields.items(): if k in flowby_partial_df.columns: - flowby_partial_df.loc[:, k] = \ + flowby_partial_df[k] = \ flowby_partial_df[k].astype(v[0]['dtype']) + if v[0]['dtype'] in ['string', 'str', 'object']: + flowby_partial_df[k] = flowby_partial_df[k].fillna(np.nan) + else: + flowby_partial_df[k] = flowby_partial_df[k].fillna(0) + # Resort it so order is correct cols = [e for e in flowbyfields.keys() if e in flowby_partial_df.columns] flowby_df = flowby_partial_df[cols] From 36b6eac5277a9fa98e8966ca8ebd9315542302f7 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 24 Aug 2023 13:54:42 -0600 Subject: [PATCH 0812/1127] delete old code --- flowsa/data_source_scripts/BLS_QCEW.py | 25 --- flowsa/flowbyfunctions.py | 252 ------------------------- 2 files changed, 277 deletions(-) diff --git a/flowsa/data_source_scripts/BLS_QCEW.py b/flowsa/data_source_scripts/BLS_QCEW.py index 18ff86c60..c4576fb96 100644 --- a/flowsa/data_source_scripts/BLS_QCEW.py +++ b/flowsa/data_source_scripts/BLS_QCEW.py @@ -138,31 +138,6 @@ def bls_qcew_parse(*, df_list, year, **_): return df2 -# def bls_clean_allocation_fba_w_sec(df_w_sec, **kwargs): -# """ -# clean up bls df with sectors by estimating suppresed data -# :param df_w_sec: df, FBA format BLS QCEW data -# :param kwargs: additional arguments can include 'attr', a -# dictionary of FBA method yaml parameters -# :return: df, BLS QCEW FBA with estimated suppressed data -# """ -# groupcols = list(df_w_sec.select_dtypes(include=['object', 'int']).columns) -# # estimate supressed data -# df = equally_allocate_suppressed_parent_to_child_naics( -# df_w_sec, kwargs['method'], 'SectorProducedBy', groupcols) -# -# # for purposes of allocation, we do not need to differentiate between -# # federal government, state government, local government, or private -# # sectors. So after estimating the suppressed data (above), modify the -# # flow names and aggregate data -# col_list = [e for e in df_w_sec.columns if e in ['FlowName', 'Flowable']] -# for c in col_list: -# df[c] = df[c].str.split(',').str[0] -# df2 = aggregator(df, groupcols) -# -# return df2 - - def clean_qcew(fba: FlowByActivity, **kwargs): #todo: check function method for state if fba.config.get('geoscale') == 'national': diff --git a/flowsa/flowbyfunctions.py b/flowsa/flowbyfunctions.py index aecbd8cc3..6a18465b7 100644 --- a/flowsa/flowbyfunctions.py +++ b/flowsa/flowbyfunctions.py @@ -580,258 +580,6 @@ def dataframe_difference(df1, df2, which=None): return diff_df -# def equally_allocate_suppressed_parent_to_child_naics( -# df_load, method, sector_column, groupcols, -# equally_allocate_parent_to_child=True): -# """ -# Estimate data suppression, by equally allocating parent NAICS -# values to child NAICS -# :param df_load: df with sector columns -# :param method: dictionary, FBS method yaml -# :param sector_column: str, column to estimate suppressed data for -# :param groupcols: list, columns to group df by -# :param equally_allocate_parent_to_child: default True, if True will -# first equally allocate parent to child sectors if the child sector is -# missing -# :return: df, with estimated suppressed data -# """ -# from flowsa.allocation import equally_allocate_parent_to_child_naics -# from flowsa.validation import \ -# compare_child_to_parent_sectors_flowamounts, \ -# compare_summation_at_sector_lengths_between_two_dfs -# -# vlog.info('Estimating suppressed data by equally allocating ' -# 'parent to child sectors.') -# df = sector_disaggregation(df_load) -# -# # equally allocate parent to child naics where child naics are not -# # included in the dataset. This step is necessary to accurately -# # calculate the flow that has already been allocated. Must allocate to -# # NAICS_6 for suppressed data function to work correctly. -# if equally_allocate_parent_to_child: -# vlog.info('Before estimating suppressed data, equally ' -# 'allocate parent sectors to child sectors.') -# df = equally_allocate_parent_to_child_naics( -# df, method, overwritetargetsectorlevel='NAICS_6') -# -# df = replace_NoneType_with_empty_cells(df) -# df = df[df[sector_column] != ''] -# -# # determine if activities are sector-like, -# # if aggregating a df with a 'SourceName' -# sector_like_activities = check_activities_sector_like(df_load) -# if sector_like_activities is False: -# log.error('Function is not written to estimate suppressed data when ' -# 'activities are not NAICS-like.') -# -# # if activities are source like, drop from df, -# # add back in as copies of sector columns columns to keep -# if sector_like_activities: -# # subset df -# df_cols = [e for e in df.columns if e not in -# ('ActivityProducedBy', 'ActivityConsumedBy')] -# df = df[df_cols] -# # drop activity from groupby -# groupcols = [e for e in groupcols if e -# not in ['ActivityConsumedBy', 'ActivityProducedBy', -# 'Description']] -# -# # load naics 2 to naics 6 crosswalk -# cw_load = load_crosswalk('sector_length') -# # only keep official naics -# cw = cw_load.drop(columns=['NAICS_7']).drop_duplicates() -# cw_melt = pd.melt(cw, -# id_vars=["NAICS_6"], var_name="NAICS_Length", -# value_name="NAICS_Match").drop( -# columns=['NAICS_Length']).drop_duplicates() -# -# df_sup = df[df['FlowAmount'] == 0].reset_index(drop=True) -# # merge the naics cw -# new_naics = pd.merge(df_sup, cw_melt, how='left', -# left_on=[sector_column], right_on=['NAICS_Match']) -# # drop rows where match is null because no additional naics to add -# new_naics = new_naics.dropna() -# new_naics[sector_column] = new_naics['NAICS_6'].copy() -# new_naics = new_naics.drop(columns=['NAICS_6', 'NAICS_Match']) -# -# # if a parent and child naics are both suppressed, can get situations -# # where a naics6 code is duplicated because both the parent and child -# # will match with the naics6. Therefore, drop duplicates -# new_naics2 = new_naics.drop_duplicates() -# -# # merge the new naics with the existing df, if data already -# # existed for a NAICS6, keep the original -# dfm = pd.merge( -# new_naics2[groupcols], df, how='left', on=groupcols, -# indicator=True).query('_merge=="left_only"').drop('_merge', axis=1) -# dfm = replace_NoneType_with_empty_cells(dfm) -# dfm = dfm.fillna(0) -# df = pd.concat([df, dfm], ignore_index=True) -# # add length column and subset the data -# # subtract out existing data at NAICS6 from total data -# # at a length where no suppressed data -# drop_col = 'SectorConsumedByLength' -# if sector_column == 'SectorConsumedBy': -# drop_col = 'SectorProducedByLength' -# df = assign_columns_of_sector_levels(df).rename( -# columns={f'{sector_column}Length': 'SectorLength'}).drop(columns=[ -# drop_col]) -# # df with non-suppressed data only -# dfns = df[df['FlowAmount'] != 0].reset_index(drop=True) -# -# df_sup2 = pd.DataFrame() -# cw_load = load_crosswalk('sector_length') -# df_sup = df_sup.assign(SectorMatchFlow=np.nan) -# merge_cols = list(df_sup.select_dtypes( -# include=['object', 'int']).columns) -# # also drop sector and description cols -# merge_cols = [c for c in merge_cols -# if c not in ['SectorConsumedBy', 'SectorProducedBy', -# 'Description']] -# # subset the df by length i -# dfs = subset_df_by_sector_lengths(df_sup, [6]) -# -# counter = 1 -# while dfs.isnull().values.any() and 6-counter > 1: -# # subset the crosswalk by i and i-1 -# cw = cw_load[[f'NAICS_6', -# f'NAICS_{6-counter}']].drop_duplicates() -# # merge df with the cw to determine which sector to look for in -# # non-suppressed data -# for s in ['Produced', 'Consumed']: -# dfs = dfs.merge(cw, how='left', left_on=f'Sector{s}By', -# right_on=f'NAICS_6').drop( -# columns=f'NAICS_6').rename( -# columns={f'NAICS_{6-counter}': f'Sector{s}Match'}) -# dfs[f'Sector{s}Match'] = dfs[f'Sector{s}Match'].fillna('') -# # merge with non suppressed data -# dfs = dfs.merge(dfns, how='left', -# left_on=merge_cols + ['SectorProducedMatch', -# 'SectorConsumedMatch'], -# right_on=merge_cols + ['SectorProducedBy', -# 'SectorConsumedBy']) -# dfs['SectorMatchFlow'].fillna(dfs['FlowAmount_y'], inplace=True) -# # drop all columns from the non suppressed data -# dfs = dfs[dfs.columns[~dfs.columns.str.endswith('_y')]] -# dfs.columns = dfs.columns.str.replace('_x', '') -# # subset the df into rows assigned a new value and those not -# dfs_assigned = dfs[~dfs['SectorMatchFlow'].isnull()] -# dfs = dfs[dfs['SectorMatchFlow'].isnull()].drop( -# columns=['SectorProducedMatch', 'SectorConsumedMatch', -# 'SectorLength']).reset_index(drop=True) -# df_sup2 = pd.concat([df_sup2, dfs_assigned], ignore_index=True) -# counter = counter + 1 -# -# # merge in the df where calculated how much flow has already been -# # allocated to NAICS6 -# mergecols = [e for e in groupcols if e not in -# ['SectorProducedBy', 'SectorConsumedBy']] -# mergecols = mergecols + ['SectorProducedMatch', 'SectorConsumedMatch'] -# meltcols = mergecols + ['sector_allocated'] -# -# if len(df_sup2) > 0: -# for ii in range(5, 1, -1): -# # subset the df by length i -# dfs = df_sup2[df_sup2['SectorLength'] == ii] -# -# dfns_sub = dfns[dfns['SectorLength'] == 6].reset_index(drop=True) -# for s in ['Produced', 'Consumed']: -# dfns_sub = assign_sector_match_column( -# dfns_sub, f'Sector{s}By', 6, ii).rename( -# columns={'sector_group': f'Sector{s}Match'}) -# dfns_sub = dfns_sub.fillna('') -# dfsum = dfns_sub.groupby(mergecols, as_index=False).agg( -# {"FlowAmount": sum}).rename(columns={ -# "FlowAmount": 'sector_allocated'}) -# -# df_sup3 = dfs.merge(dfsum[meltcols], on=mergecols, how='left') -# df_sup3['sector_allocated'] = df_sup3['sector_allocated'].fillna(0) -# # calc the remaining flow that can be allocated -# df_sup3['FlowRemainder'] = df_sup3['SectorMatchFlow'] - \ -# df_sup3['sector_allocated'] -# # Due to rounding, there can be slight differences in data at -# # sector levels, which can result in some minor negative values. -# # If the percent of FlowRemainder is less than the assigned -# # tolerance for negative numbers, or if the flowremainder is -# # -1, reset the number to 0. If it is greater, issue a warning. -# percenttolerance = 1 -# flowtolerance = -1 -# df_sup3 = df_sup3.assign(PercentOfAllocated= -# (abs(df_sup3['FlowRemainder']) / df_sup3[ -# 'SectorMatchFlow']) * 100) -# df_sup3['FlowRemainder'] = np.where( -# (df_sup3["FlowRemainder"] < 0) & -# (df_sup3['PercentOfAllocated'] < percenttolerance), 0, -# df_sup3['FlowRemainder']) -# df_sup3['FlowRemainder'] = np.where( -# df_sup3["FlowRemainder"].between(flowtolerance, 0), 0, -# df_sup3['FlowRemainder']) -# -# # check for negative values -# negv = df_sup3[df_sup3['FlowRemainder'] < 0] -# if len(negv) > 0: -# col_subset = [e for e in negv.columns if e in -# ['Class', 'SourceName', 'FlowName', -# 'Flowable', 'FlowAmount', 'Unit', -# 'Compartment', 'Context', 'Location', 'Year', -# 'SectorProducedBy', 'SectorConsumedBy', -# 'SectorMatchFlow', 'SectorProducedMatch', -# 'SectorConsumedMatch', 'sector_allocated', -# 'FlowRemainder']] -# negv = negv[col_subset].reset_index(drop=True) -# vlog.info( -# 'There are negative values when allocating suppressed ' -# 'parent data to child sector. The values are more than ' -# '%s%% of the total parent sector with a negative flow ' -# 'amount being allocated more than %s. Resetting flow ' -# 'values to be allocated to 0. See validation log for ' -# 'details.', str(percenttolerance), str(flowtolerance)) -# vlog.info('Values where flow remainders are negative, ' -# 'resetting to 0: \n {}'.format(negv.to_string())) -# df_sup3['FlowRemainder'] = np.where(df_sup3["FlowRemainder"] < 0, -# 0, df_sup3['FlowRemainder']) -# df_sup3 = df_sup3.drop(columns=[ -# 'SectorMatchFlow', 'sector_allocated', 'PercentOfAllocated']) -# # add count column used to divide the unallocated flows -# sector_column_match = sector_column.replace('By', 'Match') -# df_sup3 = df_sup3.assign(secCount=df_sup3.groupby(mergecols)[ -# sector_column_match].transform('count')) -# df_sup3 = df_sup3.assign(newFlow=df_sup3['FlowRemainder'] / -# df_sup3['secCount']) -# # reassign values and drop columns -# df_sup3 = df_sup3.assign(FlowAmount=df_sup3['newFlow']) -# df_sup3 = df_sup3.drop(columns=['SectorProducedMatch', -# 'SectorConsumedMatch', -# 'FlowRemainder', 'secCount', -# 'newFlow']) -# # reset SectorLength -# df_sup3['SectorLength'] = 6 -# # add to the df with no suppressed data -# dfns = pd.concat([dfns, df_sup3], ignore_index=True) -# -# dfns = dfns.drop(columns=['SectorLength']) -# dff = sector_aggregation(dfns) -# -# # if activities are source-like, set col values as copies -# # of the sector columns -# if sector_like_activities: -# dff = dff.assign(ActivityProducedBy=dff['SectorProducedBy']) -# dff = dff.assign(ActivityConsumedBy=dff['SectorConsumedBy']) -# # reindex columns -# dff = dff.reindex(df_load.columns, axis=1) -# -# vlog.info('Checking results of allocating suppressed parent to ' -# 'child sectors. ') -# compare_summation_at_sector_lengths_between_two_dfs(df_load, dff) -# compare_child_to_parent_sectors_flowamounts(dff) -# # todo: add third check comparing smallest child naics (6) to largest (2) -# -# # replace null values -# dff = replace_strings_with_NoneType(dff).reset_index(drop=True) -# -# return dff - - def load_fba_w_standardized_units(datasource, year, **kwargs): """ Standardize how a FBA is loaded for allocation purposes when From f5260d01ca4d6cfdeb0adfa5b997f3c078e0a9a6 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 24 Aug 2023 16:27:07 -0600 Subject: [PATCH 0813/1127] revise datapaths --- scripts/writeNAICScrosswalk.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/scripts/writeNAICScrosswalk.py b/scripts/writeNAICScrosswalk.py index e4c2f7eaa..7148e64a4 100644 --- a/scripts/writeNAICScrosswalk.py +++ b/scripts/writeNAICScrosswalk.py @@ -19,7 +19,6 @@ from flowsa import log from flowsa.common import load_crosswalk -from flowsa.dataclean import replace_NoneType_with_empty_cells, replace_strings_with_NoneType from flowsa.settings import datapath, crosswalkpath @@ -63,10 +62,12 @@ def update_naics_crosswalk(): ]].drop_duplicates().reset_index(drop=True) # convert all rows to string naics = naics.astype(str) - # ensure all None are NoneType - naics = replace_strings_with_NoneType(naics) # drop rows where all None - naics = naics.dropna(how='all') + naics = (naics + .replace('nan', np.nan) + .replace('None', np.nan) + .dropna(axis=0, how='all') + ) # drop naics > 6 in mastercrosswalk (all manufacturing) because unused # and slows functions @@ -77,7 +78,7 @@ def update_naics_crosswalk(): # and add to naics list missing_naics_df_list = [] # read in all the crosswalk csv files (ends in toNAICS.csv) - for file_name in glob.glob(f'{crosswalkpath}NAICS_Crosswalk_*.csv'): + for file_name in glob.glob(f'{crosswalkpath}/NAICS_Crosswalk_*.csv'): # skip Statistics Canada GDP because not all sectors relevant if not any(s in file_name for s in ('StatCan', 'BEA')): df = pd.read_csv(file_name, low_memory=False, dtype=str) @@ -132,15 +133,16 @@ def update_naics_crosswalk(): naics_02 = load_naics_02_to_07_crosswalk() naics_cw = pd.merge(total_naics, naics_02, how='left') - # ensure NoneType - naics_cw = replace_strings_with_NoneType(naics_cw) - # reorder naics_cw = naics_cw[['NAICS_2002_Code', 'NAICS_2007_Code', 'NAICS_2012_Code', 'NAICS_2017_Code']] + naics_cw = (naics_cw + .replace(np.nan, '') + .replace('nan', '') + ) # save as csv - naics_cw.to_csv(datapath + "NAICS_Crosswalk_TimeSeries.csv", index=False) + naics_cw.to_csv(f"{datapath}/NAICS_Crosswalk_TimeSeries.csv", index=False) def merge_df_by_crosswalk_lengths(naics_cw, d, l): @@ -179,7 +181,6 @@ def write_naics_2012_crosswalk(): # extract naics 2012 code column and drop duplicates and empty cells cw = cw_load[['NAICS_2012_Code']].drop_duplicates() - cw = replace_NoneType_with_empty_cells(cw) cw = cw[cw['NAICS_2012_Code'] != ''] # also drop the existing household and government codes because not all # inclusive and does not conform to NAICS length standards @@ -234,12 +235,12 @@ def write_naics_2012_crosswalk(): # reorder naics_cw = naics_cw.reindex(sorted(naics_cw.columns), axis=1) # save as csv - naics_cw.to_csv(datapath + "NAICS_2012_Crosswalk.csv", index=False) + naics_cw.to_csv(f"{datapath}/NAICS_2012_Crosswalk.csv", index=False) def update_sector_name_df(): """Update list of naics names with added sectors""" - sectors = pd.read_csv(f'{datapath}NAICS_2012_Names.csv', dtype=str) + sectors = pd.read_csv(f'{datapath}/NAICS_2012_Names.csv', dtype=str) # dictionary of new sector names new_sectors = pd.DataFrame( @@ -257,7 +258,7 @@ def update_sector_name_df(): ]}) df = pd.concat([sectors, new_sectors]) df = df.sort_values("NAICS_2012_Code") - df.to_csv(f'{datapath}Sector_2012_Names.csv', index=False) + df.to_csv(f'{datapath}/Sector_2012_Names.csv', index=False) if __name__ == '__main__': From 0c581feb2d36e28d8080ff6664b6ad7254122edf Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 24 Aug 2023 16:45:03 -0600 Subject: [PATCH 0814/1127] delete elciFBS.py as no longer support electricity gen FBS --- flowsa/data_source_scripts/elciFBS.py | 78 --------------------------- 1 file changed, 78 deletions(-) delete mode 100644 flowsa/data_source_scripts/elciFBS.py diff --git a/flowsa/data_source_scripts/elciFBS.py b/flowsa/data_source_scripts/elciFBS.py deleted file mode 100644 index 84d9b58f7..000000000 --- a/flowsa/data_source_scripts/elciFBS.py +++ /dev/null @@ -1,78 +0,0 @@ -# elciFBS.py (flowsa) -# !/usr/bin/env python3 -# coding=utf-8 -""" -Functions to access data electricitylci for use in flowbysector - -These functions are called if referenced in flowbysectormethods as -data_format FBS_outside_flowsa with the function specified in FBS_datapull_fxn - -""" -from flowsa import log -from flowsa.sectormapping import get_activitytosector_mapping - - -def get_elci_emissions(yaml_load, *_): - """Generate plant level emissions from eLCI package.""" - try: - import electricitylci - import electricitylci.model_config as config - except ImportError: - log.error("Must install ElectricityLCI package in order to generate " - "plant level air emissions.") - import fedelemflowlist as fl - - config.model_specs = config.build_model_class('ELCI_1') - config.model_specs.include_upstream_processes = False - config.model_specs.regional_aggregation = 'US' - config.model_specs.include_renewable_generation = False - config.model_specs.include_netl_water = True - config.model_specs.stewicombo_file = 'ELCI_1' - if 'DMR' not in config.model_specs.inventories_of_interest.keys(): - config.model_specs.inventories_of_interest['DMR'] = 2016 - - emissions = electricitylci.get_generation_process_df() - emissions = emissions.loc[emissions['stage_code'] == 'Power plant'] - # FlowUUID is not null (will remove RCRA flows) - emissions = emissions.loc[~emissions['FlowUUID'].isna()] - - column_dict = {'Balancing Authority Name': 'Location', - 'FuelCategory': 'SectorProducedBy', - 'FlowName': 'Flowable', - 'Compartment': 'Compartment', - 'FlowUUID': 'FlowUUID', - 'FlowAmount': 'FlowAmount', - 'Unit': 'Unit', - 'Year': 'Year', - 'source_string': 'MetaSources'} - - col_list = [c for c in column_dict.keys() if c in emissions] - emissions_df = emissions[col_list] - emissions_df = emissions_df.rename(columns=column_dict) - - # Update Compartment from FEDEFL - fedefl = fl.get_flows()[['Flow UUID', 'Context']] - emissions_df = emissions_df.merge(fedefl, how='left', - left_on='FlowUUID', - right_on='Flow UUID') - emissions_df.drop(columns=['Flow UUID', 'Compartment'], inplace=True) - - # Assign other fields - emissions_df['LocationSystem'] = 'BAA' - emissions_df['FlowType'] = 'ELEMENTARY_FLOW' - emissions_df['Class'] = 'Chemicals' - - # Update SectorProducedBy - mapping = get_activitytosector_mapping('eLCI') - mapping = mapping[['Activity', 'Sector']] - emissions_df_mapped = emissions_df.merge(mapping, how='left', - left_on='SectorProducedBy', - right_on='Activity') - emissions_df_mapped.drop(columns=['SectorProducedBy', 'Activity'], - inplace=True) - emissions_df_mapped.rename(columns={'Sector': 'SectorProducedBy'}, - inplace=True) - emissions_df_mapped.dropna(subset=['SectorProducedBy'], - inplace=True) - - return emissions_df_mapped From f77eb1361042de5784d474e0fc184b243b393f43 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 24 Aug 2023 16:55:18 -0600 Subject: [PATCH 0815/1127] delete obsolete code --- flowsa/data_source_scripts/Census_QWI.py | 12 +- flowsa/dataclean.py | 31 +- flowsa/datavisualization.py | 4 +- flowsa/flowbyactivity.py | 2 +- flowsa/flowbyfunctions.py | 383 +--------------------- flowsa/geo.py | 1 - flowsa/sectormapping.py | 299 ----------------- flowsa/validation.py | 401 +---------------------- 8 files changed, 21 insertions(+), 1112 deletions(-) diff --git a/flowsa/data_source_scripts/Census_QWI.py b/flowsa/data_source_scripts/Census_QWI.py index d684bef74..c9184851d 100644 --- a/flowsa/data_source_scripts/Census_QWI.py +++ b/flowsa/data_source_scripts/Census_QWI.py @@ -14,15 +14,9 @@ import json import pandas as pd -import numpy as np -from flowsa.location import get_all_state_FIPS_2, get_county_FIPS, US_FIPS -from flowsa.common import fba_default_grouping_fields, load_env_file_key -from flowsa.schema import flow_by_activity_wsec_fields, \ - flow_by_activity_mapped_wsec_fields -from flowsa.flowbyfunctions import assign_fips_location_system, \ - aggregator -from flowsa.dataclean import add_missing_flow_by_fields, \ - replace_strings_with_NoneType +from flowsa.location import get_county_FIPS +from flowsa.common import load_env_file_key +from flowsa.flowbyfunctions import assign_fips_location_system def census_qwi_url_helper(*, build_url, year, config, **_): diff --git a/flowsa/dataclean.py b/flowsa/dataclean.py index 16332da86..f9d687c83 100644 --- a/flowsa/dataclean.py +++ b/flowsa/dataclean.py @@ -5,11 +5,12 @@ Common functions to clean and harmonize dataframes """ +import pandas as pd import numpy as np -from flowsa.literature_values import get_Canadian_to_USD_exchange_rate +from flowsa import (literature_values, settings, flowsa_log) -def clean_df(df, flowbyfields, fill_na_dict, drop_description=True): +def clean_df(df, flowbyfields, drop_description=True): """ Modify a dataframe to ensure all columns are present and column datatypes correct @@ -33,32 +34,6 @@ def clean_df(df, flowbyfields, fill_na_dict, drop_description=True): return df -def replace_strings_with_NoneType(df): - """ - Ensure that cell values in columns with datatype = string remain NoneType - :param df: df with columns where datatype = object - :return: A df where values are NoneType if they are supposed to be - """ - # if datatypes are strings, ensure that Null values remain NoneType - for y in df.columns: - if df[y].dtype == object: - df.loc[df[y].isin(['nan', 'None', np.nan, '']), y] = None - return df - - -def replace_NoneType_with_empty_cells(df): - """ - Replace all NoneType in columns where datatype = string with empty cells - :param df: df with columns where datatype = object - :return: A df where values are '' when previously they were NoneType - """ - # if datatypes are strings, change NoneType to empty cells - for y in df.columns: - if df[y].dtype == object: - df.loc[df[y].isin(['nan', 'None', np.nan, None]), y] = '' - return df - - def add_missing_flow_by_fields(flowby_partial_df, flowbyfields): """ Add in missing fields to have a complete and ordered df diff --git a/flowsa/datavisualization.py b/flowsa/datavisualization.py index 5be70e85c..8391573d8 100644 --- a/flowsa/datavisualization.py +++ b/flowsa/datavisualization.py @@ -12,13 +12,11 @@ import plotly.graph_objects as go from plotly.subplots import make_subplots import flowsa -from flowsa.common import load_crosswalk, load_yaml_dict -from flowsa.dataclean import replace_NoneType_with_empty_cells +from flowsa.common import load_crosswalk # todo: need to update fxn to use new sector_aggregation - datavis not # currently working # from flowsa.flowbyfunctions import sector_aggregation from flowsa.flowsa_log import log -from flowsa.sectormapping import get_sector_list from flowsa.settings import datapath, plotoutputpath import textwrap diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index 5ce137784..018399dba 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -166,7 +166,7 @@ def process_data_frame(*, df, source, year, config): log.info("Retrieved data for %s %s", source, year) # add any missing columns of data and cast to appropriate data type log.info("Add any missing columns and check field datatypes") - flow_df = clean_df(df, flow_by_activity_fields, fba_fill_na_dict, + flow_df = clean_df(df, flow_by_activity_fields, drop_description=False) # sort df and reset index flow_df = flow_df.sort_values(['Class', 'Location', 'ActivityProducedBy', diff --git a/flowsa/flowbyfunctions.py b/flowsa/flowbyfunctions.py index 6a18465b7..173f6cb7f 100644 --- a/flowsa/flowbyfunctions.py +++ b/flowsa/flowbyfunctions.py @@ -5,23 +5,15 @@ Helper functions for flowbyactivity and flowbysector data """ -import pandas as pd import numpy as np from esupy.dqi import get_weighted_average import flowsa -from flowsa.common import \ - load_crosswalk, fbs_fill_na_dict, \ - fbs_collapsed_default_grouping_fields, fbs_collapsed_fill_na_dict, \ - fba_activity_fields, fba_default_grouping_fields, \ - load_sector_length_cw_melt, fba_fill_na_dict, \ - fba_mapped_default_grouping_fields -from flowsa.dataclean import clean_df, replace_strings_with_NoneType, \ - replace_NoneType_with_empty_cells, standardize_units -from flowsa.flowsa_log import log, vlog -from flowsa.location import US_FIPS, get_state_FIPS, \ - get_county_FIPS, update_geoscale, fips_number_key +from flowsa.common import fbs_collapsed_default_grouping_fields +from flowsa.dataclean import clean_df, standardize_units +from flowsa.flowsa_log import log +from flowsa.location import US_FIPS, get_state_FIPS, get_county_FIPS from flowsa.schema import flow_by_activity_fields, flow_by_sector_fields, \ - flow_by_sector_collapsed_fields, flow_by_activity_mapped_fields + flow_by_sector_collapsed_fields def create_geoscale_list(df, geoscale, year='2015'): @@ -70,28 +62,6 @@ def filter_by_geoscale(df, geoscale): return df -def agg_by_geoscale(df, from_scale, to_scale, groupbycols): - """ - Aggregate a df by geoscale - :param df: flowbyactivity or flowbysector df - :param from_scale: str, geoscale to aggregate from - ('national', 'state', 'county') - :param to_scale: str, geoscale to aggregate to ( - 'national', 'state', 'county') - :param groupbycols: flowbyactivity or flowbysector default groupby columns - :return: df, at identified to_scale geographic level - """ - - # use from scale to filter by these values - df = filter_by_geoscale(df, from_scale).reset_index(drop=True) - - df = update_geoscale(df, to_scale) - - fba_agg = aggregator(df, groupbycols) - - return fba_agg - - def aggregator(df, groupbycols, retain_zeros=True, flowcolname='FlowAmount'): """ Aggregates flowbyactivity or flowbysector 'FlowAmount' column in df and @@ -145,9 +115,6 @@ def is_identical(s): df_dfg = df_dfg.reset_index() df_dfg.columns = df_dfg.columns.droplevel(level=1) - # if datatypes are strings, ensure that Null values remain NoneType - df_dfg = replace_strings_with_NoneType(df_dfg) - return df_dfg @@ -165,7 +132,7 @@ def remove_parent_sectors_from_crosswalk(cw_load, sector_list): return cw_load -# todo: delete +# todo: revise to work for recursively built data # def sector_aggregation(df_load, return_all_possible_sector_combos=False, # sectors_to_exclude_from_agg=None): # """ @@ -249,159 +216,6 @@ def remove_parent_sectors_from_crosswalk(cw_load, sector_list): # return df.reset_index(drop=True) -def append_new_sectors(df, i, j, cw_load, group_cols): - """ - Function to append new sectors at more aggregated levels - :param df: df, FBS - :param i: numeric, sector length to aggregate - :param j: numeric, value to subtract from sector length for new sector - length to add - :param cw_load: df, sector crosswalk - :param group_cols: list, cols to group by - :param sectors_to_exclude_from_agg: list, sectors that should not be - aggregated beyond the sector level provided - :return: - """ - - # load crosswalk - sector_merge = 'NAICS_' + str(i) - sector_add = 'NAICS_' + str(i - j) - - cw_dict = {} - if 'Sector' in df.columns: - cw_dict['Sector'] = cw_load[ - [sector_merge, sector_add]].drop_duplicates() - else: - if isinstance(cw_load, dict): - for s in ['Produced', 'Consumed']: - cw = cw_load[f'Sector{s}By'][[sector_merge, - sector_add]].drop_duplicates() - cw_dict[s] = cw - else: - cw_dict['SectorProducedBy'] = cw_load[ - [sector_merge, sector_add]].drop_duplicates() - cw_dict['SectorConsumedBy'] = cw_load[ - [sector_merge, sector_add]].drop_duplicates() - - cw_melt = load_sector_length_cw_melt() - cw_sub = cw_melt[cw_melt['SectorLength'] == i] - sector_list = cw_sub['Sector'].drop_duplicates().values.tolist() - - # loop through and add additional sectors - if 'Sector' in df.columns: - sectype_list = ['Sector'] - else: - sectype_list = ['SectorProducedBy', 'SectorConsumedBy'] - for s in sectype_list: - dfm = df[df[s].isin(sector_list)] - dfm = dfm.merge(cw_dict[s], how='left', left_on=[s], - right_on=sector_merge) - # replace sector column with matched sector add - dfm[s] = np.where( - ~dfm[sector_add].isnull(), dfm[sector_add], - dfm[s]) - dfm = dfm.drop(columns=[sector_merge, sector_add]) - dfm = replace_NoneType_with_empty_cells(dfm) - - # aggregate the new sector flow amounts - if 'FlowAmount' in dfm.columns: - agg_sectors = aggregator(dfm, group_cols) - # if FlowName is not in column and instead aggregating for the - # HelperFlow then simply sum helper flow column - else: - agg_sectors = dfm.groupby(group_cols)['HelperFlow'] \ - .sum().reset_index() - # append to df - agg_sectors = replace_NoneType_with_empty_cells(agg_sectors) - cols = [e for e in df.columns if e in - ['FlowName', 'Flowable', 'Class', 'SectorProducedBy', - 'SectorConsumedBy', 'Sector', 'Compartment', 'Context', - 'Location', 'Unit', 'FlowType', 'Year']] - # get copies where the indices are the columns of interest - df_2 = df.set_index(cols) - agg_sectors_2 = agg_sectors.set_index(cols) - # Look for index overlap, ~ - dfi = agg_sectors[~agg_sectors_2.index.isin(df_2.index)] - df = pd.concat([df, dfi], ignore_index=True).reset_index( - drop=True) - - return df - - -# def sector_disaggregation(df_load): -# """ -# function to disaggregate sectors if there is only one -# naics at a lower level works for lower than naics 4 -# :param df_load: A FBS df, must have sector columns -# :return: A FBS df with values for the missing naics5 and naics6 -# """ -# -# # ensure None values are not strings -# df = replace_NoneType_with_empty_cells(df_load) -# -# # determine if activities are sector-like, if aggregating -# # a df with a 'SourceName' -# sector_like_activities = check_activities_sector_like(df_load) -# -# # if activities are sector like, drop columns while running disag then -# # add back in -# if sector_like_activities: -# df = df.drop(columns=['ActivityProducedBy', 'ActivityConsumedBy'], -# errors='ignore') -# df = df.reset_index(drop=True) -# -# # load naics 2 to naics 6 crosswalk -# cw_load = load_crosswalk('sector_length') -# -# # appends missing naics levels to df -# for i in range(2, 6): -# dfm = subset_and_merge_df_by_sector_lengths( -# df, i, i + 1, keep_paired_sectors_not_in_subset_list=True) -# -# # only keep values in left column, meaning there are no less -# # aggregated naics in the df -# dfm2 = dfm.query('_merge=="left_only"').drop( -# columns=['_merge', 'SPB_tmp', 'SCB_tmp']) -# -# sector_merge = 'NAICS_' + str(i) -# sector_add = 'NAICS_' + str(i + 1) -# -# # subset the df by naics length -# cw = cw_load[[sector_merge, sector_add]].drop_duplicates() -# # only keep the rows where there is only one value in sector_add for -# # a value in sector_merge -# cw = cw.drop_duplicates(subset=[sector_merge], keep=False).reset_index( -# drop=True) -# -# # loop through and add additional naics -# sectype_list = ['Produced', 'Consumed'] -# for s in sectype_list: -# # inner join - only keep rows where there are data in the crosswalk -# dfm2 = dfm2.merge(cw, how='left', left_on=[f'Sector{s}By'], -# right_on=sector_merge) -# dfm2[f'Sector{s}By'] = np.where( -# ~dfm2[sector_add].isnull(), dfm2[sector_add], -# dfm2[f'Sector{s}By']) -# dfm2 = dfm2.drop(columns=[sector_merge, sector_add]) -# dfm3 = dfm2.dropna(subset=['SectorProducedBy', 'SectorConsumedBy'], -# how='all') -# dfm3 = dfm3.reset_index(drop=True) -# dfm3 = replace_NoneType_with_empty_cells(dfm3) -# df = pd.concat([df, dfm3], ignore_index=True) -# -# # drop duplicates that can arise if sectors are non-traditional naics -# # (household and government) -# df = df.drop_duplicates().reset_index(drop=True) -# -# # if activities are source-like, set col values -# # as copies of the sector columns -# if sector_like_activities: -# df = df.assign(ActivityProducedBy=df['SectorProducedBy']) -# df = df.assign(ActivityConsumedBy=df['SectorConsumedBy']) -# -# return df - - def assign_fips_location_system(df, year_of_data): """ Add location system based on year of data. County level FIPS @@ -435,7 +249,7 @@ def collapse_fbs_sectors(fbs): :return: df, FBS with single Sector column """ # ensure correct datatypes and order - fbs = clean_df(fbs, flow_by_sector_fields, fbs_fill_na_dict) + fbs = clean_df(fbs, flow_by_sector_fields) if fbs['SectorProducedBy'].isnull().all(): fbs['Sector'] = fbs['SectorConsumedBy'] @@ -468,118 +282,13 @@ def collapse_fbs_sectors(fbs): fbs_collapsed = \ aggregator(fbs_collapsed, fbs_collapsed_default_grouping_fields) # sort dataframe - fbs_collapsed = clean_df(fbs_collapsed, flow_by_sector_collapsed_fields, - fbs_collapsed_fill_na_dict) + fbs_collapsed = clean_df(fbs_collapsed, flow_by_sector_collapsed_fields) fbs_collapsed = fbs_collapsed.sort_values( ['Sector', 'Flowable', 'Context', 'Location']).reset_index(drop=True) return fbs_collapsed -def return_activity_from_scale(df, provided_from_scale): - """ - Determine the 'from scale' used for aggregation/df - subsetting for each activity combo in a df - :param df: flowbyactivity df - :param provided_from_scale: str, The scale to use specified in method yaml - :return: df, FBA with column indicating the "from" geoscale to - use for each row - """ - - # determine the unique combinations of activityproduced/consumedby - df = replace_NoneType_with_empty_cells(df) - unique_activities = unique_activity_names(df) - # filter by geoscale - fips = create_geoscale_list(df, provided_from_scale) - # determine unique activities after subsetting by geoscale - unique_activities_sub = \ - unique_activity_names(df[df['Location'].isin(fips)]) - - # return df of the difference between unique_activities - # and unique_activities2 - df_missing = dataframe_difference( - unique_activities, unique_activities_sub, which='left_only') - # return df of the similarities between unique_activities - # and unique_activities2 - df_existing = dataframe_difference( - unique_activities, unique_activities_sub, which='both') - df_existing = df_existing.drop(columns='_merge') - df_existing['activity_from_scale'] = provided_from_scale - - if len(df_missing) > 0: - # for loop through geoscales until find data for each activity combo - if provided_from_scale == 'national': - geoscales = ['state', 'county'] - elif provided_from_scale == 'state': - geoscales = ['county'] - elif provided_from_scale == 'county': - log.error('Missing county level data') - - for i in geoscales: - # filter by geoscale - fips_i = create_geoscale_list(df, i) - df_i = df[df['Location'].isin(fips_i)] - - # determine unique activities after subsetting by geoscale - unique_activities_i = unique_activity_names(df_i) - - # return df of the difference between unique_activities subset and - # unique_activities for geoscale - df_missing_i = dataframe_difference( - unique_activities_sub, unique_activities_i, which='right_only') - df_missing_i = df_missing_i.drop(columns='_merge') - df_missing_i['activity_from_scale'] = i - # return df of the similarities between unique_activities - # and unique_activities2 - df_existing_i = dataframe_difference( - unique_activities_sub, unique_activities_i, which='both') - - # append unique activities and df with defined activity_from_scale - unique_activities_sub = pd.concat([unique_activities_sub, - df_missing_i[[fba_activity_fields[0], fba_activity_fields[1]]]], - ignore_index=True) - df_existing = pd.concat([df_existing, df_missing_i], - ignore_index=True) - df_missing = dataframe_difference( - df_missing[[fba_activity_fields[0], fba_activity_fields[1]]], - df_existing_i[[fba_activity_fields[0], - fba_activity_fields[1]]], which=None) - - return df_existing - - -def unique_activity_names(fba_df): - """ - Determine the unique activity names in a df - :param fba_df: a flowbyactivity df - :return: df with ActivityProducedBy and ActivityConsumedBy columns - """ - - activities = fba_df[[fba_activity_fields[0], fba_activity_fields[1]]] - unique_activities = activities.drop_duplicates().reset_index(drop=True) - - return unique_activities - - -def dataframe_difference(df1, df2, which=None): - """ - Find rows which are different between two DataFrames - :param df1: df, FBA or FBS - :param df2: df, FBA or FBS - :param which: 'both', 'right_only', 'left_only' - :return: df, comparison of data in the two dfs - """ - comparison_df = df1.merge(df2, - indicator=True, - how='outer') - if which is None: - diff_df = comparison_df[comparison_df['_merge'] != 'both'] - else: - diff_df = comparison_df[comparison_df['_merge'] == which] - - return diff_df - - def load_fba_w_standardized_units(datasource, year, **kwargs): """ Standardize how a FBA is loaded for allocation purposes when @@ -612,89 +321,19 @@ def load_fba_w_standardized_units(datasource, year, **kwargs): if 'allocation_map_to_flow_list' in kwargs: if kwargs['allocation_map_to_flow_list']: # ensure df loaded correctly/has correct dtypes - fba = clean_df(fba, flow_by_activity_fields, fba_fill_na_dict, + fba = clean_df(fba, flow_by_activity_fields, drop_description=False) fba, mapping_files = map_fbs_flows( fba, datasource, kwargs, keep_fba_columns=True, keep_unmapped_rows=True) else: # ensure df loaded correctly/has correct dtypes - fba = clean_df(fba, flow_by_activity_fields, fba_fill_na_dict) + fba = clean_df(fba, flow_by_activity_fields) fba = standardize_units(fba) else: # ensure df loaded correctly/has correct dtypes - fba = clean_df(fba, flow_by_activity_fields, fba_fill_na_dict, + fba = clean_df(fba, flow_by_activity_fields, drop_description=False) fba = standardize_units(fba) return fba - - -def assign_columns_of_sector_levels(df_load): - """ - Add additional column capturing the sector level in the two columns - :param df_load: df with at least on sector column - :param ambiguous_sector_assignment: if there are sectors that can be - assigned to multiple sector lengths (e.g., for government or household - sectors), option to specify which sector assignment to keep. - :return: df with new column for sector length - """ - df = replace_NoneType_with_empty_cells(df_load) - # load cw with column of sector levels - cw = load_sector_length_cw_melt() - # merge df assigning sector lengths - for s in ['Produced', 'Consumed']: - df = df.merge(cw, how='left', left_on=f'Sector{s}By', - right_on='Sector').drop(columns=['Sector']).rename( - columns={'SectorLength': f'Sector{s}ByLength'}) - df[f'Sector{s}ByLength'] = df[f'Sector{s}ByLength'].fillna(0) - - duplicate_cols = [e for e in df.columns if e not in [ - 'SectorProducedByLength', 'SectorConsumedByLength']] - duplicate_df = df[df.duplicated(subset=duplicate_cols, - keep=False)].reset_index(drop=True) - - if len(duplicate_df) > 0: - log.warning('There are duplicate rows caused by ambiguous sectors.') - - dfc = df.sort_values(['SectorProducedByLength', - 'SectorConsumedByLength']).reset_index(drop=True) - return dfc - - -def assign_sector_match_column(df_load, sectorcolumn, sectorlength, - sectorlengthmatch): - - sector = 'NAICS_' + str(sectorlength) - sector_add = 'NAICS_' + str(sectorlengthmatch) - - cw_load = load_crosswalk("sector_length") - cw = cw_load[[sector, sector_add]].drop_duplicates().reset_index( - drop=True) - - df = df_load.merge(cw, how='left', left_on=sectorcolumn, - right_on=sector - ).rename(columns={sector_add: 'sector_group'} - ).drop(columns=sector) - - return df - - -# def aggregate_and_subset_for_target_sectors(df, method): -# """Helper function to create data at aggregated NAICS prior to -# subsetting based on the target_sector_list. Designed for use when -# FBS are the source data. -# """ -# from flowsa.sectormapping import get_sector_list -# # return sector level specified in method yaml -# # load the crosswalk linking sector lengths -# secondary_sector_level = method.get('target_subset_sector_level') -# sector_list = get_sector_list( -# method.get('target_sector_level'), -# secondary_sector_level_dict=secondary_sector_level) -# -# # subset df to get NAICS at the target level -# df_agg = sector_aggregation(df) -# df_subset = subset_df_by_sector_list(df_agg, sector_list) -# -# return df_subset diff --git a/flowsa/geo.py b/flowsa/geo.py index 32f5bc939..763dce7a0 100644 --- a/flowsa/geo.py +++ b/flowsa/geo.py @@ -2,7 +2,6 @@ import enum from functools import total_ordering import pandas as pd -import numpy as np from . import settings from .flowsa_log import log diff --git a/flowsa/sectormapping.py b/flowsa/sectormapping.py index 2e4bc4b27..f2eed9f3e 100644 --- a/flowsa/sectormapping.py +++ b/flowsa/sectormapping.py @@ -58,243 +58,6 @@ def get_activitytosector_mapping(source, fbsconfigpath=None): return mapping -# def add_sectors_to_flowbyactivity( -# flowbyactivity_df, -# activity_to_sector_mapping=None, -# sectorsourcename=SECTOR_SOURCE_NAME, -# allocationmethod=None, -# overwrite_sectorlevel=None, -# fbsconfigpath=None -# ): -# """ -# Add Sectors from the Activity fields and mapped them to Sector -# from the crosswalk. No allocation is performed. -# :param flowbyactivity_df: A standard flowbyactivity data frame -# :param activity_to_sector_mapping: str, name for activity_to_sector mapping -# :param sectorsourcename: A sector source name, using package default -# :param allocationmethod: str, modifies function behavoir if = 'direct' -# :param fbsconfigpath, str, opt ional path to an FBS method outside flowsa -# repo -# :return: a df with activity fields mapped to 'sectors' -# """ -# from flowsa.naics import convert_naics_year -# # First check if source activities are NAICS like - -# # if so make it into a mapping file -# s = pd.unique(flowbyactivity_df['SourceName'])[0] -# # load catalog info for source, first check for sourcename used -# # in source catalog -# ts = return_true_source_catalog_name(s) -# src_info = load_yaml_dict('source_catalog')[ts] -# # read the pre-determined level of sector aggregation of -# # each crosswalk from the source catalog -# levelofSectoragg = src_info['sector_hierarchy'] -# # if the FBS activity set is 'direct', overwrite the -# # levelofsectoragg, or if specified in fxn call -# if allocationmethod == 'direct': -# levelofSectoragg = 'parent-completeChild' -# if overwrite_sectorlevel is not None: -# levelofSectoragg = overwrite_sectorlevel -# # if data are provided in NAICS format, use the mastercrosswalk -# if src_info['sector-like_activities']: -# cw = load_crosswalk('sector_timeseries') -# sectors = cw.loc[:, [SECTOR_SOURCE_NAME]] -# # Create mapping df that's just the sectors at first -# mapping = sectors.drop_duplicates() -# # Add the sector twice as activities so mapping is identical -# mapping = mapping.assign(Activity=sectors[SECTOR_SOURCE_NAME]) -# mapping = mapping.rename(columns={SECTOR_SOURCE_NAME: "Sector"}) -# # add columns so can run expand_naics_list_fxn -# # if sector-like_activities = True, missing columns, so add -# mapping['ActivitySourceName'] = s -# # tmp assignment -# mapping['SectorType'] = None -# # Include all digits of naics in mapping, if levelofNAICSagg -# # is specified as "aggregated" -# if levelofSectoragg == 'aggregated': -# mapping = expand_naics_list(mapping, sectorsourcename) -# else: -# # if source data activities are text strings, or sector-like -# # activities should be modified, call on the manually -# # created source crosswalks -# if activity_to_sector_mapping: -# s = activity_to_sector_mapping -# mapping = get_activitytosector_mapping(s, fbsconfigpath=fbsconfigpath) -# # filter by SectorSourceName of interest -# mapping = mapping[mapping['SectorSourceName'] == sectorsourcename] -# # drop SectorSourceName -# mapping = mapping.drop(columns=['SectorSourceName']) -# # Include all digits of naics in mapping, if levelofNAICSagg -# # is specified as "aggregated" -# if levelofSectoragg == 'aggregated': -# mapping = expand_naics_list(mapping, sectorsourcename) -# # Merge in with flowbyactivity by -# flowbyactivity_wsector_df = flowbyactivity_df.copy(deep=True) -# for k, v in activity_fields.items(): -# sector_direction = k -# flowbyactivity_field = v[0]["flowbyactivity"] -# flowbysector_field = v[1]["flowbysector"] -# sector_type_field = sector_direction+'SectorType' -# mappings_df_tmp = mapping.rename( -# columns={'Activity': flowbyactivity_field, -# 'Sector': flowbysector_field, -# 'SectorType': sector_type_field}) -# # column doesn't exist for sector-like activities, -# # so ignore if error occurs -# mappings_df_tmp = mappings_df_tmp.drop( -# columns=['ActivitySourceName'], errors='ignore') -# # Merge them in. Critical this is a left merge to -# # preserve all unmapped rows -# flowbyactivity_wsector_df = pd.merge( -# flowbyactivity_wsector_df, mappings_df_tmp, how='left', -# on=flowbyactivity_field) -# for c in ['SectorProducedBy', 'ProducedBySectorType', -# 'SectorConsumedBy', 'ConsumedBySectorType']: -# flowbyactivity_wsector_df[c] = \ -# flowbyactivity_wsector_df[c].replace({np.nan: None}) -# # add sector source name -# flowbyactivity_wsector_df = \ -# flowbyactivity_wsector_df.assign(SectorSourceName=sectorsourcename) -# -# # if activities are sector-like check that the sectors are in the crosswalk -# if src_info['sector-like_activities']: -# flowbyactivity_wsector_df = convert_naics_year( -# flowbyactivity_wsector_df, sectorsourcename) -# -# return flowbyactivity_wsector_df - - -def expand_naics_list(df, sectorsourcename): - """ - Add disaggregated sectors to the crosswalks. - :param df: df, with sector columns - :param sectorsourcename: str, sectorsourcename for naics year - :return: df with additional rows for expanded sector list - """ - - # load master crosswalk - cw = load_crosswalk('sector_timeseries') - sectors = cw.loc[:, [sectorsourcename]] - # drop duplicates - sectors = sectors.drop_duplicates().dropna() - # drop rows that contain hyphenated sectors - sectors = sectors[ - ~sectors[sectorsourcename].str.contains("-")].reset_index(drop=True) - # Ensure 'None' not added to sectors - sectors = sectors[sectors[sectorsourcename] != "None"] - - # create list of sectors that exist in original df, which, - # if created when expanding sector list cannot be added - existing_sectors = df[['Sector']] - existing_sectors = existing_sectors.drop_duplicates() - - naics_df = pd.DataFrame([]) - for i in existing_sectors['Sector']: - dig = len(str(i)) - n = sectors.loc[ - sectors[sectorsourcename].apply(lambda x: x[0:dig]) == i] - if len(n) != 0: - n = n.assign(Sector=i) - naics_df = pd.concat([naics_df, n]) - - # merge df to retain activityname/sectortype info - naics_expanded = df.merge(naics_df, how='left') - # drop column of aggregated naics and rename column of disaggregated naics - naics_expanded = naics_expanded.drop(columns=["Sector"]) - naics_expanded = naics_expanded.rename( - columns={sectorsourcename: 'Sector'}) - # drop duplicates and rearrange df columns - naics_expanded = naics_expanded.drop_duplicates() - naics_expanded = naics_expanded[['ActivitySourceName', 'Activity', - 'Sector', 'SectorType']] - - return naics_expanded - - -# def get_fba_allocation_subset(fba_allocation, source, activitynames, -# sourceconfig=False, flowSubsetMapped=None, -# allocMethod=None, fbsconfigpath=None): -# """ -# Subset the fba allocation data based on NAICS associated with activity -# :param fba_allocation: df, FBA format -# :param source: str, source name -# :param activitynames: list, activity names in activity set -# :param kwargs: can be the mapping file and method of allocation -# :return: df, FBA subset -# """ -# # first determine if there are special cases that would modify the -# # typical method of subset an example of a special case is when the -# # allocation method is 'proportional-flagged' -# subset_by_sector_cols = False -# if flowSubsetMapped is not None: -# fsm = flowSubsetMapped -# if allocMethod is not None: -# am = allocMethod -# if am == 'proportional-flagged': -# subset_by_sector_cols = True -# -# if check_activities_sector_like(fba_allocation, sourcename=source) is \ -# False: -# # read in source crosswalk -# df = get_activitytosector_mapping( -# sourceconfig.get('activity_to_sector_mapping', source), -# fbsconfigpath=fbsconfigpath) -# sec_source_name = df['SectorSourceName'][0] -# df = expand_naics_list(df, sec_source_name) -# # subset source crosswalk to only contain values -# # pertaining to list of activity names -# df = df.loc[df['Activity'].isin(activitynames)] -# # turn column of sectors related to activity names into list -# sector_list = pd.unique(df['Sector']).tolist() -# # subset fba allocation table to the values in -# # the activity list, based on overlapping sectors -# if 'Sector' in fba_allocation: -# fba_allocation_subset =\ -# fba_allocation.loc[fba_allocation['Sector'].isin( -# sector_list)].reset_index(drop=True) -# else: -# fba_allocation_subset = \ -# fba_allocation.loc[ -# (fba_allocation[fbs_activity_fields[0]].isin(sector_list) -# ) | -# (fba_allocation[fbs_activity_fields[1]].isin(sector_list) -# )].reset_index(drop=True) -# else: -# if 'Sector' in fba_allocation: -# fba_allocation_subset =\ -# fba_allocation.loc[fba_allocation['Sector'].isin( -# activitynames)].reset_index(drop=True) -# elif subset_by_sector_cols: -# # if it is a special case, then base the subset of data on -# # sectors in the sector columns, not on activitynames -# fsm_sub = fsm.loc[ -# (fsm[fba_activity_fields[0]].isin(activitynames)) | -# (fsm[fba_activity_fields[1]].isin(activitynames) -# )].reset_index(drop=True) -# part1 = fsm_sub[['SectorConsumedBy']] -# part2 = fsm_sub[['SectorProducedBy']] -# part1.columns = ['Sector'] -# part2.columns = ['Sector'] -# modified_activitynames = \ -# pd.concat([part1, part2], ignore_index=True).drop_duplicates() -# modified_activitynames = modified_activitynames[ -# modified_activitynames['Sector'].notnull()] -# modified_activitynames = modified_activitynames['Sector'].tolist() -# fba_allocation_subset = fba_allocation.loc[ -# (fba_allocation[fbs_activity_fields[0]].isin( -# modified_activitynames)) | -# (fba_allocation[fbs_activity_fields[1]].isin( -# modified_activitynames) -# )].reset_index(drop=True) -# -# else: -# fba_allocation_subset = fba_allocation.loc[ -# (fba_allocation[fbs_activity_fields[0]].isin(activitynames)) | -# (fba_allocation[fbs_activity_fields[1]].isin(activitynames) -# )].reset_index(drop=True) -# -# return fba_allocation_subset - - def convert_units_to_annual(df): """ Convert data and units to annual flows @@ -400,68 +163,6 @@ def map_fbs_flows(fbs, from_fba_source, v, **kwargs): return fbs_mapped, mapping_files -def get_sector_list(sector_level, secondary_sector_level_dict=None): - """ - Create a sector list at the specified sector level - :param sector_level: str, NAICS level - :param secondary_sector_level_dict: dict, additional sectors to keep, - key is the secondary target NAICS level, value is a list of NAICS at the - "sector_level" that should also include a further disaggregated subset - of the data - ex. sector_level = 'NAICS_4' - secondary_sector_level_dict = {'NAICS_6': ['1133', '1125']} - :return: list, sectors at specified sector level - """ - # load crosswalk - cw = load_crosswalk('sector_length') - - # first determine if there are sectors in a secondary target sector - # level that should be included in the sector list. If there are, - # add the sectors at the specified sector length and add the parent - # sectors at the target sector length to a list to be dropped from - # the sector list. - - # create empty lists for sector list and parent sectors to drop - sector_list = [] - sector_drop = [] - # loop through identified secondary sector levels in a dictionary - if secondary_sector_level_dict is not None: - for k, v in secondary_sector_level_dict.items(): - # first determine if any sectors in the sector list are already - # at level k - cw_sec = cw[k].drop_duplicates().values.tolist() - sector_add_list_1 = [x for x in v if x in cw_sec] - # remove any sectors from v if identified in sector_add_list_1 - v = [x for x in v if x not in sector_add_list_1] - - # for any sectors at more aggregated level than k, determine the - # child sectors - cw_melt = cw.melt( - id_vars=[k], var_name="NAICS_Length", - value_name="NAICS_Match").drop_duplicates() - cw_sub = cw_melt[cw_melt['NAICS_Match'].isin(v)] - sector_add_list_2 = cw_sub[k].unique().tolist() - - # determine sectors to add and drop - sector_list = sector_list + sector_add_list_1 + sector_add_list_2 - sector_drop = sector_drop + v - - # check if through loop any sectors in the drop list were included in - # sector list, and if so, drop - sector_list2 = [x for x in sector_list if x not in sector_drop] - - # sectors at primary sector level - sector_col = cw[[sector_level]].drop_duplicates() - # drop any sectors that are already accounted for at a secondary sector - # length - sector_col = sector_col[~sector_col[sector_level].isin(sector_drop)] - # add sectors to list - sector_add = sector_col[sector_level].tolist() - sector_list3 = sector_list2 + sector_add - - return sector_list3 - - def map_to_BEA_sectors(fbs_load, region, io_level, year): """ Map FBS sectors from NAICS to BEA, allocating by gross industry output. diff --git a/flowsa/validation.py b/flowsa/validation.py index 4c6cc4cd8..c9c368c56 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -9,68 +9,13 @@ import numpy as np import flowsa from flowsa.flowby import FlowBySector -from flowsa.flowbyfunctions import aggregator, create_geoscale_list,\ - collapse_fbs_sectors +from flowsa.flowbyfunctions import aggregator, collapse_fbs_sectors from flowsa.flowsa_log import log, vlog -from flowsa.common import sector_level_key, fba_activity_fields -from flowsa.dataclean import replace_NoneType_with_empty_cells, replace_strings_with_NoneType +from flowsa.common import fba_activity_fields from flowsa.location import US_FIPS from flowsa.schema import dq_fields -def check_if_data_exists_at_geoscale(df_load, geoscale): - """ - Check if an activity or a sector exists at the specified geoscale - :param df_load: df with activity columns - :param geoscale: national, state, or county - """ - - # filter by geoscale depends on Location System - fips_list = create_geoscale_list(df_load, geoscale) - fips = pd.DataFrame(fips_list, columns=['FIPS']) - - activities = df_load[['ActivityProducedBy', 'ActivityConsumedBy']]\ - .drop_duplicates().reset_index(drop=True) - # add tmp column and merge - fips['tmp'] = 1 - activities['tmp'] = 1 - activities = activities.merge(fips, on='tmp').drop(columns='tmp') - - # merge activities with df and determine which FIPS are missing for each - # activity - df = df_load[df_load['Location'].isin(fips_list)] - # if activities are defined, subset df - # df = df[df['']] - - dfm = df.merge(activities, - left_on=['ActivityProducedBy', 'ActivityConsumedBy', - 'Location'], - right_on=['ActivityProducedBy', 'ActivityConsumedBy', - 'FIPS'], - how='outer') - # subset into df where values for state and where states do not have data - df1 = dfm[~dfm['FlowAmount'].isna()] - df2 = dfm[dfm['FlowAmount'].isna()] - df2 = df2[['ActivityProducedBy', 'ActivityConsumedBy', - 'FIPS']].reset_index(drop=True) - - # define source name and year - sn = df_load['SourceName'][0] - y = df_load['Year'][0] - - if len(df1) == 0: - vlog.info(f'No flows found for activities in {sn} {y} at the ' - f'{geoscale} scale') - if len(df2) > 0: - # if len(df2) > 1: - df2 = df2.groupby( - ['ActivityProducedBy', 'ActivityConsumedBy'], dropna=False).agg( - lambda col: ','.join(col)).reset_index() - vlog.info("There are %s, activity combos that do not have " - "data in %s %s: \n {}".format(df2.to_string()), - geoscale, sn, y) - - def calculate_flowamount_diff_between_dfs(dfa_load, dfb_load): """ Calculate the differences in FlowAmounts between two dfs @@ -162,282 +107,6 @@ def calculate_flowamount_diff_between_dfs(dfa_load, dfb_load): vlog.info('Total FlowAmount differences by Activity Columns: ' '\n {}'.format(dfagg2.to_string(), index=False)) -# todo: convert this fxn to recursive method - important to check FBA to FBS -# flow totals -# def compare_activity_to_sector_flowamounts(fba_load, fbs_load, -# activity_set, config, v, attr, **_): -# """ -# Function to compare the loaded flowbyactivity with the final flowbysector -# by activityname (if exists) to target sector level -# output, checking for data loss -# :param fba_load: df, FBA loaded and mapped using FEDEFL -# :param fbs_load: df, final FBS df -# :param activity_set: str, activity set -# :param config: dictionary, method yaml -# :return: printout data differences between loaded FBA and FBS output, -# save results as csv in local directory -# """ -# data_format = v.get('data_format') -# if (data_format == 'FBA') & (check_activities_sector_like(fba_load)): -# vlog.debug('Not comparing loaded FlowByActivity to FlowBySector ' -# 'ratios for a dataset with sector-like activities because ' -# 'if there are modifications to flowamounts for a sector, ' -# 'then the ratios will be different') -# else: -# # subset fba df -# col_subset = ['Class', 'MetaSources', 'Flowable', 'Unit', 'FlowType', -# 'ActivityProducedBy', 'ActivityConsumedBy', -# 'SectorProducedBy', 'SectorConsumedBy', 'Context', -# 'Location', 'LocationSystem', 'Year', 'FlowAmount'] -# fba = fba_load[fba_load.columns.intersection( -# col_subset)].reset_index(drop=True) -# # todo: modify so location subset is based on target geoscale -# fba.loc[:, 'Location'] = US_FIPS -# group_cols = [e for e in fba.columns if e in -# ['ActivityProducedBy', 'ActivityConsumedBy', -# 'SectorProducedBy', 'SectorConsumedBy', 'Flowable', -# 'Unit', 'FlowType', 'Context', 'Location', -# 'LocationSystem', 'Year']] -# fba_agg = aggregator(fba, group_cols) -# fba_agg.rename(columns={'FlowAmount': 'FBA_amount'}, inplace=True) -# -# # subset fbs df -# col_subset_2 = ['Class', 'SectorSourceName', 'Flowable', 'Unit', -# 'FlowType', 'SectorProducedBy', -# 'ActivityProducedBy', 'ActivityConsumedBy', -# 'Context', 'Location', 'LocationSystem', 'Year', -# 'FlowAmount'] -# if attr.get('allocation_merge_columns') is not None: -# col_subset_2 = col_subset_2 + attr.get('allocation_merge_columns') -# fbs = fbs_load[fbs_load.columns.intersection( -# col_subset_2)].reset_index(drop=True) -# -# # determine which -# for i in ['Produced', 'Consumed']: -# try: -# fbs[f'{i}Length'] = fbs[f'Sector{i}By'].str.len() -# except KeyError: -# pass -# max_list = [e for e in fbs.columns if e in ['ProducedLength', -# 'ConsumedLength']] -# fbs['SectorLength'] = fbs[max_list].max(axis=1) -# -# fbs.loc[:, 'Location'] = US_FIPS -# group_cols = ['Flowable', 'Unit', 'FlowType', 'Context', 'Location', -# 'LocationSystem', 'Year', 'SectorLength'] -# if v.get('data_format') == 'FBA': -# group_cols = ['ActivityProducedBy', 'ActivityConsumedBy'] + \ -# group_cols -# else: -# group_cols = attr.get('allocation_merge_columns') + group_cols -# fbs_agg = aggregator(fbs, group_cols) -# fbs_agg.rename(columns={'FlowAmount': 'FBS_amount'}, inplace=True) -# -# # merge compare 1 and compare 2 -# if v.get('data_format') == 'FBA': -# merge_cols = ['ActivityProducedBy', 'ActivityConsumedBy', -# 'Flowable', 'Unit', 'FlowType', 'Context', -# 'Location', 'LocationSystem', 'Year'] -# else: -# merge_cols = attr.get('allocation_merge_columns') + \ -# ['Flowable', 'Unit', 'FlowType', 'Context', -# 'Location', 'LocationSystem', 'Year'] -# df_merge = fba_agg.merge(fbs_agg, left_on=merge_cols, -# right_on=merge_cols, how='left') -# df_merge['Ratio'] = df_merge['FBS_amount'] / df_merge['FBA_amount'] -# -# # reorder -# order_cols = ['SectorProducedBy', 'SectorConsumedBy', -# 'ActivityProducedBy', 'ActivityConsumedBy', -# 'Flowable', 'Unit', 'FlowType', 'Context', 'Location', -# 'LocationSystem', 'Year', 'SectorLength', -# 'FBA_amount', 'FBS_amount', 'Ratio'] -# df_merge = df_merge[df_merge.columns.intersection( -# order_cols)].reset_index(drop=True) -# -# # keep only rows of specified sector length -# # todo: update to also keep sub target list -# comparison = df_merge[ -# df_merge['SectorLength'] == sector_level_key[ -# config['target_sector_level']]].reset_index(drop=True) -# -# tolerance = 0.01 -# comparison2 = comparison[(comparison['Ratio'] < 1 - tolerance) | -# (comparison['Ratio'] > 1 + tolerance)] -# -# if len(comparison2) > 0: -# vlog.info('There are %s combinations of flowable/context/sector ' -# 'length where the flowbyactivity to flowbysector ratio ' -# 'is less than or greater than 1 by %s', -# len(comparison2), str(tolerance)) -# -# # include df subset in the validation log -# # only print rows where flowamount ratio is less t -# # han 1 (round flowamountratio) -# df_v = comparison2[comparison2['Ratio'].apply( -# lambda x: round(x, 3) < 1)].reset_index(drop=True) -# -# # save to validation log -# log.info('Save the comparison of FlowByActivity load ' -# 'to FlowBySector ratios for %s in validation log', -# activity_set) -# # if df not empty, print, if empty, print string -# if df_v.empty: -# vlog.info('Ratios for %s all round to 1', activity_set) -# else: -# vlog.info('Comparison of FlowByActivity load to ' -# 'FlowBySector ratios for %s: ' -# '\n {}'.format(df_v.to_string()), activity_set) - - -# def compare_fba_geo_subset_and_fbs_output_totals( -# fba_load, fbs_load, activity_set, source_name, source_attr, -# activity_attr, method): -# """ -# Function to compare the loaded flowbyactivity total after -# subsetting by activity and geography with the final flowbysector output -# total. Not a direct comparison of the loaded FBA because FBAs are -# modified before being subset by activity for the target sector level -# :param fba_load: df, FBA loaded, before being mapped -# :param fbs_load: df, final FBS df at target sector level -# :param activity_set: str, activity set -# :param source_name: str, source name -# :param source_attr: dictionary, attribute data from method yaml -# for source data -# :param activity_attr: dictionary, attribute data from method yaml -# for activity set -# :param method: dictionary, FBS method yaml -# :return: printout data differences between loaded FBA and FBS output -# totals by location, save results as csv in local directory -# """ -# -# vlog.info('Comparing Flow-By-Activity subset by activity and geography to ' -# 'the subset Flow-By-Sector FlowAmount total.') -# -# # determine from scale -# if fips_number_key[source_attr['geoscale_to_use']] < \ -# fips_number_key[activity_attr['allocation_from_scale']]: -# from_scale = source_attr['geoscale_to_use'] -# else: -# from_scale = activity_attr['allocation_from_scale'] -# -# if source_attr['data_format'] == 'FBA': -# # extract relevant geoscale data or aggregate existing data -# fba = subset_df_by_geoscale(fba_load, from_scale, -# method['target_geoscale']) -# if check_activities_sector_like(fba_load): -# # if activities are sector-like, run sector aggregation and then -# # subset df to only keep NAICS2 -# fba = fba[['Class', 'SourceName', 'FlowAmount', 'Unit', 'Context', -# 'ActivityProducedBy', 'ActivityConsumedBy', 'Location', -# 'LocationSystem']] -# # rename the activity cols to sector cols for purposes of aggregation -# fba = fba.rename(columns={'ActivityProducedBy': 'SectorProducedBy', -# 'ActivityConsumedBy': 'SectorConsumedBy'}) -# fba = sector_aggregation(fba) -# # subset fba to only include NAICS2 -# # fba = replace_NoneType_with_empty_cells(fba) -# fba = subset_df_by_sector_lengths(fba, [2]) -# else: -# fba = sector_aggregation(fba_load) -# fba = subset_df_by_sector_lengths(fba, [2]) -# # subset/agg dfs -# col_subset = ['Class', 'FlowAmount', 'Unit', 'Context', -# 'Location', 'LocationSystem'] -# group_cols = ['Class', 'Unit', 'Context', 'Location', 'LocationSystem'] -# # check units -# compare_df_units(fba, fbs_load) -# # fba -# fba = fba[col_subset] -# fba_agg = aggregator(fba, group_cols).reset_index(drop=True) -# fba_agg.rename(columns={'FlowAmount': 'FBA_amount', -# 'Unit': 'FBA_unit'}, inplace=True) -# -# # fbs -# fbs = fbs_load[col_subset] -# fbs_agg = aggregator(fbs, group_cols) -# fbs_agg.rename(columns={'FlowAmount': 'FBS_amount', -# 'Unit': 'FBS_unit'}, inplace=True) -# -# try: -# # merge FBA and FBS totals -# df_merge = fba_agg.merge(fbs_agg, how='left') -# df_merge['FBS_amount'] = df_merge['FBS_amount'].fillna(0) -# df_merge['FlowAmount_difference'] = \ -# df_merge['FBA_amount'] - df_merge['FBS_amount'] -# df_merge['Percent_difference'] = \ -# (df_merge['FlowAmount_difference']/df_merge['FBA_amount']) * 100 -# # cases where flow amount diff is 0 but because fba amount is 0, -# # percent diff is null. Fill those cases with 0s -# df_merge['Percent_difference'] = np.where( -# (df_merge['FlowAmount_difference'] == 0) & -# (df_merge['FBA_amount'] == 0), 0, df_merge['Percent_difference']) -# # reorder -# df_merge = df_merge[['Class', 'Context', 'Location', 'LocationSystem', -# 'FBA_amount', 'FBA_unit', 'FBS_amount', -# 'FBS_unit', 'FlowAmount_difference', -# 'Percent_difference']] -# # df_merge = replace_NoneType_with_empty_cells(df_merge) -# -# # list of contexts and locations -# context_list = df_merge[['Class', 'Context', -# 'Location']].values.tolist() -# -# # loop through the contexts and print results of comparison -# vlog.info(f'Comparing FBA {activity_set} {source_attr["geoscale_to_use"]} ' -# 'subset to FBS results. Details in Validation Log') -# for i, j, k in context_list: -# df_merge_subset = \ -# df_merge[(df_merge['Class'] == i) & -# (df_merge['Context'] == j) & -# (df_merge['Location'] == k)].reset_index(drop=True) -# diff_per = df_merge_subset['Percent_difference'][0] -# if np.isnan(diff_per): -# vlog.info(f'FlowBySector FlowAmount for {source_name} ' -# f'{activity_set} {i} does not exist in the FBS') -# continue -# # make reporting more manageable -# if abs(diff_per) > 0.01: -# diff_per = round(diff_per, 2) -# else: -# diff_per = round(diff_per, 6) -# -# # diff_units = df_merge_subset['FBS_unit'][0] -# if diff_per > 0: -# vlog.info(f'FlowBySector FlowAmount for {source_name} ' -# f'{activity_set} {i} {j} at {k} is ' -# f'{str(abs(diff_per))}% less than the ' -# f'FlowByActivity FlowAmount') -# elif diff_per < 0: -# vlog.info(f'FlowBySector FlowAmount for {source_name} ' -# f'{activity_set} {i} {j} at {k} is ' -# f'{str(abs(diff_per))}% more than the ' -# f'FlowByActivity FlowAmount') -# elif diff_per == 0: -# vlog.info(f'FlowBySector FlowAmount for {source_name} ' -# f'{activity_set} {i} {j} at {k} is equal to the ' -# f'FlowByActivity FlowAmount') -# -# # subset the df to include in the validation log -# # only print rows where the percent difference does not round to 0 -# df_v = df_merge[df_merge['Percent_difference'].apply( -# lambda x: round(x, 3) != 0)].reset_index(drop=True) -# -# # log output -# log.info('Save the comparison of FlowByActivity load to FlowBySector ' -# f'total FlowAmounts for {activity_set} in validation log file') -# # if df not empty, print, if empty, print string -# if df_v.empty: -# vlog.info(f'Percent difference between loaded FBA and ' -# f'output FBS for {activity_set} all round to 0') -# else: -# vlog.info('Comparison of FBA load to FBS total ' -# 'FlowAmounts for %s: ' -# '\n {}'.format(df_v.to_string()), activity_set) -# except: -# vlog.info('Error occurred when comparing total FlowAmounts ' -# 'for FlowByActivity and FlowBySector') - def compare_summation_at_sector_lengths_between_two_dfs(df1, df2): """ @@ -502,72 +171,6 @@ def compare_summation_at_sector_lengths_between_two_dfs(df1, df2): 'length') -# def compare_child_to_parent_sectors_flowamounts(df_load): -# """ -# Sum child sectors up to one sector and compare to parent sector values -# :param df_load: df, contains sector columns -# :return: comparison of flow values -# """ -# from flowsa.flowbyfunctions import assign_sector_match_column -# -# merge_cols = [e for e in df_load.columns if e in [ -# 'Class', 'SourceName', 'MetaSources', 'FlowName', 'Unit', -# 'FlowType', 'Flowable', 'ActivityProducedBy', 'ActivityConsumedBy', -# 'Compartment', 'Context', 'Location', 'Year', 'Description']] -# # determine if activities are sector-like -# sector_like_activities = check_activities_sector_like(df_load) -# # if activities are sector like, drop columns from merge group -# if sector_like_activities: -# merge_cols = [e for e in merge_cols if e not in ( -# 'ActivityProducedBy', 'ActivityConsumedBy')] -# -# agg_cols = merge_cols + ['SectorProducedMatch', 'SectorConsumedMatch'] -# dfagg = pd.DataFrame() -# for i in range(3, 7): -# df = subset_df_by_sector_lengths(df_load, [i]) -# for s in ['Produced', 'Consumed']: -# df = assign_sector_match_column(df, f'Sector{s}By', i, i-1).rename( -# columns={'sector_group': f'Sector{s}Match'}) -# df = df.fillna('') -# df2 = df.groupby(agg_cols).agg( -# {'FlowAmount': 'sum'}).rename(columns={ -# 'FlowAmount': 'ChildNAICSSum'}).reset_index() -# dfagg = pd.concat([dfagg, df2], ignore_index=True) -# -# # merge new df with summed child naics to original df -# drop_cols = [e for e in df_load.columns if e in -# ['MeasureofSpread', 'Spread', 'DistributionType', 'Min', -# 'Max', 'DataReliability', 'DataCollection', 'Description', -# 'SectorProducedMatch', 'SectorConsumedMatch']] -# dfm = df_load.merge(dfagg, how='left', left_on=merge_cols + [ -# 'SectorProducedBy', 'SectorConsumedBy'], right_on=agg_cols).drop( -# columns=drop_cols) -# dfm = dfm.assign(FlowDiff=dfm['ChildNAICSSum'] - dfm['FlowAmount']) -# dfm['PercentDiff'] = (dfm['FlowDiff'] / dfm['FlowAmount']) * 100 -# -# cols_subset = [e for e in dfm.columns if e in [ -# 'Class', 'SourceName', 'MetaSources', 'Flowable', 'FlowName', -# 'Unit', 'FlowType', 'ActivityProducedBy', 'ActivityConsumedBy', -# 'Context', 'Location', 'Year', 'SectorProducedBy', -# 'SectorConsumedBy', 'FlowAmount', 'ChildNAICSSum', 'PercentDiff']] -# dfm = dfm[cols_subset] -# -# # subset df where child sectors sum to be greater than parent sectors -# tolerance = 1 -# dfm2 = dfm[(dfm['PercentDiff'] > tolerance) | -# (dfm['PercentDiff'] < - tolerance)].reset_index(drop=True) -# -# if len(dfm2) > 0: -# log.info(f'See validation log for cases where child sectors sum to be ' -# f'different than parent sectors by at least {tolerance}%.') -# vlog.info('There are cases where child sectors sum to be ' -# 'different than parent sectors by at least %s%%: ' -# '\n {}'.format(dfm2.to_string()), tolerance) -# else: -# vlog.info(f'No child sectors sum to be different than parent ' -# f'sectors by at least {tolerance}%.') - - def check_for_nonetypes_in_sector_col(df): """ Check for NoneType in columns where datatype = string From d01cf5d090faa87752effdf9be4661c84160e404 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 24 Aug 2023 16:55:53 -0600 Subject: [PATCH 0816/1127] update standardize_units() for the FBA to use the same conversion csv used by FBS --- flowsa/dataclean.py | 175 +++++++++----------------------------------- 1 file changed, 36 insertions(+), 139 deletions(-) diff --git a/flowsa/dataclean.py b/flowsa/dataclean.py index f9d687c83..c2ee07a82 100644 --- a/flowsa/dataclean.py +++ b/flowsa/dataclean.py @@ -69,148 +69,45 @@ def add_missing_flow_by_fields(flowby_partial_df, flowbyfields): def standardize_units(df): """ - Convert unit to standard + Convert unit to standard using csv Timeframe is over one year + This function is copied from the flowby.py fxn :param df: df, Either flowbyactivity or flowbysector :return: df, with standarized units """ - days_in_year = 365 - sq_ft_to_sq_m_multiplier = 0.092903 - # rounded to match USGS_NWIS_WU mapping file on FEDEFL - gallon_water_to_kg = 3.79 - ac_ft_water_to_kg = 1233481.84 - acre_to_m2 = 4046.8564224 - mj_in_btu = .0010550559 - ton_to_kg = 907.185 - lb_to_kg = 0.45359 - - # strip whitespace from units - df['Unit'] = df['Unit'].str.strip() - - # class = employment, unit = 'p' - # class = energy, unit = MJ - # class = land, unit = m2 - df.loc[:, 'FlowAmount'] = np.where(df['Unit'].isin(['ACRES', 'Acres']), - df['FlowAmount'] * acre_to_m2, - df['FlowAmount']) - df.loc[:, 'Unit'] = np.where(df['Unit'].isin(['ACRES', 'Acres']), - 'm2', df['Unit']) - - df.loc[:, 'FlowAmount'] = \ - np.where(df['Unit'].isin(['million sq ft', 'million square feet']), - df['FlowAmount'] * sq_ft_to_sq_m_multiplier * 1000000, - df['FlowAmount']) - df.loc[:, 'Unit'] = \ - np.where(df['Unit'].isin(['million sq ft', 'million square feet']), - 'm2', df['Unit']) - - df.loc[:, 'FlowAmount'] = \ - np.where(df['Unit'].isin(['square feet']), - df['FlowAmount'] * sq_ft_to_sq_m_multiplier, df['FlowAmount']) - df.loc[:, 'Unit'] = \ - np.where(df['Unit'].isin(['square feet']), 'm2', df['Unit']) - - # class = money, unit = USD - if df['Unit'].str.contains('Canadian Dollar').any(): - exchange_rate = float(get_Canadian_to_USD_exchange_rate( - df['Year'].unique()[0])) - df.loc[:, 'FlowAmount'] = np.where(df['Unit'] == 'Canadian Dollar', - df['FlowAmount'] / exchange_rate, - df['FlowAmount']) - df.loc[:, 'FlowAmount'] = np.where(df['Unit'] == 'Thousand USD', - df['FlowAmount'] * 1000, - df['FlowAmount']) - df.loc[:, 'Unit'] = np.where(df['Unit'].isin( - ['Canadian Dollar', 'Thousand USD']), 'USD', df['Unit']) - - # class = water, unit = kg - df.loc[:, 'FlowAmount'] = \ - np.where(df['Unit'] == 'gallons/animal/day', - (df['FlowAmount'] * gallon_water_to_kg) * days_in_year, - df['FlowAmount']) - df.loc[:, 'Unit'] = \ - np.where(df['Unit'] == 'gallons/animal/day', 'kg', df['Unit']) - - df.loc[:, 'FlowAmount'] = \ - np.where(df['Unit'] == 'ACRE FEET / ACRE', - (df['FlowAmount'] / acre_to_m2) * ac_ft_water_to_kg, - df['FlowAmount']) - df.loc[:, 'Unit'] = \ - np.where(df['Unit'] == 'ACRE FEET / ACRE', 'kg/m2', df['Unit']) - - df.loc[:, 'FlowAmount'] = \ - np.where(df['Unit'] == 'Mgal', - df['FlowAmount'] * 1000000 * gallon_water_to_kg, - df['FlowAmount']) - df.loc[:, 'Unit'] = np.where(df['Unit'] == 'Mgal', 'kg', df['Unit']) - - df.loc[:, 'FlowAmount'] = np.where(df['Unit'] == 'gal', - df['FlowAmount'] * gallon_water_to_kg, - df['FlowAmount']) - df.loc[:, 'Unit'] = np.where(df['Unit'] == 'gal', 'kg', df['Unit']) - - df.loc[:, 'FlowAmount'] = np.where(df['Unit'] == 'gal/USD', - df['FlowAmount'] * gallon_water_to_kg, - df['FlowAmount']) - df.loc[:, 'Unit'] = np.where(df['Unit'] == 'gal/USD', 'kg/USD', df['Unit']) - - df.loc[:, 'FlowAmount'] = \ - np.where(df['Unit'] == 'Bgal/d', - df['FlowAmount'] * (10**9) * gallon_water_to_kg * - days_in_year, - df['FlowAmount']) - df.loc[:, 'Unit'] = np.where(df['Unit'] == 'Bgal/d', 'kg', df['Unit']) - - df.loc[:, 'FlowAmount'] = \ - np.where(df['Unit'] == 'Mgal/d', - df['FlowAmount'] * (10**6) * gallon_water_to_kg * - days_in_year, - df['FlowAmount']) - df.loc[:, 'Unit'] = np.where(df['Unit'] == 'Mgal/d', 'kg', df['Unit']) - - # Convert Energy unit "Quadrillion Btu" to MJ - # 1 Quad = .0010550559 x 10^15 - df.loc[:, 'FlowAmount'] = \ - np.where(df['Unit'] == 'Quadrillion Btu', - df['FlowAmount'] * mj_in_btu * (10 ** 15), - df['FlowAmount']) - df.loc[:, 'Unit'] = \ - np.where(df['Unit'] == 'Quadrillion Btu', 'MJ', df['Unit']) - - # Convert Energy unit "Trillion Btu" to MJ - # 1 Tril = .0010550559 x 10^12 - df.loc[:, 'FlowAmount'] = \ - np.where(df['Unit'].isin(['Trillion Btu', 'TBtu']), - df['FlowAmount'] * mj_in_btu * (10 ** 12), - df['FlowAmount']) - df.loc[:, 'Unit'] = \ - np.where(df['Unit'].isin(['Trillion Btu', 'TBtu']), 'MJ', df['Unit']) - - # Convert million cubic meters to gallons (for water) - df.loc[:, 'FlowAmount'] = \ - np.where(df['Unit'] == 'million Cubic metres/year', - df['FlowAmount'] * 264.172 * (10**6) * gallon_water_to_kg, - df['FlowAmount']) - df.loc[:, 'Unit'] = \ - np.where(df['Unit'] == 'million Cubic metres/year', 'kg', df['Unit']) - - # Convert mass units (LB or TON) to kg - df.loc[:, 'FlowAmount'] = np.where( - df['Unit'].isin(['TON', 'tons', 'short tons']), - df['FlowAmount'] * ton_to_kg, df['FlowAmount']) - df.loc[:, 'FlowAmount'] = np.where(df['Unit'] == 'Thousands of Tons', - df['FlowAmount'] * 1000 * ton_to_kg, - df['FlowAmount']) - df.loc[:, 'FlowAmount'] = np.where(df['Unit'] == 'LB', - df['FlowAmount'] * lb_to_kg, - df['FlowAmount']) - df.loc[:, 'FlowAmount'] = np.where(df['Unit'] == 'MT', - df['FlowAmount'] * 1000, - df['FlowAmount']) - df.loc[:, 'Unit'] = np.where(df['Unit'].isin( - ['TON', 'tons', 'short tons', 'LB', 'Thousands of Tons', 'MT']), 'kg', - df['Unit']) - - return df + year = df['Year'][0] + + exchange_rate = ( + literature_values + .get_Canadian_to_USD_exchange_rate(year) + ) + + conversion_table = pd.concat([ + pd.read_csv(settings.datapath / 'unit_conversion.csv'), + pd.Series({'old_unit': 'Canadian Dollar', + 'new_unit': 'USD', + 'conversion_factor': 1 / exchange_rate}).to_frame().T + ]) + + standardized = ( + df + .assign(Unit=df.Unit.str.strip()) + .merge(conversion_table, how='left', + left_on='Unit', right_on='old_unit') + .assign(Unit=lambda x: x.new_unit.mask(x.new_unit.isna(), x.Unit), + conversion_factor=lambda x: x.conversion_factor.fillna(1), + FlowAmount=lambda x: x.FlowAmount * x.conversion_factor) + .drop(columns=['old_unit', 'new_unit', 'conversion_factor']) + ) + + standardized_units = list(conversion_table.new_unit.unique()) + + if any(~standardized.Unit.isin(standardized_units)): + unstandardized_units = [unit for unit in standardized.Unit.unique() + if unit not in standardized_units] + flowsa_log.log.warning(f'Some units not standardized by ' + f'standardize_units(): {unstandardized_units}.') + + return standardized From db9695d05b0551f2604c4479289142b9e72af0fe Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 24 Aug 2023 16:59:47 -0600 Subject: [PATCH 0817/1127] update import statements --- flowsa/bibliography.py | 5 ++--- flowsa/flowby.py | 2 +- flowsa/flowbyactivity.py | 1 - flowsa/flowbyclean.py | 3 +-- flowsa/sectormapping.py | 4 +--- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/flowsa/bibliography.py b/flowsa/bibliography.py index 92e883088..b037c996e 100644 --- a/flowsa/bibliography.py +++ b/flowsa/bibliography.py @@ -9,9 +9,8 @@ from bibtexparser.bwriter import BibTexWriter from bibtexparser.bibdatabase import BibDatabase from esupy.processed_data_mgmt import mkdir_if_missing -from flowsa.common import load_yaml_dict, \ - load_values_from_literature_citations_config, get_flowsa_base_name, \ - sourceconfigpath, load_yaml_dict +from flowsa.common import load_values_from_literature_citations_config, \ + get_flowsa_base_name, sourceconfigpath, load_yaml_dict from flowsa.flowsa_log import log from flowsa.settings import outputpath, biboutputpath diff --git a/flowsa/flowby.py b/flowsa/flowby.py index aece3ec79..59b9b0d9f 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -6,7 +6,7 @@ from copy import deepcopy from flowsa import (common, settings, metadata, sectormapping, literature_values, flowbyactivity, flowsa_yaml, - validation, geo, naics, exceptions, location, schema) + validation, geo, naics, exceptions, schema) from flowsa.flowsa_log import log, vlog, reset_log_file import esupy.processed_data_mgmt import esupy.dqi diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index 018399dba..56ace7c99 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -19,7 +19,6 @@ from flowsa.settings import paths from flowsa.flowsa_log import log, reset_log_file from flowsa.metadata import set_fb_meta, write_metadata -from flowsa.flowbyfunctions import fba_fill_na_dict from flowsa.schema import flow_by_activity_fields from flowsa.dataclean import clean_df diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index 59a0630b8..15f1c746d 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -3,8 +3,7 @@ from flowsa.flowby import FlowBySector, FB, get_catalog_info, \ get_flowby_from_config from flowsa.flowsa_log import log -from flowsa import (geo, location, getFlowBySector, flowbyfunctions, - FlowByActivity) +from flowsa import (geo, location, FlowByActivity) from flowsa.naics import map_source_sectors_to_more_aggregated_sectors from flowsa.validation import compare_summation_at_sector_lengths_between_two_dfs diff --git a/flowsa/sectormapping.py b/flowsa/sectormapping.py index f2eed9f3e..41f39a199 100644 --- a/flowsa/sectormapping.py +++ b/flowsa/sectormapping.py @@ -9,10 +9,8 @@ import numpy as np from esupy.mapping import apply_flow_mapping import flowsa -from flowsa.common import get_flowsa_base_name, fba_activity_fields, \ - fbs_activity_fields +from flowsa.common import get_flowsa_base_name, load_crosswalk from flowsa.dataclean import standardize_units -from flowsa.flowbyfunctions import load_crosswalk from flowsa.flowsa_log import log from flowsa.schema import dq_fields From 6bf0d36905bfbdedf4289700e236d29f467e27f7 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 24 Aug 2023 17:07:05 -0600 Subject: [PATCH 0818/1127] rename 'flowbyactivity.py' to generateflowbyactivity --- flowsa/data_source_scripts/BEA.py | 2 +- flowsa/data_source_scripts/BLM_PLS.py | 6 +- flowsa/data_source_scripts/BLS_QCEW.py | 8 +-- .../CalRecycle_WasteCharacterization.py | 2 +- flowsa/data_source_scripts/Census_ASM.py | 2 +- flowsa/data_source_scripts/Census_CBP.py | 2 +- .../Census_PEP_Population.py | 4 +- flowsa/data_source_scripts/Census_QWI.py | 8 +-- flowsa/data_source_scripts/Census_VIP.py | 2 +- flowsa/data_source_scripts/EIA_AEO.py | 2 +- flowsa/data_source_scripts/EIA_CBECS_Land.py | 2 +- flowsa/data_source_scripts/EIA_CBECS_Water.py | 2 +- flowsa/data_source_scripts/EIA_MECS.py | 8 +-- flowsa/data_source_scripts/EIA_MER.py | 4 +- flowsa/data_source_scripts/EIA_SEDS.py | 4 +- flowsa/data_source_scripts/EPA_CDDPath.py | 2 +- flowsa/data_source_scripts/EPA_EQUATES.py | 8 +-- .../EPA_FactsAndFigures.py | 2 +- flowsa/data_source_scripts/EPA_GHGI.py | 2 +- flowsa/data_source_scripts/EPA_NEI.py | 4 +- flowsa/data_source_scripts/EPA_NI.py | 10 +-- flowsa/data_source_scripts/EPA_PI.py | 4 +- flowsa/data_source_scripts/EPA_REI.py | 4 +- flowsa/data_source_scripts/EPA_WARMer.py | 2 +- flowsa/data_source_scripts/EPA_WFR.py | 2 +- .../NETL_EIA_PlantWater.py | 2 +- flowsa/data_source_scripts/StatCan_GDP.py | 4 +- flowsa/data_source_scripts/USDA_ACUP.py | 8 +-- .../data_source_scripts/USDA_CoA_Cropland.py | 6 +- .../USDA_CoA_Cropland_NAICS.py | 2 +- .../data_source_scripts/USDA_CoA_Livestock.py | 6 +- flowsa/data_source_scripts/USDA_ERS_FIWS.py | 2 +- flowsa/data_source_scripts/USDA_ERS_MLU.py | 2 +- flowsa/data_source_scripts/USDA_IWMS.py | 4 +- flowsa/data_source_scripts/USGS_MYB.py | 64 +++++++++---------- flowsa/data_source_scripts/USGS_NWIS_WU.py | 2 +- flowsa/data_source_scripts/USGS_SPARROW.py | 2 +- ...yactivity.py => generateflowbyactivity.py} | 2 +- .../USDA_ACUP_Fertilizer.yaml | 2 +- .../USDA_ACUP_Pesticide.yaml | 2 +- 40 files changed, 104 insertions(+), 104 deletions(-) rename flowsa/{flowbyactivity.py => generateflowbyactivity.py} (99%) diff --git a/flowsa/data_source_scripts/BEA.py b/flowsa/data_source_scripts/BEA.py index d4065a9be..50ab5edc7 100644 --- a/flowsa/data_source_scripts/BEA.py +++ b/flowsa/data_source_scripts/BEA.py @@ -117,7 +117,7 @@ def bea_make_ar_parse(*, year, **_): """ Combine, parse, and format the provided dataframes :param dataframe_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications diff --git a/flowsa/data_source_scripts/BLM_PLS.py b/flowsa/data_source_scripts/BLM_PLS.py index 8666724cd..f27da9871 100644 --- a/flowsa/data_source_scripts/BLM_PLS.py +++ b/flowsa/data_source_scripts/BLM_PLS.py @@ -195,15 +195,15 @@ def split(row, header, sub_header, next_line): def blm_pls_URL_helper(*, build_url, year, config, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which data is obtained. :param build_url: string, base url :param config: dictionary, items in FBA method yaml - :param args: dictionary, arguments specified when running flowbyactivity.py - flowbyactivity.py ('year' and 'source') + :param args: dictionary, arguments specified when running generateflowbyactivity.py + generateflowbyactivity.py ('year' and 'source') :return: list, urls to call, concat, parse, format into Flow-By-Activity format """ diff --git a/flowsa/data_source_scripts/BLS_QCEW.py b/flowsa/data_source_scripts/BLS_QCEW.py index c4576fb96..3075fe27d 100644 --- a/flowsa/data_source_scripts/BLS_QCEW.py +++ b/flowsa/data_source_scripts/BLS_QCEW.py @@ -25,15 +25,15 @@ def BLS_QCEW_URL_helper(*, build_url, year, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which data is obtained. :param build_url: string, base url :param config: dictionary, items in FBA method yaml - :param args: dictionary, arguments specified when running flowbyactivity.py - flowbyactivity.py ('year' and 'source') + :param args: dictionary, arguments specified when running generateflowbyactivity.py + generateflowbyactivity.py ('year' and 'source') :return: list, urls to call, concat, parse, format into Flow-By-Activity format """ @@ -76,7 +76,7 @@ def bls_qcew_parse(*, df_list, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications diff --git a/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py b/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py index b9cfad387..bb9b0b68b 100644 --- a/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py +++ b/flowsa/data_source_scripts/CalRecycle_WasteCharacterization.py @@ -62,7 +62,7 @@ def calR_parse(*, year, **_): """ Combine, parse, and format the provided dataframes :param dataframe_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications diff --git a/flowsa/data_source_scripts/Census_ASM.py b/flowsa/data_source_scripts/Census_ASM.py index cafd20d8a..564896b7d 100644 --- a/flowsa/data_source_scripts/Census_ASM.py +++ b/flowsa/data_source_scripts/Census_ASM.py @@ -14,7 +14,7 @@ def asm_URL_helper(*, build_url, year, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which data diff --git a/flowsa/data_source_scripts/Census_CBP.py b/flowsa/data_source_scripts/Census_CBP.py index 16f06f052..006f21e86 100644 --- a/flowsa/data_source_scripts/Census_CBP.py +++ b/flowsa/data_source_scripts/Census_CBP.py @@ -19,7 +19,7 @@ def Census_CBP_URL_helper(*, build_url, year, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which data diff --git a/flowsa/data_source_scripts/Census_PEP_Population.py b/flowsa/data_source_scripts/Census_PEP_Population.py index 4f1cf9f30..d06b7b4c3 100644 --- a/flowsa/data_source_scripts/Census_PEP_Population.py +++ b/flowsa/data_source_scripts/Census_PEP_Population.py @@ -15,7 +15,7 @@ def Census_pop_URL_helper(*, build_url, year, config, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which @@ -113,7 +113,7 @@ def census_pop_parse(*, df_list, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications diff --git a/flowsa/data_source_scripts/Census_QWI.py b/flowsa/data_source_scripts/Census_QWI.py index c9184851d..3adddffbd 100644 --- a/flowsa/data_source_scripts/Census_QWI.py +++ b/flowsa/data_source_scripts/Census_QWI.py @@ -21,15 +21,15 @@ def census_qwi_url_helper(*, build_url, year, config, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which data is obtained. :param build_url: string, base url :param config: dictionary, items in FBA method yaml - :param args: dictionary, arguments specified when running flowbyactivity.py - flowbyactivity.py ('year' and 'source') + :param args: dictionary, arguments specified when running generateflowbyactivity.py + generateflowbyactivity.py ('year' and 'source') :return: list, urls to call, concat, parse, format into Flow-By-Activity format """ @@ -81,7 +81,7 @@ def census_qwi_parse(*, df_list, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications diff --git a/flowsa/data_source_scripts/Census_VIP.py b/flowsa/data_source_scripts/Census_VIP.py index a40e7a66c..8b3128ce4 100644 --- a/flowsa/data_source_scripts/Census_VIP.py +++ b/flowsa/data_source_scripts/Census_VIP.py @@ -54,7 +54,7 @@ def census_vip_parse(*, df_list, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications diff --git a/flowsa/data_source_scripts/EIA_AEO.py b/flowsa/data_source_scripts/EIA_AEO.py index 2c192dbaf..e47a75d8f 100644 --- a/flowsa/data_source_scripts/EIA_AEO.py +++ b/flowsa/data_source_scripts/EIA_AEO.py @@ -19,7 +19,7 @@ def eia_aeo_url_helper(*, build_url, year, config, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which data is diff --git a/flowsa/data_source_scripts/EIA_CBECS_Land.py b/flowsa/data_source_scripts/EIA_CBECS_Land.py index 75b238355..6f6fd6a63 100644 --- a/flowsa/data_source_scripts/EIA_CBECS_Land.py +++ b/flowsa/data_source_scripts/EIA_CBECS_Land.py @@ -21,7 +21,7 @@ def eia_cbecs_land_URL_helper(*, build_url, config, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which data is diff --git a/flowsa/data_source_scripts/EIA_CBECS_Water.py b/flowsa/data_source_scripts/EIA_CBECS_Water.py index d656af095..603530161 100644 --- a/flowsa/data_source_scripts/EIA_CBECS_Water.py +++ b/flowsa/data_source_scripts/EIA_CBECS_Water.py @@ -39,7 +39,7 @@ def eia_cbecs_water_parse(*, df_list, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications diff --git a/flowsa/data_source_scripts/EIA_MECS.py b/flowsa/data_source_scripts/EIA_MECS.py index d4eb0f8b0..d110e6701 100644 --- a/flowsa/data_source_scripts/EIA_MECS.py +++ b/flowsa/data_source_scripts/EIA_MECS.py @@ -23,15 +23,15 @@ def eia_mecs_URL_helper(*, build_url, config, year, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which data is obtained. :param build_url: string, base url :param config: dictionary, items in FBA method yaml - :param args: dictionary, arguments specified when running flowbyactivity.py - flowbyactivity.py ('year' and 'source') + :param args: dictionary, arguments specified when running generateflowbyactivity.py + generateflowbyactivity.py ('year' and 'source') :return: list, urls to call, concat, parse, format into Flow-By-Activity format """ @@ -62,7 +62,7 @@ def eia_mecs_land_call(*, resp, year, **_): :param url: string, url :param resp: df, response from url call :param args: dictionary, arguments specified when running - flowbyactivity.py ('year' and 'source') + generateflowbyactivity.py ('year' and 'source') :return: pandas dataframe of original source data """ # Convert response to dataframe diff --git a/flowsa/data_source_scripts/EIA_MER.py b/flowsa/data_source_scripts/EIA_MER.py index dd9118587..a8bd88d5d 100644 --- a/flowsa/data_source_scripts/EIA_MER.py +++ b/flowsa/data_source_scripts/EIA_MER.py @@ -16,7 +16,7 @@ def eia_mer_url_helper(*, build_url, config, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which @@ -92,7 +92,7 @@ def eia_mer_parse(*, df_list, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications diff --git a/flowsa/data_source_scripts/EIA_SEDS.py b/flowsa/data_source_scripts/EIA_SEDS.py index 2149ce7f2..b10c9e622 100644 --- a/flowsa/data_source_scripts/EIA_SEDS.py +++ b/flowsa/data_source_scripts/EIA_SEDS.py @@ -19,7 +19,7 @@ def eia_seds_url_helper(*, build_url, config, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which @@ -57,7 +57,7 @@ def eia_seds_parse(*, df_list, year, config, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications diff --git a/flowsa/data_source_scripts/EPA_CDDPath.py b/flowsa/data_source_scripts/EPA_CDDPath.py index b401da37c..56ff96262 100644 --- a/flowsa/data_source_scripts/EPA_CDDPath.py +++ b/flowsa/data_source_scripts/EPA_CDDPath.py @@ -84,7 +84,7 @@ def epa_cddpath_parse(*, df_list, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications diff --git a/flowsa/data_source_scripts/EPA_EQUATES.py b/flowsa/data_source_scripts/EPA_EQUATES.py index 738326e36..d9bbd1c19 100644 --- a/flowsa/data_source_scripts/EPA_EQUATES.py +++ b/flowsa/data_source_scripts/EPA_EQUATES.py @@ -20,15 +20,15 @@ def equates_url_helper(*, build_url, year, config, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which data is obtained. :param build_url: string, base url :param config: dictionary, items in FBA method yaml - :param args: dictionary, arguments specified when running flowbyactivity.py - flowbyactivity.py ('year' and 'source') + :param args: dictionary, arguments specified when running generateflowbyactivity.py + generateflowbyactivity.py ('year' and 'source') :return: list, urls to call, concat, parse, format into Flow-By-Activity format """ @@ -59,7 +59,7 @@ def equates_parse(*, df_list, source, year, config, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications diff --git a/flowsa/data_source_scripts/EPA_FactsAndFigures.py b/flowsa/data_source_scripts/EPA_FactsAndFigures.py index 955caa0e3..7ca4368ee 100644 --- a/flowsa/data_source_scripts/EPA_FactsAndFigures.py +++ b/flowsa/data_source_scripts/EPA_FactsAndFigures.py @@ -21,7 +21,7 @@ def ff_call(*, resp, year, **_): :param url: string, url :param resp: df, response from url call :param args: dictionary, arguments specified when running - flowbyactivity.py ('year' and 'source') + generateflowbyactivity.py ('year' and 'source') :return: pandas dataframe of original source data """ diff --git a/flowsa/data_source_scripts/EPA_GHGI.py b/flowsa/data_source_scripts/EPA_GHGI.py index be75efdbb..73e378a28 100644 --- a/flowsa/data_source_scripts/EPA_GHGI.py +++ b/flowsa/data_source_scripts/EPA_GHGI.py @@ -47,7 +47,7 @@ def ghg_url_helper(*, build_url, config, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which data is diff --git a/flowsa/data_source_scripts/EPA_NEI.py b/flowsa/data_source_scripts/EPA_NEI.py index fdce41fd0..9f7c71dba 100644 --- a/flowsa/data_source_scripts/EPA_NEI.py +++ b/flowsa/data_source_scripts/EPA_NEI.py @@ -19,7 +19,7 @@ def epa_nei_url_helper(*, build_url, year, config, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which data is @@ -50,7 +50,7 @@ def epa_nei_call(*, resp, **_): :param _1: string, url (unused) :param resp: df, response from url call :param _2: dictionary, arguments specified when running - flowbyactivity.py ('year' and 'source') (unused) + generateflowbyactivity.py ('year' and 'source') (unused) :return: pandas dataframe of original source data """ with ZipFile(io.BytesIO(resp.content)) as z: diff --git a/flowsa/data_source_scripts/EPA_NI.py b/flowsa/data_source_scripts/EPA_NI.py index 853131028..199ac558c 100644 --- a/flowsa/data_source_scripts/EPA_NI.py +++ b/flowsa/data_source_scripts/EPA_NI.py @@ -95,15 +95,15 @@ def name_and_unit_split(df_legend): def ni_url_helper(*, build_url, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which data is obtained. :param build_url: string, base url :param config: dictionary, items in FBA method yaml - :param args: dictionary, arguments specified when running flowbyactivity.py - flowbyactivity.py ('year' and 'source') + :param args: dictionary, arguments specified when running generateflowbyactivity.py + generateflowbyactivity.py ('year' and 'source') :return: list, urls to call, concat, parse, format into Flow-By-Activity format """ @@ -118,7 +118,7 @@ def ni_call(*, resp, year, **_): :param url: string, url :param resp: df, response from url call :param args: dictionary, arguments specified when running - flowbyactivity.py ('year' and 'source') + generateflowbyactivity.py ('year' and 'source') :return: pandas dataframe of original source data """ df_legend = pd.io.excel.read_excel(io.BytesIO(resp.content), @@ -161,7 +161,7 @@ def ni_parse(*, df_list, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications diff --git a/flowsa/data_source_scripts/EPA_PI.py b/flowsa/data_source_scripts/EPA_PI.py index 8d09aa94e..ccc46f889 100644 --- a/flowsa/data_source_scripts/EPA_PI.py +++ b/flowsa/data_source_scripts/EPA_PI.py @@ -75,7 +75,7 @@ def name_and_unit_split(df_legend): def pi_url_helper(*, build_url, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which data is @@ -163,7 +163,7 @@ def pi_parse(*, df_list, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications diff --git a/flowsa/data_source_scripts/EPA_REI.py b/flowsa/data_source_scripts/EPA_REI.py index 5bf365038..c204f1b42 100644 --- a/flowsa/data_source_scripts/EPA_REI.py +++ b/flowsa/data_source_scripts/EPA_REI.py @@ -12,7 +12,7 @@ def rei_url_helper(*, build_url, config, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which data is @@ -39,7 +39,7 @@ def rei_call(*, url, **_): :param url: string, url :param resp: df, response from url call :param args: dictionary, arguments specified when running - flowbyactivity.py ('year' and 'source') + generateflowbyactivity.py ('year' and 'source') :return: pandas dataframe of original source data """ df = pd.read_csv(url) diff --git a/flowsa/data_source_scripts/EPA_WARMer.py b/flowsa/data_source_scripts/EPA_WARMer.py index afc62fb14..581b17503 100644 --- a/flowsa/data_source_scripts/EPA_WARMer.py +++ b/flowsa/data_source_scripts/EPA_WARMer.py @@ -14,7 +14,7 @@ def warmer_call(*, url, **_): :param url: string, url :param resp: df, response from url call :param args: dictionary, arguments specified when running - flowbyactivity.py ('year' and 'source') + generateflowbyactivity.py ('year' and 'source') :return: pandas dataframe of original source data """ df = pd.read_csv(url) diff --git a/flowsa/data_source_scripts/EPA_WFR.py b/flowsa/data_source_scripts/EPA_WFR.py index 38de611e3..80c3700bf 100644 --- a/flowsa/data_source_scripts/EPA_WFR.py +++ b/flowsa/data_source_scripts/EPA_WFR.py @@ -22,7 +22,7 @@ def epa_wfr_call(*, resp, **_): :param url: string, url :param resp: df, response from url call :param args: dictionary, arguments specified when running - flowbyactivity.py ('year' and 'source') + generateflowbyactivity.py ('year' and 'source') :return: pandas dataframe of original source data """ result_list = [] diff --git a/flowsa/data_source_scripts/NETL_EIA_PlantWater.py b/flowsa/data_source_scripts/NETL_EIA_PlantWater.py index c86919cab..cd031a8fd 100644 --- a/flowsa/data_source_scripts/NETL_EIA_PlantWater.py +++ b/flowsa/data_source_scripts/NETL_EIA_PlantWater.py @@ -18,7 +18,7 @@ def netl_eia_parse(*, source, year, **_): """ Combine, parse, and format the provided dataframes :param dataframe_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications diff --git a/flowsa/data_source_scripts/StatCan_GDP.py b/flowsa/data_source_scripts/StatCan_GDP.py index 5befe0098..fecd2f2b0 100644 --- a/flowsa/data_source_scripts/StatCan_GDP.py +++ b/flowsa/data_source_scripts/StatCan_GDP.py @@ -22,7 +22,7 @@ def sc_gdp_call(*, resp, **_): :param url: string, url :param resp: df, response from url call :param args: dictionary, arguments specified when running - flowbyactivity.py ('year' and 'source') + generateflowbyactivity.py ('year' and 'source') :return: pandas dataframe of original source data """ # Convert response to dataframe @@ -41,7 +41,7 @@ def sc_gdp_parse(*, df_list, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications diff --git a/flowsa/data_source_scripts/USDA_ACUP.py b/flowsa/data_source_scripts/USDA_ACUP.py index 3f0bf9629..75627615e 100644 --- a/flowsa/data_source_scripts/USDA_ACUP.py +++ b/flowsa/data_source_scripts/USDA_ACUP.py @@ -14,15 +14,15 @@ def acup_url_helper(*, build_url, config, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which data is obtained. :param build_url: string, base url :param config: dictionary, items in FBA method yaml - :param args: dictionary, arguments specified when running flowbyactivity.py - flowbyactivity.py ('year' and 'source') + :param args: dictionary, arguments specified when running generateflowbyactivity.py + generateflowbyactivity.py ('year' and 'source') :return: list, urls to call, concat, parse, format into Flow-By-Activity format """ @@ -57,7 +57,7 @@ def acup_parse(*, df_list, source, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications diff --git a/flowsa/data_source_scripts/USDA_CoA_Cropland.py b/flowsa/data_source_scripts/USDA_CoA_Cropland.py index 6cd841213..fb7a23ea6 100644 --- a/flowsa/data_source_scripts/USDA_CoA_Cropland.py +++ b/flowsa/data_source_scripts/USDA_CoA_Cropland.py @@ -16,7 +16,7 @@ def CoA_Cropland_URL_helper(*, build_url, config, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which data is @@ -80,7 +80,7 @@ def coa_cropland_call(*, resp, **_): :param url: string, url :param resp: df, response from url call :param args: dictionary, arguments specified when running - flowbyactivity.py ('year' and 'source') + generateflowbyactivity.py ('year' and 'source') :return: pandas dataframe of original source data """ cropland_json = json.loads(resp.text) @@ -92,7 +92,7 @@ def coa_cropland_parse(*, df_list, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications diff --git a/flowsa/data_source_scripts/USDA_CoA_Cropland_NAICS.py b/flowsa/data_source_scripts/USDA_CoA_Cropland_NAICS.py index bd6d475a2..b53f2df3e 100644 --- a/flowsa/data_source_scripts/USDA_CoA_Cropland_NAICS.py +++ b/flowsa/data_source_scripts/USDA_CoA_Cropland_NAICS.py @@ -17,7 +17,7 @@ def CoA_Cropland_NAICS_URL_helper(*, build_url, config, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which data is diff --git a/flowsa/data_source_scripts/USDA_CoA_Livestock.py b/flowsa/data_source_scripts/USDA_CoA_Livestock.py index c53c0f179..b11580f6c 100644 --- a/flowsa/data_source_scripts/USDA_CoA_Livestock.py +++ b/flowsa/data_source_scripts/USDA_CoA_Livestock.py @@ -15,7 +15,7 @@ def CoA_Livestock_URL_helper(*, build_url, config, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which data is @@ -57,7 +57,7 @@ def coa_livestock_call(*, resp, **_): :param url: string, url :param resp: df, response from url call :param args: dictionary, arguments specified when running - flowbyactivity.py ('year' and 'source') + generateflowbyactivity.py ('year' and 'source') :return: pandas dataframe of original source data """ livestock_json = json.loads(resp.text) @@ -70,7 +70,7 @@ def coa_livestock_parse(*, df_list, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications diff --git a/flowsa/data_source_scripts/USDA_ERS_FIWS.py b/flowsa/data_source_scripts/USDA_ERS_FIWS.py index b6f6f1544..10cc5ba2d 100644 --- a/flowsa/data_source_scripts/USDA_ERS_FIWS.py +++ b/flowsa/data_source_scripts/USDA_ERS_FIWS.py @@ -35,7 +35,7 @@ def fiws_parse(*, df_list, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications diff --git a/flowsa/data_source_scripts/USDA_ERS_MLU.py b/flowsa/data_source_scripts/USDA_ERS_MLU.py index edc89c9ed..9cb98db2e 100644 --- a/flowsa/data_source_scripts/USDA_ERS_MLU.py +++ b/flowsa/data_source_scripts/USDA_ERS_MLU.py @@ -42,7 +42,7 @@ def mlu_parse(*, df_list, source, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications diff --git a/flowsa/data_source_scripts/USDA_IWMS.py b/flowsa/data_source_scripts/USDA_IWMS.py index 58aefebfa..4ba7bf07e 100644 --- a/flowsa/data_source_scripts/USDA_IWMS.py +++ b/flowsa/data_source_scripts/USDA_IWMS.py @@ -20,7 +20,7 @@ def iwms_url_helper(*, build_url, config, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which data is @@ -58,7 +58,7 @@ def iwms_parse(*, df_list, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications diff --git a/flowsa/data_source_scripts/USGS_MYB.py b/flowsa/data_source_scripts/USGS_MYB.py index 0c53976cc..e0b850b82 100644 --- a/flowsa/data_source_scripts/USGS_MYB.py +++ b/flowsa/data_source_scripts/USGS_MYB.py @@ -135,15 +135,15 @@ def usgs_myb_remove_digits(value_string): def usgs_myb_url_helper(*, build_url, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which data is obtained. :param build_url: string, base url :param config: dictionary, items in FBA method yaml - :param args: dictionary, arguments specified when running flowbyactivity.py - flowbyactivity.py ('year' and 'source') + :param args: dictionary, arguments specified when running generateflowbyactivity.py + generateflowbyactivity.py ('year' and 'source') :return: list, urls to call, concat, parse, format into Flow-By-Activity format """ @@ -236,7 +236,7 @@ def usgs_barite_call(*, resp, year, **_): :param url: string, url :param resp: df, response from url call :param args: dictionary, arguments specified when running - flowbyactivity.py ('year' and 'source') + generateflowbyactivity.py ('year' and 'source') :return: pandas dataframe of original source data """ df_raw_data = pd.io.excel.read_excel( @@ -263,7 +263,7 @@ def usgs_barite_parse(*, df_list, source, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications @@ -344,7 +344,7 @@ def usgs_bauxite_parse(*, df_list, source, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications @@ -395,7 +395,7 @@ def usgs_beryllium_call(*, resp, year, **_): :param url: string, url :param resp: df, response from url call :param args: dictionary, arguments specified when running - flowbyactivity.py ('year' and 'source') + generateflowbyactivity.py ('year' and 'source') :return: pandas dataframe of original source data """ df_raw_data = pd.io.excel.read_excel(io.BytesIO(resp.content), @@ -444,7 +444,7 @@ def usgs_beryllium_parse(*, df_list, source, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications @@ -490,7 +490,7 @@ def usgs_boron_call(*, resp, year, **_): :param url: string, url :param resp: df, response from url call :param args: dictionary, arguments specified when running - flowbyactivity.py ('year' and 'source') + generateflowbyactivity.py ('year' and 'source') :return: pandas dataframe of original source data """ df_raw_data = pd.io.excel.read_excel(io.BytesIO(resp.content), @@ -537,7 +537,7 @@ def usgs_boron_parse(*, df_list, source, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications @@ -593,7 +593,7 @@ def usgs_chromium_call(*, resp, year, **_): :param url: string, url :param resp: df, response from url call :param args: dictionary, arguments specified when running - flowbyactivity.py ('year' and 'source') + generateflowbyactivity.py ('year' and 'source') :return: pandas dataframe of original source data """ df_raw_data = pd.io.excel.read_excel(io.BytesIO(resp.content), @@ -624,7 +624,7 @@ def usgs_chromium_parse(*, df_list, source, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications @@ -672,7 +672,7 @@ def usgs_clay_call(*, resp, year, **_): :param url: string, url :param resp: df, response from url call :param args: dictionary, arguments specified when running - flowbyactivity.py ('year' and 'source') + generateflowbyactivity.py ('year' and 'source') :return: pandas dataframe of original source data """ df_raw_data_ball = pd.io.excel.read_excel(io.BytesIO(resp.content), @@ -786,7 +786,7 @@ def usgs_clay_parse(*, df_list, source, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications @@ -844,7 +844,7 @@ def usgs_cobalt_call(*, resp, year, **_): :param url: string, url :param resp: df, response from url call :param args: dictionary, arguments specified when running - flowbyactivity.py ('year' and 'source') + generateflowbyactivity.py ('year' and 'source') :return: pandas dataframe of original source data """ df_raw_data = pd.io.excel.read_excel(io.BytesIO(resp.content), @@ -892,7 +892,7 @@ def usgs_cobalt_parse(*, df_list, source, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications @@ -985,7 +985,7 @@ def usgs_copper_parse(*, df_list, source, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications @@ -1149,7 +1149,7 @@ def usgs_feldspar_parse(*, df_list, source, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications @@ -1277,7 +1277,7 @@ def usgs_fluorspar_parse(*, df_list, source, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications @@ -1336,7 +1336,7 @@ def usgs_gallium_call(*, resp, year, **_): :param url: string, url :param resp: df, response from url call :param args: dictionary, arguments specified when running - flowbyactivity.py ('year' and 'source') + generateflowbyactivity.py ('year' and 'source') :return: pandas dataframe of original source data """ df_raw_data = pd.io.excel.read_excel(io.BytesIO(resp.content), @@ -1507,7 +1507,7 @@ def usgs_gold_call(*, resp, year, **_): :param url: string, url :param resp: df, response from url call :param args: dictionary, arguments specified when running - flowbyactivity.py ('year' and 'source') + generateflowbyactivity.py ('year' and 'source') :return: pandas dataframe of original source data """ df_raw_data = pd.io.excel.read_excel(io.BytesIO(resp.content), @@ -1658,7 +1658,7 @@ def usgs_gypsum_call(*, resp, year, **_): :param url: string, url :param resp: df, response from url call :param args: dictionary, arguments specified when running - flowbyactivity.py ('year' and 'source') + generateflowbyactivity.py ('year' and 'source') :return: pandas dataframe of original source data """ df_raw_data_one = pd.io.excel.read_excel(io.BytesIO(resp.content), @@ -1742,7 +1742,7 @@ def usgs_iodine_call(*, resp, year, **_): :param url: string, url :param resp: df, response from url call :param args: dictionary, arguments specified when running - flowbyactivity.py ('year' and 'source') + generateflowbyactivity.py ('year' and 'source') :return: pandas dataframe of original source data """ df_raw_data = pd.io.excel.read_excel(io.BytesIO(resp.content), @@ -1926,7 +1926,7 @@ def usgs_kyanite_parse(*, df_list, source, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications @@ -1968,7 +1968,7 @@ def usgs_kyanite_parse(*, df_list, source, year, **_): def usgs_lead_url_helper(*, year, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which data is @@ -2396,7 +2396,7 @@ def usgs_ma_call(*, resp, year, **_): :param url: string, url :param resp: df, response from url call :param args: dictionary, arguments specified when running - flowbyactivity.py ('year' and 'source') + generateflowbyactivity.py ('year' and 'source') :return: pandas dataframe of original source data """ df_raw_data = pd.io.excel.read_excel(io.BytesIO(resp.content), @@ -2434,7 +2434,7 @@ def usgs_ma_parse(*, df_list, source, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications @@ -3781,7 +3781,7 @@ def description(value, code): def soda_url_helper(*, build_url, config, year, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which data is @@ -3863,7 +3863,7 @@ def soda_parse(*, df_list, source, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications @@ -4272,7 +4272,7 @@ def usgs_titanium_call(*, resp, year, **_): :param url: string, url :param resp: df, response from url call :param args: dictionary, arguments specified when running - flowbyactivity.py ('year' and 'source') + generateflowbyactivity.py ('year' and 'source') :return: pandas dataframe of original source data """ df_raw_data = pd.io.excel.read_excel(io.BytesIO(resp.content), @@ -4313,7 +4313,7 @@ def usgs_titanium_parse(*, df_list, source, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications @@ -4476,7 +4476,7 @@ def usgs_vermiculite_parse(*, df_list, source, year, **_): """ Combine, parse, and format the provided dataframes :param df_list: list of dataframes to concat and format - :param args: dictionary, used to run flowbyactivity.py + :param args: dictionary, used to run generateflowbyactivity.py ('year' and 'source') :return: df, parsed and partially formatted to flowbyactivity specifications diff --git a/flowsa/data_source_scripts/USGS_NWIS_WU.py b/flowsa/data_source_scripts/USGS_NWIS_WU.py index fb6349a53..6acda2146 100644 --- a/flowsa/data_source_scripts/USGS_NWIS_WU.py +++ b/flowsa/data_source_scripts/USGS_NWIS_WU.py @@ -20,7 +20,7 @@ def usgs_URL_helper(*, build_url, config, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which data is diff --git a/flowsa/data_source_scripts/USGS_SPARROW.py b/flowsa/data_source_scripts/USGS_SPARROW.py index b8d7142d8..dbbd0f8ce 100644 --- a/flowsa/data_source_scripts/USGS_SPARROW.py +++ b/flowsa/data_source_scripts/USGS_SPARROW.py @@ -104,7 +104,7 @@ def name_replace(df_legend, df_raw): def sparrow_url_helper(*, build_url, config, **_): """ - This helper function uses the "build_url" input from flowbyactivity.py, + This helper function uses the "build_url" input from generateflowbyactivity.py, which is a base url for data imports that requires parts of the url text string to be replaced with info specific to the data year. This function does not parse the data, only modifies the urls from which data is diff --git a/flowsa/flowbyactivity.py b/flowsa/generateflowbyactivity.py similarity index 99% rename from flowsa/flowbyactivity.py rename to flowsa/generateflowbyactivity.py index 56ace7c99..aa568c2d9 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/generateflowbyactivity.py @@ -1,4 +1,4 @@ -# flowbyactivity.py (flowsa) +# generateflowbyactivity.py (flowsa) # !/usr/bin/env python3 # coding=utf-8 """ diff --git a/flowsa/methods/flowbyactivitymethods/USDA_ACUP_Fertilizer.yaml b/flowsa/methods/flowbyactivitymethods/USDA_ACUP_Fertilizer.yaml index 2d3c70e1e..85d25ce0b 100644 --- a/flowsa/methods/flowbyactivitymethods/USDA_ACUP_Fertilizer.yaml +++ b/flowsa/methods/flowbyactivitymethods/USDA_ACUP_Fertilizer.yaml @@ -1,7 +1,7 @@ author: US Department of Agriculture source_name_bib: Agricultural Chemical Use Program citable_url: https://www.nass.usda.gov/Surveys/Guide_to_NASS_Surveys/Chemical_Use/ -date_generated: '2021-06-24' # updated automatically when flowbyactivity.py is run +date_generated: '2021-06-24' # updated automatically when generateflowbyactivity.py is run bib_id: USDA_ACUP_Fert api_name: USDA_Quickstats api_key_required: true diff --git a/flowsa/methods/flowbyactivitymethods/USDA_ACUP_Pesticide.yaml b/flowsa/methods/flowbyactivitymethods/USDA_ACUP_Pesticide.yaml index 91b055188..a73ec0e93 100644 --- a/flowsa/methods/flowbyactivitymethods/USDA_ACUP_Pesticide.yaml +++ b/flowsa/methods/flowbyactivitymethods/USDA_ACUP_Pesticide.yaml @@ -1,7 +1,7 @@ author: US Department of Agriculture source_name_bib: Agricultural Chemical Use Program citable_url: https://www.nass.usda.gov/Surveys/Guide_to_NASS_Surveys/Chemical_Use/ -date_generated: '2021-06-24' # updated automatically when flowbyactivity.py is run +date_generated: '2021-06-24' # updated automatically when generateflowbyactivity.py is run bib_id: USDA_ACUP_Pest api_name: USDA_Quickstats api_key_required: true From 29f12132752acc6eec151f3867d0df1a85f0a322 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 24 Aug 2023 17:08:22 -0600 Subject: [PATCH 0819/1127] move get_catalog_info() to common.py --- flowsa/common.py | 10 ++++++++++ flowsa/flowby.py | 18 ++++-------------- flowsa/flowbyclean.py | 4 ++-- flowsa/metadata.py | 3 +-- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/flowsa/common.py b/flowsa/common.py index cea996701..1a8d82e26 100644 --- a/flowsa/common.py +++ b/flowsa/common.py @@ -298,3 +298,13 @@ def check_method_status(): with open(yaml_path, 'r') as f: method_status = yaml.safe_load(f) return method_status + + +def get_catalog_info(source_name: str) -> dict: + ''' + Retrieves the information on a given source from source_catalog.yaml. + Replaces various pieces of code that load the source_catalog yaml. + ''' + source_catalog = load_yaml_dict('source_catalog') + source_name = return_true_source_catalog_name(source_name) + return source_catalog.get(source_name, {}) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 59b9b0d9f..9a49128ce 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1,12 +1,13 @@ -from typing import List, Literal, TypeVar, Union +from typing import List, Literal, TypeVar import pandas as pd from pandas import ExcelWriter import numpy as np from functools import partial, reduce from copy import deepcopy from flowsa import (common, settings, metadata, sectormapping, - literature_values, flowbyactivity, flowsa_yaml, - validation, geo, naics, exceptions, schema) + literature_values, flowsa_yaml, validation, geo, naics, + exceptions, schema) +from flowsa.common import get_catalog_info from flowsa.flowsa_log import log, vlog, reset_log_file import esupy.processed_data_mgmt import esupy.dqi @@ -23,17 +24,6 @@ # ^^^ Replaces schema.py -# TODO: Move this to common.py -def get_catalog_info(source_name: str) -> dict: - ''' - Retrieves the information on a given source from source_catalog.yaml. - Replaces various pieces of code that load the source_catalog yaml. - ''' - source_catalog = common.load_yaml_dict('source_catalog') - source_name = common.return_true_source_catalog_name(source_name) - return source_catalog.get(source_name, {}) - - # TODO: Should this be in the flowsa __init__.py? def get_flowby_from_config( name: str, diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index 15f1c746d..66b498124 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -1,7 +1,7 @@ import numpy as np import pandas as pd -from flowsa.flowby import FlowBySector, FB, get_catalog_info, \ - get_flowby_from_config +from flowsa.flowby import FlowBySector, FB, get_flowby_from_config +from flowsa.common import get_catalog_info from flowsa.flowsa_log import log from flowsa import (geo, location, FlowByActivity) from flowsa.naics import map_source_sectors_to_more_aggregated_sectors diff --git a/flowsa/metadata.py b/flowsa/metadata.py index 51a4afb20..98fd82fd9 100644 --- a/flowsa/metadata.py +++ b/flowsa/metadata.py @@ -9,7 +9,7 @@ import pandas as pd from esupy.processed_data_mgmt import FileMeta, write_metadata_to_file, \ read_source_metadata -from flowsa.common import return_true_source_catalog_name +from flowsa.common import return_true_source_catalog_name, get_catalog_info from flowsa.flowsa_log import log from flowsa.settings import paths, PKG, PKG_VERSION_NUMBER, WRITE_FORMAT, \ GIT_HASH, GIT_HASH_LONG @@ -94,7 +94,6 @@ def return_fbs_method_data(source_name, config): """ from flowsa.data_source_scripts.stewiFBS import add_stewi_metadata,\ add_stewicombo_metadata - from flowsa.flowby import get_catalog_info # Create empty dictionary for storing meta data meta = {} From fb4d9691a95a3a30e17311267d048d016d0c5642 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 24 Aug 2023 17:24:36 -0600 Subject: [PATCH 0820/1127] split the code in flowby into scripts "flowby", "flowbyactivity", "flowbysector", "flowbyseries" --- flowsa/__init__.py | 3 +- flowsa/data_source_scripts/BLS_QCEW.py | 2 +- flowsa/data_source_scripts/BTS_Airlines.py | 3 +- flowsa/data_source_scripts/EIA_MECS.py | 2 +- flowsa/data_source_scripts/EPA_GHGI.py | 3 +- flowsa/data_source_scripts/EPA_NEI.py | 2 +- flowsa/data_source_scripts/EPA_REI.py | 2 +- flowsa/data_source_scripts/EPA_SIT.py | 2 +- flowsa/data_source_scripts/EPA_StateGHGI.py | 2 +- flowsa/data_source_scripts/EPA_WFR.py | 2 +- flowsa/data_source_scripts/USDA_ERS_MLU.py | 2 +- flowsa/data_source_scripts/USDA_IWMS.py | 3 +- flowsa/data_source_scripts/USGS_NWIS_WU.py | 2 +- flowsa/data_source_scripts/stewiFBS.py | 8 +- .../temp_data_source_functions.py | 2 +- flowsa/datavisualization.py | 3 +- flowsa/flowby.py | 1358 +---------------- flowsa/flowbyactivity.py | 881 +++++++++++ flowsa/flowbyclean.py | 5 +- flowsa/flowbysector.py | 327 ++++ flowsa/flowbyseries.py | 46 + flowsa/test_FBS_against_remote.py | 3 +- flowsa/test_single_FBS.py | 2 +- flowsa/validation.py | 2 +- 24 files changed, 1342 insertions(+), 1325 deletions(-) create mode 100644 flowsa/flowbyactivity.py create mode 100644 flowsa/flowbysector.py create mode 100644 flowsa/flowbyseries.py diff --git a/flowsa/__init__.py b/flowsa/__init__.py index 0a9bd2d61..2c3fd11c8 100644 --- a/flowsa/__init__.py +++ b/flowsa/__init__.py @@ -28,7 +28,8 @@ import flowsa.flowbyactivity from flowsa.bibliography import generate_fbs_bibliography from flowsa.datavisualization import FBSscatterplot -from .flowby import FlowByActivity, FlowBySector +from .flowbyactivity import FlowByActivity +from .flowbysector import FlowBySector def getFlowByActivity( diff --git a/flowsa/data_source_scripts/BLS_QCEW.py b/flowsa/data_source_scripts/BLS_QCEW.py index 3075fe27d..d2e1899a9 100644 --- a/flowsa/data_source_scripts/BLS_QCEW.py +++ b/flowsa/data_source_scripts/BLS_QCEW.py @@ -18,7 +18,7 @@ import numpy as np from flowsa.location import US_FIPS from flowsa.flowbyfunctions import assign_fips_location_system -from flowsa.flowby import FlowByActivity +from flowsa import FlowByActivity from flowsa.flowsa_log import log from flowsa.naics import industry_spec_key diff --git a/flowsa/data_source_scripts/BTS_Airlines.py b/flowsa/data_source_scripts/BTS_Airlines.py index bfb365643..2622c6c87 100644 --- a/flowsa/data_source_scripts/BTS_Airlines.py +++ b/flowsa/data_source_scripts/BTS_Airlines.py @@ -1,7 +1,6 @@ import pandas as pd import numpy as np -from flowsa.flowby import FlowByActivity -from flowsa import flowsa_yaml, settings +from flowsa import flowsa_yaml, settings, FlowByActivity def generate_fba(): diff --git a/flowsa/data_source_scripts/EIA_MECS.py b/flowsa/data_source_scripts/EIA_MECS.py index d110e6701..765dbb04a 100644 --- a/flowsa/data_source_scripts/EIA_MECS.py +++ b/flowsa/data_source_scripts/EIA_MECS.py @@ -14,7 +14,7 @@ from flowsa.location import US_FIPS, get_region_and_division_codes from flowsa.common import WITHDRAWN_KEYWORD from flowsa.flowsa_log import log -from flowsa.flowby import FlowByActivity +from flowsa import FlowByActivity from flowsa.flowbyclean import load_prepare_clean_source from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.data_source_scripts.EIA_CBECS_Land import \ diff --git a/flowsa/data_source_scripts/EPA_GHGI.py b/flowsa/data_source_scripts/EPA_GHGI.py index 73e378a28..dbf94041d 100644 --- a/flowsa/data_source_scripts/EPA_GHGI.py +++ b/flowsa/data_source_scripts/EPA_GHGI.py @@ -15,8 +15,7 @@ from flowsa.flowsa_log import log from flowsa.settings import externaldatapath from flowsa.schema import flow_by_activity_fields -from flowsa.flowby import FlowByActivity - +from flowsa import FlowByActivity SECTOR_DICT = {'Res.': 'Residential', 'Comm.': 'Commercial', diff --git a/flowsa/data_source_scripts/EPA_NEI.py b/flowsa/data_source_scripts/EPA_NEI.py index 9f7c71dba..0a613be45 100644 --- a/flowsa/data_source_scripts/EPA_NEI.py +++ b/flowsa/data_source_scripts/EPA_NEI.py @@ -12,7 +12,7 @@ import numpy as np from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.dataclean import standardize_units -from flowsa.flowby import FlowByActivity +from flowsa import FlowByActivity from flowsa.flowsa_log import log from flowsa.location import merge_urb_cnty_pct diff --git a/flowsa/data_source_scripts/EPA_REI.py b/flowsa/data_source_scripts/EPA_REI.py index c204f1b42..9b2e82350 100644 --- a/flowsa/data_source_scripts/EPA_REI.py +++ b/flowsa/data_source_scripts/EPA_REI.py @@ -7,7 +7,7 @@ import numpy as np from flowsa.location import US_FIPS from flowsa.flowbyfunctions import assign_fips_location_system -from flowsa.flowby import FlowBySector +from flowsa import FlowBySector def rei_url_helper(*, build_url, config, **_): diff --git a/flowsa/data_source_scripts/EPA_SIT.py b/flowsa/data_source_scripts/EPA_SIT.py index 43439af71..5cd3b2293 100644 --- a/flowsa/data_source_scripts/EPA_SIT.py +++ b/flowsa/data_source_scripts/EPA_SIT.py @@ -9,7 +9,7 @@ import pandas as pd import os from flowsa.settings import externaldatapath -from flowsa.flowby import FlowByActivity +from flowsa import FlowByActivity from flowsa.flowbyfunctions import assign_fips_location_system, \ load_fba_w_standardized_units from flowsa.flowsa_log import log diff --git a/flowsa/data_source_scripts/EPA_StateGHGI.py b/flowsa/data_source_scripts/EPA_StateGHGI.py index a42f0cefd..c4479781a 100644 --- a/flowsa/data_source_scripts/EPA_StateGHGI.py +++ b/flowsa/data_source_scripts/EPA_StateGHGI.py @@ -7,7 +7,7 @@ import pandas as pd import io from zipfile import ZipFile -from flowsa.flowby import FlowByActivity +from flowsa import FlowByActivity from flowsa.flowsa_log import log from flowsa.location import apply_county_FIPS from flowsa.flowbyfunctions import assign_fips_location_system diff --git a/flowsa/data_source_scripts/EPA_WFR.py b/flowsa/data_source_scripts/EPA_WFR.py index 80c3700bf..f5695827b 100644 --- a/flowsa/data_source_scripts/EPA_WFR.py +++ b/flowsa/data_source_scripts/EPA_WFR.py @@ -12,7 +12,7 @@ from tabula.io import read_pdf from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.location import US_FIPS -from flowsa.flowby import FlowByActivity +from flowsa import FlowByActivity def epa_wfr_call(*, resp, **_): diff --git a/flowsa/data_source_scripts/USDA_ERS_MLU.py b/flowsa/data_source_scripts/USDA_ERS_MLU.py index 9cb98db2e..8a068aef2 100644 --- a/flowsa/data_source_scripts/USDA_ERS_MLU.py +++ b/flowsa/data_source_scripts/USDA_ERS_MLU.py @@ -22,7 +22,7 @@ get_urban_land_use_for_airports, \ get_urban_land_use_for_railroads, get_open_space_fraction_of_urban_area from flowsa.validation import compare_df_units -from flowsa.flowby import FlowByActivity +from flowsa import FlowByActivity from flowsa.naics import industry_spec_key diff --git a/flowsa/data_source_scripts/USDA_IWMS.py b/flowsa/data_source_scripts/USDA_IWMS.py index 4ba7bf07e..92b75d0db 100644 --- a/flowsa/data_source_scripts/USDA_IWMS.py +++ b/flowsa/data_source_scripts/USDA_IWMS.py @@ -16,7 +16,8 @@ load_fba_w_standardized_units, filter_by_geoscale # from flowsa.data_source_scripts.USDA_CoA_Cropland import disaggregate_pastureland, \ # disaggregate_cropland -from flowsa.flowby import FlowByActivity +from flowsa import FlowByActivity + def iwms_url_helper(*, build_url, config, **_): """ diff --git a/flowsa/data_source_scripts/USGS_NWIS_WU.py b/flowsa/data_source_scripts/USGS_NWIS_WU.py index 6acda2146..8077889bc 100644 --- a/flowsa/data_source_scripts/USGS_NWIS_WU.py +++ b/flowsa/data_source_scripts/USGS_NWIS_WU.py @@ -15,7 +15,7 @@ from flowsa.flowsa_log import vlog from flowsa.validation import compare_df_units, \ calculate_flowamount_diff_between_dfs -from flowsa.flowby import FlowByActivity +from flowsa import FlowByActivity def usgs_URL_helper(*, build_url, config, **_): diff --git a/flowsa/data_source_scripts/stewiFBS.py b/flowsa/data_source_scripts/stewiFBS.py index c7bacf101..f1aaacf11 100644 --- a/flowsa/data_source_scripts/stewiFBS.py +++ b/flowsa/data_source_scripts/stewiFBS.py @@ -13,7 +13,9 @@ import pandas as pd import numpy as np from esupy.processed_data_mgmt import read_source_metadata -from flowsa.flowby import FlowBySector, FlowByActivity + +import flowsa.flowbysector +from flowsa import FlowBySector, FlowByActivity from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.flowsa_log import log from flowsa.location import apply_county_FIPS, update_geoscale @@ -357,5 +359,5 @@ def add_stewicombo_metadata(inventory_name): if __name__ == "__main__": import flowsa - fbs = flowsa.flowby.FlowBySector.generateFlowBySector('CRHW_national_2017') - fbs = flowsa.flowby.FlowBySector.generateFlowBySector('TRI_DMR_state_2017') + fbs = flowsa.flowbysector.FlowBySector.generateFlowBySector('CRHW_national_2017') + fbs = flowsa.flowbysector.FlowBySector.generateFlowBySector('TRI_DMR_state_2017') diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index 73c6880f3..f99543e63 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -1,5 +1,5 @@ from flowsa.data_source_scripts import EPA_GHGI as ghgi -from flowsa.flowby import FlowByActivity +from flowsa import FlowByActivity def clean_mecs_energy_fba_for_bea_summary(fba: FlowByActivity, **kwargs): diff --git a/flowsa/datavisualization.py b/flowsa/datavisualization.py index 8391573d8..911350fb2 100644 --- a/flowsa/datavisualization.py +++ b/flowsa/datavisualization.py @@ -12,6 +12,7 @@ import plotly.graph_objects as go from plotly.subplots import make_subplots import flowsa +import flowsa.flowbysector from flowsa.common import load_crosswalk # todo: need to update fxn to use new sector_aggregation - datavis not # currently working @@ -186,7 +187,7 @@ def stackedBarChart(df, for k, v in selection_fields.items(): df = df[df[k].str.startswith(tuple(v))] - df = flowsa.FlowBySector(df) + df = flowsa.flowbysector.FlowBySector(df) # agg sectors for data visualization df.config['industry_spec'] = industry_spec df = df.sector_aggregation() diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 9a49128ce..bd2e0704f 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1,17 +1,15 @@ from typing import List, Literal, TypeVar import pandas as pd -from pandas import ExcelWriter import numpy as np from functools import partial, reduce from copy import deepcopy -from flowsa import (common, settings, metadata, sectormapping, - literature_values, flowsa_yaml, validation, geo, naics, - exceptions, schema) +from flowsa import (settings, literature_values, flowsa_yaml, geo, schema, + FlowBySector, FlowByActivity) from flowsa.common import get_catalog_info -from flowsa.flowsa_log import log, vlog, reset_log_file +from flowsa.flowbyseries import _FlowBySeries +from flowsa.flowsa_log import log, vlog import esupy.processed_data_mgmt import esupy.dqi -import fedelemflowlist FB = TypeVar('FB', bound='_FlowBy') S = TypeVar('S', bound='_FlowBySeries') @@ -706,8 +704,8 @@ def attribute_flows_to_sectors( attributed_fb = fb.division_attribution(attribution_fbs) elif attribution_method == 'inheritance': - log.info(f'Directly attributing {self.full_name} to sectors, child ' - 'sectors inherit parent values.') + log.info(f'Directly attributing {self.full_name} to sectors, ' + f'child sectors inherit parent values.') attributed_fb = fb.copy() elif attribution_method == 'equal': @@ -788,7 +786,6 @@ def attribute_flows_to_sectors( return self - def activity_sets(self) -> List['FB']: ''' This function breaks up an FBA dataset into its activity sets, if its @@ -890,6 +887,59 @@ def load_prepare_attribution_source( return attribution_fbs + def harmonize_geoscale( + self: 'FB', + other: 'FlowBySector' + ) -> 'FlowByActivity': + + fb_geoscale = geo.scale.from_string(self.config['geoscale']) + other_geoscale = geo.scale.from_string(other.config['geoscale']) + + if other_geoscale < fb_geoscale: + log.info('Aggregating %s from %s to %s', other.full_name, + other_geoscale, fb_geoscale) + other = ( + other + .convert_fips_to_geoscale(fb_geoscale) + .aggregate_flowby() + ) + elif other_geoscale > fb_geoscale: + log.info('%s is %s, while %s is %s, so attributing %s to ' + '%s', other.full_name, other_geoscale, self.full_name, + fb_geoscale, other_geoscale, fb_geoscale) + self = ( + self + .assign(temp_location=self.Location) + .convert_fips_to_geoscale(other_geoscale, + column='temp_location') + ) + + fb = self.add_primary_secondary_columns('Sector') + + subset_cols = ['PrimarySector', 'Location', 'FlowAmount', 'Unit'] + groupby_cols = ['PrimarySector', 'Location', 'Unit'] + attribution_cols = self.config.get('attribute_on') + if attribution_cols is not None: + subset_cols = subset_cols + attribution_cols + groupby_cols = subset_cols + attribution_cols + fill_cols = self.config.get('fill_columns') + if fill_cols is not None: + subset_cols = subset_cols + [fill_cols] + groupby_cols = groupby_cols + [fill_cols] + # ensure no duplicates + subset_cols = list(set(subset_cols)) + groupby_cols = list(set(groupby_cols)) + + other = ( + other + .add_primary_secondary_columns('Sector') + [subset_cols] + .groupby(groupby_cols) + .agg('sum') + .reset_index() + ) + + return fb_geoscale, other_geoscale, fb, other def proportionally_attribute( self: 'FB', # flowbyactivity or flowbysector @@ -1030,8 +1080,6 @@ def proportionally_attribute( other.full_name ) - # todo: in rei we have negative flowamount_other numbers - add - # validation check, although neg numbers are expected fb = ( non_zero_denominator .assign(FlowAmount=lambda x: (x.FlowAmount @@ -1066,61 +1114,6 @@ def proportionally_attribute( .reset_index(drop=True) ) - def harmonize_geoscale( - self: 'FB', - other: 'FlowBySector' - ) -> 'FlowByActivity': - - fb_geoscale = geo.scale.from_string(self.config['geoscale']) - other_geoscale = geo.scale.from_string(other.config['geoscale']) - - if other_geoscale < fb_geoscale: - log.info('Aggregating %s from %s to %s', other.full_name, - other_geoscale, fb_geoscale) - other = ( - other - .convert_fips_to_geoscale(fb_geoscale) - .aggregate_flowby() - ) - elif other_geoscale > fb_geoscale: - log.info('%s is %s, while %s is %s, so attributing %s to ' - '%s', other.full_name, other_geoscale, self.full_name, - fb_geoscale, other_geoscale, fb_geoscale) - self = ( - self - .assign(temp_location=self.Location) - .convert_fips_to_geoscale(other_geoscale, - column='temp_location') - ) - - fb = self.add_primary_secondary_columns('Sector') - - subset_cols = ['PrimarySector', 'Location', 'FlowAmount', 'Unit'] - groupby_cols = ['PrimarySector', 'Location', 'Unit'] - attribution_cols = self.config.get('attribute_on') - if attribution_cols is not None: - subset_cols = subset_cols + attribution_cols - groupby_cols = subset_cols + attribution_cols - fill_cols = self.config.get('fill_columns') - if fill_cols is not None: - subset_cols = subset_cols + [fill_cols] - groupby_cols = groupby_cols + [fill_cols] - # ensure no duplicates - subset_cols = list(set(subset_cols)) - groupby_cols = list(set(groupby_cols)) - - other = ( - other - .add_primary_secondary_columns('Sector') - [subset_cols] - .groupby(groupby_cols) - .agg('sum') - .reset_index() - ) - - return fb_geoscale, other_geoscale, fb, other - - def multiplication_attribution( self: 'FB', other: 'FlowBySector' @@ -1213,7 +1206,6 @@ def multiplication_attribution( .reset_index(drop=True) ) - def division_attribution( self: 'FB', other: 'FlowBySector' @@ -1275,7 +1267,6 @@ def division_attribution( .reset_index(drop=True) ) - def add_primary_secondary_columns( self: FB, col_type: Literal['Activity', 'Sector'] @@ -1391,1234 +1382,3 @@ def astype(self: FB, *args, **kwargs) -> FB: fb = type(self)(df, add_missing_columns=False, **metadata) return fb - - -class FlowByActivity(_FlowBy): - _metadata = [*_FlowBy()._metadata] - - def __init__( - self, - data: pd.DataFrame or '_FlowBy' = None, - *args, - mapped: bool = False, - w_sector: bool = False, - **kwargs - ) -> None: - if isinstance(data, pd.DataFrame): - mapped = mapped or any( - [c in data.columns for c in flowby_config['_mapped_fields']] - ) - w_sector = w_sector or any( - [c in data.columns for c in flowby_config['_sector_fields']] - ) - - if mapped and w_sector: - fields = flowby_config['fba_mapped_w_sector_fields'] - elif mapped: - fields = flowby_config['fba_mapped_fields'] - elif w_sector: - fields = flowby_config['fba_w_sector_fields'] - else: - fields = flowby_config['fba_fields'] - - column_order = flowby_config['fba_column_order'] - else: - fields = None - column_order = None - - super().__init__(data, - fields=fields, - column_order=column_order, - *args, **kwargs) - - @property - def _constructor(self) -> 'FlowByActivity': - return FlowByActivity - - @property - def _constructor_sliced(self) -> '_FBASeries': - return _FBASeries - - @classmethod - def getFlowByActivity( - cls, - full_name: str, - year: int = None, - config: dict = None, - download_ok: bool = settings.DEFAULT_DOWNLOAD_IF_MISSING, - **kwargs - ) -> 'FlowByActivity': - """ - Loads stored data in the FlowByActivity format. If it is not - available, tries to download it from EPA's remote server (if - download_ok is True), or generate it. - :param datasource: str, the code of the datasource. - :param year: int, a year, e.g. 2012 - :param download_ok: bool, if True will attempt to load from - EPA remote server prior to generating - :kwargs: keyword arguments to pass to _getFlowBy(). Possible kwargs - include config. - :return: a FlowByActivity dataframe - """ - if year is None and isinstance(config, dict): - year = config.get('year') - - file_metadata = metadata.set_fb_meta( - full_name if year is None else f'{full_name}_{year}', - 'FlowByActivity' - ) - flowby_generator = partial( - flowbyactivity.main, - source=full_name, - year=year - ) - return super()._getFlowBy( - file_metadata=file_metadata, - download_ok=download_ok, - flowby_generator=flowby_generator, - output_path=settings.fbaoutputpath, - full_name=full_name, - config=config, - **kwargs - ) - - # TODO: probably only slight modification is needed to allow for material - # flow list mapping using this function as well. - def map_to_fedefl_list( - self: 'FlowByActivity', - drop_unmapped_rows: bool = False - ) -> 'FlowByActivity': - fba_merge_keys = [ - 'Flowable', - 'Unit', - 'Context' - ] - mapping_fields = [ - 'SourceListName', - 'SourceFlowName', - 'SourceFlowContext', - 'SourceUnit', - 'ConversionFactor', - 'TargetFlowName', - 'TargetFlowContext', - 'TargetUnit', - 'TargetFlowUUID' - ] - mapping_merge_keys = [ - 'SourceFlowName', - 'SourceUnit', - 'SourceFlowContext' - ] - merge_type = 'inner' if drop_unmapped_rows else 'left' - - mapping_subset = self.config.get('fedefl_mapping') - - log.info(f'Mapping flows in {self.full_name} to ' - f'{mapping_subset} in federal elementary flow list') - - # Check for use of multiple mapping files - # TODO this was handled in esupy originally - can we go back to that fxn? - if isinstance(mapping_subset, list): - fba_merge_keys.append('SourceName') - mapping_merge_keys.append('SourceListName') - - fba = ( - self - .assign(Flowable=self.FlowName, - Context=self.Compartment, - ) - .drop(columns=['FlowName', 'Compartment']) - ) - - mapping = ( - fedelemflowlist.get_flowmapping(mapping_subset)[mapping_fields] - .assign(ConversionFactor=lambda x: x.ConversionFactor.fillna(1)) - ) - if mapping.empty: - log.error('Elementary flow list entries for %s not found', - mapping_subset) - return FlowByActivity(self, mapped=True) - - mapped_fba = fba.merge(mapping, - how=merge_type, - left_on=fba_merge_keys, - right_on=mapping_merge_keys, - indicator='mapped') - - is_mappable = mapped_fba.TargetFlowName.notnull() - mapped_fba = ( - mapped_fba - .assign( - Flowable=mapped_fba.Flowable.mask( - is_mappable, mapped_fba.TargetFlowName), - Context=mapped_fba.Context.mask( - is_mappable, mapped_fba.TargetFlowContext), - Unit=mapped_fba.Unit.mask( - is_mappable, mapped_fba.TargetUnit), - FlowAmount=mapped_fba.FlowAmount.mask( - is_mappable, - mapped_fba.FlowAmount * mapped_fba.ConversionFactor), - FlowUUID=mapped_fba.TargetFlowUUID - ) - .drop(columns=mapping_fields) - ) - - if any(mapped_fba.mapped == 'both'): - log.info('Units standardized to %s by mapping to federal ' - 'elementary flow list', list(mapping.TargetUnit.unique())) - if any(mapped_fba.mapped == 'left_only'): - log.warning('Some units not standardized by mapping to federal ' - 'elementary flows list: %s', - list(mapped_fba - .query('mapped == "left_only"').Unit.unique())) - - return mapped_fba.drop(columns='mapped') - - # TODO: Can this be generalized to a _FlowBy method? - def convert_to_geoscale( - self: 'FlowByActivity', - target_geoscale: Literal['national', 'state', 'county', - geo.scale.NATIONAL, geo.scale.STATE, - geo.scale.COUNTY] = None - ) -> 'FlowByActivity': - ''' - Converts, by filtering or aggregating (or both), the given dataset to - the target geoscale. - - Rows from the calling FlowBy that correspond to a higher level (more - aggregated) geoscale than the target are dropped. Then, for each - combination of 'ActivityProducedBy' and 'ActivityConsumedBy', and for - each level at or below (less aggregated than) the target geoscale, - determine the highest level at which data is reported for each unit at - that scale (so if the level is 'state', find the highest level at which - data is reported for each state, for each activity combination). - Finally, use this information to identify the correct source scale - for each activity combination and regional unit (details below), then - filter or aggregate (or both) to convert the dataset so all rows are - at the target geoscale. - - For any region and activity combination, the correct source geoscale - is the highest (most aggregated) geoscale at or below the target - geoscale, for which data covering that region and activity combination - is reported. For example, if the target geoscale is 'national', - national level data should be used if available. If not, state level - data should be aggregated up if available. However, if some states - report county level data AND NOT state level data, then for those - states (and only those states) county level data should be aggregated - up. County level data from states that also report state level data - should, in this example, be ignored. - - :param target_geoscale: str or geo.scale constant, the geoscale to - convert the calling FlowBy data set to. Currently, this needs to be - one which corresponds to a FIPS level (that is, one of national, - state, or county) - :return: FlowBy data set, with rows filtered or aggregated to the - target geoscale. - ''' - if self.LocationSystem.eq('Census_Region').all(): - return self - target_geoscale = target_geoscale or self.config.get('geoscale') - if type(target_geoscale) == str: - target_geoscale = geo.scale.from_string(target_geoscale) - - geoscale_by_fips = pd.concat([ - (geo.filtered_fips(scale) - .assign(geoscale=scale, National='USA') - # ^^^ Need to have a column for each relevant scale - .rename(columns={'FIPS': 'Location'})) - # ^^^ (only FIPS for now) - for scale in [s for s in geo.scale if s.has_fips_level] - ]) - - geoscale_name_columns = [s.name.title() for s in geo.scale - if s.has_fips_level] - - log.info('Determining appropriate source geoscale for %s; ' - 'target geoscale is %s', - self.full_name, - target_geoscale.name.lower()) - - highest_reporting_level_by_geoscale = [ - (self - .merge(geoscale_by_fips, how='inner') - .query('geoscale <= @scale') - .groupby(['ActivityProducedBy', 'ActivityConsumedBy'] - + [s.name.title() for s in geo.scale - if s.has_fips_level and s >= scale], - dropna=False) - .agg({'geoscale': 'max'}) - .reset_index() - .rename(columns={ - 'geoscale': f'highest_reporting_level_by_{scale.name.title()}' - })) - for scale in geo.scale - if scale.has_fips_level and scale <= target_geoscale - ] - - # if an activity column is a mix of string and np.nan values but - # after subsetting, the column is all np.nan, then the column dtype is - # converted to float which causes an error when merging float col back - # with the original object dtype. So convert float cols back to object - for df in highest_reporting_level_by_geoscale: - for c in ['ActivityProducedBy', 'ActivityConsumedBy']: - if df[c].dtype == float: - df[c] = df[c].astype(object) - - fba_with_reporting_levels = reduce( - lambda x, y: x.merge(y, how='left'), - [self, geoscale_by_fips, *highest_reporting_level_by_geoscale] - ) - - reporting_level_columns = [ - f'highest_reporting_level_by_{s.name.title()}' - for s in geo.scale if s.has_fips_level and s <= target_geoscale - ] - - fba_at_source_geoscale = ( - fba_with_reporting_levels - .assign(source_geoscale=( - fba_with_reporting_levels[reporting_level_columns] - .max(axis='columns'))) - # ^^^ max() with axis='columns' takes max along rows - .query('geoscale == source_geoscale') - .drop(columns=(['geoscale', - *geoscale_name_columns, - *reporting_level_columns])) - ) - - if len(fba_at_source_geoscale.source_geoscale.unique()) > 1: - log.warning('%s has multiple source geoscales: %s', - fba_at_source_geoscale.full_name, - ', '.join([s.name.lower() for s in - fba_at_source_geoscale - .source_geoscale.unique()])) - else: - log.info('%s source geoscale is %s', - fba_at_source_geoscale.full_name, - fba_at_source_geoscale - .source_geoscale.unique()[0].name.lower()) - - fba_at_target_geoscale = ( - fba_at_source_geoscale - .drop(columns='source_geoscale') - .convert_fips_to_geoscale(target_geoscale) - .aggregate_flowby() - .astype({activity: flowby_config['fba_fields'][activity] - for activity in ['ActivityProducedBy', - 'ActivityConsumedBy']}) - ) - - if target_geoscale != geo.scale.NATIONAL: - # TODO: This block of code can be simplified a great deal once - # validation.py is rewritten to use the FB config dictionary - activities = list( - self - .add_primary_secondary_columns('Activity') - .PrimaryActivity.unique() - ) - - validation.compare_geographic_totals( - fba_at_target_geoscale, self, - self.source_name, self.config, - self.full_name.split('.')[-1], activities, - df_type='FBS', subnational_geoscale=target_geoscale - # ^^^ TODO: Rewrite validation to use fb metadata - ) - - return fba_at_target_geoscale - - def map_to_sectors( - self: 'FlowByActivity', - target_year: Literal[2002, 2007, 2012, 2017] = 2012, - external_config_path: str = None - ) -> 'FlowByActivity': - """ - Maps the activities in the calling dataframe to industries/sectors, but - does not perform any attribution. Columns for SectorProducedBy and - SectorConsumedBy are added to the FBA. Each activity may be matched - with many industries/sectors, and each industry/sector may have many - activities matched to it. - - The set of industries/sectors that activities are mapped to is - determined by the industry_spec parameter. Currently, this is only - able to be set in terms of NAICS codes, and specifies the desired - default level of NAICS aggregation as well as different levels for - specific groups of NAICS codes. See documentation for - industries.naics_key_from_industry_spec for details on formatting - the industry_spec dict. - - :param industry_spec: dict, formatted as in documentation for - industries.naics_key_from_industry_spec. Gives the desired - industry/sector aggregation level. - :param target_year: int, which NAICS year to use. - :param external_config_path: str, an external path to search for a - crosswalk. - """ - from flowsa.flowbyclean import \ - define_parentincompletechild_descendants, \ - drop_parentincompletechild_descendants - - naics_key = naics.industry_spec_key(self.config['industry_spec']) - - activity_schema = self.config['activity_schema'] if isinstance( - self.config['activity_schema'], str) else self.config.get( - 'activity_schema', {}).get(self.config['year']) - - if "NAICS" in activity_schema: - log.info('Activities in %s are NAICS codes.', - self.full_name) - - try: - source_year = int(activity_schema[6:10]) - except ValueError: - source_year = 2012 - log.warning('No NAICS year given for NAICS activities in %s. ' - '2012 used as default.', self.full_name) - else: - log.info('NAICS Activities in %s use NAICS year %s.', - self.full_name, source_year) - - # if activity schema does not match target naics year, - # convert sectors to target sectors - if activity_schema != f"NAICS_{self.config['target_naics_year']}_Code": - log.info(f"Converting {activity_schema} to NAICS" - f"_{self.config['target_naics_year']}_Code") - self = naics.convert_naics_year( - self, - f"NAICS_{self.config['target_naics_year']}_Code", - activity_schema) - - if self.config.get('sector_hierarchy') == 'parent-completeChild': - log.info('NAICS are a mix of parent-completeChild, assigning ' - 'activity columns directly to sector columns') - - # load master crosswalk - cw = common.load_crosswalk('sector_timeseries') - sectors = (cw[[f"NAICS_{self.config['target_naics_year']}_Code"]] - .drop_duplicates() - .dropna() - ) - - # existing naics - existing_sectors = pd.DataFrame() - existing_sectors['Sector'] = ( - pd.Series(self[['ActivityProducedBy', - 'ActivityConsumedBy']].values.ravel('F')) - .dropna() - .drop_duplicates() - .reset_index(drop=True) - ) - - # drop all sectors that are not sectors because BLS QCEW - # often has non-traditional NAICS6, but the parent NAICS5 do - # map correctly to sectors - existing_sectors = existing_sectors[existing_sectors[ - 'Sector'].isin(sectors[f"NAICS_{self.config['target_naics_year']}_Code"].values)] - - # drop parent sectors - existing_sectors_df = pd.DataFrame([]) - for i in existing_sectors['Sector']: - n = existing_sectors[ - existing_sectors['Sector'].apply( - lambda x: x[0:len(str(i))] == i)] - if len(n) == 1: - existing_sectors_df = pd.concat( - [existing_sectors_df, n]) - existing_sectors_list = existing_sectors_df[ - 'Sector'].values.tolist() - - activity_to_target_naics_crosswalk = ( - naics_key - .query('source_naics in @existing_sectors_list') - ) - - fba_w_naics = self - for direction in ['ProducedBy', 'ConsumedBy']: - fba_w_naics = ( - fba_w_naics - .merge(activity_to_target_naics_crosswalk, - how='left', - left_on=f'Activity{direction}', - right_on='source_naics') - .rename(columns={'target_naics': f'Sector{direction}', - 'SectorType': f'{direction}SectorType'}) - .drop(columns=['ActivitySourceName', - 'SectorSourceName', - 'source_naics'], - errors='ignore') - ) - else: # either "flat" or "parent-inComplete" - # if sector-like activities are aggregated, then map all - # sectors to target sector level - log.info('Converting NAICS codes to desired industry/sector ' - 'aggregation structure.') - fba_w_naics = self.copy() - for direction in ['ProducedBy', 'ConsumedBy']: - if self.config.get('sector_hierarchy') == 'parent-incompleteChild': - # add descendants column - fba_w_naics = \ - define_parentincompletechild_descendants( - fba_w_naics, activity_col=f'Activity{direction}') - fba_w_naics = ( - fba_w_naics - .merge(naics_key, - how='left', - left_on=f'Activity{direction}', - right_on='source_naics') - .rename(columns={'target_naics': f'Sector{direction}'}) - .drop(columns='source_naics') - ) - if self.config.get('sector_hierarchy') == 'parent-incompleteChild': - # add descendants column - fba_w_naics = drop_parentincompletechild_descendants( - fba_w_naics, sector_col=f'Sector{direction}') - else: - log.info('Getting crosswalk between activities in %s and ' - 'NAICS codes.', self.full_name) - activity_to_source_naics_crosswalk = ( - sectormapping.get_activitytosector_mapping( - # ^^^ TODO: Replace or streamline get_...() function - (self.config.get('activity_to_sector_mapping') - or self.source_name), - fbsconfigpath=external_config_path) - .astype('object') - [['Activity', 'Sector', 'SectorType', 'SectorSourceName']] - ) - - source_years = set( - activity_to_source_naics_crosswalk.SectorSourceName - .str.removeprefix('NAICS_') - .str.removesuffix('_Code') - .dropna().astype('int') - ) - source_year = (2012 if 2012 in source_years - else max(source_years) if source_years - else 2012) - if not source_years: - log.warning('No NAICS year/sector source name (e.g. ' - '"NAICS_2012_Code") provided in crosswalk for %s. ' - '2012 being used as default.', - self.full_name) - - activity_to_source_naics_crosswalk = ( - activity_to_source_naics_crosswalk - .query(f'SectorSourceName == "NAICS_{source_year}_Code"') - .reset_index(drop=True) - ) - - # only retain the activities in the crosswalk that exist in - # the FBA. Necessary because the crosswalk could contain parent - # to child relationships that do not exist in the FBA subset and - # if those parent-child relationships are kept in the crosswalk, - # the FBA could be mapped incorrectly - activities_in_fba = (pd.Series(self[['ActivityProducedBy', - 'ActivityConsumedBy']] - .values.ravel('F')) - .dropna() - .drop_duplicates() - .values.tolist() - ) - activity_to_source_naics_crosswalk = \ - activity_to_source_naics_crosswalk[ - activity_to_source_naics_crosswalk['Activity'].isin( - activities_in_fba)] - - log.info('Converting NAICS codes in crosswalk to desired ' - 'industry/sector aggregation structure.') - if self.config.get('sector_hierarchy') == 'parent-completeChild': - existing_sectors = activity_to_source_naics_crosswalk[ - ['Activity', 'Sector']] - - # create list of sectors that exist in original df, which, - # if created when expanding sector list cannot be added - naics_df = pd.DataFrame([]) - for i in existing_sectors['Activity'].unique(): - existing_sectors_sub = existing_sectors[ - existing_sectors['Activity'] == i] - for j in existing_sectors_sub['Sector']: - dig = len(str(j)) - n = existing_sectors[ - existing_sectors['Sector'].str.startswith(j)] - if len(n) == 1: - expanded_n = naics_key[naics_key['source_naics'] - == j] - expanded_n = expanded_n.assign(Activity=i) - naics_df = pd.concat([naics_df, expanded_n]) - - activity_to_target_naics_crosswalk = ( - activity_to_source_naics_crosswalk - .merge(naics_df, - how='left', - left_on=['Activity', 'Sector'], - right_on=['Activity', 'source_naics']) - .assign(Sector=lambda x: x['target_naics']) - .drop(columns=['source_naics', 'target_naics']) - .drop_duplicates() - ) - - fba_w_naics = self.copy() - for direction in ['ProducedBy', 'ConsumedBy']: - fba_w_naics = ( - fba_w_naics - .merge(activity_to_target_naics_crosswalk, - how='left', - left_on=f'Activity{direction}', - right_on='Activity') - .rename(columns={'Sector': f'Sector{direction}', - 'SectorType': f'{direction}SectorType'}) - .drop(columns=['ActivitySourceName', - 'SectorSourceName', - 'Activity'], - errors='ignore') - ) - - else: - activity_to_target_naics_crosswalk = ( - activity_to_source_naics_crosswalk - .merge(naics_key, - how='left', - left_on='Sector', - right_on='source_naics') - .assign(Sector=lambda x: x.target_naics) - .drop(columns=['source_naics', 'target_naics']) - .drop_duplicates() - ) - - log.info('Mapping activities in %s to NAICS codes using ' - 'crosswalk', self.full_name) - fba_w_naics = self - for direction in ['ProducedBy', 'ConsumedBy']: - fba_w_naics = ( - fba_w_naics - .merge(activity_to_target_naics_crosswalk, - how='left', - left_on=f'Activity{direction}', - right_on='Activity') - .rename(columns={'Sector': f'Sector{direction}', - 'SectorType': f'{direction}SectorType'}) - .drop(columns=['ActivitySourceName', - 'SectorSourceName', - 'Activity'], - errors='ignore') - ) - - if source_year != target_year: - log.info('Using NAICS time series/crosswalk to map NAICS ' - 'codes from NAICS year %s to NAICS year %s.', - source_year, target_year) - for direction in ['ProducedBy', 'ConsumedBy']: - fba_w_naics = ( - fba_w_naics - .merge(naics.year_crosswalk(source_year, target_year), - how='left', - left_on=f'Sector{direction}', - right_on='source_naics') - .assign(**{f'Sector{direction}': lambda x: x.target_naics}) - .drop(columns=['source_naics', 'target_naics']) - ) - - # warn if any activities are not mapped to sectors - not_mapped = fba_w_naics[fba_w_naics[['SectorProducedBy', - 'SectorConsumedBy']].isna().all(1)] - if (len(not_mapped) > 0) & ("NAICS" not in activity_schema): - not_mapped = (not_mapped - [['ActivityProducedBy', 'ActivityConsumedBy']] - .drop_duplicates()) - log.warning('Activities in %s are not mapped to sectors: %s', - not_mapped.full_name, - sorted( - set(not_mapped.ActivityProducedBy.dropna()) - .union(set(not_mapped.ActivityConsumedBy.dropna()))) - ) - # drop rows of data that are not mapped to sectors - fba_w_naics = fba_w_naics.dropna(subset=[ - 'SectorProducedBy', 'SectorConsumedBy'], how='all') - - return ( - fba_w_naics - .assign(SectorSourceName=f'NAICS_{target_year}_Code') - .reset_index(drop=True) - ) - - def equally_attribute(self: 'FlowByActivity') -> 'FlowByActivity': - ''' - This function takes a FlowByActivity dataset with SectorProducedBy and - SectorConsumedBy columns already added and attributes flows from any - activity which is mapped to multiple industries/sectors equally across - those industries/sectors, by NAICS level. In other words, if an - activity is mapped to multiple industries/sectors, the flow amount is - equally divided across the relevant 2-digit NAICS industries. Then, - within each 2-digit industry the flow amount for that industry is - equally divided across the relevant 3-digit NAICS industries; within - each of those, the flow amount is equally divided across relevant - 4-digit NAICS industries, and so on. - - For example: - Suppose that activity A has a flow amount of 12 and is mapped to - industries 111210, 111220, and 213110, a flow amount of 3 will be - attributed to 111210, a flow amount of 3 to 111220, and a flow amount - of 6 to 213110. - - Attribution happens according to the primary sector first (see - documentation for - flowby.FlowByActivity.add_primary_secondary_sector_columns() for - details on how the primary sector is determined; in most cases, the - primary sector is the (only) non-null value out of SectorProducedBy or - SectorConsumedBy). If necessary, flow amounts are further (equally) - subdivided based on the secondary sector. - ''' - naics_key = naics.map_target_sectors_to_less_aggregated_sectors( - self.config['industry_spec']) - - fba = self.add_primary_secondary_columns('Sector') - - groupby_cols = ['group_id', 'Location'] - for rank in ['Primary', 'Secondary']: - fba = ( - fba - .merge(naics_key, how='left', left_on=f'{rank}Sector', - right_on='target_naics') - .assign( - **{f'_unique_naics_{n}_by_group': lambda x, i=n: ( - x.groupby(groupby_cols if i == 2 - else [*groupby_cols, f'_naics_{i-1}'], - dropna=False) - [[f'_naics_{i}']] - .transform('nunique', dropna=False) - ) - for n in range(2, 8)}, - FlowAmount=lambda x: reduce( - lambda x, y: x / y, - [x.FlowAmount, *[x[f'_unique_naics_{n}_by_group'] - for n in range(2, 8)]] - ) - ) - .drop(columns=naics_key.columns.values.tolist()) - ) - groupby_cols.append(f'{rank}Sector') - - return fba.drop( - columns=['PrimarySector', 'SecondarySector', - *[f'_unique_naics_{n}_by_group' for n in range(2, 8)]] - ) - - - def prepare_fbs( - self: 'FlowByActivity', - external_config_path: str = None, - download_sources_ok: bool = True - ) -> 'FlowBySector': - if 'activity_sets' in self.config: - try: - return ( - pd.concat([ - fba.prepare_fbs( - external_config_path=external_config_path, download_sources_ok=download_sources_ok) - for fba in ( - self - .select_by_fields() - .function_socket('clean_fba_before_activity_sets') - .activity_sets() - ) - ]) - .reset_index(drop=True) - ) - except ValueError: - return FlowBySector(pd.DataFrame()) - log.info(f'Processing FlowBySector for {self.full_name}') - # Primary FlowBySector generation approach: - return FlowBySector( - self - .function_socket('clean_fba_before_mapping') - .select_by_fields() - .function_socket('estimate_suppressed') - .select_by_fields(selection_fields=self.config.get( - 'selection_fields_after_data_suppression_estimation')) - .convert_units_and_flows() # and also map to flow lists - .function_socket('clean_fba') - .convert_to_geoscale() - .attribute_flows_to_sectors(external_config_path=external_config_path, - download_sources_ok=download_sources_ok) # recursive call to prepare_fbs - .drop(columns=['ActivityProducedBy', 'ActivityConsumedBy']) - .aggregate_flowby() - ) - - def activity_sets(self) -> List['FlowByActivity']: - ''' - This function breaks up an FBA dataset into its activity sets, if its - config dictionary specifies activity sets, and returns a list of the - resulting FBAs. Otherwise, it returns a list containing the calling - FBA. - - Activity sets are determined by the selection_field key under each - activity set name. An error will be logged if any rows from the calling - FBA are assigned to multiple activity sets. - ''' - if 'activity_sets' not in self.config: - return [self] - - log.info('Splitting %s into activity sets', self.full_name) - activities = self.config['activity_sets'] - parent_config = {k: v for k, v in self.config.items() - if k not in ['activity_sets', - 'clean_fba_before_activity_sets'] - and not k.startswith('_')} - parent_fba = self.reset_index().rename(columns={'index': 'row'}) - - child_fba_list = [] - assigned_rows = set() - for activity_set, activity_config in activities.items(): - log.info('Creating FlowByActivity for %s', activity_set) - - child_fba = ( - parent_fba - .add_full_name( - f'{parent_fba.full_name}{NAME_SEP_CHAR}{activity_set}') - .select_by_fields( - selection_fields=activity_config.get('selection_fields'), - exclusion_fields=activity_config.get('exclusion_fields')) - ) - - child_fba.config = {**parent_config, **activity_config} - child_fba = child_fba.assign(SourceName=child_fba.full_name) - - if set(child_fba.row) & assigned_rows: - log.critical( - 'Some rows from %s assigned to multiple activity ' - 'sets. This will lead to double-counting:\n%s', - parent_fba.full_name, - child_fba.query( - f'row in {list(set(child_fba.row) & assigned_rows)}' - ) - ) - # raise ValueError('Some rows in multiple activity sets') - - assigned_rows.update(child_fba.row) - if not child_fba.empty: - child_fba_list.append(child_fba.drop(columns='row')) - else: - log.error('Activity set %s is empty. Check activity set ' - 'definition!', child_fba.full_name) - - if set(parent_fba.row) - assigned_rows: - log.warning('Some rows from %s not assigned to an activity ' - 'set. Is this intentional?', parent_fba.full_name) - unassigned = parent_fba.query('row not in @assigned_rows') - - return child_fba_list - - def convert_units_and_flows( - self: 'FlowByActivity' - ) -> 'FlowByActivity': - if 'emissions_factors' in self.config: - self = self.convert_activity_to_emissions() - if 'adjustment_factor' in self.config: - # ^^^ TODO: There has to be a better way to do this. - self = self.assign(FlowAmount=self.FlowAmount - * self.config['adjustment_factor']) - - self = self.convert_daily_to_annual() - if self.config.get('fedefl_mapping'): - mapped = self.map_to_fedefl_list( - drop_unmapped_rows=self.config.get('drop_unmapped_rows', False) - ) - else: - mapped = self.rename(columns={'FlowName': 'Flowable', - 'Compartment': 'Context'}) - return (mapped.standardize_units()) - - def convert_activity_to_emissions( - self: 'FlowByActivity' - ) -> 'FlowByActivity': - ''' - This method converts flows of an activity (most commonly a measure of - fuel burned) into flows of one or more pollutants. This is a first - draft, so it may need some refinement. - - Emissions factors may be specified in a .csv file, with whatever - columns need to be matched on for accurate conversion from activity to - emissions. - ''' - emissions_factors = ( - pd.read_csv( - settings.datapath / f'{self.config["emissions_factors"]}.csv') - .drop(columns='source') - ) - - emissions_fba = ( - self - .merge(emissions_factors, how='left') - .assign(FlowName=lambda x: x.pollutant, - FlowAmount=lambda x: x.FlowAmount * x.emissions_factor, - Unit=lambda x: x.target_unit, - Class='Chemicals', - FlowType='ELEMENTARY_FLOW') - .drop(columns=['pollutant', 'target_unit', 'emissions_factor']) - .add_primary_secondary_columns('Activity') - .assign(ActivityProducedBy=lambda x: x.PrimaryActivity, - ActivityConsumedBy=lambda x: x.SecondaryActivity) - # ^^^ TODO: This is a line I'm quite skeptical of. There's got to - # be a better way to do this. Maybe specify in the config? - .drop(columns=['PrimaryActivity', 'SecondaryActivity']) - ) - return emissions_fba - - -class FlowBySector(_FlowBy): - _metadata = [*_FlowBy()._metadata] - - def __init__( - self, - data: pd.DataFrame or '_FlowBy' = None, - *args, - collapsed: bool = False, - w_activity: bool = False, - **kwargs - ) -> None: - if isinstance(data, pd.DataFrame): - collapsed = collapsed or any( - [c in data.columns for c in flowby_config['_collapsed_fields']] - ) - w_activity = w_activity or any( - [c in data.columns for c in flowby_config['_activity_fields']] - ) - - if collapsed: - fields = flowby_config['fbs_collapsed_fields'] - elif w_activity: - fields = flowby_config['fbs_w_activity_fields'] - else: - fields = flowby_config['fbs_fields'] - - column_order = flowby_config['fbs_column_order'] - else: - fields = None - column_order = None - - super().__init__(data, - fields=fields, - column_order=column_order, - *args, **kwargs) - - @property - def _constructor(self) -> 'FlowBySector': - return FlowBySector - - @property - def _constructor_sliced(self) -> '_FBSSeries': - return _FBSSeries - - @classmethod - def getFlowBySector( - cls, - method: str, - config: dict = None, - external_config_path: str = None, - download_sources_ok: bool = settings.DEFAULT_DOWNLOAD_IF_MISSING, - download_fbs_ok: bool = settings.DEFAULT_DOWNLOAD_IF_MISSING, - **kwargs - ) -> 'FlowBySector': - ''' - Loads stored FlowBySector output. If it is not - available, tries to download it from EPA's remote server (if - download_ok is True), or generate it. - :param method: string, name of the FBS attribution method file to use - :param external_config_path: str, path to the FBS method file if - loading a file from outside the flowsa repository - :param download_fba_ok: bool, if True will attempt to load FBAs - used in generating the FBS from EPA's remote server rather than - generating (if not found locally) - :param download_FBS_if_missing: bool, if True will attempt to load the - FBS from EPA's remote server rather than generating it - (if not found locally) - :kwargs: keyword arguments to pass to _getFlowBy(). Possible kwargs - include full_name and config. - :return: FlowBySector dataframe - ''' - file_metadata = metadata.set_fb_meta(method, 'FlowBySector') - - if config is None: - try: - config = common.load_yaml_dict(method, 'FBS', - external_config_path) - except exceptions.FlowsaMethodNotFoundError: - config = {} - - flowby_generator = ( - lambda x=method, y=external_config_path, z=download_sources_ok: - cls.generateFlowBySector(x, y, z) - ) - return super()._getFlowBy( - file_metadata=file_metadata, - download_ok=download_fbs_ok, - flowby_generator=flowby_generator, - output_path=settings.fbsoutputpath, - full_name=method, - config=config, - **kwargs - ) - - @classmethod - def generateFlowBySector( - cls, - method: str, - external_config_path: str = None, - download_sources_ok: bool = settings.DEFAULT_DOWNLOAD_IF_MISSING, - ) -> 'FlowBySector': - ''' - Generates a FlowBySector dataset. - :param method: str, name of FlowBySector method .yaml file to use. - :param external_config_path: str, optional. If given, tells flowsa - where to look for the method yaml specified above. - :param download_fba_ok: bool, optional. Whether to attempt to download - source data FlowByActivity files from EPA server rather than - generating them. - ''' - log.info('Beginning FlowBySector generation for %s', method) - method_config = common.load_yaml_dict(method, 'FBS', - external_config_path) - - # Cache one or more sources by attaching to method_config - to_cache = method_config.pop('sources_to_cache', {}) - if 'cache' in method_config: - log.warning('Config key "cache" for %s about to be overwritten', - method) - - method_config['cache'] = {} - for source_name, config in to_cache.items(): - method_config['cache'][source_name] = ( - get_flowby_from_config( - name=source_name, - config={ - **method_config, - 'method_config_keys': method_config.keys(), - **get_catalog_info(source_name), - **config - }, - external_config_path=external_config_path, - download_sources_ok=download_sources_ok - ).prepare_fbs(external_config_path=external_config_path, download_sources_ok=download_sources_ok) - ) - # ^^^ This is done with a for loop instead of a dict comprehension - # so that later entries in method_config['sources_to_cache'] - # can make use of the cached copy of an earlier entry. - - # Generate FBS from method_config - sources = method_config.pop('source_names') - - fbs = pd.concat([ - get_flowby_from_config( - name=source_name, - config={ - **method_config, - 'method_config_keys': method_config.keys(), - **get_catalog_info(source_name), - **config - }, - external_config_path=external_config_path, - download_sources_ok=download_sources_ok - ).prepare_fbs(external_config_path=external_config_path, - download_sources_ok=download_sources_ok) - for source_name, config in sources.items() - ]) - - fbs.full_name = method - fbs.config = method_config - - # drop year from LocationSystem for FBS use with USEEIO - fbs['LocationSystem'] = fbs['LocationSystem'].str.split('_').str[0] - # aggregate to target geoscale - fbs = ( - fbs - .convert_fips_to_geoscale( - geo.scale.from_string(fbs.config.get('geoscale'))) - .aggregate_flowby() - ) - # aggregate to target sector - fbs = fbs.sector_aggregation() - - # set all data quality fields to none until implemented fully - log.info('Reset all data quality fields to None') - dq_cols = ['Spread', 'Min', 'Max', - 'DataReliability', 'TemporalCorrelation', - 'GeographicalCorrelation', 'TechnologicalCorrelation', - 'DataCollection'] - fbs = fbs.assign(**dict.fromkeys(dq_cols, None)) - - # Save fbs and metadata - log.info(f'FBS generation complete, saving {method} to file') - meta = metadata.set_fb_meta(method, 'FlowBySector') - esupy.processed_data_mgmt.write_df_to_file(fbs, settings.paths, meta) - reset_log_file(method, meta) - metadata.write_metadata(source_name=method, - config=common.load_yaml_dict( - method, 'FBS', external_config_path), - fb_meta=meta, - category='FlowBySector') - - return fbs - - def sector_aggregation(self): - """ - In the event activity sets in an FBS are at a less aggregated target - sector level than the overall target level, aggregate the sectors to - the FBS target scale - :return: - """ - naics_key = naics.industry_spec_key(self.config['industry_spec']) - - fbs = self - for direction in ['ProducedBy', 'ConsumedBy']: - fbs = ( - fbs - .rename(columns={f'Sector{direction}': 'source_naics'}) - .merge(naics_key, - how='left') - .rename(columns={'target_naics': f'Sector{direction}'}) - .drop(columns='source_naics') - .aggregate_flowby() - ) - - return fbs - - def prepare_fbs( - self: 'FlowBySector', - external_config_path: str = None, - download_sources_ok: bool = True - ) -> 'FlowBySector': - if 'activity_sets' in self.config: - try: - return ( - pd.concat([ - fbs.prepare_fbs() - for fbs in ( - self - .select_by_fields() - .activity_sets() - ) - ]) - .reset_index(drop=True) - ) - except ValueError: - return FlowBySector(pd.DataFrame()) - return ( - self - .function_socket('clean_fbs') - .select_by_fields() - .sector_aggregation() # convert to proper industry spec. - .convert_fips_to_geoscale() - .attribute_flows_to_sectors(external_config_path=external_config_path, - download_sources_ok=download_sources_ok) - .aggregate_flowby() # necessary after consolidating geoscale - ) - - - def display_tables( - self: 'FlowBySector', - display_tables: dict = None - ) -> pd.DataFrame: - display_tables = display_tables or self.config.get('display_tables') - if display_tables is None: - log.error('Cannot generate display tables, since no configuration ' - 'is specified for them') - return None - - def convert_industry_spec( - fb_at_source_naics: 'FlowBySector', - industry_spec: dict = None - ) -> 'FlowBySector': - ''' - This is here because it's only for display purposes. It can be - replaced once there's a proper method for converting an FBS to - a new industry_spec - ''' - if industry_spec is None: - return fb_at_source_naics - fb_at_target_naics = ( - fb_at_source_naics - .merge(naics.industry_spec_key(industry_spec), - how='left', - left_on='SectorProducedBy', right_on='source_naics') - .assign( - SectorProducedBy=lambda x: - x.SectorProducedBy.mask(x.SectorProducedBy.str.len() - >= x.target_naics.str.len(), - x.target_naics) - ) - .drop(columns=['target_naics', 'source_naics']) - .aggregate_flowby() - ) - return fb_at_target_naics - - table_dict = { - table_name: ( - self - .select_by_fields(table_config.get('selection_fields')) - .pipe(convert_industry_spec, table_config.get('industry_spec')) - [['Flowable', 'Unit', 'SectorProducedBy', 'FlowAmount']] - .rename(columns={'Flowable': 'Pollutant', - 'SectorProducedBy': 'Industry', - 'FlowAmount': 'Amount'}) - .replace(table_config.get('replace_dict', {})) - .assign(Pollutant=lambda x: x.Pollutant + ' (' + x.Unit + ')') - .drop(columns='Unit') - .groupby(['Pollutant', 'Industry']).agg('sum') - .reset_index() - .pivot(index='Pollutant', columns='Industry', values='Amount') - ) - for table_name, table_config in display_tables.items() - } - - tables_path = (settings.tableoutputpath / f'{self.full_name}' - f'_Display_Tables.xlsx') - try: - with ExcelWriter(tables_path) as writer: - for name, table in table_dict.items(): - table.to_excel(writer, name) - except PermissionError: - log.warning(f'Permission to write display tables for ' - f'{self.full_name} to {tables_path} denied.') - - return table_dict - - -# The three classes extending pd.Series, together with the _constructor... -# methods of each class, are required for allowing pandas methods called on -# objects of these classes to return objects of these classes, as desired. -# For more information, see -# https://pandas.pydata.org/docs/development/extending.html - -class _FlowBySeries(pd.Series): - _metadata = [*_FlowBy()._metadata] - - @property - def _constructor(self) -> '_FlowBySeries': - return _FlowBySeries - - @property - def _constructor_expanddim(self) -> '_FlowBy': - return _FlowBy - - -class _FBASeries(pd.Series): - _metadata = [*FlowByActivity()._metadata] - - @property - def _constructor(self) -> '_FBASeries': - return _FBASeries - - @property - def _constructor_expanddim(self) -> 'FlowByActivity': - return FlowByActivity - - -class _FBSSeries(pd.Series): - _metadata = [*FlowBySector()._metadata] - - @property - def _constructor(self) -> '_FBSSeries': - return _FBSSeries - - @property - def _constructor_expanddim(self) -> 'FlowBySector': - return FlowBySector diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py new file mode 100644 index 000000000..0152b89e1 --- /dev/null +++ b/flowsa/flowbyactivity.py @@ -0,0 +1,881 @@ +from functools import partial, reduce +from typing import Literal, List + +import fedelemflowlist +import pandas as pd + +from flowsa import settings, metadata, log, geo, validation, naics, common, \ + sectormapping, FlowBySector +from flowsa.flowby import _FlowBy, flowby_config, NAME_SEP_CHAR +from flowsa.flowbyseries import _FBASeries + + +class FlowByActivity(_FlowBy): + _metadata = [*_FlowBy()._metadata] + + def __init__( + self, + data: pd.DataFrame or '_FlowBy' = None, + *args, + mapped: bool = False, + w_sector: bool = False, + **kwargs + ) -> None: + if isinstance(data, pd.DataFrame): + mapped = mapped or any( + [c in data.columns for c in flowby_config['_mapped_fields']] + ) + w_sector = w_sector or any( + [c in data.columns for c in flowby_config['_sector_fields']] + ) + + if mapped and w_sector: + fields = flowby_config['fba_mapped_w_sector_fields'] + elif mapped: + fields = flowby_config['fba_mapped_fields'] + elif w_sector: + fields = flowby_config['fba_w_sector_fields'] + else: + fields = flowby_config['fba_fields'] + + column_order = flowby_config['fba_column_order'] + else: + fields = None + column_order = None + + super().__init__(data, + fields=fields, + column_order=column_order, + *args, **kwargs) + + @property + def _constructor(self) -> 'FlowByActivity': + return FlowByActivity + + @property + def _constructor_sliced(self) -> '_FBASeries': + return _FBASeries + + @classmethod + def getFlowByActivity( + cls, + full_name: str, + year: int = None, + config: dict = None, + download_ok: bool = settings.DEFAULT_DOWNLOAD_IF_MISSING, + **kwargs + ) -> 'FlowByActivity': + """ + Loads stored data in the FlowByActivity format. If it is not + available, tries to download it from EPA's remote server (if + download_ok is True), or generate it. + :param datasource: str, the code of the datasource. + :param year: int, a year, e.g. 2012 + :param download_ok: bool, if True will attempt to load from + EPA remote server prior to generating + :kwargs: keyword arguments to pass to _getFlowBy(). Possible kwargs + include config. + :return: a FlowByActivity dataframe + """ + if year is None and isinstance(config, dict): + year = config.get('year') + + file_metadata = metadata.set_fb_meta( + full_name if year is None else f'{full_name}_{year}', + 'FlowByActivity' + ) + flowby_generator = partial( + flowbyactivity.main, + source=full_name, + year=year + ) + return super()._getFlowBy( + file_metadata=file_metadata, + download_ok=download_ok, + flowby_generator=flowby_generator, + output_path=settings.fbaoutputpath, + full_name=full_name, + config=config, + **kwargs + ) + + # TODO: probably only slight modification is needed to allow for material + # flow list mapping using this function as well. + def map_to_fedefl_list( + self: 'FlowByActivity', + drop_unmapped_rows: bool = False + ) -> 'FlowByActivity': + fba_merge_keys = [ + 'Flowable', + 'Unit', + 'Context' + ] + mapping_fields = [ + 'SourceListName', + 'SourceFlowName', + 'SourceFlowContext', + 'SourceUnit', + 'ConversionFactor', + 'TargetFlowName', + 'TargetFlowContext', + 'TargetUnit', + 'TargetFlowUUID' + ] + mapping_merge_keys = [ + 'SourceFlowName', + 'SourceUnit', + 'SourceFlowContext' + ] + merge_type = 'inner' if drop_unmapped_rows else 'left' + + mapping_subset = self.config.get('fedefl_mapping') + + log.info(f'Mapping flows in {self.full_name} to ' + f'{mapping_subset} in federal elementary flow list') + + # Check for use of multiple mapping files + # TODO this was handled in esupy originally - can we go back to that fxn? + if isinstance(mapping_subset, list): + fba_merge_keys.append('SourceName') + mapping_merge_keys.append('SourceListName') + + fba = ( + self + .assign(Flowable=self.FlowName, + Context=self.Compartment, + ) + .drop(columns=['FlowName', 'Compartment']) + ) + + mapping = ( + fedelemflowlist.get_flowmapping(mapping_subset)[mapping_fields] + .assign(ConversionFactor=lambda x: x.ConversionFactor.fillna(1)) + ) + if mapping.empty: + log.error('Elementary flow list entries for %s not found', + mapping_subset) + return FlowByActivity(self, mapped=True) + + mapped_fba = fba.merge(mapping, + how=merge_type, + left_on=fba_merge_keys, + right_on=mapping_merge_keys, + indicator='mapped') + + is_mappable = mapped_fba.TargetFlowName.notnull() + mapped_fba = ( + mapped_fba + .assign( + Flowable=mapped_fba.Flowable.mask( + is_mappable, mapped_fba.TargetFlowName), + Context=mapped_fba.Context.mask( + is_mappable, mapped_fba.TargetFlowContext), + Unit=mapped_fba.Unit.mask( + is_mappable, mapped_fba.TargetUnit), + FlowAmount=mapped_fba.FlowAmount.mask( + is_mappable, + mapped_fba.FlowAmount * mapped_fba.ConversionFactor), + FlowUUID=mapped_fba.TargetFlowUUID + ) + .drop(columns=mapping_fields) + ) + + if any(mapped_fba.mapped == 'both'): + log.info('Units standardized to %s by mapping to federal ' + 'elementary flow list', list(mapping.TargetUnit.unique())) + if any(mapped_fba.mapped == 'left_only'): + log.warning('Some units not standardized by mapping to federal ' + 'elementary flows list: %s', + list(mapped_fba + .query('mapped == "left_only"').Unit.unique())) + + return mapped_fba.drop(columns='mapped') + + # TODO: Can this be generalized to a _FlowBy method? + def convert_to_geoscale( + self: 'FlowByActivity', + target_geoscale: Literal['national', 'state', 'county', + geo.scale.NATIONAL, geo.scale.STATE, + geo.scale.COUNTY] = None + ) -> 'FlowByActivity': + ''' + Converts, by filtering or aggregating (or both), the given dataset to + the target geoscale. + + Rows from the calling FlowBy that correspond to a higher level (more + aggregated) geoscale than the target are dropped. Then, for each + combination of 'ActivityProducedBy' and 'ActivityConsumedBy', and for + each level at or below (less aggregated than) the target geoscale, + determine the highest level at which data is reported for each unit at + that scale (so if the level is 'state', find the highest level at which + data is reported for each state, for each activity combination). + Finally, use this information to identify the correct source scale + for each activity combination and regional unit (details below), then + filter or aggregate (or both) to convert the dataset so all rows are + at the target geoscale. + + For any region and activity combination, the correct source geoscale + is the highest (most aggregated) geoscale at or below the target + geoscale, for which data covering that region and activity combination + is reported. For example, if the target geoscale is 'national', + national level data should be used if available. If not, state level + data should be aggregated up if available. However, if some states + report county level data AND NOT state level data, then for those + states (and only those states) county level data should be aggregated + up. County level data from states that also report state level data + should, in this example, be ignored. + + :param target_geoscale: str or geo.scale constant, the geoscale to + convert the calling FlowBy data set to. Currently, this needs to be + one which corresponds to a FIPS level (that is, one of national, + state, or county) + :return: FlowBy data set, with rows filtered or aggregated to the + target geoscale. + ''' + if self.LocationSystem.eq('Census_Region').all(): + return self + target_geoscale = target_geoscale or self.config.get('geoscale') + if type(target_geoscale) == str: + target_geoscale = geo.scale.from_string(target_geoscale) + + geoscale_by_fips = pd.concat([ + (geo.filtered_fips(scale) + .assign(geoscale=scale, National='USA') + # ^^^ Need to have a column for each relevant scale + .rename(columns={'FIPS': 'Location'})) + # ^^^ (only FIPS for now) + for scale in [s for s in geo.scale if s.has_fips_level] + ]) + + geoscale_name_columns = [s.name.title() for s in geo.scale + if s.has_fips_level] + + log.info('Determining appropriate source geoscale for %s; ' + 'target geoscale is %s', + self.full_name, + target_geoscale.name.lower()) + + highest_reporting_level_by_geoscale = [ + (self + .merge(geoscale_by_fips, how='inner') + .query('geoscale <= @scale') + .groupby(['ActivityProducedBy', 'ActivityConsumedBy'] + + [s.name.title() for s in geo.scale + if s.has_fips_level and s >= scale], + dropna=False) + .agg({'geoscale': 'max'}) + .reset_index() + .rename(columns={ + 'geoscale': f'highest_reporting_level_by_{scale.name.title()}' + })) + for scale in geo.scale + if scale.has_fips_level and scale <= target_geoscale + ] + + # if an activity column is a mix of string and np.nan values but + # after subsetting, the column is all np.nan, then the column dtype is + # converted to float which causes an error when merging float col back + # with the original object dtype. So convert float cols back to object + for df in highest_reporting_level_by_geoscale: + for c in ['ActivityProducedBy', 'ActivityConsumedBy']: + if df[c].dtype == float: + df[c] = df[c].astype(object) + + fba_with_reporting_levels = reduce( + lambda x, y: x.merge(y, how='left'), + [self, geoscale_by_fips, *highest_reporting_level_by_geoscale] + ) + + reporting_level_columns = [ + f'highest_reporting_level_by_{s.name.title()}' + for s in geo.scale if s.has_fips_level and s <= target_geoscale + ] + + fba_at_source_geoscale = ( + fba_with_reporting_levels + .assign(source_geoscale=( + fba_with_reporting_levels[reporting_level_columns] + .max(axis='columns'))) + # ^^^ max() with axis='columns' takes max along rows + .query('geoscale == source_geoscale') + .drop(columns=(['geoscale', + *geoscale_name_columns, + *reporting_level_columns])) + ) + + if len(fba_at_source_geoscale.source_geoscale.unique()) > 1: + log.warning('%s has multiple source geoscales: %s', + fba_at_source_geoscale.full_name, + ', '.join([s.name.lower() for s in + fba_at_source_geoscale + .source_geoscale.unique()])) + else: + log.info('%s source geoscale is %s', + fba_at_source_geoscale.full_name, + fba_at_source_geoscale + .source_geoscale.unique()[0].name.lower()) + + fba_at_target_geoscale = ( + fba_at_source_geoscale + .drop(columns='source_geoscale') + .convert_fips_to_geoscale(target_geoscale) + .aggregate_flowby() + .astype({activity: flowby_config['fba_fields'][activity] + for activity in ['ActivityProducedBy', + 'ActivityConsumedBy']}) + ) + + if target_geoscale != geo.scale.NATIONAL: + # TODO: This block of code can be simplified a great deal once + # validation.py is rewritten to use the FB config dictionary + activities = list( + self + .add_primary_secondary_columns('Activity') + .PrimaryActivity.unique() + ) + + validation.compare_geographic_totals( + fba_at_target_geoscale, self, + self.source_name, self.config, + self.full_name.split('.')[-1], activities, + df_type='FBS', subnational_geoscale=target_geoscale + # ^^^ TODO: Rewrite validation to use fb metadata + ) + + return fba_at_target_geoscale + + def map_to_sectors( + self: 'FlowByActivity', + target_year: Literal[2002, 2007, 2012, 2017] = 2012, + external_config_path: str = None + ) -> 'FlowByActivity': + """ + Maps the activities in the calling dataframe to industries/sectors, but + does not perform any attribution. Columns for SectorProducedBy and + SectorConsumedBy are added to the FBA. Each activity may be matched + with many industries/sectors, and each industry/sector may have many + activities matched to it. + + The set of industries/sectors that activities are mapped to is + determined by the industry_spec parameter. Currently, this is only + able to be set in terms of NAICS codes, and specifies the desired + default level of NAICS aggregation as well as different levels for + specific groups of NAICS codes. See documentation for + industries.naics_key_from_industry_spec for details on formatting + the industry_spec dict. + + :param industry_spec: dict, formatted as in documentation for + industries.naics_key_from_industry_spec. Gives the desired + industry/sector aggregation level. + :param target_year: int, which NAICS year to use. + :param external_config_path: str, an external path to search for a + crosswalk. + """ + from flowsa.flowbyclean import \ + define_parentincompletechild_descendants, \ + drop_parentincompletechild_descendants + + naics_key = naics.industry_spec_key(self.config['industry_spec']) + + activity_schema = self.config['activity_schema'] if isinstance( + self.config['activity_schema'], str) else self.config.get( + 'activity_schema', {}).get(self.config['year']) + + if "NAICS" in activity_schema: + log.info('Activities in %s are NAICS codes.', + self.full_name) + + try: + source_year = int(activity_schema[6:10]) + except ValueError: + source_year = 2012 + log.warning('No NAICS year given for NAICS activities in %s. ' + '2012 used as default.', self.full_name) + else: + log.info('NAICS Activities in %s use NAICS year %s.', + self.full_name, source_year) + + # if activity schema does not match target naics year, + # convert sectors to target sectors + if activity_schema != f"NAICS_{self.config['target_naics_year']}_Code": + log.info(f"Converting {activity_schema} to NAICS" + f"_{self.config['target_naics_year']}_Code") + self = naics.convert_naics_year( + self, + f"NAICS_{self.config['target_naics_year']}_Code", + activity_schema) + + if self.config.get('sector_hierarchy') == 'parent-completeChild': + log.info('NAICS are a mix of parent-completeChild, assigning ' + 'activity columns directly to sector columns') + + # load master crosswalk + cw = common.load_crosswalk('sector_timeseries') + sectors = (cw[[f"NAICS_{self.config['target_naics_year']}_Code"]] + .drop_duplicates() + .dropna() + ) + + # existing naics + existing_sectors = pd.DataFrame() + existing_sectors['Sector'] = ( + pd.Series(self[['ActivityProducedBy', + 'ActivityConsumedBy']].values.ravel('F')) + .dropna() + .drop_duplicates() + .reset_index(drop=True) + ) + + # drop all sectors that are not sectors because BLS QCEW + # often has non-traditional NAICS6, but the parent NAICS5 do + # map correctly to sectors + existing_sectors = existing_sectors[existing_sectors[ + 'Sector'].isin(sectors[f"NAICS_{self.config['target_naics_year']}_Code"].values)] + + # drop parent sectors + existing_sectors_df = pd.DataFrame([]) + for i in existing_sectors['Sector']: + n = existing_sectors[ + existing_sectors['Sector'].apply( + lambda x: x[0:len(str(i))] == i)] + if len(n) == 1: + existing_sectors_df = pd.concat( + [existing_sectors_df, n]) + existing_sectors_list = existing_sectors_df[ + 'Sector'].values.tolist() + + activity_to_target_naics_crosswalk = ( + naics_key + .query('source_naics in @existing_sectors_list') + ) + + fba_w_naics = self + for direction in ['ProducedBy', 'ConsumedBy']: + fba_w_naics = ( + fba_w_naics + .merge(activity_to_target_naics_crosswalk, + how='left', + left_on=f'Activity{direction}', + right_on='source_naics') + .rename(columns={'target_naics': f'Sector{direction}', + 'SectorType': f'{direction}SectorType'}) + .drop(columns=['ActivitySourceName', + 'SectorSourceName', + 'source_naics'], + errors='ignore') + ) + else: # either "flat" or "parent-inComplete" + # if sector-like activities are aggregated, then map all + # sectors to target sector level + log.info('Converting NAICS codes to desired industry/sector ' + 'aggregation structure.') + fba_w_naics = self.copy() + for direction in ['ProducedBy', 'ConsumedBy']: + if self.config.get('sector_hierarchy') == 'parent-incompleteChild': + # add descendants column + fba_w_naics = \ + define_parentincompletechild_descendants( + fba_w_naics, activity_col=f'Activity{direction}') + fba_w_naics = ( + fba_w_naics + .merge(naics_key, + how='left', + left_on=f'Activity{direction}', + right_on='source_naics') + .rename(columns={'target_naics': f'Sector{direction}'}) + .drop(columns='source_naics') + ) + if self.config.get('sector_hierarchy') == 'parent-incompleteChild': + # add descendants column + fba_w_naics = drop_parentincompletechild_descendants( + fba_w_naics, sector_col=f'Sector{direction}') + else: + log.info('Getting crosswalk between activities in %s and ' + 'NAICS codes.', self.full_name) + activity_to_source_naics_crosswalk = ( + sectormapping.get_activitytosector_mapping( + # ^^^ TODO: Replace or streamline get_...() function + (self.config.get('activity_to_sector_mapping') + or self.source_name), + fbsconfigpath=external_config_path) + .astype('object') + [['Activity', 'Sector', 'SectorType', 'SectorSourceName']] + ) + + source_years = set( + activity_to_source_naics_crosswalk.SectorSourceName + .str.removeprefix('NAICS_') + .str.removesuffix('_Code') + .dropna().astype('int') + ) + source_year = (2012 if 2012 in source_years + else max(source_years) if source_years + else 2012) + if not source_years: + log.warning('No NAICS year/sector source name (e.g. ' + '"NAICS_2012_Code") provided in crosswalk for %s. ' + '2012 being used as default.', + self.full_name) + + activity_to_source_naics_crosswalk = ( + activity_to_source_naics_crosswalk + .query(f'SectorSourceName == "NAICS_{source_year}_Code"') + .reset_index(drop=True) + ) + + # only retain the activities in the crosswalk that exist in + # the FBA. Necessary because the crosswalk could contain parent + # to child relationships that do not exist in the FBA subset and + # if those parent-child relationships are kept in the crosswalk, + # the FBA could be mapped incorrectly + activities_in_fba = (pd.Series(self[['ActivityProducedBy', + 'ActivityConsumedBy']] + .values.ravel('F')) + .dropna() + .drop_duplicates() + .values.tolist() + ) + activity_to_source_naics_crosswalk = \ + activity_to_source_naics_crosswalk[ + activity_to_source_naics_crosswalk['Activity'].isin( + activities_in_fba)] + + log.info('Converting NAICS codes in crosswalk to desired ' + 'industry/sector aggregation structure.') + if self.config.get('sector_hierarchy') == 'parent-completeChild': + existing_sectors = activity_to_source_naics_crosswalk[ + ['Activity', 'Sector']] + + # create list of sectors that exist in original df, which, + # if created when expanding sector list cannot be added + naics_df = pd.DataFrame([]) + for i in existing_sectors['Activity'].unique(): + existing_sectors_sub = existing_sectors[ + existing_sectors['Activity'] == i] + for j in existing_sectors_sub['Sector']: + dig = len(str(j)) + n = existing_sectors[ + existing_sectors['Sector'].str.startswith(j)] + if len(n) == 1: + expanded_n = naics_key[naics_key['source_naics'] + == j] + expanded_n = expanded_n.assign(Activity=i) + naics_df = pd.concat([naics_df, expanded_n]) + + activity_to_target_naics_crosswalk = ( + activity_to_source_naics_crosswalk + .merge(naics_df, + how='left', + left_on=['Activity', 'Sector'], + right_on=['Activity', 'source_naics']) + .assign(Sector=lambda x: x['target_naics']) + .drop(columns=['source_naics', 'target_naics']) + .drop_duplicates() + ) + + fba_w_naics = self.copy() + for direction in ['ProducedBy', 'ConsumedBy']: + fba_w_naics = ( + fba_w_naics + .merge(activity_to_target_naics_crosswalk, + how='left', + left_on=f'Activity{direction}', + right_on='Activity') + .rename(columns={'Sector': f'Sector{direction}', + 'SectorType': f'{direction}SectorType'}) + .drop(columns=['ActivitySourceName', + 'SectorSourceName', + 'Activity'], + errors='ignore') + ) + + else: + activity_to_target_naics_crosswalk = ( + activity_to_source_naics_crosswalk + .merge(naics_key, + how='left', + left_on='Sector', + right_on='source_naics') + .assign(Sector=lambda x: x.target_naics) + .drop(columns=['source_naics', 'target_naics']) + .drop_duplicates() + ) + + log.info('Mapping activities in %s to NAICS codes using ' + 'crosswalk', self.full_name) + fba_w_naics = self + for direction in ['ProducedBy', 'ConsumedBy']: + fba_w_naics = ( + fba_w_naics + .merge(activity_to_target_naics_crosswalk, + how='left', + left_on=f'Activity{direction}', + right_on='Activity') + .rename(columns={'Sector': f'Sector{direction}', + 'SectorType': f'{direction}SectorType'}) + .drop(columns=['ActivitySourceName', + 'SectorSourceName', + 'Activity'], + errors='ignore') + ) + + if source_year != target_year: + log.info('Using NAICS time series/crosswalk to map NAICS ' + 'codes from NAICS year %s to NAICS year %s.', + source_year, target_year) + for direction in ['ProducedBy', 'ConsumedBy']: + fba_w_naics = ( + fba_w_naics + .merge(naics.year_crosswalk(source_year, target_year), + how='left', + left_on=f'Sector{direction}', + right_on='source_naics') + .assign(**{f'Sector{direction}': lambda x: x.target_naics}) + .drop(columns=['source_naics', 'target_naics']) + ) + + # warn if any activities are not mapped to sectors + not_mapped = fba_w_naics[fba_w_naics[['SectorProducedBy', + 'SectorConsumedBy']].isna().all(1)] + if (len(not_mapped) > 0) & ("NAICS" not in activity_schema): + not_mapped = (not_mapped + [['ActivityProducedBy', 'ActivityConsumedBy']] + .drop_duplicates()) + log.warning('Activities in %s are not mapped to sectors: %s', + not_mapped.full_name, + sorted( + set(not_mapped.ActivityProducedBy.dropna()) + .union(set(not_mapped.ActivityConsumedBy.dropna()))) + ) + # drop rows of data that are not mapped to sectors + fba_w_naics = fba_w_naics.dropna(subset=[ + 'SectorProducedBy', 'SectorConsumedBy'], how='all') + + return ( + fba_w_naics + .assign(SectorSourceName=f'NAICS_{target_year}_Code') + .reset_index(drop=True) + ) + + def equally_attribute(self: 'FlowByActivity') -> 'FlowByActivity': + ''' + This function takes a FlowByActivity dataset with SectorProducedBy and + SectorConsumedBy columns already added and attributes flows from any + activity which is mapped to multiple industries/sectors equally across + those industries/sectors, by NAICS level. In other words, if an + activity is mapped to multiple industries/sectors, the flow amount is + equally divided across the relevant 2-digit NAICS industries. Then, + within each 2-digit industry the flow amount for that industry is + equally divided across the relevant 3-digit NAICS industries; within + each of those, the flow amount is equally divided across relevant + 4-digit NAICS industries, and so on. + + For example: + Suppose that activity A has a flow amount of 12 and is mapped to + industries 111210, 111220, and 213110, a flow amount of 3 will be + attributed to 111210, a flow amount of 3 to 111220, and a flow amount + of 6 to 213110. + + Attribution happens according to the primary sector first (see + documentation for + flowby.FlowByActivity.add_primary_secondary_sector_columns() for + details on how the primary sector is determined; in most cases, the + primary sector is the (only) non-null value out of SectorProducedBy or + SectorConsumedBy). If necessary, flow amounts are further (equally) + subdivided based on the secondary sector. + ''' + naics_key = naics.map_target_sectors_to_less_aggregated_sectors( + self.config['industry_spec']) + + fba = self.add_primary_secondary_columns('Sector') + + groupby_cols = ['group_id', 'Location'] + for rank in ['Primary', 'Secondary']: + fba = ( + fba + .merge(naics_key, how='left', left_on=f'{rank}Sector', + right_on='target_naics') + .assign( + **{f'_unique_naics_{n}_by_group': lambda x, i=n: ( + x.groupby(groupby_cols if i == 2 + else [*groupby_cols, f'_naics_{i-1}'], + dropna=False) + [[f'_naics_{i}']] + .transform('nunique', dropna=False) + ) + for n in range(2, 8)}, + FlowAmount=lambda x: reduce( + lambda x, y: x / y, + [x.FlowAmount, *[x[f'_unique_naics_{n}_by_group'] + for n in range(2, 8)]] + ) + ) + .drop(columns=naics_key.columns.values.tolist()) + ) + groupby_cols.append(f'{rank}Sector') + + return fba.drop( + columns=['PrimarySector', 'SecondarySector', + *[f'_unique_naics_{n}_by_group' for n in range(2, 8)]] + ) + + + def prepare_fbs( + self: 'FlowByActivity', + external_config_path: str = None, + download_sources_ok: bool = True + ) -> 'FlowBySector': + if 'activity_sets' in self.config: + try: + return ( + pd.concat([ + fba.prepare_fbs( + external_config_path=external_config_path, download_sources_ok=download_sources_ok) + for fba in ( + self + .select_by_fields() + .function_socket('clean_fba_before_activity_sets') + .activity_sets() + ) + ]) + .reset_index(drop=True) + ) + except ValueError: + return FlowBySector(pd.DataFrame()) + log.info(f'Processing FlowBySector for {self.full_name}') + # Primary FlowBySector generation approach: + return FlowBySector( + self + .function_socket('clean_fba_before_mapping') + .select_by_fields() + .function_socket('estimate_suppressed') + .select_by_fields(selection_fields=self.config.get( + 'selection_fields_after_data_suppression_estimation')) + .convert_units_and_flows() # and also map to flow lists + .function_socket('clean_fba') + .convert_to_geoscale() + .attribute_flows_to_sectors(external_config_path=external_config_path, + download_sources_ok=download_sources_ok) # recursive call to prepare_fbs + .drop(columns=['ActivityProducedBy', 'ActivityConsumedBy']) + .aggregate_flowby() + ) + + def activity_sets(self) -> List['FlowByActivity']: + ''' + This function breaks up an FBA dataset into its activity sets, if its + config dictionary specifies activity sets, and returns a list of the + resulting FBAs. Otherwise, it returns a list containing the calling + FBA. + + Activity sets are determined by the selection_field key under each + activity set name. An error will be logged if any rows from the calling + FBA are assigned to multiple activity sets. + ''' + if 'activity_sets' not in self.config: + return [self] + + log.info('Splitting %s into activity sets', self.full_name) + activities = self.config['activity_sets'] + parent_config = {k: v for k, v in self.config.items() + if k not in ['activity_sets', + 'clean_fba_before_activity_sets'] + and not k.startswith('_')} + parent_fba = self.reset_index().rename(columns={'index': 'row'}) + + child_fba_list = [] + assigned_rows = set() + for activity_set, activity_config in activities.items(): + log.info('Creating FlowByActivity for %s', activity_set) + + child_fba = ( + parent_fba + .add_full_name( + f'{parent_fba.full_name}{NAME_SEP_CHAR}{activity_set}') + .select_by_fields( + selection_fields=activity_config.get('selection_fields'), + exclusion_fields=activity_config.get('exclusion_fields')) + ) + + child_fba.config = {**parent_config, **activity_config} + child_fba = child_fba.assign(SourceName=child_fba.full_name) + + if set(child_fba.row) & assigned_rows: + log.critical( + 'Some rows from %s assigned to multiple activity ' + 'sets. This will lead to double-counting:\n%s', + parent_fba.full_name, + child_fba.query( + f'row in {list(set(child_fba.row) & assigned_rows)}' + ) + ) + # raise ValueError('Some rows in multiple activity sets') + + assigned_rows.update(child_fba.row) + if not child_fba.empty: + child_fba_list.append(child_fba.drop(columns='row')) + else: + log.error('Activity set %s is empty. Check activity set ' + 'definition!', child_fba.full_name) + + if set(parent_fba.row) - assigned_rows: + log.warning('Some rows from %s not assigned to an activity ' + 'set. Is this intentional?', parent_fba.full_name) + unassigned = parent_fba.query('row not in @assigned_rows') + + return child_fba_list + + def convert_units_and_flows( + self: 'FlowByActivity' + ) -> 'FlowByActivity': + if 'emissions_factors' in self.config: + self = self.convert_activity_to_emissions() + if 'adjustment_factor' in self.config: + # ^^^ TODO: There has to be a better way to do this. + self = self.assign(FlowAmount=self.FlowAmount + * self.config['adjustment_factor']) + + self = self.convert_daily_to_annual() + if self.config.get('fedefl_mapping'): + mapped = self.map_to_fedefl_list( + drop_unmapped_rows=self.config.get('drop_unmapped_rows', False) + ) + else: + mapped = self.rename(columns={'FlowName': 'Flowable', + 'Compartment': 'Context'}) + return (mapped.standardize_units()) + + def convert_activity_to_emissions( + self: 'FlowByActivity' + ) -> 'FlowByActivity': + ''' + This method converts flows of an activity (most commonly a measure of + fuel burned) into flows of one or more pollutants. This is a first + draft, so it may need some refinement. + + Emissions factors may be specified in a .csv file, with whatever + columns need to be matched on for accurate conversion from activity to + emissions. + ''' + emissions_factors = ( + pd.read_csv( + settings.datapath / f'{self.config["emissions_factors"]}.csv') + .drop(columns='source') + ) + + emissions_fba = ( + self + .merge(emissions_factors, how='left') + .assign(FlowName=lambda x: x.pollutant, + FlowAmount=lambda x: x.FlowAmount * x.emissions_factor, + Unit=lambda x: x.target_unit, + Class='Chemicals', + FlowType='ELEMENTARY_FLOW') + .drop(columns=['pollutant', 'target_unit', 'emissions_factor']) + .add_primary_secondary_columns('Activity') + .assign(ActivityProducedBy=lambda x: x.PrimaryActivity, + ActivityConsumedBy=lambda x: x.SecondaryActivity) + # ^^^ TODO: This is a line I'm quite skeptical of. There's got to + # be a better way to do this. Maybe specify in the config? + .drop(columns=['PrimaryActivity', 'SecondaryActivity']) + ) + return emissions_fba diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index 66b498124..b2e893738 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -1,12 +1,13 @@ import numpy as np import pandas as pd -from flowsa.flowby import FlowBySector, FB, get_flowby_from_config +from flowsa.flowby import FB, get_flowby_from_config from flowsa.common import get_catalog_info from flowsa.flowsa_log import log -from flowsa import (geo, location, FlowByActivity) +from flowsa import (geo, location, FlowByActivity, FlowBySector) from flowsa.naics import map_source_sectors_to_more_aggregated_sectors from flowsa.validation import compare_summation_at_sector_lengths_between_two_dfs + def return_primary_activity_column(fba: FlowByActivity) -> \ FlowByActivity: """ diff --git a/flowsa/flowbysector.py b/flowsa/flowbysector.py new file mode 100644 index 000000000..e4a22d502 --- /dev/null +++ b/flowsa/flowbysector.py @@ -0,0 +1,327 @@ +import esupy.processed_data_mgmt +import pandas as pd +from pandas import ExcelWriter + +from flowsa import settings, metadata, common, exceptions, log, geo, naics +from flowsa.common import get_catalog_info +from flowsa.flowby import _FlowBy, flowby_config, get_flowby_from_config +from flowsa.flowbyseries import _FBSSeries +from flowsa.flowsa_log import reset_log_file + + +class FlowBySector(_FlowBy): + _metadata = [*_FlowBy()._metadata] + + def __init__( + self, + data: pd.DataFrame or '_FlowBy' = None, + *args, + collapsed: bool = False, + w_activity: bool = False, + **kwargs + ) -> None: + if isinstance(data, pd.DataFrame): + collapsed = collapsed or any( + [c in data.columns for c in flowby_config['_collapsed_fields']] + ) + w_activity = w_activity or any( + [c in data.columns for c in flowby_config['_activity_fields']] + ) + + if collapsed: + fields = flowby_config['fbs_collapsed_fields'] + elif w_activity: + fields = flowby_config['fbs_w_activity_fields'] + else: + fields = flowby_config['fbs_fields'] + + column_order = flowby_config['fbs_column_order'] + else: + fields = None + column_order = None + + super().__init__(data, + fields=fields, + column_order=column_order, + *args, **kwargs) + + @property + def _constructor(self) -> 'FlowBySector': + return FlowBySector + + @property + def _constructor_sliced(self) -> '_FBSSeries': + return _FBSSeries + + @classmethod + def getFlowBySector( + cls, + method: str, + config: dict = None, + external_config_path: str = None, + download_sources_ok: bool = settings.DEFAULT_DOWNLOAD_IF_MISSING, + download_fbs_ok: bool = settings.DEFAULT_DOWNLOAD_IF_MISSING, + **kwargs + ) -> 'FlowBySector': + ''' + Loads stored FlowBySector output. If it is not + available, tries to download it from EPA's remote server (if + download_ok is True), or generate it. + :param method: string, name of the FBS attribution method file to use + :param external_config_path: str, path to the FBS method file if + loading a file from outside the flowsa repository + :param download_fba_ok: bool, if True will attempt to load FBAs + used in generating the FBS from EPA's remote server rather than + generating (if not found locally) + :param download_FBS_if_missing: bool, if True will attempt to load the + FBS from EPA's remote server rather than generating it + (if not found locally) + :kwargs: keyword arguments to pass to _getFlowBy(). Possible kwargs + include full_name and config. + :return: FlowBySector dataframe + ''' + file_metadata = metadata.set_fb_meta(method, 'FlowBySector') + + if config is None: + try: + config = common.load_yaml_dict(method, 'FBS', + external_config_path) + except exceptions.FlowsaMethodNotFoundError: + config = {} + + flowby_generator = ( + lambda x=method, y=external_config_path, z=download_sources_ok: + cls.generateFlowBySector(x, y, z) + ) + return super()._getFlowBy( + file_metadata=file_metadata, + download_ok=download_fbs_ok, + flowby_generator=flowby_generator, + output_path=settings.fbsoutputpath, + full_name=method, + config=config, + **kwargs + ) + + @classmethod + def generateFlowBySector( + cls, + method: str, + external_config_path: str = None, + download_sources_ok: bool = settings.DEFAULT_DOWNLOAD_IF_MISSING, + ) -> 'FlowBySector': + ''' + Generates a FlowBySector dataset. + :param method: str, name of FlowBySector method .yaml file to use. + :param external_config_path: str, optional. If given, tells flowsa + where to look for the method yaml specified above. + :param download_fba_ok: bool, optional. Whether to attempt to download + source data FlowByActivity files from EPA server rather than + generating them. + ''' + log.info('Beginning FlowBySector generation for %s', method) + method_config = common.load_yaml_dict(method, 'FBS', + external_config_path) + + # Cache one or more sources by attaching to method_config + to_cache = method_config.pop('sources_to_cache', {}) + if 'cache' in method_config: + log.warning('Config key "cache" for %s about to be overwritten', + method) + + method_config['cache'] = {} + for source_name, config in to_cache.items(): + method_config['cache'][source_name] = ( + get_flowby_from_config( + name=source_name, + config={ + **method_config, + 'method_config_keys': method_config.keys(), + **get_catalog_info(source_name), + **config + }, + external_config_path=external_config_path, + download_sources_ok=download_sources_ok + ).prepare_fbs(external_config_path=external_config_path, download_sources_ok=download_sources_ok) + ) + # ^^^ This is done with a for loop instead of a dict comprehension + # so that later entries in method_config['sources_to_cache'] + # can make use of the cached copy of an earlier entry. + + # Generate FBS from method_config + sources = method_config.pop('source_names') + + fbs = pd.concat([ + get_flowby_from_config( + name=source_name, + config={ + **method_config, + 'method_config_keys': method_config.keys(), + **get_catalog_info(source_name), + **config + }, + external_config_path=external_config_path, + download_sources_ok=download_sources_ok + ).prepare_fbs(external_config_path=external_config_path, + download_sources_ok=download_sources_ok) + for source_name, config in sources.items() + ]) + + fbs.full_name = method + fbs.config = method_config + + # drop year from LocationSystem for FBS use with USEEIO + fbs['LocationSystem'] = fbs['LocationSystem'].str.split('_').str[0] + # aggregate to target geoscale + fbs = ( + fbs + .convert_fips_to_geoscale( + geo.scale.from_string(fbs.config.get('geoscale'))) + .aggregate_flowby() + ) + # aggregate to target sector + fbs = fbs.sector_aggregation() + + # set all data quality fields to none until implemented fully + log.info('Reset all data quality fields to None') + dq_cols = ['Spread', 'Min', 'Max', + 'DataReliability', 'TemporalCorrelation', + 'GeographicalCorrelation', 'TechnologicalCorrelation', + 'DataCollection'] + fbs = fbs.assign(**dict.fromkeys(dq_cols, None)) + + # Save fbs and metadata + log.info(f'FBS generation complete, saving {method} to file') + meta = metadata.set_fb_meta(method, 'FlowBySector') + esupy.processed_data_mgmt.write_df_to_file(fbs, settings.paths, meta) + reset_log_file(method, meta) + metadata.write_metadata(source_name=method, + config=common.load_yaml_dict( + method, 'FBS', external_config_path), + fb_meta=meta, + category='FlowBySector') + + return fbs + + def sector_aggregation(self): + """ + In the event activity sets in an FBS are at a less aggregated target + sector level than the overall target level, aggregate the sectors to + the FBS target scale + :return: + """ + naics_key = naics.industry_spec_key(self.config['industry_spec']) + + fbs = self + for direction in ['ProducedBy', 'ConsumedBy']: + fbs = ( + fbs + .rename(columns={f'Sector{direction}': 'source_naics'}) + .merge(naics_key, + how='left') + .rename(columns={'target_naics': f'Sector{direction}'}) + .drop(columns='source_naics') + .aggregate_flowby() + ) + + return fbs + + def prepare_fbs( + self: 'FlowBySector', + external_config_path: str = None, + download_sources_ok: bool = True + ) -> 'FlowBySector': + if 'activity_sets' in self.config: + try: + return ( + pd.concat([ + fbs.prepare_fbs() + for fbs in ( + self + .select_by_fields() + .activity_sets() + ) + ]) + .reset_index(drop=True) + ) + except ValueError: + return FlowBySector(pd.DataFrame()) + return ( + self + .function_socket('clean_fbs') + .select_by_fields() + .sector_aggregation() # convert to proper industry spec. + .convert_fips_to_geoscale() + .attribute_flows_to_sectors(external_config_path=external_config_path, + download_sources_ok=download_sources_ok) + .aggregate_flowby() # necessary after consolidating geoscale + ) + + + def display_tables( + self: 'FlowBySector', + display_tables: dict = None + ) -> pd.DataFrame: + display_tables = display_tables or self.config.get('display_tables') + if display_tables is None: + log.error('Cannot generate display tables, since no configuration ' + 'is specified for them') + return None + + def convert_industry_spec( + fb_at_source_naics: 'FlowBySector', + industry_spec: dict = None + ) -> 'FlowBySector': + ''' + This is here because it's only for display purposes. It can be + replaced once there's a proper method for converting an FBS to + a new industry_spec + ''' + if industry_spec is None: + return fb_at_source_naics + fb_at_target_naics = ( + fb_at_source_naics + .merge(naics.industry_spec_key(industry_spec), + how='left', + left_on='SectorProducedBy', right_on='source_naics') + .assign( + SectorProducedBy=lambda x: + x.SectorProducedBy.mask(x.SectorProducedBy.str.len() + >= x.target_naics.str.len(), + x.target_naics) + ) + .drop(columns=['target_naics', 'source_naics']) + .aggregate_flowby() + ) + return fb_at_target_naics + + table_dict = { + table_name: ( + self + .select_by_fields(table_config.get('selection_fields')) + .pipe(convert_industry_spec, table_config.get('industry_spec')) + [['Flowable', 'Unit', 'SectorProducedBy', 'FlowAmount']] + .rename(columns={'Flowable': 'Pollutant', + 'SectorProducedBy': 'Industry', + 'FlowAmount': 'Amount'}) + .replace(table_config.get('replace_dict', {})) + .assign(Pollutant=lambda x: x.Pollutant + ' (' + x.Unit + ')') + .drop(columns='Unit') + .groupby(['Pollutant', 'Industry']).agg('sum') + .reset_index() + .pivot(index='Pollutant', columns='Industry', values='Amount') + ) + for table_name, table_config in display_tables.items() + } + + tables_path = (settings.tableoutputpath / f'{self.full_name}' + f'_Display_Tables.xlsx') + try: + with ExcelWriter(tables_path) as writer: + for name, table in table_dict.items(): + table.to_excel(writer, name) + except PermissionError: + log.warning(f'Permission to write display tables for ' + f'{self.full_name} to {tables_path} denied.') + + return table_dict diff --git a/flowsa/flowbyseries.py b/flowsa/flowbyseries.py new file mode 100644 index 000000000..c88dd06dc --- /dev/null +++ b/flowsa/flowbyseries.py @@ -0,0 +1,46 @@ +import pandas as pd + +from flowsa import FlowByActivity, FlowBySector +from flowsa.flowby import _FlowBy + + +# The three classes extending pd.Series, together with the _constructor... +# methods of each class, are required for allowing pandas methods called on +# objects of these classes to return objects of these classes, as desired. +# For more information, see +# https://pandas.pydata.org/docs/development/extending.html + +class _FlowBySeries(pd.Series): + _metadata = [*_FlowBy()._metadata] + + @property + def _constructor(self) -> '_FlowBySeries': + return _FlowBySeries + + @property + def _constructor_expanddim(self) -> '_FlowBy': + return _FlowBy + + +class _FBASeries(pd.Series): + _metadata = [*FlowByActivity()._metadata] + + @property + def _constructor(self) -> '_FBASeries': + return _FBASeries + + @property + def _constructor_expanddim(self) -> 'FlowByActivity': + return FlowByActivity + + +class _FBSSeries(pd.Series): + _metadata = [*FlowBySector()._metadata] + + @property + def _constructor(self) -> '_FBSSeries': + return _FBSSeries + + @property + def _constructor_expanddim(self) -> 'FlowBySector': + return FlowBySector diff --git a/flowsa/test_FBS_against_remote.py b/flowsa/test_FBS_against_remote.py index 338e7b203..8dbedd96f 100644 --- a/flowsa/test_FBS_against_remote.py +++ b/flowsa/test_FBS_against_remote.py @@ -5,9 +5,8 @@ import pytest import os -from flowsa import seeAvailableFlowByModels +from flowsa import seeAvailableFlowByModels, FlowBySector from flowsa.common import check_method_status -from flowsa.flowby import FlowBySector from flowsa.settings import diffpath from flowsa.test_single_FBS import compare_single_FBS_against_remote diff --git a/flowsa/test_single_FBS.py b/flowsa/test_single_FBS.py index e44aa2a2f..25445a2ea 100644 --- a/flowsa/test_single_FBS.py +++ b/flowsa/test_single_FBS.py @@ -3,7 +3,7 @@ """ import pytest import os -from flowsa.flowby import FlowBySector +from flowsa import FlowBySector from flowsa.metadata import set_fb_meta from flowsa.settings import paths, diffpath from flowsa.validation import compare_FBS_results diff --git a/flowsa/validation.py b/flowsa/validation.py index c9c368c56..00ed55438 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -8,7 +8,7 @@ import pandas as pd import numpy as np import flowsa -from flowsa.flowby import FlowBySector +from flowsa import FlowBySector from flowsa.flowbyfunctions import aggregator, collapse_fbs_sectors from flowsa.flowsa_log import log, vlog from flowsa.common import fba_activity_fields From 2f45b088536d76814889cfe54bc605161bc7bf65 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 24 Aug 2023 20:06:17 -0600 Subject: [PATCH 0821/1127] correct import statements --- flowsa/data_source_scripts/BLS_QCEW.py | 2 +- flowsa/data_source_scripts/EIA_MECS.py | 2 +- flowsa/data_source_scripts/EPA_GHGI.py | 2 +- flowsa/data_source_scripts/EPA_NEI.py | 2 +- flowsa/data_source_scripts/EPA_REI.py | 2 +- flowsa/data_source_scripts/EPA_SIT.py | 2 +- flowsa/data_source_scripts/EPA_StateGHGI.py | 2 +- flowsa/data_source_scripts/EPA_WFR.py | 2 +- flowsa/data_source_scripts/USDA_ERS_MLU.py | 2 +- flowsa/data_source_scripts/USDA_IWMS.py | 4 +--- flowsa/data_source_scripts/USGS_NWIS_WU.py | 2 +- flowsa/data_source_scripts/stewiFBS.py | 3 ++- flowsa/data_source_scripts/temp_data_source_functions.py | 2 +- flowsa/flowbyseries.py | 3 ++- flowsa/metadata.py | 2 +- flowsa/test_single_FBS.py | 2 +- flowsa/validation.py | 2 +- 17 files changed, 19 insertions(+), 19 deletions(-) diff --git a/flowsa/data_source_scripts/BLS_QCEW.py b/flowsa/data_source_scripts/BLS_QCEW.py index d2e1899a9..25f243b1c 100644 --- a/flowsa/data_source_scripts/BLS_QCEW.py +++ b/flowsa/data_source_scripts/BLS_QCEW.py @@ -18,7 +18,7 @@ import numpy as np from flowsa.location import US_FIPS from flowsa.flowbyfunctions import assign_fips_location_system -from flowsa import FlowByActivity +from flowsa.flowbyactivity import FlowByActivity from flowsa.flowsa_log import log from flowsa.naics import industry_spec_key diff --git a/flowsa/data_source_scripts/EIA_MECS.py b/flowsa/data_source_scripts/EIA_MECS.py index 765dbb04a..cfff664cf 100644 --- a/flowsa/data_source_scripts/EIA_MECS.py +++ b/flowsa/data_source_scripts/EIA_MECS.py @@ -14,7 +14,7 @@ from flowsa.location import US_FIPS, get_region_and_division_codes from flowsa.common import WITHDRAWN_KEYWORD from flowsa.flowsa_log import log -from flowsa import FlowByActivity +from flowsa.flowbyactivity import FlowByActivity from flowsa.flowbyclean import load_prepare_clean_source from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.data_source_scripts.EIA_CBECS_Land import \ diff --git a/flowsa/data_source_scripts/EPA_GHGI.py b/flowsa/data_source_scripts/EPA_GHGI.py index dbf94041d..6c258894e 100644 --- a/flowsa/data_source_scripts/EPA_GHGI.py +++ b/flowsa/data_source_scripts/EPA_GHGI.py @@ -15,7 +15,7 @@ from flowsa.flowsa_log import log from flowsa.settings import externaldatapath from flowsa.schema import flow_by_activity_fields -from flowsa import FlowByActivity +from flowsa.flowbyactivity import FlowByActivity SECTOR_DICT = {'Res.': 'Residential', 'Comm.': 'Commercial', diff --git a/flowsa/data_source_scripts/EPA_NEI.py b/flowsa/data_source_scripts/EPA_NEI.py index 0a613be45..354c456a4 100644 --- a/flowsa/data_source_scripts/EPA_NEI.py +++ b/flowsa/data_source_scripts/EPA_NEI.py @@ -12,7 +12,7 @@ import numpy as np from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.dataclean import standardize_units -from flowsa import FlowByActivity +from flowsa.flowbyactivity import FlowByActivity from flowsa.flowsa_log import log from flowsa.location import merge_urb_cnty_pct diff --git a/flowsa/data_source_scripts/EPA_REI.py b/flowsa/data_source_scripts/EPA_REI.py index 9b2e82350..2f359d8db 100644 --- a/flowsa/data_source_scripts/EPA_REI.py +++ b/flowsa/data_source_scripts/EPA_REI.py @@ -7,7 +7,7 @@ import numpy as np from flowsa.location import US_FIPS from flowsa.flowbyfunctions import assign_fips_location_system -from flowsa import FlowBySector +from flowsa.flowbysector import FlowBySector def rei_url_helper(*, build_url, config, **_): diff --git a/flowsa/data_source_scripts/EPA_SIT.py b/flowsa/data_source_scripts/EPA_SIT.py index 5cd3b2293..daaf6e069 100644 --- a/flowsa/data_source_scripts/EPA_SIT.py +++ b/flowsa/data_source_scripts/EPA_SIT.py @@ -9,7 +9,7 @@ import pandas as pd import os from flowsa.settings import externaldatapath -from flowsa import FlowByActivity +from flowsa.flowbyactivity import FlowByActivity from flowsa.flowbyfunctions import assign_fips_location_system, \ load_fba_w_standardized_units from flowsa.flowsa_log import log diff --git a/flowsa/data_source_scripts/EPA_StateGHGI.py b/flowsa/data_source_scripts/EPA_StateGHGI.py index c4479781a..f46af50da 100644 --- a/flowsa/data_source_scripts/EPA_StateGHGI.py +++ b/flowsa/data_source_scripts/EPA_StateGHGI.py @@ -7,7 +7,7 @@ import pandas as pd import io from zipfile import ZipFile -from flowsa import FlowByActivity +from flowsa.flowbyactivity import FlowByActivity from flowsa.flowsa_log import log from flowsa.location import apply_county_FIPS from flowsa.flowbyfunctions import assign_fips_location_system diff --git a/flowsa/data_source_scripts/EPA_WFR.py b/flowsa/data_source_scripts/EPA_WFR.py index f5695827b..0216d9bd5 100644 --- a/flowsa/data_source_scripts/EPA_WFR.py +++ b/flowsa/data_source_scripts/EPA_WFR.py @@ -12,7 +12,7 @@ from tabula.io import read_pdf from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.location import US_FIPS -from flowsa import FlowByActivity +from flowsa.flowbyactivity import FlowByActivity def epa_wfr_call(*, resp, **_): diff --git a/flowsa/data_source_scripts/USDA_ERS_MLU.py b/flowsa/data_source_scripts/USDA_ERS_MLU.py index 8a068aef2..15b54780b 100644 --- a/flowsa/data_source_scripts/USDA_ERS_MLU.py +++ b/flowsa/data_source_scripts/USDA_ERS_MLU.py @@ -22,7 +22,7 @@ get_urban_land_use_for_airports, \ get_urban_land_use_for_railroads, get_open_space_fraction_of_urban_area from flowsa.validation import compare_df_units -from flowsa import FlowByActivity +from flowsa.flowbyactivity import FlowByActivity from flowsa.naics import industry_spec_key diff --git a/flowsa/data_source_scripts/USDA_IWMS.py b/flowsa/data_source_scripts/USDA_IWMS.py index 92b75d0db..bcb2d8a9c 100644 --- a/flowsa/data_source_scripts/USDA_IWMS.py +++ b/flowsa/data_source_scripts/USDA_IWMS.py @@ -14,9 +14,7 @@ from flowsa.common import WITHDRAWN_KEYWORD from flowsa.flowbyfunctions import assign_fips_location_system, \ load_fba_w_standardized_units, filter_by_geoscale -# from flowsa.data_source_scripts.USDA_CoA_Cropland import disaggregate_pastureland, \ -# disaggregate_cropland -from flowsa import FlowByActivity +from flowsa.flowbyactivity import FlowByActivity def iwms_url_helper(*, build_url, config, **_): diff --git a/flowsa/data_source_scripts/USGS_NWIS_WU.py b/flowsa/data_source_scripts/USGS_NWIS_WU.py index 8077889bc..fcda31ab2 100644 --- a/flowsa/data_source_scripts/USGS_NWIS_WU.py +++ b/flowsa/data_source_scripts/USGS_NWIS_WU.py @@ -15,7 +15,7 @@ from flowsa.flowsa_log import vlog from flowsa.validation import compare_df_units, \ calculate_flowamount_diff_between_dfs -from flowsa import FlowByActivity +from flowsa.flowbyactivity import FlowByActivity def usgs_URL_helper(*, build_url, config, **_): diff --git a/flowsa/data_source_scripts/stewiFBS.py b/flowsa/data_source_scripts/stewiFBS.py index f1aaacf11..38bfd49f3 100644 --- a/flowsa/data_source_scripts/stewiFBS.py +++ b/flowsa/data_source_scripts/stewiFBS.py @@ -15,7 +15,8 @@ from esupy.processed_data_mgmt import read_source_metadata import flowsa.flowbysector -from flowsa import FlowBySector, FlowByActivity +from flowsa.flowbysector import FlowBySector +from flowsa.flowbyactivity import FlowByActivity from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.flowsa_log import log from flowsa.location import apply_county_FIPS, update_geoscale diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py index f99543e63..ea9e7de21 100644 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ b/flowsa/data_source_scripts/temp_data_source_functions.py @@ -1,5 +1,5 @@ from flowsa.data_source_scripts import EPA_GHGI as ghgi -from flowsa import FlowByActivity +from flowsa.flowbyactivity import FlowByActivity def clean_mecs_energy_fba_for_bea_summary(fba: FlowByActivity, **kwargs): diff --git a/flowsa/flowbyseries.py b/flowsa/flowbyseries.py index c88dd06dc..50ee34981 100644 --- a/flowsa/flowbyseries.py +++ b/flowsa/flowbyseries.py @@ -1,6 +1,7 @@ import pandas as pd -from flowsa import FlowByActivity, FlowBySector +from flowsa.flowbyactivity import FlowByActivity +from flowsa.flowbysector import FlowBySector from flowsa.flowby import _FlowBy diff --git a/flowsa/metadata.py b/flowsa/metadata.py index 98fd82fd9..aa7a3f9bf 100644 --- a/flowsa/metadata.py +++ b/flowsa/metadata.py @@ -212,7 +212,7 @@ def getMetadata(source, year=None, category=None): :param category: string, 'FlowBySector' or 'FlowByActivity' :return: meta object, previously generated FBA or FBS meta """ - from flowsa.flowbyactivity import set_fba_name + from flowsa.generateflowbyactivity import set_fba_name if category is None: log.error('Category required, specify "FlowByActivity" or ' diff --git a/flowsa/test_single_FBS.py b/flowsa/test_single_FBS.py index 25445a2ea..b98c50c87 100644 --- a/flowsa/test_single_FBS.py +++ b/flowsa/test_single_FBS.py @@ -3,7 +3,7 @@ """ import pytest import os -from flowsa import FlowBySector +from flowsa.flowbysector import FlowBySector from flowsa.metadata import set_fb_meta from flowsa.settings import paths, diffpath from flowsa.validation import compare_FBS_results diff --git a/flowsa/validation.py b/flowsa/validation.py index 00ed55438..013ef02c1 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -8,7 +8,7 @@ import pandas as pd import numpy as np import flowsa -from flowsa import FlowBySector +from flowsa.flowbysector import FlowBySector from flowsa.flowbyfunctions import aggregator, collapse_fbs_sectors from flowsa.flowsa_log import log, vlog from flowsa.common import fba_activity_fields From ae0aaab5542da2661ec041f82095ce606b73c267 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 24 Aug 2023 20:07:15 -0600 Subject: [PATCH 0822/1127] address circular reasoning import errors --- flowsa/flowby.py | 11 ++++++++--- flowsa/flowbyactivity.py | 12 ++++++------ flowsa/flowbysector.py | 3 +-- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index bd2e0704f..be29c9a53 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -3,10 +3,8 @@ import numpy as np from functools import partial, reduce from copy import deepcopy -from flowsa import (settings, literature_values, flowsa_yaml, geo, schema, - FlowBySector, FlowByActivity) +from flowsa import (settings, literature_values, flowsa_yaml, geo, schema) from flowsa.common import get_catalog_info -from flowsa.flowbyseries import _FlowBySeries from flowsa.flowsa_log import log, vlog import esupy.processed_data_mgmt import esupy.dqi @@ -35,6 +33,9 @@ def get_flowby_from_config( :return: a FlowByActivity dataframe """ + from flowsa.flowbyactivity import FlowByActivity + from flowsa.flowbysector import FlowBySector + external_data_path = config.get('external_data_path') if config['data_format'] == 'FBA': @@ -142,6 +143,7 @@ def _constructor(self) -> '_FlowBy': @property def _constructor_sliced(self) -> '_FlowBySeries': + from flowsa.flowbyseries import _FlowBySeries return _FlowBySeries def __finalize__(self, other, method=None, **kwargs): @@ -1296,6 +1298,9 @@ def add_primary_secondary_columns( columns added, if possible; otherwise, the unmodified caling FlowBy dataset. ''' + + from flowsa.flowbyseries import _FlowBySeries + if (f'{col_type}ProducedBy' not in self or f'{col_type}ConsumedBy' not in self): log.error(f'Cannot add Primary{col_type} or Secondary{col_type} ' diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index 0152b89e1..13d8721d0 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -1,13 +1,10 @@ from functools import partial, reduce from typing import Literal, List - import fedelemflowlist import pandas as pd - from flowsa import settings, metadata, log, geo, validation, naics, common, \ - sectormapping, FlowBySector + sectormapping, generateflowbyactivity from flowsa.flowby import _FlowBy, flowby_config, NAME_SEP_CHAR -from flowsa.flowbyseries import _FBASeries class FlowByActivity(_FlowBy): @@ -54,6 +51,7 @@ def _constructor(self) -> 'FlowByActivity': @property def _constructor_sliced(self) -> '_FBASeries': + from flowsa.flowbyseries import _FBASeries return _FBASeries @classmethod @@ -85,7 +83,7 @@ def getFlowByActivity( 'FlowByActivity' ) flowby_generator = partial( - flowbyactivity.main, + generateflowbyactivity.main, source=full_name, year=year ) @@ -719,12 +717,14 @@ def equally_attribute(self: 'FlowByActivity') -> 'FlowByActivity': *[f'_unique_naics_{n}_by_group' for n in range(2, 8)]] ) - def prepare_fbs( self: 'FlowByActivity', external_config_path: str = None, download_sources_ok: bool = True ) -> 'FlowBySector': + + from flowsa import FlowBySector + if 'activity_sets' in self.config: try: return ( diff --git a/flowsa/flowbysector.py b/flowsa/flowbysector.py index e4a22d502..2664eb1c9 100644 --- a/flowsa/flowbysector.py +++ b/flowsa/flowbysector.py @@ -1,11 +1,9 @@ import esupy.processed_data_mgmt import pandas as pd from pandas import ExcelWriter - from flowsa import settings, metadata, common, exceptions, log, geo, naics from flowsa.common import get_catalog_info from flowsa.flowby import _FlowBy, flowby_config, get_flowby_from_config -from flowsa.flowbyseries import _FBSSeries from flowsa.flowsa_log import reset_log_file @@ -51,6 +49,7 @@ def _constructor(self) -> 'FlowBySector': @property def _constructor_sliced(self) -> '_FBSSeries': + from flowsa.flowbyseries import _FBSSeries return _FBSSeries @classmethod From 1c4a1e2c54f2dddb21fbe2b00069fad14d70bf4c Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 25 Aug 2023 10:02:47 -0400 Subject: [PATCH 0823/1127] ensure strings are reset to np.nan after assigning dtype --- flowsa/dataclean.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flowsa/dataclean.py b/flowsa/dataclean.py index 16332da86..8aa1ff7e5 100644 --- a/flowsa/dataclean.py +++ b/flowsa/dataclean.py @@ -85,7 +85,10 @@ def add_missing_flow_by_fields(flowby_partial_df, flowbyfields): flowby_partial_df[k] = flowby_partial_df[k].fillna(np.nan) else: flowby_partial_df[k] = flowby_partial_df[k].fillna(0) - + # convert all None, 'nan' to np.nan + flowby_partial_df = (flowby_partial_df + .replace('None', np.nan) + .replace('nan', np.nan)) # Resort it so order is correct cols = [e for e in flowbyfields.keys() if e in flowby_partial_df.columns] flowby_df = flowby_partial_df[cols] From 75c33c0c2a391fa716bbadba62a8ee6e19e5a9dc Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 25 Aug 2023 08:25:13 -0600 Subject: [PATCH 0824/1127] add py file descriptions --- flowsa/flowby.py | 5 +++++ flowsa/flowbyactivity.py | 10 ++++++++++ flowsa/flowbysector.py | 6 ++++++ flowsa/flowbyseries.py | 16 +++++++++------- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index be29c9a53..ac2a62f6c 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1,3 +1,8 @@ +""" +The functions defined in this script can be applied to both +FlowByActivity and FlowBySector classes. +""" + from typing import List, Literal, TypeVar import pandas as pd import numpy as np diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index 13d8721d0..64e12e1d4 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -1,3 +1,13 @@ +""" +FlowByActivity (FBA) data are attributed to a class, allowing the configuration +file and other attributes to be attached to the FBA object. The functions +defined in this file are specific to FBA data and. + +Generation of FBA datasets calls on the functions defined in +gerneateflowbyactivity.py + +""" + from functools import partial, reduce from typing import Literal, List import fedelemflowlist diff --git a/flowsa/flowbysector.py b/flowsa/flowbysector.py index 2664eb1c9..0671cd469 100644 --- a/flowsa/flowbysector.py +++ b/flowsa/flowbysector.py @@ -1,3 +1,9 @@ +""" +FlowBySector (FBS) data are attributed to a class, allowing the configuration +file and other attributes to be attached to the FBS object. The functions +defined in this file are specific to FBS data. +""" + import esupy.processed_data_mgmt import pandas as pd from pandas import ExcelWriter diff --git a/flowsa/flowbyseries.py b/flowsa/flowbyseries.py index 50ee34981..9c2a87a14 100644 --- a/flowsa/flowbyseries.py +++ b/flowsa/flowbyseries.py @@ -1,16 +1,18 @@ -import pandas as pd +""" +The three classes extending pd.Series, together with the _constructor... +methods of each class, are required for allowing pandas methods called on +objects of these classes to return objects of these classes, as desired. + +For more information, see +https://pandas.pydata.org/docs/development/extending.html +""" +import pandas as pd from flowsa.flowbyactivity import FlowByActivity from flowsa.flowbysector import FlowBySector from flowsa.flowby import _FlowBy -# The three classes extending pd.Series, together with the _constructor... -# methods of each class, are required for allowing pandas methods called on -# objects of these classes to return objects of these classes, as desired. -# For more information, see -# https://pandas.pydata.org/docs/development/extending.html - class _FlowBySeries(pd.Series): _metadata = [*_FlowBy()._metadata] From 095a411ee468b03e62c5e3f262ee44f1aab301ce Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 25 Aug 2023 12:26:24 -0400 Subject: [PATCH 0825/1127] expand industial HFCS to more sectors to match national model --- .../activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index 4cbaf2210..611c14776 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -200,6 +200,10 @@ EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,71,,ods_substitutes EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,72,,ods_substitutes EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,81,,ods_substitutes +EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,11,,ods_substitutes +EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,21,,ods_substitutes +EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,2212,,ods_substitutes +EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,23,,ods_substitutes EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,31,,ods_substitutes EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,32,,ods_substitutes EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,33,,ods_substitutes From ec2e3297416365b8607e916e1986ee0d3ddc847d Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 25 Aug 2023 13:23:19 -0400 Subject: [PATCH 0826/1127] CH4 and N2O emisisons from commercial combustion were improperly assigned based on use of natural gas only; split by fuel type to better attribute --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 32 +++++++------- flowsa/data_source_scripts/EPA_StateGHGI.py | 14 ++++-- .../EPA_StateGHGI_asets.csv | 2 +- .../flowbysectormethods/GHG_state_2019.yaml | 28 ++++++++++++ .../flowbysectormethods/GHG_state_common.yaml | 44 +++++++++++++++++++ 5 files changed, 99 insertions(+), 21 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index 611c14776..72ba62d64 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -58,22 +58,22 @@ EPA_State_GHGI,Industry - Coal Mining - Fugitive - Post-Mining (Underground),NAI EPA_State_GHGI,Industry - Coal Mining - Fugitive - Surface Mining,NAICS_2012_Code,2121,,direct EPA_State_GHGI,Industry - Coal Mining - Fugitive - Underground Liberated,NAICS_2012_Code,2121,,direct EPA_State_GHGI,Industry - Coal Mining - Fugitive - Underground Recovered &Used For Energy,NAICS_2012_Code,2121,,direct -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,2213,,use_table_gas -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,42,,use_table_gas -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,44,,use_table_gas -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,45,,use_table_gas -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,493,,use_table_gas -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,51,,use_table_gas -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,52,,use_table_gas -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,53,,use_table_gas -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,54,,use_table_gas -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,55,,use_table_gas -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,56,,use_table_gas -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,61,,use_table_gas -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,62,,use_table_gas -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,71,,use_table_gas -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,72,,use_table_gas -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,81,,use_table_gas +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,2213,,commercial_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,42,,commercial_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,44,,commercial_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,45,,commercial_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,493,,commercial_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,51,,commercial_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,52,,commercial_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,53,,commercial_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,54,,commercial_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,55,,commercial_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,56,,commercial_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,61,,commercial_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,62,,commercial_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,71,,commercial_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,72,,commercial_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,81,,commercial_ch4_n2o EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,2213,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,42,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,44,,use_table_coal diff --git a/flowsa/data_source_scripts/EPA_StateGHGI.py b/flowsa/data_source_scripts/EPA_StateGHGI.py index a42f0cefd..40b81021a 100644 --- a/flowsa/data_source_scripts/EPA_StateGHGI.py +++ b/flowsa/data_source_scripts/EPA_StateGHGI.py @@ -103,14 +103,19 @@ def allocate_flows_by_fuel(fba: FlowByActivity, **_) -> FlowByActivity: year = fba.config.get('year') # combine lists of activities from CO2 activity set - activity_list = [a for a in - fba.config['clean_parameter']['flow_ratio_source'] - for a in a] + alist = fba.config['clean_parameter']['flow_ratio_source'] + if any(isinstance(i, list) for i in alist): + # pulled from !index, so list of lists + activity_list = sum(alist, []) + else: + activity_list = alist source_fba = pd.concat([ flowsa.getFlowByActivity(x, year) for x in fba.config['clean_parameter']['fba_source'] ], ignore_index=True) + sector = fba.config['clean_parameter']['sector'] + # align fuel names from National GHGI (keys) with StateGHGI (values) fuels = {'Natural Gas': 'Natural Gas', 'Coal': 'Coal', @@ -118,7 +123,7 @@ def allocate_flows_by_fuel(fba: FlowByActivity, **_) -> FlowByActivity: df_list = [] for f in fuels.keys(): - df = (source_fba.query(f'ActivityProducedBy == "{f} Industrial"') + df = (source_fba.query(f'ActivityProducedBy == "{f} {sector}"') [['FlowName', 'FlowAmount']] .assign(Fuel=f) ) @@ -131,6 +136,7 @@ def allocate_flows_by_fuel(fba: FlowByActivity, **_) -> FlowByActivity: .assign(CH4=lambda x: x['CH4'] / x['CO2']) .assign(N2O=lambda x: x['N2O'] / x['CO2']) .drop(columns='CO2') + .fillna(0) ) # prepare dataframe from StateGHGI including CO2 flows by fuel type diff --git a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv index 7c7ee367f..d66fb7d29 100644 --- a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv @@ -57,7 +57,7 @@ direct,Industry - Coal Mining - Fugitive - Post-Mining (Underground),EPA_GHGI_T_ direct,Industry - Coal Mining - Fugitive - Surface Mining,EPA_GHGI_T_2_1 direct,Industry - Coal Mining - Fugitive - Underground Liberated,EPA_GHGI_T_2_1 direct,Industry - Coal Mining - Fugitive - Underground Recovered &Used For Energy,EPA_GHGI_T_2_1 -use_table_gas,Commercial - Stationary Combustion - Fossil Fuel Combustion, +commercial_ch4_n2o,Commercial - Stationary Combustion - Fossil Fuel Combustion, use_table_coal,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,EPA_GHGI_T_A_14 use_table_gas,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,EPA_GHGI_T_A_14 use_table_pet,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,EPA_GHGI_T_A_14 diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml index fca1f31c5..d48d2684c 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml @@ -49,6 +49,34 @@ source_names: selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas + commercial_ch4_n2o: # CH4 and N2O from commercial combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o + activity_sets: + coal: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) + petroleum: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + gas: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'22': ''} # Electricity and natural gas + use_table_chem: # other process use of carbonates !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem attribution_source: diff --git a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml index 0036b91b9..4268e9f6e 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml @@ -95,6 +95,49 @@ source_names: selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas + commercial_ch4_n2o: # CH4 and N2O from commercial combustion + clean_fba_before_activity_sets: !script_function:EPA_StateGHGI allocate_flows_by_fuel + clean_parameter: + flow_ratio_source: + - Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal + - Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas + - Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum + fba_source: # National tables for identifyng CH4 and N2O ratios to CO2 + - EPA_GHGI_T_3_7 + - EPA_GHGI_T_3_8 + - EPA_GHGI_T_3_9 + sector: Commercial + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv commercial_ch4_n2o + activity_sets: + coal: + selection_fields: + Description: Coal + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) + petroleum: + selection_fields: + Description: Petroleum + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + gas: + selection_fields: + Description: Natural Gas + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'22': ''} # Electricity and natural gas + industrial_coal: # CO2 from industrial coal combustion selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv industrial_coal @@ -139,6 +182,7 @@ source_names: - EPA_GHGI_T_3_7 - EPA_GHGI_T_3_8 - EPA_GHGI_T_3_9 + sector: Industrial selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv industrial_ch4_n2o activity_sets: From 78b46b58bafdbdad4e268e730e51495f379b7a22 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 25 Aug 2023 13:55:55 -0400 Subject: [PATCH 0827/1127] add gov't sectors to commercial stationary combustion and HFCs --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index 72ba62d64..575ec87b3 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -74,6 +74,7 @@ EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,71,,commercial_ch4_n2o EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,72,,commercial_ch4_n2o EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,81,,commercial_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,81,,commercial_ch4_n2o EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,2213,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,42,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,44,,use_table_coal @@ -90,6 +91,7 @@ EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combus EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,71,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,72,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,81,,use_table_coal +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,923,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,2213,,use_table_gas EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,42,,use_table_gas EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,44,,use_table_gas @@ -106,6 +108,7 @@ EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combus EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,71,,use_table_gas EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,72,,use_table_gas EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,81,,use_table_gas +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,923,,use_table_gas EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,2213,,use_table_pet EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,42,,use_table_pet EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,44,,use_table_pet @@ -122,6 +125,7 @@ EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combus EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,71,,use_table_pet EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,72,,use_table_pet EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,81,,use_table_pet +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,923,,use_table_pet EPA_State_GHGI,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation,NAICS_2012_Code,2211,,direct EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Coal,NAICS_2012_Code,2211,,direct EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Geothermal,NAICS_2012_Code,2211,,direct @@ -200,6 +204,7 @@ EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,71,,ods_substitutes EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,72,,ods_substitutes EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,81,,ods_substitutes +EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,923,,ods_substitutes EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,11,,ods_substitutes EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,21,,ods_substitutes EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,2212,,ods_substitutes From 69545c3ceed5526910d24f3b4958f3d16290ccc8 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 25 Aug 2023 12:02:36 -0600 Subject: [PATCH 0828/1127] update datapaths and convert "append" to "concat" --- scripts/AEOseriesIDs.py | 2 +- .../write_Crosswalk_BEA_2012.py | 2 +- .../write_Crosswalk_BEA_Make_Table.py | 4 +- .../write_Crosswalk_BLM_PLS.py | 15 ++- .../write_Crosswalk_BLS_GreenIndustries.py | 6 +- .../write_Crosswalk_Blackhurst_IO.py | 46 +++---- ...sswalk_CalRecycle_WasteCharacterization.py | 15 ++- .../write_Crosswalk_Census_CBP.py | 14 ++- .../write_Crosswalk_Census_VIP.py | 6 +- .../write_Crosswalk_EIA_CBECS.py | 10 +- .../write_Crosswalk_EPA_CDDPath.py | 13 +- .../write_Crosswalk_EPA_FactsAndFigures.py | 4 +- .../write_Crosswalk_EPA_REI.py | 2 +- .../write_Crosswalk_EPA_WARMer.py | 4 +- .../write_Crosswalk_EPA_WFR.py | 2 +- .../write_Crosswalk_NETL_EIA_PlantWater.py | 4 +- .../write_Crosswalk_StatCan_GDP.py | 14 ++- .../write_Crosswalk_StatCan_IWS_MI.py | 14 ++- .../write_Crosswalk_USDA_ACUP.py | 39 +++--- .../write_Crosswalk_USDA_CoA_Cropland.py | 28 ++--- .../write_Crosswalk_USDA_CoA_Livestock.py | 4 +- .../write_Crosswalk_USDA_ERS_FIWS.py | 4 +- .../write_Crosswalk_USDA_ERS_MLU.py | 76 ++++++------ .../write_Crosswalk_USDA_IWMS.py | 112 ++++++++++-------- .../write_Crosswalk_USGS_NWIS_WU.py | 98 ++++++++------- .../write_Crosswalk_USGS_WU_Coef.py | 25 ++-- .../write_FBS_activity_set_BLM_PLS.py | 2 +- .../write_FBS_activity_set_BLS_QCEW.py | 2 +- .../write_FBS_activity_set_CNHW_Food.py | 4 +- .../write_FBS_activity_set_EIA_CBECS_Land.py | 2 +- .../write_FBS_activity_set_EIA_MECS_Land.py | 2 +- .../write_FBS_activity_set_EPA_REI_waste.py | 2 +- scripts/write_BEA_Use_from_useeior.py | 4 +- scripts/write_Division_Codes_from_Census.py | 5 +- scripts/write_FIPS_from_Census.py | 2 +- scripts/write_FIPS_xwalk_from_Census.py | 16 +-- scripts/write_Larson_UrbanPublicParks_SI.py | 3 +- scripts/write_NAICS_from_useeior.py | 2 +- 38 files changed, 330 insertions(+), 279 deletions(-) diff --git a/scripts/AEOseriesIDs.py b/scripts/AEOseriesIDs.py index 63ca4f4cc..4279bf024 100644 --- a/scripts/AEOseriesIDs.py +++ b/scripts/AEOseriesIDs.py @@ -90,4 +90,4 @@ def getAEOseriesIDs(): df = df.reindex(columns=['table_name', 'series_name', 'units', 'series_id']) # save to csv - df.to_csv(externaldatapath + 'AEOseriesIDs.csv', index=False) \ No newline at end of file + df.to_csv(f"{externaldatapath}/AEOseriesIDs.csv", index=False) \ No newline at end of file diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_2012.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_2012.py index 7455459df..f0a078c88 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_2012.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_2012.py @@ -36,4 +36,4 @@ def write_BEA_crosswalk(level='Detail'): if __name__ == '__main__': write_BEA_crosswalk('Detail') - write_BEA_crosswalk('Summary') \ No newline at end of file + write_BEA_crosswalk('Summary') diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_Make_Table.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_Make_Table.py index 932f74662..e35473aca 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_Make_Table.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_Make_Table.py @@ -49,5 +49,5 @@ def assign_naics(df_load): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BLM_PLS.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BLM_PLS.py index a75decc96..fef6eaca4 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BLM_PLS.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BLM_PLS.py @@ -86,12 +86,11 @@ def assign_naics(df): df.loc[df['Activity'] == 'Hardrock - Acquired Lands Leases, Hardrock Preference Right Leases', 'Sector'] = '2122' # Nonmetallic Mineral Mining and Quarrying - df = df.append( - pd.DataFrame([['BLM_PLS', - 'Hardrock - Acquired Lands Leases, Hardrock Preference Right Leases', - '2123']], - columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( + [['BLM_PLS', 'Hardrock - Acquired Lands Leases, Hardrock Preference ' + 'Right Leases', '2123']], + columns=['ActivitySourceName', 'Activity', 'Sector'])], + ignore_index=True, sort=True) # Coal Mining df.loc[df['Activity'] == 'Logical Mining Units', 'Sector'] = '21211' @@ -196,5 +195,5 @@ def assign_naics(df): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BLS_GreenIndustries.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BLS_GreenIndustries.py index e8ca50a6f..94e560b08 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BLS_GreenIndustries.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BLS_GreenIndustries.py @@ -19,7 +19,7 @@ from flowsa.settings import datapath # read the csv loaded as a raw datafile -df_raw = pd.read_csv(datapath + "BLS_GreenIndustries_Raw.csv") +df_raw = pd.read_csv(f"{datapath}/BLS_GreenIndustries_Raw.csv") # only keep columns where naics is included in green goods and services df1 = df_raw[df_raw['Included'] == 'Y'] @@ -44,5 +44,5 @@ # reset index df3.reset_index(drop=True, inplace=True) # save as csv -df3.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_BLS_GreenIndustries.csv", index=False) +df3.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"BLS_GreenIndustries.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Blackhurst_IO.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Blackhurst_IO.py index 858c17e29..599d4aa0e 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Blackhurst_IO.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Blackhurst_IO.py @@ -40,26 +40,32 @@ def assign_naics(df_load): # reset sector value for sand, gravel, clay df.loc[df['Activity'] == '212320', 'Sector'] = '212321' - df = df.append(pd.DataFrame([['Blackhurst_IO', '212320', '212322']], - columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) - df = df.append(pd.DataFrame([['Blackhurst_IO', '212320', '212324']], - columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) - df = df.append(pd.DataFrame([['Blackhurst_IO', '212320', '212325']], - columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( + [['Blackhurst_IO','212320', '212322']], columns=[ + 'ActivitySourceName', 'Activity', 'Sector'])], + ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( + [['Blackhurst_IO', '212320', '212324']], + columns=['ActivitySourceName', 'Activity', 'Sector'] + )], ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( + [['Blackhurst_IO', '212320', '212325']], + columns=['ActivitySourceName', 'Activity', 'Sector'] + )], ignore_index=True, sort=True) df.loc[df['Activity'] == '212390', 'Sector'] = '212391' - df = df.append(pd.DataFrame([['Blackhurst_IO', '212390', '212392']], - columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) - df = df.append(pd.DataFrame([['Blackhurst_IO', '212390', '212393']], - columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) - df = df.append(pd.DataFrame([['Blackhurst_IO', '212390', '212399']], - columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( + [['Blackhurst_IO', '212390', '212392']], + columns=['ActivitySourceName', 'Activity', 'Sector'])], + ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( + [['Blackhurst_IO', '212390', '212393']], + columns=['ActivitySourceName', 'Activity', 'Sector'])], + ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( + [['Blackhurst_IO', '212390', '212399']], + columns=['ActivitySourceName', 'Activity', 'Sector'])], + ignore_index=True, sort=True) # drop two rows where Blackhurst's IO vectors do not align with the # NAICS to BEA mapping because a NAICS code is it's own activity rather @@ -101,5 +107,5 @@ def assign_naics(df_load): # sort df df2 = order_crosswalk(df2) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_CalRecycle_WasteCharacterization.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_CalRecycle_WasteCharacterization.py index faaec2d1e..656f76a8f 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_CalRecycle_WasteCharacterization.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_CalRecycle_WasteCharacterization.py @@ -18,8 +18,8 @@ def assign_naics(df): :return: df with assigned Sector columns """ - mapping = pd.read_csv(externaldatapath + "California_Commercial_bySector_2014_Mapping.csv", - dtype='str') + mapping = pd.read_csv(f"{externaldatapath}/California_Commercial_" + f"bySector_2014_Mapping.csv", dtype='str') mapping = mapping.melt(var_name='Activity', value_name='Sector' ).dropna().reset_index(drop=True) @@ -28,11 +28,10 @@ def assign_naics(df): df = df.merge(mapping, on='Activity') # append Multifamily Sector to PCE - df = df.append({'Activity': 'Multifamily', - 'ActivitySourceName': 'CalRecycle_WasteCharacterization', - 'Sector': 'F010'}, + df = pd.concat([df, pd.DataFrame( + [['Multifamily', 'CalRecycle_WasteCharacterization', 'F010']], + columns=['Activity', 'ActivitySourceName', 'Sector'])], ignore_index=True) - return df @@ -55,5 +54,5 @@ def assign_naics(df): # reorder df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Census_CBP.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Census_CBP.py index 0dcc36266..7b8b8a54b 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Census_CBP.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Census_CBP.py @@ -25,15 +25,17 @@ df['Sector'] = df['Activity'].copy() # modify the sector for activity = '31-33' df.loc[df['Activity'] == '31-33', 'Sector'] = '31' - df = df.append(pd.DataFrame([['Census_CBP', '31-33', '32']], - columns=['ActivitySourceName', 'Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Census_CBP', '31-33', '33']], - columns=['ActivitySourceName', 'Activity', 'Sector']), sort=True) + df = pd.concat([df, pd.DataFrame( + [['Census_CBP', '31-33', '32']], + columns=['ActivitySourceName', 'Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame( + [['Census_CBP', '31-33', '33']], + columns=['ActivitySourceName', 'Activity', 'Sector'])], sort=True) # Add additional columns df['SectorSourceName'] = "NAICS_2012_Code" df['SectorType'] = "I" # reorder df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Census_VIP.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Census_VIP.py index a6822f938..fa79121f6 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Census_VIP.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Census_VIP.py @@ -17,7 +17,7 @@ def assign_naics(df): :return: df with assigned Sector columns """ - cw = pd.read_csv(externaldatapath + 'VIPNametoNAICStoFF.csv', + cw = pd.read_csv(f"{externaldatapath}/VIPNametoNAICStoFF.csv", usecols=['Name', '2012_NAICS_Code']) cw['Name'] = cw['Name'].str.lower() df['Name'] = df['Activity'].str.split(' - ').str[1].str.lower() @@ -48,5 +48,5 @@ def assign_naics(df): # reorder df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/" + f"NAICS_Crosswalk_{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EIA_CBECS.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EIA_CBECS.py index 9ee4ee514..20bf3ffca 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EIA_CBECS.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EIA_CBECS.py @@ -44,9 +44,9 @@ # but included in imported data. Will associate vacant with all CBECS NAICS sec_list = df['Sector'].drop_duplicates().values.tolist() for s in sec_list: - df = df.append(pd.DataFrame([[s, 'Vacant']], - columns=['Sector', 'Activity']), - ignore_index=True, sort=False) + df = pd.concat([df, pd.DataFrame( + [[s, 'Vacant']], columns=['Sector', 'Activity'])], + ignore_index=True, sort=False) # the original dataset is for NAICS 2002, but 3 digit NAICS # have not changed between 2002 and 2012, so labeling 2012 @@ -71,5 +71,5 @@ df = df.sort_values(['Activity', 'Sector']).reset_index(drop=True) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_EIA_CBECS_" + r + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/" + f"NAICS_Crosswalk_EIA_CBECS_{r}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_CDDPath.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_CDDPath.py index f4f576af7..1ffbaee6f 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_CDDPath.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_CDDPath.py @@ -17,7 +17,7 @@ def assign_naics(df): :return: df with assigned Sector columns """ - cw = pd.read_csv(externaldatapath + 'VIPNametoNAICStoFF.csv', + cw = pd.read_csv(f"{externaldatapath}/VIPNametoNAICStoFF.csv", usecols=['FF Source Category', '2012_NAICS_Code'], dtype='str').drop_duplicates() df = df.merge(cw, how='left', left_on=['Activity'], @@ -26,10 +26,9 @@ def assign_naics(df): # append additional mapping for Wood see EPA_CDDPath.py # function assign_wood_to_engineering() - df = df.append({'Activity': 'Other - Wood', - 'ActivitySourceName': 'EPA_CDDPath', - '2012_NAICS_Code': '237990'}, - ignore_index=True) + df = pd.concat([df, pd.DataFrame( + [['Other - Wood', 'EPA_CDDPath', '237990']], + columns=['Activity', 'ActivitySourceName', '2012_NAICS_Code'])], ignore_index=True) df = df.rename(columns={'2012_NAICS_Code': 'Sector'}) @@ -55,5 +54,5 @@ def assign_naics(df): # reorder df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_FactsAndFigures.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_FactsAndFigures.py index df1e1640b..d4de46eb1 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_FactsAndFigures.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_FactsAndFigures.py @@ -40,7 +40,7 @@ def assign_naics(df): df.loc[df['Activity'] == 'Landfilled', 'Sector'] = '5622121' df.loc[df['Activity'] == 'Recycled', 'Sector'] = \ '5629201' # child NAICS 1 for MSW - df.loc[df['Activity'] == 'Sewer/Wastewater Treatment', 'Sector'] = '22132' + df.loc[df['Activity'] == 'Sewer/Wastewater Treatment', 'Sector'] = '221320' return df @@ -66,5 +66,5 @@ def assign_naics(df): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(f'{datapath}activitytosectormapping/NAICS_Crosswalk_' + df.to_csv(f'{datapath}/activitytosectormapping/NAICS_Crosswalk_' f'{datasource}.csv', index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_REI.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_REI.py index a27b3579f..9cfe6312d 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_REI.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_REI.py @@ -93,5 +93,5 @@ def assign_naics(df): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(f'{datapath}activitytosectormapping/NAICS_Crosswalk_' + df.to_csv(f'{datapath}/activitytosectormapping/NAICS_Crosswalk_' f'{datasource}.csv', index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_WARMer.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_WARMer.py index 3ef5ac296..462e572be 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_WARMer.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_WARMer.py @@ -6,7 +6,7 @@ """ import pandas as pd -from flowsa.flowbyactivity import load_yaml_dict +from flowsa.common import load_yaml_dict from flowsa.settings import datapath from scripts.FlowByActivity_Crosswalks.common_scripts import order_crosswalk @@ -43,5 +43,5 @@ # reorder df = order_crosswalk(df) # save as csv - df.to_csv(f'{datapath}activitytosectormapping/NAICS_Crosswalk_' + df.to_csv(f'{datapath}/activitytosectormapping/NAICS_Crosswalk_' f'{datasource}.csv', index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_WFR.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_WFR.py index e66ae5600..16ba41575 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_WFR.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_WFR.py @@ -180,5 +180,5 @@ def food_waste_ttmt(): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(f"{crosswalkpath}NAICS_Crosswalk_{datasource}.csv", + df.to_csv(f"{crosswalkpath}/NAICS_Crosswalk_{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_NETL_EIA_PlantWater.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_NETL_EIA_PlantWater.py index 0f4a52e22..9423c4fdc 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_NETL_EIA_PlantWater.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_NETL_EIA_PlantWater.py @@ -84,5 +84,5 @@ def assign_naics(df): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "Crosswalk_" + datasource + "_toNAICS.csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/Crosswalk_" + f"{datasource}_toNAICS.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_StatCan_GDP.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_StatCan_GDP.py index c89e65d4a..b9c2b190f 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_StatCan_GDP.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_StatCan_GDP.py @@ -26,10 +26,12 @@ df['Sector'] = df['Activity'].copy() # modify the sector for activity = '31-33' df.loc[df['Activity'] == '31-33', 'Sector'] = '31' - df = df.append(pd.DataFrame([['StatCan_GDP', '31-33', '32']], - columns=['ActivitySourceName', 'Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['StatCan_GDP', '31-33', '33']], - columns=['ActivitySourceName', 'Activity', 'Sector']), sort=True) + df = pd.concat([df, pd.DataFrame( + [['StatCan_GDP', '31-33', '32']], + columns=['ActivitySourceName', 'Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame( + [['StatCan_GDP', '31-33', '33']], + columns=['ActivitySourceName', 'Activity', 'Sector'])], sort=True) # drop 'Other' and nan df = df[~df['Activity'].isin(['Other', 'nan'])] # Add additional columns @@ -38,5 +40,5 @@ # reorder df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_StatCan_IWS_MI.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_StatCan_IWS_MI.py index bebc6f816..f79b39bc6 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_StatCan_IWS_MI.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_StatCan_IWS_MI.py @@ -27,10 +27,12 @@ df['Sector'] = df['Activity'].copy() # modify the sector for activity = '31-33' df.loc[df['Activity'] == '31-33', 'Sector'] = '31' - df = df.append(pd.DataFrame([['StatCan_IWS_MI', '31-33', '32']], - columns=['ActivitySourceName', 'Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['StatCan_IWS_MI', '31-33', '33']], - columns=['ActivitySourceName', 'Activity', 'Sector']), sort=True) + df = pd.concat([df, pd.DataFrame( + [['StatCan_IWS_MI', '31-33', '32']], + columns=['ActivitySourceName', 'Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame( + [['StatCan_IWS_MI', '31-33', '33']], + columns=['ActivitySourceName', 'Activity', 'Sector'])], sort=True) # drop 'Other' and nan df = df[~df['Activity'].isin(['Other', 'nan'])] # Add additional columns @@ -39,5 +41,5 @@ # reorder df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ACUP.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ACUP.py index f963a8263..475c2e97d 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ACUP.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ACUP.py @@ -84,21 +84,27 @@ def assign_naics(df): # orchards associated with 6 naics6, for now, after allocation, # divide values associated with these naics by 6 df.loc[df['Activity'] == 'ORCHARDS', 'Sector'] = '111331' - df = df.append(pd.DataFrame([['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111332']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) - df = df.append(pd.DataFrame([['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111333']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) - df = df.append(pd.DataFrame([['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111335']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) - df = df.append(pd.DataFrame([['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111336']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) - df = df.append(pd.DataFrame([['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111339']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( + [['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111332']], + columns=['ActivitySourceName', 'Activity', 'SectorSourceName', + 'Sector'])], ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( + [['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111333']], + columns=['ActivitySourceName', 'Activity', 'SectorSourceName', + 'Sector'])], ignore_index=True, + sort=True) + pd.concat([df, pd.DataFrame( + [['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111335']], + columns=['ActivitySourceName', 'Activity', 'SectorSourceName', + 'Sector'])], ignore_index=True, sort=True) + pd.concat([df, pd.DataFrame( + [['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111336']], + columns=['ActivitySourceName', 'Activity', 'SectorSourceName', + 'Sector'])], ignore_index=True, sort=True) + pd.concat([df, pd.DataFrame( + [['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111339']], + columns=['ActivitySourceName', 'Activity', 'SectorSourceName', + 'Sector'])], ignore_index=True, sort=True) df.loc[df['Activity'] == 'BERRY TOTALS', 'Sector'] = '111334' df.loc[df['Activity'] == 'PINEAPPLES', 'Sector'] = '111339' @@ -176,4 +182,5 @@ def assign_naics(df): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(f"{datapath}activitytosectormapping/NAICS_Crosswalk_{d}.csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk" + f"_{d}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_CoA_Cropland.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_CoA_Cropland.py index f86463483..5c0cb7ccc 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_CoA_Cropland.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_CoA_Cropland.py @@ -100,37 +100,37 @@ def assign_naics(df): # orchards associated with 6 naics6, for now, after allocation, # divide values associated with these naics by 6 df.loc[df['Activity'] == 'ORCHARDS', 'Sector'] = '111331' - df = df.append(pd.DataFrame( + df = pd.concat([df, pd.DataFrame( [['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111332']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) - df = df.append(pd.DataFrame( + 'Sector'])], ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( [['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111335']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) - df = df.append(pd.DataFrame( + 'Sector'])], ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( [['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111336']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) - df = df.append(pd.DataFrame( + 'Sector'])], ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( [['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111339']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) + 'Sector'])], ignore_index=True, sort=True) # orange groves - df = df.append(pd.DataFrame( + df = pd.concat([df, pd.DataFrame( [['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111310']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) + 'Sector'])], ignore_index=True, sort=True) # citrus except orange groves - df = df.append(pd.DataFrame( + df = pd.concat([df, pd.DataFrame( [['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111320']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) + 'Sector'])], ignore_index=True, sort=True) df.loc[df['Activity'] == 'BERRY TOTALS', 'Sector'] = '111334' - df = df.append(pd.DataFrame( + df = pd.concat([df, pd.DataFrame( [['USDA_CoA_Cropland', 'BERRY TOTALS', 'NAICS_2012_Code', '111333']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) + 'Sector'])], ignore_index=True, sort=True) df.loc[df['Activity'] == 'PINEAPPLES', 'Sector'] = '111339' # coa aggregates to greenhouse nursery and floriculture production: 1114 diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_CoA_Livestock.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_CoA_Livestock.py index b10bd1a49..e23fd33fe 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_CoA_Livestock.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_CoA_Livestock.py @@ -129,5 +129,5 @@ def assign_naics(df): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ERS_FIWS.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ERS_FIWS.py index 65ed16e3d..d6f9612c6 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ERS_FIWS.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ERS_FIWS.py @@ -185,5 +185,5 @@ def assign_naics(df): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ERS_MLU.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ERS_MLU.py index 8568ff838..823b6c5d7 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ERS_MLU.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ERS_MLU.py @@ -61,55 +61,65 @@ def assign_naics(df): # Highways, roads, and railroad rights-of-way, plus airport facilities outside of urban areas. df.loc[df['Activity'] == 'Land in rural transportation facilities', 'Sector'] = '484' - df = df.append( - pd.DataFrame([['USDA_ERS_MLU', 'Land in rural transportation facilities', '485']], - columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) + pd.concat([df, + pd.DataFrame([['USDA_ERS_MLU', 'Land in rural transportation facilities', '485']], + columns=['ActivitySourceName', 'Activity', 'Sector'] + )], ignore_index=True, sort=True) # personal consumption expenditures - df = df.append(pd.DataFrame([['USDA_ERS_MLU', 'Land in rural transportation facilities', - 'F01000']], - columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) + pd.concat([df, + pd.DataFrame([['USDA_ERS_MLU', 'Land in rural transportation facilities', + 'F01000']], + columns=['ActivitySourceName', 'Activity', 'Sector'] + )], ignore_index=True, sort=True) # state/local gov't passenger transit - df = df.append(pd.DataFrame([['USDA_ERS_MLU', 'Land in rural transportation facilities', - 'S00201']], - columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) + pd.concat([df, + pd.DataFrame([['USDA_ERS_MLU', 'Land in rural transportation facilities', + 'S00201']], + columns=['ActivitySourceName', 'Activity', 'Sector'] + )], ignore_index=True, sort=True) # railroads - df = df.append(pd.DataFrame([['USDA_ERS_MLU', 'Land in rural transportation facilities', + pd.concat([df, + pd.DataFrame([['USDA_ERS_MLU', 'Land in rural transportation facilities', '482112']], - columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) + columns=['ActivitySourceName', 'Activity', 'Sector'] + )], ignore_index=True, sort=True) # airports - df = df.append(pd.DataFrame([['USDA_ERS_MLU', 'Land in rural transportation facilities', - '488119']], - columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) + df = pd.concat([df, + pd.DataFrame([['USDA_ERS_MLU', 'Land in rural transportation facilities', + '488119']], + columns=['ActivitySourceName', 'Activity', 'Sector'] + )], ignore_index=True, sort=True) # Densely-populated areas with at least 50,000 people # (urbanized areas) and densely-populated areas with / # 2,500 to 50,000 people (urban clusters). df.loc[df['Activity'] == 'Land in urban areas', 'Sector'] = '481' - df = df.append(pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', '482']], + pd.concat([df, + pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', '482']], columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) - df = df.append(pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', '484']], + )], ignore_index=True, sort=True) + pd.concat([df, + pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', '484']], columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) - df = df.append(pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', '485']], + )], ignore_index=True, sort=True) + pd.concat([df, + pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', '485']], columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) + )], ignore_index=True, sort=True) # personal consumption expenditures - df = df.append(pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', 'F01000']], + pd.concat([df, + pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', 'F01000']], columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) - df = df.append(pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', '488119']], # airports + )], ignore_index=True, sort=True) + pd.concat([df, + pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', '488119']], # airports columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) + )], ignore_index=True, sort=True) # city parks/open space - df = df.append(pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', '712190']], + pd.concat([df, + pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', '712190']], columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) + )], ignore_index=True, sort=True) # state/local gov't passenger transit df = df.append(pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', 'S00201']], columns=['ActivitySourceName', 'Activity', 'Sector'] @@ -163,5 +173,5 @@ def assign_naics(df): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/" + f"NAICS_Crosswalk_{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_IWMS.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_IWMS.py index e3a99adbf..54a2b32f9 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_IWMS.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_IWMS.py @@ -40,23 +40,27 @@ def assign_naics(df): # tobacco farming df.loc[df['Activity'] == 'CROPS, OTHER', 'Sector'] = '11191' # sugarcane farming - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'CROPS, OTHER', 'NAICS_2012_Code', '11193']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], ignore_index=True, sort=True) # oilseed (except soybean) farming - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'CROPS, OTHER', 'NAICS_2012_Code', '11112']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], ignore_index=True, sort=True) # SUGARBEETS - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'CROPS, OTHER', 'NAICS_2012_Code', '111991']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], ignore_index=True, sort=True) - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'CROPS, OTHER', 'NAICS_2012_Code', '111998']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], ignore_index=True, sort=True) df.loc[df['Activity'] == 'HAY & HAYLAGE, (EXCL ALFALFA)', 'Sector'] = '111940A' @@ -72,35 +76,35 @@ def assign_naics(df): pd.DataFrame([['USDA_IWMS', 'ORCHARDS', 'NAICS_2012_Code', '111332']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector'] ), ignore_index=True, sort=True) - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'ORCHARDS', 'NAICS_2012_Code', '111333']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector'] - ), ignore_index=True, sort=True) + )], ignore_index=True, sort=True) df.loc[df['Activity'] == 'BERRY TOTALS', 'Sector'] = '111334' - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'ORCHARDS', 'NAICS_2012_Code', '111335']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector'] - ), ignore_index=True, sort=True) - df = df.append( + )], ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'ORCHARDS', 'NAICS_2012_Code', '111336']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector'] - ), ignore_index=True, sort=True) - df = df.append( + )], ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'ORCHARDS', 'NAICS_2012_Code', '111339']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector'] - ), ignore_index=True, sort=True) + )], ignore_index=True, sort=True) # orange groves - df = df.append(pd.DataFrame([['USDA_IWMS', 'ORCHARDS', - 'NAICS_2012_Code', '11131']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( + [['USDA_IWMS', 'ORCHARDS', 'NAICS_2012_Code', '11131']], + columns=['ActivitySourceName', 'Activity', 'SectorSourceName', + 'Sector'])], ignore_index=True, sort=True) # citrus except orange groves - df = df.append(pd.DataFrame([['USDA_IWMS', 'ORCHARDS', - 'NAICS_2012_Code', '11132']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( + [['USDA_IWMS', 'ORCHARDS', 'NAICS_2012_Code', '11132']], + columns=['ActivitySourceName', 'Activity', 'SectorSourceName', + 'Sector'])], ignore_index=True, sort=True) df.loc[df['Activity'] == 'PEANUTS', 'Sector'] = '111992' @@ -110,49 +114,57 @@ def assign_naics(df): # BARLEY df.loc[df['Activity'] == 'SMALL GRAINS, OTHER', 'Sector'] = '111199A' # BUCKWHEAT - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'SMALL GRAINS, OTHER', 'NAICS_2012_Code', '111199B']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), - ignore_index=True, sort=True) + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], + ignore_index=True, sort=True) # MILLET, PROSO - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'SMALL GRAINS, OTHER', 'NAICS_2012_Code', '111199C']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), - ignore_index=True, sort=True) + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], + ignore_index=True, sort=True) # OATS - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'SMALL GRAINS, OTHER', 'NAICS_2012_Code', '111199D']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), - ignore_index=True, sort=True) + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], + ignore_index=True, sort=True) # RYE - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'SMALL GRAINS, OTHER', 'NAICS_2012_Code', '111199E']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), - ignore_index=True, sort=True) + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], + ignore_index=True, sort=True) # TRITICALE - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'SMALL GRAINS, OTHER', 'NAICS_2012_Code', '111199I']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), - ignore_index=True, sort=True) + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], + ignore_index=True, sort=True) # WILD RICE - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'SMALL GRAINS, OTHER', 'NAICS_2012_Code', '111199J']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), - ignore_index=True, sort=True) + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], + ignore_index=True, sort=True) # three types of sorghum, so manually add two rows # grain df.loc[df['Activity'] == 'SORGHUM, GRAIN', 'Sector'] = '111199F' # syrup - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'SORGHUM, GRAIN', 'NAICS_2012_Code', '111199G']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), - ignore_index=True, sort=True) + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], + ignore_index=True, sort=True) # silage - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'SORGHUM, GRAIN', 'NAICS_2012_Code', '111199H']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), - ignore_index=True, sort=True) + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], + ignore_index=True, sort=True) df.loc[df['Activity'] == 'SOYBEANS', 'Sector'] = '11111' @@ -189,5 +201,5 @@ def assign_naics(df): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USGS_NWIS_WU.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USGS_NWIS_WU.py index ec07ac8d5..dd7670a17 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USGS_NWIS_WU.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USGS_NWIS_WU.py @@ -29,64 +29,74 @@ def assign_naics(df): df.loc[df['Activity'] == 'Hydroelectric Power', 'Sector'] = '221111' df.loc[df['Activity'] == 'Industrial', 'Sector'] = '1133' - df = df.append(pd.DataFrame([['Industrial', '23']], columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Industrial', '31']], columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Industrial', '32']], columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Industrial', '33']], columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Industrial', '48839']], - columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Industrial', '5111']], - columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Industrial', '51222']], - columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Industrial', '51223']], - columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Industrial', '54171']], - columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Industrial', '56291']], - columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Industrial', '81149']], - columns=['Activity', 'Sector']), sort=True) + df = pd.concat([df, pd.DataFrame([['Industrial', '23']], columns=[ + 'Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Industrial', '31']], columns=[ + 'Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Industrial', '32']], columns=[ + 'Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Industrial', '33']], columns=[ + 'Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Industrial', '48839']], + columns=['Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Industrial', '5111']], + columns=['Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Industrial', '51222']], + columns=['Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Industrial', '51223']], + columns=['Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Industrial', '54171']], + columns=['Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Industrial', '56291']], + columns=['Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Industrial', '81149']], + columns=['Activity', 'Sector'])], sort=True) df.loc[df['Activity'] == 'Irrigation', 'Sector'] = '111' - df = df.append(pd.DataFrame([['Irrigation', '112']], columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Irrigation', '71391']], - columns=['Activity', 'Sector']), sort=True) + df = pd.concat([df, pd.DataFrame([['Irrigation', '112']], columns=[ + 'Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Irrigation', '71391']], + columns=['Activity', 'Sector'])], sort=True) df.loc[df['Activity'] == 'Irrigation Crop', 'Sector'] = '111' - df = df.append(pd.DataFrame([['Irrigation Crop', '112']], - columns=['Activity', 'Sector']), sort=True) + df = pd.concat([df, pd.DataFrame([['Irrigation Crop', '112']], + columns=['Activity', 'Sector'])], sort=True) df.loc[df['Activity'] == 'Irrigation Golf Courses', 'Sector'] = '71391' df.loc[df['Activity'] == 'Irrigation Total', 'Sector'] = '111' - df = df.append(pd.DataFrame([['Irrigation Total', '71391']], - columns=['Activity', 'Sector']), sort=True) + df = pd.concat([df, pd.DataFrame([['Irrigation Total', '71391']], + columns=['Activity', 'Sector'])], sort=True) df.loc[df['Activity'] == 'Livestock', 'Sector'] = '1121' - df = df.append(pd.DataFrame([['Livestock', '1122']], columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Livestock', '1123']], columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Livestock', '1124']], columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Livestock', '1129']], columns=['Activity', 'Sector']), sort=True) + df = pd.concat([df, pd.DataFrame([['Livestock', '1122']], columns=[ + 'Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Livestock', '1123']], columns=[ + 'Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Livestock', '1124']], columns=[ + 'Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Livestock', '1129']], columns=[ + 'Activity', 'Sector'])], sort=True) df.loc[df['Activity'] == 'Mining', 'Sector'] = '21' - df = df.append(pd.DataFrame([['Mining', '54136']], columns=['Activity', 'Sector']), sort=True) + df = pd.concat([df, pd.DataFrame([['Mining', '54136']], columns=[ + 'Activity', 'Sector'])], sort=True) df.loc[df['Activity'] == 'Public', 'Sector'] = '221310' df.loc[df['Activity'] == 'Public Supply', 'Sector'] = '221310' - df = df.append(pd.DataFrame([['Thermoelectric Power', '221112']], - columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Thermoelectric Power', '221113']], - columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Thermoelectric Power', '221114']], - columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Thermoelectric Power', '221116']], - columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Thermoelectric Power', '221117']], - columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Thermoelectric Power', '221118']], - columns=['Activity', 'Sector']), sort=True) + df = pd.concat([df, pd.DataFrame([['Thermoelectric Power', '221112']], + columns=['Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Thermoelectric Power', '221113']], + columns=['Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Thermoelectric Power', '221114']], + columns=['Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Thermoelectric Power', '221116']], + columns=['Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Thermoelectric Power', '221117']], + columns=['Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Thermoelectric Power', '221118']], + columns=['Activity', 'Sector'])], sort=True) # df.loc[df['Activity'] == 'Total', 'Sector'] = '' # df.loc[df['Activity'] == 'Total Groundwater', 'Sector'] = '' @@ -121,5 +131,5 @@ def assign_naics(df): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USGS_WU_Coef.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USGS_WU_Coef.py index f931e154b..ba5dc0bfc 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USGS_WU_Coef.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USGS_WU_Coef.py @@ -40,12 +40,12 @@ def assign_naics(df): df.loc[df['Activity'] == 'Turkeys', 'Sector'] = '11233' # poultry hatcheries: 11234 # other poultry production: 11239, manually add row - df = df.append( - pd.DataFrame([['USGS_WU_Coef', 'Broilers and other chickens', + df = pd.concat([df, + pd.DataFrame([['USGS_WU_Coef', 'Broilers and other chickens', 'NAICS_2012_Code', '11239']], columns=['ActivitySourceName', 'Activity', - 'SectorSourceName', 'Sector']), - ignore_index=True) + 'SectorSourceName', 'Sector'])], + ignore_index=True) # sheep and goat farming: 1124 # sheep farming: 11241 df.loc[df['Activity'] == 'Sheep and lambs', 'Sector'] = '11241' @@ -58,15 +58,16 @@ def assign_naics(df): df.loc[df['Activity'] == 'Horses (including ponies, mules, burrows, ' \ 'and donkeys)', 'Sector'] = '11292' # fur-bearing animal and rabbit production: 11293, manually add row - df = df.append( - pd.DataFrame([['USGS_WU_Coef', 'Broilers and other chickens', - 'NAICS_2012_Code', '11293']], columns=[ - 'ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True) + df = pd.concat([df, + pd.DataFrame([['USGS_WU_Coef', 'Broilers and other chickens', + 'NAICS_2012_Code', '11293']], + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], + ignore_index=True) # all other animal production: 11299, manually add row - df = df.append(pd.DataFrame([['USGS_WU_Coef', 'Sheep and lambs', + df = pd.concat([df, pd.DataFrame([['USGS_WU_Coef', 'Sheep and lambs', 'NAICS_2012_Code', '11299']], columns=[ - 'ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), + 'ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector'])], ignore_index=True) return df @@ -92,5 +93,5 @@ def assign_naics(df): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(f"{datapath}activitytosectormapping/NAICS_Crosswalk_" + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" f"{datasource}.csv", index=False) diff --git a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLM_PLS.py b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLM_PLS.py index 26d8f58e7..210bc63e7 100644 --- a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLM_PLS.py +++ b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLM_PLS.py @@ -31,5 +31,5 @@ .sort_values(['activity_set', 'name']) .reset_index(drop=True)) - df.to_csv(f'{flowbysectoractivitysetspath}{datasource}_{year}_asets.csv', + df.to_csv(f'{flowbysectoractivitysetspath}/{datasource}_{year}_asets.csv', index=False) diff --git a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLS_QCEW.py b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLS_QCEW.py index 9e9004c3a..914ff0199 100644 --- a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLS_QCEW.py +++ b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLS_QCEW.py @@ -34,5 +34,5 @@ # drop duplicates and save df df3 = df2.drop_duplicates() df3 = df3.sort_values(['activity_set', 'name']).reset_index(drop=True) - df3.to_csv(f"{flowbysectoractivitysetspath}{datasource}_asets.csv", + df3.to_csv(f"{flowbysectoractivitysetspath}/{datasource}_asets.csv", index=False) diff --git a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_CNHW_Food.py b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_CNHW_Food.py index d60a0dded..5cbea31ab 100644 --- a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_CNHW_Food.py +++ b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_CNHW_Food.py @@ -32,7 +32,7 @@ # data to include in activity set 1 wfr_fba = flowsa.getFlowByActivity('EPA_WFR', '2018') wfr_fba = wfr_fba[['ActivityProducedBy']].drop_duplicates() - wfr_cw = pd.read_csv(f'{crosswalkpath}NAICS_Crosswalk_EPA_WFR.csv') + wfr_cw = pd.read_csv(f'{crosswalkpath}/NAICS_Crosswalk_EPA_WFR.csv') wfr = wfr_fba.merge(wfr_cw[['Activity', 'Sector']], left_on='ActivityProducedBy', right_on='Activity').drop(columns='Activity') @@ -50,5 +50,5 @@ .sort_values(['activity_set', 'name']) .reset_index(drop=True)) - df.to_csv(f'{flowbysectoractivitysetspath}CNHW_Food_asets.csv', + df.to_csv(f'{flowbysectoractivitysetspath}/CNHW_Food_asets.csv', index=False) diff --git a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EIA_CBECS_Land.py b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EIA_CBECS_Land.py index 0d0173154..17dc18042 100644 --- a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EIA_CBECS_Land.py +++ b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EIA_CBECS_Land.py @@ -30,5 +30,5 @@ .sort_values(['activity_set', 'name']) .reset_index(drop=True)) - df.to_csv(f'{flowbysectoractivitysetspath}{datasource}_{year}_asets.csv', + df.to_csv(f'{flowbysectoractivitysetspath}/{datasource}_{year}_asets.csv', index=False) diff --git a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EIA_MECS_Land.py b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EIA_MECS_Land.py index 74e6c4b62..1d203356c 100644 --- a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EIA_MECS_Land.py +++ b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EIA_MECS_Land.py @@ -29,5 +29,5 @@ .sort_values(['activity_set', 'name']) .reset_index(drop=True)) - df.to_csv(f'{flowbysectoractivitysetspath}{datasource}_{year}_asets.csv', + df.to_csv(f'{flowbysectoractivitysetspath}/{datasource}_{year}_asets.csv', index=False) diff --git a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EPA_REI_waste.py b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EPA_REI_waste.py index 3ef3401c8..cd9473a06 100644 --- a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EPA_REI_waste.py +++ b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EPA_REI_waste.py @@ -31,5 +31,5 @@ .sort_values(['activity_set', 'name']) .reset_index(drop=True)) - df.to_csv(f'{flowbysectoractivitysetspath}{datasource}_waste_' + df.to_csv(f'{flowbysectoractivitysetspath}/{datasource}_waste_' f'{year}_asets.csv', index=False) diff --git a/scripts/write_BEA_Use_from_useeior.py b/scripts/write_BEA_Use_from_useeior.py index b9e3abcab..0ef30c2af 100644 --- a/scripts/write_BEA_Use_from_useeior.py +++ b/scripts/write_BEA_Use_from_useeior.py @@ -60,7 +60,6 @@ """ - from rpy2.robjects.packages import importr from rpy2.robjects import pandas2ri from flowsa.settings import externaldatapath @@ -82,5 +81,4 @@ # Apply it to the df index UseIndustryTransactions.index = Industries # Write out to csv -UseIndustryTransactions.to_csv(externaldatapath + - "BEA_2012_Detail_Use_Industry_Transactions.csv") +UseIndustryTransactions.to_csv(f"{externaldatapath}/BEA_2012_Detail_Use_Industry_Transactions.csv") diff --git a/scripts/write_Division_Codes_from_Census.py b/scripts/write_Division_Codes_from_Census.py index 3ff56b811..732990d6f 100644 --- a/scripts/write_Division_Codes_from_Census.py +++ b/scripts/write_Division_Codes_from_Census.py @@ -25,11 +25,12 @@ df.columns = raw_df.loc[4, ] # assign location system - df['LocationSystem'] = np.where(df["Name"].str.contains("Region"), "Census_Region", None) + df['LocationSystem'] = np.where(df["Name"].str.contains("Region"), + "Census_Region", None) df['LocationSystem'] = np.where(df["Name"].str.contains("Division"), "Census_Division", df['LocationSystem']) # rename columns to match flowbyactivity format df = df.rename(columns={"State (FIPS)": "State_FIPS"}) - df.to_csv(datapath + "Census_Regions_and_Divisions.csv", index=False) + df.to_csv(f"{datapath}/Census_Regions_and_Divisions.csv", index=False) diff --git a/scripts/write_FIPS_from_Census.py b/scripts/write_FIPS_from_Census.py index f99796aad..ad6cbb637 100644 --- a/scripts/write_FIPS_from_Census.py +++ b/scripts/write_FIPS_from_Census.py @@ -94,4 +94,4 @@ def stripcounty(s): FIPS_df["County"] = FIPS_df["County"].apply(clean_str_and_capitalize) FIPS_df["State"] = FIPS_df["State"].apply(clean_str_and_capitalize) - FIPS_df.to_csv(datapath+"FIPS.csv", index=False) + FIPS_df.to_csv(f"{datapath}/FIPS.csv", index=False) diff --git a/scripts/write_FIPS_xwalk_from_Census.py b/scripts/write_FIPS_xwalk_from_Census.py index be8cf2b7c..4803c0e60 100644 --- a/scripts/write_FIPS_xwalk_from_Census.py +++ b/scripts/write_FIPS_xwalk_from_Census.py @@ -53,7 +53,10 @@ def annual_fips(years): # skip the first few rows FIPS_df = pd.DataFrame(raw_df.loc[1:]).reindex() # Assign the column titles (remove whitespace if exists and new lines - FIPS_df.columns = raw_df.loc[0, ].str.replace(' |\\n', '') + FIPS_df.columns = (raw_df.loc[0, ] + .str.replace('\n', '') + .str.replace(' ', '') + ) original_cols = FIPS_df.columns @@ -61,9 +64,9 @@ def annual_fips(years): geocode_levels = {"010": "Country", "040": "State", "050": "County_" + year} - level_codes = geocode_levels.keys() + level_codes = list(geocode_levels.keys()) # filter df for records with the levels of interest - FIPS_df = FIPS_df.loc[FIPS_df["SummaryLevel"].isin(level_codes)] + FIPS_df = FIPS_df.query(f"SummaryLevel.isin({level_codes})") # split df by level to return a list of dfs # use a list comprehension to split it out @@ -93,7 +96,6 @@ def annual_fips(years): new_dfs[level] = new_df # New merge the new dfs to add the info - # FIPS_df_new = FIPS_df for k, v in new_dfs.items(): fields_to_merge = [str(x) for x in state_and_county_fields[k]] FIPS_df = pd.merge(FIPS_df, v, on=fields_to_merge, how="left") @@ -187,8 +189,8 @@ def read_fips_2010(): # so 2010 will have an additional row df_10 = pd.DataFrame(df_13["FIPS_2013"]) df_10['FIPS_2010'] = df_13['FIPS_2013'] - df_10 = df_10.append(pd.DataFrame([["51019", "51515"]], - columns=df_10.columns)) + df_10 = pd.concat([df_10, pd.DataFrame([["51019", "51515"]], + columns=df_10.columns)]) # merge 2010 with 2013 dataframe df2 = pd.merge(df_10, df_13, on="FIPS_2013", how='left')\ @@ -222,4 +224,4 @@ def read_fips_2010(): drop=True) # write fips crosswalk as csv - fips_xwalk.to_csv(datapath + "FIPS_Crosswalk.csv", index=False) + fips_xwalk.to_csv(f"{datapath}/FIPS_Crosswalk.csv", index=False) diff --git a/scripts/write_Larson_UrbanPublicParks_SI.py b/scripts/write_Larson_UrbanPublicParks_SI.py index 356b4bb12..1315d7ebf 100644 --- a/scripts/write_Larson_UrbanPublicParks_SI.py +++ b/scripts/write_Larson_UrbanPublicParks_SI.py @@ -28,4 +28,5 @@ # Read directly into a pandas df raw_df = pd.read_excel(io.BytesIO(response.content)).dropna().reset_index(drop=True) # save data to csv - raw_df.to_csv(externaldatapath + "Larson_UrbanPublicParks_SI.csv", index=False) + raw_df.to_csv(f"{externaldatapath}/Larson_UrbanPublicParks_SI.csv", + index=False) diff --git a/scripts/write_NAICS_from_useeior.py b/scripts/write_NAICS_from_useeior.py index 271716f54..7b35fde85 100644 --- a/scripts/write_NAICS_from_useeior.py +++ b/scripts/write_NAICS_from_useeior.py @@ -28,7 +28,7 @@ def import_useeior_mastercrosswalk(): 'MasterCrosswalk2012')['MasterCrosswalk2012'] # save as csv - cw.to_csv(datapath + "NAICS_to_BEA_Crosswalk.csv", index=False) + cw.to_csv(f"{datapath}/NAICS_to_BEA_Crosswalk.csv", index=False) if __name__ == '__main__': From bab5da3532888720e91a32502814cf0cfa4eb913 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 25 Aug 2023 12:02:36 -0600 Subject: [PATCH 0829/1127] update datapaths and convert "append" to "concat" --- scripts/AEOseriesIDs.py | 2 +- .../write_Crosswalk_BEA_2012.py | 2 +- .../write_Crosswalk_BEA_Make_Table.py | 4 +- .../write_Crosswalk_BLM_PLS.py | 15 ++- .../write_Crosswalk_BLS_GreenIndustries.py | 6 +- .../write_Crosswalk_Blackhurst_IO.py | 46 +++---- ...sswalk_CalRecycle_WasteCharacterization.py | 15 ++- .../write_Crosswalk_Census_CBP.py | 14 ++- .../write_Crosswalk_Census_VIP.py | 6 +- .../write_Crosswalk_EIA_CBECS.py | 10 +- .../write_Crosswalk_EPA_CDDPath.py | 13 +- .../write_Crosswalk_EPA_FactsAndFigures.py | 4 +- .../write_Crosswalk_EPA_REI.py | 2 +- .../write_Crosswalk_EPA_WARMer.py | 4 +- .../write_Crosswalk_EPA_WFR.py | 2 +- .../write_Crosswalk_NETL_EIA_PlantWater.py | 4 +- .../write_Crosswalk_StatCan_GDP.py | 14 ++- .../write_Crosswalk_StatCan_IWS_MI.py | 14 ++- .../write_Crosswalk_USDA_ACUP.py | 39 +++--- .../write_Crosswalk_USDA_CoA_Cropland.py | 28 ++--- .../write_Crosswalk_USDA_CoA_Livestock.py | 4 +- .../write_Crosswalk_USDA_ERS_FIWS.py | 4 +- .../write_Crosswalk_USDA_ERS_MLU.py | 76 ++++++------ .../write_Crosswalk_USDA_IWMS.py | 112 ++++++++++-------- .../write_Crosswalk_USGS_NWIS_WU.py | 98 ++++++++------- .../write_Crosswalk_USGS_WU_Coef.py | 25 ++-- .../write_FBS_activity_set_BLM_PLS.py | 2 +- .../write_FBS_activity_set_BLS_QCEW.py | 2 +- .../write_FBS_activity_set_CNHW_Food.py | 4 +- .../write_FBS_activity_set_EIA_CBECS_Land.py | 2 +- .../write_FBS_activity_set_EIA_MECS_Land.py | 2 +- .../write_FBS_activity_set_EPA_REI_waste.py | 2 +- scripts/write_BEA_Use_from_useeior.py | 4 +- scripts/write_Division_Codes_from_Census.py | 5 +- scripts/write_FIPS_from_Census.py | 2 +- scripts/write_FIPS_xwalk_from_Census.py | 16 +-- scripts/write_Larson_UrbanPublicParks_SI.py | 3 +- scripts/write_NAICS_from_useeior.py | 2 +- 38 files changed, 330 insertions(+), 279 deletions(-) diff --git a/scripts/AEOseriesIDs.py b/scripts/AEOseriesIDs.py index 63ca4f4cc..4279bf024 100644 --- a/scripts/AEOseriesIDs.py +++ b/scripts/AEOseriesIDs.py @@ -90,4 +90,4 @@ def getAEOseriesIDs(): df = df.reindex(columns=['table_name', 'series_name', 'units', 'series_id']) # save to csv - df.to_csv(externaldatapath + 'AEOseriesIDs.csv', index=False) \ No newline at end of file + df.to_csv(f"{externaldatapath}/AEOseriesIDs.csv", index=False) \ No newline at end of file diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_2012.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_2012.py index 7455459df..f0a078c88 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_2012.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_2012.py @@ -36,4 +36,4 @@ def write_BEA_crosswalk(level='Detail'): if __name__ == '__main__': write_BEA_crosswalk('Detail') - write_BEA_crosswalk('Summary') \ No newline at end of file + write_BEA_crosswalk('Summary') diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_Make_Table.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_Make_Table.py index 932f74662..e35473aca 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_Make_Table.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_Make_Table.py @@ -49,5 +49,5 @@ def assign_naics(df_load): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BLM_PLS.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BLM_PLS.py index a75decc96..fef6eaca4 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BLM_PLS.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BLM_PLS.py @@ -86,12 +86,11 @@ def assign_naics(df): df.loc[df['Activity'] == 'Hardrock - Acquired Lands Leases, Hardrock Preference Right Leases', 'Sector'] = '2122' # Nonmetallic Mineral Mining and Quarrying - df = df.append( - pd.DataFrame([['BLM_PLS', - 'Hardrock - Acquired Lands Leases, Hardrock Preference Right Leases', - '2123']], - columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( + [['BLM_PLS', 'Hardrock - Acquired Lands Leases, Hardrock Preference ' + 'Right Leases', '2123']], + columns=['ActivitySourceName', 'Activity', 'Sector'])], + ignore_index=True, sort=True) # Coal Mining df.loc[df['Activity'] == 'Logical Mining Units', 'Sector'] = '21211' @@ -196,5 +195,5 @@ def assign_naics(df): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BLS_GreenIndustries.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BLS_GreenIndustries.py index e8ca50a6f..94e560b08 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BLS_GreenIndustries.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BLS_GreenIndustries.py @@ -19,7 +19,7 @@ from flowsa.settings import datapath # read the csv loaded as a raw datafile -df_raw = pd.read_csv(datapath + "BLS_GreenIndustries_Raw.csv") +df_raw = pd.read_csv(f"{datapath}/BLS_GreenIndustries_Raw.csv") # only keep columns where naics is included in green goods and services df1 = df_raw[df_raw['Included'] == 'Y'] @@ -44,5 +44,5 @@ # reset index df3.reset_index(drop=True, inplace=True) # save as csv -df3.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_BLS_GreenIndustries.csv", index=False) +df3.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"BLS_GreenIndustries.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Blackhurst_IO.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Blackhurst_IO.py index 858c17e29..599d4aa0e 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Blackhurst_IO.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Blackhurst_IO.py @@ -40,26 +40,32 @@ def assign_naics(df_load): # reset sector value for sand, gravel, clay df.loc[df['Activity'] == '212320', 'Sector'] = '212321' - df = df.append(pd.DataFrame([['Blackhurst_IO', '212320', '212322']], - columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) - df = df.append(pd.DataFrame([['Blackhurst_IO', '212320', '212324']], - columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) - df = df.append(pd.DataFrame([['Blackhurst_IO', '212320', '212325']], - columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( + [['Blackhurst_IO','212320', '212322']], columns=[ + 'ActivitySourceName', 'Activity', 'Sector'])], + ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( + [['Blackhurst_IO', '212320', '212324']], + columns=['ActivitySourceName', 'Activity', 'Sector'] + )], ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( + [['Blackhurst_IO', '212320', '212325']], + columns=['ActivitySourceName', 'Activity', 'Sector'] + )], ignore_index=True, sort=True) df.loc[df['Activity'] == '212390', 'Sector'] = '212391' - df = df.append(pd.DataFrame([['Blackhurst_IO', '212390', '212392']], - columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) - df = df.append(pd.DataFrame([['Blackhurst_IO', '212390', '212393']], - columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) - df = df.append(pd.DataFrame([['Blackhurst_IO', '212390', '212399']], - columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( + [['Blackhurst_IO', '212390', '212392']], + columns=['ActivitySourceName', 'Activity', 'Sector'])], + ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( + [['Blackhurst_IO', '212390', '212393']], + columns=['ActivitySourceName', 'Activity', 'Sector'])], + ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( + [['Blackhurst_IO', '212390', '212399']], + columns=['ActivitySourceName', 'Activity', 'Sector'])], + ignore_index=True, sort=True) # drop two rows where Blackhurst's IO vectors do not align with the # NAICS to BEA mapping because a NAICS code is it's own activity rather @@ -101,5 +107,5 @@ def assign_naics(df_load): # sort df df2 = order_crosswalk(df2) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_CalRecycle_WasteCharacterization.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_CalRecycle_WasteCharacterization.py index faaec2d1e..656f76a8f 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_CalRecycle_WasteCharacterization.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_CalRecycle_WasteCharacterization.py @@ -18,8 +18,8 @@ def assign_naics(df): :return: df with assigned Sector columns """ - mapping = pd.read_csv(externaldatapath + "California_Commercial_bySector_2014_Mapping.csv", - dtype='str') + mapping = pd.read_csv(f"{externaldatapath}/California_Commercial_" + f"bySector_2014_Mapping.csv", dtype='str') mapping = mapping.melt(var_name='Activity', value_name='Sector' ).dropna().reset_index(drop=True) @@ -28,11 +28,10 @@ def assign_naics(df): df = df.merge(mapping, on='Activity') # append Multifamily Sector to PCE - df = df.append({'Activity': 'Multifamily', - 'ActivitySourceName': 'CalRecycle_WasteCharacterization', - 'Sector': 'F010'}, + df = pd.concat([df, pd.DataFrame( + [['Multifamily', 'CalRecycle_WasteCharacterization', 'F010']], + columns=['Activity', 'ActivitySourceName', 'Sector'])], ignore_index=True) - return df @@ -55,5 +54,5 @@ def assign_naics(df): # reorder df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Census_CBP.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Census_CBP.py index 0dcc36266..7b8b8a54b 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Census_CBP.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Census_CBP.py @@ -25,15 +25,17 @@ df['Sector'] = df['Activity'].copy() # modify the sector for activity = '31-33' df.loc[df['Activity'] == '31-33', 'Sector'] = '31' - df = df.append(pd.DataFrame([['Census_CBP', '31-33', '32']], - columns=['ActivitySourceName', 'Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Census_CBP', '31-33', '33']], - columns=['ActivitySourceName', 'Activity', 'Sector']), sort=True) + df = pd.concat([df, pd.DataFrame( + [['Census_CBP', '31-33', '32']], + columns=['ActivitySourceName', 'Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame( + [['Census_CBP', '31-33', '33']], + columns=['ActivitySourceName', 'Activity', 'Sector'])], sort=True) # Add additional columns df['SectorSourceName'] = "NAICS_2012_Code" df['SectorType'] = "I" # reorder df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Census_VIP.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Census_VIP.py index a6822f938..fa79121f6 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Census_VIP.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Census_VIP.py @@ -17,7 +17,7 @@ def assign_naics(df): :return: df with assigned Sector columns """ - cw = pd.read_csv(externaldatapath + 'VIPNametoNAICStoFF.csv', + cw = pd.read_csv(f"{externaldatapath}/VIPNametoNAICStoFF.csv", usecols=['Name', '2012_NAICS_Code']) cw['Name'] = cw['Name'].str.lower() df['Name'] = df['Activity'].str.split(' - ').str[1].str.lower() @@ -48,5 +48,5 @@ def assign_naics(df): # reorder df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/" + f"NAICS_Crosswalk_{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EIA_CBECS.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EIA_CBECS.py index 9ee4ee514..20bf3ffca 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EIA_CBECS.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EIA_CBECS.py @@ -44,9 +44,9 @@ # but included in imported data. Will associate vacant with all CBECS NAICS sec_list = df['Sector'].drop_duplicates().values.tolist() for s in sec_list: - df = df.append(pd.DataFrame([[s, 'Vacant']], - columns=['Sector', 'Activity']), - ignore_index=True, sort=False) + df = pd.concat([df, pd.DataFrame( + [[s, 'Vacant']], columns=['Sector', 'Activity'])], + ignore_index=True, sort=False) # the original dataset is for NAICS 2002, but 3 digit NAICS # have not changed between 2002 and 2012, so labeling 2012 @@ -71,5 +71,5 @@ df = df.sort_values(['Activity', 'Sector']).reset_index(drop=True) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_EIA_CBECS_" + r + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/" + f"NAICS_Crosswalk_EIA_CBECS_{r}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_CDDPath.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_CDDPath.py index f4f576af7..1ffbaee6f 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_CDDPath.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_CDDPath.py @@ -17,7 +17,7 @@ def assign_naics(df): :return: df with assigned Sector columns """ - cw = pd.read_csv(externaldatapath + 'VIPNametoNAICStoFF.csv', + cw = pd.read_csv(f"{externaldatapath}/VIPNametoNAICStoFF.csv", usecols=['FF Source Category', '2012_NAICS_Code'], dtype='str').drop_duplicates() df = df.merge(cw, how='left', left_on=['Activity'], @@ -26,10 +26,9 @@ def assign_naics(df): # append additional mapping for Wood see EPA_CDDPath.py # function assign_wood_to_engineering() - df = df.append({'Activity': 'Other - Wood', - 'ActivitySourceName': 'EPA_CDDPath', - '2012_NAICS_Code': '237990'}, - ignore_index=True) + df = pd.concat([df, pd.DataFrame( + [['Other - Wood', 'EPA_CDDPath', '237990']], + columns=['Activity', 'ActivitySourceName', '2012_NAICS_Code'])], ignore_index=True) df = df.rename(columns={'2012_NAICS_Code': 'Sector'}) @@ -55,5 +54,5 @@ def assign_naics(df): # reorder df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_FactsAndFigures.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_FactsAndFigures.py index df1e1640b..d4de46eb1 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_FactsAndFigures.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_FactsAndFigures.py @@ -40,7 +40,7 @@ def assign_naics(df): df.loc[df['Activity'] == 'Landfilled', 'Sector'] = '5622121' df.loc[df['Activity'] == 'Recycled', 'Sector'] = \ '5629201' # child NAICS 1 for MSW - df.loc[df['Activity'] == 'Sewer/Wastewater Treatment', 'Sector'] = '22132' + df.loc[df['Activity'] == 'Sewer/Wastewater Treatment', 'Sector'] = '221320' return df @@ -66,5 +66,5 @@ def assign_naics(df): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(f'{datapath}activitytosectormapping/NAICS_Crosswalk_' + df.to_csv(f'{datapath}/activitytosectormapping/NAICS_Crosswalk_' f'{datasource}.csv', index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_REI.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_REI.py index a27b3579f..9cfe6312d 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_REI.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_REI.py @@ -93,5 +93,5 @@ def assign_naics(df): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(f'{datapath}activitytosectormapping/NAICS_Crosswalk_' + df.to_csv(f'{datapath}/activitytosectormapping/NAICS_Crosswalk_' f'{datasource}.csv', index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_WARMer.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_WARMer.py index 3ef5ac296..462e572be 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_WARMer.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_WARMer.py @@ -6,7 +6,7 @@ """ import pandas as pd -from flowsa.flowbyactivity import load_yaml_dict +from flowsa.common import load_yaml_dict from flowsa.settings import datapath from scripts.FlowByActivity_Crosswalks.common_scripts import order_crosswalk @@ -43,5 +43,5 @@ # reorder df = order_crosswalk(df) # save as csv - df.to_csv(f'{datapath}activitytosectormapping/NAICS_Crosswalk_' + df.to_csv(f'{datapath}/activitytosectormapping/NAICS_Crosswalk_' f'{datasource}.csv', index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_WFR.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_WFR.py index e66ae5600..16ba41575 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_WFR.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_WFR.py @@ -180,5 +180,5 @@ def food_waste_ttmt(): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(f"{crosswalkpath}NAICS_Crosswalk_{datasource}.csv", + df.to_csv(f"{crosswalkpath}/NAICS_Crosswalk_{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_NETL_EIA_PlantWater.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_NETL_EIA_PlantWater.py index 0f4a52e22..9423c4fdc 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_NETL_EIA_PlantWater.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_NETL_EIA_PlantWater.py @@ -84,5 +84,5 @@ def assign_naics(df): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "Crosswalk_" + datasource + "_toNAICS.csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/Crosswalk_" + f"{datasource}_toNAICS.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_StatCan_GDP.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_StatCan_GDP.py index c89e65d4a..b9c2b190f 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_StatCan_GDP.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_StatCan_GDP.py @@ -26,10 +26,12 @@ df['Sector'] = df['Activity'].copy() # modify the sector for activity = '31-33' df.loc[df['Activity'] == '31-33', 'Sector'] = '31' - df = df.append(pd.DataFrame([['StatCan_GDP', '31-33', '32']], - columns=['ActivitySourceName', 'Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['StatCan_GDP', '31-33', '33']], - columns=['ActivitySourceName', 'Activity', 'Sector']), sort=True) + df = pd.concat([df, pd.DataFrame( + [['StatCan_GDP', '31-33', '32']], + columns=['ActivitySourceName', 'Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame( + [['StatCan_GDP', '31-33', '33']], + columns=['ActivitySourceName', 'Activity', 'Sector'])], sort=True) # drop 'Other' and nan df = df[~df['Activity'].isin(['Other', 'nan'])] # Add additional columns @@ -38,5 +40,5 @@ # reorder df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_StatCan_IWS_MI.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_StatCan_IWS_MI.py index bebc6f816..f79b39bc6 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_StatCan_IWS_MI.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_StatCan_IWS_MI.py @@ -27,10 +27,12 @@ df['Sector'] = df['Activity'].copy() # modify the sector for activity = '31-33' df.loc[df['Activity'] == '31-33', 'Sector'] = '31' - df = df.append(pd.DataFrame([['StatCan_IWS_MI', '31-33', '32']], - columns=['ActivitySourceName', 'Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['StatCan_IWS_MI', '31-33', '33']], - columns=['ActivitySourceName', 'Activity', 'Sector']), sort=True) + df = pd.concat([df, pd.DataFrame( + [['StatCan_IWS_MI', '31-33', '32']], + columns=['ActivitySourceName', 'Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame( + [['StatCan_IWS_MI', '31-33', '33']], + columns=['ActivitySourceName', 'Activity', 'Sector'])], sort=True) # drop 'Other' and nan df = df[~df['Activity'].isin(['Other', 'nan'])] # Add additional columns @@ -39,5 +41,5 @@ # reorder df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ACUP.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ACUP.py index f963a8263..475c2e97d 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ACUP.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ACUP.py @@ -84,21 +84,27 @@ def assign_naics(df): # orchards associated with 6 naics6, for now, after allocation, # divide values associated with these naics by 6 df.loc[df['Activity'] == 'ORCHARDS', 'Sector'] = '111331' - df = df.append(pd.DataFrame([['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111332']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) - df = df.append(pd.DataFrame([['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111333']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) - df = df.append(pd.DataFrame([['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111335']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) - df = df.append(pd.DataFrame([['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111336']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) - df = df.append(pd.DataFrame([['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111339']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( + [['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111332']], + columns=['ActivitySourceName', 'Activity', 'SectorSourceName', + 'Sector'])], ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( + [['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111333']], + columns=['ActivitySourceName', 'Activity', 'SectorSourceName', + 'Sector'])], ignore_index=True, + sort=True) + pd.concat([df, pd.DataFrame( + [['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111335']], + columns=['ActivitySourceName', 'Activity', 'SectorSourceName', + 'Sector'])], ignore_index=True, sort=True) + pd.concat([df, pd.DataFrame( + [['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111336']], + columns=['ActivitySourceName', 'Activity', 'SectorSourceName', + 'Sector'])], ignore_index=True, sort=True) + pd.concat([df, pd.DataFrame( + [['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111339']], + columns=['ActivitySourceName', 'Activity', 'SectorSourceName', + 'Sector'])], ignore_index=True, sort=True) df.loc[df['Activity'] == 'BERRY TOTALS', 'Sector'] = '111334' df.loc[df['Activity'] == 'PINEAPPLES', 'Sector'] = '111339' @@ -176,4 +182,5 @@ def assign_naics(df): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(f"{datapath}activitytosectormapping/NAICS_Crosswalk_{d}.csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk" + f"_{d}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_CoA_Cropland.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_CoA_Cropland.py index f86463483..5c0cb7ccc 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_CoA_Cropland.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_CoA_Cropland.py @@ -100,37 +100,37 @@ def assign_naics(df): # orchards associated with 6 naics6, for now, after allocation, # divide values associated with these naics by 6 df.loc[df['Activity'] == 'ORCHARDS', 'Sector'] = '111331' - df = df.append(pd.DataFrame( + df = pd.concat([df, pd.DataFrame( [['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111332']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) - df = df.append(pd.DataFrame( + 'Sector'])], ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( [['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111335']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) - df = df.append(pd.DataFrame( + 'Sector'])], ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( [['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111336']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) - df = df.append(pd.DataFrame( + 'Sector'])], ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( [['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111339']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) + 'Sector'])], ignore_index=True, sort=True) # orange groves - df = df.append(pd.DataFrame( + df = pd.concat([df, pd.DataFrame( [['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111310']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) + 'Sector'])], ignore_index=True, sort=True) # citrus except orange groves - df = df.append(pd.DataFrame( + df = pd.concat([df, pd.DataFrame( [['USDA_CoA_Cropland', 'ORCHARDS', 'NAICS_2012_Code', '111320']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) + 'Sector'])], ignore_index=True, sort=True) df.loc[df['Activity'] == 'BERRY TOTALS', 'Sector'] = '111334' - df = df.append(pd.DataFrame( + df = pd.concat([df, pd.DataFrame( [['USDA_CoA_Cropland', 'BERRY TOTALS', 'NAICS_2012_Code', '111333']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) + 'Sector'])], ignore_index=True, sort=True) df.loc[df['Activity'] == 'PINEAPPLES', 'Sector'] = '111339' # coa aggregates to greenhouse nursery and floriculture production: 1114 diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_CoA_Livestock.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_CoA_Livestock.py index b10bd1a49..e23fd33fe 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_CoA_Livestock.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_CoA_Livestock.py @@ -129,5 +129,5 @@ def assign_naics(df): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ERS_FIWS.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ERS_FIWS.py index 65ed16e3d..d6f9612c6 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ERS_FIWS.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ERS_FIWS.py @@ -185,5 +185,5 @@ def assign_naics(df): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ERS_MLU.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ERS_MLU.py index 8568ff838..823b6c5d7 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ERS_MLU.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_ERS_MLU.py @@ -61,55 +61,65 @@ def assign_naics(df): # Highways, roads, and railroad rights-of-way, plus airport facilities outside of urban areas. df.loc[df['Activity'] == 'Land in rural transportation facilities', 'Sector'] = '484' - df = df.append( - pd.DataFrame([['USDA_ERS_MLU', 'Land in rural transportation facilities', '485']], - columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) + pd.concat([df, + pd.DataFrame([['USDA_ERS_MLU', 'Land in rural transportation facilities', '485']], + columns=['ActivitySourceName', 'Activity', 'Sector'] + )], ignore_index=True, sort=True) # personal consumption expenditures - df = df.append(pd.DataFrame([['USDA_ERS_MLU', 'Land in rural transportation facilities', - 'F01000']], - columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) + pd.concat([df, + pd.DataFrame([['USDA_ERS_MLU', 'Land in rural transportation facilities', + 'F01000']], + columns=['ActivitySourceName', 'Activity', 'Sector'] + )], ignore_index=True, sort=True) # state/local gov't passenger transit - df = df.append(pd.DataFrame([['USDA_ERS_MLU', 'Land in rural transportation facilities', - 'S00201']], - columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) + pd.concat([df, + pd.DataFrame([['USDA_ERS_MLU', 'Land in rural transportation facilities', + 'S00201']], + columns=['ActivitySourceName', 'Activity', 'Sector'] + )], ignore_index=True, sort=True) # railroads - df = df.append(pd.DataFrame([['USDA_ERS_MLU', 'Land in rural transportation facilities', + pd.concat([df, + pd.DataFrame([['USDA_ERS_MLU', 'Land in rural transportation facilities', '482112']], - columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) + columns=['ActivitySourceName', 'Activity', 'Sector'] + )], ignore_index=True, sort=True) # airports - df = df.append(pd.DataFrame([['USDA_ERS_MLU', 'Land in rural transportation facilities', - '488119']], - columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) + df = pd.concat([df, + pd.DataFrame([['USDA_ERS_MLU', 'Land in rural transportation facilities', + '488119']], + columns=['ActivitySourceName', 'Activity', 'Sector'] + )], ignore_index=True, sort=True) # Densely-populated areas with at least 50,000 people # (urbanized areas) and densely-populated areas with / # 2,500 to 50,000 people (urban clusters). df.loc[df['Activity'] == 'Land in urban areas', 'Sector'] = '481' - df = df.append(pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', '482']], + pd.concat([df, + pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', '482']], columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) - df = df.append(pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', '484']], + )], ignore_index=True, sort=True) + pd.concat([df, + pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', '484']], columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) - df = df.append(pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', '485']], + )], ignore_index=True, sort=True) + pd.concat([df, + pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', '485']], columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) + )], ignore_index=True, sort=True) # personal consumption expenditures - df = df.append(pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', 'F01000']], + pd.concat([df, + pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', 'F01000']], columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) - df = df.append(pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', '488119']], # airports + )], ignore_index=True, sort=True) + pd.concat([df, + pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', '488119']], # airports columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) + )], ignore_index=True, sort=True) # city parks/open space - df = df.append(pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', '712190']], + pd.concat([df, + pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', '712190']], columns=['ActivitySourceName', 'Activity', 'Sector'] - ), ignore_index=True, sort=True) + )], ignore_index=True, sort=True) # state/local gov't passenger transit df = df.append(pd.DataFrame([['USDA_ERS_MLU', 'Land in urban areas', 'S00201']], columns=['ActivitySourceName', 'Activity', 'Sector'] @@ -163,5 +173,5 @@ def assign_naics(df): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/" + f"NAICS_Crosswalk_{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_IWMS.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_IWMS.py index e3a99adbf..54a2b32f9 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_IWMS.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_IWMS.py @@ -40,23 +40,27 @@ def assign_naics(df): # tobacco farming df.loc[df['Activity'] == 'CROPS, OTHER', 'Sector'] = '11191' # sugarcane farming - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'CROPS, OTHER', 'NAICS_2012_Code', '11193']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], ignore_index=True, sort=True) # oilseed (except soybean) farming - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'CROPS, OTHER', 'NAICS_2012_Code', '11112']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], ignore_index=True, sort=True) # SUGARBEETS - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'CROPS, OTHER', 'NAICS_2012_Code', '111991']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], ignore_index=True, sort=True) - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'CROPS, OTHER', 'NAICS_2012_Code', '111998']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], ignore_index=True, sort=True) df.loc[df['Activity'] == 'HAY & HAYLAGE, (EXCL ALFALFA)', 'Sector'] = '111940A' @@ -72,35 +76,35 @@ def assign_naics(df): pd.DataFrame([['USDA_IWMS', 'ORCHARDS', 'NAICS_2012_Code', '111332']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector'] ), ignore_index=True, sort=True) - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'ORCHARDS', 'NAICS_2012_Code', '111333']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector'] - ), ignore_index=True, sort=True) + )], ignore_index=True, sort=True) df.loc[df['Activity'] == 'BERRY TOTALS', 'Sector'] = '111334' - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'ORCHARDS', 'NAICS_2012_Code', '111335']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector'] - ), ignore_index=True, sort=True) - df = df.append( + )], ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'ORCHARDS', 'NAICS_2012_Code', '111336']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector'] - ), ignore_index=True, sort=True) - df = df.append( + )], ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'ORCHARDS', 'NAICS_2012_Code', '111339']], columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector'] - ), ignore_index=True, sort=True) + )], ignore_index=True, sort=True) # orange groves - df = df.append(pd.DataFrame([['USDA_IWMS', 'ORCHARDS', - 'NAICS_2012_Code', '11131']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( + [['USDA_IWMS', 'ORCHARDS', 'NAICS_2012_Code', '11131']], + columns=['ActivitySourceName', 'Activity', 'SectorSourceName', + 'Sector'])], ignore_index=True, sort=True) # citrus except orange groves - df = df.append(pd.DataFrame([['USDA_IWMS', 'ORCHARDS', - 'NAICS_2012_Code', '11132']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True, sort=True) + df = pd.concat([df, pd.DataFrame( + [['USDA_IWMS', 'ORCHARDS', 'NAICS_2012_Code', '11132']], + columns=['ActivitySourceName', 'Activity', 'SectorSourceName', + 'Sector'])], ignore_index=True, sort=True) df.loc[df['Activity'] == 'PEANUTS', 'Sector'] = '111992' @@ -110,49 +114,57 @@ def assign_naics(df): # BARLEY df.loc[df['Activity'] == 'SMALL GRAINS, OTHER', 'Sector'] = '111199A' # BUCKWHEAT - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'SMALL GRAINS, OTHER', 'NAICS_2012_Code', '111199B']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), - ignore_index=True, sort=True) + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], + ignore_index=True, sort=True) # MILLET, PROSO - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'SMALL GRAINS, OTHER', 'NAICS_2012_Code', '111199C']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), - ignore_index=True, sort=True) + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], + ignore_index=True, sort=True) # OATS - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'SMALL GRAINS, OTHER', 'NAICS_2012_Code', '111199D']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), - ignore_index=True, sort=True) + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], + ignore_index=True, sort=True) # RYE - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'SMALL GRAINS, OTHER', 'NAICS_2012_Code', '111199E']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), - ignore_index=True, sort=True) + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], + ignore_index=True, sort=True) # TRITICALE - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'SMALL GRAINS, OTHER', 'NAICS_2012_Code', '111199I']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), - ignore_index=True, sort=True) + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], + ignore_index=True, sort=True) # WILD RICE - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'SMALL GRAINS, OTHER', 'NAICS_2012_Code', '111199J']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), - ignore_index=True, sort=True) + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], + ignore_index=True, sort=True) # three types of sorghum, so manually add two rows # grain df.loc[df['Activity'] == 'SORGHUM, GRAIN', 'Sector'] = '111199F' # syrup - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'SORGHUM, GRAIN', 'NAICS_2012_Code', '111199G']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), - ignore_index=True, sort=True) + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], + ignore_index=True, sort=True) # silage - df = df.append( + df = pd.concat([df, pd.DataFrame([['USDA_IWMS', 'SORGHUM, GRAIN', 'NAICS_2012_Code', '111199H']], - columns=['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), - ignore_index=True, sort=True) + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], + ignore_index=True, sort=True) df.loc[df['Activity'] == 'SOYBEANS', 'Sector'] = '11111' @@ -189,5 +201,5 @@ def assign_naics(df): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USGS_NWIS_WU.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USGS_NWIS_WU.py index ec07ac8d5..dd7670a17 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USGS_NWIS_WU.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USGS_NWIS_WU.py @@ -29,64 +29,74 @@ def assign_naics(df): df.loc[df['Activity'] == 'Hydroelectric Power', 'Sector'] = '221111' df.loc[df['Activity'] == 'Industrial', 'Sector'] = '1133' - df = df.append(pd.DataFrame([['Industrial', '23']], columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Industrial', '31']], columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Industrial', '32']], columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Industrial', '33']], columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Industrial', '48839']], - columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Industrial', '5111']], - columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Industrial', '51222']], - columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Industrial', '51223']], - columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Industrial', '54171']], - columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Industrial', '56291']], - columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Industrial', '81149']], - columns=['Activity', 'Sector']), sort=True) + df = pd.concat([df, pd.DataFrame([['Industrial', '23']], columns=[ + 'Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Industrial', '31']], columns=[ + 'Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Industrial', '32']], columns=[ + 'Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Industrial', '33']], columns=[ + 'Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Industrial', '48839']], + columns=['Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Industrial', '5111']], + columns=['Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Industrial', '51222']], + columns=['Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Industrial', '51223']], + columns=['Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Industrial', '54171']], + columns=['Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Industrial', '56291']], + columns=['Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Industrial', '81149']], + columns=['Activity', 'Sector'])], sort=True) df.loc[df['Activity'] == 'Irrigation', 'Sector'] = '111' - df = df.append(pd.DataFrame([['Irrigation', '112']], columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Irrigation', '71391']], - columns=['Activity', 'Sector']), sort=True) + df = pd.concat([df, pd.DataFrame([['Irrigation', '112']], columns=[ + 'Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Irrigation', '71391']], + columns=['Activity', 'Sector'])], sort=True) df.loc[df['Activity'] == 'Irrigation Crop', 'Sector'] = '111' - df = df.append(pd.DataFrame([['Irrigation Crop', '112']], - columns=['Activity', 'Sector']), sort=True) + df = pd.concat([df, pd.DataFrame([['Irrigation Crop', '112']], + columns=['Activity', 'Sector'])], sort=True) df.loc[df['Activity'] == 'Irrigation Golf Courses', 'Sector'] = '71391' df.loc[df['Activity'] == 'Irrigation Total', 'Sector'] = '111' - df = df.append(pd.DataFrame([['Irrigation Total', '71391']], - columns=['Activity', 'Sector']), sort=True) + df = pd.concat([df, pd.DataFrame([['Irrigation Total', '71391']], + columns=['Activity', 'Sector'])], sort=True) df.loc[df['Activity'] == 'Livestock', 'Sector'] = '1121' - df = df.append(pd.DataFrame([['Livestock', '1122']], columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Livestock', '1123']], columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Livestock', '1124']], columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Livestock', '1129']], columns=['Activity', 'Sector']), sort=True) + df = pd.concat([df, pd.DataFrame([['Livestock', '1122']], columns=[ + 'Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Livestock', '1123']], columns=[ + 'Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Livestock', '1124']], columns=[ + 'Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Livestock', '1129']], columns=[ + 'Activity', 'Sector'])], sort=True) df.loc[df['Activity'] == 'Mining', 'Sector'] = '21' - df = df.append(pd.DataFrame([['Mining', '54136']], columns=['Activity', 'Sector']), sort=True) + df = pd.concat([df, pd.DataFrame([['Mining', '54136']], columns=[ + 'Activity', 'Sector'])], sort=True) df.loc[df['Activity'] == 'Public', 'Sector'] = '221310' df.loc[df['Activity'] == 'Public Supply', 'Sector'] = '221310' - df = df.append(pd.DataFrame([['Thermoelectric Power', '221112']], - columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Thermoelectric Power', '221113']], - columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Thermoelectric Power', '221114']], - columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Thermoelectric Power', '221116']], - columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Thermoelectric Power', '221117']], - columns=['Activity', 'Sector']), sort=True) - df = df.append(pd.DataFrame([['Thermoelectric Power', '221118']], - columns=['Activity', 'Sector']), sort=True) + df = pd.concat([df, pd.DataFrame([['Thermoelectric Power', '221112']], + columns=['Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Thermoelectric Power', '221113']], + columns=['Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Thermoelectric Power', '221114']], + columns=['Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Thermoelectric Power', '221116']], + columns=['Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Thermoelectric Power', '221117']], + columns=['Activity', 'Sector'])], sort=True) + df = pd.concat([df, pd.DataFrame([['Thermoelectric Power', '221118']], + columns=['Activity', 'Sector'])], sort=True) # df.loc[df['Activity'] == 'Total', 'Sector'] = '' # df.loc[df['Activity'] == 'Total Groundwater', 'Sector'] = '' @@ -121,5 +131,5 @@ def assign_naics(df): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(datapath + "activitytosectormapping/" + - "NAICS_Crosswalk_" + datasource + ".csv", index=False) + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" + f"{datasource}.csv", index=False) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USGS_WU_Coef.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USGS_WU_Coef.py index f931e154b..ba5dc0bfc 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USGS_WU_Coef.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_USGS_WU_Coef.py @@ -40,12 +40,12 @@ def assign_naics(df): df.loc[df['Activity'] == 'Turkeys', 'Sector'] = '11233' # poultry hatcheries: 11234 # other poultry production: 11239, manually add row - df = df.append( - pd.DataFrame([['USGS_WU_Coef', 'Broilers and other chickens', + df = pd.concat([df, + pd.DataFrame([['USGS_WU_Coef', 'Broilers and other chickens', 'NAICS_2012_Code', '11239']], columns=['ActivitySourceName', 'Activity', - 'SectorSourceName', 'Sector']), - ignore_index=True) + 'SectorSourceName', 'Sector'])], + ignore_index=True) # sheep and goat farming: 1124 # sheep farming: 11241 df.loc[df['Activity'] == 'Sheep and lambs', 'Sector'] = '11241' @@ -58,15 +58,16 @@ def assign_naics(df): df.loc[df['Activity'] == 'Horses (including ponies, mules, burrows, ' \ 'and donkeys)', 'Sector'] = '11292' # fur-bearing animal and rabbit production: 11293, manually add row - df = df.append( - pd.DataFrame([['USGS_WU_Coef', 'Broilers and other chickens', - 'NAICS_2012_Code', '11293']], columns=[ - 'ActivitySourceName', 'Activity', 'SectorSourceName', - 'Sector']), ignore_index=True) + df = pd.concat([df, + pd.DataFrame([['USGS_WU_Coef', 'Broilers and other chickens', + 'NAICS_2012_Code', '11293']], + columns=['ActivitySourceName', 'Activity', + 'SectorSourceName', 'Sector'])], + ignore_index=True) # all other animal production: 11299, manually add row - df = df.append(pd.DataFrame([['USGS_WU_Coef', 'Sheep and lambs', + df = pd.concat([df, pd.DataFrame([['USGS_WU_Coef', 'Sheep and lambs', 'NAICS_2012_Code', '11299']], columns=[ - 'ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector']), + 'ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector'])], ignore_index=True) return df @@ -92,5 +93,5 @@ def assign_naics(df): # sort df df = order_crosswalk(df) # save as csv - df.to_csv(f"{datapath}activitytosectormapping/NAICS_Crosswalk_" + df.to_csv(f"{datapath}/activitytosectormapping/NAICS_Crosswalk_" f"{datasource}.csv", index=False) diff --git a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLM_PLS.py b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLM_PLS.py index 26d8f58e7..210bc63e7 100644 --- a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLM_PLS.py +++ b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLM_PLS.py @@ -31,5 +31,5 @@ .sort_values(['activity_set', 'name']) .reset_index(drop=True)) - df.to_csv(f'{flowbysectoractivitysetspath}{datasource}_{year}_asets.csv', + df.to_csv(f'{flowbysectoractivitysetspath}/{datasource}_{year}_asets.csv', index=False) diff --git a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLS_QCEW.py b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLS_QCEW.py index 9e9004c3a..914ff0199 100644 --- a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLS_QCEW.py +++ b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLS_QCEW.py @@ -34,5 +34,5 @@ # drop duplicates and save df df3 = df2.drop_duplicates() df3 = df3.sort_values(['activity_set', 'name']).reset_index(drop=True) - df3.to_csv(f"{flowbysectoractivitysetspath}{datasource}_asets.csv", + df3.to_csv(f"{flowbysectoractivitysetspath}/{datasource}_asets.csv", index=False) diff --git a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_CNHW_Food.py b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_CNHW_Food.py index d60a0dded..5cbea31ab 100644 --- a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_CNHW_Food.py +++ b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_CNHW_Food.py @@ -32,7 +32,7 @@ # data to include in activity set 1 wfr_fba = flowsa.getFlowByActivity('EPA_WFR', '2018') wfr_fba = wfr_fba[['ActivityProducedBy']].drop_duplicates() - wfr_cw = pd.read_csv(f'{crosswalkpath}NAICS_Crosswalk_EPA_WFR.csv') + wfr_cw = pd.read_csv(f'{crosswalkpath}/NAICS_Crosswalk_EPA_WFR.csv') wfr = wfr_fba.merge(wfr_cw[['Activity', 'Sector']], left_on='ActivityProducedBy', right_on='Activity').drop(columns='Activity') @@ -50,5 +50,5 @@ .sort_values(['activity_set', 'name']) .reset_index(drop=True)) - df.to_csv(f'{flowbysectoractivitysetspath}CNHW_Food_asets.csv', + df.to_csv(f'{flowbysectoractivitysetspath}/CNHW_Food_asets.csv', index=False) diff --git a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EIA_CBECS_Land.py b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EIA_CBECS_Land.py index 0d0173154..17dc18042 100644 --- a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EIA_CBECS_Land.py +++ b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EIA_CBECS_Land.py @@ -30,5 +30,5 @@ .sort_values(['activity_set', 'name']) .reset_index(drop=True)) - df.to_csv(f'{flowbysectoractivitysetspath}{datasource}_{year}_asets.csv', + df.to_csv(f'{flowbysectoractivitysetspath}/{datasource}_{year}_asets.csv', index=False) diff --git a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EIA_MECS_Land.py b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EIA_MECS_Land.py index 74e6c4b62..1d203356c 100644 --- a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EIA_MECS_Land.py +++ b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EIA_MECS_Land.py @@ -29,5 +29,5 @@ .sort_values(['activity_set', 'name']) .reset_index(drop=True)) - df.to_csv(f'{flowbysectoractivitysetspath}{datasource}_{year}_asets.csv', + df.to_csv(f'{flowbysectoractivitysetspath}/{datasource}_{year}_asets.csv', index=False) diff --git a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EPA_REI_waste.py b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EPA_REI_waste.py index 3ef3401c8..cd9473a06 100644 --- a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EPA_REI_waste.py +++ b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EPA_REI_waste.py @@ -31,5 +31,5 @@ .sort_values(['activity_set', 'name']) .reset_index(drop=True)) - df.to_csv(f'{flowbysectoractivitysetspath}{datasource}_waste_' + df.to_csv(f'{flowbysectoractivitysetspath}/{datasource}_waste_' f'{year}_asets.csv', index=False) diff --git a/scripts/write_BEA_Use_from_useeior.py b/scripts/write_BEA_Use_from_useeior.py index b9e3abcab..0ef30c2af 100644 --- a/scripts/write_BEA_Use_from_useeior.py +++ b/scripts/write_BEA_Use_from_useeior.py @@ -60,7 +60,6 @@ """ - from rpy2.robjects.packages import importr from rpy2.robjects import pandas2ri from flowsa.settings import externaldatapath @@ -82,5 +81,4 @@ # Apply it to the df index UseIndustryTransactions.index = Industries # Write out to csv -UseIndustryTransactions.to_csv(externaldatapath + - "BEA_2012_Detail_Use_Industry_Transactions.csv") +UseIndustryTransactions.to_csv(f"{externaldatapath}/BEA_2012_Detail_Use_Industry_Transactions.csv") diff --git a/scripts/write_Division_Codes_from_Census.py b/scripts/write_Division_Codes_from_Census.py index 3ff56b811..732990d6f 100644 --- a/scripts/write_Division_Codes_from_Census.py +++ b/scripts/write_Division_Codes_from_Census.py @@ -25,11 +25,12 @@ df.columns = raw_df.loc[4, ] # assign location system - df['LocationSystem'] = np.where(df["Name"].str.contains("Region"), "Census_Region", None) + df['LocationSystem'] = np.where(df["Name"].str.contains("Region"), + "Census_Region", None) df['LocationSystem'] = np.where(df["Name"].str.contains("Division"), "Census_Division", df['LocationSystem']) # rename columns to match flowbyactivity format df = df.rename(columns={"State (FIPS)": "State_FIPS"}) - df.to_csv(datapath + "Census_Regions_and_Divisions.csv", index=False) + df.to_csv(f"{datapath}/Census_Regions_and_Divisions.csv", index=False) diff --git a/scripts/write_FIPS_from_Census.py b/scripts/write_FIPS_from_Census.py index f99796aad..ad6cbb637 100644 --- a/scripts/write_FIPS_from_Census.py +++ b/scripts/write_FIPS_from_Census.py @@ -94,4 +94,4 @@ def stripcounty(s): FIPS_df["County"] = FIPS_df["County"].apply(clean_str_and_capitalize) FIPS_df["State"] = FIPS_df["State"].apply(clean_str_and_capitalize) - FIPS_df.to_csv(datapath+"FIPS.csv", index=False) + FIPS_df.to_csv(f"{datapath}/FIPS.csv", index=False) diff --git a/scripts/write_FIPS_xwalk_from_Census.py b/scripts/write_FIPS_xwalk_from_Census.py index be8cf2b7c..4803c0e60 100644 --- a/scripts/write_FIPS_xwalk_from_Census.py +++ b/scripts/write_FIPS_xwalk_from_Census.py @@ -53,7 +53,10 @@ def annual_fips(years): # skip the first few rows FIPS_df = pd.DataFrame(raw_df.loc[1:]).reindex() # Assign the column titles (remove whitespace if exists and new lines - FIPS_df.columns = raw_df.loc[0, ].str.replace(' |\\n', '') + FIPS_df.columns = (raw_df.loc[0, ] + .str.replace('\n', '') + .str.replace(' ', '') + ) original_cols = FIPS_df.columns @@ -61,9 +64,9 @@ def annual_fips(years): geocode_levels = {"010": "Country", "040": "State", "050": "County_" + year} - level_codes = geocode_levels.keys() + level_codes = list(geocode_levels.keys()) # filter df for records with the levels of interest - FIPS_df = FIPS_df.loc[FIPS_df["SummaryLevel"].isin(level_codes)] + FIPS_df = FIPS_df.query(f"SummaryLevel.isin({level_codes})") # split df by level to return a list of dfs # use a list comprehension to split it out @@ -93,7 +96,6 @@ def annual_fips(years): new_dfs[level] = new_df # New merge the new dfs to add the info - # FIPS_df_new = FIPS_df for k, v in new_dfs.items(): fields_to_merge = [str(x) for x in state_and_county_fields[k]] FIPS_df = pd.merge(FIPS_df, v, on=fields_to_merge, how="left") @@ -187,8 +189,8 @@ def read_fips_2010(): # so 2010 will have an additional row df_10 = pd.DataFrame(df_13["FIPS_2013"]) df_10['FIPS_2010'] = df_13['FIPS_2013'] - df_10 = df_10.append(pd.DataFrame([["51019", "51515"]], - columns=df_10.columns)) + df_10 = pd.concat([df_10, pd.DataFrame([["51019", "51515"]], + columns=df_10.columns)]) # merge 2010 with 2013 dataframe df2 = pd.merge(df_10, df_13, on="FIPS_2013", how='left')\ @@ -222,4 +224,4 @@ def read_fips_2010(): drop=True) # write fips crosswalk as csv - fips_xwalk.to_csv(datapath + "FIPS_Crosswalk.csv", index=False) + fips_xwalk.to_csv(f"{datapath}/FIPS_Crosswalk.csv", index=False) diff --git a/scripts/write_Larson_UrbanPublicParks_SI.py b/scripts/write_Larson_UrbanPublicParks_SI.py index 356b4bb12..1315d7ebf 100644 --- a/scripts/write_Larson_UrbanPublicParks_SI.py +++ b/scripts/write_Larson_UrbanPublicParks_SI.py @@ -28,4 +28,5 @@ # Read directly into a pandas df raw_df = pd.read_excel(io.BytesIO(response.content)).dropna().reset_index(drop=True) # save data to csv - raw_df.to_csv(externaldatapath + "Larson_UrbanPublicParks_SI.csv", index=False) + raw_df.to_csv(f"{externaldatapath}/Larson_UrbanPublicParks_SI.csv", + index=False) diff --git a/scripts/write_NAICS_from_useeior.py b/scripts/write_NAICS_from_useeior.py index 271716f54..7b35fde85 100644 --- a/scripts/write_NAICS_from_useeior.py +++ b/scripts/write_NAICS_from_useeior.py @@ -28,7 +28,7 @@ def import_useeior_mastercrosswalk(): 'MasterCrosswalk2012')['MasterCrosswalk2012'] # save as csv - cw.to_csv(datapath + "NAICS_to_BEA_Crosswalk.csv", index=False) + cw.to_csv(f"{datapath}/NAICS_to_BEA_Crosswalk.csv", index=False) if __name__ == '__main__': From b763b6d90a63e1a12fe4bed61f794b8c55cafef4 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 25 Aug 2023 14:04:56 -0400 Subject: [PATCH 0830/1127] drop 2213 from commercial allocation, which uses use table as it gets conflated with electricity sector --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 5 ----- 1 file changed, 5 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index 575ec87b3..606cec3eb 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -58,7 +58,6 @@ EPA_State_GHGI,Industry - Coal Mining - Fugitive - Post-Mining (Underground),NAI EPA_State_GHGI,Industry - Coal Mining - Fugitive - Surface Mining,NAICS_2012_Code,2121,,direct EPA_State_GHGI,Industry - Coal Mining - Fugitive - Underground Liberated,NAICS_2012_Code,2121,,direct EPA_State_GHGI,Industry - Coal Mining - Fugitive - Underground Recovered &Used For Energy,NAICS_2012_Code,2121,,direct -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,2213,,commercial_ch4_n2o EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,42,,commercial_ch4_n2o EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,44,,commercial_ch4_n2o EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,45,,commercial_ch4_n2o @@ -75,7 +74,6 @@ EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,72,,commercial_ch4_n2o EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,81,,commercial_ch4_n2o EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,81,,commercial_ch4_n2o -EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,2213,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,42,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,44,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,45,,use_table_coal @@ -92,7 +90,6 @@ EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combus EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,72,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,81,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,923,,use_table_coal -EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,2213,,use_table_gas EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,42,,use_table_gas EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,44,,use_table_gas EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,45,,use_table_gas @@ -109,7 +106,6 @@ EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combus EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,72,,use_table_gas EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,81,,use_table_gas EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,923,,use_table_gas -EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,2213,,use_table_pet EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,42,,use_table_pet EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,44,,use_table_pet EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,45,,use_table_pet @@ -188,7 +184,6 @@ EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mob EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,481,,transport_nonroad EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,482,,transport_nonroad EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,483,,transport_nonroad -EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,2213,,ods_substitutes EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,42,,ods_substitutes EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,44,,ods_substitutes EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,45,,ods_substitutes From f2ab0db3a00b98cf7d77da677e471843a18652da Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 24 Aug 2023 16:27:07 -0600 Subject: [PATCH 0831/1127] revise datapaths --- scripts/writeNAICScrosswalk.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/scripts/writeNAICScrosswalk.py b/scripts/writeNAICScrosswalk.py index e4c2f7eaa..7148e64a4 100644 --- a/scripts/writeNAICScrosswalk.py +++ b/scripts/writeNAICScrosswalk.py @@ -19,7 +19,6 @@ from flowsa import log from flowsa.common import load_crosswalk -from flowsa.dataclean import replace_NoneType_with_empty_cells, replace_strings_with_NoneType from flowsa.settings import datapath, crosswalkpath @@ -63,10 +62,12 @@ def update_naics_crosswalk(): ]].drop_duplicates().reset_index(drop=True) # convert all rows to string naics = naics.astype(str) - # ensure all None are NoneType - naics = replace_strings_with_NoneType(naics) # drop rows where all None - naics = naics.dropna(how='all') + naics = (naics + .replace('nan', np.nan) + .replace('None', np.nan) + .dropna(axis=0, how='all') + ) # drop naics > 6 in mastercrosswalk (all manufacturing) because unused # and slows functions @@ -77,7 +78,7 @@ def update_naics_crosswalk(): # and add to naics list missing_naics_df_list = [] # read in all the crosswalk csv files (ends in toNAICS.csv) - for file_name in glob.glob(f'{crosswalkpath}NAICS_Crosswalk_*.csv'): + for file_name in glob.glob(f'{crosswalkpath}/NAICS_Crosswalk_*.csv'): # skip Statistics Canada GDP because not all sectors relevant if not any(s in file_name for s in ('StatCan', 'BEA')): df = pd.read_csv(file_name, low_memory=False, dtype=str) @@ -132,15 +133,16 @@ def update_naics_crosswalk(): naics_02 = load_naics_02_to_07_crosswalk() naics_cw = pd.merge(total_naics, naics_02, how='left') - # ensure NoneType - naics_cw = replace_strings_with_NoneType(naics_cw) - # reorder naics_cw = naics_cw[['NAICS_2002_Code', 'NAICS_2007_Code', 'NAICS_2012_Code', 'NAICS_2017_Code']] + naics_cw = (naics_cw + .replace(np.nan, '') + .replace('nan', '') + ) # save as csv - naics_cw.to_csv(datapath + "NAICS_Crosswalk_TimeSeries.csv", index=False) + naics_cw.to_csv(f"{datapath}/NAICS_Crosswalk_TimeSeries.csv", index=False) def merge_df_by_crosswalk_lengths(naics_cw, d, l): @@ -179,7 +181,6 @@ def write_naics_2012_crosswalk(): # extract naics 2012 code column and drop duplicates and empty cells cw = cw_load[['NAICS_2012_Code']].drop_duplicates() - cw = replace_NoneType_with_empty_cells(cw) cw = cw[cw['NAICS_2012_Code'] != ''] # also drop the existing household and government codes because not all # inclusive and does not conform to NAICS length standards @@ -234,12 +235,12 @@ def write_naics_2012_crosswalk(): # reorder naics_cw = naics_cw.reindex(sorted(naics_cw.columns), axis=1) # save as csv - naics_cw.to_csv(datapath + "NAICS_2012_Crosswalk.csv", index=False) + naics_cw.to_csv(f"{datapath}/NAICS_2012_Crosswalk.csv", index=False) def update_sector_name_df(): """Update list of naics names with added sectors""" - sectors = pd.read_csv(f'{datapath}NAICS_2012_Names.csv', dtype=str) + sectors = pd.read_csv(f'{datapath}/NAICS_2012_Names.csv', dtype=str) # dictionary of new sector names new_sectors = pd.DataFrame( @@ -257,7 +258,7 @@ def update_sector_name_df(): ]}) df = pd.concat([sectors, new_sectors]) df = df.sort_values("NAICS_2012_Code") - df.to_csv(f'{datapath}Sector_2012_Names.csv', index=False) + df.to_csv(f'{datapath}/Sector_2012_Names.csv', index=False) if __name__ == '__main__': From 38532730735d8686a395b181bf12678f645e5217 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 24 Aug 2023 16:45:03 -0600 Subject: [PATCH 0832/1127] delete elciFBS.py as no longer support electricity gen FBS --- flowsa/data_source_scripts/elciFBS.py | 78 --------------------------- 1 file changed, 78 deletions(-) delete mode 100644 flowsa/data_source_scripts/elciFBS.py diff --git a/flowsa/data_source_scripts/elciFBS.py b/flowsa/data_source_scripts/elciFBS.py deleted file mode 100644 index 84d9b58f7..000000000 --- a/flowsa/data_source_scripts/elciFBS.py +++ /dev/null @@ -1,78 +0,0 @@ -# elciFBS.py (flowsa) -# !/usr/bin/env python3 -# coding=utf-8 -""" -Functions to access data electricitylci for use in flowbysector - -These functions are called if referenced in flowbysectormethods as -data_format FBS_outside_flowsa with the function specified in FBS_datapull_fxn - -""" -from flowsa import log -from flowsa.sectormapping import get_activitytosector_mapping - - -def get_elci_emissions(yaml_load, *_): - """Generate plant level emissions from eLCI package.""" - try: - import electricitylci - import electricitylci.model_config as config - except ImportError: - log.error("Must install ElectricityLCI package in order to generate " - "plant level air emissions.") - import fedelemflowlist as fl - - config.model_specs = config.build_model_class('ELCI_1') - config.model_specs.include_upstream_processes = False - config.model_specs.regional_aggregation = 'US' - config.model_specs.include_renewable_generation = False - config.model_specs.include_netl_water = True - config.model_specs.stewicombo_file = 'ELCI_1' - if 'DMR' not in config.model_specs.inventories_of_interest.keys(): - config.model_specs.inventories_of_interest['DMR'] = 2016 - - emissions = electricitylci.get_generation_process_df() - emissions = emissions.loc[emissions['stage_code'] == 'Power plant'] - # FlowUUID is not null (will remove RCRA flows) - emissions = emissions.loc[~emissions['FlowUUID'].isna()] - - column_dict = {'Balancing Authority Name': 'Location', - 'FuelCategory': 'SectorProducedBy', - 'FlowName': 'Flowable', - 'Compartment': 'Compartment', - 'FlowUUID': 'FlowUUID', - 'FlowAmount': 'FlowAmount', - 'Unit': 'Unit', - 'Year': 'Year', - 'source_string': 'MetaSources'} - - col_list = [c for c in column_dict.keys() if c in emissions] - emissions_df = emissions[col_list] - emissions_df = emissions_df.rename(columns=column_dict) - - # Update Compartment from FEDEFL - fedefl = fl.get_flows()[['Flow UUID', 'Context']] - emissions_df = emissions_df.merge(fedefl, how='left', - left_on='FlowUUID', - right_on='Flow UUID') - emissions_df.drop(columns=['Flow UUID', 'Compartment'], inplace=True) - - # Assign other fields - emissions_df['LocationSystem'] = 'BAA' - emissions_df['FlowType'] = 'ELEMENTARY_FLOW' - emissions_df['Class'] = 'Chemicals' - - # Update SectorProducedBy - mapping = get_activitytosector_mapping('eLCI') - mapping = mapping[['Activity', 'Sector']] - emissions_df_mapped = emissions_df.merge(mapping, how='left', - left_on='SectorProducedBy', - right_on='Activity') - emissions_df_mapped.drop(columns=['SectorProducedBy', 'Activity'], - inplace=True) - emissions_df_mapped.rename(columns={'Sector': 'SectorProducedBy'}, - inplace=True) - emissions_df_mapped.dropna(subset=['SectorProducedBy'], - inplace=True) - - return emissions_df_mapped From 6c720b04f3a3154c3679c006b552390ddd6be1dc Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 24 Aug 2023 16:55:18 -0600 Subject: [PATCH 0833/1127] delete obsolete code --- flowsa/data_source_scripts/Census_QWI.py | 12 +- flowsa/dataclean.py | 31 +- flowsa/datavisualization.py | 4 +- flowsa/flowbyactivity.py | 2 +- flowsa/flowbyfunctions.py | 383 +--------------------- flowsa/geo.py | 1 - flowsa/sectormapping.py | 299 ----------------- flowsa/validation.py | 401 +---------------------- 8 files changed, 21 insertions(+), 1112 deletions(-) diff --git a/flowsa/data_source_scripts/Census_QWI.py b/flowsa/data_source_scripts/Census_QWI.py index d684bef74..c9184851d 100644 --- a/flowsa/data_source_scripts/Census_QWI.py +++ b/flowsa/data_source_scripts/Census_QWI.py @@ -14,15 +14,9 @@ import json import pandas as pd -import numpy as np -from flowsa.location import get_all_state_FIPS_2, get_county_FIPS, US_FIPS -from flowsa.common import fba_default_grouping_fields, load_env_file_key -from flowsa.schema import flow_by_activity_wsec_fields, \ - flow_by_activity_mapped_wsec_fields -from flowsa.flowbyfunctions import assign_fips_location_system, \ - aggregator -from flowsa.dataclean import add_missing_flow_by_fields, \ - replace_strings_with_NoneType +from flowsa.location import get_county_FIPS +from flowsa.common import load_env_file_key +from flowsa.flowbyfunctions import assign_fips_location_system def census_qwi_url_helper(*, build_url, year, config, **_): diff --git a/flowsa/dataclean.py b/flowsa/dataclean.py index 16332da86..f9d687c83 100644 --- a/flowsa/dataclean.py +++ b/flowsa/dataclean.py @@ -5,11 +5,12 @@ Common functions to clean and harmonize dataframes """ +import pandas as pd import numpy as np -from flowsa.literature_values import get_Canadian_to_USD_exchange_rate +from flowsa import (literature_values, settings, flowsa_log) -def clean_df(df, flowbyfields, fill_na_dict, drop_description=True): +def clean_df(df, flowbyfields, drop_description=True): """ Modify a dataframe to ensure all columns are present and column datatypes correct @@ -33,32 +34,6 @@ def clean_df(df, flowbyfields, fill_na_dict, drop_description=True): return df -def replace_strings_with_NoneType(df): - """ - Ensure that cell values in columns with datatype = string remain NoneType - :param df: df with columns where datatype = object - :return: A df where values are NoneType if they are supposed to be - """ - # if datatypes are strings, ensure that Null values remain NoneType - for y in df.columns: - if df[y].dtype == object: - df.loc[df[y].isin(['nan', 'None', np.nan, '']), y] = None - return df - - -def replace_NoneType_with_empty_cells(df): - """ - Replace all NoneType in columns where datatype = string with empty cells - :param df: df with columns where datatype = object - :return: A df where values are '' when previously they were NoneType - """ - # if datatypes are strings, change NoneType to empty cells - for y in df.columns: - if df[y].dtype == object: - df.loc[df[y].isin(['nan', 'None', np.nan, None]), y] = '' - return df - - def add_missing_flow_by_fields(flowby_partial_df, flowbyfields): """ Add in missing fields to have a complete and ordered df diff --git a/flowsa/datavisualization.py b/flowsa/datavisualization.py index 5be70e85c..8391573d8 100644 --- a/flowsa/datavisualization.py +++ b/flowsa/datavisualization.py @@ -12,13 +12,11 @@ import plotly.graph_objects as go from plotly.subplots import make_subplots import flowsa -from flowsa.common import load_crosswalk, load_yaml_dict -from flowsa.dataclean import replace_NoneType_with_empty_cells +from flowsa.common import load_crosswalk # todo: need to update fxn to use new sector_aggregation - datavis not # currently working # from flowsa.flowbyfunctions import sector_aggregation from flowsa.flowsa_log import log -from flowsa.sectormapping import get_sector_list from flowsa.settings import datapath, plotoutputpath import textwrap diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index 5ce137784..018399dba 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -166,7 +166,7 @@ def process_data_frame(*, df, source, year, config): log.info("Retrieved data for %s %s", source, year) # add any missing columns of data and cast to appropriate data type log.info("Add any missing columns and check field datatypes") - flow_df = clean_df(df, flow_by_activity_fields, fba_fill_na_dict, + flow_df = clean_df(df, flow_by_activity_fields, drop_description=False) # sort df and reset index flow_df = flow_df.sort_values(['Class', 'Location', 'ActivityProducedBy', diff --git a/flowsa/flowbyfunctions.py b/flowsa/flowbyfunctions.py index 6a18465b7..173f6cb7f 100644 --- a/flowsa/flowbyfunctions.py +++ b/flowsa/flowbyfunctions.py @@ -5,23 +5,15 @@ Helper functions for flowbyactivity and flowbysector data """ -import pandas as pd import numpy as np from esupy.dqi import get_weighted_average import flowsa -from flowsa.common import \ - load_crosswalk, fbs_fill_na_dict, \ - fbs_collapsed_default_grouping_fields, fbs_collapsed_fill_na_dict, \ - fba_activity_fields, fba_default_grouping_fields, \ - load_sector_length_cw_melt, fba_fill_na_dict, \ - fba_mapped_default_grouping_fields -from flowsa.dataclean import clean_df, replace_strings_with_NoneType, \ - replace_NoneType_with_empty_cells, standardize_units -from flowsa.flowsa_log import log, vlog -from flowsa.location import US_FIPS, get_state_FIPS, \ - get_county_FIPS, update_geoscale, fips_number_key +from flowsa.common import fbs_collapsed_default_grouping_fields +from flowsa.dataclean import clean_df, standardize_units +from flowsa.flowsa_log import log +from flowsa.location import US_FIPS, get_state_FIPS, get_county_FIPS from flowsa.schema import flow_by_activity_fields, flow_by_sector_fields, \ - flow_by_sector_collapsed_fields, flow_by_activity_mapped_fields + flow_by_sector_collapsed_fields def create_geoscale_list(df, geoscale, year='2015'): @@ -70,28 +62,6 @@ def filter_by_geoscale(df, geoscale): return df -def agg_by_geoscale(df, from_scale, to_scale, groupbycols): - """ - Aggregate a df by geoscale - :param df: flowbyactivity or flowbysector df - :param from_scale: str, geoscale to aggregate from - ('national', 'state', 'county') - :param to_scale: str, geoscale to aggregate to ( - 'national', 'state', 'county') - :param groupbycols: flowbyactivity or flowbysector default groupby columns - :return: df, at identified to_scale geographic level - """ - - # use from scale to filter by these values - df = filter_by_geoscale(df, from_scale).reset_index(drop=True) - - df = update_geoscale(df, to_scale) - - fba_agg = aggregator(df, groupbycols) - - return fba_agg - - def aggregator(df, groupbycols, retain_zeros=True, flowcolname='FlowAmount'): """ Aggregates flowbyactivity or flowbysector 'FlowAmount' column in df and @@ -145,9 +115,6 @@ def is_identical(s): df_dfg = df_dfg.reset_index() df_dfg.columns = df_dfg.columns.droplevel(level=1) - # if datatypes are strings, ensure that Null values remain NoneType - df_dfg = replace_strings_with_NoneType(df_dfg) - return df_dfg @@ -165,7 +132,7 @@ def remove_parent_sectors_from_crosswalk(cw_load, sector_list): return cw_load -# todo: delete +# todo: revise to work for recursively built data # def sector_aggregation(df_load, return_all_possible_sector_combos=False, # sectors_to_exclude_from_agg=None): # """ @@ -249,159 +216,6 @@ def remove_parent_sectors_from_crosswalk(cw_load, sector_list): # return df.reset_index(drop=True) -def append_new_sectors(df, i, j, cw_load, group_cols): - """ - Function to append new sectors at more aggregated levels - :param df: df, FBS - :param i: numeric, sector length to aggregate - :param j: numeric, value to subtract from sector length for new sector - length to add - :param cw_load: df, sector crosswalk - :param group_cols: list, cols to group by - :param sectors_to_exclude_from_agg: list, sectors that should not be - aggregated beyond the sector level provided - :return: - """ - - # load crosswalk - sector_merge = 'NAICS_' + str(i) - sector_add = 'NAICS_' + str(i - j) - - cw_dict = {} - if 'Sector' in df.columns: - cw_dict['Sector'] = cw_load[ - [sector_merge, sector_add]].drop_duplicates() - else: - if isinstance(cw_load, dict): - for s in ['Produced', 'Consumed']: - cw = cw_load[f'Sector{s}By'][[sector_merge, - sector_add]].drop_duplicates() - cw_dict[s] = cw - else: - cw_dict['SectorProducedBy'] = cw_load[ - [sector_merge, sector_add]].drop_duplicates() - cw_dict['SectorConsumedBy'] = cw_load[ - [sector_merge, sector_add]].drop_duplicates() - - cw_melt = load_sector_length_cw_melt() - cw_sub = cw_melt[cw_melt['SectorLength'] == i] - sector_list = cw_sub['Sector'].drop_duplicates().values.tolist() - - # loop through and add additional sectors - if 'Sector' in df.columns: - sectype_list = ['Sector'] - else: - sectype_list = ['SectorProducedBy', 'SectorConsumedBy'] - for s in sectype_list: - dfm = df[df[s].isin(sector_list)] - dfm = dfm.merge(cw_dict[s], how='left', left_on=[s], - right_on=sector_merge) - # replace sector column with matched sector add - dfm[s] = np.where( - ~dfm[sector_add].isnull(), dfm[sector_add], - dfm[s]) - dfm = dfm.drop(columns=[sector_merge, sector_add]) - dfm = replace_NoneType_with_empty_cells(dfm) - - # aggregate the new sector flow amounts - if 'FlowAmount' in dfm.columns: - agg_sectors = aggregator(dfm, group_cols) - # if FlowName is not in column and instead aggregating for the - # HelperFlow then simply sum helper flow column - else: - agg_sectors = dfm.groupby(group_cols)['HelperFlow'] \ - .sum().reset_index() - # append to df - agg_sectors = replace_NoneType_with_empty_cells(agg_sectors) - cols = [e for e in df.columns if e in - ['FlowName', 'Flowable', 'Class', 'SectorProducedBy', - 'SectorConsumedBy', 'Sector', 'Compartment', 'Context', - 'Location', 'Unit', 'FlowType', 'Year']] - # get copies where the indices are the columns of interest - df_2 = df.set_index(cols) - agg_sectors_2 = agg_sectors.set_index(cols) - # Look for index overlap, ~ - dfi = agg_sectors[~agg_sectors_2.index.isin(df_2.index)] - df = pd.concat([df, dfi], ignore_index=True).reset_index( - drop=True) - - return df - - -# def sector_disaggregation(df_load): -# """ -# function to disaggregate sectors if there is only one -# naics at a lower level works for lower than naics 4 -# :param df_load: A FBS df, must have sector columns -# :return: A FBS df with values for the missing naics5 and naics6 -# """ -# -# # ensure None values are not strings -# df = replace_NoneType_with_empty_cells(df_load) -# -# # determine if activities are sector-like, if aggregating -# # a df with a 'SourceName' -# sector_like_activities = check_activities_sector_like(df_load) -# -# # if activities are sector like, drop columns while running disag then -# # add back in -# if sector_like_activities: -# df = df.drop(columns=['ActivityProducedBy', 'ActivityConsumedBy'], -# errors='ignore') -# df = df.reset_index(drop=True) -# -# # load naics 2 to naics 6 crosswalk -# cw_load = load_crosswalk('sector_length') -# -# # appends missing naics levels to df -# for i in range(2, 6): -# dfm = subset_and_merge_df_by_sector_lengths( -# df, i, i + 1, keep_paired_sectors_not_in_subset_list=True) -# -# # only keep values in left column, meaning there are no less -# # aggregated naics in the df -# dfm2 = dfm.query('_merge=="left_only"').drop( -# columns=['_merge', 'SPB_tmp', 'SCB_tmp']) -# -# sector_merge = 'NAICS_' + str(i) -# sector_add = 'NAICS_' + str(i + 1) -# -# # subset the df by naics length -# cw = cw_load[[sector_merge, sector_add]].drop_duplicates() -# # only keep the rows where there is only one value in sector_add for -# # a value in sector_merge -# cw = cw.drop_duplicates(subset=[sector_merge], keep=False).reset_index( -# drop=True) -# -# # loop through and add additional naics -# sectype_list = ['Produced', 'Consumed'] -# for s in sectype_list: -# # inner join - only keep rows where there are data in the crosswalk -# dfm2 = dfm2.merge(cw, how='left', left_on=[f'Sector{s}By'], -# right_on=sector_merge) -# dfm2[f'Sector{s}By'] = np.where( -# ~dfm2[sector_add].isnull(), dfm2[sector_add], -# dfm2[f'Sector{s}By']) -# dfm2 = dfm2.drop(columns=[sector_merge, sector_add]) -# dfm3 = dfm2.dropna(subset=['SectorProducedBy', 'SectorConsumedBy'], -# how='all') -# dfm3 = dfm3.reset_index(drop=True) -# dfm3 = replace_NoneType_with_empty_cells(dfm3) -# df = pd.concat([df, dfm3], ignore_index=True) -# -# # drop duplicates that can arise if sectors are non-traditional naics -# # (household and government) -# df = df.drop_duplicates().reset_index(drop=True) -# -# # if activities are source-like, set col values -# # as copies of the sector columns -# if sector_like_activities: -# df = df.assign(ActivityProducedBy=df['SectorProducedBy']) -# df = df.assign(ActivityConsumedBy=df['SectorConsumedBy']) -# -# return df - - def assign_fips_location_system(df, year_of_data): """ Add location system based on year of data. County level FIPS @@ -435,7 +249,7 @@ def collapse_fbs_sectors(fbs): :return: df, FBS with single Sector column """ # ensure correct datatypes and order - fbs = clean_df(fbs, flow_by_sector_fields, fbs_fill_na_dict) + fbs = clean_df(fbs, flow_by_sector_fields) if fbs['SectorProducedBy'].isnull().all(): fbs['Sector'] = fbs['SectorConsumedBy'] @@ -468,118 +282,13 @@ def collapse_fbs_sectors(fbs): fbs_collapsed = \ aggregator(fbs_collapsed, fbs_collapsed_default_grouping_fields) # sort dataframe - fbs_collapsed = clean_df(fbs_collapsed, flow_by_sector_collapsed_fields, - fbs_collapsed_fill_na_dict) + fbs_collapsed = clean_df(fbs_collapsed, flow_by_sector_collapsed_fields) fbs_collapsed = fbs_collapsed.sort_values( ['Sector', 'Flowable', 'Context', 'Location']).reset_index(drop=True) return fbs_collapsed -def return_activity_from_scale(df, provided_from_scale): - """ - Determine the 'from scale' used for aggregation/df - subsetting for each activity combo in a df - :param df: flowbyactivity df - :param provided_from_scale: str, The scale to use specified in method yaml - :return: df, FBA with column indicating the "from" geoscale to - use for each row - """ - - # determine the unique combinations of activityproduced/consumedby - df = replace_NoneType_with_empty_cells(df) - unique_activities = unique_activity_names(df) - # filter by geoscale - fips = create_geoscale_list(df, provided_from_scale) - # determine unique activities after subsetting by geoscale - unique_activities_sub = \ - unique_activity_names(df[df['Location'].isin(fips)]) - - # return df of the difference between unique_activities - # and unique_activities2 - df_missing = dataframe_difference( - unique_activities, unique_activities_sub, which='left_only') - # return df of the similarities between unique_activities - # and unique_activities2 - df_existing = dataframe_difference( - unique_activities, unique_activities_sub, which='both') - df_existing = df_existing.drop(columns='_merge') - df_existing['activity_from_scale'] = provided_from_scale - - if len(df_missing) > 0: - # for loop through geoscales until find data for each activity combo - if provided_from_scale == 'national': - geoscales = ['state', 'county'] - elif provided_from_scale == 'state': - geoscales = ['county'] - elif provided_from_scale == 'county': - log.error('Missing county level data') - - for i in geoscales: - # filter by geoscale - fips_i = create_geoscale_list(df, i) - df_i = df[df['Location'].isin(fips_i)] - - # determine unique activities after subsetting by geoscale - unique_activities_i = unique_activity_names(df_i) - - # return df of the difference between unique_activities subset and - # unique_activities for geoscale - df_missing_i = dataframe_difference( - unique_activities_sub, unique_activities_i, which='right_only') - df_missing_i = df_missing_i.drop(columns='_merge') - df_missing_i['activity_from_scale'] = i - # return df of the similarities between unique_activities - # and unique_activities2 - df_existing_i = dataframe_difference( - unique_activities_sub, unique_activities_i, which='both') - - # append unique activities and df with defined activity_from_scale - unique_activities_sub = pd.concat([unique_activities_sub, - df_missing_i[[fba_activity_fields[0], fba_activity_fields[1]]]], - ignore_index=True) - df_existing = pd.concat([df_existing, df_missing_i], - ignore_index=True) - df_missing = dataframe_difference( - df_missing[[fba_activity_fields[0], fba_activity_fields[1]]], - df_existing_i[[fba_activity_fields[0], - fba_activity_fields[1]]], which=None) - - return df_existing - - -def unique_activity_names(fba_df): - """ - Determine the unique activity names in a df - :param fba_df: a flowbyactivity df - :return: df with ActivityProducedBy and ActivityConsumedBy columns - """ - - activities = fba_df[[fba_activity_fields[0], fba_activity_fields[1]]] - unique_activities = activities.drop_duplicates().reset_index(drop=True) - - return unique_activities - - -def dataframe_difference(df1, df2, which=None): - """ - Find rows which are different between two DataFrames - :param df1: df, FBA or FBS - :param df2: df, FBA or FBS - :param which: 'both', 'right_only', 'left_only' - :return: df, comparison of data in the two dfs - """ - comparison_df = df1.merge(df2, - indicator=True, - how='outer') - if which is None: - diff_df = comparison_df[comparison_df['_merge'] != 'both'] - else: - diff_df = comparison_df[comparison_df['_merge'] == which] - - return diff_df - - def load_fba_w_standardized_units(datasource, year, **kwargs): """ Standardize how a FBA is loaded for allocation purposes when @@ -612,89 +321,19 @@ def load_fba_w_standardized_units(datasource, year, **kwargs): if 'allocation_map_to_flow_list' in kwargs: if kwargs['allocation_map_to_flow_list']: # ensure df loaded correctly/has correct dtypes - fba = clean_df(fba, flow_by_activity_fields, fba_fill_na_dict, + fba = clean_df(fba, flow_by_activity_fields, drop_description=False) fba, mapping_files = map_fbs_flows( fba, datasource, kwargs, keep_fba_columns=True, keep_unmapped_rows=True) else: # ensure df loaded correctly/has correct dtypes - fba = clean_df(fba, flow_by_activity_fields, fba_fill_na_dict) + fba = clean_df(fba, flow_by_activity_fields) fba = standardize_units(fba) else: # ensure df loaded correctly/has correct dtypes - fba = clean_df(fba, flow_by_activity_fields, fba_fill_na_dict, + fba = clean_df(fba, flow_by_activity_fields, drop_description=False) fba = standardize_units(fba) return fba - - -def assign_columns_of_sector_levels(df_load): - """ - Add additional column capturing the sector level in the two columns - :param df_load: df with at least on sector column - :param ambiguous_sector_assignment: if there are sectors that can be - assigned to multiple sector lengths (e.g., for government or household - sectors), option to specify which sector assignment to keep. - :return: df with new column for sector length - """ - df = replace_NoneType_with_empty_cells(df_load) - # load cw with column of sector levels - cw = load_sector_length_cw_melt() - # merge df assigning sector lengths - for s in ['Produced', 'Consumed']: - df = df.merge(cw, how='left', left_on=f'Sector{s}By', - right_on='Sector').drop(columns=['Sector']).rename( - columns={'SectorLength': f'Sector{s}ByLength'}) - df[f'Sector{s}ByLength'] = df[f'Sector{s}ByLength'].fillna(0) - - duplicate_cols = [e for e in df.columns if e not in [ - 'SectorProducedByLength', 'SectorConsumedByLength']] - duplicate_df = df[df.duplicated(subset=duplicate_cols, - keep=False)].reset_index(drop=True) - - if len(duplicate_df) > 0: - log.warning('There are duplicate rows caused by ambiguous sectors.') - - dfc = df.sort_values(['SectorProducedByLength', - 'SectorConsumedByLength']).reset_index(drop=True) - return dfc - - -def assign_sector_match_column(df_load, sectorcolumn, sectorlength, - sectorlengthmatch): - - sector = 'NAICS_' + str(sectorlength) - sector_add = 'NAICS_' + str(sectorlengthmatch) - - cw_load = load_crosswalk("sector_length") - cw = cw_load[[sector, sector_add]].drop_duplicates().reset_index( - drop=True) - - df = df_load.merge(cw, how='left', left_on=sectorcolumn, - right_on=sector - ).rename(columns={sector_add: 'sector_group'} - ).drop(columns=sector) - - return df - - -# def aggregate_and_subset_for_target_sectors(df, method): -# """Helper function to create data at aggregated NAICS prior to -# subsetting based on the target_sector_list. Designed for use when -# FBS are the source data. -# """ -# from flowsa.sectormapping import get_sector_list -# # return sector level specified in method yaml -# # load the crosswalk linking sector lengths -# secondary_sector_level = method.get('target_subset_sector_level') -# sector_list = get_sector_list( -# method.get('target_sector_level'), -# secondary_sector_level_dict=secondary_sector_level) -# -# # subset df to get NAICS at the target level -# df_agg = sector_aggregation(df) -# df_subset = subset_df_by_sector_list(df_agg, sector_list) -# -# return df_subset diff --git a/flowsa/geo.py b/flowsa/geo.py index 32f5bc939..763dce7a0 100644 --- a/flowsa/geo.py +++ b/flowsa/geo.py @@ -2,7 +2,6 @@ import enum from functools import total_ordering import pandas as pd -import numpy as np from . import settings from .flowsa_log import log diff --git a/flowsa/sectormapping.py b/flowsa/sectormapping.py index 2e4bc4b27..f2eed9f3e 100644 --- a/flowsa/sectormapping.py +++ b/flowsa/sectormapping.py @@ -58,243 +58,6 @@ def get_activitytosector_mapping(source, fbsconfigpath=None): return mapping -# def add_sectors_to_flowbyactivity( -# flowbyactivity_df, -# activity_to_sector_mapping=None, -# sectorsourcename=SECTOR_SOURCE_NAME, -# allocationmethod=None, -# overwrite_sectorlevel=None, -# fbsconfigpath=None -# ): -# """ -# Add Sectors from the Activity fields and mapped them to Sector -# from the crosswalk. No allocation is performed. -# :param flowbyactivity_df: A standard flowbyactivity data frame -# :param activity_to_sector_mapping: str, name for activity_to_sector mapping -# :param sectorsourcename: A sector source name, using package default -# :param allocationmethod: str, modifies function behavoir if = 'direct' -# :param fbsconfigpath, str, opt ional path to an FBS method outside flowsa -# repo -# :return: a df with activity fields mapped to 'sectors' -# """ -# from flowsa.naics import convert_naics_year -# # First check if source activities are NAICS like - -# # if so make it into a mapping file -# s = pd.unique(flowbyactivity_df['SourceName'])[0] -# # load catalog info for source, first check for sourcename used -# # in source catalog -# ts = return_true_source_catalog_name(s) -# src_info = load_yaml_dict('source_catalog')[ts] -# # read the pre-determined level of sector aggregation of -# # each crosswalk from the source catalog -# levelofSectoragg = src_info['sector_hierarchy'] -# # if the FBS activity set is 'direct', overwrite the -# # levelofsectoragg, or if specified in fxn call -# if allocationmethod == 'direct': -# levelofSectoragg = 'parent-completeChild' -# if overwrite_sectorlevel is not None: -# levelofSectoragg = overwrite_sectorlevel -# # if data are provided in NAICS format, use the mastercrosswalk -# if src_info['sector-like_activities']: -# cw = load_crosswalk('sector_timeseries') -# sectors = cw.loc[:, [SECTOR_SOURCE_NAME]] -# # Create mapping df that's just the sectors at first -# mapping = sectors.drop_duplicates() -# # Add the sector twice as activities so mapping is identical -# mapping = mapping.assign(Activity=sectors[SECTOR_SOURCE_NAME]) -# mapping = mapping.rename(columns={SECTOR_SOURCE_NAME: "Sector"}) -# # add columns so can run expand_naics_list_fxn -# # if sector-like_activities = True, missing columns, so add -# mapping['ActivitySourceName'] = s -# # tmp assignment -# mapping['SectorType'] = None -# # Include all digits of naics in mapping, if levelofNAICSagg -# # is specified as "aggregated" -# if levelofSectoragg == 'aggregated': -# mapping = expand_naics_list(mapping, sectorsourcename) -# else: -# # if source data activities are text strings, or sector-like -# # activities should be modified, call on the manually -# # created source crosswalks -# if activity_to_sector_mapping: -# s = activity_to_sector_mapping -# mapping = get_activitytosector_mapping(s, fbsconfigpath=fbsconfigpath) -# # filter by SectorSourceName of interest -# mapping = mapping[mapping['SectorSourceName'] == sectorsourcename] -# # drop SectorSourceName -# mapping = mapping.drop(columns=['SectorSourceName']) -# # Include all digits of naics in mapping, if levelofNAICSagg -# # is specified as "aggregated" -# if levelofSectoragg == 'aggregated': -# mapping = expand_naics_list(mapping, sectorsourcename) -# # Merge in with flowbyactivity by -# flowbyactivity_wsector_df = flowbyactivity_df.copy(deep=True) -# for k, v in activity_fields.items(): -# sector_direction = k -# flowbyactivity_field = v[0]["flowbyactivity"] -# flowbysector_field = v[1]["flowbysector"] -# sector_type_field = sector_direction+'SectorType' -# mappings_df_tmp = mapping.rename( -# columns={'Activity': flowbyactivity_field, -# 'Sector': flowbysector_field, -# 'SectorType': sector_type_field}) -# # column doesn't exist for sector-like activities, -# # so ignore if error occurs -# mappings_df_tmp = mappings_df_tmp.drop( -# columns=['ActivitySourceName'], errors='ignore') -# # Merge them in. Critical this is a left merge to -# # preserve all unmapped rows -# flowbyactivity_wsector_df = pd.merge( -# flowbyactivity_wsector_df, mappings_df_tmp, how='left', -# on=flowbyactivity_field) -# for c in ['SectorProducedBy', 'ProducedBySectorType', -# 'SectorConsumedBy', 'ConsumedBySectorType']: -# flowbyactivity_wsector_df[c] = \ -# flowbyactivity_wsector_df[c].replace({np.nan: None}) -# # add sector source name -# flowbyactivity_wsector_df = \ -# flowbyactivity_wsector_df.assign(SectorSourceName=sectorsourcename) -# -# # if activities are sector-like check that the sectors are in the crosswalk -# if src_info['sector-like_activities']: -# flowbyactivity_wsector_df = convert_naics_year( -# flowbyactivity_wsector_df, sectorsourcename) -# -# return flowbyactivity_wsector_df - - -def expand_naics_list(df, sectorsourcename): - """ - Add disaggregated sectors to the crosswalks. - :param df: df, with sector columns - :param sectorsourcename: str, sectorsourcename for naics year - :return: df with additional rows for expanded sector list - """ - - # load master crosswalk - cw = load_crosswalk('sector_timeseries') - sectors = cw.loc[:, [sectorsourcename]] - # drop duplicates - sectors = sectors.drop_duplicates().dropna() - # drop rows that contain hyphenated sectors - sectors = sectors[ - ~sectors[sectorsourcename].str.contains("-")].reset_index(drop=True) - # Ensure 'None' not added to sectors - sectors = sectors[sectors[sectorsourcename] != "None"] - - # create list of sectors that exist in original df, which, - # if created when expanding sector list cannot be added - existing_sectors = df[['Sector']] - existing_sectors = existing_sectors.drop_duplicates() - - naics_df = pd.DataFrame([]) - for i in existing_sectors['Sector']: - dig = len(str(i)) - n = sectors.loc[ - sectors[sectorsourcename].apply(lambda x: x[0:dig]) == i] - if len(n) != 0: - n = n.assign(Sector=i) - naics_df = pd.concat([naics_df, n]) - - # merge df to retain activityname/sectortype info - naics_expanded = df.merge(naics_df, how='left') - # drop column of aggregated naics and rename column of disaggregated naics - naics_expanded = naics_expanded.drop(columns=["Sector"]) - naics_expanded = naics_expanded.rename( - columns={sectorsourcename: 'Sector'}) - # drop duplicates and rearrange df columns - naics_expanded = naics_expanded.drop_duplicates() - naics_expanded = naics_expanded[['ActivitySourceName', 'Activity', - 'Sector', 'SectorType']] - - return naics_expanded - - -# def get_fba_allocation_subset(fba_allocation, source, activitynames, -# sourceconfig=False, flowSubsetMapped=None, -# allocMethod=None, fbsconfigpath=None): -# """ -# Subset the fba allocation data based on NAICS associated with activity -# :param fba_allocation: df, FBA format -# :param source: str, source name -# :param activitynames: list, activity names in activity set -# :param kwargs: can be the mapping file and method of allocation -# :return: df, FBA subset -# """ -# # first determine if there are special cases that would modify the -# # typical method of subset an example of a special case is when the -# # allocation method is 'proportional-flagged' -# subset_by_sector_cols = False -# if flowSubsetMapped is not None: -# fsm = flowSubsetMapped -# if allocMethod is not None: -# am = allocMethod -# if am == 'proportional-flagged': -# subset_by_sector_cols = True -# -# if check_activities_sector_like(fba_allocation, sourcename=source) is \ -# False: -# # read in source crosswalk -# df = get_activitytosector_mapping( -# sourceconfig.get('activity_to_sector_mapping', source), -# fbsconfigpath=fbsconfigpath) -# sec_source_name = df['SectorSourceName'][0] -# df = expand_naics_list(df, sec_source_name) -# # subset source crosswalk to only contain values -# # pertaining to list of activity names -# df = df.loc[df['Activity'].isin(activitynames)] -# # turn column of sectors related to activity names into list -# sector_list = pd.unique(df['Sector']).tolist() -# # subset fba allocation table to the values in -# # the activity list, based on overlapping sectors -# if 'Sector' in fba_allocation: -# fba_allocation_subset =\ -# fba_allocation.loc[fba_allocation['Sector'].isin( -# sector_list)].reset_index(drop=True) -# else: -# fba_allocation_subset = \ -# fba_allocation.loc[ -# (fba_allocation[fbs_activity_fields[0]].isin(sector_list) -# ) | -# (fba_allocation[fbs_activity_fields[1]].isin(sector_list) -# )].reset_index(drop=True) -# else: -# if 'Sector' in fba_allocation: -# fba_allocation_subset =\ -# fba_allocation.loc[fba_allocation['Sector'].isin( -# activitynames)].reset_index(drop=True) -# elif subset_by_sector_cols: -# # if it is a special case, then base the subset of data on -# # sectors in the sector columns, not on activitynames -# fsm_sub = fsm.loc[ -# (fsm[fba_activity_fields[0]].isin(activitynames)) | -# (fsm[fba_activity_fields[1]].isin(activitynames) -# )].reset_index(drop=True) -# part1 = fsm_sub[['SectorConsumedBy']] -# part2 = fsm_sub[['SectorProducedBy']] -# part1.columns = ['Sector'] -# part2.columns = ['Sector'] -# modified_activitynames = \ -# pd.concat([part1, part2], ignore_index=True).drop_duplicates() -# modified_activitynames = modified_activitynames[ -# modified_activitynames['Sector'].notnull()] -# modified_activitynames = modified_activitynames['Sector'].tolist() -# fba_allocation_subset = fba_allocation.loc[ -# (fba_allocation[fbs_activity_fields[0]].isin( -# modified_activitynames)) | -# (fba_allocation[fbs_activity_fields[1]].isin( -# modified_activitynames) -# )].reset_index(drop=True) -# -# else: -# fba_allocation_subset = fba_allocation.loc[ -# (fba_allocation[fbs_activity_fields[0]].isin(activitynames)) | -# (fba_allocation[fbs_activity_fields[1]].isin(activitynames) -# )].reset_index(drop=True) -# -# return fba_allocation_subset - - def convert_units_to_annual(df): """ Convert data and units to annual flows @@ -400,68 +163,6 @@ def map_fbs_flows(fbs, from_fba_source, v, **kwargs): return fbs_mapped, mapping_files -def get_sector_list(sector_level, secondary_sector_level_dict=None): - """ - Create a sector list at the specified sector level - :param sector_level: str, NAICS level - :param secondary_sector_level_dict: dict, additional sectors to keep, - key is the secondary target NAICS level, value is a list of NAICS at the - "sector_level" that should also include a further disaggregated subset - of the data - ex. sector_level = 'NAICS_4' - secondary_sector_level_dict = {'NAICS_6': ['1133', '1125']} - :return: list, sectors at specified sector level - """ - # load crosswalk - cw = load_crosswalk('sector_length') - - # first determine if there are sectors in a secondary target sector - # level that should be included in the sector list. If there are, - # add the sectors at the specified sector length and add the parent - # sectors at the target sector length to a list to be dropped from - # the sector list. - - # create empty lists for sector list and parent sectors to drop - sector_list = [] - sector_drop = [] - # loop through identified secondary sector levels in a dictionary - if secondary_sector_level_dict is not None: - for k, v in secondary_sector_level_dict.items(): - # first determine if any sectors in the sector list are already - # at level k - cw_sec = cw[k].drop_duplicates().values.tolist() - sector_add_list_1 = [x for x in v if x in cw_sec] - # remove any sectors from v if identified in sector_add_list_1 - v = [x for x in v if x not in sector_add_list_1] - - # for any sectors at more aggregated level than k, determine the - # child sectors - cw_melt = cw.melt( - id_vars=[k], var_name="NAICS_Length", - value_name="NAICS_Match").drop_duplicates() - cw_sub = cw_melt[cw_melt['NAICS_Match'].isin(v)] - sector_add_list_2 = cw_sub[k].unique().tolist() - - # determine sectors to add and drop - sector_list = sector_list + sector_add_list_1 + sector_add_list_2 - sector_drop = sector_drop + v - - # check if through loop any sectors in the drop list were included in - # sector list, and if so, drop - sector_list2 = [x for x in sector_list if x not in sector_drop] - - # sectors at primary sector level - sector_col = cw[[sector_level]].drop_duplicates() - # drop any sectors that are already accounted for at a secondary sector - # length - sector_col = sector_col[~sector_col[sector_level].isin(sector_drop)] - # add sectors to list - sector_add = sector_col[sector_level].tolist() - sector_list3 = sector_list2 + sector_add - - return sector_list3 - - def map_to_BEA_sectors(fbs_load, region, io_level, year): """ Map FBS sectors from NAICS to BEA, allocating by gross industry output. diff --git a/flowsa/validation.py b/flowsa/validation.py index 4c6cc4cd8..c9c368c56 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -9,68 +9,13 @@ import numpy as np import flowsa from flowsa.flowby import FlowBySector -from flowsa.flowbyfunctions import aggregator, create_geoscale_list,\ - collapse_fbs_sectors +from flowsa.flowbyfunctions import aggregator, collapse_fbs_sectors from flowsa.flowsa_log import log, vlog -from flowsa.common import sector_level_key, fba_activity_fields -from flowsa.dataclean import replace_NoneType_with_empty_cells, replace_strings_with_NoneType +from flowsa.common import fba_activity_fields from flowsa.location import US_FIPS from flowsa.schema import dq_fields -def check_if_data_exists_at_geoscale(df_load, geoscale): - """ - Check if an activity or a sector exists at the specified geoscale - :param df_load: df with activity columns - :param geoscale: national, state, or county - """ - - # filter by geoscale depends on Location System - fips_list = create_geoscale_list(df_load, geoscale) - fips = pd.DataFrame(fips_list, columns=['FIPS']) - - activities = df_load[['ActivityProducedBy', 'ActivityConsumedBy']]\ - .drop_duplicates().reset_index(drop=True) - # add tmp column and merge - fips['tmp'] = 1 - activities['tmp'] = 1 - activities = activities.merge(fips, on='tmp').drop(columns='tmp') - - # merge activities with df and determine which FIPS are missing for each - # activity - df = df_load[df_load['Location'].isin(fips_list)] - # if activities are defined, subset df - # df = df[df['']] - - dfm = df.merge(activities, - left_on=['ActivityProducedBy', 'ActivityConsumedBy', - 'Location'], - right_on=['ActivityProducedBy', 'ActivityConsumedBy', - 'FIPS'], - how='outer') - # subset into df where values for state and where states do not have data - df1 = dfm[~dfm['FlowAmount'].isna()] - df2 = dfm[dfm['FlowAmount'].isna()] - df2 = df2[['ActivityProducedBy', 'ActivityConsumedBy', - 'FIPS']].reset_index(drop=True) - - # define source name and year - sn = df_load['SourceName'][0] - y = df_load['Year'][0] - - if len(df1) == 0: - vlog.info(f'No flows found for activities in {sn} {y} at the ' - f'{geoscale} scale') - if len(df2) > 0: - # if len(df2) > 1: - df2 = df2.groupby( - ['ActivityProducedBy', 'ActivityConsumedBy'], dropna=False).agg( - lambda col: ','.join(col)).reset_index() - vlog.info("There are %s, activity combos that do not have " - "data in %s %s: \n {}".format(df2.to_string()), - geoscale, sn, y) - - def calculate_flowamount_diff_between_dfs(dfa_load, dfb_load): """ Calculate the differences in FlowAmounts between two dfs @@ -162,282 +107,6 @@ def calculate_flowamount_diff_between_dfs(dfa_load, dfb_load): vlog.info('Total FlowAmount differences by Activity Columns: ' '\n {}'.format(dfagg2.to_string(), index=False)) -# todo: convert this fxn to recursive method - important to check FBA to FBS -# flow totals -# def compare_activity_to_sector_flowamounts(fba_load, fbs_load, -# activity_set, config, v, attr, **_): -# """ -# Function to compare the loaded flowbyactivity with the final flowbysector -# by activityname (if exists) to target sector level -# output, checking for data loss -# :param fba_load: df, FBA loaded and mapped using FEDEFL -# :param fbs_load: df, final FBS df -# :param activity_set: str, activity set -# :param config: dictionary, method yaml -# :return: printout data differences between loaded FBA and FBS output, -# save results as csv in local directory -# """ -# data_format = v.get('data_format') -# if (data_format == 'FBA') & (check_activities_sector_like(fba_load)): -# vlog.debug('Not comparing loaded FlowByActivity to FlowBySector ' -# 'ratios for a dataset with sector-like activities because ' -# 'if there are modifications to flowamounts for a sector, ' -# 'then the ratios will be different') -# else: -# # subset fba df -# col_subset = ['Class', 'MetaSources', 'Flowable', 'Unit', 'FlowType', -# 'ActivityProducedBy', 'ActivityConsumedBy', -# 'SectorProducedBy', 'SectorConsumedBy', 'Context', -# 'Location', 'LocationSystem', 'Year', 'FlowAmount'] -# fba = fba_load[fba_load.columns.intersection( -# col_subset)].reset_index(drop=True) -# # todo: modify so location subset is based on target geoscale -# fba.loc[:, 'Location'] = US_FIPS -# group_cols = [e for e in fba.columns if e in -# ['ActivityProducedBy', 'ActivityConsumedBy', -# 'SectorProducedBy', 'SectorConsumedBy', 'Flowable', -# 'Unit', 'FlowType', 'Context', 'Location', -# 'LocationSystem', 'Year']] -# fba_agg = aggregator(fba, group_cols) -# fba_agg.rename(columns={'FlowAmount': 'FBA_amount'}, inplace=True) -# -# # subset fbs df -# col_subset_2 = ['Class', 'SectorSourceName', 'Flowable', 'Unit', -# 'FlowType', 'SectorProducedBy', -# 'ActivityProducedBy', 'ActivityConsumedBy', -# 'Context', 'Location', 'LocationSystem', 'Year', -# 'FlowAmount'] -# if attr.get('allocation_merge_columns') is not None: -# col_subset_2 = col_subset_2 + attr.get('allocation_merge_columns') -# fbs = fbs_load[fbs_load.columns.intersection( -# col_subset_2)].reset_index(drop=True) -# -# # determine which -# for i in ['Produced', 'Consumed']: -# try: -# fbs[f'{i}Length'] = fbs[f'Sector{i}By'].str.len() -# except KeyError: -# pass -# max_list = [e for e in fbs.columns if e in ['ProducedLength', -# 'ConsumedLength']] -# fbs['SectorLength'] = fbs[max_list].max(axis=1) -# -# fbs.loc[:, 'Location'] = US_FIPS -# group_cols = ['Flowable', 'Unit', 'FlowType', 'Context', 'Location', -# 'LocationSystem', 'Year', 'SectorLength'] -# if v.get('data_format') == 'FBA': -# group_cols = ['ActivityProducedBy', 'ActivityConsumedBy'] + \ -# group_cols -# else: -# group_cols = attr.get('allocation_merge_columns') + group_cols -# fbs_agg = aggregator(fbs, group_cols) -# fbs_agg.rename(columns={'FlowAmount': 'FBS_amount'}, inplace=True) -# -# # merge compare 1 and compare 2 -# if v.get('data_format') == 'FBA': -# merge_cols = ['ActivityProducedBy', 'ActivityConsumedBy', -# 'Flowable', 'Unit', 'FlowType', 'Context', -# 'Location', 'LocationSystem', 'Year'] -# else: -# merge_cols = attr.get('allocation_merge_columns') + \ -# ['Flowable', 'Unit', 'FlowType', 'Context', -# 'Location', 'LocationSystem', 'Year'] -# df_merge = fba_agg.merge(fbs_agg, left_on=merge_cols, -# right_on=merge_cols, how='left') -# df_merge['Ratio'] = df_merge['FBS_amount'] / df_merge['FBA_amount'] -# -# # reorder -# order_cols = ['SectorProducedBy', 'SectorConsumedBy', -# 'ActivityProducedBy', 'ActivityConsumedBy', -# 'Flowable', 'Unit', 'FlowType', 'Context', 'Location', -# 'LocationSystem', 'Year', 'SectorLength', -# 'FBA_amount', 'FBS_amount', 'Ratio'] -# df_merge = df_merge[df_merge.columns.intersection( -# order_cols)].reset_index(drop=True) -# -# # keep only rows of specified sector length -# # todo: update to also keep sub target list -# comparison = df_merge[ -# df_merge['SectorLength'] == sector_level_key[ -# config['target_sector_level']]].reset_index(drop=True) -# -# tolerance = 0.01 -# comparison2 = comparison[(comparison['Ratio'] < 1 - tolerance) | -# (comparison['Ratio'] > 1 + tolerance)] -# -# if len(comparison2) > 0: -# vlog.info('There are %s combinations of flowable/context/sector ' -# 'length where the flowbyactivity to flowbysector ratio ' -# 'is less than or greater than 1 by %s', -# len(comparison2), str(tolerance)) -# -# # include df subset in the validation log -# # only print rows where flowamount ratio is less t -# # han 1 (round flowamountratio) -# df_v = comparison2[comparison2['Ratio'].apply( -# lambda x: round(x, 3) < 1)].reset_index(drop=True) -# -# # save to validation log -# log.info('Save the comparison of FlowByActivity load ' -# 'to FlowBySector ratios for %s in validation log', -# activity_set) -# # if df not empty, print, if empty, print string -# if df_v.empty: -# vlog.info('Ratios for %s all round to 1', activity_set) -# else: -# vlog.info('Comparison of FlowByActivity load to ' -# 'FlowBySector ratios for %s: ' -# '\n {}'.format(df_v.to_string()), activity_set) - - -# def compare_fba_geo_subset_and_fbs_output_totals( -# fba_load, fbs_load, activity_set, source_name, source_attr, -# activity_attr, method): -# """ -# Function to compare the loaded flowbyactivity total after -# subsetting by activity and geography with the final flowbysector output -# total. Not a direct comparison of the loaded FBA because FBAs are -# modified before being subset by activity for the target sector level -# :param fba_load: df, FBA loaded, before being mapped -# :param fbs_load: df, final FBS df at target sector level -# :param activity_set: str, activity set -# :param source_name: str, source name -# :param source_attr: dictionary, attribute data from method yaml -# for source data -# :param activity_attr: dictionary, attribute data from method yaml -# for activity set -# :param method: dictionary, FBS method yaml -# :return: printout data differences between loaded FBA and FBS output -# totals by location, save results as csv in local directory -# """ -# -# vlog.info('Comparing Flow-By-Activity subset by activity and geography to ' -# 'the subset Flow-By-Sector FlowAmount total.') -# -# # determine from scale -# if fips_number_key[source_attr['geoscale_to_use']] < \ -# fips_number_key[activity_attr['allocation_from_scale']]: -# from_scale = source_attr['geoscale_to_use'] -# else: -# from_scale = activity_attr['allocation_from_scale'] -# -# if source_attr['data_format'] == 'FBA': -# # extract relevant geoscale data or aggregate existing data -# fba = subset_df_by_geoscale(fba_load, from_scale, -# method['target_geoscale']) -# if check_activities_sector_like(fba_load): -# # if activities are sector-like, run sector aggregation and then -# # subset df to only keep NAICS2 -# fba = fba[['Class', 'SourceName', 'FlowAmount', 'Unit', 'Context', -# 'ActivityProducedBy', 'ActivityConsumedBy', 'Location', -# 'LocationSystem']] -# # rename the activity cols to sector cols for purposes of aggregation -# fba = fba.rename(columns={'ActivityProducedBy': 'SectorProducedBy', -# 'ActivityConsumedBy': 'SectorConsumedBy'}) -# fba = sector_aggregation(fba) -# # subset fba to only include NAICS2 -# # fba = replace_NoneType_with_empty_cells(fba) -# fba = subset_df_by_sector_lengths(fba, [2]) -# else: -# fba = sector_aggregation(fba_load) -# fba = subset_df_by_sector_lengths(fba, [2]) -# # subset/agg dfs -# col_subset = ['Class', 'FlowAmount', 'Unit', 'Context', -# 'Location', 'LocationSystem'] -# group_cols = ['Class', 'Unit', 'Context', 'Location', 'LocationSystem'] -# # check units -# compare_df_units(fba, fbs_load) -# # fba -# fba = fba[col_subset] -# fba_agg = aggregator(fba, group_cols).reset_index(drop=True) -# fba_agg.rename(columns={'FlowAmount': 'FBA_amount', -# 'Unit': 'FBA_unit'}, inplace=True) -# -# # fbs -# fbs = fbs_load[col_subset] -# fbs_agg = aggregator(fbs, group_cols) -# fbs_agg.rename(columns={'FlowAmount': 'FBS_amount', -# 'Unit': 'FBS_unit'}, inplace=True) -# -# try: -# # merge FBA and FBS totals -# df_merge = fba_agg.merge(fbs_agg, how='left') -# df_merge['FBS_amount'] = df_merge['FBS_amount'].fillna(0) -# df_merge['FlowAmount_difference'] = \ -# df_merge['FBA_amount'] - df_merge['FBS_amount'] -# df_merge['Percent_difference'] = \ -# (df_merge['FlowAmount_difference']/df_merge['FBA_amount']) * 100 -# # cases where flow amount diff is 0 but because fba amount is 0, -# # percent diff is null. Fill those cases with 0s -# df_merge['Percent_difference'] = np.where( -# (df_merge['FlowAmount_difference'] == 0) & -# (df_merge['FBA_amount'] == 0), 0, df_merge['Percent_difference']) -# # reorder -# df_merge = df_merge[['Class', 'Context', 'Location', 'LocationSystem', -# 'FBA_amount', 'FBA_unit', 'FBS_amount', -# 'FBS_unit', 'FlowAmount_difference', -# 'Percent_difference']] -# # df_merge = replace_NoneType_with_empty_cells(df_merge) -# -# # list of contexts and locations -# context_list = df_merge[['Class', 'Context', -# 'Location']].values.tolist() -# -# # loop through the contexts and print results of comparison -# vlog.info(f'Comparing FBA {activity_set} {source_attr["geoscale_to_use"]} ' -# 'subset to FBS results. Details in Validation Log') -# for i, j, k in context_list: -# df_merge_subset = \ -# df_merge[(df_merge['Class'] == i) & -# (df_merge['Context'] == j) & -# (df_merge['Location'] == k)].reset_index(drop=True) -# diff_per = df_merge_subset['Percent_difference'][0] -# if np.isnan(diff_per): -# vlog.info(f'FlowBySector FlowAmount for {source_name} ' -# f'{activity_set} {i} does not exist in the FBS') -# continue -# # make reporting more manageable -# if abs(diff_per) > 0.01: -# diff_per = round(diff_per, 2) -# else: -# diff_per = round(diff_per, 6) -# -# # diff_units = df_merge_subset['FBS_unit'][0] -# if diff_per > 0: -# vlog.info(f'FlowBySector FlowAmount for {source_name} ' -# f'{activity_set} {i} {j} at {k} is ' -# f'{str(abs(diff_per))}% less than the ' -# f'FlowByActivity FlowAmount') -# elif diff_per < 0: -# vlog.info(f'FlowBySector FlowAmount for {source_name} ' -# f'{activity_set} {i} {j} at {k} is ' -# f'{str(abs(diff_per))}% more than the ' -# f'FlowByActivity FlowAmount') -# elif diff_per == 0: -# vlog.info(f'FlowBySector FlowAmount for {source_name} ' -# f'{activity_set} {i} {j} at {k} is equal to the ' -# f'FlowByActivity FlowAmount') -# -# # subset the df to include in the validation log -# # only print rows where the percent difference does not round to 0 -# df_v = df_merge[df_merge['Percent_difference'].apply( -# lambda x: round(x, 3) != 0)].reset_index(drop=True) -# -# # log output -# log.info('Save the comparison of FlowByActivity load to FlowBySector ' -# f'total FlowAmounts for {activity_set} in validation log file') -# # if df not empty, print, if empty, print string -# if df_v.empty: -# vlog.info(f'Percent difference between loaded FBA and ' -# f'output FBS for {activity_set} all round to 0') -# else: -# vlog.info('Comparison of FBA load to FBS total ' -# 'FlowAmounts for %s: ' -# '\n {}'.format(df_v.to_string()), activity_set) -# except: -# vlog.info('Error occurred when comparing total FlowAmounts ' -# 'for FlowByActivity and FlowBySector') - def compare_summation_at_sector_lengths_between_two_dfs(df1, df2): """ @@ -502,72 +171,6 @@ def compare_summation_at_sector_lengths_between_two_dfs(df1, df2): 'length') -# def compare_child_to_parent_sectors_flowamounts(df_load): -# """ -# Sum child sectors up to one sector and compare to parent sector values -# :param df_load: df, contains sector columns -# :return: comparison of flow values -# """ -# from flowsa.flowbyfunctions import assign_sector_match_column -# -# merge_cols = [e for e in df_load.columns if e in [ -# 'Class', 'SourceName', 'MetaSources', 'FlowName', 'Unit', -# 'FlowType', 'Flowable', 'ActivityProducedBy', 'ActivityConsumedBy', -# 'Compartment', 'Context', 'Location', 'Year', 'Description']] -# # determine if activities are sector-like -# sector_like_activities = check_activities_sector_like(df_load) -# # if activities are sector like, drop columns from merge group -# if sector_like_activities: -# merge_cols = [e for e in merge_cols if e not in ( -# 'ActivityProducedBy', 'ActivityConsumedBy')] -# -# agg_cols = merge_cols + ['SectorProducedMatch', 'SectorConsumedMatch'] -# dfagg = pd.DataFrame() -# for i in range(3, 7): -# df = subset_df_by_sector_lengths(df_load, [i]) -# for s in ['Produced', 'Consumed']: -# df = assign_sector_match_column(df, f'Sector{s}By', i, i-1).rename( -# columns={'sector_group': f'Sector{s}Match'}) -# df = df.fillna('') -# df2 = df.groupby(agg_cols).agg( -# {'FlowAmount': 'sum'}).rename(columns={ -# 'FlowAmount': 'ChildNAICSSum'}).reset_index() -# dfagg = pd.concat([dfagg, df2], ignore_index=True) -# -# # merge new df with summed child naics to original df -# drop_cols = [e for e in df_load.columns if e in -# ['MeasureofSpread', 'Spread', 'DistributionType', 'Min', -# 'Max', 'DataReliability', 'DataCollection', 'Description', -# 'SectorProducedMatch', 'SectorConsumedMatch']] -# dfm = df_load.merge(dfagg, how='left', left_on=merge_cols + [ -# 'SectorProducedBy', 'SectorConsumedBy'], right_on=agg_cols).drop( -# columns=drop_cols) -# dfm = dfm.assign(FlowDiff=dfm['ChildNAICSSum'] - dfm['FlowAmount']) -# dfm['PercentDiff'] = (dfm['FlowDiff'] / dfm['FlowAmount']) * 100 -# -# cols_subset = [e for e in dfm.columns if e in [ -# 'Class', 'SourceName', 'MetaSources', 'Flowable', 'FlowName', -# 'Unit', 'FlowType', 'ActivityProducedBy', 'ActivityConsumedBy', -# 'Context', 'Location', 'Year', 'SectorProducedBy', -# 'SectorConsumedBy', 'FlowAmount', 'ChildNAICSSum', 'PercentDiff']] -# dfm = dfm[cols_subset] -# -# # subset df where child sectors sum to be greater than parent sectors -# tolerance = 1 -# dfm2 = dfm[(dfm['PercentDiff'] > tolerance) | -# (dfm['PercentDiff'] < - tolerance)].reset_index(drop=True) -# -# if len(dfm2) > 0: -# log.info(f'See validation log for cases where child sectors sum to be ' -# f'different than parent sectors by at least {tolerance}%.') -# vlog.info('There are cases where child sectors sum to be ' -# 'different than parent sectors by at least %s%%: ' -# '\n {}'.format(dfm2.to_string()), tolerance) -# else: -# vlog.info(f'No child sectors sum to be different than parent ' -# f'sectors by at least {tolerance}%.') - - def check_for_nonetypes_in_sector_col(df): """ Check for NoneType in columns where datatype = string From 51b1b3e5618873fe6ef5ea619407706e7dbcb03e Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 24 Aug 2023 16:55:53 -0600 Subject: [PATCH 0834/1127] update standardize_units() for the FBA to use the same conversion csv used by FBS --- flowsa/dataclean.py | 175 +++++++++----------------------------------- 1 file changed, 36 insertions(+), 139 deletions(-) diff --git a/flowsa/dataclean.py b/flowsa/dataclean.py index f9d687c83..c2ee07a82 100644 --- a/flowsa/dataclean.py +++ b/flowsa/dataclean.py @@ -69,148 +69,45 @@ def add_missing_flow_by_fields(flowby_partial_df, flowbyfields): def standardize_units(df): """ - Convert unit to standard + Convert unit to standard using csv Timeframe is over one year + This function is copied from the flowby.py fxn :param df: df, Either flowbyactivity or flowbysector :return: df, with standarized units """ - days_in_year = 365 - sq_ft_to_sq_m_multiplier = 0.092903 - # rounded to match USGS_NWIS_WU mapping file on FEDEFL - gallon_water_to_kg = 3.79 - ac_ft_water_to_kg = 1233481.84 - acre_to_m2 = 4046.8564224 - mj_in_btu = .0010550559 - ton_to_kg = 907.185 - lb_to_kg = 0.45359 - - # strip whitespace from units - df['Unit'] = df['Unit'].str.strip() - - # class = employment, unit = 'p' - # class = energy, unit = MJ - # class = land, unit = m2 - df.loc[:, 'FlowAmount'] = np.where(df['Unit'].isin(['ACRES', 'Acres']), - df['FlowAmount'] * acre_to_m2, - df['FlowAmount']) - df.loc[:, 'Unit'] = np.where(df['Unit'].isin(['ACRES', 'Acres']), - 'm2', df['Unit']) - - df.loc[:, 'FlowAmount'] = \ - np.where(df['Unit'].isin(['million sq ft', 'million square feet']), - df['FlowAmount'] * sq_ft_to_sq_m_multiplier * 1000000, - df['FlowAmount']) - df.loc[:, 'Unit'] = \ - np.where(df['Unit'].isin(['million sq ft', 'million square feet']), - 'm2', df['Unit']) - - df.loc[:, 'FlowAmount'] = \ - np.where(df['Unit'].isin(['square feet']), - df['FlowAmount'] * sq_ft_to_sq_m_multiplier, df['FlowAmount']) - df.loc[:, 'Unit'] = \ - np.where(df['Unit'].isin(['square feet']), 'm2', df['Unit']) - - # class = money, unit = USD - if df['Unit'].str.contains('Canadian Dollar').any(): - exchange_rate = float(get_Canadian_to_USD_exchange_rate( - df['Year'].unique()[0])) - df.loc[:, 'FlowAmount'] = np.where(df['Unit'] == 'Canadian Dollar', - df['FlowAmount'] / exchange_rate, - df['FlowAmount']) - df.loc[:, 'FlowAmount'] = np.where(df['Unit'] == 'Thousand USD', - df['FlowAmount'] * 1000, - df['FlowAmount']) - df.loc[:, 'Unit'] = np.where(df['Unit'].isin( - ['Canadian Dollar', 'Thousand USD']), 'USD', df['Unit']) - - # class = water, unit = kg - df.loc[:, 'FlowAmount'] = \ - np.where(df['Unit'] == 'gallons/animal/day', - (df['FlowAmount'] * gallon_water_to_kg) * days_in_year, - df['FlowAmount']) - df.loc[:, 'Unit'] = \ - np.where(df['Unit'] == 'gallons/animal/day', 'kg', df['Unit']) - - df.loc[:, 'FlowAmount'] = \ - np.where(df['Unit'] == 'ACRE FEET / ACRE', - (df['FlowAmount'] / acre_to_m2) * ac_ft_water_to_kg, - df['FlowAmount']) - df.loc[:, 'Unit'] = \ - np.where(df['Unit'] == 'ACRE FEET / ACRE', 'kg/m2', df['Unit']) - - df.loc[:, 'FlowAmount'] = \ - np.where(df['Unit'] == 'Mgal', - df['FlowAmount'] * 1000000 * gallon_water_to_kg, - df['FlowAmount']) - df.loc[:, 'Unit'] = np.where(df['Unit'] == 'Mgal', 'kg', df['Unit']) - - df.loc[:, 'FlowAmount'] = np.where(df['Unit'] == 'gal', - df['FlowAmount'] * gallon_water_to_kg, - df['FlowAmount']) - df.loc[:, 'Unit'] = np.where(df['Unit'] == 'gal', 'kg', df['Unit']) - - df.loc[:, 'FlowAmount'] = np.where(df['Unit'] == 'gal/USD', - df['FlowAmount'] * gallon_water_to_kg, - df['FlowAmount']) - df.loc[:, 'Unit'] = np.where(df['Unit'] == 'gal/USD', 'kg/USD', df['Unit']) - - df.loc[:, 'FlowAmount'] = \ - np.where(df['Unit'] == 'Bgal/d', - df['FlowAmount'] * (10**9) * gallon_water_to_kg * - days_in_year, - df['FlowAmount']) - df.loc[:, 'Unit'] = np.where(df['Unit'] == 'Bgal/d', 'kg', df['Unit']) - - df.loc[:, 'FlowAmount'] = \ - np.where(df['Unit'] == 'Mgal/d', - df['FlowAmount'] * (10**6) * gallon_water_to_kg * - days_in_year, - df['FlowAmount']) - df.loc[:, 'Unit'] = np.where(df['Unit'] == 'Mgal/d', 'kg', df['Unit']) - - # Convert Energy unit "Quadrillion Btu" to MJ - # 1 Quad = .0010550559 x 10^15 - df.loc[:, 'FlowAmount'] = \ - np.where(df['Unit'] == 'Quadrillion Btu', - df['FlowAmount'] * mj_in_btu * (10 ** 15), - df['FlowAmount']) - df.loc[:, 'Unit'] = \ - np.where(df['Unit'] == 'Quadrillion Btu', 'MJ', df['Unit']) - - # Convert Energy unit "Trillion Btu" to MJ - # 1 Tril = .0010550559 x 10^12 - df.loc[:, 'FlowAmount'] = \ - np.where(df['Unit'].isin(['Trillion Btu', 'TBtu']), - df['FlowAmount'] * mj_in_btu * (10 ** 12), - df['FlowAmount']) - df.loc[:, 'Unit'] = \ - np.where(df['Unit'].isin(['Trillion Btu', 'TBtu']), 'MJ', df['Unit']) - - # Convert million cubic meters to gallons (for water) - df.loc[:, 'FlowAmount'] = \ - np.where(df['Unit'] == 'million Cubic metres/year', - df['FlowAmount'] * 264.172 * (10**6) * gallon_water_to_kg, - df['FlowAmount']) - df.loc[:, 'Unit'] = \ - np.where(df['Unit'] == 'million Cubic metres/year', 'kg', df['Unit']) - - # Convert mass units (LB or TON) to kg - df.loc[:, 'FlowAmount'] = np.where( - df['Unit'].isin(['TON', 'tons', 'short tons']), - df['FlowAmount'] * ton_to_kg, df['FlowAmount']) - df.loc[:, 'FlowAmount'] = np.where(df['Unit'] == 'Thousands of Tons', - df['FlowAmount'] * 1000 * ton_to_kg, - df['FlowAmount']) - df.loc[:, 'FlowAmount'] = np.where(df['Unit'] == 'LB', - df['FlowAmount'] * lb_to_kg, - df['FlowAmount']) - df.loc[:, 'FlowAmount'] = np.where(df['Unit'] == 'MT', - df['FlowAmount'] * 1000, - df['FlowAmount']) - df.loc[:, 'Unit'] = np.where(df['Unit'].isin( - ['TON', 'tons', 'short tons', 'LB', 'Thousands of Tons', 'MT']), 'kg', - df['Unit']) - - return df + year = df['Year'][0] + + exchange_rate = ( + literature_values + .get_Canadian_to_USD_exchange_rate(year) + ) + + conversion_table = pd.concat([ + pd.read_csv(settings.datapath / 'unit_conversion.csv'), + pd.Series({'old_unit': 'Canadian Dollar', + 'new_unit': 'USD', + 'conversion_factor': 1 / exchange_rate}).to_frame().T + ]) + + standardized = ( + df + .assign(Unit=df.Unit.str.strip()) + .merge(conversion_table, how='left', + left_on='Unit', right_on='old_unit') + .assign(Unit=lambda x: x.new_unit.mask(x.new_unit.isna(), x.Unit), + conversion_factor=lambda x: x.conversion_factor.fillna(1), + FlowAmount=lambda x: x.FlowAmount * x.conversion_factor) + .drop(columns=['old_unit', 'new_unit', 'conversion_factor']) + ) + + standardized_units = list(conversion_table.new_unit.unique()) + + if any(~standardized.Unit.isin(standardized_units)): + unstandardized_units = [unit for unit in standardized.Unit.unique() + if unit not in standardized_units] + flowsa_log.log.warning(f'Some units not standardized by ' + f'standardize_units(): {unstandardized_units}.') + + return standardized From e47a7a3048ebbe7765ee7eb6de8a5a401f3832f9 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 24 Aug 2023 16:59:47 -0600 Subject: [PATCH 0835/1127] update import statements --- flowsa/bibliography.py | 5 ++--- flowsa/flowby.py | 2 +- flowsa/flowbyactivity.py | 1 - flowsa/flowbyclean.py | 3 +-- flowsa/sectormapping.py | 4 +--- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/flowsa/bibliography.py b/flowsa/bibliography.py index 92e883088..b037c996e 100644 --- a/flowsa/bibliography.py +++ b/flowsa/bibliography.py @@ -9,9 +9,8 @@ from bibtexparser.bwriter import BibTexWriter from bibtexparser.bibdatabase import BibDatabase from esupy.processed_data_mgmt import mkdir_if_missing -from flowsa.common import load_yaml_dict, \ - load_values_from_literature_citations_config, get_flowsa_base_name, \ - sourceconfigpath, load_yaml_dict +from flowsa.common import load_values_from_literature_citations_config, \ + get_flowsa_base_name, sourceconfigpath, load_yaml_dict from flowsa.flowsa_log import log from flowsa.settings import outputpath, biboutputpath diff --git a/flowsa/flowby.py b/flowsa/flowby.py index aece3ec79..59b9b0d9f 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -6,7 +6,7 @@ from copy import deepcopy from flowsa import (common, settings, metadata, sectormapping, literature_values, flowbyactivity, flowsa_yaml, - validation, geo, naics, exceptions, location, schema) + validation, geo, naics, exceptions, schema) from flowsa.flowsa_log import log, vlog, reset_log_file import esupy.processed_data_mgmt import esupy.dqi diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index 018399dba..56ace7c99 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -19,7 +19,6 @@ from flowsa.settings import paths from flowsa.flowsa_log import log, reset_log_file from flowsa.metadata import set_fb_meta, write_metadata -from flowsa.flowbyfunctions import fba_fill_na_dict from flowsa.schema import flow_by_activity_fields from flowsa.dataclean import clean_df diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index 59a0630b8..15f1c746d 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -3,8 +3,7 @@ from flowsa.flowby import FlowBySector, FB, get_catalog_info, \ get_flowby_from_config from flowsa.flowsa_log import log -from flowsa import (geo, location, getFlowBySector, flowbyfunctions, - FlowByActivity) +from flowsa import (geo, location, FlowByActivity) from flowsa.naics import map_source_sectors_to_more_aggregated_sectors from flowsa.validation import compare_summation_at_sector_lengths_between_two_dfs diff --git a/flowsa/sectormapping.py b/flowsa/sectormapping.py index f2eed9f3e..41f39a199 100644 --- a/flowsa/sectormapping.py +++ b/flowsa/sectormapping.py @@ -9,10 +9,8 @@ import numpy as np from esupy.mapping import apply_flow_mapping import flowsa -from flowsa.common import get_flowsa_base_name, fba_activity_fields, \ - fbs_activity_fields +from flowsa.common import get_flowsa_base_name, load_crosswalk from flowsa.dataclean import standardize_units -from flowsa.flowbyfunctions import load_crosswalk from flowsa.flowsa_log import log from flowsa.schema import dq_fields From 961d032cba490e4e9a42e91653ebeabfae76ce52 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 25 Aug 2023 14:28:11 -0400 Subject: [PATCH 0836/1127] use Use table for industrial stationary combustion emissions from petroleum, expand sectors, to align with national model --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 18 ++++++++++----- .../EPA_StateGHGI_asets.csv | 4 ++-- .../flowbysectormethods/GHG_state_2019.yaml | 2 +- .../flowbysectormethods/GHG_state_common.yaml | 22 +++++-------------- 4 files changed, 20 insertions(+), 26 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index 606cec3eb..808f48e70 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -136,9 +136,12 @@ EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combusti EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,31,,industrial_gas EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,32,,industrial_gas EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,33,,industrial_gas -EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,NAICS_2012_Code,31,,industrial_petroleum -EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,NAICS_2012_Code,32,,industrial_petroleum -EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,NAICS_2012_Code,33,,industrial_petroleum +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,NAICS_2012_Code,11,,use_table_pet +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,NAICS_2012_Code,21,,use_table_pet +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,NAICS_2012_Code,23,,use_table_pet +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,NAICS_2012_Code,31,,use_table_pet +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,NAICS_2012_Code,32,,use_table_pet +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,NAICS_2012_Code,33,,use_table_pet EPA_State_GHGI,Residential - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,F010,,direct EPA_State_GHGI,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,F010,,direct EPA_State_GHGI,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,F010,,direct @@ -261,9 +264,12 @@ EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,112,,transport_machinery EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,113,,transport_machinery EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,114,,transport_machinery -EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,31,,industrial_petroleum -EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,32,,industrial_petroleum -EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,33,,industrial_petroleum +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,11,,use_table_pet +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,21,,use_table_pet +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,23,,use_table_pet +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,31,,use_table_pet +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,32,,use_table_pet +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,33,,use_table_pet EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,111,,transport_machinery EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,112,,transport_machinery EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,113,,transport_machinery diff --git a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv index d66fb7d29..220e87cec 100644 --- a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv @@ -69,7 +69,7 @@ direct,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel C industrial_ch4_n2o,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial, industrial_coal,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,EPA_GHGI_T_A_14 industrial_gas,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,EPA_GHGI_T_A_14 -industrial_petroleum,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,EPA_GHGI_T_A_14 +use_table_pet,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,EPA_GHGI_T_A_14 direct,Residential - Stationary Combustion - Fossil Fuel Combustion, direct,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal, direct,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas, @@ -144,7 +144,7 @@ direct,Commercial - Landfills - Municipal - Landfills - MSW Landfill - MSW Landf direct,Industry - Wastewater Treatment - Wastewater Treatment and Discharge - Industrial,EPA_GHGI_T_2_1 direct,Commercial - Wastewater Treatment - Wastewater Treatment and Discharge - Domestic,EPA_GHGI_T_2_1 transport_machinery,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,EPA_GHGI_T_3_14 -industrial_petroleum,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,negative emissions; align with 'Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum' to avoid double counting +use_table_pet,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,negative emissions; align with 'Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum' to avoid double counting transport_machinery,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,EPA_GHGI_T_3_13 transport_machinery,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,EPA_GHGI_T_3_14 direct,Electric Power Industry - Other Process Uses of Carbonates - Mineral Industry, diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml index d48d2684c..37ca930fd 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml @@ -31,7 +31,7 @@ source_names: selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - use_table_pet: # commercial petroleum combustion; mobile ag equipment + use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: diff --git a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml index 4268e9f6e..8ee2f4a6d 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml @@ -74,7 +74,7 @@ source_names: selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - use_table_pet: # commercial petroleum combustion; mobile ag equipment + use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_pet attribution_method: proportional @@ -148,19 +148,6 @@ source_names: Class: Energy Flowable: Coal - industrial_petroleum: # CO2 from industrial petroleum combustion - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv industrial_petroleum - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - selection_fields: - Class: Energy - Flowable: - - Distillate Fuel Oil - - Residual Fuel Oil - # - "Other" Should this be included? - industrial_gas: # CO2 from industrial gas combustion selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv industrial_gas @@ -175,9 +162,10 @@ source_names: clean_fba_before_activity_sets: !script_function:EPA_StateGHGI allocate_flows_by_fuel clean_parameter: flow_ratio_source: - - !from_index:EPA_StateGHGI_asets.csv industrial_coal - - !from_index:EPA_StateGHGI_asets.csv industrial_petroleum - - !from_index:EPA_StateGHGI_asets.csv industrial_gas + - Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal + - Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas + - Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum + - Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment fba_source: # National tables for identifyng CH4 and N2O ratios to CO2 - EPA_GHGI_T_3_7 - EPA_GHGI_T_3_8 From a7f9622697e993f5d9adc292b168c36afd7aedb9 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 25 Aug 2023 15:09:29 -0400 Subject: [PATCH 0837/1127] to better align with the national model, estimate splits between manufacturing and non-manufacturing stationary combustion industrial emissions from coal and gas, this allows for attribution of these emissions to 11, 21, and 23 --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 18 ++++++++---- flowsa/data_source_scripts/EPA_StateGHGI.py | 29 +++++++++++++++++++ .../EPA_StateGHGI_asets.csv | 6 ++-- .../flowbysectormethods/GHG_state_2019.yaml | 4 +-- .../flowbysectormethods/GHG_state_common.yaml | 16 +++++++--- 5 files changed, 59 insertions(+), 14 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index 808f48e70..ba36a04c7 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -130,12 +130,18 @@ EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossi EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,31,,industrial_ch4_n2o EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,32,,industrial_ch4_n2o EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,33,,industrial_ch4_n2o -EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,31,,industrial_coal -EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,32,,industrial_coal -EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,33,,industrial_coal -EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,31,,industrial_gas -EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,32,,industrial_gas -EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,33,,industrial_gas +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal - Manufacturing,NAICS_2012_Code,31,,industrial_coal +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal - Manufacturing,NAICS_2012_Code,32,,industrial_coal +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal - Manufacturing,NAICS_2012_Code,33,,industrial_coal +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,11,,use_table_coal +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,21,,use_table_coal +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,23,,use_table_coal +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas - Manufacturing,NAICS_2012_Code,31,,industrial_gas +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas - Manufacturing,NAICS_2012_Code,32,,industrial_gas +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas - Manufacturing,NAICS_2012_Code,33,,industrial_gas +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,11,,use_table_gas +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,21,,use_table_gas +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,23,,use_table_gas EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,NAICS_2012_Code,11,,use_table_pet EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,NAICS_2012_Code,21,,use_table_pet EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,NAICS_2012_Code,23,,use_table_pet diff --git a/flowsa/data_source_scripts/EPA_StateGHGI.py b/flowsa/data_source_scripts/EPA_StateGHGI.py index 40b81021a..b041f9dbd 100644 --- a/flowsa/data_source_scripts/EPA_StateGHGI.py +++ b/flowsa/data_source_scripts/EPA_StateGHGI.py @@ -184,6 +184,35 @@ def allocate_flows_by_fuel(fba: FlowByActivity, **_) -> FlowByActivity: return new_fba +def allocate_industrial_combustion(fba: FlowByActivity, **_) -> FlowByActivity: + """ + Split industrial combustion emissions into two buckets to be further allocated. + + clean_fba_before_activity_sets. Calculate the percentage of fuel consumption + captured in EIA MECS relative to national GHGI. Create new activities to + distinguish those which use EIA MECS as allocation source and those that + use alternate source. + """ + from flowsa.data_source_scripts.EPA_GHGI import get_manufacturing_energy_ratios + pct_dict = get_manufacturing_energy_ratios(fba.config.get('clean_parameter')) + + # activities reflect flows in A_14 and 3_8 and 3_9 + alist = fba.config.get('clean_parameter')['activities_to_split'] + activities_to_split = {a: a.rsplit(' - ')[-1] for a in alist} + + for activity, fuel in activities_to_split.items(): + df_subset = fba.loc[fba['ActivityProducedBy'] == activity].reset_index(drop=True) + if len(df_subset) == 0: + continue + df_subset['FlowAmount'] = df_subset['FlowAmount'] * pct_dict[fuel] + df_subset['ActivityProducedBy'] = f"{activity} - Manufacturing" + fba.loc[fba['ActivityProducedBy'] == activity, + 'FlowAmount'] = fba['FlowAmount'] * (1-pct_dict[fuel]) + fba = pd.concat([fba, df_subset], ignore_index=True) + + return fba + + if __name__ == '__main__': import flowsa flowsa.flowbyactivity.main(source='EPA_StateGHGI', year='2017') diff --git a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv index 220e87cec..713783f47 100644 --- a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv @@ -67,8 +67,10 @@ direct,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel C direct,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Natural Gas, direct,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum, industrial_ch4_n2o,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial, -industrial_coal,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,EPA_GHGI_T_A_14 -industrial_gas,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,EPA_GHGI_T_A_14 +industrial_coal,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal - Manufacturing,EPA_GHGI_T_A_14 +use_table_coal,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal, +industrial_gas,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas - Manufacturing,EPA_GHGI_T_A_14 +use_table_gas,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas, use_table_pet,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,EPA_GHGI_T_A_14 direct,Residential - Stationary Combustion - Fossil Fuel Combustion, direct,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal, diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml index 37ca930fd..42fd6d5ed 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml @@ -22,7 +22,7 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets ## List these activity sets separately to access the correct use table year - use_table_coal: # commercial coal combustion + use_table_coal: # commercial coal combustion, non-manufacturing industrial !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: @@ -40,7 +40,7 @@ source_names: selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - use_table_gas: # commercial gas combustion + use_table_gas: # commercial gas combustion, non-manufacturing industrial !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: diff --git a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml index 8ee2f4a6d..852ade620 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml @@ -48,6 +48,14 @@ source_names: # year: *ghg_year keep_unmapped_rows: True fedefl_mapping: 'GHGI' + clean_fba_before_activity_sets: !script_function:EPA_StateGHGI allocate_industrial_combustion + clean_parameter: # Override each year for use in allocate_industrial_combustion + energy_fba: EIA_MECS_Energy + year: 2018 + ghg_fba: EPA_GHGI_T_A_7 # 2018 Table + activities_to_split: + - Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal + - Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas activity_sets: direct: selection_fields: @@ -64,7 +72,7 @@ source_names: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct_ods attribution_method: direct - use_table_coal: # commercial coal combustion + use_table_coal: # commercial coal combustion, non-manufacturing industrial selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_coal attribution_method: proportional @@ -84,7 +92,7 @@ source_names: selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - use_table_gas: # commercial gas combustion + use_table_gas: # commercial gas combustion, non-manufacturing industrial # This allocaiton is problematic because 22 includes electricity selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_gas @@ -138,7 +146,7 @@ source_names: selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas - industrial_coal: # CO2 from industrial coal combustion + industrial_coal: # CO2 from industrial coal combustion (manufacturing) selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv industrial_coal attribution_method: proportional @@ -148,7 +156,7 @@ source_names: Class: Energy Flowable: Coal - industrial_gas: # CO2 from industrial gas combustion + industrial_gas: # CO2 from industrial gas combustion (manufacturing) selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv industrial_gas attribution_method: proportional From ad728ce069904490cb430bbd89b91e73d57bce19 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 25 Aug 2023 15:09:42 -0400 Subject: [PATCH 0838/1127] drop HFCS from select sectors --- .../activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv | 2 -- 1 file changed, 2 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index ba36a04c7..8a941a420 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -209,9 +209,7 @@ EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,72,,ods_substitutes EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,81,,ods_substitutes EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,923,,ods_substitutes -EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,11,,ods_substitutes EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,21,,ods_substitutes -EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,2212,,ods_substitutes EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,23,,ods_substitutes EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,31,,ods_substitutes EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,32,,ods_substitutes From b47fb4d5069d648c99069dec0db402c656783298 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 25 Aug 2023 15:55:53 -0400 Subject: [PATCH 0839/1127] fix error when activity set is all zeros --- flowsa/flowby.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index aece3ec79..bb30f2e20 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -853,8 +853,8 @@ def activity_sets(self) -> List['FB']: if not child_df.empty: child_df_list.append(child_df.drop(columns='row')) else: - log.error('Activity set %s is empty. Check activity set ' - 'definition!', child_df.full_name) + log.error(f'Activity set {child_df.full_name} is empty. ' + 'Check activity set definition!') if set(parent_df.row) - assigned_rows: log.warning('Some rows from %s not assigned to an activity ' @@ -2204,11 +2204,12 @@ def activity_sets(self) -> List['FlowByActivity']: # raise ValueError('Some rows in multiple activity sets') assigned_rows.update(child_fba.row) - if not child_fba.empty: + if ((not child_fba.empty) and + len(child_fba.query('FlowAmount != 0')) > 0): child_fba_list.append(child_fba.drop(columns='row')) else: - log.error('Activity set %s is empty. Check activity set ' - 'definition!', child_fba.full_name) + log.error(f'Activity set {child_fba.full_name} is empty or all ' + 'zeroes. Check activity set definition!') if set(parent_fba.row) - assigned_rows: log.warning('Some rows from %s not assigned to an activity ' From 1d38ac28bc447bc7e0779f190e0aefdf64297584 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 25 Aug 2023 14:24:53 -0600 Subject: [PATCH 0840/1127] delete flowbyseries.py, move series classes into flowby, flowbyactivity, flowbysector scripts --- flowsa/flowby.py | 26 ++++++++++++++++++--- flowsa/flowbyactivity.py | 21 ++++++++++++++++- flowsa/flowbysector.py | 21 ++++++++++++++++- flowsa/flowbyseries.py | 49 ---------------------------------------- 4 files changed, 63 insertions(+), 54 deletions(-) delete mode 100644 flowsa/flowbyseries.py diff --git a/flowsa/flowby.py b/flowsa/flowby.py index ac2a62f6c..17288615a 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -148,7 +148,6 @@ def _constructor(self) -> '_FlowBy': @property def _constructor_sliced(self) -> '_FlowBySeries': - from flowsa.flowbyseries import _FlowBySeries return _FlowBySeries def __finalize__(self, other, method=None, **kwargs): @@ -626,6 +625,9 @@ def attribute_flows_to_sectors( attributed to those sectors, by the methods specified in the calling FBA's configuration dictionary. """ + + from flowsa.flowbyactivity import FlowByActivity + validate = True # look for the "attribute" key in the FBS yaml, which will exist if # there are multiple, non-recursive attribution methods applied to a @@ -1304,8 +1306,6 @@ def add_primary_secondary_columns( dataset. ''' - from flowsa.flowbyseries import _FlowBySeries - if (f'{col_type}ProducedBy' not in self or f'{col_type}ConsumedBy' not in self): log.error(f'Cannot add Primary{col_type} or Secondary{col_type} ' @@ -1392,3 +1392,23 @@ def astype(self: FB, *args, **kwargs) -> FB: fb = type(self)(df, add_missing_columns=False, **metadata) return fb + + +""" +The three classes extending pd.Series, together with the _constructor... +methods of each class, are required for allowing pandas methods called on +objects of these classes to return objects of these classes, as desired. + +For more information, see +https://pandas.pydata.org/docs/development/extending.html +""" +class _FlowBySeries(pd.Series): + _metadata = [*_FlowBy()._metadata] + + @property + def _constructor(self) -> '_FlowBySeries': + return _FlowBySeries + + @property + def _constructor_expanddim(self) -> '_FlowBy': + return _FlowBy diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index 64e12e1d4..a3dd440b5 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -61,7 +61,6 @@ def _constructor(self) -> 'FlowByActivity': @property def _constructor_sliced(self) -> '_FBASeries': - from flowsa.flowbyseries import _FBASeries return _FBASeries @classmethod @@ -889,3 +888,23 @@ def convert_activity_to_emissions( .drop(columns=['PrimaryActivity', 'SecondaryActivity']) ) return emissions_fba + + +""" +The three classes extending pd.Series, together with the _constructor... +methods of each class, are required for allowing pandas methods called on +objects of these classes to return objects of these classes, as desired. + +For more information, see +https://pandas.pydata.org/docs/development/extending.html +""" +class _FBASeries(pd.Series): + _metadata = [*FlowByActivity()._metadata] + + @property + def _constructor(self) -> '_FBASeries': + return _FBASeries + + @property + def _constructor_expanddim(self) -> 'FlowByActivity': + return FlowByActivity diff --git a/flowsa/flowbysector.py b/flowsa/flowbysector.py index 0671cd469..91c7e5fc6 100644 --- a/flowsa/flowbysector.py +++ b/flowsa/flowbysector.py @@ -55,7 +55,6 @@ def _constructor(self) -> 'FlowBySector': @property def _constructor_sliced(self) -> '_FBSSeries': - from flowsa.flowbyseries import _FBSSeries return _FBSSeries @classmethod @@ -330,3 +329,23 @@ def convert_industry_spec( f'{self.full_name} to {tables_path} denied.') return table_dict + + +""" +The three classes extending pd.Series, together with the _constructor... +methods of each class, are required for allowing pandas methods called on +objects of these classes to return objects of these classes, as desired. + +For more information, see +https://pandas.pydata.org/docs/development/extending.html +""" +class _FBSSeries(pd.Series): + _metadata = [*FlowBySector()._metadata] + + @property + def _constructor(self) -> '_FBSSeries': + return _FBSSeries + + @property + def _constructor_expanddim(self) -> 'FlowBySector': + return FlowBySector diff --git a/flowsa/flowbyseries.py b/flowsa/flowbyseries.py deleted file mode 100644 index 9c2a87a14..000000000 --- a/flowsa/flowbyseries.py +++ /dev/null @@ -1,49 +0,0 @@ -""" -The three classes extending pd.Series, together with the _constructor... -methods of each class, are required for allowing pandas methods called on -objects of these classes to return objects of these classes, as desired. - -For more information, see -https://pandas.pydata.org/docs/development/extending.html -""" - -import pandas as pd -from flowsa.flowbyactivity import FlowByActivity -from flowsa.flowbysector import FlowBySector -from flowsa.flowby import _FlowBy - - -class _FlowBySeries(pd.Series): - _metadata = [*_FlowBy()._metadata] - - @property - def _constructor(self) -> '_FlowBySeries': - return _FlowBySeries - - @property - def _constructor_expanddim(self) -> '_FlowBy': - return _FlowBy - - -class _FBASeries(pd.Series): - _metadata = [*FlowByActivity()._metadata] - - @property - def _constructor(self) -> '_FBASeries': - return _FBASeries - - @property - def _constructor_expanddim(self) -> 'FlowByActivity': - return FlowByActivity - - -class _FBSSeries(pd.Series): - _metadata = [*FlowBySector()._metadata] - - @property - def _constructor(self) -> '_FBSSeries': - return _FBSSeries - - @property - def _constructor_expanddim(self) -> 'FlowBySector': - return FlowBySector From 7b6a3a8cb28369bd16dd16e0cd447486938cbbdb Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 25 Aug 2023 15:56:21 -0600 Subject: [PATCH 0841/1127] delete flowbyseries.py, move series classes into flowby, flowbyactivity, flowbysector scripts --- flowsa/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/flowsa/__init__.py b/flowsa/__init__.py index 2c3fd11c8..57aa9dae9 100644 --- a/flowsa/__init__.py +++ b/flowsa/__init__.py @@ -15,6 +15,11 @@ The most recent version (based on timestamp) of Flow-By-Activity and Flow-By-Sector files are loaded when running these functions """ +# necessary so 'FlowBySector'/'FlowByActivity' can be used in fxn +# annotations without importing the class to the py script which would lead +# to circular reasoning +from __future__ import annotations + import os import pprint import pandas as pd From c6d1810bf83197b5811d3ddd6024286f35dca262 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sun, 27 Aug 2023 20:16:11 -0400 Subject: [PATCH 0842/1127] drop methane emissions from aviation, (drop aviation as a use table attribution source because the crosswalk still maps to aviation for N2O) --- .../flowbysectormethods/GHG_state_2019.yaml | 15 ++++++++++-- .../flowbysectormethods/GHG_state_common.yaml | 23 +++++++++++++++++-- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml index 42fd6d5ed..fe6052eff 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml @@ -95,8 +95,19 @@ source_names: selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - transport_nonroad: # CH4, N2O from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad + transport_nonroad_CH4: # CH4 from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + exclusion_fields: + ActivityConsumedBy: '481' # Exclude airlines + + transport_nonroad_N2O: # N2O from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O attribution_source: stateio_Use_Summary: !include:GHG_state_common.yaml:_allocation_types:_use_allocation diff --git a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml index 852ade620..362c55821 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml @@ -246,7 +246,7 @@ source_names: FlowName: AG LAND, CROPLAND, HARVESTED # land in active use estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution - transport_petroleum: # C02 from petroleum highway + transport_petroleum: # C02 from petroleum highway; ch4, n2o from alternative fuels # state inventory assumes all petroleum is "highway" # Allocate to all transport types and households by fuel consumption selection_fields: @@ -279,11 +279,30 @@ source_names: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_gasoline attribution_method: direct - transport_nonroad: # CH4, N2O from petroleum non-highway + transport_nonroad_CH4: # CH4 from petroleum non-highway + # National inventory distinguishes by vehicle type (ship, rail, equipment, etc.) + # Exclude air which has no CH4 emissions per national inventory + # 'Based on this data, CH4 emissions factors for jet aircraft were ' + # 'changed to zero to rflect the latest emissions testing data...' + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad + FlowName: CH4 + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + exclusion_fields: + ActivityConsumedBy: ['481', # Exclude airlines + 'F030', 'F040', 'F050'] # Plus other sectors excluded above + + transport_nonroad_N2O: # N2O from petroleum non-highway # National inventory distinguishes by vehicle type (ship, rail, equipment, etc.) # Allocate to ships, rail, air by fuel use selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad + FlowName: N2O attribution_method: proportional attribution_source: stateio_Use_Summary: From 11e1f2df9b1d975fe490b7174969bc971281d4b7 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sun, 27 Aug 2023 20:39:07 -0400 Subject: [PATCH 0843/1127] drop 487, 488, 492 from transportation emissions, add gov't 928 --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index 8a941a420..477ef930e 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -158,9 +158,13 @@ EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Oth EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway,NAICS_2012_Code,491,,transport_petroleum EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway,NAICS_2012_Code,492,,transport_petroleum EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway,NAICS_2012_Code,F010,,transport_petroleum -EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,48,,transport_petroleum +EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,481,,transport_petroleum +EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,482,,transport_petroleum +EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,483,,transport_petroleum +EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,484,,transport_petroleum +EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,485,,transport_petroleum EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,491,,transport_petroleum -EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,492,,transport_petroleum +EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,928,,transport_petroleum EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,F010,,transport_petroleum EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,NAICS_2012_Code,484,,transport_diesel EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,NAICS_2012_Code,F010,,transport_gasoline @@ -176,9 +180,13 @@ EPA_State_GHGI,Industry - Natural Gas Systems - Fugitive,NAICS_2012_Code,2111,,d EPA_State_GHGI,Industry - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - Industrial,NAICS_2012_Code,31,,industrial_neu EPA_State_GHGI,Industry - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - Industrial,NAICS_2012_Code,32,,industrial_neu EPA_State_GHGI,Industry - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - Industrial,NAICS_2012_Code,33,,industrial_neu -EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,48,,transport_petroleum +EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,481,,transport_petroleum +EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,482,,transport_petroleum +EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,483,,transport_petroleum +EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,484,,transport_petroleum +EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,485,,transport_petroleum EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,491,,transport_petroleum -EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,492,,transport_petroleum +EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,928,,transport_petroleum EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,F010,,transport_petroleum EPA_State_GHGI,U.S. Territories - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - US Territories,,,,exclude - territories EPA_State_GHGI,Industry - Petroleum Systems - Fugitive,NAICS_2012_Code,2111,,direct (or 3241?) From 9c1eebe843148812862ca3584902ca095f671f1e Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sun, 27 Aug 2023 21:14:00 -0400 Subject: [PATCH 0844/1127] fix error in assigning semiconductor manufacturing, assign to 3344 --- .../activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index 477ef930e..cbac8a6e6 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -243,8 +243,8 @@ EPA_State_GHGI,Industry - Urea Consumption for Non-Agricultural Purposes - Chemi EPA_State_GHGI,Industry - Urea Consumption for Non-Agricultural Purposes - Chemical Industry - Urea Consumption for Non-Agricultural Uses,NAICS_2012_Code,33,,use_table_chem EPA_State_GHGI,Industry - Electronics Industry - Micro-Electro-Mechanical Devices,NAICS_2012_Code,3332,,direct EPA_State_GHGI,Industry - Electronics Industry - Photovoltaics,NAICS_2012_Code,334413,,direct -EPA_State_GHGI,Industry - Electronics Industry - Semiconductor Manufacture,NAICS_2012_Code,3332,,direct -EPA_State_GHGI,Industry - Electronics Industry - Semiconductor Manufacture - Heat Transfer Fluids,NAICS_2012_Code,3332,,direct +EPA_State_GHGI,Industry - Electronics Industry - Semiconductor Manufacture,NAICS_2012_Code,3344,,direct +EPA_State_GHGI,Industry - Electronics Industry - Semiconductor Manufacture - Heat Transfer Fluids,NAICS_2012_Code,3344,,direct EPA_State_GHGI,Industry - Aluminum Production - Metal Industry,NAICS_2012_Code,3313,,direct EPA_State_GHGI,Industry - Ferroalloy Production - Metal Industry,NAICS_2012_Code,3311,,direct EPA_State_GHGI,Industry - Iron and Steel Production - Metal Industry - Iron Production,NAICS_2012_Code,3311,,direct From 362df8c08943730a9488dfc0117a2dbe6701e22e Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sun, 27 Aug 2023 21:47:54 -0400 Subject: [PATCH 0845/1127] update all other FBS years with recent changes --- .../flowbysectormethods/GHG_state_2012.yaml | 50 +++++++++++++++++-- .../flowbysectormethods/GHG_state_2013.yaml | 50 +++++++++++++++++-- .../flowbysectormethods/GHG_state_2014.yaml | 50 +++++++++++++++++-- .../flowbysectormethods/GHG_state_2015.yaml | 50 +++++++++++++++++-- .../flowbysectormethods/GHG_state_2016.yaml | 50 +++++++++++++++++-- .../flowbysectormethods/GHG_state_2017.yaml | 50 +++++++++++++++++-- .../flowbysectormethods/GHG_state_2018.yaml | 50 +++++++++++++++++-- .../flowbysectormethods/GHG_state_2019.yaml | 3 +- .../flowbysectormethods/GHG_state_2020.yaml | 50 +++++++++++++++++-- .../flowbysectormethods/GHG_state_common.yaml | 2 +- 10 files changed, 363 insertions(+), 42 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml index 68e2a4f5d..68ccde48d 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml @@ -22,7 +22,7 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets ## List these activity sets separately to access the correct use table year - use_table_coal: # commercial coal combustion + use_table_coal: # commercial coal combustion, non-manufacturing industrial !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: @@ -31,7 +31,7 @@ source_names: selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - use_table_pet: # commercial petroleum combustion; mobile ag equipment + use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: @@ -40,7 +40,7 @@ source_names: selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - use_table_gas: # commercial gas combustion + use_table_gas: # commercial gas combustion, non-manufacturing industrial !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: @@ -49,6 +49,34 @@ source_names: selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas + commercial_ch4_n2o: # CH4 and N2O from commercial combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o + activity_sets: + coal: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) + petroleum: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + gas: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'22': ''} # Electricity and natural gas + use_table_chem: # other process use of carbonates !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem attribution_source: @@ -67,8 +95,20 @@ source_names: selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - transport_nonroad: # CH4, N2O from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad + transport_nonroad_CH4: # CH4 from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + exclusion_fields: + ActivityConsumedBy: ['481', # Exclude airlines + 'F030', 'F040', 'F050'] # Plus other sectors excluded above + + transport_nonroad_N2O: # N2O from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O attribution_source: stateio_Use_Summary: !include:GHG_state_common.yaml:_allocation_types:_use_allocation diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml index 08551dc3f..0db580a7d 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml @@ -22,7 +22,7 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets ## List these activity sets separately to access the correct use table year - use_table_coal: # commercial coal combustion + use_table_coal: # commercial coal combustion, non-manufacturing industrial !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: @@ -31,7 +31,7 @@ source_names: selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - use_table_pet: # commercial petroleum combustion; mobile ag equipment + use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: @@ -40,7 +40,7 @@ source_names: selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - use_table_gas: # commercial gas combustion + use_table_gas: # commercial gas combustion, non-manufacturing industrial !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: @@ -49,6 +49,34 @@ source_names: selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas + commercial_ch4_n2o: # CH4 and N2O from commercial combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o + activity_sets: + coal: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) + petroleum: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + gas: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'22': ''} # Electricity and natural gas + use_table_chem: # other process use of carbonates !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem attribution_source: @@ -67,8 +95,20 @@ source_names: selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - transport_nonroad: # CH4, N2O from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad + transport_nonroad_CH4: # CH4 from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + exclusion_fields: + ActivityConsumedBy: ['481', # Exclude airlines + 'F030', 'F040', 'F050'] # Plus other sectors excluded above + + transport_nonroad_N2O: # N2O from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O attribution_source: stateio_Use_Summary: !include:GHG_state_common.yaml:_allocation_types:_use_allocation diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml index d349410cc..cc7b8e8dd 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml @@ -22,7 +22,7 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets ## List these activity sets separately to access the correct use table year - use_table_coal: # commercial coal combustion + use_table_coal: # commercial coal combustion, non-manufacturing industrial !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: @@ -31,7 +31,7 @@ source_names: selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - use_table_pet: # commercial petroleum combustion; mobile ag equipment + use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: @@ -40,7 +40,7 @@ source_names: selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - use_table_gas: # commercial gas combustion + use_table_gas: # commercial gas combustion, non-manufacturing industrial !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: @@ -49,6 +49,34 @@ source_names: selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas + commercial_ch4_n2o: # CH4 and N2O from commercial combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o + activity_sets: + coal: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) + petroleum: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + gas: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'22': ''} # Electricity and natural gas + use_table_chem: # other process use of carbonates !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem attribution_source: @@ -67,8 +95,20 @@ source_names: selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - transport_nonroad: # CH4, N2O from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad + transport_nonroad_CH4: # CH4 from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + exclusion_fields: + ActivityConsumedBy: ['481', # Exclude airlines + 'F030', 'F040', 'F050'] # Plus other sectors excluded above + + transport_nonroad_N2O: # N2O from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O attribution_source: stateio_Use_Summary: !include:GHG_state_common.yaml:_allocation_types:_use_allocation diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml index 81cda7e94..120f5ece2 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml @@ -22,7 +22,7 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets ## List these activity sets separately to access the correct use table year - use_table_coal: # commercial coal combustion + use_table_coal: # commercial coal combustion, non-manufacturing industrial !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: @@ -31,7 +31,7 @@ source_names: selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - use_table_pet: # commercial petroleum combustion; mobile ag equipment + use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: @@ -40,7 +40,7 @@ source_names: selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - use_table_gas: # commercial gas combustion + use_table_gas: # commercial gas combustion, non-manufacturing industrial !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: @@ -49,6 +49,34 @@ source_names: selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas + commercial_ch4_n2o: # CH4 and N2O from commercial combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o + activity_sets: + coal: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) + petroleum: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + gas: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'22': ''} # Electricity and natural gas + use_table_chem: # other process use of carbonates !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem attribution_source: @@ -67,8 +95,20 @@ source_names: selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - transport_nonroad: # CH4, N2O from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad + transport_nonroad_CH4: # CH4 from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + exclusion_fields: + ActivityConsumedBy: ['481', # Exclude airlines + 'F030', 'F040', 'F050'] # Plus other sectors excluded above + + transport_nonroad_N2O: # N2O from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O attribution_source: stateio_Use_Summary: !include:GHG_state_common.yaml:_allocation_types:_use_allocation diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2016.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2016.yaml index f863955d1..2015a528a 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2016.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2016.yaml @@ -22,7 +22,7 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets ## List these activity sets separately to access the correct use table year - use_table_coal: # commercial coal combustion + use_table_coal: # commercial coal combustion, non-manufacturing industrial !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: @@ -31,7 +31,7 @@ source_names: selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - use_table_pet: # commercial petroleum combustion; mobile ag equipment + use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: @@ -40,7 +40,7 @@ source_names: selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - use_table_gas: # commercial gas combustion + use_table_gas: # commercial gas combustion, non-manufacturing industrial !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: @@ -49,6 +49,34 @@ source_names: selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas + commercial_ch4_n2o: # CH4 and N2O from commercial combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o + activity_sets: + coal: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) + petroleum: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + gas: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'22': ''} # Electricity and natural gas + use_table_chem: # other process use of carbonates !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem attribution_source: @@ -67,8 +95,20 @@ source_names: selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - transport_nonroad: # CH4, N2O from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad + transport_nonroad_CH4: # CH4 from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + exclusion_fields: + ActivityConsumedBy: ['481', # Exclude airlines + 'F030', 'F040', 'F050'] # Plus other sectors excluded above + + transport_nonroad_N2O: # N2O from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O attribution_source: stateio_Use_Summary: !include:GHG_state_common.yaml:_allocation_types:_use_allocation diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2017.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2017.yaml index 2476d08d9..bbb6b6581 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2017.yaml @@ -22,7 +22,7 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets ## List these activity sets separately to access the correct use table year - use_table_coal: # commercial coal combustion + use_table_coal: # commercial coal combustion, non-manufacturing industrial !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: @@ -31,7 +31,7 @@ source_names: selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - use_table_pet: # commercial petroleum combustion; mobile ag equipment + use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: @@ -40,7 +40,7 @@ source_names: selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - use_table_gas: # commercial gas combustion + use_table_gas: # commercial gas combustion, non-manufacturing industrial !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: @@ -49,6 +49,34 @@ source_names: selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas + commercial_ch4_n2o: # CH4 and N2O from commercial combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o + activity_sets: + coal: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) + petroleum: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + gas: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'22': ''} # Electricity and natural gas + use_table_chem: # other process use of carbonates !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem attribution_source: @@ -67,8 +95,20 @@ source_names: selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - transport_nonroad: # CH4, N2O from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad + transport_nonroad_CH4: # CH4 from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + exclusion_fields: + ActivityConsumedBy: ['481', # Exclude airlines + 'F030', 'F040', 'F050'] # Plus other sectors excluded above + + transport_nonroad_N2O: # N2O from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O attribution_source: stateio_Use_Summary: !include:GHG_state_common.yaml:_allocation_types:_use_allocation diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2018.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2018.yaml index 16c577a59..37d71269d 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2018.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2018.yaml @@ -22,7 +22,7 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets ## List these activity sets separately to access the correct use table year - use_table_coal: # commercial coal combustion + use_table_coal: # commercial coal combustion, non-manufacturing industrial !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: @@ -31,7 +31,7 @@ source_names: selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - use_table_pet: # commercial petroleum combustion; mobile ag equipment + use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: @@ -40,7 +40,7 @@ source_names: selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - use_table_gas: # commercial gas combustion + use_table_gas: # commercial gas combustion, non-manufacturing industrial !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: @@ -49,6 +49,34 @@ source_names: selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas + commercial_ch4_n2o: # CH4 and N2O from commercial combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o + activity_sets: + coal: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) + petroleum: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + gas: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'22': ''} # Electricity and natural gas + use_table_chem: # other process use of carbonates !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem attribution_source: @@ -67,8 +95,20 @@ source_names: selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - transport_nonroad: # CH4, N2O from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad + transport_nonroad_CH4: # CH4 from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + exclusion_fields: + ActivityConsumedBy: ['481', # Exclude airlines + 'F030', 'F040', 'F050'] # Plus other sectors excluded above + + transport_nonroad_N2O: # N2O from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O attribution_source: stateio_Use_Summary: !include:GHG_state_common.yaml:_allocation_types:_use_allocation diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml index fe6052eff..4be855b9e 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml @@ -104,7 +104,8 @@ source_names: selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel exclusion_fields: - ActivityConsumedBy: '481' # Exclude airlines + ActivityConsumedBy: ['481', # Exclude airlines + 'F030', 'F040', 'F050'] # Plus other sectors excluded above transport_nonroad_N2O: # N2O from petroleum non-highway !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2020.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2020.yaml index ad31eff69..586d05f1f 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2020.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2020.yaml @@ -22,7 +22,7 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets ## List these activity sets separately to access the correct use table year - use_table_coal: # commercial coal combustion + use_table_coal: # commercial coal combustion, non-manufacturing industrial !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: @@ -31,7 +31,7 @@ source_names: selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - use_table_pet: # commercial petroleum combustion; mobile ag equipment + use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: @@ -40,7 +40,7 @@ source_names: selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - use_table_gas: # commercial gas combustion + use_table_gas: # commercial gas combustion, non-manufacturing industrial !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: @@ -49,6 +49,34 @@ source_names: selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas + commercial_ch4_n2o: # CH4 and N2O from commercial combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o + activity_sets: + coal: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) + petroleum: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + gas: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'22': ''} # Electricity and natural gas + use_table_chem: # other process use of carbonates !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem attribution_source: @@ -67,8 +95,20 @@ source_names: selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - transport_nonroad: # CH4, N2O from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad + transport_nonroad_CH4: # CH4 from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 + attribution_source: + stateio_Use_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'324': ''} # Petroleum fuel + exclusion_fields: + ActivityConsumedBy: ['481', # Exclude airlines + 'F030', 'F040', 'F050'] # Plus other sectors excluded above + + transport_nonroad_N2O: # N2O from petroleum non-highway + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O attribution_source: stateio_Use_Summary: !include:GHG_state_common.yaml:_allocation_types:_use_allocation diff --git a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml index 362c55821..9f52662fc 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml @@ -295,7 +295,7 @@ source_names: ActivityProducedBy: {'324': ''} # Petroleum fuel exclusion_fields: ActivityConsumedBy: ['481', # Exclude airlines - 'F030', 'F040', 'F050'] # Plus other sectors excluded above + 'F030', 'F040', 'F050'] # Plus other sectors excluded above transport_nonroad_N2O: # N2O from petroleum non-highway # National inventory distinguishes by vehicle type (ship, rail, equipment, etc.) From 62a499b20a63bc404fed955f40870c0048dd669f Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 28 Aug 2023 11:11:24 -0400 Subject: [PATCH 0846/1127] align oil and gas emissions with state splits from national model --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 8 ++- .../EPA_StateGHGI_asets.csv | 4 +- .../flowbysectormethods/GHG_state_common.yaml | 54 +++++++++++++++++++ 3 files changed, 62 insertions(+), 4 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index cbac8a6e6..eb8e96d50 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -176,7 +176,9 @@ EPA_State_GHGI,U.S. Territories - CO2 from Fossil Fuel Combustion - Fossil Fuel EPA_State_GHGI,U.S. Territories - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - US Territories - Natural Gas,,,,exclude - territories EPA_State_GHGI,U.S. Territories - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - US Territories - Petroleum,,,,exclude - territories EPA_State_GHGI,Electric Power Industry - Incineration of Waste - Incineration,NAICS_2012_Code,562213,,direct -EPA_State_GHGI,Industry - Natural Gas Systems - Fugitive,NAICS_2012_Code,2111,,direct +EPA_State_GHGI,Industry - Natural Gas Systems - Fugitive,NAICS_2012_Code,2111,,ng_systems +EPA_State_GHGI,Industry - Natural Gas Systems - Fugitive,NAICS_2012_Code,2212,,ng_systems +EPA_State_GHGI,Industry - Natural Gas Systems - Fugitive,NAICS_2012_Code,486,,ng_systems EPA_State_GHGI,Industry - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - Industrial,NAICS_2012_Code,31,,industrial_neu EPA_State_GHGI,Industry - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - Industrial,NAICS_2012_Code,32,,industrial_neu EPA_State_GHGI,Industry - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - Industrial,NAICS_2012_Code,33,,industrial_neu @@ -189,7 +191,9 @@ EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fos EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,928,,transport_petroleum EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,F010,,transport_petroleum EPA_State_GHGI,U.S. Territories - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - US Territories,,,,exclude - territories -EPA_State_GHGI,Industry - Petroleum Systems - Fugitive,NAICS_2012_Code,2111,,direct (or 3241?) +EPA_State_GHGI,Industry - Petroleum Systems - Fugitive,NAICS_2012_Code,2111,,pet_systems +EPA_State_GHGI,Industry - Petroleum Systems - Fugitive,NAICS_2012_Code,3241,,pet_systems +EPA_State_GHGI,Industry - Petroleum Systems - Fugitive,NAICS_2012_Code,486,,pet_systems EPA_State_GHGI,Agriculture - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,NAICS_2012_Code,111,,use_table_pet EPA_State_GHGI,Agriculture - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,NAICS_2012_Code,112,,use_table_pet EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,481,,transport_nonroad diff --git a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv index 713783f47..6020cba45 100644 --- a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv @@ -88,11 +88,11 @@ exclude,U.S. Territories - CO2 from Fossil Fuel Combustion - Fossil Fuel Combust exclude,U.S. Territories - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - US Territories - Natural Gas, exclude,U.S. Territories - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - US Territories - Petroleum, direct,Electric Power Industry - Incineration of Waste - Incineration,EPA_GHGI_T_2_1 -direct,Industry - Natural Gas Systems - Fugitive,EPA_GHGI_T_3_63 +ng_systems,Industry - Natural Gas Systems - Fugitive,EPA_GHGI_T_3_63 industrial_neu,Industry - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - Industrial,EPA_GHGI_T_A_14 transport_petroleum,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels, exclude,U.S. Territories - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - US Territories, -direct,Industry - Petroleum Systems - Fugitive,EPA_GHGI_T_3_38 +pet_systems,Industry - Petroleum Systems - Fugitive,EPA_GHGI_T_3_38 use_table_pet,Agriculture - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary, transport_nonroad,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,negative emissions; align with 'Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Non-Highway' to avoid double counting transport_nonroad,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,negative emissions; align with 'Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Non-Highway' to avoid double counting diff --git a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml index 9f52662fc..d23e8747e 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml @@ -72,6 +72,60 @@ source_names: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct_ods attribution_method: direct + ng_systems_CH4: + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ng_systems + FlowName: CH4 + attribution_method: proportional + attribution_source: + EPA_GHGI_T_3_68: + geoscale: national + + ng_systems_CO2: + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ng_systems + FlowName: CO2 + attribution_method: proportional + attribution_source: + EPA_GHGI_T_3_70: + geoscale: national + + ng_systems_N2O: + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ng_systems + FlowName: N2O + attribution_method: proportional + attribution_source: + EPA_GHGI_T_3_72: + geoscale: national + + pet_systems_CH4: + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv pet_systems + FlowName: CH4 + attribution_method: proportional + attribution_source: + EPA_GHGI_T_3_42: + geoscale: national + + pet_systems_CO2: + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv pet_systems + FlowName: CO2 + attribution_method: proportional + attribution_source: + EPA_GHGI_T_3_44: + geoscale: national + + pet_systems_N2O: + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv pet_systems + FlowName: N2O + attribution_method: proportional + attribution_source: + EPA_GHGI_T_3_46: + geoscale: national + use_table_coal: # commercial coal combustion, non-manufacturing industrial selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_coal From 1fae1f6e809050873ed59065883e2c50c39d967c Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 28 Aug 2023 11:39:59 -0400 Subject: [PATCH 0847/1127] use 2014 MECS for fuel split for 2012-2015 --- flowsa/methods/flowbysectormethods/GHG_state_2012.yaml | 4 ++++ flowsa/methods/flowbysectormethods/GHG_state_2013.yaml | 4 ++++ flowsa/methods/flowbysectormethods/GHG_state_2014.yaml | 4 ++++ flowsa/methods/flowbysectormethods/GHG_state_2015.yaml | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml index 68ccde48d..04ae7c117 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml @@ -18,6 +18,10 @@ source_names: EPA_StateGHGI: # U.S. GHG emissions by state !include:GHG_state_common.yaml:source_names:EPA_StateGHGI year: *ghg_year + clean_parameter: # Override each year for use in allocate_industrial_combustion + energy_fba: EIA_MECS_Energy + year: 2014 + ghg_fba: EPA_GHGI_T_A_11 # 2014 Table activity_sets: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml index 0db580a7d..5ace9da68 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml @@ -18,6 +18,10 @@ source_names: EPA_StateGHGI: # U.S. GHG emissions by state !include:GHG_state_common.yaml:source_names:EPA_StateGHGI year: *ghg_year + clean_parameter: # Override each year for use in allocate_industrial_combustion + energy_fba: EIA_MECS_Energy + year: 2014 + ghg_fba: EPA_GHGI_T_A_11 # 2014 Table activity_sets: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml index cc7b8e8dd..e9d1ca1ad 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml @@ -18,6 +18,10 @@ source_names: EPA_StateGHGI: # U.S. GHG emissions by state !include:GHG_state_common.yaml:source_names:EPA_StateGHGI year: *ghg_year + clean_parameter: # Override each year for use in allocate_industrial_combustion + energy_fba: EIA_MECS_Energy + year: 2014 + ghg_fba: EPA_GHGI_T_A_11 # 2014 Table activity_sets: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml index 120f5ece2..30fcd32b9 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml @@ -18,6 +18,10 @@ source_names: EPA_StateGHGI: # U.S. GHG emissions by state !include:GHG_state_common.yaml:source_names:EPA_StateGHGI year: *ghg_year + clean_parameter: # Override each year for use in allocate_industrial_combustion + energy_fba: EIA_MECS_Energy + year: 2014 + ghg_fba: EPA_GHGI_T_A_11 # 2014 Table activity_sets: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets From d93c81820bcd73670d6b2d0bd28d6d9f588a03f6 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 28 Aug 2023 12:13:36 -0400 Subject: [PATCH 0848/1127] fix method linking error --- flowsa/methods/flowbysectormethods/GHG_state_2012.yaml | 2 +- flowsa/methods/flowbysectormethods/GHG_state_2013.yaml | 2 +- flowsa/methods/flowbysectormethods/GHG_state_2014.yaml | 2 +- flowsa/methods/flowbysectormethods/GHG_state_2015.yaml | 2 +- flowsa/methods/flowbysectormethods/GHG_state_common.yaml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml index 04ae7c117..73194b076 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml @@ -19,7 +19,7 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI year: *ghg_year clean_parameter: # Override each year for use in allocate_industrial_combustion - energy_fba: EIA_MECS_Energy + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:clean_parameter year: 2014 ghg_fba: EPA_GHGI_T_A_11 # 2014 Table activity_sets: diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml index 5ace9da68..a0b89dcc8 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml @@ -19,7 +19,7 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI year: *ghg_year clean_parameter: # Override each year for use in allocate_industrial_combustion - energy_fba: EIA_MECS_Energy + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:clean_parameter year: 2014 ghg_fba: EPA_GHGI_T_A_11 # 2014 Table activity_sets: diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml index e9d1ca1ad..5be257513 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml @@ -19,7 +19,7 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI year: *ghg_year clean_parameter: # Override each year for use in allocate_industrial_combustion - energy_fba: EIA_MECS_Energy + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:clean_parameter year: 2014 ghg_fba: EPA_GHGI_T_A_11 # 2014 Table activity_sets: diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml index 30fcd32b9..c17e87168 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml @@ -19,7 +19,7 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI year: *ghg_year clean_parameter: # Override each year for use in allocate_industrial_combustion - energy_fba: EIA_MECS_Energy + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:clean_parameter year: 2014 ghg_fba: EPA_GHGI_T_A_11 # 2014 Table activity_sets: diff --git a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml index d23e8747e..92d2f6526 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml @@ -337,7 +337,7 @@ source_names: # National inventory distinguishes by vehicle type (ship, rail, equipment, etc.) # Exclude air which has no CH4 emissions per national inventory # 'Based on this data, CH4 emissions factors for jet aircraft were ' - # 'changed to zero to rflect the latest emissions testing data...' + # 'changed to zero to reflect the latest emissions testing data...' selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad FlowName: CH4 From 2b9fb3dda12fa73b86ace5ad9f54f5a0036c7689 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 28 Aug 2023 12:57:10 -0600 Subject: [PATCH 0849/1127] line length --- flowsa/flowbysector.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flowsa/flowbysector.py b/flowsa/flowbysector.py index 91c7e5fc6..f05ebf3d7 100644 --- a/flowsa/flowbysector.py +++ b/flowsa/flowbysector.py @@ -146,7 +146,8 @@ def generateFlowBySector( }, external_config_path=external_config_path, download_sources_ok=download_sources_ok - ).prepare_fbs(external_config_path=external_config_path, download_sources_ok=download_sources_ok) + ).prepare_fbs(external_config_path=external_config_path, + download_sources_ok=download_sources_ok) ) # ^^^ This is done with a for loop instead of a dict comprehension # so that later entries in method_config['sources_to_cache'] From f195a414bdb0951ceeba4ce9fcaa7fdac3ab48b2 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 28 Aug 2023 12:57:29 -0600 Subject: [PATCH 0850/1127] clean up import statements --- flowsa/flowbyclean.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index 0e21d4495..38d162f93 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -3,8 +3,7 @@ from flowsa.flowby import FB, get_flowby_from_config from flowsa.common import get_catalog_info from flowsa.flowsa_log import log -from flowsa import (geo, location, getFlowBySector, flowbyfunctions, - FlowByActivity) +from flowsa import (geo, location, FlowByActivity) from flowsa.naics import map_source_sectors_to_more_aggregated_sectors from flowsa.validation import compare_summation_at_sector_lengths_between_two_dfs @@ -399,7 +398,6 @@ def attribute_national_to_states(fba: FlowByActivity, **_) -> FlowByActivity: return fba - def calculate_flow_per_person( fbs: 'FlowBySector', download_sources_ok: bool = True, From a98daaf056c00ba4aca3aa6a6ba9387bfc9f29c6 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 28 Aug 2023 12:58:08 -0600 Subject: [PATCH 0851/1127] drop estimate_suppressed fxn - not relevant for mecs land --- flowsa/methods/flowbysectormethods/Land_state_2012.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Land_state_2012.yaml b/flowsa/methods/flowbysectormethods/Land_state_2012.yaml index a1bcfddb6..d2cdd4bb9 100644 --- a/flowsa/methods/flowbysectormethods/Land_state_2012.yaml +++ b/flowsa/methods/flowbysectormethods/Land_state_2012.yaml @@ -32,8 +32,7 @@ sources_to_cache: selection_fields: Class: Land FlowName: "Approximate Enclosed Floorspace of All Buildings Onsite" - Year: {2014: 2012} # replace year to align with method year - estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy + Year: {2014: 2012} # replace year to align with method year= clean_fba: !script_function:EIA_MECS mecs_land_fba_cleanup clean_fba_w_sec: !clean_function:flowbyclean attribute_national_to_states clean_source: From c542e71b8c0e83ba752227145d6ada60a4922fbc Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 28 Aug 2023 13:03:34 -0600 Subject: [PATCH 0852/1127] skip NEI data in testing FBA because Certificate verify failed --- flowsa/methods/method_status.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/flowsa/methods/method_status.yaml b/flowsa/methods/method_status.yaml index 110a753b3..c3782a018 100644 --- a/flowsa/methods/method_status.yaml +++ b/flowsa/methods/method_status.yaml @@ -17,4 +17,19 @@ BTS_Airlines: Status: Private data Type: FileNotFoundError +EPA_NEI_Nonroad: + Active: True + Status: Max retries exceeded with url - Certificate verify failed + Type: HTTPSConnectionPool + +EPA_NEI_Onroad: + Active: True + Status: Max retries exceeded with url - Certificate verify failed + Type: HTTPSConnectionPool + +EPA_NEI_Nonpoint: + Active: True + Status: Max retries exceeded with url - Certificate verify failed + Type: HTTPSConnectionPool + From f18469e6a42dc9a498242169ecd0d30a3b952014 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 28 Aug 2023 15:59:30 -0400 Subject: [PATCH 0853/1127] update NEI error --- flowsa/methods/method_status.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flowsa/methods/method_status.yaml b/flowsa/methods/method_status.yaml index c3782a018..05604e13a 100644 --- a/flowsa/methods/method_status.yaml +++ b/flowsa/methods/method_status.yaml @@ -20,16 +20,16 @@ BTS_Airlines: EPA_NEI_Nonroad: Active: True Status: Max retries exceeded with url - Certificate verify failed - Type: HTTPSConnectionPool + Type: SSLError EPA_NEI_Onroad: Active: True Status: Max retries exceeded with url - Certificate verify failed - Type: HTTPSConnectionPool + Type: SSLError EPA_NEI_Nonpoint: Active: True Status: Max retries exceeded with url - Certificate verify failed - Type: HTTPSConnectionPool + Type: SSLError From 7bca219072aed5f9cd8a69308471427fe19d97a1 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 28 Aug 2023 15:10:08 -0600 Subject: [PATCH 0854/1127] move where future annotations are imported --- flowsa/__init__.py | 11 +++-------- flowsa/flowbyactivity.py | 4 ++++ flowsa/flowbyclean.py | 5 +++++ flowsa/flowbysector.py | 4 ++++ 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/flowsa/__init__.py b/flowsa/__init__.py index 57aa9dae9..ea58d30a6 100644 --- a/flowsa/__init__.py +++ b/flowsa/__init__.py @@ -15,10 +15,6 @@ The most recent version (based on timestamp) of Flow-By-Activity and Flow-By-Sector files are loaded when running these functions """ -# necessary so 'FlowBySector'/'FlowByActivity' can be used in fxn -# annotations without importing the class to the py script which would lead -# to circular reasoning -from __future__ import annotations import os import pprint @@ -30,11 +26,10 @@ from flowsa.flowbyfunctions import collapse_fbs_sectors, filter_by_geoscale from flowsa.validation import check_for_nonetypes_in_sector_col, \ check_for_negative_flowamounts -import flowsa.flowbyactivity from flowsa.bibliography import generate_fbs_bibliography from flowsa.datavisualization import FBSscatterplot -from .flowbyactivity import FlowByActivity -from .flowbysector import FlowBySector +from flowsa.flowbyactivity import FlowByActivity +from flowsa.flowbysector import FlowBySector def getFlowByActivity( @@ -71,7 +66,7 @@ def getFlowByActivity( # if geographic level specified, only load rows in geo level if geographic_level is not None: fba = filter_by_geoscale(fba, geographic_level) - return pd.DataFrame(fba) + return pd.DataFrame(fba.reset_index(drop=True)) def getFlowBySector( diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index a3dd440b5..aa8f9845e 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -7,6 +7,10 @@ gerneateflowbyactivity.py """ +# necessary so 'FlowBySector'/'FlowByActivity' can be used in fxn +# annotations without importing the class to the py script which would lead +# to circular reasoning +from __future__ import annotations from functools import partial, reduce from typing import Literal, List diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index 38d162f93..702b456cb 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -1,3 +1,8 @@ +# necessary so 'FlowBySector'/'FlowByActivity' can be used in fxn +# annotations without importing the class to the py script which would lead +# to circular reasoning +from __future__ import annotations + import numpy as np import pandas as pd from flowsa.flowby import FB, get_flowby_from_config diff --git a/flowsa/flowbysector.py b/flowsa/flowbysector.py index f05ebf3d7..9c0c9cc48 100644 --- a/flowsa/flowbysector.py +++ b/flowsa/flowbysector.py @@ -3,6 +3,10 @@ file and other attributes to be attached to the FBS object. The functions defined in this file are specific to FBS data. """ +# necessary so 'FlowBySector'/'FlowByActivity' can be used in fxn +# annotations without importing the class to the py script which would lead +# to circular reasoning +from __future__ import annotations import esupy.processed_data_mgmt import pandas as pd From fdb5ff35f84447498a2b4e9a85e3332fa709ea51 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 29 Aug 2023 09:36:40 -0400 Subject: [PATCH 0855/1127] protect imports during type checking --- flowsa/flowby.py | 6 +++++- flowsa/flowbyactivity.py | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 17288615a..010912c81 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -3,7 +3,7 @@ FlowByActivity and FlowBySector classes. """ -from typing import List, Literal, TypeVar +from typing import List, Literal, TypeVar, TYPE_CHECKING import pandas as pd import numpy as np from functools import partial, reduce @@ -14,6 +14,10 @@ import esupy.processed_data_mgmt import esupy.dqi +if TYPE_CHECKING: + from flowsa.flowbysector import FlowBySector + from flowsa.flowbyactivity import FlowByActivity + FB = TypeVar('FB', bound='_FlowBy') S = TypeVar('S', bound='_FlowBySeries') NAME_SEP_CHAR = '.' diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index aa8f9845e..e1bbd9b23 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -11,6 +11,7 @@ # annotations without importing the class to the py script which would lead # to circular reasoning from __future__ import annotations +from typing import TYPE_CHECKING from functools import partial, reduce from typing import Literal, List @@ -20,6 +21,8 @@ sectormapping, generateflowbyactivity from flowsa.flowby import _FlowBy, flowby_config, NAME_SEP_CHAR +if TYPE_CHECKING: + from flowsa import FlowBySector class FlowByActivity(_FlowBy): _metadata = [*_FlowBy()._metadata] From a1f4f4101a7cc575ad49a3e2fcdd19be0864cb7f Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 29 Aug 2023 09:43:43 -0400 Subject: [PATCH 0856/1127] add missing import statements --- flowsa/__init__.py | 1 + flowsa/flowbyclean.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/flowsa/__init__.py b/flowsa/__init__.py index ea58d30a6..d90a2d643 100644 --- a/flowsa/__init__.py +++ b/flowsa/__init__.py @@ -19,6 +19,7 @@ import os import pprint import pandas as pd +import flowsa.exceptions from flowsa.common import load_yaml_dict from flowsa.flowsa_log import log from flowsa.settings import sourceconfigpath, flowbysectormethodpath, \ diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index 702b456cb..ae8a6438f 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -8,7 +8,7 @@ from flowsa.flowby import FB, get_flowby_from_config from flowsa.common import get_catalog_info from flowsa.flowsa_log import log -from flowsa import (geo, location, FlowByActivity) +from flowsa import (geo, location, FlowByActivity, FlowBySector) from flowsa.naics import map_source_sectors_to_more_aggregated_sectors from flowsa.validation import compare_summation_at_sector_lengths_between_two_dfs From 93135190411d3e86f57d732172adb40d34d43f9d Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 29 Aug 2023 09:49:56 -0400 Subject: [PATCH 0857/1127] fix import statements --- flowsa/test_methods.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/test_methods.py b/flowsa/test_methods.py index 651eb5856..4eb9ffba6 100644 --- a/flowsa/test_methods.py +++ b/flowsa/test_methods.py @@ -4,9 +4,9 @@ import pytest from flowsa import seeAvailableFlowByModels import flowsa.exceptions -from flowsa.flowbyactivity import load_yaml_dict, assemble_urls_for_query,\ +from flowsa.generateflowbyactivity import assemble_urls_for_query,\ call_urls -from flowsa.common import check_method_status +from flowsa.common import check_method_status, load_yaml_dict @pytest.mark.skip(reason="Perform targeted test for test_FBA_urls on PR") From ef0583b23714b3af394bdabbf79914ca155e68e6 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 29 Aug 2023 09:56:10 -0400 Subject: [PATCH 0858/1127] more import statements --- flowsa/test_examples.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/flowsa/test_examples.py b/flowsa/test_examples.py index c4097830f..3d30c86be 100644 --- a/flowsa/test_examples.py +++ b/flowsa/test_examples.py @@ -3,8 +3,7 @@ """ import flowsa from flowsa import seeAvailableFlowByModels -from flowsa.common import check_method_status -from flowsa.flowbyactivity import load_yaml_dict +from flowsa.common import check_method_status, load_yaml_dict def test_get_flows_by_activity(): From cab4ce0c952afb751bdcced60374500f8a5d3ab5 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 29 Aug 2023 12:07:15 -0400 Subject: [PATCH 0859/1127] :white_check_mark: run one version of each FBS during testing --- .github/workflows/generate_FBS.yml | 3 ++- flowsa/test_FBS_against_remote.py | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/generate_FBS.yml b/.github/workflows/generate_FBS.yml index 4c0e48b52..ffc19b486 100644 --- a/.github/workflows/generate_FBS.yml +++ b/.github/workflows/generate_FBS.yml @@ -1,4 +1,5 @@ -# This workflow will generate all FlowBySector files and store as artifact +# This workflow will generate the latest version of a FlowBySector file and +# store as artifact name: Generate FBS diff --git a/flowsa/test_FBS_against_remote.py b/flowsa/test_FBS_against_remote.py index 338e7b203..00d891c39 100644 --- a/flowsa/test_FBS_against_remote.py +++ b/flowsa/test_FBS_against_remote.py @@ -5,6 +5,8 @@ import pytest import os +import pandas as pd +import numpy as np from flowsa import seeAvailableFlowByModels from flowsa.common import check_method_status from flowsa.flowby import FlowBySector @@ -14,8 +16,17 @@ @pytest.mark.generate_fbs def test_generate_fbs(): - """Generate all FBS from methods in repo.""" - for m in seeAvailableFlowByModels("FBS", print_method=False): + """Generate latest year for all FBS from methods in repo.""" + models = pd.DataFrame(seeAvailableFlowByModels("FBS", print_method=False)) + models['year'] = models[0].str.extract('.*(\d{4})', expand = False) + models['model'] = models.apply(lambda x: x[0].split(x['year']), + axis=1).str[0] + m_last_two = models[0].str.slice(start=-2) + models['model'] = np.where(m_last_two.str.startswith('m'), + models['model'] + m_last_two, + models['model']) + model_list = models.drop_duplicates(subset='model', keep='last')[0] + for m in model_list: print("--------------------------------\n" f"Method: {m}\n" "--------------------------------") From 4fff9ca8bb38efa7ebd327afbed873f5ad4a9623 Mon Sep 17 00:00:00 2001 From: ysrivas08 Date: Tue, 29 Aug 2023 14:24:03 -0500 Subject: [PATCH 0860/1127] New FBS method files for the years 2012 to 2015 --- .../GHG_national_2012_m1.yaml | 165 ++++++++++++++++++ .../GHG_national_2013_m1.yaml | 165 ++++++++++++++++++ .../GHG_national_2014_m1.yaml | 165 ++++++++++++++++++ .../GHG_national_2015_m1.yaml | 165 ++++++++++++++++++ 4 files changed, 660 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml new file mode 100644 index 000000000..a3348bc11 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml @@ -0,0 +1,165 @@ +# This is a 2012 target year specific implementation of GHG_national_m1 +# All parameters add year specific data when needed to implement for 2012 +# GHGI FBA table names match the 2022 GHGI Report +# MECS year is 2014 +# CoA year is 2017 + +!include:GHG_national_m1_common.yaml +ghgi_year: &ghgi_year 2012 +mecs_year: &mecs_year 2014 + +_industrial_allocation_dict: &industrial_dict + energy_fba: 'EIA_MECS_Energy' + year: *mecs_year + ghg_fba: 'EPA_GHGI_T_A_11' # 2014 Table + +source_names: + "EPA_GHGI_T_2_1": #U.S. GHG emissions + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 + year: *ghgi_year + activity_sets: # Update USGS year for these activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + lead: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead + attribution_source: + USGS_MYB_Lead: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead + year: *ghgi_year + "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 + year: *ghgi_year + "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 + year: *ghgi_year + "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 + year: *ghgi_year + "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 + year: *ghgi_year + "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 + year: *ghgi_year + "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 + year: *ghgi_year + "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 + year: *ghgi_year + "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 + year: *ghgi_year + "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 + year: *ghgi_year + "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 + year: *ghgi_year + "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 + year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year + "EPA_GHGI_T_3_14": #CH4 from mobile combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 + year: *ghgi_year + "EPA_GHGI_T_3_15": #N2O from mobile combustion duplicates method for CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_15 + year: *ghgi_year + "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 + year: *ghgi_year + "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 + year: *ghgi_year + "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 + year: *ghgi_year + "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 + year: *ghgi_year + "EPA_GHGI_T_A_97": # HFCs from Transportation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 + year: *ghgi_year + "EPA_GHGI_T_4_80": # PFCs from aluminum production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 + year: *ghgi_year + "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_86 + year: *ghgi_year + "EPA_GHGI_T_3_22b": #Fossil fuel for non-energy uses + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + year: *ghgi_year + activity_sets: # Update EIA_MECS year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets + petroleum: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas:attribution_source:EIA_MECS_Energy + year: *mecs_year + +### Major CO2 Sources + "EPA_GHGI_T_A_13": # CO2 emissions from stationary combustion. This table number changes with year + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: # Update EIA_MECS year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets + coal_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + coal_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + ng_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9 + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets + coal_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + ng_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml new file mode 100644 index 000000000..cdebe1b13 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml @@ -0,0 +1,165 @@ +# This is a 2013 target year specific implementation of GHG_national_m1 +# All parameters add year specific data when needed to implement for 2013 +# GHGI FBA table names match the 2022 GHGI Report +# MECS year is 2014 +# CoA year is 2017 + +!include:GHG_national_m1_common.yaml +ghgi_year: &ghgi_year 2013 +mecs_year: &mecs_year 2014 + +_industrial_allocation_dict: &industrial_dict + energy_fba: 'EIA_MECS_Energy' + year: *mecs_year + ghg_fba: 'EPA_GHGI_T_A_11' # 2014 Table + +source_names: + "EPA_GHGI_T_2_1": #U.S. GHG emissions + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 + year: *ghgi_year + activity_sets: # Update USGS year for these activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + lead: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead + attribution_source: + USGS_MYB_Lead: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead + year: *ghgi_year + "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 + year: *ghgi_year + "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 + year: *ghgi_year + "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 + year: *ghgi_year + "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 + year: *ghgi_year + "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 + year: *ghgi_year + "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 + year: *ghgi_year + "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 + year: *ghgi_year + "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 + year: *ghgi_year + "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 + year: *ghgi_year + "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 + year: *ghgi_year + "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 + year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year + "EPA_GHGI_T_3_14": #CH4 from mobile combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 + year: *ghgi_year + "EPA_GHGI_T_3_15": #N2O from mobile combustion duplicates method for CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_15 + year: *ghgi_year + "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 + year: *ghgi_year + "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 + year: *ghgi_year + "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 + year: *ghgi_year + "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 + year: *ghgi_year + "EPA_GHGI_T_A_97": # HFCs from Transportation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 + year: *ghgi_year + "EPA_GHGI_T_4_80": # PFCs from aluminum production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 + year: *ghgi_year + "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_86 + year: *ghgi_year + "EPA_GHGI_T_3_22b": #Fossil fuel for non-energy uses + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + year: *ghgi_year + activity_sets: # Update EIA_MECS year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets + petroleum: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas:attribution_source:EIA_MECS_Energy + year: *mecs_year + +### Major CO2 Sources + "EPA_GHGI_T_A_12": # CO2 emissions from stationary combustion. This table number changes with year + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: # Update EIA_MECS year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets + coal_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + coal_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + ng_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9 + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets + coal_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + ng_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml new file mode 100644 index 000000000..5e2223e53 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml @@ -0,0 +1,165 @@ +# This is a 2014 target year specific implementation of GHG_national_m1 +# All parameters add year specific data when needed to implement for 2014 +# GHGI FBA table names match the 2022 GHGI Report +# MECS year is 2014 +# CoA year is 2017 + +!include:GHG_national_m1_common.yaml +ghgi_year: &ghgi_year 2014 +mecs_year: &mecs_year 2014 + +_industrial_allocation_dict: &industrial_dict + energy_fba: 'EIA_MECS_Energy' + year: *mecs_year + ghg_fba: 'EPA_GHGI_T_A_11' # 2018 Table + +source_names: + "EPA_GHGI_T_2_1": #U.S. GHG emissions + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 + year: *ghgi_year + activity_sets: # Update USGS year for these activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + lead: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead + attribution_source: + USGS_MYB_Lead: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead + year: *ghgi_year + "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 + year: *ghgi_year + "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 + year: *ghgi_year + "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 + year: *ghgi_year + "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 + year: *ghgi_year + "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 + year: *ghgi_year + "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 + year: *ghgi_year + "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 + year: *ghgi_year + "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 + year: *ghgi_year + "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 + year: *ghgi_year + "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 + year: *ghgi_year + "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 + year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year + "EPA_GHGI_T_3_14": #CH4 from mobile combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 + year: *ghgi_year + "EPA_GHGI_T_3_15": #N2O from mobile combustion duplicates method for CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_15 + year: *ghgi_year + "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 + year: *ghgi_year + "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 + year: *ghgi_year + "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 + year: *ghgi_year + "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 + year: *ghgi_year + "EPA_GHGI_T_A_97": # HFCs from Transportation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 + year: *ghgi_year + "EPA_GHGI_T_4_80": # PFCs from aluminum production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 + year: *ghgi_year + "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_86 + year: *ghgi_year + "EPA_GHGI_T_3_22b": #Fossil fuel for non-energy uses + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + year: *ghgi_year + activity_sets: # Update EIA_MECS year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets + petroleum: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas:attribution_source:EIA_MECS_Energy + year: *mecs_year + +### Major CO2 Sources + "EPA_GHGI_T_A_11": # CO2 emissions from stationary combustion. This table number changes with year + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: # Update EIA_MECS year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets + coal_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + coal_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + ng_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9 + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets + coal_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + ng_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml new file mode 100644 index 000000000..76f5ac325 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml @@ -0,0 +1,165 @@ +# This is a 2015 target year specific implementation of GHG_national_m1 +# All parameters add year specific data when needed to implement for 2015 +# GHGI FBA table names match the 2022 GHGI Report +# MECS year is 2014 +# CoA year is 2017 + +!include:GHG_national_m1_common.yaml +ghgi_year: &ghgi_year 2015 +mecs_year: &mecs_year 2014 + +_industrial_allocation_dict: &industrial_dict + energy_fba: 'EIA_MECS_Energy' + year: *mecs_year + ghg_fba: 'EPA_GHGI_T_A_11' # 2014 Table + +source_names: + "EPA_GHGI_T_2_1": #U.S. GHG emissions + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 + year: *ghgi_year + activity_sets: # Update USGS year for these activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + lead: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead + attribution_source: + USGS_MYB_Lead: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead + year: *ghgi_year + "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 + year: *ghgi_year + "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 + year: *ghgi_year + "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 + year: *ghgi_year + "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 + year: *ghgi_year + "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 + year: *ghgi_year + "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 + year: *ghgi_year + "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 + year: *ghgi_year + "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 + year: *ghgi_year + "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 + year: *ghgi_year + "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 + year: *ghgi_year + "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 + year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year + "EPA_GHGI_T_3_14": #CH4 from mobile combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 + year: *ghgi_year + "EPA_GHGI_T_3_15": #N2O from mobile combustion duplicates method for CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_15 + year: *ghgi_year + "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 + year: *ghgi_year + "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 + year: *ghgi_year + "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 + year: *ghgi_year + "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 + year: *ghgi_year + "EPA_GHGI_T_A_97": # HFCs from Transportation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 + year: *ghgi_year + "EPA_GHGI_T_4_80": # PFCs from aluminum production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 + year: *ghgi_year + "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_86 + year: *ghgi_year + "EPA_GHGI_T_3_22b": #Fossil fuel for non-energy uses + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + year: *ghgi_year + activity_sets: # Update EIA_MECS year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets + petroleum: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas:attribution_source:EIA_MECS_Energy + year: *mecs_year + +### Major CO2 Sources + "EPA_GHGI_T_A_10": # CO2 emissions from stationary combustion. This table number changes with year + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: # Update EIA_MECS year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets + coal_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + coal_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + ng_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9 + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets + coal_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + ng_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year From 0c5212322cae947392eabe80c2fe20286009f649 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 29 Aug 2023 19:28:54 -0400 Subject: [PATCH 0861/1127] :white_check_mark: run one version of each FBS during testing, partial reversion of cab4ce0c --- .github/workflows/generate_FBS.yml | 3 +-- flowsa/test_FBS_against_remote.py | 29 +++++++++++++++-------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/generate_FBS.yml b/.github/workflows/generate_FBS.yml index ffc19b486..4c0e48b52 100644 --- a/.github/workflows/generate_FBS.yml +++ b/.github/workflows/generate_FBS.yml @@ -1,5 +1,4 @@ -# This workflow will generate the latest version of a FlowBySector file and -# store as artifact +# This workflow will generate all FlowBySector files and store as artifact name: Generate FBS diff --git a/flowsa/test_FBS_against_remote.py b/flowsa/test_FBS_against_remote.py index 00d891c39..2a55dd1b4 100644 --- a/flowsa/test_FBS_against_remote.py +++ b/flowsa/test_FBS_against_remote.py @@ -16,17 +16,8 @@ @pytest.mark.generate_fbs def test_generate_fbs(): - """Generate latest year for all FBS from methods in repo.""" - models = pd.DataFrame(seeAvailableFlowByModels("FBS", print_method=False)) - models['year'] = models[0].str.extract('.*(\d{4})', expand = False) - models['model'] = models.apply(lambda x: x[0].split(x['year']), - axis=1).str[0] - m_last_two = models[0].str.slice(start=-2) - models['model'] = np.where(m_last_two.str.startswith('m'), - models['model'] + m_last_two, - models['model']) - model_list = models.drop_duplicates(subset='model', keep='last')[0] - for m in model_list: + """Generate all FBS from methods in repo.""" + for m in seeAvailableFlowByModels("FBS", print_method=False): print("--------------------------------\n" f"Method: {m}\n" "--------------------------------") @@ -36,14 +27,24 @@ def test_generate_fbs(): @pytest.mark.skip(reason="Perform targeted test for compare_FBS on PR") def test_FBS_against_remote(only_run_m=None): - """Compare results for each FBS method at current HEAD with most - recent FBS stored on remote server.""" + """Compare results for each FBS method (latest year) at current HEAD + with most recent FBS stored on remote server.""" error_list = [] outdir = diffpath method_status = check_method_status() if not os.path.exists(outdir): os.mkdir(outdir) - for m in seeAvailableFlowByModels("FBS", print_method=False): + models = pd.DataFrame(seeAvailableFlowByModels("FBS", print_method=False)) + models['year'] = models[0].str.extract('.*(\d{4})', expand = False) + models['model'] = models.apply(lambda x: x[0].split(x['year']), + axis=1).str[0] + m_last_two = models[0].str.slice(start=-2) + models['model'] = np.where(m_last_two.str.startswith('m'), + models['model'] + m_last_two, + models['model']) + model_list = (models.sort_values(by='year') + .drop_duplicates(subset='model', keep='last')[0]) + for m in model_list: if only_run_m is not None and m != only_run_m: continue if method_status.get(m) is not None: From 5b4204d480364cc26781c3ed572229fa7a5b997d Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 30 Aug 2023 15:46:03 -0600 Subject: [PATCH 0862/1127] limit the pandas version, as v2.1.0 causes failures for Python3.9 and 2.10 - will evaluate the cause --- requirements.txt | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index c9826077d..7a3b5c6e9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ kaleido == 0.2.0; platform_system=="Linux" or platform_system=="Darwin" matplotlib >= 3.4.3 # Plotting numpy>=1.20.1 # Library used for arrays openpyxl >= 3.0.7 # Extract data from xlsm files -pandas>=1.4.0 # Powerful data structures for data analysis, time series, and statistics. +pandas>=1.4.0, <2.1.0 # Powerful data structures for data analysis, time series, and statistics. pip>=9 # The PyPA recommended tool for installing Python packages. plotly >= 5.10.0 # Plotting pycountry >= 19.8.18 # ISO country codes diff --git a/setup.py b/setup.py index e372f931f..4d0edbea6 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ 'matplotlib>=3.4.3', 'numpy>=1.20.1', 'openpyxl>=3.0.7', - 'pandas>=1.4.0', + 'pandas>=1.4.0, <2.1.0', 'pip>=9', 'plotly>=5.10.0 ', 'pycountry>=19.8.18', From 92a2a3cbf90adf0820b03536867cf26865d9612c Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 30 Aug 2023 21:33:55 -0400 Subject: [PATCH 0863/1127] update CoA year --- .../GHG_national_2015_m1.yaml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml index 76f5ac325..c1d299225 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml @@ -7,6 +7,7 @@ !include:GHG_national_m1_common.yaml ghgi_year: &ghgi_year 2015 mecs_year: &mecs_year 2014 +coa_year: &coa_year 2012 _industrial_allocation_dict: &industrial_dict energy_fba: 'EIA_MECS_Energy' @@ -55,9 +56,28 @@ source_names: "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 year: *ghgi_year + activity_sets: # Update CoA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets + cropland: # allocated based on USDA land area harvested + attribution_source: + USDA_CoA_Cropland: + !include:GHG_national_m1_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland + year: *coa_year + attribution_source: + USDA_CoA_Cropland_NAICS: + !include:GHG_national_m1_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland:attribution_source:USDA_CoA_Cropland_NAICS + year: *coa_year + pasture: &pasture # allocated based on USDA Animal operation land (acres) + attribution_source: + USDA_CoA_Cropland_NAICS: + !include:GHG_national_m1_common.yaml:attribution_sources:_animal_land_allocation:USDA_CoA_Cropland_NAICS + year: *coa_year "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 year: *ghgi_year + activity_sets: # Update CoA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18:activity_sets + pasture: *pasture # allocated based on USDA Animal operation land (acres) "EPA_GHGI_T_3_13": #CO2 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 year: *ghgi_year From 4333d67b62aa7729362733fe1d081598c201852c Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 30 Aug 2023 21:38:51 -0400 Subject: [PATCH 0864/1127] fix code lost during merge conflict --- flowsa/flowbyactivity.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index a6c56d854..5ae1d6b79 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -827,7 +827,8 @@ def activity_sets(self) -> List['FlowByActivity']: # raise ValueError('Some rows in multiple activity sets') assigned_rows.update(child_fba.row) - if not child_fba.empty: + if ((not child_fba.empty) and + len(child_fba.query('FlowAmount != 0')) > 0): child_fba_list.append(child_fba.drop(columns='row')) else: log.error(f'Activity set {child_fba.full_name} is empty. ' From 5c7b0be9b7ebacc862721866d15ed759005b6700 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 30 Aug 2023 21:57:32 -0400 Subject: [PATCH 0865/1127] update 2012-2015 ghg datasets to use CoA 2012 --- .../GHG_national_2012_m1.yaml | 24 ++++++++++++++++- .../GHG_national_2013_m1.yaml | 24 ++++++++++++++++- .../GHG_national_2014_m1.yaml | 26 +++++++++++++++++-- .../GHG_national_2015_m1.yaml | 4 ++- 4 files changed, 73 insertions(+), 5 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml index a3348bc11..fb86fcf1a 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml @@ -2,11 +2,12 @@ # All parameters add year specific data when needed to implement for 2012 # GHGI FBA table names match the 2022 GHGI Report # MECS year is 2014 -# CoA year is 2017 +# CoA year is 2012 !include:GHG_national_m1_common.yaml ghgi_year: &ghgi_year 2012 mecs_year: &mecs_year 2014 +coa_year: &coa_year 2012 _industrial_allocation_dict: &industrial_dict energy_fba: 'EIA_MECS_Energy' @@ -55,9 +56,30 @@ source_names: "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 year: *ghgi_year + activity_sets: # Update CoA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets + cropland: # allocated based on USDA land area harvested + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets:cropland + attribution_source: + USDA_CoA_Cropland: + !include:GHG_national_m1_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland + year: *coa_year + attribution_source: + USDA_CoA_Cropland_NAICS: + !include:GHG_national_m1_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland:attribution_source:USDA_CoA_Cropland_NAICS + year: *coa_year + pasture: &pasture # allocated based on USDA Animal operation land (acres) + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets:pasture + attribution_source: + USDA_CoA_Cropland_NAICS: + !include:GHG_national_m1_common.yaml:attribution_sources:_animal_land_allocation:USDA_CoA_Cropland_NAICS + year: *coa_year "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 year: *ghgi_year + activity_sets: # Update CoA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18:activity_sets + pasture: *pasture # allocated based on USDA Animal operation land (acres) "EPA_GHGI_T_3_13": #CO2 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 year: *ghgi_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml index cdebe1b13..cb6e137e9 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml @@ -2,11 +2,12 @@ # All parameters add year specific data when needed to implement for 2013 # GHGI FBA table names match the 2022 GHGI Report # MECS year is 2014 -# CoA year is 2017 +# CoA year is 2012 !include:GHG_national_m1_common.yaml ghgi_year: &ghgi_year 2013 mecs_year: &mecs_year 2014 +coa_year: &coa_year 2012 _industrial_allocation_dict: &industrial_dict energy_fba: 'EIA_MECS_Energy' @@ -55,9 +56,30 @@ source_names: "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 year: *ghgi_year + activity_sets: # Update CoA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets + cropland: # allocated based on USDA land area harvested + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets:cropland + attribution_source: + USDA_CoA_Cropland: + !include:GHG_national_m1_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland + year: *coa_year + attribution_source: + USDA_CoA_Cropland_NAICS: + !include:GHG_national_m1_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland:attribution_source:USDA_CoA_Cropland_NAICS + year: *coa_year + pasture: &pasture # allocated based on USDA Animal operation land (acres) + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets:pasture + attribution_source: + USDA_CoA_Cropland_NAICS: + !include:GHG_national_m1_common.yaml:attribution_sources:_animal_land_allocation:USDA_CoA_Cropland_NAICS + year: *coa_year "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 year: *ghgi_year + activity_sets: # Update CoA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18:activity_sets + pasture: *pasture # allocated based on USDA Animal operation land (acres) "EPA_GHGI_T_3_13": #CO2 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 year: *ghgi_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml index 5e2223e53..bde134195 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml @@ -2,16 +2,17 @@ # All parameters add year specific data when needed to implement for 2014 # GHGI FBA table names match the 2022 GHGI Report # MECS year is 2014 -# CoA year is 2017 +# CoA year is 2012 !include:GHG_national_m1_common.yaml ghgi_year: &ghgi_year 2014 mecs_year: &mecs_year 2014 +coa_year: &coa_year 2012 _industrial_allocation_dict: &industrial_dict energy_fba: 'EIA_MECS_Energy' year: *mecs_year - ghg_fba: 'EPA_GHGI_T_A_11' # 2018 Table + ghg_fba: 'EPA_GHGI_T_A_11' # 2014 Table source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions @@ -55,9 +56,30 @@ source_names: "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 year: *ghgi_year + activity_sets: # Update CoA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets + cropland: # allocated based on USDA land area harvested + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets:cropland + attribution_source: + USDA_CoA_Cropland: + !include:GHG_national_m1_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland + year: *coa_year + attribution_source: + USDA_CoA_Cropland_NAICS: + !include:GHG_national_m1_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland:attribution_source:USDA_CoA_Cropland_NAICS + year: *coa_year + pasture: &pasture # allocated based on USDA Animal operation land (acres) + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets:pasture + attribution_source: + USDA_CoA_Cropland_NAICS: + !include:GHG_national_m1_common.yaml:attribution_sources:_animal_land_allocation:USDA_CoA_Cropland_NAICS + year: *coa_year "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 year: *ghgi_year + activity_sets: # Update CoA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18:activity_sets + pasture: *pasture # allocated based on USDA Animal operation land (acres) "EPA_GHGI_T_3_13": #CO2 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 year: *ghgi_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml index c1d299225..c5e81d9b5 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml @@ -2,7 +2,7 @@ # All parameters add year specific data when needed to implement for 2015 # GHGI FBA table names match the 2022 GHGI Report # MECS year is 2014 -# CoA year is 2017 +# CoA year is 2012 !include:GHG_national_m1_common.yaml ghgi_year: &ghgi_year 2015 @@ -59,6 +59,7 @@ source_names: activity_sets: # Update CoA year for some activity_sets !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets cropland: # allocated based on USDA land area harvested + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets:cropland attribution_source: USDA_CoA_Cropland: !include:GHG_national_m1_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland @@ -68,6 +69,7 @@ source_names: !include:GHG_national_m1_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland:attribution_source:USDA_CoA_Cropland_NAICS year: *coa_year pasture: &pasture # allocated based on USDA Animal operation land (acres) + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets:pasture attribution_source: USDA_CoA_Cropland_NAICS: !include:GHG_national_m1_common.yaml:attribution_sources:_animal_land_allocation:USDA_CoA_Cropland_NAICS From 4a983ce91eec3284d56924a8e9fda812e1990cd7 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 30 Aug 2023 22:23:06 -0400 Subject: [PATCH 0866/1127] use 2012 CoA for 2012-2015 GHG state methods --- flowsa/methods/flowbysectormethods/GHG_state_2012.yaml | 9 +++++++++ flowsa/methods/flowbysectormethods/GHG_state_2013.yaml | 9 +++++++++ flowsa/methods/flowbysectormethods/GHG_state_2014.yaml | 9 +++++++++ flowsa/methods/flowbysectormethods/GHG_state_2015.yaml | 9 +++++++++ 4 files changed, 36 insertions(+) diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml index 73194b076..50bb618d9 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml @@ -2,6 +2,7 @@ !include:USEEIO_summary_target.yaml year: &ghg_year 2012 +coa_year: &coa_year 2012 geoscale: state sources_to_cache: @@ -90,6 +91,14 @@ source_names: selection_fields: ActivityProducedBy: {'325': ''} # Use of chemicals + ag: # emissions from urea fertilization + # allocated between crops and animals based on USDA land area + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ag + attribution_source: + USDA_CoA_Cropland_NAICS: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ag:attribution_source:USDA_CoA_Cropland_NAICS + year: *coa_year + transport_petroleum: # C02 from petroleum highway !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum attribution_source: diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml index a0b89dcc8..3026ae193 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml @@ -2,6 +2,7 @@ !include:USEEIO_summary_target.yaml year: &ghg_year 2013 +coa_year: &coa_year 2012 geoscale: state sources_to_cache: @@ -90,6 +91,14 @@ source_names: selection_fields: ActivityProducedBy: {'325': ''} # Use of chemicals + ag: # emissions from urea fertilization + # allocated between crops and animals based on USDA land area + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ag + attribution_source: + USDA_CoA_Cropland_NAICS: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ag:attribution_source:USDA_CoA_Cropland_NAICS + year: *coa_year + transport_petroleum: # C02 from petroleum highway !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum attribution_source: diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml index 5be257513..1da95dbb0 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml @@ -2,6 +2,7 @@ !include:USEEIO_summary_target.yaml year: &ghg_year 2014 +coa_year: &coa_year 2012 geoscale: state sources_to_cache: @@ -90,6 +91,14 @@ source_names: selection_fields: ActivityProducedBy: {'325': ''} # Use of chemicals + ag: # emissions from urea fertilization + # allocated between crops and animals based on USDA land area + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ag + attribution_source: + USDA_CoA_Cropland_NAICS: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ag:attribution_source:USDA_CoA_Cropland_NAICS + year: *coa_year + transport_petroleum: # C02 from petroleum highway !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum attribution_source: diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml index c17e87168..a02983a2c 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml @@ -2,6 +2,7 @@ !include:USEEIO_summary_target.yaml year: &ghg_year 2015 +coa_year: &coa_year 2012 geoscale: state sources_to_cache: @@ -90,6 +91,14 @@ source_names: selection_fields: ActivityProducedBy: {'325': ''} # Use of chemicals + ag: # emissions from urea fertilization + # allocated between crops and animals based on USDA land area + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ag + attribution_source: + USDA_CoA_Cropland_NAICS: + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ag:attribution_source:USDA_CoA_Cropland_NAICS + year: *coa_year + transport_petroleum: # C02 from petroleum highway !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum attribution_source: From 2db51cfd74c11bfedb894000350826f47e9763d3 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 31 Aug 2023 10:41:41 -0400 Subject: [PATCH 0867/1127] add ability to adjust axis title on `stackedBarChart` --- flowsa/datavisualization.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/flowsa/datavisualization.py b/flowsa/datavisualization.py index 911350fb2..ac78eb938 100644 --- a/flowsa/datavisualization.py +++ b/flowsa/datavisualization.py @@ -158,6 +158,7 @@ def stackedBarChart(df, rows=1, cols=1, filename = 'flowsaBarChart', + axis_title = None, graphic_width = 1200, graphic_height = 1200 ): @@ -293,6 +294,7 @@ def stackedBarChart(df, df2 = df2.merge(colors, how='left') if subplot is None: + axis_title = axis_title or f"FlowAmount ({df_unit})" for r, c in zip(df2[stacking_col].unique(), df2['Color'].unique()): plot_df = df2[df2[stacking_col] == r] y_axis_col = plot_df[sector_variable] @@ -305,9 +307,10 @@ def stackedBarChart(df, orientation='h', marker_color=c )) - fig.update_xaxes(title_text=f"FlowAmount ({df_unit})") + fig.update_xaxes(title_text=axis_title) fig.update_yaxes(title_text="Sector", tickmode='linear') else: + axis_title = axis_title or f"Flow Total ({plot_df['Unit'][0]})" s = 0 for row in range(1, rows + 1): for col in range(1, cols + 1): @@ -319,13 +322,13 @@ def stackedBarChart(df, if orientation == 'h': x_data = flow_col y_data = sector_col - xaxis_title = f"Flow Total ({plot_df['Unit'][0]})" + xaxis_title = axis_title yaxis_title = "" else: x_data = sector_col y_data = flow_col xaxis_title = "" - yaxis_title = f"Flow Total ({plot_df['Unit'][0]})" + yaxis_title = axis_title fig.add_trace( go.Bar(x=x_data, y=y_data, name=r, orientation=orientation, From fce053002fa6cceabc361a8c9eec629e6df87119 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 31 Aug 2023 09:18:40 -0600 Subject: [PATCH 0868/1127] spelling --- flowsa/test_FBS_against_remote.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/test_FBS_against_remote.py b/flowsa/test_FBS_against_remote.py index de98dbdc8..de092f157 100644 --- a/flowsa/test_FBS_against_remote.py +++ b/flowsa/test_FBS_against_remote.py @@ -20,7 +20,7 @@ def test_generate_fbs(): print("--------------------------------\n" f"Method: {m}\n" "--------------------------------") - FlowBySector.genereateFlowBySector( + FlowBySector.generateFlowBySector( method=m, download_sources_ok=True) From 877609a8f0d050b1fd67c0acea1fc98166fcca54 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 31 Aug 2023 10:42:31 -0600 Subject: [PATCH 0869/1127] move fxns out of temp_data_source_functions and delete file --- flowsa/data_source_scripts/EIA_MECS.py | 37 ++++++++++++ .../temp_data_source_functions.py | 57 ------------------- 2 files changed, 37 insertions(+), 57 deletions(-) delete mode 100644 flowsa/data_source_scripts/temp_data_source_functions.py diff --git a/flowsa/data_source_scripts/EIA_MECS.py b/flowsa/data_source_scripts/EIA_MECS.py index cfff664cf..f904fa491 100644 --- a/flowsa/data_source_scripts/EIA_MECS.py +++ b/flowsa/data_source_scripts/EIA_MECS.py @@ -11,6 +11,7 @@ import pandas as pd import numpy as np +from flowsa import FlowByActivity from flowsa.location import US_FIPS, get_region_and_division_codes from flowsa.common import WITHDRAWN_KEYWORD from flowsa.flowsa_log import log @@ -532,3 +533,39 @@ def mecs_land_fba_cleanup(fba, **_): fba = calculate_total_facility_land_area(fba) return fba + + +def clean_mecs_energy_fba_for_bea_summary(fba: FlowByActivity, **kwargs): + naics_3 = fba.query('ActivityConsumedBy.str.len() == 3') + naics_4 = fba.query('ActivityConsumedBy.str.len() == 4 ' + '& ActivityConsumedBy.str.startswith("336")') + naics_4_sum = ( + naics_4 + .assign(ActivityConsumedBy='336') + .aggregate_flowby() + [['Flowable', 'FlowAmount', 'Unit', 'ActivityConsumedBy']] + .rename(columns={'FlowAmount': 'naics_4_sum'}) + ) + + merged = naics_3.merge(naics_4_sum, how='left').fillna({'naics_4_sum': 0}) + subtracted = ( + merged + .assign(FlowAmount=merged.FlowAmount - merged.naics_4_sum) + .drop(columns='naics_4_sum') + ) + + subtracted.config['naics_4_list'] = list( + naics_4.ActivityConsumedBy.unique() + ) + + return subtracted + + +def clean_mapped_mecs_energy_fba_for_bea_summary( + fba: FlowByActivity, + **kwargs +): + naics_4_list = fba.config['naics_4_list'] + + return fba.query('~(SectorConsumedBy in @naics_4_list ' + '& ActivityConsumedBy != SectorConsumedBy)') diff --git a/flowsa/data_source_scripts/temp_data_source_functions.py b/flowsa/data_source_scripts/temp_data_source_functions.py deleted file mode 100644 index ea9e7de21..000000000 --- a/flowsa/data_source_scripts/temp_data_source_functions.py +++ /dev/null @@ -1,57 +0,0 @@ -from flowsa.data_source_scripts import EPA_GHGI as ghgi -from flowsa.flowbyactivity import FlowByActivity - - -def clean_mecs_energy_fba_for_bea_summary(fba: FlowByActivity, **kwargs): - naics_3 = fba.query('ActivityConsumedBy.str.len() == 3') - naics_4 = fba.query('ActivityConsumedBy.str.len() == 4 ' - '& ActivityConsumedBy.str.startswith("336")') - naics_4_sum = ( - naics_4 - .assign(ActivityConsumedBy='336') - .aggregate_flowby() - [['Flowable', 'FlowAmount', 'Unit', 'ActivityConsumedBy']] - .rename(columns={'FlowAmount': 'naics_4_sum'}) - ) - - merged = naics_3.merge(naics_4_sum, how='left').fillna({'naics_4_sum': 0}) - subtracted = ( - merged - .assign(FlowAmount=merged.FlowAmount - merged.naics_4_sum) - .drop(columns='naics_4_sum') - ) - - subtracted.config['naics_4_list'] = list( - naics_4.ActivityConsumedBy.unique() - ) - - return subtracted - - -def clean_mapped_mecs_energy_fba_for_bea_summary( - fba: FlowByActivity, - **kwargs -): - naics_4_list = fba.config['naics_4_list'] - - return fba.query('~(SectorConsumedBy in @naics_4_list ' - '& ActivityConsumedBy != SectorConsumedBy)') - - -def clean_hfc_fba_for_seea(fba: FlowByActivity, **kwargs): - attributes_to_save = { - attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] - } - - df = ( - fba - .pipe(ghgi.subtract_HFC_transport_emissions) - .pipe(ghgi.allocate_HFC_to_residential) - .pipe(ghgi.split_HFC_foams) - ) - - new_fba = FlowByActivity(df) - for attr in attributes_to_save: - setattr(new_fba, attr, attributes_to_save[attr]) - - return new_fba From 17b01ff979a638dc471b3e3ac6463bd7ef9c97a5 Mon Sep 17 00:00:00 2001 From: WesIngwersen Date: Thu, 31 Aug 2023 14:31:48 -0400 Subject: [PATCH 0870/1127] address #368 --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index eb8e96d50..cff446015 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -11,27 +11,27 @@ EPA_State_GHGI,Agriculture - Enteric Fermentation - Horses,NAICS_2012_Code,1129, EPA_State_GHGI,Agriculture - Enteric Fermentation - Mules and Asses,NAICS_2012_Code,1129,,direct EPA_State_GHGI,Agriculture - Enteric Fermentation - Sheep,NAICS_2012_Code,1124,,direct EPA_State_GHGI,Agriculture - Enteric Fermentation - Swine,NAICS_2012_Code,1122,,direct -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Barley,NAICS_2012_Code,1111,,direct -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Chickpeas,NAICS_2012_Code,1111,,direct -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Cotton,NAICS_2012_Code,1119,,direct -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Dry Beans,NAICS_2012_Code,1111,,direct -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Grass Hay,NAICS_2012_Code,1119,,direct -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Legume Hay,NAICS_2012_Code,1119,,direct -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Lentils,NAICS_2012_Code,1111,,direct -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Maize,NAICS_2012_Code,1111,,direct -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Oats,NAICS_2012_Code,1111,,direct -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Other Small Grains,NAICS_2012_Code,1111,,direct -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Peanuts,NAICS_2012_Code,1119,,direct -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Peas,NAICS_2012_Code,1112,,direct -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Potatoes,NAICS_2012_Code,1112,,direct -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Rice,NAICS_2012_Code,1111,,direct -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Sorghum,NAICS_2012_Code,1111,,direct -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Soybeans,NAICS_2012_Code,1111,,direct -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Sugarbeets,NAICS_2012_Code,1119,,direct -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Sunflower,NAICS_2012_Code,1111,,direct -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Tobacco,NAICS_2012_Code,1119,,direct -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Vegetables,NAICS_2012_Code,1112,,direct -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Wheat,NAICS_2012_Code,1111,,direct +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Barley,NAICS_2012_Code,111199,,revise WI +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Chickpeas,NAICS_2012_Code,111130,,revise WI +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Cotton,NAICS_2012_Code,11192,,revise WI +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Dry Beans,NAICS_2012_Code,111130,,revise WI +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Grass Hay,NAICS_2012_Code,11194,,revise WI +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Legume Hay,NAICS_2012_Code,11194,,revise WI +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Lentils,NAICS_2012_Code,111130,,revise WI +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Maize,NAICS_2012_Code,111150,,revise WI +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Oats,NAICS_2012_Code,111199,,revise WI +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Other Small Grains,NAICS_2012_Code,111199,,revise WI +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Peanuts,NAICS_2012_Code,111992,,revise WI +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Peas,NAICS_2012_Code,111130,,revise WI +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Potatoes,NAICS_2012_Code,111211,,revise WI +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Rice,NAICS_2012_Code,11116,,revise WI +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Sorghum,NAICS_2012_Code,111199,,revise WI +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Soybeans,NAICS_2012_Code,11111,,revise WI +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Sugarbeets,NAICS_2012_Code,111991,,revise WI +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Sunflower,NAICS_2012_Code,111120,,revise WI +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Tobacco,NAICS_2012_Code,11191,,revise WI +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Vegetables,NAICS_2012_Code,111219,,revise WI +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Wheat,NAICS_2012_Code,11114,,revise WI EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Dolomite",NAICS_2012_Code,3274,,direct EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Limestone",NAICS_2012_Code,3274,,direct EPA_State_GHGI,Agriculture - Manure Management - American Bison,NAICS_2012_Code,1129,,direct From 16573cbcb817019ef1cf4519f9c94b9eeff16847 Mon Sep 17 00:00:00 2001 From: WesIngwersen Date: Thu, 31 Aug 2023 14:36:55 -0400 Subject: [PATCH 0871/1127] address #369 --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index cff446015..db8c75116 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -32,8 +32,10 @@ EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Sunflower, EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Tobacco,NAICS_2012_Code,11191,,revise WI EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Vegetables,NAICS_2012_Code,111219,,revise WI EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Wheat,NAICS_2012_Code,11114,,revise WI -EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Dolomite",NAICS_2012_Code,3274,,direct -EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Limestone",NAICS_2012_Code,3274,,direct +EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Dolomite",NAICS_2012_Code,111,,align with national method +EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Dolomite",NAICS_2012_Code,112,,align with national method +EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Limestone",NAICS_2012_Code,111,,align with national method +EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Limestone",NAICS_2012_Code,112,,align with national method EPA_State_GHGI,Agriculture - Manure Management - American Bison,NAICS_2012_Code,1129,,direct EPA_State_GHGI,Agriculture - Manure Management - Beef Cattle,NAICS_2012_Code,1121,,direct EPA_State_GHGI,Agriculture - Manure Management - Bison,NAICS_2012_Code,1129,,direct From 33d7ebc9ec3d3c90fd832d384a589d915eb31243 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 31 Aug 2023 15:27:39 -0400 Subject: [PATCH 0872/1127] use use table to attribute urea emissions, consistent with national method #369 --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 8 ++++---- .../flowbysectoractivitysets/EPA_StateGHGI_asets.csv | 4 ++-- flowsa/methods/flowbysectormethods/GHG_state_common.yaml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index db8c75116..74cbec836 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -32,10 +32,10 @@ EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Sunflower, EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Tobacco,NAICS_2012_Code,11191,,revise WI EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Vegetables,NAICS_2012_Code,111219,,revise WI EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Wheat,NAICS_2012_Code,11114,,revise WI -EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Dolomite",NAICS_2012_Code,111,,align with national method -EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Dolomite",NAICS_2012_Code,112,,align with national method -EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Limestone",NAICS_2012_Code,111,,align with national method -EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Limestone",NAICS_2012_Code,112,,align with national method +EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Dolomite",NAICS_2012_Code,111,,use_table_chem +EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Dolomite",NAICS_2012_Code,112,,use_table_chem +EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Limestone",NAICS_2012_Code,111,,use_table_chem +EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Limestone",NAICS_2012_Code,112,,use_table_chem EPA_State_GHGI,Agriculture - Manure Management - American Bison,NAICS_2012_Code,1129,,direct EPA_State_GHGI,Agriculture - Manure Management - Beef Cattle,NAICS_2012_Code,1121,,direct EPA_State_GHGI,Agriculture - Manure Management - Bison,NAICS_2012_Code,1129,,direct diff --git a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv index 6020cba45..a4c496643 100644 --- a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv @@ -32,8 +32,8 @@ direct,Agriculture - Field Burning of Agricultural Residues - Sunflower,EPA_GHGI direct,Agriculture - Field Burning of Agricultural Residues - Tobacco,EPA_GHGI_T_5_29 direct,Agriculture - Field Burning of Agricultural Residues - Vegetables,EPA_GHGI_T_5_29 direct,Agriculture - Field Burning of Agricultural Residues - Wheat,EPA_GHGI_T_5_29 -direct,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Dolomite",EPA_GHGI_T_2_1 -direct,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Limestone",EPA_GHGI_T_2_1 +use_table_chem,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Dolomite",EPA_GHGI_T_2_1 +use_table_chem,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Limestone",EPA_GHGI_T_2_1 direct,Agriculture - Manure Management - American Bison,EPA_GHGI_T_2_1 direct,Agriculture - Manure Management - Beef Cattle,EPA_GHGI_T_5_7 direct,Agriculture - Manure Management - Bison,EPA_GHGI_T_5_7 diff --git a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml index 92d2f6526..b81161b1b 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml @@ -276,7 +276,7 @@ source_names: Class: Other # nonfuel consumption Flowable: Total - use_table_chem: # other process use of carbonates + use_table_chem: # other process use of carbonates, urea application selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_chem attribution_method: proportional From c8e03605f66ab2cc387935c3523f8e4d7dda3bee Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 31 Aug 2023 15:36:27 -0400 Subject: [PATCH 0873/1127] align animals with CoA_livestock, #368 --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index 74cbec836..36e8457c9 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -36,16 +36,16 @@ EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea applicati EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Dolomite",NAICS_2012_Code,112,,use_table_chem EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Limestone",NAICS_2012_Code,111,,use_table_chem EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Limestone",NAICS_2012_Code,112,,use_table_chem -EPA_State_GHGI,Agriculture - Manure Management - American Bison,NAICS_2012_Code,1129,,direct -EPA_State_GHGI,Agriculture - Manure Management - Beef Cattle,NAICS_2012_Code,1121,,direct -EPA_State_GHGI,Agriculture - Manure Management - Bison,NAICS_2012_Code,1129,,direct -EPA_State_GHGI,Agriculture - Manure Management - Dairy Cattle,NAICS_2012_Code,1121,,direct -EPA_State_GHGI,Agriculture - Manure Management - Dairy Heifers,NAICS_2012_Code,1121,,direct -EPA_State_GHGI,Agriculture - Manure Management - Goats,NAICS_2012_Code,1124,,direct -EPA_State_GHGI,Agriculture - Manure Management - Horses,NAICS_2012_Code,1129,,direct -EPA_State_GHGI,Agriculture - Manure Management - Mules and Asses,NAICS_2012_Code,1129,,direct +EPA_State_GHGI,Agriculture - Manure Management - American Bison,NAICS_2012_Code,112990B,,direct +EPA_State_GHGI,Agriculture - Manure Management - Beef Cattle,NAICS_2012_Code,11211,,direct +EPA_State_GHGI,Agriculture - Manure Management - Bison,NAICS_2012_Code,112990B,,direct +EPA_State_GHGI,Agriculture - Manure Management - Dairy Cattle,NAICS_2012_Code,11212,,direct +EPA_State_GHGI,Agriculture - Manure Management - Dairy Heifers,NAICS_2012_Code,11212,,direct +EPA_State_GHGI,Agriculture - Manure Management - Goats,NAICS_2012_Code,11242,,direct +EPA_State_GHGI,Agriculture - Manure Management - Horses,NAICS_2012_Code,112920A,,direct +EPA_State_GHGI,Agriculture - Manure Management - Mules and Asses,NAICS_2012_Code,112920B,,direct EPA_State_GHGI,Agriculture - Manure Management - Poultry,NAICS_2012_Code,1123,,direct -EPA_State_GHGI,Agriculture - Manure Management - Sheep,NAICS_2012_Code,1124,,direct +EPA_State_GHGI,Agriculture - Manure Management - Sheep,NAICS_2012_Code,11241,,direct EPA_State_GHGI,Agriculture - Manure Management - Swine,NAICS_2012_Code,1122,,direct EPA_State_GHGI,Agriculture - Rice Cultivation,NAICS_2012_Code,1111,,direct EPA_State_GHGI,"Agriculture - Urea Fertilization - CO2 emissions from liming, urea application and other carbon-containing fertilizers",NAICS_2012_Code,111,,ag From 5dbe6a31f3e8323501168d833599ae5e19bad723 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 31 Aug 2023 15:45:15 -0400 Subject: [PATCH 0874/1127] fix typo, assign commerical CH4 and N2O to 923 #370 --- .../activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index 36e8457c9..728af0132 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -75,7 +75,7 @@ EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,71,,commercial_ch4_n2o EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,72,,commercial_ch4_n2o EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,81,,commercial_ch4_n2o -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,81,,commercial_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,923,,commercial_ch4_n2o EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,42,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,44,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,45,,use_table_coal From d2a2e3cf5d28fd359c27134ee92895077072d2bc Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 1 Sep 2023 10:56:11 -0400 Subject: [PATCH 0875/1127] update attribution approach for electricity to use make table (and gov't utilities) similar to national model --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 20 ++++++++++++++----- .../EPA_StateGHGI_asets.csv | 10 +++++----- .../flowbysectormethods/GHG_state_2019.yaml | 9 +++++++++ .../flowbysectormethods/GHG_state_common.yaml | 10 ++++++++++ 4 files changed, 39 insertions(+), 10 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index 728af0132..125ae60c6 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -124,11 +124,21 @@ EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combus EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,72,,use_table_pet EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,81,,use_table_pet EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,923,,use_table_pet -EPA_State_GHGI,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation,NAICS_2012_Code,2211,,direct -EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Coal,NAICS_2012_Code,2211,,direct -EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Geothermal,NAICS_2012_Code,2211,,direct -EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Natural Gas,NAICS_2012_Code,2211,,direct -EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum,NAICS_2012_Code,2211,,direct +EPA_State_GHGI,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation,NAICS_2012_Code,2211,,make_table_elec +EPA_State_GHGI,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation,NAICS_2012_Code,S00101,,make_table_elec +EPA_State_GHGI,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation,NAICS_2012_Code,S00202,,make_table_elec +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Coal,NAICS_2012_Code,2211,,make_table_elec +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Coal,NAICS_2012_Code,S00101,,make_table_elec +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Coal,NAICS_2012_Code,S00202,,make_table_elec +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Geothermal,NAICS_2012_Code,2211,,make_table_elec +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Geothermal,NAICS_2012_Code,S00101,,make_table_elec +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Geothermal,NAICS_2012_Code,S00202,,make_table_elec +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Natural Gas,NAICS_2012_Code,2211,,make_table_elec +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Natural Gas,NAICS_2012_Code,S00101,,make_table_elec +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Natural Gas,NAICS_2012_Code,S00202,,make_table_elec +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum,NAICS_2012_Code,2211,,make_table_elec +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum,NAICS_2012_Code,S00101,,make_table_elec +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum,NAICS_2012_Code,S00202,,make_table_elec EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,31,,industrial_ch4_n2o EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,32,,industrial_ch4_n2o EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,33,,industrial_ch4_n2o diff --git a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv index a4c496643..ac6dcd949 100644 --- a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv @@ -61,11 +61,11 @@ commercial_ch4_n2o,Commercial - Stationary Combustion - Fossil Fuel Combustion, use_table_coal,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,EPA_GHGI_T_A_14 use_table_gas,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,EPA_GHGI_T_A_14 use_table_pet,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,EPA_GHGI_T_A_14 -direct,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation, -direct,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Coal, -direct,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Geothermal, -direct,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Natural Gas, -direct,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum, +make_table_elec,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation, +make_table_elec,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Coal, +make_table_elec,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Geothermal, +make_table_elec,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Natural Gas, +make_table_elec,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum, industrial_ch4_n2o,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial, industrial_coal,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal - Manufacturing,EPA_GHGI_T_A_14 use_table_coal,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal, diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml index 4be855b9e..2fa4f7533 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml @@ -22,6 +22,15 @@ source_names: !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets ## List these activity sets separately to access the correct use table year + make_table_elec: # electricity combustion + !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:make_table_elec + attribution_source: + stateio_Make_Summary: + !include:GHG_state_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityConsumedBy: {'22': ''} # utilities + use_table_coal: # commercial coal combustion, non-manufacturing industrial !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: diff --git a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml index b81161b1b..bd1265a65 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_common.yaml @@ -72,6 +72,16 @@ source_names: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct_ods attribution_method: direct + make_table_elec: # electricity combustion + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv make_table_elec + attribution_method: proportional + attribution_source: + stateio_Make_Summary: + <<: *use_table_allocation + selection_fields: + ActivityConsumedBy: {'22': ''} # utilities + ng_systems_CH4: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ng_systems From 80fc11c03bde9e4268df7f2694152de5f8e02bb7 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 1 Sep 2023 12:03:26 -0400 Subject: [PATCH 0876/1127] initial draft method attributing national GHGI to states as second attribution method --- .../GHG_state_2019_m2.yaml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml new file mode 100644 index 000000000..7f48d2b4e --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml @@ -0,0 +1,53 @@ + + + +!include:USEEIO_summary_target.yaml +year: &ghg_year 2019 +geoscale: state + + +source_names: + EPA_GHGI_T_2_1: #U.S. GHG emissions + year: *ghg_year + fedefl_mapping: GHGI + geoscale: national + activity_sets: + direct: + selection_fields: + PrimaryActivity: + - Abandoned Oil and Gas Wells #CH4 + - Abandoned Underground Coal Mines #CH4 + - Adipic Acid Production #N2O + - Aluminum Production #CO2 + - Ammonia Production #CO2 + - Anaerobic Digestion at Biogas Facilities #CH4 new activity + - Caprolactam, Glyoxal, and Glyoxylic Acid Production #N2O + - Carbide Production and Consumption #CO2, CH4 + - Cement Production #CO2 + - Coal Mining #CO2, CH4 + - Composting #CH4, N2O + - Ferroalloy Production #CO2, CH4 + - Glass Production #CO2 + - Landfills #CH4 + - Lime Production #CO2 + - Incineration of Waste #CO2, #N2O + - Iron and Steel Production & Metallurgical Coke Production #CO2, CH4 + - Nitric Acid Production #N2O + - Phosphoric Acid Production #CO2 + - Rice Cultivation #CH4 + - Soda Ash Production #CO2 + - Titanium Dioxide Production #CO2 + - Wastewater Treatment #CH4, N2O + - Zinc Production #CO2 + FlowName: ["CO2", "CH4", "N2O"] # HFCs and other flows are pulled elsewhere + attribute: + - attribution_method: direct + - attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct From 15acc692930344c8ff4a480114b82aaa3171bb32 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 1 Sep 2023 12:05:10 -0400 Subject: [PATCH 0877/1127] don't harmonize geoscales when Location is in fill_cols; don't merge on location --- flowsa/flowby.py | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 8d280f784..a9a83917e 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -908,7 +908,11 @@ def harmonize_geoscale( fb_geoscale = geo.scale.from_string(self.config['geoscale']) other_geoscale = geo.scale.from_string(other.config['geoscale']) - if other_geoscale < fb_geoscale: + fill_cols = self.config.get('fill_columns') + if 'Location' in fill_cols: + # Don't harmonize geoscales when updating Location + pass + elif other_geoscale < fb_geoscale: log.info('Aggregating %s from %s to %s', other.full_name, other_geoscale, fb_geoscale) other = ( @@ -935,7 +939,6 @@ def harmonize_geoscale( if attribution_cols is not None: subset_cols = subset_cols + attribution_cols groupby_cols = subset_cols + attribution_cols - fill_cols = self.config.get('fill_columns') if fill_cols is not None: subset_cols = subset_cols + [fill_cols] groupby_cols = groupby_cols + [fill_cols] @@ -1060,14 +1063,25 @@ def proportionally_attribute( log.info(f'Proportionally attributing on {attribute_cols}') + # TODO turn off use of Location as merge col temporarily + # merged = ( + # fb + # .merge(other, + # how='left', + # left_on=attribute_cols + ['temp_location' if + # 'temp_location' in fb else + # 'Location'], + # right_on=attribute_cols + ['Location'], + # suffixes=[None, '_other']) + # .fillna({'FlowAmount_other': 0}) + # ) + merged = ( fb .merge(other, how='left', - left_on=attribute_cols + ['temp_location' if - 'temp_location' in fb else - 'Location'], - right_on=attribute_cols + ['Location'], + left_on=attribute_cols, + right_on=attribute_cols, suffixes=[None, '_other']) .fillna({'FlowAmount_other': 0}) ) From c63e23b68918b8f07f6828ba7ac85547f5d525ed Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 1 Sep 2023 12:34:36 -0400 Subject: [PATCH 0878/1127] validate for each attribution method separately --- flowsa/flowby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index a9a83917e..8b60d479c 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -632,7 +632,6 @@ def attribute_flows_to_sectors( from flowsa.flowbyactivity import FlowByActivity - validate = True # look for the "attribute" key in the FBS yaml, which will exist if # there are multiple, non-recursive attribution methods applied to a # data source @@ -647,6 +646,7 @@ def attribute_flows_to_sectors( attribute_config = [attribute_config] for step_config in attribute_config: + validate = True grouped: 'FB' = ( self .reset_index(drop=True).reset_index() From 549fdffd2db835587885883a6f822bd1bcf5716d Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 1 Sep 2023 13:02:59 -0400 Subject: [PATCH 0879/1127] update merge columns when Location is in `fill_columns` --- flowsa/flowby.py | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 8b60d479c..fb048a5cf 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1062,26 +1062,18 @@ def proportionally_attribute( attribute_cols = self.config.get('attribute_on') log.info(f'Proportionally attributing on {attribute_cols}') - - # TODO turn off use of Location as merge col temporarily - # merged = ( - # fb - # .merge(other, - # how='left', - # left_on=attribute_cols + ['temp_location' if - # 'temp_location' in fb else - # 'Location'], - # right_on=attribute_cols + ['Location'], - # suffixes=[None, '_other']) - # .fillna({'FlowAmount_other': 0}) - # ) - + left_on = attribute_cols + ['temp_location' if 'temp_location' + in fb else 'Location'] + right_on = attribute_cols + ['Location'] + for l in (left_on, right_on): + if 'Location' in self.config.get('fill_columns', []): + l.remove('Location') merged = ( fb .merge(other, how='left', - left_on=attribute_cols, - right_on=attribute_cols, + left_on=left_on, + right_on=right_on, suffixes=[None, '_other']) .fillna({'FlowAmount_other': 0}) ) From fbdab1937879c9349764483dc1fbc07ddce8be5e Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 1 Sep 2023 11:13:28 -0600 Subject: [PATCH 0880/1127] in sector_aggregation() add option to manually set the industry_spec --- flowsa/flowbysector.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/flowsa/flowbysector.py b/flowsa/flowbysector.py index 9c0c9cc48..fafbfa34c 100644 --- a/flowsa/flowbysector.py +++ b/flowsa/flowbysector.py @@ -212,14 +212,16 @@ def generateFlowBySector( return fbs - def sector_aggregation(self): + def sector_aggregation(self, industry_spec=None): """ In the event activity sets in an FBS are at a less aggregated target sector level than the overall target level, aggregate the sectors to the FBS target scale :return: """ - naics_key = naics.industry_spec_key(self.config['industry_spec']) + if industry_spec is None: + industry_spec = self.config['industry_spec'] + naics_key = naics.industry_spec_key(industry_spec) fbs = self for direction in ['ProducedBy', 'ConsumedBy']: From 143cd545633da6f54497fb4a4ff90bd51b4aa6ac Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 1 Sep 2023 13:16:06 -0400 Subject: [PATCH 0881/1127] fix TypeError --- flowsa/flowby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index fb048a5cf..60f7c8b74 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -909,7 +909,7 @@ def harmonize_geoscale( other_geoscale = geo.scale.from_string(other.config['geoscale']) fill_cols = self.config.get('fill_columns') - if 'Location' in fill_cols: + if fill_cols and 'Location' in fill_cols: # Don't harmonize geoscales when updating Location pass elif other_geoscale < fb_geoscale: From 66f9b5aca8b5fa709d56290f3ada4ace9024fd42 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 1 Sep 2023 11:17:17 -0600 Subject: [PATCH 0882/1127] new fxn to compare the sector and flow totals of national vs state FBS --- flowsa/validation.py | 75 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/flowsa/validation.py b/flowsa/validation.py index 013ef02c1..604bb90db 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -279,6 +279,81 @@ def compare_FBS(df1, df2, ignore_metasources=False): return df_m +def compare_national_state_fbs(dataname=None, year=None, method=None, + nationalname=None, statename=None): + """ + Developed to compare national and state FBS. Either include + dataname/year/method OR specify nationalname/statename if want to + compare specific githash versions of the FBS + + :param dataname: str, Only want the beginning of the flowname, so for + example, in "Water_national_2015", the dataname is "Water" + :param year: str, method year + :param method: str, if there is a method, include here + :param nationalname: str, name of national method, can include version + and githash + :param statename: str, name of national method, can include version + and githash + :return: + """ + # declare string versions of national and state dataframes + if nationalname is not None: + n = nationalname + s = statename + else: + if method is None: + method = '' + else: + method = f'_{method}' + + n = f'{dataname}_national_{year}{method}' + s = f'{dataname}_state_{year}{method}' + + # load the FBS as dataframes + national = FlowBySector.getFlowBySector(n) + state = FlowBySector.getFlowBySector(s) + + # load state level target sectors - assumption state will always be + # equal or more aggregated than national + state_target = state.config['industry_spec'] + + groupby_fields = ['Flowable','Context','SectorProducedBy', 'SectorConsumedBy', + 'Unit', 'Location', 'FlowUUID'] + subset_fields = groupby_fields + ['FlowAmount'] + + # attribute national data to state level target sectors, subset df, + # and aggregate + national_agg = ( + national + .sector_aggregation(industry_spec=state_target)[subset_fields] + .aggregate_flowby() + ) + + # attribute state data to national location, subset df, + # and aggregate + state_agg = ( + state + .convert_fips_to_geoscale(target_geoscale='national')[subset_fields] + .aggregate_flowby() + ) + + # compare FBS results + sectors = pd.DataFrame( + national_agg + .merge(state_agg, how='outer', on=groupby_fields) + .rename(columns={'FlowAmount_x':'national', + 'FlowAmount_y':'state'})) + sectors['comp'] = sectors['state'].fillna(0) / sectors['national'] + + flows = ( + sectors + .groupby('Flowable').agg({'state':'sum','national':'sum'}) + .reset_index()) + flows['comp'] = round(flows['state'] / flows['national'], 3) + + return sectors, flows + + def compare_geographic_totals( df_subset, df_load, sourcename, attr, activity_set, activity_names, df_type='FBA', subnational_geoscale=None From 5788cdbcc5f26b21d2aa8f9f87751e02f21cd75b Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 1 Sep 2023 13:42:35 -0400 Subject: [PATCH 0883/1127] add additional activity sets for testing --- .../EPA_StateGHGI_asets.csv | 8 +-- .../GHG_state_2019_m2.yaml | 57 +++++++++++++++++++ 2 files changed, 61 insertions(+), 4 deletions(-) diff --git a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv index ac6dcd949..cc71df63b 100644 --- a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv @@ -1,8 +1,8 @@ activity_set,name,note -direct,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Direct - Cropland,EPA_GHGI_T_5_18 -direct,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Direct - Grassland,EPA_GHGI_T_5_18 -direct,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Indirect - Cropland,EPA_GHGI_T_5_19 -direct,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Indirect - Grassland,EPA_GHGI_T_5_19 +n2o_soil_direct,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Direct - Cropland,EPA_GHGI_T_5_18 +n2o_soil_direct,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Direct - Grassland,EPA_GHGI_T_5_18 +n2o_soil,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Indirect - Cropland,EPA_GHGI_T_5_19 +n2o_soil,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Indirect - Grassland,EPA_GHGI_T_5_19 direct,Agriculture - Enteric Fermentation - American Bison,EPA_GHGI_T_5_3 direct,Agriculture - Enteric Fermentation - Beef Cattle,EPA_GHGI_T_5_3 direct,Agriculture - Enteric Fermentation - Dairy Cattle,EPA_GHGI_T_5_3 diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml index 7f48d2b4e..c4335947c 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml @@ -40,6 +40,7 @@ source_names: - Wastewater Treatment #CH4, N2O - Zinc Production #CO2 FlowName: ["CO2", "CH4", "N2O"] # HFCs and other flows are pulled elsewhere + attribute: - attribution_method: direct - attribution_method: proportional @@ -51,3 +52,59 @@ source_names: fedefl_mapping: GHGI selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct + + +## Fossil Fuels + EPA_GHGI_T_3_68: &natgas #CH4 from Natural Gas Systems + year: *ghg_year + geoscale: national + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + - Distribution + - Distribution - Post-Meter + - Exploration + - Processing + - Production + - Transmission and Storage + attribute: + - attribution_method: direct + - attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ng_systems + + EPA_GHGI_T_5_17: #Direct N2O emissions from agricultural soils + year: *ghg_year + geoscale: national + fedefl_mapping: GHGI + activity_sets: + fertilizer_use: &fertilizer # allocated based on fertilizer use + selection_fields: + PrimaryActivity: + - Organic Amendment Cropland + - Residue N Cropland + - Synthetic Fertilizer Cropland + attribute: + - attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + year: 2012 + activity_to_sector_mapping: BEA_2012_Detail + attribution_method: equal + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + - attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv n2o_soil_direct From 9c6dd380632a14da9e67fadca35477833d11486c Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 1 Sep 2023 13:42:50 -0400 Subject: [PATCH 0884/1127] allow comparison of metasources --- flowsa/validation.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/flowsa/validation.py b/flowsa/validation.py index 604bb90db..e6e3069ae 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -280,7 +280,8 @@ def compare_FBS(df1, df2, ignore_metasources=False): def compare_national_state_fbs(dataname=None, year=None, method=None, - nationalname=None, statename=None): + nationalname=None, statename=None, + compare_metasources=False): """ Developed to compare national and state FBS. Either include dataname/year/method OR specify nationalname/statename if want to @@ -294,6 +295,7 @@ def compare_national_state_fbs(dataname=None, year=None, method=None, and githash :param statename: str, name of national method, can include version and githash + :param compare_metasources: bool, include MetaSources in the comparion :return: """ # declare string versions of national and state dataframes @@ -319,6 +321,8 @@ def compare_national_state_fbs(dataname=None, year=None, method=None, groupby_fields = ['Flowable','Context','SectorProducedBy', 'SectorConsumedBy', 'Unit', 'Location', 'FlowUUID'] + if compare_metasources: + groupby_fields = groupby_fields + ['MetaSources'] subset_fields = groupby_fields + ['FlowAmount'] # attribute national data to state level target sectors, subset df, @@ -342,7 +346,8 @@ def compare_national_state_fbs(dataname=None, year=None, method=None, national_agg .merge(state_agg, how='outer', on=groupby_fields) .rename(columns={'FlowAmount_x':'national', - 'FlowAmount_y':'state'})) + 'FlowAmount_y':'state'}) + .drop(columns='Location')) sectors['comp'] = sectors['state'].fillna(0) / sectors['national'] flows = ( From 43b74737837dcb5979be576b4ce1c516dbac3ffb Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 1 Sep 2023 11:50:48 -0600 Subject: [PATCH 0885/1127] load config file if git version/hash is included in filename, but issue warning that the FBS method might have been created using a different yaml --- flowsa/common.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/flowsa/common.py b/flowsa/common.py index 1a8d82e26..d77cb961c 100644 --- a/flowsa/common.py +++ b/flowsa/common.py @@ -6,6 +6,7 @@ import os from os import path +import re import yaml import pandas as pd import numpy as np @@ -120,6 +121,18 @@ def load_yaml_dict(filename, flowbytype=None, filepath=None): or FBS files :return: dictionary containing all information in yaml """ + # check if the version and githash are included in the filename, if so, + # drop, but return warning that we might be loading a revised version of + # the config file. The pattern looks for a "_v" followed by a number + # between [0-9] followed by a decimal + pattern = '_v[0-9].*' + if re.search(pattern, filename): + log.warning('Filename includes a github version and githash. Dropping ' + 'the version and hash to load most up-to-date yaml config ' + 'file. The yaml config file might not reflect the yaml used ' + 'to generate the dataframe') + filename = re.sub(pattern,'', filename) + if filename in ['source_catalog']: folder = datapath else: From acfb11fc454ab89255b9e52c0341096c22b80579 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 1 Sep 2023 14:02:29 -0400 Subject: [PATCH 0886/1127] implement include statements --- .../GHG_state_2019_m2.yaml | 52 ++----------------- 1 file changed, 4 insertions(+), 48 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml index c4335947c..fa2082a2e 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml @@ -13,34 +13,7 @@ source_names: geoscale: national activity_sets: direct: - selection_fields: - PrimaryActivity: - - Abandoned Oil and Gas Wells #CH4 - - Abandoned Underground Coal Mines #CH4 - - Adipic Acid Production #N2O - - Aluminum Production #CO2 - - Ammonia Production #CO2 - - Anaerobic Digestion at Biogas Facilities #CH4 new activity - - Caprolactam, Glyoxal, and Glyoxylic Acid Production #N2O - - Carbide Production and Consumption #CO2, CH4 - - Cement Production #CO2 - - Coal Mining #CO2, CH4 - - Composting #CH4, N2O - - Ferroalloy Production #CO2, CH4 - - Glass Production #CO2 - - Landfills #CH4 - - Lime Production #CO2 - - Incineration of Waste #CO2, #N2O - - Iron and Steel Production & Metallurgical Coke Production #CO2, CH4 - - Nitric Acid Production #N2O - - Phosphoric Acid Production #CO2 - - Rice Cultivation #CH4 - - Soda Ash Production #CO2 - - Titanium Dioxide Production #CO2 - - Wastewater Treatment #CH4, N2O - - Zinc Production #CO2 - FlowName: ["CO2", "CH4", "N2O"] # HFCs and other flows are pulled elsewhere - + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:direct attribute: - attribution_method: direct - attribution_method: proportional @@ -56,17 +29,9 @@ source_names: ## Fossil Fuels EPA_GHGI_T_3_68: &natgas #CH4 from Natural Gas Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghg_year geoscale: national - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: - - Distribution - - Distribution - Post-Meter - - Exploration - - Processing - - Production - - Transmission and Storage attribute: - attribution_method: direct - attribution_method: proportional @@ -85,20 +50,11 @@ source_names: fedefl_mapping: GHGI activity_sets: fertilizer_use: &fertilizer # allocated based on fertilizer use - selection_fields: - PrimaryActivity: - - Organic Amendment Cropland - - Residue N Cropland - - Synthetic Fertilizer Cropland + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets:fertilizer_use attribute: - attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: - year: 2012 - activity_to_sector_mapping: BEA_2012_Detail - attribution_method: equal - selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets:fertilizer_use:attribution_source - attribution_method: proportional attribute_on: ['Flowable', 'SectorProducedBy'] fill_columns: Location From 763888dfd07939f2551e0deac3c1f2f744186f90 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 1 Sep 2023 14:22:57 -0400 Subject: [PATCH 0887/1127] add 2_1 tables, update state activity sets to align names --- .../EPA_StateGHGI_asets.csv | 28 ++--- .../GHG_state_2019_m2.yaml | 110 ++++++++++++++++++ 2 files changed, 124 insertions(+), 14 deletions(-) diff --git a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv index cc71df63b..b8aa01855 100644 --- a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv @@ -32,8 +32,8 @@ direct,Agriculture - Field Burning of Agricultural Residues - Sunflower,EPA_GHGI direct,Agriculture - Field Burning of Agricultural Residues - Tobacco,EPA_GHGI_T_5_29 direct,Agriculture - Field Burning of Agricultural Residues - Vegetables,EPA_GHGI_T_5_29 direct,Agriculture - Field Burning of Agricultural Residues - Wheat,EPA_GHGI_T_5_29 -use_table_chem,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Dolomite",EPA_GHGI_T_2_1 -use_table_chem,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Limestone",EPA_GHGI_T_2_1 +liming,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Dolomite",EPA_GHGI_T_2_1 +liming,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Limestone",EPA_GHGI_T_2_1 direct,Agriculture - Manure Management - American Bison,EPA_GHGI_T_2_1 direct,Agriculture - Manure Management - Beef Cattle,EPA_GHGI_T_5_7 direct,Agriculture - Manure Management - Bison,EPA_GHGI_T_5_7 @@ -46,7 +46,7 @@ direct,Agriculture - Manure Management - Poultry,EPA_GHGI_T_5_7 direct,Agriculture - Manure Management - Sheep,EPA_GHGI_T_5_7 direct,Agriculture - Manure Management - Swine,EPA_GHGI_T_5_7 direct,Agriculture - Rice Cultivation,EPA_GHGI_T_2_1 -ag,"Agriculture - Urea Fertilization - CO2 emissions from liming, urea application and other carbon-containing fertilizers",EPA_GHGI_T_2_1 +urea,"Agriculture - Urea Fertilization - CO2 emissions from liming, urea application and other carbon-containing fertilizers",EPA_GHGI_T_2_1 direct,Industry - Abandoned Oil and Gas Wells - Fugitive - Abandoned Wells, direct,Industry - Abandoned Underground Coal Mines - Fugitive - Coal Mining - Abandoned Coal Mines - Liberated,EPA_GHGI_T_2_1 direct,Industry - Abandoned Underground Coal Mines - Fugitive - Coal Mining - Abandoned Coal Mines - Recovered &Used,EPA_GHGI_T_2_1 @@ -61,11 +61,11 @@ commercial_ch4_n2o,Commercial - Stationary Combustion - Fossil Fuel Combustion, use_table_coal,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,EPA_GHGI_T_A_14 use_table_gas,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,EPA_GHGI_T_A_14 use_table_pet,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,EPA_GHGI_T_A_14 -make_table_elec,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation, -make_table_elec,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Coal, -make_table_elec,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Geothermal, -make_table_elec,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Natural Gas, -make_table_elec,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum, +electric_power,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation, +electric_power,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Coal, +electric_power,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Geothermal, +electric_power,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Natural Gas, +electric_power,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum, industrial_ch4_n2o,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial, industrial_coal,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal - Manufacturing,EPA_GHGI_T_A_14 use_table_coal,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal, @@ -115,7 +115,7 @@ direct,Industry - Phosphoric Acid Production - Chemical Industry,EPA_GHGI_T_2_1 direct,Industry - Carbide Production and Consumption - Chemical Industry - Silicon Carbide Production and Consumption,EPA_GHGI_T_2_1 direct,Industry - Soda Ash Production - Chemical Industry,EPA_GHGI_T_2_1 direct,Industry - Titanium Dioxide Production - Chemical Industry,EPA_GHGI_T_2_1 -use_table_chem,Industry - Urea Consumption for Non-Agricultural Purposes - Chemical Industry - Urea Consumption for Non-Agricultural Uses,EPA_GHGI_T_2_1 +urea,Industry - Urea Consumption for Non-Agricultural Purposes - Chemical Industry - Urea Consumption for Non-Agricultural Uses,EPA_GHGI_T_2_1 direct,Industry - Electronics Industry - Micro-Electro-Mechanical Devices, direct,Industry - Electronics Industry - Photovoltaics, direct,Industry - Electronics Industry - Semiconductor Manufacture, @@ -128,16 +128,16 @@ direct,Industry - Iron and Steel Production - Metal Industry - Other Activities, direct,Industry - Iron and Steel Production - Metal Industry - Pellet Production,EPA_GHGI_T_2_1 direct,Industry - Iron and Steel Production - Metal Industry - Sinter Production,EPA_GHGI_T_2_1 direct,Industry - Iron and Steel Production - Metal Industry - Steel Production,EPA_GHGI_T_2_1 -direct,Industry - Lead Production - Metal Industry,EPA_GHGI_T_2_1 +lead,Industry - Lead Production - Metal Industry,EPA_GHGI_T_2_1 direct,Industry - Magnesium Production and Processing - Metal Industry,EPA_GHGI_T_4_84 direct,Industry - Zinc Production - Metal Industry,EPA_GHGI_T_2_1 exclude,Industry - Carbon Dioxide Consumption - Mineral Industry,Excluded from national model direct,Industry - Cement Production - Mineral Industry - Cement Manufacture,EPA_GHGI_T_2_1 direct,Industry - Glass Production - Mineral Industry,EPA_GHGI_T_2_1 direct,Industry - Lime Production - Mineral Industry - Lime Manufacture,EPA_GHGI_T_2_1 -use_table_chem,Industry - Other Process Uses of Carbonates - Mineral Industry,EPA_GHGI_T_2_1 -direct,Electric Power Industry - Electrical Transmission and Distribution - Other product manufacture and use - Electric Power Systems, -direct,Electric Power Industry - Electrical Transmission and Distribution - Other product manufacture and use - Equipment OEM, +carbonate_use,Industry - Other Process Uses of Carbonates - Mineral Industry,EPA_GHGI_T_2_1 +electricity_transmission,Electric Power Industry - Electrical Transmission and Distribution - Other product manufacture and use - Electric Power Systems, +electricity_transmission,Electric Power Industry - Electrical Transmission and Distribution - Other product manufacture and use - Equipment OEM, direct,Industry - HCFC-22 Production - Production and Use of Fluorinated Gases,EPA_GHGI_T_4_50 direct,Commercial - Composting,EPA_GHGI_T_2_1 direct,Commercial - Anaerobic Digestion at Biogas Facility - Anaerobic Digestion at Biogas Facilities,EPA_GHGI_T_2_1 @@ -152,4 +152,4 @@ transport_machinery,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobi direct,Electric Power Industry - Other Process Uses of Carbonates - Mineral Industry, transport_nonroad,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other, industrial_ch4_n2o,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,negative emissions; align with 'Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial' to avoid double counting -use_table_chem,Industry - N2O from Product Uses - Other product manufacture and use,EPA_GHGI_T_2_1 +nitrous_oxide_use,Industry - N2O from Product Uses - Other product manufacture and use,EPA_GHGI_T_2_1 diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml index fa2082a2e..5c88763c7 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml @@ -26,6 +26,116 @@ source_names: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct + electricity_transmission: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electricity_transmission + attribute: + - attribution_method: direct + - attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv electricity_transmission + + electric_power: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power + attribute: + - attribution_method: proportional + attribution_source: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power:attribution_source + - attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv electric_power + + liming: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming + attribute: + - attribution_method: proportional + attribution_source: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming:attribution_source + - attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv liming + + urea: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea + attribute: + - attribution_method: proportional + attribution_source: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea:attribution_source + - attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv urea + + carbonate_use: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use + attribute: + - attribution_method: proportional + attribution_source: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use:attribution_source + - attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv carbonate_use + + lead: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead + attribute: + - attribution_method: proportional + attribution_source: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source + - attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv lead + + nitrous_oxide_use: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use + attribute: + - attribution_method: proportional + attribution_source: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use:attribution_source + - attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv nitrous_oxide_use + ## Fossil Fuels EPA_GHGI_T_3_68: &natgas #CH4 from Natural Gas Systems From df67358132c447cf39ac27fccf72211845be2b34 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 1 Sep 2023 15:04:32 -0400 Subject: [PATCH 0888/1127] add CO2 mobile combustion, split NG-based flows from national model to attribute separately for states --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 9 ++-- .../EPA_StateGHGI_asets.csv | 2 +- .../GHG_national_m1_common.yaml | 9 ++-- .../GHG_state_2019_m2.yaml | 49 +++++++++++++++++++ 4 files changed, 60 insertions(+), 9 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index 125ae60c6..8bd6d774c 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -170,14 +170,13 @@ EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Oth EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway,NAICS_2012_Code,491,,transport_petroleum EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway,NAICS_2012_Code,492,,transport_petroleum EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway,NAICS_2012_Code,F010,,transport_petroleum -EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,481,,transport_petroleum -EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,482,,transport_petroleum -EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,483,,transport_petroleum -EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,484,,transport_petroleum -EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,485,,transport_petroleum +EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,48,,transport_petroleum EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,491,,transport_petroleum +EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,492,,transport_petroleum +EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,922,,transport_petroleum EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,928,,transport_petroleum EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,F010,,transport_petroleum +EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,S00201,,transport_petroleum EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,NAICS_2012_Code,484,,transport_diesel EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,NAICS_2012_Code,F010,,transport_gasoline EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Non-Highway,NAICS_2012_Code,481,,transport_nonroad diff --git a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv index b8aa01855..88b7f2693 100644 --- a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv @@ -90,7 +90,7 @@ exclude,U.S. Territories - CO2 from Fossil Fuel Combustion - Fossil Fuel Combust direct,Electric Power Industry - Incineration of Waste - Incineration,EPA_GHGI_T_2_1 ng_systems,Industry - Natural Gas Systems - Fugitive,EPA_GHGI_T_3_63 industrial_neu,Industry - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - Industrial,EPA_GHGI_T_A_14 -transport_petroleum,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels, +transport_petroleum-UPDATENAME,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels, exclude,U.S. Territories - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - US Territories, pet_systems,Industry - Petroleum Systems - Fugitive,EPA_GHGI_T_3_38 use_table_pet,Agriculture - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary, diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml index f32e3bc25..63d985f01 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml @@ -292,7 +292,7 @@ source_names: EPA_GHGI_T_3_13: #CO2 from mobile combustion fedefl_mapping: GHGI activity_sets: - direct_attribution: + direct_petroleum: selection_fields: PrimaryActivity: General Aviation Aircraft Aviation Gasoline: General Aviation Aircraft @@ -301,8 +301,6 @@ source_names: Military Aircraft Jet Fuel: Military Aircraft Buses Gasoline: Buses Buses LPG: Buses - Buses Natural Gas: Buses - Pipeline Natural Gas: Pipeline Natural Gas Motorcycles Gasoline: Motorcycles Rail Distillate Fuel Oil: Rail Recreational Boats Distillate Fuel Oil: Recreational Boats @@ -314,6 +312,11 @@ source_names: Light-Duty Trucks LPG: Light-Duty Trucks - Households Passenger Cars LPG: Passenger Cars - Households attribution_method: direct + direct_ng: + selection_fields: + PrimaryActivity: + Buses Natural Gas: Buses + Pipeline Natural Gas: Pipeline Natural Gas petroleum_fuels: selection_fields: diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml index 5c88763c7..0d542820a 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml @@ -174,3 +174,52 @@ source_names: fedefl_mapping: GHGI selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv n2o_soil_direct + +## Mobile Sources + EPA_GHGI_T_3_13: #CO2 from mobile combustion + year: *ghg_year + geoscale: national + fedefl_mapping: GHGI + activity_sets: + direct_petroleum: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:direct_petroleum + attribute: + - attribution_method: direct + - attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_petroleum + direct_ng: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:direct_ng + attribute: + - attribution_method: direct + - attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_ng + + petroleum_fuels: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels + attribute: + - attribution_method: proportional + attribution_source: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source + - attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_petroleum From 53581d647e49dcceb6e58dc79f5823f4fb67a153 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 1 Sep 2023 15:43:36 -0400 Subject: [PATCH 0889/1127] add stationary combustion CO2 --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 12 +- .../EPA_StateGHGI_asets.csv | 8 +- .../GHG_state_2019_m2.yaml | 111 ++++++++++++++++++ 3 files changed, 120 insertions(+), 11 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index 8bd6d774c..107c659be 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -142,15 +142,15 @@ EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossi EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,31,,industrial_ch4_n2o EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,32,,industrial_ch4_n2o EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,33,,industrial_ch4_n2o -EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal - Manufacturing,NAICS_2012_Code,31,,industrial_coal -EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal - Manufacturing,NAICS_2012_Code,32,,industrial_coal -EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal - Manufacturing,NAICS_2012_Code,33,,industrial_coal +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,31,,use_table_coal +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,32,,use_table_coal +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,33,,use_table_coal EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,11,,use_table_coal EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,21,,use_table_coal EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,23,,use_table_coal -EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas - Manufacturing,NAICS_2012_Code,31,,industrial_gas -EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas - Manufacturing,NAICS_2012_Code,32,,industrial_gas -EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas - Manufacturing,NAICS_2012_Code,33,,industrial_gas +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,31,,use_table_gas +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,32,,use_table_gas +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,33,,use_table_gas EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,11,,use_table_gas EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,21,,use_table_gas EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,23,,use_table_gas diff --git a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv index 88b7f2693..3975097be 100644 --- a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv @@ -67,15 +67,13 @@ electric_power,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossi electric_power,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Natural Gas, electric_power,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum, industrial_ch4_n2o,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial, -industrial_coal,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal - Manufacturing,EPA_GHGI_T_A_14 use_table_coal,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal, -industrial_gas,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas - Manufacturing,EPA_GHGI_T_A_14 use_table_gas,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas, use_table_pet,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,EPA_GHGI_T_A_14 direct,Residential - Stationary Combustion - Fossil Fuel Combustion, -direct,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal, -direct,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas, -direct,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum, +residential_co2,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal, +residential_co2,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas, +residential_co2,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum, direct,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal, transport_ng,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,EPA_GHGI_T_A_14 transport_petroleum,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway, diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml index 0d542820a..6b8fd62c0 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml @@ -3,6 +3,7 @@ !include:USEEIO_summary_target.yaml year: &ghg_year 2019 +mecs_year: &mecs_year 2018 geoscale: state @@ -223,3 +224,113 @@ source_names: fedefl_mapping: GHGI selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_petroleum + +## Stationary Combustion + EPA_GHGI_T_A_6: # CO2 emissions from stationary combustion + year: *ghg_year + geoscale: national + fedefl_mapping: GHGI + clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion + clean_parameter: # Override each year for use in allocate_industrial_combustion + energy_fba: 'EIA_MECS_Energy' + year: *mecs_year + ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table + activity_sets: + direct_attribution: #direct allocation + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:direct_attribution + attribute: + - attribution_method: direct + - attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv residential_co2 + + non-manufacturing_coal: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:non-manufacturing_coal + attribute: + - attribution_method: proportional + attribution_source: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:non-manufacturing_coal:attribution_source + - attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_coal + + non-manufacturing_natural_gas: # Applies to non-manufacturing sectors like ag and mining + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:non-manufacturing_natural_gas + attribute: + - attribution_method: proportional + attribution_source: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:non-manufacturing_natural_gas:attribution_source + - attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_gas + + coal_manufacturing: # Industrial Coal for Manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing + attribute: + - attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + - attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_coal + + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing + attribute: + - attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + - attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_gas + + + petroleum: # Petroleum + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:petroleum + attribute: + - attribution_method: proportional + attribution_source: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:petroleum:attribution_source + - attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_pet From 5fa50c361972605aac82738aceb2ad639ae02aa8 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 1 Sep 2023 14:00:08 -0600 Subject: [PATCH 0890/1127] revise employment state FBS to proportionally attribute national level FBS to states using BLS QCEW data --- .../flowbysectormethods/Employment_state_2015.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2015.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2015.yaml index 7f29be2ab..fa7ada483 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2015.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2015.yaml @@ -4,7 +4,12 @@ target_naics_year: 2012 geoscale: state source_names: - "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state - year: 2015 - activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation + Employment_national_2015: + attribution_method: proportional + attribute_on: ['SectorProducedBy'] + fill_columns: Location + attribution_source: + BLS_QCEW: !include:Employment_common.yaml:bls_load_and_clean_state + year: 2015 + activity_sets: + qcew: !include:Employment_common.yaml:bls_allocation From 2ed2a90911e0cc82d4d43261ca8c34e28a5725c7 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 1 Sep 2023 16:10:13 -0400 Subject: [PATCH 0891/1127] add additional activities for CO2 --- .../EPA_StateGHGI_asets.csv | 12 +++--- .../GHG_state_2019_m2.yaml | 41 +++++++++++++++++++ 2 files changed, 47 insertions(+), 6 deletions(-) diff --git a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv index 3975097be..d9dd33e28 100644 --- a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv @@ -103,12 +103,12 @@ direct,Industry - Adipic Acid Production - Chemical Industry,EPA_GHGI_T_2_1 direct,Industry - Ammonia Production - Chemical Industry,EPA_GHGI_T_2_1 direct,"Industry - Caprolactam, Glyoxal,and Glyoxylic Acid Production - Chemical Industry - Caprolactam Production",EPA_GHGI_T_2_1 direct,Industry - Nitric Acid Production - Chemical Industry,EPA_GHGI_T_2_1 -direct,Industry - Petrochemical Production - Chemical Industry - Acrylonitrile,EPA_GHGI_T_4_46 -direct,Industry - Petrochemical Production - Chemical Industry - Carbon Black,EPA_GHGI_T_4_46 -direct,Industry - Petrochemical Production - Chemical Industry - Ethylene,EPA_GHGI_T_4_46 -direct,Industry - Petrochemical Production - Chemical Industry - Ethylene Dichloride,EPA_GHGI_T_4_46 -direct,Industry - Petrochemical Production - Chemical Industry - Ethylene Oxide,EPA_GHGI_T_4_46 -direct,Industry - Petrochemical Production - Chemical Industry - Methanol,EPA_GHGI_T_4_46 +petrochemicals,Industry - Petrochemical Production - Chemical Industry - Acrylonitrile,EPA_GHGI_T_4_46 +petrochemicals,Industry - Petrochemical Production - Chemical Industry - Carbon Black,EPA_GHGI_T_4_46 +petrochemicals,Industry - Petrochemical Production - Chemical Industry - Ethylene,EPA_GHGI_T_4_46 +petrochemicals,Industry - Petrochemical Production - Chemical Industry - Ethylene Dichloride,EPA_GHGI_T_4_46 +petrochemicals,Industry - Petrochemical Production - Chemical Industry - Ethylene Oxide,EPA_GHGI_T_4_46 +petrochemicals,Industry - Petrochemical Production - Chemical Industry - Methanol,EPA_GHGI_T_4_46 direct,Industry - Phosphoric Acid Production - Chemical Industry,EPA_GHGI_T_2_1 direct,Industry - Carbide Production and Consumption - Chemical Industry - Silicon Carbide Production and Consumption,EPA_GHGI_T_2_1 direct,Industry - Soda Ash Production - Chemical Industry,EPA_GHGI_T_2_1 diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml index 6b8fd62c0..ab1e06089 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml @@ -154,7 +154,29 @@ source_names: fedefl_mapping: GHGI selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ng_systems + EPA_GHGI_T_3_70: *natgas #CO2 from Natural Gas Systems, mimics CH4 + EPA_GHGI_T_3_72: *natgas #N2O from Natural Gas Systems, mimics CH4 + + EPA_GHGI_T_3_42: &petroleum #CH4 from Petroleum Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 + year: *ghg_year + geoscale: national + attribute: + - attribution_method: direct + - attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv pet_systems + EPA_GHGI_T_3_44: *petroleum #CO2 from Petroleum Systems, mimics CH4 + EPA_GHGI_T_3_46: *petroleum #N2O from Petroleum Systems, mimics CH4 + +## Agriculture EPA_GHGI_T_5_17: #Direct N2O emissions from agricultural soils year: *ghg_year geoscale: national @@ -334,3 +356,22 @@ source_names: fedefl_mapping: GHGI selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_pet + +## Other sources + EPA_GHGI_T_4_46: #CO2 for selected petrochemicals + # TODO update this to use separate activity sets for each source + + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 + year: *ghg_year + geoscale: national + attribute: + - attribution_method: direct + - attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv petrochemicals From 8f22251dea8b036706012e27dae953f6ba0a1fd5 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 1 Sep 2023 15:17:05 -0600 Subject: [PATCH 0892/1127] update all state employment FBS to attribute national employment FBS to states using BLS QCEW --- .../methods/flowbysectormethods/Employment_common.yaml | 5 +++++ .../flowbysectormethods/Employment_state_2012.yaml | 10 ++++++---- .../flowbysectormethods/Employment_state_2013.yaml | 10 ++++++---- .../flowbysectormethods/Employment_state_2014.yaml | 10 ++++++---- .../flowbysectormethods/Employment_state_2015.yaml | 5 +---- .../flowbysectormethods/Employment_state_2016.yaml | 10 ++++++---- .../flowbysectormethods/Employment_state_2017.yaml | 10 ++++++---- .../flowbysectormethods/Employment_state_2018.yaml | 10 ++++++---- .../flowbysectormethods/Employment_state_2019.yaml | 10 ++++++---- .../flowbysectormethods/Employment_state_2020.yaml | 10 ++++++---- 10 files changed, 54 insertions(+), 36 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Employment_common.yaml b/flowsa/methods/flowbysectormethods/Employment_common.yaml index 1e2bce309..bc570e72b 100644 --- a/flowsa/methods/flowbysectormethods/Employment_common.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_common.yaml @@ -24,3 +24,8 @@ bls_allocation: selection_fields: PrimaryActivity: !from_index:BLS_QCEW_asets.csv qcew attribution_method: direct + +employment_fbs_allocation: + attribution_method: proportional + attribute_on: ['SectorProducedBy'] + fill_columns: Location diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2012.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2012.yaml index a7d9ec79f..2e32339f6 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2012.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2012.yaml @@ -4,7 +4,9 @@ target_naics_year: 2012 geoscale: state source_names: - "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state - year: 2012 - activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation + Employment_national_2012: !include:Employment_common.yaml:employment_fbs_allocation + attribution_source: + BLS_QCEW: !include:Employment_common.yaml:bls_load_and_clean_state + year: 2012 + activity_sets: + qcew: !include:Employment_common.yaml:bls_allocation diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2013.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2013.yaml index 1b01a69e9..33bbb7c1b 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2013.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2013.yaml @@ -4,7 +4,9 @@ target_naics_year: 2012 geoscale: state source_names: - "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state - year: 2013 - activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation + Employment_national_2013: !include:Employment_common.yaml:employment_fbs_allocation + attribution_source: + BLS_QCEW: !include:Employment_common.yaml:bls_load_and_clean_state + year: 2013 + activity_sets: + qcew: !include:Employment_common.yaml:bls_allocation diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2014.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2014.yaml index 720c725b1..bb5ba0d5c 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2014.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2014.yaml @@ -4,7 +4,9 @@ target_naics_year: 2012 geoscale: state source_names: - "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state - year: 2014 - activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation + Employment_national_2014: !include:Employment_common.yaml:employment_fbs_allocation + attribution_source: + BLS_QCEW: !include:Employment_common.yaml:bls_load_and_clean_state + year: 2014 + activity_sets: + qcew: !include:Employment_common.yaml:bls_allocation diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2015.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2015.yaml index fa7ada483..676b4f913 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2015.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2015.yaml @@ -4,10 +4,7 @@ target_naics_year: 2012 geoscale: state source_names: - Employment_national_2015: - attribution_method: proportional - attribute_on: ['SectorProducedBy'] - fill_columns: Location + Employment_national_2015: !include:Employment_common.yaml:employment_fbs_allocation attribution_source: BLS_QCEW: !include:Employment_common.yaml:bls_load_and_clean_state year: 2015 diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2016.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2016.yaml index 2a2c34b6a..4bdc777ca 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2016.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2016.yaml @@ -4,7 +4,9 @@ target_naics_year: 2012 geoscale: state source_names: - "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state - year: 2016 - activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation + Employment_national_2016: !include:Employment_common.yaml:employment_fbs_allocation + attribution_source: + BLS_QCEW: !include:Employment_common.yaml:bls_load_and_clean_state + year: 2016 + activity_sets: + qcew: !include:Employment_common.yaml:bls_allocation diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2017.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2017.yaml index 62fc70c15..636962d84 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2017.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2017.yaml @@ -4,7 +4,9 @@ target_naics_year: 2012 geoscale: state source_names: - "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state - year: 2017 - activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation + Employment_national_2017: !include:Employment_common.yaml:employment_fbs_allocation + attribution_source: + BLS_QCEW: !include:Employment_common.yaml:bls_load_and_clean_state + year: 2017 + activity_sets: + qcew: !include:Employment_common.yaml:bls_allocation diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2018.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2018.yaml index 6b3a53e50..d42a8c210 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2018.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2018.yaml @@ -4,7 +4,9 @@ target_naics_year: 2012 geoscale: state source_names: - "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state - year: 2018 - activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation + Employment_national_2018: !include:Employment_common.yaml:employment_fbs_allocation + attribution_source: + BLS_QCEW: !include:Employment_common.yaml:bls_load_and_clean_state + year: 2018 + activity_sets: + qcew: !include:Employment_common.yaml:bls_allocation diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2019.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2019.yaml index aa041a8c6..c946bbb7d 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2019.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2019.yaml @@ -4,7 +4,9 @@ target_naics_year: 2012 geoscale: state source_names: - "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state - year: 2019 - activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation + Employment_national_2019: !include:Employment_common.yaml:employment_fbs_allocation + attribution_source: + BLS_QCEW: !include:Employment_common.yaml:bls_load_and_clean_state + year: 2019 + activity_sets: + qcew: !include:Employment_common.yaml:bls_allocation diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2020.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2020.yaml index 284ba044d..2c7e6e0be 100644 --- a/flowsa/methods/flowbysectormethods/Employment_state_2020.yaml +++ b/flowsa/methods/flowbysectormethods/Employment_state_2020.yaml @@ -4,7 +4,9 @@ target_naics_year: 2012 geoscale: state source_names: - "BLS_QCEW": !include:Employment_common.yaml:bls_load_and_clean_state - year: 2020 - activity_sets: - qcew: !include:Employment_common.yaml:bls_allocation + Employment_national_2020: !include:Employment_common.yaml:employment_fbs_allocation + attribution_source: + BLS_QCEW: !include:Employment_common.yaml:bls_load_and_clean_state + year: 2020 + activity_sets: + qcew: !include:Employment_common.yaml:bls_allocation From bd4304fc7a8462ed1f857d0f341e5ba57b3bf95a Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 4 Sep 2023 09:05:32 -0400 Subject: [PATCH 0893/1127] add sample GHG_state_m3 from FBS --- .../GHG_state_2019_m3.yaml | 265 ++++++++++++++++++ 1 file changed, 265 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml new file mode 100644 index 000000000..ad9d4f0d2 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml @@ -0,0 +1,265 @@ + + + +!include:USEEIO_summary_target.yaml +year: &ghg_year 2019 +geoscale: state + + +source_names: + GHG_national_2019: #U.S. GHG emissions + year: *ghg_year + fedefl_mapping: GHGI + data_format: FBS + geoscale: national + activity_sets: + direct: + selection_fields: + MetaSources: 'EPA_GHGI_T_2_1.direct' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct + + electric_power: + selection_fields: + MetaSources: 'EPA_GHGI_T_2_1.electric_power' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv electric_power + + liming: + selection_fields: + MetaSources: 'EPA_GHGI_T_2_1.liming' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv liming + + urea: + selection_fields: + MetaSources: 'EPA_GHGI_T_2_1.urea' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv urea + + + carbonate_use: + selection_fields: + MetaSources: 'EPA_GHGI_T_2_1.carbonate_use' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv carbonate_use + + + + lead: + selection_fields: + MetaSources: 'EPA_GHGI_T_2_1.lead' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv lead + + + + nitrous_oxide_use: + selection_fields: + MetaSources: 'EPA_GHGI_T_2_1.nitrous_oxide_use' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv nitrous_oxide_use + + + + EPA_GHGI_T_3_68: + selection_fields: + MetaSources: + - 'EPA_GHGI_T_3_68' + - 'EPA_GHGI_T_3_70' + - 'EPA_GHGI_T_3_72' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ng_systems + + + + + EPA_GHGI_T_3_42: + selection_fields: + MetaSources: + - 'EPA_GHGI_T_3_42' + - 'EPA_GHGI_T_3_44' + - 'EPA_GHGI_T_3_46' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv pet_systems + + + + + fertilizer_use: + selection_fields: + MetaSources: 'EPA_GHGI_T_5_17.fertilizer_use' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv n2o_soil_direct + + + + + direct_petroleum: + selection_fields: + MetaSources: + - 'EPA_GHGI_T_3_13.direct_petroleum' + - 'EPA_GHGI_T_3_13.petroleum_fuels' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_petroleum + + + + + direct_ng: + selection_fields: + MetaSources: 'EPA_GHGI_T_3_13.direct_ng' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_ng + + + + + direct_attribution: + selection_fields: + MetaSources: 'EPA_GHGI_T_A_6.direct_attribution' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv residential_co2 + + + + + coal: + selection_fields: + MetaSources: + - 'EPA_GHGI_T_A_6.non-manufacturing_coal' + - 'EPA_GHGI_T_A_6.coal_manufacturing' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_coal + + natural_gas: + selection_fields: + MetaSources: + - 'EPA_GHGI_T_A_6.non-manufacturing_natural_gas' + - 'EPA_GHGI_T_A_6.natural_gas_manufacturing' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_gas + + + petroleum_fuels: + selection_fields: + MetaSources: 'EPA_GHGI_T_A_6.petroleum' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_pet + + + + + From 8f16468ee49338ff8b20bd4c1d4bde7527a09404 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 4 Sep 2023 09:12:18 -0400 Subject: [PATCH 0894/1127] directly attributed data can be sourced directly from StateGHGI --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 136 +++++++++--------- .../EPA_StateGHGI_asets.csv | 82 +++++------ .../GHG_state_2019_m2.yaml | 67 ++++----- .../GHG_state_2019_m3.yaml | 35 +++++ 4 files changed, 179 insertions(+), 141 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index 107c659be..513eba7de 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -3,50 +3,50 @@ EPA_State_GHGI,Agriculture - N2O from Agricultural Soil Management - Agricultura EPA_State_GHGI,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Direct - Grassland,NAICS_2012_Code,112,,direct EPA_State_GHGI,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Indirect - Cropland,NAICS_2012_Code,111,,direct EPA_State_GHGI,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Indirect - Grassland,NAICS_2012_Code,112,,direct -EPA_State_GHGI,Agriculture - Enteric Fermentation - American Bison,NAICS_2012_Code,1129,,direct -EPA_State_GHGI,Agriculture - Enteric Fermentation - Beef Cattle,NAICS_2012_Code,1121,,direct -EPA_State_GHGI,Agriculture - Enteric Fermentation - Dairy Cattle,NAICS_2012_Code,1121,,direct -EPA_State_GHGI,Agriculture - Enteric Fermentation - Goats,NAICS_2012_Code,1124,,direct -EPA_State_GHGI,Agriculture - Enteric Fermentation - Horses,NAICS_2012_Code,1129,,direct -EPA_State_GHGI,Agriculture - Enteric Fermentation - Mules and Asses,NAICS_2012_Code,1129,,direct -EPA_State_GHGI,Agriculture - Enteric Fermentation - Sheep,NAICS_2012_Code,1124,,direct -EPA_State_GHGI,Agriculture - Enteric Fermentation - Swine,NAICS_2012_Code,1122,,direct -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Barley,NAICS_2012_Code,111199,,revise WI -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Chickpeas,NAICS_2012_Code,111130,,revise WI -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Cotton,NAICS_2012_Code,11192,,revise WI -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Dry Beans,NAICS_2012_Code,111130,,revise WI -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Grass Hay,NAICS_2012_Code,11194,,revise WI -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Legume Hay,NAICS_2012_Code,11194,,revise WI -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Lentils,NAICS_2012_Code,111130,,revise WI -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Maize,NAICS_2012_Code,111150,,revise WI -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Oats,NAICS_2012_Code,111199,,revise WI -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Other Small Grains,NAICS_2012_Code,111199,,revise WI -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Peanuts,NAICS_2012_Code,111992,,revise WI -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Peas,NAICS_2012_Code,111130,,revise WI -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Potatoes,NAICS_2012_Code,111211,,revise WI -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Rice,NAICS_2012_Code,11116,,revise WI -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Sorghum,NAICS_2012_Code,111199,,revise WI -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Soybeans,NAICS_2012_Code,11111,,revise WI -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Sugarbeets,NAICS_2012_Code,111991,,revise WI -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Sunflower,NAICS_2012_Code,111120,,revise WI -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Tobacco,NAICS_2012_Code,11191,,revise WI -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Vegetables,NAICS_2012_Code,111219,,revise WI -EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Wheat,NAICS_2012_Code,11114,,revise WI -EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Dolomite",NAICS_2012_Code,111,,use_table_chem -EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Dolomite",NAICS_2012_Code,112,,use_table_chem -EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Limestone",NAICS_2012_Code,111,,use_table_chem -EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Limestone",NAICS_2012_Code,112,,use_table_chem -EPA_State_GHGI,Agriculture - Manure Management - American Bison,NAICS_2012_Code,112990B,,direct -EPA_State_GHGI,Agriculture - Manure Management - Beef Cattle,NAICS_2012_Code,11211,,direct -EPA_State_GHGI,Agriculture - Manure Management - Bison,NAICS_2012_Code,112990B,,direct -EPA_State_GHGI,Agriculture - Manure Management - Dairy Cattle,NAICS_2012_Code,11212,,direct -EPA_State_GHGI,Agriculture - Manure Management - Dairy Heifers,NAICS_2012_Code,11212,,direct -EPA_State_GHGI,Agriculture - Manure Management - Goats,NAICS_2012_Code,11242,,direct -EPA_State_GHGI,Agriculture - Manure Management - Horses,NAICS_2012_Code,112920A,,direct -EPA_State_GHGI,Agriculture - Manure Management - Mules and Asses,NAICS_2012_Code,112920B,,direct -EPA_State_GHGI,Agriculture - Manure Management - Poultry,NAICS_2012_Code,1123,,direct -EPA_State_GHGI,Agriculture - Manure Management - Sheep,NAICS_2012_Code,11241,,direct -EPA_State_GHGI,Agriculture - Manure Management - Swine,NAICS_2012_Code,1122,,direct +EPA_State_GHGI,Agriculture - Enteric Fermentation - American Bison,NAICS_2012_Code,1129,,ag_livestock +EPA_State_GHGI,Agriculture - Enteric Fermentation - Beef Cattle,NAICS_2012_Code,1121,,ag_livestock +EPA_State_GHGI,Agriculture - Enteric Fermentation - Dairy Cattle,NAICS_2012_Code,1121,,ag_livestock +EPA_State_GHGI,Agriculture - Enteric Fermentation - Goats,NAICS_2012_Code,1124,,ag_livestock +EPA_State_GHGI,Agriculture - Enteric Fermentation - Horses,NAICS_2012_Code,1129,,ag_livestock +EPA_State_GHGI,Agriculture - Enteric Fermentation - Mules and Asses,NAICS_2012_Code,1129,,ag_livestock +EPA_State_GHGI,Agriculture - Enteric Fermentation - Sheep,NAICS_2012_Code,1124,,ag_livestock +EPA_State_GHGI,Agriculture - Enteric Fermentation - Swine,NAICS_2012_Code,1122,,ag_livestock +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Barley,NAICS_2012_Code,111199,,ag_burning +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Chickpeas,NAICS_2012_Code,111130,,ag_burning +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Cotton,NAICS_2012_Code,11192,,ag_burning +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Dry Beans,NAICS_2012_Code,111130,,ag_burning +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Grass Hay,NAICS_2012_Code,11194,,ag_burning +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Legume Hay,NAICS_2012_Code,11194,,ag_burning +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Lentils,NAICS_2012_Code,111130,,ag_burning +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Maize,NAICS_2012_Code,111150,,ag_burning +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Oats,NAICS_2012_Code,111199,,ag_burning +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Other Small Grains,NAICS_2012_Code,111199,,ag_burning +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Peanuts,NAICS_2012_Code,111992,,ag_burning +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Peas,NAICS_2012_Code,111130,,ag_burning +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Potatoes,NAICS_2012_Code,111211,,ag_burning +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Rice,NAICS_2012_Code,11116,,ag_burning +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Sorghum,NAICS_2012_Code,111199,,ag_burning +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Soybeans,NAICS_2012_Code,11111,,ag_burning +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Sugarbeets,NAICS_2012_Code,111991,,ag_burning +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Sunflower,NAICS_2012_Code,111120,,ag_burning +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Tobacco,NAICS_2012_Code,11191,,ag_burning +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Vegetables,NAICS_2012_Code,111219,,ag_burning +EPA_State_GHGI,Agriculture - Field Burning of Agricultural Residues - Wheat,NAICS_2012_Code,11114,,ag_burning +EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Dolomite",NAICS_2012_Code,111,,liming +EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Dolomite",NAICS_2012_Code,112,,liming +EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Limestone",NAICS_2012_Code,111,,liming +EPA_State_GHGI,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Limestone",NAICS_2012_Code,112,,liming +EPA_State_GHGI,Agriculture - Manure Management - American Bison,NAICS_2012_Code,112990B,,ag_livestock +EPA_State_GHGI,Agriculture - Manure Management - Beef Cattle,NAICS_2012_Code,11211,,ag_livestock +EPA_State_GHGI,Agriculture - Manure Management - Bison,NAICS_2012_Code,112990B,,ag_livestock +EPA_State_GHGI,Agriculture - Manure Management - Dairy Cattle,NAICS_2012_Code,11212,,ag_livestock +EPA_State_GHGI,Agriculture - Manure Management - Dairy Heifers,NAICS_2012_Code,11212,,ag_livestock +EPA_State_GHGI,Agriculture - Manure Management - Goats,NAICS_2012_Code,11242,,ag_livestock +EPA_State_GHGI,Agriculture - Manure Management - Horses,NAICS_2012_Code,112920A,,ag_livestock +EPA_State_GHGI,Agriculture - Manure Management - Mules and Asses,NAICS_2012_Code,112920B,,ag_livestock +EPA_State_GHGI,Agriculture - Manure Management - Poultry,NAICS_2012_Code,1123,,ag_livestock +EPA_State_GHGI,Agriculture - Manure Management - Sheep,NAICS_2012_Code,11241,,ag_livestock +EPA_State_GHGI,Agriculture - Manure Management - Swine,NAICS_2012_Code,1122,,ag_livestock EPA_State_GHGI,Agriculture - Rice Cultivation,NAICS_2012_Code,1111,,direct EPA_State_GHGI,"Agriculture - Urea Fertilization - CO2 emissions from liming, urea application and other carbon-containing fertilizers",NAICS_2012_Code,111,,ag EPA_State_GHGI,"Agriculture - Urea Fertilization - CO2 emissions from liming, urea application and other carbon-containing fertilizers",NAICS_2012_Code,112,,ag @@ -124,21 +124,21 @@ EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combus EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,72,,use_table_pet EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,81,,use_table_pet EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,923,,use_table_pet -EPA_State_GHGI,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation,NAICS_2012_Code,2211,,make_table_elec -EPA_State_GHGI,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation,NAICS_2012_Code,S00101,,make_table_elec -EPA_State_GHGI,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation,NAICS_2012_Code,S00202,,make_table_elec -EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Coal,NAICS_2012_Code,2211,,make_table_elec -EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Coal,NAICS_2012_Code,S00101,,make_table_elec -EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Coal,NAICS_2012_Code,S00202,,make_table_elec -EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Geothermal,NAICS_2012_Code,2211,,make_table_elec -EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Geothermal,NAICS_2012_Code,S00101,,make_table_elec -EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Geothermal,NAICS_2012_Code,S00202,,make_table_elec -EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Natural Gas,NAICS_2012_Code,2211,,make_table_elec -EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Natural Gas,NAICS_2012_Code,S00101,,make_table_elec -EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Natural Gas,NAICS_2012_Code,S00202,,make_table_elec -EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum,NAICS_2012_Code,2211,,make_table_elec -EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum,NAICS_2012_Code,S00101,,make_table_elec -EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum,NAICS_2012_Code,S00202,,make_table_elec +EPA_State_GHGI,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation,NAICS_2012_Code,2211,,electric_power +EPA_State_GHGI,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation,NAICS_2012_Code,S00101,,electric_power +EPA_State_GHGI,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation,NAICS_2012_Code,S00202,,electric_power +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Coal,NAICS_2012_Code,2211,,electric_power +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Coal,NAICS_2012_Code,S00101,,electric_power +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Coal,NAICS_2012_Code,S00202,,electric_power +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Geothermal,NAICS_2012_Code,2211,,electric_power +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Geothermal,NAICS_2012_Code,S00101,,electric_power +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Geothermal,NAICS_2012_Code,S00202,,electric_power +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Natural Gas,NAICS_2012_Code,2211,,electric_power +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Natural Gas,NAICS_2012_Code,S00101,,electric_power +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Natural Gas,NAICS_2012_Code,S00202,,electric_power +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum,NAICS_2012_Code,2211,,electric_power +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum,NAICS_2012_Code,S00101,,electric_power +EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum,NAICS_2012_Code,S00202,,electric_power EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,31,,industrial_ch4_n2o EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,32,,industrial_ch4_n2o EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,33,,industrial_ch4_n2o @@ -243,12 +243,12 @@ EPA_State_GHGI,Industry - Adipic Acid Production - Chemical Industry,NAICS_2012_ EPA_State_GHGI,Industry - Ammonia Production - Chemical Industry,NAICS_2012_Code,3313,,direct EPA_State_GHGI,"Industry - Caprolactam, Glyoxal,and Glyoxylic Acid Production - Chemical Industry - Caprolactam Production",NAICS_2012_Code,3251,,direct EPA_State_GHGI,Industry - Nitric Acid Production - Chemical Industry,NAICS_2012_Code,3253,,direct -EPA_State_GHGI,Industry - Petrochemical Production - Chemical Industry - Acrylonitrile,NAICS_2012_Code,3251,,direct -EPA_State_GHGI,Industry - Petrochemical Production - Chemical Industry - Carbon Black,NAICS_2012_Code,3251,,direct -EPA_State_GHGI,Industry - Petrochemical Production - Chemical Industry - Ethylene,NAICS_2012_Code,3241,,direct -EPA_State_GHGI,Industry - Petrochemical Production - Chemical Industry - Ethylene Dichloride,NAICS_2012_Code,3251,,direct -EPA_State_GHGI,Industry - Petrochemical Production - Chemical Industry - Ethylene Oxide,NAICS_2012_Code,3251,,direct -EPA_State_GHGI,Industry - Petrochemical Production - Chemical Industry - Methanol,NAICS_2012_Code,3251,,direct +EPA_State_GHGI,Industry - Petrochemical Production - Chemical Industry - Acrylonitrile,NAICS_2012_Code,3251,,petrochemicals +EPA_State_GHGI,Industry - Petrochemical Production - Chemical Industry - Carbon Black,NAICS_2012_Code,3251,,petrochemicals +EPA_State_GHGI,Industry - Petrochemical Production - Chemical Industry - Ethylene,NAICS_2012_Code,3241,,petrochemicals +EPA_State_GHGI,Industry - Petrochemical Production - Chemical Industry - Ethylene Dichloride,NAICS_2012_Code,3251,,petrochemicals +EPA_State_GHGI,Industry - Petrochemical Production - Chemical Industry - Ethylene Oxide,NAICS_2012_Code,3251,,petrochemicals +EPA_State_GHGI,Industry - Petrochemical Production - Chemical Industry - Methanol,NAICS_2012_Code,3251,,petrochemicals EPA_State_GHGI,Industry - Phosphoric Acid Production - Chemical Industry,NAICS_2012_Code,3253,,direct EPA_State_GHGI,Industry - Carbide Production and Consumption - Chemical Industry - Silicon Carbide Production and Consumption,NAICS_2012_Code,3251,,direct EPA_State_GHGI,Industry - Soda Ash Production - Chemical Industry,NAICS_2012_Code,3251,,direct @@ -278,9 +278,9 @@ EPA_State_GHGI,Industry - Lime Production - Mineral Industry - Lime Manufacture, EPA_State_GHGI,Industry - Other Process Uses of Carbonates - Mineral Industry,NAICS_2012_Code,31,,use_table_chem EPA_State_GHGI,Industry - Other Process Uses of Carbonates - Mineral Industry,NAICS_2012_Code,32,,use_table_chem EPA_State_GHGI,Industry - Other Process Uses of Carbonates - Mineral Industry,NAICS_2012_Code,33,,use_table_chem -EPA_State_GHGI,Electric Power Industry - Electrical Transmission and Distribution - Other product manufacture and use - Electric Power Systems,NAICS_2012_Code,22112,,direct -EPA_State_GHGI,Electric Power Industry - Electrical Transmission and Distribution - Other product manufacture and use - Equipment OEM,NAICS_2012_Code,22112,,direct -EPA_State_GHGI,Industry - HCFC-22 Production - Production and Use of Fluorinated Gases,NAICS_2012_Code,325120,,direct +EPA_State_GHGI,Electric Power Industry - Electrical Transmission and Distribution - Other product manufacture and use - Electric Power Systems,NAICS_2012_Code,22112,,electricity_transmission +EPA_State_GHGI,Electric Power Industry - Electrical Transmission and Distribution - Other product manufacture and use - Equipment OEM,NAICS_2012_Code,22112,,electricity_transmission +EPA_State_GHGI,Industry - HCFC-22 Production - Production and Use of Fluorinated Gases,NAICS_2012_Code,325120,,hcfc EPA_State_GHGI,Commercial - Composting,NAICS_2012_Code,562219,,direct EPA_State_GHGI,Commercial - Anaerobic Digestion at Biogas Facility - Anaerobic Digestion at Biogas Facilities,NAICS_2012_Code,5622,,direct EPA_State_GHGI,Industry - Landfills - Industrial - Landfills - Industrial Landfill - Industrial Waste Landfills Net Emissions,NAICS_2012_Code,562212,,direct diff --git a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv index d9dd33e28..92488d1c5 100644 --- a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv @@ -3,48 +3,48 @@ n2o_soil_direct,Agriculture - N2O from Agricultural Soil Management - Agricultur n2o_soil_direct,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Direct - Grassland,EPA_GHGI_T_5_18 n2o_soil,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Indirect - Cropland,EPA_GHGI_T_5_19 n2o_soil,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Indirect - Grassland,EPA_GHGI_T_5_19 -direct,Agriculture - Enteric Fermentation - American Bison,EPA_GHGI_T_5_3 -direct,Agriculture - Enteric Fermentation - Beef Cattle,EPA_GHGI_T_5_3 -direct,Agriculture - Enteric Fermentation - Dairy Cattle,EPA_GHGI_T_5_3 -direct,Agriculture - Enteric Fermentation - Goats,EPA_GHGI_T_5_3 -direct,Agriculture - Enteric Fermentation - Horses,EPA_GHGI_T_5_3 -direct,Agriculture - Enteric Fermentation - Mules and Asses,EPA_GHGI_T_5_3 -direct,Agriculture - Enteric Fermentation - Sheep,EPA_GHGI_T_5_3 -direct,Agriculture - Enteric Fermentation - Swine,EPA_GHGI_T_5_3 -direct,Agriculture - Field Burning of Agricultural Residues - Barley,EPA_GHGI_T_5_29 -direct,Agriculture - Field Burning of Agricultural Residues - Chickpeas,EPA_GHGI_T_5_29 -direct,Agriculture - Field Burning of Agricultural Residues - Cotton,EPA_GHGI_T_5_29 -direct,Agriculture - Field Burning of Agricultural Residues - Dry Beans,EPA_GHGI_T_5_29 -direct,Agriculture - Field Burning of Agricultural Residues - Grass Hay,EPA_GHGI_T_5_29 -direct,Agriculture - Field Burning of Agricultural Residues - Legume Hay,EPA_GHGI_T_5_29 -direct,Agriculture - Field Burning of Agricultural Residues - Lentils,EPA_GHGI_T_5_29 -direct,Agriculture - Field Burning of Agricultural Residues - Maize,EPA_GHGI_T_5_29 -direct,Agriculture - Field Burning of Agricultural Residues - Oats,EPA_GHGI_T_5_29 -direct,Agriculture - Field Burning of Agricultural Residues - Other Small Grains,EPA_GHGI_T_5_29 -direct,Agriculture - Field Burning of Agricultural Residues - Peanuts,EPA_GHGI_T_5_29 -direct,Agriculture - Field Burning of Agricultural Residues - Peas,EPA_GHGI_T_5_29 -direct,Agriculture - Field Burning of Agricultural Residues - Potatoes,EPA_GHGI_T_5_29 -direct,Agriculture - Field Burning of Agricultural Residues - Rice,EPA_GHGI_T_5_29 -direct,Agriculture - Field Burning of Agricultural Residues - Sorghum,EPA_GHGI_T_5_29 -direct,Agriculture - Field Burning of Agricultural Residues - Soybeans,EPA_GHGI_T_5_29 -direct,Agriculture - Field Burning of Agricultural Residues - Sugarbeets,EPA_GHGI_T_5_29 -direct,Agriculture - Field Burning of Agricultural Residues - Sunflower,EPA_GHGI_T_5_29 -direct,Agriculture - Field Burning of Agricultural Residues - Tobacco,EPA_GHGI_T_5_29 -direct,Agriculture - Field Burning of Agricultural Residues - Vegetables,EPA_GHGI_T_5_29 -direct,Agriculture - Field Burning of Agricultural Residues - Wheat,EPA_GHGI_T_5_29 +ag_livestock,Agriculture - Enteric Fermentation - American Bison,EPA_GHGI_T_5_3 +ag_livestock,Agriculture - Enteric Fermentation - Beef Cattle,EPA_GHGI_T_5_3 +ag_livestock,Agriculture - Enteric Fermentation - Dairy Cattle,EPA_GHGI_T_5_3 +ag_livestock,Agriculture - Enteric Fermentation - Goats,EPA_GHGI_T_5_3 +ag_livestock,Agriculture - Enteric Fermentation - Horses,EPA_GHGI_T_5_3 +ag_livestock,Agriculture - Enteric Fermentation - Mules and Asses,EPA_GHGI_T_5_3 +ag_livestock,Agriculture - Enteric Fermentation - Sheep,EPA_GHGI_T_5_3 +ag_livestock,Agriculture - Enteric Fermentation - Swine,EPA_GHGI_T_5_3 +ag_burning,Agriculture - Field Burning of Agricultural Residues - Barley,EPA_GHGI_T_5_29 +ag_burning,Agriculture - Field Burning of Agricultural Residues - Chickpeas,EPA_GHGI_T_5_29 +ag_burning,Agriculture - Field Burning of Agricultural Residues - Cotton,EPA_GHGI_T_5_29 +ag_burning,Agriculture - Field Burning of Agricultural Residues - Dry Beans,EPA_GHGI_T_5_29 +ag_burning,Agriculture - Field Burning of Agricultural Residues - Grass Hay,EPA_GHGI_T_5_29 +ag_burning,Agriculture - Field Burning of Agricultural Residues - Legume Hay,EPA_GHGI_T_5_29 +ag_burning,Agriculture - Field Burning of Agricultural Residues - Lentils,EPA_GHGI_T_5_29 +ag_burning,Agriculture - Field Burning of Agricultural Residues - Maize,EPA_GHGI_T_5_29 +ag_burning,Agriculture - Field Burning of Agricultural Residues - Oats,EPA_GHGI_T_5_29 +ag_burning,Agriculture - Field Burning of Agricultural Residues - Other Small Grains,EPA_GHGI_T_5_29 +ag_burning,Agriculture - Field Burning of Agricultural Residues - Peanuts,EPA_GHGI_T_5_29 +ag_burning,Agriculture - Field Burning of Agricultural Residues - Peas,EPA_GHGI_T_5_29 +ag_burning,Agriculture - Field Burning of Agricultural Residues - Potatoes,EPA_GHGI_T_5_29 +ag_burning,Agriculture - Field Burning of Agricultural Residues - Rice,EPA_GHGI_T_5_29 +ag_burning,Agriculture - Field Burning of Agricultural Residues - Sorghum,EPA_GHGI_T_5_29 +ag_burning,Agriculture - Field Burning of Agricultural Residues - Soybeans,EPA_GHGI_T_5_29 +ag_burning,Agriculture - Field Burning of Agricultural Residues - Sugarbeets,EPA_GHGI_T_5_29 +ag_burning,Agriculture - Field Burning of Agricultural Residues - Sunflower,EPA_GHGI_T_5_29 +ag_burning,Agriculture - Field Burning of Agricultural Residues - Tobacco,EPA_GHGI_T_5_29 +ag_burning,Agriculture - Field Burning of Agricultural Residues - Vegetables,EPA_GHGI_T_5_29 +ag_burning,Agriculture - Field Burning of Agricultural Residues - Wheat,EPA_GHGI_T_5_29 liming,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Dolomite",EPA_GHGI_T_2_1 liming,"Agriculture - Liming - CO2 emissions from liming, urea application and other carbon-containing fertilizers - Limestone",EPA_GHGI_T_2_1 -direct,Agriculture - Manure Management - American Bison,EPA_GHGI_T_2_1 -direct,Agriculture - Manure Management - Beef Cattle,EPA_GHGI_T_5_7 -direct,Agriculture - Manure Management - Bison,EPA_GHGI_T_5_7 -direct,Agriculture - Manure Management - Dairy Cattle,EPA_GHGI_T_5_7 -direct,Agriculture - Manure Management - Dairy Heifers,EPA_GHGI_T_5_7 -direct,Agriculture - Manure Management - Goats,EPA_GHGI_T_5_7 -direct,Agriculture - Manure Management - Horses,EPA_GHGI_T_5_7 -direct,Agriculture - Manure Management - Mules and Asses,EPA_GHGI_T_5_7 -direct,Agriculture - Manure Management - Poultry,EPA_GHGI_T_5_7 -direct,Agriculture - Manure Management - Sheep,EPA_GHGI_T_5_7 -direct,Agriculture - Manure Management - Swine,EPA_GHGI_T_5_7 +ag_livestock,Agriculture - Manure Management - American Bison,EPA_GHGI_T_2_1 +ag_livestock,Agriculture - Manure Management - Beef Cattle,EPA_GHGI_T_5_7 +ag_livestock,Agriculture - Manure Management - Bison,EPA_GHGI_T_5_7 +ag_livestock,Agriculture - Manure Management - Dairy Cattle,EPA_GHGI_T_5_7 +ag_livestock,Agriculture - Manure Management - Dairy Heifers,EPA_GHGI_T_5_7 +ag_livestock,Agriculture - Manure Management - Goats,EPA_GHGI_T_5_7 +ag_livestock,Agriculture - Manure Management - Horses,EPA_GHGI_T_5_7 +ag_livestock,Agriculture - Manure Management - Mules and Asses,EPA_GHGI_T_5_7 +ag_livestock,Agriculture - Manure Management - Poultry,EPA_GHGI_T_5_7 +ag_livestock,Agriculture - Manure Management - Sheep,EPA_GHGI_T_5_7 +ag_livestock,Agriculture - Manure Management - Swine,EPA_GHGI_T_5_7 direct,Agriculture - Rice Cultivation,EPA_GHGI_T_2_1 urea,"Agriculture - Urea Fertilization - CO2 emissions from liming, urea application and other carbon-containing fertilizers",EPA_GHGI_T_2_1 direct,Industry - Abandoned Oil and Gas Wells - Fugitive - Abandoned Wells, @@ -136,7 +136,7 @@ direct,Industry - Lime Production - Mineral Industry - Lime Manufacture,EPA_GHGI carbonate_use,Industry - Other Process Uses of Carbonates - Mineral Industry,EPA_GHGI_T_2_1 electricity_transmission,Electric Power Industry - Electrical Transmission and Distribution - Other product manufacture and use - Electric Power Systems, electricity_transmission,Electric Power Industry - Electrical Transmission and Distribution - Other product manufacture and use - Equipment OEM, -direct,Industry - HCFC-22 Production - Production and Use of Fluorinated Gases,EPA_GHGI_T_4_50 +hcfc,Industry - HCFC-22 Production - Production and Use of Fluorinated Gases,EPA_GHGI_T_4_50 direct,Commercial - Composting,EPA_GHGI_T_2_1 direct,Commercial - Anaerobic Digestion at Biogas Facility - Anaerobic Digestion at Biogas Facilities,EPA_GHGI_T_2_1 direct,Industry - Landfills - Industrial - Landfills - Industrial Landfill - Industrial Waste Landfills Net Emissions,EPA_GHGI_T_2_1 diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml index ab1e06089..ea11ed0de 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml @@ -8,12 +8,46 @@ geoscale: state source_names: +## Directly sourced from State Inventory + EPA_StateGHGI: + geoscale: state + year: *ghg_year + fedefl_mapping: GHGI + activity_sets: + electricity_transmission: #SF6 + # replicates electricity_transmission from EPA_GHGI_T_2_1 + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv electricity_transmission + attribution_method: direct + petrochemicals: #CO2 for selected petrochemicals + # replicates EPA_GHGI_T_4_46 + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv petrochemicals + attribution_method: direct + ag_livestock: #CH4 from Enteric Fermentation, CH4, N2O from manure + # replicates EPA_GHGI_T_5_3 and EPA_GHGI_T_5_6 + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ag_livestock + attribution_method: direct + ag_burning: #CH4, N2O, CO and NOx from field burning of residue + # replicates EPA_GHGI_T_5_28 + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ag_burning + attribution_method: direct + hcfc: # HFCs from HCFC-22 production + # replicates EPA_GHGI_T_4_50 + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv hcfc + attribution_method: direct + + EPA_GHGI_T_2_1: #U.S. GHG emissions year: *ghg_year fedefl_mapping: GHGI geoscale: national activity_sets: direct: + ## TODO review these for possible direct attribution from StateGHGI !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:direct attribute: - attribution_method: direct @@ -27,20 +61,6 @@ source_names: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct - electricity_transmission: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electricity_transmission - attribute: - - attribution_method: direct - - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv electricity_transmission - electric_power: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power attribute: @@ -137,7 +157,6 @@ source_names: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv nitrous_oxide_use - ## Fossil Fuels EPA_GHGI_T_3_68: &natgas #CH4 from Natural Gas Systems !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 @@ -357,21 +376,5 @@ source_names: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_pet -## Other sources - EPA_GHGI_T_4_46: #CO2 for selected petrochemicals - # TODO update this to use separate activity sets for each source - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 - year: *ghg_year - geoscale: national - attribute: - - attribution_method: direct - - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv petrochemicals + diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml index ad9d4f0d2..561905355 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml @@ -7,6 +7,41 @@ geoscale: state source_names: +## Directly sourced from State Inventory + EPA_StateGHGI: + geoscale: state + year: *ghg_year + fedefl_mapping: GHGI + activity_sets: + electricity_transmission: #SF6 + # replicates electricity_transmission from EPA_GHGI_T_2_1 + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv electricity_transmission + attribution_method: direct + petrochemicals: #CO2 for selected petrochemicals + # replicates EPA_GHGI_T_4_46 + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv petrochemicals + attribution_method: direct + ag_livestock: #CH4 from Enteric Fermentation, CH4, N2O from manure + # replicates EPA_GHGI_T_5_3 and EPA_GHGI_T_5_6 + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ag_livestock + attribution_method: direct + ag_burning: #CH4, N2O, CO and NOx from field burning of residue + # replicates EPA_GHGI_T_5_28 + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ag_burning + attribution_method: direct + hcfc: # HFCs from HCFC-22 production + # replicates EPA_GHGI_T_4_50 + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv hcfc + attribution_method: direct + + + + GHG_national_2019: #U.S. GHG emissions year: *ghg_year fedefl_mapping: GHGI From 603072b243bd2077b1e81dbfc35f4757fe2b95f6 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 4 Sep 2023 09:12:46 -0400 Subject: [PATCH 0895/1127] source `data_format` from method if not in source catalog --- flowsa/metadata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/metadata.py b/flowsa/metadata.py index aa7a3f9bf..45978b486 100644 --- a/flowsa/metadata.py +++ b/flowsa/metadata.py @@ -112,7 +112,7 @@ def return_fbs_method_data(source_name, config): v['inventory_dict']) continue - cat = (get_catalog_info(k)['data_format'] + cat = (get_catalog_info(k).get('data_format', v.get('data_format', '')) .replace('FBS', 'FlowBySector') .replace('FBA', 'FlowByActivity')) From 36f410a3ef334cfe694082a741e0bc063f1b4046 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 4 Sep 2023 12:10:27 -0400 Subject: [PATCH 0896/1127] separate gasoline and diesel as separate activity sets for ch4, n2o emissions for use by state model --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 52 ++++----- .../EPA_StateGHGI_asets.csv | 20 ++-- .../GHG_national_m1_common.yaml | 16 ++- .../GHG_state_2019_m3.yaml | 109 +++++++++++++++--- 4 files changed, 141 insertions(+), 56 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index 513eba7de..4ffec598f 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -1,8 +1,8 @@ ActivitySourceName,Activity,SectorSourceName,Sector,SectorType,Notes -EPA_State_GHGI,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Direct - Cropland,NAICS_2012_Code,111,,direct -EPA_State_GHGI,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Direct - Grassland,NAICS_2012_Code,112,,direct -EPA_State_GHGI,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Indirect - Cropland,NAICS_2012_Code,111,,direct -EPA_State_GHGI,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Indirect - Grassland,NAICS_2012_Code,112,,direct +EPA_State_GHGI,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Direct - Cropland,NAICS_2012_Code,111,,n2o_soil_direct +EPA_State_GHGI,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Direct - Grassland,NAICS_2012_Code,112,,n2o_soil_direct +EPA_State_GHGI,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Indirect - Cropland,NAICS_2012_Code,111,,n2o_soil_indirect +EPA_State_GHGI,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Indirect - Grassland,NAICS_2012_Code,112,,n2o_soil_indirect EPA_State_GHGI,Agriculture - Enteric Fermentation - American Bison,NAICS_2012_Code,1129,,ag_livestock EPA_State_GHGI,Agriculture - Enteric Fermentation - Beef Cattle,NAICS_2012_Code,1121,,ag_livestock EPA_State_GHGI,Agriculture - Enteric Fermentation - Dairy Cattle,NAICS_2012_Code,1121,,ag_livestock @@ -60,22 +60,22 @@ EPA_State_GHGI,Industry - Coal Mining - Fugitive - Post-Mining (Underground),NAI EPA_State_GHGI,Industry - Coal Mining - Fugitive - Surface Mining,NAICS_2012_Code,2121,,direct EPA_State_GHGI,Industry - Coal Mining - Fugitive - Underground Liberated,NAICS_2012_Code,2121,,direct EPA_State_GHGI,Industry - Coal Mining - Fugitive - Underground Recovered &Used For Energy,NAICS_2012_Code,2121,,direct -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,42,,commercial_ch4_n2o -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,44,,commercial_ch4_n2o -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,45,,commercial_ch4_n2o -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,493,,commercial_ch4_n2o -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,51,,commercial_ch4_n2o -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,52,,commercial_ch4_n2o -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,53,,commercial_ch4_n2o -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,54,,commercial_ch4_n2o -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,55,,commercial_ch4_n2o -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,56,,commercial_ch4_n2o -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,61,,commercial_ch4_n2o -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,62,,commercial_ch4_n2o -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,71,,commercial_ch4_n2o -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,72,,commercial_ch4_n2o -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,81,,commercial_ch4_n2o -EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,923,,commercial_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,42,,ind_com_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,44,,ind_com_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,45,,ind_com_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,493,,ind_com_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,51,,ind_com_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,52,,ind_com_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,53,,ind_com_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,54,,ind_com_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,55,,ind_com_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,56,,ind_com_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,61,,ind_com_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,62,,ind_com_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,71,,ind_com_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,72,,ind_com_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,81,,ind_com_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,923,,ind_com_ch4_n2o EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,42,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,44,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,45,,use_table_coal @@ -139,9 +139,9 @@ EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossi EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum,NAICS_2012_Code,2211,,electric_power EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum,NAICS_2012_Code,S00101,,electric_power EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum,NAICS_2012_Code,S00202,,electric_power -EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,31,,industrial_ch4_n2o -EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,32,,industrial_ch4_n2o -EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,33,,industrial_ch4_n2o +EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,31,,ind_com_ch4_n2o +EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,32,,ind_com_ch4_n2o +EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,33,,ind_com_ch4_n2o EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,31,,use_table_coal EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,32,,use_table_coal EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,33,,use_table_coal @@ -306,9 +306,9 @@ EPA_State_GHGI,Electric Power Industry - Other Process Uses of Carbonates - Mine EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,31,,transport_nonroad EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,32,,transport_nonroad EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,33,,transport_nonroad -EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,NAICS_2012_Code,31,,industrial_ch4_n2o -EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,NAICS_2012_Code,32,,industrial_ch4_n2o -EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,NAICS_2012_Code,33,,industrial_ch4_n2o +EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,NAICS_2012_Code,31,,ind_com_ch4_n2o +EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,NAICS_2012_Code,32,,ind_com_ch4_n2o +EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,NAICS_2012_Code,33,,ind_com_ch4_n2o EPA_State_GHGI,Industry - N2O from Product Uses - Other product manufacture and use,NAICS_2012_Code,621,,use_table_chem EPA_State_GHGI,Industry - N2O from Product Uses - Other product manufacture and use,NAICS_2012_Code,622,,use_table_chem EPA_State_GHGI,Industry - N2O from Product Uses - Other product manufacture and use,NAICS_2012_Code,623,,use_table_chem diff --git a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv index 92488d1c5..45afb06c1 100644 --- a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv @@ -1,8 +1,8 @@ activity_set,name,note -n2o_soil_direct,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Direct - Cropland,EPA_GHGI_T_5_18 -n2o_soil_direct,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Direct - Grassland,EPA_GHGI_T_5_18 -n2o_soil,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Indirect - Cropland,EPA_GHGI_T_5_19 -n2o_soil,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Indirect - Grassland,EPA_GHGI_T_5_19 +n2o_soil_direct,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Direct - Cropland,EPA_GHGI_T_5_17 +n2o_soil_direct,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Direct - Grassland,EPA_GHGI_T_5_17 +n2o_soil_indirect,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Indirect - Cropland,EPA_GHGI_T_5_18 +n2o_soil_indirect,Agriculture - N2O from Agricultural Soil Management - Agricultural Soil Management - Indirect - Grassland,EPA_GHGI_T_5_18 ag_livestock,Agriculture - Enteric Fermentation - American Bison,EPA_GHGI_T_5_3 ag_livestock,Agriculture - Enteric Fermentation - Beef Cattle,EPA_GHGI_T_5_3 ag_livestock,Agriculture - Enteric Fermentation - Dairy Cattle,EPA_GHGI_T_5_3 @@ -57,7 +57,7 @@ direct,Industry - Coal Mining - Fugitive - Post-Mining (Underground),EPA_GHGI_T_ direct,Industry - Coal Mining - Fugitive - Surface Mining,EPA_GHGI_T_2_1 direct,Industry - Coal Mining - Fugitive - Underground Liberated,EPA_GHGI_T_2_1 direct,Industry - Coal Mining - Fugitive - Underground Recovered &Used For Energy,EPA_GHGI_T_2_1 -commercial_ch4_n2o,Commercial - Stationary Combustion - Fossil Fuel Combustion, +ind_com_ch4_n2o,Commercial - Stationary Combustion - Fossil Fuel Combustion, use_table_coal,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,EPA_GHGI_T_A_14 use_table_gas,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,EPA_GHGI_T_A_14 use_table_pet,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,EPA_GHGI_T_A_14 @@ -66,7 +66,7 @@ electric_power,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossi electric_power,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Geothermal, electric_power,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Natural Gas, electric_power,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum, -industrial_ch4_n2o,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial, +ind_com_ch4_n2o,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial, use_table_coal,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal, use_table_gas,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas, use_table_pet,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,EPA_GHGI_T_A_14 @@ -143,11 +143,11 @@ direct,Industry - Landfills - Industrial - Landfills - Industrial Landfill - Ind direct,Commercial - Landfills - Municipal - Landfills - MSW Landfill - MSW Landfills Net Emissions,EPA_GHGI_T_2_1 direct,Industry - Wastewater Treatment - Wastewater Treatment and Discharge - Industrial,EPA_GHGI_T_2_1 direct,Commercial - Wastewater Treatment - Wastewater Treatment and Discharge - Domestic,EPA_GHGI_T_2_1 -transport_machinery,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,EPA_GHGI_T_3_14 +transport_nonroad,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,EPA_GHGI_T_3_14 use_table_pet,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,negative emissions; align with 'Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum' to avoid double counting -transport_machinery,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,EPA_GHGI_T_3_13 -transport_machinery,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,EPA_GHGI_T_3_14 +transport_nonroad,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,EPA_GHGI_T_3_13 +transport_nonroad,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,EPA_GHGI_T_3_14 direct,Electric Power Industry - Other Process Uses of Carbonates - Mineral Industry, transport_nonroad,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other, -industrial_ch4_n2o,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,negative emissions; align with 'Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial' to avoid double counting +ind_com_ch4_n2o,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,negative emissions; align with 'Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial' to avoid double counting nitrous_oxide_use,Industry - N2O from Product Uses - Other product manufacture and use,EPA_GHGI_T_2_1 diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml index 63d985f01..3c5e2df65 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml @@ -349,12 +349,10 @@ source_names: Medium- and Heavy-Duty Trucks and Buses Gasoline On-Road: Medium- and Heavy-Duty Trucks and Buses attribution_method: direct - petroleum_fuels: + petroleum_fuels_diesel: selection_fields: PrimaryActivity: - Passenger Cars Gasoline On-Road: Passenger Cars Passenger Cars Diesel On-Road: Passenger Cars - Light-Duty Trucks Gasoline On-Road: Light-Duty Trucks Light-Duty Trucks Diesel On-Road: Light-Duty Trucks Medium- and Heavy-Duty Buses Diesel On-Road: Buses - Distillate Fuel Oil Medium- and Heavy-Duty Trucks Diesel On-Road: Medium- and Heavy-Duty Trucks - Distillate Fuel Oil @@ -365,6 +363,18 @@ source_names: selection_fields: ActivityProducedBy: {'324110': ''} # purchases of refinery products + petroleum_fuels_gasoline: + selection_fields: + PrimaryActivity: + Passenger Cars Gasoline On-Road: Passenger Cars + Light-Duty Trucks Gasoline On-Road: Light-Duty Trucks + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + construction_and_mining: #this set is allocated by purchases of construction equipment selection_fields: PrimaryActivity: Construction/Mining Equipment Non-Road diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml index 561905355..f8509b435 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml @@ -163,8 +163,6 @@ source_names: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ng_systems - - EPA_GHGI_T_3_42: selection_fields: MetaSources: @@ -181,12 +179,13 @@ source_names: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv pet_systems - - - - fertilizer_use: +## Agriculture + direct_n2o: selection_fields: - MetaSources: 'EPA_GHGI_T_5_17.fertilizer_use' + MetaSources: + - 'EPA_GHGI_T_5_17.fertilizer_use' + - 'EPA_GHGI_T_5_17.cropland' + - 'EPA_GHGI_T_5_17.pasture' attribution_method: proportional attribute_on: ['Flowable', 'SectorProducedBy'] fill_columns: Location @@ -197,9 +196,22 @@ source_names: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv n2o_soil_direct + indirect_n2o: + selection_fields: + MetaSources: + - 'EPA_GHGI_T_5_18.fertilizer_use' + - 'EPA_GHGI_T_5_18.pasture' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv n2o_soil_indirect - - +## Mobile Sources direct_petroleum: selection_fields: MetaSources: @@ -215,9 +227,6 @@ source_names: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_petroleum - - - direct_ng: selection_fields: MetaSources: 'EPA_GHGI_T_3_13.direct_ng' @@ -231,9 +240,58 @@ source_names: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_ng + transport_ch4_n2o_diesel: + selection_fields: + MetaSources: + - 'EPA_GHGI_T_3_14.petroleum_fuels_diesel' + - 'EPA_GHGI_T_3_15.petroleum_fuels_diesel' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_diesel + transport_ch4_n2o_gasoline: + selection_fields: + MetaSources: + - 'EPA_GHGI_T_3_14.petroleum_fuels_gasoline' + - 'EPA_GHGI_T_3_15.petroleum_fuels_gasoline' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_gasoline + transport_ch4_n2o_nonroad: + selection_fields: + MetaSources: + - 'EPA_GHGI_T_3_14.construction_and_mining' + - 'EPA_GHGI_T_3_14.farm_non_road' + - 'EPA_GHGI_T_3_14.other_non_road' + - 'EPA_GHGI_T_3_14.alt_fuel_on_road' + - 'EPA_GHGI_T_3_15.construction_and_mining' + - 'EPA_GHGI_T_3_15.farm_non_road' + - 'EPA_GHGI_T_3_15.other_non_road' + - 'EPA_GHGI_T_3_15.alt_fuel_on_road' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad +## Stationary Combustion direct_attribution: selection_fields: MetaSources: 'EPA_GHGI_T_A_6.direct_attribution' @@ -247,9 +305,6 @@ source_names: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv residential_co2 - - - coal: selection_fields: MetaSources: @@ -280,7 +335,6 @@ source_names: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_gas - petroleum_fuels: selection_fields: MetaSources: 'EPA_GHGI_T_A_6.petroleum' @@ -294,7 +348,28 @@ source_names: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_pet - + stationary_ch4_n2o: + selection_fields: + MetaSources: + - 'EPA_GHGI_T_3_8.natural_gas_nonmanufacturing' + - 'EPA_GHGI_T_3_8.fuel_oil' + - 'EPA_GHGI_T_3_8.coal_nonmanufacturing' + - 'EPA_GHGI_T_3_8.ng_manufacturing' + - 'EPA_GHGI_T_3_8.coal_manufacturing' + - 'EPA_GHGI_T_3_9.natural_gas_nonmanufacturing' + - 'EPA_GHGI_T_3_9.fuel_oil' + - 'EPA_GHGI_T_3_9.coal_nonmanufacturing' + - 'EPA_GHGI_T_3_9.ng_manufacturing' + - 'EPA_GHGI_T_3_9.coal_manufacturing' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ind_com_ch4_n2o From 3fafb5ec8fb3e0d29ac8e1025051d617353622b8 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 4 Sep 2023 12:34:18 -0400 Subject: [PATCH 0897/1127] add ODS activity sets --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 22 +++++----- .../EPA_StateGHGI_asets.csv | 4 +- .../GHG_state_2019_m3.yaml | 41 ++++++++++++++++++- 3 files changed, 53 insertions(+), 14 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index 4ffec598f..39b2b6d62 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -238,7 +238,7 @@ EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product u EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,32,,ods_substitutes EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,33,,ods_substitutes EPA_State_GHGI,Residential - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Residential,NAICS_2012_Code,F010,,direct_ods -EPA_State_GHGI,Transportation - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Transportation,NAICS_2012_Code,F010,,direct_ods +EPA_State_GHGI,Transportation - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Transportation,NAICS_2012_Code,F010,,ods_transportation EPA_State_GHGI,Industry - Adipic Acid Production - Chemical Industry,NAICS_2012_Code,3251,,direct EPA_State_GHGI,Industry - Ammonia Production - Chemical Industry,NAICS_2012_Code,3313,,direct EPA_State_GHGI,"Industry - Caprolactam, Glyoxal,and Glyoxylic Acid Production - Chemical Industry - Caprolactam Production",NAICS_2012_Code,3251,,direct @@ -269,7 +269,7 @@ EPA_State_GHGI,Industry - Iron and Steel Production - Metal Industry - Pellet Pr EPA_State_GHGI,Industry - Iron and Steel Production - Metal Industry - Sinter Production,NAICS_2012_Code,3311,,direct EPA_State_GHGI,Industry - Iron and Steel Production - Metal Industry - Steel Production,NAICS_2012_Code,3311,,direct EPA_State_GHGI,Industry - Lead Production - Metal Industry,NAICS_2012_Code,3314,,direct -EPA_State_GHGI,Industry - Magnesium Production and Processing - Metal Industry,NAICS_2012_Code,331,,direct +EPA_State_GHGI,Industry - Magnesium Production and Processing - Metal Industry,NAICS_2012_Code,331,,magnesium EPA_State_GHGI,Industry - Zinc Production - Metal Industry,NAICS_2012_Code,3314,,direct EPA_State_GHGI,Industry - Carbon Dioxide Consumption - Mineral Industry,,,,exclude EPA_State_GHGI,Industry - Cement Production - Mineral Industry - Cement Manufacture,NAICS_2012_Code,3273,,direct @@ -287,21 +287,21 @@ EPA_State_GHGI,Industry - Landfills - Industrial - Landfills - Industrial Landfi EPA_State_GHGI,Commercial - Landfills - Municipal - Landfills - MSW Landfill - MSW Landfills Net Emissions,NAICS_2012_Code,562212,,direct EPA_State_GHGI,Industry - Wastewater Treatment - Wastewater Treatment and Discharge - Industrial,NAICS_2012_Code,2213,,direct EPA_State_GHGI,Commercial - Wastewater Treatment - Wastewater Treatment and Discharge - Domestic,NAICS_2012_Code,2213,,direct -EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,111,,transport_machinery -EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,112,,transport_machinery -EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,113,,transport_machinery -EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,114,,transport_machinery +EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,111,,transport_nonroad +EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,112,,transport_nonroad +EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,113,,transport_nonroad +EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,114,,transport_nonroad EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,11,,use_table_pet EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,21,,use_table_pet EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,23,,use_table_pet EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,31,,use_table_pet EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,32,,use_table_pet EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,33,,use_table_pet -EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,111,,transport_machinery -EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,112,,transport_machinery -EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,113,,transport_machinery -EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,114,,transport_machinery -EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,NAICS_2012_Code,23,,transport_machinery +EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,111,,transport_nonroad +EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,112,,transport_nonroad +EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,113,,transport_nonroad +EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,114,,transport_nonroad +EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,NAICS_2012_Code,23,,transport_nonroad EPA_State_GHGI,Electric Power Industry - Other Process Uses of Carbonates - Mineral Industry,NAICS_2012_Code,2211,,direct EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,31,,transport_nonroad EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,32,,transport_nonroad diff --git a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv index 45afb06c1..6675ab5cb 100644 --- a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv @@ -98,7 +98,7 @@ transport_nonroad,Transportation - Mobile Combustion - Fossil Fuel Combustion - ods_substitutes,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,EPA_GHGI_T_4_102 ods_substitutes,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,EPA_GHGI_T_4_102 direct_ods,Residential - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Residential,EPA_GHGI_T_4_102 -direct_ods,Transportation - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Transportation,EPA_GHGI_T_4_102 +ods_transportation,Transportation - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Transportation,EPA_GHGI_T_4_102 direct,Industry - Adipic Acid Production - Chemical Industry,EPA_GHGI_T_2_1 direct,Industry - Ammonia Production - Chemical Industry,EPA_GHGI_T_2_1 direct,"Industry - Caprolactam, Glyoxal,and Glyoxylic Acid Production - Chemical Industry - Caprolactam Production",EPA_GHGI_T_2_1 @@ -127,7 +127,7 @@ direct,Industry - Iron and Steel Production - Metal Industry - Pellet Production direct,Industry - Iron and Steel Production - Metal Industry - Sinter Production,EPA_GHGI_T_2_1 direct,Industry - Iron and Steel Production - Metal Industry - Steel Production,EPA_GHGI_T_2_1 lead,Industry - Lead Production - Metal Industry,EPA_GHGI_T_2_1 -direct,Industry - Magnesium Production and Processing - Metal Industry,EPA_GHGI_T_4_84 +magnesium,Industry - Magnesium Production and Processing - Metal Industry,EPA_GHGI_T_4_84 direct,Industry - Zinc Production - Metal Industry,EPA_GHGI_T_2_1 exclude,Industry - Carbon Dioxide Consumption - Mineral Industry,Excluded from national model direct,Industry - Cement Production - Mineral Industry - Cement Manufacture,EPA_GHGI_T_2_1 diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml index f8509b435..a60b0246e 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml @@ -39,7 +39,7 @@ source_names: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv hcfc attribution_method: direct - + # direct_ods GHG_national_2019: #U.S. GHG emissions @@ -371,5 +371,44 @@ source_names: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ind_com_ch4_n2o + ods_substitutes: + selection_fields: + MetaSources: + - 'EPA_GHGI_T_4_102.refrigerants' + - 'EPA_GHGI_T_4_102.air_conditioning' + - 'EPA_GHGI_T_4_102.foams' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ods_substitutes + ods_transportation: + selection_fields: + MetaSources: 'EPA_GHGI_T_A_97' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ods_transportation + magnesium: + selection_fields: + MetaSources: 'EPA_GHGI_T_4_86' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv magnesium From af45ce33090954770ad1aa70d54a4b899de9f10a Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 4 Sep 2023 12:41:21 -0400 Subject: [PATCH 0898/1127] for ODS, `split_HFCs_by_type` to make sure Flowable is aligned --- flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml index a60b0246e..d70aec5c5 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml @@ -382,6 +382,10 @@ source_names: fill_columns: Location attribution_source: EPA_StateGHGI: + clean_fba_before_mapping: !script_function:EPA_GHGI split_HFCs_by_type + clean_parameter: + # Proportions of specific HFCs are assigned based on national total + flow_fba: EPA_GHGI_T_4_100 geoscale: state fedefl_mapping: GHGI selection_fields: @@ -395,6 +399,10 @@ source_names: fill_columns: Location attribution_source: EPA_StateGHGI: + clean_fba_before_mapping: !script_function:EPA_GHGI split_HFCs_by_type + clean_parameter: + # Proportions of specific HFCs are assigned based on national total + flow_fba: EPA_GHGI_T_4_100 geoscale: state fedefl_mapping: GHGI selection_fields: From 78fbe668aef41d3373844722606d22b86abfc2e4 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 4 Sep 2023 14:07:37 -0400 Subject: [PATCH 0899/1127] assign more direct activity sets from state inventory --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 15 +++++- .../GHG_state_2019_m3.yaml | 53 +++++++++---------- 2 files changed, 39 insertions(+), 29 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index 39b2b6d62..5f972b83c 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -165,6 +165,7 @@ EPA_State_GHGI,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combu EPA_State_GHGI,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,F010,,direct EPA_State_GHGI,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,F010,,direct EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,482,,direct +EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,485,,transport_ng EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,486,,transport_ng EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway,NAICS_2012_Code,48,,transport_petroleum EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway,NAICS_2012_Code,491,,transport_petroleum @@ -177,8 +178,20 @@ EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Co EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,928,,transport_petroleum EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,F010,,transport_petroleum EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,S00201,,transport_petroleum -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,NAICS_2012_Code,484,,transport_diesel +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,NAICS_2012_Code,48,,transport_diesel +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,NAICS_2012_Code,491,,transport_diesel +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,NAICS_2012_Code,492,,transport_diesel +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,NAICS_2012_Code,922,,transport_diesel +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,NAICS_2012_Code,928,,transport_diesel +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,NAICS_2012_Code,F010,,transport_diesel +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,NAICS_2012_Code,S00201,,transport_diesel +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,NAICS_2012_Code,48,,transport_gasoline +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,NAICS_2012_Code,491,,transport_gasoline +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,NAICS_2012_Code,492,,transport_gasoline +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,NAICS_2012_Code,922,,transport_gasoline +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,NAICS_2012_Code,928,,transport_gasoline EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,NAICS_2012_Code,F010,,transport_gasoline +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,NAICS_2012_Code,S00201,,transport_gasoline EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Non-Highway,NAICS_2012_Code,481,,transport_nonroad EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Non-Highway,NAICS_2012_Code,482,,transport_nonroad EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Non-Highway,NAICS_2012_Code,483,,transport_nonroad diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml index d70aec5c5..705d7d445 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml @@ -13,6 +13,21 @@ source_names: year: *ghg_year fedefl_mapping: GHGI activity_sets: + direct: + # replicates direct attribution from EPA_GHGI_T_2_1, EPA_GHGI_T_4_80, + # and EPA_GHGI_T_4_96 + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct + attribution_method: direct + direct_ods: + # replicates direct attribution from EPA_GHGI_T_4_102.households + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct_ods + clean_fba_before_mapping: !script_function:EPA_GHGI split_HFCs_by_type + clean_parameter: + # Proportions of specific HFCs are assigned based on national total + flow_fba: EPA_GHGI_T_4_100 + attribution_method: direct electricity_transmission: #SF6 # replicates electricity_transmission from EPA_GHGI_T_2_1 selection_fields: @@ -48,18 +63,6 @@ source_names: data_format: FBS geoscale: national activity_sets: - direct: - selection_fields: - MetaSources: 'EPA_GHGI_T_2_1.direct' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct electric_power: selection_fields: @@ -114,8 +117,6 @@ source_names: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv carbonate_use - - lead: selection_fields: MetaSources: 'EPA_GHGI_T_2_1.lead' @@ -129,8 +130,6 @@ source_names: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv lead - - nitrous_oxide_use: selection_fields: MetaSources: 'EPA_GHGI_T_2_1.nitrous_oxide_use' @@ -145,8 +144,7 @@ source_names: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv nitrous_oxide_use - - EPA_GHGI_T_3_68: + ng_systems: selection_fields: MetaSources: - 'EPA_GHGI_T_3_68' @@ -162,8 +160,7 @@ source_names: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ng_systems - - EPA_GHGI_T_3_42: + pet_systems: selection_fields: MetaSources: - 'EPA_GHGI_T_3_42' @@ -180,7 +177,7 @@ source_names: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv pet_systems ## Agriculture - direct_n2o: + n2o_soil_direct: selection_fields: MetaSources: - 'EPA_GHGI_T_5_17.fertilizer_use' @@ -196,7 +193,7 @@ source_names: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv n2o_soil_direct - indirect_n2o: + n2o_soil_indirect: selection_fields: MetaSources: - 'EPA_GHGI_T_5_18.fertilizer_use' @@ -212,7 +209,7 @@ source_names: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv n2o_soil_indirect ## Mobile Sources - direct_petroleum: + transport_petroleum: selection_fields: MetaSources: - 'EPA_GHGI_T_3_13.direct_petroleum' @@ -227,7 +224,7 @@ source_names: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_petroleum - direct_ng: + transport_ng: selection_fields: MetaSources: 'EPA_GHGI_T_3_13.direct_ng' attribution_method: proportional @@ -292,7 +289,7 @@ source_names: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad ## Stationary Combustion - direct_attribution: + stationary_residiential: selection_fields: MetaSources: 'EPA_GHGI_T_A_6.direct_attribution' attribution_method: proportional @@ -305,7 +302,7 @@ source_names: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv residential_co2 - coal: + stationary_coal: selection_fields: MetaSources: - 'EPA_GHGI_T_A_6.non-manufacturing_coal' @@ -320,7 +317,7 @@ source_names: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_coal - natural_gas: + stationary_natural_gas: selection_fields: MetaSources: - 'EPA_GHGI_T_A_6.non-manufacturing_natural_gas' @@ -335,7 +332,7 @@ source_names: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_gas - petroleum_fuels: + stationary_petroleum_fuels: selection_fields: MetaSources: 'EPA_GHGI_T_A_6.petroleum' attribution_method: proportional From 9569709d8c48536a8a5d911e561fddeb0cbd37cd Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 4 Sep 2023 14:07:53 -0400 Subject: [PATCH 0900/1127] add back 2213 to commercial activities --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index 5f972b83c..9799349c9 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -60,6 +60,7 @@ EPA_State_GHGI,Industry - Coal Mining - Fugitive - Post-Mining (Underground),NAI EPA_State_GHGI,Industry - Coal Mining - Fugitive - Surface Mining,NAICS_2012_Code,2121,,direct EPA_State_GHGI,Industry - Coal Mining - Fugitive - Underground Liberated,NAICS_2012_Code,2121,,direct EPA_State_GHGI,Industry - Coal Mining - Fugitive - Underground Recovered &Used For Energy,NAICS_2012_Code,2121,,direct +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,2213,,ind_com_ch4_n2o EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,42,,ind_com_ch4_n2o EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,44,,ind_com_ch4_n2o EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,45,,ind_com_ch4_n2o @@ -76,6 +77,7 @@ EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,72,,ind_com_ch4_n2o EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,81,,ind_com_ch4_n2o EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,923,,ind_com_ch4_n2o +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,2213,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,42,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,44,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,45,,use_table_coal @@ -92,6 +94,7 @@ EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combus EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,72,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,81,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,923,,use_table_coal +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,2213,,use_table_gas EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,42,,use_table_gas EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,44,,use_table_gas EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,45,,use_table_gas @@ -108,6 +111,7 @@ EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combus EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,72,,use_table_gas EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,81,,use_table_gas EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,923,,use_table_gas +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,2213,,use_table_pet EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,42,,use_table_pet EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,44,,use_table_pet EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,45,,use_table_pet @@ -229,6 +233,7 @@ EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mob EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,481,,transport_nonroad EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,482,,transport_nonroad EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,483,,transport_nonroad +EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,2213,,ods_substitutes EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,42,,ods_substitutes EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,44,,ods_substitutes EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,45,,ods_substitutes From a4cd493e4ad186fdf60a3ec8ba9015c3498723c8 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 4 Sep 2023 14:15:41 -0400 Subject: [PATCH 0901/1127] add 927 to commercial activities, consistent with national model --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index 9799349c9..8db97648e 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -77,6 +77,7 @@ EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,72,,ind_com_ch4_n2o EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,81,,ind_com_ch4_n2o EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,923,,ind_com_ch4_n2o +EPA_State_GHGI,Commercial - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,927,,ind_com_ch4_n2o EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,2213,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,42,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,44,,use_table_coal @@ -94,6 +95,7 @@ EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combus EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,72,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,81,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,923,,use_table_coal +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,927,,use_table_coal EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,2213,,use_table_gas EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,42,,use_table_gas EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,44,,use_table_gas @@ -111,6 +113,7 @@ EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combus EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,72,,use_table_gas EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,81,,use_table_gas EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,923,,use_table_gas +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,927,,use_table_gas EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,2213,,use_table_pet EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,42,,use_table_pet EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,44,,use_table_pet @@ -128,6 +131,7 @@ EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combus EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,72,,use_table_pet EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,81,,use_table_pet EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,923,,use_table_pet +EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,927,,use_table_pet EPA_State_GHGI,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation,NAICS_2012_Code,2211,,electric_power EPA_State_GHGI,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation,NAICS_2012_Code,S00101,,electric_power EPA_State_GHGI,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation,NAICS_2012_Code,S00202,,electric_power @@ -250,6 +254,7 @@ EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,72,,ods_substitutes EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,81,,ods_substitutes EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,923,,ods_substitutes +EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,927,,ods_substitutes EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,21,,ods_substitutes EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,23,,ods_substitutes EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,31,,ods_substitutes From a0d83ef685344a149f055a02332b7404e309f6a9 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 5 Sep 2023 09:40:55 -0400 Subject: [PATCH 0902/1127] further updates to align with national model --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 30 +++++++++------ .../EPA_StateGHGI_asets.csv | 4 +- .../GHG_state_2019_m3.yaml | 38 +++++++++++++++++++ 3 files changed, 59 insertions(+), 13 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index 8db97648e..f62569183 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -132,9 +132,9 @@ EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combus EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,81,,use_table_pet EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,923,,use_table_pet EPA_State_GHGI,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,927,,use_table_pet -EPA_State_GHGI,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation,NAICS_2012_Code,2211,,electric_power -EPA_State_GHGI,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation,NAICS_2012_Code,S00101,,electric_power -EPA_State_GHGI,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation,NAICS_2012_Code,S00202,,electric_power +EPA_State_GHGI,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation,NAICS_2012_Code,2211,,electric_ch4_n2o +EPA_State_GHGI,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation,NAICS_2012_Code,S00101,,electric_ch4_n2o +EPA_State_GHGI,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation,NAICS_2012_Code,S00202,,electric_ch4_n2o EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Coal,NAICS_2012_Code,2211,,electric_power EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Coal,NAICS_2012_Code,S00101,,electric_power EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Coal,NAICS_2012_Code,S00202,,electric_power @@ -147,6 +147,10 @@ EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossi EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum,NAICS_2012_Code,2211,,electric_power EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum,NAICS_2012_Code,S00101,,electric_power EPA_State_GHGI,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum,NAICS_2012_Code,S00202,,electric_power +EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,11,,ind_com_ch4_n2o +EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,21,,ind_com_ch4_n2o +EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,2212,,ind_com_ch4_n2o +EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,23,,ind_com_ch4_n2o EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,31,,ind_com_ch4_n2o EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,32,,ind_com_ch4_n2o EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,33,,ind_com_ch4_n2o @@ -155,15 +159,18 @@ EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combusti EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,33,,use_table_coal EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,11,,use_table_coal EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,21,,use_table_coal +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,2212,,use_table_coal EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,23,,use_table_coal EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,31,,use_table_gas EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,32,,use_table_gas EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,33,,use_table_gas EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,11,,use_table_gas EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,21,,use_table_gas +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,2212,,use_table_gas EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,23,,use_table_gas EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,NAICS_2012_Code,11,,use_table_pet EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,NAICS_2012_Code,21,,use_table_pet +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,NAICS_2012_Code,2212,,use_table_pet EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,NAICS_2012_Code,23,,use_table_pet EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,NAICS_2012_Code,31,,use_table_pet EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,NAICS_2012_Code,32,,use_table_pet @@ -214,14 +221,13 @@ EPA_State_GHGI,Industry - Natural Gas Systems - Fugitive,NAICS_2012_Code,486,,ng EPA_State_GHGI,Industry - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - Industrial,NAICS_2012_Code,31,,industrial_neu EPA_State_GHGI,Industry - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - Industrial,NAICS_2012_Code,32,,industrial_neu EPA_State_GHGI,Industry - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - Industrial,NAICS_2012_Code,33,,industrial_neu -EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,481,,transport_petroleum -EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,482,,transport_petroleum -EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,483,,transport_petroleum -EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,484,,transport_petroleum -EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,485,,transport_petroleum -EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,491,,transport_petroleum -EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,928,,transport_petroleum -EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,F010,,transport_petroleum +EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,48,,industrial_neu +EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,491,,industrial_neu +EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,492,,industrial_neu +EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,922,,industrial_neu +EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,928,,industrial_neu +EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,F010,,industrial_neu +EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,S00201,,industrial_neu EPA_State_GHGI,U.S. Territories - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - US Territories,,,,exclude - territories EPA_State_GHGI,Industry - Petroleum Systems - Fugitive,NAICS_2012_Code,2111,,pet_systems EPA_State_GHGI,Industry - Petroleum Systems - Fugitive,NAICS_2012_Code,3241,,pet_systems @@ -261,6 +267,7 @@ EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product u EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,32,,ods_substitutes EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,33,,ods_substitutes EPA_State_GHGI,Residential - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Residential,NAICS_2012_Code,F010,,direct_ods +EPA_State_GHGI,Transportation - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Transportation,NAICS_2012_Code,48,,ods_transportation EPA_State_GHGI,Transportation - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Transportation,NAICS_2012_Code,F010,,ods_transportation EPA_State_GHGI,Industry - Adipic Acid Production - Chemical Industry,NAICS_2012_Code,3251,,direct EPA_State_GHGI,Industry - Ammonia Production - Chemical Industry,NAICS_2012_Code,3313,,direct @@ -316,6 +323,7 @@ EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,114,,transport_nonroad EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,11,,use_table_pet EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,21,,use_table_pet +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,2212,,use_table_pet EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,23,,use_table_pet EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,31,,use_table_pet EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,32,,use_table_pet diff --git a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv index 6675ab5cb..e9b4da3ad 100644 --- a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv @@ -61,7 +61,7 @@ ind_com_ch4_n2o,Commercial - Stationary Combustion - Fossil Fuel Combustion, use_table_coal,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,EPA_GHGI_T_A_14 use_table_gas,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,EPA_GHGI_T_A_14 use_table_pet,Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,EPA_GHGI_T_A_14 -electric_power,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation, +electric_ch4_n2o,Electric Power Industry - Stationary Combustion - Fossil Fuel Combustion - Electricity Generation, electric_power,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Coal, electric_power,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Geothermal, electric_power,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Natural Gas, @@ -88,7 +88,7 @@ exclude,U.S. Territories - CO2 from Fossil Fuel Combustion - Fossil Fuel Combust direct,Electric Power Industry - Incineration of Waste - Incineration,EPA_GHGI_T_2_1 ng_systems,Industry - Natural Gas Systems - Fugitive,EPA_GHGI_T_3_63 industrial_neu,Industry - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - Industrial,EPA_GHGI_T_A_14 -transport_petroleum-UPDATENAME,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels, +industrial_neu,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels, exclude,U.S. Territories - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - US Territories, pet_systems,Industry - Petroleum Systems - Fugitive,EPA_GHGI_T_3_38 use_table_pet,Agriculture - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary, diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml index 705d7d445..00181efaa 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml @@ -353,11 +353,13 @@ source_names: - 'EPA_GHGI_T_3_8.coal_nonmanufacturing' - 'EPA_GHGI_T_3_8.ng_manufacturing' - 'EPA_GHGI_T_3_8.coal_manufacturing' + - 'EPA_GHGI_T_3_8.fuel_oil' - 'EPA_GHGI_T_3_9.natural_gas_nonmanufacturing' - 'EPA_GHGI_T_3_9.fuel_oil' - 'EPA_GHGI_T_3_9.coal_nonmanufacturing' - 'EPA_GHGI_T_3_9.ng_manufacturing' - 'EPA_GHGI_T_3_9.coal_manufacturing' + - 'EPA_GHGI_T_3_9.fuel_oil' attribution_method: proportional attribute_on: ['Flowable', 'SectorProducedBy'] fill_columns: Location @@ -368,6 +370,42 @@ source_names: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ind_com_ch4_n2o + electric_ch4_n2o: + selection_fields: + MetaSources: + - 'EPA_GHGI_T_3_8.electric_power' + - 'EPA_GHGI_T_3_9.electric_power' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv electric_ch4_n2o + + industrial_neu: + selection_fields: + MetaSources: + - 'EPA_GHGI_T_3_22.coal' + - 'EPA_GHGI_T_3_22.petroleum' + - 'EPA_GHGI_T_3_22.natural_gas' + - 'EPA_GHGI_T_3_22.transportation_lubricants' + - 'EPA_GHGI_T_3_22b.coal' + - 'EPA_GHGI_T_3_22b.petroleum' + - 'EPA_GHGI_T_3_22b.natural_gas' + - 'EPA_GHGI_T_3_22b.transportation_lubricants' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv industrial_neu + ods_substitutes: selection_fields: MetaSources: From b4389ca12a6fddc971386f203ee34ab8ee685f95 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 5 Sep 2023 10:01:34 -0400 Subject: [PATCH 0903/1127] separate non-road ag and mining emissions as new activities --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 12 ++++--- .../EPA_StateGHGI_asets.csv | 4 +-- .../GHG_state_2019_m3.yaml | 35 ++++++++++++++++--- 3 files changed, 40 insertions(+), 11 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index f62569183..d9eba8bf9 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -317,10 +317,10 @@ EPA_State_GHGI,Industry - Landfills - Industrial - Landfills - Industrial Landfi EPA_State_GHGI,Commercial - Landfills - Municipal - Landfills - MSW Landfill - MSW Landfills Net Emissions,NAICS_2012_Code,562212,,direct EPA_State_GHGI,Industry - Wastewater Treatment - Wastewater Treatment and Discharge - Industrial,NAICS_2012_Code,2213,,direct EPA_State_GHGI,Commercial - Wastewater Treatment - Wastewater Treatment and Discharge - Domestic,NAICS_2012_Code,2213,,direct -EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,111,,transport_nonroad -EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,112,,transport_nonroad -EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,113,,transport_nonroad -EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,114,,transport_nonroad +EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,111,,transport_nonroad_ag +EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,112,,transport_nonroad_ag +EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,113,,transport_nonroad_ag +EPA_State_GHGI,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,114,,transport_nonroad_ag EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,11,,use_table_pet EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,21,,use_table_pet EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,2212,,use_table_pet @@ -332,7 +332,9 @@ EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combu EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,112,,transport_nonroad EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,113,,transport_nonroad EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,114,,transport_nonroad -EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,NAICS_2012_Code,23,,transport_nonroad +EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,NAICS_2012_Code,211,,transport_nonroad_construction +EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,NAICS_2012_Code,212,,transport_nonroad_construction +EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,NAICS_2012_Code,213111,,transport_nonroad_construction EPA_State_GHGI,Electric Power Industry - Other Process Uses of Carbonates - Mineral Industry,NAICS_2012_Code,2211,,direct EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,31,,transport_nonroad EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,32,,transport_nonroad diff --git a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv index e9b4da3ad..4fe0776c4 100644 --- a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv @@ -143,10 +143,10 @@ direct,Industry - Landfills - Industrial - Landfills - Industrial Landfill - Ind direct,Commercial - Landfills - Municipal - Landfills - MSW Landfill - MSW Landfills Net Emissions,EPA_GHGI_T_2_1 direct,Industry - Wastewater Treatment - Wastewater Treatment and Discharge - Industrial,EPA_GHGI_T_2_1 direct,Commercial - Wastewater Treatment - Wastewater Treatment and Discharge - Domestic,EPA_GHGI_T_2_1 -transport_nonroad,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,EPA_GHGI_T_3_14 +transport_nonroad_ag,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,EPA_GHGI_T_3_14 use_table_pet,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,negative emissions; align with 'Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum' to avoid double counting transport_nonroad,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,EPA_GHGI_T_3_13 -transport_nonroad,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,EPA_GHGI_T_3_14 +transport_nonroad_construction,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,EPA_GHGI_T_3_14 direct,Electric Power Industry - Other Process Uses of Carbonates - Mineral Industry, transport_nonroad,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other, ind_com_ch4_n2o,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,negative emissions; align with 'Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial' to avoid double counting diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml index 00181efaa..9dab79986 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml @@ -270,12 +270,8 @@ source_names: transport_ch4_n2o_nonroad: selection_fields: MetaSources: - - 'EPA_GHGI_T_3_14.construction_and_mining' - - 'EPA_GHGI_T_3_14.farm_non_road' - 'EPA_GHGI_T_3_14.other_non_road' - 'EPA_GHGI_T_3_14.alt_fuel_on_road' - - 'EPA_GHGI_T_3_15.construction_and_mining' - - 'EPA_GHGI_T_3_15.farm_non_road' - 'EPA_GHGI_T_3_15.other_non_road' - 'EPA_GHGI_T_3_15.alt_fuel_on_road' attribution_method: proportional @@ -288,6 +284,37 @@ source_names: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad + transport_ch4_n2o_nonroad_ag: + selection_fields: + MetaSources: + - 'EPA_GHGI_T_3_14.farm_non_road' + - 'EPA_GHGI_T_3_15.farm_non_road' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad_ag + + transport_ch4_n2o_nonroad_construction: + selection_fields: + MetaSources: + - 'EPA_GHGI_T_3_14.construction_and_mining' + - 'EPA_GHGI_T_3_15.construction_and_mining' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad_construction + + ## Stationary Combustion stationary_residiential: selection_fields: From 9f8ad09fa46c50582590e2b516d2023e1898fcce Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 5 Sep 2023 08:06:48 -0600 Subject: [PATCH 0904/1127] add national employment fbs for 2019 and 2020 --- .../flowbysectormethods/Employment_national_2019.yaml | 10 ++++++++++ .../flowbysectormethods/Employment_national_2020.yaml | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/Employment_national_2019.yaml create mode 100644 flowsa/methods/flowbysectormethods/Employment_national_2020.yaml diff --git a/flowsa/methods/flowbysectormethods/Employment_national_2019.yaml b/flowsa/methods/flowbysectormethods/Employment_national_2019.yaml new file mode 100644 index 000000000..3cc73d684 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/Employment_national_2019.yaml @@ -0,0 +1,10 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: national + +source_names: + BLS_QCEW: !include:Employment_common.yaml:bls_load_and_clean_national + year: 2019 + activity_sets: + qcew: !include:Employment_common.yaml:bls_allocation diff --git a/flowsa/methods/flowbysectormethods/Employment_national_2020.yaml b/flowsa/methods/flowbysectormethods/Employment_national_2020.yaml new file mode 100644 index 000000000..1c8feff34 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/Employment_national_2020.yaml @@ -0,0 +1,10 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: national + +source_names: + BLS_QCEW: !include:Employment_common.yaml:bls_load_and_clean_national + year: 2020 + activity_sets: + qcew: !include:Employment_common.yaml:bls_allocation From 1bb3e1cc73a89c61a3826490096298713051485c Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 5 Sep 2023 10:14:42 -0400 Subject: [PATCH 0905/1127] download supporting tables first before generating --- flowsa/data_source_scripts/EPA_GHGI.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_GHGI.py b/flowsa/data_source_scripts/EPA_GHGI.py index 6c258894e..1331625c0 100644 --- a/flowsa/data_source_scripts/EPA_GHGI.py +++ b/flowsa/data_source_scripts/EPA_GHGI.py @@ -715,7 +715,8 @@ def get_manufacturing_energy_ratios(parameter_dict): # Filter MECS for total national energy consumption for manufacturing sectors mecs = load_fba_w_standardized_units(datasource=parameter_dict.get('energy_fba'), year=mecs_year, - flowclass='Energy') + flowclass='Energy', + download_FBA_if_missing=True) mecs = (mecs.loc[(mecs['ActivityConsumedBy'] == '31-33') & (mecs['Location'] == '00000') & (mecs['Description'].isin(['Table 3.2', 'Table 2.2'])) & @@ -725,7 +726,8 @@ def get_manufacturing_energy_ratios(parameter_dict): # Load energy consumption data by fuel from GHGI ghgi = load_fba_w_standardized_units(datasource=parameter_dict.get('ghg_fba'), year=mecs_year, - flowclass='Energy') + flowclass='Energy', + download_FBA_if_missing=True) ghgi = ghgi[ghgi['ActivityConsumedBy']=='Industrial'].reset_index(drop=True) pct_dict = {} @@ -786,7 +788,8 @@ def split_HFCs_by_type(fba: FlowByActivity, **_) -> FlowByActivity: tbl = fba.config.get('clean_parameter')['flow_fba'] # 4-100 splits = load_fba_w_standardized_units(datasource=tbl, - year=fba['Year'][0]) + year=fba['Year'][0], + download_FBA_if_missing=True) splits['pct'] = splits['FlowAmount'] / splits['FlowAmount'].sum() splits = splits[['FlowName', 'pct']] From e11d904af4cc8f784c2e0b42384b6b369a3b27ab Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 5 Sep 2023 10:22:53 -0400 Subject: [PATCH 0906/1127] split activities for mobile combustion to align state and national data --- .../GHG_national_m1_common.yaml | 18 ++++++++++++++---- .../flowbysectormethods/GHG_state_2019_m3.yaml | 6 ++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml index 3c5e2df65..b59265480 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml @@ -338,15 +338,25 @@ source_names: EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion fedefl_mapping: GHGI activity_sets: - direct_attribution: + direct_gasoline: + selection_fields: + PrimaryActivity: + Motorcycles Gasoline On-Road: Motorcycles + Medium- and Heavy-Duty Trucks and Buses Gasoline On-Road: Medium- and Heavy-Duty Trucks and Buses + attribution_method: direct + + direct_diesel: + selection_fields: + PrimaryActivity: + Medium- and Heavy-Duty Trucks and Buses Diesel On-Road: Medium- and Heavy-Duty Trucks and Buses + attribution_method: direct + + direct_non_road: selection_fields: PrimaryActivity: Rail Non-Road: Rail Ships and Boats Non-Road: Ships and Boats Aircraft Non-Road: General Aviation Aircraft - Motorcycles Gasoline On-Road: Motorcycles - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road: Medium- and Heavy-Duty Trucks and Buses - Medium- and Heavy-Duty Trucks and Buses Gasoline On-Road: Medium- and Heavy-Duty Trucks and Buses attribution_method: direct petroleum_fuels_diesel: diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml index 9dab79986..0b3b7fc49 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml @@ -241,7 +241,9 @@ source_names: selection_fields: MetaSources: - 'EPA_GHGI_T_3_14.petroleum_fuels_diesel' + - 'EPA_GHGI_T_3_14.direct_diesel' - 'EPA_GHGI_T_3_15.petroleum_fuels_diesel' + - 'EPA_GHGI_T_3_15.direct_diesel' attribution_method: proportional attribute_on: ['Flowable', 'SectorProducedBy'] fill_columns: Location @@ -256,7 +258,9 @@ source_names: selection_fields: MetaSources: - 'EPA_GHGI_T_3_14.petroleum_fuels_gasoline' + - 'EPA_GHGI_T_3_14.direct_gasoline' - 'EPA_GHGI_T_3_15.petroleum_fuels_gasoline' + - 'EPA_GHGI_T_3_15.direct_gasoline' attribution_method: proportional attribute_on: ['Flowable', 'SectorProducedBy'] fill_columns: Location @@ -270,8 +274,10 @@ source_names: transport_ch4_n2o_nonroad: selection_fields: MetaSources: + - 'EPA_GHGI_T_3_14.direct_non_road' # Ships, boats, rail - 'EPA_GHGI_T_3_14.other_non_road' - 'EPA_GHGI_T_3_14.alt_fuel_on_road' + - 'EPA_GHGI_T_3_15.direct_non_road' # Ships, boats, rail, air - 'EPA_GHGI_T_3_15.other_non_road' - 'EPA_GHGI_T_3_15.alt_fuel_on_road' attribution_method: proportional From b726087a5f6ca4a6d48e44d98ea76310de633c30 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 5 Sep 2023 10:36:14 -0400 Subject: [PATCH 0907/1127] align neu sectors with national model --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index d9eba8bf9..77bb685dc 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -218,16 +218,15 @@ EPA_State_GHGI,Electric Power Industry - Incineration of Waste - Incineration,NA EPA_State_GHGI,Industry - Natural Gas Systems - Fugitive,NAICS_2012_Code,2111,,ng_systems EPA_State_GHGI,Industry - Natural Gas Systems - Fugitive,NAICS_2012_Code,2212,,ng_systems EPA_State_GHGI,Industry - Natural Gas Systems - Fugitive,NAICS_2012_Code,486,,ng_systems +EPA_State_GHGI,Industry - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - Industrial,NAICS_2012_Code,212,,industrial_neu EPA_State_GHGI,Industry - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - Industrial,NAICS_2012_Code,31,,industrial_neu EPA_State_GHGI,Industry - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - Industrial,NAICS_2012_Code,32,,industrial_neu EPA_State_GHGI,Industry - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - Industrial,NAICS_2012_Code,33,,industrial_neu EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,48,,industrial_neu EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,491,,industrial_neu EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,492,,industrial_neu -EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,922,,industrial_neu -EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,928,,industrial_neu +EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,92,,industrial_neu EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,F010,,industrial_neu -EPA_State_GHGI,Transportation - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels,NAICS_2012_Code,S00201,,industrial_neu EPA_State_GHGI,U.S. Territories - Non-Energy Use of Fuels - Non-Energy Uses of Fossil Fuels - US Territories,,,,exclude - territories EPA_State_GHGI,Industry - Petroleum Systems - Fugitive,NAICS_2012_Code,2111,,pet_systems EPA_State_GHGI,Industry - Petroleum Systems - Fugitive,NAICS_2012_Code,3241,,pet_systems From 2cd1a150ffca1e657eafbd2928cacfa1b94a2165 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 5 Sep 2023 12:16:01 -0400 Subject: [PATCH 0908/1127] further separate nonroad emissions --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 21 ++++++++++++------- .../EPA_StateGHGI_asets.csv | 4 ++-- .../GHG_state_2019_m3.yaml | 17 +++++++++++++-- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index 77bb685dc..b5e8d22ba 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -327,17 +327,24 @@ EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combusti EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,31,,use_table_pet EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,32,,use_table_pet EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,33,,use_table_pet -EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,111,,transport_nonroad -EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,112,,transport_nonroad -EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,113,,transport_nonroad -EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,114,,transport_nonroad +EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,111,,tbd +EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,112,,tbd +EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,113,,tbd +EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,114,,tbd EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,NAICS_2012_Code,211,,transport_nonroad_construction EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,NAICS_2012_Code,212,,transport_nonroad_construction EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,NAICS_2012_Code,213111,,transport_nonroad_construction EPA_State_GHGI,Electric Power Industry - Other Process Uses of Carbonates - Mineral Industry,NAICS_2012_Code,2211,,direct -EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,31,,transport_nonroad -EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,32,,transport_nonroad -EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,33,,transport_nonroad +EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,485,,transport_nonroad_other +EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,487,,transport_nonroad_other +EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,488,,transport_nonroad_other +EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,492,,transport_nonroad_other +EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,5321,,transport_nonroad_other +EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,5324,,transport_nonroad_other +EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,6219,,transport_nonroad_other +EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,7139,,transport_nonroad_other +EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,8111,,transport_nonroad_other +EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,8113,,transport_nonroad_other EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,NAICS_2012_Code,31,,ind_com_ch4_n2o EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,NAICS_2012_Code,32,,ind_com_ch4_n2o EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,NAICS_2012_Code,33,,ind_com_ch4_n2o diff --git a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv index 4fe0776c4..0a373f405 100644 --- a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv @@ -145,9 +145,9 @@ direct,Industry - Wastewater Treatment - Wastewater Treatment and Discharge - In direct,Commercial - Wastewater Treatment - Wastewater Treatment and Discharge - Domestic,EPA_GHGI_T_2_1 transport_nonroad_ag,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,EPA_GHGI_T_3_14 use_table_pet,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,negative emissions; align with 'Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum' to avoid double counting -transport_nonroad,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,EPA_GHGI_T_3_13 +tbd,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,EPA_GHGI_T_3_13 transport_nonroad_construction,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,EPA_GHGI_T_3_14 direct,Electric Power Industry - Other Process Uses of Carbonates - Mineral Industry, -transport_nonroad,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other, +transport_nonroad_other,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other, ind_com_ch4_n2o,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,negative emissions; align with 'Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial' to avoid double counting nitrous_oxide_use,Industry - N2O from Product Uses - Other product manufacture and use,EPA_GHGI_T_2_1 diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml index 0b3b7fc49..983e45d87 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml @@ -275,10 +275,8 @@ source_names: selection_fields: MetaSources: - 'EPA_GHGI_T_3_14.direct_non_road' # Ships, boats, rail - - 'EPA_GHGI_T_3_14.other_non_road' - 'EPA_GHGI_T_3_14.alt_fuel_on_road' - 'EPA_GHGI_T_3_15.direct_non_road' # Ships, boats, rail, air - - 'EPA_GHGI_T_3_15.other_non_road' - 'EPA_GHGI_T_3_15.alt_fuel_on_road' attribution_method: proportional attribute_on: ['Flowable', 'SectorProducedBy'] @@ -290,6 +288,21 @@ source_names: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad + transport_ch4_n2o_nonroad_other: + selection_fields: + MetaSources: + - 'EPA_GHGI_T_3_14.other_non_road' + - 'EPA_GHGI_T_3_15.other_non_road' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad_other + transport_ch4_n2o_nonroad_ag: selection_fields: MetaSources: From bf0650002e207e50a98702a3b2a9a3a6977da5c3 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 5 Sep 2023 12:56:18 -0400 Subject: [PATCH 0909/1127] to align with foams, expand mapping for ODS substitutes --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index b5e8d22ba..e5382e3f3 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -246,7 +246,8 @@ EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,42,,ods_substitutes EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,44,,ods_substitutes EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,45,,ods_substitutes -EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,493,,ods_substitutes +EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,48,,ods_substitutes +EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,49,,ods_substitutes EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,51,,ods_substitutes EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,52,,ods_substitutes EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,53,,ods_substitutes @@ -258,8 +259,8 @@ EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,71,,ods_substitutes EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,72,,ods_substitutes EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,81,,ods_substitutes -EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,923,,ods_substitutes -EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,927,,ods_substitutes +EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,92,,ods_substitutes +EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,F010,,ods_substitutes EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,21,,ods_substitutes EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,23,,ods_substitutes EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,31,,ods_substitutes From 03a3cb74333efc2da45bc190262c7ff3359e9e10 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 5 Sep 2023 13:07:29 -0400 Subject: [PATCH 0910/1127] fix alternative fuels --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 8 ++++---- .../EPA_StateGHGI_asets.csv | 2 +- .../GHG_state_2019_m3.yaml | 19 ++++++++++++++++--- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index e5382e3f3..c073a6ba9 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -182,10 +182,10 @@ EPA_State_GHGI,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combu EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,482,,direct EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,485,,transport_ng EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,486,,transport_ng -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway,NAICS_2012_Code,48,,transport_petroleum -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway,NAICS_2012_Code,491,,transport_petroleum -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway,NAICS_2012_Code,492,,transport_petroleum -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway,NAICS_2012_Code,F010,,transport_petroleum +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway,NAICS_2012_Code,48,,transport_alt_fuel +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway,NAICS_2012_Code,491,,transport_alt_fuel +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway,NAICS_2012_Code,492,,transport_alt_fuel +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway,NAICS_2012_Code,F010,,transport_alt_fuel EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,48,,transport_petroleum EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,491,,transport_petroleum EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,492,,transport_petroleum diff --git a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv index 0a373f405..d1cdee132 100644 --- a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv @@ -76,7 +76,7 @@ residential_co2,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Comb residential_co2,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum, direct,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal, transport_ng,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,EPA_GHGI_T_A_14 -transport_petroleum,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway, +transport_alt_fuel,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway, transport_petroleum,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,EPA_GHGI_T_A_14 transport_diesel,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,EPA_GHGI_T_3_14 transport_gasoline,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,EPA_GHGI_T_3_14 diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml index 983e45d87..3f31f3107 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml @@ -271,16 +271,29 @@ source_names: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_gasoline - transport_ch4_n2o_nonroad: + transport_ch4_n2o_alt: selection_fields: MetaSources: - - 'EPA_GHGI_T_3_14.direct_non_road' # Ships, boats, rail - 'EPA_GHGI_T_3_14.alt_fuel_on_road' - - 'EPA_GHGI_T_3_15.direct_non_road' # Ships, boats, rail, air - 'EPA_GHGI_T_3_15.alt_fuel_on_road' attribution_method: proportional attribute_on: ['Flowable', 'SectorProducedBy'] fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_alt_fuel + + transport_ch4_n2o_nonroad: + selection_fields: + MetaSources: # Ships, boats, rail, air + - 'EPA_GHGI_T_3_14.direct_non_road' + - 'EPA_GHGI_T_3_15.direct_non_road' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location attribution_source: EPA_StateGHGI: geoscale: state From 1e7a5390b441192746ff69c2a8d56f9114844be9 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 5 Sep 2023 13:08:04 -0400 Subject: [PATCH 0911/1127] add digits to chemicals, fix Ammonia --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index c073a6ba9..33515c6e9 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -269,20 +269,20 @@ EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product u EPA_State_GHGI,Residential - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Residential,NAICS_2012_Code,F010,,direct_ods EPA_State_GHGI,Transportation - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Transportation,NAICS_2012_Code,48,,ods_transportation EPA_State_GHGI,Transportation - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Transportation,NAICS_2012_Code,F010,,ods_transportation -EPA_State_GHGI,Industry - Adipic Acid Production - Chemical Industry,NAICS_2012_Code,3251,,direct -EPA_State_GHGI,Industry - Ammonia Production - Chemical Industry,NAICS_2012_Code,3313,,direct -EPA_State_GHGI,"Industry - Caprolactam, Glyoxal,and Glyoxylic Acid Production - Chemical Industry - Caprolactam Production",NAICS_2012_Code,3251,,direct -EPA_State_GHGI,Industry - Nitric Acid Production - Chemical Industry,NAICS_2012_Code,3253,,direct +EPA_State_GHGI,Industry - Adipic Acid Production - Chemical Industry,NAICS_2012_Code,32519,,direct +EPA_State_GHGI,Industry - Ammonia Production - Chemical Industry,NAICS_2012_Code,32531,,direct +EPA_State_GHGI,"Industry - Caprolactam, Glyoxal,and Glyoxylic Acid Production - Chemical Industry - Caprolactam Production",NAICS_2012_Code,32519,,direct +EPA_State_GHGI,Industry - Nitric Acid Production - Chemical Industry,NAICS_2012_Code,32531,,direct EPA_State_GHGI,Industry - Petrochemical Production - Chemical Industry - Acrylonitrile,NAICS_2012_Code,3251,,petrochemicals EPA_State_GHGI,Industry - Petrochemical Production - Chemical Industry - Carbon Black,NAICS_2012_Code,3251,,petrochemicals EPA_State_GHGI,Industry - Petrochemical Production - Chemical Industry - Ethylene,NAICS_2012_Code,3241,,petrochemicals EPA_State_GHGI,Industry - Petrochemical Production - Chemical Industry - Ethylene Dichloride,NAICS_2012_Code,3251,,petrochemicals EPA_State_GHGI,Industry - Petrochemical Production - Chemical Industry - Ethylene Oxide,NAICS_2012_Code,3251,,petrochemicals EPA_State_GHGI,Industry - Petrochemical Production - Chemical Industry - Methanol,NAICS_2012_Code,3251,,petrochemicals -EPA_State_GHGI,Industry - Phosphoric Acid Production - Chemical Industry,NAICS_2012_Code,3253,,direct -EPA_State_GHGI,Industry - Carbide Production and Consumption - Chemical Industry - Silicon Carbide Production and Consumption,NAICS_2012_Code,3251,,direct -EPA_State_GHGI,Industry - Soda Ash Production - Chemical Industry,NAICS_2012_Code,3251,,direct -EPA_State_GHGI,Industry - Titanium Dioxide Production - Chemical Industry,NAICS_2012_Code,3251,,direct +EPA_State_GHGI,Industry - Phosphoric Acid Production - Chemical Industry,NAICS_2012_Code,32531,,direct +EPA_State_GHGI,Industry - Carbide Production and Consumption - Chemical Industry - Silicon Carbide Production and Consumption,NAICS_2012_Code,32518,,direct +EPA_State_GHGI,Industry - Soda Ash Production - Chemical Industry,NAICS_2012_Code,32519,,direct +EPA_State_GHGI,Industry - Titanium Dioxide Production - Chemical Industry,NAICS_2012_Code,32519,,direct EPA_State_GHGI,Industry - Urea Consumption for Non-Agricultural Purposes - Chemical Industry - Urea Consumption for Non-Agricultural Uses,NAICS_2012_Code,31,,use_table_chem EPA_State_GHGI,Industry - Urea Consumption for Non-Agricultural Purposes - Chemical Industry - Urea Consumption for Non-Agricultural Uses,NAICS_2012_Code,32,,use_table_chem EPA_State_GHGI,Industry - Urea Consumption for Non-Agricultural Purposes - Chemical Industry - Urea Consumption for Non-Agricultural Uses,NAICS_2012_Code,33,,use_table_chem From f98abfa403f1751dea9fff3f348c0ef7b8bc6a9f Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 5 Sep 2023 13:11:18 -0400 Subject: [PATCH 0912/1127] add check on HFC splits --- flowsa/data_source_scripts/EPA_GHGI.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flowsa/data_source_scripts/EPA_GHGI.py b/flowsa/data_source_scripts/EPA_GHGI.py index 1331625c0..46c544ebe 100644 --- a/flowsa/data_source_scripts/EPA_GHGI.py +++ b/flowsa/data_source_scripts/EPA_GHGI.py @@ -785,7 +785,7 @@ def split_HFCs_by_type(fba: FlowByActivity, **_) -> FlowByActivity: attributes_to_save = { attr: getattr(fba, attr) for attr in fba._metadata + ['_metadata'] } - + original_sum = fba.FlowAmount.sum() tbl = fba.config.get('clean_parameter')['flow_fba'] # 4-100 splits = load_fba_w_standardized_units(datasource=tbl, year=fba['Year'][0], @@ -803,6 +803,9 @@ def split_HFCs_by_type(fba: FlowByActivity, **_) -> FlowByActivity: .drop(columns=['FlowName', 'FlowAmount']) .rename(columns={'Flow': 'FlowName', 'value': 'FlowAmount'})) + new_sum = fba.FlowAmount.sum() + if round(new_sum, 6) != round(original_sum, 6): + log.warning('Error: totals do not match when splitting HFCs') new_fba = FlowByActivity(fba) for attr in attributes_to_save: setattr(new_fba, attr, attributes_to_save[attr]) From 7e9841784bcea8b13aea1a1c6cda2684b9a70b29 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 5 Sep 2023 13:16:04 -0400 Subject: [PATCH 0913/1127] update notes --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index 33515c6e9..5d29902bb 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -48,8 +48,8 @@ EPA_State_GHGI,Agriculture - Manure Management - Poultry,NAICS_2012_Code,1123,,a EPA_State_GHGI,Agriculture - Manure Management - Sheep,NAICS_2012_Code,11241,,ag_livestock EPA_State_GHGI,Agriculture - Manure Management - Swine,NAICS_2012_Code,1122,,ag_livestock EPA_State_GHGI,Agriculture - Rice Cultivation,NAICS_2012_Code,1111,,direct -EPA_State_GHGI,"Agriculture - Urea Fertilization - CO2 emissions from liming, urea application and other carbon-containing fertilizers",NAICS_2012_Code,111,,ag -EPA_State_GHGI,"Agriculture - Urea Fertilization - CO2 emissions from liming, urea application and other carbon-containing fertilizers",NAICS_2012_Code,112,,ag +EPA_State_GHGI,"Agriculture - Urea Fertilization - CO2 emissions from liming, urea application and other carbon-containing fertilizers",NAICS_2012_Code,111,,urea +EPA_State_GHGI,"Agriculture - Urea Fertilization - CO2 emissions from liming, urea application and other carbon-containing fertilizers",NAICS_2012_Code,112,,urea EPA_State_GHGI,Industry - Abandoned Oil and Gas Wells - Fugitive - Abandoned Wells,NAICS_2012_Code,2111,,direct EPA_State_GHGI,Industry - Abandoned Underground Coal Mines - Fugitive - Coal Mining - Abandoned Coal Mines - Liberated,NAICS_2012_Code,2121,,direct EPA_State_GHGI,Industry - Abandoned Underground Coal Mines - Fugitive - Coal Mining - Abandoned Coal Mines - Recovered &Used,NAICS_2012_Code,2121,,direct @@ -176,9 +176,9 @@ EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combusti EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,NAICS_2012_Code,32,,use_table_pet EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,NAICS_2012_Code,33,,use_table_pet EPA_State_GHGI,Residential - Stationary Combustion - Fossil Fuel Combustion,NAICS_2012_Code,F010,,direct -EPA_State_GHGI,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,F010,,direct -EPA_State_GHGI,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,F010,,direct -EPA_State_GHGI,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,F010,,direct +EPA_State_GHGI,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,F010,,residential_co2 +EPA_State_GHGI,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,F010,,residential_co2 +EPA_State_GHGI,Residential - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,F010,,residential_co2 EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal,NAICS_2012_Code,482,,direct EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,485,,transport_ng EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas,NAICS_2012_Code,486,,transport_ng @@ -283,9 +283,9 @@ EPA_State_GHGI,Industry - Phosphoric Acid Production - Chemical Industry,NAICS_2 EPA_State_GHGI,Industry - Carbide Production and Consumption - Chemical Industry - Silicon Carbide Production and Consumption,NAICS_2012_Code,32518,,direct EPA_State_GHGI,Industry - Soda Ash Production - Chemical Industry,NAICS_2012_Code,32519,,direct EPA_State_GHGI,Industry - Titanium Dioxide Production - Chemical Industry,NAICS_2012_Code,32519,,direct -EPA_State_GHGI,Industry - Urea Consumption for Non-Agricultural Purposes - Chemical Industry - Urea Consumption for Non-Agricultural Uses,NAICS_2012_Code,31,,use_table_chem -EPA_State_GHGI,Industry - Urea Consumption for Non-Agricultural Purposes - Chemical Industry - Urea Consumption for Non-Agricultural Uses,NAICS_2012_Code,32,,use_table_chem -EPA_State_GHGI,Industry - Urea Consumption for Non-Agricultural Purposes - Chemical Industry - Urea Consumption for Non-Agricultural Uses,NAICS_2012_Code,33,,use_table_chem +EPA_State_GHGI,Industry - Urea Consumption for Non-Agricultural Purposes - Chemical Industry - Urea Consumption for Non-Agricultural Uses,NAICS_2012_Code,31,,urea +EPA_State_GHGI,Industry - Urea Consumption for Non-Agricultural Purposes - Chemical Industry - Urea Consumption for Non-Agricultural Uses,NAICS_2012_Code,32,,urea +EPA_State_GHGI,Industry - Urea Consumption for Non-Agricultural Purposes - Chemical Industry - Urea Consumption for Non-Agricultural Uses,NAICS_2012_Code,33,,urea EPA_State_GHGI,Industry - Electronics Industry - Micro-Electro-Mechanical Devices,NAICS_2012_Code,3332,,direct EPA_State_GHGI,Industry - Electronics Industry - Photovoltaics,NAICS_2012_Code,334413,,direct EPA_State_GHGI,Industry - Electronics Industry - Semiconductor Manufacture,NAICS_2012_Code,3344,,direct @@ -298,16 +298,16 @@ EPA_State_GHGI,Industry - Iron and Steel Production - Metal Industry - Other Act EPA_State_GHGI,Industry - Iron and Steel Production - Metal Industry - Pellet Production,NAICS_2012_Code,3311,,direct EPA_State_GHGI,Industry - Iron and Steel Production - Metal Industry - Sinter Production,NAICS_2012_Code,3311,,direct EPA_State_GHGI,Industry - Iron and Steel Production - Metal Industry - Steel Production,NAICS_2012_Code,3311,,direct -EPA_State_GHGI,Industry - Lead Production - Metal Industry,NAICS_2012_Code,3314,,direct +EPA_State_GHGI,Industry - Lead Production - Metal Industry,NAICS_2012_Code,3314,,lead EPA_State_GHGI,Industry - Magnesium Production and Processing - Metal Industry,NAICS_2012_Code,331,,magnesium EPA_State_GHGI,Industry - Zinc Production - Metal Industry,NAICS_2012_Code,3314,,direct EPA_State_GHGI,Industry - Carbon Dioxide Consumption - Mineral Industry,,,,exclude EPA_State_GHGI,Industry - Cement Production - Mineral Industry - Cement Manufacture,NAICS_2012_Code,3273,,direct EPA_State_GHGI,Industry - Glass Production - Mineral Industry,NAICS_2012_Code,3272,,direct EPA_State_GHGI,Industry - Lime Production - Mineral Industry - Lime Manufacture,NAICS_2012_Code,3274,,direct -EPA_State_GHGI,Industry - Other Process Uses of Carbonates - Mineral Industry,NAICS_2012_Code,31,,use_table_chem -EPA_State_GHGI,Industry - Other Process Uses of Carbonates - Mineral Industry,NAICS_2012_Code,32,,use_table_chem -EPA_State_GHGI,Industry - Other Process Uses of Carbonates - Mineral Industry,NAICS_2012_Code,33,,use_table_chem +EPA_State_GHGI,Industry - Other Process Uses of Carbonates - Mineral Industry,NAICS_2012_Code,31,,carbonate_use +EPA_State_GHGI,Industry - Other Process Uses of Carbonates - Mineral Industry,NAICS_2012_Code,32,,carbonate_use +EPA_State_GHGI,Industry - Other Process Uses of Carbonates - Mineral Industry,NAICS_2012_Code,33,,carbonate_use EPA_State_GHGI,Electric Power Industry - Electrical Transmission and Distribution - Other product manufacture and use - Electric Power Systems,NAICS_2012_Code,22112,,electricity_transmission EPA_State_GHGI,Electric Power Industry - Electrical Transmission and Distribution - Other product manufacture and use - Equipment OEM,NAICS_2012_Code,22112,,electricity_transmission EPA_State_GHGI,Industry - HCFC-22 Production - Production and Use of Fluorinated Gases,NAICS_2012_Code,325120,,hcfc @@ -349,6 +349,6 @@ EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile No EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,NAICS_2012_Code,31,,ind_com_ch4_n2o EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,NAICS_2012_Code,32,,ind_com_ch4_n2o EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,NAICS_2012_Code,33,,ind_com_ch4_n2o -EPA_State_GHGI,Industry - N2O from Product Uses - Other product manufacture and use,NAICS_2012_Code,621,,use_table_chem -EPA_State_GHGI,Industry - N2O from Product Uses - Other product manufacture and use,NAICS_2012_Code,622,,use_table_chem -EPA_State_GHGI,Industry - N2O from Product Uses - Other product manufacture and use,NAICS_2012_Code,623,,use_table_chem +EPA_State_GHGI,Industry - N2O from Product Uses - Other product manufacture and use,NAICS_2012_Code,621,,nitrous_oxide_use +EPA_State_GHGI,Industry - N2O from Product Uses - Other product manufacture and use,NAICS_2012_Code,622,,nitrous_oxide_use +EPA_State_GHGI,Industry - N2O from Product Uses - Other product manufacture and use,NAICS_2012_Code,623,,nitrous_oxide_use From 81d439c67c094be4c89d2b46af7e0ce7999f801f Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 5 Sep 2023 13:25:15 -0400 Subject: [PATCH 0914/1127] avoid FutureWarning when col is NA --- flowsa/validation.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flowsa/validation.py b/flowsa/validation.py index e6e3069ae..6a192f200 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -321,6 +321,9 @@ def compare_national_state_fbs(dataname=None, year=None, method=None, groupby_fields = ['Flowable','Context','SectorProducedBy', 'SectorConsumedBy', 'Unit', 'Location', 'FlowUUID'] + for g in groupby_fields: + if national[g].isna().all() & state[g].isna().all(): + groupby_fields.remove(g) if compare_metasources: groupby_fields = groupby_fields + ['MetaSources'] subset_fields = groupby_fields + ['FlowAmount'] From ffd418764970dd4c25a36c5d626d31ffb98eb09b Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 5 Sep 2023 13:59:36 -0400 Subject: [PATCH 0915/1127] rename to common method --- .../{GHG_state_2019_m3.yaml => GHG_state_common_m2.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename flowsa/methods/flowbysectormethods/{GHG_state_2019_m3.yaml => GHG_state_common_m2.yaml} (100%) diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml b/flowsa/methods/flowbysectormethods/GHG_state_common_m2.yaml similarity index 100% rename from flowsa/methods/flowbysectormethods/GHG_state_2019_m3.yaml rename to flowsa/methods/flowbysectormethods/GHG_state_common_m2.yaml From d6b4bcabdeb1f11cd80c08b1c67bcfbeb24b0962 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 5 Sep 2023 14:02:06 -0400 Subject: [PATCH 0916/1127] delete old state _m2 --- .../GHG_state_2019_m2.yaml | 380 ------------------ 1 file changed, 380 deletions(-) delete mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml deleted file mode 100644 index ea11ed0de..000000000 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml +++ /dev/null @@ -1,380 +0,0 @@ - - - -!include:USEEIO_summary_target.yaml -year: &ghg_year 2019 -mecs_year: &mecs_year 2018 -geoscale: state - - -source_names: -## Directly sourced from State Inventory - EPA_StateGHGI: - geoscale: state - year: *ghg_year - fedefl_mapping: GHGI - activity_sets: - electricity_transmission: #SF6 - # replicates electricity_transmission from EPA_GHGI_T_2_1 - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv electricity_transmission - attribution_method: direct - petrochemicals: #CO2 for selected petrochemicals - # replicates EPA_GHGI_T_4_46 - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv petrochemicals - attribution_method: direct - ag_livestock: #CH4 from Enteric Fermentation, CH4, N2O from manure - # replicates EPA_GHGI_T_5_3 and EPA_GHGI_T_5_6 - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ag_livestock - attribution_method: direct - ag_burning: #CH4, N2O, CO and NOx from field burning of residue - # replicates EPA_GHGI_T_5_28 - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ag_burning - attribution_method: direct - hcfc: # HFCs from HCFC-22 production - # replicates EPA_GHGI_T_4_50 - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv hcfc - attribution_method: direct - - - EPA_GHGI_T_2_1: #U.S. GHG emissions - year: *ghg_year - fedefl_mapping: GHGI - geoscale: national - activity_sets: - direct: - ## TODO review these for possible direct attribution from StateGHGI - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:direct - attribute: - - attribution_method: direct - - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct - - electric_power: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power - attribute: - - attribution_method: proportional - attribution_source: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power:attribution_source - - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv electric_power - - liming: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming - attribute: - - attribution_method: proportional - attribution_source: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming:attribution_source - - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv liming - - urea: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea - attribute: - - attribution_method: proportional - attribution_source: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea:attribution_source - - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv urea - - carbonate_use: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use - attribute: - - attribution_method: proportional - attribution_source: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use:attribution_source - - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv carbonate_use - - lead: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead - attribute: - - attribution_method: proportional - attribution_source: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source - - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv lead - - nitrous_oxide_use: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use - attribute: - - attribution_method: proportional - attribution_source: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use:attribution_source - - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv nitrous_oxide_use - -## Fossil Fuels - EPA_GHGI_T_3_68: &natgas #CH4 from Natural Gas Systems - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 - year: *ghg_year - geoscale: national - attribute: - - attribution_method: direct - - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ng_systems - EPA_GHGI_T_3_70: *natgas #CO2 from Natural Gas Systems, mimics CH4 - EPA_GHGI_T_3_72: *natgas #N2O from Natural Gas Systems, mimics CH4 - - - EPA_GHGI_T_3_42: &petroleum #CH4 from Petroleum Systems - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 - year: *ghg_year - geoscale: national - attribute: - - attribution_method: direct - - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv pet_systems - EPA_GHGI_T_3_44: *petroleum #CO2 from Petroleum Systems, mimics CH4 - EPA_GHGI_T_3_46: *petroleum #N2O from Petroleum Systems, mimics CH4 - -## Agriculture - EPA_GHGI_T_5_17: #Direct N2O emissions from agricultural soils - year: *ghg_year - geoscale: national - fedefl_mapping: GHGI - activity_sets: - fertilizer_use: &fertilizer # allocated based on fertilizer use - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets:fertilizer_use - attribute: - - attribution_method: proportional - attribution_source: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets:fertilizer_use:attribution_source - - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv n2o_soil_direct - -## Mobile Sources - EPA_GHGI_T_3_13: #CO2 from mobile combustion - year: *ghg_year - geoscale: national - fedefl_mapping: GHGI - activity_sets: - direct_petroleum: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:direct_petroleum - attribute: - - attribution_method: direct - - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_petroleum - direct_ng: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:direct_ng - attribute: - - attribution_method: direct - - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_ng - - petroleum_fuels: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels - attribute: - - attribution_method: proportional - attribution_source: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source - - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_petroleum - -## Stationary Combustion - EPA_GHGI_T_A_6: # CO2 emissions from stationary combustion - year: *ghg_year - geoscale: national - fedefl_mapping: GHGI - clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion - clean_parameter: # Override each year for use in allocate_industrial_combustion - energy_fba: 'EIA_MECS_Energy' - year: *mecs_year - ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table - activity_sets: - direct_attribution: #direct allocation - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:direct_attribution - attribute: - - attribution_method: direct - - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv residential_co2 - - non-manufacturing_coal: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:non-manufacturing_coal - attribute: - - attribution_method: proportional - attribution_source: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:non-manufacturing_coal:attribution_source - - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_coal - - non-manufacturing_natural_gas: # Applies to non-manufacturing sectors like ag and mining - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:non-manufacturing_natural_gas - attribute: - - attribution_method: proportional - attribution_source: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:non-manufacturing_natural_gas:attribution_source - - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_gas - - coal_manufacturing: # Industrial Coal for Manufacturing - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing - attribute: - - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_coal - - natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing - attribute: - - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_gas - - - petroleum: # Petroleum - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:petroleum - attribute: - - attribution_method: proportional - attribution_source: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:petroleum:attribution_source - - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_pet - - - From e1a7e11c62812d1628e95a991a8d0352c632ca2f Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 6 Sep 2023 08:48:32 -0600 Subject: [PATCH 0917/1127] address issues of dropped state/national blm_pls data --- flowsa/data_source_scripts/BLM_PLS.py | 31 +++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/flowsa/data_source_scripts/BLM_PLS.py b/flowsa/data_source_scripts/BLM_PLS.py index f27da9871..d601fdda0 100644 --- a/flowsa/data_source_scripts/BLM_PLS.py +++ b/flowsa/data_source_scripts/BLM_PLS.py @@ -25,6 +25,12 @@ def split(row, header, sub_header, next_line): :param next_line: next row :return: data appropriately split """ + # ensure space after "Leases" + row["one"] = (row["one"] + .replace("Leases", " Leases ") + .replace(" ", " ") + .strip() + ) flow_amount = "" num_in_state = False @@ -107,13 +113,15 @@ def split(row, header, sub_header, next_line): elif "Leases" in split_str_one[2] or "III" in \ split_str_one[2] or "Act" in split_str_one: if next_line: - column = 6 else: if isinstance(split_str_two, float): column = 2 else: - if len(split_str_two) == 0: + if (len(split_str_two) == 0) & \ + (split_str_one[2] == "Leases"): + column = 6 + elif len(split_str_two) == 0: column = 2 elif split_str_two[0] == "None": column = 8 @@ -140,8 +148,9 @@ def split(row, header, sub_header, next_line): column = 6 elif len(split_str_one) == 7: if "/" in split_str_one[2]: - if "/" in split_str_one[3]: - column = 7 + column = 6 + elif split_str_one[3]: + column = 7 else: if any(i.isdigit() for i in split_str_one[1]): @@ -178,6 +187,8 @@ def split(row, header, sub_header, next_line): flow_amount = split_str_one[5] elif column == 8: flow_amount = split_str_one[6] + elif column == 0: + log.warning('FlowAmount is 0, check split() allocations.') if next_line: location_str = "Total" @@ -493,8 +504,13 @@ def blm_pls_call(*, resp, year, **_): pdf_page = read_pdf(io.BytesIO(resp.content), pages=page_number, stream=True, guess=False)[0] + # drop nan rows + pdf_page = (pdf_page + .dropna(axis=0, how='all') + .reset_index(drop=True)) - if pdf_page.shape[1] == 1: + page_shape = pdf_page.shape[1] + if page_shape == 1: pdf_page.columns = ["one"] else: pdf_page.columns = ["one", "two"] @@ -558,7 +574,7 @@ def blm_pls_call(*, resp, year, **_): else: row_one_str = row["one"] - if pdf_page.shape[1] == 1 and \ + if page_shape == 1 and \ row["one"] == "Total": next_line = True elif row_one_str.strip() == "Total" or \ @@ -577,6 +593,9 @@ def blm_pls_call(*, resp, year, **_): df["ActivityConsumedBy"] = flow_name df["FlowAmount"] = flow_value + # drop where flowamount is null, at times due to duplicated info + df = df.query("FlowAmount != ''").reset_index(drop=True) + return df From 9e15f195b4fa74f0e6fe19e3a5f19f7c9e63f80c Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 6 Sep 2023 08:49:45 -0600 Subject: [PATCH 0918/1127] drop extra column added to FBA --- flowsa/data_source_scripts/EIA_CBECS_Land.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/data_source_scripts/EIA_CBECS_Land.py b/flowsa/data_source_scripts/EIA_CBECS_Land.py index 6f6fd6a63..b9c9ad753 100644 --- a/flowsa/data_source_scripts/EIA_CBECS_Land.py +++ b/flowsa/data_source_scripts/EIA_CBECS_Land.py @@ -313,7 +313,7 @@ def calculate_floorspace_based_on_number_of_floors(fba_load): fba3 = fba3.assign(Description='Building Footprint') fba4 = fba3.aggregate_flowby() - return fba4 + return fba4.drop(columns=['DivisionFactor']) def disaggregate_eia_cbecs_mercentile(df_load): From d148eda9bd54146da627cff1881432ca512c7626 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 6 Sep 2023 08:50:44 -0600 Subject: [PATCH 0919/1127] add DC data to ERS MLU FBA --- flowsa/data_source_scripts/USDA_ERS_MLU.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flowsa/data_source_scripts/USDA_ERS_MLU.py b/flowsa/data_source_scripts/USDA_ERS_MLU.py index 15b54780b..401db4a5d 100644 --- a/flowsa/data_source_scripts/USDA_ERS_MLU.py +++ b/flowsa/data_source_scripts/USDA_ERS_MLU.py @@ -57,6 +57,9 @@ def mlu_parse(*, df_list, source, year, **_): var_name="FlowName", value_name="FlowAmount") + # rename states to match with FIPS crosswalk + df = df.replace('District of Columbia', 'District Of Columbia') + # load fips codes and merge fips = get_all_state_FIPS_2() fips['State'] = fips['State'].apply(lambda x: x.title()) From f8bdac9cc086b5c3582e53c930125aca99cbb9bb Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 6 Sep 2023 08:51:47 -0600 Subject: [PATCH 0920/1127] state urban land use - attribute national residential area to states based on weighted state urban land area --- flowsa/data_source_scripts/USDA_ERS_MLU.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/flowsa/data_source_scripts/USDA_ERS_MLU.py b/flowsa/data_source_scripts/USDA_ERS_MLU.py index 401db4a5d..96c02c6ab 100644 --- a/flowsa/data_source_scripts/USDA_ERS_MLU.py +++ b/flowsa/data_source_scripts/USDA_ERS_MLU.py @@ -138,7 +138,18 @@ def allocate_usda_ers_mlu_land_in_urban_areas( # calculate total residential area from the American Housing Survey residential_land_area = get_area_of_urban_land_occupied_by_houses_2013() df_residential = fba[fba[sector_col] == 'F01000'] - df_residential = df_residential.assign(FlowAmount=residential_land_area) + # if it is state data, take weighted avg using land area + if fba.config['geoscale'] == 'state': + df_residential = (df_residential + .assign(rural_res=residential_land_area, + total_area=df_residential['FlowAmount'].sum(), + FlowAmount=lambda x: x['FlowAmount']/x[ + 'total_area'] * x['rural_res'] + ) + ) + else: + df_residential = df_residential.assign(FlowAmount=residential_land_area) + df_residential['group_id'] = 0 # make an assumption about the percent of urban area that is open space openspace_multiplier = get_open_space_fraction_of_urban_area() @@ -212,7 +223,8 @@ def allocate_usda_ers_mlu_land_in_urban_areas( [df_residential, df_openspace, df_airport, df_railroad, df_highway2], ignore_index=True, sort=False).reset_index(drop=True) - return allocated_urban_areas_df + return allocated_urban_areas_df.drop(columns=['rurl_res', 'total_area'], + errors='ignore') def allocate_usda_ers_mlu_land_in_rural_transportation_areas( From ffb83d7db9a273ff8b3f509d8708b74342ddbd4f Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 6 Sep 2023 08:53:01 -0600 Subject: [PATCH 0921/1127] modify land FBS method so state sectors sum to national --- .../Land_national_2012.yaml | 6 ++- .../flowbysectormethods/Land_state_2012.yaml | 44 +++++++++++++------ 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Land_national_2012.yaml b/flowsa/methods/flowbysectormethods/Land_national_2012.yaml index 5412b54b3..a036a0343 100644 --- a/flowsa/methods/flowbysectormethods/Land_national_2012.yaml +++ b/flowsa/methods/flowbysectormethods/Land_national_2012.yaml @@ -40,9 +40,11 @@ sources_to_cache: source_names: EIA_CBECS_Land: <<: *_eia_cbecs_land + EIA_MECS_Land: <<: *_eia_mecs_land - "BLM_PLS": + + BLM_PLS: fedefl_mapping: BLM_PLS selection_fields: Class: Land @@ -57,6 +59,7 @@ source_names: PrimaryActivity: !from_index:BLM_PLS_2012_asets.csv hardrock_mining attribution_method: proportional attribution_source: Employment_national_2012 + USDA_ERS_MLU: fedefl_mapping: USDA_ERS_MLU geoscale: state @@ -127,7 +130,6 @@ source_names: PrimaryActivity: - 'Land in rural transportation facilities' clean_fba_w_sec: !script_function:USDA_ERS_MLU allocate_usda_ers_mlu_land_in_rural_transportation_areas - geoscale: national attribution_method: direct urban: selection_fields: diff --git a/flowsa/methods/flowbysectormethods/Land_state_2012.yaml b/flowsa/methods/flowbysectormethods/Land_state_2012.yaml index d2cdd4bb9..b265849df 100644 --- a/flowsa/methods/flowbysectormethods/Land_state_2012.yaml +++ b/flowsa/methods/flowbysectormethods/Land_state_2012.yaml @@ -7,48 +7,63 @@ year: 2012 geoscale: state sources_to_cache: - # Attribute national (instead of census regions) to states since regional - # data is only "all buildings" and not broken out by floors EIA_CBECS_Land: &_eia_cbecs_land # commercial land use fedefl_mapping: EIA_CBECS_Land geoscale: national selection_fields: Class: Land - Location: '00000' + Location: !include:Location_common.yaml:_national_location clean_fba: !script_function:EIA_CBECS_Land cbecs_land_fba_cleanup - clean_fba_w_sec: !clean_function:flowbyclean attribute_national_to_states - clean_source: - Employment_state_2012: - geoscale: state activity_sets: cbecs_land: # all activities in eia cbecs land crosswalk selection_fields: PrimaryActivity: !from_index:EIA_CBECS_Land_2012_asets.csv cbecs_land - attribution_method: direct + attribute: + - attribution_method: proportional + attribution_source: + Employment_national_2012: + geoscale: national + - attribution_method: proportional + attribute_on: ['PrimarySector'] + fill_columns: Location + attribution_source: + Employment_state_2012: + geoscale: state EIA_MECS_Land: &_eia_mecs_land # manufacturing land use fedefl_mapping: EIA_MECS_Land year: 2014 geoscale: national + industry_spec: + default: NAICS_6 selection_fields: Class: Land + Location: !include:Location_common.yaml:_national_location FlowName: "Approximate Enclosed Floorspace of All Buildings Onsite" - Year: {2014: 2012} # replace year to align with method year= + Year: {2014: 2012} # replace year to align with method year clean_fba: !script_function:EIA_MECS mecs_land_fba_cleanup - clean_fba_w_sec: !clean_function:flowbyclean attribute_national_to_states - clean_source: - Employment_state_2014: - geoscale: state activity_sets: mecs_land: # all activities in eia mecs land crosswalk selection_fields: PrimaryActivity: !from_index:EIA_MECS_Land_2014_asets.csv mecs_land - attribution_method: direct + attribute: + - attribution_method: proportional + attribution_source: + Employment_national_2014: + geoscale: national + - attribution_method: proportional + attribute_on: ['PrimarySector'] + fill_columns: Location + attribution_source: + Employment_state_2014: # use 2014 bc MECS is 2014 + geoscale: state source_names: EIA_CBECS_Land: <<: *_eia_cbecs_land + EIA_MECS_Land: <<: *_eia_mecs_land + BLM_PLS: fedefl_mapping: BLM_PLS selection_fields: @@ -64,6 +79,7 @@ source_names: PrimaryActivity: !from_index:BLM_PLS_2012_asets.csv hardrock_mining attribution_method: proportional attribution_source: Employment_state_2012 + USDA_ERS_MLU: fedefl_mapping: USDA_ERS_MLU selection_fields: From d5b875ad63887a24467cf5f88d13928e97b23fc5 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 6 Sep 2023 08:54:01 -0600 Subject: [PATCH 0922/1127] add DC data to usgs_nwis_wu --- flowsa/data_source_scripts/USGS_NWIS_WU.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/flowsa/data_source_scripts/USGS_NWIS_WU.py b/flowsa/data_source_scripts/USGS_NWIS_WU.py index fcda31ab2..1b316f4b6 100644 --- a/flowsa/data_source_scripts/USGS_NWIS_WU.py +++ b/flowsa/data_source_scripts/USGS_NWIS_WU.py @@ -32,9 +32,8 @@ def usgs_URL_helper(*, build_url, config, **_): """ # initiate url list for usgs data urls_usgs = [] - # call on state acronyms from common.py (and remove entry for DC) + # call on state acronyms from common.py state_abbrevs = abbrev_us_state - state_abbrevs = {k: v for (k, v) in state_abbrevs.items() if k != "DC"} # replace "__aggLevel__" in build_url to create three urls for c in config['agg_levels']: # at national level, remove most of the url @@ -395,7 +394,7 @@ def usgs_fba_data_cleanup(fba: FlowByActivity) -> FlowByActivity: # drop flowname = 'total' rows when possible to prevent double counting # subset data where flowname = total and where it does not - vlog.info('Drop rows where the FlowName is total to prevent' + vlog.info('Drop rows where the FlowName is total to prevent ' 'double counting at the state and county levels. ' 'Retain rows at national level') df2 = dfc[dfc['FlowName'] == 'total'] From d833f307fafa62aa9ee00477554d477310217241 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 6 Sep 2023 10:07:27 -0600 Subject: [PATCH 0923/1127] retain DC public supply data in water m1 FBS --- flowsa/data_source_scripts/USGS_NWIS_WU.py | 41 ++++++---------------- 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/flowsa/data_source_scripts/USGS_NWIS_WU.py b/flowsa/data_source_scripts/USGS_NWIS_WU.py index 1b316f4b6..6c430baf7 100644 --- a/flowsa/data_source_scripts/USGS_NWIS_WU.py +++ b/flowsa/data_source_scripts/USGS_NWIS_WU.py @@ -364,18 +364,7 @@ def usgs_fba_data_cleanup(fba: FlowByActivity) -> FlowByActivity: fba['FlowAmount'] = np.where(fba['Unit'] == 'Bgal/d', fba['FlowAmount'] * 1000, fba['FlowAmount']) fba['Unit'] = np.where(fba['Unit'] == 'Bgal/d', 'Mgal/d', fba['Unit']) - # drop wastewater data - # fba = fba[fba['FlowName'] != 'wastewater'] - # drop rows of commercial data (because only exists for 3 states), - # causes issues because linked with public supply - # also drop closed-loop or once-through cooling (thermoelectric power) - # to avoid double counting - # vlog.info('Removing all rows for Commercial Data because does not ' - # 'exist for all states and causes issues as information ' - # 'on Public Supply deliveries.') - # dfa = fba[~fba['Description'].str.lower().str.contains( - # 'commercial|closed-loop cooling|once-through')] - # calculate_flowamount_diff_between_dfs(fba, dfa) + # calculated NET PUBLIC SUPPLY by subtracting out deliveries to domestic vlog.info('Modify the public supply values to generate ' 'NET public supply by subtracting out deliveries to domestic') @@ -413,11 +402,6 @@ def usgs_fba_data_cleanup(fba: FlowByActivity) -> FlowByActivity: # concat the two df dfd = pd.concat([df1, df2, df3], ignore_index=True, sort=False) - # In 2015, there is data for consumptive water use for - # thermo and crop, drop because do not calculate consumptive water loss - # for all water categories - # dfd = dfd[dfd['Compartment'] != 'air'].reset_index(drop=True) - return dfd @@ -428,7 +412,8 @@ def calculate_net_public_supply(df_load: FlowByActivity): greater than/equal to the Domestic deliveries because water can be withdrawn in one county and delivered in another (water can also cross state lines). Therefore, can/do end up with NEGATIVE net public supply - values and PS water should only be used at a national level + values (especially at county-level) and PS water is most accurate at + national level Domestic deliveries are subtracted from public supply. An assumption is made that PS deliveries to domestic is fresh water. The national level @@ -449,17 +434,6 @@ def calculate_net_public_supply(df_load: FlowByActivity): ['Industrial', 'Thermoelectric Power', 'Thermoelectric Power Closed-loop cooling', 'Thermoelectric Power Once-through cooling'])] - # drop duplicate info of "Public Supply deliveries to" - # df1_sub = df1_sub.loc[~df1_sub['Description'].str.contains( - # "Public Supply total deliveries")] - # df1_sub = df1_sub.loc[~df1_sub['Description'].str.contains( - # "deliveries from public supply")] - - # calculate data drop - # vlog.info('Dropping rows that contain "deliveries from public ' - # 'supply" to avoid double counting with rows of "Public ' - # 'Supply deliveries to"') - # calculate_flowamount_diff_between_dfs(df1, df1_sub) # drop county level values because cannot use county data vlog.info('Dropping county level public supply withdrawals ' @@ -500,6 +474,7 @@ def calculate_net_public_supply(df_load: FlowByActivity): # create flowratio for ground/surface df_w_modified.loc[:, 'FlowRatio'] = \ df_w_modified['FlowAmount'] / df_w_modified['FlowTotal'] + # calculate new, net total public supply withdrawals # will end up with negative values due to instances of water # deliveries coming form surrounding counties @@ -519,8 +494,12 @@ def calculate_net_public_supply(df_load: FlowByActivity): net_ps[['FlowName', 'Compartment', 'Location', 'FlowRatio']], how='left', - left_on='Location', - right_on='Location') + on='Location') + # DC has flowratio of 0, so replace (net public supply = 0) + df_d_modified['FlowRatio'] = np.where( + (df_d_modified['Location'] == '11000') & + (df_d_modified['FlowRatio'].isna()), + 0.5, df_d_modified['FlowRatio']) df_d_modified.loc[:, 'FlowAmount'] = \ df_d_modified['FlowAmount'] * df_d_modified['FlowRatio'] df_d_modified = df_d_modified.drop(columns=["FlowRatio"]) From b7c1675a0a46cef050526b8b9154ed158e101b40 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 6 Sep 2023 10:08:45 -0600 Subject: [PATCH 0924/1127] use state employment FBS in water national FBS so state water FBS sectors sum to national sectors --- flowsa/methods/flowbysectormethods/Water_common.yaml | 1 + .../methods/flowbysectormethods/Water_national_2015_m1.yaml | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Water_common.yaml b/flowsa/methods/flowbysectormethods/Water_common.yaml index 4ea2842fc..0a46a982d 100644 --- a/flowsa/methods/flowbysectormethods/Water_common.yaml +++ b/flowsa/methods/flowbysectormethods/Water_common.yaml @@ -56,6 +56,7 @@ source_names: Compartment: air Description: # prevent double counting with "Public Supply deliveries to" - Domestic deliveries from public supply, in Mgal/d + - Public Supply total deliveries, in Mgal/d clean_fba_before_activity_sets: !script_function:USGS_NWIS_WU usgs_fba_data_cleanup activity_sets: diff --git a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml index aa27b08e3..6f6ea0694 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml @@ -21,9 +21,7 @@ source_names: employment_attribution: !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:employment_attribution attribution_method: proportional - attribution_source: - Employment_national_2015: - geoscale: national + attribution_source: Employment_state_2015 cropland_attribution: !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution attribution_method: proportional From af7603edad568460e528a90a18adb2079a0b637c Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 6 Sep 2023 10:53:28 -0600 Subject: [PATCH 0925/1127] spelling --- flowsa/data_source_scripts/USDA_ERS_MLU.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/data_source_scripts/USDA_ERS_MLU.py b/flowsa/data_source_scripts/USDA_ERS_MLU.py index 96c02c6ab..c8af384ac 100644 --- a/flowsa/data_source_scripts/USDA_ERS_MLU.py +++ b/flowsa/data_source_scripts/USDA_ERS_MLU.py @@ -359,4 +359,4 @@ def allocate_usda_ers_mlu_other_land( fba['FlowAmount'] = np.where(fba['SectorConsumedBy'].isin(household), rural_res, fba['FlowAmount']) - return fba.drop(columns=['rurl_res', 'total_area'], errors='ignore') + return fba.drop(columns=['rural_res', 'total_area'], errors='ignore') From 67b5b44433451087de75255a2bf7c687ff86f2cf Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 6 Sep 2023 13:12:28 -0600 Subject: [PATCH 0926/1127] add bea summary make and use tables for 2012-2021 - pulled from useeior --- .../BEA_Summary_Make_2012_BeforeRedef.csv | 73 +++++++++++++++++ .../BEA_Summary_Make_2013_BeforeRedef.csv | 73 +++++++++++++++++ .../BEA_Summary_Make_2014_BeforeRedef.csv | 73 +++++++++++++++++ .../BEA_Summary_Make_2015_BeforeRedef.csv | 73 +++++++++++++++++ .../BEA_Summary_Make_2016_BeforeRedef.csv | 73 +++++++++++++++++ .../BEA_Summary_Make_2017_BeforeRedef.csv | 73 +++++++++++++++++ .../BEA_Summary_Make_2018_BeforeRedef.csv | 73 +++++++++++++++++ .../BEA_Summary_Make_2019_BeforeRedef.csv | 73 +++++++++++++++++ .../BEA_Summary_Make_2020_BeforeRedef.csv | 73 +++++++++++++++++ .../BEA_Summary_Make_2021_BeforeRedef.csv | 73 +++++++++++++++++ .../BEA_Summary_Use_2012_PRO_BeforeRedef.csv | 80 +++++++++++++++++++ .../BEA_Summary_Use_2013_PRO_BeforeRedef.csv | 80 +++++++++++++++++++ .../BEA_Summary_Use_2014_PRO_BeforeRedef.csv | 80 +++++++++++++++++++ .../BEA_Summary_Use_2015_PRO_BeforeRedef.csv | 80 +++++++++++++++++++ .../BEA_Summary_Use_2016_PRO_BeforeRedef.csv | 80 +++++++++++++++++++ .../BEA_Summary_Use_2017_PRO_BeforeRedef.csv | 80 +++++++++++++++++++ .../BEA_Summary_Use_2018_PRO_BeforeRedef.csv | 80 +++++++++++++++++++ .../BEA_Summary_Use_2019_PRO_BeforeRedef.csv | 80 +++++++++++++++++++ .../BEA_Summary_Use_2020_PRO_BeforeRedef.csv | 80 +++++++++++++++++++ .../BEA_Summary_Use_2021_PRO_BeforeRedef.csv | 80 +++++++++++++++++++ .../Water_state_2015_m2.yaml | 38 +++++++++ 21 files changed, 1568 insertions(+) create mode 100644 flowsa/data/external_data/BEA_Summary_Make_2012_BeforeRedef.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Make_2013_BeforeRedef.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Make_2014_BeforeRedef.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Make_2015_BeforeRedef.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Make_2016_BeforeRedef.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Make_2017_BeforeRedef.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Make_2018_BeforeRedef.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Make_2019_BeforeRedef.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Make_2020_BeforeRedef.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Make_2021_BeforeRedef.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Use_2012_PRO_BeforeRedef.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Use_2013_PRO_BeforeRedef.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Use_2014_PRO_BeforeRedef.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Use_2015_PRO_BeforeRedef.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Use_2016_PRO_BeforeRedef.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Use_2017_PRO_BeforeRedef.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Use_2018_PRO_BeforeRedef.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Use_2019_PRO_BeforeRedef.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Use_2020_PRO_BeforeRedef.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Use_2021_PRO_BeforeRedef.csv create mode 100644 flowsa/methods/flowbysectormethods/Water_state_2015_m2.yaml diff --git a/flowsa/data/external_data/BEA_Summary_Make_2012_BeforeRedef.csv b/flowsa/data/external_data/BEA_Summary_Make_2012_BeforeRedef.csv new file mode 100644 index 000000000..65bb56999 --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Make_2012_BeforeRedef.csv @@ -0,0 +1,73 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","Used","Other","Total Industry Output" +"111CA",396833,4531,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2795,0,0,0,0,0,0,0,0,0,0,404166 +"113FF",14,45970,0,0,0,0,918,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46902 +"211",0,0,287989,45,47038,0,542,0,0,0,18,172,0,0,0,0,0,0,0,0,0,0,0,24664,220,0,692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,1171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,362652 +"212",0,0,0,100761,9805,0,10138,0,290,0,0,0,0,0,0,0,0,0,0,0,0,0,0,74,2876,0,627,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124665 +"213",0,0,84,44,118125,0,5528,0,0,0,991,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,812,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,481,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,126168 +"22",0,0,84,0,0,454946,1950,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,0,0,2436,0,0,0,0,0,0,0,0,0,0,0,0,0,0,421,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1503,0,0,461485 +"23",0,0,0,0,0,0,1074207,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,155,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1074580 +"321",0,0,0,0,0,0,976,77921,4,0,297,0,0,0,0,0,238,1,0,0,0,66,0,0,3,106,815,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,293,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,0,80773 +"327",0,0,3,473,1,0,1302,11,94501,0,238,15,0,150,0,10,80,1,0,342,0,145,0,48,81,148,1222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,836,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,99640 +"331",0,0,0,0,0,0,458,0,5,261379,1840,152,1,731,0,0,0,0,0,55,0,1,0,1791,176,0,999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,511,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1066,0,269217 +"332",0,0,0,0,0,0,2822,167,75,2646,321794,4212,445,222,1604,273,88,193,0,2,0,1,54,2,98,880,3694,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,261,2411,0,0,0,0,0,0,0,0,0,0,0,0,180,0,0,0,0,0,1397,0,343521 +"333",0,0,0,0,0,0,1033,0,58,18,2324,378426,875,874,1113,227,7,140,3,102,0,9,0,0,34,158,9016,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,719,9387,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,0,404751 +"334",0,0,0,0,0,0,53,3,4,31,186,809,298308,907,15,2462,8,770,0,1,0,7,7,0,170,240,4063,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1287,44911,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,354241 +"335",0,0,0,0,0,0,146,0,14,1211,265,648,705,115125,306,97,2,67,0,33,0,28,0,0,44,11,2011,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,259,1876,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,122845 +"3361MV",0,0,0,0,0,0,938,0,2,27,541,1481,39,57,495283,244,16,63,0,26,0,0,0,0,1,93,3159,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,325,10599,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,941,0,513836 +"3364OT",0,0,0,0,0,0,1632,0,0,1,514,2144,2060,116,172,261364,0,0,0,7,0,0,0,0,40,20,2023,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,19841,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,81,0,290669 +"337",0,0,0,0,0,0,579,405,137,3,312,47,0,2,2,0,61831,187,0,146,1,10,8,0,4,98,1728,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65787 +"339",0,0,0,0,0,0,676,75,19,90,335,245,620,82,87,222,267,135421,0,47,30,107,245,4,222,774,5691,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,380,10050,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,155688 +"311FT",0,0,0,0,0,0,302,0,0,0,0,0,0,0,0,0,0,0,880239,0,60,9,0,0,3326,3,8912,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,94,2979,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,895927 +"313TT",0,0,0,0,0,0,111,0,0,3,224,80,0,0,34,1,287,159,0,46636,105,28,95,0,2951,111,667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,201,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51710 +"315AL",0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,47,18203,0,0,0,0,0,789,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33,153,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19224 +"322",0,0,0,0,0,0,210,97,196,1,11,0,410,0,0,0,0,283,0,158,0,173651,459,0,115,923,1065,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,991,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,336,0,178973 +"323",0,0,0,0,0,0,11,0,0,0,250,0,44,0,0,0,0,575,0,482,14,794,60485,0,0,393,753,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,211,18724,0,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,117,0,83095 +"324",0,0,1587,2077,0,0,339,0,191,0,0,3,0,25,0,0,0,0,0,0,0,21,0,783998,39428,6,5205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,569,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,833489 +"325",0,0,0,3,0,0,343,1,6,252,232,628,1498,160,2,2,0,707,12436,39,0,180,1,1723,714560,5472,15157,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,486,38935,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,792822 +"326",0,0,0,0,0,0,216,178,179,33,588,956,170,146,466,254,200,693,0,794,0,1131,156,3,431,204597,2620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,111,2467,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,78,0,216467 +"42",0,593,0,0,0,0,2329,0,0,0,8,477,118,0,272,11,21,1604,3653,0,0,0,0,0,0,0,1562428,0,0,0,0,0,0,0,0,0,1060,915,14,0,0,0,0,0,0,0,0,0,0,10030,0,13282,1432,0,25,0,0,0,0,0,0,0,0,0,0,56707,0,0,0,0,0,0,0,1654978 +"441",0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,151721,0,0,0,0,0,0,25,0,0,376,261,0,0,0,0,3664,0,0,0,0,0,697,0,6,24,0,0,0,40,0,0,0,0,0,191,0,0,64887,0,0,0,0,0,0,0,221895 +"445",0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,8098,0,0,0,0,0,0,0,0,0,183553,0,0,0,0,0,0,0,0,0,0,0,0,0,0,356,0,0,0,0,0,888,0,0,13,0,186,0,0,0,0,0,0,0,57,0,14502,21,0,0,0,0,0,0,0,207675 +"452",0,0,0,0,0,0,1842,0,0,0,0,0,0,0,0,0,0,0,2308,0,0,0,0,0,0,0,0,0,0,194234,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,242,0,0,454,0,172,0,0,1232,0,0,0,0,0,0,6491,3766,0,0,0,0,0,0,0,210740 +"4A0",176,0,0,0,0,0,4975,0,0,0,0,0,0,0,0,0,0,2098,29,0,259,0,45,0,0,0,0,0,0,0,716416,0,0,0,0,0,0,2551,37,0,560,93,0,209,0,0,0,0,0,3381,0,1729,815,0,1988,0,154,402,0,0,0,0,195,0,13464,13621,0,0,0,0,0,0,0,763197 +"481",0,597,0,0,0,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,192815,0,0,0,0,0,375,0,0,0,0,0,0,0,0,0,0,0,65,0,354,1082,0,0,0,0,43,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,195394 +"482",0,0,0,0,0,0,985,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77769,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,0,125,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,79137 +"483",0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48171,0,0,0,2251,0,0,0,0,0,0,0,0,0,0,0,0,0,11,2,0,0,0,0,0,0,0,0,0,174,0,0,0,0,0,0,0,0,0,0,50616 +"484",0,0,0,0,0,0,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,288222,0,0,3285,3854,0,0,0,0,0,0,0,0,0,0,309,0,63,60,0,0,1806,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,297770 +"485",0,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,12,0,0,0,0,50868,0,66,0,0,0,0,0,0,0,0,0,0,6,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50998 +"486",0,0,0,0,0,117,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36243,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36441 +"487OS",0,0,0,0,0,0,298,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,70,0,7,0,0,202,0,1281,1293,335,0,181342,985,0,0,0,0,0,0,69,0,0,0,61,0,150,181,0,72,0,0,0,0,0,0,0,0,0,70,830,0,0,0,0,0,0,0,187246 +"493",0,0,0,0,0,0,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1462,0,0,317,106964,0,0,0,0,0,0,0,0,0,0,6,0,89,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,108889 +"511",0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1695,0,0,0,8298,0,0,0,112,0,0,0,0,0,0,0,0,198017,0,0,12423,0,0,0,0,0,0,1,0,9559,59968,0,814,0,5352,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,296240 +"512",0,0,0,0,0,0,31,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,552,0,0,0,0,0,0,0,0,0,129203,0,0,0,0,0,0,0,98,147,0,240,1352,0,0,0,0,0,0,0,0,0,57,0,0,0,0,0,0,0,0,0,0,131697 +"513",0,0,0,0,0,0,1388,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4004,0,0,0,730,0,0,0,0,0,0,0,0,0,662,623904,0,0,0,0,0,0,0,9524,0,1715,88998,0,0,0,0,0,0,0,0,0,0,0,0,2190,0,0,0,0,0,0,0,733115 +"514",0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,361,0,0,0,412,0,0,0,0,0,0,0,0,8813,0,161,140552,0,0,0,0,0,0,205,0,14134,55787,0,418,0,632,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,221490 +"521CI",0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,675153,34459,0,0,0,0,48425,0,2780,843,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,761660 +"523",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20750,449685,6631,0,0,0,0,0,1010,395,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,478470 +"524",0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,653,792198,0,0,0,0,302,1994,1193,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,796345 +"525",0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,117098,0,0,0,0,96,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,117255 +"HS",0,0,0,0,0,0,12274,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1714376,0,0,0,10,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1726669 +"ORE",0,0,0,0,0,0,803,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,157,0,0,887626,0,0,76,142,0,0,0,0,0,0,0,0,0,0,19,0,60,0,0,0,0,0,0,0,888883 +"532RL",0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,346,60,251,0,786,0,0,0,624,29,0,0,0,0,0,0,0,0,5,758,0,0,1852,292143,0,170,33,0,0,0,2,0,0,0,0,0,0,0,0,1544,0,0,0,0,0,0,0,298651 +"5411",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,306587,229,159,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,306975 +"5415",0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3281,0,0,0,240,0,0,0,0,0,0,0,0,2065,0,152,11588,0,0,0,0,0,0,310,0,320812,9093,0,3346,0,1552,0,0,0,0,0,0,0,0,1757,0,0,0,0,0,0,0,354201 +"5412OP",0,0,0,0,0,0,455,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,465,0,0,0,0,0,0,453,3408,0,0,0,0,0,0,0,0,0,0,0,2380,0,485,0,0,0,0,12,0,8761,1103576,0,2176,0,0,0,0,0,0,0,0,0,0,1691,0,0,0,0,0,0,0,1123863 +"55",0,0,0,0,0,0,84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9248,3823,465623,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,478778 +"561",0,0,0,0,0,0,1188,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2481,0,0,0,0,0,0,0,1130,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,0,0,247,34,0,6226,10207,0,639785,110,144,9,0,0,36,0,0,0,0,0,0,0,0,0,0,0,0,661652 +"562",0,0,77,0,0,0,71,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,123,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,380,0,67,60,0,0,82227,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,561,0,83578 +"61",0,0,0,0,0,0,805,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1230,0,0,0,0,0,0,0,0,0,0,0,0,0,0,94,0,0,64,74,0,3650,24438,0,0,0,242633,0,0,0,0,1370,0,22624,12589,15,0,0,0,0,0,0,0,309586 +"621",0,0,0,0,0,0,190,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8296,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2749,0,681,83,0,0,0,0,856619,0,0,0,0,0,0,184,0,0,0,0,0,0,0,0,868802 +"622",0,0,0,0,0,0,1277,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,889,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1112,0,1916,5818,0,0,0,0,6240,690008,0,0,0,0,0,2082,0,0,0,0,0,0,0,0,709343 +"623",0,0,0,0,0,0,46,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,101,0,0,13,7,0,0,0,0,892,0,207417,110,0,0,0,327,0,0,0,0,0,0,0,0,208930 +"624",0,0,0,0,0,0,234,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,91,183,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,70,8,0,0,0,0,201,0,1999,166654,0,0,0,0,0,0,0,0,0,0,0,0,169440 +"711AS",0,0,0,0,0,0,516,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,749,940,0,31,6235,0,0,0,14,0,0,0,0,128800,2908,7,3049,280,0,0,0,0,0,0,0,144746 +"713",0,0,0,0,0,0,357,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,317,0,0,1897,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,131,286,0,12,122,0,0,0,1017,0,0,0,694,187,101749,365,11683,962,0,0,0,0,0,0,0,119779 +"721",0,0,0,0,0,0,886,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,351,364,728,0,0,0,0,0,0,0,0,0,0,195,0,0,0,0,0,0,871,1055,0,18,1,0,0,0,0,0,0,0,0,1187,30184,142895,34793,1404,0,0,0,0,0,0,0,214942 +"722",0,0,0,0,0,0,956,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,716,0,1401,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,911,138,609722,0,0,0,0,0,0,131,0,613975 +"81",0,0,0,0,0,0,510,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,570,1376,0,88,3000,0,0,0,0,0,0,0,0,0,0,0,450,0,0,0,0,0,1112,233,0,466,1159,0,0,0,25,0,0,0,267,0,0,0,3114,563893,0,0,0,0,0,0,0,576265 +"GFGD",0,0,0,0,0,0,4,0,0,0,0,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,0,12,0,0,0,0,0,0,0,0,2312,22052,0,0,0,199,0,1329,0,0,18,0,0,0,0,650338,0,0,0,0,0,0,676302 +"GFGN",0,112,0,0,0,57,384,0,0,1,0,0,0,0,0,0,0,67,0,0,0,0,9,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,196,0,0,0,0,0,0,87,0,0,0,0,2556,12738,0,0,0,0,0,1452,0,0,0,0,0,0,0,0,349383,486,0,0,0,2843,370376 +"GFE",0,0,0,0,0,13348,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3888,34,0,0,0,0,0,0,0,0,0,23,0,0,0,0,1647,0,0,743,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,1764,0,0,0,75019,0,0,0,0,97146 +"GSLG",474,2775,0,183,0,1020,27098,178,0,0,0,0,0,0,0,0,0,1016,2030,0,1117,549,1395,0,90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,447,1,0,2557,0,0,0,22548,0,0,0,0,4926,46272,0,7426,12480,83549,14766,159760,0,3495,2652,2258,8865,16888,956,0,0,0,1515717,0,3573,0,1947061 +"GSLE",0,0,0,0,0,122858,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4505,0,0,0,143,271,0,14718,0,10979,0,0,0,0,0,25,0,18,0,6276,24271,0,0,0,0,0,0,0,0,0,0,0,0,164,27921,0,0,2649,0,0,0,0,83539,0,0,298336 +"Total Commodity Output",397496,54577,289825,103585,174969,592345,1165794,79043,95680,265696,330967,390496,305300,118595,499357,265164,63047,144047,908796,48918,19789,176737,67600,812309,764876,214033,1651111,153483,189384,199117,742830,193017,77911,49723,291626,65950,39739,202471,112114,209538,130484,624506,169961,700157,485286,801626,139733,1720651,917871,373576,306889,416223,1626766,465623,656650,96623,335313,880404,852549,209416,171257,134378,169399,174915,730720,717416,650338,349383,75505,1515717,85041,8542,2843,29222821 diff --git a/flowsa/data/external_data/BEA_Summary_Make_2013_BeforeRedef.csv b/flowsa/data/external_data/BEA_Summary_Make_2013_BeforeRedef.csv new file mode 100644 index 000000000..89fdc54d6 --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Make_2013_BeforeRedef.csv @@ -0,0 +1,73 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","Used","Other","Total Industry Output" +"111CA",429044,5156,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2725,0,0,0,0,0,0,0,0,0,0,436934 +"113FF",16,48241,0,0,0,0,1055,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49312 +"211",0,0,340276,64,56295,0,1335,0,0,0,22,206,0,0,0,0,0,0,0,0,0,0,0,25427,263,0,786,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,105,1591,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,426372 +"212",0,0,0,93411,10347,0,6804,0,302,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77,2851,0,618,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,142,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,114553 +"213",0,0,87,45,111445,0,8338,0,0,0,1028,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,830,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,69,666,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,122511 +"22",0,0,97,0,0,485158,1443,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0,0,0,0,0,2826,0,0,0,0,0,0,0,0,0,0,0,0,0,0,416,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1577,0,0,491663 +"23",0,0,0,0,0,0,1155220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,233,247,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1155700 +"321",0,0,0,0,0,0,309,88306,44,0,254,0,0,0,0,0,264,1,0,0,0,101,0,0,9,158,947,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,136,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,90579 +"327",0,0,3,508,1,0,412,1,101767,0,230,4,0,223,0,7,96,1,0,315,0,249,0,24,159,135,1297,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,846,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,106304 +"331",0,0,0,0,0,0,145,0,3,255561,1336,163,0,698,0,0,0,0,0,37,0,2,0,2628,273,0,1163,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,460,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,716,0,263236 +"332",0,0,0,0,0,0,1070,217,86,2967,329697,3885,501,269,1523,456,113,234,0,3,0,3,88,5,119,1212,4117,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,2546,0,0,0,0,0,0,0,0,0,0,0,0,95,0,0,0,0,0,1094,0,350553 +"333",0,0,0,0,0,0,468,0,105,30,2603,371234,1030,1244,1064,212,6,244,5,99,0,13,0,0,118,214,8775,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,720,8635,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,148,0,396978 +"334",0,0,0,0,0,0,17,2,13,37,180,645,294766,809,12,2726,9,777,0,1,0,5,7,0,239,288,4025,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1263,46746,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,352567 +"335",0,0,0,0,0,0,46,0,10,1266,212,469,824,115245,196,70,2,82,0,27,0,58,0,0,236,10,2095,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,315,2377,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,123537 +"3361MV",0,0,0,0,0,0,298,0,3,42,627,1397,49,100,546754,393,29,82,0,61,0,0,0,0,8,196,3279,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,367,11191,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,761,0,565638 +"3364OT",0,0,0,0,0,0,517,0,0,1,326,2143,1933,198,84,277335,0,0,0,24,0,0,0,0,14,29,1896,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,664,20944,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80,0,306188 +"337",0,0,0,0,0,0,184,401,132,5,282,47,0,2,2,0,63765,322,0,195,2,13,9,0,10,126,1488,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44,269,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67298 +"339",0,0,0,0,0,0,1430,62,14,92,308,210,678,87,57,219,242,144085,0,56,37,157,300,32,356,1022,5713,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,401,11978,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,167538 +"311FT",0,0,0,0,0,0,96,0,0,0,0,0,0,0,0,0,0,0,902055,0,46,131,0,0,4042,2,9937,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,108,3588,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,920008 +"313TT",0,0,0,0,0,0,35,0,0,3,89,53,0,0,25,1,302,137,0,48671,113,38,101,0,3480,79,636,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54016 +"315AL",0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,44,18535,0,0,0,0,0,758,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,184,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19552 +"322",0,0,0,0,0,0,67,150,138,1,6,0,652,0,0,0,0,78,0,129,0,178819,336,0,163,673,1173,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,983,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,384,0,183815 +"323",0,0,0,0,0,0,3,0,0,0,169,0,66,0,0,0,0,493,0,534,15,1030,60797,0,0,513,770,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,216,18477,0,164,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,83,0,83330 +"324",0,0,73,249,0,0,108,0,198,0,0,0,0,7,0,0,0,0,0,0,0,7,0,795537,31511,2,5871,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,153,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,833756 +"325",0,0,0,3,0,0,109,0,14,103,122,234,1052,98,0,2,0,462,11459,32,0,192,1,2224,756429,4156,11498,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,512,42150,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,830853 +"326",0,0,0,0,0,0,68,165,120,38,425,759,154,145,251,251,175,616,0,764,0,1496,171,9,849,212351,2709,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,131,2770,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,69,0,224486 +"42",0,570,0,0,0,0,2291,0,0,0,8,484,124,0,302,11,22,1674,3807,0,0,0,0,0,0,0,1639245,0,0,0,0,0,0,0,0,0,1069,928,14,0,0,0,0,0,0,0,0,0,0,10758,0,13726,886,0,25,0,0,0,0,0,0,0,0,0,0,58850,0,0,0,0,0,0,0,1734795 +"441",0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,161944,0,0,0,0,0,0,25,0,0,393,271,0,0,0,0,4007,0,0,0,0,0,718,0,4,24,0,0,0,42,0,0,0,0,0,196,0,0,68223,0,0,0,0,0,0,0,235849 +"445",0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,8249,0,0,0,0,0,0,0,0,0,185830,0,0,0,0,0,0,0,0,0,0,0,0,0,0,364,0,0,0,0,0,794,0,0,13,0,190,0,0,0,0,0,0,0,58,0,15144,21,0,0,0,0,0,0,0,210668 +"452",0,0,0,0,0,0,1720,0,0,0,0,0,0,0,0,0,0,0,2382,0,0,0,0,0,0,0,0,0,0,199823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,245,0,0,462,0,177,0,0,1271,0,0,0,0,0,0,6776,3854,0,0,0,0,0,0,0,216710 +"4A0",183,0,0,0,0,0,6199,0,0,0,0,0,0,0,0,0,0,2135,31,0,265,0,43,0,0,0,0,0,0,0,767420,0,0,0,0,0,0,2684,38,0,595,89,0,214,0,0,0,0,0,3431,0,1652,836,0,2037,0,158,418,0,0,0,0,205,0,14060,14102,0,0,0,0,0,0,0,816793 +"481",0,638,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,198655,0,0,0,0,0,401,0,0,0,0,0,0,0,0,0,0,0,70,0,256,1190,0,0,0,0,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,201273 +"482",0,0,0,0,0,0,976,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,81072,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,223,0,117,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,82412 +"483",0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48125,0,0,0,2314,0,0,0,0,0,0,0,0,0,0,0,0,0,17,4,0,0,0,0,0,0,0,0,0,180,0,0,0,0,0,0,0,0,0,0,50646 +"484",0,0,0,0,0,0,340,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,297362,0,0,3390,3977,0,0,0,0,0,0,0,0,0,0,320,0,60,73,0,0,1862,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,307384 +"485",0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,13,0,0,0,0,55480,0,69,0,0,0,0,0,0,0,0,0,0,7,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55597 +"486",0,0,0,0,0,121,54,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38545,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38768 +"487OS",0,0,0,0,0,0,118,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73,0,7,0,0,209,0,1341,1379,348,0,188820,1054,0,0,0,0,0,0,74,0,0,0,66,0,191,226,0,76,0,0,0,0,0,0,0,0,0,73,881,0,0,0,0,0,0,0,194933 +"493",0,0,0,0,0,0,27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1516,0,0,328,110855,0,0,0,0,0,0,0,0,0,0,7,0,90,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112877 +"511",0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1629,0,0,0,8813,0,0,0,109,0,0,0,0,0,0,0,0,206904,0,0,12169,0,0,0,0,0,0,1,0,10102,62579,0,809,0,5684,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,308803 +"512",0,0,0,0,0,0,43,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,590,0,0,0,0,0,0,0,0,0,132409,0,0,0,0,0,0,0,103,154,0,259,1561,0,0,0,0,0,0,0,0,0,60,0,0,0,0,0,0,0,0,0,0,135195 +"513",0,0,0,0,0,0,1534,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4123,0,0,0,775,0,0,0,0,0,0,0,0,0,700,639997,0,0,0,0,0,0,0,9637,0,1721,91574,0,0,0,0,0,0,0,0,0,0,0,0,2251,0,0,0,0,0,0,0,752312 +"514",0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,388,0,0,0,451,0,0,0,0,0,0,0,0,9475,0,173,151560,0,0,0,0,0,0,221,0,15211,62524,0,450,0,679,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,241147 +"521CI",0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692883,34487,0,0,0,0,55033,0,2897,984,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,786287 +"523",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21448,488671,6942,0,0,0,0,0,1110,461,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,518632 +"524",0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,706,846278,0,0,0,0,328,2018,1393,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,850730 +"525",0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138647,0,0,0,0,16,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138735 +"HS",0,0,0,0,0,0,13970,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1767299,0,0,0,13,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1781293 +"ORE",0,0,0,0,0,0,687,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,140,0,0,962231,0,0,91,140,0,0,0,0,0,0,0,0,0,0,17,0,54,0,0,0,0,0,0,0,963360 +"532RL",0,0,0,0,0,0,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,356,62,253,0,824,0,0,0,683,30,0,0,0,0,0,0,0,0,6,784,0,0,2055,310645,0,139,38,0,0,0,2,0,0,0,0,0,0,0,0,1621,0,0,0,0,0,0,0,317567 +"5411",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,308757,250,172,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,309179 +"5415",0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3371,0,0,0,256,0,0,0,0,0,0,0,0,2137,0,155,11831,0,0,0,0,0,0,313,0,326088,7851,0,3442,0,1569,0,0,0,0,0,0,0,0,1767,0,0,0,0,0,0,0,358785 +"5412OP",0,0,0,0,0,0,635,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,462,0,0,0,0,0,0,445,3679,0,0,0,0,0,0,0,0,0,0,0,2456,0,505,0,0,0,0,13,0,9104,1131457,0,2220,0,0,0,0,0,0,0,0,0,0,1779,0,0,0,0,0,0,0,1152756 +"55",0,0,0,0,0,0,117,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9779,4115,484984,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,498995 +"561",0,0,0,0,0,0,1661,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2471,0,0,0,0,0,0,0,1089,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,0,0,258,36,0,7233,10390,0,666803,119,148,9,0,0,38,0,0,0,0,0,0,0,0,0,0,0,0,690314 +"562",0,0,77,0,0,0,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,0,0,0,0,0,0,13,0,0,0,0,0,0,0,0,0,0,0,390,0,65,62,0,0,83741,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,564,0,85080 +"61",0,0,0,0,0,0,1688,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1276,0,0,0,0,0,0,0,0,0,0,0,0,0,0,95,0,0,66,76,0,3432,25060,0,0,0,250501,0,0,0,0,1427,0,23764,12377,16,0,0,0,0,0,0,0,319778 +"621",0,0,0,0,0,0,249,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8525,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2793,0,742,87,0,0,0,0,862171,0,0,0,0,0,0,186,0,0,0,0,0,0,0,0,874752 +"622",0,0,0,0,0,0,914,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,921,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1155,0,2186,5788,0,0,0,0,6310,713485,0,0,0,0,0,2153,0,0,0,0,0,0,0,0,732911 +"623",0,0,0,0,0,0,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,0,0,11,8,0,0,0,0,916,0,212362,113,0,0,0,331,0,0,0,0,0,0,0,0,213892 +"624",0,0,0,0,0,0,206,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,94,190,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,78,7,0,0,0,0,216,0,2009,169909,0,0,0,0,0,0,0,0,0,0,0,0,172710 +"711AS",0,0,0,0,0,0,298,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1296,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,825,989,0,58,6637,0,0,0,15,0,0,0,0,132943,2939,8,3214,298,0,0,0,0,0,0,0,149519 +"713",0,0,0,0,0,0,206,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,327,0,0,2006,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,135,297,0,9,131,0,0,0,1075,0,0,0,703,196,105837,382,12253,994,0,0,0,0,0,0,0,124552 +"721",0,0,0,0,0,0,1210,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,363,380,759,0,0,0,0,0,0,0,0,0,0,206,0,0,0,0,0,0,917,1113,0,18,1,0,0,0,0,0,0,0,0,1251,30978,150605,36671,1480,0,0,0,0,0,0,0,225962 +"722",0,0,0,0,0,0,1035,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,732,0,1458,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,947,143,634927,0,0,0,0,0,0,136,0,639380 +"81",0,0,0,0,0,0,817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,560,1516,0,105,3089,0,0,0,0,0,0,0,0,0,0,0,445,0,0,0,0,0,1164,237,0,573,1187,0,0,0,26,0,0,0,281,0,0,0,3217,571270,0,0,0,0,0,0,0,584488 +"GFGD",0,0,0,0,0,0,4,0,0,0,0,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,0,13,0,0,0,0,0,0,0,0,2161,22545,0,0,0,219,0,1392,0,0,20,0,0,0,0,611205,0,0,0,0,0,0,637602 +"GFGN",0,80,0,0,0,41,304,0,0,0,0,0,0,0,0,0,0,47,0,0,0,0,6,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,140,0,0,0,0,0,0,62,0,0,0,0,2455,13011,0,0,0,0,0,1036,0,0,0,0,0,0,0,0,346307,347,0,0,0,3008,366849 +"GFE",0,0,0,0,0,13365,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3574,34,0,0,0,0,0,0,0,0,0,21,0,0,0,0,2280,0,0,762,0,0,638,0,0,0,0,0,0,0,0,0,0,0,0,1632,0,0,0,70894,0,0,0,0,93199 +"GSLG",494,2882,0,461,0,1057,14698,186,0,0,0,0,0,0,0,0,0,1041,1736,0,1118,547,1370,0,91,0,0,0,0,0,0,0,0,0,0,0,0,0,0,456,1,0,1990,0,0,0,21703,0,0,0,0,7000,47057,0,6965,12955,84811,26837,170753,0,2889,2699,2300,8964,16986,974,0,0,0,1575132,0,3709,0,2019862 +"GSLE",0,0,0,0,0,127580,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4523,0,0,0,149,283,0,15314,0,11384,0,0,0,0,0,25,0,-102,0,6474,24796,0,0,0,0,0,0,0,0,0,0,0,0,168,28253,0,0,2790,0,0,0,0,87867,0,0,309506 +"Total Commodity Output",429736,57567,340614,94741,178088,627321,1231765,89498,102950,260145,337924,381935,301839,119125,550270,281683,65025,152514,929725,50992,20131,182860,67793,825967,801224,221165,1727344,163860,191709,204422,794926,198864,81221,49749,300966,71172,42439,210722,116209,219111,133765,640620,180465,718942,524374,856549,160412,1773773,993422,399746,309085,427662,1678165,484984,683358,98677,344929,898194,886666,214371,173932,138702,174678,183884,760000,731321,611205,346307,71241,1575132,89444,7786,3008,30350112 diff --git a/flowsa/data/external_data/BEA_Summary_Make_2014_BeforeRedef.csv b/flowsa/data/external_data/BEA_Summary_Make_2014_BeforeRedef.csv new file mode 100644 index 000000000..83725d96b --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Make_2014_BeforeRedef.csv @@ -0,0 +1,73 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","Used","Other","Total Industry Output" +"111CA",433926,5190,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2540,0,0,0,0,0,0,0,0,0,0,441667 +"113FF",18,54497,0,0,0,0,1235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55750 +"211",0,0,379408,89,63284,0,1434,0,0,0,25,232,0,0,0,0,0,0,0,0,0,0,0,28579,296,0,883,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,119,1692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,476039 +"212",0,0,0,95174,9437,0,8750,0,328,0,0,0,0,0,0,0,0,0,0,0,0,0,0,82,2790,0,589,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,117311 +"213",0,0,99,47,140235,0,9364,0,0,0,1141,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,893,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,141,717,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,152640 +"22",0,0,113,0,0,530295,1738,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0,0,0,0,0,3273,0,0,0,0,0,0,0,0,0,0,0,0,0,0,438,144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1623,0,0,537642 +"23",0,0,0,0,0,0,1258342,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,239,191,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1258772 +"321",0,0,0,0,0,0,676,94632,54,0,260,0,0,0,0,0,335,1,0,0,0,134,0,0,13,180,1027,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,225,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44,0,97599 +"327",0,0,3,548,1,0,903,1,108288,0,232,3,0,220,0,12,110,1,0,432,0,231,0,25,123,184,1337,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,909,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,113588 +"331",0,0,0,0,0,0,318,0,4,257571,1399,223,1,874,0,0,0,0,0,26,0,2,0,2594,276,0,1034,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,468,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,727,0,265554 +"332",0,0,0,0,0,0,1964,223,96,3016,338455,3939,474,239,1599,603,123,188,0,4,0,3,155,7,98,1231,4043,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,254,2704,0,0,0,0,0,0,0,0,0,0,0,0,114,0,0,0,0,0,1141,0,360672 +"333",0,0,0,0,0,0,787,0,127,26,2751,382755,1023,999,1170,265,5,302,6,85,0,8,0,0,136,234,9153,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,753,8201,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,141,0,408932 +"334",0,0,0,0,0,0,37,8,25,30,185,611,285434,897,17,2987,11,951,0,1,0,6,7,0,252,279,4130,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1320,50841,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,348027 +"335",0,0,0,0,0,0,101,0,22,1087,279,596,821,117976,222,38,3,92,0,47,0,68,0,1,146,17,1990,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,274,2677,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,126457 +"3361MV",0,0,0,0,0,0,650,0,4,27,679,1568,71,81,608564,419,26,78,0,80,0,0,0,0,7,226,3085,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,373,12232,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,732,0,628903 +"3364OT",0,0,0,0,0,0,1131,0,0,0,300,2376,1626,378,58,296194,0,0,0,25,0,0,0,0,14,56,1776,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,682,20421,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,107,0,325142 +"337",0,0,0,0,0,0,402,387,122,6,261,50,0,1,1,0,65284,283,0,199,1,18,9,0,10,127,1499,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,261,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68961 +"339",0,0,0,0,0,0,1325,60,26,74,353,172,519,72,63,302,249,140625,0,68,30,142,319,32,300,985,5164,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,420,11485,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,162783 +"311FT",0,0,0,0,0,0,209,0,0,0,0,0,0,0,0,0,0,0,930465,0,30,96,0,0,3999,2,10108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,3772,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,948780 +"313TT",0,0,0,0,0,0,77,0,0,3,83,55,0,0,24,2,274,121,0,50458,180,33,87,0,3346,71,779,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55831 +"315AL",0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,29,18154,0,0,0,0,0,671,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,174,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19056 +"322",0,0,0,0,0,0,146,131,125,1,6,0,726,0,0,0,0,93,0,125,0,179451,302,0,149,699,1305,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,927,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,363,0,184615 +"323",0,0,0,0,0,0,8,0,0,0,141,0,57,0,0,0,0,517,0,605,28,961,60916,0,0,499,836,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,201,17453,0,117,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,82404 +"324",0,0,49,222,0,0,235,0,256,0,0,0,0,4,0,0,0,0,0,0,0,12,0,732087,27485,2,6556,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43,147,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,767097 +"325",0,0,0,3,0,0,238,0,25,65,128,236,1030,129,1,3,0,474,9111,35,0,203,1,2120,754974,3863,12045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,478,45214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,830378 +"326",0,0,0,0,0,0,150,181,137,30,454,665,135,106,240,288,209,619,0,739,0,1492,179,6,755,218944,3000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,130,2709,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,61,0,231228 +"42",0,800,0,0,0,0,2818,0,0,0,9,499,130,0,337,12,24,1663,3708,0,0,0,0,0,0,0,1718099,0,0,0,0,0,0,0,0,0,1090,1019,14,0,0,0,0,0,0,0,0,0,0,11960,0,14372,784,0,25,0,0,0,0,0,0,0,0,0,0,61772,0,0,0,0,0,0,0,1819133 +"441",0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,174038,0,0,0,0,0,0,27,0,0,405,280,0,0,0,0,4283,0,0,0,0,0,760,0,4,60,0,0,0,44,0,0,0,0,0,207,0,0,74085,0,0,0,0,0,0,0,254194 +"445",0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,8604,0,0,0,0,0,0,0,0,0,192580,0,0,0,0,0,0,0,0,0,0,0,0,0,0,380,0,0,0,0,0,683,0,0,31,0,198,0,0,0,0,0,0,0,61,0,15878,22,0,0,0,0,0,0,0,218441 +"452",0,0,0,0,0,0,2337,0,0,0,0,0,0,0,0,0,0,0,2462,0,0,0,0,0,0,0,0,0,0,204844,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,251,0,0,494,0,183,0,0,1313,0,0,0,0,0,0,7103,3962,0,0,0,0,0,0,0,222950 +"4A0",189,0,0,0,0,0,5717,0,0,0,0,0,0,0,0,0,0,2189,34,0,273,0,41,0,0,0,0,0,0,0,804134,0,0,0,0,0,0,2890,39,0,652,85,0,227,0,0,0,0,0,3592,0,1078,1795,0,2058,0,168,441,0,0,0,0,222,0,14742,14802,0,0,0,0,0,0,0,855369 +"481",0,743,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,208330,0,0,0,0,0,441,0,0,0,0,0,0,0,0,0,0,0,77,0,227,1351,0,0,0,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,211236 +"482",0,0,0,0,0,0,1998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,86252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,210,0,146,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88647 +"483",0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51477,0,0,0,2450,0,0,0,0,0,0,0,0,0,0,0,0,0,23,7,0,0,0,0,0,0,0,0,0,191,0,0,0,0,0,0,0,0,0,0,54162 +"484",0,0,0,0,0,0,695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,322368,0,0,3643,4274,0,0,0,0,0,0,0,0,0,0,343,0,80,91,0,0,2001,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,333496 +"485",0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,13,0,0,0,0,61703,0,71,0,0,0,0,0,0,0,0,0,0,7,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,61828 +"486",0,0,0,0,0,127,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41567,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41797 +"487OS",0,0,0,0,0,0,234,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,76,0,7,0,0,220,0,1421,1513,359,0,201410,1200,0,0,0,0,0,0,81,0,0,0,72,0,178,286,0,79,0,0,0,0,0,0,0,0,0,76,970,0,0,0,0,0,0,0,208182 +"493",0,0,0,0,0,0,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1559,0,0,339,114116,0,0,0,0,0,0,0,0,0,0,7,0,71,82,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,116224 +"511",0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1616,0,0,0,9397,0,0,0,111,0,0,0,0,0,0,0,0,217435,0,0,12366,0,0,0,0,0,0,1,0,10742,62862,0,814,0,6061,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321407 +"512",0,0,0,0,0,0,23,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,620,0,0,0,0,0,0,0,0,0,133815,0,0,0,0,0,0,0,106,150,0,199,1829,0,0,0,0,0,0,0,0,0,62,0,0,0,0,0,0,0,0,0,0,136822 +"513",0,0,0,0,0,0,1489,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4397,0,0,0,828,0,0,0,0,0,0,0,0,0,748,672665,0,0,0,0,0,0,0,9918,0,1806,98754,0,0,0,0,0,0,0,0,0,0,0,0,2393,0,0,0,0,0,0,0,792998 +"514",0,0,0,0,0,0,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,404,0,0,0,499,0,0,0,0,0,0,0,0,10013,0,180,161225,0,0,0,0,0,0,230,0,15815,71699,0,467,0,705,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,261249 +"521CI",0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,719312,33758,0,0,0,0,62187,0,2886,964,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,819108 +"523",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22069,527374,7358,0,0,0,0,0,1170,451,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,558422 +"524",0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,744,938345,0,0,0,0,350,2047,1365,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,942853 +"525",0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,144937,0,0,0,0,13,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,145018 +"HS",0,0,0,0,0,0,14941,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1819777,0,0,0,14,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1834742 +"ORE",0,0,0,0,0,0,700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,143,0,0,1029543,0,0,102,141,0,0,0,0,0,0,0,0,0,0,18,0,55,0,0,0,0,0,0,0,1030702 +"532RL",0,0,0,0,0,0,36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,359,65,256,0,864,0,0,0,761,32,0,0,0,0,0,0,0,0,6,835,0,0,2271,330621,0,158,38,0,0,0,2,0,0,0,0,0,0,0,0,1742,0,0,0,0,0,0,0,338045 +"5411",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,317411,235,173,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,317819 +"5415",0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3399,0,0,0,288,0,0,0,0,0,0,0,0,2279,0,162,12351,0,0,0,0,0,0,326,0,342787,9073,0,3689,0,1638,0,0,0,0,0,0,0,0,1834,0,0,0,0,0,0,0,377828 +"5412OP",0,0,0,0,0,0,340,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,503,0,0,0,0,0,0,461,4146,0,0,0,0,0,0,0,0,0,0,0,2580,0,539,0,0,0,0,13,0,9720,1201438,0,2401,0,0,0,0,0,0,0,0,0,0,1942,0,0,0,0,0,0,0,1224083 +"55",0,0,0,0,0,0,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10522,4110,516630,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,531325 +"561",0,0,0,0,0,0,887,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2498,0,0,0,0,0,0,0,1056,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,0,0,280,40,0,8090,11200,0,733474,130,148,11,0,0,42,0,0,0,0,0,0,0,0,0,0,0,0,757919 +"562",0,0,79,0,0,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,143,0,0,0,0,0,0,13,0,0,0,0,0,0,0,0,0,0,0,418,0,65,63,0,0,88445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,582,0,89837 +"61",0,0,0,0,0,0,1612,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1334,0,0,0,0,0,0,0,0,0,0,0,0,0,0,95,0,0,67,81,0,3761,25533,0,0,0,259216,0,0,0,0,1485,0,24529,12524,16,0,0,0,0,0,0,0,330252 +"621",0,0,0,0,0,0,356,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8956,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2902,0,689,94,0,0,0,0,895818,0,0,0,0,0,0,194,0,0,0,0,0,0,0,0,909009 +"622",0,0,0,0,0,0,868,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,960,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1205,0,2340,5756,0,0,0,0,6596,738664,0,0,0,0,0,2246,0,0,0,0,0,0,0,0,758634 +"623",0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,104,0,0,7,8,0,0,0,0,953,0,219529,116,0,0,0,338,0,0,0,0,0,0,0,0,221088 +"624",0,0,0,0,0,0,93,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,95,194,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,69,6,0,0,0,0,238,0,2081,177136,0,0,0,0,0,0,0,0,0,0,0,0,179912 +"711AS",0,0,0,0,0,0,291,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1376,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,869,1081,0,76,7084,0,0,0,16,0,0,0,0,141599,2849,8,3463,323,0,0,0,0,0,0,0,159033 +"713",0,0,0,0,0,0,201,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,365,0,0,2114,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,144,316,0,32,141,0,0,0,1120,0,0,0,746,203,109709,401,12852,1051,0,0,0,0,0,0,0,129394 +"721",0,0,0,0,0,0,1293,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,375,391,776,0,0,0,0,0,0,0,0,0,0,225,0,0,0,0,0,0,1004,1212,0,23,1,0,0,0,0,0,0,0,0,1366,31859,164045,39988,1614,0,0,0,0,0,0,0,244184 +"722",0,0,0,0,0,0,1406,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,765,0,1550,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1014,154,674995,0,0,0,0,0,0,145,0,680029 +"81",0,0,0,0,0,0,651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,574,1730,0,114,3360,0,0,0,0,0,0,0,0,0,0,0,428,0,0,0,0,0,1236,250,0,650,1235,0,0,0,28,0,0,0,296,0,0,0,3312,606956,0,0,0,0,0,0,0,620820 +"GFGD",0,0,0,0,0,0,4,0,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44,0,15,0,0,0,0,0,0,0,0,2061,22735,0,0,0,242,0,1537,0,0,22,0,0,0,0,598672,0,0,0,0,0,0,625335 +"GFGN",0,137,0,0,0,70,262,0,0,1,0,0,0,0,0,0,0,82,0,0,0,0,11,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,0,0,0,0,0,0,107,0,0,0,0,2336,13628,0,0,0,0,0,1782,0,0,0,0,0,0,0,0,353528,596,0,0,0,3120,375908 +"GFE",0,0,0,0,0,14001,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3341,33,0,0,0,0,0,0,0,0,0,19,0,0,0,0,1781,0,0,763,0,0,632,0,0,0,0,0,0,0,0,0,0,0,0,1532,0,0,0,72421,0,0,0,0,94524 +"GSLG",534,3119,0,474,0,1144,17036,201,0,0,0,0,0,0,0,0,0,1061,1821,0,1142,562,1437,0,93,0,0,0,0,0,0,0,0,0,0,0,0,0,0,476,1,0,2053,0,0,0,23239,0,0,0,0,5066,47641,0,7365,13128,87089,29504,179345,0,3044,2819,2408,9241,17272,1020,0,0,0,1614052,0,3759,0,2077146 +"GSLE",0,0,0,0,0,131567,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4753,0,0,0,154,299,0,15919,0,11811,0,0,0,0,0,25,0,-98,0,6864,25223,0,0,0,0,0,0,0,0,0,0,0,0,167,29182,0,0,2911,0,0,0,0,90706,0,0,319483 +"Total Commodity Output",434667,64487,379751,96557,212957,677203,1346770,95834,109641,261935,347141,393982,292054,121976,612296,301123,66653,149340,956211,52959,19837,183423,68082,765534,795271,227600,1808644,176210,198735,209246,833392,208550,86407,53197,326228,78013,45930,224492,119922,230443,135279,673316,191017,746297,562420,948603,168282,1826641,1061616,428908,317760,446494,1777109,516630,750871,103705,356475,934924,921328,221610,181380,147661,180304,198396,806515,777584,598672,353528,73017,1614052,92329,7876,3120,31756413 diff --git a/flowsa/data/external_data/BEA_Summary_Make_2015_BeforeRedef.csv b/flowsa/data/external_data/BEA_Summary_Make_2015_BeforeRedef.csv new file mode 100644 index 000000000..e451faba6 --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Make_2015_BeforeRedef.csv @@ -0,0 +1,73 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","Used","Other","Total Industry Output" +"111CA",394963,5523,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2410,0,0,0,0,0,0,0,0,0,0,402908 +"113FF",20,52625,0,0,0,0,882,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,53526 +"211",0,0,216209,106,35701,0,1045,0,0,0,14,131,0,0,0,0,0,0,0,0,0,0,0,13304,167,0,589,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,1553,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,268953 +"212",0,0,0,82013,8877,0,11113,0,351,0,0,0,0,0,0,0,0,0,0,0,0,0,0,89,3025,0,576,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,142,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,106189 +"213",0,0,69,52,111759,0,6772,0,0,0,790,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,631,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,653,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,120830 +"22",0,0,89,0,0,506310,2298,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0,0,0,0,0,2576,0,0,0,0,0,0,0,0,0,0,0,0,0,0,488,247,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1734,0,0,513760 +"23",0,0,0,0,0,0,1385646,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,207,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1386108 +"321",0,0,0,0,0,0,1026,97651,61,0,275,0,0,0,0,0,403,1,0,1,0,158,0,0,17,207,1040,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,118,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,0,101014 +"327",0,0,4,581,1,0,1385,1,113261,0,261,4,0,282,0,7,107,1,0,432,0,273,0,27,110,178,1407,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,780,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,119118 +"331",0,0,0,0,0,0,592,0,4,219582,1274,229,0,814,0,0,0,0,0,21,0,3,0,2068,249,0,1084,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,450,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,696,0,227114 +"332",0,0,0,0,0,0,2607,234,93,3041,328915,3668,437,238,1656,551,125,184,0,4,0,3,163,7,124,1273,4254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,270,2932,0,0,0,0,0,0,0,0,0,0,0,0,115,0,0,0,0,0,1069,0,351962 +"333",0,0,0,0,0,0,1050,0,137,26,2579,351928,1255,1086,1118,294,4,306,6,82,0,9,0,1,115,224,8649,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,0,790,8901,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,0,378756 +"334",0,0,0,0,0,0,68,10,8,26,184,669,286717,810,16,3501,11,1073,0,0,0,5,8,0,236,269,3894,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1374,49281,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,348159 +"335",0,0,0,0,0,0,148,0,21,991,286,475,910,117773,230,63,2,112,0,60,0,95,0,1,185,20,1906,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,264,2428,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,125970 +"3361MV",0,0,0,0,0,0,841,0,3,27,707,1477,74,76,655147,476,29,90,0,80,0,0,0,0,8,249,3054,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,360,12517,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,851,0,676066 +"3364OT",0,0,0,0,0,0,1559,0,0,0,350,1834,1300,188,57,302654,0,0,0,18,0,0,0,0,12,40,1722,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,549,21657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,104,0,332042 +"337",0,0,0,0,0,0,633,402,143,7,261,67,0,1,2,0,69694,259,0,198,0,22,9,0,12,138,1520,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,306,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73697 +"339",0,0,0,0,0,0,1467,47,35,70,356,182,487,62,48,279,244,143384,0,72,15,155,310,29,287,882,5269,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,449,12099,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,166227 +"311FT",0,0,0,0,0,0,314,0,0,0,0,0,0,0,0,0,0,0,929935,0,14,109,0,0,3230,2,9025,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,109,3482,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,946223 +"313TT",0,0,0,0,0,0,103,0,0,2,65,25,0,0,31,2,272,111,0,48371,147,31,70,0,3225,70,741,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,256,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,53537 +"315AL",0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,29,17795,0,0,0,0,0,574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,199,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18625 +"322",0,0,0,0,0,0,172,162,124,1,6,0,1004,0,0,0,0,85,0,119,0,177420,275,0,135,624,1473,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,870,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,354,0,182889 +"323",0,0,0,0,0,0,25,0,0,0,109,0,86,0,0,0,0,520,0,661,27,1116,61386,0,0,504,863,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,201,16521,0,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,0,82196 +"324",0,0,27,200,0,0,407,0,245,0,0,0,0,6,0,0,0,0,0,0,0,3,0,480815,15229,1,3744,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,126,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,500845 +"325",0,0,0,3,0,0,237,0,12,94,126,281,1093,123,0,3,0,531,8208,30,0,238,1,1526,710831,3615,12000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,481,46056,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,785489 +"326",0,0,0,0,0,0,192,143,157,29,453,651,131,93,237,335,219,648,0,679,0,1689,181,7,721,221723,3060,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,117,2009,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,0,233541 +"42",0,686,0,0,0,0,2772,0,0,0,9,483,134,0,353,11,25,1609,3633,0,0,0,0,0,0,0,1748136,0,0,0,0,0,0,0,0,0,722,1049,15,0,0,0,0,0,0,0,0,0,0,12127,0,14277,1540,0,25,0,0,0,0,0,0,0,0,0,0,63149,0,0,0,0,0,0,0,1850756 +"441",0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,196581,0,0,0,0,0,0,28,0,0,408,289,0,0,0,0,4597,0,0,0,0,0,798,0,6,7,0,0,0,46,0,0,0,0,0,214,0,0,76098,0,0,0,0,0,0,0,279078 +"445",0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,8794,0,0,0,0,0,0,0,0,0,200571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,391,0,0,0,0,0,622,0,0,4,0,203,0,0,0,0,0,0,0,62,0,17294,23,0,0,0,0,0,0,0,227964 +"452",0,0,0,0,0,0,2034,0,0,0,0,0,0,0,0,0,0,0,2510,0,0,0,0,0,0,0,0,0,0,211627,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,496,0,187,0,0,1353,0,0,0,0,0,0,7736,4017,0,0,0,0,0,0,0,230215 +"4A0",191,0,0,0,0,0,5810,0,0,0,0,0,0,0,0,0,0,2206,39,0,278,0,38,0,0,0,0,0,0,0,852712,0,0,0,0,0,0,2997,41,0,727,79,0,239,0,0,0,0,0,3783,0,1144,3378,0,2014,0,176,464,0,0,0,0,247,0,16057,15323,0,0,0,0,0,0,0,907942 +"481",0,829,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,0,208311,0,0,0,0,0,466,0,0,0,0,0,0,0,0,0,0,0,81,0,144,1379,0,0,0,0,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,211288 +"482",0,0,0,0,0,0,1922,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,79767,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,201,0,112,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,82025 +"483",0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48446,0,0,0,2374,0,0,0,0,0,0,0,0,0,0,0,0,0,20,4,0,0,0,0,0,0,0,0,0,197,0,0,0,0,0,0,0,0,0,0,51054 +"484",0,0,0,0,0,0,245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321834,0,0,3667,4267,0,0,0,0,0,0,0,0,0,0,343,0,92,78,0,0,2024,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,332550 +"485",0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,13,0,0,0,0,65639,0,74,0,0,0,0,0,0,0,0,0,0,7,0,0,0,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65769 +"486",0,0,0,0,0,128,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43463,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43699 +"487OS",0,0,0,0,0,0,238,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77,0,8,0,0,223,0,1625,1613,381,0,210402,1361,0,0,0,0,0,0,87,0,0,0,76,0,275,258,0,83,0,0,0,0,0,0,0,0,0,80,1042,0,0,0,0,0,0,0,217827 +"493",0,0,0,0,0,0,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1610,0,0,350,117915,0,0,0,0,0,0,0,0,0,0,7,0,97,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,120074 +"511",0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1537,0,0,0,9616,0,0,0,114,0,0,0,0,0,0,0,0,221284,0,0,12377,0,0,0,0,0,0,1,0,10987,58736,0,784,0,6203,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321645 +"512",0,0,0,0,0,0,89,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,666,0,0,0,0,0,0,0,0,0,139731,0,0,0,0,0,0,0,115,154,0,221,2273,0,0,0,0,0,0,0,0,0,74,0,0,0,0,0,0,0,0,0,0,143340 +"513",0,0,0,0,0,0,1778,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4488,0,0,0,893,0,0,0,0,0,0,0,0,0,803,696315,0,0,0,0,0,0,0,10281,0,1813,103269,0,0,0,0,0,0,0,0,0,0,0,0,2439,0,0,0,0,0,0,0,822079 +"514",0,0,0,0,0,0,111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,437,0,0,0,569,0,0,0,0,0,0,0,0,10995,0,195,177485,0,0,0,0,0,0,249,0,17101,82396,0,504,0,761,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,290802 +"521CI",0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,721929,34386,0,0,0,0,69869,0,2817,1217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,830219 +"523",0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22000,536977,7429,0,0,0,0,0,1255,570,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,568232 +"524",0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,789,1015090,0,0,0,0,362,2247,1723,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1020216 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,163449,0,0,0,0,10,85,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,163544 +"HS",0,0,0,0,0,0,15290,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1880411,0,0,0,18,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1895732 +"ORE",0,0,0,0,0,0,796,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,147,0,0,1121617,0,0,112,158,0,0,0,0,0,0,0,0,0,0,19,0,57,0,0,0,0,0,0,0,1122905 +"532RL",0,0,0,0,0,0,98,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,366,68,257,0,901,0,0,0,788,34,0,0,0,0,0,0,0,0,7,873,0,0,2522,321385,0,146,48,0,0,0,2,0,0,0,0,0,0,0,0,1813,0,0,0,0,0,0,0,329307 +"5411",0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,330939,263,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,331383 +"5415",0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3478,0,0,0,298,0,0,0,0,0,0,0,0,2327,0,163,12397,0,0,0,0,0,0,325,0,344289,11210,0,3736,0,1636,0,0,0,0,0,0,0,0,1822,0,0,0,0,0,0,0,381688 +"5412OP",0,0,0,0,0,0,763,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,540,0,0,0,0,0,0,472,4509,0,0,0,0,0,0,0,0,0,0,0,2639,0,581,0,0,0,0,12,0,10236,1261780,0,2482,0,0,0,0,0,0,0,0,0,0,2088,0,0,0,0,0,0,0,1286101 +"55",0,0,0,0,0,0,118,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11562,4390,545660,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,561730 +"561",0,0,0,0,0,0,1451,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2558,0,0,0,0,0,0,0,984,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,287,43,0,8930,11547,0,781645,139,151,12,0,0,45,0,0,0,0,0,0,0,0,0,0,0,0,807857 +"562",0,0,75,0,0,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,147,0,0,0,0,0,0,13,0,0,0,0,0,0,0,0,0,0,0,420,0,36,65,0,0,88449,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,554,0,89811 +"61",0,0,0,0,0,0,998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1387,0,0,0,0,0,0,0,0,0,0,0,0,0,0,97,0,0,68,82,0,3910,26655,0,0,0,268805,0,0,0,0,1537,0,25242,12300,16,0,0,0,0,0,0,0,341095 +"621",0,0,0,0,0,0,395,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3050,0,758,98,0,0,0,0,942765,0,0,0,0,0,0,204,0,0,0,0,0,0,0,0,956675 +"622",0,0,0,0,0,0,2196,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1025,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1286,0,2464,5900,0,0,0,0,7215,790568,0,0,0,0,0,2401,0,0,0,0,0,0,0,0,813055 +"623",0,0,0,0,0,0,133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,107,0,0,3,9,0,0,0,0,996,0,228990,119,0,0,0,345,0,0,0,0,0,0,0,0,230719 +"624",0,0,0,0,0,0,361,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,97,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,2,0,0,0,0,256,0,2161,184431,0,0,0,0,0,0,0,0,0,0,0,0,187572 +"711AS",0,0,0,0,0,0,729,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1378,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,844,1159,0,95,7579,0,0,0,16,0,0,0,0,150180,2964,8,3683,337,0,0,0,0,0,0,0,168972 +"713",0,0,0,0,0,0,361,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,426,0,0,2272,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,151,333,0,41,155,0,0,0,1162,0,0,0,776,214,115022,424,13559,1090,0,0,0,0,0,0,0,135985 +"721",0,0,0,0,0,0,1989,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,392,415,801,0,0,0,0,0,0,0,0,0,0,241,0,0,0,0,0,0,1079,1299,0,24,0,0,0,0,0,0,0,0,0,1467,31441,174879,42856,1731,0,0,0,0,0,0,0,258628 +"722",0,0,0,0,0,0,1052,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,805,0,1679,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1096,166,733521,0,0,0,0,0,0,157,0,738477 +"81",0,0,0,0,0,0,389,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,510,1818,0,131,3454,0,0,0,0,0,0,0,0,0,0,0,432,0,0,0,0,0,1292,258,0,724,1267,0,0,0,28,0,0,0,309,0,0,0,3443,628385,0,0,0,0,0,0,0,642441 +"GFGD",0,0,0,0,0,0,4,0,0,0,0,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,0,14,0,0,0,0,0,0,0,0,2021,22641,0,0,0,235,0,1494,0,0,21,0,0,0,0,586829,0,0,0,0,0,0,613306 +"GFGN",0,111,0,0,0,56,266,0,0,1,0,0,0,0,0,0,0,66,0,0,0,0,9,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,193,0,0,0,0,0,0,86,0,0,0,0,2302,14670,0,0,0,0,0,1437,0,0,0,0,0,0,0,0,368316,481,0,0,0,3291,391290 +"GFE",0,0,0,0,0,13514,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3111,33,0,0,0,0,0,0,0,0,0,15,0,0,0,0,1583,0,0,762,0,0,615,0,0,0,0,0,0,0,0,0,0,0,0,1437,0,0,0,72992,0,0,0,0,94062 +"GSLG",527,3075,0,532,0,1128,18267,198,0,0,0,0,0,0,0,0,0,1097,1917,0,1182,582,1504,0,97,0,0,0,0,0,0,0,0,0,0,0,0,0,0,491,1,0,2105,0,0,0,24935,0,0,0,0,5113,49189,0,7870,13474,90114,31429,191049,0,3232,2968,2542,9594,17804,1077,0,0,0,1653836,0,3858,0,2140785 +"GSLE",0,0,0,0,0,132455,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4825,0,0,0,159,343,0,16382,0,12285,0,0,0,0,0,24,0,-67,0,7067,25467,0,0,0,0,0,0,0,0,0,0,0,0,173,30564,0,0,3008,0,0,0,0,94744,0,0,327428 +"Total Commodity Output",395700,62848,216474,83486,156339,653591,1481455,98860,114656,223898,337021,362108,293637,121551,658894,308174,71137,152285,955041,50858,19457,181911,68588,497874,738024,230019,1834220,198907,206857,215853,883472,208534,79926,50413,325874,82436,46760,234085,123887,235290,141319,696993,207450,749180,572740,1025304,188469,1887478,1154317,428523,331301,452555,1858870,545660,799648,104086,369336,984542,984547,231151,188912,156560,186832,210331,872719,803629,586829,368316,73472,1653836,96477,7995,3291,32183068 diff --git a/flowsa/data/external_data/BEA_Summary_Make_2016_BeforeRedef.csv b/flowsa/data/external_data/BEA_Summary_Make_2016_BeforeRedef.csv new file mode 100644 index 000000000..cd235edb3 --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Make_2016_BeforeRedef.csv @@ -0,0 +1,73 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","Used","Other","Total Industry Output" +"111CA",373112,4444,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2110,0,0,0,0,0,0,0,0,0,0,379677 +"113FF",21,51802,0,0,0,0,753,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52575 +"211",0,0,183991,85,30534,0,671,0,0,0,5,109,0,0,0,0,0,0,0,0,0,0,0,13296,142,0,499,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,142,1012,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,230486 +"212",0,0,0,74571,5618,0,12354,0,366,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,2461,0,550,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,114,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96130 +"213",0,0,41,55,53910,0,5559,0,0,0,1036,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,499,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,70,596,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,61795 +"22",0,0,88,0,0,490657,2854,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0,0,0,0,0,2576,0,0,0,0,0,0,0,0,0,0,0,0,0,0,499,170,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1774,0,0,498637 +"23",0,0,0,0,0,0,1494747,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,334,71,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1495152 +"321",0,0,0,0,0,0,804,101222,244,0,325,0,0,0,0,0,450,2,0,1,0,154,0,0,18,218,1076,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43,0,104683 +"327",0,0,4,620,1,0,1141,1,119052,0,208,3,0,275,0,8,111,1,0,501,0,208,0,34,124,179,1468,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,812,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,124776 +"331",0,0,0,0,0,0,351,0,5,197125,994,200,0,729,0,0,0,0,0,19,0,2,0,1854,199,0,999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,59,438,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,632,0,203609 +"332",0,0,0,0,0,0,2173,218,131,2987,318222,3635,504,236,1495,643,120,250,0,2,0,2,157,10,136,1298,4160,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,314,2648,0,0,0,0,0,0,0,0,0,0,0,0,208,0,0,0,0,0,1066,0,340615 +"333",0,0,0,0,0,0,826,0,178,25,2188,327505,1117,1283,994,316,6,355,7,79,0,8,0,1,155,236,8232,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,715,8239,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,153,0,352634 +"334",0,0,0,0,0,0,63,67,27,25,172,638,281123,741,17,4187,12,1115,0,0,0,5,8,0,264,302,3835,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1402,52403,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,346409 +"335",0,0,0,0,0,0,89,0,27,843,270,435,868,113026,266,76,2,117,0,65,0,80,0,0,193,21,1839,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,269,2743,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,121230 +"3361MV",0,0,0,0,0,0,685,0,4,24,685,1419,42,62,663706,629,42,112,0,88,0,0,0,0,10,274,3025,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,333,14365,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,868,0,686373 +"3364OT",0,0,0,0,0,0,1160,0,0,0,324,1476,1246,129,73,282124,0,0,0,25,0,0,0,0,10,35,1631,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,564,20522,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88,0,309408 +"337",0,0,0,0,0,0,540,396,171,7,261,62,0,1,1,0,70410,246,0,195,0,18,9,0,15,140,1537,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,263,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,74304 +"339",0,0,0,0,0,0,1398,42,57,72,295,155,472,61,45,283,231,134838,0,69,4,123,300,27,306,798,5089,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,458,12265,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,157387 +"311FT",0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,929503,1,5,121,0,0,3167,2,9089,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,142,3568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,945857 +"313TT",0,0,0,0,0,0,75,0,0,2,100,24,0,0,23,1,258,121,0,47177,121,24,67,0,3081,66,716,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,416,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52287 +"315AL",0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,27,18042,0,0,0,0,0,561,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,325,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18977 +"322",0,0,0,0,0,0,128,155,145,1,6,0,676,0,0,0,0,100,0,149,0,171852,281,0,159,673,1405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,59,874,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,353,0,177015 +"323",0,0,0,0,0,0,19,0,0,0,104,0,58,0,0,0,0,558,0,694,27,1005,64372,0,0,490,1102,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,211,16861,0,117,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,0,85684 +"324",0,0,13,169,0,0,352,0,194,0,0,0,0,3,0,0,0,0,0,0,0,1,0,414374,13837,1,3757,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,234,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,432966 +"325",0,0,0,3,0,0,182,0,22,94,114,227,837,118,0,1,0,514,7662,26,0,168,1,1560,702846,3188,10718,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,477,49243,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,778003 +"326",0,0,0,0,0,0,136,136,187,30,462,586,135,89,250,329,220,708,0,638,0,1579,194,16,816,218242,3024,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,142,2807,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,230789 +"42",0,683,0,0,0,0,2966,0,0,0,9,489,137,0,337,11,26,1573,3486,0,0,0,0,0,0,0,1748264,0,0,0,0,0,0,0,0,0,630,1111,15,0,0,0,0,0,0,0,0,0,0,12214,0,15071,921,0,28,0,0,0,0,0,0,0,0,0,0,64253,0,0,0,0,0,0,0,1852225 +"441",0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,213916,0,0,0,0,0,0,29,0,0,440,312,0,0,0,0,4797,0,0,0,0,0,844,0,6,11,0,0,0,48,0,0,0,0,0,219,0,0,79316,0,0,0,0,0,0,0,299944 +"445",0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,8968,0,0,0,0,0,0,0,0,0,203945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,401,0,0,0,0,0,530,0,3,6,0,207,0,0,0,0,0,0,0,63,0,18373,23,0,0,0,0,0,0,0,232520 +"452",0,0,0,0,0,0,1777,0,0,0,0,0,0,0,0,0,0,0,2568,0,0,0,0,0,0,0,0,0,0,211697,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,260,0,0,499,0,191,0,0,1370,0,0,0,0,0,0,8219,4063,0,0,0,0,0,0,0,230645 +"4A0",189,0,0,0,0,0,6948,0,0,0,0,0,0,0,0,0,0,2174,43,0,285,0,35,0,0,0,0,0,0,0,889185,0,0,0,0,0,0,3151,44,0,803,73,0,246,0,0,0,0,0,3948,0,1441,5212,0,1966,0,184,486,0,0,0,0,262,0,17058,15883,0,0,0,0,0,0,0,949615 +"481",0,915,0,0,0,0,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0,0,0,0,206635,0,0,0,0,0,513,0,0,0,0,0,0,0,0,0,0,0,89,0,120,1802,0,0,0,0,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,210211 +"482",0,0,0,0,0,0,1230,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73420,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,189,0,138,129,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,75106 +"483",0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47189,0,0,0,2301,0,0,0,0,0,0,0,0,0,0,0,0,0,15,21,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,49734 +"484",0,0,0,0,0,0,181,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,320638,0,0,3667,4265,0,0,0,0,0,0,0,0,0,0,342,0,99,166,0,0,2013,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,331371 +"485",0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,14,0,0,0,0,67398,0,73,0,0,0,0,0,0,0,0,0,0,7,0,0,0,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67526 +"486",0,0,0,0,0,130,91,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44175,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44488 +"487OS",0,0,0,0,0,0,341,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,82,0,8,0,0,239,0,1602,1600,391,0,215020,1441,0,0,0,0,0,0,86,0,0,0,76,0,296,520,0,86,0,0,0,0,0,0,0,0,0,77,1096,0,0,0,0,0,0,0,222961 +"493",0,0,0,0,0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1751,0,0,381,126909,0,0,0,0,0,0,0,0,0,0,8,0,124,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,129421 +"511",0,0,0,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1479,0,0,0,10790,0,0,0,118,0,0,0,0,0,0,0,0,244525,0,0,12433,0,0,0,0,0,0,1,0,12239,57204,0,772,0,6967,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,346546 +"512",0,0,0,0,0,0,108,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,705,0,0,0,0,0,0,0,0,0,145654,0,0,0,0,0,0,0,119,159,0,251,2523,0,0,0,0,0,0,0,0,0,77,0,0,0,0,0,0,0,0,0,0,149615 +"513",0,0,0,0,0,0,1764,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4599,0,0,0,899,0,0,0,0,0,0,0,0,0,855,726146,0,0,0,0,0,0,0,10942,0,1920,112441,0,0,0,0,0,0,0,0,0,0,0,0,2518,0,0,0,0,0,0,0,862085 +"514",0,0,0,0,0,0,169,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,458,0,0,0,654,0,0,0,0,0,0,0,0,11868,0,204,194375,0,0,0,0,0,0,261,0,17963,97730,0,529,0,800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,325011 +"521CI",0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,760827,34093,0,0,0,0,77562,0,3060,1673,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,877218 +"523",0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21869,534062,7292,0,0,0,0,0,1334,783,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,565341 +"524",0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,819,1056801,0,0,0,0,380,2348,2368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1062721 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,155863,0,0,0,0,0,117,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,155980 +"HS",0,0,0,0,0,0,14934,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1955610,0,0,0,20,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1970581 +"ORE",0,0,0,0,0,0,855,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,146,0,0,1192292,0,0,172,189,0,0,0,0,0,0,0,0,0,0,20,0,61,0,0,0,0,0,0,0,1193736 +"532RL",0,0,0,0,0,0,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,360,70,282,0,944,0,0,0,779,36,0,0,0,0,0,0,0,0,7,919,0,0,2582,324168,0,150,65,0,0,0,2,0,0,0,0,0,0,0,0,1884,0,0,0,0,0,0,0,332364 +"5411",0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,337629,274,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,338068 +"5415",0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3401,0,0,0,344,0,0,0,0,0,0,0,0,2490,0,173,13329,0,0,0,0,0,0,342,0,367143,12200,0,4059,0,1735,0,0,0,0,0,0,0,0,1918,0,0,0,0,0,0,0,407144 +"5412OP",0,0,0,0,0,0,930,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,562,0,0,0,0,0,0,488,4862,0,0,0,0,0,0,0,0,0,0,0,2733,0,615,0,0,0,0,13,0,10817,1311803,0,2591,0,0,0,0,0,0,0,0,0,0,2267,0,0,0,0,0,0,0,1337680 +"55",0,0,0,0,0,0,125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12343,5120,549245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,566833 +"561",0,0,0,0,0,0,1962,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2693,0,0,0,0,0,0,0,931,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,0,0,297,47,0,9525,12186,0,846449,151,166,13,0,0,49,0,0,0,0,0,0,0,0,0,0,0,0,874536 +"562",0,0,78,0,0,0,27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,152,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,452,0,38,71,0,0,94251,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,0,95658 +"61",0,0,0,0,0,0,795,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,99,0,0,70,82,0,4312,28324,0,0,0,278525,0,0,0,0,1581,0,25946,11939,16,0,0,0,0,0,0,0,353134 +"621",0,0,0,0,0,0,313,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9974,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3209,0,868,158,0,0,0,0,998588,0,0,0,0,0,0,215,0,0,0,0,0,0,0,0,1013324 +"622",0,0,0,0,0,0,935,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1074,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1350,0,2650,6076,0,0,0,0,7417,829314,0,0,0,0,0,2510,0,0,0,0,0,0,0,0,851325 +"623",0,0,0,0,0,0,57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,110,0,0,9,14,0,0,0,0,1035,0,238295,123,0,0,0,357,0,0,0,0,0,0,0,0,240019 +"624",0,0,0,0,0,0,172,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,97,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,76,4,0,0,0,0,279,0,2294,195370,0,0,0,0,0,0,0,0,0,0,0,0,198496 +"711AS",0,0,0,0,0,0,655,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,835,1234,0,84,8053,0,0,0,18,0,0,0,0,156621,2832,8,3862,356,0,0,0,0,0,0,0,175969 +"713",0,0,0,0,0,0,445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,465,0,0,2380,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,159,346,0,29,164,0,0,0,1219,0,0,0,807,224,120386,444,14224,1121,0,0,0,0,0,0,0,142415 +"721",0,0,0,0,0,0,1345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,404,459,817,0,0,0,0,0,0,0,0,0,0,253,0,0,0,0,0,0,1130,1364,0,25,0,0,0,0,0,0,0,0,0,1537,32720,182851,44946,1816,0,0,0,0,0,0,0,269683 +"722",0,0,0,0,0,0,852,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,829,0,1754,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1089,173,770553,0,0,0,0,0,0,165,0,775415 +"81",0,0,0,0,0,0,726,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,515,2004,0,151,3561,0,0,0,0,0,0,0,0,0,0,0,422,0,0,0,0,0,1346,264,0,710,1324,0,0,0,29,0,0,0,316,0,0,0,3483,656336,0,0,0,0,0,0,0,671187 +"GFGD",0,0,0,0,0,0,4,0,0,0,0,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,0,13,0,0,0,0,0,0,0,0,2148,21994,0,0,0,220,0,1398,0,0,20,0,0,0,0,588899,0,0,0,0,0,0,614739 +"GFGN",0,161,0,0,0,82,286,0,0,1,0,0,0,0,0,0,0,96,0,0,0,0,13,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,283,0,0,0,0,0,0,126,0,0,0,0,2379,16221,0,0,0,0,0,2098,0,0,0,0,0,0,0,0,376809,702,0,0,0,3223,402490 +"GFE",0,0,0,0,0,13571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3004,34,0,0,0,0,0,0,0,0,0,15,0,0,0,0,1584,0,0,771,0,0,611,0,0,0,0,0,0,0,0,0,0,0,0,1394,0,0,0,72811,0,0,0,0,93794 +"GSLG",524,3059,0,582,0,1122,19146,197,0,0,0,0,0,0,0,0,0,1123,2003,0,1210,596,1552,0,99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,503,1,0,2146,0,0,0,26169,0,0,0,0,5078,51391,0,8276,13672,92344,33131,201396,0,3383,3056,2619,9844,18208,1109,0,0,0,1697401,0,3914,0,2204856 +"GSLE",0,0,0,0,0,133546,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4926,0,0,0,161,370,0,16618,0,12960,0,0,0,0,0,19,0,-75,0,7371,24139,0,0,0,0,0,0,0,0,0,0,0,0,153,31619,0,0,3135,0,0,0,0,98929,0,0,333872 +"Total Commodity Output",373846,61064,184215,76086,90062,639108,1587719,102445,120810,201236,325781,336967,287224,116753,667207,288608,71888,144003,954240,49756,19694,175948,71724,431296,728050,226164,1833319,216470,210395,215896,921502,206874,73581,49160,324796,84443,47380,239632,132985,259668,147367,726850,225453,788158,569597,1066919,182158,1962981,1223857,440312,338009,482228,1951077,549245,865273,110087,382256,1042379,1034206,240589,200049,163191,194195,219286,915417,837381,588899,376809,73513,1697401,100702,7999,3223,32855063 diff --git a/flowsa/data/external_data/BEA_Summary_Make_2017_BeforeRedef.csv b/flowsa/data/external_data/BEA_Summary_Make_2017_BeforeRedef.csv new file mode 100644 index 000000000..aef6d4f61 --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Make_2017_BeforeRedef.csv @@ -0,0 +1,73 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","Used","Other","Total Industry Output" +"111CA",387565,5527,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2276,0,0,0,0,0,0,0,0,0,0,395379 +"113FF",20,56148,0,0,0,0,838,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57006 +"211",0,0,241083,79,40676,0,835,0,0,0,7,142,0,0,0,0,0,0,0,0,0,0,0,20452,183,0,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,110,963,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,305097 +"212",0,0,0,84979,7129,0,9694,0,393,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,2515,0,585,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,109,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,105504 +"213",0,0,59,57,79025,0,6194,0,0,0,1160,0,0,0,0,0,0,0,0,0,0,0,0,33,0,0,599,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,580,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,87745 +"22",0,0,104,0,0,503400,2577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,0,0,2725,0,0,0,0,0,0,0,0,0,0,0,0,0,0,507,143,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1794,0,0,511269 +"23",0,0,0,0,0,0,1569726,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,126,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1570262 +"321",0,0,0,0,0,0,601,109404,86,0,156,0,0,0,0,0,188,0,0,0,0,5,0,0,9,161,829,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,103,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,332,0,111892 +"327",0,0,4,645,1,0,695,62,123397,0,86,4,0,98,0,5,14,1,0,10,0,39,0,34,23,64,688,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,792,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,126704 +"331",0,0,0,0,0,0,192,0,4,216049,1488,114,1,778,0,0,1,0,0,4,0,2,0,1730,333,1,753,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77,522,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,222742 +"332",0,0,0,0,0,0,2274,143,49,3167,325303,2652,222,77,602,335,42,35,0,1,0,0,148,4,59,519,2197,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,320,2626,0,0,0,0,0,0,0,0,0,0,0,0,211,0,0,0,0,0,2817,0,343802 +"333",0,0,0,0,0,0,622,0,126,17,1748,345113,497,2390,1261,452,1,66,1,0,0,0,0,0,17,7,2813,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,0,868,8259,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,364463 +"334",0,0,0,0,0,0,46,0,29,12,81,683,296076,656,4,827,1,1140,0,0,0,2,5,0,106,30,1768,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1394,50132,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,352993 +"335",0,0,0,0,0,0,68,0,15,565,196,823,476,113801,902,20,5,51,0,5,0,180,0,0,146,100,1497,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,289,2499,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,121637 +"3361MV",0,0,0,0,0,0,467,0,0,25,741,2020,67,581,655256,2215,5,20,0,44,0,0,0,0,5,151,1392,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,398,15024,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,564,0,678976 +"3364OT",0,0,0,0,0,0,739,0,0,0,65,548,508,19,1913,313785,0,0,0,2,0,0,0,0,4,8,344,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,796,20111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,338874 +"337",0,0,0,0,0,0,421,593,8,0,78,28,0,1,0,0,71454,219,0,65,0,2,15,0,0,22,793,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,305,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,74040 +"339",0,0,0,0,0,0,823,18,32,15,276,317,153,20,11,65,157,138265,0,31,4,61,187,79,122,578,4128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,478,12987,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,158806 +"311FT",0,0,0,0,0,0,166,0,0,0,0,0,0,0,0,0,0,0,929538,0,645,30,0,0,2073,0,5528,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,140,3294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,941416 +"313TT",0,0,0,0,0,0,47,0,0,1,5,1,0,0,0,0,99,27,0,45174,208,1,176,0,3533,11,545,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,318,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50162 +"315AL",0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,162,16492,0,0,0,0,0,462,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,246,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17378 +"322",0,0,0,0,0,0,80,525,62,0,1,0,592,0,0,0,0,61,0,338,0,177342,211,0,133,702,1188,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,585,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,445,0,182317 +"323",0,0,0,0,0,0,14,0,0,0,57,0,24,0,0,0,0,401,0,556,6,424,63936,0,0,151,262,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,205,16525,0,345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,205,0,83111 +"324",0,0,4,166,0,0,261,0,141,0,0,0,0,5,0,0,0,0,0,0,0,0,0,500661,31300,0,3523,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,183,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,536275 +"325",0,0,0,3,0,0,122,0,16,25,34,215,1163,11,2,0,0,854,8001,7,0,223,0,7649,713888,3209,6973,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,539,48472,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,791408 +"326",0,0,0,0,0,0,94,118,56,10,171,385,27,217,405,72,62,1048,0,238,0,972,182,3,1590,226349,1621,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,158,2428,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,275,0,236483 +"42",0,681,0,0,0,0,4017,0,0,0,10,517,144,0,336,12,28,1516,3509,0,0,0,0,0,0,0,1850792,0,0,0,0,0,0,0,0,0,772,1132,15,0,0,0,0,0,0,0,0,0,0,13215,0,16846,940,0,27,0,0,0,0,0,0,0,0,0,0,66385,0,0,0,0,0,0,0,1960895 +"441",0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,216685,0,0,0,0,0,0,31,0,0,404,337,0,0,0,0,4939,0,0,0,0,0,871,0,5,19,0,0,0,50,0,0,0,0,0,228,0,0,80876,0,0,0,0,0,0,0,304451 +"445",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9321,0,0,0,0,0,0,0,0,0,213203,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,0,0,0,0,0,450,0,3,10,0,215,0,0,0,0,0,0,0,66,0,19485,24,0,0,0,0,0,0,0,243193 +"452",0,0,0,0,0,0,2287,0,0,0,0,0,0,0,0,0,0,0,2640,0,0,0,0,0,0,0,0,0,0,213931,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,266,0,5,514,0,197,0,0,1367,0,0,0,0,0,0,8713,4145,0,0,0,0,0,0,0,234065 +"4A0",190,0,0,0,0,0,6348,0,0,0,0,0,0,0,0,0,0,2178,48,0,284,0,33,0,0,0,0,0,0,0,933544,0,0,0,0,0,0,3427,47,0,898,67,0,249,0,0,0,0,0,4074,0,1372,5380,0,1960,0,192,492,0,0,0,0,274,0,18089,16696,0,0,0,0,0,0,0,995842 +"481",0,1008,0,0,0,0,36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,0,0,218757,0,0,0,0,0,521,0,0,0,0,0,0,0,0,0,0,0,90,0,110,2140,0,0,0,0,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,222740 +"482",0,0,0,0,0,0,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,78027,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,216,0,137,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,78784 +"483",0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50757,0,0,0,2272,0,0,0,0,0,0,0,0,0,0,0,0,0,7,40,0,0,0,0,0,0,0,0,0,218,0,0,0,0,0,0,0,0,0,0,53294 +"484",0,0,0,0,0,0,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,345508,0,0,4025,4535,0,0,0,0,0,0,0,0,0,0,366,0,83,264,0,0,2136,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,356935 +"485",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,15,0,0,0,0,76011,0,81,0,0,0,0,0,0,0,0,0,0,8,0,0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,76159 +"486",0,0,0,0,0,139,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46738,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,130,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47146 +"487OS",0,0,0,0,0,0,86,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80,0,8,0,0,227,0,1649,1661,405,0,222961,1450,0,0,0,0,0,0,89,0,0,0,78,0,306,809,0,90,0,0,0,0,0,0,0,0,0,69,1156,0,0,0,0,0,0,0,231124 +"493",0,0,0,0,0,0,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1873,0,0,416,135876,0,0,0,0,0,0,0,0,0,0,8,0,121,392,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138749 +"511",0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1488,0,0,0,11928,0,0,0,120,0,0,0,0,0,0,0,0,265762,0,0,12451,0,0,0,0,0,0,1,0,13489,55863,0,767,0,7700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,369583 +"512",0,0,0,0,0,0,56,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,669,0,0,0,0,0,0,0,0,0,146089,0,0,0,0,0,0,0,115,155,0,287,2812,0,0,0,0,0,0,0,0,0,63,0,0,0,0,0,0,0,0,0,0,150267 +"513",0,0,0,0,0,0,1539,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4546,0,0,0,914,0,0,0,0,0,0,0,0,0,878,720474,0,0,0,0,0,0,0,10657,0,2045,113596,0,0,0,0,0,0,0,0,0,0,0,0,2486,0,0,0,0,0,0,0,857135 +"514",0,0,0,0,0,0,532,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,517,0,0,0,741,0,0,0,0,0,0,0,0,13302,0,231,218557,0,0,0,0,0,0,294,0,20263,111886,0,597,0,901,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,367819 +"521CI",0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,823606,34001,0,0,0,0,79867,0,3175,1817,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,942469 +"523",0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24016,558682,7430,0,0,0,0,0,1298,851,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,592278 +"524",0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,1131290,0,0,0,0,406,2548,2572,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1137682 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,155667,0,0,0,0,1,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,155795 +"HS",0,0,0,0,0,0,20343,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2028316,0,0,0,68,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2048746 +"ORE",0,0,0,0,0,0,857,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,148,0,0,1226619,0,0,208,202,0,0,0,0,0,0,0,0,0,0,21,0,64,0,0,0,0,0,0,0,1228119 +"532RL",0,0,0,0,0,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,378,72,282,0,982,0,0,0,819,38,0,0,0,0,0,0,0,0,8,945,0,0,2575,330202,0,134,71,0,0,0,2,0,0,0,0,0,0,0,0,1975,0,0,0,0,0,0,0,338532 +"5411",0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,358197,320,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,358680 +"5415",0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3640,0,0,0,394,0,0,0,0,0,0,0,0,2772,0,188,13910,0,0,0,0,0,0,368,0,398338,10534,0,4537,0,1895,0,0,0,0,0,0,0,0,2053,0,0,0,0,0,0,0,438637 +"5412OP",0,0,0,0,0,0,511,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,569,0,0,0,0,0,0,513,5282,0,0,0,0,0,0,0,0,0,0,0,2869,0,639,0,0,0,0,13,0,11390,1385909,0,2725,0,0,0,0,0,0,0,0,0,0,2461,0,0,0,0,0,0,0,1412883 +"55",0,0,0,0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12902,5057,584600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,602634 +"561",0,0,0,0,0,0,1075,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2767,0,0,0,0,0,0,0,886,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,0,0,304,50,0,9372,12879,0,909512,158,207,14,0,0,53,0,0,0,0,0,0,0,0,0,0,0,0,937346 +"562",0,0,85,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,159,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,482,0,20,74,0,0,101151,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,628,0,102615 +"61",0,0,0,0,0,0,694,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1505,0,0,0,0,0,0,0,0,0,0,0,0,0,0,99,0,0,72,84,0,4384,29884,0,0,0,287306,0,0,0,0,1631,0,26942,11600,16,0,0,0,0,0,0,0,364218 +"621",0,0,0,0,0,0,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10501,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3377,0,916,187,0,0,0,0,1047740,0,0,0,0,0,0,226,0,0,0,0,0,0,0,0,1063361 +"622",0,0,0,0,0,0,1226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1396,0,2840,6496,0,0,0,0,7618,855961,0,0,0,0,0,2600,0,0,0,0,0,0,0,0,879248 +"623",0,0,0,0,0,0,41,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,113,0,0,18,17,0,0,0,0,1069,0,243416,129,0,0,0,365,0,0,0,0,0,0,0,0,245186 +"624",0,0,0,0,0,0,136,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,106,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,76,6,0,0,0,0,305,0,2447,206450,0,0,0,0,0,0,0,0,0,0,0,0,209751 +"711AS",0,0,0,0,0,0,581,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1564,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,943,1356,0,79,8734,0,0,0,19,0,0,0,0,168006,3075,8,4234,397,0,0,0,0,0,0,0,188996 +"713",0,0,0,0,0,0,510,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,475,0,0,2491,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,165,356,0,44,173,0,0,0,1266,0,0,0,825,232,127831,462,14776,1171,0,0,0,0,0,0,0,150776 +"721",0,0,0,0,0,0,1577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,423,486,829,0,0,0,0,0,0,0,0,0,0,266,0,0,0,0,0,0,1187,1437,0,29,1,0,0,0,0,0,0,0,0,1614,34323,192045,47245,1911,0,0,0,0,0,0,0,283389 +"722",0,0,0,0,0,0,738,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,869,0,1838,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1140,182,811313,0,0,0,0,0,0,174,0,816253 +"81",0,0,0,0,0,0,488,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,585,2133,0,171,3748,0,0,0,0,0,0,0,0,0,0,0,378,0,0,0,0,0,1394,273,0,777,1393,0,0,0,30,0,0,0,334,0,0,0,3669,680368,0,0,0,0,0,0,0,695741 +"GFGD",0,0,0,0,0,0,4,0,0,0,0,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,0,14,0,0,0,0,0,0,0,0,2222,21410,0,0,0,227,0,1443,0,0,20,0,0,0,0,601506,0,0,0,0,0,0,626891 +"GFGN",0,159,0,0,0,81,255,0,0,1,0,0,0,0,0,0,0,95,0,0,0,0,13,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,279,0,0,0,0,0,0,124,0,0,0,0,2461,17239,0,0,0,0,0,2068,0,0,0,0,0,0,0,0,381020,692,0,0,0,3363,407860 +"GFE",0,0,0,0,0,13635,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3067,35,0,0,0,0,0,0,0,0,0,18,0,0,0,0,1559,0,0,773,0,0,620,0,0,0,0,0,0,0,0,0,0,0,0,1435,0,0,0,70278,0,0,0,0,91422 +"GSLG",542,3164,0,623,0,1160,19990,204,0,0,0,0,0,0,0,0,0,1146,2098,0,1237,609,1622,0,102,0,0,0,0,0,0,0,0,0,0,0,0,0,0,521,1,0,2233,0,0,0,28209,0,0,0,0,5326,54166,0,8816,13888,94282,34913,212229,0,3545,3146,2700,10063,18569,1144,0,0,0,1744034,0,3976,0,2274258 +"GSLE",0,0,0,0,0,137198,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5086,0,0,0,171,429,0,16735,0,13407,0,0,0,0,0,20,0,-77,0,7447,25128,0,0,0,0,0,0,0,0,0,0,0,0,167,32923,0,0,3275,0,0,0,0,102492,0,0,344402 +"Total Commodity Output",388317,66688,241339,86553,126831,655613,1662463,111080,124415,219888,331662,353564,299960,118653,660692,317789,72059,147128,955155,46639,18876,179893,71351,530745,756151,232064,1911565,219381,219871,218274,967589,218984,78198,52835,349893,93190,50235,248660,142261,282635,147926,721225,250411,853245,594195,1141551,184000,2035762,1259395,450016,358603,521598,2042374,584600,929788,117333,394078,1093577,1071702,245862,211337,174816,205116,229723,962387,866814,601506,381020,70970,1744034,104287,10339,3363,34392092 diff --git a/flowsa/data/external_data/BEA_Summary_Make_2018_BeforeRedef.csv b/flowsa/data/external_data/BEA_Summary_Make_2018_BeforeRedef.csv new file mode 100644 index 000000000..be80175c3 --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Make_2018_BeforeRedef.csv @@ -0,0 +1,73 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","Used","Other","Total Industry Output" +"111CA",388389,4702,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1999,0,0,0,0,0,0,0,0,0,0,395102 +"113FF",19,55605,0,0,0,0,604,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56228 +"211",0,0,328271,90,50214,0,468,0,0,0,9,194,0,0,0,0,0,0,0,0,0,0,0,29073,255,0,712,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,621,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410045 +"212",0,0,0,89954,7219,0,10355,0,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,106,2569,0,622,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,111313 +"213",0,0,75,61,93899,0,6603,0,0,0,3820,0,0,0,0,0,0,0,0,0,0,0,0,141,0,0,726,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47,444,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,105817 +"22",0,0,104,0,0,548884,2746,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,0,0,3055,0,0,0,0,0,0,0,0,0,0,0,0,0,0,478,122,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2091,0,0,557498 +"23",0,0,0,0,0,0,1647406,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,387,161,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1647954 +"321",0,0,0,0,0,0,583,117991,5,0,58,0,0,0,0,0,240,0,0,0,0,9,0,0,7,10,1093,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,289,0,120426 +"327",0,0,5,652,1,0,766,4,129384,0,15,1,0,53,37,9,38,2,0,23,0,8,0,60,66,51,816,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,853,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,132895 +"331",0,0,0,0,0,0,207,0,8,247647,1329,133,1,334,0,0,10,0,0,18,0,2,0,1942,284,1,667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,95,569,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,560,0,253806 +"332",0,0,0,0,0,0,2583,818,60,3278,352361,2802,260,130,941,946,51,89,0,79,0,0,91,2,34,713,3457,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,360,2537,0,0,0,0,0,0,0,0,0,0,0,0,605,0,0,0,0,0,3485,0,375683 +"333",0,0,0,0,0,0,623,0,147,26,1605,371523,592,2899,570,1018,21,173,2,2,0,0,0,0,66,27,4640,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,925,9305,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,327,0,394503 +"334",0,0,0,0,0,0,53,0,2,29,32,650,309142,755,9,705,4,637,0,0,0,0,10,0,32,7,2133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1373,54148,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,369723 +"335",0,0,0,0,0,0,71,0,14,242,161,396,213,122249,85,14,0,24,0,3,0,24,0,0,10,69,1868,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,318,2648,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128411 +"3361MV",0,0,0,0,0,0,500,0,2,60,924,1972,19,628,687718,2440,0,37,0,173,0,0,0,0,8,84,1708,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,330,16239,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,385,0,713227 +"3364OT",0,0,0,0,0,0,752,0,0,0,194,308,684,21,1862,317739,0,0,0,1,0,0,0,0,0,23,884,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,748,18655,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,341894 +"337",0,0,0,0,0,0,369,470,20,2,100,2,0,1,0,0,74810,191,0,50,15,3,4,0,0,3,868,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,53,281,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77242 +"339",0,0,0,0,0,0,766,47,10,3,391,28,129,162,10,45,210,146068,0,23,16,56,310,7,160,511,4439,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,586,13680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,167656 +"311FT",0,0,0,0,0,0,166,0,0,0,0,0,0,0,0,0,0,0,939866,1,661,159,0,0,2648,0,7072,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,3395,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,954102 +"313TT",0,0,0,0,0,0,46,0,0,1,0,0,0,0,0,0,74,56,0,45511,163,0,110,0,3658,23,581,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,346,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50579 +"315AL",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,16218,0,0,0,0,0,479,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,273,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17161 +"322",0,0,0,0,0,0,78,322,24,0,1,0,77,0,0,0,0,14,0,251,0,186341,211,0,19,164,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,53,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,271,0,188941 +"323",0,0,0,0,0,0,12,0,0,0,105,0,6,0,0,0,0,583,0,600,6,701,63573,0,0,250,348,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,177,17814,0,289,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,175,0,84637 +"324",0,0,1,171,0,0,269,0,91,0,0,0,0,43,0,0,0,0,0,0,0,2,0,623945,35082,1,5095,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,781,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,665516 +"325",0,0,0,4,0,0,133,0,5,13,2,165,946,15,1,0,0,802,7140,22,0,56,0,8110,746589,2788,6955,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,564,54396,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,828705 +"326",0,0,0,0,0,0,96,356,107,5,509,149,34,299,663,45,41,654,0,830,0,649,130,0,963,243114,1798,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,190,1807,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,0,252617 +"42",0,677,0,0,0,0,4451,0,0,0,11,551,151,0,345,26,29,1555,3595,0,0,0,0,0,0,0,1953516,0,0,0,0,0,0,0,0,0,934,1160,16,0,0,0,0,0,0,0,0,0,0,14268,0,18019,1153,0,26,0,0,0,0,0,0,0,0,0,0,69797,0,0,0,0,0,0,0,2070278 +"441",0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,230216,0,0,0,0,0,0,32,0,0,425,354,0,0,0,0,5018,0,0,0,0,0,944,0,6,25,0,0,0,53,0,0,0,0,0,242,0,0,85466,0,0,0,0,0,0,0,322788 +"445",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9580,0,0,0,0,0,0,0,0,0,215989,0,0,0,0,0,0,0,0,0,0,0,0,0,0,429,0,0,0,0,0,396,0,4,13,0,222,0,0,0,0,0,0,0,68,0,20725,25,0,0,0,0,0,0,0,247451 +"452",0,0,0,0,0,0,1980,0,0,0,0,0,0,0,0,0,0,0,2732,0,0,0,0,0,0,0,0,0,0,225093,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,281,0,5,530,0,204,0,0,1445,0,0,0,0,0,0,9249,4279,0,0,0,0,0,0,0,245797 +"4A0",192,0,0,0,0,0,6125,0,0,0,0,0,0,0,0,0,0,2250,54,0,286,0,30,0,0,0,0,0,0,0,987089,0,0,0,0,0,0,3605,50,0,995,62,0,259,0,0,0,0,0,4313,0,1568,7078,0,1953,0,203,522,0,0,0,0,294,0,19200,18729,0,0,0,0,0,0,0,1054856 +"481",0,1078,0,0,0,0,44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,0,0,0,0,235253,0,0,0,0,0,572,0,0,0,0,0,0,0,0,0,0,0,100,0,211,2731,0,0,0,0,65,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240076 +"482",0,0,0,0,0,0,183,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,84665,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,0,138,402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85636 +"483",0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55174,0,0,0,2431,0,0,0,0,0,0,0,0,0,0,0,0,0,11,66,0,0,0,0,0,0,0,0,0,241,0,0,0,0,0,0,0,0,0,0,57925 +"484",0,0,0,0,0,0,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,378856,0,0,4353,4903,0,0,0,0,0,0,0,0,0,0,406,0,99,406,0,0,2260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,391313 +"485",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,0,0,15,0,0,0,0,90113,0,89,0,0,0,0,0,0,0,0,0,0,9,0,0,0,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,90282 +"486",0,0,0,0,0,156,88,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,53635,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54131 +"487OS",0,0,0,0,0,0,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,84,0,9,0,0,236,0,1735,1816,444,0,240113,1524,0,0,0,0,0,0,97,0,0,0,86,0,343,1236,0,98,0,0,0,0,0,0,0,0,0,66,1219,0,0,0,0,0,0,0,249216 +"493",0,0,0,0,0,0,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1959,0,0,437,142205,0,0,0,0,0,0,0,0,0,0,9,0,183,638,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,145497 +"511",0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1453,0,0,0,13106,0,0,0,119,0,0,0,0,0,0,0,0,284692,0,0,12265,0,0,0,0,0,0,1,0,14755,54212,0,741,0,8479,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,389845 +"512",0,0,0,0,0,0,50,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,820,0,0,0,0,0,0,0,0,0,156899,0,0,0,0,0,0,0,126,170,0,268,3793,0,0,0,0,0,0,0,0,0,88,0,0,0,0,0,0,0,0,0,0,162238 +"513",0,0,0,0,0,0,1333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4765,0,0,0,968,0,0,0,0,0,0,0,0,0,912,739103,0,0,0,0,0,0,0,10578,0,1942,120317,0,0,0,0,0,0,0,0,0,0,0,0,2584,0,0,0,0,0,0,0,882502 +"514",0,0,0,0,0,0,803,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,575,0,0,0,849,0,0,0,0,0,0,0,0,14871,0,256,246547,0,0,0,0,0,0,328,0,22503,134468,0,664,0,1003,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,422867 +"521CI",0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,889339,35892,0,0,0,0,79946,0,3446,1969,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1010594 +"523",0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27511,587729,7553,0,0,0,0,0,1260,922,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,624975 +"524",0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,908,1212143,0,0,0,0,426,2603,2786,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1218869 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,149960,0,0,0,0,0,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,150097 +"HS",0,0,0,0,0,0,18993,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2113241,0,0,0,84,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2132339 +"ORE",0,0,0,0,0,0,865,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,149,0,0,1298102,0,0,257,212,0,0,0,0,0,0,0,0,0,0,21,0,64,0,0,0,0,0,0,0,1299670 +"532RL",0,0,0,0,0,0,57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,405,75,287,0,1049,0,0,0,916,40,0,0,0,0,0,0,0,0,8,1013,0,0,2841,358725,0,178,77,0,0,0,3,0,0,0,0,0,0,0,0,3420,0,0,0,0,0,0,0,369095 +"5411",0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,362223,354,206,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,362785 +"5415",0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3886,0,0,0,446,0,0,0,0,0,0,0,0,3058,0,204,15145,0,0,0,0,0,0,400,0,435355,12355,0,5065,0,2066,0,0,0,0,0,0,0,0,2219,0,0,0,0,0,0,0,480207 +"5412OP",0,0,0,0,0,0,571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,573,0,0,0,0,0,0,548,5575,0,0,0,0,0,0,0,0,0,0,0,2975,0,665,0,0,0,0,14,0,11911,1472817,0,2822,0,0,0,0,0,0,0,0,0,0,2575,0,0,0,0,0,0,0,1501045 +"55",0,0,0,0,0,0,82,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13324,5202,617086,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,635694 +"561",0,0,0,0,0,0,1214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2846,0,0,0,0,0,0,0,840,0,0,0,0,0,0,0,0,0,0,0,0,0,0,70,0,0,315,54,0,9852,13847,0,984652,173,202,15,0,0,58,0,0,0,0,0,0,0,0,0,0,0,0,1014139 +"562",0,0,93,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,166,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,520,0,26,82,0,0,107199,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,700,0,108803 +"61",0,0,0,0,0,0,733,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,74,88,0,4718,31680,0,0,0,295220,0,0,0,0,1680,0,27717,10790,659,0,0,0,0,0,0,0,375035 +"621",0,0,0,0,0,0,433,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11014,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3514,0,1276,294,0,0,0,0,1093194,0,0,0,0,0,0,235,0,0,0,0,0,0,0,0,1109960 +"622",0,0,0,0,0,0,1258,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1463,0,2509,6912,0,0,0,0,7763,895444,0,0,0,0,0,2719,0,0,0,0,0,0,0,0,919235 +"623",0,0,0,0,0,0,39,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,115,0,0,23,26,0,0,0,0,1114,0,252111,133,0,0,0,373,0,0,0,0,0,0,0,0,253952 +"624",0,0,0,0,0,0,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,109,234,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,82,8,0,0,0,0,327,0,2589,218867,0,0,0,0,0,0,0,0,0,0,0,0,222334 +"711AS",0,0,0,0,0,0,625,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,956,1423,0,77,9350,0,0,0,20,0,0,0,0,179404,3086,9,4476,408,0,0,0,0,0,0,0,201450 +"713",0,0,0,0,0,0,555,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,464,0,0,2622,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,368,0,55,178,0,0,0,1306,0,0,0,851,237,135161,473,14827,2603,0,0,0,0,0,0,0,159869 +"721",0,0,0,0,0,0,1711,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,435,504,893,0,0,0,0,0,0,0,0,0,0,281,0,0,0,0,0,0,1258,1517,0,34,1,0,0,0,0,0,0,0,0,1706,35979,202569,49824,2018,0,0,0,0,0,0,0,298749 +"722",0,0,0,0,0,0,785,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,897,0,1943,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1187,192,858364,0,0,0,0,0,0,185,0,863554 +"81",0,0,0,0,0,0,496,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,613,2325,0,189,3980,0,0,0,0,0,0,0,0,0,0,0,381,0,0,0,0,0,1470,287,0,746,1422,0,0,0,31,0,0,0,353,0,0,0,3827,710759,0,0,0,0,0,0,0,726879 +"GFGD",0,0,0,0,0,0,4,0,0,0,0,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,0,14,0,0,0,0,0,0,0,0,2405,22319,0,0,0,233,0,1482,0,0,21,0,0,0,0,637125,0,0,0,0,0,0,663650 +"GFGN",0,99,0,0,0,50,284,0,0,1,0,0,0,0,0,0,0,59,0,0,0,0,8,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,0,0,0,77,0,0,0,0,2601,18362,0,0,0,0,0,1287,0,0,0,0,0,0,0,0,400841,431,0,0,0,3904,428185 +"GFE",0,0,0,0,0,14286,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3040,36,0,0,0,0,0,0,0,0,0,13,0,0,0,0,1476,0,0,807,0,0,638,0,0,0,0,0,0,0,0,0,0,0,0,1446,0,0,0,70288,0,0,0,0,92031 +"GSLG",570,3328,0,655,0,1220,20998,215,0,0,0,0,0,0,0,0,0,1206,2207,0,1302,641,1707,0,107,0,0,0,0,0,0,0,0,0,0,0,0,0,0,548,1,0,2348,0,0,0,29671,0,0,0,0,5771,56817,0,9273,14608,99277,36723,223229,0,3729,3309,2840,10596,19544,1203,0,0,0,1828966,0,4182,0,2386790 +"GSLE",0,0,0,0,0,146536,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5300,0,0,0,183,483,0,16930,0,14648,0,0,0,0,0,21,0,-82,0,7810,27773,0,0,0,0,0,0,0,0,0,0,0,0,168,34141,0,0,3396,0,0,0,0,107860,0,0,365167 +"Total Commodity Output",389171,65489,328549,91587,151333,711133,1741385,120234,130293,251307,361624,378877,312264,127589,692240,322989,75529,154402,965175,47764,18666,188651,71056,663388,792563,247840,2024693,233097,222917,229483,1023052,235489,84848,57392,383580,107526,57624,267848,149052,303342,158862,739907,279674,922577,625201,1222518,179708,2121051,1334017,480457,362649,566749,2184982,617086,1006009,124240,408097,1141169,1121443,254700,223992,186525,215326,241577,1015665,912030,637125,400841,70719,1828966,109951,10772,3904,36489532 diff --git a/flowsa/data/external_data/BEA_Summary_Make_2019_BeforeRedef.csv b/flowsa/data/external_data/BEA_Summary_Make_2019_BeforeRedef.csv new file mode 100644 index 000000000..4704a664c --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Make_2019_BeforeRedef.csv @@ -0,0 +1,73 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","Used","Other","Total Industry Output" +"111CA",381058,4866,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1956,0,0,0,0,0,0,0,0,0,0,387890 +"113FF",17,50840,0,0,0,0,276,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51132 +"211",0,0,301566,79,50162,0,874,0,0,0,8,178,0,0,0,0,0,0,0,0,0,0,0,20328,239,0,702,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,156,882,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,375173 +"212",0,0,0,86283,9785,0,11960,0,431,0,0,0,0,0,0,0,0,0,0,0,0,0,0,114,2611,0,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,111909 +"213",0,0,76,64,93718,0,8851,0,0,0,3520,0,0,0,0,0,0,0,0,0,0,0,0,151,0,0,714,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,580,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,107732 +"22",0,0,147,0,0,550422,2695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,0,0,3101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,444,126,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1871,0,0,558824 +"23",0,0,0,0,0,0,1722170,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,500,236,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1722906 +"321",0,0,0,0,0,0,361,109807,0,0,214,0,0,0,0,0,281,0,0,0,0,10,0,0,23,120,936,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,317,0,112196 +"327",0,0,5,670,1,0,491,9,133652,0,50,43,0,23,0,1,43,5,0,24,0,35,0,98,198,198,778,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43,898,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,137272 +"331",0,0,0,0,0,0,125,0,5,231229,1301,96,1,295,0,0,2,0,0,12,0,2,0,1237,245,0,788,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,111,448,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,520,0,236418 +"332",0,0,0,0,0,0,1877,341,227,3373,362751,2908,342,188,746,347,37,75,0,11,0,0,83,2,176,763,2886,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,323,2718,0,0,0,0,0,0,0,0,0,0,0,0,427,0,0,0,0,0,3107,0,383709 +"333",0,0,0,0,0,0,434,0,158,38,2069,374915,662,3808,1610,233,6,362,2,1,0,0,0,1,183,112,5308,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,942,9171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,302,0,400331 +"334",0,0,0,0,0,0,29,0,1,11,25,536,309865,782,6,2164,4,1158,0,0,0,1,1,0,314,26,2285,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1468,53951,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,372625 +"335",0,0,0,0,0,0,42,0,17,629,252,757,455,124657,291,10,11,21,0,0,0,46,0,1,55,108,1748,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,300,2980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,132381 +"3361MV",0,0,0,0,0,0,282,0,1,60,1473,1473,26,282,693689,1914,0,18,0,163,0,0,0,0,17,70,1901,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,324,14776,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,363,0,716830 +"3364OT",0,0,0,0,0,0,441,0,0,0,408,2118,3840,81,1876,314142,0,0,0,2,0,0,0,0,11,24,1099,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,833,14327,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,53,0,339256 +"337",0,0,0,0,0,0,209,231,21,0,48,3,0,1,0,0,72825,116,0,57,19,1,3,0,3,3,847,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,265,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,74713 +"339",0,0,0,0,0,0,993,24,0,9,237,38,794,142,13,4,213,142744,0,68,98,51,427,174,1232,801,4564,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,545,14264,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,167437 +"311FT",0,0,0,0,0,0,90,0,0,0,0,0,0,0,0,0,0,0,964356,1,474,61,0,0,2611,0,7119,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,151,2992,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,977857 +"313TT",0,0,0,0,0,0,22,0,0,0,0,0,0,0,1,0,66,34,0,44751,218,0,143,0,3652,42,568,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,299,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49805 +"315AL",0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,179,17056,0,0,0,0,0,378,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17880 +"322",0,0,0,0,0,0,49,297,22,0,7,0,141,0,0,0,0,8,0,222,0,186744,152,0,167,282,968,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,664,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,504,0,190284 +"323",0,0,0,0,0,0,9,0,0,0,103,0,32,0,0,0,0,484,0,639,26,482,63090,0,0,149,331,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,189,17285,0,278,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,165,0,83262 +"324",0,0,0,171,0,0,142,0,124,0,0,0,0,38,0,0,0,0,0,0,0,1,0,562669,28284,1,4038,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,733,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,596252 +"325",0,0,0,4,0,0,81,0,4,5,14,26,675,2,0,0,0,1404,8089,20,0,139,0,8448,726887,1759,7248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,488,60279,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815574 +"326",0,0,0,0,0,0,66,62,180,7,331,225,52,279,931,13,169,1201,0,958,0,941,115,0,1644,240132,1887,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,190,1775,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,195,0,251350 +"42",0,767,0,0,0,0,3038,0,0,0,11,557,158,0,349,13,30,1527,3557,0,0,0,0,0,0,0,2005910,0,0,0,0,0,0,0,0,0,885,1211,17,0,0,0,0,0,0,0,0,0,0,14829,0,19994,1317,0,33,0,0,0,0,0,0,0,0,0,0,72456,0,0,0,0,0,0,0,2126659 +"441",0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,226983,0,0,0,0,0,0,34,0,0,462,366,0,0,0,0,5142,0,0,0,0,0,1042,0,15,36,0,0,0,55,0,0,0,0,0,253,0,0,89093,0,0,0,0,0,0,0,323484 +"445",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9914,0,0,0,0,0,0,0,0,0,224811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,445,0,0,0,0,0,327,0,3,19,0,230,0,0,0,0,0,0,0,70,0,22028,26,0,0,0,0,0,0,0,257873 +"452",0,0,0,0,0,0,444,0,0,0,0,0,0,0,0,0,0,0,2819,0,0,0,0,0,0,0,0,0,0,226038,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,303,0,0,555,0,210,0,0,1370,0,0,0,0,0,0,9847,4299,0,0,0,0,0,0,0,245884 +"4A0",188,0,0,0,0,0,5497,0,0,0,0,0,0,0,0,0,0,2283,60,0,285,0,28,0,0,0,0,0,0,0,1026321,0,0,0,0,0,0,3948,51,0,1112,59,0,264,0,0,0,0,0,4372,0,2090,8504,0,1951,0,210,488,0,0,0,0,317,0,20422,19665,0,0,0,0,0,0,0,1098115 +"481",0,977,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,0,253843,0,0,0,0,0,473,0,0,0,0,0,0,0,0,0,0,0,82,0,289,2836,0,0,0,0,54,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258574 +"482",0,0,0,0,0,0,1722,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,82759,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,277,0,120,535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85413 +"483",0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56131,0,0,0,2598,0,0,0,0,0,0,0,0,0,0,0,0,0,17,88,0,0,0,0,0,0,0,0,0,99,0,0,0,0,0,0,0,0,0,0,58944 +"484",0,0,0,0,0,0,346,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,385753,0,0,4772,5012,0,0,0,0,0,0,0,0,0,0,443,0,114,520,0,0,2270,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,399230 +"485",0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0,16,0,0,0,0,91381,0,102,0,0,0,0,0,0,0,0,0,0,11,0,0,0,46,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,91579 +"486",0,0,0,0,0,173,131,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,289,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,59631 +"487OS",0,0,0,0,0,0,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,90,0,9,0,0,253,0,1746,1842,456,0,247197,1614,0,0,0,0,0,0,99,0,0,0,94,0,474,1577,0,107,0,0,0,0,0,0,0,0,0,55,1323,0,0,0,0,0,0,0,257141 +"493",0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2028,0,0,465,147306,0,0,0,0,0,0,0,0,0,0,10,0,164,843,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,150837 +"511",0,0,0,0,0,0,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1383,0,0,0,14291,0,0,0,122,0,0,0,0,0,0,0,0,302202,0,0,12196,0,0,0,0,0,0,1,0,16130,52299,0,758,0,9250,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,408651 +"512",0,0,0,0,0,0,68,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,823,0,0,0,0,0,0,0,0,0,160656,0,0,0,0,0,0,0,129,174,0,316,4480,0,0,0,0,0,0,0,0,0,79,0,0,0,0,0,0,0,0,0,0,166748 +"513",0,0,0,0,0,0,1153,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4851,0,0,0,970,0,0,0,0,0,0,0,0,0,863,745586,0,0,0,0,0,0,0,10686,0,1964,119650,0,0,0,0,0,0,0,0,0,0,0,0,2636,0,0,0,0,0,0,0,888359 +"514",0,0,0,0,0,0,787,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,636,0,0,0,960,0,0,0,0,0,0,0,0,16464,0,283,273683,0,0,0,0,0,0,363,0,24884,155091,0,736,0,1108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,474995 +"521CI",0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,908706,34530,0,0,0,0,78750,0,3300,2411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1027700 +"523",0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29081,621022,7989,0,0,0,0,0,1263,1129,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,660485 +"524",0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,961,1256959,0,0,0,0,449,2714,3412,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1264499 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133884,0,0,0,0,6,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134057 +"HS",0,0,0,0,0,0,16893,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2212202,0,0,0,84,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2229205 +"ORE",0,0,0,0,0,0,903,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,153,0,0,1449503,0,0,266,241,0,0,0,0,0,0,0,0,0,0,22,0,67,0,0,0,0,0,0,0,1451153 +"532RL",0,0,0,0,0,0,68,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,77,282,0,1061,0,0,0,968,38,0,0,0,0,0,0,0,0,9,1069,0,0,3099,379598,0,213,94,0,0,0,3,0,0,0,0,0,0,0,0,4446,0,0,0,0,0,0,0,391434 +"5411",0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,375561,417,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,376221 +"5415",0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4000,0,0,0,478,0,0,0,0,0,0,0,0,3178,0,209,15447,0,0,0,0,0,0,406,0,446061,15165,0,5293,0,2102,0,0,0,0,0,0,0,0,2239,0,0,0,0,0,0,0,494585 +"5412OP",0,0,0,0,0,0,553,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,622,0,0,0,0,0,0,584,6183,0,0,0,0,0,0,0,0,0,0,0,3165,0,703,0,0,0,0,14,0,12591,1590926,0,3002,0,0,0,0,0,0,0,0,0,0,2807,0,0,0,0,0,0,0,1621151 +"55",0,0,0,0,0,0,73,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14179,5756,651288,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,671296 +"561",0,0,0,0,0,0,1208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3064,0,0,0,0,0,0,0,798,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73,0,0,327,60,0,10891,14768,0,1051303,189,224,18,0,0,61,0,0,0,0,0,0,0,0,0,0,0,0,1082982 +"562",0,0,103,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,0,0,0,0,0,0,17,0,0,0,0,0,0,0,0,0,0,0,551,0,40,88,0,0,112464,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,734,0,114172 +"61",0,0,0,0,0,0,303,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1616,0,0,0,0,0,0,0,0,0,0,0,0,0,0,101,0,0,75,89,0,4647,32934,0,0,0,303834,0,0,0,0,1683,0,28752,9300,1643,0,0,0,0,0,0,0,384977 +"621",0,0,0,0,0,0,500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11482,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3670,0,1376,394,0,0,0,0,1149796,0,0,0,0,0,0,243,0,0,0,0,0,0,0,0,1167461 +"622",0,0,0,0,0,0,551,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1250,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1573,0,2695,7352,0,0,0,0,8161,937423,0,0,0,0,0,2910,0,0,0,0,0,0,0,0,961915 +"623",0,0,0,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,119,0,0,35,35,0,0,0,0,1172,0,262470,137,0,0,0,386,0,0,0,0,0,0,0,0,264390 +"624",0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,114,244,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,101,12,0,0,0,0,353,0,2658,230915,0,0,0,0,0,0,0,0,0,0,0,0,234461 +"711AS",0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1733,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1058,1511,0,89,9985,0,0,0,22,0,0,0,0,187201,2294,10,4733,435,0,0,0,0,0,0,0,209260 +"713",0,0,0,0,0,0,178,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,513,0,0,2746,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,179,384,0,86,189,0,0,0,1363,0,0,0,888,246,143223,497,15655,2614,0,0,0,0,0,0,0,168761 +"721",0,0,0,0,0,0,1411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,448,513,851,0,0,0,0,0,0,0,0,0,0,291,0,0,0,0,0,0,1305,1567,0,43,2,0,0,0,0,0,0,0,0,1748,37010,208608,51339,2084,0,0,0,0,0,0,0,307238 +"722",0,0,0,0,0,0,523,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,935,0,2024,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,491,201,903382,0,0,0,0,0,0,193,0,907750 +"81",0,0,0,0,0,0,373,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,593,2501,0,203,4145,0,0,0,0,0,0,0,0,0,0,0,397,0,0,0,0,0,1535,302,0,934,1478,0,0,0,33,0,0,0,371,0,0,0,4006,738929,0,0,0,0,0,0,0,755798 +"GFGD",0,0,0,0,0,0,4,0,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44,0,15,0,0,0,0,0,0,0,0,2606,23352,0,0,0,245,0,1556,0,0,22,0,0,0,0,679644,0,0,0,0,0,0,707491 +"GFGN",0,79,0,0,0,40,365,0,0,0,0,0,0,0,0,0,0,47,0,0,0,0,6,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,0,0,0,0,0,62,0,0,0,0,2799,20503,0,0,0,0,0,1028,0,0,0,0,0,0,0,0,415141,344,0,0,0,4309,444868 +"GFE",0,0,0,0,0,14091,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2972,37,0,0,0,0,0,0,0,0,0,16,0,0,0,0,1515,0,0,823,0,0,632,0,0,0,0,0,0,0,0,0,0,0,0,1433,0,0,0,69162,0,0,0,0,90680 +"GSLG",586,3419,0,673,0,1254,22309,221,0,0,0,0,0,0,0,0,0,1237,2267,0,1336,656,1751,0,109,0,0,0,0,0,0,0,0,0,0,0,0,0,0,562,1,0,2412,0,0,0,30480,0,0,0,0,5357,58938,0,9525,15006,101652,37721,229296,0,3831,3398,2917,10849,20040,1236,0,0,0,1913994,0,4296,0,2487327 +"GSLE",0,0,0,0,0,148022,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5507,0,0,0,180,524,0,17210,0,15842,0,0,0,0,0,22,0,-87,0,8255,31561,0,0,0,0,0,0,0,0,0,0,0,0,106,34237,0,0,3413,0,0,0,0,110475,0,0,375268 +"Total Commodity Output",381849,60947,301897,87945,153665,714001,1812530,111002,134843,235361,372823,383878,317051,130579,699513,318840,73686,152726,991063,47111,19512,189170,70868,593223,768666,244591,2078551,230090,231992,230424,1064066,254096,82939,58401,390625,109085,62983,277088,154365,322545,162691,746428,307316,943659,657225,1267870,164425,2220457,1489723,501489,376010,587332,2338379,651288,1073425,129928,420100,1199133,1169303,265128,236202,194403,222945,248939,1065778,949836,679644,415141,69506,1913994,112346,10758,4309,37709701 diff --git a/flowsa/data/external_data/BEA_Summary_Make_2020_BeforeRedef.csv b/flowsa/data/external_data/BEA_Summary_Make_2020_BeforeRedef.csv new file mode 100644 index 000000000..1270d0fa8 --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Make_2020_BeforeRedef.csv @@ -0,0 +1,73 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","Used","Other","Total Industry Output" +"111CA",387897,4595,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1893,0,0,0,0,0,0,0,0,0,0,394395 +"113FF",18,53123,0,0,0,0,244,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,53384 +"211",0,0,205852,79,31437,0,498,0,0,0,5,119,0,0,0,0,0,0,0,0,0,0,0,16035,159,0,516,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,136,436,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255273 +"212",0,0,0,74760,7337,0,12561,0,430,0,0,0,0,0,0,0,0,0,0,0,0,0,0,114,2166,0,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,98029 +"213",0,0,40,66,50883,0,7036,0,0,0,3905,0,0,0,0,0,0,0,0,0,0,0,0,165,0,0,532,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,342,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63020 +"22",0,0,104,0,0,522174,2773,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,0,0,0,3028,0,0,0,0,0,0,0,0,0,0,0,0,0,0,417,120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1999,0,0,530634 +"23",0,0,0,0,0,0,1795211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,482,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1795933 +"321",0,0,0,0,0,0,164,118803,0,0,521,0,0,0,0,0,1350,0,0,0,0,8,0,0,15,128,1001,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,109,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,338,0,122455 +"327",0,0,5,691,1,0,223,8,131478,0,51,53,0,44,0,0,440,1,0,22,0,65,0,80,225,18,825,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,963,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,135237 +"331",0,0,0,0,0,0,57,0,22,193976,958,42,1,471,0,0,1,0,0,6,0,1,0,962,225,0,744,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88,530,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,445,0,198528 +"332",0,0,0,0,0,0,1439,1062,199,3223,330415,2585,302,138,872,1202,140,69,0,3,0,0,69,4,198,803,2543,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,327,3171,0,0,0,0,0,0,0,0,0,0,0,0,392,0,0,0,0,0,2885,0,352040 +"333",0,0,0,0,0,0,387,0,266,66,2395,335516,357,2613,1279,505,7,482,0,0,0,0,0,2,496,62,4596,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,922,9687,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,259,0,359909 +"334",0,0,0,0,0,0,13,733,3,18,33,672,302757,737,9,2246,86,1874,0,0,0,1,0,0,544,40,2460,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1546,60638,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,374411 +"335",0,0,0,0,0,0,19,0,9,467,86,965,272,119420,341,11,731,42,0,0,0,40,0,2,49,88,1743,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,301,2674,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127261 +"3361MV",0,0,0,0,0,0,128,0,1,64,1355,1387,17,308,622061,1911,1,859,0,36,0,0,0,0,6,118,1358,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,329,13940,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,359,0,644235 +"3364OT",0,0,0,0,0,0,200,0,0,1,295,1032,3621,106,1448,242820,0,0,0,3,0,0,0,0,9,46,842,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,824,16867,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,268143 +"337",0,0,0,0,0,0,95,192,8,1,42,2,0,0,0,0,71885,32,0,53,1,0,1,0,3,2,775,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,238,299,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73628 +"339",0,0,0,0,0,0,935,22,0,38,197,24,567,30,9,7,509,137743,0,64,399,26,386,178,906,714,4457,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,532,13862,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,161607 +"311FT",0,0,0,0,0,0,41,0,0,0,0,0,0,0,0,0,0,0,985925,0,545,48,0,0,6994,0,6487,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,164,3595,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1003800 +"313TT",0,0,0,0,0,0,10,0,0,0,0,0,0,0,7,0,245,83,0,41176,1333,0,131,0,3162,43,507,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,272,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46977 +"315AL",0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,162,16201,0,0,0,0,0,360,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,213,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16952 +"322",0,0,0,0,0,0,22,138,16,0,8,0,93,0,0,0,0,13,0,250,0,174856,145,0,644,281,739,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,555,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,384,0,178193 +"323",0,0,0,0,0,0,4,0,0,0,97,0,32,0,0,0,0,427,0,669,42,484,59290,0,0,200,290,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,220,14304,0,237,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,140,0,76436 +"324",0,0,0,172,0,0,65,0,51,0,0,0,0,49,0,0,0,0,0,0,0,0,0,334265,17191,1,2683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,727,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,355259 +"325",0,0,0,4,0,0,37,0,1,23,15,29,771,79,1,0,0,1109,7921,18,0,24,0,6494,679664,2787,7849,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,507,61337,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,768669 +"326",0,0,0,0,0,0,30,103,182,25,256,210,40,319,987,11,2122,1744,0,1079,0,867,47,0,676,225054,1748,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,193,1612,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,190,0,237497 +"42",0,756,0,0,0,0,2943,0,0,0,11,552,157,0,297,17,34,1326,3708,0,0,0,0,0,0,0,1921823,0,0,0,0,0,0,0,0,0,623,1186,16,0,0,0,0,0,0,0,0,0,0,13218,0,19328,1220,0,35,0,0,0,0,0,0,0,0,0,0,67734,0,0,0,0,0,0,0,2034986 +"441",0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,216796,0,0,0,0,0,0,31,0,0,443,382,0,0,0,0,4985,0,0,0,0,0,848,0,21,37,0,0,0,51,0,0,0,0,0,249,0,0,84044,0,0,0,0,0,0,0,307889 +"445",0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,10867,0,0,0,0,0,0,0,0,0,250427,0,0,0,0,0,0,0,0,0,0,0,0,0,0,491,0,0,0,0,0,276,0,5,19,0,253,0,0,0,0,0,0,0,68,0,21680,28,0,0,0,0,0,0,0,284117 +"452",0,0,0,0,0,0,354,0,0,0,0,0,0,0,0,0,0,0,2966,0,0,0,0,0,0,0,0,0,0,248733,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,284,0,0,499,0,220,0,0,1512,0,0,0,0,0,0,9571,5195,0,0,0,0,0,0,0,269334 +"4A0",171,0,0,0,0,0,5572,0,0,0,0,0,0,0,0,0,0,2207,82,0,279,0,27,0,0,0,0,0,0,0,1090740,0,0,0,0,0,0,4246,54,0,1484,57,0,276,0,0,0,0,0,4026,0,4214,10495,0,2104,0,187,495,0,0,0,0,244,0,20004,20664,0,0,0,0,0,0,0,1167628 +"481",0,968,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,0,111502,0,0,0,0,0,353,0,0,0,0,0,0,0,0,0,0,0,61,0,254,1795,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,114987 +"482",0,0,0,0,0,0,1604,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72030,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,342,0,272,281,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,74529 +"483",0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36792,0,0,0,1631,0,0,0,0,0,0,0,0,0,0,0,0,0,23,46,0,0,0,0,0,0,0,0,0,108,0,0,0,0,0,0,0,0,0,0,38611 +"484",0,0,0,0,0,0,323,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,379582,0,0,4459,4951,0,0,0,0,0,0,0,0,0,0,402,0,129,304,0,0,2305,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,392456 +"485",0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,10,0,0,0,0,58342,0,55,0,0,0,0,0,0,0,0,0,0,8,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58462 +"486",0,0,0,0,0,166,111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55825,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,152,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56294 +"487OS",0,0,0,0,0,0,185,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88,0,4,0,0,245,0,1346,1947,273,0,261614,1713,0,0,0,0,0,0,103,0,0,0,89,0,605,941,0,116,0,0,0,0,0,0,0,0,0,29,1413,0,0,0,0,0,0,0,270711 +"493",0,0,0,0,0,0,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2075,0,0,469,150846,0,0,0,0,0,0,0,0,0,0,9,0,190,456,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,154062 +"511",0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1282,0,0,0,15558,0,0,0,121,0,0,0,0,0,0,0,0,322017,0,0,11713,0,0,0,0,0,0,1,0,17633,50884,0,689,0,9808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,429719 +"512",0,0,0,0,0,0,48,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,332,0,0,0,0,0,0,0,0,0,137465,0,0,0,0,0,0,0,55,163,0,238,5540,0,0,0,0,0,0,0,0,0,185,0,0,0,0,0,0,0,0,0,0,144046 +"513",0,0,0,0,0,0,1170,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4874,0,0,0,988,0,0,0,0,0,0,0,0,0,878,742045,0,0,0,0,0,0,0,10453,0,1922,121794,0,0,0,0,0,0,0,0,0,0,0,0,2618,0,0,0,0,0,0,0,886743 +"514",0,0,0,0,0,0,798,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,678,0,0,0,1056,0,0,0,0,0,0,0,0,17891,0,305,296651,0,0,0,0,0,0,399,0,23768,173348,0,791,0,1161,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,516848 +"521CI",0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,912967,36645,0,0,0,0,75795,0,3428,3049,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1031886 +"523",0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28013,650798,8399,0,0,0,0,0,1254,1427,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,689892 +"524",0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1007,1307054,0,0,0,0,478,2795,4314,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1315650 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,165108,0,0,0,0,442,212,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,165763 +"HS",0,0,0,0,0,0,17955,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2305205,0,0,0,73,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2323265 +"ORE",0,0,0,0,0,0,985,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,157,0,0,1384611,0,0,314,287,0,0,0,0,0,0,0,0,0,0,24,0,75,0,0,0,0,0,0,0,1386453 +"532RL",0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,407,78,220,0,1030,0,0,0,825,41,0,0,0,0,0,0,0,0,9,924,0,0,2589,358332,0,219,119,0,0,0,2,0,0,0,0,0,0,0,0,1998,0,0,0,0,0,0,0,366840 +"5411",0,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,381210,433,257,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,381925 +"5415",0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4006,0,0,0,551,0,0,0,0,0,0,0,0,3322,0,217,16118,0,0,0,0,0,0,426,0,466301,14318,0,5546,0,2143,0,0,0,0,0,0,0,0,2301,0,0,0,0,0,0,0,515252 +"5412OP",0,0,0,0,0,0,368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,633,0,0,0,0,0,0,601,6589,0,0,0,0,0,0,0,0,0,0,0,3260,0,723,0,0,0,0,14,0,13052,1630567,0,3039,0,0,0,0,0,0,0,0,0,0,2840,0,0,0,0,0,0,0,1661684 +"55",0,0,0,0,0,0,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15110,5569,657446,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,678177 +"561",0,0,0,0,0,0,877,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3146,0,0,0,0,0,0,0,778,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73,0,0,326,58,0,10958,12686,0,1004728,198,203,15,0,0,60,0,0,0,0,0,0,0,0,0,0,0,0,1034106 +"562",0,0,100,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,190,0,0,0,0,0,0,17,0,0,0,0,0,0,0,0,0,0,0,542,0,47,89,0,0,112535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,750,0,114280 +"61",0,0,0,0,0,0,283,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1548,0,0,0,0,0,0,0,0,0,0,0,0,0,0,211,0,0,342,345,0,4582,34840,0,0,0,303870,0,0,0,0,1755,0,10348,5421,23,0,0,0,0,0,0,0,363566 +"621",0,0,0,0,0,0,559,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11196,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3930,0,1411,283,0,0,0,0,1099147,0,0,0,0,0,0,249,0,0,0,0,0,0,0,0,1116775 +"622",0,0,0,0,0,0,460,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1262,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1675,0,2707,7432,0,0,0,0,8868,932358,0,0,0,0,0,2996,0,0,0,0,0,0,0,0,957759 +"623",0,0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,0,0,36,25,0,0,0,0,1514,0,259581,144,0,0,0,410,0,0,0,0,0,0,0,0,261882 +"624",0,0,0,0,0,0,102,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,273,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,135,12,0,0,0,0,376,0,3770,230061,0,0,0,0,0,0,0,0,0,0,0,0,234857 +"711AS",0,0,0,0,0,0,159,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1221,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,793,1106,0,88,6973,0,0,0,16,0,0,0,0,120169,2469,8,3075,313,0,0,0,0,0,0,0,136390 +"713",0,0,0,0,0,0,132,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,630,0,0,1859,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,62,0,89,5,0,0,0,1061,0,0,0,374,85,94128,49,8980,349,0,0,0,0,0,0,0,107812 +"721",0,0,0,0,0,0,973,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,487,584,653,0,0,0,0,0,0,0,0,0,0,153,0,0,0,0,0,0,657,962,0,32,2,0,0,0,0,0,0,0,0,925,20400,115770,27805,1115,0,0,0,0,0,0,0,170537 +"722",0,0,0,0,0,0,539,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,955,0,1646,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1138,155,769538,0,0,0,0,0,0,163,0,774133 +"81",0,0,0,0,0,0,350,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,647,2293,0,233,3559,0,0,0,0,0,0,0,0,0,0,0,362,0,0,0,0,0,1519,305,0,1012,1441,0,0,0,26,0,0,0,4173,0,0,0,3754,691219,0,0,0,0,0,0,0,710893 +"GFGD",0,0,0,0,0,0,4,0,0,0,0,3,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,0,15,0,0,0,0,0,0,0,0,2559,24917,0,0,0,249,0,1585,0,0,22,0,0,0,0,701608,0,0,0,0,0,0,731008 +"GFGN",0,42,0,0,0,22,426,0,0,0,0,0,0,0,0,0,0,25,0,0,0,0,3,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,74,0,0,0,0,0,0,33,0,0,0,0,2751,26720,0,0,0,0,0,551,0,0,0,0,0,0,0,0,467992,184,0,0,0,3260,502087 +"GFE",0,0,0,0,0,13699,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2735,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1623,0,0,668,0,0,577,0,0,0,0,0,0,0,0,0,0,0,0,1206,0,0,0,68227,0,0,0,0,88764 +"GSLG",551,3321,0,634,0,1180,23048,208,0,0,0,0,0,0,0,0,0,1154,2133,0,1252,605,1632,0,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,523,1,0,2271,0,0,0,28696,0,0,0,0,5544,59695,0,9084,14716,94192,36245,221436,0,3606,3188,2928,10001,10646,1163,0,0,0,1968775,0,4045,0,2512574 +"GSLE",0,0,0,0,0,148192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6326,0,0,0,140,339,0,8972,0,9820,0,0,0,0,0,22,0,-85,0,8552,18416,0,0,0,0,0,0,0,0,0,0,0,0,131,26067,0,0,2583,0,0,0,0,104959,0,0,334435 +"Total Commodity Output",388637,62805,206101,76406,89658,685433,1882738,121277,132665,197905,340646,343190,308995,124315,627312,248729,77550,149192,1013602,43543,20052,177025,66793,358302,713435,230385,1991792,219817,258418,253014,1125668,111747,72170,38478,384460,67629,59476,284294,157962,343827,139873,742776,330390,946753,689181,1318460,193837,2313756,1410117,474135,381688,612049,2409654,657446,1026842,129754,412968,1148214,1155929,263351,238419,126276,149877,136353,885364,886066,701608,467992,68412,1968775,106959,9996,3260,36561975 diff --git a/flowsa/data/external_data/BEA_Summary_Make_2021_BeforeRedef.csv b/flowsa/data/external_data/BEA_Summary_Make_2021_BeforeRedef.csv new file mode 100644 index 000000000..a93408ff2 --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Make_2021_BeforeRedef.csv @@ -0,0 +1,73 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","Used","Other","Total Industry Output" +"111CA",459857,4698,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2071,0,0,0,0,0,0,0,0,0,0,466636 +"113FF",35,59129,0,0,0,0,244,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,59408 +"211",0,0,385961,75,28979,0,498,0,0,0,12,230,0,0,0,0,0,0,0,0,0,0,0,37574,300,0,808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,114,1178,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,455730 +"212",0,0,0,83716,8573,0,12561,0,468,0,0,0,0,0,0,0,0,0,0,0,0,0,0,125,2717,0,674,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,131,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,108964 +"213",0,0,41,73,54066,0,7036,0,0,0,1022,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,749,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,754,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63819 +"22",0,0,127,0,0,634563,2773,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,0,0,0,0,0,3714,0,0,0,0,0,0,0,0,0,0,0,0,0,0,459,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2137,0,0,643958 +"23",0,0,0,0,0,0,1963725,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,423,303,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1964451 +"321",0,0,0,0,0,0,164,146406,0,0,643,0,0,0,0,0,897,0,0,0,0,10,0,0,18,160,1565,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57,0,150057 +"327",0,0,5,729,1,0,223,9,141811,0,55,57,0,47,0,0,235,1,0,23,0,69,0,85,238,19,1687,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,146318 +"331",0,0,0,0,0,0,57,0,27,256535,1181,48,1,585,0,0,2,0,0,8,0,1,0,1232,281,0,1209,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,491,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,795,0,262538 +"332",0,0,0,0,0,0,727,1158,233,3784,371876,2907,344,155,1028,637,148,94,0,3,0,0,78,4,216,920,5027,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,302,2900,0,0,0,0,0,0,0,0,0,0,0,0,125,0,0,0,0,0,1209,0,393877 +"333",0,0,0,0,0,0,368,0,297,74,2895,383877,339,2801,1462,254,9,571,0,0,0,0,0,2,709,72,10043,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,783,9998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,0,414743 +"334",0,0,0,0,0,0,13,1106,3,19,35,700,322113,790,9,2303,50,2019,0,1,0,1,0,0,560,42,4132,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1605,66920,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,402420 +"335",0,0,0,0,0,0,19,0,11,579,102,1061,299,134813,426,12,353,53,0,0,0,50,0,2,61,92,2662,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,311,3253,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,144161 +"3361MV",0,0,0,0,0,0,131,0,1,35,1441,1473,15,329,709993,1323,1,14,0,27,0,0,0,0,5,127,2829,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,277,14391,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,772,0,733182 +"3364OT",0,0,0,0,0,0,200,0,0,2,366,1573,4472,120,2329,261213,0,0,0,5,0,0,0,0,12,52,1494,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,699,35407,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,0,308008 +"337",0,0,0,0,0,0,95,189,7,1,41,2,0,0,0,0,77447,33,0,49,3,0,1,0,3,2,1425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,276,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,79642 +"339",0,0,0,0,0,0,1117,26,0,44,195,26,602,30,10,3,412,156512,0,65,254,25,401,182,662,773,5905,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,471,15136,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,182850 +"311FT",0,0,0,0,0,0,41,0,0,0,0,0,0,0,0,0,0,0,1033711,1,753,50,0,0,5108,0,10424,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,118,3266,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,1053476 +"313TT",0,0,0,0,0,0,10,0,0,0,0,0,0,0,6,0,215,92,0,45089,2196,0,122,0,3401,41,724,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,326,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52235 +"315AL",0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,160,21615,0,0,0,0,0,504,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,256,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22544 +"322",0,0,0,0,0,0,22,122,18,0,10,0,107,0,0,0,0,15,0,294,0,187202,167,0,709,322,1653,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,82,696,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,384,0,191803 +"323",0,0,0,0,0,0,4,0,0,0,101,0,33,0,0,0,0,446,0,781,101,502,60355,0,0,208,834,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,237,14965,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,61,0,78734 +"324",0,0,0,167,0,0,65,0,50,0,0,0,0,49,0,0,0,0,0,0,0,0,0,571220,31672,1,3834,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47,801,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,607906 +"325",0,0,0,4,0,0,37,0,1,26,17,32,863,90,1,0,0,1300,8796,22,0,26,0,12710,735588,3131,12891,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,541,71208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,847284 +"326",0,0,0,0,0,0,30,109,192,28,276,225,42,343,1074,12,1883,1961,0,1217,0,929,50,0,692,232471,3256,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,179,1909,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,69,0,246945 +"42",0,788,0,0,0,0,3392,0,0,0,13,661,180,0,325,15,42,1366,3859,0,0,0,0,0,0,0,2297947,0,0,0,0,0,0,0,0,0,1068,1572,19,0,0,0,0,0,0,0,0,0,0,16062,0,20031,1657,0,38,0,0,0,0,0,0,0,0,0,0,76856,0,0,0,0,0,0,0,2425889 +"441",0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,278623,0,0,0,0,0,0,33,0,0,588,457,0,0,0,0,6090,0,0,0,0,0,1241,0,6,47,0,0,0,55,0,0,0,0,0,328,0,0,93086,0,0,0,0,0,0,0,380557 +"445",0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,11217,0,0,0,0,0,0,0,0,0,259189,0,0,0,0,0,0,0,0,0,0,0,0,0,0,508,0,0,0,0,0,364,0,10,24,0,261,0,0,0,0,0,0,0,286,0,25496,29,0,0,0,0,0,0,0,297386 +"452",0,0,0,0,0,0,354,0,0,0,0,0,0,0,0,0,0,0,3243,0,0,0,0,0,0,0,0,0,0,267782,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,317,0,0,576,0,240,0,0,1710,0,0,0,0,0,0,11344,4844,0,0,0,0,0,0,0,290410 +"4A0",265,0,0,0,0,0,6208,0,0,0,0,0,0,0,0,0,0,3562,97,0,992,0,27,0,0,0,0,0,0,0,1308938,0,0,0,0,0,0,5631,64,0,1744,56,0,296,0,0,0,0,0,5367,0,1802,10938,0,2396,0,510,601,0,0,0,0,341,0,23642,24532,0,0,0,0,0,0,0,1398006 +"481",0,1662,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0,0,181755,0,0,0,0,0,588,0,0,0,0,0,0,0,0,0,0,0,101,0,138,3654,0,0,0,0,71,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,187990 +"482",0,0,0,0,0,0,1604,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,81513,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,339,0,217,688,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,84361 +"483",0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42531,0,0,0,1834,0,0,0,0,0,0,0,0,0,0,0,0,0,16,114,0,0,0,0,0,0,0,0,0,105,0,0,0,0,0,0,0,0,0,0,44609 +"484",0,0,0,0,0,0,323,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,460087,0,0,5597,6000,0,0,0,0,0,0,0,0,0,0,482,0,136,663,0,0,2742,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,476030 +"485",0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,0,0,11,0,0,0,0,69779,0,78,0,0,0,0,0,0,0,0,0,0,9,0,0,0,52,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,69949 +"486",0,0,0,0,0,187,111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62487,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,371,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63182 +"487OS",0,0,0,0,0,0,185,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,117,0,8,0,0,317,0,2027,2537,455,0,331777,2257,0,0,0,0,0,0,133,0,0,0,117,0,300,2047,0,154,0,0,0,0,0,0,0,0,0,89,1868,0,0,0,0,0,0,0,344389 +"493",0,0,0,0,0,0,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2482,0,0,568,180728,0,0,0,0,0,0,0,0,0,0,11,0,170,1082,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,185058 +"511",0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1346,0,0,0,18227,0,0,0,133,0,0,0,0,0,0,0,0,375054,0,0,12998,0,0,0,0,0,0,1,0,20515,57362,0,713,0,11799,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,498160 +"512",0,0,0,0,0,0,48,0,0,0,0,0,43,0,0,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,554,0,0,0,0,0,0,0,0,0,160127,0,0,0,0,0,0,0,67,197,0,254,5758,0,0,0,0,0,0,0,0,0,1160,0,0,0,0,0,0,0,0,0,0,168221 +"513",0,0,0,0,0,0,1170,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5176,0,0,0,1041,0,0,0,0,0,0,0,0,0,973,774370,0,0,0,0,0,0,0,10551,0,2012,134553,0,0,0,0,0,0,0,0,0,0,0,0,2787,0,0,0,0,0,0,0,932633 +"514",0,0,0,0,0,0,798,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,810,0,0,0,1370,0,0,0,0,0,0,0,0,21773,0,361,370811,0,0,0,0,0,0,475,0,32056,223606,0,940,0,1408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,654408 +"521CI",0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,952072,39681,0,0,0,0,73409,0,5279,2685,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1073129 +"523",0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30819,745649,9111,0,0,0,0,0,1762,1257,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,788599 +"524",0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1112,1390180,0,0,0,0,528,5891,3800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1401514 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192325,0,0,0,0,11,187,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192523 +"HS",0,0,0,0,0,0,17955,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2390041,0,0,0,76,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2408100 +"ORE",0,0,0,0,0,0,1131,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,162,0,0,1558962,0,0,344,286,0,0,0,0,0,0,0,0,0,0,27,0,86,0,0,0,0,0,0,0,1560998 +"532RL",0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,442,86,316,0,1256,0,0,0,934,50,0,0,0,0,0,0,0,0,10,1179,0,0,2904,389370,0,129,105,0,0,0,3,0,0,0,0,0,0,0,0,2433,0,0,0,0,0,0,0,399262 +"5411",0,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,422072,407,298,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,422801 +"5415",0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4272,0,0,0,591,0,0,0,0,0,0,0,0,3545,0,232,17278,0,0,0,0,0,0,457,0,496918,19237,0,5958,0,2326,0,0,0,0,0,0,0,0,2478,0,0,0,0,0,0,0,553296 +"5412OP",0,0,0,0,0,0,368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,752,0,0,0,0,0,0,677,6505,0,0,0,0,0,0,0,0,0,0,0,3862,0,814,0,0,0,0,19,0,14213,1847288,0,3688,0,0,0,0,0,0,0,0,0,0,2985,0,0,0,0,0,0,0,1881171 +"55",0,0,0,0,0,0,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15299,7475,710307,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,733132 +"561",0,0,0,0,0,0,877,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3438,0,0,0,0,0,0,0,718,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77,0,0,368,58,0,10949,14637,0,1215087,229,213,24,0,0,77,0,0,0,0,0,0,0,0,0,0,0,0,1246752 +"562",0,0,112,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,190,0,0,0,0,0,0,19,0,0,0,0,0,0,0,0,0,0,0,603,0,27,100,0,0,125440,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,847,0,127349 +"61",0,0,0,0,0,0,283,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,0,0,83,101,0,4222,37447,0,0,0,318586,0,0,0,0,1664,0,18936,8525,17,0,0,0,0,0,0,0,391655 +"621",0,0,0,0,0,0,559,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12786,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4555,0,1182,507,0,0,0,0,1205061,0,0,0,0,0,0,269,0,0,0,0,0,0,0,0,1224919 +"622",0,0,0,0,0,0,460,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1937,0,2768,8171,0,0,0,0,9605,1009640,0,0,0,0,0,3261,0,0,0,0,0,0,0,0,1037226 +"623",0,0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,126,0,0,22,46,0,0,0,0,1539,0,261976,152,0,0,0,417,0,0,0,0,0,0,0,0,264325 +"624",0,0,0,0,0,0,102,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,279,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,145,16,0,0,0,0,449,0,2537,256602,0,0,0,0,0,0,0,0,0,0,0,0,260255 +"711AS",0,0,0,0,0,0,159,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1737,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1272,1793,0,73,11930,0,0,0,75,0,0,0,0,164966,3615,119,5016,491,0,0,0,0,0,0,0,191247 +"713",0,0,0,0,0,0,132,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,874,0,0,2962,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,324,0,41,17,0,0,0,1559,0,0,0,628,128,121695,114,14326,894,0,0,0,0,0,0,0,143756 +"721",0,0,0,0,0,0,973,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,506,597,904,0,0,0,0,0,0,0,0,0,0,245,0,0,0,0,0,0,1081,1658,0,95,2,0,0,0,0,0,0,0,0,1490,32296,175518,43558,1757,0,0,0,0,0,0,0,260709 +"722",0,0,0,0,0,0,539,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1065,0,2287,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1393,230,1029751,0,0,0,0,0,0,224,0,1035490 +"81",0,0,0,0,0,0,350,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,818,2668,0,282,4548,0,0,0,0,0,0,0,0,0,0,0,398,0,0,0,0,0,1751,354,0,857,1639,0,0,0,34,0,0,0,404,0,0,0,4259,737683,0,0,0,0,0,0,0,756045 +"GFGD",0,0,0,0,0,0,4,0,0,0,0,3,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47,0,16,0,0,0,0,0,0,0,0,2417,26697,0,0,0,262,0,1665,0,0,23,0,0,0,0,713008,0,0,0,0,0,0,744145 +"GFGN",0,155,0,0,0,79,391,0,0,1,0,0,0,0,0,0,0,93,0,0,0,0,12,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,272,0,0,0,0,0,0,121,0,0,0,0,2534,28079,0,0,0,0,0,2018,0,0,0,0,0,0,0,0,533783,675,0,0,0,4226,572449 +"GFE",0,0,0,0,0,14791,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3122,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2046,0,0,820,0,0,641,0,0,0,0,0,0,0,0,0,0,0,0,1415,0,0,0,69491,0,0,0,0,92356 +"GSLG",584,3406,0,671,0,1249,22799,220,0,0,0,0,0,0,0,0,0,1224,2258,0,1326,644,1732,0,107,0,0,0,0,0,0,0,0,0,0,0,0,0,0,556,1,0,2403,0,0,0,30367,0,0,0,0,5444,61736,0,9490,14951,99781,37578,237427,0,3816,3377,2906,10648,10799,1231,0,0,0,2106940,0,4280,0,2679952 +"GSLE",0,0,0,0,0,155650,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6794,0,0,0,161,344,0,9475,0,15547,0,0,0,0,0,24,0,-87,0,8779,27651,0,0,0,0,0,0,0,0,0,0,0,0,174,38001,0,0,3138,0,0,0,0,113029,0,0,378680 +"Total Commodity Output",460740,69838,386246,85436,91619,806518,2051653,149353,143121,261129,380281,392875,329452,140153,716664,265772,81693,169357,1063181,47743,27241,189510,68482,623168,783070,238432,2402189,282280,267877,272588,1349957,182071,81674,44902,466074,79759,67269,363801,189525,401198,162891,775264,407766,989808,787265,1402903,222813,2398820,1595157,510278,422600,656354,2762691,710307,1239071,143362,436610,1256637,1250751,264513,261680,171824,204197,205592,1182166,957317,713008,533783,70166,2106940,115166,8949,4226,41404764 diff --git a/flowsa/data/external_data/BEA_Summary_Use_2012_PRO_BeforeRedef.csv b/flowsa/data/external_data/BEA_Summary_Use_2012_PRO_BeforeRedef.csv new file mode 100644 index 000000000..cdcb27f00 --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Use_2012_PRO_BeforeRedef.csv @@ -0,0 +1,80 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","Total Intermediate","F010","F02S","F02E","F02N","F02R","F030","F040","F050","F06C","F06S","F06E","F06N","F07C","F07S","F07E","F07N","F10C","F10S","F10E","F10N","Total Final Uses (GDP)","Total Commodity Output" +"111CA",55665,653,0,83,46,0,1913,0,0,0,0,0,0,0,0,0,0,297,234457,2004,0,0,0,0,16525,0,1693,338,1018,215,304,0,0,0,0,0,0,86,0,0,0,0,0,1,0,0,0,0,3,0,2,1,894,34,734,0,135,0,0,0,0,0,387,37,1534,44,7,-370,0,2641,0,321383,70171,0,0,0,0,-18067,56465,-32455,0,0,0,0,0,0,0,0,0,0,0,0,76114,397496 +"113FF",23105,4970,0,66,0,0,0,8544,3,0,0,0,0,0,0,0,46,232,6174,0,56,3419,41,23,787,2770,0,0,677,0,2,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,208,10,1,0,57,0,0,0,0,0,155,359,2992,145,0,84,8,3183,0,58118,5815,0,0,0,0,599,6249,-16204,0,0,0,0,0,0,0,0,0,0,0,0,-3540,54577 +"211",0,0,30457,15,2,24851,0,2,0,29,1,0,0,0,0,0,0,0,1,0,0,2,0,539764,5601,2,24,3,4,2,10,0,0,0,0,0,56,0,3,2,0,1,0,0,0,0,0,0,0,0,0,0,10,28,2,4,4,6,37,6,4,1,7,15,38,13,0,0,1187,0,16744,618940,0,0,0,0,0,-1570,9200,-336744,0,0,0,0,0,0,0,0,0,0,0,0,-329115,289825 +"212",2325,1,95,6226,59,10709,10726,8,6553,16312,429,158,7,98,52,92,22,157,1395,82,0,1606,0,2369,6284,107,20,0,0,0,2,0,106,0,4,0,0,2,3,27,12,152,250,0,0,0,0,8,0,0,0,0,795,47,350,55,233,0,62,26,17,180,510,57,387,688,0,1703,0,1362,6631,79561,135,0,264,0,0,2124,16795,4706,0,0,0,0,0,0,0,0,0,0,0,0,24024,103585 +"213",0,0,12433,2007,1368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15847,0,152911,3775,0,0,11,3416,-992,0,0,0,0,0,0,0,0,0,0,0,0,159122,174969 +"22",4764,148,5225,4332,203,26498,3795,1823,3640,8131,4376,2122,1304,968,2606,1357,611,990,9528,1313,69,6250,1418,8082,17322,4959,15748,2559,8369,4866,13390,101,98,100,1152,72,1180,813,12025,890,385,4019,1562,2429,1212,310,1847,2,56907,1614,589,292,4054,8023,2156,490,6963,3196,9047,2396,1256,661,2534,5691,18682,4406,2261,898,1557,17568,2367,348571,242392,0,0,0,0,0,3491,-2109,0,0,0,0,0,0,0,0,0,0,0,0,243774,592345 +"23",1673,38,941,2229,2184,7329,204,170,347,686,648,483,198,145,414,197,97,175,1137,77,11,624,249,8046,1783,497,2178,440,525,500,2031,325,2125,50,305,200,1037,1628,857,104,38,2293,151,3421,1316,317,388,64117,49373,300,123,31,716,501,359,37,666,384,803,265,261,167,409,763,1552,3922,7012,1468,1493,26487,42242,254260,0,312909,0,0,313747,0,99,0,0,8107,0,0,0,14843,0,0,0,261829,0,0,911534,1165794 +"321",245,60,0,88,125,0,25404,16331,329,316,191,903,350,165,2648,254,5564,799,364,40,1,4780,4,0,248,1065,2139,50,407,67,588,0,1249,0,59,0,11,79,163,107,75,668,1281,62,3,8,0,23,4096,424,12,15,526,2,413,14,25,205,202,4,930,4,120,350,718,383,15,23,2,3328,131,79256,3943,327,0,0,2974,1219,4933,-13687,0,0,0,0,0,0,79,0,0,0,0,0,-213,79043 +"327",8,63,734,453,651,53,40721,707,11625,2530,1063,2543,348,1812,5522,344,355,639,4907,145,0,458,2,1037,1746,1363,212,166,58,106,525,0,12,0,35,0,1,49,158,7,2,2222,770,44,27,4,0,25,65,428,6,87,2819,67,850,91,74,1752,1615,175,249,8,115,73,1520,904,31,330,0,2303,1462,99277,6293,0,0,0,0,2175,8418,-20484,0,0,0,0,0,0,0,0,0,0,0,0,-3598,95680 +"331",110,0,5220,808,600,3,3822,372,682,82553,73602,38771,4669,17600,41340,10514,3629,6383,5735,351,0,482,24,31,61,1661,1310,4,0,0,908,0,1037,0,0,0,0,379,0,25,10,245,312,0,0,1,0,1,1454,117,0,12,1340,33,405,460,154,162,48,18,297,17,272,19,76,539,91,250,0,236,295,309546,447,0,0,0,0,4177,36016,-84489,0,0,0,0,0,0,0,0,0,0,0,0,-43850,265696 +"332",1596,168,4930,1393,1565,354,57316,2296,2527,5798,38926,31362,6145,8626,36067,12663,3038,4761,15016,666,112,5885,1440,762,10810,6978,2322,307,152,112,1247,217,360,1517,868,94,881,906,556,1249,15,10229,1638,135,112,3,19,21,1078,1429,33,1398,4393,671,2053,2256,368,334,581,22,1601,35,667,660,2302,3869,4496,1254,887,3502,2755,320804,14721,0,12732,0,0,4582,31866,-57921,0,0,2119,0,0,0,1292,0,0,0,773,0,10164,330967 +"333",3687,230,6725,3973,4354,1179,21808,493,168,1217,3946,37624,359,1635,21103,4414,87,1720,3161,30,11,1185,1191,143,3457,1459,2402,170,114,110,637,5,241,27,212,89,174,2165,573,173,49,2024,856,14,42,11,0,10,68,1355,32,957,2143,148,1939,3084,1243,439,474,185,130,25,94,59,574,5458,794,160,33,3238,1074,159166,7067,0,231019,0,0,7094,121335,-143960,0,0,1638,0,0,0,523,0,0,0,6614,0,231331,390496 +"334",45,1,30,30,424,55,4139,624,865,1947,4042,9343,33195,4246,14583,13052,902,2067,2400,518,52,866,1200,324,5106,1959,8370,438,260,205,2468,4,77,3,110,1,16,123,182,2703,978,14640,3949,411,527,15,441,29,284,263,1216,5520,6035,5709,2444,885,548,5446,455,178,275,10,73,212,86,4187,13934,2568,1,1410,1631,191332,77339,0,177654,0,289,528,105445,-299643,0,0,28410,0,0,0,8163,0,0,0,15782,0,113968,305300 +"335",993,180,106,49,273,15,25560,455,112,2199,2175,13862,2678,8473,4645,2627,76,999,811,46,4,414,99,110,992,1040,439,152,41,87,254,3,143,38,36,61,5,32,380,1,0,4026,454,96,45,5,0,6,519,342,1,1322,4249,110,1835,625,314,28,433,502,305,34,213,322,522,2168,915,1874,41,1705,1791,95470,36340,0,25833,0,4569,2841,30097,-79696,0,0,888,0,0,0,921,0,0,0,1333,0,23125,118595 +"3361MV",872,98,609,968,482,28,1999,573,484,758,1129,17054,542,441,151505,3376,309,474,2499,83,1,992,203,181,1311,438,5800,5363,1020,266,2706,0,49,0,3646,132,2,148,3133,485,56,1201,150,39,14,0,0,0,0,1319,0,29,2763,536,5323,1308,306,339,581,93,1494,30,58,108,460,14187,4520,90,2114,4787,761,252822,194926,0,191624,0,0,17163,100482,-267438,0,0,1235,0,0,0,283,0,0,0,8258,0,246535,499357 +"3364OT",0,96,0,50,0,0,4,32,0,0,38,210,0,0,288,63217,0,0,0,0,0,0,0,0,0,0,6,16,0,0,0,1291,1260,1487,4,7,0,989,0,0,0,4,0,0,0,0,0,0,0,0,0,0,228,4,28,24,0,0,0,0,14,0,9,0,0,118,25089,427,4,0,102,95047,15658,0,52050,0,0,6655,99299,-46268,0,0,37854,0,0,0,3362,0,0,0,1508,0,170117,265164 +"337",0,0,0,0,0,0,10310,708,0,0,0,425,114,3,29,132,3253,246,0,0,0,0,0,0,0,296,315,146,0,12,783,0,0,2,0,0,0,8,0,0,0,182,373,0,0,0,0,2490,22,0,7,1,194,5,1,0,0,277,51,1,104,83,250,3,233,159,0,0,1066,8,417,22708,37185,0,24472,0,408,1885,3753,-30170,0,0,1,0,0,0,98,0,0,0,2708,0,40339,63047 +"339",170,3,23,38,23,0,688,19,174,62,48,2597,4,678,1338,59,22,6448,28,97,168,1,8,7,665,99,1065,76,85,7,932,0,1,0,5,10,1,207,257,7,2,152,125,180,76,14,0,0,215,83,72,55,1332,15,1291,414,312,16307,17478,1002,1200,118,545,45,490,1816,181,273,0,5488,94,65494,81944,0,41834,0,0,2281,31358,-80242,0,0,112,0,0,0,207,0,0,0,1059,0,78553,144047 +"311FT",33461,434,0,0,0,0,0,44,156,8,0,0,0,0,0,0,0,7,185566,23,923,1420,1288,587,4318,127,2409,5,2863,829,1095,521,1,303,16,0,0,36,0,44,11,0,47,0,0,0,0,0,0,0,0,0,4203,125,0,0,6221,14,8495,6016,7929,531,4246,5925,44903,2167,3230,55,584,42307,0,373491,546885,0,0,0,0,3753,65460,-80792,0,0,0,0,0,0,0,0,0,0,0,0,535305,908796 +"313TT",223,98,0,4,0,0,1353,507,301,0,0,1086,2,0,2986,975,2974,2235,131,8782,1898,3288,378,60,2,2620,1604,58,144,1939,1970,0,0,192,10,0,5,84,5,12,103,12,12,0,0,0,0,1,86,228,0,0,233,5,94,77,41,40,527,1536,739,0,356,1184,217,1122,1027,279,2,1786,23,45654,19866,0,841,0,268,864,8977,-27650,0,0,0,0,0,0,66,0,0,0,31,0,3264,48918 +"315AL",20,0,0,0,0,1,0,0,1,0,0,0,0,0,1943,0,0,44,14,211,1340,0,588,14,0,1,580,95,7,327,403,0,0,0,0,0,0,0,0,12,7,388,3,0,0,0,0,0,0,40,0,0,42,8,166,98,57,98,115,0,561,45,13,5,39,1311,98,27,46,2127,38,10935,139054,0,0,0,0,478,4760,-135437,0,0,0,0,0,0,0,0,0,0,0,0,8854,19789 +"322",335,0,66,236,91,36,1667,469,1327,1503,2081,2172,547,1013,2031,647,973,1755,23162,456,40,41511,6834,320,6815,3919,5414,83,1153,283,1377,27,65,13,136,781,99,3129,531,2413,91,525,272,1153,356,78,3,1,701,651,497,341,2974,773,3381,258,233,1588,2308,940,766,72,146,1801,2405,1145,167,1738,64,11852,31,152821,22086,0,0,0,0,1457,21916,-21542,0,0,0,0,0,0,0,0,0,0,0,0,23917,176737 +"323",29,0,9,5,0,2,33,21,0,0,1,13,0,2,4,0,0,0,193,0,25,0,2188,11,677,0,8465,107,214,137,2629,5,17,0,156,28,11,351,11,5671,506,596,4572,830,1319,1115,0,0,53,368,849,214,4742,896,2375,14,926,1724,1967,154,1566,720,171,717,549,1769,835,1381,114,9674,564,62295,5340,0,0,0,0,120,2318,-2474,0,0,0,0,0,0,0,0,0,0,0,0,5305,67600 +"324",10008,827,6233,7096,4499,23110,47443,1065,1017,3242,947,1849,222,1587,567,406,377,790,4106,167,23,1920,1823,30898,15594,1270,6312,737,672,182,1958,38476,8407,7197,48663,2294,85,12586,323,368,84,705,565,7173,3132,29,1071,10,4311,2691,47,667,2170,1642,3242,1503,971,1048,5083,936,729,168,1066,1286,3551,4001,26205,1207,4453,102836,23525,501455,287049,0,0,0,0,4480,120047,-100722,0,0,0,0,0,0,0,0,0,0,0,0,310853,812309 +"325",26810,2476,6657,3331,2068,1934,8509,2514,3830,2082,7586,4721,2410,2902,6689,1700,1661,6154,7573,11257,212,14164,6108,18875,251307,61243,2416,80,55,39,832,2,250,11,161,4,5,112,564,790,146,605,628,84,87,7,0,56,9775,435,197,173,11328,1737,6385,955,632,26263,19752,2514,495,106,531,87,480,3884,1665,2104,160,24304,2891,588556,227597,0,3175,0,0,3102,151503,-209057,0,0,0,0,0,0,0,0,0,0,0,0,176321,764876 +"326",1458,98,86,2142,1204,23,20575,698,1251,966,2519,8774,1669,1741,19357,3281,3998,5257,18367,372,138,3359,582,483,11883,18665,10532,970,1538,277,3179,12,7,1,679,12,164,4035,569,613,84,4927,443,182,96,131,0,13,306,1792,96,777,4965,252,1682,341,599,6447,2825,1118,1144,24,186,123,4794,4331,1843,616,42,8056,1571,201342,30077,0,141,0,15,2740,25332,-45643,0,0,0,0,0,0,30,0,0,0,0,0,12692,214033 +"42",35398,2571,4818,4507,3027,5976,51514,7129,4429,23046,16661,29028,9737,8809,46388,10799,5137,9121,61106,2864,1552,11941,3170,19749,46616,13588,44547,2480,1834,1684,11078,3437,2426,1869,13941,751,278,5104,1798,3351,252,12271,2337,2207,1215,197,390,359,3487,9388,911,2217,11809,3300,6395,2140,2576,18084,16902,3348,3487,379,2370,2746,13669,10613,11772,2790,2044,32212,7977,723101,479625,43,180358,17241,2128,7968,184597,33503,0,0,10007,344,0,0,3578,467,0,0,7187,963,928009,1651111 +"441",7,2,69,122,83,9,1359,74,103,95,154,1980,43,1,1249,433,58,111,522,18,0,193,42,1,309,73,131,1167,234,58,572,0,5,0,491,2,0,6,91,95,12,50,4,9,3,2,0,31,225,274,0,6,355,0,766,25,0,0,0,0,0,1,6,15,41,2874,0,0,0,0,1,14664,122408,0,16406,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138820,153483 +"445",49,0,1,0,0,57,146,0,2,0,1,4,0,1,10,0,6,7,12,0,0,2,31,2,44,2,24,9,64,15,68,0,5,1,480,21,1,32,0,3,1,0,7,6,7,1,0,43,46,6,1,2,13,0,93,0,22,11,13,2,3,11,40,81,2112,36,0,0,0,62,0,3720,185479,0,175,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,185663,189384 +"452",76,1,11,11,5,82,1551,8,10,8,22,165,8,12,152,28,65,84,157,193,0,30,457,16,267,20,153,145,71,16,151,1,8,2,685,28,5,45,6,21,5,5,43,35,41,4,0,469,181,36,11,10,106,0,270,4,61,68,38,6,17,7,22,183,897,423,0,5,0,68,0,7792,188087,0,2541,269,429,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,191325,199117 +"4A0",800,11,58,123,8,1033,57768,87,14,22,114,509,44,97,652,45,495,626,1036,803,1,158,1731,221,2561,105,609,995,432,325,1286,4,89,298,8212,316,18,628,14,69,15,20,158,129,151,15,0,3723,710,100,66,35,396,0,983,12,140,325,166,63,72,131,365,814,8221,1859,2,43,0,674,0,101808,604908,0,27416,4318,4381,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,641022,742830 +"481",154,2,16,40,642,877,472,208,359,399,880,694,128,81,431,285,250,384,1060,66,24,282,431,266,578,594,5840,85,39,60,146,170,26,99,1100,7,4,971,53,699,260,1267,2009,3834,3649,510,502,14,5572,1057,1452,2345,4604,356,4256,489,793,2834,323,456,541,138,199,290,1118,817,6846,2540,306,3634,81,71994,118988,0,321,28,3,3,47720,-46100,0,0,34,1,0,0,7,1,0,0,16,2,121023,193017 +"482",1826,71,416,1644,183,4301,1636,678,2201,4429,948,580,79,328,1042,278,247,219,6095,86,5,2537,173,2642,5501,1355,326,25,101,30,80,96,161,19,3941,13,4,362,50,56,4,341,37,62,30,52,3,6,147,57,53,32,645,38,338,39,58,302,198,71,108,8,55,96,446,159,247,704,531,1631,2549,53812,7805,0,2715,0,24,53,13083,270,0,0,47,0,0,0,6,0,0,0,95,0,24100,77911 +"483",580,29,444,265,89,349,1027,7,263,659,132,77,29,90,69,47,17,50,1096,37,0,185,2,117,1106,203,44,11,15,4,17,22,14,4,28,1,4,10,1,1,0,32,6,5,2,0,1,2,45,12,0,7,549,44,83,20,160,147,126,13,14,3,10,9,43,44,1777,127,662,516,224,11829,17866,0,10,0,0,-132,6881,13267,0,0,3,0,0,0,0,0,0,0,0,0,37895,49723 +"484",6318,354,881,760,554,3279,13297,1636,2209,6638,3651,4432,1233,1395,5958,1821,1204,1415,25924,858,205,3273,717,7913,7742,2535,3968,1302,1462,1488,3945,1054,319,264,4843,90,45,2598,216,696,280,1198,731,245,153,75,22,122,644,384,160,278,2444,332,1168,321,403,1260,1393,442,697,154,820,446,1892,1757,2254,481,655,5622,1024,156349,77731,15,20117,557,315,342,31431,2736,0,0,794,11,0,0,195,15,0,0,983,31,135274,291626 +"485",0,3,2,7,148,377,353,50,81,99,216,174,27,18,95,61,60,117,212,11,5,66,103,64,116,133,633,30,5,12,50,1,390,0,0,0,1,163,6,188,61,553,746,1408,987,393,125,13,1737,397,608,767,2560,110,1520,117,275,1221,1086,550,121,1145,50,97,385,231,32,3,22,10974,354,32731,33220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33220,65950 +"486",110,8,5348,55,28,6341,216,5,7,11,6,12,1,5,3,2,2,4,22,4,0,15,14,12018,226,10,47,5,5,1,14,287,62,54,362,17,1,92,2,3,1,4,4,53,23,0,8,0,28,19,0,5,11,12,26,11,7,7,38,6,5,1,8,9,25,28,195,9,304,747,4330,31352,2079,0,0,0,0,4219,2089,0,0,0,0,0,0,0,0,0,0,0,0,0,8386,39739 +"487OS",0,204,21,689,12,5523,0,582,741,114,90,13,0,3,9,0,554,193,430,68,0,412,328,759,112,355,37308,1102,688,427,6045,20869,1398,7141,23748,193,474,25529,1028,1681,579,225,2854,467,2729,305,0,0,0,1864,767,356,6085,180,1840,741,324,1353,1767,303,869,506,640,115,350,1257,2,75,783,554,3473,170206,18069,0,0,0,0,0,10701,3495,0,0,0,0,0,0,0,0,0,0,0,0,32265,202471 +"493",351,0,8,256,0,543,0,107,107,71,905,393,2284,59,113,81,81,314,155,89,49,141,221,68,255,167,25853,6344,9299,11757,23333,18,2,454,2829,55,24,619,10371,679,177,469,828,0,0,69,0,0,56,464,223,107,775,4,1262,80,237,650,716,147,237,162,92,831,1467,539,200,221,0,3237,103,111803,164,0,0,0,0,0,148,0,0,0,0,0,0,0,0,0,0,0,0,0,312,112114 +"511",55,1,18,0,3,118,318,1,1,6,50,33,20,3,11,119,7,32,6,0,0,4,64,6,42,9,1343,106,177,72,583,5,48,0,17,1,0,148,96,6482,30,515,1273,290,672,81,32,4,223,606,1059,647,2525,1500,928,6,599,1374,706,94,1158,20,41,89,71,519,1580,1078,970,6700,87,35486,64748,0,0,69396,0,-211,37718,-3728,0,0,0,1189,0,0,0,1611,0,0,0,3332,174052,209538 +"512",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,150,185,0,82,3,0,0,1,0,52,4,0,52,18891,33632,6,11,14,0,0,0,45,808,6,11,1434,122,25,0,493,21,6,611,542,84,28,261,929,654,1400,365,15,204,0,61180,24894,0,0,31961,0,94,18089,-5735,0,0,0,0,0,0,0,0,0,0,0,0,69304,130484 +"513",592,39,1186,276,1003,1574,4877,236,331,340,1001,931,453,194,395,431,198,627,991,79,31,366,467,403,1108,608,15544,1332,665,606,6223,332,185,85,1108,335,562,1817,598,2604,305,96820,7278,8552,6111,2045,1141,445,8627,1646,4720,3268,9581,4562,6901,500,2196,4914,3074,891,1131,342,939,3407,4680,3630,6945,4111,984,33445,1190,285120,292880,0,7155,23236,0,0,16269,-155,0,0,0,0,0,0,0,0,0,0,0,0,339386,624506 +"514",0,0,44,6,15,1125,634,229,337,316,865,851,448,133,222,765,251,398,682,72,36,302,172,81,360,379,3532,1279,986,820,3352,103,1,0,39,13,20,299,112,2435,82,2587,7308,6594,2414,709,932,4,404,5493,2529,1753,9551,3924,9776,465,3300,1157,2226,278,1010,313,451,464,2332,4378,11807,3908,378,8097,1343,117686,31637,0,0,14168,0,0,4233,-898,0,0,0,676,0,0,0,679,0,0,0,1781,52276,169961 +"521CI",1392,109,2413,874,2143,6924,5179,286,952,1276,1742,1721,760,609,1173,640,624,968,3797,249,132,440,455,572,1809,1285,24236,1850,3248,2793,13689,1229,8241,532,1362,3568,121,932,995,1696,992,3566,1555,38931,31301,5782,3439,98585,35492,22535,3816,2795,15861,15752,6815,215,3889,7190,2327,2158,1247,430,1353,1997,3359,17050,192,153,5799,6523,8590,452707,203864,0,0,0,0,0,43630,-44,0,0,0,0,0,0,0,0,0,0,0,0,247449,700157 +"523",293,39,2619,879,3457,593,1377,45,82,1508,1932,1739,156,364,1104,675,551,987,225,19,7,44,71,87,56,125,2147,103,226,335,720,2479,536,4580,279,366,64,1084,43,360,134,320,140,20600,31611,1473,69158,5,3450,791,909,397,2220,6119,1338,42,666,1292,4136,461,1108,236,79,2025,2427,10465,1,78,175,22097,1113,217422,205968,0,0,0,0,0,61952,-56,0,0,0,0,0,0,0,0,0,0,0,0,267864,485286 +"524",2497,447,3806,984,1747,592,419,153,673,543,721,1189,645,713,850,664,355,498,2308,267,155,263,113,208,1510,388,19503,1303,918,764,4039,417,24,425,6191,1258,486,1523,961,402,825,1131,628,4980,11816,313040,5317,3036,26507,3378,2980,794,5182,263,3874,668,1223,7898,32864,1549,2513,1153,961,1078,2487,2102,0,33148,1577,1437,5719,541052,296669,0,0,0,5584,0,16539,-58218,0,0,0,0,0,0,0,0,0,0,0,0,260573,801626 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6370,9079,0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15470,124263,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124263,139733 +"HS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1720651,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1720651,1720651 +"ORE",29122,71,927,80,195,2632,9904,480,477,358,2983,1265,2223,336,1085,3478,823,887,2013,380,70,873,1338,72,2510,1522,54915,8419,12827,8694,57783,429,134,257,3404,431,340,2531,14272,5491,2989,15303,6180,20263,18535,15525,560,2888,102051,9224,20327,4514,34569,18753,11256,1668,28908,43956,27347,20666,15205,6256,9688,4992,42090,37377,3501,9053,1401,36826,4284,812185,4959,14605,0,0,82654,0,3468,0,0,0,0,0,0,0,0,0,0,0,0,0,105686,917871 +"532RL",3572,161,4637,1849,4469,1029,14111,243,782,956,2524,2148,977,715,1769,1414,244,1574,4321,135,120,993,676,1391,5136,976,23935,636,1440,1978,6280,8202,3568,405,7079,622,165,1888,1030,2586,2202,11136,6514,5083,5680,2985,27,14,1742,6477,3227,2626,12602,15778,4582,1370,2021,4795,4845,587,463,1062,1279,1692,6490,1979,377,187,989,5461,381,231389,70850,0,0,0,0,0,71336,0,0,0,0,0,0,0,0,0,0,0,0,0,142186,373576 +"5411",435,115,3733,1009,2382,4629,5293,242,354,317,1379,1406,4197,222,1270,3492,242,1212,1095,149,73,380,272,677,3059,679,15811,442,359,869,2750,317,632,137,160,56,199,456,285,3214,606,3656,3135,5409,8509,10116,1921,507,13426,833,2910,4458,11630,9061,5538,375,419,5404,13490,1358,853,1522,1952,2255,3060,3165,1822,359,2061,8255,925,192993,90901,0,0,0,14388,0,11032,-2425,0,0,0,0,0,0,0,0,0,0,0,0,113896,306889 +"5415",371,49,2185,150,51,1510,3368,174,236,348,1106,1227,406,97,355,1883,200,484,818,97,30,248,392,574,841,440,12537,1520,632,787,3273,130,1204,4,301,40,9,163,339,2994,337,4794,7806,7548,7195,1404,687,50,1303,684,4185,5125,12302,15555,6647,196,1450,4335,7225,1096,1048,182,680,636,1717,2282,29954,17277,797,13503,2120,201694,0,0,18701,169328,0,0,14946,-23843,0,0,2086,6816,0,0,0,17537,0,0,1130,7828,214529,416223 +"5412OP",1687,702,5654,2726,9533,10690,34548,1383,2139,3237,6564,5509,7813,1347,3742,5441,2010,5014,8818,782,445,2071,1783,3189,11195,3847,92791,10235,6932,7352,37643,910,2428,1138,1994,437,1821,1986,1792,19908,8087,49008,22697,51847,37433,12276,3149,193,53900,9803,9837,20201,92303,40143,29183,2264,5075,27729,32929,7641,5830,4541,5512,9202,26566,18655,50595,9490,2921,42286,13277,1033808,55602,0,42239,314582,1210,0,112821,-80573,0,0,0,61470,0,0,0,69932,0,0,0,15675,592958,1626766 +"55",0,0,14001,3385,1837,18,4033,798,1560,939,6272,12406,21752,1113,8304,6271,463,2848,14748,861,595,2326,654,3563,16564,1947,75105,913,3521,19124,20736,508,2,724,5435,257,1,2885,552,6570,521,2806,1370,4903,10970,1297,589,10,1574,4773,7253,5250,17771,59,26395,2385,4678,22883,7447,3656,2097,1771,1534,15475,44094,6071,0,0,729,0,0,461954,0,0,0,0,0,0,3669,0,0,0,0,0,0,0,0,0,0,0,0,0,3669,465623 +"561",674,65,1115,744,1979,11313,5799,589,1265,3114,6513,2952,2627,587,2685,3602,396,1445,3400,307,497,1495,3270,2396,4768,1902,51060,2738,3034,3014,14882,3950,1206,3225,9484,1093,1588,5416,3274,11676,1600,30788,12794,16701,10046,4026,331,665,60306,14912,9342,23144,45394,6317,32912,2388,3268,25756,33189,6454,4071,2439,2189,5084,8594,10023,17467,1890,4221,25287,5256,607992,48001,0,0,0,0,0,1690,-1032,0,0,0,0,0,0,0,0,0,0,0,0,48659,656650 +"562",267,13,1334,343,497,695,2117,133,280,443,497,298,148,102,205,188,126,196,1561,109,12,384,126,769,2515,359,2541,608,493,262,1443,23,89,35,326,27,18,241,913,119,24,172,78,562,106,714,572,5,7467,486,123,115,1333,576,1210,7783,522,1755,2071,798,687,93,657,1133,2472,1335,753,359,275,15265,2996,73357,23330,0,0,0,0,0,59,-123,0,0,0,0,0,0,0,0,0,0,0,0,23266,96623 +"61",15,5,0,0,0,235,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,105,29,0,3,2295,21,1081,0,3382,197,45,0,0,0,16,22,0,0,0,94,234,25,10,0,0,0,0,0,0,64,81,0,818,0,4136,1,16,0,0,1414,256,0,0,2934,2006,62,128,14330,12,34080,300193,0,0,0,0,0,2597,-1557,0,0,0,0,0,0,0,0,0,0,0,0,301233,335313 +"621",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,0,50,0,0,14510,12757,60,6,58,1,0,0,60,0,415,0,4196,0,32147,848179,0,0,0,0,0,78,0,0,0,0,0,0,0,0,0,0,0,0,0,848257,880404 +"622",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,410,0,0,0,0,0,0,0,0,0,0,0,0,410,853565,0,0,0,0,0,903,-2329,0,0,0,0,0,0,0,0,0,0,0,0,852139,852549 +"623",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1760,0,785,0,2545,206871,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206871,209416 +"624",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,156,0,156,171101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,171101,171257 +"711AS",57,1,1,0,29,141,94,29,36,66,93,78,7,9,44,28,21,45,128,10,3,42,45,63,44,82,1671,335,474,40,345,35,241,0,29,5,0,212,57,190,5339,21133,273,989,541,149,183,0,3118,268,585,365,3119,2352,1186,56,1035,559,545,173,191,13709,664,293,1415,2009,1505,42,83,912,12,67636,61692,0,0,4199,0,0,1696,-845,0,0,0,0,0,0,0,0,0,0,0,0,66742,134378 +"713",28,1,0,1,31,45,76,10,15,18,41,31,5,2,17,12,11,21,40,1,0,13,21,12,20,27,351,3,48,1,281,0,1,0,0,0,0,2,2,39,12,83,154,285,199,51,25,1,344,51,142,166,396,521,409,25,65,279,13,38,54,96,9,256,296,52,331,2,1,643,206,6432,162967,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,162967,169399 +"721",2,0,6,20,366,857,388,121,194,236,523,417,68,48,224,148,145,283,513,35,13,160,356,155,283,382,1807,14,71,31,162,0,18,0,0,0,7,470,134,552,187,1184,2200,4036,2854,694,363,15,4901,1046,1598,2234,4547,607,3664,441,591,2630,194,313,356,98,118,361,1153,631,1491,619,92,2417,154,50998,123916,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,123916,174915 +"722",548,42,42,64,704,1807,432,183,264,388,678,580,125,96,305,204,179,362,821,68,23,254,324,376,384,461,4880,570,856,645,2455,8292,6,18,342,50,34,1078,179,560,346,1289,2231,6591,3264,1710,963,672,16082,1799,3090,3164,12369,2704,8700,449,1806,15881,9625,8016,1981,458,1169,5593,3200,2507,602,205,1388,9731,460,157723,570602,0,0,0,0,0,2395,0,0,0,0,0,0,0,0,0,0,0,0,0,572997,730720 +"81",400,344,206,144,930,640,5895,324,680,1292,1343,917,541,246,751,408,186,374,2063,150,18,1130,466,1090,3065,927,23400,1318,2595,1626,6165,388,162,55,11223,577,717,2526,1179,1100,226,4464,1921,6077,3002,3688,733,61,5437,8952,1483,834,7411,4358,7380,2175,1378,6035,15377,1726,913,733,1432,1930,8634,7809,4388,406,1460,17329,1692,207004,513443,0,0,0,0,0,320,-3352,0,0,0,0,0,0,0,0,0,0,0,0,510412,717416 +"GFGD",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,650338,0,0,0,0,0,0,0,0,0,0,0,650338,650338 +"GFGN",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,349383,0,0,0,0,0,0,0,349383,349383 +"GFE",20,6,0,13,0,248,10,0,0,18,49,578,8,320,0,0,0,44,0,2,0,0,114,111,98,0,17847,486,510,326,3271,4,0,2384,2446,107,92,838,424,774,292,333,1427,3572,13198,168,0,0,267,848,488,210,2384,178,1177,118,698,973,1726,320,472,145,87,998,3358,1389,0,187,2,1670,151,67985,7595,0,0,0,0,0,375,-450,0,0,0,0,0,0,0,0,0,0,0,0,7520,75505 +"GSLG",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1515717,0,0,0,1515717,1515717 +"GSLE",0,3,0,0,0,2829,0,43,112,182,179,113,74,47,78,56,33,70,683,49,7,163,40,328,1220,120,884,173,226,106,590,2,0,0,75,3,6,71,420,63,26,92,58,335,130,39,0,0,488,733,477,141,1219,262,886,74,81,497,621,265,2245,36,183,512,1121,611,633,406,248,3908,984,26362,58679,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58679,85041 +"Used",-50,16,0,-28,785,4485,1552,0,40,20942,220,3,0,0,0,0,0,139,0,9,0,1529,0,0,20,24,0,20,0,0,232,-220,0,-66,47,1,147,1170,1,0,198,1,0,0,0,0,0,0,0,0,0,0,0,72,0,0,193,2,0,0,0,-113,444,0,0,6154,-34,0,0,0,0,37934,53945,-1375,-100167,0,-1386,8184,29796,-12765,0,-4,0,0,0,-365,-76,0,0,3122,-8300,0,-29392,8542 +"Other",944,60,1136,61,388,1180,1873,205,199,681,732,1240,1148,356,1594,661,125,457,2288,96,25,479,241,2237,2511,584,5262,52,524,607,2487,12663,210,2367,1116,14,49,433,88,885,356,9615,722,3071,22690,1427,202,1726,2682,803,378,1129,2728,1323,1363,102,568,0,0,261,0,226,238,689,1594,464,13631,3324,1063,0,0,120631,-73359,0,0,6408,0,0,161092,-211930,0,0,0,0,0,0,0,0,0,0,0,0,-117788,2843 +"Total Intermediate",256191,16188,137733,57679,57549,180835,519637,54955,56926,203455,205537,251766,112978,70693,398070,163769,43363,74244,675870,35743,9218,125818,44653,674351,487849,148755,654690,60687,75651,77297,279867,107340,39393,37450,169375,14539,11107,92304,61672,93997,48907,360770,116161,241970,245653,389441,104223,180481,492031,124887,89498,101459,402290,176642,229523,40758,95395,294187,310871,82967,73416,42991,49757,86052,291908,227683,268691,114324,46922,621582,178210,12968848,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V001",28286,19768,34979,18912,36636,69760,365906,16656,23380,31220,90276,88411,130664,31889,56836,71522,17302,46226,91888,11156,8167,29123,25571,17958,89665,39040,457673,92380,82848,84367,250524,40570,22308,6554,78692,17111,6754,67164,35598,92210,30338,111401,37628,211118,203328,215125,518,15469,68251,30531,115473,192560,468622,259415,317140,24137,161398,435739,329833,113073,84939,44167,41931,67344,215192,250937,248004,161051,56097,1147127,91526,8575371,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V002",-542,1612,31790,5938,2316,58601,7452,661,1290,2351,2852,3369,7063,273,2943,2273,382,1686,31061,598,285,1736,785,2872,14626,1534,192366,37247,21263,37497,98439,16981,34,236,4017,1614,2531,2149,658,3688,6490,32514,2572,15647,4830,23892,809,195204,20885,16440,10846,4695,11671,8366,7693,3142,7937,7850,9040,5149,1616,7349,10089,22701,39746,18897,0,0,-5124,0,-17394,1078079,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V003",120231,9334,158149,42136,29666,152289,181584,8501,18044,32191,44856,61206,103536,19990,55987,53105,4739,33531,97107,4213,1555,22296,12085,138308,200682,27138,350248,31581,27913,11579,134368,30503,17402,6376,45686,17734,16049,25629,10961,106346,45962,228430,65129,292926,24659,167887,11705,1335515,307716,126792,91158,55487,241280,34355,107296,15541,44856,131026,59599,7741,9469,50239,18002,38846,67129,78749,159606,95001,-750,178351,45994,6600532,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"Total Value Added",147976,30714,224919,66986,68619,280650,554942,25818,42713,65762,137984,152985,241263,52152,115766,126900,22424,81443,220057,15967,10007,53155,38441,159138,304973,67712,1000287,161208,132024,133443,483331,88054,39743,13165,128396,36459,25334,94942,47217,202244,82790,372345,105329,519691,232817,406905,13033,1546187,396852,173764,217477,252742,721573,302136,432129,42820,214191,574615,398472,125962,96024,101755,70022,128890,322066,348582,407611,256053,50223,1325479,120125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16253968,0 +"Total Industry Output",404167,46902,362652,124665,126168,461485,1074580,80773,99640,269217,343521,404751,354241,122845,513836,290669,65787,155688,895927,51710,19224,178973,83095,833489,792822,216467,1654978,221895,207675,210740,763197,195394,79137,50616,297770,50998,36441,187246,108889,296240,131697,733115,221490,761660,478470,796345,117255,1726669,888883,298651,306975,354201,1123863,478778,661652,83578,309586,868802,709343,208930,169440,144746,119779,214942,613975,576265,676302,370377,97146,1947060,298336,0,11047364,479435,983401,655691,432014,71212,1982383,-2534000,650338,8103,85228,70506,349383,14478,18735,90241,1515717,264951,39176,29612,0,29222821 diff --git a/flowsa/data/external_data/BEA_Summary_Use_2013_PRO_BeforeRedef.csv b/flowsa/data/external_data/BEA_Summary_Use_2013_PRO_BeforeRedef.csv new file mode 100644 index 000000000..7622503ed --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Use_2013_PRO_BeforeRedef.csv @@ -0,0 +1,80 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","Total Intermediate","F010","F02S","F02E","F02N","F02R","F030","F040","F050","F06C","F06S","F06E","F06N","F07C","F07S","F07E","F07N","F10C","F10S","F10E","F10N","Total Final Uses (GDP)","Total Commodity Output" +"111CA",51969,704,0,60,36,0,1927,0,0,0,0,0,0,0,0,0,0,353,244871,1291,0,0,0,0,14479,0,1802,365,947,201,319,0,0,0,0,0,0,101,0,0,0,0,0,1,0,0,0,0,4,0,2,1,840,33,784,0,143,0,0,0,0,0,415,43,1741,41,6,-517,0,2606,0,325566,72970,0,0,0,0,12455,53299,-34554,0,0,0,0,0,0,0,0,0,0,0,0,104170,429736 +"113FF",22643,5756,0,65,0,0,0,9764,2,0,0,0,0,0,0,0,40,210,6585,0,33,3712,37,18,710,2171,0,0,696,0,2,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,208,11,1,0,70,0,0,0,0,0,160,398,3168,156,0,61,15,3322,0,60018,6464,0,0,0,0,403,6854,-16174,0,0,0,0,0,0,0,0,0,0,0,0,-2452,57567 +"211",0,0,34594,6,1,30307,0,1,0,26,0,0,0,0,0,0,0,0,0,0,0,1,0,526391,5334,1,10,1,2,1,5,0,0,0,0,0,41,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,4,11,1,2,2,2,13,2,1,0,3,6,15,6,0,0,1152,0,18780,616724,0,0,0,0,0,-943,14605,-289772,0,0,0,0,0,0,0,0,0,0,0,0,-276111,340614 +"212",1794,1,113,6380,59,11066,11787,7,7527,15644,417,157,6,81,53,120,20,169,1383,85,0,1411,0,2684,5302,103,19,0,0,0,2,0,112,0,4,0,0,2,3,27,14,132,215,0,0,0,0,10,0,0,0,0,681,43,362,54,237,0,57,26,24,193,511,56,349,705,0,1293,0,1411,6931,79847,136,0,244,0,0,-309,14311,512,0,0,0,0,0,0,0,0,0,0,0,0,14895,94741 +"213",0,0,13034,1867,1227,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16168,0,155592,3944,0,0,2,3689,-1306,0,0,0,0,0,0,0,0,0,0,0,0,161920,178088 +"22",4659,161,7020,3766,192,29043,4147,1788,3687,8271,4545,2064,1237,821,2848,1294,564,1189,9925,1486,66,5899,1373,9863,18869,5089,16623,2706,8147,5080,14715,100,106,110,1132,95,1242,873,12724,886,389,3740,1424,2786,1284,539,2439,6,65121,1750,594,304,4159,8079,2558,506,7160,2957,9424,2389,1164,670,2647,5938,18702,4723,1879,809,1531,18025,2061,370162,256009,0,0,0,0,0,3760,-2609,0,0,0,0,0,0,0,0,0,0,0,0,257160,627321 +"23",1728,43,1197,1900,1895,7719,202,166,336,657,637,427,168,119,455,247,83,189,1095,85,10,678,230,8017,1737,490,2171,435,481,490,2120,295,2151,36,299,235,1039,1589,844,97,35,2208,138,4190,1323,515,445,66365,54815,293,111,30,671,473,380,38,632,331,805,251,230,174,380,747,1454,3579,7354,1764,1430,27197,43250,264397,0,323546,0,0,368991,0,101,0,0,6529,0,0,0,12098,0,0,0,256103,0,0,967367,1231765 +"321",252,62,0,77,121,0,30972,18921,373,349,235,908,326,165,3038,291,6098,1074,386,39,2,5153,4,0,276,1287,2292,54,413,79,672,0,1395,0,58,0,12,83,178,106,86,663,1380,74,4,14,0,34,4588,510,12,16,594,2,488,15,48,219,216,4,1027,4,139,400,805,387,13,23,4,3451,128,91094,3966,343,0,0,3138,1384,5368,-15871,0,0,0,0,0,0,76,0,0,0,0,0,-1596,89498 +"327",6,75,1090,400,686,72,45246,739,11280,2592,1069,2497,318,1543,6058,344,336,816,5162,128,0,440,2,1103,2072,1475,223,190,65,105,618,0,13,0,31,0,2,51,147,6,2,2078,779,53,32,8,0,29,76,494,5,96,2948,61,960,99,114,1589,1431,162,238,8,124,78,1561,1072,25,299,0,1306,1596,104325,9636,0,0,0,0,1340,8876,-21228,0,0,0,0,0,0,0,0,0,0,0,0,-1375,102950 +"331",97,0,5993,645,508,3,3929,368,647,80683,73423,36632,4846,16461,42833,10503,3411,7270,5924,278,0,474,26,41,54,1527,1287,4,0,0,942,0,1148,0,0,0,0,377,0,24,11,209,277,0,0,2,0,1,1544,113,0,11,1253,29,398,436,147,136,49,17,247,17,258,18,82,547,76,257,0,223,364,307080,424,0,0,0,0,3844,32943,-84145,0,0,0,0,0,0,0,0,0,0,0,0,-46934,260145 +"332",1486,182,6056,1180,1401,446,60404,2248,2834,5625,38132,29134,5828,7886,38234,12838,2962,5663,14981,719,112,5644,1427,746,11156,7258,2367,328,139,98,1370,190,366,1403,835,103,974,961,556,1243,18,9426,1541,152,125,5,21,30,1192,1533,29,1323,4096,661,2299,2377,394,304,573,22,1369,27,697,672,2339,3951,4518,1351,906,3915,3042,324420,16481,0,12098,0,0,5486,33794,-57777,0,0,1697,0,0,0,993,0,0,0,731,0,13504,337924 +"333",2889,234,8469,3501,4069,681,23506,449,154,1299,4027,33899,284,1338,20914,4232,71,1691,3271,28,17,968,1130,132,3697,1530,2326,184,116,115,678,6,309,23,173,102,183,2250,628,157,49,1998,762,15,45,25,0,14,79,1541,31,978,1931,170,2063,3080,1396,398,448,176,116,24,90,67,526,5051,625,145,41,3170,1037,155826,7109,0,227883,0,0,4760,115501,-136588,0,0,1087,0,0,0,373,0,0,0,5984,0,226109,381935 +"334",68,1,30,25,294,66,4725,683,947,2011,4397,9030,31636,4246,16277,14998,948,2582,2491,596,56,906,1257,380,5703,2213,9482,467,268,239,2613,3,120,2,133,2,18,127,227,2772,798,13684,4108,490,642,27,687,57,357,299,1387,5368,6347,6143,2891,779,549,5485,398,169,281,13,83,200,74,4499,13617,2318,1,1457,1465,197713,79311,0,178323,0,264,2610,104225,-300487,0,0,21915,0,0,0,7190,0,0,0,10775,0,104126,301839 +"335",1113,194,141,48,306,18,27062,496,120,2136,2345,13124,2503,8051,5252,2963,82,1304,881,52,4,425,104,109,1042,1159,517,148,35,129,273,2,143,34,32,68,6,30,407,1,0,3435,450,106,43,7,0,10,626,362,1,1206,4024,142,2049,612,383,28,487,534,327,41,221,397,517,1980,794,1531,48,1551,1945,96713,36075,0,28100,0,4608,2379,31285,-82644,0,0,590,0,0,0,754,0,0,0,1263,0,22412,119125 +"3361MV",824,106,793,807,422,33,1860,586,507,776,1191,16197,484,367,173203,3474,322,603,2620,96,1,1044,203,184,1455,500,5824,5225,966,255,3008,0,46,0,3190,157,2,125,3163,401,54,1094,126,49,17,0,0,0,0,1367,0,26,2623,559,5419,1306,305,290,575,90,1263,37,54,106,455,13288,3859,75,1959,4341,657,271015,207052,0,214060,0,0,13637,105452,-277798,0,0,5238,0,0,0,386,0,0,0,11228,0,279255,550270 +"3364OT",0,23,0,54,0,0,5,30,0,0,41,186,0,0,337,68468,0,0,0,0,0,0,0,0,0,0,12,16,0,0,0,1231,1561,1288,3,9,0,1077,0,0,0,4,0,0,0,0,0,0,0,0,0,0,217,4,27,26,0,0,0,0,1,0,7,0,0,99,27465,379,6,0,117,102694,17036,0,57934,0,0,3670,109978,-49874,0,0,36649,0,0,0,2562,0,0,0,1032,0,178989,281683 +"337",1,0,0,0,0,0,12590,982,0,0,0,402,104,2,39,175,3351,296,0,0,0,0,0,0,0,349,329,163,0,2,886,0,0,2,0,0,0,8,0,0,0,180,387,0,0,0,0,3044,28,0,9,1,214,6,1,0,0,265,57,1,100,90,264,3,266,162,0,0,926,6,126,25814,38013,0,24932,0,418,1149,3816,-31697,0,0,1,0,0,0,113,0,0,0,2468,0,39212,65025 +"339",158,4,31,32,21,0,669,21,197,63,51,2401,4,604,1477,53,20,7445,30,103,135,0,8,8,711,107,1159,111,87,7,1054,0,1,0,4,11,1,205,267,6,2,137,123,205,66,27,0,0,269,91,62,63,1479,16,1343,430,398,16469,18837,1028,1282,120,481,47,532,1697,153,236,0,6330,110,69302,79464,0,45683,0,0,3812,31700,-78699,0,0,80,0,0,0,159,0,0,0,1013,0,83212,152514 +"311FT",33808,400,0,0,0,0,0,31,206,9,0,0,0,0,0,0,0,8,183210,10,942,1431,1349,548,4926,152,2398,6,2926,826,1168,501,1,254,14,0,0,44,0,49,8,0,45,0,0,0,0,0,0,0,0,0,4931,113,0,0,6930,14,8094,6349,7954,486,4565,6569,48584,2314,2723,37,890,45984,0,381807,552349,0,0,0,0,5507,69613,-79552,0,0,0,0,0,0,0,0,0,0,0,0,547918,929725 +"313TT",225,112,0,4,0,0,1363,519,360,0,0,1187,1,0,3499,957,2945,2547,165,9471,1800,3345,396,61,2,2498,1755,60,144,1975,2244,0,0,193,8,0,5,81,5,10,101,12,13,0,0,0,0,1,102,252,0,0,245,6,98,81,43,43,531,1705,771,0,382,1372,215,1226,929,251,4,1950,29,48297,19634,0,917,0,311,1164,9172,-28580,0,0,0,0,0,0,52,0,0,0,25,0,2695,50992 +"315AL",19,0,0,0,0,1,0,0,1,0,0,0,0,0,1810,0,0,40,11,492,1659,0,1010,13,0,2,634,124,9,333,594,0,0,0,0,0,0,0,0,19,17,691,5,0,0,0,0,0,0,93,0,0,37,13,190,85,86,137,170,0,832,102,21,9,80,1358,94,28,49,2487,38,13393,135872,0,0,0,0,4614,5014,-138762,0,0,0,0,0,0,0,0,0,0,0,0,6737,20131 +"322",338,0,89,203,87,40,1934,491,1414,1529,2271,2117,542,944,2384,715,1005,2160,24714,525,42,43635,6861,287,7389,4328,5725,86,1146,300,1501,24,61,12,138,820,107,3116,564,2210,100,475,243,1331,414,164,4,1,816,698,487,333,3105,704,3545,266,244,1656,2771,1254,773,79,145,1824,2464,1168,134,1639,68,11969,33,160761,21407,0,0,0,0,1090,22157,-22555,0,0,0,0,0,0,0,0,0,0,0,0,22100,182860 +"323",26,0,12,4,0,3,34,24,0,0,1,11,0,2,4,0,0,0,204,0,19,0,1923,13,837,0,8858,112,207,135,2972,4,17,0,148,32,11,387,11,6012,582,553,3558,899,1428,1909,0,0,56,382,802,212,4864,830,2287,14,937,1546,1928,146,1420,722,165,715,544,1658,655,1165,97,9283,634,62015,5127,0,0,0,0,658,2354,-2362,0,0,0,0,0,0,0,0,0,0,0,0,5777,67793 +"324",10839,986,8002,6427,4351,28873,50124,1054,1016,3097,1428,1811,238,1259,589,402,342,888,4073,193,22,1929,1778,43373,16226,1303,6828,788,665,171,2209,38199,9242,6541,54012,3232,96,13483,349,406,98,715,629,9690,4180,56,1345,18,5000,3148,58,786,2194,1634,3902,1716,1020,941,5366,905,693,170,1067,1326,3577,4020,21976,1078,4928,101389,21469,531937,279372,0,0,0,0,521,120231,-106093,0,0,0,0,0,0,0,0,0,0,0,0,294030,825967 +"325",27569,2797,7786,3106,1922,2071,9913,2475,3957,1999,7819,4576,2300,2683,7683,1726,1704,6951,7278,11742,166,13411,6081,19015,259128,64234,2420,93,60,45,866,2,280,11,168,6,6,123,682,808,150,576,621,102,98,16,0,84,10116,525,184,169,10723,1241,6309,1046,715,25063,22653,2379,496,128,594,94,460,4047,1637,1874,183,25815,2713,606469,239115,0,3559,0,0,9765,153800,-211484,0,0,0,0,0,0,0,0,0,0,0,0,194755,801224 +"326",1355,111,110,1464,1100,25,21626,671,1300,978,2617,8668,1548,1618,22412,3483,4022,6575,18169,393,114,3149,553,459,12880,19596,10730,1033,1490,288,3546,16,7,1,632,13,201,4129,590,547,84,4525,414,213,109,256,1,17,243,1935,92,785,5059,205,1833,352,607,6083,2741,1136,1009,25,183,127,4895,4341,1653,529,49,8625,1702,208050,30497,0,161,0,21,3522,25832,-46944,0,0,0,0,0,0,27,0,0,0,0,0,13116,221165 +"42",36771,2954,6069,4023,2843,6748,56146,7683,4693,23427,16951,28062,9627,8253,51410,11333,5237,10691,63927,3081,1693,12125,3373,21294,51377,14080,47986,2572,1905,1824,12892,3890,2661,1723,14610,955,313,5826,2079,4329,264,11805,2341,2908,1637,366,582,432,3925,10433,1028,2413,12716,3515,7330,2240,3289,18383,18439,3515,3593,426,2991,3364,16465,11165,11049,2621,2126,35141,7509,771453,490917,42,184465,19324,2195,13470,188658,35468,0,0,9330,351,0,0,3402,487,0,0,6764,1016,955891,1727344 +"441",6,2,96,114,80,11,1350,86,120,106,183,2109,42,1,1322,500,65,156,605,23,0,227,47,1,377,94,143,1256,243,61,704,0,6,0,480,2,0,7,100,87,13,45,4,12,4,3,0,40,257,310,0,6,391,0,835,28,0,0,0,0,0,1,7,16,41,2948,0,0,0,0,1,15771,130409,0,17673,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,148089,163860 +"445",46,0,1,0,0,62,154,0,3,0,1,4,0,1,10,0,5,9,11,0,0,2,32,2,42,2,25,9,65,15,71,0,6,2,477,25,1,33,0,2,1,0,6,7,8,1,0,54,49,5,1,1,13,0,94,0,23,10,13,2,2,11,41,89,2150,35,0,0,0,65,0,3799,187739,0,162,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,187911,191709 +"452",68,1,14,9,5,87,1657,8,12,8,23,161,7,10,152,30,58,103,151,144,0,31,346,14,255,22,158,147,70,16,165,0,8,2,662,34,5,45,7,20,5,5,34,40,44,7,0,584,189,37,10,9,105,0,279,4,67,62,35,6,15,7,22,189,909,411,0,4,0,69,0,7864,192648,0,3156,292,462,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,196558,204422 +"4A0",781,14,77,123,8,1157,64502,81,16,24,126,522,41,85,706,54,467,818,1037,654,1,169,1367,231,2689,114,660,1032,461,341,1439,3,97,301,8614,407,19,697,16,75,16,19,132,155,172,27,0,4935,761,107,64,35,410,0,1140,13,171,314,166,71,68,139,379,916,9001,1968,2,40,1,606,0,111855,642419,0,30741,5088,4823,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683071,794926 +"481",140,2,19,35,572,959,457,219,347,336,849,604,104,66,349,275,220,435,1008,69,21,258,388,307,595,593,5891,91,38,60,178,165,23,93,1174,10,3,1144,56,693,278,1110,1751,4155,3925,830,600,22,5850,1071,1358,2212,4627,346,4271,478,762,2460,310,423,499,135,190,294,1064,751,5599,2197,346,3594,78,70435,119266,0,302,28,2,19,48535,-39769,0,0,26,1,0,0,5,1,0,0,12,1,128430,198864 +"482",1634,73,545,1421,168,4887,1809,729,2413,4367,997,575,81,319,1199,314,258,261,6021,96,5,2535,177,4001,5478,1442,345,28,95,29,91,98,179,18,4076,16,5,401,55,55,4,320,37,74,35,89,4,9,175,64,52,31,657,36,346,43,64,283,196,76,105,7,59,108,488,169,204,623,562,1700,2931,56854,7907,0,2946,0,27,130,12734,328,0,0,131,0,0,0,7,0,0,0,157,0,24367,81221 +"483",502,30,429,247,84,424,1093,8,300,675,138,75,30,82,74,54,17,60,1169,32,0,183,2,125,1067,218,47,11,15,4,19,22,15,4,32,2,3,11,1,1,0,31,5,7,2,0,1,2,51,13,0,7,541,44,84,21,164,130,118,13,13,4,10,9,44,44,1496,119,749,563,268,11859,18511,0,10,0,0,1,6731,12634,0,0,3,0,0,0,0,0,0,0,0,0,37890,49749 +"484",5969,466,1059,825,532,2627,14940,1836,2347,6712,3716,4234,1208,1293,6707,2027,1239,1573,26805,845,205,3354,728,8211,7902,2651,4242,1365,1400,1575,4280,1041,360,242,5010,111,51,2865,233,705,205,1148,674,309,183,130,31,146,725,436,160,288,2544,438,1260,336,463,1272,1497,482,712,161,897,488,2041,1767,1981,428,650,5765,1068,162173,77523,15,20694,601,796,2067,31792,3472,0,0,713,11,0,0,166,15,0,0,896,32,138793,300966 +"485",0,3,3,7,146,536,394,58,88,92,231,166,24,16,81,65,59,152,226,14,5,68,103,82,138,148,697,34,5,13,61,1,408,0,0,0,1,177,7,204,71,543,739,1699,1162,689,163,22,1993,430,630,804,2844,117,1647,125,307,1172,1117,540,121,1261,51,104,408,228,22,3,32,11494,310,35357,35815,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35815,71172 +"486",119,9,7462,52,30,8282,250,6,8,13,10,13,2,4,3,3,2,5,25,4,0,16,14,13650,255,11,54,6,5,1,17,299,72,51,422,25,1,105,3,3,1,4,5,76,33,0,11,0,36,24,0,6,13,13,33,13,8,7,42,6,5,1,8,10,27,30,172,9,337,775,5157,38172,2162,0,0,0,0,-412,2518,0,0,0,0,0,0,0,0,0,0,0,0,0,4267,42439 +"487OS",0,218,31,735,12,6230,0,670,812,116,105,14,0,2,6,0,518,235,495,79,0,456,335,1012,147,418,39942,1194,687,457,6942,21228,1439,5920,23679,238,492,27484,1079,1777,633,211,2559,537,3061,534,0,0,0,2003,760,366,6659,203,1863,824,339,1235,1797,308,822,556,641,120,358,1248,2,66,859,550,3558,177879,19145,0,0,0,0,0,10916,2782,0,0,0,0,0,0,0,0,0,0,0,0,32843,210722 +"493",326,0,11,259,0,627,0,91,103,69,894,371,2031,51,116,73,74,343,153,91,47,128,213,71,281,168,26921,6689,8961,12558,25482,16,2,387,2749,65,23,603,10854,705,190,415,748,0,0,120,0,1,59,493,218,109,832,4,1300,81,225,617,714,145,226,164,88,830,1431,541,150,196,0,3275,109,115886,174,0,0,0,0,0,149,0,0,0,0,0,0,0,0,0,0,0,0,0,323,116209 +"511",52,1,27,0,3,152,366,2,1,7,57,32,18,3,11,101,7,40,7,0,0,4,65,3,48,9,1484,122,147,79,612,5,53,0,17,2,0,155,106,7131,34,500,1178,352,780,139,41,6,250,544,1096,696,2701,1564,994,6,639,1307,741,93,1030,21,41,97,75,597,1364,1011,528,6884,93,36334,65562,0,0,74228,0,1415,39131,-3759,0,0,0,1174,0,0,0,1628,0,0,0,3399,182777,219111 +"512",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,145,193,0,93,3,0,0,1,0,60,5,0,62,20365,34717,7,14,17,0,0,0,55,773,7,12,1500,132,28,0,484,21,7,631,569,88,28,231,887,672,1256,298,18,199,0,63609,25191,0,0,31842,0,113,18413,-5403,0,0,0,0,0,0,0,0,0,0,0,0,70155,133765 +"513",559,41,1636,252,943,1760,5472,270,348,331,1093,903,385,183,554,415,194,771,1066,97,29,349,495,493,1133,668,17060,1373,687,674,7179,305,190,77,1113,387,560,1762,645,2731,338,95208,7170,10232,6989,2713,1043,643,9918,1735,4310,3425,10207,4768,7296,525,2299,4657,3139,898,1090,343,838,2251,4240,3652,5660,3762,1108,35457,1094,292189,300499,0,7111,23686,0,0,17299,-162,0,0,0,0,0,0,0,0,0,0,0,0,348431,640620 +"514",0,0,74,7,15,1375,771,281,387,329,980,892,400,130,247,720,260,524,785,93,37,323,192,79,446,449,3946,1455,1028,884,3982,101,1,0,40,17,22,314,131,2535,97,2550,7090,8106,2858,1220,1253,6,475,6093,2695,1935,10732,4270,11126,509,3549,1134,2481,283,988,342,470,517,2546,4508,10695,3866,571,9338,1494,128049,32975,0,0,13263,0,0,4468,-1023,0,0,0,581,0,0,0,597,0,0,0,1555,52416,180465 +"521CI",1258,111,3106,761,1969,8131,5619,305,930,1084,1742,1546,694,517,1073,631,562,1137,3818,264,114,402,408,642,2033,1333,24478,1806,3119,2748,14602,1062,8243,435,1305,4047,128,900,1034,1776,1041,3232,1476,42570,33539,9213,4257,101734,38605,23726,3715,2763,16311,15069,6756,218,3757,6484,2154,2063,1186,426,1227,1907,3167,15382,198,152,6265,5775,8807,469044,205235,0,0,0,0,0,44709,-46,0,0,0,0,0,0,0,0,0,0,0,0,249897,718942 +"523",269,40,3067,775,3172,661,1524,48,78,1505,2223,1840,155,363,1140,811,582,1326,214,19,6,37,63,95,60,123,2133,96,218,345,765,2124,542,4466,258,477,76,1138,43,387,199,277,125,23293,35516,2330,83796,11,3667,807,894,385,2288,6471,1342,41,656,1122,4092,427,1042,270,74,2130,2423,10013,1,57,158,21905,1147,240225,218952,0,0,0,0,0,65256,-58,0,0,0,0,0,0,0,0,0,0,0,0,284150,524374 +"524",3023,549,5393,905,1740,618,436,146,611,419,679,979,470,582,727,692,292,529,2097,253,125,232,103,197,1591,371,21089,1305,898,747,4205,362,22,427,6872,1345,757,1530,991,417,821,1059,530,5695,11998,340126,4839,4490,29739,3559,2953,788,5241,209,3930,689,1163,6983,34688,1495,2432,1086,920,1144,2561,2091,0,34249,1457,1526,5705,578895,306879,0,0,0,6914,0,16340,-52479,0,0,0,0,0,0,0,0,0,0,0,0,277654,856549 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10427,11877,0,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22325,138088,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138088,160412 +"HS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1773773,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1773773,1773773 +"ORE",29791,79,1291,85,198,3236,11293,454,537,383,3273,1282,2431,350,1197,3784,801,1101,2354,445,79,892,1434,53,2836,1701,60093,9088,13095,9299,64805,379,144,250,3480,537,347,2535,15363,5820,3166,14568,6057,24187,22032,27382,755,3612,100594,10060,21272,4792,37033,19332,12591,1541,31751,43455,29961,22056,15271,6841,10508,5312,43950,40336,3780,8647,1302,36923,4018,869678,5468,15129,0,0,99621,0,3526,0,0,0,0,0,0,0,0,0,0,0,0,0,123744,993422 +"532RL",3261,178,6057,1747,4355,1219,15237,256,800,965,2719,2135,901,657,1779,1578,224,1992,4525,150,115,1027,692,1589,6228,1066,26696,690,1501,2125,7432,8193,3499,378,6970,762,174,1891,1143,2821,2386,10450,6494,6001,6791,4777,34,27,2016,7359,3366,2661,13865,16947,5203,1407,2280,4595,5434,624,457,1179,1331,1838,6910,2112,357,186,1222,5346,448,249830,75668,0,0,0,0,0,74248,0,0,0,0,0,0,0,0,0,0,0,0,0,149916,399746 +"5411",403,108,4445,824,2043,4822,5294,229,317,285,1366,1244,3919,226,1270,3373,202,1310,1042,154,72,359,262,691,3112,678,15604,432,332,847,2854,257,623,115,145,62,190,416,284,3288,624,3113,2707,5756,8818,15458,2231,733,13814,819,2671,4191,11139,8575,5344,359,395,4557,12486,1227,777,1459,1759,1923,2892,2800,1364,293,1909,7855,916,192461,90555,0,0,0,16503,0,12009,-2443,0,0,0,0,0,0,0,0,0,0,0,0,116624,309085 +"5415",354,51,3833,160,47,1783,3654,194,234,328,1233,1314,383,87,391,1609,187,583,868,121,25,236,426,642,941,469,13217,1629,623,819,3647,113,1232,3,292,47,9,155,355,3521,370,4381,7134,8662,8009,2351,846,84,1401,718,4124,5199,12736,15819,6907,199,1516,3966,7218,1051,1007,181,641,656,1722,2217,24051,15179,811,14316,2173,201462,0,0,25801,173996,0,0,16303,-25656,0,0,1368,7004,0,0,0,17911,0,0,853,8621,226200,427662 +"5412OP",1704,722,7569,2506,8903,12079,37486,1435,2107,2967,6686,5167,7547,1274,7633,5662,1825,5636,9063,857,418,2044,1738,3454,11778,4051,96461,10593,6674,7787,41144,712,2435,879,1922,520,1903,1925,1882,19659,8799,43190,20532,59590,41501,20378,4031,301,58893,10620,9785,20671,94249,40357,30670,2345,5052,25257,33088,7436,5489,4651,5455,9457,26219,17919,41840,8421,3024,42972,14276,1063275,57883,0,41474,339162,1577,0,114543,-83286,0,0,0,58543,0,0,0,68143,0,0,0,16850,614890,1678165 +"55",0,0,18864,3090,1718,18,4603,714,1539,941,6358,12027,20543,1028,8791,6147,437,3222,14997,912,583,2168,650,3804,19025,2012,79889,984,3437,20338,22269,459,4,647,5276,305,2,2837,574,7064,572,2665,1393,5527,12196,2162,731,38,1704,5047,7275,5293,18647,67,27959,2448,4568,21097,7347,3557,1980,1796,1507,15871,44388,6263,0,0,680,0,0,481053,0,0,0,0,0,0,3931,0,0,0,0,0,0,0,0,0,0,0,0,0,3931,484984 +"561",628,69,1497,686,1864,12717,6244,604,1238,2900,6919,2690,2481,540,2852,3439,363,1719,3482,335,454,1567,3153,2793,5104,1989,54387,2898,2975,3079,16807,3593,1293,2953,9496,1357,1543,5589,3627,11930,1674,29964,12517,19049,11963,6776,417,1093,65998,16430,9199,24264,46917,6696,34827,2461,3584,25222,34061,6353,3601,2460,2214,5418,8683,10318,14285,1667,3842,25688,5581,633076,49683,0,0,0,0,0,1749,-1149,0,0,0,0,0,0,0,0,0,0,0,0,50282,683358 +"562",244,15,1683,301,447,771,2265,143,257,447,506,277,125,93,249,168,119,218,1530,126,12,346,125,843,2583,376,2610,610,471,268,1558,20,92,29,304,30,18,234,934,122,25,162,72,639,115,1113,685,13,8144,501,125,116,1341,569,1251,7923,552,1557,2015,754,629,86,620,1161,2424,1288,586,310,331,15288,3183,75145,23606,0,0,0,0,0,62,-137,0,0,0,0,0,0,0,0,0,0,0,0,23532,98677 +"61",15,5,0,0,0,280,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,36,0,3,2455,25,1082,0,3906,189,47,0,0,0,15,22,0,0,0,87,231,32,13,0,0,0,0,0,0,67,78,0,837,0,4268,1,16,0,0,1425,243,0,0,3006,1760,61,152,14493,13,34973,308820,0,0,0,0,0,2574,-1437,0,0,0,0,0,0,0,0,0,0,0,0,309957,344929 +"621",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,0,90,0,0,14550,13797,97,5,104,2,0,0,111,0,563,0,7064,0,36439,861672,0,0,0,0,0,82,0,0,0,0,0,0,0,0,0,0,0,0,0,861754,898194 +"622",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3110,0,0,0,0,0,0,0,0,0,0,0,0,3110,885194,0,0,0,0,0,948,-2586,0,0,0,0,0,0,0,0,0,0,0,0,883556,886666 +"623",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2026,0,823,0,2849,211522,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,211522,214371 +"624",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,205,0,205,173727,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,173727,173932 +"711AS",58,2,1,0,29,165,105,34,37,60,99,75,7,7,39,31,21,58,137,12,3,42,45,80,53,91,1786,322,484,41,391,31,244,0,29,6,0,210,67,202,5710,21271,273,1193,635,267,233,1,3524,285,596,379,3336,2441,1253,60,1181,529,568,176,193,14493,645,307,1428,1959,1276,38,88,955,15,70413,63762,0,0,4043,0,0,1488,-1004,0,0,0,0,0,0,0,0,0,0,0,0,68289,138702 +"713",22,0,0,1,23,41,66,8,12,13,33,22,3,1,11,10,8,21,32,1,0,10,16,12,18,22,297,3,38,1,283,0,0,0,0,0,0,2,2,32,11,61,116,260,178,70,25,1,300,43,112,132,328,465,352,20,58,205,10,29,40,99,7,274,277,40,210,2,1,506,217,5515,169162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169162,174678 +"721",2,0,7,19,352,990,409,137,206,213,545,391,59,43,188,155,137,358,531,39,12,158,342,195,327,411,1911,15,70,32,185,0,19,0,0,0,7,458,153,584,218,1110,2129,4741,3281,1225,462,26,5499,1139,1617,2294,4851,642,3955,461,602,2475,194,309,350,102,118,383,1193,619,1242,560,124,2466,160,54204,129680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,129680,183884 +"722",509,48,55,55,670,1986,446,207,270,342,692,537,110,76,258,209,167,443,847,74,21,244,309,466,436,489,5170,602,888,695,2883,7970,6,14,337,58,37,1137,201,577,384,1179,2106,7582,3659,2908,1189,1014,17625,1890,3077,3192,13234,2753,9210,454,2041,14631,9793,8378,1895,481,1198,6190,3339,2583,492,182,1440,10364,491,165492,591923,0,0,0,0,0,2585,0,0,0,0,0,0,0,0,0,0,0,0,0,594508,760000 +"81",345,386,254,131,842,757,5843,329,682,1278,1380,844,489,207,854,520,163,426,2064,172,16,1272,447,1082,3133,952,24345,1363,2488,1651,6713,342,158,53,11455,731,715,2516,1236,1128,225,3963,1849,7619,3156,5433,867,58,6155,8976,1405,803,7463,4319,7782,2319,1395,5439,16208,1707,853,724,1413,1984,8538,7973,3462,363,1611,17503,1747,213075,521276,0,0,0,0,0,324,-3353,0,0,0,0,0,0,0,0,0,0,0,0,518247,731321 +"GFGD",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,611205,0,0,0,0,0,0,0,0,0,0,0,611205,611205 +"GFGN",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,346307,0,0,0,0,0,0,0,346307,346307 +"GFE",18,5,0,9,0,276,10,0,0,13,49,517,5,290,0,0,0,48,0,2,0,0,103,132,101,0,18166,486,485,325,3531,3,0,1935,2325,119,85,789,424,776,302,287,1222,2970,10685,278,0,0,286,865,459,206,2435,175,1130,116,679,846,1662,306,424,144,83,1006,3269,1322,0,174,3,1623,169,64158,7158,0,0,0,0,0,380,-455,0,0,0,0,0,0,0,0,0,0,0,0,7083,71241 +"GSLG",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1575132,0,0,0,1575132,1575132 +"GSLE",0,5,0,0,0,3169,0,49,107,200,192,111,66,46,110,53,34,81,709,60,7,155,43,374,1324,134,953,191,228,116,674,1,0,0,74,3,7,71,455,69,29,92,58,405,157,70,0,0,571,835,507,144,1323,274,930,77,91,479,639,267,2119,37,187,558,1163,632,527,366,255,4054,758,27479,61965,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,61965,89444 +"Used",-43,87,0,-28,178,3456,1152,0,44,21392,229,3,0,0,0,0,0,92,0,13,0,1802,0,0,27,28,0,17,0,0,233,-478,0,-68,491,1,210,2232,1,0,135,1,0,0,0,0,0,0,0,-31,0,0,0,197,0,0,567,2,0,0,0,-106,523,0,0,5564,-31,0,0,0,0,37889,59657,-2146,-105324,0,-699,5210,29082,-15341,0,-4,0,0,0,-493,-20,0,0,3239,-3263,0,-30102,7786 +"Other",972,60,1150,59,400,1185,1934,205,208,686,742,1274,1183,354,1632,669,129,472,2324,104,25,487,243,2245,2457,598,5379,50,534,616,2548,13958,220,2931,1106,14,48,432,89,910,363,10189,744,3202,24186,1473,174,1329,2751,825,371,1172,2779,1327,1382,100,571,0,0,266,0,235,229,715,1623,473,12265,3179,953,0,0,123505,-90166,0,0,6372,0,0,178601,-215305,0,0,0,0,0,0,0,0,0,0,0,0,-120498,3008 +"Total Intermediate",253671,18287,170384,52215,53085,204748,567016,60036,59074,200777,208663,238443,107943,65433,442542,172784,43258,86968,691555,37249,9331,127364,44323,682448,509383,155355,692547,63430,74658,81343,310014,107038,41422,34179,176307,17604,11776,97878,65580,97988,52167,346465,109481,278012,269146,464658,126115,191189,531086,134431,89778,103578,416625,179365,243813,41803,102141,280476,326978,84817,71227,44973,51325,89081,301750,227829,237500,108542,47801,638942,181725,13506920,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V001",28555,20311,36431,18562,38530,72778,387955,17711,24080,30869,91191,88681,128136,33017,59315,73897,17894,47204,94371,11490,8194,29352,25433,18595,92365,40030,467636,98036,85381,84626,258620,43077,21618,6866,82494,17691,6170,68990,36449,99472,29729,112087,45186,218966,202593,219180,585,15639,72273,31004,117227,197383,486882,274980,329190,24497,165202,453291,338011,115991,89983,46181,43514,69641,226124,257867,239563,160242,55337,1197762,95452,8843638,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V002",-380,1714,33148,6265,2207,58947,7906,686,1296,2362,3509,3422,7630,732,3073,2330,387,3045,31128,597,280,1745,770,3424,15468,1871,202170,40623,22166,38765,103576,19313,57,698,4088,1697,2681,2143,684,3723,6652,33451,2969,16267,4897,25938,787,200637,21373,17210,13323,5067,12344,8401,8155,3248,8185,8076,8912,5420,1740,7538,10452,24121,42536,19869,0,0,-7152,0,-17420,1128942,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V003",155086,8999,186409,37512,28688,155189,192823,12145,21852,29228,47189,66432,108856,24356,60707,57177,5760,30320,102953,4679,1746,25354,12804,129290,213637,27230,372441,33759,28464,11976,144583,31844,19315,8904,44494,18604,18141,25922,10164,107620,46647,260309,83511,273042,41996,140954,11248,1373829,338629,134921,88851,52757,236905,36249,109156,15532,44250,132908,59011,7664,9760,50827,19262,43120,68970,78923,160538,98065,-2787,183158,49749,6870613,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"Total Value Added",183261,31024,255989,62339,69426,286914,588684,30542,47229,62460,141889,158534,244623,58104,123096,133405,24040,80569,228453,16766,10221,56451,39007,151309,321470,69131,1042247,172419,136011,135367,506779,94234,40989,16468,131077,37993,26992,97055,47298,210815,83028,405847,131666,508275,249487,386072,12620,1590104,432275,183135,219401,255207,736131,319630,446501,43277,217637,594276,405933,129075,101482,104546,73228,136881,337630,356659,400101,258307,45398,1380921,127782,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16843193,0 +"Total Industry Output",436933,49312,426372,114553,122511,491663,1155700,90579,106304,263236,350553,396978,352567,123537,565638,306188,67298,167538,920008,54016,19552,183815,83330,833756,830853,224486,1734795,235849,210668,216710,816793,201273,82412,50646,307384,55597,38768,194933,112877,308803,135195,752312,241147,786287,518632,850730,138735,1781293,963360,317567,309179,358785,1152756,498995,690314,85080,319778,874752,732911,213892,172710,149519,124552,225962,639380,584488,637602,366848,93199,2019862,309506,0,11363526,492521,1027048,691925,509988,104531,2037816,-2517210,611205,6525,78827,67664,346307,11605,16246,88781,1575132,259341,39939,31474,0,30350112 diff --git a/flowsa/data/external_data/BEA_Summary_Use_2014_PRO_BeforeRedef.csv b/flowsa/data/external_data/BEA_Summary_Use_2014_PRO_BeforeRedef.csv new file mode 100644 index 000000000..3c7e9ecb3 --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Use_2014_PRO_BeforeRedef.csv @@ -0,0 +1,80 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","Total Intermediate","F010","F02S","F02E","F02N","F02R","F030","F040","F050","F06C","F06S","F06E","F06N","F07C","F07S","F07E","F07N","F10C","F10S","F10E","F10N","Total Final Uses (GDP)","Total Commodity Output" +"111CA",62872,815,0,54,41,0,1851,0,0,0,0,0,0,0,0,0,0,296,256575,2586,0,0,0,0,9918,0,1690,333,826,180,264,0,0,0,0,0,0,105,0,0,0,0,0,1,0,0,0,0,3,0,2,1,698,26,783,0,142,0,0,0,0,0,383,51,1886,35,5,-402,0,2385,0,344406,74978,0,0,0,0,-2068,56142,-38792,0,0,0,0,0,0,0,0,0,0,0,0,90261,434667 +"113FF",24811,7577,0,94,0,0,0,11311,2,0,0,0,0,0,0,0,35,191,7452,0,43,4395,38,8,570,1905,0,0,837,0,3,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,241,12,1,0,79,0,0,0,0,0,180,515,3732,189,0,107,16,3646,0,67993,6726,0,0,0,0,745,7019,-17997,0,0,0,0,0,0,0,0,0,0,0,0,-3506,64487 +"211",0,0,49701,2,0,42436,0,0,0,73,0,0,0,0,0,0,0,0,0,0,0,0,0,502842,12607,0,4,1,1,0,2,0,0,0,0,0,83,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,5,0,1,1,1,3,1,0,0,1,3,6,2,0,0,1441,0,22153,631374,0,0,0,0,0,897,24482,-277002,0,0,0,0,0,0,0,0,0,0,0,0,-251623,379751 +"212",1984,2,111,6407,82,12440,12646,8,9079,15189,418,150,5,101,65,113,19,184,1362,75,0,1437,0,2077,5017,105,20,0,0,0,2,0,134,0,5,1,0,3,3,25,14,147,310,0,0,0,0,15,0,0,0,0,759,49,343,53,223,0,62,24,48,182,479,57,347,600,0,988,0,1947,6318,82232,188,0,330,0,0,1142,13682,-1016,0,0,0,0,0,0,0,0,0,0,0,0,14325,96557 +"213",0,0,14313,1879,1343,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17572,0,188319,4353,0,0,6,3974,-1268,0,0,0,0,0,0,0,0,0,0,0,0,195384,212957 +"22",5896,221,7360,4670,281,34977,4849,1947,3966,8729,4974,2248,1234,942,3141,1345,570,1103,10201,1481,63,6476,1356,7566,19083,5440,17904,3268,8895,5380,16262,127,139,113,1254,112,1329,981,13341,934,342,4108,1381,2504,1317,450,2120,10,78505,2060,630,332,4512,9223,2726,499,7410,3206,10073,2484,1185,708,2594,6904,19952,4993,1786,691,1520,20390,2005,406776,269401,0,0,0,0,0,4018,-2992,0,0,0,0,0,0,0,0,0,0,0,0,270427,677203 +"23",1821,48,2645,2157,2926,8494,213,172,344,605,615,423,142,128,441,177,80,165,1030,84,9,638,194,6636,1686,495,2092,473,470,468,2101,306,2203,37,313,249,1570,1796,805,92,29,2236,130,4076,1485,376,333,68964,59749,306,108,29,665,482,383,37,635,336,801,249,216,180,343,780,1390,3529,7540,1644,1258,27652,44272,275561,0,373580,0,0,416976,0,98,0,0,5259,0,0,0,12222,0,0,0,263074,0,0,1071209,1346770 +"321",315,63,0,85,166,0,33743,20969,373,348,233,1075,306,195,3469,329,5979,1107,373,43,2,5019,4,0,249,1447,2780,84,496,96,796,0,1590,0,81,0,11,101,197,99,85,791,1343,68,5,6,0,48,4877,598,13,17,653,2,714,17,45,233,221,4,904,4,145,461,844,445,12,19,3,3299,125,98224,4140,267,0,0,3631,1461,5811,-17828,0,0,0,0,0,0,128,0,0,0,0,0,-2390,95834 +"327",5,89,1103,421,934,68,50498,823,12034,2521,1226,2585,257,1728,6684,369,327,812,5049,127,0,403,2,593,2420,1742,254,204,70,174,667,0,15,0,42,0,2,52,167,7,2,2620,724,54,49,6,0,46,103,616,5,106,3032,60,1025,99,106,1831,1639,186,221,9,131,103,1717,1132,28,277,0,1470,1583,113453,9990,0,0,0,0,1113,9202,-24117,0,0,0,0,0,0,0,0,0,0,0,0,-3812,109641 +"331",110,0,6446,662,773,3,4101,386,743,77726,75805,36486,4025,17370,46214,10880,3404,6585,6162,271,0,484,33,19,55,1578,1213,4,0,0,907,0,1357,0,0,0,0,390,0,25,12,227,374,0,0,1,0,1,1895,135,0,11,1287,33,422,480,154,146,47,17,240,17,272,19,76,511,65,192,0,267,315,311434,483,0,0,0,0,4244,34889,-89114,0,0,0,0,0,0,0,0,0,0,0,0,-49498,261935 +"332",1772,196,6468,1354,1780,449,65924,2406,2831,5436,39303,29422,5091,8672,41353,13555,2872,5595,15092,653,106,5527,1437,304,10788,7629,2472,372,148,133,1450,271,449,1576,965,147,1129,992,567,1389,21,11016,1562,137,161,2,17,39,1583,1794,30,1526,4307,727,2398,2325,371,309,562,22,1298,27,668,767,2331,3834,3901,1186,883,4143,2855,338874,15573,0,13228,0,0,5039,35668,-63953,0,0,1423,0,0,0,769,0,0,0,519,0,8266,347141 +"333",3663,265,9033,4129,5734,713,25919,495,148,1280,4078,35646,259,1471,23978,4655,68,1111,3657,28,10,979,1073,85,4034,1683,2387,197,120,122,730,7,272,23,215,159,181,2439,659,135,40,2359,734,10,51,81,0,18,90,1717,28,965,2064,287,2335,3253,1299,463,422,161,102,23,87,73,585,5416,584,117,135,3645,1119,170101,6786,0,244483,0,0,6449,115923,-155366,0,0,777,0,0,0,309,0,0,0,4522,0,223882,393982 +"334",107,1,35,30,420,81,5263,771,943,1941,4726,9255,28303,4599,19687,16265,906,2591,2620,540,52,877,1307,206,5334,2357,10026,562,304,276,2688,5,178,3,175,4,19,148,259,3069,711,15722,3994,464,921,23,628,91,468,356,1461,5607,7134,6739,3360,843,583,6245,431,167,301,14,93,259,83,4575,15558,2133,1,1632,1471,208997,80671,0,185538,0,284,1560,104704,-318936,0,0,15335,0,0,0,7071,0,0,0,6829,0,83057,292054 +"335",1523,209,173,66,506,23,30873,670,126,1986,2476,14221,2220,9094,6613,2941,81,1216,890,49,3,433,106,60,1068,1315,505,179,34,261,312,2,143,27,36,94,7,31,474,2,0,4423,385,96,57,5,0,15,881,408,1,1322,4488,153,2070,744,472,28,414,610,422,45,285,495,539,2106,803,1267,52,1563,1950,107148,37099,0,27663,0,4673,1833,32069,-90331,0,0,411,0,0,0,575,0,0,0,836,0,14828,121976 +"3361MV",1041,130,954,1045,597,39,2055,632,558,752,1281,16862,438,411,198424,3680,313,603,2674,80,0,1078,208,99,1454,555,6173,5449,1067,266,3450,0,57,0,3834,272,2,142,3301,441,61,1483,195,44,21,0,0,0,0,1657,0,28,2906,631,6214,1378,327,316,586,92,1265,76,59,126,495,13329,4056,65,1933,4982,654,303396,219547,0,240243,0,0,10114,110813,-302693,0,0,9286,0,0,0,1968,0,0,0,19622,0,308900,612296 +"3364OT",0,18,0,56,0,0,7,28,0,0,40,216,0,0,383,75683,0,0,0,0,0,0,0,0,0,0,20,14,0,0,0,1371,1730,1605,12,12,0,1439,0,0,0,4,0,0,0,0,0,0,0,0,0,0,267,5,32,25,0,0,0,0,2,0,23,0,0,92,28730,446,7,0,143,112410,17933,0,66133,0,0,3769,120074,-58460,0,0,36071,0,0,0,2515,0,0,0,678,0,188714,301123 +"337",1,0,0,0,0,0,14310,1158,0,0,0,490,79,3,47,237,3579,294,0,0,0,0,0,0,0,414,368,189,0,3,1043,0,0,2,0,0,0,10,0,1,0,225,368,0,0,0,0,2417,47,0,13,1,261,9,2,0,0,295,63,1,95,101,287,4,286,190,0,0,1261,8,81,28240,40529,0,26627,0,443,1184,3841,-35462,0,0,0,0,0,0,106,0,0,0,1144,0,38412,66653 +"339",235,5,34,37,32,0,900,25,181,61,54,2539,3,714,1723,75,18,6658,30,131,118,0,6,5,641,112,1174,131,95,8,1093,0,2,0,6,17,1,233,288,8,3,169,122,161,50,13,0,0,333,115,65,67,1692,19,1504,437,431,15744,16553,921,1216,127,545,59,598,1672,139,200,0,6237,103,66687,84249,0,45166,0,0,2457,31099,-81016,0,0,42,0,0,0,110,0,0,0,546,0,82653,149340 +"311FT",33578,429,0,0,0,0,0,30,203,9,0,0,0,0,0,0,0,7,183927,14,940,1226,770,235,5484,148,2317,5,3075,853,1400,393,2,367,18,0,0,46,0,48,9,0,72,0,0,0,0,0,0,0,0,0,5028,108,0,0,7232,17,9472,6671,8549,598,4794,7649,53680,2621,2789,25,830,49963,0,395631,569883,0,0,0,0,5360,69596,-84259,0,0,0,0,0,0,0,0,0,0,0,0,560580,956211 +"313TT",282,138,0,5,0,0,1681,539,385,0,0,1210,1,0,4216,958,2997,2495,195,9536,1543,3187,405,40,5,2694,2044,74,149,2202,2322,0,0,200,13,0,5,103,6,11,116,14,13,0,0,0,0,1,161,314,0,0,267,6,124,82,47,52,649,1962,887,0,374,1752,246,1302,1010,220,4,2193,34,51467,20712,0,905,0,338,1038,9309,-30865,0,0,0,0,0,0,46,0,0,0,8,0,1492,52959 +"315AL",36,0,0,0,0,2,0,0,1,0,0,0,0,0,2166,0,0,53,11,689,2065,0,1540,12,0,2,756,201,12,291,780,0,0,0,0,0,0,0,0,32,25,1703,6,0,0,0,0,0,0,129,0,0,43,16,265,85,115,194,202,0,1208,133,37,20,171,2026,128,31,50,3821,36,19096,141623,0,0,0,0,2139,4535,-147556,0,0,0,0,0,0,0,0,0,0,0,0,741,19837 +"322",395,0,91,243,118,45,2144,553,1308,1523,2472,2109,496,1072,2717,732,1013,2170,23977,465,34,43229,6368,156,8032,4881,5676,94,1192,308,1553,34,67,11,163,1093,96,3289,557,2200,111,568,228,1127,535,121,2,1,960,760,502,337,3296,710,3724,290,229,1791,3498,1466,792,86,146,1956,2449,1162,116,1320,66,12100,37,163165,20714,0,0,0,0,1178,22302,-23936,0,0,0,0,0,0,0,0,0,0,0,0,20258,183423 +"323",31,0,10,4,0,3,32,26,0,0,1,11,0,2,4,0,0,0,182,0,15,0,1638,7,1176,0,8899,126,209,143,3455,4,17,0,175,43,9,410,10,6562,626,620,3387,797,1886,1403,0,0,67,400,787,220,4878,781,2388,13,871,1565,1813,140,1327,669,160,738,538,1710,560,871,74,9281,540,62314,5128,0,0,0,0,829,2260,-2449,0,0,0,0,0,0,0,0,0,0,0,0,5768,68082 +"324",9196,984,7764,5845,4870,25611,46234,1042,870,2747,905,2260,149,1585,598,425,310,790,3569,151,14,1693,2701,25796,15951,1526,5922,786,605,158,2098,40163,8629,5993,50578,3215,98,12578,340,351,78,632,417,6077,3967,34,875,23,4793,2799,42,606,2000,1616,4213,1959,879,981,5207,845,612,153,880,1349,3212,3656,16077,709,3940,89235,18919,471885,259205,0,0,0,0,5405,122340,-93300,0,0,0,0,0,0,0,0,0,0,0,0,293650,765534 +"325",25453,3228,7677,3364,2672,2465,10450,2438,3774,1826,8445,4413,2185,2817,8617,1601,1610,6635,6494,11245,151,12792,6044,7036,236779,66494,2403,93,57,44,819,2,301,10,186,6,6,121,643,860,146,603,793,89,121,12,0,96,11435,552,179,172,10363,1530,6638,1114,576,22494,21352,2170,473,130,517,98,444,4368,1305,1585,161,26968,2764,571505,255892,0,3123,0,0,4154,153293,-192696,0,0,0,0,0,0,0,0,0,0,0,0,223766,795271 +"326",1382,140,116,1473,1543,27,24219,713,1327,918,2636,8233,1325,1784,25059,3491,4010,6081,18638,372,63,3076,607,210,13847,20610,10997,1127,1560,283,3877,27,8,1,722,20,209,4461,607,587,97,5471,414,179,138,178,0,25,297,2201,87,826,5493,199,1964,366,546,6001,2766,1151,960,25,180,142,4919,4219,1472,412,41,8654,1782,217592,30368,0,168,0,19,2432,26336,-49336,0,0,0,0,0,0,21,0,0,0,0,0,10008,227600 +"42",39483,3726,6662,4473,3823,7089,61453,8509,5155,24817,17982,29483,8825,9297,57983,12442,5276,9998,63888,3272,1764,12491,3500,17881,50572,15192,49982,2888,1993,2024,14593,4179,2852,1851,15345,1113,330,6141,2163,4806,289,14048,2362,2133,1895,290,433,374,4519,11184,1054,2514,13462,3804,8198,2392,3219,18764,18919,3634,3755,457,2928,3770,16694,11971,11257,2345,2025,36436,7196,807615,517874,34,195203,20637,2272,13145,192542,37363,0,0,9530,395,0,0,3593,529,0,0,6691,1223,1001028,1808644 +"441",7,2,102,151,115,12,1472,95,131,105,199,2036,35,1,1494,514,64,155,617,19,0,233,47,1,375,105,144,1294,261,63,792,0,7,0,569,3,0,7,109,95,14,54,4,11,5,4,0,31,277,359,0,6,423,0,909,30,0,0,0,0,0,1,7,18,39,2902,0,0,0,0,1,16528,140486,0,19189,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,159682,176210 +"445",44,0,1,0,0,67,163,0,3,0,1,4,0,1,11,0,5,8,12,0,0,2,29,2,39,2,26,10,73,17,80,0,6,2,493,29,1,34,0,2,1,0,6,6,10,1,0,43,56,6,1,2,14,0,96,1,26,11,14,2,2,13,48,91,2252,35,0,0,0,62,0,3964,194590,0,170,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,194771,198735 +"452",69,1,14,12,7,101,1786,8,13,8,26,162,6,13,173,31,58,99,160,81,0,34,262,8,251,22,161,156,76,17,185,1,9,2,731,41,4,49,7,20,5,6,35,35,59,4,0,466,229,42,10,9,114,0,299,5,92,62,37,6,15,8,25,206,979,414,0,3,0,69,0,8102,197103,0,3283,318,440,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,201144,209246 +"4A0",746,15,79,135,13,1309,68710,80,18,23,146,577,37,110,839,58,482,799,1142,377,0,200,1028,160,2853,116,690,1188,511,367,1591,5,98,335,9071,466,17,723,19,76,19,25,138,141,235,15,0,4052,1005,128,66,38,459,0,1215,15,199,328,179,72,67,154,425,999,9545,2053,2,34,0,620,0,117436,673130,0,32182,5581,5062,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,715956,833392 +"481",157,2,19,42,826,1236,495,256,393,375,882,690,99,73,457,325,223,389,1044,72,19,276,377,212,673,633,6456,110,41,67,202,141,28,125,1469,11,3,1355,58,728,316,1380,1709,3807,5167,360,494,65,6660,1200,1378,2428,5085,392,5409,486,745,2731,321,439,518,141,199,345,1134,842,5226,1842,294,3945,79,76174,125923,0,326,32,3,21,48513,-42483,0,0,22,1,0,0,6,1,0,0,10,2,132376,208550 +"482",2065,93,610,1631,221,5693,1999,819,2756,4549,1039,573,79,384,1283,332,264,255,6455,90,5,2619,168,4092,5683,1573,361,29,102,30,98,117,198,20,4452,21,4,420,57,58,5,407,41,61,43,81,3,12,220,71,49,31,711,41,389,48,65,315,218,82,108,9,64,128,527,172,180,507,492,1854,2844,61072,8029,0,2973,0,29,548,12586,414,0,0,374,0,0,0,41,0,0,0,341,0,25334,86407 +"483",562,40,368,285,124,515,1186,9,328,700,154,81,29,106,87,51,18,63,1220,44,0,188,3,88,1011,239,51,13,15,4,21,27,18,4,35,2,3,12,1,1,0,37,7,5,3,0,1,3,65,15,0,8,579,51,101,22,169,154,131,14,14,4,11,11,48,45,1493,111,878,659,283,12627,19795,0,12,0,0,81,7461,13219,0,0,2,0,0,0,0,0,0,0,0,0,40570,53197 +"484",6710,593,1301,909,772,3173,17598,2065,2830,7343,4174,4648,1143,1525,7975,2281,1294,1634,27020,948,210,3442,746,8504,7754,2928,4421,1609,1490,1596,4714,1091,407,258,5805,138,57,3248,249,760,263,1490,685,251,229,89,25,125,876,510,162,323,2755,422,1422,377,500,1337,1587,531,745,178,973,587,2288,1948,1769,381,692,6187,1092,176160,82514,12,23585,672,631,2166,34399,4510,0,0,673,13,0,0,178,17,0,0,658,40,150068,326228 +"485",0,4,3,9,221,671,483,72,105,106,251,201,24,18,116,82,62,140,247,14,5,76,104,60,173,165,784,44,6,15,75,1,523,0,0,0,1,222,8,224,84,710,746,1624,1599,476,140,74,2357,498,667,927,3301,138,2188,133,313,1362,1169,582,131,1369,54,128,455,271,21,2,29,12305,347,39511,38502,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38502,78013 +"486",116,11,9228,55,37,10693,263,6,7,12,7,19,1,4,3,3,2,5,22,3,0,16,25,10761,412,14,55,7,5,1,18,373,80,56,469,30,2,116,3,3,1,4,4,56,37,0,8,0,39,25,0,6,13,15,41,17,8,8,48,7,5,1,8,12,28,32,149,7,388,805,5630,40348,2371,0,0,0,0,156,3055,0,0,0,0,0,0,0,0,0,0,0,0,0,5582,45930 +"487OS",0,236,35,947,16,6815,0,722,933,140,107,17,0,3,8,0,545,218,494,80,0,401,333,726,158,505,40739,1309,704,453,7696,21215,1547,6185,28493,268,454,31559,1053,1758,671,250,2355,471,3792,212,0,0,0,2113,732,382,6948,226,2002,908,320,1274,1709,298,784,560,750,132,359,1270,2,47,810,539,3792,190584,20300,0,0,0,0,0,10526,3083,0,0,0,0,0,0,0,0,0,0,0,0,33909,224492 +"493",361,0,11,303,0,703,0,94,97,66,896,382,1590,58,113,66,66,308,142,77,38,123,195,21,317,171,27526,7687,9273,12138,26873,14,3,507,3345,81,17,677,10870,705,204,507,693,0,0,48,0,2,63,529,212,117,872,4,1593,79,219,636,689,141,220,159,86,888,1456,533,124,155,0,3330,101,119573,196,0,0,0,0,0,153,0,0,0,0,0,0,0,0,0,0,0,0,0,349,119922 +"511",61,2,28,0,4,181,422,2,1,7,45,36,14,3,15,98,7,36,7,0,0,3,61,2,58,10,1606,148,145,86,655,4,65,0,21,3,0,182,108,8436,38,611,1127,318,983,95,33,8,274,579,1105,765,3045,1735,1238,6,626,1494,745,96,1006,21,42,112,78,651,1254,831,456,7274,93,39304,68879,0,0,80456,0,1726,36838,-4129,0,0,0,1354,0,0,0,1814,0,0,0,4200,191139,230443 +"512",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,148,172,0,99,2,0,0,1,0,33,4,0,49,19157,36425,5,10,17,0,0,0,46,558,5,10,1430,122,24,0,655,18,5,491,446,73,27,366,896,621,870,238,14,224,0,63291,25334,0,0,33045,0,83,19648,-6123,0,0,0,0,0,0,0,0,0,0,0,0,71988,135279 +"513",700,54,1553,286,1283,1918,6223,262,360,335,1068,950,333,190,476,447,186,640,1065,93,27,341,461,314,1360,661,17986,1604,731,657,7938,280,208,97,1382,487,364,1869,645,2782,376,104662,6116,9244,8386,2282,879,743,11114,1915,4380,3764,11090,5231,8974,518,2210,5063,3091,903,1073,337,846,2388,4537,3729,4916,3098,949,36261,991,308681,315548,0,7120,25221,0,0,16915,-170,0,0,0,0,0,0,0,0,0,0,0,0,364635,673316 +"514",0,0,85,11,21,1869,906,335,452,375,1043,1009,328,150,274,772,269,486,840,93,33,346,182,50,536,487,4225,1766,1120,932,4447,95,2,0,51,25,17,373,137,2435,111,3241,7390,7431,3561,965,1054,9,534,6993,2786,2201,11992,4868,13979,525,3629,1279,2583,295,1034,367,486,620,2752,4880,10138,3285,531,10246,1555,137896,35459,0,0,11348,0,0,4995,-1211,0,0,0,526,0,0,0,523,0,0,0,1482,53121,191017 +"521CI",1438,132,2695,827,2761,9864,6353,318,977,1155,1690,1583,600,453,1188,679,509,981,3591,251,92,364,361,399,2214,1371,24307,1940,3161,2928,14989,839,8912,551,1618,5008,96,978,1010,1806,1107,3801,1407,37724,39739,6986,3412,104408,42407,25390,3583,2939,17296,15899,7723,217,3451,6972,1971,2047,1180,412,1199,1959,3097,15940,195,150,5661,5531,8728,483522,214539,0,0,0,0,0,48284,-48,0,0,0,0,0,0,0,0,0,0,0,0,262774,746297 +"523",330,50,3199,704,3487,845,1823,48,89,1503,2044,1845,126,339,1259,829,519,1068,222,20,5,37,61,64,69,133,2301,115,238,376,836,1753,789,5387,330,618,57,1205,44,393,225,350,121,25302,48234,2425,84522,25,4209,956,897,421,2568,7275,1549,42,690,1244,4950,443,1304,251,78,2439,2624,11859,5,96,156,22349,1170,263942,226723,0,0,0,0,0,71815,-61,0,0,0,0,0,0,0,0,0,0,0,0,298478,562420 +"524",2843,943,6671,2075,3494,1064,521,231,932,680,943,1472,443,825,1323,1096,390,697,3104,341,152,302,113,190,2638,575,25378,1780,1111,983,5554,348,39,464,7844,1747,801,1827,1327,495,1152,1639,595,6155,16624,341359,5655,5999,35616,4396,3301,994,6564,258,5336,774,1520,7535,41307,1618,3038,1289,1089,1473,2966,2581,0,42847,1285,1778,7913,638409,337524,0,0,0,8029,0,16851,-52210,0,0,0,0,0,0,0,0,0,0,0,0,310194,948603 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10181,14060,0,0,0,0,0,0,52,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24292,143990,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,143990,168282 +"HS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1826641,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1826641,1826641 +"ORE",33279,115,1366,97,275,3860,13583,479,563,368,3363,1314,2667,373,1318,3769,797,1051,2449,478,70,918,1330,36,3023,1772,66598,10583,14537,10070,71527,425,186,267,4247,597,336,2922,16246,6299,3682,17313,6361,22564,25884,28436,516,4068,104863,11071,22553,5207,39731,22288,13408,1538,32816,47428,32188,23357,15888,7231,11041,6060,48003,44139,3989,9485,1412,37614,3866,937552,5398,17424,0,0,97915,0,3327,0,0,0,0,0,0,0,0,0,0,0,0,0,124064,1061616 +"532RL",3839,242,6298,2015,6085,1417,17015,276,870,1076,2751,2278,797,675,2036,1733,220,1725,4623,158,95,1029,603,1128,6778,1076,27769,818,1575,2243,8019,8560,3678,415,8523,913,168,2185,1188,2838,2711,12507,6189,5433,8204,4794,26,35,2163,8036,3429,2628,14758,18588,5783,1450,2317,4877,6184,670,473,1250,1379,2076,7062,2247,331,174,1058,5200,425,268188,82821,0,0,0,0,0,77899,0,0,0,0,0,0,0,0,0,0,0,0,0,160720,428908 +"5411",467,138,5047,928,2845,5904,5730,245,334,286,1373,1249,3628,232,1289,3142,194,1125,1012,144,59,344,229,410,3287,682,15730,488,337,838,3087,225,715,138,172,84,136,463,272,3199,669,3685,2604,4859,10419,13838,1658,805,14821,860,2545,4443,11428,9058,6271,349,368,4704,11918,1189,775,1444,1764,2014,2944,2896,1192,229,1810,7964,832,196564,93302,0,0,0,18234,0,12324,-2663,0,0,0,0,0,0,0,0,0,0,0,0,121197,317760 +"5415",415,72,5192,263,71,2214,4259,236,280,360,1343,1679,404,110,438,1785,200,560,931,123,26,250,417,464,1209,525,14519,2025,698,897,4126,108,1581,4,375,70,7,182,375,4209,432,5512,7010,7894,10283,2054,713,109,1605,819,4185,5791,14059,18325,8463,209,1469,4487,7453,1113,1056,188,685,786,1889,2451,23336,13276,783,15926,2292,217660,0,0,22119,181395,0,0,18654,-28234,0,0,794,7072,0,0,0,18413,0,0,310,8310,228833,446494 +"5412OP",2204,926,7935,3008,12746,14859,43951,1635,2332,3157,6791,5583,7243,1381,4475,5857,1787,5172,12819,843,369,2097,1611,2225,13274,4352,100709,12153,6915,7552,44683,719,2988,1108,2367,700,1452,2188,1919,20454,9995,51831,21461,58109,51011,18624,2853,386,67836,11532,10023,22959,101836,44112,36095,2396,5010,27510,33812,7653,5541,4777,5674,10525,26621,19061,38812,7049,2944,45623,14324,1140536,62204,0,37928,360753,1948,0,122733,-90286,0,0,0,55390,0,0,0,68320,0,0,0,17585,636573,1777109 +"55",0,0,19755,3703,2454,20,5419,769,1513,934,6649,12940,17064,1224,9068,5942,407,3019,14371,756,489,2162,615,1186,22693,2132,84310,1170,3654,20907,23447,428,7,830,6641,439,4,3297,591,7303,644,3293,1422,4874,15690,1953,603,50,1893,5620,7254,5844,20319,58,36340,2469,4715,23153,7541,3633,2005,1852,1536,17820,46960,6117,0,0,648,0,0,512619,0,0,0,0,0,0,4011,0,0,0,0,0,0,0,0,0,0,0,0,0,4011,516630 +"561",759,93,1584,861,2729,14060,7570,681,1331,3285,7298,2810,2454,590,3239,4103,377,1519,3845,370,365,1697,2947,1618,5619,2168,59551,3573,3248,3310,19777,3026,1583,3903,10955,1778,1383,6611,4118,12327,2124,35450,15699,18922,14200,5933,330,1548,74044,18217,9401,25582,50057,7538,40517,2713,3823,28168,38451,7057,4070,2665,2277,6524,9649,11019,13500,1392,3740,28004,5614,697340,53054,0,0,0,0,0,1824,-1348,0,0,0,0,0,0,0,0,0,0,0,0,53530,750871 +"562",305,19,1900,352,624,942,2573,146,279,477,518,290,111,97,246,188,119,192,1580,126,11,370,116,587,2748,391,2780,718,512,284,1712,18,110,37,353,41,14,276,970,128,28,199,68,585,144,1002,554,17,9223,542,124,129,1441,646,1422,8107,539,1675,2011,767,625,84,631,1359,2583,1354,559,265,323,16297,3206,79771,24014,0,0,0,0,0,80,-160,0,0,0,0,0,0,0,0,0,0,0,0,23934,103705 +"61",15,6,0,0,0,331,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,94,24,0,3,2552,30,1129,0,4326,177,56,0,0,0,11,25,0,0,0,110,211,28,17,0,0,0,0,0,0,71,82,0,915,0,4040,1,15,0,0,1455,235,0,0,3350,1593,49,161,15251,13,36384,318729,0,0,0,0,0,2705,-1343,0,0,0,0,0,0,0,0,0,0,0,0,320091,356475 +"621",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,0,101,0,0,14947,14001,101,6,110,2,0,0,126,0,314,0,7615,0,37376,897470,0,0,0,0,0,79,0,0,0,0,0,0,0,0,0,0,0,0,0,897549,934924 +"622",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2510,0,0,0,0,0,0,0,0,0,0,0,0,2510,920554,0,0,0,0,0,1291,-3028,0,0,0,0,0,0,0,0,0,0,0,0,918818,921328 +"623",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2085,0,838,0,2922,218688,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218688,221610 +"624",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,168,0,168,181212,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,181212,181380 +"711AS",77,2,1,0,42,166,120,35,39,62,95,80,6,7,47,34,20,48,130,11,2,41,41,50,59,89,1744,397,517,40,406,23,290,0,33,7,0,225,66,201,5845,25688,255,997,781,191,175,2,3608,281,568,404,3386,2640,1474,57,1178,552,506,163,176,14551,633,320,1453,2073,1026,28,84,930,14,75295,67474,0,0,4319,0,0,1611,-1037,0,0,0,0,0,0,0,0,0,0,0,0,72366,147661 +"713",27,1,0,1,30,46,69,9,13,13,31,23,3,1,13,10,7,16,30,1,0,9,13,7,19,21,282,3,37,1,286,0,1,0,0,0,0,2,1,30,11,67,100,210,207,34,18,4,300,42,101,128,322,478,390,18,52,203,9,27,37,100,7,304,277,39,172,1,1,482,223,5419,174884,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,174884,180304 +"721",3,0,7,22,509,1284,451,160,235,236,565,450,56,46,256,186,139,315,559,41,11,170,331,135,391,430,2093,18,75,37,209,0,23,0,0,0,5,507,156,613,250,1380,2060,4321,4318,681,380,79,6210,1268,1642,2529,5331,721,5121,470,587,2754,203,321,362,107,121,443,1270,702,1158,467,107,2662,161,58909,139487,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,139487,198396 +"722",657,63,59,66,904,2634,490,233,298,370,690,588,89,88,327,240,163,378,848,74,17,249,291,315,507,506,5460,703,972,803,3245,6769,7,21,414,80,26,1379,210,595,433,1453,2004,6757,4738,2445,961,1263,19489,2076,3076,3476,14429,3076,11133,454,2174,16650,9750,8914,1905,502,1291,7042,3543,2793,444,148,1390,11136,486,177259,626650,0,0,0,0,0,2606,0,0,0,0,0,0,0,0,0,0,0,0,0,629256,806515 +"81",411,534,250,163,1188,835,6654,375,761,1294,1458,910,432,247,909,432,172,396,2131,186,15,1314,414,490,3343,1052,25278,1601,2663,1744,7367,342,191,58,12625,829,723,2807,1259,1131,213,4512,1934,7269,3652,5143,710,61,6762,9800,1444,864,7849,5029,8297,2427,1412,5917,17135,1788,864,753,1362,2259,8904,8266,3033,305,1546,18519,1669,224680,556165,0,0,0,0,0,68,-3329,0,0,0,0,0,0,0,0,0,0,0,0,552904,777584 +"GFGD",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,598672,0,0,0,0,0,0,0,0,0,0,0,598672,598672 +"GFGN",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,353528,0,0,0,0,0,0,0,353528,353528 +"GFE",22,7,0,10,0,323,10,0,0,13,44,543,3,293,0,0,0,43,0,3,0,0,94,85,117,0,18266,540,494,330,3792,2,0,2493,2772,148,57,869,404,760,318,332,1112,2259,11596,115,0,1,306,906,438,216,2504,186,1193,111,676,867,1566,293,401,134,78,1101,3253,1309,0,165,2,1654,149,65779,7176,0,0,0,0,0,476,-414,0,0,0,0,0,0,0,0,0,0,0,0,7238,73017 +"GSLG",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1614052,0,0,0,1614052,1614052 +"GSLE",0,5,0,0,0,3948,0,45,111,201,187,110,55,45,98,55,31,68,694,57,6,158,38,248,1323,131,963,218,234,114,699,1,0,0,78,4,5,77,445,69,31,107,53,351,196,48,0,0,620,890,490,150,1398,292,1037,73,90,513,608,262,2007,35,178,616,1166,632,461,286,242,4175,726,28256,64073,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64073,92329 +"Used",-42,90,0,-28,217,3517,1407,0,33,22576,269,3,0,0,0,0,0,92,0,14,0,2045,0,0,36,38,0,28,0,0,263,-496,0,-69,1651,1,200,2892,1,0,156,1,0,0,0,0,0,0,0,-33,0,0,0,114,0,0,794,2,0,0,0,-113,456,0,0,8473,-35,0,0,0,0,44553,61749,-2011,-110107,0,-789,3562,25566,-14559,0,-4,0,0,0,-202,-18,0,0,3001,-2865,0,-36677,7876 +"Other",1033,63,1212,60,421,1237,2041,216,220,730,784,1343,1247,373,1718,699,137,498,2437,112,26,512,255,2384,2592,630,5601,51,564,647,2554,14724,229,2938,1150,14,48,445,94,964,383,9929,782,3156,27601,1608,191,1467,2891,871,373,1233,2922,1403,1453,100,603,0,0,285,0,253,246,753,1709,500,11449,3307,953,0,0,129424,-94650,0,0,6712,0,0,187874,-226239,0,0,0,0,0,0,0,0,0,0,0,0,-126304,3120 +"Total Intermediate",275668,22836,197306,58459,73182,239294,621121,66615,63989,201404,216592,247818,96490,72027,496152,185791,43202,80942,709910,37994,9140,127807,43332,608918,500359,164032,729533,72928,79611,84220,339053,108250,44723,37954,192672,21237,11592,108226,68407,103632,54491,398157,111821,259257,330324,455481,124383,198144,593447,147181,91989,111715,446992,198517,285731,43637,104088,297242,342373,88636,73960,46489,52601,101053,320565,244011,225289,109107,45543,656014,185074,14205732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V001",29109,21862,39296,18454,43387,75188,422384,19374,25637,31826,95323,92622,132262,33582,64720,75694,18724,48796,100054,12081,8370,29785,25771,19062,97235,42102,489900,103389,87586,87191,267305,44412,23162,7142,86802,18630,6575,72008,38055,106900,32331,115320,49840,222567,223632,234022,864,16464,76818,33094,118965,213681,516303,287434,350814,25904,174871,469249,345371,118991,94650,49717,47008,73923,242281,272838,239144,165022,55788,1232456,98543,9259654,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V002",2467,1696,37506,6132,2460,58974,8399,674,1387,2368,3386,3398,8085,824,3273,2388,372,2941,30410,589,278,1652,730,3511,15706,1781,207727,43328,23159,39844,107497,20706,237,810,4036,1639,2818,2154,743,5282,6286,33852,3457,16150,5018,35618,762,209631,22384,18390,14286,5680,12940,8256,8685,3334,8069,8241,9121,5439,1766,7737,10917,25243,44832,20456,0,0,-7268,0,-17909,1182741,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V003",134421,9356,201931,34266,33611,164186,206867,10936,22576,29956,45371,65094,111189,20024,64758,61270,6663,30104,108407,5167,1267,25372,12571,135607,217077,23312,391973,34548,28086,11694,141514,37869,20525,8256,49986,20323,20813,25794,9019,105593,43715,245669,96130,321134,-551,217732,19009,1410503,338054,139380,92579,46752,247848,37118,112689,16962,43224,134277,61769,8022,9536,55091,18867,43965,72352,83515,160902,101779,461,188677,53775,7108287,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"Total Value Added",165998,32914,278733,58851,79458,298348,637651,30984,49599,64150,144080,161114,251536,54430,132751,139351,25759,81841,238871,17837,9915,56808,39072,158180,330018,67195,1089600,181266,138830,138730,516316,102987,43924,16208,140824,40592,30206,99956,47816,217775,82331,394841,149427,559851,228099,487371,20635,1636598,437255,190864,225830,266112,777091,332808,472188,46199,226164,611767,416261,132452,105952,112544,76792,143131,359464,376809,400046,266800,48981,1421133,134409,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17550681,0 +"Total Industry Output",441666,55750,476039,117311,152640,537642,1258772,97599,113588,265554,360672,408932,348027,126457,628903,325142,68961,162783,948780,55831,19056,184615,82404,767097,830378,231228,1819133,254194,218441,222950,855369,211236,88647,54162,333496,61828,41797,208182,116224,321407,136822,792998,261249,819108,558422,942853,145018,1834742,1030702,338045,317819,377828,1224083,531325,757919,89837,330252,909009,758634,221088,179912,159033,129394,244184,680029,620820,625335,375908,94524,2077146,319483,0,11847720,577624,1091944,730488,560156,83966,2111188,-2621225,598672,5255,74740,64750,353528,12020,17417,89617,1614052,266075,39851,32841,0,31756413 diff --git a/flowsa/data/external_data/BEA_Summary_Use_2015_PRO_BeforeRedef.csv b/flowsa/data/external_data/BEA_Summary_Use_2015_PRO_BeforeRedef.csv new file mode 100644 index 000000000..c9bc8da39 --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Use_2015_PRO_BeforeRedef.csv @@ -0,0 +1,80 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","Total Intermediate","F010","F02S","F02E","F02N","F02R","F030","F040","F050","F06C","F06S","F06E","F06N","F07C","F07S","F07E","F07N","F10C","F10S","F10E","F10N","Total Final Uses (GDP)","Total Commodity Output" +"111CA",59046,669,0,45,30,0,1934,0,0,0,0,0,0,0,0,0,0,341,228338,1261,0,0,0,0,8300,0,1446,400,891,200,260,0,0,0,0,0,0,116,0,0,0,0,0,1,0,0,0,1,4,0,2,1,629,25,818,0,134,0,0,0,0,0,450,43,1571,36,4,-453,0,2535,0,309077,74800,0,0,0,0,4949,44514,-37639,0,0,0,0,0,0,0,0,0,0,0,0,86624,395700 +"113FF",23530,6947,0,75,0,0,0,12373,1,0,0,0,0,0,0,0,34,177,7151,0,23,4501,35,8,371,1672,0,0,629,0,2,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,12,1,0,67,0,0,0,0,0,155,366,3020,149,0,85,11,3663,0,65288,6661,0,0,0,0,640,6334,-16075,0,0,0,0,0,0,0,0,0,0,0,0,-2440,62848 +"211",0,0,17701,2,0,23727,0,0,0,52,0,0,0,0,0,0,0,0,0,0,0,0,0,271893,8352,0,2,0,0,0,1,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,0,1,0,1,1,1,0,0,1,2,4,2,0,0,1020,0,17588,340379,0,0,0,0,0,4196,15448,-143549,0,0,0,0,0,0,0,0,0,0,0,0,-123905,216474 +"212",1807,1,49,6329,71,11042,13915,9,7728,12105,377,103,4,66,61,131,20,158,1154,59,0,1253,0,1461,3920,104,13,0,0,0,2,0,116,0,5,1,0,2,3,23,11,150,208,0,0,0,0,12,0,0,0,0,663,38,290,37,221,0,77,26,19,170,369,43,284,472,0,701,0,1953,5977,73809,160,0,248,0,0,1219,9939,-1890,0,0,0,0,0,0,0,0,0,0,0,0,9677,83486 +"213",0,0,9978,1699,1383,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13096,0,137147,2916,0,0,-2,4510,-1327,0,0,0,0,0,0,0,0,0,0,0,0,143243,156339 +"22",4957,150,4037,4372,217,36016,5812,1835,3458,7201,4476,2038,1129,774,3027,1238,569,1080,8478,1176,63,5474,1227,4566,15470,4888,15813,3714,8647,5226,16106,103,101,96,1416,123,934,1031,12073,857,339,4295,1487,2130,1221,413,1998,19,86917,1385,490,258,3731,9501,2703,529,6538,2779,9642,2319,1085,719,2451,6336,20737,4699,1548,535,1039,18826,2249,388884,263603,0,0,0,0,0,3778,-2674,0,0,0,0,0,0,0,0,0,0,0,0,264707,653591 +"23",1655,41,2173,2366,3032,8721,272,171,343,544,576,373,126,108,443,164,78,164,973,81,9,664,180,6272,1558,460,1885,585,481,478,2185,283,2260,44,312,238,1238,2095,747,77,29,2126,141,3643,1289,335,425,72344,61573,313,102,28,669,526,395,36,509,305,802,240,216,193,368,763,1532,3717,7576,1553,1194,28228,45793,281418,0,429080,0,0,474420,0,101,0,0,4975,0,0,0,13311,0,0,0,278150,0,0,1200037,1481455 +"321",366,36,0,126,166,0,36511,20309,394,365,229,953,296,217,3534,338,6038,1099,404,46,2,4849,5,0,224,1535,2758,109,539,103,867,0,1743,0,104,0,3,98,198,91,64,738,1232,60,5,4,0,43,5960,328,13,15,615,2,711,14,35,196,197,4,805,4,114,447,801,427,13,17,2,3639,136,101297,4363,205,0,0,4372,1372,5222,-18087,0,0,0,0,0,0,116,0,0,0,0,0,-2437,98860 +"327",3,71,698,367,838,152,55897,852,13361,2267,1170,2218,218,1569,7057,348,333,870,5225,159,0,421,2,690,2340,1792,193,219,68,160,665,0,15,0,46,0,1,42,124,7,1,2401,749,46,82,6,0,35,121,372,6,88,3230,62,921,101,85,1626,1375,173,224,9,105,82,1661,1029,32,244,0,1585,1599,118505,10729,0,0,0,0,1434,8612,-24623,0,0,0,0,0,0,0,0,0,0,0,0,-3849,114656 +"331",91,0,3779,580,606,7,3984,404,755,64545,66830,28620,3192,13669,43775,9568,3179,6221,5535,289,0,480,29,27,42,1589,1038,4,0,0,855,0,1041,0,0,0,0,308,0,20,9,212,245,0,0,1,0,1,2076,73,0,12,1167,29,349,311,118,75,48,14,187,12,173,12,72,337,59,152,0,269,347,267419,489,0,0,0,0,539,28927,-73476,0,0,0,0,0,0,0,0,0,0,0,0,-43521,223898 +"332",1603,149,4109,1138,1591,714,72744,2616,2864,5028,37699,26210,4148,7679,42538,13517,3116,5846,14943,683,126,5523,1449,326,10579,7882,2010,367,144,120,1421,85,383,1426,1036,140,693,891,465,1248,18,10259,1379,120,168,2,20,41,2145,1104,30,1276,4292,701,2069,1860,356,243,540,27,1276,49,414,711,2356,3034,4070,961,645,3671,3104,332193,16336,0,13327,0,0,4716,33408,-65031,0,0,1064,0,0,0,633,0,0,0,375,0,4828,337021 +"333",3529,324,6261,4067,5656,873,28696,665,185,1380,4220,35579,249,1397,25655,5157,82,1738,3658,33,8,1072,1155,135,4314,1816,2212,280,117,121,832,8,252,19,245,163,63,2820,537,136,36,2367,577,8,48,114,0,27,112,2127,25,920,2313,412,2207,2614,1120,462,397,153,102,25,85,83,564,5288,620,119,191,3913,1285,174023,6570,0,223198,0,0,2776,101899,-151733,0,0,343,0,0,0,355,0,0,0,4677,0,188085,362108 +"334",148,1,19,28,431,169,5413,896,1016,1875,4972,8988,26142,4315,21900,16772,1053,2828,2778,622,61,720,1448,194,5641,2464,9024,632,285,252,2463,2,119,3,186,3,6,149,226,3185,664,16809,4084,385,1319,21,731,163,539,382,1327,5109,6977,6695,2983,620,603,6770,451,181,288,16,95,226,81,4139,16509,2045,1,1886,1646,211168,80833,0,187293,0,234,5803,100565,-316210,0,0,11826,0,0,0,6730,0,0,0,5395,0,82469,293637 +"335",1274,174,123,62,458,58,35075,1104,138,1961,2368,13753,1834,8083,7048,2837,93,1276,911,57,3,461,117,90,1098,1438,321,181,33,274,299,1,135,26,41,96,3,29,447,2,0,4270,366,80,67,7,0,16,1198,233,1,1206,4380,107,1858,622,560,20,345,604,377,45,240,513,552,2260,782,1082,54,1655,2106,109383,38588,0,26374,0,4301,2285,31326,-92211,0,0,245,0,0,0,597,0,0,0,663,0,12168,121551 +"3361MV",959,108,519,949,488,83,2025,736,541,718,1210,14202,380,394,219402,3874,330,597,2509,87,1,1020,201,136,1300,564,5633,4051,887,204,3050,0,49,0,3982,276,0,206,3060,378,53,1576,139,33,18,0,0,0,0,1044,0,19,2661,684,5924,1298,322,311,600,95,1306,98,62,106,539,10653,4030,59,1564,5733,737,314774,232493,0,275524,0,0,9077,105811,-318049,0,0,14045,0,0,0,3493,0,0,0,21727,0,344120,658894 +"3364OT",0,12,0,46,0,0,6,41,0,0,46,167,0,0,383,72166,0,0,0,0,0,0,0,0,0,0,24,23,0,0,0,798,1580,1659,13,13,0,1259,0,0,0,3,0,0,0,0,0,0,0,0,0,0,172,3,36,25,0,0,0,0,11,0,25,0,0,145,28031,447,8,0,162,107303,19416,0,68988,0,0,8696,122163,-56600,0,0,35118,0,0,0,2617,0,0,0,472,0,200871,308174 +"337",1,0,0,0,0,0,16881,591,1,0,0,417,66,2,53,413,3709,349,0,0,0,1,0,0,0,444,362,200,0,0,1036,0,0,3,0,0,0,17,0,1,0,212,369,0,0,0,0,2751,76,0,18,1,275,8,3,0,0,232,52,1,91,103,204,4,279,194,0,0,1520,11,87,31038,47787,0,23958,0,333,1989,3716,-38647,0,0,0,0,0,0,43,0,0,0,919,0,40098,71137 +"339",209,4,19,38,28,0,960,31,170,57,57,2310,3,670,1832,80,16,7194,34,134,138,0,7,8,602,123,1016,166,87,8,1152,0,1,0,6,17,0,228,258,7,2,172,119,130,73,8,0,0,447,79,53,54,1825,18,1469,407,405,16873,18809,1057,1309,95,455,46,575,1477,132,165,0,6847,129,70906,89297,0,48245,0,0,3805,31690,-92177,0,0,19,0,0,0,127,0,0,0,373,0,81379,152285 +"311FT",32423,379,0,0,0,0,0,44,222,9,0,0,0,0,0,0,0,7,182805,10,836,1270,631,212,4342,148,2341,5,2645,738,1151,379,2,369,26,0,0,53,0,43,12,0,44,0,0,0,0,0,0,0,0,0,4983,104,0,0,6462,14,8595,6715,8219,559,4793,6884,47864,2537,2611,12,617,53686,0,385797,579471,0,0,0,0,13976,64190,-88392,0,0,0,0,0,0,0,0,0,0,0,0,569244,955041 +"313TT",243,92,0,4,0,0,1904,587,401,0,0,893,1,0,4188,934,3081,2303,188,9082,1412,2813,346,52,7,2624,1814,78,140,2466,2159,0,0,163,15,0,2,88,4,11,112,13,12,0,0,0,0,1,205,211,0,0,256,6,153,88,50,51,639,2049,908,0,311,1665,275,1116,874,190,2,2440,38,49758,20445,0,1505,0,594,1345,8916,-31756,0,0,0,0,0,0,45,0,0,0,4,0,1099,50858 +"315AL",36,0,0,0,0,3,0,0,1,0,0,0,0,0,2259,0,0,65,11,769,2136,0,1730,4,0,2,847,243,12,276,753,0,0,0,0,0,0,0,0,32,27,1895,4,0,0,0,0,0,0,108,0,0,46,16,288,92,119,185,204,0,1132,139,43,21,199,1896,118,27,49,4499,46,20334,142114,0,0,0,0,3475,4621,-151087,0,0,0,0,0,0,0,0,0,0,0,0,-877,19457 +"322",388,0,51,215,104,100,2287,623,1461,1417,2451,1986,421,963,2816,716,1107,2346,24827,477,36,42011,6481,157,7780,5085,4748,99,1203,310,1476,12,53,9,175,990,27,2879,473,1945,93,547,196,945,886,131,1,1,1211,834,457,274,3055,649,3202,229,219,1126,3190,1536,763,85,140,1606,2422,1021,110,1107,51,12637,44,159475,21494,0,0,0,0,2523,21448,-23029,0,0,0,0,0,0,0,0,0,0,0,0,22436,181911 +"323",27,0,6,3,0,5,34,33,0,0,1,10,0,2,5,0,0,0,198,0,14,0,1606,11,1097,0,8405,143,198,136,3673,3,16,0,236,54,2,471,9,6166,645,567,2925,598,1896,1376,0,0,87,285,723,166,4769,751,2319,13,940,1497,1739,137,1307,740,169,639,558,1790,549,761,52,10402,523,61492,5883,0,0,0,0,1452,2238,-2478,0,0,0,0,0,0,0,0,0,0,0,0,7096,68588 +"324",5263,463,2630,3378,2972,14853,38488,997,594,2071,757,1550,112,1199,504,263,288,736,3077,93,12,1103,1630,16822,10268,1109,2926,532,321,79,1130,27581,4462,3411,27764,1981,42,7603,200,259,56,483,283,3473,4018,26,597,22,4206,1333,28,319,1465,814,3409,1299,573,766,4459,685,488,129,553,666,1781,2608,8024,356,2264,59277,12690,306674,169545,0,0,0,0,11694,70360,-60399,0,0,0,0,0,0,0,0,0,0,0,0,191200,497874 +"325",23628,2088,4811,3041,2257,3032,9806,2411,4012,1536,8133,3940,1816,2301,8515,1444,1745,6352,6309,10925,124,12608,5655,5108,207459,58877,1868,93,47,41,885,1,256,8,191,7,2,108,563,772,133,584,605,72,187,12,0,145,12363,425,165,131,9581,1719,5439,784,562,30227,26525,2492,498,142,515,76,562,3841,1450,1375,132,26774,2603,532893,280225,0,2232,0,0,14401,144429,-236155,0,0,0,0,0,0,0,0,0,0,0,0,205131,738024 +"326",1248,109,66,1116,1309,66,24933,745,1385,854,2535,7057,1101,1636,25988,3490,4385,6646,18890,398,60,3062,655,250,13653,20247,9852,1220,1492,270,3844,10,7,1,745,21,84,3819,514,568,66,5009,373,156,207,198,0,23,312,1682,89,702,5522,181,1774,324,494,6053,2586,1190,857,24,165,129,5078,3679,1304,333,26,9076,1861,213807,35574,0,187,0,40,3532,25194,-48330,0,0,0,0,0,0,16,0,0,0,0,0,16212,230019 +"42",38194,2691,4257,4303,3709,6632,68288,8662,5307,22655,18044,28110,8396,8676,62134,12911,5612,10910,65694,3347,1718,12284,3633,13663,52213,15254,52287,3367,1953,2072,16597,3438,2294,1567,12558,1013,168,5499,1960,4028,266,14172,2203,1755,2739,304,469,434,5586,10526,982,2297,13458,3792,7670,2072,3310,22149,21029,3842,3724,504,2833,3601,16116,10816,10997,2080,1843,37424,7468,812554,530279,26,199967,22411,2377,18826,188260,38123,0,0,8492,334,0,0,3801,422,0,0,7233,1116,1021666,1834220 +"441",7,1,103,255,188,46,2336,197,264,187,376,2982,57,1,2888,1047,132,315,1178,44,0,444,94,1,692,214,209,1955,437,95,1435,0,11,0,1171,4,0,11,154,165,26,85,7,17,9,8,0,33,371,448,0,8,750,0,1388,47,0,0,0,0,0,3,13,29,52,4668,0,0,0,0,1,27662,142302,0,28933,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,171245,198907 +"445",43,0,0,0,0,74,237,0,19,0,1,4,0,1,11,0,5,8,11,0,0,2,43,1,101,3,29,11,69,16,80,0,5,1,462,29,0,35,0,3,1,0,7,7,14,1,0,49,76,5,2,2,20,0,249,1,20,13,15,2,4,12,44,96,2285,42,0,1,0,66,0,4339,202318,0,192,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,202518,206857 +"452",68,1,10,18,11,119,1920,14,48,12,36,212,6,11,254,61,66,104,190,39,0,44,295,8,380,33,183,200,83,20,238,0,9,1,729,41,2,52,10,36,7,9,42,42,79,5,0,502,316,43,25,11,194,0,587,6,66,85,48,7,27,9,25,244,1031,549,1,19,0,290,0,9833,201129,0,3907,456,527,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206020,215853 +"4A0",703,12,45,216,22,1404,72517,93,45,34,170,677,32,98,1020,123,529,794,1202,202,0,214,1192,138,3212,152,793,1459,494,414,1767,2,89,674,9167,441,6,977,25,169,27,41,176,174,329,18,0,4387,1374,124,192,47,917,0,1426,18,226,494,239,70,162,151,352,1183,9878,2476,11,182,0,2666,0,128661,699890,0,40662,8316,5942,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,754811,883472 +"481",143,2,11,48,749,1241,545,263,378,314,774,547,79,61,470,319,212,372,941,56,16,247,344,101,576,576,6193,140,44,71,243,150,35,157,1482,18,1,1367,58,768,347,1509,1895,3667,5314,261,617,90,8382,1077,1442,2013,5453,429,6245,513,847,3022,348,463,554,189,251,330,1293,1013,4756,1647,259,4432,89,78859,126390,0,303,30,2,31,43517,-40634,0,0,19,0,0,0,5,1,0,0,9,1,129675,208534 +"482",1874,66,323,1234,176,5255,2067,811,2297,3666,891,437,67,325,1237,339,266,256,6367,77,5,2505,162,3146,5137,1568,322,26,103,31,94,130,202,18,4051,19,2,423,48,54,4,371,34,56,68,86,3,19,268,60,50,26,678,35,370,39,59,263,210,81,89,9,60,112,464,151,174,376,449,1887,2810,55442,7739,0,3276,0,25,1159,11078,393,0,0,339,0,0,0,76,0,0,0,400,0,24484,79926 +"483",519,28,198,268,106,585,1212,10,328,629,150,71,25,91,88,43,19,65,1189,31,0,183,2,72,907,210,39,13,15,4,20,27,14,4,29,2,1,11,1,1,0,32,5,4,4,0,1,5,84,8,0,6,742,63,97,18,216,135,129,14,11,3,10,10,43,39,1213,87,627,666,305,11788,19812,0,11,0,0,230,6284,12285,0,0,3,0,0,0,0,0,0,0,0,0,38625,50413 +"484",7575,572,853,1102,767,3321,20501,1951,3303,6134,3984,4154,976,1348,8170,2144,1204,1657,30890,813,180,3018,692,8122,8126,2900,4122,1852,1452,1514,4629,1232,382,237,5631,140,30,3213,215,645,200,1467,632,207,286,76,29,123,1013,402,140,279,2797,393,1334,327,468,1432,1591,494,648,243,827,483,2100,1734,1749,316,646,6423,1246,179854,82159,8,21088,579,412,3113,32680,4683,0,0,553,9,0,0,157,11,0,0,540,29,146020,325874 +"485",0,3,2,10,196,610,606,72,100,88,216,153,19,15,118,79,58,129,217,11,4,67,93,28,145,148,724,54,6,16,83,1,467,0,0,0,0,181,7,230,92,774,800,1493,1622,431,174,91,2897,438,663,737,3433,148,2444,140,353,1445,1114,585,140,1594,65,121,495,317,21,2,18,13533,449,41585,40850,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40850,82436 +"486",120,9,6052,54,33,10381,327,9,8,13,9,21,1,5,4,3,2,6,25,4,0,18,26,10996,490,15,46,7,5,1,16,440,71,54,442,32,1,121,3,4,1,5,4,55,64,0,10,1,52,20,0,5,15,13,54,20,9,9,71,9,6,2,8,9,26,38,127,6,465,903,7714,39597,2664,0,0,0,0,1408,3091,0,0,0,0,0,0,0,0,0,0,0,0,0,7163,46760 +"487OS",0,207,25,1480,16,8096,0,923,1014,149,116,17,0,3,10,0,393,223,516,77,0,412,360,411,177,517,40454,1548,753,485,8843,20443,1553,5274,31950,409,240,34268,1125,1926,766,294,2555,399,3845,151,0,0,0,1801,769,319,6953,223,2274,1130,383,1421,1825,333,871,575,784,130,413,1526,2,46,730,637,4132,199699,21642,0,0,0,0,0,9701,3043,0,0,0,0,0,0,0,0,0,0,0,0,34386,234085 +"493",371,0,6,385,0,650,0,131,117,89,1046,396,938,46,133,72,86,427,181,100,44,146,197,34,366,203,25767,9498,9486,12214,28080,13,2,551,4748,112,6,838,10623,724,219,562,719,0,0,32,0,4,78,419,210,92,887,5,1813,85,220,658,699,147,231,197,101,922,1592,666,120,145,0,3801,106,123558,165,0,0,0,0,0,164,0,0,0,0,0,0,0,0,0,0,0,0,0,329,123887 +"511",55,2,17,0,4,157,540,2,1,6,45,31,10,2,12,87,6,34,6,0,0,4,54,1,49,9,1513,185,126,87,634,4,61,0,26,4,0,218,102,5504,41,632,1418,288,981,82,41,13,297,408,967,601,2615,1857,1223,7,624,1216,736,94,909,24,49,98,81,593,1252,666,332,7110,100,34954,71284,0,0,81276,0,2325,43601,-4123,0,0,0,1065,0,0,0,1345,0,0,0,3564,200336,235290 +"512",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,198,190,0,111,2,0,0,1,0,16,6,0,46,20061,37052,6,10,20,0,0,0,64,514,6,9,1380,144,30,0,1417,22,6,615,553,100,44,963,1224,694,996,236,8,456,0,67226,25803,0,0,34790,0,107,21462,-8069,0,0,0,0,0,0,0,0,0,0,0,0,74093,141319 +"513",661,45,890,313,1159,2061,7877,268,356,296,994,845,283,179,467,399,175,622,959,92,26,308,428,172,1090,614,16884,1912,748,660,8465,264,192,105,1975,670,152,2302,625,2847,415,106618,6465,8576,8490,2121,1049,1288,13825,1610,4332,3012,11524,5669,10240,567,2492,5356,3151,953,1133,434,981,2320,4896,4454,4919,2877,763,42106,1144,323159,324385,0,6763,26953,0,0,15893,-159,0,0,0,0,0,0,0,0,0,0,0,0,373834,696993 +"514",0,0,48,9,20,2004,1138,347,431,324,961,896,215,125,286,717,254,479,730,77,29,316,168,44,459,430,4129,2241,1175,988,4775,90,2,0,75,35,6,483,134,2582,127,3526,7850,6765,3715,957,1368,17,666,5241,2895,1806,12877,5490,16017,575,4443,1426,2658,323,1161,510,595,621,3115,5698,10279,3084,328,11948,1748,145046,43247,0,0,12728,0,0,5392,-1211,0,0,0,438,0,0,0,409,0,0,0,1401,62404,207450 +"521CI",1416,102,1374,862,2464,9323,7937,329,877,961,1453,1345,499,333,1188,679,483,896,2997,198,74,320,330,194,1692,1229,20717,2078,2966,2905,14281,819,7220,568,2332,6314,40,1156,945,1829,1169,3978,1503,34891,38961,6334,4350,101421,52047,18271,3480,2325,17242,15300,8158,234,3038,7445,1728,2121,1239,488,1281,1672,2865,14008,182,150,4108,4884,9365,467965,232832,0,0,0,0,0,48429,-45,0,0,0,0,0,0,0,0,0,0,0,0,281216,749180 +"523",331,41,2633,877,3692,779,2253,48,81,1242,1713,1505,98,266,1305,787,470,972,187,15,4,32,52,31,55,112,2089,132,233,371,829,1683,724,5848,455,861,26,1432,42,388,249,360,124,22276,48037,2320,101658,38,5015,706,860,326,2528,7331,1618,44,655,1274,4805,449,1318,361,89,2407,2703,12309,7,82,127,24644,1269,280681,225444,0,0,0,0,0,66672,-57,0,0,0,0,0,0,0,0,0,0,0,0,292059,572740 +"524",2725,985,4518,2310,4264,1339,640,280,1011,753,1004,1642,368,750,1706,1481,468,775,2958,355,153,339,110,168,2541,626,26672,2435,1276,1170,6713,281,47,414,8180,1915,538,2090,1615,570,1479,2282,669,6285,18305,349824,6079,9570,44214,4172,3598,877,7727,317,6747,915,2108,6109,49438,1658,3911,1840,1447,1538,3525,3621,0,57230,807,2172,10273,696927,352367,0,0,0,9391,0,16338,-49719,0,0,0,0,0,0,0,0,0,0,0,0,328377,1025304 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10005,14758,0,0,0,0,0,0,80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24843,163627,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,163627,188469 +"HS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1887478,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1887478,1887478 +"ORE",30204,113,962,116,285,4546,20442,509,574,377,3469,1365,2552,383,1408,3992,836,1185,2572,471,76,940,1308,32,3104,1831,73842,13081,17365,12045,85626,409,203,306,5502,666,306,3167,17819,6026,3627,15337,7807,25165,28462,32475,630,6065,113315,10335,23412,5363,42259,28046,14532,1610,35592,47318,31874,24178,16834,8543,11939,7234,61987,45760,3568,6957,915,33779,3550,1018480,4879,20090,0,0,107600,0,3269,0,0,0,0,0,0,0,0,0,0,0,0,0,135837,1154317 +"532RL",4067,182,3821,1894,5063,1376,19452,287,823,936,2289,1832,577,515,1953,1570,205,1462,3723,133,71,891,555,801,5312,950,26539,1049,1562,2094,8454,9201,4177,477,10585,1142,152,2003,1183,2616,2744,11322,6442,5592,7711,3508,35,64,2331,7334,3222,2268,14376,18761,5788,1538,2034,4716,5401,678,493,1460,1514,2035,7378,2234,310,158,704,6017,456,260599,93564,0,0,0,0,0,74360,0,0,0,0,0,0,0,0,0,0,0,0,0,167924,428523 +"5411",456,110,3599,921,2682,5994,7404,272,319,255,1463,1104,2757,204,1307,3123,195,1211,878,145,63,350,231,268,3017,614,14673,564,340,835,3274,210,671,151,244,118,54,565,262,3064,739,3938,2656,4377,10570,13728,2014,1410,18310,693,2527,3653,11869,9762,7072,381,409,4972,12239,1251,835,1883,2184,2324,3289,3239,1202,214,1536,9225,869,203335,96737,0,0,0,21446,0,12504,-2721,0,0,0,0,0,0,0,0,0,0,0,0,127965,331301 +"5415",415,58,3914,305,64,1996,5406,243,261,309,1325,1737,369,93,469,1605,184,535,786,101,21,235,373,275,1048,475,13475,2476,700,902,4239,100,1471,5,524,96,2,211,358,5019,471,5767,7052,7452,10281,1975,881,207,1942,642,4097,4496,14392,19541,9309,224,1634,4730,7500,1155,1108,238,826,739,2041,2820,23244,12277,584,17985,2441,220231,0,0,19300,182720,0,0,22360,-29113,0,0,540,7591,0,0,0,19078,0,0,201,9647,232324,452555 +"5412OP",2158,776,4746,3401,11338,14867,55388,1714,2272,2695,6576,4910,5541,1196,4669,5705,1772,5306,11676,798,361,2038,1547,1575,11720,4071,97995,15601,7319,7872,49411,707,2826,1117,3068,900,603,2396,1857,17668,9438,50921,24021,59625,49657,19279,3227,669,82387,10226,9978,19000,107476,49061,40178,2495,5434,28742,36106,8119,5752,5700,6167,10664,30268,21291,38649,6550,2505,51602,16371,1189717,66545,0,36029,379457,2219,0,131203,-91641,0,0,0,55906,0,0,0,70982,0,0,0,18452,669153,1858870 +"55",0,0,12044,4122,2350,34,7266,946,1842,1262,7873,13757,11651,974,10611,6122,537,4086,18670,1005,564,2585,755,1930,25488,2485,81399,1472,3985,21695,24754,403,4,922,9703,622,2,4176,623,7447,725,3423,1524,4524,16360,1976,784,118,2390,5140,7457,4998,21784,55,42702,2737,4601,25364,8212,3924,2188,2475,1842,18636,52554,8347,0,0,598,0,0,541603,0,0,0,0,0,0,4057,0,0,0,0,0,0,0,0,0,0,0,0,0,4057,545660 +"561",733,74,900,924,2512,16251,10020,798,1325,2947,7229,2270,2132,548,3222,4239,358,1644,3264,410,377,1584,2744,1148,5177,2007,58536,4496,3411,3432,22020,3016,1503,4253,11701,2558,762,7253,4950,13136,1998,33495,19439,18487,14553,5788,391,2871,89485,14806,9310,23851,50555,8287,49699,2882,3694,25359,47127,8166,3393,3564,2679,6644,10945,12110,14133,1346,3063,32897,6388,743267,55881,0,0,0,0,0,2046,-1546,0,0,0,0,0,0,0,0,0,0,0,0,56381,799648 +"562",277,15,1106,350,515,844,3026,142,262,394,439,246,94,72,234,174,107,173,1352,106,9,339,100,416,2294,347,2371,804,485,271,1651,16,99,37,459,53,5,326,871,123,30,205,68,521,137,899,642,29,10614,387,120,97,1372,654,1569,8183,606,1642,1919,754,617,95,691,1218,2635,1482,540,235,241,18247,3531,80984,23184,0,0,0,0,0,104,-185,0,0,0,0,0,0,0,0,0,0,0,0,23103,104086 +"61",16,5,0,0,0,304,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,82,10,0,3,2291,34,1103,0,4476,147,51,0,0,0,3,32,0,0,0,103,230,20,14,0,0,0,0,0,0,52,90,0,977,0,4282,1,15,0,0,1697,221,0,0,3307,1445,40,158,16372,14,37604,330442,0,0,0,0,0,2633,-1342,0,0,0,0,0,0,0,0,0,0,0,0,331732,369336 +"621",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,0,100,0,0,15531,13956,102,7,141,2,0,0,129,0,421,0,9291,0,39739,944717,0,0,0,0,0,86,0,0,0,0,0,0,0,0,0,0,0,0,0,944803,984542 +"622",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3584,0,0,0,0,0,0,0,0,0,0,0,0,3584,982737,0,0,0,0,0,1724,-3499,0,0,0,0,0,0,0,0,0,0,0,0,980963,984547 +"623",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2171,0,656,0,2827,228323,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,228323,231151 +"624",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,773,0,773,188139,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,188139,188912 +"711AS",73,2,1,0,39,161,160,39,40,54,86,65,5,6,50,34,19,47,122,9,2,38,39,23,51,84,1675,445,487,44,457,24,274,0,50,10,0,264,68,211,6211,25588,288,990,827,187,233,3,4723,266,595,341,3724,2795,1695,64,1322,623,547,182,201,17357,765,381,1599,2074,1101,28,84,1105,16,81170,70527,0,0,4632,0,0,1543,-1312,0,0,0,0,0,0,0,0,0,0,0,0,75390,156560 +"713",21,0,0,1,21,38,72,7,10,8,22,14,2,1,11,8,6,12,21,1,0,7,10,3,13,15,218,3,30,1,265,0,0,0,0,0,0,2,1,25,10,58,87,159,173,23,18,4,303,31,83,84,273,469,368,16,54,179,8,23,32,131,7,300,287,38,141,1,0,460,239,4927,181906,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,181906,186832 +"721",3,0,4,27,467,1347,534,167,231,201,502,356,45,39,269,186,133,301,509,32,9,154,308,64,340,406,2039,25,81,39,236,0,23,0,0,0,2,596,161,655,284,1515,2287,4130,4558,579,493,108,7902,1116,1702,2090,5805,813,6031,517,687,3073,227,351,401,148,149,455,1438,864,1211,452,66,3219,182,63341,146991,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,146991,210331 +"722",659,56,34,71,874,2811,599,257,300,325,631,491,71,73,356,249,160,372,807,62,15,233,279,151,434,484,5415,875,1035,851,3589,6890,7,24,657,116,13,1773,212,639,485,1593,2243,6632,5057,2537,1272,2348,25320,1815,3237,2896,15848,3560,12859,502,2214,18698,10153,9598,2081,670,1635,7465,4036,3360,475,147,1326,13601,570,197182,672956,0,0,0,0,0,2581,0,0,0,0,0,0,0,0,0,0,0,0,0,675537,872719 +"81",401,476,144,198,1132,806,8823,396,795,1218,1439,847,348,219,965,420,176,422,2121,180,17,1439,407,368,3263,1032,23826,1985,2852,1857,8111,321,183,116,13215,856,452,3402,1263,1077,217,4020,2254,6703,3756,5260,949,72,7320,9406,1415,788,8118,5681,9225,2366,1341,6128,17187,1818,900,959,1484,2276,10194,8732,3027,298,1359,22291,2004,235119,572241,0,0,0,0,0,74,-3804,0,0,0,0,0,0,0,0,0,0,0,0,568510,803629 +"GFGD",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,586829,0,0,0,0,0,0,0,0,0,0,0,586829,586829 +"GFGN",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,368316,0,0,0,0,0,0,0,368316,368316 +"GFE",18,5,0,9,0,303,11,0,0,13,39,433,3,209,0,0,0,42,0,2,0,0,82,34,95,0,16812,632,491,326,3965,2,0,2668,3810,198,18,1062,389,771,337,342,1124,2017,12413,78,0,1,373,712,427,165,2491,194,1250,116,621,893,1555,303,414,157,87,1026,3491,1409,0,151,2,1826,151,66570,6772,0,0,0,0,0,522,-392,0,0,0,0,0,0,0,0,0,0,0,0,6902,73472 +"GSLG",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1653836,0,0,0,1653836,1653836 +"GSLE",0,5,0,0,0,4146,0,48,113,179,171,102,50,36,99,54,31,67,637,53,6,157,36,202,1180,128,864,264,236,115,717,1,0,0,109,5,2,93,424,70,34,117,56,325,198,44,0,0,760,796,491,122,1415,314,1147,78,108,537,614,274,2091,42,197,585,1264,737,461,267,205,4865,832,29376,67101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67101,96477 +"Used",-43,95,0,-22,315,3818,1719,0,33,13621,156,2,0,0,0,0,0,120,0,10,0,1499,0,0,25,27,0,23,0,0,242,-174,0,-92,654,1,87,2953,1,0,114,1,0,0,0,0,0,0,0,-33,0,0,0,123,0,0,1005,2,0,0,0,-48,430,0,0,10455,-49,0,0,0,0,37071,80626,-2203,-114948,0,-435,3694,20347,-16121,0,-4,0,0,0,-651,-20,0,0,3290,-2650,0,-29076,7995 +"Other",979,59,1163,60,400,1196,1937,202,208,692,738,1274,1186,353,1617,640,127,475,2333,102,24,491,244,2231,2547,601,5468,61,524,618,2564,13984,224,2563,1150,17,51,448,90,1010,366,9262,761,3107,28187,1647,202,1306,2848,860,398,1196,2847,1349,1404,107,570,0,0,268,0,230,223,728,1605,459,10232,3175,1140,0,0,125126,-101471,0,0,8374,0,0,200130,-228869,0,0,0,0,0,0,0,0,0,0,0,0,-121836,3291 +"Total Intermediate",257679,18617,110831,56171,67272,214533,690787,68515,64422,167025,204540,226216,80688,62298,529723,182863,44544,84893,684307,35596,8932,123187,41967,355282,452234,155242,707189,86542,82486,87594,368249,93541,37687,35255,183441,23540,6872,109719,68126,97902,55697,395462,120989,248669,337278,465651,146150,209004,686500,123144,92611,96835,460478,213822,315211,41881,107650,312290,369337,93105,75504,56049,55353,101065,342573,250803,214946,115992,36441,673467,186583,13977047,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V001",27205,23410,38814,18055,34998,77628,458477,20428,27080,31636,97092,94664,137529,34671,69905,77790,20277,51622,103480,12017,8174,30172,26028,19815,100482,43560,509809,110163,92549,90339,280575,48445,24226,7322,92014,19815,7146,77801,43261,114787,34244,112649,56995,236473,227418,250693,1121,17545,84663,34499,122863,234630,551939,302345,371539,26608,180447,494895,366378,123477,100385,52218,48669,77673,263185,286397,238665,171258,59107,1275273,102019,9709535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V002",789,1516,32422,4942,2393,58707,8935,698,1433,2459,3348,3516,8495,869,3382,2462,384,2955,30077,565,288,1720,755,3644,16169,1803,210305,45418,23594,39815,107862,22022,208,860,4126,1703,2920,2245,774,5423,6431,39472,3864,17276,5043,40312,725,216402,23314,18751,15939,5929,13172,8442,8946,3309,8312,8517,10914,5717,1815,8006,11452,26461,50660,21304,0,0,-6001,0,-18530,1217959,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V003",117235,9983,86886,27021,16167,162892,227908,11374,26183,25995,46982,54359,121447,28132,73055,68927,8492,26757,128358,5358,1232,27811,13446,122104,216604,32936,423452,36954,29335,12467,151255,47280,19904,7617,52968,20711,26761,28062,7913,103533,46969,274497,108952,327802,-1507,263560,15547,1452781,328429,152914,99971,44295,260513,37122,112160,18013,44686,140973,66425,8421,9867,52698,20511,53429,82059,83937,159695,104041,4515,192044,57356,7278526,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"Total Value Added",145229,34909,158122,50018,53558,299227,695320,32500,54696,60090,147422,152539,267471,63672,146342,149179,29154,81334,261915,17941,9694,59702,40229,145563,333255,78299,1143567,192536,145478,142621,539693,117747,44338,15799,149108,42229,36827,108108,51948,223743,87643,426617,169812,581551,230953,554565,17394,1686728,436406,206163,238773,284853,825623,347908,492645,47930,233445,644385,443717,137615,112068,112923,80632,157563,395904,391638,398359,275298,57621,1467318,140845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18206021,0 +"Total Industry Output",402907,53526,268953,106189,120830,513760,1386108,101014,119118,227114,351962,378756,348159,125970,676066,332042,73697,166227,946223,53537,18625,182889,82196,500845,785489,233541,1850756,279078,227964,230215,907942,211288,82025,51054,332550,65769,43699,217827,120074,321645,143340,822079,290802,830219,568232,1020216,163544,1895732,1122905,329307,331383,381688,1286101,561730,807857,89811,341095,956675,813055,230719,187572,168972,135985,258628,738477,642441,613305,391291,94062,2140784,327428,0,12263478,584353,1119478,762723,633821,136785,1991463,-2517663,586829,4971,72605,65343,368316,12659,18790,92248,1653836,281440,40338,34209,0,32183068 diff --git a/flowsa/data/external_data/BEA_Summary_Use_2016_PRO_BeforeRedef.csv b/flowsa/data/external_data/BEA_Summary_Use_2016_PRO_BeforeRedef.csv new file mode 100644 index 000000000..383bee3f3 --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Use_2016_PRO_BeforeRedef.csv @@ -0,0 +1,80 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","Total Intermediate","F010","F02S","F02E","F02N","F02R","F030","F040","F050","F06C","F06S","F06E","F06N","F07C","F07S","F07E","F07N","F10C","F10S","F10E","F10N","Total Final Uses (GDP)","Total Commodity Output" +"111CA",55880,640,0,36,12,0,2032,0,0,0,0,0,0,0,0,0,0,290,212171,1819,0,0,0,0,7608,0,1313,419,1089,258,271,0,0,0,0,0,0,111,0,0,0,0,0,1,0,0,0,1,4,0,2,1,670,25,897,0,102,0,0,0,0,0,492,34,1623,36,4,-372,0,2434,0,289905,77059,0,0,0,0,-2623,48425,-38920,0,0,0,0,0,0,0,0,0,0,0,0,83941,373846 +"113FF",21360,6174,0,57,0,0,0,12079,1,0,0,0,0,0,0,0,33,152,7347,0,39,4881,46,17,336,1396,0,0,641,0,2,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,197,10,1,0,67,0,0,0,0,0,163,427,3228,167,0,98,14,3288,0,62225,8212,0,0,0,0,803,6058,-16234,0,0,0,0,0,0,0,0,0,0,0,0,-1161,61064 +"211",0,0,9514,8,0,17691,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,9,0,234967,2205,0,4,2,0,1,27,0,0,0,0,0,4,0,12,33,0,0,0,0,0,0,0,0,0,0,0,0,41,0,0,0,14,30,0,0,0,0,19,2,0,21,0,0,861,0,14640,280116,0,0,0,0,0,2033,17929,-115863,0,0,0,0,0,0,0,0,0,0,0,0,-95901,184215 +"212",1616,1,33,6418,29,8618,15005,8,7289,9642,366,87,3,65,49,115,19,98,919,54,0,1078,0,1850,3427,90,10,0,0,0,1,0,109,0,6,1,0,3,2,26,12,158,275,0,0,0,0,28,0,0,0,0,700,31,356,43,223,0,68,29,13,210,503,46,237,801,0,519,0,1582,5348,68218,137,0,194,0,0,402,8131,-995,0,0,0,0,0,0,0,0,0,0,0,0,7868,76086 +"213",0,0,8033,1084,626,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9768,0,75831,1651,0,0,-4,3512,-695,0,0,0,0,0,0,0,0,0,0,0,0,80295,90062 +"22",4756,127,3100,3056,76,31518,5704,1859,3604,6260,4504,2121,1246,772,3152,1179,629,906,9055,1185,71,5656,1319,5269,15760,5006,13370,3482,7261,4318,14247,108,90,107,1699,121,786,1187,11001,909,344,4779,1312,1977,1223,432,1572,12,89998,1032,518,273,4019,7988,3099,603,6194,3078,10345,2499,1207,759,2583,6038,18552,4774,1415,478,1022,20379,2398,377480,260288,0,0,0,0,0,3721,-2381,0,0,0,0,0,0,0,0,0,0,0,0,261628,639108 +"23",1632,39,1135,2079,984,9316,303,194,391,536,641,408,143,119,509,159,89,147,1163,87,11,727,208,8146,1648,510,1975,680,508,492,2391,266,2323,40,346,235,1004,2093,816,86,31,2207,151,3710,1245,315,354,75297,61979,324,113,33,783,557,438,44,608,354,903,268,249,199,397,900,1702,4000,7776,1510,747,29057,48172,289001,0,465009,0,0,526426,0,97,0,0,4840,0,0,0,13376,0,0,0,288970,0,0,1298718,1587719 +"321",397,33,0,137,73,0,40303,20456,387,334,246,775,288,232,3519,275,6119,999,448,49,2,4879,6,0,212,1509,2574,113,499,103,845,0,1961,0,108,0,2,96,201,94,64,743,1104,59,4,4,0,88,6301,348,13,15,617,2,800,13,26,219,214,5,890,4,139,466,794,479,11,14,1,3909,160,105780,4578,186,0,0,5591,770,5187,-19756,0,0,0,0,0,0,109,0,0,0,0,0,-3335,102445 +"327",3,57,577,333,346,165,60637,869,14657,1892,1170,1934,223,1589,6769,286,319,730,5185,156,0,428,2,1656,2042,1732,230,230,68,199,765,0,15,0,48,0,1,43,130,7,1,2447,707,44,75,6,0,100,133,386,5,86,3742,62,1024,128,59,1611,1403,183,278,9,137,91,1723,1164,39,223,0,1714,1908,124984,10899,0,0,0,0,935,8088,-24095,0,0,0,0,0,0,0,0,0,0,0,0,-4173,120810 +"331",70,0,2935,466,227,6,3999,396,731,53447,58951,24710,3150,12818,43297,7387,2895,5075,4885,316,0,472,32,50,42,1400,861,4,0,0,740,0,660,0,0,0,0,292,0,18,8,207,250,0,0,1,0,2,1600,61,0,12,1057,23,303,287,87,62,46,12,166,8,172,10,72,405,58,146,0,285,333,236003,674,0,0,0,0,-625,26565,-61381,0,0,0,0,0,0,0,0,0,0,0,0,-34767,201236 +"332",1571,114,3358,839,765,787,75779,2658,2776,4268,35677,24151,3891,7661,43137,10759,2922,4782,14834,663,196,5171,1681,750,9391,7380,1903,373,133,113,1470,124,369,1574,1149,140,609,914,479,1279,16,10101,1346,116,123,2,17,60,2056,1039,32,1290,4578,696,2289,2118,326,263,566,25,1413,40,467,779,2423,3839,4222,771,617,3566,3442,325228,18855,0,11418,0,0,1342,30963,-62820,0,0,344,0,0,0,271,0,0,0,180,0,553,325781 +"333",3011,194,7030,4415,3268,899,30694,621,204,1302,4310,31960,261,1479,23097,3870,82,1458,3799,33,15,1045,1443,229,4125,1677,2322,268,103,108,793,7,223,18,256,151,43,2831,524,141,37,2414,584,9,38,327,0,37,120,1864,21,1074,2385,506,2395,2852,922,529,412,156,115,21,92,64,522,5932,583,100,180,3687,1370,167660,6702,0,213860,0,0,-1051,90029,-143198,0,0,119,0,0,0,197,0,0,0,2649,0,169307,336967 +"334",172,0,15,18,385,148,7322,928,1103,1665,5055,8702,24646,4337,21765,13356,1108,2301,2828,665,96,618,1819,443,5462,2312,9996,630,236,221,2574,3,80,3,181,4,3,129,211,3422,1084,17493,3967,334,1018,17,552,244,445,318,1298,5149,6990,6306,3291,611,527,8886,456,192,270,12,83,203,71,4556,16459,2146,1,1692,1601,211237,80914,0,188265,0,219,-1479,97498,-309494,0,0,15149,0,0,0,2878,0,0,0,2035,0,75987,287224 +"335",1474,135,110,49,186,50,37407,1569,146,1478,2345,13105,1803,7966,6676,2014,92,998,918,57,5,430,138,172,1001,1034,296,187,33,159,301,1,137,20,54,99,2,33,504,2,0,3846,297,92,59,7,0,26,1168,228,1,1194,4378,97,1944,715,423,22,377,629,408,47,301,500,506,2284,802,1011,55,1627,2149,108378,38161,0,26460,0,4242,518,28578,-90249,0,0,155,0,0,0,261,0,0,0,250,0,8375,116753 +"3361MV",1006,93,414,735,188,73,2013,794,553,597,1195,12155,340,382,221560,3251,321,492,2523,66,1,932,233,277,1151,527,5584,4899,830,216,3074,0,45,0,4136,277,0,216,3127,347,44,1627,164,33,13,0,0,0,0,1017,0,19,2782,659,6601,1516,300,308,622,97,1433,319,62,117,542,12383,3860,53,1513,6095,797,317603,228476,0,280294,0,0,10030,104672,-321680,0,0,12181,0,0,0,8687,0,0,0,26946,0,349604,667207 +"3364OT",0,16,0,34,0,0,7,54,0,0,47,128,0,0,318,68239,0,0,0,0,0,0,0,0,0,0,22,26,0,0,0,1153,1532,2607,9,12,0,1696,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1136,24,37,30,0,0,0,0,0,0,16,0,0,136,31277,605,10,0,203,109378,19179,0,59136,0,0,-10697,124494,-49457,0,0,34151,0,0,0,2310,0,0,0,114,0,179230,288608 +"337",1,0,0,0,0,0,17686,457,1,0,0,324,72,3,54,328,3809,343,0,0,0,1,0,0,0,426,381,221,0,0,1069,0,0,3,0,0,0,18,0,1,0,206,318,0,0,0,0,3126,62,0,15,1,298,5,3,0,0,209,50,1,110,100,259,4,279,230,0,0,1446,10,82,32010,49845,0,24623,0,353,1235,3493,-39823,0,0,0,0,0,0,9,0,0,0,144,0,39878,71888 +"339",193,3,15,31,10,0,968,28,143,43,55,2110,3,685,1782,62,12,5256,35,137,175,0,8,15,541,124,935,188,80,8,1044,0,1,0,6,18,0,233,264,8,2,161,120,135,68,8,0,0,461,87,51,54,1768,16,1584,380,351,16553,18033,926,1196,75,428,47,513,1357,100,138,0,5939,114,65888,91834,0,46373,0,0,1174,31338,-92718,0,0,2,0,0,0,23,0,0,0,89,0,78115,144003 +"311FT",30682,341,0,0,0,0,0,44,237,6,0,0,0,0,0,0,0,6,180806,12,722,1285,602,514,3701,151,2253,5,2776,761,1113,212,2,405,26,0,0,51,0,45,12,0,61,0,0,0,0,0,0,0,0,0,5516,103,0,0,6115,12,8693,6605,8055,524,4717,7209,45325,2777,2175,11,605,59046,0,384321,589407,0,0,0,0,7075,61901,-88465,0,0,0,0,0,0,0,0,0,0,0,0,569919,954240 +"313TT",225,71,0,2,0,0,2135,578,410,0,0,962,1,1,4024,759,2729,1994,151,8523,1656,3008,461,112,9,2507,1682,72,118,2630,2038,0,0,159,14,0,1,74,3,10,113,12,10,0,0,0,0,2,206,186,0,0,255,6,179,106,41,54,657,1993,919,0,292,1622,248,1264,698,165,1,2465,39,48652,20912,0,1549,0,598,769,8377,-31113,0,0,0,0,0,0,11,0,0,0,1,0,1104,49756 +"315AL",34,0,0,0,0,3,0,0,1,0,0,0,0,0,1896,0,0,58,11,539,1406,0,1258,16,0,1,700,200,8,204,559,0,0,0,0,0,0,0,0,17,16,800,2,0,0,0,0,0,0,100,0,0,35,11,228,94,71,138,161,0,804,109,21,11,88,1653,85,19,47,2563,44,14010,144475,0,0,0,0,-652,4345,-142484,0,0,0,0,0,0,0,0,0,0,0,0,5685,19694 +"322",412,0,40,157,39,92,2299,624,1553,1163,2388,1894,393,974,2747,606,1093,1945,27944,460,64,37890,7179,334,6763,4695,4541,108,1347,354,1464,17,44,9,187,945,17,2763,465,1918,82,541,202,940,886,124,2,2,1159,905,480,278,3316,612,3652,255,197,1160,2876,1303,757,84,148,1656,2442,1162,97,872,51,12399,45,156611,21131,0,0,0,0,65,20460,-22320,0,0,0,0,0,0,0,0,0,0,0,0,19337,175948 +"323",27,0,5,2,0,8,35,34,0,0,1,10,0,2,5,0,0,0,212,0,23,0,1661,22,733,0,8673,158,200,137,4073,2,15,0,228,60,2,484,9,6866,589,563,4030,617,1675,1479,0,0,98,248,694,181,5262,715,2556,16,944,1638,1956,148,1396,649,178,710,594,2062,526,705,46,11686,572,66221,5866,0,0,0,0,-182,2262,-2443,0,0,0,0,0,0,0,0,0,0,0,0,5503,71724 +"324",4809,357,2103,2185,1062,11959,36706,956,528,1633,828,1026,116,1060,473,172,282,626,3264,86,17,1000,992,17212,8470,848,2409,528,297,72,1117,22790,3341,2356,23113,1483,33,6584,171,254,49,461,260,3332,3766,23,346,54,3959,1062,24,328,1447,714,3130,1090,523,820,4507,693,510,126,527,687,1681,2259,7041,256,1909,53393,11028,269324,137852,0,0,0,0,5852,66058,-47789,0,0,0,0,0,0,0,0,0,0,0,0,161973,431296 +"325",22793,1542,4804,2528,912,2938,10574,2268,4454,1436,7535,3904,1881,2373,8958,1344,1843,5771,7994,9254,192,12135,6018,13394,195036,58172,1742,110,46,39,912,1,224,8,212,6,1,109,570,775,145,578,649,74,168,12,0,186,12703,401,158,132,10798,1628,5826,865,485,29803,21582,2254,542,167,587,78,593,4332,1080,1190,121,27077,2606,521629,290475,0,3303,0,0,7163,142140,-236661,0,0,0,0,0,0,0,0,0,0,0,0,206421,728050 +"326",1324,88,53,984,478,60,26241,732,1396,684,2654,6187,1088,1661,25458,2976,4277,5479,19138,367,200,2879,736,568,11981,18605,9838,1325,1466,269,3935,17,6,1,786,23,60,3943,552,567,64,5594,349,159,194,197,0,45,292,1686,96,734,5982,174,1963,358,423,6562,2993,1308,912,25,194,145,5059,4504,1246,294,24,10013,2092,212766,36002,0,182,0,40,1088,24247,-48168,0,0,0,0,0,0,6,0,0,0,0,0,13398,226164 +"42",38405,2416,4484,4062,2180,6295,76393,9012,5692,21644,17460,26424,7656,8857,62909,10738,5551,9064,66608,3137,1545,12524,3864,14327,50090,14858,54676,3966,1988,2095,17892,2895,2182,1438,12738,934,146,5477,2084,6285,243,13808,2321,1902,2701,381,348,562,5804,9181,954,2342,14811,3611,8637,2325,3125,24257,19655,3886,3807,450,2937,3940,15956,12120,10890,1979,1891,38054,8140,822008,544543,25,200864,23941,2667,5254,175317,37534,0,0,8824,458,0,0,3346,602,0,0,6366,1569,1011311,1833319 +"441",7,2,83,184,73,42,2577,193,277,167,376,2644,55,1,3053,956,130,267,1199,34,0,409,113,1,632,203,256,2458,421,104,1483,0,10,0,1211,4,0,12,153,154,22,79,6,17,7,6,0,37,403,443,0,9,796,0,1605,54,0,0,0,0,0,3,13,32,56,5601,0,0,0,0,1,29134,155816,0,31508,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,187336,216470 +"445",51,0,0,0,0,70,247,0,12,0,1,4,0,1,11,0,6,6,11,0,0,2,46,2,90,3,28,12,70,16,82,0,6,1,504,26,0,38,0,3,1,0,9,6,11,1,0,54,78,4,2,2,22,0,246,1,16,13,16,2,4,12,44,94,2259,43,0,1,0,63,0,4353,205910,0,123,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206042,210395 +"452",82,1,8,12,4,115,2026,14,37,11,37,188,6,12,264,55,68,81,185,31,0,40,314,17,361,32,181,230,80,20,245,0,9,2,812,38,1,58,10,34,7,9,55,39,66,4,0,555,318,41,22,11,208,0,602,6,49,90,54,7,30,9,26,248,1036,620,1,18,0,293,0,10142,201389,0,3316,552,497,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,205753,215896 +"4A0",850,9,37,139,9,1320,77866,116,44,30,183,644,34,105,1111,117,568,639,1205,170,3,198,1302,216,3109,161,796,1820,494,489,1873,2,95,545,9865,409,4,1005,25,162,26,41,231,165,277,18,0,5031,1349,122,170,47,1025,0,1547,19,198,520,262,77,174,150,404,1195,10003,2874,12,175,0,2706,0,136582,729560,0,38752,10275,6332,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,784920,921502 +"481",155,2,12,44,253,1059,559,248,374,272,715,442,63,60,452,259,197,269,994,52,17,216,318,107,533,538,6079,147,45,69,280,121,30,194,1617,16,1,1383,59,732,297,1448,1803,3545,3938,269,463,317,9294,827,1139,2067,5484,404,7030,588,760,3090,351,462,550,161,253,356,1276,1048,4456,1442,237,4699,90,77126,125270,0,343,39,2,8,41025,-36979,0,0,23,1,0,0,4,1,0,0,8,3,129748,206874 +"482",1900,56,248,732,75,4106,2193,768,2154,2830,835,399,69,303,1305,303,260,227,6291,78,6,2328,171,2258,4791,1597,303,29,127,37,94,130,212,16,3791,18,1,386,49,55,4,385,35,60,68,102,2,28,277,59,44,27,693,32,424,43,54,254,224,79,89,9,61,114,429,173,160,279,410,1889,2491,50528,7701,0,3256,0,25,366,10355,352,0,0,325,0,0,0,202,0,0,0,471,0,23053,73581 +"483",525,23,195,222,39,545,1163,9,329,532,142,61,26,79,86,35,18,51,1073,35,1,179,2,105,806,198,31,12,19,5,18,25,12,3,28,2,1,10,1,1,0,29,6,5,4,0,0,7,76,5,0,5,885,68,98,17,253,124,146,13,10,3,11,10,40,39,1151,78,581,650,324,11281,20698,0,9,0,0,53,5925,11192,0,0,2,0,0,0,0,0,0,0,0,0,37879,49160 +"484",7325,612,726,1163,352,3730,21738,1978,3368,5454,3693,3721,949,1327,7964,1766,1199,1380,31647,839,181,2943,741,8194,7528,2743,4208,1978,1478,1442,4775,1068,356,224,5795,127,24,3155,216,735,185,1434,683,217,275,89,20,160,1024,379,132,292,3052,383,1500,362,423,1466,1542,493,659,163,972,519,2155,1931,1802,292,643,6621,1281,179992,83723,7,20477,667,377,1092,33091,4281,0,0,505,13,0,0,137,17,0,0,375,44,144805,324796 +"485",0,3,1,8,62,623,608,63,91,71,185,110,13,13,101,58,50,85,211,9,4,53,80,26,119,127,676,57,5,14,78,0,496,0,0,0,0,188,7,215,74,768,688,1372,1140,403,124,344,3043,346,510,722,3450,134,2703,152,331,1527,1317,657,132,1652,63,131,467,319,17,2,15,14033,583,41729,42714,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42714,84443 +"486",125,8,4554,41,13,9647,371,12,8,10,12,16,1,5,4,2,3,5,29,4,0,20,19,14497,278,13,46,8,5,1,18,448,65,46,453,29,1,129,3,5,1,6,5,65,74,0,7,2,58,20,0,6,19,14,59,20,9,11,88,11,8,2,10,11,30,39,138,5,486,993,7947,41101,2659,0,0,0,0,295,3325,0,0,0,0,0,0,0,0,0,0,0,0,0,6279,47380 +"487OS",0,212,20,1484,5,8086,0,936,1000,139,115,14,0,3,9,0,298,186,535,62,0,397,355,442,174,504,41806,1858,780,491,9845,19473,1588,4920,32872,377,192,34570,1099,1768,714,274,2898,460,3233,170,0,0,0,1547,669,358,8470,260,2665,1418,397,1563,2097,359,952,542,868,144,453,1699,2,46,738,755,4137,204503,22735,0,0,0,0,0,9447,2947,0,0,0,0,0,0,0,0,0,0,0,0,35129,239632 +"493",459,0,5,383,0,627,0,157,147,96,1222,453,900,94,155,73,108,334,235,124,87,167,235,189,382,262,26897,10821,9934,12233,30593,10,2,646,4719,121,4,920,12000,738,204,589,778,0,0,35,0,1,95,361,182,102,951,5,2269,107,218,689,795,159,253,181,108,1015,1706,710,125,139,0,4277,123,132711,113,0,0,0,0,0,162,0,0,0,0,0,0,0,0,0,0,0,0,0,274,132985 +"511",58,2,15,0,2,159,650,2,1,5,28,29,10,2,12,79,7,27,7,0,0,4,53,2,41,10,1618,213,112,92,660,3,62,0,26,4,0,217,112,13046,39,673,1466,318,819,85,34,21,355,326,849,681,3788,1932,1790,9,630,1318,841,101,911,22,52,115,88,720,1306,651,387,7765,109,45568,78385,0,0,94749,0,-140,35972,-4181,0,0,0,1621,0,0,0,2132,0,0,0,5563,214100,259668 +"512",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,243,174,0,117,1,0,0,1,0,10,6,0,66,20007,41275,5,10,14,0,0,0,69,427,4,9,1594,132,31,0,1551,22,7,717,602,91,47,1314,1470,691,915,249,7,561,0,72468,25541,0,0,36716,0,40,20272,-7669,0,0,0,0,0,0,0,0,0,0,0,0,74900,147367 +"513",637,41,724,265,407,1844,8795,271,358,270,979,790,286,174,464,338,174,479,1032,92,28,269,429,208,975,585,16792,2197,748,632,8901,197,175,115,1904,712,92,2361,642,3173,371,113721,6254,8649,6804,3297,1030,1858,16450,1332,3851,3190,12352,5655,11955,671,2424,5499,3381,979,1167,390,1057,2580,5569,4648,4569,2587,723,45159,1224,338954,337957,0,6932,29084,0,0,14092,-170,0,0,0,0,0,0,0,0,0,0,0,0,387896,726850 +"514",0,0,48,8,8,1889,1270,379,483,320,1029,898,207,143,315,673,272,394,867,81,39,318,185,113,437,459,4368,2619,1257,1027,5316,72,2,0,77,42,4,545,149,2575,124,3816,10278,7113,3118,1179,1173,30,821,4828,2627,2081,15043,5807,20482,745,4798,1683,3187,362,1331,497,657,766,3552,6766,10936,3110,356,14447,1921,162521,47643,0,0,9124,0,0,5228,-1161,0,0,0,454,0,0,0,443,0,0,0,1201,62932,225453 +"521CI",1620,86,1581,762,962,9163,8858,335,927,936,1455,1240,567,346,1240,621,480,741,3200,202,85,301,332,215,1692,1269,20521,2386,3003,2961,14811,463,6225,622,2334,6747,26,1206,1002,1912,1082,4152,1560,36477,35400,5629,3677,102919,64063,16176,2984,2599,18639,14953,9535,299,2916,8444,1706,2294,1349,453,1301,1686,2833,14632,213,193,3999,5192,9849,480638,254673,0,0,0,0,0,52896,-48,0,0,0,0,0,0,0,0,0,0,0,0,307520,788158 +"523",315,35,2713,1367,2529,733,2471,52,84,1107,1573,1256,70,255,1217,619,429,710,210,15,4,32,52,36,55,112,2170,169,239,393,861,1013,773,6239,440,920,16,1540,38,376,218,362,121,25456,44543,2958,95658,98,6015,725,732,363,2774,7758,1876,54,656,1372,6093,477,1599,300,94,2590,2878,15125,9,120,138,25522,1794,281721,225905,0,0,0,0,0,62032,-61,0,0,0,0,0,0,0,0,0,0,0,0,287876,569597 +"524",2796,1085,5438,1755,1848,1266,633,289,1059,798,951,1498,224,810,1699,1445,465,632,3360,375,170,350,105,242,2431,622,26995,2763,1292,1174,6880,244,46,397,8961,2011,368,2184,1691,548,1370,2457,729,6243,14594,366891,7627,13699,49824,3451,3026,940,8332,303,7740,1117,2147,6321,57605,1706,4362,1638,1485,1736,3709,3877,0,62058,643,2356,10856,736744,355395,0,0,0,9799,0,17249,-52268,0,0,0,0,0,0,0,0,0,0,0,0,330174,1066919 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7625,14458,0,0,0,0,0,0,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22141,160017,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160017,182158 +"HS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1962981,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1962981,1962981 +"ORE",30593,116,861,109,137,4801,24763,541,631,368,3617,1354,2816,416,1557,3688,889,1125,2885,458,95,849,1394,55,3349,1959,79079,14868,18548,12968,93132,305,229,317,6236,668,249,3521,19825,6185,3964,16770,8475,27477,26558,35406,638,7198,115044,9803,24233,5644,45601,29737,16284,1711,36463,48712,35183,25315,17838,8029,12293,7958,69706,47458,3784,6200,667,34096,3517,1077317,5663,21672,0,0,115994,0,3210,0,0,0,0,0,0,0,0,0,0,0,0,0,146540,1223857 +"532RL",4233,169,2953,1510,1907,1431,20804,314,928,901,2334,1682,493,549,1997,1304,226,1163,4061,136,79,874,565,1000,5182,941,27043,1197,1605,2141,9087,8714,4158,500,11467,1167,120,2076,1248,2568,2847,11756,6278,5775,6671,3172,28,74,2501,6968,3102,2290,15458,18815,6641,1748,2064,5139,5621,710,535,1462,1579,2329,7954,2250,326,184,640,7054,511,263307,101538,0,0,0,0,0,75467,0,0,0,0,0,0,0,0,0,0,0,0,0,177005,440312 +"5411",435,97,2792,741,1061,5218,7541,295,337,241,1539,1092,2963,219,1471,3003,202,1022,980,169,101,349,269,456,3162,677,14270,620,332,779,3446,154,631,174,237,129,44,608,264,3381,686,3893,2988,4265,8240,15299,1611,1683,21179,585,2062,3838,12646,9559,8131,450,394,4949,12957,1275,867,1676,2185,2389,3346,3436,1155,194,1512,10171,850,205971,98630,0,0,0,23652,0,12998,-3242,0,0,0,0,0,0,0,0,0,0,0,0,132038,338009 +"5415",452,54,4290,283,24,1910,6315,247,274,280,1392,1964,322,98,523,1424,185,424,934,97,23,243,401,400,960,471,13856,2772,720,918,4509,76,1437,5,520,110,2,236,378,5640,441,5958,7684,8030,8434,2393,718,228,2310,546,3520,4914,15822,20037,11055,278,1634,5298,8381,1240,1201,217,868,861,2214,3020,23400,11702,585,20403,2524,231087,0,0,22616,197510,0,0,25730,-31030,0,0,274,7718,0,0,0,19892,0,0,52,8379,251141,482228 +"5412OP",2054,791,4037,3069,4230,13687,64954,1883,2461,2585,6780,4879,6033,1321,5110,5285,1788,4427,12864,897,486,2004,1731,2129,11755,4249,101407,18002,7610,7916,54808,578,2727,1174,3086,976,396,2600,1949,18491,9783,53681,27182,60651,41179,21388,2874,816,95872,9751,9208,19926,116326,50492,46323,2866,5409,29947,37755,8421,5965,5396,6295,12329,32896,22513,38060,6282,2529,56971,18687,1250981,70300,0,28814,405629,2671,0,141387,-94876,0,0,0,51581,0,0,0,75468,0,0,0,19123,700097,1951077 +"55",0,0,9663,3344,889,24,7967,916,2108,1248,8370,14529,10730,1827,11629,5315,613,3082,22486,1102,1031,2717,1023,9832,25068,2993,77598,1522,4536,20535,23950,296,23,961,8906,675,12,4223,568,7846,657,3260,1446,4462,12523,2199,591,36,2656,3976,5915,5085,22023,95,49033,3164,4372,25941,8236,3912,2195,2125,1804,19035,52110,7646,0,0,519,0,0,545172,0,0,0,0,0,0,4073,0,0,0,0,0,0,0,0,0,0,0,0,0,4073,549245 +"561",750,68,757,804,970,18760,10930,822,1425,2814,7231,2097,2365,523,3348,3978,381,1421,3901,411,393,1684,2912,1676,5277,2083,61289,5246,3535,3458,24350,1835,1486,5308,12168,3777,539,7961,5207,13921,2134,35152,20403,19941,13650,6349,322,4005,100731,13957,9167,25464,55338,8734,58151,3526,3858,29585,51849,9350,3722,3655,2821,7686,11878,12867,14423,1275,3158,37112,6995,805116,59847,0,0,0,0,0,2051,-1742,0,0,0,0,0,0,0,0,0,0,0,0,60156,865273 +"562",276,14,940,293,186,761,3242,133,269,374,420,225,91,70,221,154,107,130,1417,102,10,332,99,457,2082,341,2357,901,474,263,1692,12,90,40,512,57,4,337,909,125,27,204,63,547,107,873,502,18,12518,322,98,100,1477,640,1659,9471,598,1707,2047,773,640,82,688,1353,2696,1536,519,211,241,19499,3918,85652,24527,0,0,0,0,0,118,-210,0,0,0,0,0,0,0,0,0,0,0,0,24434,110087 +"61",16,4,0,0,0,277,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,78,9,0,3,2240,36,1076,0,4749,104,48,0,0,0,2,31,0,0,0,107,200,19,10,0,0,0,0,0,0,54,93,0,1006,0,4122,1,16,0,0,1559,222,0,0,3760,1393,36,172,17457,15,38925,342046,0,0,0,0,0,2748,-1463,0,0,0,0,0,0,0,0,0,0,0,0,343331,382256 +"621",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,0,107,0,0,15777,14114,102,6,122,2,0,0,136,0,407,0,9247,0,40087,1002207,0,0,0,0,0,86,0,0,0,0,0,0,0,0,0,0,0,0,0,1002292,1042379 +"622",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6253,0,0,0,0,0,0,0,0,0,0,0,0,6253,1029943,0,0,0,0,0,1984,-3975,0,0,0,0,0,0,0,0,0,0,0,0,1027953,1034206 +"623",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2199,0,812,0,3011,237578,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,237578,240589 +"624",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,780,0,780,199269,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,199269,200049 +"711AS",80,2,1,0,15,178,183,38,40,48,83,54,4,6,48,28,18,35,130,8,2,34,38,23,48,81,1632,607,501,42,453,13,261,0,45,11,0,308,72,213,5811,27988,278,1002,637,208,179,11,5369,207,494,372,4017,2813,1982,78,1324,672,574,184,202,17115,790,381,1721,2405,1033,24,90,1164,17,84529,73630,0,0,5060,0,0,1500,-1528,0,0,0,0,0,0,0,0,0,0,0,0,78662,163191 +"713",17,0,0,1,6,29,67,6,9,7,18,10,1,1,9,6,5,8,20,1,0,5,8,2,11,13,184,3,25,1,257,0,0,0,0,0,0,2,1,22,7,49,71,136,114,23,12,13,300,21,59,77,245,433,378,16,50,169,7,21,28,120,6,348,286,36,117,1,0,431,256,4585,189610,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,189610,194195 +"721",2,0,4,26,171,1239,571,171,244,190,501,302,36,40,269,159,134,231,572,31,10,143,300,69,327,400,2116,26,76,40,249,0,22,0,0,0,1,723,181,699,262,1577,2261,4281,3660,697,402,417,9466,947,1466,2323,6299,839,7462,652,667,3470,240,378,430,136,156,515,1551,976,1207,423,60,3506,191,67194,152092,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,152092,219286 +"722",636,54,28,58,331,2324,606,258,312,301,615,418,53,73,353,209,156,282,886,60,17,215,275,157,413,476,5315,1035,1064,873,3863,3963,7,24,645,128,9,1883,204,645,432,1565,2039,6585,3857,3122,985,3286,29227,1455,2666,3058,16833,3472,14952,589,2359,20557,10934,10482,2071,606,1734,8821,4279,3524,469,135,1416,15682,598,207016,705826,0,0,0,0,0,2574,0,0,0,0,0,0,0,0,0,0,0,0,0,708401,915417 +"81",440,445,129,155,415,893,9359,405,817,1076,1443,834,351,217,997,359,180,334,2280,174,20,1418,426,706,3116,1031,22726,2121,2718,1747,8197,281,169,129,13029,796,341,3625,1291,1111,213,4191,2260,6972,3463,6018,718,65,7426,9130,1372,826,8591,5512,10059,2596,1395,6398,17510,1819,943,913,1496,2402,10203,8746,2846,279,1377,24241,2087,238367,603250,0,0,0,0,0,74,-4309,0,0,0,0,0,0,0,0,0,0,0,0,599015,837381 +"GFGD",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,588899,0,0,0,0,0,0,0,0,0,0,0,588899,588899 +"GFGN",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,376809,0,0,0,0,0,0,0,376809,376809 +"GFE",19,4,0,7,0,269,11,0,0,14,38,356,2,205,0,0,0,33,0,1,0,0,78,32,86,0,16285,689,474,312,4081,1,0,2948,3655,207,10,1089,347,662,293,329,1173,2381,12259,77,0,3,429,572,346,171,2493,185,1358,138,647,902,1663,304,421,134,87,1140,3599,1404,0,137,2,1958,160,66681,6583,0,0,0,0,0,548,-299,0,0,0,0,0,0,0,0,0,0,0,0,6832,73513 +"GSLG",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1697401,0,0,0,1697401,1697401 +"GSLE",0,5,0,0,0,3730,0,47,122,180,172,99,51,37,98,51,33,54,699,54,7,163,38,235,1122,134,891,296,241,117,768,1,0,0,146,6,1,105,464,77,33,123,56,349,167,57,0,0,950,716,439,138,1606,321,1341,96,117,585,688,296,2264,39,205,682,1353,807,465,254,211,5696,980,31273,69429,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,69429,100702 +"Used",-39,113,0,-19,505,4099,1733,0,49,14299,203,2,0,0,0,0,0,90,0,12,0,1787,0,0,27,28,0,21,0,0,219,-169,0,-124,-102,1,62,3015,1,0,92,1,0,0,0,0,0,0,0,-46,0,0,0,113,0,0,823,2,0,0,0,-143,485,0,0,11253,-49,0,0,0,0,38346,82890,-2371,-126566,0,-65,5348,17763,-13635,0,-4,286,0,0,-1085,484,0,0,3526,3082,0,-30347,7999 +"Other",1060,70,1301,57,354,1352,2114,232,233,734,857,1483,1353,398,1645,723,147,518,2563,122,28,530,271,2808,2798,654,6003,51,611,658,3173,14001,211,2089,1244,16,45,468,98,1028,413,8522,834,3381,28737,1747,196,1803,3862,932,367,1296,3091,1607,1557,99,647,0,0,319,0,279,270,803,1804,707,10223,3398,965,0,0,131961,-94843,0,0,7878,0,0,200178,-241951,0,0,0,0,0,0,0,0,0,0,0,0,-128738,3223 +"Total Intermediate",249785,16620,91922,48722,29688,196631,747443,69351,67272,146748,194571,208864,78349,62768,530894,160961,44019,69858,681204,33708,9363,118619,44463,347259,420954,150932,716379,98222,84157,86726,390631,81030,35024,36263,182507,24837,5294,112103,71388,112022,55796,415396,129775,260004,297910,491125,137240,224690,752003,111734,85932,102285,499191,215885,362870,47607,106924,330385,390316,97069,78960,53738,57425,109476,352378,270731,215627,117717,34674,706219,191320,14159952,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V001",29030,24619,33722,16383,24396,81409,485888,21052,28007,30388,95605,90788,142701,34952,72429,77315,20968,51757,107643,12034,8060,29957,26146,19421,99020,44897,511034,114735,93460,91737,287735,53399,21943,7056,92645,20768,7228,80880,48606,118894,35656,112702,61783,248127,228639,255773,1609,18028,88004,34641,126066,246312,566699,304599,382677,27177,190531,519488,380869,128648,107508,56253,51873,79693,282334,295297,242160,178953,58609,1303303,104374,9977096,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V002",-2013,1510,30477,4641,2284,59961,9525,738,1501,2503,3283,3590,8096,931,3547,2590,403,1720,30184,578,294,1717,980,4255,15892,1731,212918,47431,24308,40123,110770,23158,205,782,4286,1756,3046,2399,832,5676,6696,39401,4348,18403,5317,41898,757,224497,25284,19707,16712,6254,13951,8762,9442,3415,8841,9037,12374,6002,1932,8402,11843,28214,53434,22270,0,0,-6004,0,-19908,1249888,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V003",102875,9826,74366,26384,5426,160636,252296,13541,27997,23970,47155,49392,117263,22578,79503,68542,8914,34051,126825,5968,1259,26722,14096,62030,242137,33229,411894,39556,30595,12059,160479,52625,17934,5632,51933,20165,28920,27579,8595,109954,51467,294586,129104,350685,33475,273926,16373,1503366,328445,166282,109357,52292,257840,37587,119546,17460,46838,154414,67765,8300,10097,57577,21274,52300,87269,82889,156953,105819,6515,195334,58087,7468126,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"Total Value Added",129892,35956,138565,47408,32107,302006,747709,35332,57504,56861,146044,143770,268060,58462,155480,148448,30285,87529,264652,18579,9613,58396,41221,85707,357049,79857,1135846,201722,148362,143919,558984,129182,40083,13470,148864,42690,39194,110858,58033,234524,93819,446688,195235,617214,267431,571596,18740,1745890,441733,220630,252136,304859,838490,350948,511666,48052,246210,682939,461009,142950,119536,122232,84990,160207,423037,400456,399112,284773,59120,1498637,142552,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18695111,0 +"Total Industry Output",379678,52575,230486,96130,61795,498637,1495152,104683,124776,203609,340615,352634,346409,121230,686373,309408,74304,157387,945857,52287,18977,177015,85684,432966,778003,230789,1852225,299944,232520,230645,949615,210211,75106,49734,331371,67526,44488,222961,129421,346546,149615,862085,325011,877218,565341,1062721,155980,1970581,1193736,332364,338068,407144,1337680,566833,874536,95658,353134,1013324,851325,240019,198496,175969,142415,269683,775415,671187,614739,402490,93794,2204856,333872,0,12693271,560360,1087752,821224,699441,36259,1947445,-2453695,588899,4836,72341,61846,376809,12291,18936,98554,1697401,292496,42763,35882,0,32855063 diff --git a/flowsa/data/external_data/BEA_Summary_Use_2017_PRO_BeforeRedef.csv b/flowsa/data/external_data/BEA_Summary_Use_2017_PRO_BeforeRedef.csv new file mode 100644 index 000000000..c5c3833a3 --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Use_2017_PRO_BeforeRedef.csv @@ -0,0 +1,80 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","Total Intermediate","F010","F02S","F02E","F02N","F02R","F030","F040","F050","F06C","F06S","F06E","F06N","F07C","F07S","F07E","F07N","F10C","F10S","F10E","F10N","Total Final Uses (GDP)","Total Commodity Output" +"111CA",64162,706,0,34,18,0,1945,0,0,0,0,0,0,0,0,0,0,192,214788,1879,0,0,0,0,7108,0,1371,445,1318,311,340,0,0,0,0,0,0,130,0,0,0,0,0,2,0,0,0,1,4,0,2,1,788,33,1023,0,131,0,0,0,0,0,571,43,1903,40,4,-198,0,2643,0,301737,82432,0,0,0,0,-4182,49627,-41297,0,0,0,0,0,0,0,0,0,0,0,0,86580,388317 +"113FF",22531,7765,0,81,0,0,0,11395,1,0,0,0,0,0,0,0,39,172,7862,0,34,5639,50,19,383,1740,0,0,812,0,2,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,14,2,0,81,0,0,0,0,0,233,489,3728,193,0,102,15,3874,0,67507,9806,0,0,0,0,780,6554,-17959,0,0,0,0,0,0,0,0,0,0,0,0,-819,66688 +"211",0,0,20585,0,0,23911,0,1,0,13,0,0,0,0,0,0,0,0,0,0,0,0,0,285152,3289,0,17,1,0,1,28,0,0,0,0,0,6,0,5,1,0,0,0,0,0,0,0,0,0,0,0,0,8,1,0,0,1,1,0,0,0,0,10,1,0,7,0,0,1010,0,18507,352559,0,0,0,0,0,-1146,37009,-147082,0,0,0,0,0,0,0,0,0,0,0,0,-111219,241339 +"212",1935,1,55,5921,54,9624,16435,7,7918,10047,395,107,2,69,48,188,17,78,943,52,0,1099,0,2566,3945,112,15,0,0,0,2,0,133,0,6,1,0,3,2,35,15,198,389,0,0,0,0,32,0,0,0,0,960,49,487,61,240,0,65,35,39,256,591,70,332,874,0,603,0,1793,5697,74598,320,0,111,0,0,-929,12157,296,0,0,0,0,0,0,0,0,0,0,0,0,11955,86553 +"213",0,0,11461,1265,887,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13648,0,108722,2456,0,0,8,3045,-1048,0,0,0,0,0,0,0,0,0,0,0,0,113182,126831 +"22",4462,155,3883,2733,114,28534,5088,1509,3219,5946,4007,1968,812,651,2703,1112,556,824,8416,1074,57,5183,1108,6330,14964,4594,15664,3664,8140,4797,16358,107,101,115,1797,143,720,1374,11874,906,324,4589,1571,2565,1197,731,1695,17,94966,1226,542,291,4271,8840,3380,642,7073,3219,10470,2433,1240,776,2623,6375,19690,4676,1342,444,865,21415,2169,387418,266620,0,0,0,0,0,4011,-2436,0,0,0,0,0,0,0,0,0,0,0,0,268195,655613 +"23",1603,50,1242,1876,1411,9712,276,220,360,571,588,415,109,105,576,208,87,138,1247,94,10,653,194,7687,1691,495,2423,740,597,571,2900,256,2442,36,341,192,929,1981,903,91,30,2199,191,3711,1189,431,368,76766,62590,312,122,36,882,646,527,51,655,387,971,272,269,213,445,992,1888,4315,8423,1581,612,30165,49573,296836,0,471777,0,0,574515,0,99,0,0,5599,0,0,0,12844,0,0,0,300792,0,0,1365627,1662463 +"321",506,72,0,425,309,0,43115,24983,250,435,225,752,246,362,3333,206,6513,1148,456,46,5,5766,4,0,231,1344,4455,100,746,145,1204,0,2018,0,134,0,1,92,263,76,62,883,1298,75,4,7,0,84,5070,343,11,12,666,3,644,16,27,297,229,4,812,7,146,503,890,479,7,9,1,3601,159,116315,3357,75,0,0,6753,63,5835,-21322,0,0,0,0,0,0,5,0,0,0,0,0,-5235,111080 +"327",23,63,849,485,847,84,65343,705,13449,1874,1090,2429,168,1417,6719,405,306,799,4664,137,0,365,2,1741,1802,1611,153,322,84,306,958,0,19,0,101,0,0,44,194,7,2,2795,1025,74,68,9,0,107,81,413,1,77,3324,95,1073,164,68,2393,1761,211,305,9,127,135,2224,1239,30,219,0,1645,2091,131331,10409,0,0,0,0,216,8307,-25848,0,0,0,0,0,0,0,0,0,0,0,0,-6916,124415 +"331",81,0,4340,639,453,6,4786,443,949,60624,62952,29568,2651,13341,49885,10199,3640,5392,4919,152,0,655,31,67,64,1524,1018,5,0,0,647,0,684,0,0,0,0,394,0,28,11,283,426,0,0,1,0,2,2214,79,0,2,1323,42,444,431,108,93,25,18,256,16,276,17,132,509,93,180,0,112,522,267754,876,0,0,0,0,2109,29381,-80232,0,0,0,0,0,0,0,0,0,0,0,0,-47866,219888 +"332",1882,181,5338,1045,897,547,80184,2357,2596,4065,35507,22679,3523,7142,42006,12806,2762,5256,14467,569,115,5217,1603,701,9421,6673,2920,467,161,96,1664,124,464,1794,1242,156,545,851,720,1316,27,10945,1869,184,154,3,15,60,1300,1207,28,1047,4532,922,2370,2227,387,289,953,34,1823,40,430,906,3018,4099,3035,643,662,3767,4222,333258,17458,0,12277,0,0,2056,31466,-65468,0,0,521,0,0,0,85,0,0,0,11,0,-1596,331662 +"333",2884,224,8051,4193,4470,1374,35016,446,160,898,4240,28739,294,1686,24075,4432,85,503,3775,30,0,786,1741,174,3323,1632,2722,178,135,95,907,2,137,24,249,181,33,2733,587,131,37,1929,618,9,42,814,0,26,96,687,33,1202,2354,487,2723,3113,2055,645,527,199,118,50,137,78,638,6543,573,85,27,4537,1953,173682,8145,0,228677,0,0,2493,97173,-159390,0,0,2048,0,0,0,44,0,0,0,693,0,179882,353564 +"334",49,1,20,22,267,147,6234,799,1000,1462,4185,7708,23136,3283,19217,19557,1023,2460,2221,561,68,791,2072,421,5754,2256,13173,880,358,287,3008,2,64,2,206,5,3,140,314,3593,464,19591,5000,557,1112,41,701,302,562,362,1252,5656,8440,8253,4025,623,1072,8592,476,190,382,23,153,290,94,4623,21756,2139,1,2098,1564,227140,85762,0,199312,0,233,1260,97654,-331571,0,0,17852,0,0,0,1518,0,0,0,799,0,72820,299960 +"335",2148,239,104,59,414,26,37961,1772,111,1163,1942,13233,1309,9006,6985,2397,74,1034,740,42,3,335,111,142,1090,876,845,245,78,378,437,1,194,22,59,88,1,59,186,3,0,4817,357,157,71,7,0,34,1282,218,0,1285,4366,122,2043,809,489,24,487,872,530,57,382,645,571,5023,1966,1430,47,1428,3028,118459,38025,0,27307,0,4231,1246,29520,-100843,0,0,603,0,0,0,40,0,0,0,66,0,194,118653 +"3361MV",960,146,663,806,285,36,1940,588,474,463,1043,11425,236,304,207880,3506,266,406,2176,47,1,836,195,238,979,414,7612,5413,1171,238,4496,0,53,0,4131,373,0,127,3864,314,61,1290,171,49,16,0,0,0,0,1107,0,29,3118,825,7042,1210,324,422,852,120,1643,650,92,151,700,14557,4073,44,1420,6517,778,311364,237966,0,276452,0,0,8405,105859,-326644,0,0,2916,0,0,0,14111,0,0,0,30262,0,349328,660692 +"3364OT",0,28,0,12,0,0,33,15,0,0,39,60,0,0,236,72760,0,0,0,0,0,0,0,0,0,0,4,104,0,0,0,1404,1507,2309,9,18,0,2164,0,0,0,8,0,0,0,0,0,0,0,0,0,0,426,10,54,44,0,0,0,0,0,0,25,0,0,615,37139,281,2,0,83,119389,19040,0,71043,0,0,-4448,117435,-49377,0,0,43861,0,0,0,485,0,0,0,361,0,198400,317789 +"337",0,0,0,0,0,0,17280,292,1,0,0,263,41,2,39,262,4126,207,0,0,0,0,0,0,0,277,611,269,0,17,1483,0,0,0,0,0,0,0,0,1,0,177,420,0,0,0,0,3332,41,0,9,1,314,3,2,0,0,275,61,1,111,111,259,2,317,289,0,0,1252,13,37,32197,52543,0,25593,0,376,1399,3552,-43633,0,0,1,0,0,0,3,0,0,0,29,0,39862,72059 +"339",150,4,24,34,19,0,1697,8,115,19,34,1944,1,533,1779,55,30,5071,23,19,115,0,7,3,434,106,1057,301,99,4,1254,0,1,0,7,15,0,218,359,7,2,201,112,116,40,17,0,0,198,63,48,13,1875,20,1423,195,361,16698,16774,1020,1065,76,385,43,462,1410,123,113,0,6038,39,64478,97283,0,47705,0,0,1773,31047,-95237,0,0,43,0,0,0,7,0,0,0,29,0,82650,147128 +"311FT",30440,269,0,0,0,0,0,22,242,6,0,0,0,0,0,0,0,4,167080,20,721,1277,528,447,3554,145,2337,3,3001,770,1323,451,2,558,41,0,0,44,0,52,22,0,74,0,0,0,0,0,0,0,0,0,5365,36,0,0,5797,15,8525,6792,9332,814,5445,7811,51024,2705,2058,118,614,60055,0,379941,604946,0,0,0,0,-717,63738,-92753,0,0,0,0,0,0,0,0,0,0,0,0,575214,955155 +"313TT",66,49,0,2,0,0,2739,512,516,0,0,1009,2,0,4069,1186,2543,2103,114,6771,1358,3214,433,100,1,2238,2512,65,141,2470,2348,0,0,75,19,0,1,78,3,4,143,8,9,0,0,0,0,2,106,159,0,0,331,9,135,95,51,73,593,2265,1003,0,369,1897,269,1185,536,130,1,2485,12,48606,20133,0,725,0,585,139,8444,-31999,0,0,0,0,0,0,5,0,0,0,1,0,-1968,46639 +"315AL",64,0,0,0,0,1,0,0,1,0,0,0,0,0,1669,0,0,96,13,385,1158,0,936,10,0,1,744,103,4,294,447,0,0,0,0,0,0,0,0,16,18,905,1,0,0,0,0,0,0,89,0,0,26,10,204,82,94,84,87,0,885,102,35,14,100,1585,95,20,65,2675,31,13151,137186,0,0,0,0,6704,4218,-142383,0,0,0,0,0,0,0,0,0,0,0,0,5726,18876 +"322",450,1,66,188,71,50,2753,536,1347,1040,2031,1727,299,878,2590,714,1033,1783,28192,381,44,36715,5650,317,6295,4100,6436,138,1842,476,2012,17,60,7,209,1223,15,2885,517,1883,102,726,311,1425,800,167,4,2,1032,982,516,346,3730,745,3813,281,212,1382,3293,1573,956,105,211,2047,3387,1344,118,813,52,12038,31,159513,22168,0,0,0,0,-639,21458,-22606,0,0,0,0,0,0,0,0,0,0,0,0,20380,179893 +"323",19,0,4,1,0,5,40,5,0,0,0,4,0,1,3,0,0,0,98,0,5,0,1968,3,366,0,9209,150,204,121,4504,7,12,0,349,70,1,217,8,6771,580,508,4459,998,1178,2361,0,0,101,223,889,210,5706,1556,3085,14,918,1683,1974,146,1348,730,249,659,576,2025,424,485,14,10151,614,68006,3399,0,0,0,0,490,2063,-2607,0,0,0,0,0,0,0,0,0,0,0,0,3345,71351 +"324",6208,529,3654,2972,2164,17462,42436,795,520,1430,521,853,76,1299,459,228,247,555,3085,88,11,1381,842,14333,10128,819,4090,805,497,130,1676,22308,5375,2699,25988,1822,51,10797,205,345,71,652,470,6182,4340,39,494,96,4644,1455,41,582,1819,1230,3884,1175,660,1036,4887,803,625,152,971,1060,2675,2877,10658,327,2114,73004,13978,332880,166865,0,0,0,0,-3763,87633,-52871,0,0,0,0,0,0,0,0,0,0,0,0,197864,530745 +"325",22463,1787,5459,2547,1369,2637,13108,2147,4168,1132,6831,3827,1560,2353,8976,2125,1694,5911,9233,9606,243,12507,5523,13163,203550,63518,2042,123,65,46,1126,1,283,8,227,7,1,105,964,776,161,696,800,130,150,20,0,187,11904,413,143,128,12338,1863,6814,1102,999,29190,14656,2462,499,395,813,87,1011,4687,682,1120,114,33272,2795,542842,299269,0,1919,0,0,3656,148114,-239649,0,0,0,0,0,0,0,0,0,0,0,0,213309,756151 +"326",1574,150,58,1247,688,26,30325,598,1072,583,1985,5814,759,1380,22558,3422,3585,4593,19789,316,94,2829,810,440,10054,18432,18846,1777,1888,397,5259,13,7,0,459,25,40,3175,522,476,88,5388,462,108,112,219,0,68,360,1528,44,709,5461,163,1895,302,502,7628,3192,1534,767,44,271,174,5942,4676,1087,222,11,9193,2460,220676,36459,0,262,0,36,1346,25036,-51756,0,0,0,0,0,0,4,0,0,0,0,0,11387,232064 +"42",39356,3096,5846,4186,3589,6794,83425,8959,5364,23900,16181,26033,5989,8292,61164,12882,5463,8411,65030,2702,1313,13116,3501,15277,48316,14282,61272,4343,2371,2246,20908,2841,2688,1329,12345,1005,143,5913,2851,6317,280,14579,3027,2997,2593,676,441,601,5421,8894,984,2467,15633,4404,9393,2332,4045,24359,16588,4371,4097,652,3339,4522,18158,14363,12573,1837,1757,40686,9316,854423,569643,10,206941,25740,2769,8356,187731,38513,0,0,7550,481,0,0,2244,626,0,0,4883,1656,1057142,1911565 +"441",7,2,120,208,126,22,2582,138,225,126,274,2349,41,1,2630,1077,103,212,987,24,0,357,91,1,519,156,257,2591,549,109,2022,0,12,0,1271,5,0,13,157,136,29,94,8,23,8,16,0,39,349,465,0,14,818,0,1794,61,0,0,0,0,0,4,19,41,65,6385,0,0,0,0,1,29731,156788,0,32851,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,189650,219381 +"445",61,0,0,0,0,83,301,0,10,0,1,3,0,1,9,0,4,5,10,0,0,1,43,2,95,2,32,19,82,20,95,0,8,1,507,29,0,52,0,3,1,0,7,10,8,1,0,58,75,5,2,2,20,0,277,1,15,13,16,2,3,15,52,102,2417,59,0,1,0,62,0,4705,215002,0,154,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215165,219871 +"452",79,1,10,13,7,106,1953,10,28,7,25,152,4,8,203,57,46,58,152,28,0,33,280,13,313,26,194,276,97,22,277,0,11,1,667,34,1,64,9,31,5,9,40,58,43,5,0,568,295,40,24,10,187,0,591,7,52,87,45,7,23,9,26,294,973,695,1,15,0,291,0,9693,204023,0,3446,508,603,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,208581,218274 +"4A0",1040,15,47,162,17,1578,80213,109,38,24,139,587,23,80,934,145,407,479,1094,137,1,189,1229,215,2899,158,957,2560,662,521,2251,2,143,535,10109,471,4,1378,28,166,19,46,185,269,200,21,0,5407,1532,131,206,48,1034,0,1589,25,205,587,249,94,161,168,433,1494,10477,3636,10,146,1,2810,0,142929,766745,0,40176,11094,6645,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,824660,967589 +"481",164,2,16,36,359,893,479,148,286,274,508,372,38,49,383,164,163,210,844,44,12,167,231,97,471,461,6649,151,52,69,339,160,31,280,1602,15,2,1254,66,772,325,1545,2135,4418,3964,478,455,455,9436,925,1606,2511,6239,439,8432,584,843,3692,388,496,589,200,331,368,1323,1151,3928,1230,235,4538,88,81661,132730,0,354,43,2,9,42979,-38836,0,0,27,1,0,0,4,1,0,0,7,3,137323,218984 +"482",1994,67,351,848,164,4299,2339,793,2628,3127,829,447,52,279,1351,314,259,239,6017,72,5,2331,142,2239,5057,1638,356,36,149,41,117,111,250,16,3964,22,2,431,57,53,5,344,42,92,63,199,3,38,279,65,54,31,780,43,483,50,58,367,236,93,114,12,70,127,531,191,179,298,407,2143,2506,53385,8207,0,3331,0,23,-313,12396,412,0,0,100,0,0,0,199,0,0,0,458,0,24813,78198 +"483",497,25,205,194,67,472,1082,6,272,444,117,57,13,74,81,72,14,41,931,29,0,156,1,97,716,127,34,12,21,6,19,19,13,2,25,2,2,12,1,1,0,31,7,6,4,1,0,8,60,5,0,3,1091,84,103,18,286,153,151,13,9,3,13,10,44,41,1215,76,519,708,279,10898,22509,0,8,0,0,-54,6678,12794,0,0,3,0,0,0,0,0,0,0,0,0,41937,52835 +"484",7764,771,1054,1163,593,4114,24698,2234,3450,6766,4089,4045,889,1337,8562,2338,1321,1459,31224,836,166,3567,774,8529,7556,3011,5436,1530,1347,1341,4534,1092,450,208,5984,150,25,3412,286,853,231,1640,959,335,254,168,24,192,968,391,189,331,3611,454,1767,412,527,1779,1605,611,775,213,1059,644,2573,2196,2139,300,577,7144,1420,194446,89517,3,22862,853,423,1289,34260,4900,0,0,710,16,0,0,153,21,0,0,384,55,155446,349893 +"485",0,5,2,7,97,580,584,41,74,79,144,101,8,11,89,35,46,71,189,8,3,44,64,25,113,119,809,58,6,14,103,1,464,0,0,0,0,148,8,245,89,847,883,1858,1261,873,134,485,3398,399,776,970,3986,158,3516,165,375,1891,1467,662,156,1776,85,141,532,371,10,1,13,14966,511,47154,46035,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46035,93190 +"486",124,9,6827,47,24,10517,384,8,7,8,6,11,1,4,4,2,2,4,26,3,0,23,14,13874,283,12,64,11,7,2,24,362,87,44,421,30,1,174,3,6,1,7,7,100,70,1,8,2,60,22,1,9,22,20,61,17,10,13,79,10,8,2,15,15,40,41,173,5,466,1135,8137,44017,2670,0,0,0,0,-1126,4674,0,0,0,0,0,0,0,0,0,0,0,0,0,6218,50235 +"487OS",0,275,29,1452,6,7474,0,622,830,146,85,14,0,2,9,0,248,186,540,55,0,424,307,478,191,484,45139,1855,806,511,10909,17940,1789,3994,37476,368,251,33520,1224,1880,725,263,3241,572,2813,283,0,0,0,1570,902,439,9583,261,2865,1603,415,1766,2261,376,947,554,819,136,442,1770,1,44,581,717,4166,211629,23558,0,0,0,0,0,10167,3305,0,0,0,0,0,0,0,0,0,0,0,0,37031,248660 +"493",351,0,6,293,0,504,0,3042,1580,139,1420,709,1447,56,201,183,137,383,4023,1372,302,3552,1564,3679,3470,4523,23125,7603,7642,10115,24312,9,2,798,7236,130,7,840,12295,639,186,477,786,0,0,56,0,1,67,329,222,109,962,5,2042,87,170,641,734,138,230,175,98,746,1245,656,102,112,0,3829,113,142008,87,0,0,0,0,0,166,0,0,0,0,0,0,0,0,0,0,0,0,0,253,142261 +"511",46,2,17,0,2,138,564,1,1,5,22,26,7,1,14,101,6,20,6,0,0,4,40,4,36,9,1853,220,105,96,694,4,64,0,43,7,0,284,121,13652,40,720,1559,414,792,177,33,25,350,263,1192,875,4150,2077,2068,8,671,1522,958,105,844,27,65,113,85,757,1180,551,250,7645,109,47841,86038,0,0,105586,0,1175,36218,-4469,0,0,0,1782,0,0,0,2321,0,0,0,6143,234794,282635 +"512",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,286,201,0,124,2,0,0,2,0,28,8,0,52,18766,40671,7,15,17,0,0,0,84,398,8,14,1868,148,41,0,1743,31,9,888,767,121,59,1544,1595,697,971,211,5,609,0,72023,24329,0,0,38328,0,32,22792,-9578,0,0,0,0,0,0,0,0,0,0,0,0,75903,147926 +"513",504,40,837,206,541,1415,6987,216,326,274,914,823,237,182,441,505,171,518,1028,102,34,231,435,213,903,528,17979,2048,761,692,9462,232,159,136,3055,921,204,2559,641,2996,376,111953,7344,9897,6075,5024,777,2103,15534,1316,4789,3770,13029,5685,12731,618,2488,6219,3532,982,1162,440,1162,2348,4963,4909,3754,2053,537,41188,1009,338221,332643,0,6907,30662,0,0,12951,-159,0,0,0,0,0,0,0,0,0,0,0,0,383004,721225 +"514",0,0,59,8,11,1656,1146,522,512,815,1671,1107,319,198,574,853,419,530,1053,163,49,600,284,591,623,845,4207,2398,1234,846,5688,96,1,0,138,65,11,625,168,2159,132,4069,11924,8532,2817,1757,1162,37,870,4656,3685,2674,16900,6472,23137,725,5143,1962,3602,355,1369,609,803,784,3681,8007,10232,2815,288,14769,1889,178103,55916,0,0,9446,0,0,6071,-1253,0,0,0,455,0,0,0,439,0,0,0,1232,72307,250411 +"521CI",1338,106,2427,625,1375,8074,7807,197,686,893,1096,1068,628,305,1207,405,412,650,2610,177,66,242,266,186,1577,1068,21807,2364,3114,2807,15924,1151,5510,761,4183,8725,64,1396,1061,2139,1155,4283,1926,43567,39439,13069,3741,104529,66468,16788,4127,3241,20233,15390,10821,298,2935,10274,1647,2473,1441,522,1507,1531,2560,12957,228,220,2969,5073,9772,511681,281605,0,0,0,0,0,60005,-45,0,0,0,0,0,0,0,0,0,0,0,0,341564,853245 +"523",239,50,3212,1044,3255,602,2143,26,60,998,1043,964,36,187,933,327,337,510,162,12,3,23,36,30,44,85,2304,179,256,379,942,2414,781,8089,759,1304,36,1859,42,393,234,384,138,29699,44024,6250,92665,131,5959,709,993,432,3031,8154,2023,51,626,1612,6892,502,1679,337,116,2575,2822,14767,9,117,101,26467,1720,291318,231056,0,0,0,0,0,71878,-57,0,0,0,0,0,0,0,0,0,0,0,0,302876,594195 +"524",2436,1327,8834,1876,2814,947,480,138,621,565,548,1099,91,620,1463,950,312,498,2323,283,112,230,67,179,1787,450,29593,2595,1323,1053,6776,228,41,396,9353,2248,290,2179,1777,558,1292,2166,844,6445,12084,401799,7631,15310,46328,3454,4137,1139,8859,236,8089,1050,2083,6725,67406,1649,4709,1802,1743,1715,3718,4436,0,58520,311,2151,8916,776208,389030,0,0,0,9451,0,19555,-52692,0,0,0,0,0,0,0,0,0,0,0,0,365344,1141551 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7992,12971,0,0,0,0,0,0,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21000,163000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,163000,184000 +"HS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2035762,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2035762,2035762 +"ORE",26873,116,1003,90,177,3834,20398,456,543,375,2994,1308,2626,373,1480,3421,812,1069,3136,401,72,799,1206,51,3165,1674,86178,14766,19387,13163,97397,230,241,342,6190,854,227,3589,20242,6217,4434,16173,9888,31770,25287,36572,741,8644,117975,9425,24910,5929,47199,30794,17933,1801,37725,51630,37593,25359,18320,9009,12959,8070,69061,46350,3709,7222,831,34436,3569,1102797,5655,21531,0,0,126137,0,3275,0,0,0,0,0,0,0,0,0,0,0,0,0,156598,1259395 +"532RL",3489,218,4153,1436,3011,1277,21123,234,707,812,1639,1316,263,412,1540,803,211,819,3307,108,53,720,458,1034,4336,778,29320,1181,1664,2007,9653,7661,3843,476,11793,1415,106,2029,1273,2504,2915,10453,6765,6725,6139,4332,28,86,2380,6272,3317,2413,15723,18978,7064,1759,1985,5163,5434,652,523,1529,1625,2273,7688,2069,291,178,464,7162,458,262027,105829,0,0,0,0,0,82161,0,0,0,0,0,0,0,0,0,0,0,0,0,187989,450016 +"5411",344,103,3274,587,1360,4003,5842,580,423,768,2846,1506,3020,206,2124,3345,314,1277,1182,230,89,942,520,1224,3786,1196,13131,547,319,759,3645,176,609,224,313,179,94,662,273,3280,721,3902,3438,4465,7207,28963,1503,1776,19643,537,2440,4260,13212,9476,7865,401,400,5363,13202,1196,833,1181,1856,2777,2584,3360,937,153,1083,9048,791,219871,105321,0,0,0,23062,0,14209,-3860,0,0,0,0,0,0,0,0,0,0,0,0,138732,358603 +"5415",370,62,5953,292,35,1583,5244,152,218,287,1076,1769,212,86,458,1811,170,362,854,89,19,193,313,471,820,403,15617,2788,786,947,5036,94,1487,7,897,162,4,269,407,6606,478,6289,9155,9305,8184,4886,691,257,2338,575,4919,6153,17775,21741,12842,270,1759,6224,9501,1310,1267,265,1100,881,2268,3339,21103,10302,440,20253,2515,246793,0,0,25550,212866,0,0,30501,-34142,0,0,736,8411,0,0,0,21702,0,0,33,9149,274804,521598 +"5412OP",1842,886,4886,2621,6273,12121,55972,2527,2583,4825,9228,6104,6680,1720,6699,6321,2418,4761,12313,1225,459,3457,2054,4261,13339,5662,105891,17320,7969,9041,59911,754,2793,1281,4463,1372,961,2822,1984,18403,10801,54645,32091,63793,37608,32109,3092,1006,100917,9730,10366,24110,127620,52312,47012,2794,5750,33094,38680,8087,6044,4815,6049,11246,30636,22292,35475,7782,1893,55068,17833,1310952,73104,0,25421,425057,3053,0,155230,-102136,0,0,0,50580,0,0,0,80856,0,0,0,20257,731422,2042374 +"55",0,0,11071,3513,1145,22,9079,774,1731,1483,8397,18666,11488,1219,15175,7871,579,3117,28309,1191,740,3116,825,9853,23530,2408,85739,1478,6444,21051,26181,307,46,1038,5709,725,24,3207,566,6928,652,2535,1736,4985,12170,3129,532,33,2722,3941,6753,5444,22622,107,49158,2911,4587,24579,7892,3607,2272,2297,1868,21723,60129,6712,0,0,463,0,0,580304,0,0,0,0,0,0,4297,0,0,0,0,0,0,0,0,0,0,0,0,0,4297,584600 +"561",643,83,963,687,1394,18611,9812,696,1395,2919,6771,2043,2005,440,3095,4487,354,1417,3963,337,344,1586,2769,2718,5212,1986,71862,5562,3952,3585,29246,4028,1538,7016,13739,5158,770,8505,5481,18675,2244,31164,26648,25294,14178,11089,336,5034,103565,13792,10221,26978,58175,9174,60241,3813,4000,31581,54350,10073,4027,4199,3204,8331,12829,13240,13140,1127,2462,37846,6824,865029,64260,0,0,0,0,0,2437,-1938,0,0,0,0,0,0,0,0,0,0,0,0,64759,929788 +"562",237,17,1179,258,281,684,2872,100,227,357,353,212,75,61,220,137,99,121,1295,94,8,303,88,523,2073,329,2817,967,535,289,1982,15,95,55,794,84,9,389,997,136,29,228,75,743,107,2059,503,16,13028,333,137,131,1796,714,1873,9744,669,2130,2407,857,713,104,871,1424,2862,1781,477,187,190,19139,3664,90359,27051,0,0,0,0,0,157,-234,0,0,0,0,0,0,0,0,0,0,0,0,26974,117333 +"61",14,5,0,0,0,219,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,53,7,0,3,2335,36,1137,0,5270,132,46,0,0,0,4,40,0,0,0,97,213,23,10,0,0,0,0,0,0,64,93,0,1153,0,4588,1,20,0,0,2016,293,0,0,4009,1344,32,139,17540,14,40961,352268,0,0,0,0,0,2580,-1731,0,0,0,0,0,0,0,0,0,0,0,0,353117,394078 +"621",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,90,0,113,0,0,17232,14684,106,8,146,2,0,0,133,0,330,0,9015,0,41858,1051632,0,0,0,0,0,87,0,0,0,0,0,0,0,0,0,0,0,0,0,1051719,1093577 +"622",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6657,0,0,0,0,0,0,0,0,0,0,0,0,6657,1066753,0,0,0,0,0,2716,-4424,0,0,0,0,0,0,0,0,0,0,0,0,1065045,1071702 +"623",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2347,0,1014,0,3361,242501,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,242501,245862 +"624",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,768,0,768,210569,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,210569,211337 +"711AS",65,2,1,0,20,182,154,22,31,51,61,47,2,5,38,16,16,27,112,8,2,28,28,22,42,74,2006,619,518,46,565,35,256,0,89,20,0,324,79,228,6331,27108,321,1296,668,371,187,16,5901,237,709,458,5014,2939,2352,79,1338,826,721,216,242,19280,988,426,1735,2549,1028,24,71,1220,17,90508,78533,0,0,5561,0,0,1539,-1325,0,0,0,0,0,0,0,0,0,0,0,0,84308,174816 +"713",19,0,0,1,11,30,73,4,8,8,15,10,1,1,8,4,5,7,20,1,0,5,7,3,11,14,253,3,35,1,308,0,0,0,0,0,0,3,1,29,10,65,104,202,143,53,15,23,379,30,103,118,344,516,532,20,60,249,10,27,37,149,9,353,301,48,128,1,0,516,253,5699,199417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,199417,205116 +"721",2,0,6,20,239,1017,461,99,177,186,346,247,19,31,215,85,109,173,456,25,7,106,214,60,275,359,2225,25,85,36,291,0,22,0,0,0,3,751,194,710,282,1628,2593,5040,3612,1300,386,589,9438,999,2028,2804,6913,886,8944,626,719,4045,263,397,450,165,194,526,1574,1029,1042,355,44,3375,182,71705,158018,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,158018,229723 +"722",512,56,34,49,461,1839,494,141,223,290,421,358,25,64,270,115,126,210,695,49,12,159,192,134,333,382,5814,966,1049,730,4034,8438,7,31,1114,178,19,1761,198,640,429,1537,2262,7685,3722,6014,919,3725,28430,1503,3562,3607,17691,3622,16428,554,2226,22313,11563,9678,2067,661,1918,8818,4072,3604,405,114,1075,14922,558,218307,741373,0,0,0,0,0,2708,0,0,0,0,0,0,0,0,0,0,0,0,0,744081,962387 +"81",346,488,148,129,595,831,8095,544,771,1269,1710,960,343,190,1251,488,207,395,2495,207,21,1427,460,1067,3336,1132,26968,2107,3046,1769,9460,297,159,105,12686,887,373,3431,1413,1111,192,4003,2756,7282,3356,10220,720,68,7400,8613,1479,881,9184,6193,11041,2869,1310,6621,17953,1756,945,947,1508,2580,11022,8906,2596,265,1137,24819,2124,253468,618069,0,0,0,0,0,75,-4797,0,0,0,0,0,0,0,0,0,0,0,0,613347,866814 +"GFGD",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,601506,0,0,0,0,0,0,0,0,0,0,0,601506,601506 +"GFGN",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,381020,0,0,0,0,0,0,0,381020,381020 +"GFE",13,4,0,5,0,189,7,0,0,12,24,241,0,129,0,0,0,18,0,1,0,0,46,23,57,0,15237,588,426,261,3853,3,0,3320,5190,231,21,950,318,610,258,274,1136,2595,11859,118,0,4,358,495,404,180,2311,165,1261,111,573,882,1559,276,364,137,88,963,3066,1225,0,122,1,1605,140,64311,6237,0,0,0,0,0,710,-289,0,0,0,0,0,0,0,0,0,0,0,0,6659,70970 +"GSLG",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1744034,0,0,0,1744034,1744034 +"GSLE",0,6,0,0,0,3313,0,42,108,174,159,100,44,34,105,59,31,56,660,52,6,154,37,280,1146,140,1066,315,278,135,916,1,0,0,205,8,3,116,521,83,35,139,68,447,166,114,0,0,959,788,618,175,1921,366,1536,100,115,717,831,329,2576,50,254,731,1470,942,435,230,175,5739,854,33235,71051,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71051,104287 +"Used",-18,125,0,-14,1133,4124,1811,0,55,18706,254,3,0,0,0,0,0,71,0,17,0,2715,0,0,40,41,0,26,0,0,246,-225,0,-183,1379,1,69,2963,1,0,115,2,0,0,0,0,0,0,0,-45,0,0,0,88,0,0,1460,2,0,0,0,-138,454,0,0,11579,-47,0,0,0,0,46809,88929,-2586,-143546,0,1365,4503,20028,-14128,0,-4,295,0,0,-2683,264,0,0,3909,7185,0,-36469,10339 +"Other",1082,74,1444,59,467,1384,2278,224,237,767,860,1385,1209,384,1766,831,149,528,2557,132,27,572,277,3239,2814,701,6328,54,635,710,3244,14623,235,2317,1281,15,49,480,104,1081,428,8605,884,3458,33710,1802,191,1851,4113,990,377,1369,3300,1688,1649,107,665,0,0,333,0,292,287,847,1966,539,10485,3206,870,0,0,140616,-90323,0,0,9583,0,0,203881,-260394,0,0,0,0,0,0,0,0,0,0,0,0,-137253,3363 +"Total Intermediate",256494,20458,129870,48691,44388,199713,769629,73960,64904,163651,193879,210769,73060,60857,520505,185973,44097,67638,673901,32480,7965,126821,42722,404752,427710,158171,795166,96779,90391,87365,421142,87923,37439,40269,200555,31137,6156,116031,76339,117121,56469,411763,155237,300758,295128,586844,133165,234237,763630,109909,99920,115790,535718,229804,387916,48711,114925,350769,402041,99070,83779,59373,62590,115704,373079,282362,223475,113437,29256,732936,200089,14914756,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V001",30857,25332,29293,17623,29965,81578,520422,22261,29470,31764,99341,94780,150705,36458,75338,78966,21959,53804,113482,12300,7885,30386,26233,19430,101682,47155,532941,118071,96461,93086,299250,57095,21893,7144,96307,21954,7617,86152,53892,130913,35436,112173,70251,263353,251232,271004,2059,18921,93508,36227,131525,264757,594263,324519,409331,30195,192422,545209,396274,131540,114086,59516,54197,82723,298036,305492,246097,184220,59219,1338917,107032,10434978,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V002",-68,1671,31660,5162,2249,61750,10110,773,1564,2560,3515,3690,8410,973,3704,2751,418,1795,30050,586,296,1829,778,4009,18747,1985,223582,49552,25619,41418,116306,25335,-46,988,4503,1879,3346,2512,906,6007,6368,41092,5138,19468,5558,32143,743,235356,27166,21081,16901,6694,14804,9170,10243,3652,9257,9557,13855,6413,2103,8614,13565,30594,56697,23736,0,0,-6339,0,-18933,1307574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V003",108096,9545,114274,34029,11143,168228,270101,14898,30765,24767,47067,55224,120817,23350,79428,71184,7566,35570,123983,4795,1233,23280,13378,108084,243269,29172,409207,40049,30722,12196,159144,52387,19497,4893,55570,21189,30027,26429,7612,115542,51995,292107,137193,358890,40361,247692,19827,1560232,343814,171314,110335,51397,268098,39141,129856,20057,47613,157826,67077,8163,9783,61492,20424,54368,88441,84151,157318,110203,9287,202406,56213,7734784,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"Total Value Added",138885,36548,175227,56813,43357,311556,800633,37932,61800,59091,149923,153694,279933,60781,158471,152901,29944,91169,267515,17681,9414,55496,40388,131523,363698,78312,1165730,207672,152802,146700,574700,134817,41344,13025,156380,45022,40990,115093,62410,252462,93799,445372,212582,641711,297151,550838,22630,1814509,464489,228623,258760,322848,877165,372830,549430,53904,249292,712592,477207,146116,125972,129622,88186,167686,443174,413379,403416,294423,62166,1541322,144312,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19477336,0 +"Total Industry Output",395379,57006,305097,105504,87745,511269,1570262,111892,126704,222742,343802,364463,352993,121637,678976,338874,74040,158806,941416,50162,17378,182317,83111,536275,791408,236483,1960895,304451,243193,234065,995842,222740,78784,53294,356935,76159,47146,231124,138749,369583,150267,857135,367819,942469,592278,1137682,155795,2048746,1228119,338532,358680,438637,1412883,602634,937346,102615,364218,1063361,879248,245186,209751,188996,150776,283389,816253,695741,626891,407860,91422,2274258,344402,0,13233609,599532,1118293,875327,760284,32189,2085548,-2622282,601506,5595,77264,61725,381020,10161,19170,105966,1744034,304701,45200,38494,0,34392092 diff --git a/flowsa/data/external_data/BEA_Summary_Use_2018_PRO_BeforeRedef.csv b/flowsa/data/external_data/BEA_Summary_Use_2018_PRO_BeforeRedef.csv new file mode 100644 index 000000000..abbfbfdd9 --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Use_2018_PRO_BeforeRedef.csv @@ -0,0 +1,80 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","Total Intermediate","F010","F02S","F02E","F02N","F02R","F030","F040","F050","F06C","F06S","F06E","F06N","F07C","F07S","F07E","F07N","F10C","F10S","F10E","F10N","Total Final Uses (GDP)","Total Commodity Output" +"111CA",68574,541,0,43,23,0,2122,0,0,0,0,0,0,0,0,0,0,226,215625,1055,0,0,0,0,7053,0,1330,568,1595,388,399,0,0,0,0,0,0,105,0,0,0,0,0,3,0,0,0,1,5,0,2,1,948,37,1415,0,105,0,0,0,0,0,641,44,2119,41,5,115,0,2812,0,307939,83252,0,0,0,0,-7847,47832,-42005,0,0,0,0,0,0,0,0,0,0,0,0,81232,389171 +"113FF",21685,7246,0,95,0,0,0,12592,1,0,0,0,0,0,0,0,31,164,7594,0,47,6237,40,20,323,1655,0,0,828,0,2,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,294,16,2,0,83,0,0,0,0,0,259,512,4133,220,0,66,19,4268,0,68438,9159,0,0,0,0,-424,6308,-17991,0,0,0,0,0,0,0,0,0,0,0,0,-2949,65489 +"211",0,0,35973,1,0,30584,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,345577,4239,0,2,0,0,0,2,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,0,0,0,0,0,0,0,0,0,1,3,1,0,0,994,0,20407,437816,0,0,0,0,0,-2095,63421,-170592,0,0,0,0,0,0,0,0,0,0,0,0,-109266,328549 +"212",1745,1,85,5367,59,10395,17438,5,8532,11393,444,127,1,85,48,135,16,90,929,47,0,988,0,2654,4131,89,16,0,0,0,2,0,148,0,5,1,0,2,2,26,15,194,338,0,0,0,0,37,0,0,0,0,1039,47,442,61,235,0,45,33,44,256,560,70,319,720,0,557,0,1996,5569,77582,33,0,62,0,0,-446,14113,243,0,0,0,0,0,0,0,0,0,0,0,0,14005,91587 +"213",0,0,16469,1322,854,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18683,0,126984,3317,0,0,1,3059,-711,0,0,0,0,0,0,0,0,0,0,0,0,132650,151333 +"22",4379,118,6966,3209,143,34290,5424,1501,3405,6173,4193,2025,663,626,2714,1023,543,823,8613,1278,63,5069,1066,6622,14878,4753,17998,4483,8718,5618,18381,106,119,109,2060,176,782,959,12173,717,309,3938,1677,2779,1116,855,1431,21,106093,1643,488,271,4074,9896,3299,515,7269,3045,9936,2175,1195,790,2626,7123,22463,4337,1489,484,909,23636,2477,421318,287931,0,0,0,0,0,4324,-2440,0,0,0,0,0,0,0,0,0,0,0,0,289814,711133 +"23",1491,34,1221,1784,1379,8988,250,186,340,562,540,390,88,92,476,166,73,126,1136,108,11,607,168,7736,1453,460,2301,748,521,551,2841,275,2499,33,353,227,943,1837,782,61,24,2184,163,3936,1234,431,257,72653,71171,300,96,27,742,585,531,35,575,313,779,214,230,208,409,905,1754,3853,8470,1533,708,31595,53159,302909,0,486889,0,0,612200,0,103,0,0,6022,0,0,0,13246,0,0,0,320017,0,0,1438476,1741385 +"321",466,51,0,277,286,0,43122,26411,278,721,283,867,396,549,3587,224,7091,1380,832,57,6,6057,3,0,327,1593,4859,123,773,142,1336,0,2253,0,129,0,2,101,308,63,78,1111,1498,109,6,8,0,104,7131,389,16,18,723,3,722,21,34,310,289,6,714,8,158,713,1044,577,5,9,1,3796,159,124709,3605,31,0,0,7616,1271,5815,-22831,0,0,0,0,0,0,17,0,0,0,0,0,-4475,120234 +"327",27,42,1426,494,901,113,67507,744,13317,2097,1189,2296,159,1511,7792,441,329,777,4878,220,0,355,2,1820,1769,1854,120,382,85,281,1069,0,20,0,70,0,0,39,228,5,2,2979,1186,75,56,7,0,118,72,418,0,82,4152,80,1064,179,74,2393,2047,229,324,10,129,136,2355,1704,32,217,0,2053,2217,138749,10227,0,0,0,0,1418,8448,-28549,0,0,0,0,0,0,0,0,0,0,0,0,-8456,130293 +"331",106,0,7249,697,526,6,4967,550,1200,72178,72834,33263,2371,13243,53875,10614,4245,5904,5607,195,0,759,30,59,71,1682,1234,6,0,0,713,0,858,0,0,0,0,381,0,21,11,254,420,0,0,1,0,2,3213,87,0,1,1454,42,466,479,121,89,24,21,279,18,291,21,151,507,93,174,0,149,541,304356,786,0,0,0,0,4734,30241,-88810,0,0,0,0,0,0,0,0,0,0,0,0,-53049,251307 +"332",1923,128,7831,1246,1105,557,86190,2684,2905,5172,41126,25599,2974,7525,45078,13538,3032,5201,15356,697,159,5440,1628,826,10777,7086,3556,537,198,120,1971,199,536,1906,1244,187,785,860,719,1115,44,11338,2176,237,197,4,16,78,1880,1335,37,1268,5252,1027,2603,2562,402,300,1096,33,2032,48,488,1154,3164,3603,3432,762,637,3946,4403,365269,17299,0,14021,0,0,4508,33484,-73346,0,0,254,0,0,0,83,0,0,0,51,0,-3646,361624 +"333",2970,142,11402,4300,4819,1586,35729,480,179,1120,4383,33152,307,1740,27789,4620,79,516,4218,36,0,957,1687,181,3472,1653,2968,208,142,131,1049,3,155,28,248,192,32,3308,581,139,57,1968,830,10,43,745,0,32,226,757,29,1419,2558,442,2904,3683,1614,701,598,208,129,48,147,83,855,7074,568,93,32,4971,2099,191623,8897,0,243586,0,0,5883,103174,-180686,0,0,2002,0,0,0,42,0,0,0,4357,0,187255,378877 +"334",38,0,37,26,280,164,5251,839,1099,1830,4615,8501,19819,3552,20109,18945,1032,2571,2462,657,80,838,2111,500,6332,2394,13668,1039,380,388,3086,3,59,3,202,6,4,127,319,3443,594,20228,6311,648,1121,70,588,290,746,369,1428,6216,9513,8744,4378,734,1193,10019,539,204,437,27,186,285,105,4413,23793,2238,1,2320,1655,236198,89406,0,207285,0,240,5061,99890,-344821,0,0,16663,0,0,0,978,0,0,0,1365,0,76066,312264 +"335",3007,166,149,78,611,29,39602,2252,122,1668,2348,14853,1126,9482,7688,2433,77,1079,773,50,4,338,112,163,1157,1037,1863,322,80,330,472,1,223,20,49,114,1,95,158,3,0,5717,471,163,67,5,0,47,1624,226,1,1356,4847,84,2372,903,659,20,561,955,204,62,430,685,567,5415,2277,1900,48,1560,3286,130644,37749,0,32202,0,4366,2510,30372,-111367,0,0,565,0,0,0,38,0,0,0,510,0,-3055,127589 +"3361MV",910,103,965,829,342,46,2005,696,535,634,1119,12490,227,367,219402,3551,290,460,2498,63,1,886,205,253,1162,469,8391,5068,1185,252,4808,0,63,0,3910,366,0,119,3821,261,96,1303,165,59,18,0,0,0,0,1175,0,33,3343,930,7039,1335,307,472,999,131,1777,819,103,159,765,13799,4477,41,1361,6825,767,327048,243266,0,302087,0,0,14431,103373,-339453,0,0,11319,0,0,0,7754,0,0,0,22416,0,365192,692240 +"3364OT",0,70,0,15,0,0,25,15,0,0,42,5,0,0,227,71865,0,0,0,0,0,0,0,0,0,0,8,111,0,0,0,700,1988,2370,1,24,0,1857,0,0,0,10,0,0,0,0,0,0,0,0,0,0,623,15,72,46,0,0,0,0,0,0,2,0,0,602,44249,899,2,0,111,125956,19437,0,67738,0,0,-2843,124642,-53175,0,0,40699,0,0,0,426,0,0,0,111,0,197033,322989 +"337",0,0,0,0,0,0,18880,268,1,0,0,240,29,2,32,271,4709,166,0,0,0,1,0,0,0,251,640,279,0,21,1671,0,0,0,0,0,0,1,0,1,0,184,491,0,0,0,0,3461,79,0,15,2,357,3,3,0,0,261,61,1,121,115,277,3,301,289,0,0,1148,11,64,34711,55272,0,27080,0,413,2133,3725,-47939,0,0,0,0,0,0,2,0,0,0,132,0,40818,75529 +"339",111,2,41,35,22,0,1658,8,116,22,38,2101,1,567,1914,55,40,5382,6,8,123,0,6,2,419,103,1020,307,98,3,1217,0,2,0,6,13,0,248,335,5,2,231,108,134,40,19,0,0,231,55,42,12,1943,23,1384,202,340,17424,16093,1338,1147,96,437,43,571,1745,159,135,0,7380,37,67412,101496,0,50872,0,0,3983,31843,-101379,0,0,21,0,0,0,5,0,0,0,150,0,86991,154402 +"311FT",31140,232,0,0,0,0,0,27,246,7,0,0,0,0,0,0,0,4,163507,17,277,1343,587,517,3716,153,2491,5,3209,840,1352,796,2,595,65,0,0,53,0,44,19,0,73,0,0,0,0,0,0,0,0,0,4985,31,0,0,5547,15,8420,6856,9864,839,6337,8364,51020,2875,2218,120,642,60920,0,380370,616289,0,0,0,0,1639,65804,-98928,0,0,0,0,0,0,0,0,0,0,0,0,584804,965175 +"313TT",58,35,0,2,0,0,2153,519,490,0,0,1066,2,0,3684,1094,2433,2153,124,7164,1547,3292,406,97,7,2464,2608,80,143,2783,2929,0,0,64,14,0,1,77,2,4,192,7,8,0,0,0,0,2,270,131,0,0,418,8,189,95,57,79,592,2394,1046,0,360,1947,293,1161,636,137,1,2663,12,50194,21391,0,737,0,595,446,8600,-34205,0,0,0,0,0,0,5,0,0,0,1,0,-2430,47764 +"315AL",56,0,0,0,0,1,0,0,1,0,0,0,0,0,1449,0,0,100,10,440,1241,0,827,7,0,1,716,110,4,197,442,0,0,0,0,0,0,0,0,10,30,1251,1,0,0,0,0,0,0,102,0,0,25,10,228,82,77,68,85,0,719,117,37,17,133,1859,106,22,195,2534,31,13340,147254,0,0,0,0,1176,4517,-147621,0,0,0,0,0,0,0,0,0,0,0,0,5326,18666 +"322",400,0,126,233,89,65,3024,613,1477,1342,2271,1935,280,934,2894,723,1039,1914,31300,468,63,37592,6227,396,7211,4251,6855,164,2008,575,2166,29,89,9,205,1708,16,3302,471,1746,141,805,429,1649,797,167,4,3,1573,1006,599,408,4107,883,4030,347,215,1254,2324,1146,902,117,246,2324,3656,1532,130,710,53,12973,40,170776,19789,0,0,0,0,934,22381,-25229,0,0,0,0,0,0,0,0,0,0,0,0,17875,188651 +"323",14,0,7,1,0,3,42,4,0,0,0,4,0,1,3,0,0,0,96,0,4,0,1627,3,372,0,8914,153,180,136,4875,8,11,0,439,101,2,240,7,6424,834,485,5414,927,1009,2458,0,0,133,240,716,211,5620,1444,3112,14,836,1609,2037,136,1275,667,223,633,555,2253,415,437,12,9927,571,67874,3270,0,0,0,0,718,1981,-2788,0,0,0,0,0,0,0,0,0,0,0,0,3182,71056 +"324",7236,470,7178,4028,2997,27070,48714,890,645,1779,623,1117,70,1610,524,229,268,613,3608,111,17,1500,1059,18251,11397,948,5619,1149,635,183,2108,23408,7538,3134,28330,2112,53,16358,217,376,127,829,705,8478,5197,47,514,114,6710,2068,50,818,2222,1673,5631,1340,728,1076,4880,843,727,174,1351,1391,3663,3474,17539,462,2586,96360,17758,423706,198500,0,0,0,0,-2550,112410,-68677,0,0,0,0,0,0,0,0,0,0,0,0,239683,663388 +"325",22941,1629,7819,2904,1478,2599,13400,2014,4307,1258,6918,3614,1483,2368,9233,1686,1659,5955,9444,9557,191,12750,5353,14123,214053,68917,2255,261,144,52,1109,1,273,9,213,8,1,89,864,627,215,760,822,144,124,18,0,238,15858,382,134,139,14611,1992,9551,1112,695,29992,13968,2380,670,330,833,142,855,5962,889,1069,122,33013,2705,573287,320789,0,2658,0,0,1593,160669,-266433,0,0,0,0,0,0,0,0,0,0,0,0,219276,792563 +"326",1516,110,88,1309,853,28,30353,702,1190,743,2391,6476,673,1432,24688,3197,3273,5113,22588,367,176,2979,761,553,12773,18719,20710,2029,1958,437,5825,19,7,0,534,24,40,3028,495,421,115,5644,505,118,106,208,0,80,492,1632,44,725,6075,174,2065,363,523,8466,3740,1762,888,49,277,186,6288,4690,1433,270,11,10669,2489,238662,37964,0,317,0,42,2072,26559,-57780,0,0,0,0,0,0,5,0,0,0,0,0,9178,247840 +"42",39400,2770,8702,4546,3313,8391,87000,10191,5792,26401,18727,29501,5389,8693,66236,13353,5515,8885,66170,2803,1207,13123,3460,16575,50062,15060,61869,4688,2433,2480,22382,2909,3306,1393,11789,1069,181,7013,2650,6152,374,15753,3723,3529,2585,669,404,670,7170,9396,1015,2743,17473,4768,10737,2655,3790,25011,15782,4664,4276,642,3891,5027,19204,15244,14937,1923,1884,43805,10103,905424,581239,4,218727,28333,3039,11348,197268,53284,0,0,10857,552,0,0,3621,724,0,0,8431,1841,1119269,2024693 +"441",6,1,222,256,153,29,2547,161,260,171,331,2834,40,1,2922,1127,113,241,1141,32,0,375,97,1,619,173,225,2406,580,115,2252,0,15,0,1244,6,0,12,144,114,46,112,11,26,9,29,0,38,417,511,0,15,896,0,1903,70,0,0,0,0,0,4,22,43,71,6093,0,0,0,0,2,31287,166030,0,35768,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,201809,233097 +"445",61,0,1,0,0,110,335,0,19,0,1,4,0,1,9,0,4,4,11,0,0,1,41,2,98,2,34,19,82,19,98,0,10,1,474,29,0,58,0,3,1,0,8,11,7,1,0,58,90,5,2,2,19,0,390,1,18,11,16,2,3,15,48,115,2433,53,0,1,0,71,0,4918,217862,0,128,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218000,222917 +"452",93,1,20,17,9,167,2269,12,49,11,31,199,4,9,238,65,47,62,189,29,0,37,281,16,389,27,218,278,106,25,331,0,16,1,747,42,1,85,9,29,7,11,48,66,43,6,0,596,404,48,23,12,199,0,827,9,77,85,49,7,23,10,29,339,1105,678,1,14,0,315,0,11190,213685,0,3463,590,556,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218293,229483 +"4A0",1116,10,98,214,22,2240,84392,120,53,35,165,759,21,88,1043,166,396,487,1323,155,1,199,1264,240,3297,152,1059,2671,683,622,2444,3,186,620,10335,520,4,1753,28,154,26,54,218,305,199,22,0,5493,2076,156,188,55,1066,0,1759,31,256,588,265,82,156,175,447,1715,10974,3266,10,141,1,3046,0,151910,810420,0,40940,12559,7223,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,871142,1023052 +"481",158,2,23,38,447,1090,467,189,334,319,612,458,31,50,387,177,170,233,934,51,13,179,278,174,490,520,7141,174,51,83,369,333,35,307,1731,20,4,1189,63,783,506,1723,2712,4688,4140,529,365,519,9270,1128,1451,2735,6474,455,9573,632,819,4020,414,520,636,211,354,379,1412,1341,4100,1278,258,4738,93,87578,148639,0,347,45,2,12,47761,-48936,0,0,25,1,0,0,2,1,0,0,7,3,147911,235489 +"482",2139,63,584,843,179,4703,2493,909,2633,3440,965,513,49,286,1462,334,300,264,6385,79,6,2379,148,2643,5281,1758,416,41,183,54,138,113,323,18,4225,26,4,539,59,51,8,312,51,114,67,233,3,43,378,74,52,35,806,46,526,54,60,391,242,107,122,13,91,154,581,207,228,290,396,2383,2482,57574,8546,0,3326,0,25,0,13641,427,0,0,438,0,0,0,284,0,0,0,586,0,27274,84848 +"483",520,22,323,190,72,476,1082,7,277,479,123,60,11,77,82,41,14,39,974,22,0,151,1,90,713,146,36,14,24,7,20,16,15,2,23,2,4,14,1,1,1,33,7,7,4,1,0,10,73,6,0,4,1221,93,119,19,312,163,159,12,9,3,13,10,43,39,1553,82,555,767,275,11763,25127,0,7,0,0,-22,6763,13751,0,0,3,0,0,0,0,0,0,0,0,0,45628,57392 +"484",8563,746,1613,1153,660,4858,27043,2640,3845,7735,4676,4520,789,1436,9572,2423,1455,1632,34646,832,185,3816,808,8941,7725,3273,5934,1801,1443,1356,5011,1615,527,226,6039,191,37,3500,296,852,311,1818,1183,389,256,181,21,217,1345,442,183,378,4115,506,2060,472,545,1863,1671,647,833,219,1181,740,2856,2460,2546,322,560,7835,1525,214099,95704,2,25739,1043,504,1863,38009,5070,0,0,784,20,0,0,157,27,0,0,492,68,169481,383580 +"485",0,3,5,9,145,790,722,63,107,110,209,154,8,14,110,48,57,96,258,12,4,58,93,57,144,163,984,78,7,21,141,2,554,0,0,0,1,155,10,300,165,1055,1196,2303,1553,1103,128,668,3897,561,820,1251,4713,193,4577,212,422,2345,1821,762,200,2026,108,168,670,531,10,1,17,15990,485,55644,51882,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51882,107526 +"486",127,7,10106,56,31,11492,419,8,8,9,6,13,1,4,4,2,2,4,26,3,0,21,15,15535,307,11,77,14,8,2,26,330,106,44,398,30,1,230,3,5,2,8,10,119,73,1,7,2,77,28,1,11,23,23,76,17,10,11,68,9,8,2,18,18,48,43,247,7,396,1309,7654,49818,2748,0,0,0,0,-878,5936,0,0,0,0,0,0,0,0,0,0,0,0,0,7806,57624 +"487OS",0,173,47,1429,8,8459,0,756,1016,160,108,16,0,2,9,0,238,183,623,67,0,466,345,843,188,612,46535,1984,776,536,11817,20452,1832,4540,44284,499,440,32532,1248,1752,1086,288,3886,608,2697,292,0,0,0,1855,779,468,10454,299,3191,1512,403,1887,2518,385,974,611,805,139,455,1956,1,42,523,677,4377,228142,24752,0,0,0,0,0,11230,3724,0,0,0,0,0,0,0,0,0,0,0,0,39706,267848 +"493",307,0,10,303,0,507,0,3339,1767,155,1585,606,937,61,188,163,112,524,4025,1533,284,3441,1595,4389,3581,5380,23918,8596,7434,9772,25075,19,2,855,9668,182,18,882,11902,629,269,564,897,0,0,55,0,1,61,380,186,116,946,5,2213,89,153,657,793,139,230,175,104,768,1289,752,106,114,0,3875,108,148790,88,0,0,0,0,0,174,0,0,0,0,0,0,0,0,0,0,0,0,0,262,149052 +"511",40,1,31,0,3,178,555,2,1,5,33,31,6,1,11,97,6,22,6,0,0,4,44,7,39,9,2008,261,90,113,709,8,72,0,57,13,0,343,118,13829,61,817,1851,449,812,207,26,28,310,302,1037,986,4147,2155,2331,9,646,1584,1085,106,788,28,72,111,86,748,1272,560,201,7581,117,49268,90154,0,0,118765,0,1659,35974,-4431,0,0,0,2115,0,0,0,2774,0,0,0,7065,254074,303342 +"512",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,354,213,0,160,5,0,0,4,0,90,14,0,57,23310,44572,9,21,23,0,0,0,103,448,9,19,1996,166,63,0,2016,44,14,1322,1121,143,73,1830,1801,743,1299,208,5,736,0,83019,24684,0,0,40402,0,125,20469,-9837,0,0,0,0,0,0,0,0,0,0,0,0,75843,158862 +"513",441,28,1354,215,641,1693,6780,225,370,313,957,851,188,165,445,445,171,527,1110,115,40,230,453,298,948,588,18989,2289,744,676,10042,475,166,164,4356,1350,505,2964,610,3325,563,113325,8072,10240,5955,6520,659,2321,15011,1598,4297,4169,13493,5708,14746,666,2381,6722,3837,1017,1227,458,1246,2318,5325,5471,3922,2166,489,42146,988,353303,335962,0,6784,32256,0,0,11764,-162,0,0,0,0,0,0,0,0,0,0,0,0,386604,739907 +"514",0,0,96,9,13,1984,1170,657,616,1011,1972,1279,222,217,619,796,442,650,1192,199,53,649,323,734,708,1048,4582,2811,1245,982,6129,202,1,0,202,99,29,772,164,2076,208,4709,15144,8752,2946,2241,940,44,787,5846,3358,3025,17694,6835,26304,798,5244,2129,4069,381,1494,657,875,820,3948,7621,10763,2928,298,15401,2054,194263,65972,0,0,11170,0,0,6661,-976,0,0,0,555,0,0,0,540,0,0,0,1489,85411,279674 +"521CI",1201,68,3839,651,1640,10199,8272,243,861,1012,1295,1253,657,285,1169,426,422,701,2994,211,73,246,298,339,1694,1232,22522,2529,2976,3411,16218,1810,5593,789,6015,12436,172,1507,1019,2154,1722,4790,2262,47427,45613,15043,3049,107787,65073,20986,3661,3554,20466,14905,12147,322,2848,11258,1775,2591,1540,535,1554,1457,2511,13940,236,232,2681,5154,10276,547829,309278,0,0,0,0,0,65516,-46,0,0,0,0,0,0,0,0,0,0,0,0,374748,922577 +"523",214,33,3778,1134,4131,761,2274,36,75,1141,1241,1154,33,187,950,392,355,552,192,16,3,28,46,59,50,104,2549,202,256,414,977,3891,961,8797,1095,2037,96,1853,42,391,384,456,161,33939,48324,8790,86181,179,6054,947,900,484,3226,9092,2411,56,572,1799,9095,531,2061,362,127,2628,2947,16882,11,72,100,25440,2000,308715,245671,0,0,0,0,0,70874,-58,0,0,0,0,0,0,0,0,0,0,0,0,316487,625201 +"524",2244,950,14140,2255,3282,1087,453,174,833,628,658,1203,131,558,1342,1113,318,496,2984,329,125,245,78,280,1938,522,30904,2823,1267,1200,6790,283,44,407,10448,2656,282,2214,1721,538,1792,2032,1029,7106,12324,407482,7350,14962,44609,4011,3561,1223,8864,216,9348,1089,2047,7020,76405,1703,4956,1801,1790,1701,3806,5084,0,61885,291,2114,9082,806622,430313,0,0,0,9081,0,19675,-43172,0,0,0,0,0,0,0,0,0,0,0,0,415896,1222518 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7839,11767,0,0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19641,160067,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160067,179708 +"HS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2121051,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2121051,2121051 +"ORE",23416,89,1774,93,198,5010,21548,543,730,418,3634,1465,2906,398,1665,3369,957,1241,3799,490,89,793,1351,87,3613,1865,97853,16470,20463,15487,105381,377,308,354,6317,1129,243,3316,20416,5110,4954,15290,10794,35048,26073,47476,708,9361,119992,10551,25028,5791,48120,33794,19610,1654,37817,53947,42263,25873,19444,9552,13705,8961,77913,44859,3817,8508,1067,36622,3845,1177199,6200,22544,0,0,124860,0,3214,0,0,0,0,0,0,0,0,0,0,0,0,0,156817,1334017 +"532RL",3356,171,6686,1686,3839,1395,21926,282,887,965,2116,1933,272,483,1781,984,231,1044,4088,143,69,836,551,1322,5149,976,33661,1447,1814,2701,10936,8797,2962,402,12107,2060,119,1838,1268,2730,3347,11168,7906,7341,6910,5015,24,108,2548,6523,3171,2786,17191,21667,8260,1570,2028,5314,5386,595,555,1755,1758,2587,9124,1823,330,207,512,8345,532,292395,111460,0,0,0,0,0,76601,0,0,0,0,0,0,0,0,0,0,0,0,0,188061,480457 +"5411",284,68,3964,572,1372,4441,5588,644,462,904,3036,1448,2620,190,1968,2854,302,1398,1135,230,83,893,508,1454,3755,1329,12913,568,290,745,3645,339,664,273,415,257,204,745,264,3234,988,4225,3978,4163,6759,32669,1126,1800,17666,603,2007,4459,12613,8965,8343,394,363,5368,13592,1156,826,1182,1867,2864,2587,3515,900,145,888,8621,777,221462,106338,0,0,0,24501,0,14606,-4258,0,0,0,0,0,0,0,0,0,0,0,0,141187,362649 +"5415",328,43,8875,285,40,1952,4968,202,244,316,1274,2063,163,88,484,1683,169,390,942,107,20,197,331,743,829,442,16491,3170,758,1052,5198,194,1594,8,1281,253,10,314,389,6013,723,7083,10866,9793,8180,5859,541,276,2124,690,4343,6763,18138,22000,14430,285,1735,6541,10572,1342,1342,273,1196,893,2344,3708,21734,10464,402,20695,2605,261840,0,0,32802,230080,0,0,32599,-33327,0,0,351,9067,0,0,0,23551,0,0,27,9759,304909,566749 +"5412OP",1677,600,8234,2733,7535,14438,54865,2855,2932,5516,9922,6250,6036,1610,6787,5887,2412,5237,12809,1377,477,3429,2112,4942,14429,6347,116266,21055,8204,9321,68578,1075,3076,1371,5970,2072,2332,3198,1943,18102,13274,58262,34316,62445,37251,37776,2582,1111,103174,10818,9507,26155,132364,55277,52310,2879,5645,34416,41359,8228,6292,5092,6363,12154,33674,23349,37104,8303,1749,57086,18228,1392552,76369,0,27743,466808,3777,0,166437,-107380,0,0,0,52573,0,0,0,85007,0,0,0,21096,792430,2184982 +"55",0,0,18824,3738,1298,19,9070,876,1932,1696,8986,17492,9931,1301,14646,6596,546,3656,26602,1251,683,2970,816,11519,22417,2801,91029,1706,6047,22022,26245,623,76,1281,8280,1136,40,3735,611,7546,951,3029,2098,5062,12696,3841,421,43,2524,4826,5977,6104,23360,100,54527,3151,4337,26379,8577,3772,2435,2421,2030,22695,63479,7486,0,0,432,0,0,612801,0,0,0,0,0,0,4285,0,0,0,0,0,0,0,0,0,0,0,0,0,4285,617086 +"561",622,61,1685,770,1685,19785,10076,750,1526,3243,7612,2416,2175,492,3584,4083,357,1542,4349,445,333,1671,2739,3484,5983,2137,75729,6202,3877,4113,31107,6527,1786,7679,14369,7625,1327,8510,5403,19780,2506,27750,32323,24633,14579,13025,294,5492,117340,15487,10266,29881,63694,9493,68091,4214,4180,33050,56080,11015,4434,4505,3534,8726,13473,14472,13515,1177,2315,40103,7217,934502,70797,0,0,0,0,0,2568,-1857,0,0,0,0,0,0,0,0,0,0,0,0,71507,1006009 +"562",217,11,1808,278,343,848,3005,120,252,394,404,249,64,63,225,125,103,124,1428,114,11,332,94,622,2205,349,3021,1096,527,318,2075,32,103,69,1139,120,22,437,953,145,41,254,86,811,108,2514,411,20,13532,406,124,144,1849,729,2393,10110,672,2395,2739,902,778,106,956,1467,3011,2144,476,187,188,19205,3920,96520,27776,0,0,0,0,0,169,-226,0,0,0,0,0,0,0,0,0,0,0,0,27720,124240 +"61",14,4,0,0,0,252,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,59,14,0,3,2307,42,1039,0,5445,266,47,0,0,0,11,49,0,0,0,88,211,25,11,0,0,0,0,0,0,65,90,0,1314,0,4512,1,24,0,0,2285,316,0,0,4887,1516,35,150,17216,14,42321,365254,0,0,0,0,0,2107,-1586,0,0,0,0,0,0,0,0,0,0,0,0,365776,408097 +"621",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,76,0,118,0,0,17825,15509,100,10,137,3,0,0,133,0,304,0,8985,0,43200,1097879,0,0,0,0,0,90,0,0,0,0,0,0,0,0,0,0,0,0,0,1097969,1141169 +"622",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4420,0,0,0,0,0,0,0,0,0,0,0,0,4420,1118350,0,0,0,0,0,2953,-4280,0,0,0,0,0,0,0,0,0,0,0,0,1117023,1121443 +"623",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2634,0,1134,0,3768,250932,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,250932,254700 +"624",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,916,0,916,223076,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,223076,223992 +"711AS",56,1,2,0,25,187,161,31,40,64,79,63,2,6,43,20,18,32,137,11,2,32,36,47,47,88,2328,714,517,62,688,60,275,0,140,35,0,350,79,232,9587,25398,373,1444,719,460,161,18,6271,304,666,512,5962,3106,2742,90,1357,936,913,247,297,20740,1085,472,1812,2692,1223,28,70,1376,17,97787,82395,0,0,5918,0,0,1463,-1038,0,0,0,0,0,0,0,0,0,0,0,0,88738,186525 +"713",16,0,0,1,13,35,73,5,9,9,18,12,1,1,8,4,5,8,22,1,0,5,8,5,11,14,250,4,33,1,306,0,0,0,0,0,0,4,1,28,15,68,112,196,141,59,12,25,347,34,88,122,335,520,575,20,59,251,10,27,37,157,9,362,316,78,127,1,0,499,258,5770,209556,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209556,215326 +"721",2,0,10,21,297,1239,445,126,212,218,418,310,16,32,217,97,113,194,519,31,8,115,259,115,293,395,2405,29,83,46,317,0,24,0,0,0,6,785,188,732,443,1814,2949,5153,3745,1522,309,671,9127,1197,1816,3053,7153,920,9948,676,696,4342,280,416,486,175,208,544,1667,1218,1097,369,47,3506,194,76057,165520,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,165520,241577 +"722",453,39,56,54,578,2185,493,182,270,340,512,426,25,60,280,132,132,235,821,61,13,173,233,262,362,442,6212,1019,988,837,4111,11964,8,34,1610,276,50,1741,181,657,633,1686,2528,7921,3841,7425,729,4095,27607,1818,3166,3898,17864,3748,18180,592,2039,23841,12927,9187,2191,646,1916,9110,4145,4038,429,119,1002,15629,586,232037,780950,0,0,0,0,0,2678,0,0,0,0,0,0,0,0,0,0,0,0,0,783628,1015665 +"81",310,364,240,143,690,776,8299,569,891,1520,1883,1064,283,204,1253,466,208,450,2761,277,25,1588,484,1654,3509,1295,30311,2481,3191,2106,10573,331,170,70,12715,983,492,3049,1422,885,195,3570,2802,6807,3072,11905,602,68,7393,8101,1320,862,9019,6716,11712,2387,1376,6275,17554,1664,958,934,1539,2811,12203,9422,2795,285,1104,23499,2302,261241,655784,0,0,0,0,0,77,-5072,0,0,0,0,0,0,0,0,0,0,0,0,650789,912030 +"GFGD",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,637125,0,0,0,0,0,0,0,0,0,0,0,637125,637125 +"GFGN",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400841,0,0,0,0,0,0,0,400841,400841 +"GFE",10,3,0,6,0,209,6,0,0,13,24,263,0,113,0,0,0,18,0,1,0,0,50,43,53,0,14561,595,377,266,3797,4,0,3350,6640,304,48,904,285,525,356,273,1245,2365,11474,113,0,4,321,542,322,179,2171,155,1295,106,513,865,1598,259,345,127,83,887,2929,1209,0,119,2,1506,130,63961,6155,0,0,0,0,0,897,-294,0,0,0,0,0,0,0,0,0,0,0,0,6758,70719 +"GSLG",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1828966,0,0,0,1828966,1828966 +"GSLE",0,4,0,0,0,3856,0,46,112,183,173,112,36,33,102,50,31,52,698,59,10,164,36,306,1178,138,1105,348,265,140,923,2,0,0,272,11,8,121,482,87,50,150,75,455,165,134,0,0,880,935,541,184,1908,364,1789,106,106,771,912,331,2663,50,267,729,1497,1041,442,233,151,5794,942,34808,75143,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,75143,109951 +"Used",-25,111,0,-29,152,4660,1749,0,50,18193,216,3,0,0,0,0,0,90,0,16,0,2336,0,0,32,36,0,23,0,0,277,-39,0,-183,-303,1,92,4272,1,0,127,3,0,0,0,0,0,0,0,-50,0,0,0,94,0,0,1414,1,0,0,0,-165,447,0,0,8008,-50,0,0,0,0,41562,95780,-2826,-154499,0,-496,6677,23109,-16222,0,-4,292,0,0,-909,6426,0,0,4235,7647,0,-30789,10772 +"Other",1089,72,1371,61,459,1430,2254,214,241,847,847,1411,1222,440,2356,775,156,513,2379,151,29,489,274,1907,2798,716,6301,58,635,728,3352,15244,237,2410,1347,15,50,496,105,1056,414,8421,854,3374,36306,1844,190,1826,3966,982,381,1340,3239,1675,1682,110,636,0,0,339,0,292,300,838,2002,529,6968,3262,686,0,0,138991,-83667,0,0,9897,0,0,208719,-270036,0,0,0,0,0,0,0,0,0,0,0,0,-135087,3904 +"Total Intermediate",259249,17640,203551,52028,50040,238457,800663,81177,70091,186689,220207,232509,64934,63332,555406,183103,46137,72544,688874,33849,7858,129661,43514,480110,452026,170685,852907,109192,92594,95259,453910,103813,41938,43562,223509,42742,9591,124688,75558,115570,72347,422387,179786,316603,310790,627922,121818,235834,809522,124808,93941,126590,563401,243018,436121,51166,113792,368011,423910,101506,88472,63154,67239,123520,400876,290466,246079,121094,28900,780495,213739,15956475,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V001",28423,26777,29839,19022,35911,84492,558282,23537,30733,33978,105285,100459,158131,37626,79773,83827,22578,56379,117467,12544,7762,30811,26551,19902,104524,49311,545560,121991,98854,95709,311634,59759,23200,7364,103274,24561,7772,93061,60706,145491,36993,112988,81361,273774,257154,285664,2524,19932,100376,38779,137271,285895,636534,342258,431660,32704,202266,576254,411951,137406,121848,63560,56939,86467,314610,323025,257440,191036,61211,1393382,112067,10968191,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V002",-2455,1910,35963,6015,2253,64019,10700,810,1628,2606,3614,3780,8882,1016,3837,3040,432,1874,29302,589,297,1860,789,4093,19492,2162,247716,50903,26642,42687,122479,27432,-302,1085,4767,2006,3650,2622,973,6297,6261,43715,6037,20218,5777,48104,727,244984,28384,22714,17681,7332,15775,9419,10911,3873,9692,9962,14906,6800,2231,8703,15316,32795,60286,24872,0,0,-6321,0,-20516,1398103,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V003",109885,9901,140692,34248,17613,170530,278309,14902,30443,30533,46577,57755,137775,26437,74212,71923,8096,36859,118459,3597,1244,26610,13783,161410,252663,30459,424095,40702,29361,12143,166834,49073,20800,5915,59764,20973,33119,28846,8259,122486,46637,303412,155682,399999,51254,257179,25028,1631589,361389,182794,113891,60389,285335,41000,135447,21060,49284,155732,68467,8240,9782,66033,20375,55967,87781,88517,160131,116054,8240,212913,59877,8166763,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"Total Value Added",135853,38588,206494,59285,55777,319041,847291,39249,62804,67117,155476,161994,304788,65079,157822,158790,31106,95111,265227,16730,9303,59281,41123,185405,376679,81932,1217371,213596,154857,150538,600946,136263,43698,14363,167804,47540,44541,124528,69939,274275,89891,460115,243081,693991,314185,590947,28279,1896505,490148,244287,268844,353616,937644,392677,578018,57637,261242,741949,495324,152446,133862,138297,92630,175229,462677,436414,417571,307090,63131,1606295,151427,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20533057,0 +"Total Industry Output",395102,56228,410045,111313,105817,557498,1647954,120426,132895,253806,375683,394503,369723,128411,713227,341894,77242,167656,954102,50579,17161,188941,84637,665516,828705,252617,2070278,322788,247451,245797,1054856,240076,85636,57925,391313,90282,54131,249216,145497,389845,162238,882502,422867,1010594,624975,1218869,150097,2132339,1299670,369095,362785,480207,1501045,635694,1014139,108803,375035,1109960,919235,253952,222334,201450,159869,298749,863554,726879,663650,428185,92031,2386790,365167,0,13904979,633628,1193238,957866,798565,59088,2211375,-2804452,637125,6018,84274,64883,400841,12337,19846,112624,1828966,324252,46282,41321,0,36489532 diff --git a/flowsa/data/external_data/BEA_Summary_Use_2019_PRO_BeforeRedef.csv b/flowsa/data/external_data/BEA_Summary_Use_2019_PRO_BeforeRedef.csv new file mode 100644 index 000000000..761c6c8bd --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Use_2019_PRO_BeforeRedef.csv @@ -0,0 +1,80 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","Total Intermediate","F010","F02S","F02E","F02N","F02R","F030","F040","F050","F06C","F06S","F06E","F06N","F07C","F07S","F07E","F07N","F10C","F10S","F10E","F10N","Total Final Uses (GDP)","Total Commodity Output" +"111CA",70340,344,0,43,25,0,1938,0,0,0,0,0,0,0,0,0,0,222,216271,1358,0,0,0,0,7116,0,1368,446,1441,347,366,0,0,0,0,0,0,128,0,0,0,0,0,2,0,0,0,1,6,0,2,1,962,34,1565,0,110,0,0,0,0,0,611,41,2035,36,6,-295,0,2982,0,309851,83826,0,0,0,0,-13549,44988,-43268,0,0,0,0,0,0,0,0,0,0,0,0,71998,381849 +"113FF",22144,4919,0,79,0,0,0,10349,1,0,0,0,0,0,0,0,36,179,7699,0,46,4891,41,23,330,1633,0,0,824,0,2,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,298,14,3,0,78,0,0,0,0,0,267,517,3974,205,0,55,19,4342,0,62974,9480,0,0,0,0,1019,5454,-17980,0,0,0,0,0,0,0,0,0,0,0,0,-2027,60947 +"211",0,0,22528,1,0,22251,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,292244,2627,0,2,0,0,0,1,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,4,0,1,0,1,1,0,0,0,1,2,4,1,0,0,731,0,16217,356645,0,0,0,0,0,2541,81357,-138647,0,0,0,0,0,0,0,0,0,0,0,0,-54748,301897 +"212",1692,0,75,5349,64,9190,18083,6,7845,9383,414,104,1,80,56,75,17,118,729,35,0,917,0,2644,3482,80,15,0,0,0,2,0,184,0,8,1,0,3,2,21,16,174,353,0,0,0,0,48,0,0,0,0,1094,41,470,59,267,0,45,31,21,283,548,63,275,659,0,450,0,2114,5741,73424,31,0,60,0,0,1090,12785,554,0,0,0,0,0,0,0,0,0,0,0,0,14521,87945 +"213",0,0,16150,1698,1115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19015,0,129609,3303,0,0,-6,2496,-751,0,0,0,0,0,0,0,0,0,0,0,0,134650,153665 +"22",4566,73,6584,3248,152,34255,5279,1436,3334,5125,3912,1917,593,630,2679,685,510,734,7926,976,180,4894,971,9177,13950,4666,15825,3510,8180,4698,16508,81,117,98,1764,166,1005,881,10724,677,338,3830,1945,2236,1022,778,896,23,123743,1562,454,255,4111,9490,3354,517,6367,3116,9332,2194,1191,773,2647,6464,20478,4595,1709,431,886,25626,2745,425793,285866,0,0,0,0,0,4424,-2082,0,0,0,0,0,0,0,0,0,0,0,0,288208,714001 +"23",1582,22,818,2003,1473,8574,248,182,340,521,533,370,86,96,504,139,77,120,1123,87,32,664,172,8866,1436,479,2148,638,529,500,2791,255,2579,24,377,211,705,1718,786,58,27,2319,192,3932,1494,461,173,69231,75073,359,98,27,812,609,523,37,552,334,795,226,241,210,445,885,1726,3918,9015,1268,709,32545,56190,308295,0,523797,0,0,619975,0,104,0,0,7433,0,0,0,15806,0,0,0,337119,0,0,1504235,1812530 +"321",598,40,0,309,285,0,38808,22169,358,564,237,720,349,519,3341,146,6100,1076,478,51,4,5427,3,0,271,1743,4965,101,872,131,1418,0,2470,0,150,0,3,110,283,53,84,977,1584,72,4,8,0,125,8456,382,16,15,772,3,711,21,28,263,276,5,632,7,145,562,932,484,6,7,1,3407,182,114320,3613,50,0,0,7445,565,4842,-19834,0,0,0,0,0,0,0,0,0,0,0,0,-3319,111002 +"327",2,19,1482,536,944,146,71798,973,14108,1692,1213,1922,162,1571,8117,331,334,689,5046,158,0,375,2,2118,1690,1782,108,291,78,67,975,0,23,0,65,0,0,45,221,5,3,2575,1388,59,64,8,0,154,99,462,1,80,4493,56,1143,203,53,2338,1827,216,360,11,133,131,2223,1730,37,195,0,2080,2622,143833,9826,0,0,0,0,1105,7889,-27811,0,0,0,0,0,0,0,0,0,0,0,0,-8991,134843 +"331",95,0,6307,655,535,9,5200,474,1271,62800,69306,31309,2322,13657,50166,8086,3832,6212,5374,200,0,732,25,61,63,1523,1239,4,0,0,882,0,989,0,0,0,0,351,0,18,13,246,481,0,0,1,0,4,3913,127,0,1,1649,45,526,481,135,82,24,19,289,17,305,18,142,483,109,158,0,172,637,283776,727,0,0,0,0,2051,26769,-77963,0,0,0,0,0,0,0,0,0,0,0,0,-48415,235361 +"332",2027,65,8003,1357,1127,594,90052,2798,3532,4487,41436,26311,3107,8571,46409,12105,3044,5340,15300,690,142,5653,1599,1004,10624,7615,3134,453,205,97,1925,219,559,1962,1292,248,1014,873,708,1080,55,10682,2452,197,188,4,67,111,2332,1504,47,1275,6076,1098,2907,2585,438,317,1123,33,2023,33,497,1160,3055,3811,3729,827,645,4165,5092,375291,18281,0,14568,0,0,4069,33392,-73301,0,0,414,0,0,0,50,0,0,0,59,0,-2469,372823 +"333",3305,60,11534,4753,4983,1363,35908,469,167,969,4213,33709,220,1745,26899,4378,85,577,4122,35,0,1145,1641,212,3517,1953,3028,145,143,122,944,2,75,30,195,186,56,4083,673,134,69,1838,831,12,39,762,0,32,359,635,27,1428,2938,475,3498,3787,1932,701,569,201,104,34,143,76,562,7289,739,75,34,5451,2112,194533,8704,0,256883,0,0,3090,99724,-187058,0,0,2369,0,0,0,27,0,0,0,5605,0,189345,383878 +"334",69,0,33,18,227,154,6383,889,1311,1719,5231,8743,17340,3930,21154,11632,1188,2768,2496,672,72,988,2317,620,6042,2773,13314,835,240,226,2503,3,79,3,144,4,4,85,195,3206,717,17510,6502,373,790,47,1632,341,605,315,1145,5924,8625,7303,3768,683,695,10383,574,179,281,16,115,190,72,4501,24354,2163,1,1887,1734,223038,95985,0,206490,0,264,1711,96411,-326383,0,0,17271,0,0,0,548,0,0,0,1714,0,94013,317051 +"335",2283,66,96,63,497,32,39248,1994,137,1428,2540,14704,1188,10641,8345,1590,79,1006,810,51,4,374,114,180,1067,934,1786,217,77,350,418,1,211,13,39,110,2,74,124,3,0,5264,475,144,65,4,0,71,1760,229,0,1312,5738,105,2353,802,662,18,513,803,360,58,422,586,557,5628,2412,1803,50,1219,3140,129451,39902,0,35805,0,4437,1803,30239,-112602,0,0,567,0,0,0,24,0,0,0,953,0,1129,130579 +"3361MV",1057,59,894,824,353,56,1772,575,515,507,1013,12778,203,354,219137,2928,271,445,2233,53,1,883,183,284,1048,489,7463,4471,1098,219,4390,0,59,0,3657,448,0,104,3455,199,102,1043,170,46,15,0,0,0,0,1145,0,25,3638,915,7531,1329,347,445,977,124,1735,607,103,146,722,14110,4967,37,1275,8061,811,324904,246677,0,319072,0,0,6641,102968,-343447,0,0,17563,0,0,0,6725,0,0,0,18409,0,374608,699513 +"3364OT",0,7,0,15,0,0,13,20,0,0,78,367,0,0,350,85258,0,0,0,0,0,0,0,0,0,0,3,71,0,0,0,1479,1940,1980,4,61,0,2239,0,0,0,7,0,0,0,0,0,0,0,0,0,0,1017,18,135,87,0,0,0,0,0,0,11,0,0,387,45980,1178,3,0,138,142845,20606,0,37140,0,0,17951,116805,-58030,0,0,40208,0,0,0,353,0,0,0,961,0,175995,318840 +"337",0,0,0,0,0,0,18018,205,1,0,0,209,30,1,29,200,3352,117,0,0,0,1,0,0,0,282,598,158,0,5,1409,0,0,0,0,0,0,0,0,1,0,165,532,0,0,0,0,3099,113,0,22,2,403,3,4,0,0,294,65,1,132,118,258,2,280,285,0,0,1642,12,44,32092,56547,0,25768,0,436,2264,3585,-47179,0,0,0,0,0,0,1,0,0,0,171,0,41594,73686 +"339",110,1,39,38,23,0,1231,8,98,24,40,1996,1,574,1709,15,16,4947,17,110,110,1,6,2,349,104,882,247,89,3,974,0,2,0,6,14,0,254,305,5,3,183,113,97,44,15,0,1,235,65,40,8,2184,17,1674,318,310,16403,14858,1050,1115,63,401,34,515,1181,218,127,0,7963,74,63662,105581,0,52050,0,0,1778,32367,-103001,0,0,27,0,0,0,3,0,0,0,260,0,89064,152726 +"311FT",32086,137,0,0,0,0,0,28,240,5,0,0,0,0,0,0,0,4,170437,9,478,1377,658,503,3081,163,2523,4,3230,854,1334,974,2,614,55,0,0,55,0,42,25,0,81,0,0,0,0,0,0,0,0,0,5557,36,0,0,5414,15,8457,6954,9610,936,6250,7951,50775,2671,2684,122,661,65610,0,392706,628993,0,0,0,0,6472,65121,-102229,0,0,0,0,0,0,0,0,0,0,0,0,598357,991063 +"313TT",47,17,0,2,0,0,2092,534,527,0,0,1056,2,0,3528,916,2356,2119,99,6885,1487,3320,392,115,5,2313,2133,64,133,3096,2533,0,0,69,15,0,1,80,2,3,252,7,9,0,0,0,0,2,254,136,0,0,390,7,207,110,50,84,629,2494,1138,0,363,1911,285,987,662,120,2,2746,15,48803,23040,0,898,0,561,431,8301,-34927,0,0,0,0,0,0,3,0,0,0,1,0,-1692,47111 +"315AL",53,0,0,0,0,1,0,0,1,0,0,0,0,0,1508,0,0,90,11,427,1138,0,782,13,0,1,759,78,3,184,446,0,0,0,0,0,0,0,0,8,32,1194,1,0,0,0,0,0,0,108,0,0,28,10,260,97,60,53,75,0,656,117,36,17,142,1723,128,20,77,2771,40,13145,152765,0,0,0,0,-382,4416,-150432,0,0,0,0,0,0,0,0,0,0,0,0,6367,19512 +"322",462,0,121,245,98,76,3112,603,1499,1098,2375,1880,266,999,3012,570,1055,1945,29269,446,43,37647,5680,428,7026,4673,6593,135,1869,487,2108,30,93,9,197,2110,28,3389,474,1875,143,780,464,1238,875,164,4,3,1871,1339,686,370,4676,1265,4294,328,223,1216,2137,1056,914,130,253,2229,3558,1356,155,598,50,14139,36,170576,21330,0,0,0,0,1243,20757,-24736,0,0,0,0,0,0,0,0,0,0,0,0,18594,189170 +"323",14,0,6,1,0,4,37,4,0,0,0,2,0,0,3,0,0,0,98,0,6,0,1273,3,283,0,8383,127,179,121,4791,11,11,0,440,81,3,223,7,6452,980,389,5972,840,1164,2309,0,0,166,237,743,185,6184,1324,3193,14,767,1558,2078,137,1220,703,227,581,537,2091,454,365,11,10384,628,68002,3802,0,0,0,0,-90,2022,-2869,0,0,0,0,0,0,0,0,0,0,0,0,2865,70868 +"324",6476,248,5972,3353,2666,20436,44188,727,524,1277,498,988,62,1634,453,123,228,541,2922,74,28,1189,976,19020,8335,870,4007,733,476,112,1602,22018,6042,2693,26279,2200,72,13752,163,287,120,703,637,5764,5055,37,273,117,7080,1815,40,590,2037,1219,5436,1356,694,968,4123,739,621,141,1125,1002,2644,2878,18644,342,2111,87883,16257,376697,181696,0,0,0,0,5443,97979,-68592,0,0,0,0,0,0,0,0,0,0,0,0,216526,593223 +"325",23784,998,7338,2838,1510,2745,15744,1908,3982,932,6792,3458,1278,2113,8603,1241,1575,5304,8498,8977,159,11713,4940,15343,191724,61422,1987,233,141,42,1203,1,279,8,185,10,2,76,726,565,308,618,882,96,125,14,0,241,15693,422,150,140,16963,1248,10128,993,716,35307,12964,3119,531,524,1008,110,1007,5723,1041,836,113,32144,3086,546623,332902,0,2602,0,0,8679,154129,-276269,0,0,0,0,0,0,0,0,0,0,0,0,222043,768666 +"326",1894,55,91,1206,989,35,32011,599,1206,558,2418,6149,691,1409,25335,2784,3265,4752,20289,340,80,2834,697,578,10586,19101,18979,1909,1958,405,5599,18,7,0,493,30,71,3128,488,419,138,5217,622,98,118,211,0,111,573,1964,45,809,7066,159,2151,366,540,8876,3972,1875,930,55,307,196,6527,4618,1540,242,14,11780,2880,237460,39830,0,320,0,63,1429,25534,-60048,0,0,0,0,0,0,3,0,0,0,0,0,7131,244591 +"42",40795,1606,8491,4653,3451,7692,89340,8930,6068,24934,18709,28734,4981,9316,67580,11298,5393,8587,68615,2732,1259,13163,3344,16421,50403,15496,61284,4157,2417,2517,22723,3071,3198,1384,11951,1226,260,6774,2391,6365,452,14561,3953,2652,2711,645,532,668,8228,10124,1052,2609,19332,4397,11502,2688,3866,27080,14696,4887,4210,713,3920,4868,19238,14934,15887,1823,1888,46110,10522,912461,600940,7,219455,31117,3051,8871,195022,77752,0,0,13988,612,0,0,3292,794,0,0,9199,1989,1166090,2078551 +"441",6,1,204,248,161,34,2842,154,255,147,330,2948,37,1,2704,991,109,240,1037,28,0,382,89,1,573,186,213,2197,549,102,2104,0,15,0,1162,7,0,11,129,87,50,96,10,21,8,21,0,33,527,504,0,11,1021,0,1978,70,0,0,0,0,0,4,21,38,66,6374,0,0,0,0,2,31139,162879,0,36062,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,198952,230090 +"445",65,0,1,0,0,102,297,0,14,0,1,4,0,1,9,0,4,4,10,0,0,1,42,3,85,2,33,20,86,21,101,0,10,1,506,36,0,54,0,3,1,0,10,9,7,1,0,54,116,6,2,2,23,0,427,1,14,12,17,2,3,16,51,109,2518,61,0,1,0,70,0,5048,226794,0,141,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,226945,231992 +"452",100,0,18,16,9,154,1925,11,38,9,31,202,4,9,223,57,48,59,163,30,0,37,278,17,346,28,205,281,101,24,308,0,15,1,780,51,2,78,8,25,8,10,57,50,42,5,0,527,491,48,24,12,233,0,868,9,61,86,51,7,23,11,29,316,1109,737,1,13,0,339,0,10861,214832,0,3564,623,544,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219562,230424 +"4A0",1204,5,91,205,25,2058,83627,88,50,29,171,769,20,86,1025,153,417,476,1160,174,1,204,1319,281,3015,152,1048,2822,662,622,2404,3,181,624,10896,631,8,1551,26,134,34,50,274,241,203,23,0,5023,2490,163,192,58,1272,0,1903,33,217,603,282,86,159,189,452,1650,11221,3790,12,133,1,3267,0,152437,847229,0,42907,13711,7783,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,911629,1064066 +"481",174,1,22,44,494,1125,478,206,381,325,615,468,33,54,473,170,152,223,939,46,16,205,255,224,484,496,6655,147,50,75,342,370,38,285,1564,18,10,1032,58,754,599,1714,3136,3937,3836,567,508,1219,11544,1179,1449,2427,7270,472,10179,687,768,3996,432,537,631,222,373,372,1395,1359,4987,1215,292,5531,102,92436,166525,0,365,52,2,18,46089,-51435,0,0,28,1,0,0,2,1,0,0,8,3,161660,254096 +"482",2172,38,571,802,190,3997,2580,871,2145,2871,975,509,47,304,1473,265,297,255,6310,71,5,2372,152,2871,4676,1793,378,35,164,48,130,130,348,18,4108,32,10,473,55,48,9,284,57,91,76,224,2,51,434,88,54,31,874,43,562,55,59,374,244,101,103,15,90,140,539,199,267,234,413,2551,2442,55298,8419,0,3272,0,26,809,13147,434,0,0,666,0,0,0,247,0,0,0,622,0,27641,82939 +"483",571,14,319,205,73,484,1167,7,296,434,131,60,10,86,85,29,14,41,992,25,0,153,1,121,679,163,35,11,24,6,19,18,16,2,23,2,10,13,1,1,1,32,8,6,4,1,0,12,92,6,0,4,1364,96,129,19,323,149,165,13,10,4,14,10,42,41,1688,70,511,806,316,12276,26790,0,6,0,0,122,6184,13020,0,0,3,0,0,0,0,0,0,0,0,0,46125,58401 +"484",8593,475,1543,1207,706,4423,28341,2379,4049,7584,4755,4460,771,1537,9705,2204,1364,1588,35717,841,184,3905,775,9364,7355,3261,5763,1563,1479,1258,4970,1919,557,229,5878,226,60,3390,282,871,365,1649,1332,313,283,179,28,217,1539,487,189,374,4598,459,2217,485,544,1991,1625,646,807,236,1216,703,2801,2373,3017,291,620,8376,1710,217200,98792,2,26248,1172,506,1916,37678,5363,0,0,877,23,0,0,165,30,0,0,577,75,173425,390625 +"485",0,1,4,11,152,816,673,65,116,107,198,150,8,14,130,43,48,86,240,11,4,64,81,71,134,146,891,66,7,19,134,2,614,0,0,0,3,151,9,277,186,951,1277,1835,1367,1017,82,766,4582,578,782,1055,4972,192,4592,220,385,2259,1901,804,189,2227,111,161,627,499,13,1,18,17410,540,57144,51942,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51942,109085 +"486",142,5,8940,54,31,11015,414,7,7,7,6,13,1,4,4,1,2,4,23,3,0,20,16,16952,254,11,64,10,7,2,23,362,99,44,431,36,2,226,3,5,2,8,10,94,83,0,4,3,91,28,1,10,24,20,84,20,11,11,67,9,8,2,18,14,40,40,306,6,383,1383,8038,50066,2929,0,0,0,0,1174,8813,0,0,0,0,0,0,0,0,0,0,0,0,0,12916,62983 +"487OS",0,122,46,1652,9,8538,0,763,1229,149,104,17,0,2,9,0,187,173,571,58,0,712,305,1046,183,558,46026,1652,826,508,12237,21117,1965,4602,45511,491,878,32997,1260,1743,1342,289,4614,523,2614,334,0,0,0,1969,811,436,13564,374,3456,1527,399,1964,2775,421,996,713,949,143,469,2069,2,39,541,791,4527,236898,25629,0,0,0,0,0,10842,3719,0,0,0,0,0,0,0,0,0,0,0,0,40190,277088 +"493",354,0,10,363,0,554,0,3450,1952,138,1764,631,1059,73,197,125,120,557,4170,1701,309,3738,1627,6224,3384,6215,23575,7641,7946,9212,25681,24,2,879,10161,153,45,933,11924,618,327,618,1049,0,0,62,0,1,78,397,190,107,1106,5,2424,99,128,671,864,149,233,197,114,770,1327,828,133,111,0,4473,126,154099,91,0,0,0,0,0,176,0,0,0,0,0,0,0,0,0,0,0,0,0,267,154365 +"511",48,1,32,0,3,199,638,2,1,6,38,31,7,1,26,49,5,23,7,0,0,5,41,13,35,11,1929,232,83,107,676,10,80,0,55,11,0,341,116,15096,73,835,2074,383,761,193,18,39,374,269,1029,909,4786,2299,2570,10,605,1530,1174,111,728,30,79,109,84,752,1622,529,158,8153,132,52371,96704,0,0,130082,0,182,34756,-4665,0,0,0,2363,0,0,0,3066,0,0,0,7687,270174,322545 +"512",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,355,238,0,197,7,0,0,4,0,213,15,0,55,25376,44642,11,18,21,0,0,0,128,376,9,17,2298,190,69,0,2305,44,16,1582,1211,174,89,2050,1947,742,1615,208,5,949,0,87195,24481,0,0,41747,0,61,19555,-10348,0,0,0,0,0,0,0,0,0,0,0,0,75496,162691 +"513",468,17,1218,236,682,1655,6974,270,368,294,966,880,200,177,479,304,189,506,1129,98,74,251,406,364,801,582,17585,1934,743,594,9767,559,165,162,4384,1034,1071,2980,569,3111,650,108413,8771,8462,5389,6869,480,2718,18547,1640,4327,3698,15032,5842,15830,713,2214,6520,3978,1036,1188,477,1333,2194,5359,5649,4556,2013,475,47035,1058,356714,339578,0,6831,32663,0,0,10811,-167,0,0,0,0,0,0,0,0,0,0,0,0,389714,746428 +"514",0,0,98,9,14,2123,1211,718,741,976,2236,1325,255,252,655,524,447,683,1255,206,61,751,333,1023,691,1143,4625,2518,1324,936,6294,256,1,0,216,84,73,844,165,2097,258,4784,17717,7726,2878,2262,657,57,983,5793,3487,2849,20730,7480,29135,915,5002,2202,4476,410,1506,723,938,839,4072,8253,13876,2923,335,18243,2353,211026,76567,0,0,11421,0,0,7028,-1313,0,0,0,572,0,0,0,550,0,0,0,1466,96290,307316 +"521CI",1379,36,3095,702,1760,10550,7720,255,916,1017,1286,1243,694,314,1599,393,370,670,2787,175,95,284,274,421,1775,1201,21118,2145,2959,3084,15339,2230,5449,734,5962,9305,387,1494,933,2028,1933,4375,2535,40676,45187,13168,1984,113554,78246,20384,3496,3084,21639,14432,12248,340,2532,10829,1647,2583,1466,565,1721,1371,2440,12274,245,254,2578,5406,10464,547836,325974,0,0,0,0,0,69896,-48,0,0,0,0,0,0,0,0,0,0,0,0,395822,943659 +"523",258,18,4270,1219,4347,852,2278,44,91,1270,1375,1291,41,223,1256,378,351,576,202,14,5,36,44,84,53,112,2577,183,272,432,983,5603,1318,9713,1166,1793,237,2144,41,399,511,464,190,36979,55558,10818,78304,233,7952,1095,952,461,3974,11839,2786,64,530,1877,12580,573,2701,419,147,2788,3278,20153,18,65,112,24874,2410,332253,252291,0,0,0,0,0,72741,-60,0,0,0,0,0,0,0,0,0,0,0,0,324972,657225 +"524",2324,864,13856,2256,4247,1176,415,191,944,699,686,1269,145,680,2529,1226,304,476,2906,288,182,308,71,329,2186,495,30371,2460,1326,1123,6776,255,49,447,10983,2895,488,2295,1784,526,2080,1940,1195,7966,12994,433107,7493,17061,53146,4232,3645,1138,10231,232,10425,1214,2045,7480,89110,1843,5375,2077,1961,1711,3845,5524,0,70073,340,2446,10174,874934,416650,0,0,0,7794,0,19110,-50618,0,0,0,0,0,0,0,0,0,0,0,0,392936,1267870 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6888,10262,0,0,0,0,0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17180,147245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,147245,164425 +"HS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2220457,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2220457,2220457 +"ORE",25174,69,2159,126,263,6590,28093,575,714,407,3857,1488,3034,433,1539,2455,1032,1295,3942,473,90,934,1466,94,4014,2196,114673,18101,25497,17320,123659,405,405,411,6916,1212,364,3605,23563,4722,5659,18741,15619,36459,28299,53795,783,10293,124588,11288,26824,6114,55891,42961,22304,1701,38551,58796,46433,28140,20239,10664,15314,10451,94736,48725,4305,9347,1137,37828,4043,1323393,6825,24231,0,0,131988,0,3285,0,0,0,0,0,0,0,0,0,0,0,0,0,166329,1489723 +"532RL",4238,113,6754,1878,4283,1384,23275,282,909,939,2112,1888,289,507,2114,858,250,986,3869,122,104,937,511,1884,5322,1004,33155,1278,1867,2441,10924,9298,3099,400,11822,1953,150,1765,1257,2571,3303,11758,9453,6468,6383,4893,19,140,2565,6139,3036,2622,18492,22772,8570,1544,1899,5329,5129,587,544,1805,1891,2592,9077,2008,393,229,593,9144,632,298801,117500,0,0,0,0,0,85188,0,0,0,0,0,0,0,0,0,0,0,0,0,202687,501489 +"5411",305,45,4568,631,1520,4521,5576,639,499,768,3266,1491,2828,211,2244,2140,289,1447,1090,224,89,909,520,1992,4019,1426,12074,486,291,666,3690,402,721,261,418,201,449,796,260,3118,1176,4230,4711,3451,6166,30455,806,2416,21757,604,1975,4204,14407,9234,8878,421,338,5221,14164,1184,816,1201,2017,2984,2345,3446,1090,136,877,9857,824,228477,110178,0,0,0,26096,0,16002,-4743,0,0,0,0,0,0,0,0,0,0,0,0,147533,376010 +"5415",369,27,9759,351,43,2017,5455,207,269,309,1326,2083,197,98,533,850,156,374,937,91,41,209,304,942,747,440,14999,2595,737,928,4894,224,1624,8,1253,194,23,326,354,6066,835,6716,12082,8171,7222,5393,351,359,2465,670,4185,5822,19694,21917,14692,298,1600,6250,10699,1338,1288,277,1239,842,2223,3660,25308,9374,406,22538,2636,262908,0,0,35837,239870,0,0,39188,-34471,0,0,440,9463,0,0,0,24409,0,0,25,9663,324424,587332 +"5412OP",1688,387,8394,3126,8243,15661,56552,2979,3319,5174,10580,6484,6766,1798,7610,4949,2406,5401,12219,1372,588,3671,2102,6921,14473,6841,113450,18543,8579,8574,70055,1289,3384,1461,6249,1791,5190,3505,1911,17921,15482,59049,44923,54590,36675,37710,2198,1426,122478,11903,9741,24613,150521,59297,58596,3184,5790,35122,44316,8697,6397,5544,7000,12273,34315,24270,44557,8811,1876,65230,20726,1478915,82353,0,29893,517250,3163,0,173364,-109850,0,0,0,53002,0,0,0,88070,0,0,0,22219,859464,2338379 +"55",0,0,19718,4515,1571,21,10061,961,2159,1500,10092,18490,10463,1585,15255,4859,592,4069,26678,1383,750,3166,869,16369,21542,3260,92994,1520,5663,21106,26173,792,109,1371,9010,947,57,4203,640,7732,1213,3401,2747,4549,12596,3889,303,49,3257,5385,6244,6123,27985,138,60792,3677,3857,27820,9710,4169,2564,2744,2279,23202,66283,9149,0,0,422,0,0,646794,0,0,0,0,0,0,4494,0,0,0,0,0,0,0,0,0,0,0,0,0,4494,651288 +"561",685,40,1695,852,1897,24235,10361,771,1524,3179,7857,2342,2108,527,3616,3555,357,1482,4017,405,484,1879,2757,4957,6255,2173,75920,5625,4077,3781,32837,8587,1953,7974,14564,5453,2929,9174,5340,15504,3017,25648,31053,22980,14086,13150,215,7786,136337,16396,10546,29336,68599,10060,78446,5387,4177,34789,60324,11942,4982,4920,3828,8952,13974,15327,17455,1165,2430,47576,8256,996866,75799,0,0,0,0,0,3153,-2393,0,0,0,0,0,0,0,0,0,0,0,0,76559,1073425 +"562",234,7,1685,315,373,861,2879,119,270,354,382,251,50,64,228,111,96,109,1389,90,15,350,85,850,1929,347,2804,928,522,281,1964,38,104,69,1085,95,50,441,884,135,44,241,96,662,98,2265,273,24,16568,390,120,125,2038,738,2513,10655,660,2245,2778,903,731,105,976,1411,2882,2156,556,170,200,21323,4524,101313,28663,0,0,0,0,0,242,-290,0,0,0,0,0,0,0,0,0,0,0,0,28615,129928 +"61",16,3,0,0,0,257,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,18,0,2,2087,38,1033,0,5283,276,48,0,0,0,25,50,0,0,0,78,228,20,10,0,0,0,0,0,0,54,93,0,1272,0,4274,1,25,0,0,2415,319,0,0,4671,1878,34,180,19482,16,44245,375097,0,0,0,0,0,2431,-1673,0,0,0,0,0,0,0,0,0,0,0,0,375855,420100 +"621",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,97,0,109,0,0,17945,16200,93,11,128,2,0,0,114,0,155,0,8411,0,43265,1155776,0,0,0,0,0,92,0,0,0,0,0,0,0,0,0,0,0,0,0,1155868,1199133 +"622",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1303,0,0,0,0,0,0,0,0,0,0,0,0,1303,1169175,0,0,0,0,0,4323,-5498,0,0,0,0,0,0,0,0,0,0,0,0,1168000,1169303 +"623",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2751,0,1393,0,4144,260984,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,260984,265128 +"624",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1060,0,1060,235142,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,235142,236202 +"711AS",62,1,2,0,26,203,154,32,44,65,78,64,2,6,46,18,16,30,134,9,3,37,32,62,45,81,2147,655,531,57,711,77,297,0,144,28,0,387,81,221,11076,25068,406,1210,651,439,106,20,7808,318,659,445,6847,3267,2853,96,1298,915,976,258,304,21788,1175,492,1792,2689,1532,27,72,1573,15,102762,85115,0,0,6338,0,0,1505,-1316,0,0,0,0,0,0,0,0,0,0,0,0,91642,194403 +"713",17,0,0,1,14,35,69,6,10,9,17,12,1,1,9,4,4,7,21,1,0,5,7,6,11,13,230,3,32,1,295,0,0,0,0,0,0,4,1,26,17,64,121,159,126,57,7,27,413,35,84,104,360,541,589,21,57,240,10,27,35,173,9,369,318,62,149,1,0,552,711,6308,216637,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,216637,222945 +"721",3,0,8,25,321,1259,452,135,238,217,409,309,17,34,275,89,98,179,499,27,10,130,232,146,283,345,2234,25,82,41,306,0,25,0,0,0,16,842,188,696,520,1744,3240,4249,3402,1504,204,754,11005,1199,1774,2654,7825,938,10275,730,631,4227,292,422,475,181,218,521,1610,1197,1321,344,54,3981,202,77886,171054,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,171054,248939 +"722",493,25,49,60,634,2146,473,195,302,341,506,432,24,66,338,119,116,218,782,51,17,198,210,335,353,423,5710,839,977,751,3933,14887,8,30,1610,219,111,1711,167,623,729,1594,2766,6537,3475,7048,474,5363,33718,1823,3077,3371,19344,3754,18526,632,1876,23350,13331,9243,2129,652,2039,8726,3995,3940,521,111,1021,17676,625,241950,821002,0,0,0,0,0,2826,0,0,0,0,0,0,0,0,0,0,0,0,0,823828,1065778 +"81",412,256,237,169,792,787,9348,601,973,1513,2037,1104,304,231,1425,410,230,466,2971,246,72,1865,530,2635,3732,1463,30433,2241,3481,2062,11069,352,192,97,13224,1120,667,2963,1455,857,228,3959,3493,6068,3362,12139,440,72,7445,8473,1351,858,10026,7436,12603,2533,1405,6892,18143,1779,1009,978,1666,2908,12780,10082,3372,295,1118,27685,2828,278449,676201,0,0,0,0,0,79,-4892,0,0,0,0,0,0,0,0,0,0,0,0,671387,949836 +"GFGD",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,679644,0,0,0,0,0,0,0,0,0,0,0,679644,679644 +"GFGN",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415141,0,0,0,0,0,0,0,415141,415141 +"GFE",13,2,0,6,0,216,6,0,0,12,25,264,0,124,0,0,0,18,0,1,0,0,45,56,51,0,13584,495,374,237,3698,4,0,3285,6653,235,117,893,264,488,410,252,1380,2120,11582,117,0,5,396,539,313,156,2354,154,1314,112,476,834,1646,264,330,134,84,856,2826,1152,0,107,2,1680,147,62907,6015,0,0,0,0,0,848,-263,0,0,0,0,0,0,0,0,0,0,0,0,6599,69506 +"GSLG",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1913994,0,0,0,1913994,1913994 +"GSLE",0,2,0,0,0,3911,0,46,122,166,166,116,29,35,106,43,33,47,695,49,13,175,33,431,1048,141,1024,294,268,126,891,3,0,0,263,9,19,125,455,82,54,144,81,374,146,127,0,0,1029,929,521,159,2114,376,1882,115,102,734,953,338,2590,52,272,711,1459,1087,538,220,151,6705,1060,35985,76360,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,76360,112346 +"Used",-37,92,0,-13,380,5028,1872,0,71,20442,290,4,0,0,0,0,0,87,0,19,0,2892,0,0,40,47,0,26,0,0,297,-777,0,-123,288,2,141,1909,1,0,155,3,0,0,0,0,0,0,0,-63,0,0,0,74,0,0,626,2,0,0,0,-202,510,0,0,9932,-53,0,0,0,0,43961,92610,-2996,-149700,0,-931,2286,22686,-17431,0,-4,299,0,0,-554,8793,0,0,4484,7255,0,-33202,10758 +"Other",1047,69,1359,67,441,1423,2188,236,248,718,887,1404,1471,388,1785,588,148,507,2534,124,30,572,291,4312,2889,699,6053,62,591,689,3299,16136,249,2640,1314,17,52,473,99,989,413,7654,823,3070,39297,1715,178,1646,3995,946,371,1265,3124,1609,1619,110,647,0,0,327,0,267,287,813,1842,502,6650,3405,743,0,0,142406,-73512,0,0,10541,0,0,207127,-282253,0,0,0,0,0,0,0,0,0,0,0,0,-138097,4309 +"Total Intermediate",268055,11474,187285,54627,54219,228023,818905,73144,72327,170211,220514,231919,63796,67767,558619,172458,43062,71254,691260,32824,8511,129545,41972,451275,418516,167552,849210,99055,97633,91815,470311,113024,42065,44513,225922,37385,17093,122625,76008,111106,82014,411779,207188,288326,318661,655906,109759,246332,927742,129145,96029,119762,631914,259167,475053,54562,110712,383158,447942,106967,90095,67677,71376,123338,417900,302165,276408,127810,28984,831391,222585,16328725,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V001",28627,27547,30828,18996,36415,87953,598507,24646,31794,34044,106880,101921,161204,38233,80313,88022,22400,57804,120264,12379,7645,31950,26644,20950,110248,50638,558596,128553,103433,96682,323346,62457,23009,7743,110477,30089,8566,102554,64784,158971,39210,113395,88628,289673,260553,298641,2843,21205,107626,40780,143708,309103,677721,359257,455311,34265,213527,607010,427503,141994,131732,66557,58850,91250,332621,337087,267937,195658,61384,1433534,115307,11459981,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V002",-10691,1938,35988,5810,2336,65990,11457,851,1700,2754,3984,3978,9100,1043,4055,3113,455,2044,28948,625,312,1959,829,4245,19209,2434,280412,53732,28236,44488,128315,28441,89,1198,4928,2127,3854,2823,1027,6700,6261,43444,6623,21143,6171,35836,759,259206,30024,23848,18113,7926,16775,10015,11489,4092,10244,10493,15701,7119,2390,8556,16400,33172,61863,26216,0,0,-6455,0,-21192,1457071,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V003",101899,10173,121072,32475,14761,176858,294037,13555,31450,29409,52332,62513,138526,25338,73844,75663,8796,36335,137385,3978,1411,26829,13818,119782,267602,30727,438441,42144,28571,12898,176144,54651,20250,5489,57903,21977,30117,29139,9017,131875,39263,319742,172556,428559,75101,274116,20697,1702462,385762,197661,118370,57793,294740,42857,141129,21253,50494,166800,70768,8310,10243,66471,22136,59478,95366,90330,163147,121400,6767,222402,58567,8463923,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"Total Value Added",119835,39658,187888,57282,53513,330801,904001,39052,64944,66207,163196,168412,308830,64614,158211,166798,31651,96183,286597,16982,9369,60739,41290,144976,397058,83799,1277448,224429,160240,154069,627805,145550,43348,14431,173308,54194,42538,134516,74828,297545,84734,476580,267807,739375,341825,608592,24299,1982873,523412,262289,280192,374822,989236,412129,607929,59610,274265,784303,513973,157424,144365,141583,97385,183900,489850,453633,431083,317058,61696,1655936,152682,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21380976,0 +"Total Industry Output",387890,51132,375173,111909,107732,558824,1722906,112196,137272,236418,383709,400331,372625,132381,716830,339256,74713,167437,977857,49805,17880,190284,83262,596252,815574,251350,2126659,323484,257873,245884,1098115,258574,85413,58944,399230,91579,59631,257141,150837,408651,166748,888359,474995,1027700,660485,1264499,134057,2229205,1451153,391434,376221,494585,1621151,671296,1082982,114172,384977,1167461,961915,264390,234461,209260,168761,307238,907750,755798,707491,444868,90680,2487327,375268,0,14392721,674702,1209842,1036586,813224,72789,2203540,-2782324,679644,7429,94721,66035,415141,15253,20236,116921,1913994,341603,45818,43102,0,37709701 diff --git a/flowsa/data/external_data/BEA_Summary_Use_2020_PRO_BeforeRedef.csv b/flowsa/data/external_data/BEA_Summary_Use_2020_PRO_BeforeRedef.csv new file mode 100644 index 000000000..a7ce6633d --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Use_2020_PRO_BeforeRedef.csv @@ -0,0 +1,80 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","Total Intermediate","F010","F02S","F02E","F02N","F02R","F030","F040","F050","F06C","F06S","F06E","F06N","F07C","F07S","F07E","F07N","F10C","F10S","F10E","F10N","Total Final Uses (GDP)","Total Commodity Output" +"111CA",66242,290,0,30,14,0,2126,0,0,0,0,0,0,0,0,0,0,170,206386,2691,0,0,0,0,5420,0,1283,289,1197,276,295,0,0,0,0,0,0,95,0,0,0,0,0,0,0,0,0,1,3,0,1,1,849,33,1001,0,90,0,0,0,0,0,481,12,1731,29,6,339,0,2552,0,293933,91825,0,0,0,0,-5176,52208,-44153,0,0,0,0,0,0,0,0,0,0,0,0,94704,388637 +"113FF",23541,5422,0,51,0,0,0,12455,1,0,0,0,0,0,0,0,39,154,7157,0,51,5538,33,17,280,1427,0,0,804,0,2,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,14,3,0,84,0,0,0,0,0,171,193,3299,179,0,29,13,4227,0,65435,8953,0,0,0,0,563,4707,-16854,0,0,0,0,0,0,0,0,0,0,0,0,-2630,62805 +"211",0,0,20059,2,1,17900,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,180904,2516,1,6,1,1,0,4,0,0,0,0,0,4,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,3,11,1,1,1,1,4,1,1,0,2,5,18,4,0,0,509,0,13508,235482,0,0,0,0,0,-504,56938,-85816,0,0,0,0,0,0,0,0,0,0,0,0,-29381,206101 +"212",1821,0,54,5668,34,6341,19388,2,6929,8354,360,86,0,69,43,41,13,93,614,21,0,498,0,1801,2779,40,12,0,0,0,2,0,143,0,8,0,0,2,1,18,15,157,502,0,0,0,0,94,0,0,0,0,925,35,370,44,278,0,38,22,12,243,193,29,208,1507,0,475,0,1859,4391,66634,27,0,34,0,0,-761,9421,1051,0,0,0,0,0,0,0,0,0,0,0,0,9772,76406 +"213",0,0,9589,1619,871,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,61,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12144,0,75129,1818,0,0,-11,2159,-1580,0,0,0,0,0,0,0,0,0,0,0,0,77515,89658 +"22",5163,72,5337,2416,79,31742,6496,1014,2785,3549,3144,1409,359,503,2383,406,413,680,8376,702,77,3700,1052,5839,11422,4261,15410,3052,9491,4951,18512,33,105,84,1801,63,827,832,10659,510,288,3464,2290,2044,933,980,1660,19,110650,1654,416,237,4149,10814,3085,479,5767,2550,9160,1848,1130,461,1128,2672,19204,5640,1949,690,794,28816,2673,397350,287053,0,0,0,0,0,3106,-2077,0,0,0,0,0,0,0,0,0,0,0,0,288083,685433 +"23",1959,31,1042,2249,1166,6982,476,192,526,523,760,471,71,135,697,128,103,190,1870,98,21,878,281,7176,1961,742,3037,799,908,777,4207,123,2626,12,356,186,348,1434,997,63,25,2378,318,2954,1201,587,476,70810,68265,285,109,33,1141,1026,598,42,248,337,978,229,271,151,301,529,2372,6767,8983,1765,745,34100,58806,313434,0,517861,0,0,680425,0,108,0,0,9963,0,0,0,18582,0,0,0,342365,0,0,1569304,1882738 +"321",648,30,0,356,207,0,46644,26725,355,495,294,561,374,590,3219,245,7095,1388,431,54,9,6287,3,0,351,1722,4687,99,914,124,1555,0,2584,0,163,0,1,94,283,59,128,1190,1584,72,6,12,0,217,7270,341,14,14,665,5,716,20,31,322,273,4,689,8,92,338,864,587,6,10,0,4490,140,128753,4796,503,0,0,7575,-1309,4132,-23172,0,0,0,0,0,0,0,0,0,0,0,0,-7476,121277 +"327",3,20,1400,419,616,59,74206,757,14460,1406,1061,1402,127,1304,7795,263,284,665,4651,104,0,347,2,1756,1501,1643,108,281,68,79,1159,0,20,0,44,0,0,37,184,3,5,2702,969,32,52,8,0,326,88,343,4,70,3831,49,1039,228,54,1962,1447,136,336,10,52,53,2047,1957,34,193,0,1959,1927,140150,11997,0,0,0,0,-1434,6829,-24877,0,0,0,0,0,0,0,0,0,0,0,0,-7485,132665 +"331",130,0,4914,458,251,5,5253,403,1208,52958,60228,24722,2166,13411,42202,5999,3346,5967,4559,160,0,631,22,70,54,1302,1143,4,0,0,916,0,839,0,0,0,0,325,0,15,11,204,585,0,0,1,0,2,2278,113,0,1,1437,41,480,371,130,59,24,12,247,10,138,8,134,781,105,242,0,145,409,241630,1385,0,0,0,0,-4089,24177,-65198,0,0,0,0,0,0,0,0,0,0,0,0,-43725,197905 +"332",2154,85,6519,800,616,489,93912,2379,3111,3442,38835,21655,2156,8075,40559,8767,2830,4815,16316,604,316,5002,1454,780,8891,6966,3056,366,216,83,1950,97,468,881,1298,118,328,782,693,765,71,10376,2372,177,257,6,20,72,1831,1172,39,1035,5687,1180,2873,2353,607,298,1034,32,1947,27,264,660,2863,4973,5187,835,491,3815,3863,349046,23090,0,13140,0,0,-2795,26714,-68984,0,0,389,0,0,0,7,0,0,0,38,0,-8401,340646 +"333",3431,139,9755,3848,3073,1598,37108,390,158,748,3730,30214,156,1963,22371,2982,83,881,4110,30,0,723,1545,176,3560,1781,3266,126,130,94,988,2,68,11,174,66,12,3754,610,95,60,1635,1112,7,51,710,0,33,291,606,40,1234,2678,427,3232,3327,1951,810,550,189,147,19,91,41,663,7080,760,126,21,5163,1566,178570,11153,0,233481,0,0,-5823,87453,-168102,0,0,1194,0,0,0,5,0,0,0,5260,0,164620,343190 +"334",49,0,23,13,50,92,5589,898,1546,1639,5589,8652,14695,4343,23256,8241,1253,3118,2787,762,153,1216,2595,663,6215,3074,14904,744,327,282,3428,1,64,1,207,3,1,84,240,2822,480,18737,7168,345,1126,67,587,752,526,228,1058,6660,9338,9044,3890,620,1011,9072,563,189,373,14,110,96,71,5468,29630,2468,1,2310,1401,233025,106819,0,200133,0,281,-750,88512,-334560,0,0,13556,0,0,0,370,0,0,0,1609,0,75970,308995 +"335",2816,128,99,42,273,15,40539,1943,174,1171,2647,14176,965,11115,7705,1226,89,989,1044,62,8,455,146,181,978,1450,1313,279,93,332,553,0,289,20,41,57,1,60,118,2,0,6599,422,91,84,7,0,63,1281,213,0,1212,4959,101,2264,845,994,19,415,930,436,57,228,290,579,5534,2489,2384,44,1109,2482,129729,44808,0,34624,0,4960,-1776,26010,-115013,0,0,392,0,0,0,5,0,0,0,578,0,-5414,124315 +"3361MV",1068,62,692,452,183,24,1730,509,486,383,868,10099,130,262,193543,2505,252,344,2107,40,1,778,177,226,902,436,5716,4526,1062,211,4452,0,45,0,3388,173,0,70,2670,167,107,691,207,37,13,0,0,0,0,925,0,36,2991,833,6017,1109,283,405,864,113,1519,188,64,60,567,12786,4341,38,860,6918,558,283275,262942,0,242451,0,0,-10318,80382,-283847,0,0,27782,0,0,0,4900,0,0,0,19744,0,344037,627312 +"3364OT",0,7,0,6,0,0,1,15,0,0,78,324,0,0,333,50530,0,0,0,0,0,0,0,0,0,0,3,14,0,0,0,498,1463,1015,0,32,0,2274,0,0,0,9,0,0,0,0,0,0,0,0,0,0,858,7,196,116,0,0,0,0,0,0,0,0,0,71,58209,1463,2,0,120,117644,23905,0,42130,0,0,1139,70579,-40870,0,0,32959,0,0,0,352,0,0,0,892,0,131085,248729 +"337",0,0,0,0,0,0,17871,181,0,0,0,150,21,0,27,267,3415,32,0,0,0,0,0,0,0,257,610,185,0,4,1417,0,0,0,0,0,0,0,0,1,0,196,464,0,0,0,0,2840,42,0,8,1,335,3,1,0,0,308,64,1,123,71,78,1,250,161,0,0,652,10,124,30171,70746,0,25553,0,588,-3048,2999,-49609,0,0,0,0,0,0,0,0,0,0,151,0,47379,77550 +"339",71,2,35,27,12,0,918,8,95,23,44,1739,1,558,1553,29,8,4671,8,163,130,0,6,1,292,122,704,203,89,2,889,0,1,0,7,6,0,224,281,3,4,150,95,61,48,17,0,0,143,40,61,5,2368,14,1640,345,347,14237,12828,782,1059,31,97,13,359,1104,305,233,0,9851,75,59237,113026,0,50903,0,0,336,27485,-102811,0,0,10,0,0,0,706,0,0,0,298,0,89954,149192 +"311FT",32948,186,0,0,0,0,0,29,234,4,0,0,0,0,0,0,0,6,178267,4,705,1132,690,421,2856,181,2544,1,2666,699,843,537,2,360,54,0,0,47,0,39,9,0,137,0,0,0,0,0,0,0,0,0,5189,33,0,0,4528,11,6473,5646,9751,399,2979,3208,42454,2351,2579,146,439,60682,0,372469,682453,0,0,0,0,1081,64759,-107161,0,0,0,0,0,0,0,0,0,0,0,0,641133,1013602 +"313TT",40,9,0,1,0,0,1836,396,398,0,0,1036,0,0,3062,638,2377,1883,290,6617,2006,3268,388,94,4,1928,3018,61,108,14651,1811,0,0,24,11,0,0,35,1,4,261,7,4,0,0,0,0,2,253,107,0,0,478,7,786,520,50,91,467,2605,1157,0,74,926,259,1583,605,161,1,3422,77,59903,25671,0,837,0,605,-413,6943,-50005,0,0,0,0,0,0,1,0,0,0,0,0,-16360,43543 +"315AL",40,0,0,0,0,0,0,0,0,0,0,0,0,0,1035,0,0,83,9,22,676,0,33,2,0,0,224,4,0,85,124,0,0,0,0,0,0,0,0,0,0,22,0,0,0,0,0,0,0,1,0,0,11,0,95,54,3,2,11,0,16,9,6,2,2,985,16,6,88,3729,20,7417,134982,0,0,0,0,-2316,3407,-123437,0,0,0,0,0,0,0,0,0,0,0,0,12635,20052 +"322",501,0,103,165,47,31,3657,556,1452,918,2286,1621,183,974,3119,437,1062,1872,29836,417,82,31343,4769,390,5919,4667,6128,118,2060,482,2291,15,112,3,221,1194,7,3542,404,1366,182,1005,356,989,905,186,5,6,1197,654,538,402,4467,1397,3683,297,316,1064,1760,978,1027,90,148,1006,3045,1795,174,775,41,13796,32,156667,24258,0,0,0,0,286,18938,-23123,0,0,0,0,0,0,0,0,0,0,0,0,20358,177025 +"323",14,0,5,1,0,3,37,2,0,0,0,3,0,0,3,0,0,0,100,0,5,0,1253,2,163,0,6681,94,168,98,5496,6,8,0,527,32,1,276,7,5022,1120,340,5265,691,1244,2472,0,0,123,285,826,242,7183,1336,2679,15,855,1355,1877,134,1190,440,168,228,438,1548,438,472,8,10259,437,63674,3219,0,0,0,0,720,1726,-2545,0,0,0,0,0,0,0,0,0,0,0,0,3119,66793 +"324",4603,152,3728,1507,1125,11975,38197,446,310,861,364,562,40,1197,342,58,197,480,2713,43,14,587,583,9588,4604,669,2347,459,343,71,1187,6962,3211,1214,12993,603,39,9436,95,156,98,616,292,3396,3714,33,251,186,3837,1030,40,571,1588,772,4135,1023,475,811,2988,616,532,71,507,287,1591,2141,8240,258,1089,61333,7103,233686,100976,0,0,0,0,-3342,65697,-38715,0,0,0,0,0,0,0,0,0,0,0,0,124616,358302 +"325",25796,1069,6317,2135,925,2044,13690,1635,3891,723,6530,2848,913,1694,7841,926,1391,4452,9442,7648,257,9750,4798,10384,172398,52999,2554,209,174,31,2244,1,205,3,199,4,0,55,679,402,363,697,1155,45,118,11,0,258,12504,348,77,117,24714,1537,9322,974,1057,39327,13771,3281,695,351,486,60,1073,5330,1230,1142,90,33258,2311,514958,343191,0,1864,0,0,-3207,143836,-287208,0,0,0,0,0,0,0,0,0,0,0,0,198477,713435 +"326",1960,73,79,643,524,15,32554,554,1239,452,2289,5173,441,1379,24441,2138,3141,4182,21684,319,193,2792,695,515,9091,19471,17802,1300,2112,384,6168,9,6,0,483,14,18,2735,487,360,202,5072,764,67,156,246,0,176,438,1356,38,661,6375,165,2004,368,999,8237,3743,1640,853,29,171,79,5960,4794,1433,312,13,11998,2254,228519,40147,0,273,0,59,-595,22969,-60987,0,0,0,0,0,0,1,0,0,0,0,0,1867,230385 +"42",42752,1874,7805,3462,2432,6920,91978,10119,5793,23427,16959,25682,3886,9372,61488,8274,4900,8425,67827,2421,1308,12553,3128,13023,46393,15055,57627,3500,2381,7393,29398,1439,2855,858,9621,565,102,5678,2327,5163,453,15058,3383,2286,3019,661,374,706,6327,12942,848,2778,21153,5354,10620,2758,4221,25951,13542,4619,3790,381,1714,2366,16042,14784,18553,2242,1272,45981,7631,877970,602338,72,205101,31002,3133,-5366,175835,68627,0,0,17478,483,0,0,2832,592,0,0,10018,1676,1113822,1991792 +"441",8,1,204,138,92,18,2271,142,256,125,335,2554,28,1,2366,944,110,194,1053,23,1,363,92,1,522,180,217,2418,572,107,2293,0,14,0,1178,4,0,10,99,77,55,55,2,20,7,30,0,28,431,456,0,18,942,0,1681,59,0,0,0,0,0,4,17,20,76,6225,0,0,0,0,1,29138,155754,0,34915,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,190680,219817 +"445",91,0,1,0,0,126,412,0,21,0,1,3,0,1,10,0,4,0,10,0,0,2,44,2,95,2,37,14,74,18,96,0,11,1,511,20,0,40,0,3,1,0,15,9,10,1,0,47,105,8,2,2,30,0,345,1,15,12,16,2,3,9,23,63,2684,57,0,1,0,50,0,5162,253098,0,148,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253256,258418 +"452",135,0,22,10,6,181,2394,11,51,9,35,195,3,9,222,60,53,16,173,4,0,39,254,15,353,26,219,237,109,23,369,0,17,1,781,27,1,57,7,24,11,6,81,51,57,8,0,480,421,55,27,15,276,0,738,9,98,81,50,8,24,7,15,200,1180,729,1,15,0,352,0,11145,236839,0,3797,626,607,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,241868,253014 +"4A0",1443,5,132,99,19,2174,96034,98,68,32,208,845,20,93,1131,192,486,82,1278,33,2,234,1306,237,2835,155,1178,2342,709,826,3218,2,183,416,9322,297,3,1003,27,144,51,29,424,271,303,35,0,4791,2126,184,237,77,1672,0,1766,40,326,591,295,75,166,122,196,1131,12670,3642,13,161,1,3537,0,163847,893123,0,44930,15075,8694,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,961822,1125668 +"481",185,1,16,18,102,446,293,75,174,93,275,196,17,30,216,98,68,109,611,25,11,103,126,129,253,257,2514,53,29,41,240,80,13,105,716,5,5,514,31,329,311,972,1496,1300,2252,322,170,33,5336,639,947,1366,3884,206,4433,343,378,1692,214,243,303,54,119,58,499,415,2142,706,258,2346,42,42080,62976,0,391,60,3,-9,18155,-11958,0,0,32,1,0,0,2,1,0,0,9,3,69666,111747 +"482",2266,39,538,393,119,2760,2685,876,1717,2210,914,429,39,285,1313,227,296,252,6228,69,8,2154,151,1660,4230,1837,313,32,153,47,107,63,345,12,3502,15,12,405,45,36,12,170,59,77,85,88,3,69,328,71,35,26,628,41,415,56,56,451,209,98,97,8,42,64,460,218,230,256,409,2429,1921,47892,7573,0,2477,0,24,-187,12240,430,0,0,949,0,0,0,165,0,0,0,607,0,24279,72170 +"483",542,12,369,148,42,415,1170,6,263,358,117,50,9,72,75,19,13,39,825,30,0,115,1,85,556,154,30,9,19,5,19,8,12,2,18,1,9,13,0,1,1,35,9,5,4,1,0,13,65,7,0,4,376,35,104,20,110,157,113,14,11,3,7,4,40,49,1558,94,357,782,297,9907,11193,0,6,0,0,22,5664,11682,0,0,2,0,0,0,0,0,0,0,0,0,28571,38478 +"484",8307,467,1491,1233,416,4856,29462,2700,3912,6579,4326,3775,685,1500,9028,1587,1384,1417,35129,964,219,3630,705,7786,6837,3169,5667,1331,1593,1887,5752,759,497,130,4858,116,40,3325,291,761,235,1632,1434,251,308,205,20,264,1210,444,249,413,5148,512,2121,514,647,2013,1520,638,773,168,516,320,2403,2559,3427,413,432,8441,1293,209096,105992,26,26306,1420,562,-1056,34877,5375,0,0,878,22,0,0,227,27,0,0,631,77,175364,384460 +"485",0,2,1,4,38,775,411,28,56,31,102,67,4,7,47,26,25,50,157,6,3,35,48,47,64,82,399,31,4,9,83,1,394,0,0,0,2,96,4,147,118,911,916,782,1027,900,71,257,2705,462,675,757,4058,102,2664,136,278,1350,1315,632,112,1208,39,33,271,195,9,1,7,13826,432,39534,28095,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28095,67629 +"486",159,4,8263,36,18,10561,458,5,6,6,5,10,0,4,3,1,2,4,24,2,0,15,15,13474,260,11,57,9,7,1,25,183,83,32,340,16,1,247,2,4,2,8,7,89,98,1,7,6,69,24,1,15,28,20,90,23,11,11,76,9,9,2,12,6,37,47,216,7,315,1503,7905,45007,2583,0,0,0,0,461,11424,0,0,0,0,0,0,0,0,0,0,0,0,0,14468,59476 +"487OS",0,86,38,1463,4,8478,0,795,1190,104,132,15,0,2,7,0,263,229,765,71,0,553,385,1494,199,612,42505,1791,921,522,15994,10352,1716,2733,51989,258,900,32164,1645,1936,1745,381,6880,303,3692,501,0,0,0,2813,1369,660,20469,581,3914,2043,486,2079,3085,460,1206,439,510,53,416,1587,1,59,819,873,3963,243696,25118,0,0,0,0,0,11626,3853,0,0,0,0,0,0,0,0,0,0,0,0,40598,284294 +"493",420,0,8,285,0,461,0,3559,2189,114,1719,580,1258,71,216,100,127,593,4727,1502,436,3597,1837,3620,3184,6581,21401,6427,9143,9691,29372,9,2,517,13633,68,54,1754,10727,635,383,1017,1392,0,0,81,0,1,105,502,289,150,1368,5,2736,119,79,665,901,156,254,117,80,366,1205,519,128,155,0,4219,91,157697,94,0,0,0,0,0,171,0,0,0,0,0,0,0,0,0,0,0,0,0,265,157962 +"511",49,1,24,0,1,181,660,1,1,3,31,25,4,1,9,29,5,23,7,0,0,5,41,3,21,10,1571,170,73,97,690,3,63,0,60,4,0,391,104,12183,83,1080,2511,266,1009,219,28,56,401,302,1450,1235,5176,2245,2430,12,739,1301,1162,109,651,18,50,38,66,508,1632,681,150,7816,123,50091,109859,0,0,142388,0,63,33557,-3925,0,0,0,2067,0,0,0,2537,0,0,0,7191,293736,343827 +"512",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,239,232,0,240,2,0,0,5,0,212,20,0,37,18355,44512,15,12,29,0,0,0,141,271,13,23,2812,180,75,0,2862,40,14,1424,1237,91,64,1097,2023,736,1598,309,4,1203,0,80140,12181,0,0,40644,0,-10,16693,-9775,0,0,0,0,0,0,0,0,0,0,0,0,59733,139873 +"513",463,14,802,154,300,1364,7268,146,266,141,628,479,67,99,289,131,111,324,866,54,27,212,300,348,483,452,14222,1430,722,524,10442,172,123,86,5461,460,999,4286,520,2800,717,111651,10969,6720,6915,8263,754,3064,18708,2019,6316,4799,17622,5534,16229,802,2391,6130,3828,1007,1262,279,873,710,4248,3577,4353,2765,342,45279,762,356925,337718,0,7146,30846,0,0,10264,-123,0,0,0,0,0,0,0,0,0,0,0,0,385851,742776 +"514",0,0,55,5,6,1870,1316,677,688,725,2146,1134,287,224,663,432,457,720,1443,186,87,757,367,727,583,1233,3990,1811,1283,823,6310,75,1,0,282,34,76,1292,152,1961,281,6123,19837,6386,4054,2756,976,57,1167,6512,4888,3590,21362,7099,26332,991,4581,1957,4115,379,1403,347,573,248,3007,5139,13336,3911,215,16978,1748,205224,103444,0,0,14803,0,0,5496,-1330,0,0,0,561,0,0,0,510,0,0,0,1682,125166,330390 +"521CI",1494,47,1994,500,764,8979,9358,241,902,592,1221,1098,632,296,1026,494,393,688,3426,171,120,311,322,594,1570,1229,19869,1812,3309,2893,15829,1089,5702,510,7940,5069,393,2658,900,1919,2290,5755,3200,29109,47198,15423,3078,123729,82558,26872,5514,4016,26384,15539,12855,384,2467,9943,2126,2622,1628,373,1277,661,2384,13477,337,419,2137,4973,10119,567201,312393,0,0,0,0,0,67194,-35,0,0,0,0,0,0,0,0,0,0,0,0,379552,946753 +"523",282,24,3267,1283,3492,770,2906,37,80,826,1535,1292,38,231,1056,458,399,736,247,12,6,32,48,98,47,114,2096,140,282,437,921,2638,856,7122,1645,801,275,3786,51,428,756,780,267,25956,62446,10726,100083,106,8527,1467,1510,608,4483,10647,2838,77,372,1810,10171,597,2365,304,101,1518,3021,16672,20,49,79,25887,2554,337590,267716,0,0,0,0,0,83919,-44,0,0,0,0,0,0,0,0,0,0,0,0,351591,689181 +"524",2531,579,9378,1091,1903,1035,1331,156,935,399,649,1002,150,603,1104,1695,320,480,2896,273,199,255,84,399,1657,511,25243,1887,1369,1042,6794,179,38,379,10005,1750,456,2749,1909,539,2408,2431,1523,6526,17880,465634,8121,19376,56380,5526,5635,1619,12551,220,11582,1443,2257,5993,88715,1572,5925,1344,1421,622,3222,3618,0,96971,229,2310,6771,925777,420290,0,0,0,8640,0,20779,-57026,0,0,0,0,0,0,0,0,0,0,0,0,392683,1318460 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9649,14133,0,0,0,0,0,0,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23813,170024,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,170024,193837 +"HS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2313757,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2313757,2313756 +"ORE",27325,67,1633,91,119,6393,33098,591,843,356,4486,1366,2375,399,1143,2351,1048,1259,4392,544,111,1383,1857,138,3060,2628,105319,14968,28036,17541,124908,22,304,303,5850,475,252,2811,21842,2932,4283,13698,15689,33710,22404,42703,1204,15054,123020,7119,20742,4366,50920,46206,16957,1331,37390,42954,43943,24225,19110,6957,9485,4970,83403,49878,5720,10436,795,40007,3501,1226800,5899,24015,0,0,149529,0,3873,0,0,0,0,0,0,0,0,0,0,0,0,0,183317,1410117 +"532RL",4968,95,5056,1141,1869,1046,26561,203,808,565,1876,1373,210,412,1490,859,160,1013,3863,102,103,790,492,1616,4144,894,28344,981,1880,2182,11707,5529,2959,218,10620,915,96,1233,1137,2380,2349,12148,11024,5637,7497,5533,32,156,2481,5559,3091,2987,18349,22256,7393,1225,2368,4013,3970,369,464,1001,900,930,7304,1883,493,395,484,10043,436,274660,115578,0,0,0,0,0,83897,0,0,0,0,0,0,0,0,0,0,0,0,0,199475,474135 +"5411",301,36,2493,387,625,3926,6482,683,523,629,3314,1317,2725,159,1802,2237,287,1419,1171,201,103,862,578,1372,3333,1491,9783,355,281,586,3804,120,528,142,522,74,418,1095,227,2751,1287,5501,5097,2797,7985,35190,1198,3622,22337,737,2878,5156,15434,8700,8993,475,365,4836,13687,1158,894,743,1318,1096,2903,2569,1041,181,635,9336,716,228002,111219,0,0,0,31366,0,16148,-5047,0,0,0,0,0,0,0,0,0,0,0,0,153686,381688 +"5415",377,23,5812,188,18,1761,5067,142,223,162,1110,1644,122,67,369,450,127,332,888,68,28,203,367,867,562,406,11977,1807,715,807,4894,66,1202,4,1572,75,23,489,321,5299,943,8604,15051,6433,9381,6474,552,553,2771,837,6087,7424,22264,20495,14408,337,1822,5886,10301,1312,1388,156,784,269,1730,2546,24134,12397,304,21280,2356,259912,0,0,40260,251204,0,0,42645,-31277,0,0,146,10609,0,0,0,26655,0,0,8,11888,352137,612049 +"5412OP",1603,321,5683,2053,3546,13602,91661,2701,2971,3390,9585,5346,6260,1585,6191,4223,2330,5631,16338,1214,648,3178,2136,4590,11377,6693,106380,16391,10178,9353,94693,467,2356,981,7806,646,4951,4694,1702,14147,13773,69220,51407,40819,43726,41127,3181,1827,109574,10244,10543,28973,161550,65066,53627,3372,5851,30853,44564,8181,6461,3240,3917,4912,32593,21686,43617,11555,1358,64643,15349,1496410,80477,0,22806,558084,3550,0,176059,-109516,0,0,0,61229,0,0,0,97948,0,0,0,22607,913244,2409654 +"55",0,0,15693,3368,784,22,12469,941,2323,1250,9669,16802,11574,1502,16640,4857,625,4199,30019,1168,1017,2896,945,9839,19926,3374,87941,1293,6505,21979,22868,293,66,863,13615,424,34,7666,812,8286,1532,5255,3629,4151,19358,5426,549,26,4322,7584,10212,8328,35738,120,68461,4823,1923,30322,11384,4732,3193,1444,1618,10553,59860,5002,0,0,446,0,0,654538,0,0,0,0,0,0,2908,0,0,0,0,0,0,0,0,0,0,0,0,0,2908,657446 +"561",775,36,1265,596,879,21125,13220,633,1455,1917,6762,1918,1816,442,2997,2556,328,1343,4451,349,444,1495,2823,3011,4709,2197,67776,4384,4296,3576,38922,3684,1536,3891,16041,2393,2931,11926,4625,8094,2834,28143,36313,20922,14924,13501,360,11689,144576,17627,10596,26579,68375,9287,84043,3831,3980,30747,55663,10339,4522,2423,1933,3514,12265,16365,17204,1618,1870,50501,7139,967305,58524,0,0,0,0,0,3651,-2638,0,0,0,0,0,0,0,0,0,0,0,0,59537,1026842 +"562",249,6,1200,224,177,812,3273,84,231,227,314,167,29,49,180,103,80,105,1419,73,11,252,83,617,1564,312,2465,709,535,261,1877,12,77,41,1328,47,53,786,797,132,48,351,128,485,136,2810,451,19,17009,485,188,172,2339,741,2905,11913,814,2135,2822,919,816,67,673,480,2366,1407,552,235,163,22164,3618,100371,29373,0,0,0,0,0,331,-320,0,0,0,0,0,0,0,0,0,0,0,0,29383,129754 +"61",17,2,0,0,0,205,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51,19,0,2,1608,36,1010,0,5650,97,34,0,0,0,25,64,0,0,0,77,287,24,22,0,0,0,0,0,0,67,105,0,1427,0,5153,1,25,0,0,2279,322,0,0,4803,2287,69,255,20764,15,46810,363713,0,0,0,0,0,4327,-1882,0,0,0,0,0,0,0,0,0,0,0,0,366158,412968 +"621",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,164,0,98,0,0,20954,16692,118,9,79,2,0,0,146,0,274,0,9486,0,48022,1100094,0,0,0,0,0,97,0,0,0,0,0,0,0,0,0,0,0,0,0,1100192,1148214 +"622",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3777,0,0,0,0,0,0,0,0,0,0,0,0,3777,1152233,0,0,0,0,0,5989,-6070,0,0,0,0,0,0,0,0,0,0,0,0,1152152,1155929 +"623",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2725,0,862,0,3588,259764,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,259764,263351 +"624",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4584,0,4584,233835,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,233835,238419 +"711AS",76,0,1,0,14,113,146,21,34,29,66,46,2,4,32,18,12,29,137,6,3,32,36,67,37,90,1606,437,500,40,713,30,134,0,150,7,0,312,40,179,9518,10964,522,863,835,558,146,0,6971,337,801,552,6587,2274,2311,104,1694,816,725,211,251,14806,538,171,913,2038,1077,26,41,1520,21,73392,47324,0,0,5721,0,0,1244,-1405,0,0,0,0,0,0,0,0,0,0,0,0,52884,126276 +"713",27,0,0,1,11,50,126,7,14,8,26,16,1,1,11,7,6,12,40,1,0,9,13,13,16,22,305,4,51,1,447,0,1,0,0,0,0,8,2,40,32,129,227,212,268,114,19,29,715,68,202,219,678,663,796,38,72,379,17,44,58,72,10,111,297,65,210,2,0,880,190,8113,141764,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,141764,149877 +"721",2,0,3,10,86,625,249,60,117,67,220,145,8,16,100,57,54,103,337,14,7,74,149,106,140,210,1008,10,49,20,194,0,11,0,0,0,9,729,109,360,338,1180,2009,1947,2469,1021,177,1623,6538,795,1443,1954,5140,511,5449,439,374,2281,164,238,277,55,78,112,736,445,678,248,23,2193,104,46498,89855,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,89855,136353 +"722",361,15,18,28,209,1326,343,112,190,130,338,245,16,38,168,88,80,161,655,33,15,139,165,287,214,305,3244,520,790,579,3224,6906,4,9,1605,66,78,2710,170,431,656,1482,2457,3849,3318,6082,543,5200,25855,1605,3353,3207,16890,2506,13269,515,1148,16993,10122,8443,1707,298,1178,2295,2518,2084,353,99,546,11006,359,175949,707718,0,0,0,0,0,1697,0,0,0,0,0,0,0,0,0,0,0,0,0,709415,885364 +"81",526,255,174,132,401,565,11529,481,1067,1079,2020,995,231,228,1417,288,220,501,3503,199,36,1741,609,1686,3626,1578,29931,1979,4189,2253,13434,154,158,9,9245,812,257,2930,1518,519,178,3562,3693,4504,3419,14511,830,77,6549,5587,1278,845,10249,8422,11739,2017,1326,5547,15482,1652,944,529,745,1238,12326,8282,3985,502,941,36724,2294,272455,617436,0,0,0,0,0,84,-3909,0,0,0,0,0,0,0,0,0,0,0,0,613611,886066 +"GFGD",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701608,0,0,0,0,0,0,0,0,0,0,0,701608,701608 +"GFGN",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,467992,0,0,0,0,0,0,0,467992,467992 +"GFE",14,1,0,3,0,191,5,0,0,6,29,200,0,107,0,0,0,23,0,1,0,0,47,64,46,0,11000,370,364,203,4149,2,0,1897,8917,98,129,1697,304,471,462,304,1799,1475,12915,149,0,2,397,667,457,206,2695,128,1272,127,247,763,1594,253,349,86,53,276,2275,881,0,114,1,1589,100,61979,5769,0,0,0,0,0,948,-283,0,0,0,0,0,0,0,0,0,0,0,0,6433,68412 +"GSLG",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1968775,0,0,0,1968775,1968775 +"GSLE",0,3,0,0,0,3689,0,31,111,116,135,76,17,28,89,27,25,46,733,41,8,128,33,305,899,128,911,230,293,126,915,1,0,0,320,5,21,249,435,79,43,208,99,286,148,139,0,0,847,700,677,193,2207,401,1833,146,85,604,1042,334,3183,35,206,247,1266,656,585,337,124,6866,955,34705,72254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72254,106959 +"Used",-32,46,0,-17,596,4573,2789,0,80,18171,304,3,0,0,0,0,0,2,0,24,0,2902,0,0,49,58,0,22,0,0,301,-1052,0,-81,521,1,40,1881,1,0,5,1,0,0,0,0,0,0,0,-43,0,0,0,71,0,0,1804,2,0,0,0,-70,152,0,0,11020,-36,0,0,0,0,44085,105182,-3226,-157690,0,205,-6198,18778,-17186,0,-4,137,0,0,-1765,15458,0,0,4790,7430,0,-34089,9996 +"Other",946,59,1143,15,327,969,1900,187,208,526,774,1189,2550,324,1909,502,155,397,1914,123,29,468,240,3258,2165,582,4714,37,472,565,2786,12874,185,2565,934,8,16,323,72,690,291,7192,741,2291,39729,1434,72,2439,3418,714,121,968,2410,1231,1318,37,632,0,0,283,0,226,193,425,1429,597,6424,3164,801,0,0,127678,-31424,0,0,13838,0,0,78830,-185662,0,0,0,0,0,0,0,0,0,0,0,0,-124419,3260 +"Total Intermediate",273663,11903,144330,41451,29481,192684,901562,78039,69119,142064,201472,199183,57864,65832,500337,119217,42344,68071,700309,30567,9691,116439,40405,292584,368165,157779,770040,83426,106061,110175,524172,54545,34740,27371,222888,18107,14458,128297,71366,87789,70272,416872,230653,221833,348834,697622,140132,271255,875511,131903,105943,126899,665037,266320,450378,53713,109581,343594,426776,96864,88355,42382,39783,51968,370188,282264,282597,168153,21714,809032,187083,15501502,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V001",30592,30138,28173,17572,24939,92998,598267,25430,31486,31214,101853,96537,170212,37616,73474,84906,21847,55537,126286,11573,6748,31581,24456,20662,114409,50670,562131,128486,113307,100357,327070,57721,20274,7195,109426,21477,8507,108311,76955,178392,33851,114327,100525,318627,272853,315603,3386,22082,110896,37511,146613,327410,703638,359102,449389,34972,215383,621734,445830,157156,139976,54526,47452,67617,265653,334900,280551,206699,63361,1474299,115840,11600551,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V002",-33665,-209,33210,4326,-717,65844,-53113,-1044,-181,1205,-6229,-2746,5891,-540,2115,1583,-1657,-2097,22470,-372,-721,1017,-1698,3774,16321,-439,232028,37251,26038,45777,109736,-5275,-1925,716,-4110,539,3910,-1631,59,3671,3836,42398,4319,19442,3114,46168,275,267611,12027,20282,6707,-2436,-24637,8802,-12627,1965,6126,-50907,4900,-1864,-2842,4734,11790,21526,19942,5527,0,0,-7103,0,-39157,869025,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V003",123805,11552,49560,34681,9318,179107,349217,20030,34813,24045,54943,66935,140444,24353,68310,62437,11093,40097,154734,5208,1234,29156,13274,38239,269774,29487,470787,58725,38711,13024,206651,7995,21441,3329,64252,18339,29419,35735,5682,159867,36087,313146,181352,471984,65091,256258,21971,1762316,388019,177144,122662,63380,317646,43952,146966,23630,32476,202355,80253,9727,9368,34748,8786,29426,118350,88202,167859,127235,10793,229244,70669,8590897,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"Total Value Added",120732,41482,110943,56579,33540,337950,894371,44416,66118,56464,150568,160727,316547,61429,143898,148926,31283,93537,303491,16409,7261,61754,36032,62675,400504,79719,1264946,224463,178056,159159,643456,60442,39789,11240,169568,40355,41836,142414,82697,341930,73773,469871,286195,810053,341058,618029,25631,2052009,510942,234938,275982,388354,996647,411857,583728,60567,253985,773181,530983,165018,146502,94008,68029,118569,403945,428629,448411,333934,67050,1703542,147353,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21060474,0 +"Total Industry Output",394395,53384,255273,98029,63020,530634,1795933,122455,135237,198528,352040,359909,374411,127261,644235,268143,73628,161607,1003800,46977,16952,178193,76436,355259,768669,237497,2034986,307889,284117,269334,1167628,114987,74529,38611,392456,58462,56294,270711,154062,429719,144046,886743,516848,1031886,689892,1315650,165763,2323265,1386453,366840,381925,515252,1661684,678177,1034106,114280,363566,1116775,957759,261882,234857,136390,107812,170537,774133,710893,731008,502087,88764,2512574,334435,0,14116166,614379,1077831,1105709,900829,-55822,1851596,-2479095,701608,9959,95905,74971,467992,16818,25031,128271,1968775,347155,47273,45124,0,36561975 diff --git a/flowsa/data/external_data/BEA_Summary_Use_2021_PRO_BeforeRedef.csv b/flowsa/data/external_data/BEA_Summary_Use_2021_PRO_BeforeRedef.csv new file mode 100644 index 000000000..039e790ff --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Use_2021_PRO_BeforeRedef.csv @@ -0,0 +1,80 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","Total Intermediate","F010","F02S","F02E","F02N","F02R","F030","F040","F050","F06C","F06S","F06E","F06N","F07C","F07S","F07E","F07N","F10C","F10S","F10E","F10N","Total Final Uses (GDP)","Total Commodity Output" +"111CA",82355,319,0,45,19,0,2876,0,0,0,0,0,0,0,0,0,0,96,244466,1816,0,0,0,0,7642,0,1565,192,1600,427,265,0,0,0,0,0,0,102,0,0,0,0,0,0,0,0,0,3,2,0,1,0,1191,50,712,0,131,0,0,0,0,0,534,38,2802,17,5,444,0,2200,0,351916,103616,0,0,0,0,-5724,61882,-50950,0,0,0,0,0,0,0,0,0,0,0,0,108824,460740 +"113FF",24557,7661,0,66,0,0,0,14589,1,0,0,0,0,0,0,0,69,238,7778,0,119,6884,53,23,422,1911,0,0,1096,0,6,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,349,20,4,0,91,0,0,0,0,0,273,468,6157,231,0,120,19,5067,0,78289,9721,0,0,0,0,-422,5590,-23339,0,0,0,0,0,0,0,0,0,0,0,0,-8450,69838 +"211",0,0,50693,7,1,32311,0,1,0,16,0,0,0,0,0,0,0,0,1,0,0,1,0,335865,3645,2,30,6,5,2,19,0,0,0,0,0,11,0,2,1,0,1,0,0,0,0,0,0,0,0,0,0,10,39,3,4,3,3,12,2,2,1,10,33,92,5,0,0,608,0,19082,442530,0,0,0,0,0,1031,89297,-146612,0,0,0,0,0,0,0,0,0,0,0,0,-56285,386246 +"212",1604,0,58,7201,32,6298,21938,1,7286,11499,676,153,1,119,60,60,11,156,466,18,0,359,0,1349,3804,26,22,0,0,0,5,0,152,0,7,0,0,4,1,40,29,225,1078,0,0,0,0,452,0,0,0,0,1300,34,700,94,396,0,27,36,13,234,420,57,272,737,0,599,0,1869,3362,75340,29,0,40,0,0,-500,13609,-3082,0,0,0,0,0,0,0,0,0,0,0,0,10096,85436 +"213",0,0,8890,1676,850,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11487,0,78012,1917,0,0,-10,1822,-1610,0,0,0,0,0,0,0,0,0,0,0,0,80131,91619 +"22",4982,111,7858,2811,82,42391,7645,1022,3271,4579,3526,1720,417,585,2605,556,447,834,7930,953,127,4110,1151,7625,12033,4250,22971,4189,11945,7260,27697,63,125,93,2733,83,1134,1179,15200,531,335,3435,3064,1647,993,783,1852,20,141751,2265,536,252,4845,12920,3403,538,6127,2288,9466,1582,1176,604,1356,5755,31075,4022,1719,1289,880,31274,3017,499094,306712,0,0,0,0,0,3573,-2861,0,0,0,0,0,0,0,0,0,0,0,0,307425,806518 +"23",1657,29,1315,1292,629,8097,275,97,301,335,421,284,41,76,383,81,56,118,874,64,17,481,154,7284,1020,369,2351,551,580,587,3681,252,2647,24,358,265,515,2297,835,42,20,2402,282,3322,1702,642,260,77838,100100,347,97,21,782,612,500,31,249,187,647,140,197,229,244,575,1944,3689,7659,3205,650,33882,61375,344569,0,499971,0,0,839808,0,115,0,0,11093,0,0,0,13791,0,0,0,342308,0,0,1707085,2051653 +"321",480,49,0,413,232,0,61553,30990,397,551,397,717,536,773,3801,321,9091,1822,507,64,15,7670,5,0,421,1903,6152,124,1094,165,2176,0,3381,0,140,0,2,118,392,69,137,1241,2166,57,6,12,0,1218,8907,443,20,15,940,7,665,25,38,373,345,4,817,9,148,736,1593,585,5,18,1,5366,187,162604,6657,70,0,0,10926,219,5270,-36420,0,0,0,0,0,0,27,0,0,0,0,0,-13252,149353 +"327",7,21,1941,392,587,82,79678,710,15768,1814,1197,1573,153,1477,8932,370,329,771,4994,182,0,306,2,1407,1639,1701,156,358,88,84,1536,0,20,0,38,0,0,51,289,4,5,2388,1210,26,55,16,0,1506,104,370,4,64,4303,55,1109,253,62,1848,1857,129,313,11,64,104,3098,1522,28,360,0,2011,2129,153660,13890,0,0,0,0,409,7579,-32417,0,0,0,0,0,0,0,0,0,0,0,0,-10539,143121 +"331",133,0,8839,656,336,6,7399,523,1589,79217,83184,36908,2764,18561,55250,8832,4927,8410,6030,222,0,1028,40,75,71,1615,1903,6,0,0,1828,0,1021,0,0,0,0,567,0,23,15,268,904,0,0,1,0,13,3525,152,0,1,2230,73,578,512,130,58,32,14,301,14,186,12,250,354,126,586,0,178,619,343096,1844,0,0,0,0,-5379,29433,-107865,0,0,0,0,0,0,0,0,0,0,0,0,-81967,261129 +"332",2129,138,9312,998,589,567,108930,2527,3660,4295,37819,27947,2941,9205,45963,11215,3254,6079,17234,800,463,6153,1676,762,10144,7241,4204,499,264,116,2915,205,556,812,1411,198,665,1062,667,918,71,10775,3158,115,218,6,25,372,2626,1402,56,1149,6862,1471,3488,2871,707,262,1252,29,1799,25,358,1301,4770,2786,5639,1136,499,4042,4737,400535,28489,0,14295,0,0,-3661,28799,-88626,0,0,405,0,0,0,7,0,0,0,36,0,-20254,380281 +"333",3436,158,12474,4230,2888,1218,42631,438,186,768,4114,35620,235,2251,26642,3973,82,1091,4981,40,2,1112,1804,143,4057,1765,3317,164,208,174,1398,2,71,12,163,119,24,4737,548,117,59,1441,1294,5,53,691,0,162,511,666,37,1393,3517,527,4049,4048,2661,1001,635,183,152,23,127,79,1147,6177,658,218,59,5843,1789,206599,14691,0,267151,0,0,3305,99889,-205834,0,0,1445,0,0,0,5,0,0,0,5622,0,186275,392875 +"334",49,0,35,15,83,114,6287,813,1584,1776,5814,10254,17421,4626,26616,11559,1191,3382,2714,857,189,1244,2583,559,6312,2839,17059,1047,444,449,3416,3,73,1,222,4,2,146,370,3515,1533,21393,8693,302,1343,49,681,960,680,290,1668,6801,12112,11509,4558,655,990,9863,702,159,446,24,164,212,130,4215,26919,4548,1,2631,1296,261192,130329,0,221082,0,345,6988,95799,-396082,0,0,7977,0,0,0,240,0,0,0,1582,0,68260,329452 +"335",5638,185,154,90,641,20,49216,2361,190,1429,2952,15819,1186,11459,8735,1532,90,1299,960,75,12,520,156,125,1025,1537,1563,299,119,1200,751,1,348,26,60,78,1,37,131,3,0,6882,585,74,89,16,0,323,1601,265,0,1549,6637,110,2526,991,964,16,491,849,496,35,243,611,1050,5916,2237,2424,51,1168,3974,154197,55924,0,39613,0,6419,1675,27906,-146546,0,0,355,0,0,0,5,0,0,0,605,0,-14044,140153 +"3361MV",886,92,1012,489,176,29,2005,567,512,471,863,10924,165,285,221553,2728,255,372,1927,52,2,843,182,171,894,412,8542,4032,1248,217,5560,0,49,0,3166,264,0,197,3785,189,87,695,243,27,13,0,0,0,0,1024,0,32,3545,990,7484,1335,340,403,1022,107,1656,197,92,133,973,10592,4167,71,816,7183,626,318973,318347,0,265590,0,0,-15907,88850,-315011,0,0,29165,0,0,0,7947,0,0,0,18710,0,397691,716664 +"3364OT",0,57,0,7,0,0,1,17,0,0,76,174,0,0,341,56608,0,0,0,0,0,0,0,0,0,0,13,63,0,0,0,658,1540,1546,0,44,0,2601,0,0,0,9,0,0,0,0,0,0,0,0,0,0,668,11,207,116,0,0,0,0,0,0,0,0,0,357,62395,2336,3,0,123,129972,29483,0,47463,0,0,-10665,73467,-40876,0,0,35265,0,0,0,250,0,0,0,1412,0,135800,265772 +"337",0,0,0,0,0,0,17537,156,1,0,0,145,21,1,22,80,2944,53,0,0,0,1,0,0,0,201,638,193,0,3,1995,0,0,0,0,0,0,2,0,1,0,149,473,0,0,0,0,3908,71,0,18,2,454,3,3,0,0,380,69,1,94,58,85,2,340,181,0,0,1047,11,40,31380,81699,0,27697,0,712,-468,3352,-62909,0,0,0,0,0,0,0,0,0,0,229,0,50312,81693 +"339",40,2,47,26,11,0,775,8,104,27,47,2012,1,526,1546,47,6,6493,6,144,182,0,6,0,256,121,788,231,99,2,1047,0,1,0,5,8,0,238,357,3,4,132,100,50,72,16,0,2,144,39,37,3,3079,15,1819,413,307,16711,14817,1215,1907,44,137,24,475,996,339,694,0,16243,89,75135,143524,0,57057,0,0,5145,29903,-141843,0,0,10,0,0,0,1,0,0,0,426,0,94222,169357 +"311FT",34054,235,0,0,0,0,0,34,252,6,0,0,0,0,0,0,0,8,171169,5,883,1109,859,500,3830,177,3319,1,3073,895,914,755,1,338,65,0,0,75,0,42,5,0,154,0,0,0,0,0,0,0,0,0,5105,35,0,0,5488,10,7592,4907,10553,692,3895,5914,61771,2160,2139,94,506,63853,0,397471,717357,0,0,0,0,1881,73488,-127016,0,0,0,0,0,0,0,0,0,0,0,0,665709,1063181 +"313TT",20,13,0,1,0,0,1730,394,384,0,0,1065,0,0,2551,338,2521,2078,73,7093,2899,3589,370,86,4,2103,2882,62,118,4797,2727,0,0,24,10,0,1,41,1,3,192,6,5,0,0,0,0,8,127,115,0,0,361,9,261,146,47,103,626,2605,1397,0,88,1897,481,311,462,282,2,2985,19,50512,30517,0,963,0,768,1708,7865,-44591,0,0,0,0,0,0,0,0,0,0,0,0,-2769,47743 +"315AL",46,0,0,0,0,0,0,0,0,0,0,0,0,0,1223,0,0,124,8,31,1028,0,39,4,0,0,479,9,0,145,165,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,22,0,146,82,2,2,9,0,0,18,12,3,0,498,18,8,141,1652,30,5952,178571,0,0,0,0,3206,4347,-164835,0,0,0,0,0,0,0,0,0,0,0,0,21289,27241 +"322",419,0,142,174,43,37,4430,527,1563,1090,2352,1836,216,1075,3429,499,1104,2051,29747,501,125,33458,4726,327,6181,4507,8614,151,2179,565,3099,28,104,3,195,1681,13,4731,476,1398,170,877,377,689,813,306,4,31,1403,709,691,360,5460,1415,4068,332,295,1005,2519,1015,1120,141,189,2027,4094,1266,138,1416,37,13984,39,170783,22908,0,0,0,0,1319,21663,-27161,0,0,0,0,0,0,0,0,0,0,0,0,18728,189510 +"323",10,0,6,1,0,3,48,2,0,0,0,3,0,0,3,0,0,0,82,0,8,0,1005,1,156,0,7980,104,174,126,6071,10,8,0,640,39,1,303,8,5953,824,263,4600,587,1264,1756,0,0,122,232,725,187,6644,1147,2847,14,805,1176,1849,102,1112,399,194,420,599,2026,328,739,6,9517,525,63752,3206,0,0,0,0,2363,2190,-3029,0,0,0,0,0,0,0,0,0,0,0,0,4730,68482 +"324",6996,382,7199,3108,1698,28668,53660,655,506,1310,641,942,80,1449,480,109,239,625,2981,84,31,1373,877,22642,9195,829,5774,900,668,157,2513,18827,6216,1768,20076,1142,71,17345,175,278,136,733,492,4247,5933,49,464,250,6810,1942,57,841,2381,1582,6780,1609,771,868,4064,673,763,112,1070,985,4129,3286,12386,863,1761,106584,13588,408877,180272,0,0,0,0,-3274,106680,-69387,0,0,0,0,0,0,0,0,0,0,0,0,214292,623168 +"325",27211,1844,9826,2606,1016,2974,16814,1681,4727,1573,7433,3397,1096,2186,9041,1191,1515,5718,9339,9607,407,11486,5081,13332,191041,59285,3573,286,223,45,3433,1,234,3,210,8,1,76,899,425,243,760,1391,32,109,14,0,430,15225,449,102,125,25068,1779,11241,1251,1001,44062,21503,3823,1047,546,719,101,1501,3958,2176,2256,85,39607,2817,594266,337833,0,3054,0,0,-5542,178087,-324629,0,0,0,0,0,0,0,0,0,0,0,0,188804,783070 +"326",1840,100,112,753,515,21,35420,576,1324,548,2550,5860,548,1589,27315,2467,3543,4858,20859,379,352,3265,707,465,9976,17163,17245,1926,2386,483,8182,28,6,0,573,24,34,2946,620,385,194,4555,960,47,140,448,0,772,499,1591,56,652,7339,192,2215,380,896,8338,4196,1446,833,36,208,151,7550,3286,1358,617,16,12912,2350,242174,45513,0,361,0,78,741,26174,-76609,0,0,0,0,0,0,0,0,0,0,0,0,-3742,238432 +"42",46464,3259,11585,4397,2972,10478,112338,12934,6799,30654,22112,32463,5871,11115,73378,10806,6247,10993,74202,3018,2119,14731,3461,19793,53977,16825,74844,4628,2935,3883,37558,2883,3938,907,10146,793,185,7408,3213,5827,412,16056,4257,1940,3258,619,445,1657,8497,13741,1175,3053,25131,7212,12567,3177,5174,29788,18208,5171,4751,575,2586,4617,24036,11782,19352,4144,1515,57117,9749,1063904,703676,11,231952,35201,4278,9393,226960,89101,0,0,18646,554,0,0,4378,664,0,0,11506,1964,1338285,2402189 +"441",7,1,325,172,96,26,2755,149,293,145,371,3016,41,1,2558,1152,115,228,1039,32,1,416,102,1,563,180,152,2292,730,113,3075,0,16,0,1144,6,0,14,103,94,49,60,2,16,8,21,0,30,528,538,0,17,1217,0,2023,68,0,0,0,0,0,6,25,46,120,5418,0,0,0,0,1,31718,208784,0,41763,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,250562,282280 +"445",77,0,1,0,0,165,554,0,26,0,1,4,0,1,9,0,4,1,9,0,0,2,38,3,117,2,50,20,60,15,90,0,12,1,443,22,0,39,0,3,1,0,12,6,8,1,0,64,111,8,2,2,30,0,389,1,13,9,14,2,3,10,26,99,2935,62,0,1,0,44,0,5622,262117,0,128,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,262255,267877 +"452",118,1,33,11,6,250,3041,11,64,10,37,214,4,9,224,69,54,19,157,5,0,42,230,16,409,25,305,273,118,25,456,0,19,1,713,32,1,60,7,24,9,5,71,34,48,9,0,506,465,58,25,12,315,0,905,9,72,65,50,6,22,7,18,372,1398,635,1,28,0,351,0,12593,254972,0,3698,680,644,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,259995,272588 +"4A0",1568,3,207,138,20,3755,101689,103,81,41,225,965,26,91,1190,239,503,108,1175,43,4,261,1268,322,3233,156,1761,3766,772,999,4070,3,249,486,10802,428,5,1332,29,154,42,29,393,190,270,47,0,4806,2376,213,226,71,2134,0,1864,43,316,520,315,59,170,109,231,2198,16075,3246,13,325,1,3910,0,182461,1093048,0,47052,17567,9828,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1167495,1349957 +"481",287,2,31,23,112,669,421,84,225,136,341,272,30,41,298,145,80,157,770,38,18,136,149,160,340,300,4405,86,52,70,541,203,19,201,1269,14,9,1227,64,464,305,1044,1891,1114,2515,351,193,42,5761,725,940,1394,4558,269,6278,419,413,1995,304,243,396,87,239,138,904,789,1903,1386,317,2559,63,53425,121389,0,625,99,5,20,21253,-14813,0,0,43,2,0,0,3,2,0,0,14,6,128646,182071 +"482",2491,62,815,386,118,3431,3145,914,1889,2529,970,504,45,295,1432,255,318,287,6657,83,12,2344,159,1795,4704,1891,428,36,177,59,162,101,377,10,3882,20,13,542,56,38,9,192,70,59,85,94,3,105,377,76,47,28,815,47,532,62,61,476,246,89,107,10,56,122,710,159,207,404,373,2574,1838,53465,8435,0,2632,0,28,-557,15023,545,0,0,1100,0,0,0,295,0,0,0,708,0,28209,81674 +"483",571,18,861,151,40,514,1206,6,288,451,126,58,10,74,81,23,13,39,860,27,1,110,1,87,642,160,552,9,21,6,25,13,13,1,18,1,13,15,1,1,1,30,12,3,4,0,0,21,73,7,0,4,339,42,115,22,88,177,127,11,11,2,10,8,57,38,1682,184,433,851,283,11745,12231,0,6,0,0,-42,6371,14587,0,0,3,0,0,0,0,0,0,0,0,0,33157,44902 +"484",10643,683,2399,1640,431,5252,34315,3201,4449,8178,5340,4808,875,1807,10699,1952,1632,1730,41253,1004,335,4113,751,9755,8008,3529,7797,1568,1891,1761,7650,1300,615,146,5577,168,55,4476,403,900,210,1728,1730,207,329,186,24,714,1572,492,245,417,6033,1002,2479,591,731,2233,1966,668,989,184,881,685,3999,2175,3251,651,486,9555,1499,251001,130225,4,28750,1706,804,1107,44051,6326,0,0,882,27,0,0,229,32,0,0,836,95,215073,466074 +"485",0,3,2,5,39,1088,504,30,65,42,117,84,6,7,51,33,27,68,152,7,5,42,54,57,68,85,630,40,5,15,113,1,463,0,0,0,3,149,6,198,109,908,1071,647,1133,851,80,161,2854,520,637,748,4618,129,3718,163,289,1520,1725,611,138,1671,65,79,465,388,15,3,9,16327,440,46354,33405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33405,79759 +"486",143,7,9786,47,19,11868,514,6,6,7,7,11,1,3,3,1,2,4,21,3,0,22,14,15568,260,10,88,12,9,2,34,295,96,28,313,18,1,271,3,4,2,7,7,66,93,1,7,4,83,28,1,13,27,25,95,22,11,9,63,7,9,2,16,14,60,42,193,14,232,1617,6949,49227,2774,0,0,0,0,-100,15368,0,0,0,0,0,0,0,0,0,0,0,0,0,18043,67269 +"487OS",0,127,66,1782,4,12188,0,853,1510,142,164,19,0,3,8,0,353,285,805,96,0,745,468,1955,228,660,59064,2317,1083,718,20577,20762,1955,3245,64578,378,1069,43863,2161,2039,1428,358,6981,195,3335,470,0,0,0,2601,1148,578,20140,632,4515,2475,501,2050,3407,416,1264,525,574,97,633,2553,1,114,856,843,5488,310452,32877,0,0,0,0,0,15285,5187,0,0,0,0,0,0,0,0,0,0,0,0,53349,363801 +"493",306,0,11,285,0,558,0,3579,2257,129,1717,635,1515,71,223,117,125,677,4041,1723,624,3716,1829,4148,3026,5938,28449,7696,10446,12670,39019,13,2,512,17998,96,57,1874,13731,704,301,870,1366,0,0,73,0,1,94,448,232,125,1328,5,3282,121,121,708,959,137,261,135,107,653,1904,1080,100,262,0,3932,118,189238,106,0,0,0,0,0,180,0,0,0,0,0,0,0,0,0,0,0,0,0,286,189525 +"511",44,1,38,0,1,269,809,2,1,5,36,33,6,1,9,43,6,30,7,0,0,5,45,4,24,10,2412,232,94,152,995,6,73,0,91,5,0,516,156,13594,78,1098,2895,212,1129,187,31,68,402,306,1329,1200,5505,2770,3121,14,847,1374,1422,103,739,24,79,88,109,840,1506,1313,124,8476,149,57290,128536,0,0,164105,0,6059,35828,-4591,0,0,0,2429,0,0,0,2916,0,0,0,8627,343909,401198 +"512",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,555,328,0,291,4,0,0,10,0,306,37,0,71,21590,55605,22,12,39,0,0,0,179,353,15,27,3946,242,117,0,3152,55,22,1864,1952,93,109,2065,3100,896,1777,544,5,1131,0,100546,13483,0,0,41899,0,416,17313,-10765,0,0,0,0,0,0,0,0,0,0,0,0,62346,162891 +"513",351,19,1129,150,270,1662,7683,131,267,157,618,529,79,96,276,150,105,360,723,62,38,221,292,350,452,399,19016,1864,823,669,13173,258,128,84,7284,647,945,5322,669,3372,573,114932,11000,4790,6739,5231,759,2903,17077,1858,5189,4040,17630,5924,18459,810,2325,5906,4025,850,1325,320,1141,1581,6428,6032,3392,4639,314,42597,807,370417,356215,0,7146,31482,0,0,10164,-160,0,0,0,0,0,0,0,0,0,0,0,0,404847,775264 +"514",0,0,72,5,6,2580,1549,709,761,880,2299,1351,375,233,717,558,480,889,1313,232,129,853,391,774,603,1197,5751,2496,1676,1305,9384,125,1,0,435,52,88,1803,216,3141,267,6080,25652,5085,4406,2079,1123,72,1160,7450,4712,3490,26072,8985,36634,1184,5937,2258,4862,387,1882,564,937,616,5092,9147,11608,7246,252,17710,2234,250615,130120,0,0,19341,0,0,5813,-1796,0,0,0,732,0,0,0,651,0,0,0,2290,157150,407766 +"521CI",1186,62,3008,499,726,11963,10315,214,932,663,1226,1180,591,290,985,599,381,769,2964,203,169,326,315,589,1489,1128,24765,2351,3414,3836,20573,1826,5441,502,11118,7253,423,3265,1190,2204,1908,5281,3314,24180,47106,11955,3152,125140,78197,24182,4546,3544,26408,15768,15520,412,2592,9995,2198,2262,1727,483,1528,1090,3291,14700,330,423,1948,4836,10349,579300,335078,0,0,0,0,0,75475,-46,0,0,0,0,0,0,0,0,0,0,0,0,410507,989808 +"523",232,34,3280,1467,3662,1049,3432,35,87,938,1534,1424,50,229,1032,518,394,833,223,16,9,37,51,107,47,109,2943,243,338,560,1385,4691,1034,7181,2315,1106,285,4937,68,489,621,709,283,22479,71424,8174,118726,68,8249,1492,1286,549,4879,12076,3554,82,585,1832,13415,526,3003,339,141,2553,4990,19202,22,129,75,27004,3189,380058,310892,0,0,0,0,0,96372,-58,0,0,0,0,0,0,0,0,0,0,0,0,407207,787265 +"524",2722,564,10081,1068,1264,1297,910,150,991,414,672,1124,199,622,1133,1321,330,560,2652,331,306,288,89,326,1638,482,33792,2445,1516,1514,9475,349,39,438,11374,2194,574,3348,2103,588,2061,2444,1470,5236,18903,519276,7405,15057,60387,4809,4384,1335,11911,229,12686,1444,2246,6197,74380,1445,4970,1529,1682,1174,4624,6482,0,109384,419,1991,10882,997728,437741,0,0,0,2538,0,23298,-58401,0,0,0,0,0,0,0,0,0,0,0,0,405175,1402903 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14796,16835,0,0,0,0,0,0,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31686,191127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,191127,222813 +"HS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2398820,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2398820,2398820 +"ORE",27977,68,1820,98,122,6265,26219,428,714,307,3574,1448,3770,418,1712,6513,803,1355,3139,503,142,1196,1521,106,4719,1981,105271,15044,23837,17055,130774,399,355,445,7937,833,420,4922,22145,3542,6849,18883,25494,17975,33253,85224,738,18476,136888,11595,34998,6188,74029,37156,24680,1864,40786,50547,52488,25008,24184,8098,12436,6455,91073,42370,5838,12154,1092,41382,3919,1382016,7178,23440,0,0,179433,0,3089,0,0,0,0,0,0,0,0,0,0,0,0,0,213140,1595157 +"532RL",3425,134,7087,1143,1689,1213,25134,164,728,564,1633,1307,236,353,1259,830,137,986,2969,106,129,721,427,1518,3396,701,33499,1089,1858,2569,12673,10537,3399,385,14472,1401,183,2002,1280,2312,3017,11559,11908,3503,7016,5154,27,142,2678,6083,3554,2720,18999,20678,8789,1581,2309,4484,5468,447,565,1170,1214,1590,9389,1464,406,376,465,9905,461,292767,130703,0,0,0,0,0,86809,0,0,0,0,0,0,0,0,0,0,0,0,0,217512,510278 +"5411",252,52,3138,445,635,5450,7179,731,547,805,3369,1415,2745,167,1784,3997,290,1593,1024,231,145,915,606,1577,3313,1387,14433,517,348,857,5146,201,625,209,767,114,498,1438,330,3482,1164,5285,5304,2153,8505,23470,1228,3826,22366,727,2519,4881,15582,10247,11357,526,406,5174,15986,1070,1042,955,1890,1924,4323,3797,918,340,610,9643,848,240824,122103,0,0,0,46334,0,18748,-5408,0,0,0,0,0,0,0,0,0,0,0,0,181776,422600 +"5415",317,32,6720,200,17,2388,5570,135,238,194,1056,1721,144,67,344,584,129,390,786,83,40,223,344,771,527,381,16620,2303,854,1153,6691,106,1258,4,2192,111,26,667,434,5266,787,7916,15388,5122,9548,4232,569,627,2599,799,5216,6608,22983,22982,17520,363,1936,6035,11517,1162,1540,193,1114,569,2629,4103,19895,21673,311,20559,2552,280135,0,0,45913,266581,0,0,45824,-33478,0,0,87,11112,0,0,0,28292,0,0,5,11883,376220,656354 +"5412OP",1651,474,8944,2336,3707,19594,98539,2638,3273,4106,9705,5886,6495,1619,6454,7030,2378,6226,13934,1415,902,3372,2210,5239,11538,6346,137170,18379,10745,11075,108293,994,2748,1403,12111,1082,6194,6884,2416,18851,18304,74459,82235,39910,51795,39678,3031,2226,124160,12615,13287,29876,184407,68663,74248,3980,7473,34714,52167,7987,8038,4002,5870,9175,43726,26912,39192,18802,1383,66839,18282,1741794,86635,0,28464,631115,5651,0,198028,-123063,0,0,0,69618,0,0,0,100633,0,0,0,23815,1020897,2762691 +"55",0,0,19952,3096,671,22,12836,780,2163,1223,8810,16841,11136,1365,15213,6643,564,3917,23140,1244,1333,2684,868,9859,17419,2775,106563,1366,6087,25984,31308,419,120,791,16656,549,63,8118,976,8828,1153,4339,3138,2795,17110,3049,495,15,3540,6509,7995,6824,32262,125,77660,4551,2866,26882,10724,3672,3077,1824,1956,17536,84497,9777,0,0,511,0,0,707265,0,0,0,0,0,0,3042,0,0,0,0,0,0,0,0,0,0,0,0,0,3042,710307 +"561",701,57,1951,694,955,21107,16207,638,1680,2314,7549,2299,2295,534,3452,3672,360,1748,4301,474,749,1678,3191,3786,5374,2238,102584,6453,5421,5163,58048,8976,1994,6401,20956,4117,3307,16116,5506,9461,3437,30783,54169,18804,16657,13290,372,17141,156164,17783,12052,28387,85964,13790,102376,4689,4704,31448,63695,9751,5335,3245,2814,8257,21929,17277,16855,3394,2037,53518,8886,1173513,64899,0,0,0,0,0,4370,-3711,0,0,0,0,0,0,0,0,0,0,0,0,65558,1239071 +"562",224,9,1773,233,172,1097,4010,83,256,285,337,203,34,53,193,121,79,131,1284,93,17,270,89,750,1532,302,3554,1008,652,372,2829,19,86,41,2031,71,58,906,1112,163,42,343,140,364,141,1983,479,90,17471,507,163,154,2427,849,3342,12788,877,2329,3279,841,955,86,939,1043,3828,2580,467,419,155,21452,4145,111210,32185,0,0,0,0,0,419,-451,0,0,0,0,0,0,0,0,0,0,0,0,32152,143362 +"61",15,3,0,0,0,174,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,15,0,1,1744,62,1028,0,6309,163,26,0,0,0,18,52,0,0,0,52,193,30,37,0,0,0,0,0,0,37,64,0,2290,0,5288,1,30,0,0,4471,585,0,0,6998,2539,191,431,23464,20,56368,376180,0,0,0,0,0,6352,-2290,0,0,0,0,0,0,0,0,0,0,0,0,380242,436610 +"621",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,163,0,81,0,0,22617,17410,84,10,96,2,0,0,134,0,740,0,8421,0,49759,1206770,0,0,0,0,0,108,0,0,0,0,0,0,0,0,0,0,0,0,0,1206878,1256637 +"622",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2632,0,0,0,0,0,0,0,0,0,0,0,0,2632,1249051,0,0,0,0,0,7617,-8549,0,0,0,0,0,0,0,0,0,0,0,0,1248119,1250751 +"623",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2839,0,468,0,3307,261205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,261205,264513 +"624",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9568,0,9568,252111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252111,261680 +"711AS",98,0,1,0,21,184,223,26,49,49,99,72,3,5,42,30,17,53,160,9,5,48,55,104,51,131,3138,1050,779,71,1242,67,201,0,270,13,0,615,62,299,9505,14228,860,895,1204,701,206,0,9010,457,966,742,8786,3305,4263,164,2062,1212,1028,254,382,24688,926,300,1878,3539,1076,56,46,2141,40,104263,61313,0,0,6284,0,0,1446,-1481,0,0,0,0,0,0,0,0,0,0,0,0,67561,171824 +"713",31,0,0,1,14,91,193,9,20,13,38,25,2,2,15,11,8,20,48,2,0,13,18,19,20,28,571,6,83,3,705,0,1,0,0,0,0,15,3,66,36,163,328,216,363,118,26,22,924,90,233,265,944,942,1355,56,83,521,25,52,85,107,18,267,509,297,227,5,1,1148,307,11830,192367,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192367,204197 +"721",2,0,4,9,76,760,281,52,114,75,211,152,11,15,90,61,49,117,271,16,9,75,143,108,124,184,1308,12,54,27,234,0,10,0,0,0,10,934,108,405,260,1016,1982,1353,2276,715,167,868,5710,726,1129,1603,4808,512,6373,438,341,2134,160,191,289,72,99,217,1051,726,525,414,25,2056,100,44449,161144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,161144,205592 +"722",469,32,78,49,278,3162,607,156,295,234,519,413,31,63,244,154,116,287,853,61,32,225,248,477,309,422,7099,1013,1308,1121,6284,15107,7,32,3208,150,125,3916,297,789,777,2033,3940,4368,4976,5725,837,8628,36940,2401,4321,4279,25620,4763,24062,830,1620,23801,16219,9584,2753,584,2129,6788,5535,5127,423,259,706,15959,658,276918,903493,0,0,0,0,0,1755,0,0,0,0,0,0,0,0,0,0,0,0,0,905247,1182166 +"81",394,315,270,127,352,755,11492,431,1036,1188,1902,1023,244,219,1328,313,204,541,2792,220,52,1625,570,1703,3194,1340,40340,2447,4502,2855,17068,347,165,19,12627,1321,415,4577,1807,688,243,4419,6466,4725,4548,10446,788,90,9774,8573,1839,1008,13019,8772,15241,2858,1836,6099,19673,1562,1146,740,1092,2273,17288,9389,2985,667,934,45726,2756,329784,631191,0,0,0,0,0,93,-3751,0,0,0,0,0,0,0,0,0,0,0,0,627533,957317 +"GFGD",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,713008,0,0,0,0,0,0,0,0,0,0,0,713008,713008 +"GFGN",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,533783,0,0,0,0,0,0,0,533783,533783 +"GFE",9,2,0,3,0,207,5,0,0,5,23,193,0,92,0,0,0,19,0,1,0,0,39,64,36,0,12649,410,358,237,4472,3,0,1635,10252,121,118,1472,333,416,317,231,1530,1103,13318,117,0,1,315,515,321,150,2348,127,1213,112,243,635,1471,191,306,77,59,477,2909,1078,0,140,1,1259,121,63857,5709,0,0,0,0,0,874,-273,0,0,0,0,0,0,0,0,0,0,0,0,6310,70166 +"GSLG",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2106940,0,0,0,2106940,2106940 +"GSLE",0,3,0,0,0,4453,0,27,108,129,127,80,17,26,84,28,22,49,585,45,11,119,31,328,779,108,1204,267,315,157,1202,1,0,0,434,7,20,268,536,93,43,187,107,207,175,97,0,0,942,988,613,169,2241,407,2211,143,99,655,1052,283,3174,40,246,482,1812,998,440,535,101,6357,962,37430,77737,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77737,115166 +"Used",-83,58,0,-11,1131,5643,2960,0,78,16666,222,3,0,0,0,0,0,0,0,24,0,2598,0,0,44,46,0,11,0,0,382,-3458,0,-112,-1160,1,76,1731,1,0,0,1,0,0,0,0,0,0,0,-44,0,0,0,425,0,0,504,1,0,0,0,-124,379,0,0,4399,-33,0,0,0,0,32360,160051,-3285,-190369,0,-1043,-13825,27788,-25716,0,-4,69,0,0,-576,11554,0,0,4907,7038,0,-23411,8949 +"Other",689,61,1131,14,283,1059,1660,146,192,470,590,1007,3679,281,1484,646,125,304,1466,110,35,383,211,3585,1716,425,5267,40,429,663,3342,16419,167,2117,1179,10,18,388,72,523,241,7064,974,1492,44191,986,72,1772,2482,951,158,728,2495,1047,1327,43,522,0,0,208,0,224,278,993,1863,388,6365,4360,827,0,0,134438,-6631,0,0,16684,0,0,77670,-217934,0,0,0,0,0,0,0,0,0,0,0,0,-130211,4226 +"Total Intermediate",301930,17546,216514,47722,30342,265522,1019148,88246,76092,185452,231736,240133,68387,76507,574495,151186,48129,82447,730900,34546,14235,129544,41789,478567,407691,161838,981391,99798,112754,115633,647046,103966,42208,31763,283512,27091,18053,174387,86352,103036,80213,449032,307884,182711,388750,764212,161103,293610,1004609,143482,119610,128712,765447,284808,566608,61804,121929,375414,476463,96224,102795,60676,55313,98281,511459,286194,274370,222883,24184,913356,219909,18089683,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V001",31511,29853,24826,18534,23948,93294,635566,28148,33190,33889,107966,101965,183744,40560,80207,84679,23500,60795,134314,12358,7262,32368,24722,20164,119056,54768,605994,155664,115199,110753,363868,58505,20227,7297,118572,24464,8254,126402,93393,221340,42938,117427,126152,347745,316460,323673,4060,23438,124414,39775,157836,374959,774844,392407,504904,37380,225927,674729,466161,154782,148628,61598,57464,78099,341147,350173,292985,213818,65613,1519644,118844,12549140,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V002",-14489,1081,37895,5676,98,70352,-21700,68,1119,2200,-2241,953,8444,378,3063,2333,-824,-571,26683,234,-577,1830,-1115,4344,18990,1081,291032,55868,28930,47732,139183,-788,-2702,606,1252,-1234,4183,1135,788,5630,2213,42469,6487,21451,6255,36960,600,283922,19460,23379,18115,4582,-146,10322,2445,3721,6071,-22310,11802,4022,-7478,-5597,15526,22408,-4063,9089,0,0,-9083,0,-38086,1181454,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V003",147685,10928,176495,37032,9432,214790,331437,33594,35916,40998,56416,71692,141845,26716,75417,69809,8837,40179,161579,5098,1624,28062,13338,104831,301546,29258,547472,69227,40503,16292,247909,26309,24628,4944,72694,19629,32692,42465,4525,168154,42857,323705,213884,521221,77135,276669,26760,1807130,412514,192626,127240,45042,341025,45595,172795,24443,37728,197086,82799,9297,16311,74571,15453,61921,186947,110589,176789,135748,11642,246952,78014,9584486,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"Total Value Added",164706,41862,239216,61242,33477,378436,945303,61811,70225,77086,162141,174610,334033,67654,158687,156822,31513,100403,322576,17689,8310,62260,36946,129339,439593,85107,1444497,280758,184632,174777,750960,84025,42153,12846,192517,42858,45129,170002,98706,395124,88008,483601,346524,890417,399849,637302,31420,2114490,556388,255780,303191,424583,1115723,448324,680145,65545,269726,849505,560762,168100,157461,130571,88443,162428,524030,469851,469774,349566,68172,1766596,158772,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23315081,0 +"Total Industry Output",466636,59408,455730,108964,63819,643958,1964451,150057,146318,262538,393877,414743,402420,144161,733182,308008,79642,182850,1053476,52235,22544,191803,78734,607906,847284,246945,2425889,380557,297386,290410,1398006,187990,84361,44609,476030,69949,63182,344389,185058,498160,168221,932633,654408,1073129,788599,1401514,192523,2408100,1560998,399262,422801,553296,1881171,733132,1246752,127349,391655,1224919,1037226,264325,260255,191247,143756,260709,1035490,756045,744145,572449,92356,2679952,378680,0,15902575,598223,1194044,1232744,1107582,-19091,2179415,-3041128,713008,11089,95451,84473,533783,13216,24944,133191,2106940,347215,48729,48680,0,41404764 diff --git a/flowsa/methods/flowbysectormethods/Water_state_2015_m2.yaml b/flowsa/methods/flowbysectormethods/Water_state_2015_m2.yaml new file mode 100644 index 000000000..fe8c1f742 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/Water_state_2015_m2.yaml @@ -0,0 +1,38 @@ +# This is the 2015 target year method for water m1 which builds off the generic +# method in Water_common + +!include:USEEIO_summary_target.yaml +year: 2015 +geoscale: state + +sources_to_cache: + USDA_IWMS: + !include:Water_common.yaml:sources_to_cache:USDA_IWMS + year: 2018 + +source_names: + USGS_NWIS_WU: + !include:Water_common.yaml:source_names:USGS_NWIS_WU + activity_sets: # do not import all activity sets from the common file because common file contains activity sets for multiple methods + direct_attribution: + !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:direct_attribution +# employment_attribution: +# !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:employment_attribution +# attribution_method: proportional +# attribution_source: +# Employment_national_2015: +# geoscale: national +# cropland_attribution: +# !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution +# attribution_method: proportional +# attribution_source: +# USDA_CoA_Cropland: +# !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution:attribution_source:USDA_CoA_Cropland +# year: 2017 +# livestock_attribution: +# !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:livestock_attribution +# attribution_method: proportional +# attribution_source: +# USDA_CoA_Livestock: +# !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:livestock_attribution:attribution_source:USDA_CoA_Livestock +# year: 2017 From d67cea24b0b84235c1bdc4e0177a49d57bf56c56 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 6 Sep 2023 13:29:13 -0600 Subject: [PATCH 0927/1127] delete subset_BEA_table() - obsolete and broken --- flowsa/data_source_scripts/BEA.py | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/flowsa/data_source_scripts/BEA.py b/flowsa/data_source_scripts/BEA.py index 50ab5edc7..d526ff1ef 100644 --- a/flowsa/data_source_scripts/BEA.py +++ b/flowsa/data_source_scripts/BEA.py @@ -147,33 +147,3 @@ def bea_make_ar_parse(*, year, **_): df['DataCollection'] = 5 # tmp return df - - -def subset_BEA_table(df_load, attr, **_): - """ - Modify loaded BEA table (make or use) based on data in the FBA method yaml - :param df_load: df, flowbyactivity format - :param attr: dictionary, attribute data from method yaml for activity set - :return: modified BEA dataframe - """ - df2 = pd.DataFrame() - # extract commodity to filter and which Activity column used to filter - for commodity, ActivityCol in attr['clean_parameter'].items(): - df = df_load.loc[df_load[ActivityCol] == commodity].reset_index( - drop=True) - - # set column to None to enable generalizing activity column later - df.loc[:, ActivityCol] = None - if set(fbs_activity_fields).issubset(df.columns): - for v in activity_fields.values(): - if v[0]['flowbyactivity'] == ActivityCol: - SectorCol = v[1]['flowbysector'] - df.loc[:, SectorCol] = None - df2 = pd.concat([df, df2]) - - # aggregate cols - df3 = aggregator(df2, list(df2.select_dtypes(include=['object', - 'int']).columns)) - - return df3 - From e35ac4db4df90bf2e51814489dee97eda5bebe36 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 6 Sep 2023 15:30:26 -0600 Subject: [PATCH 0928/1127] rename all BEA FBAs to align with useeior schema --- .../NAICS_Crosswalk_BEA_Make_AR.csv | 1434 ++++++++--------- ...t_IO.csv => BEA_Detail_GrossOutput_IO.csv} | 0 ...sv => BEA_Detail_Make_2002_AfterRedef.csv} | 0 ...v => BEA_Detail_Make_2012_BeforeRedef.csv} | 0 ...> BEA_Detail_Use_2012_PRO_BeforeRedef.csv} | 0 flowsa/data/source_catalog.yaml | 8 +- flowsa/data_source_scripts/StatCan_IWS_MI.py | 3 +- .../BEA_Detail_GrossOutput_IO.yaml | 28 + .../BEA_Detail_Make_AfterRedef.yaml | 10 + ....yaml => BEA_Detail_Make_BeforeRedef.yaml} | 6 +- ...ml => BEA_Detail_Use_PRO_BeforeRedef.yaml} | 8 +- .../BEA_GDP_GrossOutput.yaml | 25 - .../flowbyactivitymethods/BEA_Make_AR.yaml | 12 - .../flowbysectormethods/CAP_HAP_common.yaml | 12 +- .../CAP_HAP_national_2017_m1.yaml | 2 +- .../CAP_HAP_national_2020_m1.yaml | 2 +- .../GHG_national_m1_common.yaml | 58 +- flowsa/sectormapping.py | 2 +- .../write_Crosswalk_BEA_Make_Table.py | 2 +- scripts/write_BEA_Use_from_useeior.py | 8 +- 20 files changed, 809 insertions(+), 811 deletions(-) rename flowsa/data/external_data/{BEA_GDP_GrossOutput_IO.csv => BEA_Detail_GrossOutput_IO.csv} (100%) rename flowsa/data/external_data/{BEA_2002_Make_AfterRedef.csv => BEA_Detail_Make_2002_AfterRedef.csv} (100%) rename flowsa/data/external_data/{BEA_2012_Detail_Make_BeforeRedef.csv => BEA_Detail_Make_2012_BeforeRedef.csv} (100%) rename flowsa/data/external_data/{BEA_2012_Detail_Use_PRO_BeforeRedef.csv => BEA_Detail_Use_2012_PRO_BeforeRedef.csv} (100%) create mode 100644 flowsa/methods/flowbyactivitymethods/BEA_Detail_GrossOutput_IO.yaml create mode 100644 flowsa/methods/flowbyactivitymethods/BEA_Detail_Make_AfterRedef.yaml rename flowsa/methods/flowbyactivitymethods/{BEA_Make_Detail_BeforeRedef.yaml => BEA_Detail_Make_BeforeRedef.yaml} (70%) rename flowsa/methods/flowbyactivitymethods/{BEA_Use_Detail_PRO_BeforeRedef.yaml => BEA_Detail_Use_PRO_BeforeRedef.yaml} (62%) delete mode 100644 flowsa/methods/flowbyactivitymethods/BEA_GDP_GrossOutput.yaml delete mode 100644 flowsa/methods/flowbyactivitymethods/BEA_Make_AR.yaml diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_BEA_Make_AR.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_BEA_Make_AR.csv index 59b8f74f6..5f7e84c16 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_BEA_Make_AR.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_BEA_Make_AR.csv @@ -1,718 +1,718 @@ ActivitySourceName,Activity,SectorSourceName,Sector,SectorType -BEA_Make_AR,1111A0,NAICS_2012_Code,111110, -BEA_Make_AR,1111A0,NAICS_2012_Code,111120, -BEA_Make_AR,1111B0,NAICS_2012_Code,111130, -BEA_Make_AR,1111B0,NAICS_2012_Code,111140, -BEA_Make_AR,1111B0,NAICS_2012_Code,111150, -BEA_Make_AR,1111B0,NAICS_2012_Code,111160, -BEA_Make_AR,1111B0,NAICS_2012_Code,111191, -BEA_Make_AR,1111B0,NAICS_2012_Code,111199, -BEA_Make_AR,111200,NAICS_2012_Code,111211, -BEA_Make_AR,111200,NAICS_2012_Code,111219, -BEA_Make_AR,111400,NAICS_2012_Code,111411, -BEA_Make_AR,111400,NAICS_2012_Code,111419, -BEA_Make_AR,111400,NAICS_2012_Code,111421, -BEA_Make_AR,111400,NAICS_2012_Code,111422, -BEA_Make_AR,1121A0,NAICS_2012_Code,112111, -BEA_Make_AR,1121A0,NAICS_2012_Code,112112, -BEA_Make_AR,112120,NAICS_2012_Code,112120, -BEA_Make_AR,1121A0,NAICS_2012_Code,112130, -BEA_Make_AR,112A00,NAICS_2012_Code,112210, -BEA_Make_AR,112300,NAICS_2012_Code,112310, -BEA_Make_AR,112300,NAICS_2012_Code,112320, -BEA_Make_AR,112300,NAICS_2012_Code,112330, -BEA_Make_AR,112300,NAICS_2012_Code,112340, -BEA_Make_AR,112300,NAICS_2012_Code,112390, -BEA_Make_AR,112A00,NAICS_2012_Code,112410, -BEA_Make_AR,112A00,NAICS_2012_Code,112420, -BEA_Make_AR,112A00,NAICS_2012_Code,112511, -BEA_Make_AR,112A00,NAICS_2012_Code,112512, -BEA_Make_AR,112A00,NAICS_2012_Code,112519, -BEA_Make_AR,112A00,NAICS_2012_Code,112910, -BEA_Make_AR,112A00,NAICS_2012_Code,112920, -BEA_Make_AR,112A00,NAICS_2012_Code,112930, -BEA_Make_AR,112A00,NAICS_2012_Code,112990, -BEA_Make_AR,115000,NAICS_2012_Code,115111, -BEA_Make_AR,115000,NAICS_2012_Code,115112, -BEA_Make_AR,115000,NAICS_2012_Code,115113, -BEA_Make_AR,115000,NAICS_2012_Code,115114, -BEA_Make_AR,115000,NAICS_2012_Code,115115, -BEA_Make_AR,115000,NAICS_2012_Code,115116, -BEA_Make_AR,115000,NAICS_2012_Code,115210, -BEA_Make_AR,115000,NAICS_2012_Code,115310, -BEA_Make_AR,211000,NAICS_2012_Code,211111, -BEA_Make_AR,211000,NAICS_2012_Code,211112, -BEA_Make_AR,212100,NAICS_2012_Code,212111, -BEA_Make_AR,212100,NAICS_2012_Code,212112, -BEA_Make_AR,212100,NAICS_2012_Code,212113, -BEA_Make_AR,2122A0,NAICS_2012_Code,212210, -BEA_Make_AR,2122A0,NAICS_2012_Code,212221, -BEA_Make_AR,2122A0,NAICS_2012_Code,212222, -BEA_Make_AR,212230,NAICS_2012_Code,212231, -BEA_Make_AR,212230,NAICS_2012_Code,212234, -BEA_Make_AR,2122A0,NAICS_2012_Code,212291, -BEA_Make_AR,2122A0,NAICS_2012_Code,212299, -BEA_Make_AR,212310,NAICS_2012_Code,212311, -BEA_Make_AR,212310,NAICS_2012_Code,212312, -BEA_Make_AR,212310,NAICS_2012_Code,212313, -BEA_Make_AR,212310,NAICS_2012_Code,212319, -BEA_Make_AR,213111,NAICS_2012_Code,213111, -BEA_Make_AR,21311A,NAICS_2012_Code,213112, -BEA_Make_AR,21311A,NAICS_2012_Code,213113, -BEA_Make_AR,21311A,NAICS_2012_Code,213114, -BEA_Make_AR,21311A,NAICS_2012_Code,213115, -BEA_Make_AR,221100,NAICS_2012_Code,221111, -BEA_Make_AR,221100,NAICS_2012_Code,221112, -BEA_Make_AR,221100,NAICS_2012_Code,221113, -BEA_Make_AR,221100,NAICS_2012_Code,221114, -BEA_Make_AR,221100,NAICS_2012_Code,221115, -BEA_Make_AR,221100,NAICS_2012_Code,221116, -BEA_Make_AR,221100,NAICS_2012_Code,221117, -BEA_Make_AR,221100,NAICS_2012_Code,221118, -BEA_Make_AR,221100,NAICS_2012_Code,221121, -BEA_Make_AR,221100,NAICS_2012_Code,221122, -BEA_Make_AR,221200,NAICS_2012_Code,221210, -BEA_Make_AR,221300,NAICS_2012_Code,221310, -BEA_Make_AR,221300,NAICS_2012_Code,221320, -BEA_Make_AR,221300,NAICS_2012_Code,221330, -BEA_Make_AR,230302,NAICS_2012_Code,236118, -BEA_Make_AR,230301,NAICS_2012_Code,236210, -BEA_Make_AR,230301,NAICS_2012_Code,236220, -BEA_Make_AR,230301,NAICS_2012_Code,238110, -BEA_Make_AR,230302,NAICS_2012_Code,238110, -BEA_Make_AR,230301,NAICS_2012_Code,238120, -BEA_Make_AR,230302,NAICS_2012_Code,238120, -BEA_Make_AR,230301,NAICS_2012_Code,238130, -BEA_Make_AR,230302,NAICS_2012_Code,238130, -BEA_Make_AR,230301,NAICS_2012_Code,238140, -BEA_Make_AR,230302,NAICS_2012_Code,238140, -BEA_Make_AR,230301,NAICS_2012_Code,238150, -BEA_Make_AR,230302,NAICS_2012_Code,238150, -BEA_Make_AR,230301,NAICS_2012_Code,238160, -BEA_Make_AR,230302,NAICS_2012_Code,238160, -BEA_Make_AR,230301,NAICS_2012_Code,238170, -BEA_Make_AR,230302,NAICS_2012_Code,238170, -BEA_Make_AR,230301,NAICS_2012_Code,238190, -BEA_Make_AR,230302,NAICS_2012_Code,238190, -BEA_Make_AR,230301,NAICS_2012_Code,238210, -BEA_Make_AR,230302,NAICS_2012_Code,238210, -BEA_Make_AR,230301,NAICS_2012_Code,238220, -BEA_Make_AR,230302,NAICS_2012_Code,238220, -BEA_Make_AR,230301,NAICS_2012_Code,238290, -BEA_Make_AR,230302,NAICS_2012_Code,238290, -BEA_Make_AR,230301,NAICS_2012_Code,238310, -BEA_Make_AR,230302,NAICS_2012_Code,238310, -BEA_Make_AR,230301,NAICS_2012_Code,238320, -BEA_Make_AR,230302,NAICS_2012_Code,238320, -BEA_Make_AR,230301,NAICS_2012_Code,238330, -BEA_Make_AR,230302,NAICS_2012_Code,238330, -BEA_Make_AR,230301,NAICS_2012_Code,238340, -BEA_Make_AR,230302,NAICS_2012_Code,238340, -BEA_Make_AR,230301,NAICS_2012_Code,238350, -BEA_Make_AR,230302,NAICS_2012_Code,238350, -BEA_Make_AR,230301,NAICS_2012_Code,238390, -BEA_Make_AR,230302,NAICS_2012_Code,238390, -BEA_Make_AR,230301,NAICS_2012_Code,238910, -BEA_Make_AR,230302,NAICS_2012_Code,238910, -BEA_Make_AR,230301,NAICS_2012_Code,238990, -BEA_Make_AR,230302,NAICS_2012_Code,238990, -BEA_Make_AR,311111,NAICS_2012_Code,311111, -BEA_Make_AR,311119,NAICS_2012_Code,311119, -BEA_Make_AR,311210,NAICS_2012_Code,311211, -BEA_Make_AR,311210,NAICS_2012_Code,311212, -BEA_Make_AR,311210,NAICS_2012_Code,311213, -BEA_Make_AR,311221,NAICS_2012_Code,311221, -BEA_Make_AR,311225,NAICS_2012_Code,311225, -BEA_Make_AR,311230,NAICS_2012_Code,311230, -BEA_Make_AR,311410,NAICS_2012_Code,311411, -BEA_Make_AR,311410,NAICS_2012_Code,311412, -BEA_Make_AR,311420,NAICS_2012_Code,311421, -BEA_Make_AR,311420,NAICS_2012_Code,311422, -BEA_Make_AR,311420,NAICS_2012_Code,311423, -BEA_Make_AR,31151A,NAICS_2012_Code,311511, -BEA_Make_AR,31151A,NAICS_2012_Code,311512, -BEA_Make_AR,311513,NAICS_2012_Code,311513, -BEA_Make_AR,311514,NAICS_2012_Code,311514, -BEA_Make_AR,311520,NAICS_2012_Code,311520, -BEA_Make_AR,31161A,NAICS_2012_Code,311611, -BEA_Make_AR,31161A,NAICS_2012_Code,311612, -BEA_Make_AR,31161A,NAICS_2012_Code,311613, -BEA_Make_AR,311615,NAICS_2012_Code,311615, -BEA_Make_AR,311700,NAICS_2012_Code,311710, -BEA_Make_AR,311810,NAICS_2012_Code,311811, -BEA_Make_AR,311810,NAICS_2012_Code,311812, -BEA_Make_AR,311810,NAICS_2012_Code,311813, -BEA_Make_AR,311910,NAICS_2012_Code,311911, -BEA_Make_AR,311910,NAICS_2012_Code,311919, -BEA_Make_AR,311920,NAICS_2012_Code,311920, -BEA_Make_AR,311930,NAICS_2012_Code,311930, -BEA_Make_AR,311940,NAICS_2012_Code,311941, -BEA_Make_AR,311940,NAICS_2012_Code,311942, -BEA_Make_AR,311990,NAICS_2012_Code,311991, -BEA_Make_AR,311990,NAICS_2012_Code,311999, -BEA_Make_AR,312110,NAICS_2012_Code,312111, -BEA_Make_AR,312110,NAICS_2012_Code,312112, -BEA_Make_AR,312110,NAICS_2012_Code,312113, -BEA_Make_AR,312120,NAICS_2012_Code,312120, -BEA_Make_AR,312130,NAICS_2012_Code,312130, -BEA_Make_AR,312140,NAICS_2012_Code,312140, -BEA_Make_AR,313100,NAICS_2012_Code,313110, -BEA_Make_AR,314110,NAICS_2012_Code,314110, -BEA_Make_AR,314120,NAICS_2012_Code,314120, -BEA_Make_AR,321100,NAICS_2012_Code,321113, -BEA_Make_AR,321100,NAICS_2012_Code,321114, -BEA_Make_AR,321910,NAICS_2012_Code,321911, -BEA_Make_AR,321910,NAICS_2012_Code,321912, -BEA_Make_AR,321910,NAICS_2012_Code,321918, -BEA_Make_AR,322110,NAICS_2012_Code,322110, -BEA_Make_AR,322120,NAICS_2012_Code,322121, -BEA_Make_AR,322120,NAICS_2012_Code,322122, -BEA_Make_AR,322130,NAICS_2012_Code,322130, -BEA_Make_AR,322210,NAICS_2012_Code,322211, -BEA_Make_AR,322210,NAICS_2012_Code,322212, -BEA_Make_AR,322210,NAICS_2012_Code,322219, -BEA_Make_AR,322230,NAICS_2012_Code,322230, -BEA_Make_AR,322291,NAICS_2012_Code,322291, -BEA_Make_AR,322299,NAICS_2012_Code,322299, -BEA_Make_AR,323110,NAICS_2012_Code,323111, -BEA_Make_AR,323110,NAICS_2012_Code,323113, -BEA_Make_AR,323110,NAICS_2012_Code,323117, -BEA_Make_AR,323120,NAICS_2012_Code,323120, -BEA_Make_AR,324110,NAICS_2012_Code,324110, -BEA_Make_AR,324121,NAICS_2012_Code,324121, -BEA_Make_AR,324122,NAICS_2012_Code,324122, -BEA_Make_AR,325110,NAICS_2012_Code,325110, -BEA_Make_AR,325120,NAICS_2012_Code,325120, -BEA_Make_AR,325130,NAICS_2012_Code,325130, -BEA_Make_AR,325190,NAICS_2012_Code,325193, -BEA_Make_AR,325190,NAICS_2012_Code,325194, -BEA_Make_AR,325190,NAICS_2012_Code,325199, -BEA_Make_AR,325211,NAICS_2012_Code,325211, -BEA_Make_AR,325310,NAICS_2012_Code,325311, -BEA_Make_AR,325310,NAICS_2012_Code,325312, -BEA_Make_AR,325310,NAICS_2012_Code,325314, -BEA_Make_AR,325320,NAICS_2012_Code,325320, -BEA_Make_AR,325411,NAICS_2012_Code,325411, -BEA_Make_AR,325412,NAICS_2012_Code,325412, -BEA_Make_AR,325413,NAICS_2012_Code,325413, -BEA_Make_AR,325414,NAICS_2012_Code,325414, -BEA_Make_AR,325510,NAICS_2012_Code,325510, -BEA_Make_AR,325520,NAICS_2012_Code,325520, -BEA_Make_AR,325610,NAICS_2012_Code,325611, -BEA_Make_AR,325610,NAICS_2012_Code,325612, -BEA_Make_AR,325610,NAICS_2012_Code,325613, -BEA_Make_AR,325620,NAICS_2012_Code,325620, -BEA_Make_AR,325910,NAICS_2012_Code,325910, -BEA_Make_AR,3259A0,NAICS_2012_Code,325920, -BEA_Make_AR,3259A0,NAICS_2012_Code,325991, -BEA_Make_AR,3259A0,NAICS_2012_Code,325992, -BEA_Make_AR,3259A0,NAICS_2012_Code,325998, -BEA_Make_AR,326110,NAICS_2012_Code,326111, -BEA_Make_AR,326110,NAICS_2012_Code,326112, -BEA_Make_AR,326110,NAICS_2012_Code,326113, -BEA_Make_AR,326130,NAICS_2012_Code,326130, -BEA_Make_AR,326140,NAICS_2012_Code,326140, -BEA_Make_AR,326150,NAICS_2012_Code,326150, -BEA_Make_AR,326160,NAICS_2012_Code,326160, -BEA_Make_AR,326210,NAICS_2012_Code,326211, -BEA_Make_AR,326210,NAICS_2012_Code,326212, -BEA_Make_AR,326220,NAICS_2012_Code,326220, -BEA_Make_AR,326290,NAICS_2012_Code,326291, -BEA_Make_AR,326290,NAICS_2012_Code,326299, -BEA_Make_AR,327310,NAICS_2012_Code,327310, -BEA_Make_AR,327320,NAICS_2012_Code,327320, -BEA_Make_AR,327330,NAICS_2012_Code,327331, -BEA_Make_AR,327330,NAICS_2012_Code,327332, -BEA_Make_AR,327390,NAICS_2012_Code,327390, -BEA_Make_AR,327910,NAICS_2012_Code,327910, -BEA_Make_AR,327991,NAICS_2012_Code,327991, -BEA_Make_AR,327992,NAICS_2012_Code,327992, -BEA_Make_AR,327993,NAICS_2012_Code,327993, -BEA_Make_AR,327999,NAICS_2012_Code,327999, -BEA_Make_AR,331110,NAICS_2012_Code,331110, -BEA_Make_AR,331200,NAICS_2012_Code,331210, -BEA_Make_AR,331200,NAICS_2012_Code,331221, -BEA_Make_AR,331200,NAICS_2012_Code,331222, -BEA_Make_AR,331314,NAICS_2012_Code,331314, -BEA_Make_AR,33131B,NAICS_2012_Code,331315, -BEA_Make_AR,33131B,NAICS_2012_Code,331318, -BEA_Make_AR,331420,NAICS_2012_Code,331420, -BEA_Make_AR,331490,NAICS_2012_Code,331491, -BEA_Make_AR,331490,NAICS_2012_Code,331492, -BEA_Make_AR,331510,NAICS_2012_Code,331511, -BEA_Make_AR,331510,NAICS_2012_Code,331512, -BEA_Make_AR,331510,NAICS_2012_Code,331513, -BEA_Make_AR,331520,NAICS_2012_Code,331523, -BEA_Make_AR,331520,NAICS_2012_Code,331524, -BEA_Make_AR,331520,NAICS_2012_Code,331529, -BEA_Make_AR,33211A,NAICS_2012_Code,332111, -BEA_Make_AR,33211A,NAICS_2012_Code,332112, -BEA_Make_AR,332114,NAICS_2012_Code,332114, -BEA_Make_AR,33211A,NAICS_2012_Code,332117, -BEA_Make_AR,332310,NAICS_2012_Code,332311, -BEA_Make_AR,332310,NAICS_2012_Code,332312, -BEA_Make_AR,332310,NAICS_2012_Code,332313, -BEA_Make_AR,332320,NAICS_2012_Code,332321, -BEA_Make_AR,332320,NAICS_2012_Code,332322, -BEA_Make_AR,332320,NAICS_2012_Code,332323, -BEA_Make_AR,332410,NAICS_2012_Code,332410, -BEA_Make_AR,332420,NAICS_2012_Code,332420, -BEA_Make_AR,332430,NAICS_2012_Code,332431, -BEA_Make_AR,332430,NAICS_2012_Code,332439, -BEA_Make_AR,332500,NAICS_2012_Code,332510, -BEA_Make_AR,332600,NAICS_2012_Code,332613, -BEA_Make_AR,332600,NAICS_2012_Code,332618, -BEA_Make_AR,332710,NAICS_2012_Code,332710, -BEA_Make_AR,332720,NAICS_2012_Code,332721, -BEA_Make_AR,332720,NAICS_2012_Code,332722, -BEA_Make_AR,332800,NAICS_2012_Code,332811, -BEA_Make_AR,332800,NAICS_2012_Code,332812, -BEA_Make_AR,332800,NAICS_2012_Code,332813, -BEA_Make_AR,33291A,NAICS_2012_Code,332911, -BEA_Make_AR,33291A,NAICS_2012_Code,332912, -BEA_Make_AR,332913,NAICS_2012_Code,332913, -BEA_Make_AR,33291A,NAICS_2012_Code,332919, -BEA_Make_AR,332991,NAICS_2012_Code,332991, -BEA_Make_AR,33299A,NAICS_2012_Code,332992, -BEA_Make_AR,33299A,NAICS_2012_Code,332993, -BEA_Make_AR,33299A,NAICS_2012_Code,332994, -BEA_Make_AR,332996,NAICS_2012_Code,332996, -BEA_Make_AR,333111,NAICS_2012_Code,333111, -BEA_Make_AR,333112,NAICS_2012_Code,333112, -BEA_Make_AR,333120,NAICS_2012_Code,333120, -BEA_Make_AR,333130,NAICS_2012_Code,333131, -BEA_Make_AR,333130,NAICS_2012_Code,333132, -BEA_Make_AR,33329A,NAICS_2012_Code,333241, -BEA_Make_AR,33329A,NAICS_2012_Code,333243, -BEA_Make_AR,33329A,NAICS_2012_Code,333244, -BEA_Make_AR,33329A,NAICS_2012_Code,333249, -BEA_Make_AR,333314,NAICS_2012_Code,333314, -BEA_Make_AR,333414,NAICS_2012_Code,333414, -BEA_Make_AR,333415,NAICS_2012_Code,333415, -BEA_Make_AR,333511,NAICS_2012_Code,333511, -BEA_Make_AR,333514,NAICS_2012_Code,333514, -BEA_Make_AR,33351B,NAICS_2012_Code,333515, -BEA_Make_AR,33351B,NAICS_2012_Code,333519, -BEA_Make_AR,333611,NAICS_2012_Code,333611, -BEA_Make_AR,333612,NAICS_2012_Code,333612, -BEA_Make_AR,333613,NAICS_2012_Code,333613, -BEA_Make_AR,333618,NAICS_2012_Code,333618, -BEA_Make_AR,333912,NAICS_2012_Code,333912, -BEA_Make_AR,333920,NAICS_2012_Code,333921, -BEA_Make_AR,333920,NAICS_2012_Code,333922, -BEA_Make_AR,333920,NAICS_2012_Code,333923, -BEA_Make_AR,333920,NAICS_2012_Code,333924, -BEA_Make_AR,333991,NAICS_2012_Code,333991, -BEA_Make_AR,33399A,NAICS_2012_Code,333992, -BEA_Make_AR,333993,NAICS_2012_Code,333993, -BEA_Make_AR,333994,NAICS_2012_Code,333994, -BEA_Make_AR,33399B,NAICS_2012_Code,333995, -BEA_Make_AR,33399B,NAICS_2012_Code,333996, -BEA_Make_AR,33399A,NAICS_2012_Code,333997, -BEA_Make_AR,33399A,NAICS_2012_Code,333999, -BEA_Make_AR,334111,NAICS_2012_Code,334111, -BEA_Make_AR,334112,NAICS_2012_Code,334112, -BEA_Make_AR,334210,NAICS_2012_Code,334210, -BEA_Make_AR,334220,NAICS_2012_Code,334220, -BEA_Make_AR,334290,NAICS_2012_Code,334290, -BEA_Make_AR,334300,NAICS_2012_Code,334310, -BEA_Make_AR,33441A,NAICS_2012_Code,334412, -BEA_Make_AR,334413,NAICS_2012_Code,334413, -BEA_Make_AR,33441A,NAICS_2012_Code,334416, -BEA_Make_AR,33441A,NAICS_2012_Code,334417, -BEA_Make_AR,334418,NAICS_2012_Code,334418, -BEA_Make_AR,33441A,NAICS_2012_Code,334419, -BEA_Make_AR,334510,NAICS_2012_Code,334510, -BEA_Make_AR,334511,NAICS_2012_Code,334511, -BEA_Make_AR,334512,NAICS_2012_Code,334512, -BEA_Make_AR,334513,NAICS_2012_Code,334513, -BEA_Make_AR,334514,NAICS_2012_Code,334514, -BEA_Make_AR,334515,NAICS_2012_Code,334515, -BEA_Make_AR,334516,NAICS_2012_Code,334516, -BEA_Make_AR,334517,NAICS_2012_Code,334517, -BEA_Make_AR,33451A,NAICS_2012_Code,334519, -BEA_Make_AR,335110,NAICS_2012_Code,335110, -BEA_Make_AR,335120,NAICS_2012_Code,335121, -BEA_Make_AR,335120,NAICS_2012_Code,335122, -BEA_Make_AR,335120,NAICS_2012_Code,335129, -BEA_Make_AR,335210,NAICS_2012_Code,335210, -BEA_Make_AR,335221,NAICS_2012_Code,335221, -BEA_Make_AR,335222,NAICS_2012_Code,335222, -BEA_Make_AR,335224,NAICS_2012_Code,335224, -BEA_Make_AR,335228,NAICS_2012_Code,335228, -BEA_Make_AR,335311,NAICS_2012_Code,335311, -BEA_Make_AR,335312,NAICS_2012_Code,335312, -BEA_Make_AR,335313,NAICS_2012_Code,335313, -BEA_Make_AR,335314,NAICS_2012_Code,335314, -BEA_Make_AR,335911,NAICS_2012_Code,335911, -BEA_Make_AR,335912,NAICS_2012_Code,335912, -BEA_Make_AR,335920,NAICS_2012_Code,335921, -BEA_Make_AR,335920,NAICS_2012_Code,335929, -BEA_Make_AR,335930,NAICS_2012_Code,335931, -BEA_Make_AR,335930,NAICS_2012_Code,335932, -BEA_Make_AR,335991,NAICS_2012_Code,335991, -BEA_Make_AR,335999,NAICS_2012_Code,335999, -BEA_Make_AR,336111,NAICS_2012_Code,336111, -BEA_Make_AR,336112,NAICS_2012_Code,336112, -BEA_Make_AR,336120,NAICS_2012_Code,336120, -BEA_Make_AR,336211,NAICS_2012_Code,336211, -BEA_Make_AR,336212,NAICS_2012_Code,336212, -BEA_Make_AR,336213,NAICS_2012_Code,336213, -BEA_Make_AR,336214,NAICS_2012_Code,336214, -BEA_Make_AR,336411,NAICS_2012_Code,336411, -BEA_Make_AR,336412,NAICS_2012_Code,336412, -BEA_Make_AR,336413,NAICS_2012_Code,336413, -BEA_Make_AR,336414,NAICS_2012_Code,336414, -BEA_Make_AR,33641A,NAICS_2012_Code,336415, -BEA_Make_AR,33641A,NAICS_2012_Code,336419, -BEA_Make_AR,336500,NAICS_2012_Code,336510, -BEA_Make_AR,336611,NAICS_2012_Code,336611, -BEA_Make_AR,336612,NAICS_2012_Code,336612, -BEA_Make_AR,336991,NAICS_2012_Code,336991, -BEA_Make_AR,336992,NAICS_2012_Code,336992, -BEA_Make_AR,336999,NAICS_2012_Code,336999, -BEA_Make_AR,337110,NAICS_2012_Code,337110, -BEA_Make_AR,337121,NAICS_2012_Code,337121, -BEA_Make_AR,337122,NAICS_2012_Code,337122, -BEA_Make_AR,337127,NAICS_2012_Code,337127, -BEA_Make_AR,33721A,NAICS_2012_Code,337211, -BEA_Make_AR,33721A,NAICS_2012_Code,337212, -BEA_Make_AR,33721A,NAICS_2012_Code,337214, -BEA_Make_AR,337215,NAICS_2012_Code,337215, -BEA_Make_AR,339112,NAICS_2012_Code,339112, -BEA_Make_AR,339113,NAICS_2012_Code,339113, -BEA_Make_AR,339114,NAICS_2012_Code,339114, -BEA_Make_AR,339115,NAICS_2012_Code,339115, -BEA_Make_AR,339116,NAICS_2012_Code,339116, -BEA_Make_AR,339910,NAICS_2012_Code,339910, -BEA_Make_AR,339920,NAICS_2012_Code,339920, -BEA_Make_AR,339930,NAICS_2012_Code,339930, -BEA_Make_AR,339940,NAICS_2012_Code,339940, -BEA_Make_AR,339950,NAICS_2012_Code,339950, -BEA_Make_AR,481000,NAICS_2012_Code,481111, -BEA_Make_AR,481000,NAICS_2012_Code,481112, -BEA_Make_AR,481000,NAICS_2012_Code,481211, -BEA_Make_AR,481000,NAICS_2012_Code,481212, -BEA_Make_AR,481000,NAICS_2012_Code,481219, -BEA_Make_AR,482000,NAICS_2012_Code,482111, -BEA_Make_AR,482000,NAICS_2012_Code,482112, -BEA_Make_AR,483000,NAICS_2012_Code,483111, -BEA_Make_AR,483000,NAICS_2012_Code,483112, -BEA_Make_AR,483000,NAICS_2012_Code,483113, -BEA_Make_AR,483000,NAICS_2012_Code,483114, -BEA_Make_AR,483000,NAICS_2012_Code,483211, -BEA_Make_AR,483000,NAICS_2012_Code,483212, -BEA_Make_AR,484000,NAICS_2012_Code,484110, -BEA_Make_AR,484000,NAICS_2012_Code,484121, -BEA_Make_AR,484000,NAICS_2012_Code,484122, -BEA_Make_AR,484000,NAICS_2012_Code,484210, -BEA_Make_AR,484000,NAICS_2012_Code,484220, -BEA_Make_AR,484000,NAICS_2012_Code,484230, -BEA_Make_AR,485000,NAICS_2012_Code,485111, -BEA_Make_AR,485000,NAICS_2012_Code,485112, -BEA_Make_AR,485000,NAICS_2012_Code,485113, -BEA_Make_AR,485000,NAICS_2012_Code,485119, -BEA_Make_AR,485000,NAICS_2012_Code,485210, -BEA_Make_AR,485000,NAICS_2012_Code,485310, -BEA_Make_AR,485000,NAICS_2012_Code,485320, -BEA_Make_AR,485000,NAICS_2012_Code,485410, -BEA_Make_AR,485000,NAICS_2012_Code,485510, -BEA_Make_AR,485000,NAICS_2012_Code,485991, -BEA_Make_AR,485000,NAICS_2012_Code,485999, -BEA_Make_AR,486000,NAICS_2012_Code,486110, -BEA_Make_AR,486000,NAICS_2012_Code,486210, -BEA_Make_AR,486000,NAICS_2012_Code,486910, -BEA_Make_AR,486000,NAICS_2012_Code,486990, -BEA_Make_AR,48A000,NAICS_2012_Code,487110, -BEA_Make_AR,48A000,NAICS_2012_Code,487210, -BEA_Make_AR,48A000,NAICS_2012_Code,487990, -BEA_Make_AR,48A000,NAICS_2012_Code,488111, -BEA_Make_AR,48A000,NAICS_2012_Code,488119, -BEA_Make_AR,48A000,NAICS_2012_Code,488190, -BEA_Make_AR,48A000,NAICS_2012_Code,488210, -BEA_Make_AR,48A000,NAICS_2012_Code,488310, -BEA_Make_AR,48A000,NAICS_2012_Code,488320, -BEA_Make_AR,48A000,NAICS_2012_Code,488330, -BEA_Make_AR,48A000,NAICS_2012_Code,488390, -BEA_Make_AR,48A000,NAICS_2012_Code,488410, -BEA_Make_AR,48A000,NAICS_2012_Code,488490, -BEA_Make_AR,48A000,NAICS_2012_Code,488510, -BEA_Make_AR,48A000,NAICS_2012_Code,488991, -BEA_Make_AR,48A000,NAICS_2012_Code,488999, -BEA_Make_AR,491000,NAICS_2012_Code,491110, -BEA_Make_AR,492000,NAICS_2012_Code,492110, -BEA_Make_AR,492000,NAICS_2012_Code,492210, -BEA_Make_AR,493000,NAICS_2012_Code,493110, -BEA_Make_AR,493000,NAICS_2012_Code,493120, -BEA_Make_AR,493000,NAICS_2012_Code,493130, -BEA_Make_AR,493000,NAICS_2012_Code,493190, -BEA_Make_AR,511110,NAICS_2012_Code,511110, -BEA_Make_AR,511120,NAICS_2012_Code,511120, -BEA_Make_AR,511130,NAICS_2012_Code,511130, -BEA_Make_AR,5111A0,NAICS_2012_Code,511140, -BEA_Make_AR,5111A0,NAICS_2012_Code,511191, -BEA_Make_AR,5111A0,NAICS_2012_Code,511199, -BEA_Make_AR,511200,NAICS_2012_Code,511210, -BEA_Make_AR,512100,NAICS_2012_Code,512110, -BEA_Make_AR,512100,NAICS_2012_Code,512120, -BEA_Make_AR,512100,NAICS_2012_Code,512131, -BEA_Make_AR,512100,NAICS_2012_Code,512132, -BEA_Make_AR,512100,NAICS_2012_Code,512191, -BEA_Make_AR,512100,NAICS_2012_Code,512199, -BEA_Make_AR,512200,NAICS_2012_Code,512210, -BEA_Make_AR,512200,NAICS_2012_Code,512220, -BEA_Make_AR,512200,NAICS_2012_Code,512230, -BEA_Make_AR,512200,NAICS_2012_Code,512240, -BEA_Make_AR,512200,NAICS_2012_Code,512290, -BEA_Make_AR,515100,NAICS_2012_Code,515111, -BEA_Make_AR,515100,NAICS_2012_Code,515112, -BEA_Make_AR,515100,NAICS_2012_Code,515120, -BEA_Make_AR,515200,NAICS_2012_Code,515210, -BEA_Make_AR,518200,NAICS_2012_Code,518210, -BEA_Make_AR,52A000,NAICS_2012_Code,521110, -BEA_Make_AR,52A000,NAICS_2012_Code,522110, -BEA_Make_AR,52A000,NAICS_2012_Code,522120, -BEA_Make_AR,52A000,NAICS_2012_Code,522130, -BEA_Make_AR,52A000,NAICS_2012_Code,522190, -BEA_Make_AR,522A00,NAICS_2012_Code,522210, -BEA_Make_AR,522A00,NAICS_2012_Code,522220, -BEA_Make_AR,522A00,NAICS_2012_Code,522291, -BEA_Make_AR,522A00,NAICS_2012_Code,522292, -BEA_Make_AR,522A00,NAICS_2012_Code,522293, -BEA_Make_AR,522A00,NAICS_2012_Code,522294, -BEA_Make_AR,522A00,NAICS_2012_Code,522298, -BEA_Make_AR,522A00,NAICS_2012_Code,522310, -BEA_Make_AR,522A00,NAICS_2012_Code,522320, -BEA_Make_AR,522A00,NAICS_2012_Code,522390, -BEA_Make_AR,524200,NAICS_2012_Code,524210, -BEA_Make_AR,524200,NAICS_2012_Code,524291, -BEA_Make_AR,524200,NAICS_2012_Code,524292, -BEA_Make_AR,524200,NAICS_2012_Code,524298, -BEA_Make_AR,525000,NAICS_2012_Code,525110, -BEA_Make_AR,525000,NAICS_2012_Code,525120, -BEA_Make_AR,525000,NAICS_2012_Code,525190, -BEA_Make_AR,525000,NAICS_2012_Code,525910, -BEA_Make_AR,525000,NAICS_2012_Code,525920, -BEA_Make_AR,525000,NAICS_2012_Code,525990, -BEA_Make_AR,532100,NAICS_2012_Code,532111, -BEA_Make_AR,532100,NAICS_2012_Code,532112, -BEA_Make_AR,532100,NAICS_2012_Code,532120, -BEA_Make_AR,532A00,NAICS_2012_Code,532210, -BEA_Make_AR,532A00,NAICS_2012_Code,532220, -BEA_Make_AR,532A00,NAICS_2012_Code,532230, -BEA_Make_AR,532A00,NAICS_2012_Code,532291, -BEA_Make_AR,532A00,NAICS_2012_Code,532292, -BEA_Make_AR,532A00,NAICS_2012_Code,532299, -BEA_Make_AR,532A00,NAICS_2012_Code,532310, -BEA_Make_AR,532400,NAICS_2012_Code,532411, -BEA_Make_AR,532400,NAICS_2012_Code,532412, -BEA_Make_AR,532400,NAICS_2012_Code,532420, -BEA_Make_AR,532400,NAICS_2012_Code,532490, -BEA_Make_AR,533000,NAICS_2012_Code,533110, -BEA_Make_AR,541100,NAICS_2012_Code,541110, -BEA_Make_AR,541100,NAICS_2012_Code,541120, -BEA_Make_AR,541100,NAICS_2012_Code,541191, -BEA_Make_AR,541100,NAICS_2012_Code,541199, -BEA_Make_AR,541200,NAICS_2012_Code,541211, -BEA_Make_AR,541200,NAICS_2012_Code,541213, -BEA_Make_AR,541200,NAICS_2012_Code,541214, -BEA_Make_AR,541200,NAICS_2012_Code,541219, -BEA_Make_AR,541300,NAICS_2012_Code,541310, -BEA_Make_AR,541300,NAICS_2012_Code,541320, -BEA_Make_AR,541300,NAICS_2012_Code,541330, -BEA_Make_AR,541300,NAICS_2012_Code,541340, -BEA_Make_AR,541300,NAICS_2012_Code,541350, -BEA_Make_AR,541300,NAICS_2012_Code,541360, -BEA_Make_AR,541300,NAICS_2012_Code,541370, -BEA_Make_AR,541300,NAICS_2012_Code,541380, -BEA_Make_AR,541400,NAICS_2012_Code,541410, -BEA_Make_AR,541400,NAICS_2012_Code,541420, -BEA_Make_AR,541400,NAICS_2012_Code,541430, -BEA_Make_AR,541400,NAICS_2012_Code,541490, -BEA_Make_AR,541511,NAICS_2012_Code,541511, -BEA_Make_AR,541512,NAICS_2012_Code,541512, -BEA_Make_AR,54151A,NAICS_2012_Code,541513, -BEA_Make_AR,54151A,NAICS_2012_Code,541519, -BEA_Make_AR,541610,NAICS_2012_Code,541611, -BEA_Make_AR,541610,NAICS_2012_Code,541612, -BEA_Make_AR,541610,NAICS_2012_Code,541613, -BEA_Make_AR,541610,NAICS_2012_Code,541614, -BEA_Make_AR,541610,NAICS_2012_Code,541618, -BEA_Make_AR,5416A0,NAICS_2012_Code,541620, -BEA_Make_AR,5416A0,NAICS_2012_Code,541690, -BEA_Make_AR,541700,NAICS_2012_Code,541711, -BEA_Make_AR,541700,NAICS_2012_Code,541712, -BEA_Make_AR,541700,NAICS_2012_Code,541720, -BEA_Make_AR,541800,NAICS_2012_Code,541810, -BEA_Make_AR,541800,NAICS_2012_Code,541820, -BEA_Make_AR,541800,NAICS_2012_Code,541830, -BEA_Make_AR,541800,NAICS_2012_Code,541840, -BEA_Make_AR,541800,NAICS_2012_Code,541850, -BEA_Make_AR,541800,NAICS_2012_Code,541860, -BEA_Make_AR,541800,NAICS_2012_Code,541870, -BEA_Make_AR,541800,NAICS_2012_Code,541890, -BEA_Make_AR,5419A0,NAICS_2012_Code,541910, -BEA_Make_AR,541920,NAICS_2012_Code,541921, -BEA_Make_AR,541920,NAICS_2012_Code,541922, -BEA_Make_AR,5419A0,NAICS_2012_Code,541930, -BEA_Make_AR,541940,NAICS_2012_Code,541940, -BEA_Make_AR,5419A0,NAICS_2012_Code,541990, -BEA_Make_AR,550000,NAICS_2012_Code,551111, -BEA_Make_AR,550000,NAICS_2012_Code,551112, -BEA_Make_AR,550000,NAICS_2012_Code,551114, -BEA_Make_AR,561100,NAICS_2012_Code,561110, -BEA_Make_AR,561200,NAICS_2012_Code,561210, -BEA_Make_AR,561300,NAICS_2012_Code,561311, -BEA_Make_AR,561300,NAICS_2012_Code,561312, -BEA_Make_AR,561300,NAICS_2012_Code,561320, -BEA_Make_AR,561300,NAICS_2012_Code,561330, -BEA_Make_AR,561400,NAICS_2012_Code,561410, -BEA_Make_AR,561400,NAICS_2012_Code,561421, -BEA_Make_AR,561400,NAICS_2012_Code,561422, -BEA_Make_AR,561400,NAICS_2012_Code,561431, -BEA_Make_AR,561400,NAICS_2012_Code,561439, -BEA_Make_AR,561400,NAICS_2012_Code,561440, -BEA_Make_AR,561400,NAICS_2012_Code,561450, -BEA_Make_AR,561400,NAICS_2012_Code,561491, -BEA_Make_AR,561400,NAICS_2012_Code,561492, -BEA_Make_AR,561400,NAICS_2012_Code,561499, -BEA_Make_AR,561500,NAICS_2012_Code,561510, -BEA_Make_AR,561500,NAICS_2012_Code,561520, -BEA_Make_AR,561500,NAICS_2012_Code,561591, -BEA_Make_AR,561500,NAICS_2012_Code,561599, -BEA_Make_AR,561600,NAICS_2012_Code,561611, -BEA_Make_AR,561600,NAICS_2012_Code,561612, -BEA_Make_AR,561600,NAICS_2012_Code,561613, -BEA_Make_AR,561600,NAICS_2012_Code,561621, -BEA_Make_AR,561600,NAICS_2012_Code,561622, -BEA_Make_AR,561700,NAICS_2012_Code,561710, -BEA_Make_AR,561700,NAICS_2012_Code,561720, -BEA_Make_AR,561700,NAICS_2012_Code,561730, -BEA_Make_AR,561700,NAICS_2012_Code,561740, -BEA_Make_AR,561700,NAICS_2012_Code,561790, -BEA_Make_AR,561900,NAICS_2012_Code,561910, -BEA_Make_AR,561900,NAICS_2012_Code,561920, -BEA_Make_AR,561900,NAICS_2012_Code,561990, -BEA_Make_AR,562000,NAICS_2012_Code,562111, -BEA_Make_AR,562000,NAICS_2012_Code,562112, -BEA_Make_AR,562000,NAICS_2012_Code,562119, -BEA_Make_AR,562000,NAICS_2012_Code,562211, -BEA_Make_AR,562000,NAICS_2012_Code,562212, -BEA_Make_AR,562000,NAICS_2012_Code,562213, -BEA_Make_AR,562000,NAICS_2012_Code,562219, -BEA_Make_AR,562000,NAICS_2012_Code,562910, -BEA_Make_AR,562000,NAICS_2012_Code,562920, -BEA_Make_AR,562000,NAICS_2012_Code,562991, -BEA_Make_AR,562000,NAICS_2012_Code,562998, -BEA_Make_AR,611100,NAICS_2012_Code,611110, -BEA_Make_AR,611A00,NAICS_2012_Code,611210, -BEA_Make_AR,611A00,NAICS_2012_Code,611310, -BEA_Make_AR,611B00,NAICS_2012_Code,611410, -BEA_Make_AR,611B00,NAICS_2012_Code,611420, -BEA_Make_AR,611B00,NAICS_2012_Code,611430, -BEA_Make_AR,611B00,NAICS_2012_Code,611511, -BEA_Make_AR,611B00,NAICS_2012_Code,611512, -BEA_Make_AR,611B00,NAICS_2012_Code,611513, -BEA_Make_AR,611B00,NAICS_2012_Code,611519, -BEA_Make_AR,611B00,NAICS_2012_Code,611610, -BEA_Make_AR,611B00,NAICS_2012_Code,611620, -BEA_Make_AR,611B00,NAICS_2012_Code,611630, -BEA_Make_AR,611B00,NAICS_2012_Code,611691, -BEA_Make_AR,611B00,NAICS_2012_Code,611692, -BEA_Make_AR,611B00,NAICS_2012_Code,611699, -BEA_Make_AR,611B00,NAICS_2012_Code,611710, -BEA_Make_AR,621600,NAICS_2012_Code,621610, -BEA_Make_AR,622000,NAICS_2012_Code,622110, -BEA_Make_AR,622000,NAICS_2012_Code,622210, -BEA_Make_AR,622000,NAICS_2012_Code,622310, -BEA_Make_AR,624A00,NAICS_2012_Code,624210, -BEA_Make_AR,624A00,NAICS_2012_Code,624221, -BEA_Make_AR,624A00,NAICS_2012_Code,624229, -BEA_Make_AR,624A00,NAICS_2012_Code,624230, -BEA_Make_AR,624A00,NAICS_2012_Code,624310, -BEA_Make_AR,624400,NAICS_2012_Code,624410, -BEA_Make_AR,711100,NAICS_2012_Code,711110, -BEA_Make_AR,711100,NAICS_2012_Code,711120, -BEA_Make_AR,711100,NAICS_2012_Code,711130, -BEA_Make_AR,711100,NAICS_2012_Code,711190, -BEA_Make_AR,711200,NAICS_2012_Code,711211, -BEA_Make_AR,711200,NAICS_2012_Code,711212, -BEA_Make_AR,711200,NAICS_2012_Code,711219, -BEA_Make_AR,711A00,NAICS_2012_Code,711310, -BEA_Make_AR,711A00,NAICS_2012_Code,711320, -BEA_Make_AR,711A00,NAICS_2012_Code,711410, -BEA_Make_AR,711500,NAICS_2012_Code,711510, -BEA_Make_AR,712000,NAICS_2012_Code,712110, -BEA_Make_AR,712000,NAICS_2012_Code,712120, -BEA_Make_AR,712000,NAICS_2012_Code,712130, -BEA_Make_AR,712000,NAICS_2012_Code,712190, -BEA_Make_AR,811200,NAICS_2012_Code,811211, -BEA_Make_AR,811200,NAICS_2012_Code,811212, -BEA_Make_AR,811200,NAICS_2012_Code,811213, -BEA_Make_AR,811200,NAICS_2012_Code,811219, -BEA_Make_AR,811300,NAICS_2012_Code,811310, -BEA_Make_AR,811400,NAICS_2012_Code,811411, -BEA_Make_AR,811400,NAICS_2012_Code,811412, -BEA_Make_AR,811400,NAICS_2012_Code,811420, -BEA_Make_AR,811400,NAICS_2012_Code,811430, -BEA_Make_AR,811400,NAICS_2012_Code,811490, -BEA_Make_AR,812100,NAICS_2012_Code,812111, -BEA_Make_AR,812100,NAICS_2012_Code,812112, -BEA_Make_AR,812100,NAICS_2012_Code,812113, -BEA_Make_AR,812100,NAICS_2012_Code,812191, -BEA_Make_AR,812100,NAICS_2012_Code,812199, -BEA_Make_AR,812200,NAICS_2012_Code,812210, -BEA_Make_AR,812200,NAICS_2012_Code,812220, -BEA_Make_AR,812300,NAICS_2012_Code,812310, -BEA_Make_AR,812300,NAICS_2012_Code,812320, -BEA_Make_AR,812300,NAICS_2012_Code,812331, -BEA_Make_AR,812300,NAICS_2012_Code,812332, -BEA_Make_AR,812900,NAICS_2012_Code,812910, -BEA_Make_AR,812900,NAICS_2012_Code,812921, -BEA_Make_AR,812900,NAICS_2012_Code,812922, -BEA_Make_AR,812900,NAICS_2012_Code,812930, -BEA_Make_AR,812900,NAICS_2012_Code,812990, -BEA_Make_AR,813100,NAICS_2012_Code,813110, -BEA_Make_AR,813A00,NAICS_2012_Code,813211, -BEA_Make_AR,813A00,NAICS_2012_Code,813212, -BEA_Make_AR,813A00,NAICS_2012_Code,813219, -BEA_Make_AR,813A00,NAICS_2012_Code,813311, -BEA_Make_AR,813A00,NAICS_2012_Code,813312, -BEA_Make_AR,813A00,NAICS_2012_Code,813319, -BEA_Make_AR,813B00,NAICS_2012_Code,813410, -BEA_Make_AR,813B00,NAICS_2012_Code,813910, -BEA_Make_AR,813B00,NAICS_2012_Code,813920, -BEA_Make_AR,813B00,NAICS_2012_Code,813930, -BEA_Make_AR,813B00,NAICS_2012_Code,813940, -BEA_Make_AR,813B00,NAICS_2012_Code,813990, -BEA_Make_AR,814000,NAICS_2012_Code,814110, -BEA_Make_AR,S00600,NAICS_2012_Code,921110, -BEA_Make_AR,S00600,NAICS_2012_Code,921120, -BEA_Make_AR,S00600,NAICS_2012_Code,921130, -BEA_Make_AR,S00600,NAICS_2012_Code,921140, -BEA_Make_AR,S00600,NAICS_2012_Code,921190, -BEA_Make_AR,S00600,NAICS_2012_Code,922110, -BEA_Make_AR,S00600,NAICS_2012_Code,922120, -BEA_Make_AR,S00600,NAICS_2012_Code,922130, -BEA_Make_AR,S00600,NAICS_2012_Code,922140, -BEA_Make_AR,S00600,NAICS_2012_Code,922150, -BEA_Make_AR,S00600,NAICS_2012_Code,922160, -BEA_Make_AR,S00600,NAICS_2012_Code,922190, -BEA_Make_AR,S00600,NAICS_2012_Code,923110, -BEA_Make_AR,S00600,NAICS_2012_Code,923120, -BEA_Make_AR,S00600,NAICS_2012_Code,923130, -BEA_Make_AR,S00600,NAICS_2012_Code,923140, -BEA_Make_AR,S00600,NAICS_2012_Code,924110, -BEA_Make_AR,S00600,NAICS_2012_Code,924120, -BEA_Make_AR,S00600,NAICS_2012_Code,925110, -BEA_Make_AR,S00600,NAICS_2012_Code,925120, -BEA_Make_AR,S00600,NAICS_2012_Code,926110, -BEA_Make_AR,S00600,NAICS_2012_Code,926130, -BEA_Make_AR,S00600,NAICS_2012_Code,926140, -BEA_Make_AR,S00600,NAICS_2012_Code,926150, -BEA_Make_AR,S00102,NAICS_2012_Code,927110, -BEA_Make_AR,S00500,NAICS_2012_Code,928110, -BEA_Make_AR,S00600,NAICS_2012_Code,928120, -BEA_Make_AR,S00101,NAICS_2012_Code,S00101, -BEA_Make_AR,S00201,NAICS_2012_Code,S00201, -BEA_Make_AR,S00202,NAICS_2012_Code,S00202, +BEA_Detail_Make_AfterRedef,1111A0,NAICS_2012_Code,111110, +BEA_Detail_Make_AfterRedef,1111A0,NAICS_2012_Code,111120, +BEA_Detail_Make_AfterRedef,1111B0,NAICS_2012_Code,111130, +BEA_Detail_Make_AfterRedef,1111B0,NAICS_2012_Code,111140, +BEA_Detail_Make_AfterRedef,1111B0,NAICS_2012_Code,111150, +BEA_Detail_Make_AfterRedef,1111B0,NAICS_2012_Code,111160, +BEA_Detail_Make_AfterRedef,1111B0,NAICS_2012_Code,111191, +BEA_Detail_Make_AfterRedef,1111B0,NAICS_2012_Code,111199, +BEA_Detail_Make_AfterRedef,111200,NAICS_2012_Code,111211, +BEA_Detail_Make_AfterRedef,111200,NAICS_2012_Code,111219, +BEA_Detail_Make_AfterRedef,111400,NAICS_2012_Code,111411, +BEA_Detail_Make_AfterRedef,111400,NAICS_2012_Code,111419, +BEA_Detail_Make_AfterRedef,111400,NAICS_2012_Code,111421, +BEA_Detail_Make_AfterRedef,111400,NAICS_2012_Code,111422, +BEA_Detail_Make_AfterRedef,1121A0,NAICS_2012_Code,112111, +BEA_Detail_Make_AfterRedef,1121A0,NAICS_2012_Code,112112, +BEA_Detail_Make_AfterRedef,112120,NAICS_2012_Code,112120, +BEA_Detail_Make_AfterRedef,1121A0,NAICS_2012_Code,112130, +BEA_Detail_Make_AfterRedef,112A00,NAICS_2012_Code,112210, +BEA_Detail_Make_AfterRedef,112300,NAICS_2012_Code,112310, +BEA_Detail_Make_AfterRedef,112300,NAICS_2012_Code,112320, +BEA_Detail_Make_AfterRedef,112300,NAICS_2012_Code,112330, +BEA_Detail_Make_AfterRedef,112300,NAICS_2012_Code,112340, +BEA_Detail_Make_AfterRedef,112300,NAICS_2012_Code,112390, +BEA_Detail_Make_AfterRedef,112A00,NAICS_2012_Code,112410, +BEA_Detail_Make_AfterRedef,112A00,NAICS_2012_Code,112420, +BEA_Detail_Make_AfterRedef,112A00,NAICS_2012_Code,112511, +BEA_Detail_Make_AfterRedef,112A00,NAICS_2012_Code,112512, +BEA_Detail_Make_AfterRedef,112A00,NAICS_2012_Code,112519, +BEA_Detail_Make_AfterRedef,112A00,NAICS_2012_Code,112910, +BEA_Detail_Make_AfterRedef,112A00,NAICS_2012_Code,112920, +BEA_Detail_Make_AfterRedef,112A00,NAICS_2012_Code,112930, +BEA_Detail_Make_AfterRedef,112A00,NAICS_2012_Code,112990, +BEA_Detail_Make_AfterRedef,115000,NAICS_2012_Code,115111, +BEA_Detail_Make_AfterRedef,115000,NAICS_2012_Code,115112, +BEA_Detail_Make_AfterRedef,115000,NAICS_2012_Code,115113, +BEA_Detail_Make_AfterRedef,115000,NAICS_2012_Code,115114, +BEA_Detail_Make_AfterRedef,115000,NAICS_2012_Code,115115, +BEA_Detail_Make_AfterRedef,115000,NAICS_2012_Code,115116, +BEA_Detail_Make_AfterRedef,115000,NAICS_2012_Code,115210, +BEA_Detail_Make_AfterRedef,115000,NAICS_2012_Code,115310, +BEA_Detail_Make_AfterRedef,211000,NAICS_2012_Code,211111, +BEA_Detail_Make_AfterRedef,211000,NAICS_2012_Code,211112, +BEA_Detail_Make_AfterRedef,212100,NAICS_2012_Code,212111, +BEA_Detail_Make_AfterRedef,212100,NAICS_2012_Code,212112, +BEA_Detail_Make_AfterRedef,212100,NAICS_2012_Code,212113, +BEA_Detail_Make_AfterRedef,2122A0,NAICS_2012_Code,212210, +BEA_Detail_Make_AfterRedef,2122A0,NAICS_2012_Code,212221, +BEA_Detail_Make_AfterRedef,2122A0,NAICS_2012_Code,212222, +BEA_Detail_Make_AfterRedef,212230,NAICS_2012_Code,212231, +BEA_Detail_Make_AfterRedef,212230,NAICS_2012_Code,212234, +BEA_Detail_Make_AfterRedef,2122A0,NAICS_2012_Code,212291, +BEA_Detail_Make_AfterRedef,2122A0,NAICS_2012_Code,212299, +BEA_Detail_Make_AfterRedef,212310,NAICS_2012_Code,212311, +BEA_Detail_Make_AfterRedef,212310,NAICS_2012_Code,212312, +BEA_Detail_Make_AfterRedef,212310,NAICS_2012_Code,212313, +BEA_Detail_Make_AfterRedef,212310,NAICS_2012_Code,212319, +BEA_Detail_Make_AfterRedef,213111,NAICS_2012_Code,213111, +BEA_Detail_Make_AfterRedef,21311A,NAICS_2012_Code,213112, +BEA_Detail_Make_AfterRedef,21311A,NAICS_2012_Code,213113, +BEA_Detail_Make_AfterRedef,21311A,NAICS_2012_Code,213114, +BEA_Detail_Make_AfterRedef,21311A,NAICS_2012_Code,213115, +BEA_Detail_Make_AfterRedef,221100,NAICS_2012_Code,221111, +BEA_Detail_Make_AfterRedef,221100,NAICS_2012_Code,221112, +BEA_Detail_Make_AfterRedef,221100,NAICS_2012_Code,221113, +BEA_Detail_Make_AfterRedef,221100,NAICS_2012_Code,221114, +BEA_Detail_Make_AfterRedef,221100,NAICS_2012_Code,221115, +BEA_Detail_Make_AfterRedef,221100,NAICS_2012_Code,221116, +BEA_Detail_Make_AfterRedef,221100,NAICS_2012_Code,221117, +BEA_Detail_Make_AfterRedef,221100,NAICS_2012_Code,221118, +BEA_Detail_Make_AfterRedef,221100,NAICS_2012_Code,221121, +BEA_Detail_Make_AfterRedef,221100,NAICS_2012_Code,221122, +BEA_Detail_Make_AfterRedef,221200,NAICS_2012_Code,221210, +BEA_Detail_Make_AfterRedef,221300,NAICS_2012_Code,221310, +BEA_Detail_Make_AfterRedef,221300,NAICS_2012_Code,221320, +BEA_Detail_Make_AfterRedef,221300,NAICS_2012_Code,221330, +BEA_Detail_Make_AfterRedef,230302,NAICS_2012_Code,236118, +BEA_Detail_Make_AfterRedef,230301,NAICS_2012_Code,236210, +BEA_Detail_Make_AfterRedef,230301,NAICS_2012_Code,236220, +BEA_Detail_Make_AfterRedef,230301,NAICS_2012_Code,238110, +BEA_Detail_Make_AfterRedef,230302,NAICS_2012_Code,238110, +BEA_Detail_Make_AfterRedef,230301,NAICS_2012_Code,238120, +BEA_Detail_Make_AfterRedef,230302,NAICS_2012_Code,238120, +BEA_Detail_Make_AfterRedef,230301,NAICS_2012_Code,238130, +BEA_Detail_Make_AfterRedef,230302,NAICS_2012_Code,238130, +BEA_Detail_Make_AfterRedef,230301,NAICS_2012_Code,238140, +BEA_Detail_Make_AfterRedef,230302,NAICS_2012_Code,238140, +BEA_Detail_Make_AfterRedef,230301,NAICS_2012_Code,238150, +BEA_Detail_Make_AfterRedef,230302,NAICS_2012_Code,238150, +BEA_Detail_Make_AfterRedef,230301,NAICS_2012_Code,238160, +BEA_Detail_Make_AfterRedef,230302,NAICS_2012_Code,238160, +BEA_Detail_Make_AfterRedef,230301,NAICS_2012_Code,238170, +BEA_Detail_Make_AfterRedef,230302,NAICS_2012_Code,238170, +BEA_Detail_Make_AfterRedef,230301,NAICS_2012_Code,238190, +BEA_Detail_Make_AfterRedef,230302,NAICS_2012_Code,238190, +BEA_Detail_Make_AfterRedef,230301,NAICS_2012_Code,238210, +BEA_Detail_Make_AfterRedef,230302,NAICS_2012_Code,238210, +BEA_Detail_Make_AfterRedef,230301,NAICS_2012_Code,238220, +BEA_Detail_Make_AfterRedef,230302,NAICS_2012_Code,238220, +BEA_Detail_Make_AfterRedef,230301,NAICS_2012_Code,238290, +BEA_Detail_Make_AfterRedef,230302,NAICS_2012_Code,238290, +BEA_Detail_Make_AfterRedef,230301,NAICS_2012_Code,238310, +BEA_Detail_Make_AfterRedef,230302,NAICS_2012_Code,238310, +BEA_Detail_Make_AfterRedef,230301,NAICS_2012_Code,238320, +BEA_Detail_Make_AfterRedef,230302,NAICS_2012_Code,238320, +BEA_Detail_Make_AfterRedef,230301,NAICS_2012_Code,238330, +BEA_Detail_Make_AfterRedef,230302,NAICS_2012_Code,238330, +BEA_Detail_Make_AfterRedef,230301,NAICS_2012_Code,238340, +BEA_Detail_Make_AfterRedef,230302,NAICS_2012_Code,238340, +BEA_Detail_Make_AfterRedef,230301,NAICS_2012_Code,238350, +BEA_Detail_Make_AfterRedef,230302,NAICS_2012_Code,238350, +BEA_Detail_Make_AfterRedef,230301,NAICS_2012_Code,238390, +BEA_Detail_Make_AfterRedef,230302,NAICS_2012_Code,238390, +BEA_Detail_Make_AfterRedef,230301,NAICS_2012_Code,238910, +BEA_Detail_Make_AfterRedef,230302,NAICS_2012_Code,238910, +BEA_Detail_Make_AfterRedef,230301,NAICS_2012_Code,238990, +BEA_Detail_Make_AfterRedef,230302,NAICS_2012_Code,238990, +BEA_Detail_Make_AfterRedef,311111,NAICS_2012_Code,311111, +BEA_Detail_Make_AfterRedef,311119,NAICS_2012_Code,311119, +BEA_Detail_Make_AfterRedef,311210,NAICS_2012_Code,311211, +BEA_Detail_Make_AfterRedef,311210,NAICS_2012_Code,311212, +BEA_Detail_Make_AfterRedef,311210,NAICS_2012_Code,311213, +BEA_Detail_Make_AfterRedef,311221,NAICS_2012_Code,311221, +BEA_Detail_Make_AfterRedef,311225,NAICS_2012_Code,311225, +BEA_Detail_Make_AfterRedef,311230,NAICS_2012_Code,311230, +BEA_Detail_Make_AfterRedef,311410,NAICS_2012_Code,311411, +BEA_Detail_Make_AfterRedef,311410,NAICS_2012_Code,311412, +BEA_Detail_Make_AfterRedef,311420,NAICS_2012_Code,311421, +BEA_Detail_Make_AfterRedef,311420,NAICS_2012_Code,311422, +BEA_Detail_Make_AfterRedef,311420,NAICS_2012_Code,311423, +BEA_Detail_Make_AfterRedef,31151A,NAICS_2012_Code,311511, +BEA_Detail_Make_AfterRedef,31151A,NAICS_2012_Code,311512, +BEA_Detail_Make_AfterRedef,311513,NAICS_2012_Code,311513, +BEA_Detail_Make_AfterRedef,311514,NAICS_2012_Code,311514, +BEA_Detail_Make_AfterRedef,311520,NAICS_2012_Code,311520, +BEA_Detail_Make_AfterRedef,31161A,NAICS_2012_Code,311611, +BEA_Detail_Make_AfterRedef,31161A,NAICS_2012_Code,311612, +BEA_Detail_Make_AfterRedef,31161A,NAICS_2012_Code,311613, +BEA_Detail_Make_AfterRedef,311615,NAICS_2012_Code,311615, +BEA_Detail_Make_AfterRedef,311700,NAICS_2012_Code,311710, +BEA_Detail_Make_AfterRedef,311810,NAICS_2012_Code,311811, +BEA_Detail_Make_AfterRedef,311810,NAICS_2012_Code,311812, +BEA_Detail_Make_AfterRedef,311810,NAICS_2012_Code,311813, +BEA_Detail_Make_AfterRedef,311910,NAICS_2012_Code,311911, +BEA_Detail_Make_AfterRedef,311910,NAICS_2012_Code,311919, +BEA_Detail_Make_AfterRedef,311920,NAICS_2012_Code,311920, +BEA_Detail_Make_AfterRedef,311930,NAICS_2012_Code,311930, +BEA_Detail_Make_AfterRedef,311940,NAICS_2012_Code,311941, +BEA_Detail_Make_AfterRedef,311940,NAICS_2012_Code,311942, +BEA_Detail_Make_AfterRedef,311990,NAICS_2012_Code,311991, +BEA_Detail_Make_AfterRedef,311990,NAICS_2012_Code,311999, +BEA_Detail_Make_AfterRedef,312110,NAICS_2012_Code,312111, +BEA_Detail_Make_AfterRedef,312110,NAICS_2012_Code,312112, +BEA_Detail_Make_AfterRedef,312110,NAICS_2012_Code,312113, +BEA_Detail_Make_AfterRedef,312120,NAICS_2012_Code,312120, +BEA_Detail_Make_AfterRedef,312130,NAICS_2012_Code,312130, +BEA_Detail_Make_AfterRedef,312140,NAICS_2012_Code,312140, +BEA_Detail_Make_AfterRedef,313100,NAICS_2012_Code,313110, +BEA_Detail_Make_AfterRedef,314110,NAICS_2012_Code,314110, +BEA_Detail_Make_AfterRedef,314120,NAICS_2012_Code,314120, +BEA_Detail_Make_AfterRedef,321100,NAICS_2012_Code,321113, +BEA_Detail_Make_AfterRedef,321100,NAICS_2012_Code,321114, +BEA_Detail_Make_AfterRedef,321910,NAICS_2012_Code,321911, +BEA_Detail_Make_AfterRedef,321910,NAICS_2012_Code,321912, +BEA_Detail_Make_AfterRedef,321910,NAICS_2012_Code,321918, +BEA_Detail_Make_AfterRedef,322110,NAICS_2012_Code,322110, +BEA_Detail_Make_AfterRedef,322120,NAICS_2012_Code,322121, +BEA_Detail_Make_AfterRedef,322120,NAICS_2012_Code,322122, +BEA_Detail_Make_AfterRedef,322130,NAICS_2012_Code,322130, +BEA_Detail_Make_AfterRedef,322210,NAICS_2012_Code,322211, +BEA_Detail_Make_AfterRedef,322210,NAICS_2012_Code,322212, +BEA_Detail_Make_AfterRedef,322210,NAICS_2012_Code,322219, +BEA_Detail_Make_AfterRedef,322230,NAICS_2012_Code,322230, +BEA_Detail_Make_AfterRedef,322291,NAICS_2012_Code,322291, +BEA_Detail_Make_AfterRedef,322299,NAICS_2012_Code,322299, +BEA_Detail_Make_AfterRedef,323110,NAICS_2012_Code,323111, +BEA_Detail_Make_AfterRedef,323110,NAICS_2012_Code,323113, +BEA_Detail_Make_AfterRedef,323110,NAICS_2012_Code,323117, +BEA_Detail_Make_AfterRedef,323120,NAICS_2012_Code,323120, +BEA_Detail_Make_AfterRedef,324110,NAICS_2012_Code,324110, +BEA_Detail_Make_AfterRedef,324121,NAICS_2012_Code,324121, +BEA_Detail_Make_AfterRedef,324122,NAICS_2012_Code,324122, +BEA_Detail_Make_AfterRedef,325110,NAICS_2012_Code,325110, +BEA_Detail_Make_AfterRedef,325120,NAICS_2012_Code,325120, +BEA_Detail_Make_AfterRedef,325130,NAICS_2012_Code,325130, +BEA_Detail_Make_AfterRedef,325190,NAICS_2012_Code,325193, +BEA_Detail_Make_AfterRedef,325190,NAICS_2012_Code,325194, +BEA_Detail_Make_AfterRedef,325190,NAICS_2012_Code,325199, +BEA_Detail_Make_AfterRedef,325211,NAICS_2012_Code,325211, +BEA_Detail_Make_AfterRedef,325310,NAICS_2012_Code,325311, +BEA_Detail_Make_AfterRedef,325310,NAICS_2012_Code,325312, +BEA_Detail_Make_AfterRedef,325310,NAICS_2012_Code,325314, +BEA_Detail_Make_AfterRedef,325320,NAICS_2012_Code,325320, +BEA_Detail_Make_AfterRedef,325411,NAICS_2012_Code,325411, +BEA_Detail_Make_AfterRedef,325412,NAICS_2012_Code,325412, +BEA_Detail_Make_AfterRedef,325413,NAICS_2012_Code,325413, +BEA_Detail_Make_AfterRedef,325414,NAICS_2012_Code,325414, +BEA_Detail_Make_AfterRedef,325510,NAICS_2012_Code,325510, +BEA_Detail_Make_AfterRedef,325520,NAICS_2012_Code,325520, +BEA_Detail_Make_AfterRedef,325610,NAICS_2012_Code,325611, +BEA_Detail_Make_AfterRedef,325610,NAICS_2012_Code,325612, +BEA_Detail_Make_AfterRedef,325610,NAICS_2012_Code,325613, +BEA_Detail_Make_AfterRedef,325620,NAICS_2012_Code,325620, +BEA_Detail_Make_AfterRedef,325910,NAICS_2012_Code,325910, +BEA_Detail_Make_AfterRedef,3259A0,NAICS_2012_Code,325920, +BEA_Detail_Make_AfterRedef,3259A0,NAICS_2012_Code,325991, +BEA_Detail_Make_AfterRedef,3259A0,NAICS_2012_Code,325992, +BEA_Detail_Make_AfterRedef,3259A0,NAICS_2012_Code,325998, +BEA_Detail_Make_AfterRedef,326110,NAICS_2012_Code,326111, +BEA_Detail_Make_AfterRedef,326110,NAICS_2012_Code,326112, +BEA_Detail_Make_AfterRedef,326110,NAICS_2012_Code,326113, +BEA_Detail_Make_AfterRedef,326130,NAICS_2012_Code,326130, +BEA_Detail_Make_AfterRedef,326140,NAICS_2012_Code,326140, +BEA_Detail_Make_AfterRedef,326150,NAICS_2012_Code,326150, +BEA_Detail_Make_AfterRedef,326160,NAICS_2012_Code,326160, +BEA_Detail_Make_AfterRedef,326210,NAICS_2012_Code,326211, +BEA_Detail_Make_AfterRedef,326210,NAICS_2012_Code,326212, +BEA_Detail_Make_AfterRedef,326220,NAICS_2012_Code,326220, +BEA_Detail_Make_AfterRedef,326290,NAICS_2012_Code,326291, +BEA_Detail_Make_AfterRedef,326290,NAICS_2012_Code,326299, +BEA_Detail_Make_AfterRedef,327310,NAICS_2012_Code,327310, +BEA_Detail_Make_AfterRedef,327320,NAICS_2012_Code,327320, +BEA_Detail_Make_AfterRedef,327330,NAICS_2012_Code,327331, +BEA_Detail_Make_AfterRedef,327330,NAICS_2012_Code,327332, +BEA_Detail_Make_AfterRedef,327390,NAICS_2012_Code,327390, +BEA_Detail_Make_AfterRedef,327910,NAICS_2012_Code,327910, +BEA_Detail_Make_AfterRedef,327991,NAICS_2012_Code,327991, +BEA_Detail_Make_AfterRedef,327992,NAICS_2012_Code,327992, +BEA_Detail_Make_AfterRedef,327993,NAICS_2012_Code,327993, +BEA_Detail_Make_AfterRedef,327999,NAICS_2012_Code,327999, +BEA_Detail_Make_AfterRedef,331110,NAICS_2012_Code,331110, +BEA_Detail_Make_AfterRedef,331200,NAICS_2012_Code,331210, +BEA_Detail_Make_AfterRedef,331200,NAICS_2012_Code,331221, +BEA_Detail_Make_AfterRedef,331200,NAICS_2012_Code,331222, +BEA_Detail_Make_AfterRedef,331314,NAICS_2012_Code,331314, +BEA_Detail_Make_AfterRedef,33131B,NAICS_2012_Code,331315, +BEA_Detail_Make_AfterRedef,33131B,NAICS_2012_Code,331318, +BEA_Detail_Make_AfterRedef,331420,NAICS_2012_Code,331420, +BEA_Detail_Make_AfterRedef,331490,NAICS_2012_Code,331491, +BEA_Detail_Make_AfterRedef,331490,NAICS_2012_Code,331492, +BEA_Detail_Make_AfterRedef,331510,NAICS_2012_Code,331511, +BEA_Detail_Make_AfterRedef,331510,NAICS_2012_Code,331512, +BEA_Detail_Make_AfterRedef,331510,NAICS_2012_Code,331513, +BEA_Detail_Make_AfterRedef,331520,NAICS_2012_Code,331523, +BEA_Detail_Make_AfterRedef,331520,NAICS_2012_Code,331524, +BEA_Detail_Make_AfterRedef,331520,NAICS_2012_Code,331529, +BEA_Detail_Make_AfterRedef,33211A,NAICS_2012_Code,332111, +BEA_Detail_Make_AfterRedef,33211A,NAICS_2012_Code,332112, +BEA_Detail_Make_AfterRedef,332114,NAICS_2012_Code,332114, +BEA_Detail_Make_AfterRedef,33211A,NAICS_2012_Code,332117, +BEA_Detail_Make_AfterRedef,332310,NAICS_2012_Code,332311, +BEA_Detail_Make_AfterRedef,332310,NAICS_2012_Code,332312, +BEA_Detail_Make_AfterRedef,332310,NAICS_2012_Code,332313, +BEA_Detail_Make_AfterRedef,332320,NAICS_2012_Code,332321, +BEA_Detail_Make_AfterRedef,332320,NAICS_2012_Code,332322, +BEA_Detail_Make_AfterRedef,332320,NAICS_2012_Code,332323, +BEA_Detail_Make_AfterRedef,332410,NAICS_2012_Code,332410, +BEA_Detail_Make_AfterRedef,332420,NAICS_2012_Code,332420, +BEA_Detail_Make_AfterRedef,332430,NAICS_2012_Code,332431, +BEA_Detail_Make_AfterRedef,332430,NAICS_2012_Code,332439, +BEA_Detail_Make_AfterRedef,332500,NAICS_2012_Code,332510, +BEA_Detail_Make_AfterRedef,332600,NAICS_2012_Code,332613, +BEA_Detail_Make_AfterRedef,332600,NAICS_2012_Code,332618, +BEA_Detail_Make_AfterRedef,332710,NAICS_2012_Code,332710, +BEA_Detail_Make_AfterRedef,332720,NAICS_2012_Code,332721, +BEA_Detail_Make_AfterRedef,332720,NAICS_2012_Code,332722, +BEA_Detail_Make_AfterRedef,332800,NAICS_2012_Code,332811, +BEA_Detail_Make_AfterRedef,332800,NAICS_2012_Code,332812, +BEA_Detail_Make_AfterRedef,332800,NAICS_2012_Code,332813, +BEA_Detail_Make_AfterRedef,33291A,NAICS_2012_Code,332911, +BEA_Detail_Make_AfterRedef,33291A,NAICS_2012_Code,332912, +BEA_Detail_Make_AfterRedef,332913,NAICS_2012_Code,332913, +BEA_Detail_Make_AfterRedef,33291A,NAICS_2012_Code,332919, +BEA_Detail_Make_AfterRedef,332991,NAICS_2012_Code,332991, +BEA_Detail_Make_AfterRedef,33299A,NAICS_2012_Code,332992, +BEA_Detail_Make_AfterRedef,33299A,NAICS_2012_Code,332993, +BEA_Detail_Make_AfterRedef,33299A,NAICS_2012_Code,332994, +BEA_Detail_Make_AfterRedef,332996,NAICS_2012_Code,332996, +BEA_Detail_Make_AfterRedef,333111,NAICS_2012_Code,333111, +BEA_Detail_Make_AfterRedef,333112,NAICS_2012_Code,333112, +BEA_Detail_Make_AfterRedef,333120,NAICS_2012_Code,333120, +BEA_Detail_Make_AfterRedef,333130,NAICS_2012_Code,333131, +BEA_Detail_Make_AfterRedef,333130,NAICS_2012_Code,333132, +BEA_Detail_Make_AfterRedef,33329A,NAICS_2012_Code,333241, +BEA_Detail_Make_AfterRedef,33329A,NAICS_2012_Code,333243, +BEA_Detail_Make_AfterRedef,33329A,NAICS_2012_Code,333244, +BEA_Detail_Make_AfterRedef,33329A,NAICS_2012_Code,333249, +BEA_Detail_Make_AfterRedef,333314,NAICS_2012_Code,333314, +BEA_Detail_Make_AfterRedef,333414,NAICS_2012_Code,333414, +BEA_Detail_Make_AfterRedef,333415,NAICS_2012_Code,333415, +BEA_Detail_Make_AfterRedef,333511,NAICS_2012_Code,333511, +BEA_Detail_Make_AfterRedef,333514,NAICS_2012_Code,333514, +BEA_Detail_Make_AfterRedef,33351B,NAICS_2012_Code,333515, +BEA_Detail_Make_AfterRedef,33351B,NAICS_2012_Code,333519, +BEA_Detail_Make_AfterRedef,333611,NAICS_2012_Code,333611, +BEA_Detail_Make_AfterRedef,333612,NAICS_2012_Code,333612, +BEA_Detail_Make_AfterRedef,333613,NAICS_2012_Code,333613, +BEA_Detail_Make_AfterRedef,333618,NAICS_2012_Code,333618, +BEA_Detail_Make_AfterRedef,333912,NAICS_2012_Code,333912, +BEA_Detail_Make_AfterRedef,333920,NAICS_2012_Code,333921, +BEA_Detail_Make_AfterRedef,333920,NAICS_2012_Code,333922, +BEA_Detail_Make_AfterRedef,333920,NAICS_2012_Code,333923, +BEA_Detail_Make_AfterRedef,333920,NAICS_2012_Code,333924, +BEA_Detail_Make_AfterRedef,333991,NAICS_2012_Code,333991, +BEA_Detail_Make_AfterRedef,33399A,NAICS_2012_Code,333992, +BEA_Detail_Make_AfterRedef,333993,NAICS_2012_Code,333993, +BEA_Detail_Make_AfterRedef,333994,NAICS_2012_Code,333994, +BEA_Detail_Make_AfterRedef,33399B,NAICS_2012_Code,333995, +BEA_Detail_Make_AfterRedef,33399B,NAICS_2012_Code,333996, +BEA_Detail_Make_AfterRedef,33399A,NAICS_2012_Code,333997, +BEA_Detail_Make_AfterRedef,33399A,NAICS_2012_Code,333999, +BEA_Detail_Make_AfterRedef,334111,NAICS_2012_Code,334111, +BEA_Detail_Make_AfterRedef,334112,NAICS_2012_Code,334112, +BEA_Detail_Make_AfterRedef,334210,NAICS_2012_Code,334210, +BEA_Detail_Make_AfterRedef,334220,NAICS_2012_Code,334220, +BEA_Detail_Make_AfterRedef,334290,NAICS_2012_Code,334290, +BEA_Detail_Make_AfterRedef,334300,NAICS_2012_Code,334310, +BEA_Detail_Make_AfterRedef,33441A,NAICS_2012_Code,334412, +BEA_Detail_Make_AfterRedef,334413,NAICS_2012_Code,334413, +BEA_Detail_Make_AfterRedef,33441A,NAICS_2012_Code,334416, +BEA_Detail_Make_AfterRedef,33441A,NAICS_2012_Code,334417, +BEA_Detail_Make_AfterRedef,334418,NAICS_2012_Code,334418, +BEA_Detail_Make_AfterRedef,33441A,NAICS_2012_Code,334419, +BEA_Detail_Make_AfterRedef,334510,NAICS_2012_Code,334510, +BEA_Detail_Make_AfterRedef,334511,NAICS_2012_Code,334511, +BEA_Detail_Make_AfterRedef,334512,NAICS_2012_Code,334512, +BEA_Detail_Make_AfterRedef,334513,NAICS_2012_Code,334513, +BEA_Detail_Make_AfterRedef,334514,NAICS_2012_Code,334514, +BEA_Detail_Make_AfterRedef,334515,NAICS_2012_Code,334515, +BEA_Detail_Make_AfterRedef,334516,NAICS_2012_Code,334516, +BEA_Detail_Make_AfterRedef,334517,NAICS_2012_Code,334517, +BEA_Detail_Make_AfterRedef,33451A,NAICS_2012_Code,334519, +BEA_Detail_Make_AfterRedef,335110,NAICS_2012_Code,335110, +BEA_Detail_Make_AfterRedef,335120,NAICS_2012_Code,335121, +BEA_Detail_Make_AfterRedef,335120,NAICS_2012_Code,335122, +BEA_Detail_Make_AfterRedef,335120,NAICS_2012_Code,335129, +BEA_Detail_Make_AfterRedef,335210,NAICS_2012_Code,335210, +BEA_Detail_Make_AfterRedef,335221,NAICS_2012_Code,335221, +BEA_Detail_Make_AfterRedef,335222,NAICS_2012_Code,335222, +BEA_Detail_Make_AfterRedef,335224,NAICS_2012_Code,335224, +BEA_Detail_Make_AfterRedef,335228,NAICS_2012_Code,335228, +BEA_Detail_Make_AfterRedef,335311,NAICS_2012_Code,335311, +BEA_Detail_Make_AfterRedef,335312,NAICS_2012_Code,335312, +BEA_Detail_Make_AfterRedef,335313,NAICS_2012_Code,335313, +BEA_Detail_Make_AfterRedef,335314,NAICS_2012_Code,335314, +BEA_Detail_Make_AfterRedef,335911,NAICS_2012_Code,335911, +BEA_Detail_Make_AfterRedef,335912,NAICS_2012_Code,335912, +BEA_Detail_Make_AfterRedef,335920,NAICS_2012_Code,335921, +BEA_Detail_Make_AfterRedef,335920,NAICS_2012_Code,335929, +BEA_Detail_Make_AfterRedef,335930,NAICS_2012_Code,335931, +BEA_Detail_Make_AfterRedef,335930,NAICS_2012_Code,335932, +BEA_Detail_Make_AfterRedef,335991,NAICS_2012_Code,335991, +BEA_Detail_Make_AfterRedef,335999,NAICS_2012_Code,335999, +BEA_Detail_Make_AfterRedef,336111,NAICS_2012_Code,336111, +BEA_Detail_Make_AfterRedef,336112,NAICS_2012_Code,336112, +BEA_Detail_Make_AfterRedef,336120,NAICS_2012_Code,336120, +BEA_Detail_Make_AfterRedef,336211,NAICS_2012_Code,336211, +BEA_Detail_Make_AfterRedef,336212,NAICS_2012_Code,336212, +BEA_Detail_Make_AfterRedef,336213,NAICS_2012_Code,336213, +BEA_Detail_Make_AfterRedef,336214,NAICS_2012_Code,336214, +BEA_Detail_Make_AfterRedef,336411,NAICS_2012_Code,336411, +BEA_Detail_Make_AfterRedef,336412,NAICS_2012_Code,336412, +BEA_Detail_Make_AfterRedef,336413,NAICS_2012_Code,336413, +BEA_Detail_Make_AfterRedef,336414,NAICS_2012_Code,336414, +BEA_Detail_Make_AfterRedef,33641A,NAICS_2012_Code,336415, +BEA_Detail_Make_AfterRedef,33641A,NAICS_2012_Code,336419, +BEA_Detail_Make_AfterRedef,336500,NAICS_2012_Code,336510, +BEA_Detail_Make_AfterRedef,336611,NAICS_2012_Code,336611, +BEA_Detail_Make_AfterRedef,336612,NAICS_2012_Code,336612, +BEA_Detail_Make_AfterRedef,336991,NAICS_2012_Code,336991, +BEA_Detail_Make_AfterRedef,336992,NAICS_2012_Code,336992, +BEA_Detail_Make_AfterRedef,336999,NAICS_2012_Code,336999, +BEA_Detail_Make_AfterRedef,337110,NAICS_2012_Code,337110, +BEA_Detail_Make_AfterRedef,337121,NAICS_2012_Code,337121, +BEA_Detail_Make_AfterRedef,337122,NAICS_2012_Code,337122, +BEA_Detail_Make_AfterRedef,337127,NAICS_2012_Code,337127, +BEA_Detail_Make_AfterRedef,33721A,NAICS_2012_Code,337211, +BEA_Detail_Make_AfterRedef,33721A,NAICS_2012_Code,337212, +BEA_Detail_Make_AfterRedef,33721A,NAICS_2012_Code,337214, +BEA_Detail_Make_AfterRedef,337215,NAICS_2012_Code,337215, +BEA_Detail_Make_AfterRedef,339112,NAICS_2012_Code,339112, +BEA_Detail_Make_AfterRedef,339113,NAICS_2012_Code,339113, +BEA_Detail_Make_AfterRedef,339114,NAICS_2012_Code,339114, +BEA_Detail_Make_AfterRedef,339115,NAICS_2012_Code,339115, +BEA_Detail_Make_AfterRedef,339116,NAICS_2012_Code,339116, +BEA_Detail_Make_AfterRedef,339910,NAICS_2012_Code,339910, +BEA_Detail_Make_AfterRedef,339920,NAICS_2012_Code,339920, +BEA_Detail_Make_AfterRedef,339930,NAICS_2012_Code,339930, +BEA_Detail_Make_AfterRedef,339940,NAICS_2012_Code,339940, +BEA_Detail_Make_AfterRedef,339950,NAICS_2012_Code,339950, +BEA_Detail_Make_AfterRedef,481000,NAICS_2012_Code,481111, +BEA_Detail_Make_AfterRedef,481000,NAICS_2012_Code,481112, +BEA_Detail_Make_AfterRedef,481000,NAICS_2012_Code,481211, +BEA_Detail_Make_AfterRedef,481000,NAICS_2012_Code,481212, +BEA_Detail_Make_AfterRedef,481000,NAICS_2012_Code,481219, +BEA_Detail_Make_AfterRedef,482000,NAICS_2012_Code,482111, +BEA_Detail_Make_AfterRedef,482000,NAICS_2012_Code,482112, +BEA_Detail_Make_AfterRedef,483000,NAICS_2012_Code,483111, +BEA_Detail_Make_AfterRedef,483000,NAICS_2012_Code,483112, +BEA_Detail_Make_AfterRedef,483000,NAICS_2012_Code,483113, +BEA_Detail_Make_AfterRedef,483000,NAICS_2012_Code,483114, +BEA_Detail_Make_AfterRedef,483000,NAICS_2012_Code,483211, +BEA_Detail_Make_AfterRedef,483000,NAICS_2012_Code,483212, +BEA_Detail_Make_AfterRedef,484000,NAICS_2012_Code,484110, +BEA_Detail_Make_AfterRedef,484000,NAICS_2012_Code,484121, +BEA_Detail_Make_AfterRedef,484000,NAICS_2012_Code,484122, +BEA_Detail_Make_AfterRedef,484000,NAICS_2012_Code,484210, +BEA_Detail_Make_AfterRedef,484000,NAICS_2012_Code,484220, +BEA_Detail_Make_AfterRedef,484000,NAICS_2012_Code,484230, +BEA_Detail_Make_AfterRedef,485000,NAICS_2012_Code,485111, +BEA_Detail_Make_AfterRedef,485000,NAICS_2012_Code,485112, +BEA_Detail_Make_AfterRedef,485000,NAICS_2012_Code,485113, +BEA_Detail_Make_AfterRedef,485000,NAICS_2012_Code,485119, +BEA_Detail_Make_AfterRedef,485000,NAICS_2012_Code,485210, +BEA_Detail_Make_AfterRedef,485000,NAICS_2012_Code,485310, +BEA_Detail_Make_AfterRedef,485000,NAICS_2012_Code,485320, +BEA_Detail_Make_AfterRedef,485000,NAICS_2012_Code,485410, +BEA_Detail_Make_AfterRedef,485000,NAICS_2012_Code,485510, +BEA_Detail_Make_AfterRedef,485000,NAICS_2012_Code,485991, +BEA_Detail_Make_AfterRedef,485000,NAICS_2012_Code,485999, +BEA_Detail_Make_AfterRedef,486000,NAICS_2012_Code,486110, +BEA_Detail_Make_AfterRedef,486000,NAICS_2012_Code,486210, +BEA_Detail_Make_AfterRedef,486000,NAICS_2012_Code,486910, +BEA_Detail_Make_AfterRedef,486000,NAICS_2012_Code,486990, +BEA_Detail_Make_AfterRedef,48A000,NAICS_2012_Code,487110, +BEA_Detail_Make_AfterRedef,48A000,NAICS_2012_Code,487210, +BEA_Detail_Make_AfterRedef,48A000,NAICS_2012_Code,487990, +BEA_Detail_Make_AfterRedef,48A000,NAICS_2012_Code,488111, +BEA_Detail_Make_AfterRedef,48A000,NAICS_2012_Code,488119, +BEA_Detail_Make_AfterRedef,48A000,NAICS_2012_Code,488190, +BEA_Detail_Make_AfterRedef,48A000,NAICS_2012_Code,488210, +BEA_Detail_Make_AfterRedef,48A000,NAICS_2012_Code,488310, +BEA_Detail_Make_AfterRedef,48A000,NAICS_2012_Code,488320, +BEA_Detail_Make_AfterRedef,48A000,NAICS_2012_Code,488330, +BEA_Detail_Make_AfterRedef,48A000,NAICS_2012_Code,488390, +BEA_Detail_Make_AfterRedef,48A000,NAICS_2012_Code,488410, +BEA_Detail_Make_AfterRedef,48A000,NAICS_2012_Code,488490, +BEA_Detail_Make_AfterRedef,48A000,NAICS_2012_Code,488510, +BEA_Detail_Make_AfterRedef,48A000,NAICS_2012_Code,488991, +BEA_Detail_Make_AfterRedef,48A000,NAICS_2012_Code,488999, +BEA_Detail_Make_AfterRedef,491000,NAICS_2012_Code,491110, +BEA_Detail_Make_AfterRedef,492000,NAICS_2012_Code,492110, +BEA_Detail_Make_AfterRedef,492000,NAICS_2012_Code,492210, +BEA_Detail_Make_AfterRedef,493000,NAICS_2012_Code,493110, +BEA_Detail_Make_AfterRedef,493000,NAICS_2012_Code,493120, +BEA_Detail_Make_AfterRedef,493000,NAICS_2012_Code,493130, +BEA_Detail_Make_AfterRedef,493000,NAICS_2012_Code,493190, +BEA_Detail_Make_AfterRedef,511110,NAICS_2012_Code,511110, +BEA_Detail_Make_AfterRedef,511120,NAICS_2012_Code,511120, +BEA_Detail_Make_AfterRedef,511130,NAICS_2012_Code,511130, +BEA_Detail_Make_AfterRedef,5111A0,NAICS_2012_Code,511140, +BEA_Detail_Make_AfterRedef,5111A0,NAICS_2012_Code,511191, +BEA_Detail_Make_AfterRedef,5111A0,NAICS_2012_Code,511199, +BEA_Detail_Make_AfterRedef,511200,NAICS_2012_Code,511210, +BEA_Detail_Make_AfterRedef,512100,NAICS_2012_Code,512110, +BEA_Detail_Make_AfterRedef,512100,NAICS_2012_Code,512120, +BEA_Detail_Make_AfterRedef,512100,NAICS_2012_Code,512131, +BEA_Detail_Make_AfterRedef,512100,NAICS_2012_Code,512132, +BEA_Detail_Make_AfterRedef,512100,NAICS_2012_Code,512191, +BEA_Detail_Make_AfterRedef,512100,NAICS_2012_Code,512199, +BEA_Detail_Make_AfterRedef,512200,NAICS_2012_Code,512210, +BEA_Detail_Make_AfterRedef,512200,NAICS_2012_Code,512220, +BEA_Detail_Make_AfterRedef,512200,NAICS_2012_Code,512230, +BEA_Detail_Make_AfterRedef,512200,NAICS_2012_Code,512240, +BEA_Detail_Make_AfterRedef,512200,NAICS_2012_Code,512290, +BEA_Detail_Make_AfterRedef,515100,NAICS_2012_Code,515111, +BEA_Detail_Make_AfterRedef,515100,NAICS_2012_Code,515112, +BEA_Detail_Make_AfterRedef,515100,NAICS_2012_Code,515120, +BEA_Detail_Make_AfterRedef,515200,NAICS_2012_Code,515210, +BEA_Detail_Make_AfterRedef,518200,NAICS_2012_Code,518210, +BEA_Detail_Make_AfterRedef,52A000,NAICS_2012_Code,521110, +BEA_Detail_Make_AfterRedef,52A000,NAICS_2012_Code,522110, +BEA_Detail_Make_AfterRedef,52A000,NAICS_2012_Code,522120, +BEA_Detail_Make_AfterRedef,52A000,NAICS_2012_Code,522130, +BEA_Detail_Make_AfterRedef,52A000,NAICS_2012_Code,522190, +BEA_Detail_Make_AfterRedef,522A00,NAICS_2012_Code,522210, +BEA_Detail_Make_AfterRedef,522A00,NAICS_2012_Code,522220, +BEA_Detail_Make_AfterRedef,522A00,NAICS_2012_Code,522291, +BEA_Detail_Make_AfterRedef,522A00,NAICS_2012_Code,522292, +BEA_Detail_Make_AfterRedef,522A00,NAICS_2012_Code,522293, +BEA_Detail_Make_AfterRedef,522A00,NAICS_2012_Code,522294, +BEA_Detail_Make_AfterRedef,522A00,NAICS_2012_Code,522298, +BEA_Detail_Make_AfterRedef,522A00,NAICS_2012_Code,522310, +BEA_Detail_Make_AfterRedef,522A00,NAICS_2012_Code,522320, +BEA_Detail_Make_AfterRedef,522A00,NAICS_2012_Code,522390, +BEA_Detail_Make_AfterRedef,524200,NAICS_2012_Code,524210, +BEA_Detail_Make_AfterRedef,524200,NAICS_2012_Code,524291, +BEA_Detail_Make_AfterRedef,524200,NAICS_2012_Code,524292, +BEA_Detail_Make_AfterRedef,524200,NAICS_2012_Code,524298, +BEA_Detail_Make_AfterRedef,525000,NAICS_2012_Code,525110, +BEA_Detail_Make_AfterRedef,525000,NAICS_2012_Code,525120, +BEA_Detail_Make_AfterRedef,525000,NAICS_2012_Code,525190, +BEA_Detail_Make_AfterRedef,525000,NAICS_2012_Code,525910, +BEA_Detail_Make_AfterRedef,525000,NAICS_2012_Code,525920, +BEA_Detail_Make_AfterRedef,525000,NAICS_2012_Code,525990, +BEA_Detail_Make_AfterRedef,532100,NAICS_2012_Code,532111, +BEA_Detail_Make_AfterRedef,532100,NAICS_2012_Code,532112, +BEA_Detail_Make_AfterRedef,532100,NAICS_2012_Code,532120, +BEA_Detail_Make_AfterRedef,532A00,NAICS_2012_Code,532210, +BEA_Detail_Make_AfterRedef,532A00,NAICS_2012_Code,532220, +BEA_Detail_Make_AfterRedef,532A00,NAICS_2012_Code,532230, +BEA_Detail_Make_AfterRedef,532A00,NAICS_2012_Code,532291, +BEA_Detail_Make_AfterRedef,532A00,NAICS_2012_Code,532292, +BEA_Detail_Make_AfterRedef,532A00,NAICS_2012_Code,532299, +BEA_Detail_Make_AfterRedef,532A00,NAICS_2012_Code,532310, +BEA_Detail_Make_AfterRedef,532400,NAICS_2012_Code,532411, +BEA_Detail_Make_AfterRedef,532400,NAICS_2012_Code,532412, +BEA_Detail_Make_AfterRedef,532400,NAICS_2012_Code,532420, +BEA_Detail_Make_AfterRedef,532400,NAICS_2012_Code,532490, +BEA_Detail_Make_AfterRedef,533000,NAICS_2012_Code,533110, +BEA_Detail_Make_AfterRedef,541100,NAICS_2012_Code,541110, +BEA_Detail_Make_AfterRedef,541100,NAICS_2012_Code,541120, +BEA_Detail_Make_AfterRedef,541100,NAICS_2012_Code,541191, +BEA_Detail_Make_AfterRedef,541100,NAICS_2012_Code,541199, +BEA_Detail_Make_AfterRedef,541200,NAICS_2012_Code,541211, +BEA_Detail_Make_AfterRedef,541200,NAICS_2012_Code,541213, +BEA_Detail_Make_AfterRedef,541200,NAICS_2012_Code,541214, +BEA_Detail_Make_AfterRedef,541200,NAICS_2012_Code,541219, +BEA_Detail_Make_AfterRedef,541300,NAICS_2012_Code,541310, +BEA_Detail_Make_AfterRedef,541300,NAICS_2012_Code,541320, +BEA_Detail_Make_AfterRedef,541300,NAICS_2012_Code,541330, +BEA_Detail_Make_AfterRedef,541300,NAICS_2012_Code,541340, +BEA_Detail_Make_AfterRedef,541300,NAICS_2012_Code,541350, +BEA_Detail_Make_AfterRedef,541300,NAICS_2012_Code,541360, +BEA_Detail_Make_AfterRedef,541300,NAICS_2012_Code,541370, +BEA_Detail_Make_AfterRedef,541300,NAICS_2012_Code,541380, +BEA_Detail_Make_AfterRedef,541400,NAICS_2012_Code,541410, +BEA_Detail_Make_AfterRedef,541400,NAICS_2012_Code,541420, +BEA_Detail_Make_AfterRedef,541400,NAICS_2012_Code,541430, +BEA_Detail_Make_AfterRedef,541400,NAICS_2012_Code,541490, +BEA_Detail_Make_AfterRedef,541511,NAICS_2012_Code,541511, +BEA_Detail_Make_AfterRedef,541512,NAICS_2012_Code,541512, +BEA_Detail_Make_AfterRedef,54151A,NAICS_2012_Code,541513, +BEA_Detail_Make_AfterRedef,54151A,NAICS_2012_Code,541519, +BEA_Detail_Make_AfterRedef,541610,NAICS_2012_Code,541611, +BEA_Detail_Make_AfterRedef,541610,NAICS_2012_Code,541612, +BEA_Detail_Make_AfterRedef,541610,NAICS_2012_Code,541613, +BEA_Detail_Make_AfterRedef,541610,NAICS_2012_Code,541614, +BEA_Detail_Make_AfterRedef,541610,NAICS_2012_Code,541618, +BEA_Detail_Make_AfterRedef,5416A0,NAICS_2012_Code,541620, +BEA_Detail_Make_AfterRedef,5416A0,NAICS_2012_Code,541690, +BEA_Detail_Make_AfterRedef,541700,NAICS_2012_Code,541711, +BEA_Detail_Make_AfterRedef,541700,NAICS_2012_Code,541712, +BEA_Detail_Make_AfterRedef,541700,NAICS_2012_Code,541720, +BEA_Detail_Make_AfterRedef,541800,NAICS_2012_Code,541810, +BEA_Detail_Make_AfterRedef,541800,NAICS_2012_Code,541820, +BEA_Detail_Make_AfterRedef,541800,NAICS_2012_Code,541830, +BEA_Detail_Make_AfterRedef,541800,NAICS_2012_Code,541840, +BEA_Detail_Make_AfterRedef,541800,NAICS_2012_Code,541850, +BEA_Detail_Make_AfterRedef,541800,NAICS_2012_Code,541860, +BEA_Detail_Make_AfterRedef,541800,NAICS_2012_Code,541870, +BEA_Detail_Make_AfterRedef,541800,NAICS_2012_Code,541890, +BEA_Detail_Make_AfterRedef,5419A0,NAICS_2012_Code,541910, +BEA_Detail_Make_AfterRedef,541920,NAICS_2012_Code,541921, +BEA_Detail_Make_AfterRedef,541920,NAICS_2012_Code,541922, +BEA_Detail_Make_AfterRedef,5419A0,NAICS_2012_Code,541930, +BEA_Detail_Make_AfterRedef,541940,NAICS_2012_Code,541940, +BEA_Detail_Make_AfterRedef,5419A0,NAICS_2012_Code,541990, +BEA_Detail_Make_AfterRedef,550000,NAICS_2012_Code,551111, +BEA_Detail_Make_AfterRedef,550000,NAICS_2012_Code,551112, +BEA_Detail_Make_AfterRedef,550000,NAICS_2012_Code,551114, +BEA_Detail_Make_AfterRedef,561100,NAICS_2012_Code,561110, +BEA_Detail_Make_AfterRedef,561200,NAICS_2012_Code,561210, +BEA_Detail_Make_AfterRedef,561300,NAICS_2012_Code,561311, +BEA_Detail_Make_AfterRedef,561300,NAICS_2012_Code,561312, +BEA_Detail_Make_AfterRedef,561300,NAICS_2012_Code,561320, +BEA_Detail_Make_AfterRedef,561300,NAICS_2012_Code,561330, +BEA_Detail_Make_AfterRedef,561400,NAICS_2012_Code,561410, +BEA_Detail_Make_AfterRedef,561400,NAICS_2012_Code,561421, +BEA_Detail_Make_AfterRedef,561400,NAICS_2012_Code,561422, +BEA_Detail_Make_AfterRedef,561400,NAICS_2012_Code,561431, +BEA_Detail_Make_AfterRedef,561400,NAICS_2012_Code,561439, +BEA_Detail_Make_AfterRedef,561400,NAICS_2012_Code,561440, +BEA_Detail_Make_AfterRedef,561400,NAICS_2012_Code,561450, +BEA_Detail_Make_AfterRedef,561400,NAICS_2012_Code,561491, +BEA_Detail_Make_AfterRedef,561400,NAICS_2012_Code,561492, +BEA_Detail_Make_AfterRedef,561400,NAICS_2012_Code,561499, +BEA_Detail_Make_AfterRedef,561500,NAICS_2012_Code,561510, +BEA_Detail_Make_AfterRedef,561500,NAICS_2012_Code,561520, +BEA_Detail_Make_AfterRedef,561500,NAICS_2012_Code,561591, +BEA_Detail_Make_AfterRedef,561500,NAICS_2012_Code,561599, +BEA_Detail_Make_AfterRedef,561600,NAICS_2012_Code,561611, +BEA_Detail_Make_AfterRedef,561600,NAICS_2012_Code,561612, +BEA_Detail_Make_AfterRedef,561600,NAICS_2012_Code,561613, +BEA_Detail_Make_AfterRedef,561600,NAICS_2012_Code,561621, +BEA_Detail_Make_AfterRedef,561600,NAICS_2012_Code,561622, +BEA_Detail_Make_AfterRedef,561700,NAICS_2012_Code,561710, +BEA_Detail_Make_AfterRedef,561700,NAICS_2012_Code,561720, +BEA_Detail_Make_AfterRedef,561700,NAICS_2012_Code,561730, +BEA_Detail_Make_AfterRedef,561700,NAICS_2012_Code,561740, +BEA_Detail_Make_AfterRedef,561700,NAICS_2012_Code,561790, +BEA_Detail_Make_AfterRedef,561900,NAICS_2012_Code,561910, +BEA_Detail_Make_AfterRedef,561900,NAICS_2012_Code,561920, +BEA_Detail_Make_AfterRedef,561900,NAICS_2012_Code,561990, +BEA_Detail_Make_AfterRedef,562000,NAICS_2012_Code,562111, +BEA_Detail_Make_AfterRedef,562000,NAICS_2012_Code,562112, +BEA_Detail_Make_AfterRedef,562000,NAICS_2012_Code,562119, +BEA_Detail_Make_AfterRedef,562000,NAICS_2012_Code,562211, +BEA_Detail_Make_AfterRedef,562000,NAICS_2012_Code,562212, +BEA_Detail_Make_AfterRedef,562000,NAICS_2012_Code,562213, +BEA_Detail_Make_AfterRedef,562000,NAICS_2012_Code,562219, +BEA_Detail_Make_AfterRedef,562000,NAICS_2012_Code,562910, +BEA_Detail_Make_AfterRedef,562000,NAICS_2012_Code,562920, +BEA_Detail_Make_AfterRedef,562000,NAICS_2012_Code,562991, +BEA_Detail_Make_AfterRedef,562000,NAICS_2012_Code,562998, +BEA_Detail_Make_AfterRedef,611100,NAICS_2012_Code,611110, +BEA_Detail_Make_AfterRedef,611A00,NAICS_2012_Code,611210, +BEA_Detail_Make_AfterRedef,611A00,NAICS_2012_Code,611310, +BEA_Detail_Make_AfterRedef,611B00,NAICS_2012_Code,611410, +BEA_Detail_Make_AfterRedef,611B00,NAICS_2012_Code,611420, +BEA_Detail_Make_AfterRedef,611B00,NAICS_2012_Code,611430, +BEA_Detail_Make_AfterRedef,611B00,NAICS_2012_Code,611511, +BEA_Detail_Make_AfterRedef,611B00,NAICS_2012_Code,611512, +BEA_Detail_Make_AfterRedef,611B00,NAICS_2012_Code,611513, +BEA_Detail_Make_AfterRedef,611B00,NAICS_2012_Code,611519, +BEA_Detail_Make_AfterRedef,611B00,NAICS_2012_Code,611610, +BEA_Detail_Make_AfterRedef,611B00,NAICS_2012_Code,611620, +BEA_Detail_Make_AfterRedef,611B00,NAICS_2012_Code,611630, +BEA_Detail_Make_AfterRedef,611B00,NAICS_2012_Code,611691, +BEA_Detail_Make_AfterRedef,611B00,NAICS_2012_Code,611692, +BEA_Detail_Make_AfterRedef,611B00,NAICS_2012_Code,611699, +BEA_Detail_Make_AfterRedef,611B00,NAICS_2012_Code,611710, +BEA_Detail_Make_AfterRedef,621600,NAICS_2012_Code,621610, +BEA_Detail_Make_AfterRedef,622000,NAICS_2012_Code,622110, +BEA_Detail_Make_AfterRedef,622000,NAICS_2012_Code,622210, +BEA_Detail_Make_AfterRedef,622000,NAICS_2012_Code,622310, +BEA_Detail_Make_AfterRedef,624A00,NAICS_2012_Code,624210, +BEA_Detail_Make_AfterRedef,624A00,NAICS_2012_Code,624221, +BEA_Detail_Make_AfterRedef,624A00,NAICS_2012_Code,624229, +BEA_Detail_Make_AfterRedef,624A00,NAICS_2012_Code,624230, +BEA_Detail_Make_AfterRedef,624A00,NAICS_2012_Code,624310, +BEA_Detail_Make_AfterRedef,624400,NAICS_2012_Code,624410, +BEA_Detail_Make_AfterRedef,711100,NAICS_2012_Code,711110, +BEA_Detail_Make_AfterRedef,711100,NAICS_2012_Code,711120, +BEA_Detail_Make_AfterRedef,711100,NAICS_2012_Code,711130, +BEA_Detail_Make_AfterRedef,711100,NAICS_2012_Code,711190, +BEA_Detail_Make_AfterRedef,711200,NAICS_2012_Code,711211, +BEA_Detail_Make_AfterRedef,711200,NAICS_2012_Code,711212, +BEA_Detail_Make_AfterRedef,711200,NAICS_2012_Code,711219, +BEA_Detail_Make_AfterRedef,711A00,NAICS_2012_Code,711310, +BEA_Detail_Make_AfterRedef,711A00,NAICS_2012_Code,711320, +BEA_Detail_Make_AfterRedef,711A00,NAICS_2012_Code,711410, +BEA_Detail_Make_AfterRedef,711500,NAICS_2012_Code,711510, +BEA_Detail_Make_AfterRedef,712000,NAICS_2012_Code,712110, +BEA_Detail_Make_AfterRedef,712000,NAICS_2012_Code,712120, +BEA_Detail_Make_AfterRedef,712000,NAICS_2012_Code,712130, +BEA_Detail_Make_AfterRedef,712000,NAICS_2012_Code,712190, +BEA_Detail_Make_AfterRedef,811200,NAICS_2012_Code,811211, +BEA_Detail_Make_AfterRedef,811200,NAICS_2012_Code,811212, +BEA_Detail_Make_AfterRedef,811200,NAICS_2012_Code,811213, +BEA_Detail_Make_AfterRedef,811200,NAICS_2012_Code,811219, +BEA_Detail_Make_AfterRedef,811300,NAICS_2012_Code,811310, +BEA_Detail_Make_AfterRedef,811400,NAICS_2012_Code,811411, +BEA_Detail_Make_AfterRedef,811400,NAICS_2012_Code,811412, +BEA_Detail_Make_AfterRedef,811400,NAICS_2012_Code,811420, +BEA_Detail_Make_AfterRedef,811400,NAICS_2012_Code,811430, +BEA_Detail_Make_AfterRedef,811400,NAICS_2012_Code,811490, +BEA_Detail_Make_AfterRedef,812100,NAICS_2012_Code,812111, +BEA_Detail_Make_AfterRedef,812100,NAICS_2012_Code,812112, +BEA_Detail_Make_AfterRedef,812100,NAICS_2012_Code,812113, +BEA_Detail_Make_AfterRedef,812100,NAICS_2012_Code,812191, +BEA_Detail_Make_AfterRedef,812100,NAICS_2012_Code,812199, +BEA_Detail_Make_AfterRedef,812200,NAICS_2012_Code,812210, +BEA_Detail_Make_AfterRedef,812200,NAICS_2012_Code,812220, +BEA_Detail_Make_AfterRedef,812300,NAICS_2012_Code,812310, +BEA_Detail_Make_AfterRedef,812300,NAICS_2012_Code,812320, +BEA_Detail_Make_AfterRedef,812300,NAICS_2012_Code,812331, +BEA_Detail_Make_AfterRedef,812300,NAICS_2012_Code,812332, +BEA_Detail_Make_AfterRedef,812900,NAICS_2012_Code,812910, +BEA_Detail_Make_AfterRedef,812900,NAICS_2012_Code,812921, +BEA_Detail_Make_AfterRedef,812900,NAICS_2012_Code,812922, +BEA_Detail_Make_AfterRedef,812900,NAICS_2012_Code,812930, +BEA_Detail_Make_AfterRedef,812900,NAICS_2012_Code,812990, +BEA_Detail_Make_AfterRedef,813100,NAICS_2012_Code,813110, +BEA_Detail_Make_AfterRedef,813A00,NAICS_2012_Code,813211, +BEA_Detail_Make_AfterRedef,813A00,NAICS_2012_Code,813212, +BEA_Detail_Make_AfterRedef,813A00,NAICS_2012_Code,813219, +BEA_Detail_Make_AfterRedef,813A00,NAICS_2012_Code,813311, +BEA_Detail_Make_AfterRedef,813A00,NAICS_2012_Code,813312, +BEA_Detail_Make_AfterRedef,813A00,NAICS_2012_Code,813319, +BEA_Detail_Make_AfterRedef,813B00,NAICS_2012_Code,813410, +BEA_Detail_Make_AfterRedef,813B00,NAICS_2012_Code,813910, +BEA_Detail_Make_AfterRedef,813B00,NAICS_2012_Code,813920, +BEA_Detail_Make_AfterRedef,813B00,NAICS_2012_Code,813930, +BEA_Detail_Make_AfterRedef,813B00,NAICS_2012_Code,813940, +BEA_Detail_Make_AfterRedef,813B00,NAICS_2012_Code,813990, +BEA_Detail_Make_AfterRedef,814000,NAICS_2012_Code,814110, +BEA_Detail_Make_AfterRedef,S00600,NAICS_2012_Code,921110, +BEA_Detail_Make_AfterRedef,S00600,NAICS_2012_Code,921120, +BEA_Detail_Make_AfterRedef,S00600,NAICS_2012_Code,921130, +BEA_Detail_Make_AfterRedef,S00600,NAICS_2012_Code,921140, +BEA_Detail_Make_AfterRedef,S00600,NAICS_2012_Code,921190, +BEA_Detail_Make_AfterRedef,S00600,NAICS_2012_Code,922110, +BEA_Detail_Make_AfterRedef,S00600,NAICS_2012_Code,922120, +BEA_Detail_Make_AfterRedef,S00600,NAICS_2012_Code,922130, +BEA_Detail_Make_AfterRedef,S00600,NAICS_2012_Code,922140, +BEA_Detail_Make_AfterRedef,S00600,NAICS_2012_Code,922150, +BEA_Detail_Make_AfterRedef,S00600,NAICS_2012_Code,922160, +BEA_Detail_Make_AfterRedef,S00600,NAICS_2012_Code,922190, +BEA_Detail_Make_AfterRedef,S00600,NAICS_2012_Code,923110, +BEA_Detail_Make_AfterRedef,S00600,NAICS_2012_Code,923120, +BEA_Detail_Make_AfterRedef,S00600,NAICS_2012_Code,923130, +BEA_Detail_Make_AfterRedef,S00600,NAICS_2012_Code,923140, +BEA_Detail_Make_AfterRedef,S00600,NAICS_2012_Code,924110, +BEA_Detail_Make_AfterRedef,S00600,NAICS_2012_Code,924120, +BEA_Detail_Make_AfterRedef,S00600,NAICS_2012_Code,925110, +BEA_Detail_Make_AfterRedef,S00600,NAICS_2012_Code,925120, +BEA_Detail_Make_AfterRedef,S00600,NAICS_2012_Code,926110, +BEA_Detail_Make_AfterRedef,S00600,NAICS_2012_Code,926130, +BEA_Detail_Make_AfterRedef,S00600,NAICS_2012_Code,926140, +BEA_Detail_Make_AfterRedef,S00600,NAICS_2012_Code,926150, +BEA_Detail_Make_AfterRedef,S00102,NAICS_2012_Code,927110, +BEA_Detail_Make_AfterRedef,S00500,NAICS_2012_Code,928110, +BEA_Detail_Make_AfterRedef,S00600,NAICS_2012_Code,928120, +BEA_Detail_Make_AfterRedef,S00101,NAICS_2012_Code,S00101, +BEA_Detail_Make_AfterRedef,S00201,NAICS_2012_Code,S00201, +BEA_Detail_Make_AfterRedef,S00202,NAICS_2012_Code,S00202, diff --git a/flowsa/data/external_data/BEA_GDP_GrossOutput_IO.csv b/flowsa/data/external_data/BEA_Detail_GrossOutput_IO.csv similarity index 100% rename from flowsa/data/external_data/BEA_GDP_GrossOutput_IO.csv rename to flowsa/data/external_data/BEA_Detail_GrossOutput_IO.csv diff --git a/flowsa/data/external_data/BEA_2002_Make_AfterRedef.csv b/flowsa/data/external_data/BEA_Detail_Make_2002_AfterRedef.csv similarity index 100% rename from flowsa/data/external_data/BEA_2002_Make_AfterRedef.csv rename to flowsa/data/external_data/BEA_Detail_Make_2002_AfterRedef.csv diff --git a/flowsa/data/external_data/BEA_2012_Detail_Make_BeforeRedef.csv b/flowsa/data/external_data/BEA_Detail_Make_2012_BeforeRedef.csv similarity index 100% rename from flowsa/data/external_data/BEA_2012_Detail_Make_BeforeRedef.csv rename to flowsa/data/external_data/BEA_Detail_Make_2012_BeforeRedef.csv diff --git a/flowsa/data/external_data/BEA_2012_Detail_Use_PRO_BeforeRedef.csv b/flowsa/data/external_data/BEA_Detail_Use_2012_PRO_BeforeRedef.csv similarity index 100% rename from flowsa/data/external_data/BEA_2012_Detail_Use_PRO_BeforeRedef.csv rename to flowsa/data/external_data/BEA_Detail_Use_2012_PRO_BeforeRedef.csv diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 8d0201c49..ab89ff687 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -1,16 +1,16 @@ -BEA_GDP_GrossOutput: +BEA_Detail_GDP_GrossOutput: data_format: FBA class: - Money activity_schema: BEA_2012_Detail_Code sector_hierarchy: "flat" -BEA_Make_AR: +BEA_Detail_Make_AfterRedef: data_format: FBA class: - Money activity_schema: BEA_2012_Detail_Code sector_hierarchy: "flat" -BEA_Make_Detail_BeforeRedef: +BEA_Detail_Make_BeforeRedef: data_format: FBA class: - Money @@ -22,7 +22,7 @@ BEA_Marine_Bunker_Fuel: - Energy activity_schema: None sector_hierarchy: "flat" -BEA_Use_Detail_PRO_BeforeRedef: +BEA_Detail_Use_PRO_BeforeRedef: data_format: FBA class: - Money diff --git a/flowsa/data_source_scripts/StatCan_IWS_MI.py b/flowsa/data_source_scripts/StatCan_IWS_MI.py index be8f63ae4..9a3c42d3f 100644 --- a/flowsa/data_source_scripts/StatCan_IWS_MI.py +++ b/flowsa/data_source_scripts/StatCan_IWS_MI.py @@ -145,7 +145,8 @@ def convert_statcan_data_to_US_water_use(df, attr, download_FBA_if_missing): # load us gdp # load Canadian GDP data us_gdp_load = load_fba_w_standardized_units( - datasource='BEA_GDP_GrossOutput', year=attr['allocation_source_year'], + datasource='BEA_Detail_GrossOutput_IO', year=attr[ + 'allocation_source_year'], flowclass='Money', download_FBA_if_missing=download_FBA_if_missing) # load bea crosswalk diff --git a/flowsa/methods/flowbyactivitymethods/BEA_Detail_GrossOutput_IO.yaml b/flowsa/methods/flowbyactivitymethods/BEA_Detail_GrossOutput_IO.yaml new file mode 100644 index 000000000..60701160a --- /dev/null +++ b/flowsa/methods/flowbyactivitymethods/BEA_Detail_GrossOutput_IO.yaml @@ -0,0 +1,28 @@ +author: U.S. Bureau of Economic Analysis +source_name: Gross Output by Industry - Detail +source_url: https://www.bea.gov/data/industries/gross-output-by-industry +original_data_download_date: 2022-08-11 +bib_id: BEA_GDP +format: csv +url: None +parse_response_fxn: !script_function:BEA bea_parse +years: + - 2002 + - 2003 + - 2004 + - 2005 + - 2006 + - 2007 + - 2008 + - 2009 + - 2010 + - 2011 + - 2012 + - 2013 + - 2014 + - 2015 + - 2016 + - 2017 + - 2018 + - 2019 + - 2020 \ No newline at end of file diff --git a/flowsa/methods/flowbyactivitymethods/BEA_Detail_Make_AfterRedef.yaml b/flowsa/methods/flowbyactivitymethods/BEA_Detail_Make_AfterRedef.yaml new file mode 100644 index 000000000..faa53434d --- /dev/null +++ b/flowsa/methods/flowbyactivitymethods/BEA_Detail_Make_AfterRedef.yaml @@ -0,0 +1,10 @@ +author: U.S. Bureau of Economic Analysis +source_name: BEA_Detail_Make_AfterRedef +source_url: 'https://www.bea.gov/industry/input-output-accounts-data' +original_data_download_date: '2021-06-15' +bib_id: BEA_Detail_Make_AfterRedef +format: csv +url: None +parse_response_fxn: !script_function:BEA bea_parse +years: + - 2002 diff --git a/flowsa/methods/flowbyactivitymethods/BEA_Make_Detail_BeforeRedef.yaml b/flowsa/methods/flowbyactivitymethods/BEA_Detail_Make_BeforeRedef.yaml similarity index 70% rename from flowsa/methods/flowbyactivitymethods/BEA_Make_Detail_BeforeRedef.yaml rename to flowsa/methods/flowbyactivitymethods/BEA_Detail_Make_BeforeRedef.yaml index aead737c9..6b0df3d8e 100644 --- a/flowsa/methods/flowbyactivitymethods/BEA_Make_Detail_BeforeRedef.yaml +++ b/flowsa/methods/flowbyactivitymethods/BEA_Detail_Make_BeforeRedef.yaml @@ -3,10 +3,8 @@ source_name: Make Table Before Redefinitions source_url: 'https://www.bea.gov/industry/input-output-accounts-data' original_data_download_date: '2022-08-11' bib_id: BEA_Make_BR -api_name: None -api_key_required: false format: csv # comma delineated data url: None -parse_response_fxn: !script_function:BEA bea_make_detail_br_parse +parse_response_fxn: !script_function:BEA bea_parse years: -- 2012 + - 2012 diff --git a/flowsa/methods/flowbyactivitymethods/BEA_Use_Detail_PRO_BeforeRedef.yaml b/flowsa/methods/flowbyactivitymethods/BEA_Detail_Use_PRO_BeforeRedef.yaml similarity index 62% rename from flowsa/methods/flowbyactivitymethods/BEA_Use_Detail_PRO_BeforeRedef.yaml rename to flowsa/methods/flowbyactivitymethods/BEA_Detail_Use_PRO_BeforeRedef.yaml index 06564fc0e..2726bf257 100644 --- a/flowsa/methods/flowbyactivitymethods/BEA_Use_Detail_PRO_BeforeRedef.yaml +++ b/flowsa/methods/flowbyactivitymethods/BEA_Detail_Use_PRO_BeforeRedef.yaml @@ -3,10 +3,8 @@ source_name: Use Before Redefinitions Producer's Prices source_url: 'https://www.bea.gov/industry/input-output-accounts-data' original_data_download_date: '2022-08-11' bib_id: BEA_Use_BR -api_name: None -api_key_required: false -format: csv # comma delineated data +format: csv url: None -parse_response_fxn: !script_function:BEA bea_use_detail_br_parse +parse_response_fxn: !script_function:BEA bea_parse years: -- 2012 + - 2012 diff --git a/flowsa/methods/flowbyactivitymethods/BEA_GDP_GrossOutput.yaml b/flowsa/methods/flowbyactivitymethods/BEA_GDP_GrossOutput.yaml deleted file mode 100644 index 2ae271d73..000000000 --- a/flowsa/methods/flowbyactivitymethods/BEA_GDP_GrossOutput.yaml +++ /dev/null @@ -1,25 +0,0 @@ -author: U.S. Bureau of Economic Analysis -source_name: Gross Output by Industry - Detail -source_url: 'https://www.bea.gov/data/industries/gross-output-by-industry' -original_data_download_date: '2022-08-11' -bib_id: BEA_GDP -api_name: None -api_key_required: false -format: csv # comma delineated data -url: None -parse_response_fxn: !script_function:BEA bea_gdp_parse -years: -- 2007 -- 2008 -- 2009 -- 2010 -- 2011 -- 2012 -- 2013 -- 2014 -- 2015 -- 2016 -- 2017 -- 2018 -- 2019 -- 2020 diff --git a/flowsa/methods/flowbyactivitymethods/BEA_Make_AR.yaml b/flowsa/methods/flowbyactivitymethods/BEA_Make_AR.yaml deleted file mode 100644 index 9842ccda0..000000000 --- a/flowsa/methods/flowbyactivitymethods/BEA_Make_AR.yaml +++ /dev/null @@ -1,12 +0,0 @@ -author: BEA -source_name: BEA_Make_AR -source_url: 'https://www.bea.gov/industry/input-output-accounts-data' -original_data_download_date: '2021-06-15' -bib_id: BEA_Make_AR -api_name: None -api_key_required: false -format: csv # comma delineated data -url: None -parse_response_fxn: !script_function:BEA bea_make_ar_parse -years: -- 2002 diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml index a3fb54a5b..6fc9c08fc 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml @@ -187,7 +187,7 @@ source_names: PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv mobile_and_fuel_storage attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'324110': ''} # Petroleum @@ -197,7 +197,7 @@ source_names: PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv fertilizers attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'325310': ''} # Fertilizers @@ -218,7 +218,7 @@ source_names: - Trifluralin attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'325320': ''} # Pesticides @@ -228,7 +228,7 @@ source_names: PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv output_allocation attribution_method: proportional # attribution_source: # document in primary method file - # BEA_GDP_GrossOutput: + # BEA_Detail_GrossOutput_IO: # year: 2017 # geoscale: national # activity_to_sector_mapping: BEA_2012_Detail @@ -269,7 +269,7 @@ source_names: PrimaryActivity: !from_index:NEI_Nonroad_asets.csv offroad_vehicles_equipment attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'324110': ''} # Petroleum @@ -301,7 +301,7 @@ source_names: PrimaryActivity: !from_index:NEI_Onroad_asets.csv onroad_vehicles_gas_stations attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'324110': ''} # Petroleum diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m1.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m1.yaml index 011bcc8fa..609a0eab3 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m1.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m1.yaml @@ -28,7 +28,7 @@ source_names: PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv output_allocation attribution_method: proportional attribution_source: - BEA_GDP_GrossOutput: + BEA_Detail_GrossOutput_IO: year: 2017 geoscale: national activity_to_sector_mapping: BEA_2012_Detail diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2020_m1.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2020_m1.yaml index b31f7925c..b1b5d826e 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2020_m1.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2020_m1.yaml @@ -28,7 +28,7 @@ source_names: PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv output_allocation attribution_method: proportional attribution_source: - BEA_GDP_GrossOutput: + BEA_Detail_GrossOutput_IO: year: 2020 geoscale: national activity_to_sector_mapping: BEA_2012_Detail diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml index b59265480..13ed4b1c3 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml @@ -40,7 +40,7 @@ attribution_sources: estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy attribution_method: proportional # attribution_source: # Include in main method - # BEA_Use_Detail_PRO_BeforeRedef: + # BEA_Detail_Use_PRO_BeforeRedef: # <<: *bea # selection_fields: # ActivityProducedBy: {'XXXXX': ''} @@ -129,7 +129,7 @@ source_names: PrimaryActivity: Liming #CO2 attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea # primary_action_type: Consumed selection_fields: @@ -142,7 +142,7 @@ source_names: - Urea Consumption for Non-Agricultural Purposes #CO2 attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea # primary_action_type: Consumed selection_fields: @@ -153,7 +153,7 @@ source_names: PrimaryActivity: Other Process Uses of Carbonates #CO2 attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea # primary_action_type: Consumed selection_fields: @@ -176,7 +176,7 @@ source_names: PrimaryActivity: N2O from Product Uses #N2O attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'325120': ''} # Industrial gases @@ -254,7 +254,7 @@ source_names: - Synthetic Fertilizer Cropland attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'325310': ''} # Fertilizers @@ -329,7 +329,7 @@ source_names: Light-Duty Trucks Gasoline: Light-Duty Trucks attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'324110': ''} # purchases of refinery products @@ -368,7 +368,7 @@ source_names: Medium- and Heavy-Duty Trucks Diesel On-Road: Medium- and Heavy-Duty Trucks - Distillate Fuel Oil attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'324110': ''} # purchases of refinery products @@ -380,7 +380,7 @@ source_names: Light-Duty Trucks Gasoline On-Road: Light-Duty Trucks attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'324110': ''} # purchases of refinery products @@ -390,7 +390,7 @@ source_names: PrimaryActivity: Construction/Mining Equipment Non-Road attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment @@ -400,7 +400,7 @@ source_names: PrimaryActivity: Agricultural Equipment Non-Road attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'333111': ''} # purchases of farm machinery @@ -410,7 +410,7 @@ source_names: PrimaryActivity: Other Non-Road attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'324110': ''} # purchases of refinery products @@ -421,7 +421,7 @@ source_names: All activities Alternative Fuel On-Road: Alternative Fuel On-Road attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'221200': ''} # purchases of natural gas @@ -451,7 +451,7 @@ source_names: Industrial Other Coal Industrial: Coal Industrial attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'212100': ''} # purchases of coal @@ -463,7 +463,7 @@ source_names: - Natural Gas Industrial attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'221200': ''} # purchases of natural gas @@ -482,7 +482,7 @@ source_names: - Coal - Coke and Breeze attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'212100': ''} # purchases of coal @@ -499,7 +499,7 @@ source_names: <<: *mecs_energy_default_selection FlowName: Natural Gas attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'221200': ''} # purchases of natural gas @@ -511,7 +511,7 @@ source_names: - Total Petroleum Industrial attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'324110': ''} # purchases of refinery products @@ -557,7 +557,7 @@ source_names: - Fuel Oil Industrial attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'324110': ''} # purchases of refinery products @@ -571,7 +571,7 @@ source_names: Natural Gas Industrial: Natural Gas Industrial attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'221200': ''} # purchases of natural gas @@ -581,7 +581,7 @@ source_names: PrimaryActivity: Coal Industrial attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'212100': ''} # purchases of coal @@ -597,7 +597,7 @@ source_names: <<: *mecs_energy_default_selection FlowName: Coal attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'212100': ''} # purchases of coal @@ -615,7 +615,7 @@ source_names: <<: *mecs_energy_default_selection FlowName: Natural Gas attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'221200': ''} # purchases of natural gas @@ -679,7 +679,7 @@ source_names: - Distillate Fuel Oil - Hydrocarbon Gas Liquids, excluding natural gasoline attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'324110': ''} # purchases of refineries @@ -696,7 +696,7 @@ source_names: FlowName: Natural Gas Unit: Trillion Btu attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'221200': ''} # purchases of natural gas @@ -706,7 +706,7 @@ source_names: PrimaryActivity: Transportation Lubricants attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'324110': ''} # use of petroleum products @@ -749,7 +749,7 @@ source_names: - Industrial Process Refrigeration attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'333415': ''} # Air conditioning equipment @@ -760,7 +760,7 @@ source_names: - Commercial Stationary Air Conditioning attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'333415': ''} # Air conditioning equipment @@ -771,7 +771,7 @@ source_names: - Foams attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: diff --git a/flowsa/sectormapping.py b/flowsa/sectormapping.py index 41f39a199..f72b3f7f8 100644 --- a/flowsa/sectormapping.py +++ b/flowsa/sectormapping.py @@ -231,7 +231,7 @@ def get_BEA_industry_output(region, io_level, year): if io_level == 'detail': raise TypeError ('detail models not available for states') elif region == 'national': - fba = 'BEA_GDP_GrossOutput' + fba = 'BEA_Detail_GrossOutput_IO' # Get output by BEA sector bea = flowsa.getFlowByActivity(fba, year) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_Make_Table.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_Make_Table.py index e35473aca..96654f840 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_Make_Table.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_Make_Table.py @@ -36,7 +36,7 @@ def assign_naics(df_load): # select years to pull unique activity names year = '2002' # datasource - datasource = 'BEA_Make_AR' + datasource = 'BEA_Detail_Make_AfterRedef' # df of unique ers activity names df = unique_activity_names(datasource, year) # add manual naics 2012 assignments diff --git a/scripts/write_BEA_Use_from_useeior.py b/scripts/write_BEA_Use_from_useeior.py index 0ef30c2af..57dd91633 100644 --- a/scripts/write_BEA_Use_from_useeior.py +++ b/scripts/write_BEA_Use_from_useeior.py @@ -10,7 +10,7 @@ --- -The BEA_2012_Detail_Use_PRO_BeforeRedef was pulled from +The BEA_Detail_Use_PRO_BeforeRedef was pulled from USEEIOR's Detail_Use_2012_PRO_BeforeRedef.rda on 08/11/2022. The original file is found here: @@ -18,7 +18,7 @@ csv obtained by running the following code in Rstudio: bea <- get('Detail_Use_2012_PRO_BeforeRedef') -write.csv(bea, file='BEA_2012_Detail_Use_PRO_BeforeRedef.csv') +write.csv(bea, file='BEA_Detail_Use_2012_PRO_BeforeRedef.csv') CSV manually added to flowsa @@ -32,7 +32,7 @@ csv obtained by running the following code in Rstudio: bea <- get('Detail_Make_2012_BeforeRedef') -write.csv(bea, file='BEA_2012_Detail_Make_BeforeRedef.csv') +write.csv(bea, file='BEA_Detail_Make_2012_BeforeRedef.csv') CSV manually added to flowsa @@ -49,7 +49,7 @@ csv obtained by running the following code in Rstudio: bea <- get('Detail_GrossOutput_IO') -write.csv(bea, file='BEA_GDP_GrossOutput_IO.csv') +write.csv(bea, file='BEA_Detail_GrossOutput_IO.csv') https://github.com/USEPA/useeior/commit/2eece7a "date_last_modified": ["2021-10-04"], From 030503e1cca60090d3cddc95b77705dbe6a7da76 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 6 Sep 2023 15:31:06 -0600 Subject: [PATCH 0929/1127] add bea summary level make and use tables and condense bea parse fxn --- flowsa/data_source_scripts/BEA.py | 166 +++++------------- .../BEA_Summary_Make_BeforeRedef.yaml | 19 ++ .../BEA_Summary_Use_PRO_BeforeRedef.yaml | 19 ++ 3 files changed, 85 insertions(+), 119 deletions(-) create mode 100644 flowsa/methods/flowbyactivitymethods/BEA_Summary_Make_BeforeRedef.yaml create mode 100644 flowsa/methods/flowbyactivitymethods/BEA_Summary_Use_PRO_BeforeRedef.yaml diff --git a/flowsa/data_source_scripts/BEA.py b/flowsa/data_source_scripts/BEA.py index d526ff1ef..5b99c4191 100644 --- a/flowsa/data_source_scripts/BEA.py +++ b/flowsa/data_source_scripts/BEA.py @@ -12,138 +12,66 @@ import pandas as pd from flowsa.location import US_FIPS -from flowsa.common import fbs_activity_fields -from flowsa.schema import activity_fields from flowsa.settings import externaldatapath from flowsa.flowbyfunctions import assign_fips_location_system, aggregator - -def bea_gdp_parse(*, year, **_): - """ - Combine, parse, and format the provided dataframes - :param year: year - :return: df, parsed and partially formatted to flowbyactivity - specifications - """ - # Read directly into a pandas df - df_raw = pd.read_csv(f"{externaldatapath}/BEA_GDP_GrossOutput_IO.csv") - - df = df_raw.rename(columns={'Unnamed: 0': 'ActivityProducedBy'}) - - # use "melt" fxn to convert colummns into rows - df = df.melt(id_vars=["ActivityProducedBy"], - var_name="Year", - value_name="FlowAmount") - - df = df[df['Year'] == year] - # hardcode data - df["Class"] = "Money" - df["FlowType"] = "TECHNOSPHERE_FLOW" - df['Description'] = 'BEA_2012_Detail_Code' - df['FlowName'] = 'Gross Output' - df["SourceName"] = "BEA_GDP_GrossOutput" - df["Location"] = US_FIPS - # original unit in million USD - df['FlowAmount'] = df['FlowAmount'] * 1000000 - # state FIPS codes have not changed over last decade - df['LocationSystem'] = "FIPS_2015" - df["Unit"] = "USD" - df['DataReliability'] = 5 # tmp - df['DataCollection'] = 5 # tmp - - return df - - -def bea_use_detail_br_parse(*, year, **_): +def bea_parse(*, source, year, **_): """ - Combine, parse, and format the provided dataframes - :param year: year) - :return: df, parsed and partially formatted to - flowbyactivity specifications + Parse BEA data for GrossOutput, Make, and Use tables + :param source: + :param year: + :return: """ - csv_load = (f"{externaldatapath}/BEA_{str(year)}" - f"_Detail_Use_PRO_BeforeRedef.csv") - df_raw = pd.read_csv(csv_load) - - df = bea_detail_parse(df_raw, year) - df["SourceName"] = "BEA_Use_Detail_PRO_BeforeRedef" - - return df - - -def bea_make_detail_br_parse(*, year, **_): - """ - Combine, parse, and format the provided dataframes - :param year: year - :return: df, parsed and partially formatted to - flowbyactivity specifications - """ - # Read directly into a pandas df - csv_load = (f"{externaldatapath}/BEA_{str(year)}" - f"_Detail_Make_BeforeRedef.csv") - df_raw = pd.read_csv(csv_load) - - df = bea_detail_parse(df_raw, year) - df["SourceName"] = "BEA_Make_Detail_BeforeRedef" - - return df - - -def bea_detail_parse(df_raw, year): - df = df_raw.rename(columns={'Unnamed: 0': 'ActivityProducedBy'}) - - # use "melt" fxn to convert colummns into rows - df = df.melt(id_vars=["ActivityProducedBy"], - var_name="ActivityConsumedBy", - value_name="FlowAmount") + if 'Make' in source: + filename = source.replace('_Make_', f'_Make_{year}_') + elif 'Use' in source: + filename = source.replace('_Use_', f'_Use_{year}_') + else: + filename = source + + df = pd.read_csv(externaldatapath / f"{filename}.csv") + + if 'BeforeRedef' in source: + df = df.rename(columns={'Unnamed: 0': 'ActivityProducedBy'}) + # use "melt" fxn to convert colummns into rows + df = df.melt(id_vars=["ActivityProducedBy"], + var_name="ActivityConsumedBy", + value_name="FlowAmount") + elif '_Make_AfterRedef' in source: + # strip whitespace + for c in list(df.select_dtypes(include=['object']).columns): + df[c] = df[c].apply(lambda x: x.strip()) + # drop rows of data + df = df[df['Industry'] == df['Commodity']].reset_index(drop=True) + # drop columns + df = df.drop(columns=['Commodity', 'CommodityDescription']) + # rename columns + df = df.rename(columns={'Industry': 'ActivityProducedBy', + 'IndustryDescription': 'Description', + 'ProVal': 'FlowAmount', + 'IOYear': 'Year'}) + elif 'GrossOutput' in source: + df = df.rename(columns={'Unnamed: 0': 'ActivityProducedBy'}) + df = df.melt(id_vars=["ActivityProducedBy"], + var_name="Year", + value_name="FlowAmount") + df = df[df['Year'] == year] + + df = df.reset_index(drop=True) + + # columns relevant to all BEA data + df["SourceName"] = source df['Year'] = str(year) - # hardcode data df['FlowName'] = f"USD{str(year)}" df["Class"] = "Money" df["FlowType"] = "TECHNOSPHERE_FLOW" - df['Description'] = 'BEA_2012_Detail_Code' df["Location"] = US_FIPS - df['LocationSystem'] = "FIPS_2015" - # original unit in million USD - df['FlowAmount'] = df['FlowAmount'] * 1000000 - df["Unit"] = "USD" - df['DataReliability'] = 5 # tmp - df['DataCollection'] = 5 # tmp - return df - - -def bea_make_ar_parse(*, year, **_): - """ - Combine, parse, and format the provided dataframes - :param dataframe_list: list of dataframes to concat and format - :param args: dictionary, used to run generateflowbyactivity.py - ('year' and 'source') - :return: df, parsed and partially formatted to - flowbyactivity specifications - """ - df_load = pd.read_csv(f"{externaldatapath}/BEA" - f"_{year}_Make_AfterRedef.csv", dtype="str") - # strip whitespace - df = df_load.apply(lambda x: x.str.strip()) - # drop rows of data - df = df[df['Industry'] == df['Commodity']].reset_index(drop=True) - # drop columns - df = df.drop(columns=['Commodity', 'CommodityDescription']) - # rename columns - df = df.rename(columns={'Industry': 'ActivityProducedBy', - 'IndustryDescription': 'Description', - 'ProVal': 'FlowAmount', - 'IOYear': 'Year'}) - df.loc[:, 'FlowAmount'] = df['FlowAmount'].astype(float) * 1000000 - # hard code data - df['Class'] = 'Money' - df['SourceName'] = 'BEA_Make_AR' - df['Unit'] = 'USD' - df['Location'] = US_FIPS df = assign_fips_location_system(df, year) - df['FlowName'] = 'Gross Output Producer Value After Redef' + df['FlowAmount'] = df['FlowAmount'] + df["Unit"] = "Million USD" df['DataReliability'] = 5 # tmp df['DataCollection'] = 5 # tmp + df['Description'] = filename return df diff --git a/flowsa/methods/flowbyactivitymethods/BEA_Summary_Make_BeforeRedef.yaml b/flowsa/methods/flowbyactivitymethods/BEA_Summary_Make_BeforeRedef.yaml new file mode 100644 index 000000000..69bdc4d41 --- /dev/null +++ b/flowsa/methods/flowbyactivitymethods/BEA_Summary_Make_BeforeRedef.yaml @@ -0,0 +1,19 @@ +author: U.S. Bureau of Economic Analysis +source_name: Use Before Redefinitions Producer's Prices +source_url: 'https://www.bea.gov/industry/input-output-accounts-data' +original_data_download_date: '2023-09-06' +bib_id: BEA_Summary_Make_BR +format: csv +url: None +parse_response_fxn: !script_function:BEA bea_parse +years: + - 2012 + - 2013 + - 2014 + - 2015 + - 2016 + - 2017 + - 2018 + - 2019 + - 2020 + - 2021 diff --git a/flowsa/methods/flowbyactivitymethods/BEA_Summary_Use_PRO_BeforeRedef.yaml b/flowsa/methods/flowbyactivitymethods/BEA_Summary_Use_PRO_BeforeRedef.yaml new file mode 100644 index 000000000..f3fdec27e --- /dev/null +++ b/flowsa/methods/flowbyactivitymethods/BEA_Summary_Use_PRO_BeforeRedef.yaml @@ -0,0 +1,19 @@ +author: U.S. Bureau of Economic Analysis +source_name: Use Before Redefinitions Producer's Prices +source_url: 'https://www.bea.gov/industry/input-output-accounts-data' +original_data_download_date: '2023-09-06' +bib_id: BEA_Summary_Use_PRO_BR +format: csv +url: None +parse_response_fxn: !script_function:BEA bea_parse +years: + - 2012 + - 2013 + - 2014 + - 2015 + - 2016 + - 2017 + - 2018 + - 2019 + - 2020 + - 2021 From 1ad1488de45a16877861a14bb2c36fe84116ff87 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 6 Sep 2023 15:50:35 -0600 Subject: [PATCH 0930/1127] add bea FBAs to source catalog --- flowsa/data/source_catalog.yaml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index ab89ff687..902b2e7c6 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -1,4 +1,4 @@ -BEA_Detail_GDP_GrossOutput: +BEA_Detail_GrossOutput_IO: data_format: FBA class: - Money @@ -16,17 +16,29 @@ BEA_Detail_Make_BeforeRedef: - Money activity_schema: BEA_2012_Detail_Code sector_hierarchy: "flat" -BEA_Marine_Bunker_Fuel: +BEA_Detail_Use_PRO_BeforeRedef: data_format: FBA class: - - Energy - activity_schema: None + - Money + activity_schema: BEA_2012_Detail_Code sector_hierarchy: "flat" -BEA_Detail_Use_PRO_BeforeRedef: +BEA_Summary_Make_BeforeRedef: data_format: FBA class: - Money - activity_schema: BEA_2012_Detail_Code + activity_schema: BEA_2012_Summary_Code + sector_hierarchy: "flat" +BEA_Summary_Use_PRO_BeforeRedef: + data_format: FBA + class: + - Money + activity_schema: BEA_2012_Summary_Code + sector_hierarchy: "flat" +BEA_Marine_Bunker_Fuel: + data_format: FBA + class: + - Energy + activity_schema: None sector_hierarchy: "flat" Blackhurst_IO: data_format: FBA From af77f5882a009e4b4957ef8f6e33473dbde26a08 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 6 Sep 2023 16:03:45 -0600 Subject: [PATCH 0931/1127] rename additional bea FBAs --- .../methods/flowbysectormethods/GHG_national_m1_common.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml index 13ed4b1c3..04df6ccbf 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml @@ -118,7 +118,7 @@ source_names: Electric Power Sector: Electric Power #CO2 attribution_method: proportional attribution_source: - BEA_Make_Detail_BeforeRedef: + BEA_Detail_Make_BeforeRedef: <<: *bea primary_action_type: Produced selection_fields: @@ -545,7 +545,7 @@ source_names: Wood Electric Power: Wood Electric Power attribution_method: proportional attribution_source: - BEA_Make_Detail_BeforeRedef: + BEA_Detail_Make_BeforeRedef: <<: *bea primary_action_type: Produced selection_fields: @@ -816,7 +816,7 @@ source_names: PrimaryActivity: Magnesium Production and Processing attribution_method: proportional attribution_source: - BEA_Make_Detail_BeforeRedef: + BEA_Detail_Make_BeforeRedef: <<: *bea selection_fields: ActivityConsumedBy: {T008: ''} # Total Output From af104a331088bdf2360ae7925b72280c99b9a523 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 6 Sep 2023 16:34:50 -0600 Subject: [PATCH 0932/1127] add conversion of million USD to USD --- flowsa/data/unit_conversion.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/data/unit_conversion.csv b/flowsa/data/unit_conversion.csv index 561d4be8c..d187a6683 100644 --- a/flowsa/data/unit_conversion.csv +++ b/flowsa/data/unit_conversion.csv @@ -23,4 +23,5 @@ Tbtu,MJ,1055055900 MT CO2e,MMT CO2e,0.000001 employees,p,1 Thousand USD,USD,1000 +Million USD,USD,1000000 kg/employee,kg/p,1 From a39f2b45bea678e3c8ae6bd5c17b7747ac1e0cc7 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 7 Sep 2023 08:51:41 -0400 Subject: [PATCH 0933/1127] add example 2019 state method fbs based on detail national model --- .../GHG_state_2019_m2.yaml | 21 +++++++++++++++++++ .../GHG_state_common_m2.yaml | 13 +++++------- 2 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml new file mode 100644 index 000000000..b990d9849 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml @@ -0,0 +1,21 @@ +## Method 2 uses as its source the national GHG Flow-by-sector (detail) +# with emissions data attributed to states based on reported emissions +# in the State Inventory + + +!include:GHG_state_common_m2.yaml +year: &ghg_year 2019 +geoscale: state + + +source_names: +## Directly sourced from State Inventory + EPA_StateGHGI: + !include:GHG_state_common_m2.yaml:source_names:EPA_StateGHGI + year: *ghg_year + activity_sets: + !include:GHG_state_common_m2.yaml:source_names:EPA_StateGHGI:activity_sets + + GHG_national_2019_m1: #U.S. GHG emissions + !include:GHG_state_common_m2.yaml:source_names:GHG_national_common_m1 + year: *ghg_year diff --git a/flowsa/methods/flowbysectormethods/GHG_state_common_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_state_common_m2.yaml index 3f31f3107..48c9dc36c 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_common_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_common_m2.yaml @@ -1,4 +1,6 @@ - +## Method 2 uses as its source the national GHG Flow-by-sector (detail) +# with emissions data attributed to states based on reported emissions +# in the State Inventory !include:USEEIO_summary_target.yaml @@ -7,8 +9,7 @@ geoscale: state source_names: -## Directly sourced from State Inventory - EPA_StateGHGI: + EPA_StateGHGI: ## Directly sourced from State Inventory FBA geoscale: state year: *ghg_year fedefl_mapping: GHGI @@ -54,12 +55,8 @@ source_names: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv hcfc attribution_method: direct - # direct_ods - - - GHG_national_2019: #U.S. GHG emissions + GHG_national_common_m1: #U.S. GHG emissions year: *ghg_year - fedefl_mapping: GHGI data_format: FBS geoscale: national activity_sets: From 824f99264cd1d2ead1bea3615904c3c3145944ce Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 7 Sep 2023 09:26:24 -0400 Subject: [PATCH 0934/1127] Add summary level national model (m2) --- .../GHG_national_2019_m2.yaml | 297 +++++++ .../GHG_national_m2_common.yaml | 775 ++++++++++++++++++ 2 files changed, 1072 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml new file mode 100644 index 000000000..da7ad2234 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml @@ -0,0 +1,297 @@ +# This is a 2019 target year specific implementation of GHG_national_m2 +# This is a Summary level model +# All parameters add year specific data when needed to implement for 2019 +# GHGI FBA table names match the 2022 GHGI Report +# MECS year is 2018 + +!include:GHG_national_m2_common.yaml +ghgi_year: &ghgi_year 2019 +mecs_year: &mecs_year 2018 + +_industrial_allocation_dict: &industrial_dict + energy_fba: 'EIA_MECS_Energy' + year: *mecs_year + ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table + +source_names: + "EPA_GHGI_T_2_1": #U.S. GHG emissions + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 + year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + electric_power: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power + attribution_source: + BEA_Summary_Make_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power:attribution_source:BEA_Summary_Make_BeforeRedef + year: *ghgi_year + + urea: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + carbonate_use: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + nitrous_oxide_use: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_68 + year: *ghgi_year + "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_70 + year: *ghgi_year + "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_72 + year: *ghgi_year + "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_42 + year: *ghgi_year + "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_44 + year: *ghgi_year + "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_46 + year: *ghgi_year + "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_28 + year: *ghgi_year + "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_3 + year: *ghgi_year + "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_6 + year: *ghgi_year + "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_17 + year: *ghgi_year + "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_18 + year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets + petroleum_fuels: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14 + year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets + petroleum_fuels_diesel: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + petroleum_fuels_gasoline: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + + construction_and_mining: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + farm_non_road: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + other_non_road: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + alt_fuel_on_road: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 + + "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_46 + year: *ghgi_year + "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_50 + year: *ghgi_year + "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_96 + year: *ghgi_year + "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102 + year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets + refrigerants: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + air_conditioning: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + foams: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_A_97": # HFCs from Transportation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_A_97 + year: *ghgi_year + "EPA_GHGI_T_4_80": # PFCs from aluminum production + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_80 + year: *ghgi_year + "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_86 + year: *ghgi_year + "EPA_GHGI_T_3_22b": #Fossil fuel for non-energy uses + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + year: *ghgi_year + activity_sets: # Update EIA_MECS year for some activity_sets + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets + petroleum: + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas: + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas:attribution_source:EIA_MECS_Energy + year: *mecs_year + transportation_lubricants: + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + +### Major CO2 Sources + "EPA_GHGI_T_A_6": # CO2 emissions from stationary combustion. This table number varies by GHG year. + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: # Update EIA_MECS and BEA year for some activity_sets + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + non-manufacturing_coal: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non-manufacturing_coal + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non-manufacturing_coal:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + non-manufacturing_natural_gas: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non-manufacturing_natural_gas + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non-manufacturing_natural_gas:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + coal_manufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + petroleum: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8 + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: # Update EIA_MECS and BEA year for some activity_sets + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + electric_power: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power + attribution_source: + BEA_Summary_Make_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power:attribution_source:BEA_Summary_Make_BeforeRedef + year: *ghgi_year + + fuel_oil: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + natural_gas_nonmanufacturing: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + coal_nonmanufacturing: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + coal_manufacturing: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + ng_manufacturing: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + "EPA_GHGI_T_3_9": *T_3_8 # N2O emissions from stationary combustion diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml new file mode 100644 index 000000000..225ffc22e --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml @@ -0,0 +1,775 @@ +# This is the general method reference file for method 2 (Summary) +# Year-specific GHG_national_m2 files import this file to define attribution rules +# that are further customized +# m2 for the GHG national utilizes a summary level sector attribution + + +!include:USEEIO_summary_target.yaml +year: &ghg_year 2016 +target_naics_year: 2012 +geoscale: national + +_mecs_year: &mecs_year 2018 + +_attribution_sources: + BEA: &bea + year: *ghg_year + activity_to_sector_mapping: BEA_2012_Summary + # selection_fields: + # ActivityProducedBy: {'324': ''} # Petroleum 324110 + exclusion_fields: # Avoid unnecessary warnings about not being mapped to sectors + ActivityConsumedBy: ['F030', 'F040', 'F050', 'F051', + 'F02E', 'F06E', 'F07E', 'F10E', + 'Total Commodity Output', + 'Total Final Uses (GDP)', + 'Total Intermediate'] + ActivityProducedBy: ['Total Commodity Output'] + + attribution_method: equal + ## No attribution supplied (will use equal) because target level for + ## modeling is BEA summary level. + + EIA_MECS_Energy: &mecs_energy + year: *mecs_year + selection_fields: &mecs_energy_default_selection + Class: Energy # or Other (for non-energy use) + Unit: Trillion Btu + # FlowName: Coal # override this + Location: '00000' + Description: + - Table 2.2 # applies to Class Other + - Table 3.2 # applies to Class Energy + exclusion_fields: + ActivityConsumedBy: '31-33' + estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy + # attribution_method: proportional + # attribution_source: # Include in main method + # BEA_Summary_Use_PRO_BeforeRedef: + # <<: *bea + # selection_fields: + # ActivityProducedBy: {'XXXXX': ''} + + +source_names: + EPA_GHGI_T_2_1: #U.S. GHG emissions + # year: # override this + fedefl_mapping: GHGI + activity_sets: + direct: + selection_fields: + PrimaryActivity: + - Abandoned Oil and Gas Wells #CH4 + - Abandoned Underground Coal Mines #CH4 + - Adipic Acid Production #N2O + - Aluminum Production #CO2 + - Ammonia Production #CO2 + - Anaerobic Digestion at Biogas Facilities #CH4 new activity + - Caprolactam, Glyoxal, and Glyoxylic Acid Production #N2O + - Carbide Production and Consumption #CO2, CH4 + - Cement Production #CO2 + - Coal Mining #CO2, CH4 + - Composting #CH4, N2O + - Ferroalloy Production #CO2, CH4 + - Glass Production #CO2 + - Landfills #CH4 + - Lead Production #CO2 + - Lime Production #CO2 + - Incineration of Waste #CO2, #N2O + - Iron and Steel Production & Metallurgical Coke Production #CO2, CH4 + - Nitric Acid Production #N2O + - Phosphoric Acid Production #CO2 + - Rice Cultivation #CH4 + - Soda Ash Production #CO2 + - Titanium Dioxide Production #CO2 + - Wastewater Treatment #CH4, N2O + - Zinc Production #CO2 + FlowName: ["CO2", "CH4", "N2O"] # HFCs and other flows are pulled elsewhere + attribution_method: direct + + electricity_transmission: + selection_fields: + PrimaryActivity: Electrical Transmission and Distribution #SF6 + FlowName: SF6 + attribution_method: direct + + electric_power: + selection_fields: + PrimaryActivity: + Electric Power Sector: Electric Power #CO2 + attribution_method: proportional + attribution_source: + BEA_Summary_Make_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {'22': ''} # Utilities (221100) + + urea: + selection_fields: + PrimaryActivity: + - Urea Consumption for Non-Agricultural Purposes #CO2 + attribution_method: proportional + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325': ''} # Chemicals (325310) + + carbonate_use: + selection_fields: + PrimaryActivity: Other Process Uses of Carbonates #CO2 + attribution_method: proportional + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325': ''} # Chemicals (325180) + + nitrous_oxide_use: + selection_fields: + PrimaryActivity: N2O from Product Uses #N2O + attribution_method: proportional + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325': ''} # Chemicals (325120) + + equal: + selection_fields: + PrimaryActivity: + - Liming #CO2 + - Urea Fertilization #CO2 + attribution_method: equal + + +## Fossil Fuels + EPA_GHGI_T_3_68: &natgas #CH4 from Natural Gas Systems + # year: # override this + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + - Distribution + - Distribution - Post-Meter + - Exploration + - Processing + - Production + - Transmission and Storage + attribution_method: direct + EPA_GHGI_T_3_70: *natgas #CO2 from Natural Gas Systems mimics CH4 + EPA_GHGI_T_3_72: *natgas #N2O from Natural Gas Systems, not used in original method, mimics CH4 + + EPA_GHGI_T_3_42: &petroleum #CH4 from Petroleum Systems + # year: # override this + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + - Crude Oil Transportation + - Transportation + - Exploration + - Production + - Refining + - Crude Refining + attribution_method: direct + EPA_GHGI_T_3_44: *petroleum #CO2 from Petroleum Systems mimics CH4 + EPA_GHGI_T_3_46: *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 + +## Agriculture + EPA_GHGI_T_5_28: #CH4, N2O, CO and NOx from field burning of residues + # year: # override this + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + - Chickpeas + - Cotton + - Maize + - Rice + - Soybeans + - Wheat + attribution_method: direct + EPA_GHGI_T_5_3: &animals #CH4 from Enteric Fermentation + # year: # override this + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + - American Bison + - Beef Cattle + - Dairy Cattle + - Goats + - Horses + - Mules and Asses + - Sheep + - Swine + - Poultry + attribution_method: direct + EPA_GHGI_T_5_6: *animals #CH4 and N2O from manure, mimics enteric fermentation + + EPA_GHGI_T_5_17: #Direct N2O emissions from agricultural soils + # year: # override this + fedefl_mapping: GHGI + activity_sets: + fertilizer_use: + selection_fields: + PrimaryActivity: + - Organic Amendment Cropland + - Residue N Cropland + - Synthetic Fertilizer Cropland + attribution_method: direct + + cropland: + selection_fields: + PrimaryActivity: + - Mineralization and Asymbiotic Fixation Cropland + - Drained Organic Soils Cropland + attribution_method: direct + + pasture: &pasture + selection_fields: + PrimaryActivity: + - All activities Grassland + attribution_method: equal + + + EPA_GHGI_T_5_18: #Indirect N2O emissions from agricultural soils + # year: # override this + fedefl_mapping: GHGI + activity_sets: + fertilizer_use: + selection_fields: + PrimaryActivity: + - Volatilization & Atm. Deposition Cropland + - Surface Leaching & Run-Off Cropland + attribution_method: direct + pasture: + selection_fields: + PrimaryActivity: + - All activities Grassland + attribution_method: equal + + +## Mobile Sources + EPA_GHGI_T_3_13: #CO2 from mobile combustion + fedefl_mapping: GHGI + activity_sets: + direct_petroleum: + selection_fields: + PrimaryActivity: + General Aviation Aircraft Aviation Gasoline: General Aviation Aircraft + General Aviation Aircraft Jet Fuel: General Aviation Aircraft + Commercial Aircraft Jet Fuel: Commercial Aircraft + Military Aircraft Jet Fuel: Military Aircraft + Buses Gasoline: Buses + Buses LPG: Buses + Motorcycles Gasoline: Motorcycles + Rail Distillate Fuel Oil: Rail + Recreational Boats Distillate Fuel Oil: Recreational Boats + Recreational Boats Gasoline: Recreational Boats + Ships and Non-Recreational Boats Distillate Fuel Oil: Ships and Non-Recreational Boats + Ships and Non-Recreational Boats Residual Fuel Oil: Ships and Non-Recreational Boats + Medium- and Heavy-Duty Trucks Gasoline: Medium- and Heavy-Duty Trucks + Medium- and Heavy-Duty Trucks LPG: Medium- and Heavy-Duty Trucks + Light-Duty Trucks LPG: Light-Duty Trucks - Households + Passenger Cars LPG: Passenger Cars - Households + attribution_method: direct + direct_ng: + selection_fields: + PrimaryActivity: + Buses Natural Gas: Buses + Pipeline Natural Gas: Pipeline Natural Gas + + petroleum_fuels: + selection_fields: + PrimaryActivity: + Medium- and Heavy-Duty Trucks Distillate Fuel Oil: Medium- and Heavy-Duty Trucks - Distillate Fuel Oil + Buses Distillate Fuel Oil: Buses - Distillate Fuel Oil + Passenger Cars Distillate Fuel Oil: Passenger Cars + Passenger Cars Gasoline: Passenger Cars + Light-Duty Trucks Distillate Fuel Oil: Light-Duty Trucks + Light-Duty Trucks Gasoline: Light-Duty Trucks + attribution_method: proportional + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) + + + EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion + fedefl_mapping: GHGI + activity_sets: + direct_gasoline: + selection_fields: + PrimaryActivity: + Motorcycles Gasoline On-Road: Motorcycles + Medium- and Heavy-Duty Trucks and Buses Gasoline On-Road: Medium- and Heavy-Duty Trucks and Buses + attribution_method: direct + + # This activity is only in older FBAs + # direct_diesel: + # selection_fields: + # PrimaryActivity: + # Medium- and Heavy-Duty Trucks and Buses Diesel On-Road: Medium- and Heavy-Duty Trucks and Buses + # attribution_method: direct + + direct_non_road: + selection_fields: + PrimaryActivity: + Rail Non-Road: Rail + Ships and Boats Non-Road: Ships and Boats + Aircraft Non-Road: General Aviation Aircraft + attribution_method: direct + + petroleum_fuels_diesel: + selection_fields: + PrimaryActivity: + Passenger Cars Diesel On-Road: Passenger Cars + Light-Duty Trucks Diesel On-Road: Light-Duty Trucks + Medium- and Heavy-Duty Buses Diesel On-Road: Buses - Distillate Fuel Oil + Medium- and Heavy-Duty Trucks Diesel On-Road: Medium- and Heavy-Duty Trucks - Distillate Fuel Oil + attribution_method: proportional + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) + + petroleum_fuels_gasoline: + selection_fields: + PrimaryActivity: + Passenger Cars Gasoline On-Road: Passenger Cars + Light-Duty Trucks Gasoline On-Road: Light-Duty Trucks + attribution_method: proportional + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) + + construction_and_mining: #this set is allocated by purchases of construction equipment + selection_fields: + PrimaryActivity: Construction/Mining Equipment Non-Road + attribution_method: proportional + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333': ''} # purchases of construction/mining equipment (333120) + + farm_non_road: #this set is allocated by purchases of farm machinery + selection_fields: + PrimaryActivity: Agricultural Equipment Non-Road + attribution_method: proportional + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333': ''} # purchases of farm machinery (333111) + + other_non_road: #this set is allocated by purchases of petroleum refining + selection_fields: + PrimaryActivity: Other Non-Road + attribution_method: proportional + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) + + alt_fuel_on_road: #this set is allocated by purchases of natural gas + selection_fields: + PrimaryActivity: + All activities Alternative Fuel On-Road: Alternative Fuel On-Road + attribution_method: proportional + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'22': ''} # purchases of natural gas (221200) + + EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 + + +## Stationary Combustion + GHGI_CO2_stationary_combustion: # CO2 emissions from stationary combustion + fedefl_mapping: GHGI + # year: # override this + clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion + clean_parameter: # Override each year for use in allocate_industrial_combustion + energy_fba: 'EIA_MECS_Energy' + year: *mecs_year + ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table + activity_sets: + direct_attribution: #direct allocation + selection_fields: + PrimaryActivity: Total (All Fuels) Residential + attribution_method: direct + + non-manufacturing_coal: + selection_fields: + PrimaryActivity: + Commercial Coal Commercial: Coal Commercial + Industrial Other Coal Industrial: Coal Industrial + attribution_method: proportional + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212': ''} # purchases of coal (212100) + + non-manufacturing_natural_gas: # Applies to non-manufacturing sectors like ag and mining + selection_fields: + PrimaryActivity: + - Natural Gas Commercial + - Natural Gas Industrial + attribution_method: proportional + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'22': ''} # purchases of natural gas (221200) + + coal_manufacturing: # Industrial Coal for Manufacturing + selection_fields: + PrimaryActivity: + Industrial Other Coal Industrial - Manufacturing: Coal Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: + - Coal + - Coke and Breeze + # attribution_source: TODO do we need attribution of MECS data? + # BEA_Summary_Use_PRO_BeforeRedef: + # <<: *bea + # selection_fields: + # ActivityProducedBy: {'212100': ''} # purchases of coal + + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing + selection_fields: + PrimaryActivity: + - Natural Gas Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Natural Gas + # attribution_source: + # BEA_Summary_Use_PRO_BeforeRedef: + # <<: *bea + # selection_fields: + # ActivityProducedBy: {'221200': ''} # purchases of natural gas + + petroleum: # Petroleum + selection_fields: + PrimaryActivity: + - Total Petroleum Commercial + - Total Petroleum Industrial + attribution_method: proportional + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) + + + EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion + # year: #override this with ghgi_year + clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion + clean_parameter: # Override each year for use in allocate_industrial_combustion + energy_fba: 'EIA_MECS_Energy' + year: *mecs_year + ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table + fedefl_mapping: GHGI + activity_sets: + residential: + selection_fields: + PrimaryActivity: + - Fuel Oil Residential + - Coal Residential + - Natural Gas Residential + - Wood Residential + attribution_method: direct + + electric_power: + selection_fields: + PrimaryActivity: + Coal Electric Power: Coal Electric Power + Natural Gas Electric Power: Natural Gas Electric Power + Natural gas Electric Power: Natural Gas Electric Power # fix capitalization + Fuel Oil Electric Power: Fuel Oil Electric Power + Wood Electric Power: Wood Electric Power + attribution_method: proportional + attribution_source: + BEA_Summary_Make_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {'22': ''} # Electricity (221100) + fuel_oil: + selection_fields: + PrimaryActivity: + - Fuel Oil Commercial + - Fuel Oil Industrial + attribution_method: proportional + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) + + natural_gas_nonmanufacturing: # Commercial Natural gas + selection_fields: + PrimaryActivity: + Natural gas Commercial: Natural Gas Commercial # fix capitalization + Natural gas Industrial: Natural Gas Industrial # fix capitalization + Natural Gas Commercial: Natural Gas Commercial + Natural Gas Industrial: Natural Gas Industrial + attribution_method: proportional + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'22': ''} # purchases of natural gas (221200) + + coal_nonmanufacturing: + selection_fields: + PrimaryActivity: Coal Industrial + attribution_method: proportional + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212': ''} # purchases of coal (212100) + + coal_manufacturing: + selection_fields: + PrimaryActivity: Coal Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Coal + # attribution_source: + # BEA_Summary_Use_PRO_BeforeRedef: + # <<: *bea + # selection_fields: + # ActivityProducedBy: {'212100': ''} # purchases of coal + + ng_manufacturing: + selection_fields: + PrimaryActivity: + - Natural gas Industrial - Manufacturing + - Natural Gas Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Natural Gas + # attribution_source: + # BEA_Summary_Use_PRO_BeforeRedef: + # <<: *bea + # selection_fields: + # ActivityProducedBy: {'221200': ''} # purchases of natural gas + + #Intentionally left out 'Wood Commercial' and 'Wood Industrial' + + EPA_GHGI_T_3_9: + <<: *stationary_combustion # N2O emissions from stationary combustion + +## Other sources + EPA_GHGI_T_4_46: #CO2 for selected petrochemicals + # year: # override with ghgi_year + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + - Acrylonitrile + - Carbon Black + - Ethylene + - Ethylene Dichloride + - Ethylene Oxide + - Methanol + attribution_method: direct + + GHGI_nonenergy_fossil_fuel_emissions: # Fossil fuel for non-energy uses + # year: #override with ghgi_year + fedefl_mapping: GHGI + activity_sets: + coal: + selection_fields: + PrimaryActivity: + - Industry Industrial Coking Coal + - Industry Industrial Other Coal + attribution_method: direct + + petroleum: # consumed petroleum products + selection_fields: + PrimaryActivity: + 'Industry Asphalt & Road Oil': Industry Petroleum Products Non-energy + Industry Distillate Fuel Oil: Industry Petroleum Products Non-energy + Industry LPG: Industry Petroleum Products Non-energy + Industry Lubricants: Industry Petroleum Products Non-energy + Industry Miscellaneous Products: Industry Petroleum Products Non-energy + 'Industry Naphtha (<401 F)': Industry Petroleum Products Non-energy + 'Industry Other Oil (>401 F)': Industry Petroleum Products Non-energy + Industry Pentanes Plus: Industry Petroleum Products Non-energy + Industry Petroleum Coke: Industry Petroleum Products Non-energy + Industry Special Naphtha: Industry Petroleum Products Non-energy + Industry Still Gas: Industry Petroleum Products Non-energy + Industry Waxes: Industry Petroleum Products Non-energy + Industry Natural Gasoline: Industry Petroleum Products Non-energy #T_3_22. Also produced by nat gas plants + Industry HGL: Industry Petroleum Products Non-energy #T_3_22. Also produced by nat gas plants + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: + - Residual Fuel Oil + - Distillate Fuel Oil + - Hydrocarbon Gas Liquids, excluding natural gasoline + # attribution_source: + # BEA_Summary_Use_PRO_BeforeRedef: + # <<: *bea + # selection_fields: + # ActivityProducedBy: {'324110': ''} # purchases of refineries + + natural_gas: # consumed nat gas to chemical plants + selection_fields: + PrimaryActivity: Industry Natural Gas to Chemical Plants + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + FlowName: Natural Gas + Unit: Trillion Btu + # attribution_source: + # BEA_Summary_Use_PRO_BeforeRedef: + # <<: *bea + # selection_fields: + # ActivityProducedBy: {'221200': ''} # purchases of natural gas + + transportation_lubricants: + selection_fields: + PrimaryActivity: Transportation Lubricants + attribution_method: proportional + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324': ''} # use of petroleum products (324110) + +## Other Emissions + EPA_GHGI_T_4_50: # HFCs from HCFC-22 production + # year: # override with ghgi_year + fedefl_mapping: GHGI + selection_fields: + Unit: MMT CO2e # drop records in kt + PrimaryActivity: HCFC-22 Production + attribution_method: direct + + EPA_GHGI_T_4_96: # HFCs and other emissions from electronics manufacture + # year: # override with ghgi_year + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: Electronics Production + attribution_method: direct + + EPA_GHGI_T_4_102: # HFCs and PFCs from ODS Substitutes + clean_fba_before_activity_sets: !script_function:EPA_GHGI split_HFCs_by_type + clean_parameter: + # Proportions of specific HFCs are assigned based on national total + flow_fba: EPA_GHGI_T_4_100 + # year: # override with ghgi_year + fedefl_mapping: GHGI + activity_sets: + households: + selection_fields: + PrimaryActivity: + - Domestic Refrigeration + - Residential Stationary Air Conditioning + attribution_method: direct + + refrigerants: + selection_fields: + PrimaryActivity: + - Commercial Refrigeration + - Industrial Process Refrigeration + attribution_method: proportional + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333': ''} # Air conditioning equipment (333415) + + air_conditioning: + selection_fields: + PrimaryActivity: + - Commercial Stationary Air Conditioning + attribution_method: proportional + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333': ''} # Air conditioning equipment (333415) + + foams: + selection_fields: + PrimaryActivity: + - Foams + attribution_method: proportional + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: + '326': '' # Polystyrene foam & Urethane and other foam (326140 & 326150) + + + # 'Mobile Air Conditioning' and 'Transport Refrigeration' come from + # different table. + # Intentionally left out 'Solvents', 'Aerosols', 'Fire Protection' + + EPA_GHGI_T_A_97: # HFCs from Transportation + # year: # override with ghgi_year + clean_fba_before_mapping: !script_function:EPA_GHGI split_HFCs_by_type + clean_parameter: + # Proportions of specific HFCs are assigned based on national total + flow_fba: EPA_GHGI_T_4_100 + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + Mobile AC - Passenger Cars: Passenger Cars - Households + Mobile AC - Light-Duty Trucks: Light-Duty Trucks - Households + Mobile AC - Heavy-Duty Vehicles: Heavy-Duty Vehicles + Comfort Cooling for Trains and Buses - School and Tour Buses: School and Tour Buses + # Comfort Cooling for Trains and Buses - Transit Buses: Transit Buses #excluded + Comfort Cooling for Trains and Buses - Rail: Rail + Refrigerated Transport - Medium- and Heavy-Duty Trucks: Medium- and Heavy-Duty Trucks + Refrigerated Transport - Rail: Rail + Refrigerated Transport - Ships and Boats: Ships and Boats + attribution_method: direct + + EPA_GHGI_T_4_80: # PFCs from aluminum production + # year: # override with ghgi_year + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: Aluminum Production + attribution_method: direct + + EPA_GHGI_T_4_86: # HFCs, SF6, CO2 from magnesium production + # year: # override with ghgi_year + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: Magnesium Production and Processing + attribution_method: direct From a63d62afb412b1130c5379683d899609f8c6f2e6 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 7 Sep 2023 12:41:04 -0400 Subject: [PATCH 0935/1127] add initial GHG_national_m3 - a detail method built from a summary method --- .../GHG_national_m3_common.yaml | 753 ++++++++++++++++++ 1 file changed, 753 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/GHG_national_m3_common.yaml diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m3_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m3_common.yaml new file mode 100644 index 000000000..afc1488ac --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_national_m3_common.yaml @@ -0,0 +1,753 @@ +# This is the general method reference file for method 3 (Detail) +# Year-specific GHG_national_m3 files import this file to define attribution rules +# that are further customized +# m3 for the GHG national utilizes a full 6-digit NAICS attribution based on +# the exisiting summary level national FBS (method 2), except where Direct attribution +# is available at the detail level and uses method 1 + +industry_spec: + default: NAICS_6 +year: &ghgi_year 2019 +target_naics_year: 2012 +geoscale: national + +attribution_sources: + _BEA: &bea + year: 2012 + activity_to_sector_mapping: BEA_2012_Detail + exclusion_fields: + # Drop irrelevant final demand and total sectors + ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', + 'F06E00', 'F07E00', 'F10E00', + 'T001', 'T004', 'T007'] + ActivityProducedBy: ['T007'] + attribution_method: equal + + _mecs_energy: + EIA_MECS_Energy: &mecs_energy + # year: *mecs_year # override this with mecs year + selection_fields: &mecs_energy_default_selection + Class: Energy # or Other (for non-energy use) + Unit: Trillion Btu + # FlowName: Coal # override this + Location: '00000' + Description: + - Table 2.2 # applies to Class Other + - Table 3.2 # applies to Class Energy + exclusion_fields: + ActivityConsumedBy: '31-33' + estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy + attribution_method: proportional + # attribution_source: # Include in main method + # BEA_Use_Detail_PRO_BeforeRedef: + # <<: *bea + # selection_fields: + # ActivityProducedBy: {'XXXXX': ''} + + _cropland_allocation: &cropland_allocation + USDA_CoA_Cropland: + year: 2017 + selection_fields: + Class: Land + FlowName: + - AREA HARVESTED + - AREA BEARING & NON-BEARING # Orchards + - AREA GROWN # Berry totals + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + year: 2017 + selection_fields: + Class: Land + FlowName: AG LAND, CROPLAND, HARVESTED + estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution + + _animal_land_allocation: &animal_land_allocation + USDA_CoA_Cropland_NAICS: + year: 2017 + selection_fields: + Class: Land + FlowName: FARM OPERATIONS + estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution + +source_names: + GHG_national_2019_m2: + data_format: FBS + year: *ghgi_year + activity_sets: + ## Table 2.1 + electric_power: + selection_fields: + MetaSources: 'EPA_GHGI_T_2_1.electric_power' + attribution_method: equal + # AttributeError: 'FlowBySector' object has no attribute 'equally_attribute' + + urea: + selection_fields: + MetaSources: 'EPA_GHGI_T_2_1.urea' + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + + carbonate_use: + selection_fields: + MetaSources: 'EPA_GHGI_T_2_1.carbonate_use' + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + + nitrous_oxide_use: + selection_fields: + MetaSources: 'EPA_GHGI_T_2_1.nitrous_oxide_use' + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325120': ''} # Industrial gases + + + EPA_GHGI_T_2_1: #U.S. GHG emissions + # year: # override this + fedefl_mapping: GHGI + activity_sets: + direct: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:direct + + electricity_transmission: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electricity_transmission + + liming: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming + # selection_fields: + # PrimaryActivity: Liming #CO2 + # attribution_method: proportional + # attribution_source: + # BEA_Detail_Use_PRO_BeforeRedef: + # <<: *bea + # selection_fields: + # ActivityProducedBy: {'327400': ''} # Lime + + urea_fertilizer: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea + selection_fields: # Only uses one activity from this activity_set + PrimaryActivity: + - Urea Fertilization #CO2 + # attribution_method: proportional + # attribution_source: + # BEA_Detail_Use_PRO_BeforeRedef: + # <<: *bea + # selection_fields: + # ActivityProducedBy: {'325310': ''} # Fertilizers + + lead: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead + + +## Fossil Fuels + EPA_GHGI_T_3_68: #CH4 from Natural Gas Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 + EPA_GHGI_T_3_70: #CO2 from Natural Gas Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 + EPA_GHGI_T_3_72: #N2O from Natural Gas Systems, not used in original method, mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 + + EPA_GHGI_T_3_42: #CH4 from Petroleum Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 + EPA_GHGI_T_3_44: #CO2 from Petroleum Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 + EPA_GHGI_T_3_46: #N2O from Petroleum Systems, not in prior method, mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 + +## Agriculture + EPA_GHGI_T_5_28: #CH4, N2O, CO and NOx from field burning of residues + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 + EPA_GHGI_T_5_3: #CH4 from Enteric Fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 + EPA_GHGI_T_5_6: #CH4 and N2O from manure, mimics enteric fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 + +source_names2: ## SKIP - NOT YET UPDATED + EPA_GHGI_T_5_17: #Direct N2O emissions from agricultural soils + # year: # override this + fedefl_mapping: GHGI + activity_sets: + fertilizer_use: &fertilizer # allocated based on fertilizer use + selection_fields: + PrimaryActivity: + - Organic Amendment Cropland + - Residue N Cropland + - Synthetic Fertilizer Cropland + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + + cropland: # allocated based on USDA land area harvested + selection_fields: + PrimaryActivity: + - Mineralization and Asymbiotic Fixation Cropland + - Drained Organic Soils Cropland + attribution_method: proportional + attribution_source: *cropland_allocation + + pasture: &pasture # allocated based on USDA Animal operation land (acres) + selection_fields: + PrimaryActivity: + - All activities Grassland + attribution_method: proportional + attribution_source: *animal_land_allocation + + EPA_GHGI_T_5_18: #Indirect N2O emissions from agricultural soils + # year: # override this + fedefl_mapping: GHGI + activity_sets: + fertilizer_use: # allocated based on fertilizer use + <<: *fertilizer + selection_fields: + PrimaryActivity: + - Volatilization & Atm. Deposition Cropland + - Surface Leaching & Run-Off Cropland + pasture: # allocated based on USDA Animal operation land (acres) + <<: *pasture + + +## Mobile Sources + EPA_GHGI_T_3_13: #CO2 from mobile combustion + fedefl_mapping: GHGI + activity_sets: + direct_petroleum: + selection_fields: + PrimaryActivity: + General Aviation Aircraft Aviation Gasoline: General Aviation Aircraft + General Aviation Aircraft Jet Fuel: General Aviation Aircraft + Commercial Aircraft Jet Fuel: Commercial Aircraft + Military Aircraft Jet Fuel: Military Aircraft + Buses Gasoline: Buses + Buses LPG: Buses + Motorcycles Gasoline: Motorcycles + Rail Distillate Fuel Oil: Rail + Recreational Boats Distillate Fuel Oil: Recreational Boats + Recreational Boats Gasoline: Recreational Boats + Ships and Non-Recreational Boats Distillate Fuel Oil: Ships and Non-Recreational Boats + Ships and Non-Recreational Boats Residual Fuel Oil: Ships and Non-Recreational Boats + Medium- and Heavy-Duty Trucks Gasoline: Medium- and Heavy-Duty Trucks + Medium- and Heavy-Duty Trucks LPG: Medium- and Heavy-Duty Trucks + Light-Duty Trucks LPG: Light-Duty Trucks - Households + Passenger Cars LPG: Passenger Cars - Households + attribution_method: direct + direct_ng: + selection_fields: + PrimaryActivity: + Buses Natural Gas: Buses + Pipeline Natural Gas: Pipeline Natural Gas + + petroleum_fuels: + selection_fields: + PrimaryActivity: + Medium- and Heavy-Duty Trucks Distillate Fuel Oil: Medium- and Heavy-Duty Trucks - Distillate Fuel Oil + Buses Distillate Fuel Oil: Buses - Distillate Fuel Oil + Passenger Cars Distillate Fuel Oil: Passenger Cars + Passenger Cars Gasoline: Passenger Cars + Light-Duty Trucks Distillate Fuel Oil: Light-Duty Trucks + Light-Duty Trucks Gasoline: Light-Duty Trucks + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + + EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion + fedefl_mapping: GHGI + activity_sets: + direct_gasoline: + selection_fields: + PrimaryActivity: + Motorcycles Gasoline On-Road: Motorcycles + Medium- and Heavy-Duty Trucks and Buses Gasoline On-Road: Medium- and Heavy-Duty Trucks and Buses + attribution_method: direct + + direct_diesel: + selection_fields: + PrimaryActivity: + Medium- and Heavy-Duty Trucks and Buses Diesel On-Road: Medium- and Heavy-Duty Trucks and Buses + attribution_method: direct + + direct_non_road: + selection_fields: + PrimaryActivity: + Rail Non-Road: Rail + Ships and Boats Non-Road: Ships and Boats + Aircraft Non-Road: General Aviation Aircraft + attribution_method: direct + + petroleum_fuels_diesel: + selection_fields: + PrimaryActivity: + Passenger Cars Diesel On-Road: Passenger Cars + Light-Duty Trucks Diesel On-Road: Light-Duty Trucks + Medium- and Heavy-Duty Buses Diesel On-Road: Buses - Distillate Fuel Oil + Medium- and Heavy-Duty Trucks Diesel On-Road: Medium- and Heavy-Duty Trucks - Distillate Fuel Oil + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + petroleum_fuels_gasoline: + selection_fields: + PrimaryActivity: + Passenger Cars Gasoline On-Road: Passenger Cars + Light-Duty Trucks Gasoline On-Road: Light-Duty Trucks + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + construction_and_mining: #this set is allocated by purchases of construction equipment + selection_fields: + PrimaryActivity: Construction/Mining Equipment Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment + + farm_non_road: #this set is allocated by purchases of farm machinery + selection_fields: + PrimaryActivity: Agricultural Equipment Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333111': ''} # purchases of farm machinery + + other_non_road: #this set is allocated by purchases of petroleum refining + selection_fields: + PrimaryActivity: Other Non-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + alt_fuel_on_road: #this set is allocated by purchases of natural gas + selection_fields: + PrimaryActivity: + All activities Alternative Fuel On-Road: Alternative Fuel On-Road + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 + + +## Stationary Combustion + GHGI_CO2_stationary_combustion_and_transport: # CO2 emissions from stationary combustion + fedefl_mapping: GHGI + # year: # override this + clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion + # clean_parameter: # Override each year for use in allocate_industrial_combustion + # energy_fba: 'EIA_MECS_Energy' + # year: 2018 + # ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table + activity_sets: + direct_attribution: #direct allocation + selection_fields: + PrimaryActivity: Total (All Fuels) Residential + attribution_method: direct + + non-manufacturing_coal: + selection_fields: + PrimaryActivity: + Commercial Coal Commercial: Coal Commercial + Industrial Other Coal Industrial: Coal Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal + + non-manufacturing_natural_gas: # Applies to non-manufacturing sectors like ag and mining + selection_fields: + PrimaryActivity: + - Natural Gas Commercial + - Natural Gas Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + coal_manufacturing: # Industrial Coal for Manufacturing + selection_fields: + PrimaryActivity: + Industrial Other Coal Industrial - Manufacturing: Coal Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: + - Coal + - Coke and Breeze + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal + + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing + selection_fields: + PrimaryActivity: + - Natural Gas Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Natural Gas + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + petroleum: # Petroleum + selection_fields: + PrimaryActivity: + - Total Petroleum Commercial + - Total Petroleum Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + + EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion + # year: #override this with ghgi_year + clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion + # clean_parameter: # Override each year for use in allocate_industrial_combustion + # energy_fba: 'EIA_MECS_Energy' + # year: 2018 + # ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table + fedefl_mapping: GHGI + activity_sets: + residential: + selection_fields: + PrimaryActivity: + - Fuel Oil Residential + - Coal Residential + - Natural Gas Residential + - Wood Residential + attribution_method: direct + + electric_power: + selection_fields: + PrimaryActivity: + Coal Electric Power: Coal Electric Power + Natural Gas Electric Power: Natural Gas Electric Power + Natural gas Electric Power: Natural Gas Electric Power # fix capitalization + Fuel Oil Electric Power: Fuel Oil Electric Power + Wood Electric Power: Wood Electric Power + attribution_method: proportional + attribution_source: + BEA_Make_Detail_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity + fuel_oil: + selection_fields: + PrimaryActivity: + - Fuel Oil Commercial + - Fuel Oil Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + natural_gas_nonmanufacturing: # Commercial Natural gas + selection_fields: + PrimaryActivity: + Natural gas Commercial: Natural Gas Commercial # fix capitalization + Natural gas Industrial: Natural Gas Industrial # fix capitalization + Natural Gas Commercial: Natural Gas Commercial + Natural Gas Industrial: Natural Gas Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + coal_nonmanufacturing: + selection_fields: + PrimaryActivity: Coal Industrial + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal + + coal_manufacturing: + selection_fields: + PrimaryActivity: Coal Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Coal + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal + + ng_manufacturing: + selection_fields: + PrimaryActivity: + - Natural gas Industrial - Manufacturing + - Natural Gas Industrial - Manufacturing + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + <<: *mecs_energy_default_selection + FlowName: Natural Gas + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + #Intentionally left out 'Wood Commercial' and 'Wood Industrial' + + EPA_GHGI_T_3_9: + <<: *stationary_combustion # N2O emissions from stationary combustion + +## Other sources + EPA_GHGI_T_4_46: #CO2 for selected petrochemicals + # year: # override with ghgi_year + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + - Acrylonitrile + - Carbon Black + - Ethylene + - Ethylene Dichloride + - Ethylene Oxide + - Methanol + attribution_method: direct + + GHGI_nonenergy_fossil_fuel_emissions: # Fossil fuel for non-energy uses + # year: #override with ghgi_year + fedefl_mapping: GHGI + activity_sets: + coal: + selection_fields: + PrimaryActivity: + - Industry Industrial Coking Coal + - Industry Industrial Other Coal + attribution_method: direct + + petroleum: # consumed petroleum products + selection_fields: + PrimaryActivity: + 'Industry Asphalt & Road Oil': Industry Petroleum Products Non-energy + Industry Distillate Fuel Oil: Industry Petroleum Products Non-energy + Industry LPG: Industry Petroleum Products Non-energy + Industry Lubricants: Industry Petroleum Products Non-energy + Industry Miscellaneous Products: Industry Petroleum Products Non-energy + 'Industry Naphtha (<401 F)': Industry Petroleum Products Non-energy + 'Industry Other Oil (>401 F)': Industry Petroleum Products Non-energy + Industry Pentanes Plus: Industry Petroleum Products Non-energy + Industry Petroleum Coke: Industry Petroleum Products Non-energy + Industry Special Naphtha: Industry Petroleum Products Non-energy + Industry Still Gas: Industry Petroleum Products Non-energy + Industry Waxes: Industry Petroleum Products Non-energy + Industry Natural Gasoline: Industry Petroleum Products Non-energy #T_3_22. Also produced by nat gas plants + Industry HGL: Industry Petroleum Products Non-energy #T_3_22. Also produced by nat gas plants + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + Unit: Trillion Btu + FlowName: + - Residual Fuel Oil + - Distillate Fuel Oil + - Hydrocarbon Gas Liquids, excluding natural gasoline + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refineries + + natural_gas: # consumed nat gas to chemical plants + selection_fields: + PrimaryActivity: Industry Natural Gas to Chemical Plants + attribution_method: proportional + attribution_source: + EIA_MECS_Energy: + <<: *mecs_energy + selection_fields: + Class: Other + FlowName: Natural Gas + Unit: Trillion Btu + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + transportation_lubricants: + selection_fields: + PrimaryActivity: Transportation Lubricants + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # use of petroleum products + +## Other Emissions + EPA_GHGI_T_4_50: # HFCs from HCFC-22 production + # year: # override with ghgi_year + fedefl_mapping: GHGI + selection_fields: + Unit: MMT CO2e # drop records in kt + PrimaryActivity: HCFC-22 Production + attribution_method: direct + + EPA_GHGI_T_4_96: # HFCs and other emissions from electronics manufacture + # year: # override with ghgi_year + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: Electronics Production + attribution_method: direct + + EPA_GHGI_T_4_102: # HFCs and PFCs from ODS Substitutes + clean_fba_before_activity_sets: !script_function:EPA_GHGI split_HFCs_by_type + clean_parameter: + # Proportions of specific HFCs are assigned based on national total + flow_fba: EPA_GHGI_T_4_100 + # year: # override with ghgi_year + fedefl_mapping: GHGI + activity_sets: + households: + selection_fields: + PrimaryActivity: + - Domestic Refrigeration + - Residential Stationary Air Conditioning + attribution_method: direct + + refrigerants: + selection_fields: + PrimaryActivity: + - Commercial Refrigeration + - Industrial Process Refrigeration + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment + + air_conditioning: + selection_fields: + PrimaryActivity: + - Commercial Stationary Air Conditioning + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment + + foams: + selection_fields: + PrimaryActivity: + - Foams + attribution_method: proportional + attribution_source: + BEA_Use_Detail_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: + '326140': '' # Polystyrene foam + '326150': '' # Urethane and other foam + + # 'Mobile Air Conditioning' and 'Transport Refrigeration' come from + # different table. + # Intentionally left out 'Solvents', 'Aerosols', 'Fire Protection' + + EPA_GHGI_T_A_97: # HFCs from Transportation + # year: # override with ghgi_year + clean_fba_before_mapping: !script_function:EPA_GHGI split_HFCs_by_type + clean_parameter: + # Proportions of specific HFCs are assigned based on national total + flow_fba: EPA_GHGI_T_4_100 + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + Mobile AC - Passenger Cars: Passenger Cars - Households + Mobile AC - Light-Duty Trucks: Light-Duty Trucks - Households + Mobile AC - Heavy-Duty Vehicles: Heavy-Duty Vehicles + Comfort Cooling for Trains and Buses - School and Tour Buses: School and Tour Buses + # Comfort Cooling for Trains and Buses - Transit Buses: Transit Buses #excluded + Comfort Cooling for Trains and Buses - Rail: Rail + Refrigerated Transport - Medium- and Heavy-Duty Trucks: Medium- and Heavy-Duty Trucks + Refrigerated Transport - Rail: Rail + Refrigerated Transport - Ships and Boats: Ships and Boats + attribution_method: direct + + EPA_GHGI_T_4_80: # PFCs from aluminum production + # year: # override with ghgi_year + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: Aluminum Production + attribution_method: direct + + EPA_GHGI_T_4_86: # HFCs, SF6, CO2 from magnesium production + # year: # override with ghgi_year + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: Magnesium Production and Processing + attribution_method: proportional + attribution_source: + BEA_Make_Detail_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {T008: ''} # Total Output From 1cfcd3fab07966694e196b2726c799170e7fd75c Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 7 Sep 2023 10:54:59 -0600 Subject: [PATCH 0936/1127] move equally_attribute() to flowby and edit to work for both FBA and FBS activity sets --- flowsa/flowby.py | 67 ++++++++++++++++++++++++++++++++++++++-- flowsa/flowbyactivity.py | 62 ------------------------------------- 2 files changed, 65 insertions(+), 64 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 60f7c8b74..15f4b1143 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -8,7 +8,8 @@ import numpy as np from functools import partial, reduce from copy import deepcopy -from flowsa import (settings, literature_values, flowsa_yaml, geo, schema) +from flowsa import (settings, literature_values, flowsa_yaml, geo, schema, + naics) from flowsa.common import get_catalog_info from flowsa.flowsa_log import log, vlog import esupy.processed_data_mgmt @@ -724,7 +725,7 @@ def attribute_flows_to_sectors( elif attribution_method == 'equal': log.info(f"Equally attributing {self.full_name} to " f"target sectors.") - attributed_fb = fb.equally_attribute() + attributed_fb = fb.equally_attribute() elif attribution_method != 'direct': log.error('Attribution method for %s not recognized: %s', @@ -1286,6 +1287,68 @@ def division_attribution( .reset_index(drop=True) ) + def equally_attribute(self: 'FB') -> 'FB': + ''' + This function takes a FlowByActivity dataset with SectorProducedBy and + SectorConsumedBy columns already added and attributes flows from any + activity which is mapped to multiple industries/sectors equally across + those industries/sectors, by NAICS level. In other words, if an + activity is mapped to multiple industries/sectors, the flow amount is + equally divided across the relevant 2-digit NAICS industries. Then, + within each 2-digit industry the flow amount for that industry is + equally divided across the relevant 3-digit NAICS industries; within + each of those, the flow amount is equally divided across relevant + 4-digit NAICS industries, and so on. + + For example: + Suppose that activity A has a flow amount of 12 and is mapped to + industries 111210, 111220, and 213110, a flow amount of 3 will be + attributed to 111210, a flow amount of 3 to 111220, and a flow amount + of 6 to 213110. + + Attribution happens according to the primary sector first (see + documentation for + flowby.FlowByActivity.add_primary_secondary_sector_columns() for + details on how the primary sector is determined; in most cases, the + primary sector is the (only) non-null value out of SectorProducedBy or + SectorConsumedBy). If necessary, flow amounts are further (equally) + subdivided based on the secondary sector. + ''' + naics_key = naics.map_target_sectors_to_less_aggregated_sectors( + self.config['industry_spec']) + + fba = self.add_primary_secondary_columns('Sector') + + groupby_cols = ['group_id', 'Location'] + for rank in ['Primary', 'Secondary']: + fba = ( + fba + .merge(naics_key, how='left', left_on=f'{rank}Sector', + right_on='target_naics') + .assign( + **{f'_unique_naics_{n}_by_group': lambda x, i=n: ( + x.groupby(groupby_cols if i == 2 + else [*groupby_cols, f'_naics_{i-1}'], + dropna=False) + [[f'_naics_{i}']] + .transform('nunique', dropna=False) + ) + for n in range(2, 8)}, + FlowAmount=lambda x: reduce( + lambda x, y: x / y, + [x.FlowAmount, *[x[f'_unique_naics_{n}_by_group'] + for n in range(2, 8)]] + ) + ) + .drop(columns=naics_key.columns.values.tolist()) + ) + groupby_cols.append(f'{rank}Sector') + + return fba.drop( + columns=['PrimarySector', 'SecondarySector', + *[f'_unique_naics_{n}_by_group' for n in range(2, 8)]] + ) + def add_primary_secondary_columns( self: FB, col_type: Literal['Activity', 'Sector'] diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index 5ae1d6b79..22793210b 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -671,68 +671,6 @@ def map_to_sectors( .reset_index(drop=True) ) - def equally_attribute(self: 'FlowByActivity') -> 'FlowByActivity': - ''' - This function takes a FlowByActivity dataset with SectorProducedBy and - SectorConsumedBy columns already added and attributes flows from any - activity which is mapped to multiple industries/sectors equally across - those industries/sectors, by NAICS level. In other words, if an - activity is mapped to multiple industries/sectors, the flow amount is - equally divided across the relevant 2-digit NAICS industries. Then, - within each 2-digit industry the flow amount for that industry is - equally divided across the relevant 3-digit NAICS industries; within - each of those, the flow amount is equally divided across relevant - 4-digit NAICS industries, and so on. - - For example: - Suppose that activity A has a flow amount of 12 and is mapped to - industries 111210, 111220, and 213110, a flow amount of 3 will be - attributed to 111210, a flow amount of 3 to 111220, and a flow amount - of 6 to 213110. - - Attribution happens according to the primary sector first (see - documentation for - flowby.FlowByActivity.add_primary_secondary_sector_columns() for - details on how the primary sector is determined; in most cases, the - primary sector is the (only) non-null value out of SectorProducedBy or - SectorConsumedBy). If necessary, flow amounts are further (equally) - subdivided based on the secondary sector. - ''' - naics_key = naics.map_target_sectors_to_less_aggregated_sectors( - self.config['industry_spec']) - - fba = self.add_primary_secondary_columns('Sector') - - groupby_cols = ['group_id', 'Location'] - for rank in ['Primary', 'Secondary']: - fba = ( - fba - .merge(naics_key, how='left', left_on=f'{rank}Sector', - right_on='target_naics') - .assign( - **{f'_unique_naics_{n}_by_group': lambda x, i=n: ( - x.groupby(groupby_cols if i == 2 - else [*groupby_cols, f'_naics_{i-1}'], - dropna=False) - [[f'_naics_{i}']] - .transform('nunique', dropna=False) - ) - for n in range(2, 8)}, - FlowAmount=lambda x: reduce( - lambda x, y: x / y, - [x.FlowAmount, *[x[f'_unique_naics_{n}_by_group'] - for n in range(2, 8)]] - ) - ) - .drop(columns=naics_key.columns.values.tolist()) - ) - groupby_cols.append(f'{rank}Sector') - - return fba.drop( - columns=['PrimarySector', 'SecondarySector', - *[f'_unique_naics_{n}_by_group' for n in range(2, 8)]] - ) - def prepare_fbs( self: 'FlowByActivity', external_config_path: str = None, From 9aa5b39d042626ba992c7ca6e87c0e370e41e958 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 7 Sep 2023 10:55:19 -0600 Subject: [PATCH 0937/1127] delete test water FBS yaml --- .../Water_state_2015_m2.yaml | 38 ------------------- 1 file changed, 38 deletions(-) delete mode 100644 flowsa/methods/flowbysectormethods/Water_state_2015_m2.yaml diff --git a/flowsa/methods/flowbysectormethods/Water_state_2015_m2.yaml b/flowsa/methods/flowbysectormethods/Water_state_2015_m2.yaml deleted file mode 100644 index fe8c1f742..000000000 --- a/flowsa/methods/flowbysectormethods/Water_state_2015_m2.yaml +++ /dev/null @@ -1,38 +0,0 @@ -# This is the 2015 target year method for water m1 which builds off the generic -# method in Water_common - -!include:USEEIO_summary_target.yaml -year: 2015 -geoscale: state - -sources_to_cache: - USDA_IWMS: - !include:Water_common.yaml:sources_to_cache:USDA_IWMS - year: 2018 - -source_names: - USGS_NWIS_WU: - !include:Water_common.yaml:source_names:USGS_NWIS_WU - activity_sets: # do not import all activity sets from the common file because common file contains activity sets for multiple methods - direct_attribution: - !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:direct_attribution -# employment_attribution: -# !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:employment_attribution -# attribution_method: proportional -# attribution_source: -# Employment_national_2015: -# geoscale: national -# cropland_attribution: -# !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution -# attribution_method: proportional -# attribution_source: -# USDA_CoA_Cropland: -# !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution:attribution_source:USDA_CoA_Cropland -# year: 2017 -# livestock_attribution: -# !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:livestock_attribution -# attribution_method: proportional -# attribution_source: -# USDA_CoA_Livestock: -# !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:livestock_attribution:attribution_source:USDA_CoA_Livestock -# year: 2017 From 62522ae5565ed7cb7fdaa3f93a4db8c85f095aca Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 7 Sep 2023 11:02:49 -0600 Subject: [PATCH 0938/1127] use state employment data in water 2010 fbs --- .../methods/flowbysectormethods/Water_national_2010_m1.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Water_national_2010_m1.yaml b/flowsa/methods/flowbysectormethods/Water_national_2010_m1.yaml index 132927e2b..0ecd0dfc1 100644 --- a/flowsa/methods/flowbysectormethods/Water_national_2010_m1.yaml +++ b/flowsa/methods/flowbysectormethods/Water_national_2010_m1.yaml @@ -21,9 +21,7 @@ source_names: employment_attribution: !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:employment_attribution attribution_method: proportional - attribution_source: - Employment_national_2010: - geoscale: national + attribution_source: Employment_state_2010 cropland_attribution: !include:Water_common.yaml:source_names:USGS_NWIS_WU:activity_sets:cropland_attribution attribution_method: proportional From f64887bd28bb903a1ad7064c7abb3cee503c6893 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 7 Sep 2023 14:42:54 -0400 Subject: [PATCH 0939/1127] aggregate sectors after assigning groups in order to align group_ids with original data --- flowsa/flowby.py | 2 +- flowsa/flowbysector.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 15f4b1143..ca0062197 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -667,7 +667,7 @@ def attribute_flows_to_sectors( .rename(columns={'SourceName': 'MetaSources'}) ) elif self.config['data_format'] in ['FBS']: - fb = grouped.copy() + fb = grouped.sector_aggregation() # convert to proper industry spec. # subset the fb configuration so it only includes the # attribution_method currently being assessed - rather than all diff --git a/flowsa/flowbysector.py b/flowsa/flowbysector.py index fafbfa34c..70ee4feac 100644 --- a/flowsa/flowbysector.py +++ b/flowsa/flowbysector.py @@ -232,7 +232,10 @@ def sector_aggregation(self, industry_spec=None): how='left') .rename(columns={'target_naics': f'Sector{direction}'}) .drop(columns='source_naics') - .aggregate_flowby() + .aggregate_flowby(columns_to_group_by = ( + fbs.groupby_cols + ['group_id'] if 'group_id' in fbs + else None) + ) ) return fbs @@ -261,7 +264,6 @@ def prepare_fbs( self .function_socket('clean_fbs') .select_by_fields() - .sector_aggregation() # convert to proper industry spec. .convert_fips_to_geoscale() .attribute_flows_to_sectors(external_config_path=external_config_path, download_sources_ok=download_sources_ok) From 2b21343d398266d04603086ee08b8bc851ca4593 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 7 Sep 2023 14:43:08 -0400 Subject: [PATCH 0940/1127] fix BEA table names --- .../GHG_national_m3_common.yaml | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m3_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m3_common.yaml index afc1488ac..629773a7e 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m3_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m3_common.yaml @@ -39,7 +39,7 @@ attribution_sources: estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy attribution_method: proportional # attribution_source: # Include in main method - # BEA_Use_Detail_PRO_BeforeRedef: + # BEA_Detail_Use_PRO_BeforeRedef: # <<: *bea # selection_fields: # ActivityProducedBy: {'XXXXX': ''} @@ -79,7 +79,7 @@ source_names: electric_power: selection_fields: MetaSources: 'EPA_GHGI_T_2_1.electric_power' - attribution_method: equal + # attribution_method: equal # AttributeError: 'FlowBySector' object has no attribute 'equally_attribute' urea: @@ -87,7 +87,7 @@ source_names: MetaSources: 'EPA_GHGI_T_2_1.urea' attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'325310': ''} # Fertilizers @@ -97,7 +97,7 @@ source_names: MetaSources: 'EPA_GHGI_T_2_1.carbonate_use' attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals @@ -107,7 +107,7 @@ source_names: MetaSources: 'EPA_GHGI_T_2_1.nitrous_oxide_use' attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'325120': ''} # Industrial gases @@ -186,7 +186,7 @@ source_names2: ## SKIP - NOT YET UPDATED - Synthetic Fertilizer Cropland attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'325310': ''} # Fertilizers @@ -261,7 +261,7 @@ source_names2: ## SKIP - NOT YET UPDATED Light-Duty Trucks Gasoline: Light-Duty Trucks attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'324110': ''} # purchases of refinery products @@ -300,7 +300,7 @@ source_names2: ## SKIP - NOT YET UPDATED Medium- and Heavy-Duty Trucks Diesel On-Road: Medium- and Heavy-Duty Trucks - Distillate Fuel Oil attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'324110': ''} # purchases of refinery products @@ -312,7 +312,7 @@ source_names2: ## SKIP - NOT YET UPDATED Light-Duty Trucks Gasoline On-Road: Light-Duty Trucks attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'324110': ''} # purchases of refinery products @@ -322,7 +322,7 @@ source_names2: ## SKIP - NOT YET UPDATED PrimaryActivity: Construction/Mining Equipment Non-Road attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment @@ -332,7 +332,7 @@ source_names2: ## SKIP - NOT YET UPDATED PrimaryActivity: Agricultural Equipment Non-Road attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'333111': ''} # purchases of farm machinery @@ -342,7 +342,7 @@ source_names2: ## SKIP - NOT YET UPDATED PrimaryActivity: Other Non-Road attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'324110': ''} # purchases of refinery products @@ -353,7 +353,7 @@ source_names2: ## SKIP - NOT YET UPDATED All activities Alternative Fuel On-Road: Alternative Fuel On-Road attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'221200': ''} # purchases of natural gas @@ -383,7 +383,7 @@ source_names2: ## SKIP - NOT YET UPDATED Industrial Other Coal Industrial: Coal Industrial attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'212100': ''} # purchases of coal @@ -395,7 +395,7 @@ source_names2: ## SKIP - NOT YET UPDATED - Natural Gas Industrial attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'221200': ''} # purchases of natural gas @@ -414,7 +414,7 @@ source_names2: ## SKIP - NOT YET UPDATED - Coal - Coke and Breeze attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'212100': ''} # purchases of coal @@ -431,7 +431,7 @@ source_names2: ## SKIP - NOT YET UPDATED <<: *mecs_energy_default_selection FlowName: Natural Gas attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'221200': ''} # purchases of natural gas @@ -443,7 +443,7 @@ source_names2: ## SKIP - NOT YET UPDATED - Total Petroleum Industrial attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'324110': ''} # purchases of refinery products @@ -488,7 +488,7 @@ source_names2: ## SKIP - NOT YET UPDATED - Fuel Oil Industrial attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'324110': ''} # purchases of refinery products @@ -502,7 +502,7 @@ source_names2: ## SKIP - NOT YET UPDATED Natural Gas Industrial: Natural Gas Industrial attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'221200': ''} # purchases of natural gas @@ -512,7 +512,7 @@ source_names2: ## SKIP - NOT YET UPDATED PrimaryActivity: Coal Industrial attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'212100': ''} # purchases of coal @@ -528,7 +528,7 @@ source_names2: ## SKIP - NOT YET UPDATED <<: *mecs_energy_default_selection FlowName: Coal attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'212100': ''} # purchases of coal @@ -546,7 +546,7 @@ source_names2: ## SKIP - NOT YET UPDATED <<: *mecs_energy_default_selection FlowName: Natural Gas attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'221200': ''} # purchases of natural gas @@ -610,7 +610,7 @@ source_names2: ## SKIP - NOT YET UPDATED - Distillate Fuel Oil - Hydrocarbon Gas Liquids, excluding natural gasoline attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'324110': ''} # purchases of refineries @@ -627,7 +627,7 @@ source_names2: ## SKIP - NOT YET UPDATED FlowName: Natural Gas Unit: Trillion Btu attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'221200': ''} # purchases of natural gas @@ -637,7 +637,7 @@ source_names2: ## SKIP - NOT YET UPDATED PrimaryActivity: Transportation Lubricants attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'324110': ''} # use of petroleum products @@ -680,7 +680,7 @@ source_names2: ## SKIP - NOT YET UPDATED - Industrial Process Refrigeration attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'333415': ''} # Air conditioning equipment @@ -691,7 +691,7 @@ source_names2: ## SKIP - NOT YET UPDATED - Commercial Stationary Air Conditioning attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: {'333415': ''} # Air conditioning equipment @@ -702,7 +702,7 @@ source_names2: ## SKIP - NOT YET UPDATED - Foams attribution_method: proportional attribution_source: - BEA_Use_Detail_PRO_BeforeRedef: + BEA_Detail_Use_PRO_BeforeRedef: <<: *bea selection_fields: ActivityProducedBy: From efa85136312ec4d30c3343927b68a91ec747423b Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 8 Sep 2023 08:22:48 -0400 Subject: [PATCH 0941/1127] add FBS test for method that uses FBS as primary data source --- flowsa/test_examples.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flowsa/test_examples.py b/flowsa/test_examples.py index 3d30c86be..c38b80075 100644 --- a/flowsa/test_examples.py +++ b/flowsa/test_examples.py @@ -23,6 +23,10 @@ def test_get_flows_by_sector(): flowsa.getFlowBySector('GHG_national_2016_m1', download_FBAs_if_missing=True) + flowsa.getFlowBySector('CNHW_national_2018', + download_FBAs_if_missing=True, + download_FBS_if_missing=True) + def test_write_bibliography(): flowsa.writeFlowBySectorBibliography('Water_national_2015_m1') From e7b51a28f27124796f609f0583cef8178c953e4f Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 8 Sep 2023 08:24:13 -0400 Subject: [PATCH 0942/1127] for sequential attributions, use index to infer skipping of steps rather than re-assigning `data_format` which leads to mismatch between FB tybe and data_format and causes errors in subsequent steps --- flowsa/flowby.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index ca0062197..9a2fa164a 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -646,7 +646,7 @@ def attribute_flows_to_sectors( if isinstance(attribute_config, dict): attribute_config = [attribute_config] - for step_config in attribute_config: + for index, step_config in enumerate(attribute_config): validate = True grouped: 'FB' = ( self @@ -657,7 +657,9 @@ def attribute_flows_to_sectors( if len(grouped) == 0: log.warning(f'No data remaining in {self.full_name}.') return self - if self.config['data_format'] in ['FBA', 'FBS_outside_flowsa']: + if index > 0: + fb = grouped.copy() + elif self.config['data_format'] in ['FBA', 'FBS_outside_flowsa']: fb: 'FlowByActivity' = ( grouped .map_to_sectors(external_config_path=external_config_path) @@ -793,10 +795,6 @@ def attribute_flows_to_sectors( 'descendants'], errors='ignore') .drop(columns=step_config.get('drop_columns', [])) ) - # reset datatype to FBS because otherwise when we loop through - # to the next attribution method, the FBA will be re-cleaned and - # have additional sector columns appended - self.config.update({'data_format': 'FBS'}) return self From 72a90be990df2db659c974dc006fce328b5bd962 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 8 Sep 2023 08:27:38 -0400 Subject: [PATCH 0943/1127] add clarifying comment --- flowsa/flowby.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 9a2fa164a..e35fc71e0 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -658,6 +658,8 @@ def attribute_flows_to_sectors( log.warning(f'No data remaining in {self.full_name}.') return self if index > 0: + # On subsequent attributions, do not re-clean or append + # additional sector columns fb = grouped.copy() elif self.config['data_format'] in ['FBA', 'FBS_outside_flowsa']: fb: 'FlowByActivity' = ( From fa709d03c08e129a6d4ddaede78f3cf5f073c5cc Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 8 Sep 2023 08:54:10 -0400 Subject: [PATCH 0944/1127] update stewi `data_format` after `prepare_fbs` --- flowsa/data_source_scripts/stewiFBS.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flowsa/data_source_scripts/stewiFBS.py b/flowsa/data_source_scripts/stewiFBS.py index 38bfd49f3..70f737314 100644 --- a/flowsa/data_source_scripts/stewiFBS.py +++ b/flowsa/data_source_scripts/stewiFBS.py @@ -339,6 +339,8 @@ def prepare_stewi_fbs(df_load, config) -> 'FlowBySector': config=config, ).prepare_fbs() + fbs.config.update({'data_format': 'FBS'}) + return fbs From 6c43d0c53439f935d49c07f14315d08c1940c307 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 8 Sep 2023 08:56:16 -0400 Subject: [PATCH 0945/1127] drop stewi from source catalog and define in individual yaml files --- flowsa/data/source_catalog.yaml | 3 --- flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml | 1 + flowsa/methods/flowbysectormethods/stewiFBS_common.yaml | 3 +++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index 902b2e7c6..cc15c0e92 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -292,9 +292,6 @@ stateio: - Money activity_schema: BEA_2012_Summary_Code sector_hierarchy: "flat" -stewiFBS: - data_format: FBS - activity_schema: NAICS_2012_Code USDA_CoA_Cropland: data_format: FBA class: diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml index 6fc9c08fc..68164c06a 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml @@ -308,6 +308,7 @@ source_names: stewiFBS: data_format: FBS_outside_flowsa + activity_schema: NAICS_2012_Code FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector # inventory_dict: # assign in primary method # NEI: 2017 diff --git a/flowsa/methods/flowbysectormethods/stewiFBS_common.yaml b/flowsa/methods/flowbysectormethods/stewiFBS_common.yaml index 4902b1d05..a2459a513 100644 --- a/flowsa/methods/flowbysectormethods/stewiFBS_common.yaml +++ b/flowsa/methods/flowbysectormethods/stewiFBS_common.yaml @@ -1,6 +1,7 @@ GRDREL: data_format: FBS_outside_flowsa + activity_schema: NAICS_2012_Code FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector # Below are arguments needed by the stewicombo_to_sector function inventory_dict: @@ -11,6 +12,7 @@ GRDREL: TRI_DMR: data_format: FBS_outside_flowsa + activity_schema: NAICS_2012_Code FBS_datapull_fxn: !script_function:stewiFBS stewicombo_to_sector # Below are arguments needed by the stewicombo_to_sector function inventory_dict: @@ -22,6 +24,7 @@ TRI_DMR: CRHW: data_format: FBS_outside_flowsa + activity_schema: NAICS_2012_Code FBS_datapull_fxn: !script_function:stewiFBS stewi_to_sector # Below are arguments needed by the stewicombo_to_sector function inventory_dict: From ceab720734009d03e5620acca0801b8d06e4af3f Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 8 Sep 2023 09:09:18 -0400 Subject: [PATCH 0946/1127] change data loss to warning --- flowsa/flowby.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index e35fc71e0..5aa9e2bf9 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -781,8 +781,8 @@ def attribute_flows_to_sectors( log.info(f"No change in {self.full_name} FlowAmount after " "attribution.") else: - log.info(f"Percent change in {self.full_name} after " - f"attribution is {percent_change}%") + log.warning(f"Percent change in {self.full_name} after " + f"attribution is {percent_change}%") # run function to clean fbs after attribution attributed_fb = attributed_fb.function_socket( From 9fa138fed4df4c7c9bb6559ccc0c8a894746c69f Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 8 Sep 2023 10:36:05 -0400 Subject: [PATCH 0947/1127] complete detail national m3 --- .../GHG_national_2019_m2.yaml | 12 +- .../GHG_national_2019_m3.yaml | 145 +++++ .../GHG_national_m2_common.yaml | 26 +- .../GHG_national_m3_common.yaml | 608 +++++++----------- 4 files changed, 413 insertions(+), 378 deletions(-) create mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2019_m3.yaml diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml index da7ad2234..baa8bd800 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml @@ -189,17 +189,17 @@ source_names: year: *ghgi_year activity_sets: # Update EIA_MECS year for some activity_sets !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets - petroleum: - !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum + petroleum_neu: + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu attribution_source: EIA_MECS_Energy: - !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum:attribution_source:EIA_MECS_Energy + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy year: *mecs_year - natural_gas: - !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas + natural_gas_neu: + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu attribution_source: EIA_MECS_Energy: - !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas:attribution_source:EIA_MECS_Energy + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy year: *mecs_year transportation_lubricants: !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2019_m3.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2019_m3.yaml new file mode 100644 index 000000000..3a533038b --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_national_2019_m3.yaml @@ -0,0 +1,145 @@ +# This is a 2019 target year specific implementation of GHG_national_m3 +# All parameters add year specific data when needed to implement for 2019 +# GHGI FBA table names match the 2022 GHGI Report +# MECS year is 2018 +# CoA year is 2017 + +!include:GHG_national_m3_common.yaml +ghgi_year: &ghgi_year 2019 +mecs_year: &mecs_year 2018 + +source_names: + GHG_national_2019_m2: # National Summary model + !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2 + year: *ghgi_year + activity_sets: # Update MECS year for some activity sets + !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets + + coal_manufacturing_co2: # Industrial Coal for Manufacturing + !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets:coal_manufacturing_co2 + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy + year: *mecs_year + + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing + !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets:natural_gas_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + coal_manufacturing: + !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + ng_manufacturing: + !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + petroleum_neu: # consumed petroleum products + !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets:petroleum_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + + natural_gas_neu: # consumed nat gas to chemical plants + !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets:natural_gas_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + + + EPA_GHGI_T_2_1: #U.S. GHG emissions + !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_2_1 + year: *ghgi_year + EPA_GHGI_T_3_68: #CH4 from Natural Gas Systems + !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_3_68 + year: *ghgi_year + EPA_GHGI_T_3_70: #CO2 from Natural Gas Systems mimics CH4 + !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_3_70 + year: *ghgi_year + EPA_GHGI_T_3_72: #N2O from Natural Gas Systems, not used in original method, mimics CH4 + !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_3_72 + year: *ghgi_year + + EPA_GHGI_T_3_42: #CH4 from Petroleum Systems + !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_3_42 + year: *ghgi_year + EPA_GHGI_T_3_44: #CO2 from Petroleum Systems mimics CH4 + !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_3_44 + year: *ghgi_year + EPA_GHGI_T_3_46: #N2O from Petroleum Systems, not in prior method, mimics CH4 + !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_3_46 + year: *ghgi_year + +## Agriculture + EPA_GHGI_T_5_28: #CH4, N2O, CO and NOx from field burning of residues + !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_5_28 + year: *ghgi_year + EPA_GHGI_T_5_3: #CH4 from Enteric Fermentation + !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_5_3 + year: *ghgi_year + EPA_GHGI_T_5_6: #CH4 and N2O from manure, mimics enteric fermentation + !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_5_6 + year: *ghgi_year + +## Mobile Sources + EPA_GHGI_T_3_13: #CO2 from mobile combustion + !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year + EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion + !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_3_14 + year: *ghgi_year + EPA_GHGI_T_3_15: #N2O from mobile combustion duplicates method for CH4 + !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_3_15 + year: *ghgi_year + +## Stationary Combustion + EPA_GHGI_T_A_6: + !include:GHG_national_m3_common.yaml:source_names:GHGI_CO2_stationary_combustion + year: *ghgi_year + EPA_GHGI_T_3_8: # CH4 emissions from stationary combustion + !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_3_8 + year: *ghgi_year + EPA_GHGI_T_3_9: # N2O emissions from stationary combustion + !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_3_9 + year: *ghgi_year + +## Other sources + EPA_GHGI_T_4_46: #CO2 for selected petrochemicals + !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_4_46 + year: *ghgi_year + + EPA_GHGI_T_3_22b: # Fossil fuel for non-energy uses + !include:GHG_national_m3_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + year: *ghgi_year + +## Other Emissions + EPA_GHGI_T_4_50: # HFCs from HCFC-22 production + !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_4_50 + year: *ghgi_year + + EPA_GHGI_T_4_96: # HFCs and other emissions from electronics manufacture + !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_4_96 + year: *ghgi_year + + EPA_GHGI_T_4_102: # HFCs and PFCs from ODS Substitutes + !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_4_102 + year: *ghgi_year + + EPA_GHGI_T_A_97: # HFCs from Transportation + !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_A_97 + year: *ghgi_year + + EPA_GHGI_T_4_80: # PFCs from aluminum production + !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_4_80 + year: *ghgi_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml index 225ffc22e..bf198fdf0 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml @@ -72,7 +72,6 @@ source_names: - Ferroalloy Production #CO2, CH4 - Glass Production #CO2 - Landfills #CH4 - - Lead Production #CO2 - Lime Production #CO2 - Incineration of Waste #CO2, #N2O - Iron and Steel Production & Metallurgical Coke Production #CO2, CH4 @@ -103,6 +102,11 @@ source_names: selection_fields: ActivityConsumedBy: {'22': ''} # Utilities (221100) + liming: + selection_fields: + PrimaryActivity: Liming #CO2 + attribution_method: equal + urea: selection_fields: PrimaryActivity: @@ -114,6 +118,11 @@ source_names: selection_fields: ActivityProducedBy: {'325': ''} # Chemicals (325310) + urea_fertilizer: + selection_fields: + PrimaryActivity: Urea Fertilization #CO2 + attribution_method: equal + carbonate_use: selection_fields: PrimaryActivity: Other Process Uses of Carbonates #CO2 @@ -124,6 +133,11 @@ source_names: selection_fields: ActivityProducedBy: {'325': ''} # Chemicals (325180) + lead: + selection_fields: + PrimaryActivity: Lead Production #CO2 + attribution_method: direct + nitrous_oxide_use: selection_fields: PrimaryActivity: N2O from Product Uses #N2O @@ -134,12 +148,6 @@ source_names: selection_fields: ActivityProducedBy: {'325': ''} # Chemicals (325120) - equal: - selection_fields: - PrimaryActivity: - - Liming #CO2 - - Urea Fertilization #CO2 - attribution_method: equal ## Fossil Fuels @@ -608,7 +616,7 @@ source_names: - Industry Industrial Other Coal attribution_method: direct - petroleum: # consumed petroleum products + petroleum_neu: # consumed petroleum products selection_fields: PrimaryActivity: 'Industry Asphalt & Road Oil': Industry Petroleum Products Non-energy @@ -642,7 +650,7 @@ source_names: # selection_fields: # ActivityProducedBy: {'324110': ''} # purchases of refineries - natural_gas: # consumed nat gas to chemical plants + natural_gas_neu: # consumed nat gas to chemical plants selection_fields: PrimaryActivity: Industry Natural Gas to Chemical Plants attribution_method: proportional diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m3_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m3_common.yaml index 629773a7e..5268a6274 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m3_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m3_common.yaml @@ -71,16 +71,15 @@ attribution_sources: estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution source_names: - GHG_national_2019_m2: + GHG_national_m2: # National Summary model data_format: FBS - year: *ghgi_year + # year: *ghgi_year activity_sets: ## Table 2.1 electric_power: selection_fields: MetaSources: 'EPA_GHGI_T_2_1.electric_power' - # attribution_method: equal - # AttributeError: 'FlowBySector' object has no attribute 'equally_attribute' + attribution_method: equal urea: selection_fields: @@ -113,77 +112,11 @@ source_names: ActivityProducedBy: {'325120': ''} # Industrial gases - EPA_GHGI_T_2_1: #U.S. GHG emissions - # year: # override this - fedefl_mapping: GHGI - activity_sets: - direct: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:direct - - electricity_transmission: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electricity_transmission - - liming: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming - # selection_fields: - # PrimaryActivity: Liming #CO2 - # attribution_method: proportional - # attribution_source: - # BEA_Detail_Use_PRO_BeforeRedef: - # <<: *bea - # selection_fields: - # ActivityProducedBy: {'327400': ''} # Lime - - urea_fertilizer: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea - selection_fields: # Only uses one activity from this activity_set - PrimaryActivity: - - Urea Fertilization #CO2 - # attribution_method: proportional - # attribution_source: - # BEA_Detail_Use_PRO_BeforeRedef: - # <<: *bea - # selection_fields: - # ActivityProducedBy: {'325310': ''} # Fertilizers - - lead: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead - - -## Fossil Fuels - EPA_GHGI_T_3_68: #CH4 from Natural Gas Systems - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 - EPA_GHGI_T_3_70: #CO2 from Natural Gas Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 - EPA_GHGI_T_3_72: #N2O from Natural Gas Systems, not used in original method, mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 - - EPA_GHGI_T_3_42: #CH4 from Petroleum Systems - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 - EPA_GHGI_T_3_44: #CO2 from Petroleum Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 - EPA_GHGI_T_3_46: #N2O from Petroleum Systems, not in prior method, mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 - -## Agriculture - EPA_GHGI_T_5_28: #CH4, N2O, CO and NOx from field burning of residues - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 - EPA_GHGI_T_5_3: #CH4 from Enteric Fermentation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 - EPA_GHGI_T_5_6: #CH4 and N2O from manure, mimics enteric fermentation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 - -source_names2: ## SKIP - NOT YET UPDATED - EPA_GHGI_T_5_17: #Direct N2O emissions from agricultural soils - # year: # override this - fedefl_mapping: GHGI - activity_sets: - fertilizer_use: &fertilizer # allocated based on fertilizer use + fertilizer_use: # allocated based on fertilizer use selection_fields: - PrimaryActivity: - - Organic Amendment Cropland - - Residue N Cropland - - Synthetic Fertilizer Cropland + MetaSources: + - 'EPA_GHGI_T_5_17.fertilizer_use' + - 'EPA_GHGI_T_5_18.fertilizer_use' attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: @@ -193,72 +126,21 @@ source_names2: ## SKIP - NOT YET UPDATED cropland: # allocated based on USDA land area harvested selection_fields: - PrimaryActivity: - - Mineralization and Asymbiotic Fixation Cropland - - Drained Organic Soils Cropland + MetaSources: 'EPA_GHGI_T_5_17.cropland' attribution_method: proportional attribution_source: *cropland_allocation - pasture: &pasture # allocated based on USDA Animal operation land (acres) + pasture: # allocated based on USDA Animal operation land (acres) selection_fields: - PrimaryActivity: - - All activities Grassland + MetaSources: + - 'EPA_GHGI_T_5_17.pasture' + - 'EPA_GHGI_T_5_18.pasture' attribution_method: proportional attribution_source: *animal_land_allocation - EPA_GHGI_T_5_18: #Indirect N2O emissions from agricultural soils - # year: # override this - fedefl_mapping: GHGI - activity_sets: - fertilizer_use: # allocated based on fertilizer use - <<: *fertilizer - selection_fields: - PrimaryActivity: - - Volatilization & Atm. Deposition Cropland - - Surface Leaching & Run-Off Cropland - pasture: # allocated based on USDA Animal operation land (acres) - <<: *pasture - - -## Mobile Sources - EPA_GHGI_T_3_13: #CO2 from mobile combustion - fedefl_mapping: GHGI - activity_sets: - direct_petroleum: - selection_fields: - PrimaryActivity: - General Aviation Aircraft Aviation Gasoline: General Aviation Aircraft - General Aviation Aircraft Jet Fuel: General Aviation Aircraft - Commercial Aircraft Jet Fuel: Commercial Aircraft - Military Aircraft Jet Fuel: Military Aircraft - Buses Gasoline: Buses - Buses LPG: Buses - Motorcycles Gasoline: Motorcycles - Rail Distillate Fuel Oil: Rail - Recreational Boats Distillate Fuel Oil: Recreational Boats - Recreational Boats Gasoline: Recreational Boats - Ships and Non-Recreational Boats Distillate Fuel Oil: Ships and Non-Recreational Boats - Ships and Non-Recreational Boats Residual Fuel Oil: Ships and Non-Recreational Boats - Medium- and Heavy-Duty Trucks Gasoline: Medium- and Heavy-Duty Trucks - Medium- and Heavy-Duty Trucks LPG: Medium- and Heavy-Duty Trucks - Light-Duty Trucks LPG: Light-Duty Trucks - Households - Passenger Cars LPG: Passenger Cars - Households - attribution_method: direct - direct_ng: - selection_fields: - PrimaryActivity: - Buses Natural Gas: Buses - Pipeline Natural Gas: Pipeline Natural Gas - petroleum_fuels: selection_fields: - PrimaryActivity: - Medium- and Heavy-Duty Trucks Distillate Fuel Oil: Medium- and Heavy-Duty Trucks - Distillate Fuel Oil - Buses Distillate Fuel Oil: Buses - Distillate Fuel Oil - Passenger Cars Distillate Fuel Oil: Passenger Cars - Passenger Cars Gasoline: Passenger Cars - Light-Duty Trucks Distillate Fuel Oil: Light-Duty Trucks - Light-Duty Trucks Gasoline: Light-Duty Trucks + MetaSources: 'EPA_GHGI_T_3_13.petroleum_fuels' attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: @@ -266,38 +148,11 @@ source_names2: ## SKIP - NOT YET UPDATED selection_fields: ActivityProducedBy: {'324110': ''} # purchases of refinery products - - EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion - fedefl_mapping: GHGI - activity_sets: - direct_gasoline: - selection_fields: - PrimaryActivity: - Motorcycles Gasoline On-Road: Motorcycles - Medium- and Heavy-Duty Trucks and Buses Gasoline On-Road: Medium- and Heavy-Duty Trucks and Buses - attribution_method: direct - - direct_diesel: - selection_fields: - PrimaryActivity: - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road: Medium- and Heavy-Duty Trucks and Buses - attribution_method: direct - - direct_non_road: - selection_fields: - PrimaryActivity: - Rail Non-Road: Rail - Ships and Boats Non-Road: Ships and Boats - Aircraft Non-Road: General Aviation Aircraft - attribution_method: direct - petroleum_fuels_diesel: selection_fields: - PrimaryActivity: - Passenger Cars Diesel On-Road: Passenger Cars - Light-Duty Trucks Diesel On-Road: Light-Duty Trucks - Medium- and Heavy-Duty Buses Diesel On-Road: Buses - Distillate Fuel Oil - Medium- and Heavy-Duty Trucks Diesel On-Road: Medium- and Heavy-Duty Trucks - Distillate Fuel Oil + MetaSources: + - 'EPA_GHGI_T_3_14.petroleum_fuels_diesel' + - 'EPA_GHGI_T_3_15.petroleum_fuels_diesel' attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: @@ -307,9 +162,9 @@ source_names2: ## SKIP - NOT YET UPDATED petroleum_fuels_gasoline: selection_fields: - PrimaryActivity: - Passenger Cars Gasoline On-Road: Passenger Cars - Light-Duty Trucks Gasoline On-Road: Light-Duty Trucks + MetaSources: + - 'EPA_GHGI_T_3_14.petroleum_fuels_gasoline' + - 'EPA_GHGI_T_3_15.petroleum_fuels_gasoline' attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: @@ -319,7 +174,9 @@ source_names2: ## SKIP - NOT YET UPDATED construction_and_mining: #this set is allocated by purchases of construction equipment selection_fields: - PrimaryActivity: Construction/Mining Equipment Non-Road + MetaSources: + - 'EPA_GHGI_T_3_14.construction_and_mining' + - 'EPA_GHGI_T_3_15.construction_and_mining' attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: @@ -329,7 +186,9 @@ source_names2: ## SKIP - NOT YET UPDATED farm_non_road: #this set is allocated by purchases of farm machinery selection_fields: - PrimaryActivity: Agricultural Equipment Non-Road + MetaSources: + - 'EPA_GHGI_T_3_14.farm_non_road' + - 'EPA_GHGI_T_3_15.farm_non_road' attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: @@ -339,7 +198,9 @@ source_names2: ## SKIP - NOT YET UPDATED other_non_road: #this set is allocated by purchases of petroleum refining selection_fields: - PrimaryActivity: Other Non-Road + MetaSources: + - 'EPA_GHGI_T_3_14.other_non_road' + - 'EPA_GHGI_T_3_15.other_non_road' attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: @@ -349,8 +210,9 @@ source_names2: ## SKIP - NOT YET UPDATED alt_fuel_on_road: #this set is allocated by purchases of natural gas selection_fields: - PrimaryActivity: - All activities Alternative Fuel On-Road: Alternative Fuel On-Road + MetaSources: + - 'EPA_GHGI_T_3_14.alt_fuel_on_road' + - 'EPA_GHGI_T_3_15.alt_fuel_on_road' attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: @@ -358,29 +220,18 @@ source_names2: ## SKIP - NOT YET UPDATED selection_fields: ActivityProducedBy: {'221200': ''} # purchases of natural gas - EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 - - -## Stationary Combustion - GHGI_CO2_stationary_combustion_and_transport: # CO2 emissions from stationary combustion - fedefl_mapping: GHGI - # year: # override this - clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion - # clean_parameter: # Override each year for use in allocate_industrial_combustion - # energy_fba: 'EIA_MECS_Energy' - # year: 2018 - # ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table - activity_sets: - direct_attribution: #direct allocation - selection_fields: - PrimaryActivity: Total (All Fuels) Residential - attribution_method: direct - non-manufacturing_coal: selection_fields: - PrimaryActivity: - Commercial Coal Commercial: Coal Commercial - Industrial Other Coal Industrial: Coal Industrial + MetaSources: + - 'EPA_GHGI_T_A_5.non-manufacturing_coal' + - 'EPA_GHGI_T_A_6.non-manufacturing_coal' + - 'EPA_GHGI_T_A_7.non-manufacturing_coal' + - 'EPA_GHGI_T_A_8.non-manufacturing_coal' + - 'EPA_GHGI_T_A_9.non-manufacturing_coal' + - 'EPA_GHGI_T_A_10.non-manufacturing_coal' + - 'EPA_GHGI_T_A_11.non-manufacturing_coal' + - 'EPA_GHGI_T_A_12.non-manufacturing_coal' + - 'EPA_GHGI_T_A_13.non-manufacturing_coal' attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: @@ -390,9 +241,16 @@ source_names2: ## SKIP - NOT YET UPDATED non-manufacturing_natural_gas: # Applies to non-manufacturing sectors like ag and mining selection_fields: - PrimaryActivity: - - Natural Gas Commercial - - Natural Gas Industrial + MetaSources: + - 'EPA_GHGI_T_A_5.non-manufacturing_natural_gas' + - 'EPA_GHGI_T_A_6.non-manufacturing_natural_gas' + - 'EPA_GHGI_T_A_7.non-manufacturing_natural_gas' + - 'EPA_GHGI_T_A_8.non-manufacturing_natural_gas' + - 'EPA_GHGI_T_A_9.non-manufacturing_natural_gas' + - 'EPA_GHGI_T_A_10.non-manufacturing_natural_gas' + - 'EPA_GHGI_T_A_11.non-manufacturing_natural_gas' + - 'EPA_GHGI_T_A_12.non-manufacturing_natural_gas' + - 'EPA_GHGI_T_A_13.non-manufacturing_natural_gas' attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: @@ -400,10 +258,18 @@ source_names2: ## SKIP - NOT YET UPDATED selection_fields: ActivityProducedBy: {'221200': ''} # purchases of natural gas - coal_manufacturing: # Industrial Coal for Manufacturing - selection_fields: - PrimaryActivity: - Industrial Other Coal Industrial - Manufacturing: Coal Industrial - Manufacturing + coal_manufacturing_co2: # Industrial Coal for Manufacturing + selection_fields: + MetaSources: + - 'EPA_GHGI_T_A_5.coal_manufacturing' + - 'EPA_GHGI_T_A_6.coal_manufacturing' + - 'EPA_GHGI_T_A_7.coal_manufacturing' + - 'EPA_GHGI_T_A_8.coal_manufacturing' + - 'EPA_GHGI_T_A_9.coal_manufacturing' + - 'EPA_GHGI_T_A_10.coal_manufacturing' + - 'EPA_GHGI_T_A_11.coal_manufacturing' + - 'EPA_GHGI_T_A_12.coal_manufacturing' + - 'EPA_GHGI_T_A_13.coal_manufacturing' attribution_method: proportional attribution_source: EIA_MECS_Energy: @@ -421,8 +287,16 @@ source_names2: ## SKIP - NOT YET UPDATED natural_gas_manufacturing: # Industrial Natural Gas for manufacturing selection_fields: - PrimaryActivity: - - Natural Gas Industrial - Manufacturing + MetaSources: + - 'EPA_GHGI_T_A_5.natural_gas_manufacturing' + - 'EPA_GHGI_T_A_6.natural_gas_manufacturing' + - 'EPA_GHGI_T_A_7.natural_gas_manufacturing' + - 'EPA_GHGI_T_A_8.natural_gas_manufacturing' + - 'EPA_GHGI_T_A_9.natural_gas_manufacturing' + - 'EPA_GHGI_T_A_10.natural_gas_manufacturing' + - 'EPA_GHGI_T_A_11.natural_gas_manufacturing' + - 'EPA_GHGI_T_A_12.natural_gas_manufacturing' + - 'EPA_GHGI_T_A_13.natural_gas_manufacturing' attribution_method: proportional attribution_source: EIA_MECS_Energy: @@ -438,9 +312,16 @@ source_names2: ## SKIP - NOT YET UPDATED petroleum: # Petroleum selection_fields: - PrimaryActivity: - - Total Petroleum Commercial - - Total Petroleum Industrial + MetaSources: + - 'EPA_GHGI_T_A_5.petroleum' + - 'EPA_GHGI_T_A_6.petroleum' + - 'EPA_GHGI_T_A_7.petroleum' + - 'EPA_GHGI_T_A_8.petroleum' + - 'EPA_GHGI_T_A_9.petroleum' + - 'EPA_GHGI_T_A_10.petroleum' + - 'EPA_GHGI_T_A_11.petroleum' + - 'EPA_GHGI_T_A_12.petroleum' + - 'EPA_GHGI_T_A_13.petroleum' attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: @@ -448,44 +329,22 @@ source_names2: ## SKIP - NOT YET UPDATED selection_fields: ActivityProducedBy: {'324110': ''} # purchases of refinery products - - EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion - # year: #override this with ghgi_year - clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion - # clean_parameter: # Override each year for use in allocate_industrial_combustion - # energy_fba: 'EIA_MECS_Energy' - # year: 2018 - # ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table - fedefl_mapping: GHGI - activity_sets: - residential: - selection_fields: - PrimaryActivity: - - Fuel Oil Residential - - Coal Residential - - Natural Gas Residential - - Wood Residential - attribution_method: direct - electric_power: selection_fields: - PrimaryActivity: - Coal Electric Power: Coal Electric Power - Natural Gas Electric Power: Natural Gas Electric Power - Natural gas Electric Power: Natural Gas Electric Power # fix capitalization - Fuel Oil Electric Power: Fuel Oil Electric Power - Wood Electric Power: Wood Electric Power + MetaSources: + - 'EPA_GHGI_T_3_8.electric_power' + - 'EPA_GHGI_T_3_9.electric_power' attribution_method: proportional attribution_source: - BEA_Make_Detail_BeforeRedef: + BEA_Detail_Make_BeforeRedef: <<: *bea selection_fields: ActivityConsumedBy: {'221100': ''} # Electricity fuel_oil: selection_fields: - PrimaryActivity: - - Fuel Oil Commercial - - Fuel Oil Industrial + MetaSources: + - 'EPA_GHGI_T_3_8.fuel_oil' + - 'EPA_GHGI_T_3_9.fuel_oil' attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: @@ -495,11 +354,9 @@ source_names2: ## SKIP - NOT YET UPDATED natural_gas_nonmanufacturing: # Commercial Natural gas selection_fields: - PrimaryActivity: - Natural gas Commercial: Natural Gas Commercial # fix capitalization - Natural gas Industrial: Natural Gas Industrial # fix capitalization - Natural Gas Commercial: Natural Gas Commercial - Natural Gas Industrial: Natural Gas Industrial + MetaSources: + - 'EPA_GHGI_T_3_8.natural_gas_nonmanufacturing' + - 'EPA_GHGI_T_3_9.natural_gas_nonmanufacturing' attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: @@ -509,7 +366,9 @@ source_names2: ## SKIP - NOT YET UPDATED coal_nonmanufacturing: selection_fields: - PrimaryActivity: Coal Industrial + MetaSources: + - 'EPA_GHGI_T_3_8.coal_nonmanufacturing' + - 'EPA_GHGI_T_3_9.coal_nonmanufacturing' attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: @@ -519,7 +378,9 @@ source_names2: ## SKIP - NOT YET UPDATED coal_manufacturing: selection_fields: - PrimaryActivity: Coal Industrial - Manufacturing + MetaSources: + - 'EPA_GHGI_T_3_8.coal_manufacturing' + - 'EPA_GHGI_T_3_9.coal_manufacturing' attribution_method: proportional attribution_source: EIA_MECS_Energy: @@ -535,9 +396,9 @@ source_names2: ## SKIP - NOT YET UPDATED ng_manufacturing: selection_fields: - PrimaryActivity: - - Natural gas Industrial - Manufacturing - - Natural Gas Industrial - Manufacturing + MetaSources: + - 'EPA_GHGI_T_3_8.ng_manufacturing' + - 'EPA_GHGI_T_3_9.ng_manufacturing' attribution_method: proportional attribution_source: EIA_MECS_Energy: @@ -551,53 +412,11 @@ source_names2: ## SKIP - NOT YET UPDATED selection_fields: ActivityProducedBy: {'221200': ''} # purchases of natural gas - #Intentionally left out 'Wood Commercial' and 'Wood Industrial' - - EPA_GHGI_T_3_9: - <<: *stationary_combustion # N2O emissions from stationary combustion - -## Other sources - EPA_GHGI_T_4_46: #CO2 for selected petrochemicals - # year: # override with ghgi_year - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: - - Acrylonitrile - - Carbon Black - - Ethylene - - Ethylene Dichloride - - Ethylene Oxide - - Methanol - attribution_method: direct - - GHGI_nonenergy_fossil_fuel_emissions: # Fossil fuel for non-energy uses - # year: #override with ghgi_year - fedefl_mapping: GHGI - activity_sets: - coal: + petroleum_neu: # consumed petroleum products selection_fields: - PrimaryActivity: - - Industry Industrial Coking Coal - - Industry Industrial Other Coal - attribution_method: direct - - petroleum: # consumed petroleum products - selection_fields: - PrimaryActivity: - 'Industry Asphalt & Road Oil': Industry Petroleum Products Non-energy - Industry Distillate Fuel Oil: Industry Petroleum Products Non-energy - Industry LPG: Industry Petroleum Products Non-energy - Industry Lubricants: Industry Petroleum Products Non-energy - Industry Miscellaneous Products: Industry Petroleum Products Non-energy - 'Industry Naphtha (<401 F)': Industry Petroleum Products Non-energy - 'Industry Other Oil (>401 F)': Industry Petroleum Products Non-energy - Industry Pentanes Plus: Industry Petroleum Products Non-energy - Industry Petroleum Coke: Industry Petroleum Products Non-energy - Industry Special Naphtha: Industry Petroleum Products Non-energy - Industry Still Gas: Industry Petroleum Products Non-energy - Industry Waxes: Industry Petroleum Products Non-energy - Industry Natural Gasoline: Industry Petroleum Products Non-energy #T_3_22. Also produced by nat gas plants - Industry HGL: Industry Petroleum Products Non-energy #T_3_22. Also produced by nat gas plants + MetaSources: + - 'EPA_GHGI_T_3_22.petroleum_neu' + - 'EPA_GHGI_T_3_22b.petroleum_neu' attribution_method: proportional attribution_source: EIA_MECS_Energy: @@ -615,9 +434,11 @@ source_names2: ## SKIP - NOT YET UPDATED selection_fields: ActivityProducedBy: {'324110': ''} # purchases of refineries - natural_gas: # consumed nat gas to chemical plants + natural_gas_neu: # consumed nat gas to chemical plants selection_fields: - PrimaryActivity: Industry Natural Gas to Chemical Plants + MetaSources: + - 'EPA_GHGI_T_3_22.natural_gas_neu' + - 'EPA_GHGI_T_3_22b.natural_gas_neu' attribution_method: proportional attribution_source: EIA_MECS_Energy: @@ -634,7 +455,9 @@ source_names2: ## SKIP - NOT YET UPDATED transportation_lubricants: selection_fields: - PrimaryActivity: Transportation Lubricants + MetaSources: + - 'EPA_GHGI_T_3_22.transportation_lubricants' + - 'EPA_GHGI_T_3_22b.transportation_lubricants' attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: @@ -642,42 +465,10 @@ source_names2: ## SKIP - NOT YET UPDATED selection_fields: ActivityProducedBy: {'324110': ''} # use of petroleum products -## Other Emissions - EPA_GHGI_T_4_50: # HFCs from HCFC-22 production - # year: # override with ghgi_year - fedefl_mapping: GHGI - selection_fields: - Unit: MMT CO2e # drop records in kt - PrimaryActivity: HCFC-22 Production - attribution_method: direct - - EPA_GHGI_T_4_96: # HFCs and other emissions from electronics manufacture - # year: # override with ghgi_year - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: Electronics Production - attribution_method: direct - - EPA_GHGI_T_4_102: # HFCs and PFCs from ODS Substitutes - clean_fba_before_activity_sets: !script_function:EPA_GHGI split_HFCs_by_type - clean_parameter: - # Proportions of specific HFCs are assigned based on national total - flow_fba: EPA_GHGI_T_4_100 - # year: # override with ghgi_year - fedefl_mapping: GHGI - activity_sets: - households: - selection_fields: - PrimaryActivity: - - Domestic Refrigeration - - Residential Stationary Air Conditioning - attribution_method: direct refrigerants: selection_fields: - PrimaryActivity: - - Commercial Refrigeration - - Industrial Process Refrigeration + MetaSources: 'EPA_GHGI_T_4_102.refrigerants' attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: @@ -687,8 +478,7 @@ source_names2: ## SKIP - NOT YET UPDATED air_conditioning: selection_fields: - PrimaryActivity: - - Commercial Stationary Air Conditioning + MetaSources: 'EPA_GHGI_T_4_102.air_conditioning' attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: @@ -698,8 +488,7 @@ source_names2: ## SKIP - NOT YET UPDATED foams: selection_fields: - PrimaryActivity: - - Foams + MetaSources: 'EPA_GHGI_T_4_102.foams' attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: @@ -709,45 +498,138 @@ source_names2: ## SKIP - NOT YET UPDATED '326140': '' # Polystyrene foam '326150': '' # Urethane and other foam - # 'Mobile Air Conditioning' and 'Transport Refrigeration' come from - # different table. - # Intentionally left out 'Solvents', 'Aerosols', 'Fire Protection' + magnesium: + selection_fields: + MetaSources: 'EPA_GHGI_T_4_86' + attribution_method: proportional + attribution_source: + BEA_Detail_Make_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {T008: ''} # Total Output - EPA_GHGI_T_A_97: # HFCs from Transportation - # year: # override with ghgi_year - clean_fba_before_mapping: !script_function:EPA_GHGI split_HFCs_by_type - clean_parameter: - # Proportions of specific HFCs are assigned based on national total - flow_fba: EPA_GHGI_T_4_100 + + + EPA_GHGI_T_2_1: #U.S. GHG emissions + # year: # override this fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: - Mobile AC - Passenger Cars: Passenger Cars - Households - Mobile AC - Light-Duty Trucks: Light-Duty Trucks - Households - Mobile AC - Heavy-Duty Vehicles: Heavy-Duty Vehicles - Comfort Cooling for Trains and Buses - School and Tour Buses: School and Tour Buses - # Comfort Cooling for Trains and Buses - Transit Buses: Transit Buses #excluded - Comfort Cooling for Trains and Buses - Rail: Rail - Refrigerated Transport - Medium- and Heavy-Duty Trucks: Medium- and Heavy-Duty Trucks - Refrigerated Transport - Rail: Rail - Refrigerated Transport - Ships and Boats: Ships and Boats - attribution_method: direct + activity_sets: + direct: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:direct - EPA_GHGI_T_4_80: # PFCs from aluminum production - # year: # override with ghgi_year + electricity_transmission: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electricity_transmission + + liming: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming + # selection_fields: + # PrimaryActivity: Liming #CO2 + # attribution_method: proportional + # attribution_source: + # BEA_Detail_Use_PRO_BeforeRedef: + # <<: *bea + # selection_fields: + # ActivityProducedBy: {'327400': ''} # Lime + + urea_fertilizer: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea + selection_fields: # Only uses one activity from this activity_set + PrimaryActivity: + - Urea Fertilization #CO2 + # attribution_method: proportional + # attribution_source: + # BEA_Detail_Use_PRO_BeforeRedef: + # <<: *bea + # selection_fields: + # ActivityProducedBy: {'325310': ''} # Fertilizers + + lead: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead + + +## Fossil Fuels + EPA_GHGI_T_3_68: #CH4 from Natural Gas Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 + EPA_GHGI_T_3_70: #CO2 from Natural Gas Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 + EPA_GHGI_T_3_72: #N2O from Natural Gas Systems, not used in original method, mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 + + EPA_GHGI_T_3_42: #CH4 from Petroleum Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 + EPA_GHGI_T_3_44: #CO2 from Petroleum Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 + EPA_GHGI_T_3_46: #N2O from Petroleum Systems, not in prior method, mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 + +## Agriculture + EPA_GHGI_T_5_28: #CH4, N2O, CO and NOx from field burning of residues + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 + EPA_GHGI_T_5_3: #CH4 from Enteric Fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 + EPA_GHGI_T_5_6: #CH4 and N2O from manure, mimics enteric fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 + +## Mobile Sources + EPA_GHGI_T_3_13: #CO2 from mobile combustion + fedefl_mapping: GHGI + activity_sets: + direct_petroleum: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:direct_petroleum + direct_ng: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:direct_ng + + EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion + fedefl_mapping: GHGI + activity_sets: + direct_gasoline: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:direct_gasoline + direct_non_road: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:direct_non_road + + EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 + + +## Stationary Combustion + GHGI_CO2_stationary_combustion: # CO2 emissions from stationary combustion fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: Aluminum Production - attribution_method: direct + activity_sets: + direct_attribution: #direct allocation + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:direct_attribution + + EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion + fedefl_mapping: GHGI + activity_sets: + residential: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:residential + + EPA_GHGI_T_3_9: *stationary_combustion # N2O emissions from stationary combustion + +## Other sources + EPA_GHGI_T_4_46: #CO2 for selected petrochemicals + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 - EPA_GHGI_T_4_86: # HFCs, SF6, CO2 from magnesium production - # year: # override with ghgi_year + GHGI_nonenergy_fossil_fuel_emissions: # Fossil fuel for non-energy uses fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: Magnesium Production and Processing - attribution_method: proportional - attribution_source: - BEA_Make_Detail_BeforeRedef: - <<: *bea - selection_fields: - ActivityConsumedBy: {T008: ''} # Total Output + activity_sets: + coal: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:coal + +## Other Emissions + EPA_GHGI_T_4_50: # HFCs from HCFC-22 production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 + + EPA_GHGI_T_4_96: # HFCs and other emissions from electronics manufacture + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 + + EPA_GHGI_T_4_102: # HFCs and PFCs from ODS Substitutes + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 + activity_sets: + households: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:households + + EPA_GHGI_T_A_97: # HFCs from Transportation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 + + EPA_GHGI_T_4_80: # PFCs from aluminum production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 From 6e2c4ad74cf6f16eaf76840c87b0290371a6005a Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 8 Sep 2023 11:44:30 -0400 Subject: [PATCH 0948/1127] adjust activity set names --- .../flowbysectormethods/GHG_national_2012_m1.yaml | 14 +++++++------- .../flowbysectormethods/GHG_national_2013_m1.yaml | 14 +++++++------- .../flowbysectormethods/GHG_national_2014_m1.yaml | 14 +++++++------- .../flowbysectormethods/GHG_national_2015_m1.yaml | 14 +++++++------- .../flowbysectormethods/GHG_national_2016_m1.yaml | 14 +++++++------- .../flowbysectormethods/GHG_national_2017_m1.yaml | 14 +++++++------- .../flowbysectormethods/GHG_national_2018_m1.yaml | 14 +++++++------- .../flowbysectormethods/GHG_national_2019_m1.yaml | 14 +++++++------- .../flowbysectormethods/GHG_national_2020_m1.yaml | 14 +++++++------- .../GHG_national_m1_common.yaml | 15 ++++++++------- 10 files changed, 71 insertions(+), 70 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml index fb86fcf1a..dab3cc027 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml @@ -130,22 +130,22 @@ source_names: ### Major CO2 Sources "EPA_GHGI_T_A_13": # CO2 emissions from stationary combustion. This table number changes with year - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion year: *ghgi_year clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + coal_manufacturing_co2: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 attribution_source: EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing attribution_source: EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml index cb6e137e9..d5d7c9dc1 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml @@ -130,22 +130,22 @@ source_names: ### Major CO2 Sources "EPA_GHGI_T_A_12": # CO2 emissions from stationary combustion. This table number changes with year - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion year: *ghgi_year clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + coal_manufacturing_co2: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 attribution_source: EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing attribution_source: EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml index bde134195..e2e799f26 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml @@ -130,22 +130,22 @@ source_names: ### Major CO2 Sources "EPA_GHGI_T_A_11": # CO2 emissions from stationary combustion. This table number changes with year - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion year: *ghgi_year clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + coal_manufacturing_co2: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 attribution_source: EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing attribution_source: EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml index c5e81d9b5..ce0483d5b 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml @@ -130,22 +130,22 @@ source_names: ### Major CO2 Sources "EPA_GHGI_T_A_10": # CO2 emissions from stationary combustion. This table number changes with year - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion year: *ghgi_year clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + coal_manufacturing_co2: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 attribution_source: EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing attribution_source: EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml index 64bb82c8b..4d7fe99e3 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml @@ -108,22 +108,22 @@ source_names: ### Major CO2 Sources "EPA_GHGI_T_A_9": # CO2 emissions from stationary combustion. This table number changes with year - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion year: *ghgi_year clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + coal_manufacturing_co2: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 attribution_source: EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing attribution_source: EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml index 373a71292..69d24d895 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml @@ -108,22 +108,22 @@ source_names: ### Major CO2 Sources "EPA_GHGI_T_A_8": # CO2 emissions from stationary combustion - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion year: *ghgi_year # Table A_8 is specific to 2017 clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + coal_manufacturing_co2: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 attribution_source: EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing attribution_source: EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml index 80389fb03..00c13272f 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml @@ -108,22 +108,22 @@ source_names: ### Major CO2 Sources "EPA_GHGI_T_A_7": # CO2 emissions from stationary combustion. This table number varies by GHG year - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion year: *ghgi_year # Table A_7 is specific to 2018 clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + coal_manufacturing_co2: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 attribution_source: EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing attribution_source: EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml index e3dc7b20c..5045f8825 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml @@ -108,22 +108,22 @@ source_names: ### Major CO2 Sources "EPA_GHGI_T_A_6": # CO2 emissions from stationary combustion. This table number varies by GHG year. - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion year: *ghgi_year clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + coal_manufacturing_co2: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 attribution_source: EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing attribution_source: EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml index 52e01746d..6c5743e11 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml @@ -108,22 +108,22 @@ source_names: ## Major CO2 Sources "EPA_GHGI_T_A_5": # CO2 emissions from stationary combustion. This table number varies by GHG year. - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion year: *ghgi_year clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + coal_manufacturing_co2: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 attribution_source: EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing attribution_source: EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion_and_transport:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml index 04df6ccbf..5a1ea209e 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml @@ -345,11 +345,12 @@ source_names: Medium- and Heavy-Duty Trucks and Buses Gasoline On-Road: Medium- and Heavy-Duty Trucks and Buses attribution_method: direct - direct_diesel: - selection_fields: - PrimaryActivity: - Medium- and Heavy-Duty Trucks and Buses Diesel On-Road: Medium- and Heavy-Duty Trucks and Buses - attribution_method: direct + # This activity is only in older FBAs + # direct_diesel: + # selection_fields: + # PrimaryActivity: + # Medium- and Heavy-Duty Trucks and Buses Diesel On-Road: Medium- and Heavy-Duty Trucks and Buses + # attribution_method: direct direct_non_road: selection_fields: @@ -430,7 +431,7 @@ source_names: ## Stationary Combustion - GHGI_CO2_stationary_combustion_and_transport: # CO2 emissions from stationary combustion + GHGI_CO2_stationary_combustion: # CO2 emissions from stationary combustion fedefl_mapping: GHGI # year: # override this clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion @@ -468,7 +469,7 @@ source_names: selection_fields: ActivityProducedBy: {'221200': ''} # purchases of natural gas - coal_manufacturing: # Industrial Coal for Manufacturing + coal_manufacturing_co2: # Industrial Coal for Manufacturing selection_fields: PrimaryActivity: Industrial Other Coal Industrial - Manufacturing: Coal Industrial - Manufacturing From abbbeea15c4ea4509b13041b7b7a75f4afa6d231 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 8 Sep 2023 11:46:46 -0400 Subject: [PATCH 0949/1127] replace dash with _ non-manufacturing activity sets --- .../GHG_national_2019_m2.yaml | 12 +++--- .../GHG_national_m1_common.yaml | 4 +- .../GHG_national_m2_common.yaml | 4 +- .../GHG_national_m3_common.yaml | 40 +++++++++---------- .../GHG_state_common_m2.yaml | 4 +- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml index baa8bd800..8460ee623 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml @@ -216,17 +216,17 @@ source_names: clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS and BEA year for some activity_sets !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets - non-manufacturing_coal: - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non-manufacturing_coal + non_manufacturing_coal: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non-manufacturing_coal:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal:attribution_source:BEA_Summary_Use_PRO_BeforeRedef year: *ghgi_year - non-manufacturing_natural_gas: - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non-manufacturing_natural_gas + non_manufacturing_natural_gas: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non-manufacturing_natural_gas:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:BEA_Summary_Use_PRO_BeforeRedef year: *ghgi_year coal_manufacturing: diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml index 5a1ea209e..7a0eefd11 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml @@ -445,7 +445,7 @@ source_names: PrimaryActivity: Total (All Fuels) Residential attribution_method: direct - non-manufacturing_coal: + non_manufacturing_coal: selection_fields: PrimaryActivity: Commercial Coal Commercial: Coal Commercial @@ -457,7 +457,7 @@ source_names: selection_fields: ActivityProducedBy: {'212100': ''} # purchases of coal - non-manufacturing_natural_gas: # Applies to non-manufacturing sectors like ag and mining + non_manufacturing_natural_gas: # Applies to non-manufacturing sectors like ag and mining selection_fields: PrimaryActivity: - Natural Gas Commercial diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml index bf198fdf0..903e14797 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml @@ -411,7 +411,7 @@ source_names: PrimaryActivity: Total (All Fuels) Residential attribution_method: direct - non-manufacturing_coal: + non_manufacturing_coal: selection_fields: PrimaryActivity: Commercial Coal Commercial: Coal Commercial @@ -423,7 +423,7 @@ source_names: selection_fields: ActivityProducedBy: {'212': ''} # purchases of coal (212100) - non-manufacturing_natural_gas: # Applies to non-manufacturing sectors like ag and mining + non_manufacturing_natural_gas: # Applies to non-manufacturing sectors like ag and mining selection_fields: PrimaryActivity: - Natural Gas Commercial diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m3_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m3_common.yaml index 5268a6274..610514aa9 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m3_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m3_common.yaml @@ -220,18 +220,18 @@ source_names: selection_fields: ActivityProducedBy: {'221200': ''} # purchases of natural gas - non-manufacturing_coal: + non_manufacturing_coal: selection_fields: MetaSources: - - 'EPA_GHGI_T_A_5.non-manufacturing_coal' - - 'EPA_GHGI_T_A_6.non-manufacturing_coal' - - 'EPA_GHGI_T_A_7.non-manufacturing_coal' - - 'EPA_GHGI_T_A_8.non-manufacturing_coal' - - 'EPA_GHGI_T_A_9.non-manufacturing_coal' - - 'EPA_GHGI_T_A_10.non-manufacturing_coal' - - 'EPA_GHGI_T_A_11.non-manufacturing_coal' - - 'EPA_GHGI_T_A_12.non-manufacturing_coal' - - 'EPA_GHGI_T_A_13.non-manufacturing_coal' + - 'EPA_GHGI_T_A_5.non_manufacturing_coal' + - 'EPA_GHGI_T_A_6.non_manufacturing_coal' + - 'EPA_GHGI_T_A_7.non_manufacturing_coal' + - 'EPA_GHGI_T_A_8.non_manufacturing_coal' + - 'EPA_GHGI_T_A_9.non_manufacturing_coal' + - 'EPA_GHGI_T_A_10.non_manufacturing_coal' + - 'EPA_GHGI_T_A_11.non_manufacturing_coal' + - 'EPA_GHGI_T_A_12.non_manufacturing_coal' + - 'EPA_GHGI_T_A_13.non_manufacturing_coal' attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: @@ -239,18 +239,18 @@ source_names: selection_fields: ActivityProducedBy: {'212100': ''} # purchases of coal - non-manufacturing_natural_gas: # Applies to non-manufacturing sectors like ag and mining + non_manufacturing_natural_gas: # Applies to non-manufacturing sectors like ag and mining selection_fields: MetaSources: - - 'EPA_GHGI_T_A_5.non-manufacturing_natural_gas' - - 'EPA_GHGI_T_A_6.non-manufacturing_natural_gas' - - 'EPA_GHGI_T_A_7.non-manufacturing_natural_gas' - - 'EPA_GHGI_T_A_8.non-manufacturing_natural_gas' - - 'EPA_GHGI_T_A_9.non-manufacturing_natural_gas' - - 'EPA_GHGI_T_A_10.non-manufacturing_natural_gas' - - 'EPA_GHGI_T_A_11.non-manufacturing_natural_gas' - - 'EPA_GHGI_T_A_12.non-manufacturing_natural_gas' - - 'EPA_GHGI_T_A_13.non-manufacturing_natural_gas' + - 'EPA_GHGI_T_A_5.non_manufacturing_natural_gas' + - 'EPA_GHGI_T_A_6.non_manufacturing_natural_gas' + - 'EPA_GHGI_T_A_7.non_manufacturing_natural_gas' + - 'EPA_GHGI_T_A_8.non_manufacturing_natural_gas' + - 'EPA_GHGI_T_A_9.non_manufacturing_natural_gas' + - 'EPA_GHGI_T_A_10.non_manufacturing_natural_gas' + - 'EPA_GHGI_T_A_11.non_manufacturing_natural_gas' + - 'EPA_GHGI_T_A_12.non_manufacturing_natural_gas' + - 'EPA_GHGI_T_A_13.non_manufacturing_natural_gas' attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: diff --git a/flowsa/methods/flowbysectormethods/GHG_state_common_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_state_common_m2.yaml index 48c9dc36c..7cf32dae5 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_common_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_common_m2.yaml @@ -361,7 +361,7 @@ source_names: stationary_coal: selection_fields: MetaSources: - - 'EPA_GHGI_T_A_6.non-manufacturing_coal' + - 'EPA_GHGI_T_A_6.non_manufacturing_coal' - 'EPA_GHGI_T_A_6.coal_manufacturing' attribution_method: proportional attribute_on: ['Flowable', 'SectorProducedBy'] @@ -376,7 +376,7 @@ source_names: stationary_natural_gas: selection_fields: MetaSources: - - 'EPA_GHGI_T_A_6.non-manufacturing_natural_gas' + - 'EPA_GHGI_T_A_6.non_manufacturing_natural_gas' - 'EPA_GHGI_T_A_6.natural_gas_manufacturing' attribution_method: proportional attribute_on: ['Flowable', 'SectorProducedBy'] From 1661f55a267e7dc36f725ec4efb520ef0ef2c6a2 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 8 Sep 2023 12:47:20 -0400 Subject: [PATCH 0950/1127] drop CNHW from source catalog and assign data_format where needed --- flowsa/data/source_catalog.yaml | 6 ------ flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml | 1 + flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml | 1 + flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml | 1 + .../flowbysectormethods/Food_Waste_national_2018_m2.yaml | 1 + 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index cc15c0e92..b444b61da 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -114,12 +114,6 @@ Census_VIP: class: Money activity_schema: None sector_hierarchy: "flat" -CNHW_CA: - data_format: FBS -CNHW_national: - data_format: FBS -CNHW_state: - data_format: FBS EIA_AEO: data_format: FBA class: diff --git a/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml b/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml index 3976a48cb..ac4283434 100644 --- a/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CNHW_national_2014.yaml @@ -9,6 +9,7 @@ geoscale: national source_names: CNHW_CA_2014: + data_format: FBS activity_sets: employment: exclusion_fields: diff --git a/flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml b/flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml index e57efc228..a17539e61 100644 --- a/flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml +++ b/flowsa/methods/flowbysectormethods/CNHW_national_2018.yaml @@ -9,6 +9,7 @@ geoscale: national source_names: CNHW_CA_2014: + data_format: FBS activity_sets: employment: exclusion_fields: diff --git a/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml b/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml index 8546e4bec..a540a5081 100644 --- a/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CNHW_state_2014.yaml @@ -7,6 +7,7 @@ geoscale: state source_names: CNHW_CA_2014: + data_format: FBS activity_sets: employment: exclusion_fields: diff --git a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml index 88f9f17a2..de8149739 100644 --- a/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml +++ b/flowsa/methods/flowbysectormethods/Food_Waste_national_2018_m2.yaml @@ -10,6 +10,7 @@ geoscale: national source_names: CNHW_national_2018: + data_format: FBS selection_fields: Flowable: {'Food': 'Food Waste'} activity_sets: From 2496c7dd44ee2ee1a30b37d8177913b504e807e0 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 8 Sep 2023 13:59:13 -0400 Subject: [PATCH 0951/1127] rename GHG_state_m2_common --- flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml | 8 ++++---- ...{GHG_state_common_m2.yaml => GHG_state_m2_common.yaml} | 0 2 files changed, 4 insertions(+), 4 deletions(-) rename flowsa/methods/flowbysectormethods/{GHG_state_common_m2.yaml => GHG_state_m2_common.yaml} (100%) diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml index b990d9849..7f3ed246c 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml @@ -3,7 +3,7 @@ # in the State Inventory -!include:GHG_state_common_m2.yaml +!include:GHG_state_m2_common.yaml year: &ghg_year 2019 geoscale: state @@ -11,11 +11,11 @@ geoscale: state source_names: ## Directly sourced from State Inventory EPA_StateGHGI: - !include:GHG_state_common_m2.yaml:source_names:EPA_StateGHGI + !include:GHG_state_m2_common.yaml:source_names:EPA_StateGHGI year: *ghg_year activity_sets: - !include:GHG_state_common_m2.yaml:source_names:EPA_StateGHGI:activity_sets + !include:GHG_state_m2_common.yaml:source_names:EPA_StateGHGI:activity_sets GHG_national_2019_m1: #U.S. GHG emissions - !include:GHG_state_common_m2.yaml:source_names:GHG_national_common_m1 + !include:GHG_state_m2_common.yaml:source_names:GHG_national_common_m1 year: *ghg_year diff --git a/flowsa/methods/flowbysectormethods/GHG_state_common_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_state_m2_common.yaml similarity index 100% rename from flowsa/methods/flowbysectormethods/GHG_state_common_m2.yaml rename to flowsa/methods/flowbysectormethods/GHG_state_m2_common.yaml From 59ed3dd59a765e1b48454cd83aea457169aee747 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 8 Sep 2023 12:04:21 -0600 Subject: [PATCH 0952/1127] update to generateflowbyactivity.main --- flowsa/data_source_scripts/EPA_CDDPath.py | 2 +- flowsa/data_source_scripts/EPA_GHGI.py | 2 +- flowsa/data_source_scripts/EPA_NEI.py | 2 +- flowsa/data_source_scripts/EPA_SIT.py | 2 +- flowsa/data_source_scripts/EPA_StateGHGI.py | 2 +- flowsa/data_source_scripts/StateGHGI.py | 2 +- flowsa/data_source_scripts/stateio.py | 2 +- flowsa/test_single_FBA.py | 3 ++- 8 files changed, 9 insertions(+), 8 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_CDDPath.py b/flowsa/data_source_scripts/EPA_CDDPath.py index 56ff96262..84dfd5564 100644 --- a/flowsa/data_source_scripts/EPA_CDDPath.py +++ b/flowsa/data_source_scripts/EPA_CDDPath.py @@ -227,7 +227,7 @@ def melt_and_apply_percentages(df, fbacol='ActivityConsumedBy'): if __name__ == "__main__": import flowsa - flowsa.flowbyactivity.main(source='EPA_CDDPath', year=2018) + flowsa.generateflowbyactivity.main(source='EPA_CDDPath', year=2018) fba = flowsa.getFlowByActivity(datasource='EPA_CDDPath', year=2018) # fbs = flowsa.getFlowBySector(methodname='CDD_concrete_national_2014') diff --git a/flowsa/data_source_scripts/EPA_GHGI.py b/flowsa/data_source_scripts/EPA_GHGI.py index 46c544ebe..4d80ec6aa 100644 --- a/flowsa/data_source_scripts/EPA_GHGI.py +++ b/flowsa/data_source_scripts/EPA_GHGI.py @@ -817,4 +817,4 @@ def split_HFCs_by_type(fba: FlowByActivity, **_) -> FlowByActivity: import flowsa # fba = flowsa.getFlowByActivity('EPA_GHGI_T_4_101', 2016) # df = clean_HFC_fba(fba) - fba = flowsa.flowbyactivity.main(year=2017, source='EPA_GHGI') + fba = flowsa.generateflowbyactivity.main(year=2017, source='EPA_GHGI') diff --git a/flowsa/data_source_scripts/EPA_NEI.py b/flowsa/data_source_scripts/EPA_NEI.py index 354c456a4..9528a6ab5 100644 --- a/flowsa/data_source_scripts/EPA_NEI.py +++ b/flowsa/data_source_scripts/EPA_NEI.py @@ -237,5 +237,5 @@ def remove_flow_overlap(df, aggregate_flow, contributing_flows): if __name__ == '__main__': import flowsa - flowsa.flowbyactivity.main(source='EPA_NEI_Onroad', year='2020') + flowsa.generateflowbyactivity.main(source='EPA_NEI_Onroad', year='2020') fba = flowsa.getFlowByActivity('EPA_NEI_Onroad', '2020') diff --git a/flowsa/data_source_scripts/EPA_SIT.py b/flowsa/data_source_scripts/EPA_SIT.py index daaf6e069..742009dc6 100644 --- a/flowsa/data_source_scripts/EPA_SIT.py +++ b/flowsa/data_source_scripts/EPA_SIT.py @@ -224,5 +224,5 @@ def clean_up_state_data(fba, source_dict, method, **_): if __name__ == '__main__': import flowsa - flowsa.flowbyactivity.main(source='EPA_SIT', year='2019') + flowsa.generateflowbyactivity.main(source='EPA_SIT', year='2019') fba = flowsa.getFlowByActivity('EPA_SIT', '2019') diff --git a/flowsa/data_source_scripts/EPA_StateGHGI.py b/flowsa/data_source_scripts/EPA_StateGHGI.py index 38bfa664c..1084fec30 100644 --- a/flowsa/data_source_scripts/EPA_StateGHGI.py +++ b/flowsa/data_source_scripts/EPA_StateGHGI.py @@ -215,5 +215,5 @@ def allocate_industrial_combustion(fba: FlowByActivity, **_) -> FlowByActivity: if __name__ == '__main__': import flowsa - flowsa.flowbyactivity.main(source='EPA_StateGHGI', year='2017') + flowsa.generateflowbyactivity.main(source='EPA_StateGHGI', year='2017') fba = flowsa.getFlowByActivity('EPA_StateGHGI', '2017') diff --git a/flowsa/data_source_scripts/StateGHGI.py b/flowsa/data_source_scripts/StateGHGI.py index 416e56e40..b66a3d60c 100644 --- a/flowsa/data_source_scripts/StateGHGI.py +++ b/flowsa/data_source_scripts/StateGHGI.py @@ -249,5 +249,5 @@ def VT_remove_dupicate_activities(df_subset): if __name__ == '__main__': import flowsa - flowsa.flowbyactivity.main(source='StateGHGI_ME', year='2019') + flowsa.generateflowbyactivity.main(source='StateGHGI_ME', year='2019') fba = flowsa.getFlowByActivity('StateGHGI_ME', '2019') diff --git a/flowsa/data_source_scripts/stateio.py b/flowsa/data_source_scripts/stateio.py index c7ecd0514..0c1dcf2af 100644 --- a/flowsa/data_source_scripts/stateio.py +++ b/flowsa/data_source_scripts/stateio.py @@ -80,5 +80,5 @@ def parse_statior(*, source, year, config, **_): # source = 'stateio_Industry_GO' # source = 'stateio_Make_Summary' source = 'stateio_Use_Summary' - flowsa.flowbyactivity.main(year=2017, source=source) + flowsa.generateflowbyactivity.main(year=2017, source=source) fba = flowsa.getFlowByActivity(source, 2017) diff --git a/flowsa/test_single_FBA.py b/flowsa/test_single_FBA.py index 065dd77f4..66630129a 100644 --- a/flowsa/test_single_FBA.py +++ b/flowsa/test_single_FBA.py @@ -10,4 +10,5 @@ parser.add_argument('--year', help='FBA year') args = vars(parser.parse_args()) - flowsa.flowbyactivity.main(source=args['source'], year=args['year']) + flowsa.generateflowbyactivity.main( + source=args['source'], year=args['year']) From 7680f2d711499f5e64e6c7f7e1227a6297e99db2 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 8 Sep 2023 12:04:49 -0600 Subject: [PATCH 0953/1127] add employment state 2010 FBS - used in water 2010 m1 FBS --- .../flowbysectormethods/Employment_state_2010.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/Employment_state_2010.yaml diff --git a/flowsa/methods/flowbysectormethods/Employment_state_2010.yaml b/flowsa/methods/flowbysectormethods/Employment_state_2010.yaml new file mode 100644 index 000000000..a9e6732a1 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/Employment_state_2010.yaml @@ -0,0 +1,12 @@ +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: state + +source_names: + Employment_national_2010: !include:Employment_common.yaml:employment_fbs_allocation + attribution_source: + BLS_QCEW: !include:Employment_common.yaml:bls_load_and_clean_state + year: 2010 + activity_sets: + qcew: !include:Employment_common.yaml:bls_allocation From 8e86cfe8b29cf09ba6387793ba0434afa59c69dc Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 8 Sep 2023 12:05:14 -0600 Subject: [PATCH 0954/1127] update to f-string --- flowsa/flowbyfunctions.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/flowsa/flowbyfunctions.py b/flowsa/flowbyfunctions.py index 173f6cb7f..36d759eb3 100644 --- a/flowsa/flowbyfunctions.py +++ b/flowsa/flowbyfunctions.py @@ -233,9 +233,8 @@ def assign_fips_location_system(df, year_of_data): elif 2010 <= year_of_data < 2013: df['LocationSystem'] = 'FIPS_2010' elif year_of_data < 2010: - log.warning( - "Missing FIPS codes from crosswalk for %s. " - "Assigning to FIPS_2010", str(year_of_data)) + log.warning(f"Missing FIPS codes from crosswalk for {year_of_data}. " + f"Assigning to FIPS_2010") df['LocationSystem'] = 'FIPS_2010' return df From bf896f6963dc430c77e6f761aa1b935c709ba977 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 8 Sep 2023 14:46:10 -0400 Subject: [PATCH 0955/1127] rename original state method as m1 --- .../{GHG_state_2012.yaml => GHG_state_2012_m1.yaml} | 0 .../{GHG_state_2013.yaml => GHG_state_2013_m1.yaml} | 0 .../{GHG_state_2014.yaml => GHG_state_2014_m1.yaml} | 0 .../{GHG_state_2015.yaml => GHG_state_2015_m1.yaml} | 0 .../{GHG_state_2016.yaml => GHG_state_2016_m1.yaml} | 0 .../{GHG_state_2017.yaml => GHG_state_2017_m1.yaml} | 0 .../{GHG_state_2018.yaml => GHG_state_2018_m1.yaml} | 0 .../{GHG_state_2019.yaml => GHG_state_2019_m1.yaml} | 0 .../{GHG_state_2020.yaml => GHG_state_2020_m1.yaml} | 0 .../{GHG_state_common.yaml => GHG_state_m1_common.yaml} | 0 10 files changed, 0 insertions(+), 0 deletions(-) rename flowsa/methods/flowbysectormethods/{GHG_state_2012.yaml => GHG_state_2012_m1.yaml} (100%) rename flowsa/methods/flowbysectormethods/{GHG_state_2013.yaml => GHG_state_2013_m1.yaml} (100%) rename flowsa/methods/flowbysectormethods/{GHG_state_2014.yaml => GHG_state_2014_m1.yaml} (100%) rename flowsa/methods/flowbysectormethods/{GHG_state_2015.yaml => GHG_state_2015_m1.yaml} (100%) rename flowsa/methods/flowbysectormethods/{GHG_state_2016.yaml => GHG_state_2016_m1.yaml} (100%) rename flowsa/methods/flowbysectormethods/{GHG_state_2017.yaml => GHG_state_2017_m1.yaml} (100%) rename flowsa/methods/flowbysectormethods/{GHG_state_2018.yaml => GHG_state_2018_m1.yaml} (100%) rename flowsa/methods/flowbysectormethods/{GHG_state_2019.yaml => GHG_state_2019_m1.yaml} (100%) rename flowsa/methods/flowbysectormethods/{GHG_state_2020.yaml => GHG_state_2020_m1.yaml} (100%) rename flowsa/methods/flowbysectormethods/{GHG_state_common.yaml => GHG_state_m1_common.yaml} (100%) diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2012.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2012_m1.yaml similarity index 100% rename from flowsa/methods/flowbysectormethods/GHG_state_2012.yaml rename to flowsa/methods/flowbysectormethods/GHG_state_2012_m1.yaml diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2013.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2013_m1.yaml similarity index 100% rename from flowsa/methods/flowbysectormethods/GHG_state_2013.yaml rename to flowsa/methods/flowbysectormethods/GHG_state_2013_m1.yaml diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2014.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2014_m1.yaml similarity index 100% rename from flowsa/methods/flowbysectormethods/GHG_state_2014.yaml rename to flowsa/methods/flowbysectormethods/GHG_state_2014_m1.yaml diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2015.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2015_m1.yaml similarity index 100% rename from flowsa/methods/flowbysectormethods/GHG_state_2015.yaml rename to flowsa/methods/flowbysectormethods/GHG_state_2015_m1.yaml diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2016.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2016_m1.yaml similarity index 100% rename from flowsa/methods/flowbysectormethods/GHG_state_2016.yaml rename to flowsa/methods/flowbysectormethods/GHG_state_2016_m1.yaml diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2017.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2017_m1.yaml similarity index 100% rename from flowsa/methods/flowbysectormethods/GHG_state_2017.yaml rename to flowsa/methods/flowbysectormethods/GHG_state_2017_m1.yaml diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2018.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2018_m1.yaml similarity index 100% rename from flowsa/methods/flowbysectormethods/GHG_state_2018.yaml rename to flowsa/methods/flowbysectormethods/GHG_state_2018_m1.yaml diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m1.yaml similarity index 100% rename from flowsa/methods/flowbysectormethods/GHG_state_2019.yaml rename to flowsa/methods/flowbysectormethods/GHG_state_2019_m1.yaml diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2020.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2020_m1.yaml similarity index 100% rename from flowsa/methods/flowbysectormethods/GHG_state_2020.yaml rename to flowsa/methods/flowbysectormethods/GHG_state_2020_m1.yaml diff --git a/flowsa/methods/flowbysectormethods/GHG_state_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml similarity index 100% rename from flowsa/methods/flowbysectormethods/GHG_state_common.yaml rename to flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml From 5ad9f2d6aa5ad93869574e2118eddc1f756c0f23 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 8 Sep 2023 15:37:03 -0400 Subject: [PATCH 0956/1127] update GHG_state_m1 to align with new, more refined, activity set names --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 6 + .../EPA_StateGHGI_asets.csv | 2 + .../GHG_state_2012_m1.yaml | 104 +++++++++++------ .../GHG_state_2013_m1.yaml | 104 +++++++++++------ .../GHG_state_2014_m1.yaml | 104 +++++++++++------ .../GHG_state_2015_m1.yaml | 104 +++++++++++------ .../GHG_state_2016_m1.yaml | 96 +++++++++++----- .../GHG_state_2017_m1.yaml | 96 +++++++++++----- .../GHG_state_2018_m1.yaml | 96 +++++++++++----- .../GHG_state_2019_m1.yaml | 93 +++++++++------ .../GHG_state_2020_m1.yaml | 96 +++++++++++----- .../GHG_state_m1_common.yaml | 106 ++++++++++++++++-- 12 files changed, 706 insertions(+), 301 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index 5d29902bb..cd03b9e84 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -154,6 +154,9 @@ EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Indus EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,31,,ind_com_ch4_n2o EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,32,,ind_com_ch4_n2o EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,33,,ind_com_ch4_n2o +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal - Manufacturing,NAICS_2012_Code,31,,industrial_coal (only used in m1) +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal - Manufacturing,NAICS_2012_Code,32,,industrial_coal (only used in m1) +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal - Manufacturing,NAICS_2012_Code,33,,industrial_coal (only used in m1) EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,31,,use_table_coal EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,32,,use_table_coal EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,33,,use_table_coal @@ -161,6 +164,9 @@ EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combusti EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,21,,use_table_coal EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,2212,,use_table_coal EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,23,,use_table_coal +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas - Manufacturing,NAICS_2012_Code,31,,industrial_gas (only used in m1) +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas - Manufacturing,NAICS_2012_Code,32,,industrial_gas (only used in m1) +EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas - Manufacturing,NAICS_2012_Code,33,,industrial_gas (only used in m1) EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,31,,use_table_gas EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,32,,use_table_gas EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,33,,use_table_gas diff --git a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv index d1cdee132..b62ed4433 100644 --- a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv @@ -67,7 +67,9 @@ electric_power,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossi electric_power,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Natural Gas, electric_power,Electric Power Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Electricity Generation - Petroleum, ind_com_ch4_n2o,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial, +industrial_coal,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal - Manufacturing,m1 only use_table_coal,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal, +industrial_gas,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas - Manufacturing,m1 only use_table_gas,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas, use_table_pet,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum,EPA_GHGI_T_A_14 direct,Residential - Stationary Combustion - Fossil Fuel Combustion, diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2012_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2012_m1.yaml index 50bb618d9..4cf32ec19 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2012_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2012_m1.yaml @@ -7,7 +7,7 @@ geoscale: state sources_to_cache: EIA_MECS_Energy: - !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy + !include:GHG_state_m1_common.yaml:sources_to_cache:EIA_MECS_Energy year: 2014 attribution_source: Employment_state_2014: # Update to MECS year @@ -17,102 +17,129 @@ sources_to_cache: source_names: EPA_StateGHGI: # U.S. GHG emissions by state - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI year: *ghg_year clean_parameter: # Override each year for use in allocate_industrial_combustion - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:clean_parameter + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:clean_parameter year: 2014 ghg_fba: EPA_GHGI_T_A_11 # 2014 Table activity_sets: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets ## List these activity sets separately to access the correct use table year + electric_power: # electricity combustion + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_power + attribution_source: + stateio_Make_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityConsumedBy: {'22': ''} # utilities + + electric_ch4_n2o: # electricity combustion + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_ch4_n2o + attribution_source: + stateio_Make_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityConsumedBy: {'22': ''} # utilities + use_table_coal: # commercial coal combustion, non-manufacturing industrial - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel use_table_gas: # commercial gas combustion, non-manufacturing industrial - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas commercial_ch4_n2o: # CH4 and N2O from commercial combustion - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o activity_sets: coal: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) petroleum: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel gas: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas - use_table_chem: # other process use of carbonates - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem + carbonate_use: # other process use of carbonates + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:carbonate_use + attribution_source: + stateio_Use_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'325': ''} # Use of chemicals + + nitrous_oxide_use: # N2O from Product uses + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:nitrous_oxide_use attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'325': ''} # Use of chemicals - ag: # emissions from urea fertilization + urea: # emissions from urea fertilization # allocated between crops and animals based on USDA land area - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ag + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:urea attribution_source: USDA_CoA_Cropland_NAICS: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ag:attribution_source:USDA_CoA_Cropland_NAICS + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ag:attribution_source:USDA_CoA_Cropland_NAICS year: *coa_year transport_petroleum: # C02 from petroleum highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel transport_nonroad_CH4: # CH4 from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -121,28 +148,37 @@ source_names: 'F030', 'F040', 'F050'] # Plus other sectors excluded above transport_nonroad_N2O: # N2O from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - transport_machinery: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery + transport_nonroad_ag: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_ag + attribution_source: + stateio_Use_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'333': ''} # Machinery + + transport_nonroad_construction: # CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_construction attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Machinery ods_substitutes: # CO2e from ODS substitutes - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2013_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2013_m1.yaml index 3026ae193..bcc1756cf 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2013_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2013_m1.yaml @@ -7,7 +7,7 @@ geoscale: state sources_to_cache: EIA_MECS_Energy: - !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy + !include:GHG_state_m1_common.yaml:sources_to_cache:EIA_MECS_Energy year: 2014 attribution_source: Employment_state_2014: # Update to MECS year @@ -17,102 +17,129 @@ sources_to_cache: source_names: EPA_StateGHGI: # U.S. GHG emissions by state - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI year: *ghg_year clean_parameter: # Override each year for use in allocate_industrial_combustion - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:clean_parameter + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:clean_parameter year: 2014 ghg_fba: EPA_GHGI_T_A_11 # 2014 Table activity_sets: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets ## List these activity sets separately to access the correct use table year + electric_power: # electricity combustion + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_power + attribution_source: + stateio_Make_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityConsumedBy: {'22': ''} # utilities + + electric_ch4_n2o: # electricity combustion + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_ch4_n2o + attribution_source: + stateio_Make_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityConsumedBy: {'22': ''} # utilities + use_table_coal: # commercial coal combustion, non-manufacturing industrial - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel use_table_gas: # commercial gas combustion, non-manufacturing industrial - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas commercial_ch4_n2o: # CH4 and N2O from commercial combustion - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o activity_sets: coal: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) petroleum: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel gas: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas - use_table_chem: # other process use of carbonates - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem + carbonate_use: # other process use of carbonates + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:carbonate_use + attribution_source: + stateio_Use_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'325': ''} # Use of chemicals + + nitrous_oxide_use: # N2O from Product uses + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:nitrous_oxide_use attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'325': ''} # Use of chemicals - ag: # emissions from urea fertilization + urea: # emissions from urea fertilization # allocated between crops and animals based on USDA land area - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ag + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:urea attribution_source: USDA_CoA_Cropland_NAICS: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ag:attribution_source:USDA_CoA_Cropland_NAICS + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ag:attribution_source:USDA_CoA_Cropland_NAICS year: *coa_year transport_petroleum: # C02 from petroleum highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel transport_nonroad_CH4: # CH4 from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -121,28 +148,37 @@ source_names: 'F030', 'F040', 'F050'] # Plus other sectors excluded above transport_nonroad_N2O: # N2O from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - transport_machinery: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery + transport_nonroad_ag: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_ag + attribution_source: + stateio_Use_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'333': ''} # Machinery + + transport_nonroad_construction: # CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_construction attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Machinery ods_substitutes: # CO2e from ODS substitutes - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2014_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2014_m1.yaml index 1da95dbb0..4b4c56d2f 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2014_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2014_m1.yaml @@ -7,7 +7,7 @@ geoscale: state sources_to_cache: EIA_MECS_Energy: - !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy + !include:GHG_state_m1_common.yaml:sources_to_cache:EIA_MECS_Energy year: 2014 attribution_source: Employment_state_2014: # Update to MECS year @@ -17,102 +17,129 @@ sources_to_cache: source_names: EPA_StateGHGI: # U.S. GHG emissions by state - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI year: *ghg_year clean_parameter: # Override each year for use in allocate_industrial_combustion - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:clean_parameter + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:clean_parameter year: 2014 ghg_fba: EPA_GHGI_T_A_11 # 2014 Table activity_sets: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets ## List these activity sets separately to access the correct use table year + electric_power: # electricity combustion + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_power + attribution_source: + stateio_Make_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityConsumedBy: {'22': ''} # utilities + + electric_ch4_n2o: # electricity combustion + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_ch4_n2o + attribution_source: + stateio_Make_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityConsumedBy: {'22': ''} # utilities + use_table_coal: # commercial coal combustion, non-manufacturing industrial - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel use_table_gas: # commercial gas combustion, non-manufacturing industrial - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas commercial_ch4_n2o: # CH4 and N2O from commercial combustion - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o activity_sets: coal: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) petroleum: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel gas: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas - use_table_chem: # other process use of carbonates - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem + carbonate_use: # other process use of carbonates + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:carbonate_use + attribution_source: + stateio_Use_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'325': ''} # Use of chemicals + + nitrous_oxide_use: # N2O from Product uses + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:nitrous_oxide_use attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'325': ''} # Use of chemicals - ag: # emissions from urea fertilization + urea: # emissions from urea fertilization # allocated between crops and animals based on USDA land area - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ag + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:urea attribution_source: USDA_CoA_Cropland_NAICS: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ag:attribution_source:USDA_CoA_Cropland_NAICS + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ag:attribution_source:USDA_CoA_Cropland_NAICS year: *coa_year transport_petroleum: # C02 from petroleum highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel transport_nonroad_CH4: # CH4 from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -121,28 +148,37 @@ source_names: 'F030', 'F040', 'F050'] # Plus other sectors excluded above transport_nonroad_N2O: # N2O from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - transport_machinery: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery + transport_nonroad_ag: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_ag + attribution_source: + stateio_Use_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'333': ''} # Machinery + + transport_nonroad_construction: # CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_construction attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Machinery ods_substitutes: # CO2e from ODS substitutes - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2015_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2015_m1.yaml index a02983a2c..a49480d1e 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2015_m1.yaml @@ -7,7 +7,7 @@ geoscale: state sources_to_cache: EIA_MECS_Energy: - !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy + !include:GHG_state_m1_common.yaml:sources_to_cache:EIA_MECS_Energy year: 2014 attribution_source: Employment_state_2014: # Update to MECS year @@ -17,102 +17,129 @@ sources_to_cache: source_names: EPA_StateGHGI: # U.S. GHG emissions by state - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI year: *ghg_year clean_parameter: # Override each year for use in allocate_industrial_combustion - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:clean_parameter + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:clean_parameter year: 2014 ghg_fba: EPA_GHGI_T_A_11 # 2014 Table activity_sets: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets ## List these activity sets separately to access the correct use table year + electric_power: # electricity combustion + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_power + attribution_source: + stateio_Make_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityConsumedBy: {'22': ''} # utilities + + electric_ch4_n2o: # electricity combustion + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_ch4_n2o + attribution_source: + stateio_Make_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityConsumedBy: {'22': ''} # utilities + use_table_coal: # commercial coal combustion, non-manufacturing industrial - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel use_table_gas: # commercial gas combustion, non-manufacturing industrial - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas commercial_ch4_n2o: # CH4 and N2O from commercial combustion - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o activity_sets: coal: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) petroleum: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel gas: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas - use_table_chem: # other process use of carbonates - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem + carbonate_use: # other process use of carbonates + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:carbonate_use + attribution_source: + stateio_Use_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'325': ''} # Use of chemicals + + nitrous_oxide_use: # N2O from Product uses + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:nitrous_oxide_use attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'325': ''} # Use of chemicals - ag: # emissions from urea fertilization + urea: # emissions from urea fertilization # allocated between crops and animals based on USDA land area - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ag + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:urea attribution_source: USDA_CoA_Cropland_NAICS: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ag:attribution_source:USDA_CoA_Cropland_NAICS + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ag:attribution_source:USDA_CoA_Cropland_NAICS year: *coa_year transport_petroleum: # C02 from petroleum highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel transport_nonroad_CH4: # CH4 from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -121,28 +148,37 @@ source_names: 'F030', 'F040', 'F050'] # Plus other sectors excluded above transport_nonroad_N2O: # N2O from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - transport_machinery: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery + transport_nonroad_ag: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_ag + attribution_source: + stateio_Use_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'333': ''} # Machinery + + transport_nonroad_construction: # CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_construction attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Machinery ods_substitutes: # CO2e from ODS substitutes - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2016_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2016_m1.yaml index 2015a528a..a0677493b 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2016_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2016_m1.yaml @@ -6,7 +6,7 @@ geoscale: state sources_to_cache: EIA_MECS_Energy: - !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy + !include:GHG_state_m1_common.yaml:sources_to_cache:EIA_MECS_Energy year: 2018 attribution_source: Employment_state_2018: # Update to MECS year @@ -16,90 +16,117 @@ sources_to_cache: source_names: EPA_StateGHGI: # U.S. GHG emissions by state - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI year: *ghg_year activity_sets: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets ## List these activity sets separately to access the correct use table year + electric_power: # electricity combustion + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_power + attribution_source: + stateio_Make_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityConsumedBy: {'22': ''} # utilities + + electric_ch4_n2o: # electricity combustion + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_ch4_n2o + attribution_source: + stateio_Make_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityConsumedBy: {'22': ''} # utilities + use_table_coal: # commercial coal combustion, non-manufacturing industrial - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel use_table_gas: # commercial gas combustion, non-manufacturing industrial - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas commercial_ch4_n2o: # CH4 and N2O from commercial combustion - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o activity_sets: coal: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) petroleum: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel gas: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas - use_table_chem: # other process use of carbonates - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem + carbonate_use: # other process use of carbonates + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:carbonate_use + attribution_source: + stateio_Use_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'325': ''} # Use of chemicals + + nitrous_oxide_use: # N2O from Product uses + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:nitrous_oxide_use attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'325': ''} # Use of chemicals transport_petroleum: # C02 from petroleum highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel transport_nonroad_CH4: # CH4 from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -108,28 +135,37 @@ source_names: 'F030', 'F040', 'F050'] # Plus other sectors excluded above transport_nonroad_N2O: # N2O from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - transport_machinery: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery + transport_nonroad_ag: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_ag + attribution_source: + stateio_Use_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'333': ''} # Machinery + + transport_nonroad_construction: # CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_construction attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Machinery ods_substitutes: # CO2e from ODS substitutes - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2017_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2017_m1.yaml index bbb6b6581..f3192f3dd 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2017_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2017_m1.yaml @@ -6,7 +6,7 @@ geoscale: state sources_to_cache: EIA_MECS_Energy: - !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy + !include:GHG_state_m1_common.yaml:sources_to_cache:EIA_MECS_Energy year: 2018 attribution_source: Employment_state_2018: # Update to MECS year @@ -16,90 +16,117 @@ sources_to_cache: source_names: EPA_StateGHGI: # U.S. GHG emissions by state - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI year: *ghg_year activity_sets: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets ## List these activity sets separately to access the correct use table year + electric_power: # electricity combustion + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_power + attribution_source: + stateio_Make_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityConsumedBy: {'22': ''} # utilities + + electric_ch4_n2o: # electricity combustion + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_ch4_n2o + attribution_source: + stateio_Make_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityConsumedBy: {'22': ''} # utilities + use_table_coal: # commercial coal combustion, non-manufacturing industrial - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel use_table_gas: # commercial gas combustion, non-manufacturing industrial - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas commercial_ch4_n2o: # CH4 and N2O from commercial combustion - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o activity_sets: coal: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) petroleum: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel gas: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas - use_table_chem: # other process use of carbonates - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem + carbonate_use: # other process use of carbonates + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:carbonate_use + attribution_source: + stateio_Use_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'325': ''} # Use of chemicals + + nitrous_oxide_use: # N2O from Product uses + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:nitrous_oxide_use attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'325': ''} # Use of chemicals transport_petroleum: # C02 from petroleum highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel transport_nonroad_CH4: # CH4 from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -108,28 +135,37 @@ source_names: 'F030', 'F040', 'F050'] # Plus other sectors excluded above transport_nonroad_N2O: # N2O from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - transport_machinery: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery + transport_nonroad_ag: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_ag + attribution_source: + stateio_Use_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'333': ''} # Machinery + + transport_nonroad_construction: # CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_construction attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Machinery ods_substitutes: # CO2e from ODS substitutes - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2018_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2018_m1.yaml index 37d71269d..88ee56ed1 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2018_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2018_m1.yaml @@ -6,7 +6,7 @@ geoscale: state sources_to_cache: EIA_MECS_Energy: - !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy + !include:GHG_state_m1_common.yaml:sources_to_cache:EIA_MECS_Energy year: 2018 attribution_source: Employment_state_2018: # Update to MECS year @@ -16,90 +16,117 @@ sources_to_cache: source_names: EPA_StateGHGI: # U.S. GHG emissions by state - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI year: *ghg_year activity_sets: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets ## List these activity sets separately to access the correct use table year + electric_power: # electricity combustion + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_power + attribution_source: + stateio_Make_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityConsumedBy: {'22': ''} # utilities + + electric_ch4_n2o: # electricity combustion + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_ch4_n2o + attribution_source: + stateio_Make_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityConsumedBy: {'22': ''} # utilities + use_table_coal: # commercial coal combustion, non-manufacturing industrial - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel use_table_gas: # commercial gas combustion, non-manufacturing industrial - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas commercial_ch4_n2o: # CH4 and N2O from commercial combustion - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o activity_sets: coal: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) petroleum: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel gas: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas - use_table_chem: # other process use of carbonates - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem + carbonate_use: # other process use of carbonates + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:carbonate_use + attribution_source: + stateio_Use_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'325': ''} # Use of chemicals + + nitrous_oxide_use: # N2O from Product uses + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:nitrous_oxide_use attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'325': ''} # Use of chemicals transport_petroleum: # C02 from petroleum highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel transport_nonroad_CH4: # CH4 from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -108,28 +135,37 @@ source_names: 'F030', 'F040', 'F050'] # Plus other sectors excluded above transport_nonroad_N2O: # N2O from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - transport_machinery: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery + transport_nonroad_ag: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_ag + attribution_source: + stateio_Use_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'333': ''} # Machinery + + transport_nonroad_construction: # CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_construction attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Machinery ods_substitutes: # CO2e from ODS substitutes - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m1.yaml index 2fa4f7533..ad638e24b 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019_m1.yaml @@ -6,7 +6,7 @@ geoscale: state sources_to_cache: EIA_MECS_Energy: - !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy + !include:GHG_state_m1_common.yaml:sources_to_cache:EIA_MECS_Energy year: 2018 attribution_source: Employment_state_2018: # Update to MECS year @@ -16,99 +16,117 @@ sources_to_cache: source_names: EPA_StateGHGI: # U.S. GHG emissions by state - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI year: *ghg_year activity_sets: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets ## List these activity sets separately to access the correct use table year - make_table_elec: # electricity combustion - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:make_table_elec + electric_power: # electricity combustion + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_power attribution_source: stateio_Make_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityConsumedBy: {'22': ''} # utilities + + electric_ch4_n2o: # electricity combustion + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_ch4_n2o + attribution_source: + stateio_Make_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityConsumedBy: {'22': ''} # utilities use_table_coal: # commercial coal combustion, non-manufacturing industrial - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel use_table_gas: # commercial gas combustion, non-manufacturing industrial - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas commercial_ch4_n2o: # CH4 and N2O from commercial combustion - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o activity_sets: coal: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) petroleum: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel gas: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas - use_table_chem: # other process use of carbonates - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem + carbonate_use: # other process use of carbonates + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:carbonate_use + attribution_source: + stateio_Use_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'325': ''} # Use of chemicals + + nitrous_oxide_use: # N2O from Product uses + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:nitrous_oxide_use attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'325': ''} # Use of chemicals transport_petroleum: # C02 from petroleum highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel transport_nonroad_CH4: # CH4 from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -117,28 +135,37 @@ source_names: 'F030', 'F040', 'F050'] # Plus other sectors excluded above transport_nonroad_N2O: # N2O from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - transport_machinery: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery + transport_nonroad_ag: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_ag + attribution_source: + stateio_Use_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'333': ''} # Machinery + + transport_nonroad_construction: # CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_construction attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Machinery ods_substitutes: # CO2e from ODS substitutes - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2020_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2020_m1.yaml index 586d05f1f..5eb76913c 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2020_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2020_m1.yaml @@ -6,7 +6,7 @@ geoscale: state sources_to_cache: EIA_MECS_Energy: - !include:GHG_state_common.yaml:sources_to_cache:EIA_MECS_Energy + !include:GHG_state_m1_common.yaml:sources_to_cache:EIA_MECS_Energy year: 2018 attribution_source: Employment_state_2018: # Update to MECS year @@ -16,90 +16,117 @@ sources_to_cache: source_names: EPA_StateGHGI: # U.S. GHG emissions by state - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI year: *ghg_year activity_sets: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets ## List these activity sets separately to access the correct use table year + electric_power: # electricity combustion + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_power + attribution_source: + stateio_Make_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityConsumedBy: {'22': ''} # utilities + + electric_ch4_n2o: # electricity combustion + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_ch4_n2o + attribution_source: + stateio_Make_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityConsumedBy: {'22': ''} # utilities + use_table_coal: # commercial coal combustion, non-manufacturing industrial - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel use_table_gas: # commercial gas combustion, non-manufacturing industrial - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas commercial_ch4_n2o: # CH4 and N2O from commercial combustion - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o activity_sets: coal: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) petroleum: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel gas: - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'22': ''} # Electricity and natural gas - use_table_chem: # other process use of carbonates - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_chem + carbonate_use: # other process use of carbonates + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:carbonate_use + attribution_source: + stateio_Use_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'325': ''} # Use of chemicals + + nitrous_oxide_use: # N2O from Product uses + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:nitrous_oxide_use attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'325': ''} # Use of chemicals transport_petroleum: # C02 from petroleum highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel transport_nonroad_CH4: # CH4 from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel @@ -108,28 +135,37 @@ source_names: 'F030', 'F040', 'F050'] # Plus other sectors excluded above transport_nonroad_N2O: # N2O from petroleum non-highway - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - transport_machinery: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_machinery + transport_nonroad_ag: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_ag + attribution_source: + stateio_Use_Summary: + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation + year: *ghg_year + selection_fields: + ActivityProducedBy: {'333': ''} # Machinery + + transport_nonroad_construction: # CH4, N2O from petroleum non-highway (ag & constrution) + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_construction attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Machinery ods_substitutes: # CO2e from ODS substitutes - !include:GHG_state_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes attribution_source: stateio_Use_Summary: - !include:GHG_state_common.yaml:_allocation_types:_use_allocation + !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation year: *ghg_year selection_fields: ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml index bd1265a65..182281616 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml @@ -62,19 +62,79 @@ source_names: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct attribution_method: direct - direct_ods: + n2o_soil_direct: + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv n2o_soil_direct + attribution_method: direct + + n2o_soil_indirect: + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv n2o_soil_indirect + attribution_method: direct + + ag_livestock: + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ag_livestock + attribution_method: direct + + ag_burning: + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ag_burning + attribution_method: direct + + residential_co2: + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv residential_co2 + attribution_method: direct + + petrochemicals: + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv petrochemicals + attribution_method: direct + + lead: + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv lead + attribution_method: direct + + magnesium: + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv magnesium + attribution_method: direct + + electricity_transmission: + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv electricity_transmission + attribution_method: direct + + hcfc: + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv hcfc + attribution_method: direct + + ods_transportation: clean_fba_before_mapping: !script_function:EPA_GHGI split_HFCs_by_type clean_parameter: # Proportions of specific HFCs are assigned based on national total flow_fba: EPA_GHGI_T_4_100 #TODO reconsider mapping for transportation HFCS selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct_ods + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ods_transportation attribution_method: direct - make_table_elec: # electricity combustion + electric_power: # electricity combustion + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv electric_power + attribution_method: proportional + attribution_source: + stateio_Make_Summary: + <<: *use_table_allocation + selection_fields: + ActivityConsumedBy: {'22': ''} # utilities + + electric_ch4_n2o: # electricity combustion selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv make_table_elec + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv electric_ch4_n2o attribution_method: proportional attribution_source: stateio_Make_Summary: @@ -180,7 +240,7 @@ source_names: - EPA_GHGI_T_3_9 sector: Commercial selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv commercial_ch4_n2o + PrimaryActivity: Commercial - Stationary Combustion - Fossil Fuel Combustion # ind_com_ch4_n2o activity_sets: coal: selection_fields: @@ -244,7 +304,9 @@ source_names: - EPA_GHGI_T_3_9 sector: Industrial selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv industrial_ch4_n2o + PrimaryActivity: + - Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary # ind_com_ch4_n2o + - Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial activity_sets: coal: selection_fields: @@ -286,9 +348,9 @@ source_names: Class: Other # nonfuel consumption Flowable: Total - use_table_chem: # other process use of carbonates, urea application + carbonate_use: # other process use of carbonates selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_chem + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv carbonate_use attribution_method: proportional attribution_source: stateio_Use_Summary: @@ -296,10 +358,20 @@ source_names: selection_fields: ActivityProducedBy: {'325': ''} # Use of chemicals - ag: # emissions from urea fertilization + nitrous_oxide_use: # N2O from Product uses + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv nitrous_oxide_use + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'325': ''} # Use of chemicals + + urea: # emissions from urea fertilization # allocated between crops and animals based on USDA land area selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ag + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv urea attribution_method: proportional attribution_source: USDA_CoA_Cropland_NAICS: @@ -374,9 +446,19 @@ source_names: selection_fields: ActivityProducedBy: {'324': ''} # Petroleum fuel - transport_machinery: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) + transport_nonroad_ag: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad_ag + attribution_method: proportional + attribution_source: + stateio_Use_Summary: + <<: *use_table_allocation + selection_fields: + ActivityProducedBy: {'333': ''} # Machinery + + transport_nonroad_construction: # CH4, N2O from petroleum non-highway (ag & constrution) selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_machinery + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad_construction attribution_method: proportional attribution_source: stateio_Use_Summary: From 7a7cb4ad08f6da6bdd36d8df78f56ffcd6c69e1e Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 8 Sep 2023 16:01:45 -0400 Subject: [PATCH 0957/1127] replace some summary BEA attributions with detail --- .../GHG_national_2019_m2.yaml | 67 ---------- .../GHG_national_m2_common.yaml | 117 ++++++++++-------- 2 files changed, 66 insertions(+), 118 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml index 8460ee623..fd7a9f7fd 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml @@ -17,35 +17,6 @@ source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year - activity_sets: # Update BEA year for some activity_sets - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets - electric_power: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power - attribution_source: - BEA_Summary_Make_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power:attribution_source:BEA_Summary_Make_BeforeRedef - year: *ghgi_year - - urea: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - - carbonate_use: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - - nitrous_oxide_use: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_68 @@ -154,26 +125,6 @@ source_names: "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102 year: *ghgi_year - activity_sets: # Update BEA year for some activity_sets - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets - refrigerants: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - air_conditioning: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - foams: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year "EPA_GHGI_T_A_97": # HFCs from Transportation !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_A_97 @@ -216,12 +167,6 @@ source_names: clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS and BEA year for some activity_sets !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets - non_manufacturing_coal: - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year non_manufacturing_natural_gas: !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas attribution_source: @@ -255,12 +200,6 @@ source_names: clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS and BEA year for some activity_sets !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets - electric_power: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power - attribution_source: - BEA_Summary_Make_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power:attribution_source:BEA_Summary_Make_BeforeRedef - year: *ghgi_year fuel_oil: !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil @@ -274,12 +213,6 @@ source_names: BEA_Summary_Use_PRO_BeforeRedef: !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:BEA_Summary_Use_PRO_BeforeRedef year: *ghgi_year - coal_nonmanufacturing: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year coal_manufacturing: !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml index 903e14797..aee73fb37 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml @@ -12,7 +12,7 @@ geoscale: national _mecs_year: &mecs_year 2018 _attribution_sources: - BEA: &bea + BEA: &bea_summary year: *ghg_year activity_to_sector_mapping: BEA_2012_Summary # selection_fields: @@ -24,11 +24,23 @@ _attribution_sources: 'Total Final Uses (GDP)', 'Total Intermediate'] ActivityProducedBy: ['Total Commodity Output'] - attribution_method: equal ## No attribution supplied (will use equal) because target level for ## modeling is BEA summary level. + BEA_detail: &bea_detail + year: 2012 + activity_to_sector_mapping: BEA_2012_Detail + # selection_fields: + # ActivityProducedBy: {'324': ''} # Petroleum 324110 + exclusion_fields: # Avoid unnecessary warnings about not being mapped to sectors + ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', + 'F06E00', 'F07E00', 'F10E00', + 'T001', 'T004', 'T007'] + ActivityProducedBy: ['T007'] + attribution_method: equal + + EIA_MECS_Energy: &mecs_energy year: *mecs_year selection_fields: &mecs_energy_default_selection @@ -45,7 +57,7 @@ _attribution_sources: # attribution_method: proportional # attribution_source: # Include in main method # BEA_Summary_Use_PRO_BeforeRedef: - # <<: *bea + # <<: *bea_summary # selection_fields: # ActivityProducedBy: {'XXXXX': ''} @@ -97,10 +109,10 @@ source_names: Electric Power Sector: Electric Power #CO2 attribution_method: proportional attribution_source: - BEA_Summary_Make_BeforeRedef: - <<: *bea + BEA_Detail_Make_BeforeRedef: + <<: *bea_detail selection_fields: - ActivityConsumedBy: {'22': ''} # Utilities (221100) + ActivityConsumedBy: {'221100': ''} # Utilities (221100) liming: selection_fields: @@ -113,10 +125,10 @@ source_names: - Urea Consumption for Non-Agricultural Purposes #CO2 attribution_method: proportional attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea_detail selection_fields: - ActivityProducedBy: {'325': ''} # Chemicals (325310) + ActivityProducedBy: {'325310': ''} # Chemicals (325310) urea_fertilizer: selection_fields: @@ -128,10 +140,10 @@ source_names: PrimaryActivity: Other Process Uses of Carbonates #CO2 attribution_method: proportional attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea_detail selection_fields: - ActivityProducedBy: {'325': ''} # Chemicals (325180) + ActivityProducedBy: {'325180': ''} # Chemicals (325180) lead: selection_fields: @@ -143,10 +155,11 @@ source_names: PrimaryActivity: N2O from Product Uses #N2O attribution_method: proportional attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea_detail + selection_fields: - ActivityProducedBy: {'325': ''} # Chemicals (325120) + ActivityProducedBy: {'325120': ''} # Chemicals (325120) @@ -296,7 +309,7 @@ source_names: attribution_method: proportional attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea + <<: *bea_summary selection_fields: ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) @@ -336,7 +349,7 @@ source_names: attribution_method: proportional attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea + <<: *bea_summary selection_fields: ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) @@ -348,7 +361,7 @@ source_names: attribution_method: proportional attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea + <<: *bea_summary selection_fields: ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) @@ -358,7 +371,7 @@ source_names: attribution_method: proportional attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea + <<: *bea_summary selection_fields: ActivityProducedBy: {'333': ''} # purchases of construction/mining equipment (333120) @@ -368,7 +381,7 @@ source_names: attribution_method: proportional attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea + <<: *bea_summary selection_fields: ActivityProducedBy: {'333': ''} # purchases of farm machinery (333111) @@ -378,7 +391,7 @@ source_names: attribution_method: proportional attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea + <<: *bea_summary selection_fields: ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) @@ -389,7 +402,7 @@ source_names: attribution_method: proportional attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea + <<: *bea_summary selection_fields: ActivityProducedBy: {'22': ''} # purchases of natural gas (221200) @@ -418,10 +431,10 @@ source_names: Industrial Other Coal Industrial: Coal Industrial attribution_method: proportional attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea_detail selection_fields: - ActivityProducedBy: {'212': ''} # purchases of coal (212100) + ActivityProducedBy: {'212100': ''} # purchases of coal (212100) non_manufacturing_natural_gas: # Applies to non-manufacturing sectors like ag and mining selection_fields: @@ -431,7 +444,7 @@ source_names: attribution_method: proportional attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea + <<: *bea_summary selection_fields: ActivityProducedBy: {'22': ''} # purchases of natural gas (221200) @@ -450,7 +463,7 @@ source_names: - Coke and Breeze # attribution_source: TODO do we need attribution of MECS data? # BEA_Summary_Use_PRO_BeforeRedef: - # <<: *bea + # <<: *bea_summary # selection_fields: # ActivityProducedBy: {'212100': ''} # purchases of coal @@ -467,7 +480,7 @@ source_names: FlowName: Natural Gas # attribution_source: # BEA_Summary_Use_PRO_BeforeRedef: - # <<: *bea + # <<: *bea_summary # selection_fields: # ActivityProducedBy: {'221200': ''} # purchases of natural gas @@ -479,7 +492,7 @@ source_names: attribution_method: proportional attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea + <<: *bea_summary selection_fields: ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) @@ -512,10 +525,10 @@ source_names: Wood Electric Power: Wood Electric Power attribution_method: proportional attribution_source: - BEA_Summary_Make_BeforeRedef: - <<: *bea + BEA_Detail_Make_BeforeRedef: + <<: *bea_detail selection_fields: - ActivityConsumedBy: {'22': ''} # Electricity (221100) + ActivityConsumedBy: {'221100': ''} # Electricity (221100) fuel_oil: selection_fields: PrimaryActivity: @@ -524,7 +537,7 @@ source_names: attribution_method: proportional attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea + <<: *bea_summary selection_fields: ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) @@ -538,7 +551,7 @@ source_names: attribution_method: proportional attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea + <<: *bea_summary selection_fields: ActivityProducedBy: {'22': ''} # purchases of natural gas (221200) @@ -547,10 +560,10 @@ source_names: PrimaryActivity: Coal Industrial attribution_method: proportional attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea_detail selection_fields: - ActivityProducedBy: {'212': ''} # purchases of coal (212100) + ActivityProducedBy: {'212100': ''} # purchases of coal (212100) coal_manufacturing: selection_fields: @@ -564,7 +577,7 @@ source_names: FlowName: Coal # attribution_source: # BEA_Summary_Use_PRO_BeforeRedef: - # <<: *bea + # <<: *bea_summary # selection_fields: # ActivityProducedBy: {'212100': ''} # purchases of coal @@ -582,7 +595,7 @@ source_names: FlowName: Natural Gas # attribution_source: # BEA_Summary_Use_PRO_BeforeRedef: - # <<: *bea + # <<: *bea_summary # selection_fields: # ActivityProducedBy: {'221200': ''} # purchases of natural gas @@ -646,7 +659,7 @@ source_names: - Hydrocarbon Gas Liquids, excluding natural gasoline # attribution_source: # BEA_Summary_Use_PRO_BeforeRedef: - # <<: *bea + # <<: *bea_summary # selection_fields: # ActivityProducedBy: {'324110': ''} # purchases of refineries @@ -663,7 +676,7 @@ source_names: Unit: Trillion Btu # attribution_source: # BEA_Summary_Use_PRO_BeforeRedef: - # <<: *bea + # <<: *bea_summary # selection_fields: # ActivityProducedBy: {'221200': ''} # purchases of natural gas @@ -673,7 +686,7 @@ source_names: attribution_method: proportional attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea + <<: *bea_summary selection_fields: ActivityProducedBy: {'324': ''} # use of petroleum products (324110) @@ -715,10 +728,10 @@ source_names: - Industrial Process Refrigeration attribution_method: proportional attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea_detail selection_fields: - ActivityProducedBy: {'333': ''} # Air conditioning equipment (333415) + ActivityProducedBy: {'333415': ''} # Air conditioning equipment (333415) air_conditioning: selection_fields: @@ -726,10 +739,10 @@ source_names: - Commercial Stationary Air Conditioning attribution_method: proportional attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea_detail selection_fields: - ActivityProducedBy: {'333': ''} # Air conditioning equipment (333415) + ActivityProducedBy: {'333415': ''} # Air conditioning equipment (333415) foams: selection_fields: @@ -737,11 +750,13 @@ source_names: - Foams attribution_method: proportional attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea_detail selection_fields: ActivityProducedBy: - '326': '' # Polystyrene foam & Urethane and other foam (326140 & 326150) + ActivityProducedBy: + '326140': '' # Polystyrene foam + '326150': '' # Urethane and other foam # 'Mobile Air Conditioning' and 'Transport Refrigeration' come from From 5530550f389abf3d1c216a93f6a390b73ccfecda Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 8 Sep 2023 16:02:04 -0400 Subject: [PATCH 0958/1127] fix error in transcription --- flowsa/methods/flowbysectormethods/GHG_state_2012_m1.yaml | 2 +- flowsa/methods/flowbysectormethods/GHG_state_2013_m1.yaml | 2 +- flowsa/methods/flowbysectormethods/GHG_state_2014_m1.yaml | 2 +- flowsa/methods/flowbysectormethods/GHG_state_2015_m1.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2012_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2012_m1.yaml index 4cf32ec19..bd7e3994b 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2012_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2012_m1.yaml @@ -123,7 +123,7 @@ source_names: !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:urea attribution_source: USDA_CoA_Cropland_NAICS: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ag:attribution_source:USDA_CoA_Cropland_NAICS + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:urea:attribution_source:USDA_CoA_Cropland_NAICS year: *coa_year transport_petroleum: # C02 from petroleum highway diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2013_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2013_m1.yaml index bcc1756cf..1d7fd83f1 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2013_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2013_m1.yaml @@ -123,7 +123,7 @@ source_names: !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:urea attribution_source: USDA_CoA_Cropland_NAICS: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ag:attribution_source:USDA_CoA_Cropland_NAICS + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:urea:attribution_source:USDA_CoA_Cropland_NAICS year: *coa_year transport_petroleum: # C02 from petroleum highway diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2014_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2014_m1.yaml index 4b4c56d2f..ad95cdb51 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2014_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2014_m1.yaml @@ -123,7 +123,7 @@ source_names: !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:urea attribution_source: USDA_CoA_Cropland_NAICS: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ag:attribution_source:USDA_CoA_Cropland_NAICS + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:urea:attribution_source:USDA_CoA_Cropland_NAICS year: *coa_year transport_petroleum: # C02 from petroleum highway diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2015_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2015_m1.yaml index a49480d1e..6300c3908 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2015_m1.yaml @@ -123,7 +123,7 @@ source_names: !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:urea attribution_source: USDA_CoA_Cropland_NAICS: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ag:attribution_source:USDA_CoA_Cropland_NAICS + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:urea:attribution_source:USDA_CoA_Cropland_NAICS year: *coa_year transport_petroleum: # C02 from petroleum highway From fda1a1c9aade93944e8876606e84cb2875fcf8d4 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 11 Sep 2023 09:53:22 -0600 Subject: [PATCH 0959/1127] replace "append" with "concat" due to pandas update --- flowsa/data_source_scripts/USGS_MYB.py | 106 ++++++++++++------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/flowsa/data_source_scripts/USGS_MYB.py b/flowsa/data_source_scripts/USGS_MYB.py index e0b850b82..598df04c6 100644 --- a/flowsa/data_source_scripts/USGS_MYB.py +++ b/flowsa/data_source_scripts/USGS_MYB.py @@ -223,7 +223,7 @@ def usgs_asbestos_parse(*, df_list, source, year, **_): data["FlowAmount"] = WITHDRAWN_KEYWORD else: data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system(dataframe, str(year)) return dataframe @@ -300,7 +300,7 @@ def usgs_barite_parse(*, df_list, source, year, **_): data["FlowAmount"] = str(0) else: data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -382,7 +382,7 @@ def usgs_bauxite_parse(*, df_list, source, year, **_): data["Description"] = des data["ActivityProducedBy"] = name data['FlowName'] = name + " " + prod - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -477,7 +477,7 @@ def usgs_beryllium_parse(*, df_list, source, year, **_): data["ActivityProducedBy"] = name data['FlowName'] = name + " " + prod data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -580,7 +580,7 @@ def usgs_boron_parse(*, df_list, source, year, **_): data["FlowAmount"] = WITHDRAWN_KEYWORD else: data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -659,7 +659,7 @@ def usgs_chromium_parse(*, df_list, source, year, **_): data["FlowAmount"] = str(0) else: data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -831,7 +831,7 @@ def usgs_clay_parse(*, df_list, source, year, **_): data["FlowAmount"] = str(0) else: data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -934,7 +934,7 @@ def usgs_cobalt_parse(*, df_list, source, year, **_): data["FlowAmount"] = str(df.iloc[index][col_name]) remove_rows = ["(18)", "(2)"] if data["FlowAmount"] not in remove_rows: - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -1015,7 +1015,7 @@ def usgs_copper_parse(*, df_list, source, year, **_): col_name = usgs_myb_year(YEARS_COVERED['copper'], year) data["Description"] = "Copper; Mine" data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -1095,7 +1095,7 @@ def usgs_diatomite_parse(*, df_list, source, year, **_): data["Description"] = name data["ActivityProducedBy"] = name data['FlowName'] = name + " " + prod - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -1188,7 +1188,7 @@ def usgs_feldspar_parse(*, df_list, source, year, **_): data['FlowName'] = name + " " + prod else: data['FlowName'] = name + " " + prod + " " + des - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -1323,7 +1323,7 @@ def usgs_fluorspar_parse(*, df_list, source, year, **_): data["Description"] = des data["ActivityProducedBy"] = name data['FlowName'] = name + " " + prod - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -1404,7 +1404,7 @@ def usgs_gallium_parse(*, df_list, source, year, **_): data["FlowAmount"] = WITHDRAWN_KEYWORD else: data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -1494,7 +1494,7 @@ def usgs_garnet_parse(*, df_list, source, year, **_): data["Description"] = des data["ActivityProducedBy"] = name data['FlowName'] = name + " " + prod - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -1572,7 +1572,7 @@ def usgs_gold_parse(*, df_list, source, year, **_): data["FlowAmount"] = str(0) else: data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -1645,7 +1645,7 @@ def usgs_graphite_parse(*, df_list, source, year, **_): data["FlowAmount"] = WITHDRAWN_KEYWORD else: data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -1729,7 +1729,7 @@ def usgs_gypsum_parse(*, df_list, source, year, **_): data["Description"] = des data["ActivityProducedBy"] = name data['FlowName'] = name + " " + prod - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -1810,7 +1810,7 @@ def usgs_iodine_parse(*, df_list, source, year, **_): data["FlowAmount"] = WITHDRAWN_KEYWORD else: data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -1881,7 +1881,7 @@ def usgs_iron_ore_parse(*, df_list, source, year, **_): data["FlowAmount"] = str(0) else: data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -1960,7 +1960,7 @@ def usgs_kyanite_parse(*, df_list, source, year, **_): data["Description"] = des data["ActivityProducedBy"] = name data['FlowName'] = name + " " + prod - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -2149,7 +2149,7 @@ def usgs_lime_parse(*, df_list, source, year, **_): data['FlowName'] = name + " " + prod data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -2231,7 +2231,7 @@ def usgs_lithium_parse(*, df_list, source, year, **_): data["Description"] = des data["ActivityProducedBy"] = name data['FlowName'] = name + " " + prod - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -2306,7 +2306,7 @@ def usgs_magnesium_parse(*, df_list, source, year, **_): data["FlowAmount"] = WITHDRAWN_KEYWORD else: data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -2383,7 +2383,7 @@ def usgs_manganese_parse(*, df_list, source, year, **_): data["FlowAmount"] = str(0) else: data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -2462,7 +2462,7 @@ def usgs_ma_parse(*, df_list, source, year, **_): col_name_array = col_name.split("_") data["Description"] = product + " " + col_name_array[0] data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -2535,7 +2535,7 @@ def usgs_mica_parse(*, df_list, source, year, **_): data["Description"] = des data["ActivityProducedBy"] = name data['FlowName'] = name + " " + prod - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -2608,7 +2608,7 @@ def usgs_molybdenum_parse(*, df_list, source, year, **_): data["FlowAmount"] = str(0) else: data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, data], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -2713,7 +2713,7 @@ def usgs_nickel_parse(*, df_list, source, year, **_): data["FlowAmount"] = str(0) else: data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -2790,7 +2790,7 @@ def usgs_niobium_parse(*, df_list, source, year, **_): data["FlowAmount"] = str(0) else: data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -2875,7 +2875,7 @@ def usgs_peat_parse(*, df_list, source, year, **_): data["Description"] = des data["ActivityProducedBy"] = name data['FlowName'] = name + " " + prod - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -2960,7 +2960,7 @@ def usgs_perlite_parse(*, df_list, source, year, **_): data["Description"] = des data["ActivityProducedBy"] = name data['FlowName'] = name + " " + prod - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -3053,7 +3053,7 @@ def usgs_phosphate_parse(*, df_list, source, year, **_): data["Description"] = des data["ActivityProducedBy"] = name data['FlowName'] = name + " " + prod - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -3161,7 +3161,7 @@ def usgs_platinum_parse(*, df_list, source, year, **_): data["FlowAmount"] = str(0) else: data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -3253,7 +3253,7 @@ def usgs_potash_parse(*, df_list, source, year, **_): data["Description"] = des data["ActivityProducedBy"] = name data['FlowName'] = name + " " + prod - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -3337,7 +3337,7 @@ def usgs_pumice_parse(*, df_list, source, year, **_): data["Description"] = des data["ActivityProducedBy"] = name data['FlowName'] = name + " " + prod - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -3417,7 +3417,7 @@ def usgs_rhenium_parse(*, df_list, source, year, **_): data["FlowAmount"] = str(0) else: data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -3509,7 +3509,7 @@ def usgs_salt_parse(*, df_list, source, year, **_): data["Description"] = des data["ActivityProducedBy"] = name data['FlowName'] = name + " " + prod - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -3583,7 +3583,7 @@ def usgs_sgc_parse(*, df_list, source, year, **_): if product.strip() == "Quantity": data['FlowName'] = "Sand Gravel Construction " + prod data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -3676,7 +3676,7 @@ def usgs_sgi_parse(*, df_list, source, year, **_): data["ActivityProducedBy"] = "Sand Gravel Industrial" data['FlowName'] = "Sand Gravel Industrial " + prod data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -3746,7 +3746,7 @@ def usgs_silver_parse(*, df_list, source, year, **_): data["FlowAmount"] = str(0) else: data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -3870,7 +3870,7 @@ def soda_parse(*, df_list, source, year, **_): """ total_glass = 0 - data = {} + data = [] row_to_use = ["Quantity", "Quantity2"] prod = "" name = usgs_myb_name(source) @@ -3905,7 +3905,7 @@ def soda_parse(*, df_list, source, year, **_): data["Description"] = des data["ActivityProducedBy"] = name data['FlowName'] = name + " " + prod - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) else: @@ -3932,7 +3932,7 @@ def soda_parse(*, df_list, source, year, **_): des_str = str(df.iloc[index]["NAICS code"]) data["Description"] = des_str if df.iloc[index]["End use"].strip() != "Glass:": - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, data], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -4011,7 +4011,7 @@ def usgs_stonecr_parse(*, df_list, source, year, **_): data['FlowName'] = "Stone Crushed " + prod data["FlowAmount"] = str(df.iloc[index][col_name]) if prod != "recycle": - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -4083,7 +4083,7 @@ def usgs_stonedis_parse(*, df_list, source, year, **_): data['FlowName'] = "Stone Dimension " + prod data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -4172,7 +4172,7 @@ def usgs_strontium_parse(*, df_list, source, year, **_): data["FlowAmount"] = str(0) else: data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -4259,7 +4259,7 @@ def usgs_talc_parse(*, df_list, source, year, **_): data["Description"] = des data["ActivityProducedBy"] = name data['FlowName'] = name + " " + prod - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -4351,7 +4351,7 @@ def usgs_titanium_parse(*, df_list, source, year, **_): data["FlowAmount"] = str(0) else: data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -4427,7 +4427,7 @@ def usgs_tungsten_parse(*, df_list, source, year, **_): data["FlowAmount"] = WITHDRAWN_KEYWORD else: data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -4511,7 +4511,7 @@ def usgs_vermiculite_parse(*, df_list, source, year, **_): data["Description"] = des data["ActivityProducedBy"] = name data['FlowName'] = name + " " + prod - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -4592,7 +4592,7 @@ def usgs_zeolites_parse(*, df_list, source, year, **_): data["Description"] = des data["ActivityProducedBy"] = name data['FlowName'] = name + " " + prod - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -4705,7 +4705,7 @@ def usgs_zinc_parse(*, df_list, source, year, **_): data["ActivityProducedBy"] = name + " " + prod data['FlowName'] = "Zinc; Mine" - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -4808,7 +4808,7 @@ def usgs_zirconium_parse(*, df_list, source, year, **_): data["FlowAmount"] = WITHDRAWN_KEYWORD else: data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = dataframe.append(data, ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe From c3c9fba0ea10ae8d3f85b76cfee16cf3696e62e5 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 11 Sep 2023 10:43:46 -0600 Subject: [PATCH 0960/1127] modify myb concat statements to concat 2 dfs --- flowsa/data_source_scripts/USGS_MYB.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/data_source_scripts/USGS_MYB.py b/flowsa/data_source_scripts/USGS_MYB.py index 598df04c6..52d6ceaf7 100644 --- a/flowsa/data_source_scripts/USGS_MYB.py +++ b/flowsa/data_source_scripts/USGS_MYB.py @@ -2608,7 +2608,7 @@ def usgs_molybdenum_parse(*, df_list, source, year, **_): data["FlowAmount"] = str(0) else: data["FlowAmount"] = str(df.iloc[index][col_name]) - dataframe = pd.concat([dataframe, data], ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe @@ -3932,7 +3932,7 @@ def soda_parse(*, df_list, source, year, **_): des_str = str(df.iloc[index]["NAICS code"]) data["Description"] = des_str if df.iloc[index]["End use"].strip() != "Glass:": - dataframe = pd.concat([dataframe, data], ignore_index=True) + dataframe = pd.concat([dataframe, pd.DataFrame.from_dict([data])], ignore_index=True) dataframe = assign_fips_location_system( dataframe, str(year)) return dataframe From e01f0b60d19a627754dee45749e0b016f501c28b Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 11 Sep 2023 10:44:56 -0600 Subject: [PATCH 0961/1127] expand method_status to include new known usgs myb broken links --- flowsa/methods/method_status.yaml | 57 ++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/flowsa/methods/method_status.yaml b/flowsa/methods/method_status.yaml index 05604e13a..c0750c4d6 100644 --- a/flowsa/methods/method_status.yaml +++ b/flowsa/methods/method_status.yaml @@ -2,7 +2,37 @@ # FlowByActivity -USGS_MYB_Potash: +USGS_MYB_Barite: + Active: False + Status: Error in source data links + Type: HTTPError + +USGS_MYB_Gallium: + Active: False + Status: Error in source data links + Type: HTTPError + +USGS_MYB_Gypsum: + Active: False + Status: Error in source data links + Type: HTTPError + +USGS_MYB_IronOre: + Active: False + Status: Error in source data links + Type: HTTPError + +USGS_MYB_Kyanite: + Active: False + Status: Error in source data links + Type: HTTPError + +USGS_MYB_Mica: + Active: False + Status: Error in source data links + Type: HTTPError + +USGS_MYB_Niobium: Active: False Status: Error in source data links Type: HTTPError @@ -12,6 +42,31 @@ USGS_MYB_Phosphate: Status: Error in source data links Type: HTTPError +USGS_MYB_Potash: + Active: False + Status: Error in source data links + Type: HTTPError + +USGS_MYB_SandGravelIndustrial: + Active: False + Status: Error in source data links + Type: HTTPError + +USGS_MYB_StoneCrushed: + Active: False + Status: Error in source data links + Type: HTTPError + +USGS_MYB_Vermiculite: + Active: False + Status: Error in source data links + Type: HTTPError + +USGS_MYB_Zeolites: + Active: False + Status: Error in source data links + Type: HTTPError + BTS_Airlines: Active: True Status: Private data From d8db5ef3965a44cf5ea5ac3dce7a2ddf7bf91895 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 11 Sep 2023 11:45:12 -0600 Subject: [PATCH 0962/1127] drop support for python 3.8, add tests for 3.11 --- .github/workflows/python-app.yml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 86b0b7058..3e375069f 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -31,7 +31,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - py-version: ['3.8', '3.9', '3.10'] + py-version: ['3.9', '3.10', '3.11'] steps: - uses: actions/checkout@v3 diff --git a/setup.py b/setup.py index 4d0edbea6..e00e5e597 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ packages=find_packages(), package_dir={'flowsa': 'flowsa'}, include_package_data=True, - python_requires=">=3.8", + python_requires=">=3.9", install_requires=[ 'fedelemflowlist @ git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git@develop#egg=fedelemflowlist', 'esupy @ git+https://github.com/USEPA/esupy.git@develop#egg=esupy', From 290dd2048e85da089ff79bbdabffd1bba3a73df0 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 11 Sep 2023 12:40:18 -0600 Subject: [PATCH 0963/1127] add additional description in the FBA and FBS example files --- examples/get_flows_by_activity.py | 7 +++++++ examples/get_flows_by_sector.py | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/examples/get_flows_by_activity.py b/examples/get_flows_by_activity.py index 58a27184e..2490c3b7e 100644 --- a/examples/get_flows_by_activity.py +++ b/examples/get_flows_by_activity.py @@ -3,6 +3,13 @@ # coding=utf-8 """ +Flow-By-Activity (FBA) datasets are environmental and economic data that are +generally pulled from publicly available data sources and formatted into +standardized tables (defined in +https://github.com/USEPA/flowsa/blob/master/format%20specs/FlowByActivity.md). +These data are generally unchanged from the source data, with the exception +of formatting. + See source_catalog.yaml for available FlowByActivity datasets and available parameters for getFlowByActivity(). Examples of use of flowsa. Read parquet files as dataframes. diff --git a/examples/get_flows_by_sector.py b/examples/get_flows_by_sector.py index d4cbacd61..71ccdc1f8 100644 --- a/examples/get_flows_by_sector.py +++ b/examples/get_flows_by_sector.py @@ -3,6 +3,24 @@ # coding=utf-8 """ +Flow-By-Sector (FBS) datasets are environmental, economic, and other data that +are attributed to economic sectors, generally North American Industrial +Classification (NAICS) Codes. These datasets capture flows of env/econ data +from sectors that produce the data to the sectors that consume the data. +For example, Water_national_2015_m1 (https://github.com/USEPA/flowsa/blob/ +master/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml) +captures the flow of withdrawn water through the economy. This dataset +tracks water withdrawn by Public Supply (SectorProducedBy) that flows to +Domestic use (SectorConsumedBy). Not all FBS contain data in both the +SectorProducedBy and SectorConsumedBy columns. For example +Employment_national_2018 (https://github.com/USEPA/flowsa/blob/master/ +flowsa/methods/flowbysectormethods/Employment_national_2018.yaml) only contains +employment data in the SectorProducedBy column, as there are not flows of +employment between sectors. + +Tables are standardized into a table defined in +https://github.com/USEPA/flowsa/blob/master/format%20specs/FlowBySector.md. + Retrieves stored data in the FlowBySector format :param methodname: string, Name of an available method for the given class. Method files found in flowsa/data/flowbysectormethods From c7d241640e47d09d61668a59bf21188e7522276e Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 11 Sep 2023 13:45:22 -0600 Subject: [PATCH 0964/1127] add in working data vis examples --- examples/generate_data_visualization.py | 92 ++++++++++++------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/examples/generate_data_visualization.py b/examples/generate_data_visualization.py index a5fafdd3e..696c89032 100644 --- a/examples/generate_data_visualization.py +++ b/examples/generate_data_visualization.py @@ -15,41 +15,54 @@ ########## Produce facet graph of resources associated with cropland sectors ########## -# sectors = ['112'] -# sector_length_display = 6 -# plottype = 'facet_graph' -# method_dict = {'Water Withdrawal 2015': 'Water_national_2015_m1', -# 'Land Use 2012': 'Land_national_2012', -# 'Employment 2017': 'Employment_national_2017'} -# -# -# dv.FBSscatterplot(method_dict, plottype, -# sector_length_display=sector_length_display, -# sectors_to_include=sectors, -# plot_title='Direct Resource Use for Livestock' -# ) -# # Can manually adjust the figure pop up before saving -# plt.savefig(plotoutputpath / "livestock_resource_use.png", dpi=300) -# -# -# ########## Compare the results between water method 1 and method 2 ########## -# sectors = ['21'] -# sector_length_display = 6 -# plottype = 'method_comparison' -# method_dict = {'Water Withdrawal 2015 M1': 'Water_national_2015_m1', -# 'Water Withdrawal 2015 M2': 'Water_national_2015_m2'} -# -# flowsa.generateFBSplot(method_dict, plottype, -# sector_length_display=sector_length_display, -# sectors_to_include=sectors, -# plot_title='Comparison of 2015 National Water ' -# 'Withdrawals Method 1 and Method 2 for ' -# 'Mining Sectors' -# ) -# # Can manually adjust the figure pop up before saving -# plt.savefig(plotoutputpath / "mining_water_comp.png", dpi=300) +sectors = ['112'] +sector_length_display = 6 +plottype = 'facet_graph' +method_dict = {'Water Withdrawal 2015': 'Water_national_2015_m1', + 'Land Use 2012': 'Land_national_2012', + 'Employment 2017': 'Employment_national_2017'} + + +dv.FBSscatterplot(method_dict, plottype, + sector_length_display=sector_length_display, + sectors_to_include=sectors, + plot_title='Direct Resource Use for Livestock' + ) +# Can manually adjust the figure pop up before saving +plt.savefig(plotoutputpath / "livestock_resource_use.png", dpi=300) + + +########## Compare the results between water method 1 and method 2 ########## +sectors = ['21'] +sector_length_display = 6 +plottype = 'method_comparison' +method_dict = {'National Employment 2015': 'Employment_national_2015', + 'National Employment 2018': 'Employment_national_2018'} + +flowsa.FBSscatterplot(method_dict, plottype, + sector_length_display=sector_length_display, + sectors_to_include=sectors, + plot_title='Comparison of 2015 and 2018 Employment ' + 'for Mining Sectors' + ) +# Can manually adjust the figure pop up before saving +plt.savefig(plotoutputpath / "mining_employment_comp.png", dpi=300) +####### GHG Bar Chart ############ +# Option 1 - GHG emissions by GHG +dv.stackedBarChart('GHG_national_2018_m1', + selection_fields={'SectorProducedBy': ['111110', '112120', '325312']}, + filename='GHGEmissions') + +# Option 2 - specify indicator, much have LCIAformatter installed +# https://github.com/USEPA/LCIAformatter +dv.stackedBarChart('GHG_national_2018_m1', impact_cat='Global warming', + selection_fields={'SectorProducedBy': ['111110', '112120', '325312']}, + filename='GHGEmissionsGlobalWarming') + + +# todo: will update the sankey code for recursive method post v2.0 release ########## Compare food waste flows via Sankey ########## # methodnames = ['Food_Waste_national_2018_m1', 'Food_Waste_national_2018_m2'] # target_sector_level = 'NAICS_2' @@ -84,16 +97,3 @@ # subplot_titles=['m1', 'm2'], # filename='FoodWasteSankey' # ) - - -####### GHG Bar Chart ############ -# Option 1 - GHG emissions by GHG -# dv.stackedBarChart('GHG_national_2018_m1', -# selection_fields={'Sector': ['111110', '112120', '325312']}, -# filename='GHGEmissions') -# -# # Option 2 - specify indicator, much have LCIAformatter installed -# # https://github.com/USEPA/LCIAformatter -# dv.stackedBarChart('GHG_national_2018_m1', impact_cat='Global warming', -# selection_fields={'Sector': ['111110', '112120', '325312']}, -# filename='GHGEmissionsGlobalWarming') From 98abe716f98e3858b852e5e916e677db3ad7d0ca Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 11 Sep 2023 13:46:33 -0600 Subject: [PATCH 0965/1127] comment out fxns to write bibliography - will revist after v2.0 release --- examples/write_bibliography.py | 11 +- flowsa/__init__.py | 24 +-- flowsa/bibliography.py | 297 +++++++++++++++++---------------- 3 files changed, 168 insertions(+), 164 deletions(-) diff --git a/examples/write_bibliography.py b/examples/write_bibliography.py index 877615f16..3640d018d 100644 --- a/examples/write_bibliography.py +++ b/examples/write_bibliography.py @@ -6,8 +6,11 @@ Writes a .bib for sources in a FlowBySector method yaml """ -import flowsa +# todo: will reintroduce option to write bibliography for recursive +# method post v2.0 release - -# write .bib file to local directory for a Flow-By-Sector method -flowsa.writeFlowBySectorBibliography('Land_national_2012') +# import flowsa +# +# +# # write .bib file to local directory for a Flow-By-Sector method +# flowsa.writeFlowBySectorBibliography('Land_national_2012') diff --git a/flowsa/__init__.py b/flowsa/__init__.py index d90a2d643..c338aec0f 100644 --- a/flowsa/__init__.py +++ b/flowsa/__init__.py @@ -27,7 +27,7 @@ from flowsa.flowbyfunctions import collapse_fbs_sectors, filter_by_geoscale from flowsa.validation import check_for_nonetypes_in_sector_col, \ check_for_negative_flowamounts -from flowsa.bibliography import generate_fbs_bibliography +# from flowsa.bibliography import generate_fbs_bibliography from flowsa.datavisualization import FBSscatterplot from flowsa.flowbyactivity import FlowByActivity from flowsa.flowbysector import FlowBySector @@ -123,17 +123,17 @@ def collapse_FlowBySector( return fbs_collapsed - -def writeFlowBySectorBibliography(methodname): - """ - Generate bibliography for FlowBySectorMethod in local directory - :param methodname: string, FBS methodname for which to create .bib file - :return: .bib file save to local directory - """ - # Generate a single .bib file for a list of Flow-By-Sector method names - # and save file to local directory - log.info(f'Write bibliography to {biboutputpath / methodname}.bib') - generate_fbs_bibliography(methodname) +# todo: will reintroduce option to create bibliography post 2.0 release +# def writeFlowBySectorBibliography(methodname): +# """ +# Generate bibliography for FlowBySectorMethod in local directory +# :param methodname: string, FBS methodname for which to create .bib file +# :return: .bib file save to local directory +# """ +# # Generate a single .bib file for a list of Flow-By-Sector method names +# # and save file to local directory +# log.info(f'Write bibliography to {biboutputpath / methodname}.bib') +# generate_fbs_bibliography(methodname) def seeAvailableFlowByModels(flowbytype, print_method=True): diff --git a/flowsa/bibliography.py b/flowsa/bibliography.py index b037c996e..1781b87b9 100644 --- a/flowsa/bibliography.py +++ b/flowsa/bibliography.py @@ -4,151 +4,152 @@ """ Functions to generate .bib file for a FlowBySector method """ - -import pandas as pd -from bibtexparser.bwriter import BibTexWriter -from bibtexparser.bibdatabase import BibDatabase -from esupy.processed_data_mgmt import mkdir_if_missing -from flowsa.common import load_values_from_literature_citations_config, \ - get_flowsa_base_name, sourceconfigpath, load_yaml_dict -from flowsa.flowsa_log import log -from flowsa.settings import outputpath, biboutputpath - - -def generate_list_of_sources_in_fbs_method(methodname): - """ - Determine what FlowByActivities are used to generate a FlowBySector - :param methodname: string, FlowBySector method - :return: list, pairs of FlowByActivity source names and years - """ - sources = [] - # load the fbs method yaml - fbs_yaml = load_yaml_dict(methodname, flowbytype='FBS') - - # create list of data and allocation data sets - fbs = fbs_yaml['source_names'] - for fbs_k, fbs_v in fbs.items(): - try: - sources.append([fbs_k, fbs_v['year']]) - except KeyError: - log.info('Could not append %s to datasource ' - 'list because missing year', fbs_k) - continue - activities = fbs_v['activity_sets'] - for aset, attr in activities.items(): - if attr['allocation_source'] != 'None': - sources.append([attr['allocation_source'], - attr['allocation_source_year']]) - if 'helper_source' in attr: - sources.append([attr['helper_source'], - attr['helper_source_year']]) - if 'literature_sources' in attr: - for source, date in attr['literature_sources'].items(): - sources.append([source, date]) - - return sources - - -def load_source_dict(sourcename): - """ - Load the yaml method file for a flowbyactivity dataset - or for a value from the literature - :param sourcename: string, FBA source name or value from the lit name - :return: dictionary, the method file - """ - - try: - # check if citation info is for values in the literature - config_load = load_values_from_literature_citations_config() - config = config_load[sourcename] - except KeyError: - # else check if file exists, then try loading - # citation information from source yaml - sourcename = get_flowsa_base_name(sourceconfigpath, sourcename, "yaml") - config = load_yaml_dict(sourcename, flowbytype='FBA') - - return config - - -def generate_fbs_bibliography(methodname): - """ - Generate bibliography for a FlowBySector - :param methodname: string, methodname to create a bibliiography - :return: a .bib file saved in local directory - """ - - from flowsa.metadata import getMetadata - - # create list of sources in method - sources = generate_list_of_sources_in_fbs_method(methodname) - - # loop through list of sources, load source method - # yaml, and create bib entry - bib_list = [] - source_set = set() - for source in sources: - # drop list duplicates and any where year is None (because allocation - # is a function, not a datasource) - if source[1] != 'None': - try: - config = \ - load_values_from_literature_citations_config()[source[0]] - except KeyError: - try: - config = getMetadata(source[0], source[1]) - # flatten the dictionary so can treat all - # dictionaries the same when pulling info - config = pd.json_normalize(config, sep='_') - config.columns = \ - config.columns.str.replace('tool_meta_', '') - config = config.to_dict(orient='records')[0] - except KeyError or AttributeError: - log.info('Could not find metadata for %s', source[0]) - continue - if config is not None: - # ensure data sources are not duplicated - # when different source names - try: - if (config['source_name'], config['author'], source[1], - config['source_url']) not in source_set: - source_set.add((config['source_name'], - config['author'], - source[1], - config['source_url'])) - - # if there is a date downloaded, use in - # citation over date generated - if 'original_data_download_date' in config: - bib_date = config['original_data_download_date'] - elif 'date_accessed' in config: - bib_date = config['date_accessed'] - else: - bib_date = config['date_created'] - - db = BibDatabase() - db.entries = [{ - 'title': f"{config['source_name']} " - f"{str(source[1])}", - 'author': config['author'], - 'year': str(source[1]), - 'url': config['tool_meta']['source_url'], - 'urldate': bib_date, - 'ID': config['tool_meta']['bib_id'] + '_' + str(source[1]), - 'ENTRYTYPE': 'misc' - }] - # append each entry to a list of BibDatabase entries - bib_list.append(db) - except KeyError: - log.exception('Missing information needed to ' - 'create bib for %s, %s', source[0], - source[1]) - continue - - # write out bibliography - writer = BibTexWriter() - # create directory if missing - mkdir_if_missing(outputpath / 'Bibliography') - with open(biboutputpath / f'{methodname}.bib', 'w') as bibfile: - # loop through all entries in bib_list - for b in bib_list: - bibfile.write(writer.write(b)) +# todo: modify the functions for recursive yaml method + +# import pandas as pd +# from bibtexparser.bwriter import BibTexWriter +# from bibtexparser.bibdatabase import BibDatabase +# from esupy.processed_data_mgmt import mkdir_if_missing +# from flowsa.common import load_values_from_literature_citations_config, \ +# get_flowsa_base_name, sourceconfigpath, load_yaml_dict +# from flowsa.flowsa_log import log +# from flowsa.settings import outputpath, biboutputpath +# +# +# def generate_list_of_sources_in_fbs_method(methodname): +# """ +# Determine what FlowByActivities are used to generate a FlowBySector +# :param methodname: string, FlowBySector method +# :return: list, pairs of FlowByActivity source names and years +# """ +# sources = [] +# # load the fbs method yaml +# fbs_yaml = load_yaml_dict(methodname, flowbytype='FBS') +# +# # create list of data and allocation data sets +# fbs = fbs_yaml['source_names'] +# for fbs_k, fbs_v in fbs.items(): +# try: +# sources.append([fbs_k, fbs_v['year']]) +# except KeyError: +# log.info('Could not append %s to datasource ' +# 'list because missing year', fbs_k) +# continue +# activities = fbs_v['activity_sets'] +# for aset, attr in activities.items(): +# if attr['allocation_source'] != 'None': +# sources.append([attr['allocation_source'], +# attr['allocation_source_year']]) +# if 'helper_source' in attr: +# sources.append([attr['helper_source'], +# attr['helper_source_year']]) +# if 'literature_sources' in attr: +# for source, date in attr['literature_sources'].items(): +# sources.append([source, date]) +# +# return sources +# +# +# def load_source_dict(sourcename): +# """ +# Load the yaml method file for a flowbyactivity dataset +# or for a value from the literature +# :param sourcename: string, FBA source name or value from the lit name +# :return: dictionary, the method file +# """ +# +# try: +# # check if citation info is for values in the literature +# config_load = load_values_from_literature_citations_config() +# config = config_load[sourcename] +# except KeyError: +# # else check if file exists, then try loading +# # citation information from source yaml +# sourcename = get_flowsa_base_name(sourceconfigpath, sourcename, "yaml") +# config = load_yaml_dict(sourcename, flowbytype='FBA') +# +# return config +# +# +# def generate_fbs_bibliography(methodname): +# """ +# Generate bibliography for a FlowBySector +# :param methodname: string, methodname to create a bibliiography +# :return: a .bib file saved in local directory +# """ +# +# from flowsa.metadata import getMetadata +# +# # create list of sources in method +# sources = generate_list_of_sources_in_fbs_method(methodname) +# +# # loop through list of sources, load source method +# # yaml, and create bib entry +# bib_list = [] +# source_set = set() +# for source in sources: +# # drop list duplicates and any where year is None (because allocation +# # is a function, not a datasource) +# if source[1] != 'None': +# try: +# config = \ +# load_values_from_literature_citations_config()[source[0]] +# except KeyError: +# try: +# config = getMetadata(source[0], source[1]) +# # flatten the dictionary so can treat all +# # dictionaries the same when pulling info +# config = pd.json_normalize(config, sep='_') +# config.columns = \ +# config.columns.str.replace('tool_meta_', '') +# config = config.to_dict(orient='records')[0] +# except KeyError or AttributeError: +# log.info('Could not find metadata for %s', source[0]) +# continue +# if config is not None: +# # ensure data sources are not duplicated +# # when different source names +# try: +# if (config['source_name'], config['author'], source[1], +# config['source_url']) not in source_set: +# source_set.add((config['source_name'], +# config['author'], +# source[1], +# config['source_url'])) +# +# # if there is a date downloaded, use in +# # citation over date generated +# if 'original_data_download_date' in config: +# bib_date = config['original_data_download_date'] +# elif 'date_accessed' in config: +# bib_date = config['date_accessed'] +# else: +# bib_date = config['date_created'] +# +# db = BibDatabase() +# db.entries = [{ +# 'title': f"{config['source_name']} " +# f"{str(source[1])}", +# 'author': config['author'], +# 'year': str(source[1]), +# 'url': config['tool_meta']['source_url'], +# 'urldate': bib_date, +# 'ID': config['tool_meta']['bib_id'] + '_' + str(source[1]), +# 'ENTRYTYPE': 'misc' +# }] +# # append each entry to a list of BibDatabase entries +# bib_list.append(db) +# except KeyError: +# log.exception('Missing information needed to ' +# 'create bib for %s, %s', source[0], +# source[1]) +# continue +# +# # write out bibliography +# writer = BibTexWriter() +# # create directory if missing +# mkdir_if_missing(outputpath / 'Bibliography') +# with open(biboutputpath / f'{methodname}.bib', 'w') as bibfile: +# # loop through all entries in bib_list +# for b in bib_list: +# bibfile.write(writer.write(b)) From b9981282a8db3cb311b80bc212daf7eb3597a0c4 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 11 Sep 2023 13:47:03 -0600 Subject: [PATCH 0966/1127] edit stackedbarchart() to not overwrite industry_spec if provided industry_spec is "none" --- flowsa/datavisualization.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flowsa/datavisualization.py b/flowsa/datavisualization.py index ac78eb938..07e793563 100644 --- a/flowsa/datavisualization.py +++ b/flowsa/datavisualization.py @@ -176,7 +176,7 @@ def stackedBarChart(df, # if the df provided is a string, load the fbs method, otherwise use the # df provided if (type(df)) == str: - df = flowsa.getFlowBySector(df) + df = flowsa.FlowBySector.getFlowBySector(df) if generalize_AttributionSources: df['AttributionSources'] = np.where( @@ -190,7 +190,8 @@ def stackedBarChart(df, df = flowsa.flowbysector.FlowBySector(df) # agg sectors for data visualization - df.config['industry_spec'] = industry_spec + if industry_spec is not None: + df.config['industry_spec'] = industry_spec df = df.sector_aggregation() df = flowsa.flowbyfunctions.collapse_fbs_sectors(df) From 2a8b1f470930ad885a4d1cd40c8d05a68cc5f1a7 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 11 Sep 2023 14:18:53 -0600 Subject: [PATCH 0967/1127] update README.md files --- flowsa/README.md | 46 ++++++----- flowsa/methods/README.md | 2 +- flowsa/methods/flowbysectormethods/README.md | 82 +++++++++++++++++++- 3 files changed, 107 insertions(+), 23 deletions(-) diff --git a/flowsa/README.md b/flowsa/README.md index 0cb770597..c0989ee84 100644 --- a/flowsa/README.md +++ b/flowsa/README.md @@ -3,23 +3,29 @@ Python scripts used to generate Flow-By-Activity (FBA) and Flow-By-Sector (FBS) datasets 1. _"\_\_init\_\_.py"_ -2. _"allocation.py"_ -3. _"bibliography.py"_ -4. _"common.py"_ -5. _"dataclean.py"_ -6. _"datavisualization.py"_ -7. _"fbs_allocation.py"_ -8. _"flowbyactivity.py"_ -9. _"flowbyfunctions.py"_ -10. _"flowbysector.py"_ -11. _"flowsa_yaml.py"_ -12. _"literature_values.py"_ -13. _"location.py"_ -14. _"metadata.py"_ -15. _"schema.py"_ -16. _"sectormapping.py"_ -17. _"settings.py"_ -18. _"test_examples.py"_ -19. _"test_FBS_against_remote.py"_ -20. _"test_methods.py"_ -21. _"validation.py"_ +1. _"bibliography.py"_ +1. _"common.py"_ +1. _"dataclean.py"_ +1. _"datavisualization.py"_ +1. _"flowby.py"_ +1. _"flowbyactivity.py"_ +1. _"flowbyclean.py"_ +1. _"flowbyfunctions.py"_ +1. _"flowbysector.py"_ +1. _"flowby_log.py"_ +1. _"flowsa_yaml.py"_ +1. _"generateflowbyactivity.py"_ +1. _"geo.py"_ +1. _"literature_values.py"_ +1. _"location.py"_ +1. _"metadata.py"_ +1. _"naics.py"_ +1. _"schema.py"_ +1. _"sectormapping.py"_ +1. _"settings.py"_ +1. _"test_examples.py"_ +1. _"test_FBS_against_remote.py"_ +1. _"test_methods.py"_ +1. _"test_single_FBA.py"_ +1. _"test_single_FBS.py"_ +1. _"validation.py"_ diff --git a/flowsa/methods/README.md b/flowsa/methods/README.md index 4d26ea8bc..dd3aa05d1 100644 --- a/flowsa/methods/README.md +++ b/flowsa/methods/README.md @@ -1,6 +1,6 @@ ## Current Status -Known issues with exisiting FBA and FBS methods are shown in [method_status.yaml](method_status.yaml) +Known issues with existing FBA and FBS methods are shown in [method_status.yaml](method_status.yaml) ``` diff --git a/flowsa/methods/flowbysectormethods/README.md b/flowsa/methods/flowbysectormethods/README.md index d11de17bc..f1228a7f2 100644 --- a/flowsa/methods/flowbysectormethods/README.md +++ b/flowsa/methods/flowbysectormethods/README.md @@ -2,6 +2,84 @@ Description of parameters in flowbysectormethods yamls. All values are strings unless noted. +## Recursive vs Sequential Attribution +The FBS methods are designed to handle recursive and sequential attribution +methods. + +### Recursive Attribution Methods +Recursive attribution methods allow application of unlimited attribution +methods on a primary data source. For example, a primary data source +(such as `USDA_ERS_MLU`) can be _proportionally_ attributed to sectors with +an attribution source (`USDA_CoA_Cropland`) _after_ `USDA_CoA_Cropland` is +_proportionally_ attributed to a higher resolution of sectors with another +attribution source `USDA_CoA_Cropland_NAICS`. To apply recursive +attribution in the FBS method yaml, all attribution sources are written by +being continually indented, as demonstrated bellow. The yaml is essentially +read bottom-up, where the last attribution method listed is applied to the +data source above until reaching the primary data source. + +``` + USDA_ERS_MLU: + fedefl_mapping: USDA_ERS_MLU + geoscale: state + selection_fields: + Class: Land + activity_sets: + cropland_crops: + selection_fields: + PrimaryActivity: 'Cropland used for crops' + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland: + selection_fields: + Class: Land + FlowName: "AREA HARVESTED" + attribution_method: proportional + attribution_source: + USDA_CoA_Cropland_NAICS: + selection_fields: + Class: Land + FlowName: "AG LAND, CROPLAND, HARVESTED" + attribution_method: direct + +``` + +### Sequential Attribution Methods +Sequential attribution is defined by listing each attribution method to be +applied to a data source. The first attribution method in the list is +applied first, then the next, until all methods in the list are applied. +For example, after loading `EIA_CBECS_Land` and subsetting into an activity +set, the data can first be _proportionally_ attributed using +`Employment_national_2012`. After attribution, a second +_proportional_attribution_ method can be applied using +`Employment_state_2012` data. + +``` + EIA_CBECS_Land: # commercial land use + fedefl_mapping: EIA_CBECS_Land + geoscale: national + selection_fields: + Class: Land + Location: !include:Location_common.yaml:_national_location + clean_fba: !script_function:EIA_CBECS_Land cbecs_land_fba_cleanup + activity_sets: + cbecs_land: # all activities in eia cbecs land crosswalk + selection_fields: + PrimaryActivity: !from_index:EIA_CBECS_Land_2012_asets.csv cbecs_land + attribute: + - attribution_method: proportional + attribution_source: + Employment_national_2012: + geoscale: national + - attribution_method: proportional + attribute_on: ['PrimarySector'] + fill_columns: Location + attribution_source: + Employment_state_2012: + geoscale: state + +``` + ## Special notation Flowsa FBA and FBS method files include custom yaml configurations as defined in `flowsa_yaml.py` using the custom `FlowsaLoader` class. @@ -67,11 +145,11 @@ any level, and are inherited from higher-level sources. the name (e.g., `activity_set_1`) of the activity set as found in the csv file. - _exclusion_fields_: A dictionary that allows subsetting source data by column. See description in `flowby.select_by_fields()`. +- _attribute_: (optional) include for sequential attribution. Follow with list of _attribution_method_ parameters. - _attribution_method_: currently written for `direct`, `proportional`, `multiplication`, `equal`, `inheritance`. See "Method Descriptions" below. - _attribution_source_: The data source used to attribute the primary data - source. - By default attribution is performed on the primary activity column. + source. By default attribution is performed on the primary activity column. #### Optional cleaning functions These parameters assign functions for additional processing of FlowBy objects. From d45e1efdb28cbf32251185441e86f637913b3c7f Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 11 Sep 2023 14:45:51 -0600 Subject: [PATCH 0968/1127] comment out bib test --- flowsa/test_examples.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flowsa/test_examples.py b/flowsa/test_examples.py index c38b80075..cbbe5f998 100644 --- a/flowsa/test_examples.py +++ b/flowsa/test_examples.py @@ -28,8 +28,9 @@ def test_get_flows_by_sector(): download_FBS_if_missing=True) -def test_write_bibliography(): - flowsa.writeFlowBySectorBibliography('Water_national_2015_m1') +# todo: reinstate after modifying bib function for recursive method +# def test_write_bibliography(): +# flowsa.writeFlowBySectorBibliography('Water_national_2015_m1') def test_FBS_methods(): From e7b1bbeecff8e8097d62931af3ad7a18209e0f78 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 11 Sep 2023 15:10:28 -0600 Subject: [PATCH 0969/1127] re-add commented out bibliography.py code used in other fxns --- flowsa/bibliography.py | 130 ++++++++++++++++++++--------------------- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/flowsa/bibliography.py b/flowsa/bibliography.py index 1781b87b9..c257f472f 100644 --- a/flowsa/bibliography.py +++ b/flowsa/bibliography.py @@ -6,71 +6,71 @@ """ # todo: modify the functions for recursive yaml method -# import pandas as pd -# from bibtexparser.bwriter import BibTexWriter -# from bibtexparser.bibdatabase import BibDatabase -# from esupy.processed_data_mgmt import mkdir_if_missing -# from flowsa.common import load_values_from_literature_citations_config, \ -# get_flowsa_base_name, sourceconfigpath, load_yaml_dict -# from flowsa.flowsa_log import log -# from flowsa.settings import outputpath, biboutputpath -# -# -# def generate_list_of_sources_in_fbs_method(methodname): -# """ -# Determine what FlowByActivities are used to generate a FlowBySector -# :param methodname: string, FlowBySector method -# :return: list, pairs of FlowByActivity source names and years -# """ -# sources = [] -# # load the fbs method yaml -# fbs_yaml = load_yaml_dict(methodname, flowbytype='FBS') -# -# # create list of data and allocation data sets -# fbs = fbs_yaml['source_names'] -# for fbs_k, fbs_v in fbs.items(): -# try: -# sources.append([fbs_k, fbs_v['year']]) -# except KeyError: -# log.info('Could not append %s to datasource ' -# 'list because missing year', fbs_k) -# continue -# activities = fbs_v['activity_sets'] -# for aset, attr in activities.items(): -# if attr['allocation_source'] != 'None': -# sources.append([attr['allocation_source'], -# attr['allocation_source_year']]) -# if 'helper_source' in attr: -# sources.append([attr['helper_source'], -# attr['helper_source_year']]) -# if 'literature_sources' in attr: -# for source, date in attr['literature_sources'].items(): -# sources.append([source, date]) -# -# return sources -# -# -# def load_source_dict(sourcename): -# """ -# Load the yaml method file for a flowbyactivity dataset -# or for a value from the literature -# :param sourcename: string, FBA source name or value from the lit name -# :return: dictionary, the method file -# """ -# -# try: -# # check if citation info is for values in the literature -# config_load = load_values_from_literature_citations_config() -# config = config_load[sourcename] -# except KeyError: -# # else check if file exists, then try loading -# # citation information from source yaml -# sourcename = get_flowsa_base_name(sourceconfigpath, sourcename, "yaml") -# config = load_yaml_dict(sourcename, flowbytype='FBA') -# -# return config -# -# +import pandas as pd +from bibtexparser.bwriter import BibTexWriter +from bibtexparser.bibdatabase import BibDatabase +from esupy.processed_data_mgmt import mkdir_if_missing +from flowsa.common import load_values_from_literature_citations_config, \ + get_flowsa_base_name, sourceconfigpath, load_yaml_dict +from flowsa.flowsa_log import log +from flowsa.settings import outputpath, biboutputpath + + +def generate_list_of_sources_in_fbs_method(methodname): + """ + Determine what FlowByActivities are used to generate a FlowBySector + :param methodname: string, FlowBySector method + :return: list, pairs of FlowByActivity source names and years + """ + sources = [] + # load the fbs method yaml + fbs_yaml = load_yaml_dict(methodname, flowbytype='FBS') + + # create list of data and allocation data sets + fbs = fbs_yaml['source_names'] + for fbs_k, fbs_v in fbs.items(): + try: + sources.append([fbs_k, fbs_v['year']]) + except KeyError: + log.info('Could not append %s to datasource ' + 'list because missing year', fbs_k) + continue + activities = fbs_v['activity_sets'] + for aset, attr in activities.items(): + if attr['allocation_source'] != 'None': + sources.append([attr['allocation_source'], + attr['allocation_source_year']]) + if 'helper_source' in attr: + sources.append([attr['helper_source'], + attr['helper_source_year']]) + if 'literature_sources' in attr: + for source, date in attr['literature_sources'].items(): + sources.append([source, date]) + + return sources + + +def load_source_dict(sourcename): + """ + Load the yaml method file for a flowbyactivity dataset + or for a value from the literature + :param sourcename: string, FBA source name or value from the lit name + :return: dictionary, the method file + """ + + try: + # check if citation info is for values in the literature + config_load = load_values_from_literature_citations_config() + config = config_load[sourcename] + except KeyError: + # else check if file exists, then try loading + # citation information from source yaml + sourcename = get_flowsa_base_name(sourceconfigpath, sourcename, "yaml") + config = load_yaml_dict(sourcename, flowbytype='FBA') + + return config + + # def generate_fbs_bibliography(methodname): # """ # Generate bibliography for a FlowBySector From 14e110a139151aa9851ac991edfa09edb91de6e3 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 11 Sep 2023 16:26:19 -0600 Subject: [PATCH 0970/1127] att link to data commons in root README --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0dfa2e8e6..af740482d 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ # flowsa -`flowsa` is a data processing library attributing resources (environmental, -monetary, and human), wastes, emissions, and losses to sectors, typically +`flowsa` is a data processing library attributing the flows of resources +(environmental, monetary, and human), wastes, emissions, and losses to sectors, typically [NAICS codes](https://www.census.gov/naics/). `flowsa` aggregates, combines, and allocates data from a variety of sources. The sources can be found in the [GitHub wiki](https://github.com/USEPA/flowsa/wiki/Available-Data#flow-by-activity-datasets) @@ -49,6 +49,9 @@ where vX.X.X can be replaced with the version you wish to install under ### Additional Information on Installation, Examples, Detailed Documentation For more information on `flowsa` see the [wiki](https://github.com/USEPA/flowsa/wiki). +### Accessing datsets output by FLOWSA +FBA and FBS datasets can be accessed on [EPA's Data Commons](https://dmap-data-commons-ord.s3.amazonaws.com/index.html?prefix=flowsa/) without running the Python code. + ## Disclaimer The United States Environmental Protection Agency (EPA) GitHub project code From 92d0382239ae69f11498f8390161aaaaa785a063 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 11 Sep 2023 16:34:00 -0600 Subject: [PATCH 0971/1127] update 2.0 authors --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index e00e5e597..93798c315 100644 --- a/setup.py +++ b/setup.py @@ -37,8 +37,8 @@ ], url='https://github.com/USEPA/FLOWSA', license='MIT', - author='Catherine Birney, Ben Young, Matthew Chambers, Melissa Conner, ' - 'Jacob Specht, Mo Li, and Wesley Ingwersen', + author='Catherine Birney, Ben Young, Matthew Chambers, and Wesley ' + 'Ingwersen', author_email='ingwersen.wesley@epa.gov', classifiers=[ "Development Status :: 5 - Production/Stable", From b79df8fdfa904e3534c6a4e830908e578b9c6bc4 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 12 Sep 2023 10:40:46 -0600 Subject: [PATCH 0972/1127] drop generate_FBS github action --- .github/workflows/generate_FBS.yml | 50 ------------------------------ flowsa/test_FBS_against_remote.py | 11 ------- 2 files changed, 61 deletions(-) delete mode 100644 .github/workflows/generate_FBS.yml diff --git a/.github/workflows/generate_FBS.yml b/.github/workflows/generate_FBS.yml deleted file mode 100644 index 4c0e48b52..000000000 --- a/.github/workflows/generate_FBS.yml +++ /dev/null @@ -1,50 +0,0 @@ -# This workflow will generate all FlowBySector files and store as artifact - -name: Generate FBS - -on: - pull_request: - branches: [master] - types: [opened, reopened, ready_for_review] # excludes syncronize to avoid redundant trigger from commits on PRs - workflow_dispatch: # also allow manual trigger, for testing purposes - -jobs: - build: - runs-on: macos-latest - strategy: - fail-fast: false - - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v3 - with: - python-version: "3.10" - - - name: Update pip & install testing pkgs - run: | - python -VV - python -m pip install --upgrade pip setuptools wheel - pip install pytest - - # install package & dependencies - - name: Install package and dependencies - run: | - pip install . - - - name: Generate FBS - run: | - pytest -m generate_fbs - - - name: Upload files - if: always() - uses: actions/upload-artifact@v3.1.1 - with: - # Artifact name - name: FlowBySector - # A file, directory or wildcard patter that describes what to upload - path: | # uses local user data dir for ubuntu - ~/Library/Application Support/flowsa/FlowBySector/* - ~/Library/Application Support/flowsa/Log/* - if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn` - # retention-days: 5 # cannot exceed the retention limit set by the repository, organization, or enterprise. diff --git a/flowsa/test_FBS_against_remote.py b/flowsa/test_FBS_against_remote.py index de092f157..2c57e67f0 100644 --- a/flowsa/test_FBS_against_remote.py +++ b/flowsa/test_FBS_against_remote.py @@ -13,17 +13,6 @@ from flowsa.test_single_FBS import compare_single_FBS_against_remote -@pytest.mark.generate_fbs -def test_generate_fbs(): - """Generate all FBS from methods in repo.""" - for m in seeAvailableFlowByModels("FBS", print_method=False): - print("--------------------------------\n" - f"Method: {m}\n" - "--------------------------------") - FlowBySector.generateFlowBySector( - method=m, download_sources_ok=True) - - @pytest.mark.skip(reason="Perform targeted test for compare_FBS on PR") def test_FBS_against_remote(only_run_m=None): """Compare results for each FBS method (latest year) at current HEAD From 8e35812f30bf90a1348ecbc3a391200aab714c65 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 15 Sep 2023 08:51:46 -0400 Subject: [PATCH 0973/1127] fix EIA seds docstring --- flowsa/data/source_catalog.yaml | 2 +- flowsa/data_source_scripts/EIA_SEDS.py | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index b444b61da..ef5207763 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -157,7 +157,7 @@ EIA_SEDS: data_format: FBA class: - Energy - - Money + - Other sector_hierarchy: "flat" Employment_national: data_format: FBS diff --git a/flowsa/data_source_scripts/EIA_SEDS.py b/flowsa/data_source_scripts/EIA_SEDS.py index b10c9e622..0e2931357 100644 --- a/flowsa/data_source_scripts/EIA_SEDS.py +++ b/flowsa/data_source_scripts/EIA_SEDS.py @@ -1,12 +1,11 @@ -# EIA_MER.py (flowsa) +# EIA_SEDS.py (flowsa) # !/usr/bin/env python3 # coding=utf-8 """ -EIA Energy Monthly Data, summed to yearly -https://www.eia.gov/totalenergy/data/monthly/ +EIA State Energy Data System +https://www.eia.gov/state/seds/ 2010 - 2020 -Last updated: September 8, 2020 """ import io @@ -141,3 +140,8 @@ def eia_seds_parse(*, df_list, year, config, **_): df['DataCollection'] = 5 # tmp return df + +if __name__ == "__main__": + import flowsa + flowsa.generateflowbyactivity.main(source='EIA_SEDS', year=2020) + fba = flowsa.getFlowByActivity('EIA_SEDS', 2020) From 364f7baa7fa6a76aa0b1d9e0b3a329268dd8781a Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sun, 17 Sep 2023 20:49:12 -0400 Subject: [PATCH 0974/1127] use single common source for activity sets when possible --- .../GHG_national_2019_m2.yaml | 6 +- .../GHG_national_m1_common.yaml | 15 +- .../GHG_national_m2_common.yaml | 412 +++--------------- .../GHG_national_m3_common.yaml | 22 +- 4 files changed, 76 insertions(+), 379 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml index fd7a9f7fd..f457b02f1 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml @@ -174,11 +174,11 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:BEA_Summary_Use_PRO_BeforeRedef year: *ghgi_year - coal_manufacturing: - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing + coal_manufacturing_co2: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 attribution_source: EIA_MECS_Energy: - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml index 7a0eefd11..76f7d7e58 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml @@ -131,20 +131,28 @@ source_names: attribution_source: BEA_Detail_Use_PRO_BeforeRedef: <<: *bea - # primary_action_type: Consumed selection_fields: ActivityProducedBy: {'327400': ''} # Lime urea: selection_fields: PrimaryActivity: - - Urea Fertilization #CO2 - Urea Consumption for Non-Agricultural Purposes #CO2 attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: <<: *bea - # primary_action_type: Consumed + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + + urea_fertilizer: + selection_fields: + PrimaryActivity: + - Urea Fertilization #CO2 + attribution_method: proportional + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea selection_fields: ActivityProducedBy: {'325310': ''} # Fertilizers @@ -155,7 +163,6 @@ source_names: attribution_source: BEA_Detail_Use_PRO_BeforeRedef: <<: *bea - # primary_action_type: Consumed selection_fields: ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml index aee73fb37..ce7d640d7 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml @@ -68,51 +68,13 @@ source_names: fedefl_mapping: GHGI activity_sets: direct: - selection_fields: - PrimaryActivity: - - Abandoned Oil and Gas Wells #CH4 - - Abandoned Underground Coal Mines #CH4 - - Adipic Acid Production #N2O - - Aluminum Production #CO2 - - Ammonia Production #CO2 - - Anaerobic Digestion at Biogas Facilities #CH4 new activity - - Caprolactam, Glyoxal, and Glyoxylic Acid Production #N2O - - Carbide Production and Consumption #CO2, CH4 - - Cement Production #CO2 - - Coal Mining #CO2, CH4 - - Composting #CH4, N2O - - Ferroalloy Production #CO2, CH4 - - Glass Production #CO2 - - Landfills #CH4 - - Lime Production #CO2 - - Incineration of Waste #CO2, #N2O - - Iron and Steel Production & Metallurgical Coke Production #CO2, CH4 - - Nitric Acid Production #N2O - - Phosphoric Acid Production #CO2 - - Rice Cultivation #CH4 - - Soda Ash Production #CO2 - - Titanium Dioxide Production #CO2 - - Wastewater Treatment #CH4, N2O - - Zinc Production #CO2 - FlowName: ["CO2", "CH4", "N2O"] # HFCs and other flows are pulled elsewhere - attribution_method: direct + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:direct electricity_transmission: - selection_fields: - PrimaryActivity: Electrical Transmission and Distribution #SF6 - FlowName: SF6 - attribution_method: direct + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electricity_transmission electric_power: - selection_fields: - PrimaryActivity: - Electric Power Sector: Electric Power #CO2 - attribution_method: proportional - attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea_detail - selection_fields: - ActivityConsumedBy: {'221100': ''} # Utilities (221100) + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power liming: selection_fields: @@ -136,14 +98,7 @@ source_names: attribution_method: equal carbonate_use: - selection_fields: - PrimaryActivity: Other Process Uses of Carbonates #CO2 - attribution_method: proportional - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea_detail - selection_fields: - ActivityProducedBy: {'325180': ''} # Chemicals (325180) + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use lead: selection_fields: @@ -151,77 +106,29 @@ source_names: attribution_method: direct nitrous_oxide_use: - selection_fields: - PrimaryActivity: N2O from Product Uses #N2O - attribution_method: proportional - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea_detail - - selection_fields: - ActivityProducedBy: {'325120': ''} # Chemicals (325120) - + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use ## Fossil Fuels EPA_GHGI_T_3_68: &natgas #CH4 from Natural Gas Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 # year: # override this - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: - - Distribution - - Distribution - Post-Meter - - Exploration - - Processing - - Production - - Transmission and Storage - attribution_method: direct EPA_GHGI_T_3_70: *natgas #CO2 from Natural Gas Systems mimics CH4 EPA_GHGI_T_3_72: *natgas #N2O from Natural Gas Systems, not used in original method, mimics CH4 EPA_GHGI_T_3_42: &petroleum #CH4 from Petroleum Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 # year: # override this - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: - - Crude Oil Transportation - - Transportation - - Exploration - - Production - - Refining - - Crude Refining - attribution_method: direct EPA_GHGI_T_3_44: *petroleum #CO2 from Petroleum Systems mimics CH4 EPA_GHGI_T_3_46: *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 ## Agriculture EPA_GHGI_T_5_28: #CH4, N2O, CO and NOx from field burning of residues + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 # year: # override this - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: - - Chickpeas - - Cotton - - Maize - - Rice - - Soybeans - - Wheat - attribution_method: direct EPA_GHGI_T_5_3: &animals #CH4 from Enteric Fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 # year: # override this - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: - - American Bison - - Beef Cattle - - Dairy Cattle - - Goats - - Horses - - Mules and Asses - - Sheep - - Swine - - Poultry - attribution_method: direct EPA_GHGI_T_5_6: *animals #CH4 and N2O from manure, mimics enteric fermentation EPA_GHGI_T_5_17: #Direct N2O emissions from agricultural soils @@ -272,41 +179,17 @@ source_names: fedefl_mapping: GHGI activity_sets: direct_petroleum: - selection_fields: - PrimaryActivity: - General Aviation Aircraft Aviation Gasoline: General Aviation Aircraft - General Aviation Aircraft Jet Fuel: General Aviation Aircraft - Commercial Aircraft Jet Fuel: Commercial Aircraft - Military Aircraft Jet Fuel: Military Aircraft - Buses Gasoline: Buses - Buses LPG: Buses - Motorcycles Gasoline: Motorcycles - Rail Distillate Fuel Oil: Rail - Recreational Boats Distillate Fuel Oil: Recreational Boats - Recreational Boats Gasoline: Recreational Boats - Ships and Non-Recreational Boats Distillate Fuel Oil: Ships and Non-Recreational Boats - Ships and Non-Recreational Boats Residual Fuel Oil: Ships and Non-Recreational Boats - Medium- and Heavy-Duty Trucks Gasoline: Medium- and Heavy-Duty Trucks - Medium- and Heavy-Duty Trucks LPG: Medium- and Heavy-Duty Trucks - Light-Duty Trucks LPG: Light-Duty Trucks - Households - Passenger Cars LPG: Passenger Cars - Households - attribution_method: direct + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:direct_petroleum + direct_ng: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:direct_ng selection_fields: PrimaryActivity: Buses Natural Gas: Buses Pipeline Natural Gas: Pipeline Natural Gas petroleum_fuels: - selection_fields: - PrimaryActivity: - Medium- and Heavy-Duty Trucks Distillate Fuel Oil: Medium- and Heavy-Duty Trucks - Distillate Fuel Oil - Buses Distillate Fuel Oil: Buses - Distillate Fuel Oil - Passenger Cars Distillate Fuel Oil: Passenger Cars - Passenger Cars Gasoline: Passenger Cars - Light-Duty Trucks Distillate Fuel Oil: Light-Duty Trucks - Light-Duty Trucks Gasoline: Light-Duty Trucks - attribution_method: proportional + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels attribution_source: BEA_Summary_Use_PRO_BeforeRedef: <<: *bea_summary @@ -318,35 +201,13 @@ source_names: fedefl_mapping: GHGI activity_sets: direct_gasoline: - selection_fields: - PrimaryActivity: - Motorcycles Gasoline On-Road: Motorcycles - Medium- and Heavy-Duty Trucks and Buses Gasoline On-Road: Medium- and Heavy-Duty Trucks and Buses - attribution_method: direct - - # This activity is only in older FBAs - # direct_diesel: - # selection_fields: - # PrimaryActivity: - # Medium- and Heavy-Duty Trucks and Buses Diesel On-Road: Medium- and Heavy-Duty Trucks and Buses - # attribution_method: direct + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:direct_gasoline direct_non_road: - selection_fields: - PrimaryActivity: - Rail Non-Road: Rail - Ships and Boats Non-Road: Ships and Boats - Aircraft Non-Road: General Aviation Aircraft - attribution_method: direct + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:direct_non_road petroleum_fuels_diesel: - selection_fields: - PrimaryActivity: - Passenger Cars Diesel On-Road: Passenger Cars - Light-Duty Trucks Diesel On-Road: Light-Duty Trucks - Medium- and Heavy-Duty Buses Diesel On-Road: Buses - Distillate Fuel Oil - Medium- and Heavy-Duty Trucks Diesel On-Road: Medium- and Heavy-Duty Trucks - Distillate Fuel Oil - attribution_method: proportional + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel attribution_source: BEA_Summary_Use_PRO_BeforeRedef: <<: *bea_summary @@ -354,11 +215,7 @@ source_names: ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) petroleum_fuels_gasoline: - selection_fields: - PrimaryActivity: - Passenger Cars Gasoline On-Road: Passenger Cars - Light-Duty Trucks Gasoline On-Road: Light-Duty Trucks - attribution_method: proportional + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline attribution_source: BEA_Summary_Use_PRO_BeforeRedef: <<: *bea_summary @@ -366,9 +223,7 @@ source_names: ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) construction_and_mining: #this set is allocated by purchases of construction equipment - selection_fields: - PrimaryActivity: Construction/Mining Equipment Non-Road - attribution_method: proportional + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining attribution_source: BEA_Summary_Use_PRO_BeforeRedef: <<: *bea_summary @@ -376,9 +231,7 @@ source_names: ActivityProducedBy: {'333': ''} # purchases of construction/mining equipment (333120) farm_non_road: #this set is allocated by purchases of farm machinery - selection_fields: - PrimaryActivity: Agricultural Equipment Non-Road - attribution_method: proportional + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road attribution_source: BEA_Summary_Use_PRO_BeforeRedef: <<: *bea_summary @@ -386,9 +239,7 @@ source_names: ActivityProducedBy: {'333': ''} # purchases of farm machinery (333111) other_non_road: #this set is allocated by purchases of petroleum refining - selection_fields: - PrimaryActivity: Other Non-Road - attribution_method: proportional + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road attribution_source: BEA_Summary_Use_PRO_BeforeRedef: <<: *bea_summary @@ -396,10 +247,7 @@ source_names: ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) alt_fuel_on_road: #this set is allocated by purchases of natural gas - selection_fields: - PrimaryActivity: - All activities Alternative Fuel On-Road: Alternative Fuel On-Road - attribution_method: proportional + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road attribution_source: BEA_Summary_Use_PRO_BeforeRedef: <<: *bea_summary @@ -420,39 +268,21 @@ source_names: ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table activity_sets: direct_attribution: #direct allocation - selection_fields: - PrimaryActivity: Total (All Fuels) Residential - attribution_method: direct + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:direct_attribution non_manufacturing_coal: - selection_fields: - PrimaryActivity: - Commercial Coal Commercial: Coal Commercial - Industrial Other Coal Industrial: Coal Industrial - attribution_method: proportional - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea_detail - selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal (212100) + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal non_manufacturing_natural_gas: # Applies to non-manufacturing sectors like ag and mining - selection_fields: - PrimaryActivity: - - Natural Gas Commercial - - Natural Gas Industrial - attribution_method: proportional + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas attribution_source: BEA_Summary_Use_PRO_BeforeRedef: <<: *bea_summary selection_fields: ActivityProducedBy: {'22': ''} # purchases of natural gas (221200) - coal_manufacturing: # Industrial Coal for Manufacturing - selection_fields: - PrimaryActivity: - Industrial Other Coal Industrial - Manufacturing: Coal Industrial - Manufacturing - attribution_method: proportional + coal_manufacturing_co2: # Industrial Coal for Manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 attribution_source: EIA_MECS_Energy: <<: *mecs_energy @@ -468,10 +298,7 @@ source_names: # ActivityProducedBy: {'212100': ''} # purchases of coal natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - selection_fields: - PrimaryActivity: - - Natural Gas Industrial - Manufacturing - attribution_method: proportional + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing attribution_source: EIA_MECS_Energy: <<: *mecs_energy @@ -485,11 +312,7 @@ source_names: # ActivityProducedBy: {'221200': ''} # purchases of natural gas petroleum: # Petroleum - selection_fields: - PrimaryActivity: - - Total Petroleum Commercial - - Total Petroleum Industrial - attribution_method: proportional + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum attribution_source: BEA_Summary_Use_PRO_BeforeRedef: <<: *bea_summary @@ -507,34 +330,13 @@ source_names: fedefl_mapping: GHGI activity_sets: residential: - selection_fields: - PrimaryActivity: - - Fuel Oil Residential - - Coal Residential - - Natural Gas Residential - - Wood Residential - attribution_method: direct + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:residential electric_power: - selection_fields: - PrimaryActivity: - Coal Electric Power: Coal Electric Power - Natural Gas Electric Power: Natural Gas Electric Power - Natural gas Electric Power: Natural Gas Electric Power # fix capitalization - Fuel Oil Electric Power: Fuel Oil Electric Power - Wood Electric Power: Wood Electric Power - attribution_method: proportional - attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea_detail - selection_fields: - ActivityConsumedBy: {'221100': ''} # Electricity (221100) + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power + fuel_oil: - selection_fields: - PrimaryActivity: - - Fuel Oil Commercial - - Fuel Oil Industrial - attribution_method: proportional + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil attribution_source: BEA_Summary_Use_PRO_BeforeRedef: <<: *bea_summary @@ -542,13 +344,7 @@ source_names: ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) natural_gas_nonmanufacturing: # Commercial Natural gas - selection_fields: - PrimaryActivity: - Natural gas Commercial: Natural Gas Commercial # fix capitalization - Natural gas Industrial: Natural Gas Industrial # fix capitalization - Natural Gas Commercial: Natural Gas Commercial - Natural Gas Industrial: Natural Gas Industrial - attribution_method: proportional + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing attribution_source: BEA_Summary_Use_PRO_BeforeRedef: <<: *bea_summary @@ -556,19 +352,10 @@ source_names: ActivityProducedBy: {'22': ''} # purchases of natural gas (221200) coal_nonmanufacturing: - selection_fields: - PrimaryActivity: Coal Industrial - attribution_method: proportional - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea_detail - selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal (212100) + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing coal_manufacturing: - selection_fields: - PrimaryActivity: Coal Industrial - Manufacturing - attribution_method: proportional + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing attribution_source: EIA_MECS_Energy: <<: *mecs_energy @@ -582,11 +369,7 @@ source_names: # ActivityProducedBy: {'212100': ''} # purchases of coal ng_manufacturing: - selection_fields: - PrimaryActivity: - - Natural gas Industrial - Manufacturing - - Natural Gas Industrial - Manufacturing - attribution_method: proportional + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing attribution_source: EIA_MECS_Energy: <<: *mecs_energy @@ -606,47 +389,18 @@ source_names: ## Other sources EPA_GHGI_T_4_46: #CO2 for selected petrochemicals + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 # year: # override with ghgi_year - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: - - Acrylonitrile - - Carbon Black - - Ethylene - - Ethylene Dichloride - - Ethylene Oxide - - Methanol - attribution_method: direct GHGI_nonenergy_fossil_fuel_emissions: # Fossil fuel for non-energy uses # year: #override with ghgi_year fedefl_mapping: GHGI activity_sets: coal: - selection_fields: - PrimaryActivity: - - Industry Industrial Coking Coal - - Industry Industrial Other Coal - attribution_method: direct + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:coal petroleum_neu: # consumed petroleum products - selection_fields: - PrimaryActivity: - 'Industry Asphalt & Road Oil': Industry Petroleum Products Non-energy - Industry Distillate Fuel Oil: Industry Petroleum Products Non-energy - Industry LPG: Industry Petroleum Products Non-energy - Industry Lubricants: Industry Petroleum Products Non-energy - Industry Miscellaneous Products: Industry Petroleum Products Non-energy - 'Industry Naphtha (<401 F)': Industry Petroleum Products Non-energy - 'Industry Other Oil (>401 F)': Industry Petroleum Products Non-energy - Industry Pentanes Plus: Industry Petroleum Products Non-energy - Industry Petroleum Coke: Industry Petroleum Products Non-energy - Industry Special Naphtha: Industry Petroleum Products Non-energy - Industry Still Gas: Industry Petroleum Products Non-energy - Industry Waxes: Industry Petroleum Products Non-energy - Industry Natural Gasoline: Industry Petroleum Products Non-energy #T_3_22. Also produced by nat gas plants - Industry HGL: Industry Petroleum Products Non-energy #T_3_22. Also produced by nat gas plants - attribution_method: proportional + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum attribution_source: EIA_MECS_Energy: <<: *mecs_energy @@ -664,9 +418,7 @@ source_names: # ActivityProducedBy: {'324110': ''} # purchases of refineries natural_gas_neu: # consumed nat gas to chemical plants - selection_fields: - PrimaryActivity: Industry Natural Gas to Chemical Plants - attribution_method: proportional + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas attribution_source: EIA_MECS_Energy: <<: *mecs_energy @@ -681,9 +433,7 @@ source_names: # ActivityProducedBy: {'221200': ''} # purchases of natural gas transportation_lubricants: - selection_fields: - PrimaryActivity: Transportation Lubricants - attribution_method: proportional + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants attribution_source: BEA_Summary_Use_PRO_BeforeRedef: <<: *bea_summary @@ -692,19 +442,12 @@ source_names: ## Other Emissions EPA_GHGI_T_4_50: # HFCs from HCFC-22 production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 # year: # override with ghgi_year - fedefl_mapping: GHGI - selection_fields: - Unit: MMT CO2e # drop records in kt - PrimaryActivity: HCFC-22 Production - attribution_method: direct EPA_GHGI_T_4_96: # HFCs and other emissions from electronics manufacture + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 # year: # override with ghgi_year - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: Electronics Production - attribution_method: direct EPA_GHGI_T_4_102: # HFCs and PFCs from ODS Substitutes clean_fba_before_activity_sets: !script_function:EPA_GHGI split_HFCs_by_type @@ -715,80 +458,27 @@ source_names: fedefl_mapping: GHGI activity_sets: households: - selection_fields: - PrimaryActivity: - - Domestic Refrigeration - - Residential Stationary Air Conditioning - attribution_method: direct + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:households refrigerants: - selection_fields: - PrimaryActivity: - - Commercial Refrigeration - - Industrial Process Refrigeration - attribution_method: proportional - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea_detail - selection_fields: - ActivityProducedBy: {'333415': ''} # Air conditioning equipment (333415) + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants air_conditioning: - selection_fields: - PrimaryActivity: - - Commercial Stationary Air Conditioning - attribution_method: proportional - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea_detail - selection_fields: - ActivityProducedBy: {'333415': ''} # Air conditioning equipment (333415) + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning foams: - selection_fields: - PrimaryActivity: - - Foams - attribution_method: proportional - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea_detail - selection_fields: - ActivityProducedBy: - ActivityProducedBy: - '326140': '' # Polystyrene foam - '326150': '' # Urethane and other foam + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams - # 'Mobile Air Conditioning' and 'Transport Refrigeration' come from - # different table. - # Intentionally left out 'Solvents', 'Aerosols', 'Fire Protection' - EPA_GHGI_T_A_97: # HFCs from Transportation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 # year: # override with ghgi_year - clean_fba_before_mapping: !script_function:EPA_GHGI split_HFCs_by_type - clean_parameter: - # Proportions of specific HFCs are assigned based on national total - flow_fba: EPA_GHGI_T_4_100 - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: - Mobile AC - Passenger Cars: Passenger Cars - Households - Mobile AC - Light-Duty Trucks: Light-Duty Trucks - Households - Mobile AC - Heavy-Duty Vehicles: Heavy-Duty Vehicles - Comfort Cooling for Trains and Buses - School and Tour Buses: School and Tour Buses - # Comfort Cooling for Trains and Buses - Transit Buses: Transit Buses #excluded - Comfort Cooling for Trains and Buses - Rail: Rail - Refrigerated Transport - Medium- and Heavy-Duty Trucks: Medium- and Heavy-Duty Trucks - Refrigerated Transport - Rail: Rail - Refrigerated Transport - Ships and Boats: Ships and Boats - attribution_method: direct + EPA_GHGI_T_4_80: # PFCs from aluminum production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 # year: # override with ghgi_year - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: Aluminum Production - attribution_method: direct + EPA_GHGI_T_4_86: # HFCs, SF6, CO2 from magnesium production # year: # override with ghgi_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m3_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m3_common.yaml index 610514aa9..693e21d33 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m3_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m3_common.yaml @@ -76,7 +76,7 @@ source_names: # year: *ghgi_year activity_sets: ## Table 2.1 - electric_power: + electric_power_co2: selection_fields: MetaSources: 'EPA_GHGI_T_2_1.electric_power' attribution_method: equal @@ -261,15 +261,15 @@ source_names: coal_manufacturing_co2: # Industrial Coal for Manufacturing selection_fields: MetaSources: - - 'EPA_GHGI_T_A_5.coal_manufacturing' - - 'EPA_GHGI_T_A_6.coal_manufacturing' - - 'EPA_GHGI_T_A_7.coal_manufacturing' - - 'EPA_GHGI_T_A_8.coal_manufacturing' - - 'EPA_GHGI_T_A_9.coal_manufacturing' - - 'EPA_GHGI_T_A_10.coal_manufacturing' - - 'EPA_GHGI_T_A_11.coal_manufacturing' - - 'EPA_GHGI_T_A_12.coal_manufacturing' - - 'EPA_GHGI_T_A_13.coal_manufacturing' + - 'EPA_GHGI_T_A_5.coal_manufacturing_co2' + - 'EPA_GHGI_T_A_6.coal_manufacturing_co2' + - 'EPA_GHGI_T_A_7.coal_manufacturing_co2' + - 'EPA_GHGI_T_A_8.coal_manufacturing_co2' + - 'EPA_GHGI_T_A_9.coal_manufacturing_co2' + - 'EPA_GHGI_T_A_10.coal_manufacturing_co2' + - 'EPA_GHGI_T_A_11.coal_manufacturing_co2' + - 'EPA_GHGI_T_A_12.coal_manufacturing_co2' + - 'EPA_GHGI_T_A_13.coal_manufacturing_co2' attribution_method: proportional attribution_source: EIA_MECS_Energy: @@ -532,7 +532,7 @@ source_names: # ActivityProducedBy: {'327400': ''} # Lime urea_fertilizer: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer selection_fields: # Only uses one activity from this activity_set PrimaryActivity: - Urea Fertilization #CO2 From 26ec15e90f892ea5cd72ab7d493c22228480e052 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sun, 17 Sep 2023 20:49:31 -0400 Subject: [PATCH 0975/1127] state method uses summary national model (m2) --- flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml | 4 ++-- flowsa/methods/flowbysectormethods/GHG_state_m2_common.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml index 7f3ed246c..7f5f00414 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml @@ -16,6 +16,6 @@ source_names: activity_sets: !include:GHG_state_m2_common.yaml:source_names:EPA_StateGHGI:activity_sets - GHG_national_2019_m1: #U.S. GHG emissions - !include:GHG_state_m2_common.yaml:source_names:GHG_national_common_m1 + GHG_national_2019_m2: #U.S. GHG emissions + !include:GHG_state_m2_common.yaml:source_names:GHG_national_common_m2 year: *ghg_year diff --git a/flowsa/methods/flowbysectormethods/GHG_state_m2_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_m2_common.yaml index 7cf32dae5..0ee07614c 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_m2_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_m2_common.yaml @@ -1,4 +1,4 @@ -## Method 2 uses as its source the national GHG Flow-by-sector (detail) +## Method 2 uses as its source the national GHG Flow-by-sector (summary, m2) # with emissions data attributed to states based on reported emissions # in the State Inventory @@ -55,7 +55,7 @@ source_names: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv hcfc attribution_method: direct - GHG_national_common_m1: #U.S. GHG emissions + GHG_national_common_m2: #U.S. GHG emissions year: *ghg_year data_format: FBS geoscale: national From c6747a816ed7247d358d9ab96a7eb0bdaa486443 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 18 Sep 2023 14:03:49 -0400 Subject: [PATCH 0976/1127] separate urea and urea fertilizer to align with national model --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 4 ++-- .../flowbysectoractivitysets/EPA_StateGHGI_asets.csv | 2 +- .../flowbysectormethods/GHG_state_m2_common.yaml | 12 ++++++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index cd03b9e84..e7577416a 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -48,8 +48,8 @@ EPA_State_GHGI,Agriculture - Manure Management - Poultry,NAICS_2012_Code,1123,,a EPA_State_GHGI,Agriculture - Manure Management - Sheep,NAICS_2012_Code,11241,,ag_livestock EPA_State_GHGI,Agriculture - Manure Management - Swine,NAICS_2012_Code,1122,,ag_livestock EPA_State_GHGI,Agriculture - Rice Cultivation,NAICS_2012_Code,1111,,direct -EPA_State_GHGI,"Agriculture - Urea Fertilization - CO2 emissions from liming, urea application and other carbon-containing fertilizers",NAICS_2012_Code,111,,urea -EPA_State_GHGI,"Agriculture - Urea Fertilization - CO2 emissions from liming, urea application and other carbon-containing fertilizers",NAICS_2012_Code,112,,urea +EPA_State_GHGI,"Agriculture - Urea Fertilization - CO2 emissions from liming, urea application and other carbon-containing fertilizers",NAICS_2012_Code,111,,urea_fertilizer +EPA_State_GHGI,"Agriculture - Urea Fertilization - CO2 emissions from liming, urea application and other carbon-containing fertilizers",NAICS_2012_Code,112,,urea_fertilizer EPA_State_GHGI,Industry - Abandoned Oil and Gas Wells - Fugitive - Abandoned Wells,NAICS_2012_Code,2111,,direct EPA_State_GHGI,Industry - Abandoned Underground Coal Mines - Fugitive - Coal Mining - Abandoned Coal Mines - Liberated,NAICS_2012_Code,2121,,direct EPA_State_GHGI,Industry - Abandoned Underground Coal Mines - Fugitive - Coal Mining - Abandoned Coal Mines - Recovered &Used,NAICS_2012_Code,2121,,direct diff --git a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv index b62ed4433..51638ba13 100644 --- a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv @@ -46,7 +46,7 @@ ag_livestock,Agriculture - Manure Management - Poultry,EPA_GHGI_T_5_7 ag_livestock,Agriculture - Manure Management - Sheep,EPA_GHGI_T_5_7 ag_livestock,Agriculture - Manure Management - Swine,EPA_GHGI_T_5_7 direct,Agriculture - Rice Cultivation,EPA_GHGI_T_2_1 -urea,"Agriculture - Urea Fertilization - CO2 emissions from liming, urea application and other carbon-containing fertilizers",EPA_GHGI_T_2_1 +urea_fertilizer,"Agriculture - Urea Fertilization - CO2 emissions from liming, urea application and other carbon-containing fertilizers",EPA_GHGI_T_2_1 direct,Industry - Abandoned Oil and Gas Wells - Fugitive - Abandoned Wells, direct,Industry - Abandoned Underground Coal Mines - Fugitive - Coal Mining - Abandoned Coal Mines - Liberated,EPA_GHGI_T_2_1 direct,Industry - Abandoned Underground Coal Mines - Fugitive - Coal Mining - Abandoned Coal Mines - Recovered &Used,EPA_GHGI_T_2_1 diff --git a/flowsa/methods/flowbysectormethods/GHG_state_m2_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_m2_common.yaml index 0ee07614c..08456254f 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_m2_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_m2_common.yaml @@ -100,6 +100,18 @@ source_names: selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv urea + urea_fertilizer: + selection_fields: + MetaSources: 'EPA_GHGI_T_2_1.urea_fertilizer' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv urea_fertilizer carbonate_use: selection_fields: From a43f8df8909baf284b6a6f9a000d196aee016a18 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 18 Sep 2023 14:07:29 -0400 Subject: [PATCH 0977/1127] drop electric power other process use of carbonates see https://github.com/USEPA/GHGbyindustrydocs/issues/50 --- flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv index 51638ba13..8ee3c57ed 100644 --- a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv @@ -149,7 +149,7 @@ transport_nonroad_ag,Agriculture - Mobile Combustion - Fossil Fuel Combustion - use_table_pet,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,negative emissions; align with 'Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum' to avoid double counting tbd,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,EPA_GHGI_T_3_13 transport_nonroad_construction,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,EPA_GHGI_T_3_14 -direct,Electric Power Industry - Other Process Uses of Carbonates - Mineral Industry, +temp_drop,Electric Power Industry - Other Process Uses of Carbonates - Mineral Industry, transport_nonroad_other,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other, ind_com_ch4_n2o,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,negative emissions; align with 'Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial' to avoid double counting nitrous_oxide_use,Industry - N2O from Product Uses - Other product manufacture and use,EPA_GHGI_T_2_1 From fbe64adedcb6fb42e66d44767a306328aa90e8d3 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 18 Sep 2023 14:38:27 -0400 Subject: [PATCH 0978/1127] Split activity with named flows and unspecified HFCs into separate activities; fix actitivy names for NEU --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 2 +- .../EPA_StateGHGI_asets.csv | 2 +- .../GHG_state_m2_common.yaml | 17 ++++++++++++----- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index e7577416a..a65c1918f 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -295,7 +295,7 @@ EPA_State_GHGI,Industry - Urea Consumption for Non-Agricultural Purposes - Chemi EPA_State_GHGI,Industry - Electronics Industry - Micro-Electro-Mechanical Devices,NAICS_2012_Code,3332,,direct EPA_State_GHGI,Industry - Electronics Industry - Photovoltaics,NAICS_2012_Code,334413,,direct EPA_State_GHGI,Industry - Electronics Industry - Semiconductor Manufacture,NAICS_2012_Code,3344,,direct -EPA_State_GHGI,Industry - Electronics Industry - Semiconductor Manufacture - Heat Transfer Fluids,NAICS_2012_Code,3344,,direct +EPA_State_GHGI,Industry - Electronics Industry - Semiconductor Manufacture - Heat Transfer Fluids,NAICS_2012_Code,3344,,direct_ods EPA_State_GHGI,Industry - Aluminum Production - Metal Industry,NAICS_2012_Code,3313,,direct EPA_State_GHGI,Industry - Ferroalloy Production - Metal Industry,NAICS_2012_Code,3311,,direct EPA_State_GHGI,Industry - Iron and Steel Production - Metal Industry - Iron Production,NAICS_2012_Code,3311,,direct diff --git a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv index 8ee3c57ed..f6e101d59 100644 --- a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv @@ -119,7 +119,7 @@ urea,Industry - Urea Consumption for Non-Agricultural Purposes - Chemical Indust direct,Industry - Electronics Industry - Micro-Electro-Mechanical Devices, direct,Industry - Electronics Industry - Photovoltaics, direct,Industry - Electronics Industry - Semiconductor Manufacture, -direct,Industry - Electronics Industry - Semiconductor Manufacture - Heat Transfer Fluids, +direct_ods,Industry - Electronics Industry - Semiconductor Manufacture - Heat Transfer Fluids, direct,Industry - Aluminum Production - Metal Industry,EPA_GHGI_T_2_1 direct,Industry - Ferroalloy Production - Metal Industry,EPA_GHGI_T_2_1 direct,Industry - Iron and Steel Production - Metal Industry - Iron Production,EPA_GHGI_T_2_1 diff --git a/flowsa/methods/flowbysectormethods/GHG_state_m2_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_m2_common.yaml index 08456254f..d92d42720 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_m2_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_m2_common.yaml @@ -24,11 +24,18 @@ source_names: # replicates direct attribution from EPA_GHGI_T_4_102.households selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct_ods + exclusion_fields: + FlowName: 'SF6' # Handle this flow without splitting clean_fba_before_mapping: !script_function:EPA_GHGI split_HFCs_by_type clean_parameter: # Proportions of specific HFCs are assigned based on national total flow_fba: EPA_GHGI_T_4_100 attribution_method: direct + direct_ods2: + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct_ods + FlowName: 'SF6' # Handle this flow without splitting (see above) + attribution_method: direct electricity_transmission: #SF6 # replicates electricity_transmission from EPA_GHGI_T_2_1 selection_fields: @@ -374,7 +381,7 @@ source_names: selection_fields: MetaSources: - 'EPA_GHGI_T_A_6.non_manufacturing_coal' - - 'EPA_GHGI_T_A_6.coal_manufacturing' + - 'EPA_GHGI_T_A_6.coal_manufacturing_co2' attribution_method: proportional attribute_on: ['Flowable', 'SectorProducedBy'] fill_columns: Location @@ -457,12 +464,12 @@ source_names: selection_fields: MetaSources: - 'EPA_GHGI_T_3_22.coal' - - 'EPA_GHGI_T_3_22.petroleum' - - 'EPA_GHGI_T_3_22.natural_gas' + - 'EPA_GHGI_T_3_22.petroleum_neu' + - 'EPA_GHGI_T_3_22.natural_gas_neu' - 'EPA_GHGI_T_3_22.transportation_lubricants' - 'EPA_GHGI_T_3_22b.coal' - - 'EPA_GHGI_T_3_22b.petroleum' - - 'EPA_GHGI_T_3_22b.natural_gas' + - 'EPA_GHGI_T_3_22b.petroleum_neu' + - 'EPA_GHGI_T_3_22b.natural_gas_neu' - 'EPA_GHGI_T_3_22b.transportation_lubricants' attribution_method: proportional attribute_on: ['Flowable', 'SectorProducedBy'] From 3470a9d6275d20530b2579733d342cbf83290cdb Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 18 Sep 2023 14:58:42 -0400 Subject: [PATCH 0979/1127] add 2020 state GHG_m2 --- .../GHG_national_2020_m2.yaml | 230 ++++++++++++++++++ .../GHG_state_2019_m2.yaml | 2 +- .../GHG_state_2020_m2.yaml | 21 ++ 3 files changed, 252 insertions(+), 1 deletion(-) create mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2020_m2.yaml diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml new file mode 100644 index 000000000..683f3f74f --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml @@ -0,0 +1,230 @@ +# This is a 2020 target year specific implementation of GHG_national_m2 +# This is a Summary level model +# All parameters add year specific data when needed to implement for 2019 +# GHGI FBA table names match the 2022 GHGI Report +# MECS year is 2018 + +!include:GHG_national_m2_common.yaml +ghgi_year: &ghgi_year 2020 +mecs_year: &mecs_year 2018 + +_industrial_allocation_dict: &industrial_dict + energy_fba: 'EIA_MECS_Energy' + year: *mecs_year + ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table + +source_names: + "EPA_GHGI_T_2_1": #U.S. GHG emissions + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 + year: *ghgi_year + + "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_68 + year: *ghgi_year + "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_70 + year: *ghgi_year + "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_72 + year: *ghgi_year + "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_42 + year: *ghgi_year + "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_44 + year: *ghgi_year + "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_46 + year: *ghgi_year + "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_28 + year: *ghgi_year + "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_3 + year: *ghgi_year + "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_6 + year: *ghgi_year + "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_17 + year: *ghgi_year + "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_18 + year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets + petroleum_fuels: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14 + year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets + petroleum_fuels_diesel: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + petroleum_fuels_gasoline: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + + construction_and_mining: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + farm_non_road: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + other_non_road: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + alt_fuel_on_road: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 + + "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_46 + year: *ghgi_year + "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_50 + year: *ghgi_year + "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_96 + year: *ghgi_year + "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102 + year: *ghgi_year + + "EPA_GHGI_T_A_97": # HFCs from Transportation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_A_97 + year: *ghgi_year + "EPA_GHGI_T_4_80": # PFCs from aluminum production + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_80 + year: *ghgi_year + "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_86 + year: *ghgi_year + "EPA_GHGI_T_3_22": #Fossil fuel for non-energy uses + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + year: *ghgi_year + activity_sets: # Update EIA_MECS year for some activity_sets + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets + petroleum_neu: + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas_neu: + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + transportation_lubricants: + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + +### Major CO2 Sources + "EPA_GHGI_T_A_5": # CO2 emissions from stationary combustion. This table number varies by GHG year. + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: # Update EIA_MECS and BEA year for some activity_sets + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + non_manufacturing_natural_gas: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + coal_manufacturing_co2: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + petroleum: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8 + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: # Update EIA_MECS and BEA year for some activity_sets + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + + fuel_oil: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + natural_gas_nonmanufacturing: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + coal_manufacturing: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + ng_manufacturing: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + "EPA_GHGI_T_3_9": *T_3_8 # N2O emissions from stationary combustion diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml index 7f5f00414..9a46a5630 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml @@ -1,4 +1,4 @@ -## Method 2 uses as its source the national GHG Flow-by-sector (detail) +## Method 2 uses as its source the national GHG Flow-by-sector (summary) # with emissions data attributed to states based on reported emissions # in the State Inventory diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2020_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2020_m2.yaml new file mode 100644 index 000000000..2ce066543 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_state_2020_m2.yaml @@ -0,0 +1,21 @@ +## Method 2 uses as its source the national GHG Flow-by-sector (summary) +# with emissions data attributed to states based on reported emissions +# in the State Inventory + + +!include:GHG_state_m2_common.yaml +year: &ghg_year 2020 +geoscale: state + + +source_names: +## Directly sourced from State Inventory + EPA_StateGHGI: + !include:GHG_state_m2_common.yaml:source_names:EPA_StateGHGI + year: *ghg_year + activity_sets: + !include:GHG_state_m2_common.yaml:source_names:EPA_StateGHGI:activity_sets + + GHG_national_2020_m2: #U.S. GHG emissions + !include:GHG_state_m2_common.yaml:source_names:GHG_national_common_m2 + year: *ghg_year From 335843bbb6050735141209af764a5fe8afc7dd87 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 18 Sep 2023 16:24:00 -0400 Subject: [PATCH 0980/1127] include appendix tables from all years --- .../GHG_state_m2_common.yaml | 50 +++++++++++++++++-- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_state_m2_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_m2_common.yaml index d92d42720..de100a473 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_m2_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_m2_common.yaml @@ -364,9 +364,17 @@ source_names: ## Stationary Combustion - stationary_residiential: + stationary_residential: selection_fields: - MetaSources: 'EPA_GHGI_T_A_6.direct_attribution' + MetaSources: + - 'EPA_GHGI_T_A_5.direct_attribution' + - 'EPA_GHGI_T_A_6.direct_attribution' + - 'EPA_GHGI_T_A_7.direct_attribution' + - 'EPA_GHGI_T_A_8.direct_attribution' + - 'EPA_GHGI_T_A_9.direct_attribution' + - 'EPA_GHGI_T_A_10.direct_attribution' + - 'EPA_GHGI_T_A_11.direct_attribution' + - 'EPA_GHGI_T_A_12.direct_attribution' attribution_method: proportional attribute_on: ['Flowable', 'SectorProducedBy'] fill_columns: Location @@ -380,8 +388,22 @@ source_names: stationary_coal: selection_fields: MetaSources: + - 'EPA_GHGI_T_A_5.non_manufacturing_coal' + - 'EPA_GHGI_T_A_5.coal_manufacturing_co2' - 'EPA_GHGI_T_A_6.non_manufacturing_coal' - 'EPA_GHGI_T_A_6.coal_manufacturing_co2' + - 'EPA_GHGI_T_A_7.non_manufacturing_coal' + - 'EPA_GHGI_T_A_7.coal_manufacturing_co2' + - 'EPA_GHGI_T_A_8.non_manufacturing_coal' + - 'EPA_GHGI_T_A_8.coal_manufacturing_co2' + - 'EPA_GHGI_T_A_9.non_manufacturing_coal' + - 'EPA_GHGI_T_A_9.coal_manufacturing_co2' + - 'EPA_GHGI_T_A_10.non_manufacturing_coal' + - 'EPA_GHGI_T_A_10.coal_manufacturing_co2' + - 'EPA_GHGI_T_A_11.non_manufacturing_coal' + - 'EPA_GHGI_T_A_11.coal_manufacturing_co2' + - 'EPA_GHGI_T_A_12.non_manufacturing_coal' + - 'EPA_GHGI_T_A_12.coal_manufacturing_co2' attribution_method: proportional attribute_on: ['Flowable', 'SectorProducedBy'] fill_columns: Location @@ -395,8 +417,22 @@ source_names: stationary_natural_gas: selection_fields: MetaSources: + - 'EPA_GHGI_T_A_5.non_manufacturing_natural_gas' + - 'EPA_GHGI_T_A_5.natural_gas_manufacturing' - 'EPA_GHGI_T_A_6.non_manufacturing_natural_gas' - 'EPA_GHGI_T_A_6.natural_gas_manufacturing' + - 'EPA_GHGI_T_A_7.non_manufacturing_natural_gas' + - 'EPA_GHGI_T_A_7.natural_gas_manufacturing' + - 'EPA_GHGI_T_A_8.non_manufacturing_natural_gas' + - 'EPA_GHGI_T_A_8.natural_gas_manufacturing' + - 'EPA_GHGI_T_A_9.non_manufacturing_natural_gas' + - 'EPA_GHGI_T_A_9.natural_gas_manufacturing' + - 'EPA_GHGI_T_A_10.non_manufacturing_natural_gas' + - 'EPA_GHGI_T_A_10.natural_gas_manufacturing' + - 'EPA_GHGI_T_A_11.non_manufacturing_natural_gas' + - 'EPA_GHGI_T_A_11.natural_gas_manufacturing' + - 'EPA_GHGI_T_A_12.non_manufacturing_natural_gas' + - 'EPA_GHGI_T_A_12.natural_gas_manufacturing' attribution_method: proportional attribute_on: ['Flowable', 'SectorProducedBy'] fill_columns: Location @@ -409,7 +445,15 @@ source_names: stationary_petroleum_fuels: selection_fields: - MetaSources: 'EPA_GHGI_T_A_6.petroleum' + MetaSources: + - 'EPA_GHGI_T_A_5.petroleum' + - 'EPA_GHGI_T_A_6.petroleum' + - 'EPA_GHGI_T_A_7.petroleum' + - 'EPA_GHGI_T_A_8.petroleum' + - 'EPA_GHGI_T_A_9.petroleum' + - 'EPA_GHGI_T_A_10.petroleum' + - 'EPA_GHGI_T_A_11.petroleum' + - 'EPA_GHGI_T_A_12.petroleum' attribution_method: proportional attribute_on: ['Flowable', 'SectorProducedBy'] fill_columns: Location From 06481281b1513bb38f1991bc6cd4eefbc600d59a Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 20 Sep 2023 08:41:49 -0400 Subject: [PATCH 0981/1127] revert use of include statements --- .../GHG_national_m2_common.yaml | 397 +++++++++++++++--- 1 file changed, 349 insertions(+), 48 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml index ce7d640d7..e635c5978 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml @@ -68,13 +68,52 @@ source_names: fedefl_mapping: GHGI activity_sets: direct: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:direct + selection_fields: + PrimaryActivity: + - Abandoned Oil and Gas Wells #CH4 + - Abandoned Underground Coal Mines #CH4 + - Adipic Acid Production #N2O + - Aluminum Production #CO2 + - Ammonia Production #CO2 + - Anaerobic Digestion at Biogas Facilities #CH4 new activity + - Caprolactam, Glyoxal, and Glyoxylic Acid Production #N2O + - Carbide Production and Consumption #CO2, CH4 + - Cement Production #CO2 + - Coal Mining #CO2, CH4 + - Composting #CH4, N2O + - Ferroalloy Production #CO2, CH4 + - Glass Production #CO2 + - Landfills #CH4 + - Lime Production #CO2 + - Incineration of Waste #CO2, #N2O + - Iron and Steel Production & Metallurgical Coke Production #CO2, CH4 + - Nitric Acid Production #N2O + - Phosphoric Acid Production #CO2 + - Rice Cultivation #CH4 + - Soda Ash Production #CO2 + - Titanium Dioxide Production #CO2 + - Wastewater Treatment #CH4, N2O + - Zinc Production #CO2 + FlowName: ["CO2", "CH4", "N2O"] # HFCs and other flows are pulled elsewhere + attribution_method: direct electricity_transmission: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electricity_transmission + selection_fields: + PrimaryActivity: Electrical Transmission and Distribution #SF6 + FlowName: SF6 + attribution_method: direct electric_power: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power + selection_fields: + PrimaryActivity: + Electric Power Sector: Electric Power #CO2 + attribution_method: proportional + attribution_source: + BEA_Detail_Make_BeforeRedef: + <<: *bea + primary_action_type: Produced + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity liming: selection_fields: @@ -98,7 +137,14 @@ source_names: attribution_method: equal carbonate_use: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use + selection_fields: + PrimaryActivity: Other Process Uses of Carbonates #CO2 + attribution_method: proportional + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals lead: selection_fields: @@ -106,29 +152,75 @@ source_names: attribution_method: direct nitrous_oxide_use: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use + selection_fields: + PrimaryActivity: N2O from Product Uses #N2O + attribution_method: proportional + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325120': ''} # Industrial gases ## Fossil Fuels EPA_GHGI_T_3_68: &natgas #CH4 from Natural Gas Systems - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 # year: # override this + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + - Distribution + - Distribution - Post-Meter + - Exploration + - Processing + - Production + - Transmission and Storage + attribution_method: direct EPA_GHGI_T_3_70: *natgas #CO2 from Natural Gas Systems mimics CH4 EPA_GHGI_T_3_72: *natgas #N2O from Natural Gas Systems, not used in original method, mimics CH4 EPA_GHGI_T_3_42: &petroleum #CH4 from Petroleum Systems - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 # year: # override this + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + - Crude Oil Transportation + - Transportation + - Exploration + - Production + - Refining + - Crude Refining + attribution_method: direct EPA_GHGI_T_3_44: *petroleum #CO2 from Petroleum Systems mimics CH4 EPA_GHGI_T_3_46: *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 ## Agriculture EPA_GHGI_T_5_28: #CH4, N2O, CO and NOx from field burning of residues - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 # year: # override this + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + - Chickpeas + - Cotton + - Maize + - Rice + - Soybeans + - Wheat + attribution_method: direct EPA_GHGI_T_5_3: &animals #CH4 from Enteric Fermentation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 # year: # override this + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + - American Bison + - Beef Cattle + - Dairy Cattle + - Goats + - Horses + - Mules and Asses + - Sheep + - Swine + - Poultry + attribution_method: direct EPA_GHGI_T_5_6: *animals #CH4 and N2O from manure, mimics enteric fermentation EPA_GHGI_T_5_17: #Direct N2O emissions from agricultural soils @@ -179,17 +271,42 @@ source_names: fedefl_mapping: GHGI activity_sets: direct_petroleum: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:direct_petroleum + selection_fields: + PrimaryActivity: + General Aviation Aircraft Aviation Gasoline: General Aviation Aircraft + General Aviation Aircraft Jet Fuel: General Aviation Aircraft + Commercial Aircraft Jet Fuel: Commercial Aircraft + Military Aircraft Jet Fuel: Military Aircraft + Buses Gasoline: Buses + Buses LPG: Buses + Motorcycles Gasoline: Motorcycles + Rail Distillate Fuel Oil: Rail + Recreational Boats Distillate Fuel Oil: Recreational Boats + Recreational Boats Gasoline: Recreational Boats + Ships and Non-Recreational Boats Distillate Fuel Oil: Ships and Non-Recreational Boats + Ships and Non-Recreational Boats Residual Fuel Oil: Ships and Non-Recreational Boats + Medium- and Heavy-Duty Trucks Gasoline: Medium- and Heavy-Duty Trucks + Medium- and Heavy-Duty Trucks LPG: Medium- and Heavy-Duty Trucks + Light-Duty Trucks LPG: Light-Duty Trucks - Households + Passenger Cars LPG: Passenger Cars - Households + attribution_method: direct direct_ng: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:direct_ng selection_fields: PrimaryActivity: Buses Natural Gas: Buses Pipeline Natural Gas: Pipeline Natural Gas petroleum_fuels: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels + selection_fields: + PrimaryActivity: + Medium- and Heavy-Duty Trucks Distillate Fuel Oil: Medium- and Heavy-Duty Trucks - Distillate Fuel Oil + Buses Distillate Fuel Oil: Buses - Distillate Fuel Oil + Passenger Cars Distillate Fuel Oil: Passenger Cars + Passenger Cars Gasoline: Passenger Cars + Light-Duty Trucks Distillate Fuel Oil: Light-Duty Trucks + Light-Duty Trucks Gasoline: Light-Duty Trucks + attribution_method: proportional attribution_source: BEA_Summary_Use_PRO_BeforeRedef: <<: *bea_summary @@ -201,13 +318,28 @@ source_names: fedefl_mapping: GHGI activity_sets: direct_gasoline: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:direct_gasoline + selection_fields: + PrimaryActivity: + Motorcycles Gasoline On-Road: Motorcycles + Medium- and Heavy-Duty Trucks and Buses Gasoline On-Road: Medium- and Heavy-Duty Trucks and Buses + attribution_method: direct direct_non_road: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:direct_non_road + selection_fields: + PrimaryActivity: + Rail Non-Road: Rail + Ships and Boats Non-Road: Ships and Boats + Aircraft Non-Road: General Aviation Aircraft + attribution_method: direct petroleum_fuels_diesel: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel + selection_fields: + PrimaryActivity: + Passenger Cars Diesel On-Road: Passenger Cars + Light-Duty Trucks Diesel On-Road: Light-Duty Trucks + Medium- and Heavy-Duty Buses Diesel On-Road: Buses - Distillate Fuel Oil + Medium- and Heavy-Duty Trucks Diesel On-Road: Medium- and Heavy-Duty Trucks - Distillate Fuel Oil + attribution_method: proportional attribution_source: BEA_Summary_Use_PRO_BeforeRedef: <<: *bea_summary @@ -215,7 +347,11 @@ source_names: ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) petroleum_fuels_gasoline: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline + selection_fields: + PrimaryActivity: + Passenger Cars Gasoline On-Road: Passenger Cars + Light-Duty Trucks Gasoline On-Road: Light-Duty Trucks + attribution_method: proportional attribution_source: BEA_Summary_Use_PRO_BeforeRedef: <<: *bea_summary @@ -223,7 +359,9 @@ source_names: ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) construction_and_mining: #this set is allocated by purchases of construction equipment - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining + selection_fields: + PrimaryActivity: Construction/Mining Equipment Non-Road + attribution_method: proportional attribution_source: BEA_Summary_Use_PRO_BeforeRedef: <<: *bea_summary @@ -231,7 +369,9 @@ source_names: ActivityProducedBy: {'333': ''} # purchases of construction/mining equipment (333120) farm_non_road: #this set is allocated by purchases of farm machinery - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road + selection_fields: + PrimaryActivity: Agricultural Equipment Non-Road + attribution_method: proportional attribution_source: BEA_Summary_Use_PRO_BeforeRedef: <<: *bea_summary @@ -239,7 +379,9 @@ source_names: ActivityProducedBy: {'333': ''} # purchases of farm machinery (333111) other_non_road: #this set is allocated by purchases of petroleum refining - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road + selection_fields: + PrimaryActivity: Other Non-Road + attribution_method: proportional attribution_source: BEA_Summary_Use_PRO_BeforeRedef: <<: *bea_summary @@ -247,7 +389,10 @@ source_names: ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) alt_fuel_on_road: #this set is allocated by purchases of natural gas - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road + selection_fields: + PrimaryActivity: + All activities Alternative Fuel On-Road: Alternative Fuel On-Road + attribution_method: proportional attribution_source: BEA_Summary_Use_PRO_BeforeRedef: <<: *bea_summary @@ -268,13 +413,28 @@ source_names: ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table activity_sets: direct_attribution: #direct allocation - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:direct_attribution + selection_fields: + PrimaryActivity: Total (All Fuels) Residential + attribution_method: direct non_manufacturing_coal: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal + selection_fields: + PrimaryActivity: + Commercial Coal Commercial: Coal Commercial + Industrial Other Coal Industrial: Coal Industrial + attribution_method: proportional + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal non_manufacturing_natural_gas: # Applies to non-manufacturing sectors like ag and mining - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas + selection_fields: + PrimaryActivity: + - Natural Gas Commercial + - Natural Gas Industrial + attribution_method: proportional attribution_source: BEA_Summary_Use_PRO_BeforeRedef: <<: *bea_summary @@ -282,7 +442,10 @@ source_names: ActivityProducedBy: {'22': ''} # purchases of natural gas (221200) coal_manufacturing_co2: # Industrial Coal for Manufacturing - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 + selection_fields: + PrimaryActivity: + Industrial Other Coal Industrial - Manufacturing: Coal Industrial - Manufacturing + attribution_method: proportional attribution_source: EIA_MECS_Energy: <<: *mecs_energy @@ -298,7 +461,10 @@ source_names: # ActivityProducedBy: {'212100': ''} # purchases of coal natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing + selection_fields: + PrimaryActivity: + - Natural Gas Industrial - Manufacturing + attribution_method: proportional attribution_source: EIA_MECS_Energy: <<: *mecs_energy @@ -312,7 +478,11 @@ source_names: # ActivityProducedBy: {'221200': ''} # purchases of natural gas petroleum: # Petroleum - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum + selection_fields: + PrimaryActivity: + - Total Petroleum Commercial + - Total Petroleum Industrial + attribution_method: proportional attribution_source: BEA_Summary_Use_PRO_BeforeRedef: <<: *bea_summary @@ -330,13 +500,36 @@ source_names: fedefl_mapping: GHGI activity_sets: residential: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:residential + selection_fields: + PrimaryActivity: + - Fuel Oil Residential + - Coal Residential + - Natural Gas Residential + - Wood Residential + attribution_method: direct electric_power: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power + selection_fields: + PrimaryActivity: + Coal Electric Power: Coal Electric Power + Natural Gas Electric Power: Natural Gas Electric Power + Natural gas Electric Power: Natural Gas Electric Power # fix capitalization + Fuel Oil Electric Power: Fuel Oil Electric Power + Wood Electric Power: Wood Electric Power + attribution_method: proportional + attribution_source: + BEA_Detail_Make_BeforeRedef: + <<: *bea + primary_action_type: Produced + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity fuel_oil: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil + selection_fields: + PrimaryActivity: + - Fuel Oil Commercial + - Fuel Oil Industrial + attribution_method: proportional attribution_source: BEA_Summary_Use_PRO_BeforeRedef: <<: *bea_summary @@ -344,7 +537,13 @@ source_names: ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) natural_gas_nonmanufacturing: # Commercial Natural gas - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing + selection_fields: + PrimaryActivity: + Natural gas Commercial: Natural Gas Commercial # fix capitalization + Natural gas Industrial: Natural Gas Industrial # fix capitalization + Natural Gas Commercial: Natural Gas Commercial + Natural Gas Industrial: Natural Gas Industrial + attribution_method: proportional attribution_source: BEA_Summary_Use_PRO_BeforeRedef: <<: *bea_summary @@ -352,10 +551,19 @@ source_names: ActivityProducedBy: {'22': ''} # purchases of natural gas (221200) coal_nonmanufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing + selection_fields: + PrimaryActivity: Coal Industrial + attribution_method: proportional + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing + selection_fields: + PrimaryActivity: Coal Industrial - Manufacturing + attribution_method: proportional attribution_source: EIA_MECS_Energy: <<: *mecs_energy @@ -369,7 +577,11 @@ source_names: # ActivityProducedBy: {'212100': ''} # purchases of coal ng_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing + selection_fields: + PrimaryActivity: + - Natural gas Industrial - Manufacturing + - Natural Gas Industrial - Manufacturing + attribution_method: proportional attribution_source: EIA_MECS_Energy: <<: *mecs_energy @@ -384,23 +596,51 @@ source_names: #Intentionally left out 'Wood Commercial' and 'Wood Industrial' - EPA_GHGI_T_3_9: - <<: *stationary_combustion # N2O emissions from stationary combustion + EPA_GHGI_T_3_9: *stationary_combustion # N2O emissions from stationary combustion ## Other sources EPA_GHGI_T_4_46: #CO2 for selected petrochemicals - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 # year: # override with ghgi_year + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + - Acrylonitrile + - Carbon Black + - Ethylene + - Ethylene Dichloride + - Ethylene Oxide + - Methanol + attribution_method: direct GHGI_nonenergy_fossil_fuel_emissions: # Fossil fuel for non-energy uses # year: #override with ghgi_year fedefl_mapping: GHGI activity_sets: coal: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:coal + selection_fields: + PrimaryActivity: + - Industry Industrial Coking Coal + - Industry Industrial Other Coal + attribution_method: direct petroleum_neu: # consumed petroleum products - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum + selection_fields: + PrimaryActivity: + 'Industry Asphalt & Road Oil': Industry Petroleum Products Non-energy + Industry Distillate Fuel Oil: Industry Petroleum Products Non-energy + Industry LPG: Industry Petroleum Products Non-energy + Industry Lubricants: Industry Petroleum Products Non-energy + Industry Miscellaneous Products: Industry Petroleum Products Non-energy + 'Industry Naphtha (<401 F)': Industry Petroleum Products Non-energy + 'Industry Other Oil (>401 F)': Industry Petroleum Products Non-energy + Industry Pentanes Plus: Industry Petroleum Products Non-energy + Industry Petroleum Coke: Industry Petroleum Products Non-energy + Industry Special Naphtha: Industry Petroleum Products Non-energy + Industry Still Gas: Industry Petroleum Products Non-energy + Industry Waxes: Industry Petroleum Products Non-energy + Industry Natural Gasoline: Industry Petroleum Products Non-energy #T_3_22. Also produced by nat gas plants + Industry HGL: Industry Petroleum Products Non-energy #T_3_22. Also produced by nat gas plants + attribution_method: proportional attribution_source: EIA_MECS_Energy: <<: *mecs_energy @@ -418,7 +658,9 @@ source_names: # ActivityProducedBy: {'324110': ''} # purchases of refineries natural_gas_neu: # consumed nat gas to chemical plants - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas + selection_fields: + PrimaryActivity: Industry Natural Gas to Chemical Plants + attribution_method: proportional attribution_source: EIA_MECS_Energy: <<: *mecs_energy @@ -433,7 +675,9 @@ source_names: # ActivityProducedBy: {'221200': ''} # purchases of natural gas transportation_lubricants: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants + selection_fields: + PrimaryActivity: Transportation Lubricants + attribution_method: proportional attribution_source: BEA_Summary_Use_PRO_BeforeRedef: <<: *bea_summary @@ -442,12 +686,19 @@ source_names: ## Other Emissions EPA_GHGI_T_4_50: # HFCs from HCFC-22 production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 # year: # override with ghgi_year + fedefl_mapping: GHGI + selection_fields: + Unit: MMT CO2e # drop records in kt + PrimaryActivity: HCFC-22 Production + attribution_method: direct EPA_GHGI_T_4_96: # HFCs and other emissions from electronics manufacture - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 # year: # override with ghgi_year + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: Electronics Production + attribution_method: direct EPA_GHGI_T_4_102: # HFCs and PFCs from ODS Substitutes clean_fba_before_activity_sets: !script_function:EPA_GHGI split_HFCs_by_type @@ -458,26 +709,76 @@ source_names: fedefl_mapping: GHGI activity_sets: households: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:households + selection_fields: + PrimaryActivity: + - Domestic Refrigeration + - Residential Stationary Air Conditioning + attribution_method: direct refrigerants: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants + selection_fields: + PrimaryActivity: + - Commercial Refrigeration + - Industrial Process Refrigeration + attribution_method: proportional + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment air_conditioning: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning + selection_fields: + PrimaryActivity: + - Commercial Stationary Air Conditioning + attribution_method: proportional + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment foams: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams + selection_fields: + PrimaryActivity: + - Foams + attribution_method: proportional + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: + '326140': '' # Polystyrene foam + '326150': '' # Urethane and other foam EPA_GHGI_T_A_97: # HFCs from Transportation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 # year: # override with ghgi_year + clean_fba_before_mapping: !script_function:EPA_GHGI split_HFCs_by_type + clean_parameter: + # Proportions of specific HFCs are assigned based on national total + flow_fba: EPA_GHGI_T_4_100 + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: + Mobile AC - Passenger Cars: Passenger Cars - Households + Mobile AC - Light-Duty Trucks: Light-Duty Trucks - Households + Mobile AC - Heavy-Duty Vehicles: Heavy-Duty Vehicles + Comfort Cooling for Trains and Buses - School and Tour Buses: School and Tour Buses + # Comfort Cooling for Trains and Buses - Transit Buses: Transit Buses #excluded + Comfort Cooling for Trains and Buses - Rail: Rail + Refrigerated Transport - Medium- and Heavy-Duty Trucks: Medium- and Heavy-Duty Trucks + Refrigerated Transport - Rail: Rail + Refrigerated Transport - Ships and Boats: Ships and Boats + attribution_method: direct EPA_GHGI_T_4_80: # PFCs from aluminum production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 # year: # override with ghgi_year + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: Aluminum Production + attribution_method: direct EPA_GHGI_T_4_86: # HFCs, SF6, CO2 from magnesium production From 8d2daec496dd61730348f74336cf34463db9e4ad Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 20 Sep 2023 08:52:43 -0400 Subject: [PATCH 0982/1127] drop old m1 national (detail), m2 (summmary) becomes m1 --- .../GHG_national_2012_m1.yaml | 187 ----- .../GHG_national_2013_m1.yaml | 187 ----- .../GHG_national_2014_m1.yaml | 187 ----- .../GHG_national_2015_m1.yaml | 187 ----- .../GHG_national_2016_m1.yaml | 165 ---- .../GHG_national_2017_m1.yaml | 165 ---- .../GHG_national_2018_m1.yaml | 165 ---- .../GHG_national_2019_m1.yaml | 145 +++- .../GHG_national_2019_m2.yaml | 230 ----- .../GHG_national_2020_m1.yaml | 166 ---- .../GHG_national_2020_m2.yaml | 134 +-- .../GHG_national_m1_common.yaml | 349 ++++---- .../GHG_national_m2_common.yaml | 789 ------------------ 13 files changed, 326 insertions(+), 2730 deletions(-) delete mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml delete mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml delete mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml delete mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml delete mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml delete mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml delete mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml delete mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml delete mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml delete mode 100644 flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml deleted file mode 100644 index dab3cc027..000000000 --- a/flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml +++ /dev/null @@ -1,187 +0,0 @@ -# This is a 2012 target year specific implementation of GHG_national_m1 -# All parameters add year specific data when needed to implement for 2012 -# GHGI FBA table names match the 2022 GHGI Report -# MECS year is 2014 -# CoA year is 2012 - -!include:GHG_national_m1_common.yaml -ghgi_year: &ghgi_year 2012 -mecs_year: &mecs_year 2014 -coa_year: &coa_year 2012 - -_industrial_allocation_dict: &industrial_dict - energy_fba: 'EIA_MECS_Energy' - year: *mecs_year - ghg_fba: 'EPA_GHGI_T_A_11' # 2014 Table - -source_names: - "EPA_GHGI_T_2_1": #U.S. GHG emissions - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 - year: *ghgi_year - activity_sets: # Update USGS year for these activity_sets - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets - lead: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead - attribution_source: - USGS_MYB_Lead: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead - year: *ghgi_year - "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 - year: *ghgi_year - "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 - year: *ghgi_year - "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 - year: *ghgi_year - "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 - year: *ghgi_year - "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 - year: *ghgi_year - "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 - year: *ghgi_year - "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 - year: *ghgi_year - "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 - year: *ghgi_year - "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 - year: *ghgi_year - "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 - year: *ghgi_year - activity_sets: # Update CoA year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets - cropland: # allocated based on USDA land area harvested - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets:cropland - attribution_source: - USDA_CoA_Cropland: - !include:GHG_national_m1_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland - year: *coa_year - attribution_source: - USDA_CoA_Cropland_NAICS: - !include:GHG_national_m1_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland:attribution_source:USDA_CoA_Cropland_NAICS - year: *coa_year - pasture: &pasture # allocated based on USDA Animal operation land (acres) - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets:pasture - attribution_source: - USDA_CoA_Cropland_NAICS: - !include:GHG_national_m1_common.yaml:attribution_sources:_animal_land_allocation:USDA_CoA_Cropland_NAICS - year: *coa_year - "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 - year: *ghgi_year - activity_sets: # Update CoA year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18:activity_sets - pasture: *pasture # allocated based on USDA Animal operation land (acres) - "EPA_GHGI_T_3_13": #CO2 from mobile combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 - year: *ghgi_year - "EPA_GHGI_T_3_14": #CH4 from mobile combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 - year: *ghgi_year - "EPA_GHGI_T_3_15": #N2O from mobile combustion duplicates method for CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_15 - year: *ghgi_year - "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 - year: *ghgi_year - "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 - year: *ghgi_year - "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 - year: *ghgi_year - "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 - year: *ghgi_year - "EPA_GHGI_T_A_97": # HFCs from Transportation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 - year: *ghgi_year - "EPA_GHGI_T_4_80": # PFCs from aluminum production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 - year: *ghgi_year - "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_86 - year: *ghgi_year - "EPA_GHGI_T_3_22b": #Fossil fuel for non-energy uses - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions - year: *ghgi_year - activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets - petroleum: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum:attribution_source:EIA_MECS_Energy - year: *mecs_year - natural_gas: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas:attribution_source:EIA_MECS_Energy - year: *mecs_year - -### Major CO2 Sources - "EPA_GHGI_T_A_13": # CO2 emissions from stationary combustion. This table number changes with year - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion - year: *ghgi_year - clean_parameter: *industrial_dict - activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets - coal_manufacturing_co2: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy - year: *mecs_year - natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - - "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 - year: *ghgi_year - clean_parameter: *industrial_dict - activity_sets: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - ng_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - - "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9 - year: *ghgi_year - clean_parameter: *industrial_dict - activity_sets: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - ng_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml deleted file mode 100644 index d5d7c9dc1..000000000 --- a/flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml +++ /dev/null @@ -1,187 +0,0 @@ -# This is a 2013 target year specific implementation of GHG_national_m1 -# All parameters add year specific data when needed to implement for 2013 -# GHGI FBA table names match the 2022 GHGI Report -# MECS year is 2014 -# CoA year is 2012 - -!include:GHG_national_m1_common.yaml -ghgi_year: &ghgi_year 2013 -mecs_year: &mecs_year 2014 -coa_year: &coa_year 2012 - -_industrial_allocation_dict: &industrial_dict - energy_fba: 'EIA_MECS_Energy' - year: *mecs_year - ghg_fba: 'EPA_GHGI_T_A_11' # 2014 Table - -source_names: - "EPA_GHGI_T_2_1": #U.S. GHG emissions - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 - year: *ghgi_year - activity_sets: # Update USGS year for these activity_sets - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets - lead: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead - attribution_source: - USGS_MYB_Lead: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead - year: *ghgi_year - "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 - year: *ghgi_year - "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 - year: *ghgi_year - "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 - year: *ghgi_year - "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 - year: *ghgi_year - "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 - year: *ghgi_year - "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 - year: *ghgi_year - "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 - year: *ghgi_year - "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 - year: *ghgi_year - "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 - year: *ghgi_year - "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 - year: *ghgi_year - activity_sets: # Update CoA year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets - cropland: # allocated based on USDA land area harvested - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets:cropland - attribution_source: - USDA_CoA_Cropland: - !include:GHG_national_m1_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland - year: *coa_year - attribution_source: - USDA_CoA_Cropland_NAICS: - !include:GHG_national_m1_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland:attribution_source:USDA_CoA_Cropland_NAICS - year: *coa_year - pasture: &pasture # allocated based on USDA Animal operation land (acres) - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets:pasture - attribution_source: - USDA_CoA_Cropland_NAICS: - !include:GHG_national_m1_common.yaml:attribution_sources:_animal_land_allocation:USDA_CoA_Cropland_NAICS - year: *coa_year - "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 - year: *ghgi_year - activity_sets: # Update CoA year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18:activity_sets - pasture: *pasture # allocated based on USDA Animal operation land (acres) - "EPA_GHGI_T_3_13": #CO2 from mobile combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 - year: *ghgi_year - "EPA_GHGI_T_3_14": #CH4 from mobile combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 - year: *ghgi_year - "EPA_GHGI_T_3_15": #N2O from mobile combustion duplicates method for CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_15 - year: *ghgi_year - "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 - year: *ghgi_year - "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 - year: *ghgi_year - "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 - year: *ghgi_year - "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 - year: *ghgi_year - "EPA_GHGI_T_A_97": # HFCs from Transportation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 - year: *ghgi_year - "EPA_GHGI_T_4_80": # PFCs from aluminum production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 - year: *ghgi_year - "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_86 - year: *ghgi_year - "EPA_GHGI_T_3_22b": #Fossil fuel for non-energy uses - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions - year: *ghgi_year - activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets - petroleum: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum:attribution_source:EIA_MECS_Energy - year: *mecs_year - natural_gas: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas:attribution_source:EIA_MECS_Energy - year: *mecs_year - -### Major CO2 Sources - "EPA_GHGI_T_A_12": # CO2 emissions from stationary combustion. This table number changes with year - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion - year: *ghgi_year - clean_parameter: *industrial_dict - activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets - coal_manufacturing_co2: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy - year: *mecs_year - natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - - "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 - year: *ghgi_year - clean_parameter: *industrial_dict - activity_sets: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - ng_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - - "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9 - year: *ghgi_year - clean_parameter: *industrial_dict - activity_sets: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - ng_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml deleted file mode 100644 index e2e799f26..000000000 --- a/flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml +++ /dev/null @@ -1,187 +0,0 @@ -# This is a 2014 target year specific implementation of GHG_national_m1 -# All parameters add year specific data when needed to implement for 2014 -# GHGI FBA table names match the 2022 GHGI Report -# MECS year is 2014 -# CoA year is 2012 - -!include:GHG_national_m1_common.yaml -ghgi_year: &ghgi_year 2014 -mecs_year: &mecs_year 2014 -coa_year: &coa_year 2012 - -_industrial_allocation_dict: &industrial_dict - energy_fba: 'EIA_MECS_Energy' - year: *mecs_year - ghg_fba: 'EPA_GHGI_T_A_11' # 2014 Table - -source_names: - "EPA_GHGI_T_2_1": #U.S. GHG emissions - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 - year: *ghgi_year - activity_sets: # Update USGS year for these activity_sets - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets - lead: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead - attribution_source: - USGS_MYB_Lead: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead - year: *ghgi_year - "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 - year: *ghgi_year - "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 - year: *ghgi_year - "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 - year: *ghgi_year - "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 - year: *ghgi_year - "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 - year: *ghgi_year - "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 - year: *ghgi_year - "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 - year: *ghgi_year - "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 - year: *ghgi_year - "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 - year: *ghgi_year - "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 - year: *ghgi_year - activity_sets: # Update CoA year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets - cropland: # allocated based on USDA land area harvested - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets:cropland - attribution_source: - USDA_CoA_Cropland: - !include:GHG_national_m1_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland - year: *coa_year - attribution_source: - USDA_CoA_Cropland_NAICS: - !include:GHG_national_m1_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland:attribution_source:USDA_CoA_Cropland_NAICS - year: *coa_year - pasture: &pasture # allocated based on USDA Animal operation land (acres) - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets:pasture - attribution_source: - USDA_CoA_Cropland_NAICS: - !include:GHG_national_m1_common.yaml:attribution_sources:_animal_land_allocation:USDA_CoA_Cropland_NAICS - year: *coa_year - "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 - year: *ghgi_year - activity_sets: # Update CoA year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18:activity_sets - pasture: *pasture # allocated based on USDA Animal operation land (acres) - "EPA_GHGI_T_3_13": #CO2 from mobile combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 - year: *ghgi_year - "EPA_GHGI_T_3_14": #CH4 from mobile combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 - year: *ghgi_year - "EPA_GHGI_T_3_15": #N2O from mobile combustion duplicates method for CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_15 - year: *ghgi_year - "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 - year: *ghgi_year - "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 - year: *ghgi_year - "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 - year: *ghgi_year - "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 - year: *ghgi_year - "EPA_GHGI_T_A_97": # HFCs from Transportation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 - year: *ghgi_year - "EPA_GHGI_T_4_80": # PFCs from aluminum production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 - year: *ghgi_year - "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_86 - year: *ghgi_year - "EPA_GHGI_T_3_22b": #Fossil fuel for non-energy uses - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions - year: *ghgi_year - activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets - petroleum: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum:attribution_source:EIA_MECS_Energy - year: *mecs_year - natural_gas: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas:attribution_source:EIA_MECS_Energy - year: *mecs_year - -### Major CO2 Sources - "EPA_GHGI_T_A_11": # CO2 emissions from stationary combustion. This table number changes with year - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion - year: *ghgi_year - clean_parameter: *industrial_dict - activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets - coal_manufacturing_co2: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy - year: *mecs_year - natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - - "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 - year: *ghgi_year - clean_parameter: *industrial_dict - activity_sets: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - ng_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - - "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9 - year: *ghgi_year - clean_parameter: *industrial_dict - activity_sets: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - ng_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml deleted file mode 100644 index ce0483d5b..000000000 --- a/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml +++ /dev/null @@ -1,187 +0,0 @@ -# This is a 2015 target year specific implementation of GHG_national_m1 -# All parameters add year specific data when needed to implement for 2015 -# GHGI FBA table names match the 2022 GHGI Report -# MECS year is 2014 -# CoA year is 2012 - -!include:GHG_national_m1_common.yaml -ghgi_year: &ghgi_year 2015 -mecs_year: &mecs_year 2014 -coa_year: &coa_year 2012 - -_industrial_allocation_dict: &industrial_dict - energy_fba: 'EIA_MECS_Energy' - year: *mecs_year - ghg_fba: 'EPA_GHGI_T_A_11' # 2014 Table - -source_names: - "EPA_GHGI_T_2_1": #U.S. GHG emissions - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 - year: *ghgi_year - activity_sets: # Update USGS year for these activity_sets - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets - lead: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead - attribution_source: - USGS_MYB_Lead: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead - year: *ghgi_year - "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 - year: *ghgi_year - "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 - year: *ghgi_year - "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 - year: *ghgi_year - "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 - year: *ghgi_year - "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 - year: *ghgi_year - "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 - year: *ghgi_year - "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 - year: *ghgi_year - "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 - year: *ghgi_year - "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 - year: *ghgi_year - "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 - year: *ghgi_year - activity_sets: # Update CoA year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets - cropland: # allocated based on USDA land area harvested - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets:cropland - attribution_source: - USDA_CoA_Cropland: - !include:GHG_national_m1_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland - year: *coa_year - attribution_source: - USDA_CoA_Cropland_NAICS: - !include:GHG_national_m1_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland:attribution_source:USDA_CoA_Cropland_NAICS - year: *coa_year - pasture: &pasture # allocated based on USDA Animal operation land (acres) - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17:activity_sets:pasture - attribution_source: - USDA_CoA_Cropland_NAICS: - !include:GHG_national_m1_common.yaml:attribution_sources:_animal_land_allocation:USDA_CoA_Cropland_NAICS - year: *coa_year - "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 - year: *ghgi_year - activity_sets: # Update CoA year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18:activity_sets - pasture: *pasture # allocated based on USDA Animal operation land (acres) - "EPA_GHGI_T_3_13": #CO2 from mobile combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 - year: *ghgi_year - "EPA_GHGI_T_3_14": #CH4 from mobile combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 - year: *ghgi_year - "EPA_GHGI_T_3_15": #N2O from mobile combustion duplicates method for CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_15 - year: *ghgi_year - "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 - year: *ghgi_year - "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 - year: *ghgi_year - "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 - year: *ghgi_year - "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 - year: *ghgi_year - "EPA_GHGI_T_A_97": # HFCs from Transportation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 - year: *ghgi_year - "EPA_GHGI_T_4_80": # PFCs from aluminum production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 - year: *ghgi_year - "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_86 - year: *ghgi_year - "EPA_GHGI_T_3_22b": #Fossil fuel for non-energy uses - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions - year: *ghgi_year - activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets - petroleum: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum:attribution_source:EIA_MECS_Energy - year: *mecs_year - natural_gas: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas:attribution_source:EIA_MECS_Energy - year: *mecs_year - -### Major CO2 Sources - "EPA_GHGI_T_A_10": # CO2 emissions from stationary combustion. This table number changes with year - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion - year: *ghgi_year - clean_parameter: *industrial_dict - activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets - coal_manufacturing_co2: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy - year: *mecs_year - natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - - "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 - year: *ghgi_year - clean_parameter: *industrial_dict - activity_sets: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - ng_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - - "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9 - year: *ghgi_year - clean_parameter: *industrial_dict - activity_sets: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - ng_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml deleted file mode 100644 index 4d7fe99e3..000000000 --- a/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml +++ /dev/null @@ -1,165 +0,0 @@ -# This is a 2016 target year specific implementation of GHG_national_m1 -# All parameters add year specific data when needed to implement for 2016 -# GHGI FBA table names match the 2022 GHGI Report -# MECS year is 2018 -# CoA year is 2017 - -!include:GHG_national_m1_common.yaml -ghgi_year: &ghgi_year 2016 -mecs_year: &mecs_year 2018 - -_industrial_allocation_dict: &industrial_dict - energy_fba: 'EIA_MECS_Energy' - year: *mecs_year - ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table - -source_names: - "EPA_GHGI_T_2_1": #U.S. GHG emissions - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 - year: *ghgi_year - activity_sets: # Update USGS year for these activity_sets - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets - lead: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead - attribution_source: - USGS_MYB_Lead: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead - year: *ghgi_year - "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 - year: *ghgi_year - "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 - year: *ghgi_year - "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 - year: *ghgi_year - "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 - year: *ghgi_year - "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 - year: *ghgi_year - "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 - year: *ghgi_year - "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 - year: *ghgi_year - "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 - year: *ghgi_year - "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 - year: *ghgi_year - "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 - year: *ghgi_year - "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 - year: *ghgi_year - "EPA_GHGI_T_3_13": #CO2 from mobile combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 - year: *ghgi_year - "EPA_GHGI_T_3_14": #CH4 from mobile combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 - year: *ghgi_year - "EPA_GHGI_T_3_15": #N2O from mobile combustion duplicates method for CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_15 - year: *ghgi_year - "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 - year: *ghgi_year - "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 - year: *ghgi_year - "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 - year: *ghgi_year - "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 - year: *ghgi_year - "EPA_GHGI_T_A_97": # HFCs from Transportation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 - year: *ghgi_year - "EPA_GHGI_T_4_80": # PFCs from aluminum production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 - year: *ghgi_year - "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_86 - year: *ghgi_year - "EPA_GHGI_T_3_22b": #Fossil fuel for non-energy uses - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions - year: *ghgi_year - activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets - petroleum: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum:attribution_source:EIA_MECS_Energy - year: *mecs_year - natural_gas: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas:attribution_source:EIA_MECS_Energy - year: *mecs_year - -### Major CO2 Sources - "EPA_GHGI_T_A_9": # CO2 emissions from stationary combustion. This table number changes with year - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion - year: *ghgi_year - clean_parameter: *industrial_dict - activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets - coal_manufacturing_co2: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy - year: *mecs_year - natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - - "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 - year: *ghgi_year - clean_parameter: *industrial_dict - activity_sets: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - ng_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - - "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9 - year: *ghgi_year - clean_parameter: *industrial_dict - activity_sets: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - ng_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml deleted file mode 100644 index 69d24d895..000000000 --- a/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml +++ /dev/null @@ -1,165 +0,0 @@ -# This is a 2017 target year specific implementation of GHG_national_m1_common -# All parameters add year specific data when needed to implement for 2017 -# GHGI FBA table names match the 2022 GHGI Report -# MECS year is 2018 -# CoA year is 2017 - -!include:GHG_national_m1_common.yaml -ghgi_year: &ghgi_year 2017 -mecs_year: &mecs_year 2018 - -_industrial_allocation_dict: &industrial_dict - energy_fba: 'EIA_MECS_Energy' - year: *mecs_year - ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table - -source_names: - "EPA_GHGI_T_2_1": #U.S. GHG emissions - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 - year: *ghgi_year - activity_sets: # Update USGS year for these activity_sets - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets - lead: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead - attribution_source: - USGS_MYB_Lead: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead - year: *ghgi_year - "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 - year: *ghgi_year - "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 - year: *ghgi_year - "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 - year: *ghgi_year - "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 - year: *ghgi_year - "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 - year: *ghgi_year - "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 - year: *ghgi_year - "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 - year: *ghgi_year - "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 - year: *ghgi_year - "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 - year: *ghgi_year - "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 - year: *ghgi_year - "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 - year: *ghgi_year - "EPA_GHGI_T_3_13": #CO2 from mobile combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 - year: *ghgi_year - "EPA_GHGI_T_3_14": #CH4 from mobile combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 - year: *ghgi_year - "EPA_GHGI_T_3_15": #N2O from mobile combustion duplicates method for CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_15 - year: *ghgi_year - "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 - year: *ghgi_year - "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 - year: *ghgi_year - "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 - year: *ghgi_year - "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 - year: *ghgi_year - "EPA_GHGI_T_A_97": # HFCs from Transportation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 - year: *ghgi_year - "EPA_GHGI_T_4_80": # PFCs from aluminum production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 - year: *ghgi_year - "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_86 - year: *ghgi_year - "EPA_GHGI_T_3_22b": #Fossil fuel for non-energy uses - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions - year: *ghgi_year - activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets - petroleum: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum:attribution_source:EIA_MECS_Energy - year: *mecs_year - natural_gas: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas:attribution_source:EIA_MECS_Energy - year: *mecs_year - -### Major CO2 Sources - "EPA_GHGI_T_A_8": # CO2 emissions from stationary combustion - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion - year: *ghgi_year # Table A_8 is specific to 2017 - clean_parameter: *industrial_dict - activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets - coal_manufacturing_co2: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy - year: *mecs_year - natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - - "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 - year: *ghgi_year - clean_parameter: *industrial_dict - activity_sets: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - ng_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - - "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9 - year: *ghgi_year - clean_parameter: *industrial_dict - activity_sets: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - ng_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml deleted file mode 100644 index 00c13272f..000000000 --- a/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml +++ /dev/null @@ -1,165 +0,0 @@ -# This is a 2018 target year specific implementation of GHG_national_m1 -# All parameters add year specific data when needed to implement for 2018 -# GHGI FBA table names match the 2022 GHGI Report -# MECS year is 2018 -# CoA year is 2017 - -!include:GHG_national_m1_common.yaml -ghgi_year: &ghgi_year 2018 -mecs_year: &mecs_year 2018 - -_industrial_allocation_dict: &industrial_dict - energy_fba: 'EIA_MECS_Energy' - year: *mecs_year - ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table - -source_names: - "EPA_GHGI_T_2_1": #U.S. GHG emissions - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 - year: *ghgi_year - activity_sets: # Update USGS year for these activity_sets - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets - lead: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead - attribution_source: - USGS_MYB_Lead: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead - year: *ghgi_year - "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 - year: *ghgi_year - "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 - year: *ghgi_year - "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 - year: *ghgi_year - "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 - year: *ghgi_year - "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 - year: *ghgi_year - "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 - year: *ghgi_year - "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 - year: *ghgi_year - "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 - year: *ghgi_year - "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 - year: *ghgi_year - "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 - year: *ghgi_year - "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 - year: *ghgi_year - "EPA_GHGI_T_3_13": #CO2 from mobile combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 - year: *ghgi_year - "EPA_GHGI_T_3_14": #CH4 from mobile combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 - year: *ghgi_year - "EPA_GHGI_T_3_15": #N2O from mobile combustion duplicates method for CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_15 - year: *ghgi_year - "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 - year: *ghgi_year - "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 - year: *ghgi_year - "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 - year: *ghgi_year - "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 - year: *ghgi_year - "EPA_GHGI_T_A_97": # HFCs from Transportation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 - year: *ghgi_year - "EPA_GHGI_T_4_80": # PFCs from aluminum production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 - year: *ghgi_year - "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_86 - year: *ghgi_year - "EPA_GHGI_T_3_22b": #Fossil fuel for non-energy uses - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions - year: *ghgi_year - activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets - petroleum: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum:attribution_source:EIA_MECS_Energy - year: *mecs_year - natural_gas: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas:attribution_source:EIA_MECS_Energy - year: *mecs_year - -### Major CO2 Sources - "EPA_GHGI_T_A_7": # CO2 emissions from stationary combustion. This table number varies by GHG year - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion - year: *ghgi_year # Table A_7 is specific to 2018 - clean_parameter: *industrial_dict - activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets - coal_manufacturing_co2: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy - year: *mecs_year - natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - - "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 - year: *ghgi_year - clean_parameter: *industrial_dict - activity_sets: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - ng_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - - "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9 - year: *ghgi_year - clean_parameter: *industrial_dict - activity_sets: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - ng_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year \ No newline at end of file diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml index 5045f8825..64bd70d4d 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml @@ -1,8 +1,8 @@ # This is a 2019 target year specific implementation of GHG_national_m1 +# This is a Summary level model # All parameters add year specific data when needed to implement for 2019 # GHGI FBA table names match the 2022 GHGI Report # MECS year is 2018 -# CoA year is 2017 !include:GHG_national_m1_common.yaml ghgi_year: &ghgi_year 2019 @@ -17,14 +17,7 @@ source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year - activity_sets: # Update USGS year for these activity_sets - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets - lead: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead - attribution_source: - USGS_MYB_Lead: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead - year: *ghgi_year + "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year @@ -61,12 +54,65 @@ source_names: "EPA_GHGI_T_3_13": #CO2 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 year: *ghgi_year - "EPA_GHGI_T_3_14": #CH4 from mobile combustion + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets + petroleum_fuels: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 year: *ghgi_year - "EPA_GHGI_T_3_15": #N2O from mobile combustion duplicates method for CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_15 - year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets + petroleum_fuels_diesel: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + petroleum_fuels_gasoline: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + + construction_and_mining: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + farm_non_road: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + other_non_road: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + alt_fuel_on_road: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 + "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 year: *ghgi_year @@ -79,6 +125,7 @@ source_names: "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 year: *ghgi_year + "EPA_GHGI_T_A_97": # HFCs from Transportation !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 year: *ghgi_year @@ -93,26 +140,40 @@ source_names: year: *ghgi_year activity_sets: # Update EIA_MECS year for some activity_sets !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets - petroleum: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum + petroleum_neu: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu attribution_source: EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy year: *mecs_year - natural_gas: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas + natural_gas_neu: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu attribution_source: EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy year: *mecs_year + transportation_lubricants: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + ### Major CO2 Sources "EPA_GHGI_T_A_6": # CO2 emissions from stationary combustion. This table number varies by GHG year. !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion year: *ghgi_year clean_parameter: *industrial_dict - activity_sets: # Update EIA_MECS year for some activity_sets + activity_sets: # Update EIA_MECS and BEA year for some activity_sets !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + non_manufacturing_natural_gas: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + coal_manufacturing_co2: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 attribution_source: @@ -126,12 +187,33 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year - "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion + petroleum: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 year: *ghgi_year clean_parameter: *industrial_dict - activity_sets: + activity_sets: # Update EIA_MECS and BEA year for some activity_sets !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + + fuel_oil: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + natural_gas_nonmanufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing attribution_source: @@ -145,21 +227,4 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year - "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9 - year: *ghgi_year - clean_parameter: *industrial_dict - activity_sets: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - ng_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + "EPA_GHGI_T_3_9": *T_3_8 # N2O emissions from stationary combustion diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml deleted file mode 100644 index f457b02f1..000000000 --- a/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml +++ /dev/null @@ -1,230 +0,0 @@ -# This is a 2019 target year specific implementation of GHG_national_m2 -# This is a Summary level model -# All parameters add year specific data when needed to implement for 2019 -# GHGI FBA table names match the 2022 GHGI Report -# MECS year is 2018 - -!include:GHG_national_m2_common.yaml -ghgi_year: &ghgi_year 2019 -mecs_year: &mecs_year 2018 - -_industrial_allocation_dict: &industrial_dict - energy_fba: 'EIA_MECS_Energy' - year: *mecs_year - ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table - -source_names: - "EPA_GHGI_T_2_1": #U.S. GHG emissions - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 - year: *ghgi_year - - "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_68 - year: *ghgi_year - "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_70 - year: *ghgi_year - "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_72 - year: *ghgi_year - "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_42 - year: *ghgi_year - "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_44 - year: *ghgi_year - "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_46 - year: *ghgi_year - "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_28 - year: *ghgi_year - "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_3 - year: *ghgi_year - "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_6 - year: *ghgi_year - "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_17 - year: *ghgi_year - "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_18 - year: *ghgi_year - "EPA_GHGI_T_3_13": #CO2 from mobile combustion - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_13 - year: *ghgi_year - activity_sets: # Update BEA year for some activity_sets - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets - petroleum_fuels: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - - "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14 - year: *ghgi_year - activity_sets: # Update BEA year for some activity_sets - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets - petroleum_fuels_diesel: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - - petroleum_fuels_gasoline: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - - - construction_and_mining: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - - farm_non_road: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - - other_non_road: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - - alt_fuel_on_road: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - - "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 - - "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_46 - year: *ghgi_year - "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_50 - year: *ghgi_year - "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_96 - year: *ghgi_year - "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102 - year: *ghgi_year - - "EPA_GHGI_T_A_97": # HFCs from Transportation - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_A_97 - year: *ghgi_year - "EPA_GHGI_T_4_80": # PFCs from aluminum production - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_80 - year: *ghgi_year - "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_86 - year: *ghgi_year - "EPA_GHGI_T_3_22b": #Fossil fuel for non-energy uses - !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions - year: *ghgi_year - activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets - petroleum_neu: - !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy - year: *mecs_year - natural_gas_neu: - !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy - year: *mecs_year - transportation_lubricants: - !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - - -### Major CO2 Sources - "EPA_GHGI_T_A_6": # CO2 emissions from stationary combustion. This table number varies by GHG year. - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion - year: *ghgi_year - clean_parameter: *industrial_dict - activity_sets: # Update EIA_MECS and BEA year for some activity_sets - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets - non_manufacturing_natural_gas: - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - - coal_manufacturing_co2: - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy - year: *mecs_year - natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - - petroleum: - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - - "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8 - year: *ghgi_year - clean_parameter: *industrial_dict - activity_sets: # Update EIA_MECS and BEA year for some activity_sets - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets - - fuel_oil: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - natural_gas_nonmanufacturing: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - - coal_manufacturing: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - ng_manufacturing: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - - "EPA_GHGI_T_3_9": *T_3_8 # N2O emissions from stationary combustion diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml deleted file mode 100644 index 6c5743e11..000000000 --- a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml +++ /dev/null @@ -1,166 +0,0 @@ -# This is a 2020 target year specific implementation of GHG_national_m1 -# All parameters add year specific data when needed to implement for 2020 -# GHGI FBA table names match the 2022 GHGI Report -# MECS year is 2018 -# CoA year is 2017 - -!include:GHG_national_m1_common.yaml -ghgi_year: &ghgi_year 2020 -mecs_year: &mecs_year 2018 - -_industrial_allocation_dict: &industrial_dict - energy_fba: 'EIA_MECS_Energy' - year: *mecs_year - ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table - -source_names: - "EPA_GHGI_T_2_1": #U.S. GHG emissions - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 - year: *ghgi_year - activity_sets: # Update USGS year for these activity_sets - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets - lead: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead - attribution_source: - USGS_MYB_Lead: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead - year: 2019 # latest year available - "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 - year: *ghgi_year - "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 - year: *ghgi_year - "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 - year: *ghgi_year - "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 - year: *ghgi_year - "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 - year: *ghgi_year - "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 - year: *ghgi_year - "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 - year: *ghgi_year - "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 - year: *ghgi_year - "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 - year: *ghgi_year - "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 - year: *ghgi_year - "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 - year: *ghgi_year - "EPA_GHGI_T_3_13": #CO2 from mobile combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 - year: *ghgi_year - "EPA_GHGI_T_3_14": #CH4 from mobile combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 - year: *ghgi_year - "EPA_GHGI_T_3_15": #N2O from mobile combustion duplicates method for CH4 - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_15 - year: *ghgi_year - "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 - year: *ghgi_year - "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 - year: *ghgi_year - "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 - year: *ghgi_year - "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 - year: *ghgi_year - "EPA_GHGI_T_A_97": # HFCs from Transportation - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 - year: *ghgi_year - "EPA_GHGI_T_4_80": # PFCs from aluminum production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 - year: *ghgi_year - "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_86 - year: *ghgi_year - "EPA_GHGI_T_3_22": #Fossil fuel for non-energy uses - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions - year: *ghgi_year - activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets - petroleum: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum:attribution_source:EIA_MECS_Energy - year: *mecs_year - natural_gas: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas:attribution_source:EIA_MECS_Energy - year: *mecs_year - -## Major CO2 Sources - "EPA_GHGI_T_A_5": # CO2 emissions from stationary combustion. This table number varies by GHG year. - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion - year: *ghgi_year - clean_parameter: *industrial_dict - activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets - coal_manufacturing_co2: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy - year: *mecs_year - natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - - - "EPA_GHGI_T_3_8": # CH4 emissions from stationary combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 - year: *ghgi_year - clean_parameter: *industrial_dict - activity_sets: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - ng_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - - "EPA_GHGI_T_3_9": # N2O emissions from stationary combustion - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9 - year: *ghgi_year - clean_parameter: *industrial_dict - activity_sets: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets - coal_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year - ng_manufacturing: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing - attribution_source: - EIA_MECS_Energy: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_9:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml index 683f3f74f..e29f4dea5 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml @@ -1,10 +1,10 @@ -# This is a 2020 target year specific implementation of GHG_national_m2 +# This is a 2020 target year specific implementation of GHG_national_m1 # This is a Summary level model # All parameters add year specific data when needed to implement for 2019 # GHGI FBA table names match the 2022 GHGI Report # MECS year is 2018 -!include:GHG_national_m2_common.yaml +!include:GHG_national_m1_common.yaml ghgi_year: &ghgi_year 2020 mecs_year: &mecs_year 2018 @@ -15,216 +15,216 @@ _industrial_allocation_dict: &industrial_dict source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_68 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_70 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 year: *ghgi_year "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_72 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 year: *ghgi_year "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_42 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 year: *ghgi_year "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_44 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 year: *ghgi_year "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_46 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 year: *ghgi_year "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_28 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 year: *ghgi_year "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_3 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 year: *ghgi_year "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_6 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 year: *ghgi_year "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_17 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 year: *ghgi_year "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_18 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 year: *ghgi_year "EPA_GHGI_T_3_13": #CO2 from mobile combustion - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_13 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 year: *ghgi_year activity_sets: # Update BEA year for some activity_sets - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets petroleum_fuels: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:BEA_Summary_Use_PRO_BeforeRedef year: *ghgi_year "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 year: *ghgi_year activity_sets: # Update BEA year for some activity_sets - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets petroleum_fuels_diesel: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:BEA_Summary_Use_PRO_BeforeRedef year: *ghgi_year petroleum_fuels_gasoline: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:BEA_Summary_Use_PRO_BeforeRedef year: *ghgi_year construction_and_mining: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:BEA_Summary_Use_PRO_BeforeRedef year: *ghgi_year farm_non_road: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef year: *ghgi_year other_non_road: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef year: *ghgi_year alt_fuel_on_road: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef year: *ghgi_year "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_46 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 year: *ghgi_year "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_50 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 year: *ghgi_year "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_96 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 year: *ghgi_year "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 year: *ghgi_year "EPA_GHGI_T_A_97": # HFCs from Transportation - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_A_97 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 year: *ghgi_year "EPA_GHGI_T_4_80": # PFCs from aluminum production - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_80 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 year: *ghgi_year "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_86 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_86 year: *ghgi_year "EPA_GHGI_T_3_22": #Fossil fuel for non-energy uses - !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions year: *ghgi_year activity_sets: # Update EIA_MECS year for some activity_sets - !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets petroleum_neu: - !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu attribution_source: EIA_MECS_Energy: - !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy year: *mecs_year natural_gas_neu: - !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu attribution_source: EIA_MECS_Energy: - !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy year: *mecs_year transportation_lubricants: - !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:BEA_Summary_Use_PRO_BeforeRedef year: *ghgi_year ### Major CO2 Sources "EPA_GHGI_T_A_5": # CO2 emissions from stationary combustion. This table number varies by GHG year. - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion year: *ghgi_year clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS and BEA year for some activity_sets - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets non_manufacturing_natural_gas: - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:BEA_Summary_Use_PRO_BeforeRedef year: *ghgi_year coal_manufacturing_co2: - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 attribution_source: EIA_MECS_Energy: - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing attribution_source: EIA_MECS_Energy: - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year petroleum: - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:BEA_Summary_Use_PRO_BeforeRedef year: *ghgi_year "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 year: *ghgi_year clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS and BEA year for some activity_sets - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets fuel_oil: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:BEA_Summary_Use_PRO_BeforeRedef year: *ghgi_year natural_gas_nonmanufacturing: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing attribution_source: BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:BEA_Summary_Use_PRO_BeforeRedef year: *ghgi_year coal_manufacturing: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing attribution_source: EIA_MECS_Energy: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year ng_manufacturing: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing attribution_source: EIA_MECS_Energy: - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year "EPA_GHGI_T_3_9": *T_3_8 # N2O emissions from stationary combustion diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml index 76f7d7e58..6d65d7806 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml @@ -1,75 +1,66 @@ -# This is the general method reference file +# This is the general method reference file for method 1 (Summary) # Year-specific GHG_national_m1 files import this file to define attribution rules # that are further customized -# m1 for the GHG national largely replicates the method used in the National GHG -# Industry Attribution Model (v1) (https://doi.org/10.23719/1517571), except that -# sector attribution is to 6-digit NAICS, rather than the BEA 2012 IO schema -# Allocation source years for BEA Use/Make and Census of Ag (CoA) are currently fixed at 2012 and 2017, respectively -# other allocation source years including MECS is not defined here -industry_spec: - default: NAICS_6 -year: &ghgi_year 2016 +# m1 for the GHG national utilizes a summary level sector attribution + + +!include:USEEIO_summary_target.yaml +year: &ghg_year 2016 target_naics_year: 2012 geoscale: national -attribution_sources: - _BEA: &bea +_mecs_year: &mecs_year 2018 + +_attribution_sources: + BEA: &bea_summary + year: *ghg_year + activity_to_sector_mapping: BEA_2012_Summary + # selection_fields: + # ActivityProducedBy: {'324': ''} # Petroleum 324110 + exclusion_fields: # Avoid unnecessary warnings about not being mapped to sectors + ActivityConsumedBy: ['F030', 'F040', 'F050', 'F051', + 'F02E', 'F06E', 'F07E', 'F10E', + 'Total Commodity Output', + 'Total Final Uses (GDP)', + 'Total Intermediate'] + ActivityProducedBy: ['Total Commodity Output'] + attribution_method: equal + ## No attribution supplied (will use equal) because target level for + ## modeling is BEA summary level. + + BEA_detail: &bea_detail year: 2012 activity_to_sector_mapping: BEA_2012_Detail - exclusion_fields: - # Drop irrelevant final demand and total sectors + # selection_fields: + # ActivityProducedBy: {'324': ''} # Petroleum 324110 + exclusion_fields: # Avoid unnecessary warnings about not being mapped to sectors ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', 'F06E00', 'F07E00', 'F10E00', 'T001', 'T004', 'T007'] ActivityProducedBy: ['T007'] attribution_method: equal - _mecs_energy: - EIA_MECS_Energy: &mecs_energy - # year: *mecs_year # override this with mecs year - selection_fields: &mecs_energy_default_selection - Class: Energy # or Other (for non-energy use) - Unit: Trillion Btu - # FlowName: Coal # override this - Location: '00000' - Description: - - Table 2.2 # applies to Class Other - - Table 3.2 # applies to Class Energy - exclusion_fields: - ActivityConsumedBy: '31-33' - estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy - attribution_method: proportional - # attribution_source: # Include in main method - # BEA_Detail_Use_PRO_BeforeRedef: - # <<: *bea - # selection_fields: - # ActivityProducedBy: {'XXXXX': ''} - - _cropland_allocation: &cropland_allocation - USDA_CoA_Cropland: - year: 2017 - selection_fields: - Class: Land - FlowName: - - AREA HARVESTED - - AREA BEARING & NON-BEARING # Orchards - - AREA GROWN # Berry totals - attribution_method: proportional - attribution_source: - USDA_CoA_Cropland_NAICS: - year: 2017 - selection_fields: - Class: Land - FlowName: AG LAND, CROPLAND, HARVESTED - estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution - - _animal_land_allocation: &animal_land_allocation - USDA_CoA_Cropland_NAICS: - year: 2017 - selection_fields: - Class: Land - FlowName: FARM OPERATIONS - estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution + + EIA_MECS_Energy: &mecs_energy + year: *mecs_year + selection_fields: &mecs_energy_default_selection + Class: Energy # or Other (for non-energy use) + Unit: Trillion Btu + # FlowName: Coal # override this + Location: '00000' + Description: + - Table 2.2 # applies to Class Other + - Table 3.2 # applies to Class Energy + exclusion_fields: + ActivityConsumedBy: '31-33' + estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy + # attribution_method: proportional + # attribution_source: # Include in main method + # BEA_Summary_Use_PRO_BeforeRedef: + # <<: *bea_summary + # selection_fields: + # ActivityProducedBy: {'XXXXX': ''} + source_names: EPA_GHGI_T_2_1: #U.S. GHG emissions @@ -126,13 +117,8 @@ source_names: liming: selection_fields: - PrimaryActivity: Liming #CO2 - attribution_method: proportional - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'327400': ''} # Lime + PrimaryActivity: Liming #CO2 + attribution_method: equal urea: selection_fields: @@ -141,20 +127,14 @@ source_names: attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + <<: *bea_detail selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + ActivityProducedBy: {'325310': ''} # Chemicals (325310) urea_fertilizer: selection_fields: - PrimaryActivity: - - Urea Fertilization #CO2 - attribution_method: proportional - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + PrimaryActivity: Urea Fertilization #CO2 + attribution_method: equal carbonate_use: selection_fields: @@ -169,14 +149,7 @@ source_names: lead: selection_fields: PrimaryActivity: Lead Production #CO2 - attribution_method: proportional - attribution_source: - USGS_MYB_Lead: - # year: 2016 Override with appropriate year - selection_fields: - ActivityProducedBy: - - Primary lead, refined content, domestic ores and base bullion - - Secondary lead, lead content + attribution_method: direct nitrous_oxide_use: selection_fields: @@ -188,6 +161,7 @@ source_names: selection_fields: ActivityProducedBy: {'325120': ''} # Industrial gases + ## Fossil Fuels EPA_GHGI_T_3_68: &natgas #CH4 from Natural Gas Systems # year: # override this @@ -253,46 +227,43 @@ source_names: # year: # override this fedefl_mapping: GHGI activity_sets: - fertilizer_use: &fertilizer # allocated based on fertilizer use + fertilizer_use: selection_fields: PrimaryActivity: - Organic Amendment Cropland - Residue N Cropland - Synthetic Fertilizer Cropland - attribution_method: proportional - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + attribution_method: direct - cropland: # allocated based on USDA land area harvested + cropland: selection_fields: PrimaryActivity: - Mineralization and Asymbiotic Fixation Cropland - Drained Organic Soils Cropland - attribution_method: proportional - attribution_source: *cropland_allocation + attribution_method: direct - pasture: &pasture # allocated based on USDA Animal operation land (acres) + pasture: &pasture selection_fields: PrimaryActivity: - All activities Grassland - attribution_method: proportional - attribution_source: *animal_land_allocation + attribution_method: equal + EPA_GHGI_T_5_18: #Indirect N2O emissions from agricultural soils # year: # override this fedefl_mapping: GHGI activity_sets: - fertilizer_use: # allocated based on fertilizer use - <<: *fertilizer + fertilizer_use: selection_fields: PrimaryActivity: - Volatilization & Atm. Deposition Cropland - Surface Leaching & Run-Off Cropland - pasture: # allocated based on USDA Animal operation land (acres) - <<: *pasture + attribution_method: direct + pasture: + selection_fields: + PrimaryActivity: + - All activities Grassland + attribution_method: equal ## Mobile Sources @@ -319,6 +290,7 @@ source_names: Light-Duty Trucks LPG: Light-Duty Trucks - Households Passenger Cars LPG: Passenger Cars - Households attribution_method: direct + direct_ng: selection_fields: PrimaryActivity: @@ -336,10 +308,10 @@ source_names: Light-Duty Trucks Gasoline: Light-Duty Trucks attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea_summary selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion @@ -352,13 +324,6 @@ source_names: Medium- and Heavy-Duty Trucks and Buses Gasoline On-Road: Medium- and Heavy-Duty Trucks and Buses attribution_method: direct - # This activity is only in older FBAs - # direct_diesel: - # selection_fields: - # PrimaryActivity: - # Medium- and Heavy-Duty Trucks and Buses Diesel On-Road: Medium- and Heavy-Duty Trucks and Buses - # attribution_method: direct - direct_non_road: selection_fields: PrimaryActivity: @@ -376,10 +341,10 @@ source_names: Medium- and Heavy-Duty Trucks Diesel On-Road: Medium- and Heavy-Duty Trucks - Distillate Fuel Oil attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea_summary selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) petroleum_fuels_gasoline: selection_fields: @@ -388,40 +353,40 @@ source_names: Light-Duty Trucks Gasoline On-Road: Light-Duty Trucks attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea_summary selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) construction_and_mining: #this set is allocated by purchases of construction equipment selection_fields: PrimaryActivity: Construction/Mining Equipment Non-Road attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea_summary selection_fields: - ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment + ActivityProducedBy: {'333': ''} # purchases of construction/mining equipment (333120) farm_non_road: #this set is allocated by purchases of farm machinery selection_fields: PrimaryActivity: Agricultural Equipment Non-Road attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea_summary selection_fields: - ActivityProducedBy: {'333111': ''} # purchases of farm machinery + ActivityProducedBy: {'333': ''} # purchases of farm machinery (333111) other_non_road: #this set is allocated by purchases of petroleum refining selection_fields: PrimaryActivity: Other Non-Road attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea_summary selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) alt_fuel_on_road: #this set is allocated by purchases of natural gas selection_fields: @@ -429,10 +394,10 @@ source_names: All activities Alternative Fuel On-Road: Alternative Fuel On-Road attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea_summary selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + ActivityProducedBy: {'22': ''} # purchases of natural gas (221200) EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 @@ -442,10 +407,10 @@ source_names: fedefl_mapping: GHGI # year: # override this clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion - # clean_parameter: # Override each year for use in allocate_industrial_combustion - # energy_fba: 'EIA_MECS_Energy' - # year: 2018 - # ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table + clean_parameter: # Override each year for use in allocate_industrial_combustion + energy_fba: 'EIA_MECS_Energy' + year: *mecs_year + ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table activity_sets: direct_attribution: #direct allocation selection_fields: @@ -471,10 +436,10 @@ source_names: - Natural Gas Industrial attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea_summary selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + ActivityProducedBy: {'22': ''} # purchases of natural gas (221200) coal_manufacturing_co2: # Industrial Coal for Manufacturing selection_fields: @@ -489,11 +454,11 @@ source_names: FlowName: - Coal - Coke and Breeze - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + # attribution_source: TODO do we need attribution of MECS data? + # BEA_Summary_Use_PRO_BeforeRedef: + # <<: *bea_summary + # selection_fields: + # ActivityProducedBy: {'212100': ''} # purchases of coal natural_gas_manufacturing: # Industrial Natural Gas for manufacturing selection_fields: @@ -506,11 +471,11 @@ source_names: selection_fields: <<: *mecs_energy_default_selection FlowName: Natural Gas - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + # attribution_source: + # BEA_Summary_Use_PRO_BeforeRedef: + # <<: *bea_summary + # selection_fields: + # ActivityProducedBy: {'221200': ''} # purchases of natural gas petroleum: # Petroleum selection_fields: @@ -519,19 +484,19 @@ source_names: - Total Petroleum Industrial attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea_summary selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion # year: #override this with ghgi_year clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion - # clean_parameter: # Override each year for use in allocate_industrial_combustion - # energy_fba: 'EIA_MECS_Energy' - # year: 2018 - # ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table + clean_parameter: # Override each year for use in allocate_industrial_combustion + energy_fba: 'EIA_MECS_Energy' + year: *mecs_year + ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table fedefl_mapping: GHGI activity_sets: residential: @@ -558,6 +523,7 @@ source_names: primary_action_type: Produced selection_fields: ActivityConsumedBy: {'221100': ''} # Electricity + fuel_oil: selection_fields: PrimaryActivity: @@ -565,10 +531,10 @@ source_names: - Fuel Oil Industrial attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea_summary selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) natural_gas_nonmanufacturing: # Commercial Natural gas selection_fields: @@ -579,10 +545,10 @@ source_names: Natural Gas Industrial: Natural Gas Industrial attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea_summary selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + ActivityProducedBy: {'22': ''} # purchases of natural gas (221200) coal_nonmanufacturing: selection_fields: @@ -604,11 +570,11 @@ source_names: selection_fields: <<: *mecs_energy_default_selection FlowName: Coal - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + # attribution_source: + # BEA_Summary_Use_PRO_BeforeRedef: + # <<: *bea_summary + # selection_fields: + # ActivityProducedBy: {'212100': ''} # purchases of coal ng_manufacturing: selection_fields: @@ -622,16 +588,15 @@ source_names: selection_fields: <<: *mecs_energy_default_selection FlowName: Natural Gas - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + # attribution_source: + # BEA_Summary_Use_PRO_BeforeRedef: + # <<: *bea_summary + # selection_fields: + # ActivityProducedBy: {'221200': ''} # purchases of natural gas #Intentionally left out 'Wood Commercial' and 'Wood Industrial' - EPA_GHGI_T_3_9: - <<: *stationary_combustion # N2O emissions from stationary combustion + EPA_GHGI_T_3_9: *stationary_combustion # N2O emissions from stationary combustion ## Other sources EPA_GHGI_T_4_46: #CO2 for selected petrochemicals @@ -658,7 +623,7 @@ source_names: - Industry Industrial Other Coal attribution_method: direct - petroleum: # consumed petroleum products + petroleum_neu: # consumed petroleum products selection_fields: PrimaryActivity: 'Industry Asphalt & Road Oil': Industry Petroleum Products Non-energy @@ -686,13 +651,13 @@ source_names: - Residual Fuel Oil - Distillate Fuel Oil - Hydrocarbon Gas Liquids, excluding natural gasoline - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refineries + # attribution_source: + # BEA_Summary_Use_PRO_BeforeRedef: + # <<: *bea_summary + # selection_fields: + # ActivityProducedBy: {'324110': ''} # purchases of refineries - natural_gas: # consumed nat gas to chemical plants + natural_gas_neu: # consumed nat gas to chemical plants selection_fields: PrimaryActivity: Industry Natural Gas to Chemical Plants attribution_method: proportional @@ -703,21 +668,21 @@ source_names: Class: Other FlowName: Natural Gas Unit: Trillion Btu - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + # attribution_source: + # BEA_Summary_Use_PRO_BeforeRedef: + # <<: *bea_summary + # selection_fields: + # ActivityProducedBy: {'221200': ''} # purchases of natural gas transportation_lubricants: selection_fields: PrimaryActivity: Transportation Lubricants attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + BEA_Summary_Use_PRO_BeforeRedef: + <<: *bea_summary selection_fields: - ActivityProducedBy: {'324110': ''} # use of petroleum products + ActivityProducedBy: {'324': ''} # use of petroleum products (324110) ## Other Emissions EPA_GHGI_T_4_50: # HFCs from HCFC-22 production @@ -786,9 +751,6 @@ source_names: '326140': '' # Polystyrene foam '326150': '' # Urethane and other foam - # 'Mobile Air Conditioning' and 'Transport Refrigeration' come from - # different table. - # Intentionally left out 'Solvents', 'Aerosols', 'Fire Protection' EPA_GHGI_T_A_97: # HFCs from Transportation # year: # override with ghgi_year @@ -810,6 +772,7 @@ source_names: Refrigerated Transport - Ships and Boats: Ships and Boats attribution_method: direct + EPA_GHGI_T_4_80: # PFCs from aluminum production # year: # override with ghgi_year fedefl_mapping: GHGI @@ -817,14 +780,10 @@ source_names: PrimaryActivity: Aluminum Production attribution_method: direct + EPA_GHGI_T_4_86: # HFCs, SF6, CO2 from magnesium production # year: # override with ghgi_year fedefl_mapping: GHGI selection_fields: PrimaryActivity: Magnesium Production and Processing - attribution_method: proportional - attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea - selection_fields: - ActivityConsumedBy: {T008: ''} # Total Output + attribution_method: direct diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml deleted file mode 100644 index e635c5978..000000000 --- a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml +++ /dev/null @@ -1,789 +0,0 @@ -# This is the general method reference file for method 2 (Summary) -# Year-specific GHG_national_m2 files import this file to define attribution rules -# that are further customized -# m2 for the GHG national utilizes a summary level sector attribution - - -!include:USEEIO_summary_target.yaml -year: &ghg_year 2016 -target_naics_year: 2012 -geoscale: national - -_mecs_year: &mecs_year 2018 - -_attribution_sources: - BEA: &bea_summary - year: *ghg_year - activity_to_sector_mapping: BEA_2012_Summary - # selection_fields: - # ActivityProducedBy: {'324': ''} # Petroleum 324110 - exclusion_fields: # Avoid unnecessary warnings about not being mapped to sectors - ActivityConsumedBy: ['F030', 'F040', 'F050', 'F051', - 'F02E', 'F06E', 'F07E', 'F10E', - 'Total Commodity Output', - 'Total Final Uses (GDP)', - 'Total Intermediate'] - ActivityProducedBy: ['Total Commodity Output'] - attribution_method: equal - ## No attribution supplied (will use equal) because target level for - ## modeling is BEA summary level. - - BEA_detail: &bea_detail - year: 2012 - activity_to_sector_mapping: BEA_2012_Detail - # selection_fields: - # ActivityProducedBy: {'324': ''} # Petroleum 324110 - exclusion_fields: # Avoid unnecessary warnings about not being mapped to sectors - ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', - 'F06E00', 'F07E00', 'F10E00', - 'T001', 'T004', 'T007'] - ActivityProducedBy: ['T007'] - attribution_method: equal - - - EIA_MECS_Energy: &mecs_energy - year: *mecs_year - selection_fields: &mecs_energy_default_selection - Class: Energy # or Other (for non-energy use) - Unit: Trillion Btu - # FlowName: Coal # override this - Location: '00000' - Description: - - Table 2.2 # applies to Class Other - - Table 3.2 # applies to Class Energy - exclusion_fields: - ActivityConsumedBy: '31-33' - estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy - # attribution_method: proportional - # attribution_source: # Include in main method - # BEA_Summary_Use_PRO_BeforeRedef: - # <<: *bea_summary - # selection_fields: - # ActivityProducedBy: {'XXXXX': ''} - - -source_names: - EPA_GHGI_T_2_1: #U.S. GHG emissions - # year: # override this - fedefl_mapping: GHGI - activity_sets: - direct: - selection_fields: - PrimaryActivity: - - Abandoned Oil and Gas Wells #CH4 - - Abandoned Underground Coal Mines #CH4 - - Adipic Acid Production #N2O - - Aluminum Production #CO2 - - Ammonia Production #CO2 - - Anaerobic Digestion at Biogas Facilities #CH4 new activity - - Caprolactam, Glyoxal, and Glyoxylic Acid Production #N2O - - Carbide Production and Consumption #CO2, CH4 - - Cement Production #CO2 - - Coal Mining #CO2, CH4 - - Composting #CH4, N2O - - Ferroalloy Production #CO2, CH4 - - Glass Production #CO2 - - Landfills #CH4 - - Lime Production #CO2 - - Incineration of Waste #CO2, #N2O - - Iron and Steel Production & Metallurgical Coke Production #CO2, CH4 - - Nitric Acid Production #N2O - - Phosphoric Acid Production #CO2 - - Rice Cultivation #CH4 - - Soda Ash Production #CO2 - - Titanium Dioxide Production #CO2 - - Wastewater Treatment #CH4, N2O - - Zinc Production #CO2 - FlowName: ["CO2", "CH4", "N2O"] # HFCs and other flows are pulled elsewhere - attribution_method: direct - - electricity_transmission: - selection_fields: - PrimaryActivity: Electrical Transmission and Distribution #SF6 - FlowName: SF6 - attribution_method: direct - - electric_power: - selection_fields: - PrimaryActivity: - Electric Power Sector: Electric Power #CO2 - attribution_method: proportional - attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea - primary_action_type: Produced - selection_fields: - ActivityConsumedBy: {'221100': ''} # Electricity - - liming: - selection_fields: - PrimaryActivity: Liming #CO2 - attribution_method: equal - - urea: - selection_fields: - PrimaryActivity: - - Urea Consumption for Non-Agricultural Purposes #CO2 - attribution_method: proportional - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea_detail - selection_fields: - ActivityProducedBy: {'325310': ''} # Chemicals (325310) - - urea_fertilizer: - selection_fields: - PrimaryActivity: Urea Fertilization #CO2 - attribution_method: equal - - carbonate_use: - selection_fields: - PrimaryActivity: Other Process Uses of Carbonates #CO2 - attribution_method: proportional - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals - - lead: - selection_fields: - PrimaryActivity: Lead Production #CO2 - attribution_method: direct - - nitrous_oxide_use: - selection_fields: - PrimaryActivity: N2O from Product Uses #N2O - attribution_method: proportional - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'325120': ''} # Industrial gases - - -## Fossil Fuels - EPA_GHGI_T_3_68: &natgas #CH4 from Natural Gas Systems - # year: # override this - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: - - Distribution - - Distribution - Post-Meter - - Exploration - - Processing - - Production - - Transmission and Storage - attribution_method: direct - EPA_GHGI_T_3_70: *natgas #CO2 from Natural Gas Systems mimics CH4 - EPA_GHGI_T_3_72: *natgas #N2O from Natural Gas Systems, not used in original method, mimics CH4 - - EPA_GHGI_T_3_42: &petroleum #CH4 from Petroleum Systems - # year: # override this - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: - - Crude Oil Transportation - - Transportation - - Exploration - - Production - - Refining - - Crude Refining - attribution_method: direct - EPA_GHGI_T_3_44: *petroleum #CO2 from Petroleum Systems mimics CH4 - EPA_GHGI_T_3_46: *petroleum #N2O from Petroleum Systems, not in prior method, mimics CH4 - -## Agriculture - EPA_GHGI_T_5_28: #CH4, N2O, CO and NOx from field burning of residues - # year: # override this - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: - - Chickpeas - - Cotton - - Maize - - Rice - - Soybeans - - Wheat - attribution_method: direct - EPA_GHGI_T_5_3: &animals #CH4 from Enteric Fermentation - # year: # override this - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: - - American Bison - - Beef Cattle - - Dairy Cattle - - Goats - - Horses - - Mules and Asses - - Sheep - - Swine - - Poultry - attribution_method: direct - EPA_GHGI_T_5_6: *animals #CH4 and N2O from manure, mimics enteric fermentation - - EPA_GHGI_T_5_17: #Direct N2O emissions from agricultural soils - # year: # override this - fedefl_mapping: GHGI - activity_sets: - fertilizer_use: - selection_fields: - PrimaryActivity: - - Organic Amendment Cropland - - Residue N Cropland - - Synthetic Fertilizer Cropland - attribution_method: direct - - cropland: - selection_fields: - PrimaryActivity: - - Mineralization and Asymbiotic Fixation Cropland - - Drained Organic Soils Cropland - attribution_method: direct - - pasture: &pasture - selection_fields: - PrimaryActivity: - - All activities Grassland - attribution_method: equal - - - EPA_GHGI_T_5_18: #Indirect N2O emissions from agricultural soils - # year: # override this - fedefl_mapping: GHGI - activity_sets: - fertilizer_use: - selection_fields: - PrimaryActivity: - - Volatilization & Atm. Deposition Cropland - - Surface Leaching & Run-Off Cropland - attribution_method: direct - pasture: - selection_fields: - PrimaryActivity: - - All activities Grassland - attribution_method: equal - - -## Mobile Sources - EPA_GHGI_T_3_13: #CO2 from mobile combustion - fedefl_mapping: GHGI - activity_sets: - direct_petroleum: - selection_fields: - PrimaryActivity: - General Aviation Aircraft Aviation Gasoline: General Aviation Aircraft - General Aviation Aircraft Jet Fuel: General Aviation Aircraft - Commercial Aircraft Jet Fuel: Commercial Aircraft - Military Aircraft Jet Fuel: Military Aircraft - Buses Gasoline: Buses - Buses LPG: Buses - Motorcycles Gasoline: Motorcycles - Rail Distillate Fuel Oil: Rail - Recreational Boats Distillate Fuel Oil: Recreational Boats - Recreational Boats Gasoline: Recreational Boats - Ships and Non-Recreational Boats Distillate Fuel Oil: Ships and Non-Recreational Boats - Ships and Non-Recreational Boats Residual Fuel Oil: Ships and Non-Recreational Boats - Medium- and Heavy-Duty Trucks Gasoline: Medium- and Heavy-Duty Trucks - Medium- and Heavy-Duty Trucks LPG: Medium- and Heavy-Duty Trucks - Light-Duty Trucks LPG: Light-Duty Trucks - Households - Passenger Cars LPG: Passenger Cars - Households - attribution_method: direct - - direct_ng: - selection_fields: - PrimaryActivity: - Buses Natural Gas: Buses - Pipeline Natural Gas: Pipeline Natural Gas - - petroleum_fuels: - selection_fields: - PrimaryActivity: - Medium- and Heavy-Duty Trucks Distillate Fuel Oil: Medium- and Heavy-Duty Trucks - Distillate Fuel Oil - Buses Distillate Fuel Oil: Buses - Distillate Fuel Oil - Passenger Cars Distillate Fuel Oil: Passenger Cars - Passenger Cars Gasoline: Passenger Cars - Light-Duty Trucks Distillate Fuel Oil: Light-Duty Trucks - Light-Duty Trucks Gasoline: Light-Duty Trucks - attribution_method: proportional - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea_summary - selection_fields: - ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) - - - EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion - fedefl_mapping: GHGI - activity_sets: - direct_gasoline: - selection_fields: - PrimaryActivity: - Motorcycles Gasoline On-Road: Motorcycles - Medium- and Heavy-Duty Trucks and Buses Gasoline On-Road: Medium- and Heavy-Duty Trucks and Buses - attribution_method: direct - - direct_non_road: - selection_fields: - PrimaryActivity: - Rail Non-Road: Rail - Ships and Boats Non-Road: Ships and Boats - Aircraft Non-Road: General Aviation Aircraft - attribution_method: direct - - petroleum_fuels_diesel: - selection_fields: - PrimaryActivity: - Passenger Cars Diesel On-Road: Passenger Cars - Light-Duty Trucks Diesel On-Road: Light-Duty Trucks - Medium- and Heavy-Duty Buses Diesel On-Road: Buses - Distillate Fuel Oil - Medium- and Heavy-Duty Trucks Diesel On-Road: Medium- and Heavy-Duty Trucks - Distillate Fuel Oil - attribution_method: proportional - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea_summary - selection_fields: - ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) - - petroleum_fuels_gasoline: - selection_fields: - PrimaryActivity: - Passenger Cars Gasoline On-Road: Passenger Cars - Light-Duty Trucks Gasoline On-Road: Light-Duty Trucks - attribution_method: proportional - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea_summary - selection_fields: - ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) - - construction_and_mining: #this set is allocated by purchases of construction equipment - selection_fields: - PrimaryActivity: Construction/Mining Equipment Non-Road - attribution_method: proportional - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea_summary - selection_fields: - ActivityProducedBy: {'333': ''} # purchases of construction/mining equipment (333120) - - farm_non_road: #this set is allocated by purchases of farm machinery - selection_fields: - PrimaryActivity: Agricultural Equipment Non-Road - attribution_method: proportional - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea_summary - selection_fields: - ActivityProducedBy: {'333': ''} # purchases of farm machinery (333111) - - other_non_road: #this set is allocated by purchases of petroleum refining - selection_fields: - PrimaryActivity: Other Non-Road - attribution_method: proportional - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea_summary - selection_fields: - ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) - - alt_fuel_on_road: #this set is allocated by purchases of natural gas - selection_fields: - PrimaryActivity: - All activities Alternative Fuel On-Road: Alternative Fuel On-Road - attribution_method: proportional - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea_summary - selection_fields: - ActivityProducedBy: {'22': ''} # purchases of natural gas (221200) - - EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 - - -## Stationary Combustion - GHGI_CO2_stationary_combustion: # CO2 emissions from stationary combustion - fedefl_mapping: GHGI - # year: # override this - clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion - clean_parameter: # Override each year for use in allocate_industrial_combustion - energy_fba: 'EIA_MECS_Energy' - year: *mecs_year - ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table - activity_sets: - direct_attribution: #direct allocation - selection_fields: - PrimaryActivity: Total (All Fuels) Residential - attribution_method: direct - - non_manufacturing_coal: - selection_fields: - PrimaryActivity: - Commercial Coal Commercial: Coal Commercial - Industrial Other Coal Industrial: Coal Industrial - attribution_method: proportional - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal - - non_manufacturing_natural_gas: # Applies to non-manufacturing sectors like ag and mining - selection_fields: - PrimaryActivity: - - Natural Gas Commercial - - Natural Gas Industrial - attribution_method: proportional - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea_summary - selection_fields: - ActivityProducedBy: {'22': ''} # purchases of natural gas (221200) - - coal_manufacturing_co2: # Industrial Coal for Manufacturing - selection_fields: - PrimaryActivity: - Industrial Other Coal Industrial - Manufacturing: Coal Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: - - Coal - - Coke and Breeze - # attribution_source: TODO do we need attribution of MECS data? - # BEA_Summary_Use_PRO_BeforeRedef: - # <<: *bea_summary - # selection_fields: - # ActivityProducedBy: {'212100': ''} # purchases of coal - - natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - selection_fields: - PrimaryActivity: - - Natural Gas Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Natural Gas - # attribution_source: - # BEA_Summary_Use_PRO_BeforeRedef: - # <<: *bea_summary - # selection_fields: - # ActivityProducedBy: {'221200': ''} # purchases of natural gas - - petroleum: # Petroleum - selection_fields: - PrimaryActivity: - - Total Petroleum Commercial - - Total Petroleum Industrial - attribution_method: proportional - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea_summary - selection_fields: - ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) - - - EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion - # year: #override this with ghgi_year - clean_fba_before_activity_sets: !script_function:EPA_GHGI allocate_industrial_combustion - clean_parameter: # Override each year for use in allocate_industrial_combustion - energy_fba: 'EIA_MECS_Energy' - year: *mecs_year - ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table - fedefl_mapping: GHGI - activity_sets: - residential: - selection_fields: - PrimaryActivity: - - Fuel Oil Residential - - Coal Residential - - Natural Gas Residential - - Wood Residential - attribution_method: direct - - electric_power: - selection_fields: - PrimaryActivity: - Coal Electric Power: Coal Electric Power - Natural Gas Electric Power: Natural Gas Electric Power - Natural gas Electric Power: Natural Gas Electric Power # fix capitalization - Fuel Oil Electric Power: Fuel Oil Electric Power - Wood Electric Power: Wood Electric Power - attribution_method: proportional - attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea - primary_action_type: Produced - selection_fields: - ActivityConsumedBy: {'221100': ''} # Electricity - - fuel_oil: - selection_fields: - PrimaryActivity: - - Fuel Oil Commercial - - Fuel Oil Industrial - attribution_method: proportional - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea_summary - selection_fields: - ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) - - natural_gas_nonmanufacturing: # Commercial Natural gas - selection_fields: - PrimaryActivity: - Natural gas Commercial: Natural Gas Commercial # fix capitalization - Natural gas Industrial: Natural Gas Industrial # fix capitalization - Natural Gas Commercial: Natural Gas Commercial - Natural Gas Industrial: Natural Gas Industrial - attribution_method: proportional - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea_summary - selection_fields: - ActivityProducedBy: {'22': ''} # purchases of natural gas (221200) - - coal_nonmanufacturing: - selection_fields: - PrimaryActivity: Coal Industrial - attribution_method: proportional - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal - - coal_manufacturing: - selection_fields: - PrimaryActivity: Coal Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Coal - # attribution_source: - # BEA_Summary_Use_PRO_BeforeRedef: - # <<: *bea_summary - # selection_fields: - # ActivityProducedBy: {'212100': ''} # purchases of coal - - ng_manufacturing: - selection_fields: - PrimaryActivity: - - Natural gas Industrial - Manufacturing - - Natural Gas Industrial - Manufacturing - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - <<: *mecs_energy_default_selection - FlowName: Natural Gas - # attribution_source: - # BEA_Summary_Use_PRO_BeforeRedef: - # <<: *bea_summary - # selection_fields: - # ActivityProducedBy: {'221200': ''} # purchases of natural gas - - #Intentionally left out 'Wood Commercial' and 'Wood Industrial' - - EPA_GHGI_T_3_9: *stationary_combustion # N2O emissions from stationary combustion - -## Other sources - EPA_GHGI_T_4_46: #CO2 for selected petrochemicals - # year: # override with ghgi_year - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: - - Acrylonitrile - - Carbon Black - - Ethylene - - Ethylene Dichloride - - Ethylene Oxide - - Methanol - attribution_method: direct - - GHGI_nonenergy_fossil_fuel_emissions: # Fossil fuel for non-energy uses - # year: #override with ghgi_year - fedefl_mapping: GHGI - activity_sets: - coal: - selection_fields: - PrimaryActivity: - - Industry Industrial Coking Coal - - Industry Industrial Other Coal - attribution_method: direct - - petroleum_neu: # consumed petroleum products - selection_fields: - PrimaryActivity: - 'Industry Asphalt & Road Oil': Industry Petroleum Products Non-energy - Industry Distillate Fuel Oil: Industry Petroleum Products Non-energy - Industry LPG: Industry Petroleum Products Non-energy - Industry Lubricants: Industry Petroleum Products Non-energy - Industry Miscellaneous Products: Industry Petroleum Products Non-energy - 'Industry Naphtha (<401 F)': Industry Petroleum Products Non-energy - 'Industry Other Oil (>401 F)': Industry Petroleum Products Non-energy - Industry Pentanes Plus: Industry Petroleum Products Non-energy - Industry Petroleum Coke: Industry Petroleum Products Non-energy - Industry Special Naphtha: Industry Petroleum Products Non-energy - Industry Still Gas: Industry Petroleum Products Non-energy - Industry Waxes: Industry Petroleum Products Non-energy - Industry Natural Gasoline: Industry Petroleum Products Non-energy #T_3_22. Also produced by nat gas plants - Industry HGL: Industry Petroleum Products Non-energy #T_3_22. Also produced by nat gas plants - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - Unit: Trillion Btu - FlowName: - - Residual Fuel Oil - - Distillate Fuel Oil - - Hydrocarbon Gas Liquids, excluding natural gasoline - # attribution_source: - # BEA_Summary_Use_PRO_BeforeRedef: - # <<: *bea_summary - # selection_fields: - # ActivityProducedBy: {'324110': ''} # purchases of refineries - - natural_gas_neu: # consumed nat gas to chemical plants - selection_fields: - PrimaryActivity: Industry Natural Gas to Chemical Plants - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - <<: *mecs_energy - selection_fields: - Class: Other - FlowName: Natural Gas - Unit: Trillion Btu - # attribution_source: - # BEA_Summary_Use_PRO_BeforeRedef: - # <<: *bea_summary - # selection_fields: - # ActivityProducedBy: {'221200': ''} # purchases of natural gas - - transportation_lubricants: - selection_fields: - PrimaryActivity: Transportation Lubricants - attribution_method: proportional - attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea_summary - selection_fields: - ActivityProducedBy: {'324': ''} # use of petroleum products (324110) - -## Other Emissions - EPA_GHGI_T_4_50: # HFCs from HCFC-22 production - # year: # override with ghgi_year - fedefl_mapping: GHGI - selection_fields: - Unit: MMT CO2e # drop records in kt - PrimaryActivity: HCFC-22 Production - attribution_method: direct - - EPA_GHGI_T_4_96: # HFCs and other emissions from electronics manufacture - # year: # override with ghgi_year - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: Electronics Production - attribution_method: direct - - EPA_GHGI_T_4_102: # HFCs and PFCs from ODS Substitutes - clean_fba_before_activity_sets: !script_function:EPA_GHGI split_HFCs_by_type - clean_parameter: - # Proportions of specific HFCs are assigned based on national total - flow_fba: EPA_GHGI_T_4_100 - # year: # override with ghgi_year - fedefl_mapping: GHGI - activity_sets: - households: - selection_fields: - PrimaryActivity: - - Domestic Refrigeration - - Residential Stationary Air Conditioning - attribution_method: direct - - refrigerants: - selection_fields: - PrimaryActivity: - - Commercial Refrigeration - - Industrial Process Refrigeration - attribution_method: proportional - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'333415': ''} # Air conditioning equipment - - air_conditioning: - selection_fields: - PrimaryActivity: - - Commercial Stationary Air Conditioning - attribution_method: proportional - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'333415': ''} # Air conditioning equipment - - foams: - selection_fields: - PrimaryActivity: - - Foams - attribution_method: proportional - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: - '326140': '' # Polystyrene foam - '326150': '' # Urethane and other foam - - - EPA_GHGI_T_A_97: # HFCs from Transportation - # year: # override with ghgi_year - clean_fba_before_mapping: !script_function:EPA_GHGI split_HFCs_by_type - clean_parameter: - # Proportions of specific HFCs are assigned based on national total - flow_fba: EPA_GHGI_T_4_100 - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: - Mobile AC - Passenger Cars: Passenger Cars - Households - Mobile AC - Light-Duty Trucks: Light-Duty Trucks - Households - Mobile AC - Heavy-Duty Vehicles: Heavy-Duty Vehicles - Comfort Cooling for Trains and Buses - School and Tour Buses: School and Tour Buses - # Comfort Cooling for Trains and Buses - Transit Buses: Transit Buses #excluded - Comfort Cooling for Trains and Buses - Rail: Rail - Refrigerated Transport - Medium- and Heavy-Duty Trucks: Medium- and Heavy-Duty Trucks - Refrigerated Transport - Rail: Rail - Refrigerated Transport - Ships and Boats: Ships and Boats - attribution_method: direct - - - EPA_GHGI_T_4_80: # PFCs from aluminum production - # year: # override with ghgi_year - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: Aluminum Production - attribution_method: direct - - - EPA_GHGI_T_4_86: # HFCs, SF6, CO2 from magnesium production - # year: # override with ghgi_year - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: Magnesium Production and Processing - attribution_method: direct From 2c5af5a2ace459ea84c4e6e50c1c1353ba5179c5 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 20 Sep 2023 09:09:26 -0400 Subject: [PATCH 0983/1127] m3 (detail model built from summary) becomes m2 --- ...2019_m3.yaml => GHG_national_2019_m2.yaml} | 80 +++++++++---------- ...ommon.yaml => GHG_national_m2_common.yaml} | 60 ++++++++------ 2 files changed, 75 insertions(+), 65 deletions(-) rename flowsa/methods/flowbysectormethods/{GHG_national_2019_m3.yaml => GHG_national_2019_m2.yaml} (51%) rename flowsa/methods/flowbysectormethods/{GHG_national_m3_common.yaml => GHG_national_m2_common.yaml} (93%) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2019_m3.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml similarity index 51% rename from flowsa/methods/flowbysectormethods/GHG_national_2019_m3.yaml rename to flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml index 3a533038b..264ac66df 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2019_m3.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml @@ -1,145 +1,145 @@ -# This is a 2019 target year specific implementation of GHG_national_m3 +# This is a 2019 target year specific implementation of GHG_national_m2 # All parameters add year specific data when needed to implement for 2019 # GHGI FBA table names match the 2022 GHGI Report # MECS year is 2018 # CoA year is 2017 -!include:GHG_national_m3_common.yaml +!include:GHG_national_m2_common.yaml ghgi_year: &ghgi_year 2019 mecs_year: &mecs_year 2018 source_names: - GHG_national_2019_m2: # National Summary model - !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2 + GHG_national_2019_m1: # National Summary model + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1 year: *ghgi_year activity_sets: # Update MECS year for some activity sets - !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets coal_manufacturing_co2: # Industrial Coal for Manufacturing - !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets:coal_manufacturing_co2 + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 attribution_source: EIA_MECS_Energy: - !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy year: *mecs_year natural_gas_manufacturing: # Industrial Natural Gas for manufacturing - !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets:natural_gas_manufacturing + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing attribution_source: EIA_MECS_Energy: - !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year coal_manufacturing: - !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets:coal_manufacturing + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing attribution_source: EIA_MECS_Energy: - !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year ng_manufacturing: - !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets:ng_manufacturing + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing attribution_source: EIA_MECS_Energy: - !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year petroleum_neu: # consumed petroleum products - !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets:petroleum_neu + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu attribution_source: EIA_MECS_Energy: - !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy year: *mecs_year natural_gas_neu: # consumed nat gas to chemical plants - !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets:natural_gas_neu + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu attribution_source: EIA_MECS_Energy: - !include:GHG_national_m3_common.yaml:source_names:GHG_national_m2:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy year: *mecs_year EPA_GHGI_T_2_1: #U.S. GHG emissions - !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_2_1 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year EPA_GHGI_T_3_68: #CH4 from Natural Gas Systems - !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_3_68 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year EPA_GHGI_T_3_70: #CO2 from Natural Gas Systems mimics CH4 - !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_3_70 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_70 year: *ghgi_year EPA_GHGI_T_3_72: #N2O from Natural Gas Systems, not used in original method, mimics CH4 - !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_3_72 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_72 year: *ghgi_year EPA_GHGI_T_3_42: #CH4 from Petroleum Systems - !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_3_42 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_42 year: *ghgi_year EPA_GHGI_T_3_44: #CO2 from Petroleum Systems mimics CH4 - !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_3_44 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_44 year: *ghgi_year EPA_GHGI_T_3_46: #N2O from Petroleum Systems, not in prior method, mimics CH4 - !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_3_46 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_46 year: *ghgi_year ## Agriculture EPA_GHGI_T_5_28: #CH4, N2O, CO and NOx from field burning of residues - !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_5_28 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_28 year: *ghgi_year EPA_GHGI_T_5_3: #CH4 from Enteric Fermentation - !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_5_3 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_3 year: *ghgi_year EPA_GHGI_T_5_6: #CH4 and N2O from manure, mimics enteric fermentation - !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_5_6 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_6 year: *ghgi_year ## Mobile Sources EPA_GHGI_T_3_13: #CO2 from mobile combustion - !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_3_13 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_13 year: *ghgi_year EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion - !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_3_14 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14 year: *ghgi_year EPA_GHGI_T_3_15: #N2O from mobile combustion duplicates method for CH4 - !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_3_15 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_15 year: *ghgi_year ## Stationary Combustion EPA_GHGI_T_A_6: - !include:GHG_national_m3_common.yaml:source_names:GHGI_CO2_stationary_combustion + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion year: *ghgi_year EPA_GHGI_T_3_8: # CH4 emissions from stationary combustion - !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_3_8 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8 year: *ghgi_year EPA_GHGI_T_3_9: # N2O emissions from stationary combustion - !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_3_9 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_9 year: *ghgi_year ## Other sources EPA_GHGI_T_4_46: #CO2 for selected petrochemicals - !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_4_46 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_46 year: *ghgi_year EPA_GHGI_T_3_22b: # Fossil fuel for non-energy uses - !include:GHG_national_m3_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions year: *ghgi_year ## Other Emissions EPA_GHGI_T_4_50: # HFCs from HCFC-22 production - !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_4_50 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_50 year: *ghgi_year EPA_GHGI_T_4_96: # HFCs and other emissions from electronics manufacture - !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_4_96 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_96 year: *ghgi_year EPA_GHGI_T_4_102: # HFCs and PFCs from ODS Substitutes - !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_4_102 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102 year: *ghgi_year EPA_GHGI_T_A_97: # HFCs from Transportation - !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_A_97 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_A_97 year: *ghgi_year EPA_GHGI_T_4_80: # PFCs from aluminum production - !include:GHG_national_m3_common.yaml:source_names:EPA_GHGI_T_4_80 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_80 year: *ghgi_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m3_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml similarity index 93% rename from flowsa/methods/flowbysectormethods/GHG_national_m3_common.yaml rename to flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml index 693e21d33..17447ca61 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m3_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml @@ -1,9 +1,9 @@ -# This is the general method reference file for method 3 (Detail) -# Year-specific GHG_national_m3 files import this file to define attribution rules +# This is the general method reference file for method 2 (Detail) +# Year-specific GHG_national_m2 files import this file to define attribution rules # that are further customized -# m3 for the GHG national utilizes a full 6-digit NAICS attribution based on -# the exisiting summary level national FBS (method 2), except where Direct attribution -# is available at the detail level and uses method 1 +# m2 for the GHG national utilizes a full 6-digit NAICS attribution based on +# the exisiting summary level national FBS (method 1), except where Direct attribution +# is available at the detail level and uses the GHGI as the primary source industry_spec: default: NAICS_6 @@ -71,7 +71,7 @@ attribution_sources: estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution source_names: - GHG_national_m2: # National Summary model + GHG_national_m1: # National Summary model data_format: FBS # year: *ghgi_year activity_sets: @@ -509,7 +509,7 @@ source_names: ActivityConsumedBy: {T008: ''} # Total Output - +## For tables requiring direct attribution, reattribute the original GHGI EPA_GHGI_T_2_1: #U.S. GHG emissions # year: # override this fedefl_mapping: GHGI @@ -520,31 +520,41 @@ source_names: electricity_transmission: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electricity_transmission + # replace equal attribution in summary model liming: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming - # selection_fields: - # PrimaryActivity: Liming #CO2 - # attribution_method: proportional - # attribution_source: - # BEA_Detail_Use_PRO_BeforeRedef: - # <<: *bea - # selection_fields: - # ActivityProducedBy: {'327400': ''} # Lime + selection_fields: + PrimaryActivity: Liming #CO2 + attribution_method: proportional + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'327400': ''} # Lime + # replace equal attribution in summary model urea_fertilizer: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer - selection_fields: # Only uses one activity from this activity_set + selection_fields: PrimaryActivity: - Urea Fertilization #CO2 - # attribution_method: proportional - # attribution_source: - # BEA_Detail_Use_PRO_BeforeRedef: - # <<: *bea - # selection_fields: - # ActivityProducedBy: {'325310': ''} # Fertilizers + attribution_method: proportional + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + # replace equal attribution in summary model lead: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead + selection_fields: + PrimaryActivity: Lead Production #CO2 + attribution_method: proportional + attribution_source: + USGS_MYB_Lead: + # year: 2016 Override with appropriate year + selection_fields: + ActivityProducedBy: + - Primary lead, refined content, domestic ores and base bullion + - Secondary lead, lead content ## Fossil Fuels From 8b1feca98df8dfe9043a4df45b4de5da1f86afce Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 20 Sep 2023 09:10:56 -0400 Subject: [PATCH 0984/1127] rename 2020 m1 method --- .../{GHG_national_2020_m2.yaml => GHG_national_2020_m1.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename flowsa/methods/flowbysectormethods/{GHG_national_2020_m2.yaml => GHG_national_2020_m1.yaml} (100%) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml similarity index 100% rename from flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml rename to flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml From fb08a00d9b0d7ab8d43113394462714f54635092 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 20 Sep 2023 09:18:18 -0400 Subject: [PATCH 0985/1127] delete old m1 state (direct use of StateGHGI), m2 (based on national summary model) becomes m1 --- .../GHG_state_2012_m1.yaml | 184 ----- .../GHG_state_2013_m1.yaml | 184 ----- .../GHG_state_2014_m1.yaml | 184 ----- .../GHG_state_2015_m1.yaml | 184 ----- .../GHG_state_2016_m1.yaml | 171 ---- .../GHG_state_2017_m1.yaml | 171 ---- .../GHG_state_2018_m1.yaml | 171 ---- .../GHG_state_2019_m1.yaml | 170 +--- .../GHG_state_2019_m2.yaml | 21 - .../GHG_state_2020_m1.yaml | 170 +--- .../GHG_state_2020_m2.yaml | 21 - .../GHG_state_m1_common.yaml | 769 ++++++++++-------- .../GHG_state_m2_common.yaml | 576 ------------- 13 files changed, 452 insertions(+), 2524 deletions(-) delete mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2012_m1.yaml delete mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2013_m1.yaml delete mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2014_m1.yaml delete mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2015_m1.yaml delete mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2016_m1.yaml delete mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2017_m1.yaml delete mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2018_m1.yaml delete mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml delete mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2020_m2.yaml delete mode 100644 flowsa/methods/flowbysectormethods/GHG_state_m2_common.yaml diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2012_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2012_m1.yaml deleted file mode 100644 index bd7e3994b..000000000 --- a/flowsa/methods/flowbysectormethods/GHG_state_2012_m1.yaml +++ /dev/null @@ -1,184 +0,0 @@ -## GHG emissions by state from EPA disaggregated inventories - -!include:USEEIO_summary_target.yaml -year: &ghg_year 2012 -coa_year: &coa_year 2012 -geoscale: state - -sources_to_cache: - EIA_MECS_Energy: - !include:GHG_state_m1_common.yaml:sources_to_cache:EIA_MECS_Energy - year: 2014 - attribution_source: - Employment_state_2014: # Update to MECS year - geoscale: national - year: 2014 - clean_source: Employment_state_2014 - -source_names: - EPA_StateGHGI: # U.S. GHG emissions by state - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI - year: *ghg_year - clean_parameter: # Override each year for use in allocate_industrial_combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:clean_parameter - year: 2014 - ghg_fba: EPA_GHGI_T_A_11 # 2014 Table - activity_sets: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets - - ## List these activity sets separately to access the correct use table year - electric_power: # electricity combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_power - attribution_source: - stateio_Make_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityConsumedBy: {'22': ''} # utilities - - electric_ch4_n2o: # electricity combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_ch4_n2o - attribution_source: - stateio_Make_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityConsumedBy: {'22': ''} # utilities - - use_table_coal: # commercial coal combustion, non-manufacturing industrial - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - - use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - use_table_gas: # commercial gas combustion, non-manufacturing industrial - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'22': ''} # Electricity and natural gas - - commercial_ch4_n2o: # CH4 and N2O from commercial combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o - activity_sets: - coal: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - petroleum: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - gas: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'22': ''} # Electricity and natural gas - - carbonate_use: # other process use of carbonates - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:carbonate_use - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'325': ''} # Use of chemicals - - nitrous_oxide_use: # N2O from Product uses - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:nitrous_oxide_use - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'325': ''} # Use of chemicals - - urea: # emissions from urea fertilization - # allocated between crops and animals based on USDA land area - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:urea - attribution_source: - USDA_CoA_Cropland_NAICS: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:urea:attribution_source:USDA_CoA_Cropland_NAICS - year: *coa_year - - transport_petroleum: # C02 from petroleum highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - transport_nonroad_CH4: # CH4 from petroleum non-highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - exclusion_fields: - ActivityConsumedBy: ['481', # Exclude airlines - 'F030', 'F040', 'F050'] # Plus other sectors excluded above - - transport_nonroad_N2O: # N2O from petroleum non-highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - transport_nonroad_ag: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_ag - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Machinery - - transport_nonroad_construction: # CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_construction - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Machinery - - ods_substitutes: # CO2e from ODS substitutes - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2013_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2013_m1.yaml deleted file mode 100644 index 1d7fd83f1..000000000 --- a/flowsa/methods/flowbysectormethods/GHG_state_2013_m1.yaml +++ /dev/null @@ -1,184 +0,0 @@ -## GHG emissions by state from EPA disaggregated inventories - -!include:USEEIO_summary_target.yaml -year: &ghg_year 2013 -coa_year: &coa_year 2012 -geoscale: state - -sources_to_cache: - EIA_MECS_Energy: - !include:GHG_state_m1_common.yaml:sources_to_cache:EIA_MECS_Energy - year: 2014 - attribution_source: - Employment_state_2014: # Update to MECS year - geoscale: national - year: 2014 - clean_source: Employment_state_2014 - -source_names: - EPA_StateGHGI: # U.S. GHG emissions by state - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI - year: *ghg_year - clean_parameter: # Override each year for use in allocate_industrial_combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:clean_parameter - year: 2014 - ghg_fba: EPA_GHGI_T_A_11 # 2014 Table - activity_sets: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets - - ## List these activity sets separately to access the correct use table year - electric_power: # electricity combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_power - attribution_source: - stateio_Make_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityConsumedBy: {'22': ''} # utilities - - electric_ch4_n2o: # electricity combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_ch4_n2o - attribution_source: - stateio_Make_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityConsumedBy: {'22': ''} # utilities - - use_table_coal: # commercial coal combustion, non-manufacturing industrial - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - - use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - use_table_gas: # commercial gas combustion, non-manufacturing industrial - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'22': ''} # Electricity and natural gas - - commercial_ch4_n2o: # CH4 and N2O from commercial combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o - activity_sets: - coal: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - petroleum: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - gas: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'22': ''} # Electricity and natural gas - - carbonate_use: # other process use of carbonates - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:carbonate_use - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'325': ''} # Use of chemicals - - nitrous_oxide_use: # N2O from Product uses - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:nitrous_oxide_use - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'325': ''} # Use of chemicals - - urea: # emissions from urea fertilization - # allocated between crops and animals based on USDA land area - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:urea - attribution_source: - USDA_CoA_Cropland_NAICS: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:urea:attribution_source:USDA_CoA_Cropland_NAICS - year: *coa_year - - transport_petroleum: # C02 from petroleum highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - transport_nonroad_CH4: # CH4 from petroleum non-highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - exclusion_fields: - ActivityConsumedBy: ['481', # Exclude airlines - 'F030', 'F040', 'F050'] # Plus other sectors excluded above - - transport_nonroad_N2O: # N2O from petroleum non-highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - transport_nonroad_ag: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_ag - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Machinery - - transport_nonroad_construction: # CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_construction - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Machinery - - ods_substitutes: # CO2e from ODS substitutes - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2014_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2014_m1.yaml deleted file mode 100644 index ad95cdb51..000000000 --- a/flowsa/methods/flowbysectormethods/GHG_state_2014_m1.yaml +++ /dev/null @@ -1,184 +0,0 @@ -## GHG emissions by state from EPA disaggregated inventories - -!include:USEEIO_summary_target.yaml -year: &ghg_year 2014 -coa_year: &coa_year 2012 -geoscale: state - -sources_to_cache: - EIA_MECS_Energy: - !include:GHG_state_m1_common.yaml:sources_to_cache:EIA_MECS_Energy - year: 2014 - attribution_source: - Employment_state_2014: # Update to MECS year - geoscale: national - year: 2014 - clean_source: Employment_state_2014 - -source_names: - EPA_StateGHGI: # U.S. GHG emissions by state - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI - year: *ghg_year - clean_parameter: # Override each year for use in allocate_industrial_combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:clean_parameter - year: 2014 - ghg_fba: EPA_GHGI_T_A_11 # 2014 Table - activity_sets: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets - - ## List these activity sets separately to access the correct use table year - electric_power: # electricity combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_power - attribution_source: - stateio_Make_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityConsumedBy: {'22': ''} # utilities - - electric_ch4_n2o: # electricity combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_ch4_n2o - attribution_source: - stateio_Make_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityConsumedBy: {'22': ''} # utilities - - use_table_coal: # commercial coal combustion, non-manufacturing industrial - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - - use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - use_table_gas: # commercial gas combustion, non-manufacturing industrial - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'22': ''} # Electricity and natural gas - - commercial_ch4_n2o: # CH4 and N2O from commercial combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o - activity_sets: - coal: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - petroleum: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - gas: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'22': ''} # Electricity and natural gas - - carbonate_use: # other process use of carbonates - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:carbonate_use - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'325': ''} # Use of chemicals - - nitrous_oxide_use: # N2O from Product uses - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:nitrous_oxide_use - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'325': ''} # Use of chemicals - - urea: # emissions from urea fertilization - # allocated between crops and animals based on USDA land area - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:urea - attribution_source: - USDA_CoA_Cropland_NAICS: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:urea:attribution_source:USDA_CoA_Cropland_NAICS - year: *coa_year - - transport_petroleum: # C02 from petroleum highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - transport_nonroad_CH4: # CH4 from petroleum non-highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - exclusion_fields: - ActivityConsumedBy: ['481', # Exclude airlines - 'F030', 'F040', 'F050'] # Plus other sectors excluded above - - transport_nonroad_N2O: # N2O from petroleum non-highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - transport_nonroad_ag: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_ag - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Machinery - - transport_nonroad_construction: # CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_construction - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Machinery - - ods_substitutes: # CO2e from ODS substitutes - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2015_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2015_m1.yaml deleted file mode 100644 index 6300c3908..000000000 --- a/flowsa/methods/flowbysectormethods/GHG_state_2015_m1.yaml +++ /dev/null @@ -1,184 +0,0 @@ -## GHG emissions by state from EPA disaggregated inventories - -!include:USEEIO_summary_target.yaml -year: &ghg_year 2015 -coa_year: &coa_year 2012 -geoscale: state - -sources_to_cache: - EIA_MECS_Energy: - !include:GHG_state_m1_common.yaml:sources_to_cache:EIA_MECS_Energy - year: 2014 - attribution_source: - Employment_state_2014: # Update to MECS year - geoscale: national - year: 2014 - clean_source: Employment_state_2014 - -source_names: - EPA_StateGHGI: # U.S. GHG emissions by state - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI - year: *ghg_year - clean_parameter: # Override each year for use in allocate_industrial_combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:clean_parameter - year: 2014 - ghg_fba: EPA_GHGI_T_A_11 # 2014 Table - activity_sets: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets - - ## List these activity sets separately to access the correct use table year - electric_power: # electricity combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_power - attribution_source: - stateio_Make_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityConsumedBy: {'22': ''} # utilities - - electric_ch4_n2o: # electricity combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_ch4_n2o - attribution_source: - stateio_Make_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityConsumedBy: {'22': ''} # utilities - - use_table_coal: # commercial coal combustion, non-manufacturing industrial - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - - use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - use_table_gas: # commercial gas combustion, non-manufacturing industrial - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'22': ''} # Electricity and natural gas - - commercial_ch4_n2o: # CH4 and N2O from commercial combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o - activity_sets: - coal: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - petroleum: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - gas: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'22': ''} # Electricity and natural gas - - carbonate_use: # other process use of carbonates - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:carbonate_use - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'325': ''} # Use of chemicals - - nitrous_oxide_use: # N2O from Product uses - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:nitrous_oxide_use - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'325': ''} # Use of chemicals - - urea: # emissions from urea fertilization - # allocated between crops and animals based on USDA land area - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:urea - attribution_source: - USDA_CoA_Cropland_NAICS: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:urea:attribution_source:USDA_CoA_Cropland_NAICS - year: *coa_year - - transport_petroleum: # C02 from petroleum highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - transport_nonroad_CH4: # CH4 from petroleum non-highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - exclusion_fields: - ActivityConsumedBy: ['481', # Exclude airlines - 'F030', 'F040', 'F050'] # Plus other sectors excluded above - - transport_nonroad_N2O: # N2O from petroleum non-highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - transport_nonroad_ag: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_ag - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Machinery - - transport_nonroad_construction: # CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_construction - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Machinery - - ods_substitutes: # CO2e from ODS substitutes - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2016_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2016_m1.yaml deleted file mode 100644 index a0677493b..000000000 --- a/flowsa/methods/flowbysectormethods/GHG_state_2016_m1.yaml +++ /dev/null @@ -1,171 +0,0 @@ -## GHG emissions by state from EPA disaggregated inventories - -!include:USEEIO_summary_target.yaml -year: &ghg_year 2016 -geoscale: state - -sources_to_cache: - EIA_MECS_Energy: - !include:GHG_state_m1_common.yaml:sources_to_cache:EIA_MECS_Energy - year: 2018 - attribution_source: - Employment_state_2018: # Update to MECS year - geoscale: national - year: 2018 - clean_source: Employment_state_2018 - -source_names: - EPA_StateGHGI: # U.S. GHG emissions by state - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI - year: *ghg_year - activity_sets: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets - - ## List these activity sets separately to access the correct use table year - electric_power: # electricity combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_power - attribution_source: - stateio_Make_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityConsumedBy: {'22': ''} # utilities - - electric_ch4_n2o: # electricity combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_ch4_n2o - attribution_source: - stateio_Make_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityConsumedBy: {'22': ''} # utilities - - use_table_coal: # commercial coal combustion, non-manufacturing industrial - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - - use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - use_table_gas: # commercial gas combustion, non-manufacturing industrial - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'22': ''} # Electricity and natural gas - - commercial_ch4_n2o: # CH4 and N2O from commercial combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o - activity_sets: - coal: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - petroleum: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - gas: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'22': ''} # Electricity and natural gas - - carbonate_use: # other process use of carbonates - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:carbonate_use - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'325': ''} # Use of chemicals - - nitrous_oxide_use: # N2O from Product uses - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:nitrous_oxide_use - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'325': ''} # Use of chemicals - - transport_petroleum: # C02 from petroleum highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - transport_nonroad_CH4: # CH4 from petroleum non-highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - exclusion_fields: - ActivityConsumedBy: ['481', # Exclude airlines - 'F030', 'F040', 'F050'] # Plus other sectors excluded above - - transport_nonroad_N2O: # N2O from petroleum non-highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - transport_nonroad_ag: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_ag - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Machinery - - transport_nonroad_construction: # CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_construction - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Machinery - - ods_substitutes: # CO2e from ODS substitutes - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2017_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2017_m1.yaml deleted file mode 100644 index f3192f3dd..000000000 --- a/flowsa/methods/flowbysectormethods/GHG_state_2017_m1.yaml +++ /dev/null @@ -1,171 +0,0 @@ -## GHG emissions by state from EPA disaggregated inventories - -!include:USEEIO_summary_target.yaml -year: &ghg_year 2017 -geoscale: state - -sources_to_cache: - EIA_MECS_Energy: - !include:GHG_state_m1_common.yaml:sources_to_cache:EIA_MECS_Energy - year: 2018 - attribution_source: - Employment_state_2018: # Update to MECS year - geoscale: national - year: 2018 - clean_source: Employment_state_2018 - -source_names: - EPA_StateGHGI: # U.S. GHG emissions by state - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI - year: *ghg_year - activity_sets: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets - - ## List these activity sets separately to access the correct use table year - electric_power: # electricity combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_power - attribution_source: - stateio_Make_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityConsumedBy: {'22': ''} # utilities - - electric_ch4_n2o: # electricity combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_ch4_n2o - attribution_source: - stateio_Make_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityConsumedBy: {'22': ''} # utilities - - use_table_coal: # commercial coal combustion, non-manufacturing industrial - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - - use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - use_table_gas: # commercial gas combustion, non-manufacturing industrial - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'22': ''} # Electricity and natural gas - - commercial_ch4_n2o: # CH4 and N2O from commercial combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o - activity_sets: - coal: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - petroleum: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - gas: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'22': ''} # Electricity and natural gas - - carbonate_use: # other process use of carbonates - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:carbonate_use - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'325': ''} # Use of chemicals - - nitrous_oxide_use: # N2O from Product uses - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:nitrous_oxide_use - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'325': ''} # Use of chemicals - - transport_petroleum: # C02 from petroleum highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - transport_nonroad_CH4: # CH4 from petroleum non-highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - exclusion_fields: - ActivityConsumedBy: ['481', # Exclude airlines - 'F030', 'F040', 'F050'] # Plus other sectors excluded above - - transport_nonroad_N2O: # N2O from petroleum non-highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - transport_nonroad_ag: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_ag - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Machinery - - transport_nonroad_construction: # CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_construction - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Machinery - - ods_substitutes: # CO2e from ODS substitutes - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2018_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2018_m1.yaml deleted file mode 100644 index 88ee56ed1..000000000 --- a/flowsa/methods/flowbysectormethods/GHG_state_2018_m1.yaml +++ /dev/null @@ -1,171 +0,0 @@ -## GHG emissions by state from EPA disaggregated inventories - -!include:USEEIO_summary_target.yaml -year: &ghg_year 2018 -geoscale: state - -sources_to_cache: - EIA_MECS_Energy: - !include:GHG_state_m1_common.yaml:sources_to_cache:EIA_MECS_Energy - year: 2018 - attribution_source: - Employment_state_2018: # Update to MECS year - geoscale: national - year: 2018 - clean_source: Employment_state_2018 - -source_names: - EPA_StateGHGI: # U.S. GHG emissions by state - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI - year: *ghg_year - activity_sets: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets - - ## List these activity sets separately to access the correct use table year - electric_power: # electricity combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_power - attribution_source: - stateio_Make_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityConsumedBy: {'22': ''} # utilities - - electric_ch4_n2o: # electricity combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_ch4_n2o - attribution_source: - stateio_Make_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityConsumedBy: {'22': ''} # utilities - - use_table_coal: # commercial coal combustion, non-manufacturing industrial - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - - use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - use_table_gas: # commercial gas combustion, non-manufacturing industrial - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'22': ''} # Electricity and natural gas - - commercial_ch4_n2o: # CH4 and N2O from commercial combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o - activity_sets: - coal: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - petroleum: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - gas: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'22': ''} # Electricity and natural gas - - carbonate_use: # other process use of carbonates - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:carbonate_use - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'325': ''} # Use of chemicals - - nitrous_oxide_use: # N2O from Product uses - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:nitrous_oxide_use - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'325': ''} # Use of chemicals - - transport_petroleum: # C02 from petroleum highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - transport_nonroad_CH4: # CH4 from petroleum non-highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - exclusion_fields: - ActivityConsumedBy: ['481', # Exclude airlines - 'F030', 'F040', 'F050'] # Plus other sectors excluded above - - transport_nonroad_N2O: # N2O from petroleum non-highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - transport_nonroad_ag: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_ag - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Machinery - - transport_nonroad_construction: # CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_construction - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Machinery - - ods_substitutes: # CO2e from ODS substitutes - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m1.yaml index ad638e24b..5b624256e 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2019_m1.yaml @@ -1,171 +1,21 @@ -## GHG emissions by state from EPA disaggregated inventories +## Method 1 uses as its source the national GHG Flow-by-sector (summary) +# with emissions data attributed to states based on reported emissions +# in the State Inventory -!include:USEEIO_summary_target.yaml + +!include:GHG_state_m1_common.yaml year: &ghg_year 2019 geoscale: state -sources_to_cache: - EIA_MECS_Energy: - !include:GHG_state_m1_common.yaml:sources_to_cache:EIA_MECS_Energy - year: 2018 - attribution_source: - Employment_state_2018: # Update to MECS year - geoscale: national - year: 2018 - clean_source: Employment_state_2018 source_names: - EPA_StateGHGI: # U.S. GHG emissions by state +## Directly sourced from State Inventory + EPA_StateGHGI: !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI year: *ghg_year activity_sets: !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets - ## List these activity sets separately to access the correct use table year - electric_power: # electricity combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_power - attribution_source: - stateio_Make_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityConsumedBy: {'22': ''} # utilities - - electric_ch4_n2o: # electricity combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_ch4_n2o - attribution_source: - stateio_Make_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityConsumedBy: {'22': ''} # utilities - - use_table_coal: # commercial coal combustion, non-manufacturing industrial - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - - use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - use_table_gas: # commercial gas combustion, non-manufacturing industrial - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'22': ''} # Electricity and natural gas - - commercial_ch4_n2o: # CH4 and N2O from commercial combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o - activity_sets: - coal: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - petroleum: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - gas: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'22': ''} # Electricity and natural gas - - carbonate_use: # other process use of carbonates - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:carbonate_use - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'325': ''} # Use of chemicals - - nitrous_oxide_use: # N2O from Product uses - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:nitrous_oxide_use - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'325': ''} # Use of chemicals - - transport_petroleum: # C02 from petroleum highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - transport_nonroad_CH4: # CH4 from petroleum non-highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - exclusion_fields: - ActivityConsumedBy: ['481', # Exclude airlines - 'F030', 'F040', 'F050'] # Plus other sectors excluded above - - transport_nonroad_N2O: # N2O from petroleum non-highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - transport_nonroad_ag: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_ag - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Machinery - - transport_nonroad_construction: # CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_construction - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Machinery - - ods_substitutes: # CO2e from ODS substitutes - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment + GHG_national_2019_m1: #U.S. GHG emissions, summary model + !include:GHG_state_m1_common.yaml:source_names:GHG_national_common_m1 + year: *ghg_year diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml deleted file mode 100644 index 9a46a5630..000000000 --- a/flowsa/methods/flowbysectormethods/GHG_state_2019_m2.yaml +++ /dev/null @@ -1,21 +0,0 @@ -## Method 2 uses as its source the national GHG Flow-by-sector (summary) -# with emissions data attributed to states based on reported emissions -# in the State Inventory - - -!include:GHG_state_m2_common.yaml -year: &ghg_year 2019 -geoscale: state - - -source_names: -## Directly sourced from State Inventory - EPA_StateGHGI: - !include:GHG_state_m2_common.yaml:source_names:EPA_StateGHGI - year: *ghg_year - activity_sets: - !include:GHG_state_m2_common.yaml:source_names:EPA_StateGHGI:activity_sets - - GHG_national_2019_m2: #U.S. GHG emissions - !include:GHG_state_m2_common.yaml:source_names:GHG_national_common_m2 - year: *ghg_year diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2020_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2020_m1.yaml index 5eb76913c..dc332af63 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_2020_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_2020_m1.yaml @@ -1,171 +1,21 @@ -## GHG emissions by state from EPA disaggregated inventories +## Method 1 uses as its source the national GHG Flow-by-sector (summary) +# with emissions data attributed to states based on reported emissions +# in the State Inventory -!include:USEEIO_summary_target.yaml + +!include:GHG_state_m1_common.yaml year: &ghg_year 2020 geoscale: state -sources_to_cache: - EIA_MECS_Energy: - !include:GHG_state_m1_common.yaml:sources_to_cache:EIA_MECS_Energy - year: 2018 - attribution_source: - Employment_state_2018: # Update to MECS year - geoscale: national - year: 2018 - clean_source: Employment_state_2018 source_names: - EPA_StateGHGI: # U.S. GHG emissions by state +## Directly sourced from State Inventory + EPA_StateGHGI: !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI year: *ghg_year activity_sets: !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets - ## List these activity sets separately to access the correct use table year - electric_power: # electricity combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_power - attribution_source: - stateio_Make_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityConsumedBy: {'22': ''} # utilities - - electric_ch4_n2o: # electricity combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:electric_ch4_n2o - attribution_source: - stateio_Make_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityConsumedBy: {'22': ''} # utilities - - use_table_coal: # commercial coal combustion, non-manufacturing industrial - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_coal - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - - use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_pet - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - use_table_gas: # commercial gas combustion, non-manufacturing industrial - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:use_table_gas - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'22': ''} # Electricity and natural gas - - commercial_ch4_n2o: # CH4 and N2O from commercial combustion - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o - activity_sets: - coal: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:coal - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - petroleum: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:petroleum - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - gas: - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:commercial_ch4_n2o:activity_sets:gas - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'22': ''} # Electricity and natural gas - - carbonate_use: # other process use of carbonates - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:carbonate_use - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'325': ''} # Use of chemicals - - nitrous_oxide_use: # N2O from Product uses - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:nitrous_oxide_use - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'325': ''} # Use of chemicals - - transport_petroleum: # C02 from petroleum highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_petroleum - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - transport_nonroad_CH4: # CH4 from petroleum non-highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_CH4 - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - exclusion_fields: - ActivityConsumedBy: ['481', # Exclude airlines - 'F030', 'F040', 'F050'] # Plus other sectors excluded above - - transport_nonroad_N2O: # N2O from petroleum non-highway - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_N2O - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - - transport_nonroad_ag: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_ag - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Machinery - - transport_nonroad_construction: # CH4, N2O from petroleum non-highway (ag & constrution) - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:transport_nonroad_construction - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Machinery - - ods_substitutes: # CO2e from ODS substitutes - !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets:ods_substitutes - attribution_source: - stateio_Use_Summary: - !include:GHG_state_m1_common.yaml:_allocation_types:_use_allocation - year: *ghg_year - selection_fields: - ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment + GHG_national_2020_m1: #U.S. GHG emissions, summary model + !include:GHG_state_m1_common.yaml:source_names:GHG_national_common_m1 + year: *ghg_year diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2020_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2020_m2.yaml deleted file mode 100644 index 2ce066543..000000000 --- a/flowsa/methods/flowbysectormethods/GHG_state_2020_m2.yaml +++ /dev/null @@ -1,21 +0,0 @@ -## Method 2 uses as its source the national GHG Flow-by-sector (summary) -# with emissions data attributed to states based on reported emissions -# in the State Inventory - - -!include:GHG_state_m2_common.yaml -year: &ghg_year 2020 -geoscale: state - - -source_names: -## Directly sourced from State Inventory - EPA_StateGHGI: - !include:GHG_state_m2_common.yaml:source_names:EPA_StateGHGI - year: *ghg_year - activity_sets: - !include:GHG_state_m2_common.yaml:source_names:EPA_StateGHGI:activity_sets - - GHG_national_2020_m2: #U.S. GHG emissions - !include:GHG_state_m2_common.yaml:source_names:GHG_national_common_m2 - year: *ghg_year diff --git a/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml index 182281616..5d3a2a559 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml @@ -1,481 +1,576 @@ -# This is the general method reference file for state models. -# Year-specific GHG files import this file to define attribution rules -# that are further customized +## Method 1 uses as its source the national GHG Flow-by-sector (summary, m1) +# with emissions data attributed to states based on reported emissions +# in the State Inventory + !include:USEEIO_summary_target.yaml -# year: &ghg_year 2019 +year: &ghg_year 2019 geoscale: state -_allocation_types: - _use_allocation: &use_table_allocation - # year: *ghg_year - geoscale: state - activity_to_sector_mapping: BEA_2012_Summary - # selection_fields: - # ActivityProducedBy: {'324': ''} # Petroleum 324110 - exclusion_fields: - ActivityConsumedBy: ['F030', 'F040', 'F050', 'F051', - 'F02E', 'F06E', 'F07E', 'F10E'] - attribution_method: equal - ## No attribution supplied (will use equal) because target level for - ## modeling is BEA summary level. - -sources_to_cache: - EIA_MECS_Energy: - year: 2018 - geoscale: state - selection_fields: - # Class: Energy # Define class for each application of cached source - Unit: Trillion Btu - Description: - - Table 2.2 - - Table 3.2 - # Flowable: Natural gas # Define class for each application of cached source - exclusion_fields: - Location: '00000' - estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy - attribution_method: proportional - attribution_source: # Required to attribute a few sectors to full target sector level - Employment_state_2018: # Update to MECS year - geoscale: national # Uses national at this stage prior to attributing to states - year: 2018 - clean_fba_after_attribution: !script_function:EIA_MECS clean_mapped_mecs_energy_fba_to_state - clean_source: Employment_state_2018 ## Update to MECS year source_names: - EPA_StateGHGI: # U.S. GHG emissions by state + EPA_StateGHGI: ## Directly sourced from State Inventory FBA geoscale: state - # year: *ghg_year - keep_unmapped_rows: True - fedefl_mapping: 'GHGI' - clean_fba_before_activity_sets: !script_function:EPA_StateGHGI allocate_industrial_combustion - clean_parameter: # Override each year for use in allocate_industrial_combustion - energy_fba: EIA_MECS_Energy - year: 2018 - ghg_fba: EPA_GHGI_T_A_7 # 2018 Table - activities_to_split: - - Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal - - Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas + year: *ghg_year + fedefl_mapping: GHGI activity_sets: direct: + # replicates direct attribution from EPA_GHGI_T_2_1, EPA_GHGI_T_4_80, + # and EPA_GHGI_T_4_96 selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct attribution_method: direct - - n2o_soil_direct: - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv n2o_soil_direct - attribution_method: direct - - n2o_soil_indirect: - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv n2o_soil_indirect - attribution_method: direct - - ag_livestock: + direct_ods: + # replicates direct attribution from EPA_GHGI_T_4_102.households selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ag_livestock + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct_ods + exclusion_fields: + FlowName: 'SF6' # Handle this flow without splitting + clean_fba_before_mapping: !script_function:EPA_GHGI split_HFCs_by_type + clean_parameter: + # Proportions of specific HFCs are assigned based on national total + flow_fba: EPA_GHGI_T_4_100 attribution_method: direct - - ag_burning: + direct_ods2: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ag_burning + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct_ods + FlowName: 'SF6' # Handle this flow without splitting (see above) attribution_method: direct - - residential_co2: + electricity_transmission: #SF6 + # replicates electricity_transmission from EPA_GHGI_T_2_1 selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv residential_co2 + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv electricity_transmission attribution_method: direct - - petrochemicals: + petrochemicals: #CO2 for selected petrochemicals + # replicates EPA_GHGI_T_4_46 selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv petrochemicals attribution_method: direct - - lead: + ag_livestock: #CH4 from Enteric Fermentation, CH4, N2O from manure + # replicates EPA_GHGI_T_5_3 and EPA_GHGI_T_5_6 selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv lead - attribution_method: direct - - magnesium: - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv magnesium + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ag_livestock attribution_method: direct - - electricity_transmission: + ag_burning: #CH4, N2O, CO and NOx from field burning of residue + # replicates EPA_GHGI_T_5_28 selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv electricity_transmission + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ag_burning attribution_method: direct - - hcfc: + hcfc: # HFCs from HCFC-22 production + # replicates EPA_GHGI_T_4_50 selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv hcfc attribution_method: direct - ods_transportation: - clean_fba_before_mapping: !script_function:EPA_GHGI split_HFCs_by_type - clean_parameter: - # Proportions of specific HFCs are assigned based on national total - flow_fba: EPA_GHGI_T_4_100 - #TODO reconsider mapping for transportation HFCS - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ods_transportation - attribution_method: direct + GHG_national_common_m1: #U.S. GHG emissions, summary model + year: *ghg_year + data_format: FBS + geoscale: national + activity_sets: - electric_power: # electricity combustion + electric_power: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv electric_power + MetaSources: 'EPA_GHGI_T_2_1.electric_power' attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location attribution_source: - stateio_Make_Summary: - <<: *use_table_allocation + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI selection_fields: - ActivityConsumedBy: {'22': ''} # utilities + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv electric_power - electric_ch4_n2o: # electricity combustion + liming: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv electric_ch4_n2o + MetaSources: 'EPA_GHGI_T_2_1.liming' attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location attribution_source: - stateio_Make_Summary: - <<: *use_table_allocation + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI selection_fields: - ActivityConsumedBy: {'22': ''} # utilities + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv liming - ng_systems_CH4: + urea: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ng_systems - FlowName: CH4 + MetaSources: 'EPA_GHGI_T_2_1.urea' attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location attribution_source: - EPA_GHGI_T_3_68: - geoscale: national + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv urea - ng_systems_CO2: + urea_fertilizer: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ng_systems - FlowName: CO2 + MetaSources: 'EPA_GHGI_T_2_1.urea_fertilizer' attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location attribution_source: - EPA_GHGI_T_3_70: - geoscale: national + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv urea_fertilizer - ng_systems_N2O: + carbonate_use: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ng_systems - FlowName: N2O + MetaSources: 'EPA_GHGI_T_2_1.carbonate_use' attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location attribution_source: - EPA_GHGI_T_3_72: - geoscale: national + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv carbonate_use - pet_systems_CH4: + lead: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv pet_systems - FlowName: CH4 + MetaSources: 'EPA_GHGI_T_2_1.lead' attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location attribution_source: - EPA_GHGI_T_3_42: - geoscale: national + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv lead - pet_systems_CO2: + nitrous_oxide_use: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv pet_systems - FlowName: CO2 + MetaSources: 'EPA_GHGI_T_2_1.nitrous_oxide_use' attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location attribution_source: - EPA_GHGI_T_3_44: - geoscale: national + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv nitrous_oxide_use - pet_systems_N2O: + + ng_systems: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv pet_systems - FlowName: N2O + MetaSources: + - 'EPA_GHGI_T_3_68' + - 'EPA_GHGI_T_3_70' + - 'EPA_GHGI_T_3_72' attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location attribution_source: - EPA_GHGI_T_3_46: - geoscale: national + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ng_systems - use_table_coal: # commercial coal combustion, non-manufacturing industrial + pet_systems: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_coal + MetaSources: + - 'EPA_GHGI_T_3_42' + - 'EPA_GHGI_T_3_44' + - 'EPA_GHGI_T_3_46' attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location attribution_source: - stateio_Use_Summary: - <<: *use_table_allocation + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI selection_fields: - ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv pet_systems - use_table_pet: # commercial petroleum combustion; mobile ag equipment, industrial petroleum +## Agriculture + n2o_soil_direct: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_pet + MetaSources: + - 'EPA_GHGI_T_5_17.fertilizer_use' + - 'EPA_GHGI_T_5_17.cropland' + - 'EPA_GHGI_T_5_17.pasture' attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location attribution_source: - stateio_Use_Summary: - <<: *use_table_allocation + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv n2o_soil_direct - use_table_gas: # commercial gas combustion, non-manufacturing industrial - # This allocaiton is problematic because 22 includes electricity + n2o_soil_indirect: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_gas + MetaSources: + - 'EPA_GHGI_T_5_18.fertilizer_use' + - 'EPA_GHGI_T_5_18.pasture' attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location attribution_source: - stateio_Use_Summary: - <<: *use_table_allocation - selection_fields: - ActivityProducedBy: {'22': ''} # Electricity and natural gas - - commercial_ch4_n2o: # CH4 and N2O from commercial combustion - clean_fba_before_activity_sets: !script_function:EPA_StateGHGI allocate_flows_by_fuel - clean_parameter: - flow_ratio_source: - - Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Coal - - Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Natural Gas - - Commercial - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum - fba_source: # National tables for identifyng CH4 and N2O ratios to CO2 - - EPA_GHGI_T_3_7 - - EPA_GHGI_T_3_8 - - EPA_GHGI_T_3_9 - sector: Commercial - selection_fields: - PrimaryActivity: Commercial - Stationary Combustion - Fossil Fuel Combustion # ind_com_ch4_n2o - activity_sets: - coal: - selection_fields: - Description: Coal - attribution_method: proportional - attribution_source: - stateio_Use_Summary: - <<: *use_table_allocation - selection_fields: - ActivityProducedBy: {'212': ''} # metal ores and nonmetallic minerals (i.e., coal) - petroleum: - selection_fields: - Description: Petroleum - attribution_method: proportional - attribution_source: - stateio_Use_Summary: - <<: *use_table_allocation - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - gas: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI selection_fields: - Description: Natural Gas - attribution_method: proportional - attribution_source: - stateio_Use_Summary: - <<: *use_table_allocation - selection_fields: - ActivityProducedBy: {'22': ''} # Electricity and natural gas + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv n2o_soil_indirect - industrial_coal: # CO2 from industrial coal combustion (manufacturing) +## Mobile Sources + transport_petroleum: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv industrial_coal + MetaSources: + - 'EPA_GHGI_T_3_13.direct_petroleum' + - 'EPA_GHGI_T_3_13.petroleum_fuels' attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location attribution_source: - EIA_MECS_Energy: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI selection_fields: - Class: Energy - Flowable: Coal + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_petroleum - industrial_gas: # CO2 from industrial gas combustion (manufacturing) + transport_ng: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv industrial_gas + MetaSources: 'EPA_GHGI_T_3_13.direct_ng' attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location attribution_source: - EIA_MECS_Energy: - selection_fields: - Class: Energy - Flowable: Natural Gas - - industrial_ch4_n2o: # CH4 and N2O from industrial combustion - clean_fba_before_activity_sets: !script_function:EPA_StateGHGI allocate_flows_by_fuel - clean_parameter: - flow_ratio_source: - - Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal - - Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas - - Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum - - Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment - fba_source: # National tables for identifyng CH4 and N2O ratios to CO2 - - EPA_GHGI_T_3_7 - - EPA_GHGI_T_3_8 - - EPA_GHGI_T_3_9 - sector: Industrial - selection_fields: - PrimaryActivity: - - Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary # ind_com_ch4_n2o - - Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial - activity_sets: - coal: - selection_fields: - Description: Coal - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - selection_fields: - Class: Energy - Flowable: Coal - petroleum: - selection_fields: - Description: Petroleum - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - selection_fields: - Class: Energy - Flowable: - - Distillate Fuel Oil - - Residual Fuel Oil - gas: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI selection_fields: - Description: Natural Gas - attribution_method: proportional - attribution_source: - EIA_MECS_Energy: - selection_fields: - Class: Energy - Flowable: Natural Gas + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_ng - industrial_neu: # CO2 from non energy use of fossil fuels - industrial + transport_ch4_n2o_diesel: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv industrial_neu + MetaSources: + - 'EPA_GHGI_T_3_14.petroleum_fuels_diesel' + - 'EPA_GHGI_T_3_14.direct_diesel' + - 'EPA_GHGI_T_3_15.petroleum_fuels_diesel' + - 'EPA_GHGI_T_3_15.direct_diesel' attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location attribution_source: - EIA_MECS_Energy: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI selection_fields: - Class: Other # nonfuel consumption - Flowable: Total + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_diesel - carbonate_use: # other process use of carbonates + transport_ch4_n2o_gasoline: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv carbonate_use + MetaSources: + - 'EPA_GHGI_T_3_14.petroleum_fuels_gasoline' + - 'EPA_GHGI_T_3_14.direct_gasoline' + - 'EPA_GHGI_T_3_15.petroleum_fuels_gasoline' + - 'EPA_GHGI_T_3_15.direct_gasoline' attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location attribution_source: - stateio_Use_Summary: - <<: *use_table_allocation + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI selection_fields: - ActivityProducedBy: {'325': ''} # Use of chemicals + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_gasoline - nitrous_oxide_use: # N2O from Product uses + transport_ch4_n2o_alt: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv nitrous_oxide_use + MetaSources: + - 'EPA_GHGI_T_3_14.alt_fuel_on_road' + - 'EPA_GHGI_T_3_15.alt_fuel_on_road' attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location attribution_source: - stateio_Use_Summary: - <<: *use_table_allocation + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI selection_fields: - ActivityProducedBy: {'325': ''} # Use of chemicals + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_alt_fuel - urea: # emissions from urea fertilization - # allocated between crops and animals based on USDA land area + transport_ch4_n2o_nonroad: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv urea + MetaSources: # Ships, boats, rail, air + - 'EPA_GHGI_T_3_14.direct_non_road' + - 'EPA_GHGI_T_3_15.direct_non_road' attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location attribution_source: - USDA_CoA_Cropland_NAICS: - year: 2017 + EPA_StateGHGI: geoscale: state + fedefl_mapping: GHGI selection_fields: - Class: Land - FlowName: AG LAND, CROPLAND, HARVESTED # land in active use - estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad - transport_petroleum: # C02 from petroleum highway; ch4, n2o from alternative fuels - # state inventory assumes all petroleum is "highway" - # Allocate to all transport types and households by fuel consumption + transport_ch4_n2o_nonroad_other: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_petroleum + MetaSources: + - 'EPA_GHGI_T_3_14.other_non_road' + - 'EPA_GHGI_T_3_15.other_non_road' attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location attribution_source: - stateio_Use_Summary: - <<: *use_table_allocation + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad_other - transport_ng: # C02 from natural gas transportation - # National inventory shows all ng transport emissions coming from pipelines + transport_ch4_n2o_nonroad_ag: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_ng - attribution_method: direct + MetaSources: + - 'EPA_GHGI_T_3_14.farm_non_road' + - 'EPA_GHGI_T_3_15.farm_non_road' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad_ag - transport_diesel: # CH4, N2O from diesel highway - # Assigned to truck transport to align with national inventory - # Medium- and Heavy-Duty Trucks and Buses + transport_ch4_n2o_nonroad_construction: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_diesel - attribution_method: direct + MetaSources: + - 'EPA_GHGI_T_3_14.construction_and_mining' + - 'EPA_GHGI_T_3_15.construction_and_mining' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad_construction - transport_gasoline: # CH4, N2O from gasoline highway - # Assigned to households to align with national inventory - # Light-Duty Trucks - # Passenger Cars - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_gasoline - attribution_method: direct - transport_nonroad_CH4: # CH4 from petroleum non-highway - # National inventory distinguishes by vehicle type (ship, rail, equipment, etc.) - # Exclude air which has no CH4 emissions per national inventory - # 'Based on this data, CH4 emissions factors for jet aircraft were ' - # 'changed to zero to reflect the latest emissions testing data...' +## Stationary Combustion + stationary_residential: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad - FlowName: CH4 + MetaSources: + - 'EPA_GHGI_T_A_5.direct_attribution' + - 'EPA_GHGI_T_A_6.direct_attribution' + - 'EPA_GHGI_T_A_7.direct_attribution' + - 'EPA_GHGI_T_A_8.direct_attribution' + - 'EPA_GHGI_T_A_9.direct_attribution' + - 'EPA_GHGI_T_A_10.direct_attribution' + - 'EPA_GHGI_T_A_11.direct_attribution' + - 'EPA_GHGI_T_A_12.direct_attribution' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv residential_co2 + + stationary_coal: + selection_fields: + MetaSources: + - 'EPA_GHGI_T_A_5.non_manufacturing_coal' + - 'EPA_GHGI_T_A_5.coal_manufacturing_co2' + - 'EPA_GHGI_T_A_6.non_manufacturing_coal' + - 'EPA_GHGI_T_A_6.coal_manufacturing_co2' + - 'EPA_GHGI_T_A_7.non_manufacturing_coal' + - 'EPA_GHGI_T_A_7.coal_manufacturing_co2' + - 'EPA_GHGI_T_A_8.non_manufacturing_coal' + - 'EPA_GHGI_T_A_8.coal_manufacturing_co2' + - 'EPA_GHGI_T_A_9.non_manufacturing_coal' + - 'EPA_GHGI_T_A_9.coal_manufacturing_co2' + - 'EPA_GHGI_T_A_10.non_manufacturing_coal' + - 'EPA_GHGI_T_A_10.coal_manufacturing_co2' + - 'EPA_GHGI_T_A_11.non_manufacturing_coal' + - 'EPA_GHGI_T_A_11.coal_manufacturing_co2' + - 'EPA_GHGI_T_A_12.non_manufacturing_coal' + - 'EPA_GHGI_T_A_12.coal_manufacturing_co2' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_coal + + stationary_natural_gas: + selection_fields: + MetaSources: + - 'EPA_GHGI_T_A_5.non_manufacturing_natural_gas' + - 'EPA_GHGI_T_A_5.natural_gas_manufacturing' + - 'EPA_GHGI_T_A_6.non_manufacturing_natural_gas' + - 'EPA_GHGI_T_A_6.natural_gas_manufacturing' + - 'EPA_GHGI_T_A_7.non_manufacturing_natural_gas' + - 'EPA_GHGI_T_A_7.natural_gas_manufacturing' + - 'EPA_GHGI_T_A_8.non_manufacturing_natural_gas' + - 'EPA_GHGI_T_A_8.natural_gas_manufacturing' + - 'EPA_GHGI_T_A_9.non_manufacturing_natural_gas' + - 'EPA_GHGI_T_A_9.natural_gas_manufacturing' + - 'EPA_GHGI_T_A_10.non_manufacturing_natural_gas' + - 'EPA_GHGI_T_A_10.natural_gas_manufacturing' + - 'EPA_GHGI_T_A_11.non_manufacturing_natural_gas' + - 'EPA_GHGI_T_A_11.natural_gas_manufacturing' + - 'EPA_GHGI_T_A_12.non_manufacturing_natural_gas' + - 'EPA_GHGI_T_A_12.natural_gas_manufacturing' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_gas + + stationary_petroleum_fuels: + selection_fields: + MetaSources: + - 'EPA_GHGI_T_A_5.petroleum' + - 'EPA_GHGI_T_A_6.petroleum' + - 'EPA_GHGI_T_A_7.petroleum' + - 'EPA_GHGI_T_A_8.petroleum' + - 'EPA_GHGI_T_A_9.petroleum' + - 'EPA_GHGI_T_A_10.petroleum' + - 'EPA_GHGI_T_A_11.petroleum' + - 'EPA_GHGI_T_A_12.petroleum' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_pet + + stationary_ch4_n2o: + selection_fields: + MetaSources: + - 'EPA_GHGI_T_3_8.natural_gas_nonmanufacturing' + - 'EPA_GHGI_T_3_8.fuel_oil' + - 'EPA_GHGI_T_3_8.coal_nonmanufacturing' + - 'EPA_GHGI_T_3_8.ng_manufacturing' + - 'EPA_GHGI_T_3_8.coal_manufacturing' + - 'EPA_GHGI_T_3_8.fuel_oil' + - 'EPA_GHGI_T_3_9.natural_gas_nonmanufacturing' + - 'EPA_GHGI_T_3_9.fuel_oil' + - 'EPA_GHGI_T_3_9.coal_nonmanufacturing' + - 'EPA_GHGI_T_3_9.ng_manufacturing' + - 'EPA_GHGI_T_3_9.coal_manufacturing' + - 'EPA_GHGI_T_3_9.fuel_oil' attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location attribution_source: - stateio_Use_Summary: - <<: *use_table_allocation + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel - exclusion_fields: - ActivityConsumedBy: ['481', # Exclude airlines - 'F030', 'F040', 'F050'] # Plus other sectors excluded above + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ind_com_ch4_n2o - transport_nonroad_N2O: # N2O from petroleum non-highway - # National inventory distinguishes by vehicle type (ship, rail, equipment, etc.) - # Allocate to ships, rail, air by fuel use + electric_ch4_n2o: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad - FlowName: N2O + MetaSources: + - 'EPA_GHGI_T_3_8.electric_power' + - 'EPA_GHGI_T_3_9.electric_power' + attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location + attribution_source: + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI + selection_fields: + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv electric_ch4_n2o + + industrial_neu: + selection_fields: + MetaSources: + - 'EPA_GHGI_T_3_22.coal' + - 'EPA_GHGI_T_3_22.petroleum_neu' + - 'EPA_GHGI_T_3_22.natural_gas_neu' + - 'EPA_GHGI_T_3_22.transportation_lubricants' + - 'EPA_GHGI_T_3_22b.coal' + - 'EPA_GHGI_T_3_22b.petroleum_neu' + - 'EPA_GHGI_T_3_22b.natural_gas_neu' + - 'EPA_GHGI_T_3_22b.transportation_lubricants' attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location attribution_source: - stateio_Use_Summary: - <<: *use_table_allocation + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum fuel + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv industrial_neu - transport_nonroad_ag: # CO2 (ag only), CH4, N2O from petroleum non-highway (ag & constrution) + ods_substitutes: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad_ag + MetaSources: + - 'EPA_GHGI_T_4_102.refrigerants' + - 'EPA_GHGI_T_4_102.air_conditioning' + - 'EPA_GHGI_T_4_102.foams' attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location attribution_source: - stateio_Use_Summary: - <<: *use_table_allocation + EPA_StateGHGI: + clean_fba_before_mapping: !script_function:EPA_GHGI split_HFCs_by_type + clean_parameter: + # Proportions of specific HFCs are assigned based on national total + flow_fba: EPA_GHGI_T_4_100 + geoscale: state + fedefl_mapping: GHGI selection_fields: - ActivityProducedBy: {'333': ''} # Machinery + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ods_substitutes - transport_nonroad_construction: # CH4, N2O from petroleum non-highway (ag & constrution) + ods_transportation: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad_construction + MetaSources: 'EPA_GHGI_T_A_97' attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location attribution_source: - stateio_Use_Summary: - <<: *use_table_allocation + EPA_StateGHGI: + clean_fba_before_mapping: !script_function:EPA_GHGI split_HFCs_by_type + clean_parameter: + # Proportions of specific HFCs are assigned based on national total + flow_fba: EPA_GHGI_T_4_100 + geoscale: state + fedefl_mapping: GHGI selection_fields: - ActivityProducedBy: {'333': ''} # Machinery + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ods_transportation - ods_substitutes: # CO2e from ODS substitutes - clean_fba_before_mapping: !script_function:EPA_GHGI split_HFCs_by_type - clean_parameter: - # Proportions of specific HFCs are assigned based on national total - flow_fba: EPA_GHGI_T_4_100 + magnesium: selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ods_substitutes + MetaSources: 'EPA_GHGI_T_4_86' attribution_method: proportional + attribute_on: ['Flowable', 'SectorProducedBy'] + fill_columns: Location attribution_source: - stateio_Use_Summary: - <<: *use_table_allocation + EPA_StateGHGI: + geoscale: state + fedefl_mapping: GHGI selection_fields: - ActivityProducedBy: {'333': ''} # Poor proxy for A/C equipment + PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv magnesium diff --git a/flowsa/methods/flowbysectormethods/GHG_state_m2_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_m2_common.yaml deleted file mode 100644 index de100a473..000000000 --- a/flowsa/methods/flowbysectormethods/GHG_state_m2_common.yaml +++ /dev/null @@ -1,576 +0,0 @@ -## Method 2 uses as its source the national GHG Flow-by-sector (summary, m2) -# with emissions data attributed to states based on reported emissions -# in the State Inventory - - -!include:USEEIO_summary_target.yaml -year: &ghg_year 2019 -geoscale: state - - -source_names: - EPA_StateGHGI: ## Directly sourced from State Inventory FBA - geoscale: state - year: *ghg_year - fedefl_mapping: GHGI - activity_sets: - direct: - # replicates direct attribution from EPA_GHGI_T_2_1, EPA_GHGI_T_4_80, - # and EPA_GHGI_T_4_96 - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct - attribution_method: direct - direct_ods: - # replicates direct attribution from EPA_GHGI_T_4_102.households - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct_ods - exclusion_fields: - FlowName: 'SF6' # Handle this flow without splitting - clean_fba_before_mapping: !script_function:EPA_GHGI split_HFCs_by_type - clean_parameter: - # Proportions of specific HFCs are assigned based on national total - flow_fba: EPA_GHGI_T_4_100 - attribution_method: direct - direct_ods2: - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct_ods - FlowName: 'SF6' # Handle this flow without splitting (see above) - attribution_method: direct - electricity_transmission: #SF6 - # replicates electricity_transmission from EPA_GHGI_T_2_1 - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv electricity_transmission - attribution_method: direct - petrochemicals: #CO2 for selected petrochemicals - # replicates EPA_GHGI_T_4_46 - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv petrochemicals - attribution_method: direct - ag_livestock: #CH4 from Enteric Fermentation, CH4, N2O from manure - # replicates EPA_GHGI_T_5_3 and EPA_GHGI_T_5_6 - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ag_livestock - attribution_method: direct - ag_burning: #CH4, N2O, CO and NOx from field burning of residue - # replicates EPA_GHGI_T_5_28 - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ag_burning - attribution_method: direct - hcfc: # HFCs from HCFC-22 production - # replicates EPA_GHGI_T_4_50 - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv hcfc - attribution_method: direct - - GHG_national_common_m2: #U.S. GHG emissions - year: *ghg_year - data_format: FBS - geoscale: national - activity_sets: - - electric_power: - selection_fields: - MetaSources: 'EPA_GHGI_T_2_1.electric_power' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv electric_power - - liming: - selection_fields: - MetaSources: 'EPA_GHGI_T_2_1.liming' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv liming - - urea: - selection_fields: - MetaSources: 'EPA_GHGI_T_2_1.urea' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv urea - - urea_fertilizer: - selection_fields: - MetaSources: 'EPA_GHGI_T_2_1.urea_fertilizer' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv urea_fertilizer - - carbonate_use: - selection_fields: - MetaSources: 'EPA_GHGI_T_2_1.carbonate_use' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv carbonate_use - - lead: - selection_fields: - MetaSources: 'EPA_GHGI_T_2_1.lead' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv lead - - nitrous_oxide_use: - selection_fields: - MetaSources: 'EPA_GHGI_T_2_1.nitrous_oxide_use' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv nitrous_oxide_use - - - ng_systems: - selection_fields: - MetaSources: - - 'EPA_GHGI_T_3_68' - - 'EPA_GHGI_T_3_70' - - 'EPA_GHGI_T_3_72' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ng_systems - - pet_systems: - selection_fields: - MetaSources: - - 'EPA_GHGI_T_3_42' - - 'EPA_GHGI_T_3_44' - - 'EPA_GHGI_T_3_46' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv pet_systems - -## Agriculture - n2o_soil_direct: - selection_fields: - MetaSources: - - 'EPA_GHGI_T_5_17.fertilizer_use' - - 'EPA_GHGI_T_5_17.cropland' - - 'EPA_GHGI_T_5_17.pasture' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv n2o_soil_direct - - n2o_soil_indirect: - selection_fields: - MetaSources: - - 'EPA_GHGI_T_5_18.fertilizer_use' - - 'EPA_GHGI_T_5_18.pasture' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv n2o_soil_indirect - -## Mobile Sources - transport_petroleum: - selection_fields: - MetaSources: - - 'EPA_GHGI_T_3_13.direct_petroleum' - - 'EPA_GHGI_T_3_13.petroleum_fuels' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_petroleum - - transport_ng: - selection_fields: - MetaSources: 'EPA_GHGI_T_3_13.direct_ng' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_ng - - transport_ch4_n2o_diesel: - selection_fields: - MetaSources: - - 'EPA_GHGI_T_3_14.petroleum_fuels_diesel' - - 'EPA_GHGI_T_3_14.direct_diesel' - - 'EPA_GHGI_T_3_15.petroleum_fuels_diesel' - - 'EPA_GHGI_T_3_15.direct_diesel' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_diesel - - transport_ch4_n2o_gasoline: - selection_fields: - MetaSources: - - 'EPA_GHGI_T_3_14.petroleum_fuels_gasoline' - - 'EPA_GHGI_T_3_14.direct_gasoline' - - 'EPA_GHGI_T_3_15.petroleum_fuels_gasoline' - - 'EPA_GHGI_T_3_15.direct_gasoline' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_gasoline - - transport_ch4_n2o_alt: - selection_fields: - MetaSources: - - 'EPA_GHGI_T_3_14.alt_fuel_on_road' - - 'EPA_GHGI_T_3_15.alt_fuel_on_road' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_alt_fuel - - transport_ch4_n2o_nonroad: - selection_fields: - MetaSources: # Ships, boats, rail, air - - 'EPA_GHGI_T_3_14.direct_non_road' - - 'EPA_GHGI_T_3_15.direct_non_road' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad - - transport_ch4_n2o_nonroad_other: - selection_fields: - MetaSources: - - 'EPA_GHGI_T_3_14.other_non_road' - - 'EPA_GHGI_T_3_15.other_non_road' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad_other - - transport_ch4_n2o_nonroad_ag: - selection_fields: - MetaSources: - - 'EPA_GHGI_T_3_14.farm_non_road' - - 'EPA_GHGI_T_3_15.farm_non_road' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad_ag - - transport_ch4_n2o_nonroad_construction: - selection_fields: - MetaSources: - - 'EPA_GHGI_T_3_14.construction_and_mining' - - 'EPA_GHGI_T_3_15.construction_and_mining' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad_construction - - -## Stationary Combustion - stationary_residential: - selection_fields: - MetaSources: - - 'EPA_GHGI_T_A_5.direct_attribution' - - 'EPA_GHGI_T_A_6.direct_attribution' - - 'EPA_GHGI_T_A_7.direct_attribution' - - 'EPA_GHGI_T_A_8.direct_attribution' - - 'EPA_GHGI_T_A_9.direct_attribution' - - 'EPA_GHGI_T_A_10.direct_attribution' - - 'EPA_GHGI_T_A_11.direct_attribution' - - 'EPA_GHGI_T_A_12.direct_attribution' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv residential_co2 - - stationary_coal: - selection_fields: - MetaSources: - - 'EPA_GHGI_T_A_5.non_manufacturing_coal' - - 'EPA_GHGI_T_A_5.coal_manufacturing_co2' - - 'EPA_GHGI_T_A_6.non_manufacturing_coal' - - 'EPA_GHGI_T_A_6.coal_manufacturing_co2' - - 'EPA_GHGI_T_A_7.non_manufacturing_coal' - - 'EPA_GHGI_T_A_7.coal_manufacturing_co2' - - 'EPA_GHGI_T_A_8.non_manufacturing_coal' - - 'EPA_GHGI_T_A_8.coal_manufacturing_co2' - - 'EPA_GHGI_T_A_9.non_manufacturing_coal' - - 'EPA_GHGI_T_A_9.coal_manufacturing_co2' - - 'EPA_GHGI_T_A_10.non_manufacturing_coal' - - 'EPA_GHGI_T_A_10.coal_manufacturing_co2' - - 'EPA_GHGI_T_A_11.non_manufacturing_coal' - - 'EPA_GHGI_T_A_11.coal_manufacturing_co2' - - 'EPA_GHGI_T_A_12.non_manufacturing_coal' - - 'EPA_GHGI_T_A_12.coal_manufacturing_co2' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_coal - - stationary_natural_gas: - selection_fields: - MetaSources: - - 'EPA_GHGI_T_A_5.non_manufacturing_natural_gas' - - 'EPA_GHGI_T_A_5.natural_gas_manufacturing' - - 'EPA_GHGI_T_A_6.non_manufacturing_natural_gas' - - 'EPA_GHGI_T_A_6.natural_gas_manufacturing' - - 'EPA_GHGI_T_A_7.non_manufacturing_natural_gas' - - 'EPA_GHGI_T_A_7.natural_gas_manufacturing' - - 'EPA_GHGI_T_A_8.non_manufacturing_natural_gas' - - 'EPA_GHGI_T_A_8.natural_gas_manufacturing' - - 'EPA_GHGI_T_A_9.non_manufacturing_natural_gas' - - 'EPA_GHGI_T_A_9.natural_gas_manufacturing' - - 'EPA_GHGI_T_A_10.non_manufacturing_natural_gas' - - 'EPA_GHGI_T_A_10.natural_gas_manufacturing' - - 'EPA_GHGI_T_A_11.non_manufacturing_natural_gas' - - 'EPA_GHGI_T_A_11.natural_gas_manufacturing' - - 'EPA_GHGI_T_A_12.non_manufacturing_natural_gas' - - 'EPA_GHGI_T_A_12.natural_gas_manufacturing' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_gas - - stationary_petroleum_fuels: - selection_fields: - MetaSources: - - 'EPA_GHGI_T_A_5.petroleum' - - 'EPA_GHGI_T_A_6.petroleum' - - 'EPA_GHGI_T_A_7.petroleum' - - 'EPA_GHGI_T_A_8.petroleum' - - 'EPA_GHGI_T_A_9.petroleum' - - 'EPA_GHGI_T_A_10.petroleum' - - 'EPA_GHGI_T_A_11.petroleum' - - 'EPA_GHGI_T_A_12.petroleum' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_pet - - stationary_ch4_n2o: - selection_fields: - MetaSources: - - 'EPA_GHGI_T_3_8.natural_gas_nonmanufacturing' - - 'EPA_GHGI_T_3_8.fuel_oil' - - 'EPA_GHGI_T_3_8.coal_nonmanufacturing' - - 'EPA_GHGI_T_3_8.ng_manufacturing' - - 'EPA_GHGI_T_3_8.coal_manufacturing' - - 'EPA_GHGI_T_3_8.fuel_oil' - - 'EPA_GHGI_T_3_9.natural_gas_nonmanufacturing' - - 'EPA_GHGI_T_3_9.fuel_oil' - - 'EPA_GHGI_T_3_9.coal_nonmanufacturing' - - 'EPA_GHGI_T_3_9.ng_manufacturing' - - 'EPA_GHGI_T_3_9.coal_manufacturing' - - 'EPA_GHGI_T_3_9.fuel_oil' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ind_com_ch4_n2o - - electric_ch4_n2o: - selection_fields: - MetaSources: - - 'EPA_GHGI_T_3_8.electric_power' - - 'EPA_GHGI_T_3_9.electric_power' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv electric_ch4_n2o - - industrial_neu: - selection_fields: - MetaSources: - - 'EPA_GHGI_T_3_22.coal' - - 'EPA_GHGI_T_3_22.petroleum_neu' - - 'EPA_GHGI_T_3_22.natural_gas_neu' - - 'EPA_GHGI_T_3_22.transportation_lubricants' - - 'EPA_GHGI_T_3_22b.coal' - - 'EPA_GHGI_T_3_22b.petroleum_neu' - - 'EPA_GHGI_T_3_22b.natural_gas_neu' - - 'EPA_GHGI_T_3_22b.transportation_lubricants' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv industrial_neu - - ods_substitutes: - selection_fields: - MetaSources: - - 'EPA_GHGI_T_4_102.refrigerants' - - 'EPA_GHGI_T_4_102.air_conditioning' - - 'EPA_GHGI_T_4_102.foams' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - clean_fba_before_mapping: !script_function:EPA_GHGI split_HFCs_by_type - clean_parameter: - # Proportions of specific HFCs are assigned based on national total - flow_fba: EPA_GHGI_T_4_100 - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ods_substitutes - - ods_transportation: - selection_fields: - MetaSources: 'EPA_GHGI_T_A_97' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - clean_fba_before_mapping: !script_function:EPA_GHGI split_HFCs_by_type - clean_parameter: - # Proportions of specific HFCs are assigned based on national total - flow_fba: EPA_GHGI_T_4_100 - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv ods_transportation - - magnesium: - selection_fields: - MetaSources: 'EPA_GHGI_T_4_86' - attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] - fill_columns: Location - attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI - selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv magnesium From 2e70148b71a889ad4920eeaee794cee970ccea18 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 20 Sep 2023 09:30:00 -0400 Subject: [PATCH 0986/1127] re-add national summary models (m1) for 2012-2018 --- .../GHG_national_2012_m1.yaml | 230 ++++++++++++++++++ .../GHG_national_2013_m1.yaml | 230 ++++++++++++++++++ .../GHG_national_2014_m1.yaml | 230 ++++++++++++++++++ .../GHG_national_2015_m1.yaml | 230 ++++++++++++++++++ .../GHG_national_2016_m1.yaml | 230 ++++++++++++++++++ .../GHG_national_2017_m1.yaml | 230 ++++++++++++++++++ .../GHG_national_2018_m1.yaml | 230 ++++++++++++++++++ 7 files changed, 1610 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml new file mode 100644 index 000000000..e1f516534 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml @@ -0,0 +1,230 @@ +# This is a 2012 target year specific implementation of GHG_national_m1 +# This is a Summary level model +# All parameters add year specific data when needed to implement for 2012 +# GHGI FBA table names match the 2022 GHGI Report +# MECS year is 2014 + +!include:GHG_national_m1_common.yaml +ghgi_year: &ghgi_year 2012 +mecs_year: &mecs_year 2014 + +_industrial_allocation_dict: &industrial_dict + energy_fba: 'EIA_MECS_Energy' + year: *mecs_year + ghg_fba: 'EPA_GHGI_T_A_11' # 2014 Table + +source_names: + "EPA_GHGI_T_2_1": #U.S. GHG emissions + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 + year: *ghgi_year + + "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 + year: *ghgi_year + "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 + year: *ghgi_year + "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 + year: *ghgi_year + "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 + year: *ghgi_year + "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 + year: *ghgi_year + "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 + year: *ghgi_year + "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 + year: *ghgi_year + "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 + year: *ghgi_year + "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 + year: *ghgi_year + "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 + year: *ghgi_year + "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 + year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets + petroleum_fuels: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 + year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets + petroleum_fuels_diesel: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + petroleum_fuels_gasoline: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + + construction_and_mining: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + farm_non_road: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + other_non_road: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + alt_fuel_on_road: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 + + "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 + year: *ghgi_year + "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 + year: *ghgi_year + "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 + year: *ghgi_year + "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 + year: *ghgi_year + + "EPA_GHGI_T_A_97": # HFCs from Transportation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 + year: *ghgi_year + "EPA_GHGI_T_4_80": # PFCs from aluminum production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 + year: *ghgi_year + "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_86 + year: *ghgi_year + "EPA_GHGI_T_3_22b": #Fossil fuel for non-energy uses + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + year: *ghgi_year + activity_sets: # Update EIA_MECS year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets + petroleum_neu: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas_neu: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + transportation_lubricants: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + +### Major CO2 Sources + "EPA_GHGI_T_A_13": # CO2 emissions from stationary combustion. This table number varies by GHG year. + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: # Update EIA_MECS and BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + non_manufacturing_natural_gas: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + coal_manufacturing_co2: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + petroleum: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: # Update EIA_MECS and BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + + fuel_oil: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + natural_gas_nonmanufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + coal_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + ng_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + "EPA_GHGI_T_3_9": *T_3_8 # N2O emissions from stationary combustion diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml new file mode 100644 index 000000000..6a62bc018 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml @@ -0,0 +1,230 @@ +# This is a 2013 target year specific implementation of GHG_national_m1 +# This is a Summary level model +# All parameters add year specific data when needed to implement for 2013 +# GHGI FBA table names match the 2022 GHGI Report +# MECS year is 2014 + +!include:GHG_national_m1_common.yaml +ghgi_year: &ghgi_year 2013 +mecs_year: &mecs_year 2014 + +_industrial_allocation_dict: &industrial_dict + energy_fba: 'EIA_MECS_Energy' + year: *mecs_year + ghg_fba: 'EPA_GHGI_T_A_11' # 2014 Table + +source_names: + "EPA_GHGI_T_2_1": #U.S. GHG emissions + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 + year: *ghgi_year + + "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 + year: *ghgi_year + "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 + year: *ghgi_year + "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 + year: *ghgi_year + "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 + year: *ghgi_year + "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 + year: *ghgi_year + "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 + year: *ghgi_year + "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 + year: *ghgi_year + "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 + year: *ghgi_year + "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 + year: *ghgi_year + "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 + year: *ghgi_year + "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 + year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets + petroleum_fuels: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 + year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets + petroleum_fuels_diesel: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + petroleum_fuels_gasoline: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + + construction_and_mining: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + farm_non_road: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + other_non_road: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + alt_fuel_on_road: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 + + "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 + year: *ghgi_year + "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 + year: *ghgi_year + "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 + year: *ghgi_year + "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 + year: *ghgi_year + + "EPA_GHGI_T_A_97": # HFCs from Transportation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 + year: *ghgi_year + "EPA_GHGI_T_4_80": # PFCs from aluminum production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 + year: *ghgi_year + "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_86 + year: *ghgi_year + "EPA_GHGI_T_3_22b": #Fossil fuel for non-energy uses + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + year: *ghgi_year + activity_sets: # Update EIA_MECS year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets + petroleum_neu: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas_neu: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + transportation_lubricants: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + +### Major CO2 Sources + "EPA_GHGI_T_A_12": # CO2 emissions from stationary combustion. This table number varies by GHG year. + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: # Update EIA_MECS and BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + non_manufacturing_natural_gas: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + coal_manufacturing_co2: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + petroleum: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: # Update EIA_MECS and BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + + fuel_oil: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + natural_gas_nonmanufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + coal_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + ng_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + "EPA_GHGI_T_3_9": *T_3_8 # N2O emissions from stationary combustion diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml new file mode 100644 index 000000000..7b4a64483 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml @@ -0,0 +1,230 @@ +# This is a 2014 target year specific implementation of GHG_national_m1 +# This is a Summary level model +# All parameters add year specific data when needed to implement for 2014 +# GHGI FBA table names match the 2022 GHGI Report +# MECS year is 2014 + +!include:GHG_national_m1_common.yaml +ghgi_year: &ghgi_year 2014 +mecs_year: &mecs_year 2014 + +_industrial_allocation_dict: &industrial_dict + energy_fba: 'EIA_MECS_Energy' + year: *mecs_year + ghg_fba: 'EPA_GHGI_T_A_11' # 2014 Table + +source_names: + "EPA_GHGI_T_2_1": #U.S. GHG emissions + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 + year: *ghgi_year + + "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 + year: *ghgi_year + "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 + year: *ghgi_year + "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 + year: *ghgi_year + "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 + year: *ghgi_year + "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 + year: *ghgi_year + "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 + year: *ghgi_year + "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 + year: *ghgi_year + "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 + year: *ghgi_year + "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 + year: *ghgi_year + "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 + year: *ghgi_year + "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 + year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets + petroleum_fuels: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 + year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets + petroleum_fuels_diesel: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + petroleum_fuels_gasoline: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + + construction_and_mining: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + farm_non_road: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + other_non_road: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + alt_fuel_on_road: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 + + "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 + year: *ghgi_year + "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 + year: *ghgi_year + "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 + year: *ghgi_year + "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 + year: *ghgi_year + + "EPA_GHGI_T_A_97": # HFCs from Transportation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 + year: *ghgi_year + "EPA_GHGI_T_4_80": # PFCs from aluminum production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 + year: *ghgi_year + "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_86 + year: *ghgi_year + "EPA_GHGI_T_3_22b": #Fossil fuel for non-energy uses + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + year: *ghgi_year + activity_sets: # Update EIA_MECS year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets + petroleum_neu: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas_neu: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + transportation_lubricants: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + +### Major CO2 Sources + "EPA_GHGI_T_A_11": # CO2 emissions from stationary combustion. This table number varies by GHG year. + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: # Update EIA_MECS and BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + non_manufacturing_natural_gas: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + coal_manufacturing_co2: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + petroleum: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: # Update EIA_MECS and BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + + fuel_oil: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + natural_gas_nonmanufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + coal_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + ng_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + "EPA_GHGI_T_3_9": *T_3_8 # N2O emissions from stationary combustion diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml new file mode 100644 index 000000000..17bca8fa0 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml @@ -0,0 +1,230 @@ +# This is a 2015 target year specific implementation of GHG_national_m1 +# This is a Summary level model +# All parameters add year specific data when needed to implement for 2015 +# GHGI FBA table names match the 2022 GHGI Report +# MECS year is 2014 + +!include:GHG_national_m1_common.yaml +ghgi_year: &ghgi_year 2015 +mecs_year: &mecs_year 2014 + +_industrial_allocation_dict: &industrial_dict + energy_fba: 'EIA_MECS_Energy' + year: *mecs_year + ghg_fba: 'EPA_GHGI_T_A_11' # 2014 Table + +source_names: + "EPA_GHGI_T_2_1": #U.S. GHG emissions + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 + year: *ghgi_year + + "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 + year: *ghgi_year + "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 + year: *ghgi_year + "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 + year: *ghgi_year + "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 + year: *ghgi_year + "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 + year: *ghgi_year + "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 + year: *ghgi_year + "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 + year: *ghgi_year + "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 + year: *ghgi_year + "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 + year: *ghgi_year + "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 + year: *ghgi_year + "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 + year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets + petroleum_fuels: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 + year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets + petroleum_fuels_diesel: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + petroleum_fuels_gasoline: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + + construction_and_mining: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + farm_non_road: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + other_non_road: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + alt_fuel_on_road: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 + + "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 + year: *ghgi_year + "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 + year: *ghgi_year + "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 + year: *ghgi_year + "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 + year: *ghgi_year + + "EPA_GHGI_T_A_97": # HFCs from Transportation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 + year: *ghgi_year + "EPA_GHGI_T_4_80": # PFCs from aluminum production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 + year: *ghgi_year + "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_86 + year: *ghgi_year + "EPA_GHGI_T_3_22b": #Fossil fuel for non-energy uses + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + year: *ghgi_year + activity_sets: # Update EIA_MECS year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets + petroleum_neu: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas_neu: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + transportation_lubricants: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + +### Major CO2 Sources + "EPA_GHGI_T_A_10": # CO2 emissions from stationary combustion. This table number varies by GHG year. + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: # Update EIA_MECS and BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + non_manufacturing_natural_gas: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + coal_manufacturing_co2: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + petroleum: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: # Update EIA_MECS and BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + + fuel_oil: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + natural_gas_nonmanufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + coal_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + ng_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + "EPA_GHGI_T_3_9": *T_3_8 # N2O emissions from stationary combustion diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml new file mode 100644 index 000000000..548d160ea --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml @@ -0,0 +1,230 @@ +# This is a 2016 target year specific implementation of GHG_national_m1 +# This is a Summary level model +# All parameters add year specific data when needed to implement for 2016 +# GHGI FBA table names match the 2022 GHGI Report +# MECS year is 2018 + +!include:GHG_national_m1_common.yaml +ghgi_year: &ghgi_year 2016 +mecs_year: &mecs_year 2018 + +_industrial_allocation_dict: &industrial_dict + energy_fba: 'EIA_MECS_Energy' + year: *mecs_year + ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table + +source_names: + "EPA_GHGI_T_2_1": #U.S. GHG emissions + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 + year: *ghgi_year + + "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 + year: *ghgi_year + "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 + year: *ghgi_year + "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 + year: *ghgi_year + "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 + year: *ghgi_year + "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 + year: *ghgi_year + "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 + year: *ghgi_year + "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 + year: *ghgi_year + "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 + year: *ghgi_year + "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 + year: *ghgi_year + "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 + year: *ghgi_year + "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 + year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets + petroleum_fuels: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 + year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets + petroleum_fuels_diesel: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + petroleum_fuels_gasoline: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + + construction_and_mining: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + farm_non_road: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + other_non_road: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + alt_fuel_on_road: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 + + "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 + year: *ghgi_year + "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 + year: *ghgi_year + "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 + year: *ghgi_year + "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 + year: *ghgi_year + + "EPA_GHGI_T_A_97": # HFCs from Transportation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 + year: *ghgi_year + "EPA_GHGI_T_4_80": # PFCs from aluminum production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 + year: *ghgi_year + "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_86 + year: *ghgi_year + "EPA_GHGI_T_3_22b": #Fossil fuel for non-energy uses + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + year: *ghgi_year + activity_sets: # Update EIA_MECS year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets + petroleum_neu: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas_neu: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + transportation_lubricants: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + +### Major CO2 Sources + "EPA_GHGI_T_A_9": # CO2 emissions from stationary combustion. This table number varies by GHG year. + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: # Update EIA_MECS and BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + non_manufacturing_natural_gas: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + coal_manufacturing_co2: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + petroleum: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: # Update EIA_MECS and BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + + fuel_oil: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + natural_gas_nonmanufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + coal_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + ng_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + "EPA_GHGI_T_3_9": *T_3_8 # N2O emissions from stationary combustion diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml new file mode 100644 index 000000000..6a865ee28 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml @@ -0,0 +1,230 @@ +# This is a 2017 target year specific implementation of GHG_national_m1 +# This is a Summary level model +# All parameters add year specific data when needed to implement for 2017 +# GHGI FBA table names match the 2022 GHGI Report +# MECS year is 2018 + +!include:GHG_national_m1_common.yaml +ghgi_year: &ghgi_year 2017 +mecs_year: &mecs_year 2018 + +_industrial_allocation_dict: &industrial_dict + energy_fba: 'EIA_MECS_Energy' + year: *mecs_year + ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table + +source_names: + "EPA_GHGI_T_2_1": #U.S. GHG emissions + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 + year: *ghgi_year + + "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 + year: *ghgi_year + "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 + year: *ghgi_year + "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 + year: *ghgi_year + "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 + year: *ghgi_year + "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 + year: *ghgi_year + "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 + year: *ghgi_year + "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 + year: *ghgi_year + "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 + year: *ghgi_year + "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 + year: *ghgi_year + "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 + year: *ghgi_year + "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 + year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets + petroleum_fuels: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 + year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets + petroleum_fuels_diesel: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + petroleum_fuels_gasoline: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + + construction_and_mining: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + farm_non_road: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + other_non_road: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + alt_fuel_on_road: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 + + "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 + year: *ghgi_year + "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 + year: *ghgi_year + "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 + year: *ghgi_year + "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 + year: *ghgi_year + + "EPA_GHGI_T_A_97": # HFCs from Transportation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 + year: *ghgi_year + "EPA_GHGI_T_4_80": # PFCs from aluminum production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 + year: *ghgi_year + "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_86 + year: *ghgi_year + "EPA_GHGI_T_3_22b": #Fossil fuel for non-energy uses + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + year: *ghgi_year + activity_sets: # Update EIA_MECS year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets + petroleum_neu: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas_neu: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + transportation_lubricants: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + +### Major CO2 Sources + "EPA_GHGI_T_A_8": # CO2 emissions from stationary combustion. This table number varies by GHG year. + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: # Update EIA_MECS and BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + non_manufacturing_natural_gas: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + coal_manufacturing_co2: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + petroleum: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: # Update EIA_MECS and BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + + fuel_oil: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + natural_gas_nonmanufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + coal_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + ng_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + "EPA_GHGI_T_3_9": *T_3_8 # N2O emissions from stationary combustion diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml new file mode 100644 index 000000000..bfa753c74 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml @@ -0,0 +1,230 @@ +# This is a 2018 target year specific implementation of GHG_national_m1 +# This is a Summary level model +# All parameters add year specific data when needed to implement for 2018 +# GHGI FBA table names match the 2022 GHGI Report +# MECS year is 2018 + +!include:GHG_national_m1_common.yaml +ghgi_year: &ghgi_year 2018 +mecs_year: &mecs_year 2018 + +_industrial_allocation_dict: &industrial_dict + energy_fba: 'EIA_MECS_Energy' + year: *mecs_year + ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table + +source_names: + "EPA_GHGI_T_2_1": #U.S. GHG emissions + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 + year: *ghgi_year + + "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 + year: *ghgi_year + "EPA_GHGI_T_3_70": #CO2 from Natural Gas Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_70 + year: *ghgi_year + "EPA_GHGI_T_3_72": #N2O from Natural Gas Systems, not used in original method, mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_72 + year: *ghgi_year + "EPA_GHGI_T_3_42": #CH4 from Petroleum Systems + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_42 + year: *ghgi_year + "EPA_GHGI_T_3_44": #CO2 from Petroleum Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_44 + year: *ghgi_year + "EPA_GHGI_T_3_46": #N2O from Petroleum Systems mimics CH4 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_46 + year: *ghgi_year + "EPA_GHGI_T_5_28": #CH4, N2O, CO and NOx from field burning of residues + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_28 + year: *ghgi_year + "EPA_GHGI_T_5_3": #CH4 from Enteric Fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_3 + year: *ghgi_year + "EPA_GHGI_T_5_6": #CH4 and N2O from manure, mimics enteric fermentation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_6 + year: *ghgi_year + "EPA_GHGI_T_5_17": #Direct N2O emissions from agricultural soils + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_17 + year: *ghgi_year + "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 + year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets + petroleum_fuels: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 + year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets + petroleum_fuels_diesel: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + petroleum_fuels_gasoline: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + + construction_and_mining: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + farm_non_road: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + other_non_road: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + alt_fuel_on_road: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 + + "EPA_GHGI_T_4_46": #CO2 for selected petrochemicals + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_46 + year: *ghgi_year + "EPA_GHGI_T_4_50": # HFCs from HCFC-22 production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_50 + year: *ghgi_year + "EPA_GHGI_T_4_96": # HFCs and other emissions from electronics manufacture + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_96 + year: *ghgi_year + "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 + year: *ghgi_year + + "EPA_GHGI_T_A_97": # HFCs from Transportation + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 + year: *ghgi_year + "EPA_GHGI_T_4_80": # PFCs from aluminum production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_80 + year: *ghgi_year + "EPA_GHGI_T_4_86": # HFCs, SF6, CO2 from magnesium production + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_86 + year: *ghgi_year + "EPA_GHGI_T_3_22b": #Fossil fuel for non-energy uses + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + year: *ghgi_year + activity_sets: # Update EIA_MECS year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets + petroleum_neu: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas_neu: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + transportation_lubricants: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + +### Major CO2 Sources + "EPA_GHGI_T_A_7": # CO2 emissions from stationary combustion. This table number varies by GHG year. + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: # Update EIA_MECS and BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + non_manufacturing_natural_gas: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + coal_manufacturing_co2: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy + year: *mecs_year + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + petroleum: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 + year: *ghgi_year + clean_parameter: *industrial_dict + activity_sets: # Update EIA_MECS and BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + + fuel_oil: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + natural_gas_nonmanufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing + attribution_source: + BEA_Summary_Use_PRO_BeforeRedef: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + coal_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + ng_manufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + "EPA_GHGI_T_3_9": *T_3_8 # N2O emissions from stationary combustion From c82af3f02b58a4b8c91a7e58492ef5b7d1617920 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 20 Sep 2023 09:36:40 -0400 Subject: [PATCH 0987/1127] add A_13 to source names for 2012 state models --- .../flowbysectormethods/GHG_state_m1_common.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml index 5d3a2a559..79db8e57c 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml @@ -4,14 +4,14 @@ !include:USEEIO_summary_target.yaml -year: &ghg_year 2019 +# year: &ghg_year 2019 geoscale: state source_names: EPA_StateGHGI: ## Directly sourced from State Inventory FBA geoscale: state - year: *ghg_year + # year: *ghg_year fedefl_mapping: GHGI activity_sets: direct: @@ -63,7 +63,7 @@ source_names: attribution_method: direct GHG_national_common_m1: #U.S. GHG emissions, summary model - year: *ghg_year + # year: *ghg_year data_format: FBS geoscale: national activity_sets: @@ -375,6 +375,7 @@ source_names: - 'EPA_GHGI_T_A_10.direct_attribution' - 'EPA_GHGI_T_A_11.direct_attribution' - 'EPA_GHGI_T_A_12.direct_attribution' + - 'EPA_GHGI_T_A_13.direct_attribution' attribution_method: proportional attribute_on: ['Flowable', 'SectorProducedBy'] fill_columns: Location @@ -404,6 +405,8 @@ source_names: - 'EPA_GHGI_T_A_11.coal_manufacturing_co2' - 'EPA_GHGI_T_A_12.non_manufacturing_coal' - 'EPA_GHGI_T_A_12.coal_manufacturing_co2' + - 'EPA_GHGI_T_A_13.non_manufacturing_coal' + - 'EPA_GHGI_T_A_13.coal_manufacturing_co2' attribution_method: proportional attribute_on: ['Flowable', 'SectorProducedBy'] fill_columns: Location @@ -433,6 +436,8 @@ source_names: - 'EPA_GHGI_T_A_11.natural_gas_manufacturing' - 'EPA_GHGI_T_A_12.non_manufacturing_natural_gas' - 'EPA_GHGI_T_A_12.natural_gas_manufacturing' + - 'EPA_GHGI_T_A_13.non_manufacturing_natural_gas' + - 'EPA_GHGI_T_A_13.natural_gas_manufacturing' attribution_method: proportional attribute_on: ['Flowable', 'SectorProducedBy'] fill_columns: Location @@ -454,6 +459,7 @@ source_names: - 'EPA_GHGI_T_A_10.petroleum' - 'EPA_GHGI_T_A_11.petroleum' - 'EPA_GHGI_T_A_12.petroleum' + - 'EPA_GHGI_T_A_13.petroleum' attribution_method: proportional attribute_on: ['Flowable', 'SectorProducedBy'] fill_columns: Location From f77ccffebb36b014c2e724e73ce6daf0df77675f Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 20 Sep 2023 09:38:56 -0400 Subject: [PATCH 0988/1127] re-add 2012-2018 state models (based on national summary m1) --- .../GHG_state_2012_m1.yaml | 21 +++++++++++++++++++ .../GHG_state_2013_m1.yaml | 21 +++++++++++++++++++ .../GHG_state_2014_m1.yaml | 21 +++++++++++++++++++ .../GHG_state_2015_m1.yaml | 21 +++++++++++++++++++ .../GHG_state_2016_m1.yaml | 21 +++++++++++++++++++ .../GHG_state_2017_m1.yaml | 21 +++++++++++++++++++ .../GHG_state_2018_m1.yaml | 21 +++++++++++++++++++ 7 files changed, 147 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2012_m1.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2013_m1.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2014_m1.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2015_m1.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2016_m1.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2017_m1.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_state_2018_m1.yaml diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2012_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2012_m1.yaml new file mode 100644 index 000000000..bf482ed75 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_state_2012_m1.yaml @@ -0,0 +1,21 @@ +## Method 1 uses as its source the national GHG Flow-by-sector (summary) +# with emissions data attributed to states based on reported emissions +# in the State Inventory + + +!include:GHG_state_m1_common.yaml +year: &ghg_year 2012 +geoscale: state + + +source_names: +## Directly sourced from State Inventory + EPA_StateGHGI: + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI + year: *ghg_year + activity_sets: + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets + + GHG_national_2012_m1: #U.S. GHG emissions, summary model + !include:GHG_state_m1_common.yaml:source_names:GHG_national_common_m1 + year: *ghg_year diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2013_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2013_m1.yaml new file mode 100644 index 000000000..b95ebf768 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_state_2013_m1.yaml @@ -0,0 +1,21 @@ +## Method 1 uses as its source the national GHG Flow-by-sector (summary) +# with emissions data attributed to states based on reported emissions +# in the State Inventory + + +!include:GHG_state_m1_common.yaml +year: &ghg_year 2013 +geoscale: state + + +source_names: +## Directly sourced from State Inventory + EPA_StateGHGI: + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI + year: *ghg_year + activity_sets: + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets + + GHG_national_2013_m1: #U.S. GHG emissions, summary model + !include:GHG_state_m1_common.yaml:source_names:GHG_national_common_m1 + year: *ghg_year diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2014_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2014_m1.yaml new file mode 100644 index 000000000..35cb904ea --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_state_2014_m1.yaml @@ -0,0 +1,21 @@ +## Method 1 uses as its source the national GHG Flow-by-sector (summary) +# with emissions data attributed to states based on reported emissions +# in the State Inventory + + +!include:GHG_state_m1_common.yaml +year: &ghg_year 2014 +geoscale: state + + +source_names: +## Directly sourced from State Inventory + EPA_StateGHGI: + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI + year: *ghg_year + activity_sets: + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets + + GHG_national_2014_m1: #U.S. GHG emissions, summary model + !include:GHG_state_m1_common.yaml:source_names:GHG_national_common_m1 + year: *ghg_year diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2015_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2015_m1.yaml new file mode 100644 index 000000000..555d76a6f --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_state_2015_m1.yaml @@ -0,0 +1,21 @@ +## Method 1 uses as its source the national GHG Flow-by-sector (summary) +# with emissions data attributed to states based on reported emissions +# in the State Inventory + + +!include:GHG_state_m1_common.yaml +year: &ghg_year 2015 +geoscale: state + + +source_names: +## Directly sourced from State Inventory + EPA_StateGHGI: + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI + year: *ghg_year + activity_sets: + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets + + GHG_national_2015_m1: #U.S. GHG emissions, summary model + !include:GHG_state_m1_common.yaml:source_names:GHG_national_common_m1 + year: *ghg_year diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2016_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2016_m1.yaml new file mode 100644 index 000000000..55855f473 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_state_2016_m1.yaml @@ -0,0 +1,21 @@ +## Method 1 uses as its source the national GHG Flow-by-sector (summary) +# with emissions data attributed to states based on reported emissions +# in the State Inventory + + +!include:GHG_state_m1_common.yaml +year: &ghg_year 2016 +geoscale: state + + +source_names: +## Directly sourced from State Inventory + EPA_StateGHGI: + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI + year: *ghg_year + activity_sets: + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets + + GHG_national_2016_m1: #U.S. GHG emissions, summary model + !include:GHG_state_m1_common.yaml:source_names:GHG_national_common_m1 + year: *ghg_year diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2017_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2017_m1.yaml new file mode 100644 index 000000000..0184fe39a --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_state_2017_m1.yaml @@ -0,0 +1,21 @@ +## Method 1 uses as its source the national GHG Flow-by-sector (summary) +# with emissions data attributed to states based on reported emissions +# in the State Inventory + + +!include:GHG_state_m1_common.yaml +year: &ghg_year 2017 +geoscale: state + + +source_names: +## Directly sourced from State Inventory + EPA_StateGHGI: + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI + year: *ghg_year + activity_sets: + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets + + GHG_national_2017_m1: #U.S. GHG emissions, summary model + !include:GHG_state_m1_common.yaml:source_names:GHG_national_common_m1 + year: *ghg_year diff --git a/flowsa/methods/flowbysectormethods/GHG_state_2018_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_state_2018_m1.yaml new file mode 100644 index 000000000..c0b40e571 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_state_2018_m1.yaml @@ -0,0 +1,21 @@ +## Method 1 uses as its source the national GHG Flow-by-sector (summary) +# with emissions data attributed to states based on reported emissions +# in the State Inventory + + +!include:GHG_state_m1_common.yaml +year: &ghg_year 2018 +geoscale: state + + +source_names: +## Directly sourced from State Inventory + EPA_StateGHGI: + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI + year: *ghg_year + activity_sets: + !include:GHG_state_m1_common.yaml:source_names:EPA_StateGHGI:activity_sets + + GHG_national_2018_m1: #U.S. GHG emissions, summary model + !include:GHG_state_m1_common.yaml:source_names:GHG_national_common_m1 + year: *ghg_year From faf2c012a44caf36108ccbad22b0e684705f0011 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 20 Sep 2023 10:03:33 -0400 Subject: [PATCH 0989/1127] add national detail models (m2), 2012-2014 use USDA 2012 data --- .../GHG_national_2012_m2.yaml | 164 ++++++++++++++++++ .../GHG_national_2013_m2.yaml | 164 ++++++++++++++++++ .../GHG_national_2014_m2.yaml | 164 ++++++++++++++++++ .../GHG_national_2015_m2.yaml | 145 ++++++++++++++++ .../GHG_national_2016_m2.yaml | 145 ++++++++++++++++ .../GHG_national_2017_m2.yaml | 145 ++++++++++++++++ .../GHG_national_2018_m2.yaml | 145 ++++++++++++++++ 7 files changed, 1072 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2012_m2.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2013_m2.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2014_m2.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2015_m2.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2016_m2.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2017_m2.yaml create mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2018_m2.yaml diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2012_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2012_m2.yaml new file mode 100644 index 000000000..a4a40c91f --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_national_2012_m2.yaml @@ -0,0 +1,164 @@ +# This is a 2012 target year specific implementation of GHG_national_m2 +# All parameters add year specific data when needed to implement for 2012 +# GHGI FBA table names match the 2022 GHGI Report +# MECS year is 2014 +# CoA year is 2012 + +!include:GHG_national_m2_common.yaml +ghgi_year: &ghgi_year 2012 +mecs_year: &mecs_year 2014 +coa_year: &coa_year 2012 + +source_names: + GHG_national_2012_m1: # National Summary model + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1 + year: *ghgi_year + activity_sets: # Update MECS and CoA year for some activity sets + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets + + cropland: # allocated based on USDA land area harvested + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:cropland + attribution_source: + USDA_CoA_Cropland: + !include:GHG_national_m2_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland + year: *coa_year + attribution_source: + USDA_CoA_Cropland_NAICS: + !include:GHG_national_m2_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland:attribution_source:USDA_CoA_Cropland_NAICS + year: *coa_year + + pasture: # allocated based on USDA Animal operation land (acres) + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:pasture + attribution_source: + USDA_CoA_Cropland_NAICS: + !include:GHG_national_m2_common.yaml:attribution_sources:_animal_land_allocation:USDA_CoA_Cropland_NAICS + year: *coa_year + + coal_manufacturing_co2: # Industrial Coal for Manufacturing + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy + year: *mecs_year + + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + coal_manufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + ng_manufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + petroleum_neu: # consumed petroleum products + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + + natural_gas_neu: # consumed nat gas to chemical plants + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + + + EPA_GHGI_T_2_1: #U.S. GHG emissions + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 + year: *ghgi_year + EPA_GHGI_T_3_68: #CH4 from Natural Gas Systems + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_68 + year: *ghgi_year + EPA_GHGI_T_3_70: #CO2 from Natural Gas Systems mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_70 + year: *ghgi_year + EPA_GHGI_T_3_72: #N2O from Natural Gas Systems, not used in original method, mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_72 + year: *ghgi_year + + EPA_GHGI_T_3_42: #CH4 from Petroleum Systems + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_42 + year: *ghgi_year + EPA_GHGI_T_3_44: #CO2 from Petroleum Systems mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_44 + year: *ghgi_year + EPA_GHGI_T_3_46: #N2O from Petroleum Systems, not in prior method, mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_46 + year: *ghgi_year + +## Agriculture + EPA_GHGI_T_5_28: #CH4, N2O, CO and NOx from field burning of residues + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_28 + year: *ghgi_year + EPA_GHGI_T_5_3: #CH4 from Enteric Fermentation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_3 + year: *ghgi_year + EPA_GHGI_T_5_6: #CH4 and N2O from manure, mimics enteric fermentation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_6 + year: *ghgi_year + +## Mobile Sources + EPA_GHGI_T_3_13: #CO2 from mobile combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year + EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14 + year: *ghgi_year + EPA_GHGI_T_3_15: #N2O from mobile combustion duplicates method for CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_15 + year: *ghgi_year + +## Stationary Combustion + EPA_GHGI_T_A_13: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion + year: *ghgi_year + EPA_GHGI_T_3_8: # CH4 emissions from stationary combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8 + year: *ghgi_year + EPA_GHGI_T_3_9: # N2O emissions from stationary combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_9 + year: *ghgi_year + +## Other sources + EPA_GHGI_T_4_46: #CO2 for selected petrochemicals + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_46 + year: *ghgi_year + + EPA_GHGI_T_3_22b: # Fossil fuel for non-energy uses + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + year: *ghgi_year + +## Other Emissions + EPA_GHGI_T_4_50: # HFCs from HCFC-22 production + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_50 + year: *ghgi_year + + EPA_GHGI_T_4_96: # HFCs and other emissions from electronics manufacture + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_96 + year: *ghgi_year + + EPA_GHGI_T_4_102: # HFCs and PFCs from ODS Substitutes + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102 + year: *ghgi_year + + EPA_GHGI_T_A_97: # HFCs from Transportation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_A_97 + year: *ghgi_year + + EPA_GHGI_T_4_80: # PFCs from aluminum production + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_80 + year: *ghgi_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2013_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2013_m2.yaml new file mode 100644 index 000000000..96317a8bf --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_national_2013_m2.yaml @@ -0,0 +1,164 @@ +# This is a 2013 target year specific implementation of GHG_national_m2 +# All parameters add year specific data when needed to implement for 2013 +# GHGI FBA table names match the 2022 GHGI Report +# MECS year is 2014 +# CoA year is 2012 + +!include:GHG_national_m2_common.yaml +ghgi_year: &ghgi_year 2013 +mecs_year: &mecs_year 2014 +coa_year: &coa_year 2012 + +source_names: + GHG_national_2013_m1: # National Summary model + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1 + year: *ghgi_year + activity_sets: # Update MECS and CoA year for some activity sets + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets + + cropland: # allocated based on USDA land area harvested + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:cropland + attribution_source: + USDA_CoA_Cropland: + !include:GHG_national_m2_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland + year: *coa_year + attribution_source: + USDA_CoA_Cropland_NAICS: + !include:GHG_national_m2_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland:attribution_source:USDA_CoA_Cropland_NAICS + year: *coa_year + + pasture: # allocated based on USDA Animal operation land (acres) + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:pasture + attribution_source: + USDA_CoA_Cropland_NAICS: + !include:GHG_national_m2_common.yaml:attribution_sources:_animal_land_allocation:USDA_CoA_Cropland_NAICS + year: *coa_year + + coal_manufacturing_co2: # Industrial Coal for Manufacturing + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy + year: *mecs_year + + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + coal_manufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + ng_manufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + petroleum_neu: # consumed petroleum products + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + + natural_gas_neu: # consumed nat gas to chemical plants + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + + + EPA_GHGI_T_2_1: #U.S. GHG emissions + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 + year: *ghgi_year + EPA_GHGI_T_3_68: #CH4 from Natural Gas Systems + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_68 + year: *ghgi_year + EPA_GHGI_T_3_70: #CO2 from Natural Gas Systems mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_70 + year: *ghgi_year + EPA_GHGI_T_3_72: #N2O from Natural Gas Systems, not used in original method, mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_72 + year: *ghgi_year + + EPA_GHGI_T_3_42: #CH4 from Petroleum Systems + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_42 + year: *ghgi_year + EPA_GHGI_T_3_44: #CO2 from Petroleum Systems mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_44 + year: *ghgi_year + EPA_GHGI_T_3_46: #N2O from Petroleum Systems, not in prior method, mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_46 + year: *ghgi_year + +## Agriculture + EPA_GHGI_T_5_28: #CH4, N2O, CO and NOx from field burning of residues + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_28 + year: *ghgi_year + EPA_GHGI_T_5_3: #CH4 from Enteric Fermentation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_3 + year: *ghgi_year + EPA_GHGI_T_5_6: #CH4 and N2O from manure, mimics enteric fermentation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_6 + year: *ghgi_year + +## Mobile Sources + EPA_GHGI_T_3_13: #CO2 from mobile combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year + EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14 + year: *ghgi_year + EPA_GHGI_T_3_15: #N2O from mobile combustion duplicates method for CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_15 + year: *ghgi_year + +## Stationary Combustion + EPA_GHGI_T_A_12: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion + year: *ghgi_year + EPA_GHGI_T_3_8: # CH4 emissions from stationary combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8 + year: *ghgi_year + EPA_GHGI_T_3_9: # N2O emissions from stationary combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_9 + year: *ghgi_year + +## Other sources + EPA_GHGI_T_4_46: #CO2 for selected petrochemicals + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_46 + year: *ghgi_year + + EPA_GHGI_T_3_22b: # Fossil fuel for non-energy uses + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + year: *ghgi_year + +## Other Emissions + EPA_GHGI_T_4_50: # HFCs from HCFC-22 production + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_50 + year: *ghgi_year + + EPA_GHGI_T_4_96: # HFCs and other emissions from electronics manufacture + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_96 + year: *ghgi_year + + EPA_GHGI_T_4_102: # HFCs and PFCs from ODS Substitutes + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102 + year: *ghgi_year + + EPA_GHGI_T_A_97: # HFCs from Transportation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_A_97 + year: *ghgi_year + + EPA_GHGI_T_4_80: # PFCs from aluminum production + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_80 + year: *ghgi_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2014_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2014_m2.yaml new file mode 100644 index 000000000..e776fb1a4 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_national_2014_m2.yaml @@ -0,0 +1,164 @@ +# This is a 2014 target year specific implementation of GHG_national_m2 +# All parameters add year specific data when needed to implement for 2014 +# GHGI FBA table names match the 2022 GHGI Report +# MECS year is 2014 +# CoA year is 2012 + +!include:GHG_national_m2_common.yaml +ghgi_year: &ghgi_year 2014 +mecs_year: &mecs_year 2014 +coa_year: &coa_year 2012 + +source_names: + GHG_national_2014_m1: # National Summary model + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1 + year: *ghgi_year + activity_sets: # Update MECS and CoA year for some activity sets + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets + + cropland: # allocated based on USDA land area harvested + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:cropland + attribution_source: + USDA_CoA_Cropland: + !include:GHG_national_m2_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland + year: *coa_year + attribution_source: + USDA_CoA_Cropland_NAICS: + !include:GHG_national_m2_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland:attribution_source:USDA_CoA_Cropland_NAICS + year: *coa_year + + pasture: # allocated based on USDA Animal operation land (acres) + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:pasture + attribution_source: + USDA_CoA_Cropland_NAICS: + !include:GHG_national_m2_common.yaml:attribution_sources:_animal_land_allocation:USDA_CoA_Cropland_NAICS + year: *coa_year + + coal_manufacturing_co2: # Industrial Coal for Manufacturing + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy + year: *mecs_year + + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + coal_manufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + ng_manufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + petroleum_neu: # consumed petroleum products + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + + natural_gas_neu: # consumed nat gas to chemical plants + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + + + EPA_GHGI_T_2_1: #U.S. GHG emissions + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 + year: *ghgi_year + EPA_GHGI_T_3_68: #CH4 from Natural Gas Systems + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_68 + year: *ghgi_year + EPA_GHGI_T_3_70: #CO2 from Natural Gas Systems mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_70 + year: *ghgi_year + EPA_GHGI_T_3_72: #N2O from Natural Gas Systems, not used in original method, mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_72 + year: *ghgi_year + + EPA_GHGI_T_3_42: #CH4 from Petroleum Systems + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_42 + year: *ghgi_year + EPA_GHGI_T_3_44: #CO2 from Petroleum Systems mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_44 + year: *ghgi_year + EPA_GHGI_T_3_46: #N2O from Petroleum Systems, not in prior method, mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_46 + year: *ghgi_year + +## Agriculture + EPA_GHGI_T_5_28: #CH4, N2O, CO and NOx from field burning of residues + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_28 + year: *ghgi_year + EPA_GHGI_T_5_3: #CH4 from Enteric Fermentation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_3 + year: *ghgi_year + EPA_GHGI_T_5_6: #CH4 and N2O from manure, mimics enteric fermentation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_6 + year: *ghgi_year + +## Mobile Sources + EPA_GHGI_T_3_13: #CO2 from mobile combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year + EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14 + year: *ghgi_year + EPA_GHGI_T_3_15: #N2O from mobile combustion duplicates method for CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_15 + year: *ghgi_year + +## Stationary Combustion + EPA_GHGI_T_A_11: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion + year: *ghgi_year + EPA_GHGI_T_3_8: # CH4 emissions from stationary combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8 + year: *ghgi_year + EPA_GHGI_T_3_9: # N2O emissions from stationary combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_9 + year: *ghgi_year + +## Other sources + EPA_GHGI_T_4_46: #CO2 for selected petrochemicals + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_46 + year: *ghgi_year + + EPA_GHGI_T_3_22b: # Fossil fuel for non-energy uses + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + year: *ghgi_year + +## Other Emissions + EPA_GHGI_T_4_50: # HFCs from HCFC-22 production + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_50 + year: *ghgi_year + + EPA_GHGI_T_4_96: # HFCs and other emissions from electronics manufacture + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_96 + year: *ghgi_year + + EPA_GHGI_T_4_102: # HFCs and PFCs from ODS Substitutes + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102 + year: *ghgi_year + + EPA_GHGI_T_A_97: # HFCs from Transportation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_A_97 + year: *ghgi_year + + EPA_GHGI_T_4_80: # PFCs from aluminum production + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_80 + year: *ghgi_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2015_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2015_m2.yaml new file mode 100644 index 000000000..79a78eac9 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_national_2015_m2.yaml @@ -0,0 +1,145 @@ +# This is a 2015 target year specific implementation of GHG_national_m2 +# All parameters add year specific data when needed to implement for 2015 +# GHGI FBA table names match the 2022 GHGI Report +# MECS year is 2014 +# CoA year is 2017 + +!include:GHG_national_m2_common.yaml +ghgi_year: &ghgi_year 2015 +mecs_year: &mecs_year 2014 + +source_names: + GHG_national_2015_m1: # National Summary model + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1 + year: *ghgi_year + activity_sets: # Update MECS year for some activity sets + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets + + coal_manufacturing_co2: # Industrial Coal for Manufacturing + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy + year: *mecs_year + + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + coal_manufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + ng_manufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + petroleum_neu: # consumed petroleum products + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + + natural_gas_neu: # consumed nat gas to chemical plants + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + + + EPA_GHGI_T_2_1: #U.S. GHG emissions + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 + year: *ghgi_year + EPA_GHGI_T_3_68: #CH4 from Natural Gas Systems + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_68 + year: *ghgi_year + EPA_GHGI_T_3_70: #CO2 from Natural Gas Systems mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_70 + year: *ghgi_year + EPA_GHGI_T_3_72: #N2O from Natural Gas Systems, not used in original method, mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_72 + year: *ghgi_year + + EPA_GHGI_T_3_42: #CH4 from Petroleum Systems + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_42 + year: *ghgi_year + EPA_GHGI_T_3_44: #CO2 from Petroleum Systems mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_44 + year: *ghgi_year + EPA_GHGI_T_3_46: #N2O from Petroleum Systems, not in prior method, mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_46 + year: *ghgi_year + +## Agriculture + EPA_GHGI_T_5_28: #CH4, N2O, CO and NOx from field burning of residues + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_28 + year: *ghgi_year + EPA_GHGI_T_5_3: #CH4 from Enteric Fermentation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_3 + year: *ghgi_year + EPA_GHGI_T_5_6: #CH4 and N2O from manure, mimics enteric fermentation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_6 + year: *ghgi_year + +## Mobile Sources + EPA_GHGI_T_3_13: #CO2 from mobile combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year + EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14 + year: *ghgi_year + EPA_GHGI_T_3_15: #N2O from mobile combustion duplicates method for CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_15 + year: *ghgi_year + +## Stationary Combustion + EPA_GHGI_T_A_10: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion + year: *ghgi_year + EPA_GHGI_T_3_8: # CH4 emissions from stationary combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8 + year: *ghgi_year + EPA_GHGI_T_3_9: # N2O emissions from stationary combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_9 + year: *ghgi_year + +## Other sources + EPA_GHGI_T_4_46: #CO2 for selected petrochemicals + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_46 + year: *ghgi_year + + EPA_GHGI_T_3_22b: # Fossil fuel for non-energy uses + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + year: *ghgi_year + +## Other Emissions + EPA_GHGI_T_4_50: # HFCs from HCFC-22 production + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_50 + year: *ghgi_year + + EPA_GHGI_T_4_96: # HFCs and other emissions from electronics manufacture + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_96 + year: *ghgi_year + + EPA_GHGI_T_4_102: # HFCs and PFCs from ODS Substitutes + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102 + year: *ghgi_year + + EPA_GHGI_T_A_97: # HFCs from Transportation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_A_97 + year: *ghgi_year + + EPA_GHGI_T_4_80: # PFCs from aluminum production + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_80 + year: *ghgi_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2016_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2016_m2.yaml new file mode 100644 index 000000000..602285838 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_national_2016_m2.yaml @@ -0,0 +1,145 @@ +# This is a 2016 target year specific implementation of GHG_national_m2 +# All parameters add year specific data when needed to implement for 2016 +# GHGI FBA table names match the 2022 GHGI Report +# MECS year is 2018 +# CoA year is 2017 + +!include:GHG_national_m2_common.yaml +ghgi_year: &ghgi_year 2016 +mecs_year: &mecs_year 2018 + +source_names: + GHG_national_2016_m1: # National Summary model + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1 + year: *ghgi_year + activity_sets: # Update MECS year for some activity sets + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets + + coal_manufacturing_co2: # Industrial Coal for Manufacturing + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy + year: *mecs_year + + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + coal_manufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + ng_manufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + petroleum_neu: # consumed petroleum products + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + + natural_gas_neu: # consumed nat gas to chemical plants + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + + + EPA_GHGI_T_2_1: #U.S. GHG emissions + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 + year: *ghgi_year + EPA_GHGI_T_3_68: #CH4 from Natural Gas Systems + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_68 + year: *ghgi_year + EPA_GHGI_T_3_70: #CO2 from Natural Gas Systems mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_70 + year: *ghgi_year + EPA_GHGI_T_3_72: #N2O from Natural Gas Systems, not used in original method, mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_72 + year: *ghgi_year + + EPA_GHGI_T_3_42: #CH4 from Petroleum Systems + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_42 + year: *ghgi_year + EPA_GHGI_T_3_44: #CO2 from Petroleum Systems mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_44 + year: *ghgi_year + EPA_GHGI_T_3_46: #N2O from Petroleum Systems, not in prior method, mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_46 + year: *ghgi_year + +## Agriculture + EPA_GHGI_T_5_28: #CH4, N2O, CO and NOx from field burning of residues + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_28 + year: *ghgi_year + EPA_GHGI_T_5_3: #CH4 from Enteric Fermentation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_3 + year: *ghgi_year + EPA_GHGI_T_5_6: #CH4 and N2O from manure, mimics enteric fermentation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_6 + year: *ghgi_year + +## Mobile Sources + EPA_GHGI_T_3_13: #CO2 from mobile combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year + EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14 + year: *ghgi_year + EPA_GHGI_T_3_15: #N2O from mobile combustion duplicates method for CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_15 + year: *ghgi_year + +## Stationary Combustion + EPA_GHGI_T_A_9: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion + year: *ghgi_year + EPA_GHGI_T_3_8: # CH4 emissions from stationary combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8 + year: *ghgi_year + EPA_GHGI_T_3_9: # N2O emissions from stationary combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_9 + year: *ghgi_year + +## Other sources + EPA_GHGI_T_4_46: #CO2 for selected petrochemicals + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_46 + year: *ghgi_year + + EPA_GHGI_T_3_22b: # Fossil fuel for non-energy uses + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + year: *ghgi_year + +## Other Emissions + EPA_GHGI_T_4_50: # HFCs from HCFC-22 production + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_50 + year: *ghgi_year + + EPA_GHGI_T_4_96: # HFCs and other emissions from electronics manufacture + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_96 + year: *ghgi_year + + EPA_GHGI_T_4_102: # HFCs and PFCs from ODS Substitutes + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102 + year: *ghgi_year + + EPA_GHGI_T_A_97: # HFCs from Transportation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_A_97 + year: *ghgi_year + + EPA_GHGI_T_4_80: # PFCs from aluminum production + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_80 + year: *ghgi_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2017_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2017_m2.yaml new file mode 100644 index 000000000..9f332f3ca --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_national_2017_m2.yaml @@ -0,0 +1,145 @@ +# This is a 2017 target year specific implementation of GHG_national_m2 +# All parameters add year specific data when needed to implement for 2017 +# GHGI FBA table names match the 2022 GHGI Report +# MECS year is 2018 +# CoA year is 2017 + +!include:GHG_national_m2_common.yaml +ghgi_year: &ghgi_year 2017 +mecs_year: &mecs_year 2018 + +source_names: + GHG_national_2017_m1: # National Summary model + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1 + year: *ghgi_year + activity_sets: # Update MECS year for some activity sets + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets + + coal_manufacturing_co2: # Industrial Coal for Manufacturing + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy + year: *mecs_year + + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + coal_manufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + ng_manufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + petroleum_neu: # consumed petroleum products + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + + natural_gas_neu: # consumed nat gas to chemical plants + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + + + EPA_GHGI_T_2_1: #U.S. GHG emissions + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 + year: *ghgi_year + EPA_GHGI_T_3_68: #CH4 from Natural Gas Systems + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_68 + year: *ghgi_year + EPA_GHGI_T_3_70: #CO2 from Natural Gas Systems mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_70 + year: *ghgi_year + EPA_GHGI_T_3_72: #N2O from Natural Gas Systems, not used in original method, mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_72 + year: *ghgi_year + + EPA_GHGI_T_3_42: #CH4 from Petroleum Systems + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_42 + year: *ghgi_year + EPA_GHGI_T_3_44: #CO2 from Petroleum Systems mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_44 + year: *ghgi_year + EPA_GHGI_T_3_46: #N2O from Petroleum Systems, not in prior method, mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_46 + year: *ghgi_year + +## Agriculture + EPA_GHGI_T_5_28: #CH4, N2O, CO and NOx from field burning of residues + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_28 + year: *ghgi_year + EPA_GHGI_T_5_3: #CH4 from Enteric Fermentation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_3 + year: *ghgi_year + EPA_GHGI_T_5_6: #CH4 and N2O from manure, mimics enteric fermentation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_6 + year: *ghgi_year + +## Mobile Sources + EPA_GHGI_T_3_13: #CO2 from mobile combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year + EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14 + year: *ghgi_year + EPA_GHGI_T_3_15: #N2O from mobile combustion duplicates method for CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_15 + year: *ghgi_year + +## Stationary Combustion + EPA_GHGI_T_A_8: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion + year: *ghgi_year + EPA_GHGI_T_3_8: # CH4 emissions from stationary combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8 + year: *ghgi_year + EPA_GHGI_T_3_9: # N2O emissions from stationary combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_9 + year: *ghgi_year + +## Other sources + EPA_GHGI_T_4_46: #CO2 for selected petrochemicals + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_46 + year: *ghgi_year + + EPA_GHGI_T_3_22b: # Fossil fuel for non-energy uses + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + year: *ghgi_year + +## Other Emissions + EPA_GHGI_T_4_50: # HFCs from HCFC-22 production + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_50 + year: *ghgi_year + + EPA_GHGI_T_4_96: # HFCs and other emissions from electronics manufacture + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_96 + year: *ghgi_year + + EPA_GHGI_T_4_102: # HFCs and PFCs from ODS Substitutes + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102 + year: *ghgi_year + + EPA_GHGI_T_A_97: # HFCs from Transportation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_A_97 + year: *ghgi_year + + EPA_GHGI_T_4_80: # PFCs from aluminum production + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_80 + year: *ghgi_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2018_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2018_m2.yaml new file mode 100644 index 000000000..92207d5ed --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_national_2018_m2.yaml @@ -0,0 +1,145 @@ +# This is a 2018 target year specific implementation of GHG_national_m2 +# All parameters add year specific data when needed to implement for 2018 +# GHGI FBA table names match the 2022 GHGI Report +# MECS year is 2018 +# CoA year is 2017 + +!include:GHG_national_m2_common.yaml +ghgi_year: &ghgi_year 2018 +mecs_year: &mecs_year 2018 + +source_names: + GHG_national_2018_m1: # National Summary model + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1 + year: *ghgi_year + activity_sets: # Update MECS year for some activity sets + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets + + coal_manufacturing_co2: # Industrial Coal for Manufacturing + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy + year: *mecs_year + + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + coal_manufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + ng_manufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + petroleum_neu: # consumed petroleum products + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + + natural_gas_neu: # consumed nat gas to chemical plants + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + + + EPA_GHGI_T_2_1: #U.S. GHG emissions + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 + year: *ghgi_year + EPA_GHGI_T_3_68: #CH4 from Natural Gas Systems + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_68 + year: *ghgi_year + EPA_GHGI_T_3_70: #CO2 from Natural Gas Systems mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_70 + year: *ghgi_year + EPA_GHGI_T_3_72: #N2O from Natural Gas Systems, not used in original method, mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_72 + year: *ghgi_year + + EPA_GHGI_T_3_42: #CH4 from Petroleum Systems + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_42 + year: *ghgi_year + EPA_GHGI_T_3_44: #CO2 from Petroleum Systems mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_44 + year: *ghgi_year + EPA_GHGI_T_3_46: #N2O from Petroleum Systems, not in prior method, mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_46 + year: *ghgi_year + +## Agriculture + EPA_GHGI_T_5_28: #CH4, N2O, CO and NOx from field burning of residues + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_28 + year: *ghgi_year + EPA_GHGI_T_5_3: #CH4 from Enteric Fermentation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_3 + year: *ghgi_year + EPA_GHGI_T_5_6: #CH4 and N2O from manure, mimics enteric fermentation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_6 + year: *ghgi_year + +## Mobile Sources + EPA_GHGI_T_3_13: #CO2 from mobile combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year + EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14 + year: *ghgi_year + EPA_GHGI_T_3_15: #N2O from mobile combustion duplicates method for CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_15 + year: *ghgi_year + +## Stationary Combustion + EPA_GHGI_T_A_7: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion + year: *ghgi_year + EPA_GHGI_T_3_8: # CH4 emissions from stationary combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8 + year: *ghgi_year + EPA_GHGI_T_3_9: # N2O emissions from stationary combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_9 + year: *ghgi_year + +## Other sources + EPA_GHGI_T_4_46: #CO2 for selected petrochemicals + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_46 + year: *ghgi_year + + EPA_GHGI_T_3_22b: # Fossil fuel for non-energy uses + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + year: *ghgi_year + +## Other Emissions + EPA_GHGI_T_4_50: # HFCs from HCFC-22 production + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_50 + year: *ghgi_year + + EPA_GHGI_T_4_96: # HFCs and other emissions from electronics manufacture + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_96 + year: *ghgi_year + + EPA_GHGI_T_4_102: # HFCs and PFCs from ODS Substitutes + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102 + year: *ghgi_year + + EPA_GHGI_T_A_97: # HFCs from Transportation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_A_97 + year: *ghgi_year + + EPA_GHGI_T_4_80: # PFCs from aluminum production + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_80 + year: *ghgi_year From 5a6453b5309feb642e68d19d24b1660dcb59f8c4 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 20 Sep 2023 10:12:28 -0400 Subject: [PATCH 0990/1127] fix anchor --- .../GHG_national_m1_common.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml index 6d65d7806..8a278ed8e 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml @@ -110,7 +110,7 @@ source_names: attribution_method: proportional attribution_source: BEA_Detail_Make_BeforeRedef: - <<: *bea + <<: *bea_detail primary_action_type: Produced selection_fields: ActivityConsumedBy: {'221100': ''} # Electricity @@ -142,7 +142,7 @@ source_names: attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + <<: *bea_detail selection_fields: ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals @@ -157,7 +157,7 @@ source_names: attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + <<: *bea_detail selection_fields: ActivityProducedBy: {'325120': ''} # Industrial gases @@ -425,7 +425,7 @@ source_names: attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + <<: *bea_detail selection_fields: ActivityProducedBy: {'212100': ''} # purchases of coal @@ -519,7 +519,7 @@ source_names: attribution_method: proportional attribution_source: BEA_Detail_Make_BeforeRedef: - <<: *bea + <<: *bea_detail primary_action_type: Produced selection_fields: ActivityConsumedBy: {'221100': ''} # Electricity @@ -556,7 +556,7 @@ source_names: attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + <<: *bea_detail selection_fields: ActivityProducedBy: {'212100': ''} # purchases of coal @@ -723,7 +723,7 @@ source_names: attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + <<: *bea_detail selection_fields: ActivityProducedBy: {'333415': ''} # Air conditioning equipment @@ -734,7 +734,7 @@ source_names: attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + <<: *bea_detail selection_fields: ActivityProducedBy: {'333415': ''} # Air conditioning equipment @@ -745,7 +745,7 @@ source_names: attribution_method: proportional attribution_source: BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + <<: *bea_detail selection_fields: ActivityProducedBy: '326140': '' # Polystyrene foam From 590b8662356644c798c30be0ddd94f77f20a4aa7 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 20 Sep 2023 10:32:50 -0400 Subject: [PATCH 0991/1127] add 2020 national detail m2 --- .../GHG_national_2020_m2.yaml | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml new file mode 100644 index 000000000..6ee81cee1 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml @@ -0,0 +1,145 @@ +# This is a 2020 target year specific implementation of GHG_national_m2 +# All parameters add year specific data when needed to implement for 2020 +# GHGI FBA table names match the 2022 GHGI Report +# MECS year is 2018 +# CoA year is 2017 + +!include:GHG_national_m2_common.yaml +ghgi_year: &ghgi_year 2020 +mecs_year: &mecs_year 2018 + +source_names: + GHG_national_2020_m1: # National Summary model + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1 + year: *ghgi_year + activity_sets: # Update MECS year for some activity sets + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets + + coal_manufacturing_co2: # Industrial Coal for Manufacturing + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy + year: *mecs_year + + natural_gas_manufacturing: # Industrial Natural Gas for manufacturing + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + coal_manufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + ng_manufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy + year: *mecs_year + + petroleum_neu: # consumed petroleum products + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + + natural_gas_neu: # consumed nat gas to chemical plants + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu + attribution_source: + EIA_MECS_Energy: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy + year: *mecs_year + + + EPA_GHGI_T_2_1: #U.S. GHG emissions + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 + year: *ghgi_year + EPA_GHGI_T_3_68: #CH4 from Natural Gas Systems + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_68 + year: *ghgi_year + EPA_GHGI_T_3_70: #CO2 from Natural Gas Systems mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_70 + year: *ghgi_year + EPA_GHGI_T_3_72: #N2O from Natural Gas Systems, not used in original method, mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_72 + year: *ghgi_year + + EPA_GHGI_T_3_42: #CH4 from Petroleum Systems + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_42 + year: *ghgi_year + EPA_GHGI_T_3_44: #CO2 from Petroleum Systems mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_44 + year: *ghgi_year + EPA_GHGI_T_3_46: #N2O from Petroleum Systems, not in prior method, mimics CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_46 + year: *ghgi_year + +## Agriculture + EPA_GHGI_T_5_28: #CH4, N2O, CO and NOx from field burning of residues + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_28 + year: *ghgi_year + EPA_GHGI_T_5_3: #CH4 from Enteric Fermentation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_3 + year: *ghgi_year + EPA_GHGI_T_5_6: #CH4 and N2O from manure, mimics enteric fermentation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_5_6 + year: *ghgi_year + +## Mobile Sources + EPA_GHGI_T_3_13: #CO2 from mobile combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_13 + year: *ghgi_year + EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_14 + year: *ghgi_year + EPA_GHGI_T_3_15: #N2O from mobile combustion duplicates method for CH4 + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_15 + year: *ghgi_year + +## Stationary Combustion + EPA_GHGI_T_A_5: + !include:GHG_national_m2_common.yaml:source_names:GHGI_CO2_stationary_combustion + year: *ghgi_year + EPA_GHGI_T_3_8: # CH4 emissions from stationary combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_8 + year: *ghgi_year + EPA_GHGI_T_3_9: # N2O emissions from stationary combustion + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_9 + year: *ghgi_year + +## Other sources + EPA_GHGI_T_4_46: #CO2 for selected petrochemicals + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_46 + year: *ghgi_year + + EPA_GHGI_T_3_22b: # Fossil fuel for non-energy uses + !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions + year: *ghgi_year + +## Other Emissions + EPA_GHGI_T_4_50: # HFCs from HCFC-22 production + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_50 + year: *ghgi_year + + EPA_GHGI_T_4_96: # HFCs and other emissions from electronics manufacture + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_96 + year: *ghgi_year + + EPA_GHGI_T_4_102: # HFCs and PFCs from ODS Substitutes + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_102 + year: *ghgi_year + + EPA_GHGI_T_A_97: # HFCs from Transportation + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_A_97 + year: *ghgi_year + + EPA_GHGI_T_4_80: # PFCs from aluminum production + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_80 + year: *ghgi_year From 36413f81248342dad1cbd98789cb14fc4ad65e59 Mon Sep 17 00:00:00 2001 From: Bousquin Date: Wed, 20 Sep 2023 14:13:37 -0500 Subject: [PATCH 0992/1127] update doc string to make it clearer the result is console printed and returned as dict/list --- flowsa/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/__init__.py b/flowsa/__init__.py index c338aec0f..8e70ac30c 100644 --- a/flowsa/__init__.py +++ b/flowsa/__init__.py @@ -138,10 +138,10 @@ def collapse_FlowBySector( def seeAvailableFlowByModels(flowbytype, print_method=True): """ - Return available Flow-By-Activity or Flow-By-Sector models + Console print and return available Flow-By-Activity or Flow-By-Sector models :param flowbytype: 'FBA' or 'FBS' :param print_method: False to skip printing to console - :return: console printout of available models + :return: dict or list of available models """ # return fba directory path dependent on FBA or FBS From fbd3663755a0628b0f371d60add11db7665c1679 Mon Sep 17 00:00:00 2001 From: Bousquin Date: Wed, 20 Sep 2023 14:16:44 -0500 Subject: [PATCH 0993/1127] Reduce nesting in seeAvailableFlowByModels() and raise valueError if flowbytype not in ['FBA', 'FBS'] --- flowsa/__init__.py | 54 ++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/flowsa/__init__.py b/flowsa/__init__.py index 8e70ac30c..3acc21905 100644 --- a/flowsa/__init__.py +++ b/flowsa/__init__.py @@ -144,42 +144,40 @@ def seeAvailableFlowByModels(flowbytype, print_method=True): :return: dict or list of available models """ - # return fba directory path dependent on FBA or FBS + # fb directory contents dependent on FBA or FBS if flowbytype == 'FBA': - fb_directory = sourceconfigpath + fb_dir = os.listdir(sourceconfigpath) + elif flowbytype == 'FBS': + fb_dir = os.listdir(flowbysectormethodpath) else: - fb_directory = flowbysectormethodpath - - # empty dictionary - fb_dict = {} - # empty df - fb_df = [] - # run through all files and append - for file in os.listdir(fb_directory): - if file.endswith(".yaml"): - if all(s not in file for s in ["_common", "_summary_target"]): - # drop file extension - f = os.path.splitext(file)[0] - if flowbytype == 'FBA': - s = load_yaml_dict(f, 'FBA') - try: - years = s['years'] - except KeyError: - years = 'YAML missing information on years' - fb_dict.update({f: years}) - # else if FBS - else: - fb_df.append(f) - - # determine format of data to print + raise ValueError("flowbytype must be 'FBA' or 'FBS')" + + # list of file names (drop extension) for yaml files in flow directory + fb_names = [os.path.splitext(f)[0 for f in fb_dir if f.endswith('.yaml')] + + # further reduce list of file names by excluding common and summary_target + exclude = ["_common", "_summary_target"] + fb_names = [f for f in fb_names if all(s not in f for s in exclude)] + if flowbytype == 'FBA': - data_print = fb_dict + # create empty dictionary, this will be the data format to print FBA + data_print = {} + # iterate over names to build dict for FBA and handling years + for f in fb_names: + s = load_yaml_dict(f, 'FBA') + try: + years = s['years'] + except KeyError: + years = 'YAML missing information on years' + data_print.update({f: years}) else: - data_print = fb_df + # data format to print FBS + data_print = fb_names if print_method: # print data in human-readable format pprint.pprint(data_print, width=79, compact=True) + return data_print From d84930a70f88a2c687b87d7b524a2c4554b2c3ee Mon Sep 17 00:00:00 2001 From: Bousquin Date: Wed, 20 Sep 2023 14:33:22 -0500 Subject: [PATCH 0994/1127] minor fix (test failed to import FBA) --- flowsa/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/__init__.py b/flowsa/__init__.py index 3acc21905..8391851ed 100644 --- a/flowsa/__init__.py +++ b/flowsa/__init__.py @@ -150,7 +150,7 @@ def seeAvailableFlowByModels(flowbytype, print_method=True): elif flowbytype == 'FBS': fb_dir = os.listdir(flowbysectormethodpath) else: - raise ValueError("flowbytype must be 'FBA' or 'FBS')" + raise ValueError("flowbytype must be 'FBA' or 'FBS'") # list of file names (drop extension) for yaml files in flow directory fb_names = [os.path.splitext(f)[0 for f in fb_dir if f.endswith('.yaml')] From 70bc195f8c723238faeb773743729b30c9e7d188 Mon Sep 17 00:00:00 2001 From: Bousquin Date: Wed, 20 Sep 2023 14:46:17 -0500 Subject: [PATCH 0995/1127] quick fix --- flowsa/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/__init__.py b/flowsa/__init__.py index 8391851ed..84e8e2b0e 100644 --- a/flowsa/__init__.py +++ b/flowsa/__init__.py @@ -153,7 +153,7 @@ def seeAvailableFlowByModels(flowbytype, print_method=True): raise ValueError("flowbytype must be 'FBA' or 'FBS'") # list of file names (drop extension) for yaml files in flow directory - fb_names = [os.path.splitext(f)[0 for f in fb_dir if f.endswith('.yaml')] + fb_names = [os.path.splitext(f)[0] for f in fb_dir if f.endswith('.yaml')] # further reduce list of file names by excluding common and summary_target exclude = ["_common", "_summary_target"] From d35037e610bed9cc9161b95af5e5291829e1a6f4 Mon Sep 17 00:00:00 2001 From: Justin Bousquin Date: Wed, 20 Sep 2023 15:02:54 -0500 Subject: [PATCH 0996/1127] Update DataQualityPedigreeMatrix.md fix title typo --- docs/DataQualityPedigreeMatrix.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/DataQualityPedigreeMatrix.md b/docs/DataQualityPedigreeMatrix.md index 6b9b4844b..a7278d587 100644 --- a/docs/DataQualityPedigreeMatrix.md +++ b/docs/DataQualityPedigreeMatrix.md @@ -1,4 +1,4 @@ -# Data Quality Pedigree Mattix +# Data Quality Pedigree Matrix The following table is an update of 'Table 3 Updated Data Quality Pedigree Matrix – Flow Indicators' from [USEPA 2016 'Guidance on Data Quality Assessment for Life Cycle Inventory Data'](https://cfpub.epa.gov/si/si_public_record_report.cfm?Lab=NRMRL&dirEntryId=321834) From e88d7d9d799d49e691262dcef7d65a4f989ad5be Mon Sep 17 00:00:00 2001 From: Bousquin Date: Wed, 20 Sep 2023 16:20:13 -0500 Subject: [PATCH 0997/1127] edited line of doc string to make it more consistent with lines around it. --- flowsa/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/__init__.py b/flowsa/__init__.py index 84e8e2b0e..3c9af05de 100644 --- a/flowsa/__init__.py +++ b/flowsa/__init__.py @@ -80,7 +80,7 @@ def getFlowBySector( """ Loads stored FlowBySector output or generates it if it doesn't exist, then loads - :param methodname: string, Name of an available method for the given class + :param methodname: str, name of an available method for the given class :param fbsconfigpath: str, path to the FBS method file if loading a file from outside the flowsa repository :param download_FBAs_if_missing: bool, if True will attempt to load FBAS From 8fdfc68e9d6735ec573e78ec6e592ac095e22138 Mon Sep 17 00:00:00 2001 From: Bousquin Date: Wed, 20 Sep 2023 16:56:10 -0500 Subject: [PATCH 0998/1127] Minor addition (think the format is what is defined) --- examples/get_flows_by_sector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/get_flows_by_sector.py b/examples/get_flows_by_sector.py index 71ccdc1f8..bfdf5b09d 100644 --- a/examples/get_flows_by_sector.py +++ b/examples/get_flows_by_sector.py @@ -18,7 +18,7 @@ employment data in the SectorProducedBy column, as there are not flows of employment between sectors. -Tables are standardized into a table defined in +Tables are standardized into a table format defined in https://github.com/USEPA/flowsa/blob/master/format%20specs/FlowBySector.md. Retrieves stored data in the FlowBySector format From b8ae36b0b3eb8204970fbdc5c9c39766fd482253 Mon Sep 17 00:00:00 2001 From: Bousquin Date: Wed, 20 Sep 2023 17:00:55 -0500 Subject: [PATCH 0999/1127] Not really the data that is flowing between sectors, it's data on amounts of stuff flowing from producer to consumer sectors. My require some word-smithing past this. --- examples/get_flows_by_sector.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/get_flows_by_sector.py b/examples/get_flows_by_sector.py index bfdf5b09d..001ea4e89 100644 --- a/examples/get_flows_by_sector.py +++ b/examples/get_flows_by_sector.py @@ -4,9 +4,9 @@ """ Flow-By-Sector (FBS) datasets are environmental, economic, and other data that -are attributed to economic sectors, generally North American Industrial -Classification (NAICS) Codes. These datasets capture flows of env/econ data -from sectors that produce the data to the sectors that consume the data. +are attributed to economic sectors, generally by North American Industrial +Classification (NAICS) Codes. These datasets capture env/econ flows from sectors +that produce to the sectors that consume. For example, Water_national_2015_m1 (https://github.com/USEPA/flowsa/blob/ master/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml) captures the flow of withdrawn water through the economy. This dataset From 519abf6eacd5937193b585eca1863b474b548bec Mon Sep 17 00:00:00 2001 From: Bousquin Date: Wed, 20 Sep 2023 17:14:06 -0500 Subject: [PATCH 1000/1127] believe it downloads when it runs, seemed more descriptive --- examples/get_flows_by_sector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/get_flows_by_sector.py b/examples/get_flows_by_sector.py index 001ea4e89..2d4a69d22 100644 --- a/examples/get_flows_by_sector.py +++ b/examples/get_flows_by_sector.py @@ -33,7 +33,7 @@ # see available FBS models flowsa.seeAvailableFlowByModels('FBS') -# load FBS from local directory, if does not exist, method will run +# load FBS from local directory, if does not exist, method will download fbs_water = flowsa.getFlowBySector('Water_national_2015_m1', download_FBAs_if_missing=True) From 241910a48312e56f8a39d4b5fb8c0384a1566b21 Mon Sep 17 00:00:00 2001 From: Bousquin Date: Thu, 21 Sep 2023 08:57:49 -0500 Subject: [PATCH 1001/1127] already done by function --- examples/get_flows_by_activity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/get_flows_by_activity.py b/examples/get_flows_by_activity.py index 2490c3b7e..0cfd0e038 100644 --- a/examples/get_flows_by_activity.py +++ b/examples/get_flows_by_activity.py @@ -36,7 +36,7 @@ year=2015, flowclass='Water', geographic_level='state' - ).reset_index(drop=True) + ) # save output to csv, maintain leading 0s in location col fba_usgs.Location = fba_usgs.Location.apply('="{}"'.format) From 4911c05ad8e3c5d5706b540880f3d8006d2a7dac Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 22 Sep 2023 14:36:06 -0600 Subject: [PATCH 1002/1127] move fxn definitions out of init.py and rename change fxn names so do not have duplicate getFlowBySector() and getFlowByActivity() --- README.md | 4 +- examples/get_flows_by_activity.py | 17 +- examples/get_flows_by_sector.py | 11 +- flowsa/__init__.py | 188 +----------------- flowsa/bibliography.py | 14 ++ flowsa/common.py | 46 +++++ flowsa/data_source_scripts/BTS_Airlines.py | 3 +- flowsa/data_source_scripts/EIA_MECS.py | 1 - flowsa/data_source_scripts/EPA_CDDPath.py | 6 +- flowsa/data_source_scripts/EPA_GHGI.py | 2 +- flowsa/data_source_scripts/EPA_NEI.py | 4 +- flowsa/data_source_scripts/EPA_SIT.py | 4 +- flowsa/data_source_scripts/EPA_StateGHGI.py | 11 +- flowsa/data_source_scripts/StateGHGI.py | 4 +- flowsa/data_source_scripts/stateio.py | 4 +- flowsa/datavisualization.py | 26 ++- flowsa/flowby.py | 4 +- flowsa/flowbyactivity.py | 50 ++++- flowsa/flowbyclean.py | 4 +- flowsa/flowbyfunctions.py | 3 +- flowsa/flowbysector.py | 63 +++++- flowsa/sectormapping.py | 3 +- flowsa/test_FBS_against_remote.py | 4 +- flowsa/test_examples.py | 28 +-- flowsa/test_methods.py | 4 +- flowsa/validation.py | 21 +- .../common_scripts.py | 3 +- .../write_FBS_activity_set_BLM_PLS.py | 3 +- .../write_FBS_activity_set_BLS_QCEW.py | 3 +- .../write_FBS_activity_set_CNHW_Food.py | 6 +- .../write_FBS_activity_set_EIA_CBECS_Land.py | 3 +- .../write_FBS_activity_set_EIA_MECS_Land.py | 3 +- .../write_FBS_activity_set_EPA_REI_waste.py | 3 +- scripts/writeNAICScrosswalk.py | 2 +- 34 files changed, 293 insertions(+), 262 deletions(-) diff --git a/README.md b/README.md index af740482d..238680305 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ the [Wiki](https://github.com/USEPA/flowsa/wiki/Available-Data#flow-by-activity- `import flowsa` \ `flowsa.seeAvailableFlowByModels('FBA')` \ -`flowsa.getFlowByActivity(datasource="USDA_CoA_Cropland", year=2017)` +`flowsa.return_FBA(datasource="USDA_CoA_Cropland", year=2017)` ### Flow-By-Sector (FBS) Datasets Flow-By-Sector datasets are tables of environmental and other data @@ -38,7 +38,7 @@ FBS datasets can be found in the [Wiki](https://github.com/USEPA/flowsa/wiki/Ava `import flowsa` \ `flowsa.seeAvailableFlowByModels('FBS')` \ -`flowsa.getFlowBySector('Water_national_2015_m1')` +`flowsa.return_FBS('Water_national_2015_m1')` ## Installation `pip install git+https://github.com/USEPA/flowsa.git@vX.X.X#egg=flowsa` diff --git a/examples/get_flows_by_activity.py b/examples/get_flows_by_activity.py index 0cfd0e038..20ef3c979 100644 --- a/examples/get_flows_by_activity.py +++ b/examples/get_flows_by_activity.py @@ -22,21 +22,22 @@ """ -import flowsa +from flowsa.common import seeAvailableFlowByModels +import flowsa.flowbyactivity from flowsa.settings import fbaoutputpath # see all datasources and years available in flowsa -flowsa.seeAvailableFlowByModels('FBA') +seeAvailableFlowByModels('FBA') # Load all information for EIA MECS Land -fba_mecs = flowsa.getFlowByActivity(datasource="EIA_MECS_Land", year=2014) +fba_mecs = flowsa.flowbyactivity.getFlowByActivity(datasource="EIA_MECS_Land", year=2014) # only load state level water data and save as csv -fba_usgs = flowsa.getFlowByActivity(datasource="USGS_NWIS_WU", - year=2015, - flowclass='Water', - geographic_level='state' - ) +fba_usgs = flowsa.flowbyactivity.getFlowByActivity(datasource="USGS_NWIS_WU", + year=2015, + flowclass='Water', + geographic_level='state' + ) # save output to csv, maintain leading 0s in location col fba_usgs.Location = fba_usgs.Location.apply('="{}"'.format) diff --git a/examples/get_flows_by_sector.py b/examples/get_flows_by_sector.py index 2d4a69d22..d13372443 100644 --- a/examples/get_flows_by_sector.py +++ b/examples/get_flows_by_sector.py @@ -28,15 +28,16 @@ """ -import flowsa +from flowsa.common import seeAvailableFlowByModels +import flowsa.flowbysector # see available FBS models -flowsa.seeAvailableFlowByModels('FBS') +seeAvailableFlowByModels('FBS') # load FBS from local directory, if does not exist, method will download -fbs_water = flowsa.getFlowBySector('Water_national_2015_m1', - download_FBAs_if_missing=True) +fbs_water = flowsa.flowbysector.getFlowBySector('Water_national_2015_m1', + download_FBAs_if_missing=True) # collapse the FBS - output has 'Sector' column instead of # 'SectorProducedBy' and 'SectorConsumedBy' columns -fbs_water_collapsed = flowsa.collapse_FlowBySector('Water_national_2015_m1') +fbs_water_collapsed = flowsa.flowbysector.collapse_FlowBySector('Water_national_2015_m1') diff --git a/flowsa/__init__.py b/flowsa/__init__.py index 3c9af05de..78ee18246 100644 --- a/flowsa/__init__.py +++ b/flowsa/__init__.py @@ -16,187 +16,9 @@ Flow-By-Sector files are loaded when running these functions """ -import os -import pprint -import pandas as pd -import flowsa.exceptions -from flowsa.common import load_yaml_dict -from flowsa.flowsa_log import log -from flowsa.settings import sourceconfigpath, flowbysectormethodpath, \ - biboutputpath, DEFAULT_DOWNLOAD_IF_MISSING -from flowsa.flowbyfunctions import collapse_fbs_sectors, filter_by_geoscale -from flowsa.validation import check_for_nonetypes_in_sector_col, \ - check_for_negative_flowamounts -# from flowsa.bibliography import generate_fbs_bibliography -from flowsa.datavisualization import FBSscatterplot -from flowsa.flowbyactivity import FlowByActivity -from flowsa.flowbysector import FlowBySector +from flowsa.common import seeAvailableFlowByModels +from flowsa.flowbyactivity import getFlowByActivity +from flowsa.flowbysector import getFlowBySector, collapse_FlowBySector +# from flowsa.bibliography import writeFlowBySectorBibliography +# from flowsa.datavisualization import generateFBSplot - -def getFlowByActivity( - datasource, - year, - flowclass=None, - geographic_level=None, - download_FBA_if_missing=DEFAULT_DOWNLOAD_IF_MISSING - ) -> pd.DataFrame: - """ - Retrieves stored data in the FlowByActivity format - :param datasource: str, the code of the datasource. - :param year: int, a year, e.g. 2012 - :param flowclass: str or list, a 'Class' of the flow. Optional. E.g. - 'Water' or ['Employment', 'Chemicals'] - :param geographic_level: str, a geographic level of the data. - Optional. E.g. 'national', 'state', 'county'. - :param download_FBA_if_missing: bool, if True will attempt to load from - remote server prior to generating if file not found locally - :return: a pandas DataFrame in FlowByActivity format - """ - fba = FlowByActivity.getFlowByActivity( - full_name=datasource, - config={}, - year=int(year), - download_ok=download_FBA_if_missing - ) - - if len(fba) == 0: - raise flowsa.exceptions.FBANotAvailableError( - message=f"Error generating {datasource} for {str(year)}") - if flowclass is not None: - fba = fba.query('Class == @flowclass') - # if geographic level specified, only load rows in geo level - if geographic_level is not None: - fba = filter_by_geoscale(fba, geographic_level) - return pd.DataFrame(fba.reset_index(drop=True)) - - -def getFlowBySector( - methodname, - fbsconfigpath=None, - download_FBAs_if_missing=DEFAULT_DOWNLOAD_IF_MISSING, - download_FBS_if_missing=DEFAULT_DOWNLOAD_IF_MISSING, - **kwargs - ) -> pd.DataFrame: - """ - Loads stored FlowBySector output or generates it if it doesn't exist, - then loads - :param methodname: str, name of an available method for the given class - :param fbsconfigpath: str, path to the FBS method file if loading a file - from outside the flowsa repository - :param download_FBAs_if_missing: bool, if True will attempt to load FBAS - used in generating the FBS from remote server prior to generating if - file not found locally - :param download_FBS_if_missing: bool, if True will attempt to load from - remote server prior to generating if file not found locally - :return: dataframe in flow by sector format - """ - fbs = FlowBySector.getFlowBySector( - method=methodname, - external_config_path=fbsconfigpath, - download_sources_ok=download_FBAs_if_missing, - download_fbs_ok=download_FBS_if_missing, - **kwargs - ) - return pd.DataFrame(fbs) - - -def collapse_FlowBySector( - methodname, - fbsconfigpath=None, - download_FBAs_if_missing=DEFAULT_DOWNLOAD_IF_MISSING, - download_FBS_if_missing=DEFAULT_DOWNLOAD_IF_MISSING - ) -> pd.DataFrame: - """ - Returns fbs with one sector column in place of two - :param methodname: string, Name of an available method for the given class - :return: dataframe in flow by sector format - """ - fbs = flowsa.getFlowBySector(methodname, fbsconfigpath, - download_FBAs_if_missing, - download_FBS_if_missing) - fbs_collapsed = collapse_fbs_sectors(fbs) - - # check data for NoneType in sector column - fbs_collapsed = check_for_nonetypes_in_sector_col(fbs_collapsed) - # check data for negative FlowAmount values - fbs_collapsed = check_for_negative_flowamounts(fbs_collapsed) - - return fbs_collapsed - -# todo: will reintroduce option to create bibliography post 2.0 release -# def writeFlowBySectorBibliography(methodname): -# """ -# Generate bibliography for FlowBySectorMethod in local directory -# :param methodname: string, FBS methodname for which to create .bib file -# :return: .bib file save to local directory -# """ -# # Generate a single .bib file for a list of Flow-By-Sector method names -# # and save file to local directory -# log.info(f'Write bibliography to {biboutputpath / methodname}.bib') -# generate_fbs_bibliography(methodname) - - -def seeAvailableFlowByModels(flowbytype, print_method=True): - """ - Console print and return available Flow-By-Activity or Flow-By-Sector models - :param flowbytype: 'FBA' or 'FBS' - :param print_method: False to skip printing to console - :return: dict or list of available models - """ - - # fb directory contents dependent on FBA or FBS - if flowbytype == 'FBA': - fb_dir = os.listdir(sourceconfigpath) - elif flowbytype == 'FBS': - fb_dir = os.listdir(flowbysectormethodpath) - else: - raise ValueError("flowbytype must be 'FBA' or 'FBS'") - - # list of file names (drop extension) for yaml files in flow directory - fb_names = [os.path.splitext(f)[0] for f in fb_dir if f.endswith('.yaml')] - - # further reduce list of file names by excluding common and summary_target - exclude = ["_common", "_summary_target"] - fb_names = [f for f in fb_names if all(s not in f for s in exclude)] - - if flowbytype == 'FBA': - # create empty dictionary, this will be the data format to print FBA - data_print = {} - # iterate over names to build dict for FBA and handling years - for f in fb_names: - s = load_yaml_dict(f, 'FBA') - try: - years = s['years'] - except KeyError: - years = 'YAML missing information on years' - data_print.update({f: years}) - else: - # data format to print FBS - data_print = fb_names - - if print_method: - # print data in human-readable format - pprint.pprint(data_print, width=79, compact=True) - - return data_print - - -# todo: revise data vis fxns for recursive method -# def generateFBSplot(method_dict, plottype, sector_length_display=None, -# sectors_to_include=None, plot_title=None): -# """ -# Plot the results of FBS models. Graphic can either be a faceted -# scatterplot or a method comparison -# :param method_dict: dictionary, key is the label, value is the FBS -# methodname -# :param plottype: str, 'facet_graph' or 'method_comparison' -# :param sector_length_display: numeric, sector length by which to -# aggregate, default is 'None' which returns the max sector length in a -# dataframe -# :param sectors_to_include: list, sectors to include in output. Sectors -# are subset by all sectors that "start with" the values in this list -# :return: graphic displaying results of FBS models -# """ -# -# FBSscatterplot(method_dict, plottype, sector_length_display, -# sectors_to_include, plot_title) diff --git a/flowsa/bibliography.py b/flowsa/bibliography.py index c257f472f..7f985a0d2 100644 --- a/flowsa/bibliography.py +++ b/flowsa/bibliography.py @@ -10,6 +10,7 @@ from bibtexparser.bwriter import BibTexWriter from bibtexparser.bibdatabase import BibDatabase from esupy.processed_data_mgmt import mkdir_if_missing + from flowsa.common import load_values_from_literature_citations_config, \ get_flowsa_base_name, sourceconfigpath, load_yaml_dict from flowsa.flowsa_log import log @@ -153,3 +154,16 @@ def load_source_dict(sourcename): # # loop through all entries in bib_list # for b in bib_list: # bibfile.write(writer.write(b)) + + +# todo: will reintroduce option to create bibliography post 2.0 release +# def writeFlowBySectorBibliography(methodname): +# """ +# Generate bibliography for FlowBySectorMethod in local directory +# :param methodname: string, FBS methodname for which to create .bib file +# :return: .bib file save to local directory +# """ +# # Generate a single .bib file for a list of Flow-By-Sector method names +# # and save file to local directory +# log.info(f'Write bibliography to {biboutputpath / methodname}.bib') +# generate_fbs_bibliography(methodname) diff --git a/flowsa/common.py b/flowsa/common.py index d77cb961c..28cd1ee15 100644 --- a/flowsa/common.py +++ b/flowsa/common.py @@ -5,6 +5,7 @@ """Common variables and functions used across flowsa""" import os +import pprint from os import path import re import yaml @@ -321,3 +322,48 @@ def get_catalog_info(source_name: str) -> dict: source_catalog = load_yaml_dict('source_catalog') source_name = return_true_source_catalog_name(source_name) return source_catalog.get(source_name, {}) + + +def seeAvailableFlowByModels(flowbytype, print_method=True): + """ + Console print and return available Flow-By-Activity or Flow-By-Sector models + :param flowbytype: 'FBA' or 'FBS' + :param print_method: False to skip printing to console + :return: dict or list of available models + """ + + # fb directory contents dependent on FBA or FBS + if flowbytype == 'FBA': + fb_dir = os.listdir(sourceconfigpath) + elif flowbytype == 'FBS': + fb_dir = os.listdir(flowbysectormethodpath) + else: + raise ValueError("flowbytype must be 'FBA' or 'FBS'") + + # list of file names (drop extension) for yaml files in flow directory + fb_names = [os.path.splitext(f)[0] for f in fb_dir if f.endswith('.yaml')] + + # further reduce list of file names by excluding common and summary_target + exclude = ["_common", "_summary_target"] + fb_names = [f for f in fb_names if all(s not in f for s in exclude)] + + if flowbytype == 'FBA': + # create empty dictionary, this will be the data format to print FBA + data_print = {} + # iterate over names to build dict for FBA and handling years + for f in fb_names: + s = load_yaml_dict(f, 'FBA') + try: + years = s['years'] + except KeyError: + years = 'YAML missing information on years' + data_print.update({f: years}) + else: + # data format to print FBS + data_print = fb_names + + if print_method: + # print data in human-readable format + pprint.pprint(data_print, width=79, compact=True) + + return data_print diff --git a/flowsa/data_source_scripts/BTS_Airlines.py b/flowsa/data_source_scripts/BTS_Airlines.py index 2622c6c87..a5df893c7 100644 --- a/flowsa/data_source_scripts/BTS_Airlines.py +++ b/flowsa/data_source_scripts/BTS_Airlines.py @@ -1,6 +1,7 @@ import pandas as pd import numpy as np -from flowsa import flowsa_yaml, settings, FlowByActivity +from flowsa import flowsa_yaml, settings +from flowsa.flowbyactivity import FlowByActivity def generate_fba(): diff --git a/flowsa/data_source_scripts/EIA_MECS.py b/flowsa/data_source_scripts/EIA_MECS.py index f904fa491..a7b654e4c 100644 --- a/flowsa/data_source_scripts/EIA_MECS.py +++ b/flowsa/data_source_scripts/EIA_MECS.py @@ -11,7 +11,6 @@ import pandas as pd import numpy as np -from flowsa import FlowByActivity from flowsa.location import US_FIPS, get_region_and_division_codes from flowsa.common import WITHDRAWN_KEYWORD from flowsa.flowsa_log import log diff --git a/flowsa/data_source_scripts/EPA_CDDPath.py b/flowsa/data_source_scripts/EPA_CDDPath.py index 84dfd5564..96c984648 100644 --- a/flowsa/data_source_scripts/EPA_CDDPath.py +++ b/flowsa/data_source_scripts/EPA_CDDPath.py @@ -13,6 +13,8 @@ from tabula.io import read_pdf import re import os + +import flowsa.flowbyactivity from flowsa.location import US_FIPS from flowsa.flowsa_log import log from flowsa.settings import externaldatapath @@ -228,6 +230,6 @@ def melt_and_apply_percentages(df, fbacol='ActivityConsumedBy'): if __name__ == "__main__": import flowsa flowsa.generateflowbyactivity.main(source='EPA_CDDPath', year=2018) - fba = flowsa.getFlowByActivity(datasource='EPA_CDDPath', year=2018) + fba = flowsa.flowbyactivity.getFlowByActivity(datasource='EPA_CDDPath', year=2018) - # fbs = flowsa.getFlowBySector(methodname='CDD_concrete_national_2014') + # fbs = flowsa.return_FBS(methodname='CDD_concrete_national_2014') diff --git a/flowsa/data_source_scripts/EPA_GHGI.py b/flowsa/data_source_scripts/EPA_GHGI.py index 4d80ec6aa..b6729488f 100644 --- a/flowsa/data_source_scripts/EPA_GHGI.py +++ b/flowsa/data_source_scripts/EPA_GHGI.py @@ -815,6 +815,6 @@ def split_HFCs_by_type(fba: FlowByActivity, **_) -> FlowByActivity: if __name__ == "__main__": import flowsa - # fba = flowsa.getFlowByActivity('EPA_GHGI_T_4_101', 2016) + # fba = flowsa.return_FBA('EPA_GHGI_T_4_101', 2016) # df = clean_HFC_fba(fba) fba = flowsa.generateflowbyactivity.main(year=2017, source='EPA_GHGI') diff --git a/flowsa/data_source_scripts/EPA_NEI.py b/flowsa/data_source_scripts/EPA_NEI.py index 9528a6ab5..fb955ddca 100644 --- a/flowsa/data_source_scripts/EPA_NEI.py +++ b/flowsa/data_source_scripts/EPA_NEI.py @@ -10,6 +10,8 @@ from os import path import pandas as pd import numpy as np + +import flowsa.flowbyactivity from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.dataclean import standardize_units from flowsa.flowbyactivity import FlowByActivity @@ -238,4 +240,4 @@ def remove_flow_overlap(df, aggregate_flow, contributing_flows): if __name__ == '__main__': import flowsa flowsa.generateflowbyactivity.main(source='EPA_NEI_Onroad', year='2020') - fba = flowsa.getFlowByActivity('EPA_NEI_Onroad', '2020') + fba = flowsa.flowbyactivity.getFlowByActivity('EPA_NEI_Onroad', '2020') diff --git a/flowsa/data_source_scripts/EPA_SIT.py b/flowsa/data_source_scripts/EPA_SIT.py index 742009dc6..8c339f9fc 100644 --- a/flowsa/data_source_scripts/EPA_SIT.py +++ b/flowsa/data_source_scripts/EPA_SIT.py @@ -8,6 +8,8 @@ import pandas as pd import os + +import flowsa.flowbyactivity from flowsa.settings import externaldatapath from flowsa.flowbyactivity import FlowByActivity from flowsa.flowbyfunctions import assign_fips_location_system, \ @@ -225,4 +227,4 @@ def clean_up_state_data(fba, source_dict, method, **_): if __name__ == '__main__': import flowsa flowsa.generateflowbyactivity.main(source='EPA_SIT', year='2019') - fba = flowsa.getFlowByActivity('EPA_SIT', '2019') + fba = flowsa.flowbyactivity.getFlowByActivity('EPA_SIT', '2019') diff --git a/flowsa/data_source_scripts/EPA_StateGHGI.py b/flowsa/data_source_scripts/EPA_StateGHGI.py index 1084fec30..fa06d47cd 100644 --- a/flowsa/data_source_scripts/EPA_StateGHGI.py +++ b/flowsa/data_source_scripts/EPA_StateGHGI.py @@ -7,6 +7,8 @@ import pandas as pd import io from zipfile import ZipFile + +import flowsa.flowbyactivity from flowsa.flowbyactivity import FlowByActivity from flowsa.flowsa_log import log from flowsa.location import apply_county_FIPS @@ -110,7 +112,7 @@ def allocate_flows_by_fuel(fba: FlowByActivity, **_) -> FlowByActivity: else: activity_list = alist source_fba = pd.concat([ - flowsa.getFlowByActivity(x, year) for x in + flowsa.flowbyactivity.getFlowByActivity(x, year) for x in fba.config['clean_parameter']['fba_source'] ], ignore_index=True) @@ -140,8 +142,9 @@ def allocate_flows_by_fuel(fba: FlowByActivity, **_) -> FlowByActivity: ) # prepare dataframe from StateGHGI including CO2 flows by fuel type - fba1 = (pd.concat([(flowsa.getFlowByActivity('EPA_StateGHGI', year) - .query('ActivityProducedBy in @activity_list')), + fba1 = (pd.concat([( + flowsa.flowbyactivity.getFlowByActivity('EPA_StateGHGI', year) + .query('ActivityProducedBy in @activity_list')), fba.copy()], ignore_index=True) .assign(Fuel=lambda x: x['ActivityProducedBy'] @@ -216,4 +219,4 @@ def allocate_industrial_combustion(fba: FlowByActivity, **_) -> FlowByActivity: if __name__ == '__main__': import flowsa flowsa.generateflowbyactivity.main(source='EPA_StateGHGI', year='2017') - fba = flowsa.getFlowByActivity('EPA_StateGHGI', '2017') + fba = flowsa.flowbyactivity.getFlowByActivity('EPA_StateGHGI', '2017') diff --git a/flowsa/data_source_scripts/StateGHGI.py b/flowsa/data_source_scripts/StateGHGI.py index b66a3d60c..a8b8f96cc 100644 --- a/flowsa/data_source_scripts/StateGHGI.py +++ b/flowsa/data_source_scripts/StateGHGI.py @@ -7,6 +7,8 @@ import pandas as pd import os + +import flowsa.flowbyactivity from flowsa.settings import externaldatapath from flowsa.flowbyfunctions import assign_fips_location_system, \ load_fba_w_standardized_units @@ -250,4 +252,4 @@ def VT_remove_dupicate_activities(df_subset): if __name__ == '__main__': import flowsa flowsa.generateflowbyactivity.main(source='StateGHGI_ME', year='2019') - fba = flowsa.getFlowByActivity('StateGHGI_ME', '2019') + fba = flowsa.flowbyactivity.getFlowByActivity('StateGHGI_ME', '2019') diff --git a/flowsa/data_source_scripts/stateio.py b/flowsa/data_source_scripts/stateio.py index 0c1dcf2af..57064e0ac 100644 --- a/flowsa/data_source_scripts/stateio.py +++ b/flowsa/data_source_scripts/stateio.py @@ -11,6 +11,8 @@ from esupy.processed_data_mgmt import download_from_remote, Paths,\ load_preprocessed_output + +import flowsa.flowbyactivity from flowsa.metadata import set_fb_meta from flowsa.location import us_state_abbrev, apply_county_FIPS from flowsa.flowbyfunctions import assign_fips_location_system @@ -81,4 +83,4 @@ def parse_statior(*, source, year, config, **_): # source = 'stateio_Make_Summary' source = 'stateio_Use_Summary' flowsa.generateflowbyactivity.main(year=2017, source=source) - fba = flowsa.getFlowByActivity(source, 2017) + fba = flowsa.flowbyactivity.getFlowByActivity(source, 2017) diff --git a/flowsa/datavisualization.py b/flowsa/datavisualization.py index 07e793563..4590964fb 100644 --- a/flowsa/datavisualization.py +++ b/flowsa/datavisualization.py @@ -88,7 +88,7 @@ def FBSscatterplot(method_dict, plottype, sector_length_display=None, df_list = [] for label, method in method_dict.items(): - dfm = flowsa.collapse_FlowBySector(method) + dfm = flowsa.flowbysector.collapse_FlowBySector(method) if plottype == 'facet_graph': dfm['methodname'] = dfm['Unit'].apply(lambda x: f"{label} ({x})") elif plottype == 'method_comparison': @@ -176,7 +176,7 @@ def stackedBarChart(df, # if the df provided is a string, load the fbs method, otherwise use the # df provided if (type(df)) == str: - df = flowsa.FlowBySector.getFlowBySector(df) + df = flowsa.FlowBySector.return_FBS(df) if generalize_AttributionSources: df['AttributionSources'] = np.where( @@ -446,7 +446,7 @@ def convert_units_for_graphics(df): # :return: csv file for use in generating sankey diagram # """ # -# df = flowsa.FlowBySector.getFlowBySector( +# df = flowsa.FlowBySector.return_FBS( # methodname, external_config_path=fbsconfigpath, download_sources_ok=True) # # df = convert_units_for_graphics(df) @@ -685,3 +685,23 @@ def convert_units_for_graphics(df): # log.info(f'Saving file to {plotoutputpath / filename}.svg') # fig.write_image(plotoutputpath / f"{filename}.svg", # width=width, height=height) + +# todo: revise data vis fxns for recursive method +# def generateFBSplot(method_dict, plottype, sector_length_display=None, +# sectors_to_include=None, plot_title=None): +# """ +# Plot the results of FBS models. Graphic can either be a faceted +# scatterplot or a method comparison +# :param method_dict: dictionary, key is the label, value is the FBS +# methodname +# :param plottype: str, 'facet_graph' or 'method_comparison' +# :param sector_length_display: numeric, sector length by which to +# aggregate, default is 'None' which returns the max sector length in a +# dataframe +# :param sectors_to_include: list, sectors to include in output. Sectors +# are subset by all sectors that "start with" the values in this list +# :return: graphic displaying results of FBS models +# """ +# +# FBSscatterplot(method_dict, plottype, sector_length_display, +# sectors_to_include, plot_title) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 5aa9e2bf9..37ed8e303 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -49,14 +49,14 @@ def get_flowby_from_config( external_data_path = config.get('external_data_path') if config['data_format'] == 'FBA': - return FlowByActivity.getFlowByActivity( + return FlowByActivity.return_FBA( full_name=name, config=config, download_ok=download_sources_ok, external_data_path=external_data_path ) elif config['data_format'] == 'FBS': - return FlowBySector.getFlowBySector( + return FlowBySector.return_FBS( method=name, config=config, external_config_path=external_config_path, diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index 22793210b..d7eaf29df 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -17,12 +17,17 @@ from typing import Literal, List import fedelemflowlist import pandas as pd -from flowsa import settings, metadata, log, geo, validation, naics, common, \ + +import flowsa.exceptions +from flowsa import settings, metadata, geo, validation, naics, common, \ sectormapping, generateflowbyactivity +from flowsa.flowsa_log import log +from flowsa.settings import DEFAULT_DOWNLOAD_IF_MISSING +from flowsa.flowbyfunctions import filter_by_geoscale from flowsa.flowby import _FlowBy, flowby_config, NAME_SEP_CHAR if TYPE_CHECKING: - from flowsa import FlowBySector + from flowsa.flowbysector import FlowBySector class FlowByActivity(_FlowBy): _metadata = [*_FlowBy()._metadata] @@ -71,7 +76,7 @@ def _constructor_sliced(self) -> '_FBASeries': return _FBASeries @classmethod - def getFlowByActivity( + def return_FBA( cls, full_name: str, year: int = None, @@ -677,7 +682,7 @@ def prepare_fbs( download_sources_ok: bool = True ) -> 'FlowBySector': - from flowsa import FlowBySector + from flowsa.flowbysector import FlowBySector if 'activity_sets' in self.config: try: @@ -854,3 +859,40 @@ def _constructor(self) -> '_FBASeries': @property def _constructor_expanddim(self) -> 'FlowByActivity': return FlowByActivity + + +def getFlowByActivity( + datasource, + year, + flowclass=None, + geographic_level=None, + download_FBA_if_missing=DEFAULT_DOWNLOAD_IF_MISSING + ) -> pd.DataFrame: + """ + Retrieves stored data in the FlowByActivity format + :param datasource: str, the code of the datasource. + :param year: int, a year, e.g. 2012 + :param flowclass: str or list, a 'Class' of the flow. Optional. E.g. + 'Water' or ['Employment', 'Chemicals'] + :param geographic_level: str, a geographic level of the data. + Optional. E.g. 'national', 'state', 'county'. + :param download_FBA_if_missing: bool, if True will attempt to load from + remote server prior to generating if file not found locally + :return: a pandas DataFrame in FlowByActivity format + """ + fba = FlowByActivity.return_FBA( + full_name=datasource, + config={}, + year=int(year), + download_ok=download_FBA_if_missing + ) + + if len(fba) == 0: + raise flowsa.exceptions.FBANotAvailableError( + message=f"Error generating {datasource} for {str(year)}") + if flowclass is not None: + fba = fba.query('Class == @flowclass') + # if geographic level specified, only load rows in geo level + if geographic_level is not None: + fba = filter_by_geoscale(fba, geographic_level) + return pd.DataFrame(fba.reset_index(drop=True)) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index ae8a6438f..8865808a3 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -8,7 +8,9 @@ from flowsa.flowby import FB, get_flowby_from_config from flowsa.common import get_catalog_info from flowsa.flowsa_log import log -from flowsa import (geo, location, FlowByActivity, FlowBySector) +from flowsa import (geo, location) +from flowsa.flowbyactivity import FlowByActivity +from flowsa.flowbysector import FlowBySector from flowsa.naics import map_source_sectors_to_more_aggregated_sectors from flowsa.validation import compare_summation_at_sector_lengths_between_two_dfs diff --git a/flowsa/flowbyfunctions.py b/flowsa/flowbyfunctions.py index 36d759eb3..5912fbcbc 100644 --- a/flowsa/flowbyfunctions.py +++ b/flowsa/flowbyfunctions.py @@ -8,6 +8,7 @@ import numpy as np from esupy.dqi import get_weighted_average import flowsa +import flowsa.flowbyactivity from flowsa.common import fbs_collapsed_default_grouping_fields from flowsa.dataclean import clean_df, standardize_units from flowsa.flowsa_log import log @@ -312,7 +313,7 @@ def load_fba_w_standardized_units(datasource, year, **kwargs): if 'download_FBA_if_missing' in kwargs: fba_dict['download_FBA_if_missing'] = kwargs['download_FBA_if_missing'] # load the allocation FBA - fba = flowsa.getFlowByActivity( + fba = flowsa.flowbyactivity.getFlowByActivity( datasource, year, **fba_dict).reset_index(drop=True) # convert to standardized units either by mapping to federal # flow list/material flow list or by using function. Mapping will add diff --git a/flowsa/flowbysector.py b/flowsa/flowbysector.py index 70ee4feac..5ecb20239 100644 --- a/flowsa/flowbysector.py +++ b/flowsa/flowbysector.py @@ -11,10 +11,13 @@ import esupy.processed_data_mgmt import pandas as pd from pandas import ExcelWriter -from flowsa import settings, metadata, common, exceptions, log, geo, naics +from flowsa import settings, metadata, common, exceptions, geo, naics from flowsa.common import get_catalog_info from flowsa.flowby import _FlowBy, flowby_config, get_flowby_from_config -from flowsa.flowsa_log import reset_log_file +from flowsa.settings import DEFAULT_DOWNLOAD_IF_MISSING +from flowsa.flowsa_log import reset_log_file, log +from flowsa.validation import check_for_negative_flowamounts, \ + check_for_nonetypes_in_sector_col class FlowBySector(_FlowBy): @@ -62,7 +65,7 @@ def _constructor_sliced(self) -> '_FBSSeries': return _FBSSeries @classmethod - def getFlowBySector( + def return_FBS( cls, method: str, config: dict = None, @@ -358,3 +361,57 @@ def _constructor(self) -> '_FBSSeries': @property def _constructor_expanddim(self) -> 'FlowBySector': return FlowBySector + + +def getFlowBySector( + methodname, + fbsconfigpath=None, + download_FBAs_if_missing=DEFAULT_DOWNLOAD_IF_MISSING, + download_FBS_if_missing=DEFAULT_DOWNLOAD_IF_MISSING, + **kwargs + ) -> pd.DataFrame: + """ + Loads stored FlowBySector output or generates it if it doesn't exist, + then loads + :param methodname: str, name of an available method for the given class + :param fbsconfigpath: str, path to the FBS method file if loading a file + from outside the flowsa repository + :param download_FBAs_if_missing: bool, if True will attempt to load FBAS + used in generating the FBS from remote server prior to generating if + file not found locally + :param download_FBS_if_missing: bool, if True will attempt to load from + remote server prior to generating if file not found locally + :return: dataframe in flow by sector format + """ + fbs = FlowBySector.return_FBS( + method=methodname, + external_config_path=fbsconfigpath, + download_sources_ok=download_FBAs_if_missing, + download_fbs_ok=download_FBS_if_missing, + **kwargs + ) + return pd.DataFrame(fbs) + + +def collapse_FlowBySector( + methodname, + fbsconfigpath=None, + download_FBAs_if_missing=DEFAULT_DOWNLOAD_IF_MISSING, + download_FBS_if_missing=DEFAULT_DOWNLOAD_IF_MISSING + ) -> pd.DataFrame: + """ + Returns fbs with one sector column in place of two + :param methodname: string, Name of an available method for the given class + :return: dataframe in flow by sector format + """ + fbs = flowsa.flowbysector.getFlowBySector(methodname, fbsconfigpath, + download_FBAs_if_missing, + download_FBS_if_missing) + fbs_collapsed = collapse_fbs_sectors(fbs) + + # check data for NoneType in sector column + fbs_collapsed = check_for_nonetypes_in_sector_col(fbs_collapsed) + # check data for negative FlowAmount values + fbs_collapsed = check_for_negative_flowamounts(fbs_collapsed) + + return fbs_collapsed diff --git a/flowsa/sectormapping.py b/flowsa/sectormapping.py index f72b3f7f8..3c8c57f2e 100644 --- a/flowsa/sectormapping.py +++ b/flowsa/sectormapping.py @@ -9,6 +9,7 @@ import numpy as np from esupy.mapping import apply_flow_mapping import flowsa +import flowsa.flowbyactivity from flowsa.common import get_flowsa_base_name, load_crosswalk from flowsa.dataclean import standardize_units from flowsa.flowsa_log import log @@ -234,7 +235,7 @@ def get_BEA_industry_output(region, io_level, year): fba = 'BEA_Detail_GrossOutput_IO' # Get output by BEA sector - bea = flowsa.getFlowByActivity(fba, year) + bea = flowsa.flowbyactivity.getFlowByActivity(fba, year) bea = ( bea.drop(columns=bea.columns.difference( ['FlowAmount','ActivityProducedBy','Location'])) diff --git a/flowsa/test_FBS_against_remote.py b/flowsa/test_FBS_against_remote.py index de092f157..56fa7e394 100644 --- a/flowsa/test_FBS_against_remote.py +++ b/flowsa/test_FBS_against_remote.py @@ -7,8 +7,8 @@ import os import pandas as pd import numpy as np -from flowsa import seeAvailableFlowByModels, FlowBySector -from flowsa.common import check_method_status +from flowsa.flowbysector import FlowBySector +from flowsa.common import check_method_status, seeAvailableFlowByModels from flowsa.settings import diffpath from flowsa.test_single_FBS import compare_single_FBS_against_remote diff --git a/flowsa/test_examples.py b/flowsa/test_examples.py index cbbe5f998..2b3969010 100644 --- a/flowsa/test_examples.py +++ b/flowsa/test_examples.py @@ -2,30 +2,32 @@ Test functions work, used for CI/CD testing """ import flowsa -from flowsa import seeAvailableFlowByModels -from flowsa.common import check_method_status, load_yaml_dict +import flowsa.flowbyactivity +import flowsa.flowbysector +from flowsa.common import check_method_status, load_yaml_dict, \ + seeAvailableFlowByModels def test_get_flows_by_activity(): - flowsa.getFlowByActivity(datasource="EIA_MECS_Land", year=2014, - download_FBA_if_missing=False) + flowsa.flowbyactivity.getFlowByActivity(datasource="EIA_MECS_Land", year=2014, + download_FBA_if_missing=False) def test_get_flows_by_sector(): # set function to download any FBAs that are missing - flowsa.getFlowBySector('Water_national_2015_m1', - download_FBAs_if_missing=True) + flowsa.flowbysector.getFlowBySector('Water_national_2015_m1', + download_FBAs_if_missing=True) - flowsa.getFlowBySector('TRI_DMR_state_2017', - download_FBAs_if_missing=True) + flowsa.flowbysector.getFlowBySector('TRI_DMR_state_2017', + download_FBAs_if_missing=True) - flowsa.getFlowBySector('GHG_national_2016_m1', - download_FBAs_if_missing=True) + flowsa.flowbysector.getFlowBySector('GHG_national_2016_m1', + download_FBAs_if_missing=True) - flowsa.getFlowBySector('CNHW_national_2018', - download_FBAs_if_missing=True, - download_FBS_if_missing=True) + flowsa.flowbysector.getFlowBySector('CNHW_national_2018', + download_FBAs_if_missing=True, + download_FBS_if_missing=True) # todo: reinstate after modifying bib function for recursive method diff --git a/flowsa/test_methods.py b/flowsa/test_methods.py index 4eb9ffba6..340ac61e8 100644 --- a/flowsa/test_methods.py +++ b/flowsa/test_methods.py @@ -2,11 +2,11 @@ Test FBA config and urls during github action """ import pytest -from flowsa import seeAvailableFlowByModels import flowsa.exceptions from flowsa.generateflowbyactivity import assemble_urls_for_query,\ call_urls -from flowsa.common import check_method_status, load_yaml_dict +from flowsa.common import check_method_status, load_yaml_dict, \ + seeAvailableFlowByModels @pytest.mark.skip(reason="Perform targeted test for test_FBA_urls on PR") diff --git a/flowsa/validation.py b/flowsa/validation.py index 6a192f200..7050986ad 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -8,6 +8,7 @@ import pandas as pd import numpy as np import flowsa +import flowsa.flowbysector from flowsa.flowbysector import FlowBySector from flowsa.flowbyfunctions import aggregator, collapse_fbs_sectors from flowsa.flowsa_log import log, vlog @@ -211,15 +212,15 @@ def compare_FBS_results(fbs1, fbs2, ignore_metasources=False, import flowsa # load first file - df1 = flowsa.getFlowBySector(fbs1, - download_FBS_if_missing=compare_to_remote) + df1 = flowsa.flowbysector.getFlowBySector(fbs1, + download_FBS_if_missing=compare_to_remote) # load second file if compare_to_remote: # Generate the FBS locally and then immediately load df2 = FlowBySector.generateFlowBySector( method=fbs2, download_sources_ok=True) else: - df2 = flowsa.getFlowBySector(fbs2) + df2 = flowsa.flowbysector.getFlowBySector(fbs2) df_m = compare_FBS(df1, df2, ignore_metasources=ignore_metasources) return df_m @@ -312,8 +313,8 @@ def compare_national_state_fbs(dataname=None, year=None, method=None, s = f'{dataname}_state_{year}{method}' # load the FBS as dataframes - national = FlowBySector.getFlowBySector(n) - state = FlowBySector.getFlowBySector(s) + national = FlowBySector.return_FBS(n) + state = FlowBySector.return_FBS(s) # load state level target sectors - assumption state will always be # equal or more aggregated than national @@ -554,20 +555,20 @@ def calculate_industry_coefficients(fbs_load, year,region, if __name__ == "__main__": df1 = calculate_industry_coefficients( - flowsa.getFlowBySector('Water_national_2015_m1'), 2015, + flowsa.flowbysector.getFlowBySector('Water_national_2015_m1'), 2015, "national", "summary", False) df2 = calculate_industry_coefficients( - flowsa.getFlowBySector('GRDREL_national_2017'), 2017, + flowsa.flowbysector.getFlowBySector('GRDREL_national_2017'), 2017, "national", "summary", True) df3 = calculate_industry_coefficients( - flowsa.getFlowBySector('GRDREL_national_2017'), 2017, + flowsa.flowbysector.getFlowBySector('GRDREL_national_2017'), 2017, "national", "detail", True) df4 = calculate_industry_coefficients( - flowsa.getFlowBySector('GRDREL_state_2017'), 2017, + flowsa.flowbysector.getFlowBySector('GRDREL_state_2017'), 2017, "national", "detail", True) try: df5 = calculate_industry_coefficients( - flowsa.getFlowBySector('GRDREL_state_2017'), 2017, + flowsa.flowbysector.getFlowBySector('GRDREL_state_2017'), 2017, "state", "detail", True) except TypeError: df5 = None diff --git a/scripts/FlowByActivity_Crosswalks/common_scripts.py b/scripts/FlowByActivity_Crosswalks/common_scripts.py index 5f3ac7761..3c10eab3f 100644 --- a/scripts/FlowByActivity_Crosswalks/common_scripts.py +++ b/scripts/FlowByActivity_Crosswalks/common_scripts.py @@ -7,6 +7,7 @@ import pandas as pd import flowsa +import flowsa.flowbyactivity def unique_activity_names(datasource, year, **_): @@ -22,7 +23,7 @@ def unique_activity_names(datasource, year, **_): """ # create single df representing all selected years - df = flowsa.getFlowByActivity(datasource, year) + df = flowsa.flowbyactivity.getFlowByActivity(datasource, year) # return additional columns used to return unique activity names, # if specified diff --git a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLM_PLS.py b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLM_PLS.py index 210bc63e7..5f0e02474 100644 --- a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLM_PLS.py +++ b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLM_PLS.py @@ -9,13 +9,14 @@ import numpy as np import flowsa +import flowsa.flowbyactivity from flowsa.settings import flowbysectoractivitysetspath datasource = 'BLM_PLS' year = '2012' if __name__ == '__main__': - df_import = flowsa.getFlowByActivity(datasource, year) + df_import = flowsa.flowbyactivity.getFlowByActivity(datasource, year) df = (df_import[['ActivityConsumedBy']] .drop_duplicates() diff --git a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLS_QCEW.py b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLS_QCEW.py index 914ff0199..689bd7839 100644 --- a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLS_QCEW.py +++ b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLS_QCEW.py @@ -8,6 +8,7 @@ import pandas as pd import flowsa +import flowsa.flowbyactivity from flowsa.settings import flowbysectoractivitysetspath datasource = 'BLS_QCEW' @@ -19,7 +20,7 @@ # empty df df2 = pd.DataFrame() for y in as_years: - df_import = flowsa.getFlowByActivity(datasource, y) + df_import = flowsa.flowbyactivity.getFlowByActivity(datasource, y) df = (df_import[['ActivityProducedBy']] .drop_duplicates() diff --git a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_CNHW_Food.py b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_CNHW_Food.py index 5cbea31ab..f0fe7dd24 100644 --- a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_CNHW_Food.py +++ b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_CNHW_Food.py @@ -12,12 +12,14 @@ import pandas as pd import numpy as np import flowsa +import flowsa.flowbyactivity +import flowsa.flowbysector from flowsa.settings import flowbysectoractivitysetspath, crosswalkpath methodname = 'CNHW_national_2014' if __name__ == '__main__': - df_import = flowsa.getFlowBySector(methodname) + df_import = flowsa.flowbysector.getFlowBySector(methodname) df = (df_import .query('Flowable=="Food"') @@ -30,7 +32,7 @@ # load the wasted food report activity to sector crosswalk to identify # data to include in activity set 1 - wfr_fba = flowsa.getFlowByActivity('EPA_WFR', '2018') + wfr_fba = flowsa.flowbyactivity.getFlowByActivity('EPA_WFR', '2018') wfr_fba = wfr_fba[['ActivityProducedBy']].drop_duplicates() wfr_cw = pd.read_csv(f'{crosswalkpath}/NAICS_Crosswalk_EPA_WFR.csv') wfr = wfr_fba.merge(wfr_cw[['Activity', 'Sector']], diff --git a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EIA_CBECS_Land.py b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EIA_CBECS_Land.py index 17dc18042..cef7d23c8 100644 --- a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EIA_CBECS_Land.py +++ b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EIA_CBECS_Land.py @@ -7,13 +7,14 @@ """ import flowsa +import flowsa.flowbyactivity from flowsa.settings import flowbysectoractivitysetspath datasource = 'EIA_CBECS_Land' year = '2012' if __name__ == '__main__': - df_import = flowsa.getFlowByActivity(datasource, year) + df_import = flowsa.flowbyactivity.getFlowByActivity(datasource, year) activities_to_drop = ['All buildings', 'Mercantile', 'Health care'] diff --git a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EIA_MECS_Land.py b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EIA_MECS_Land.py index 1d203356c..36a1e7369 100644 --- a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EIA_MECS_Land.py +++ b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EIA_MECS_Land.py @@ -7,6 +7,7 @@ """ import flowsa +import flowsa.flowbyactivity from flowsa.settings import flowbysectoractivitysetspath datasource = 'EIA_MECS_Land' @@ -14,7 +15,7 @@ year = '2014' if __name__ == '__main__': - df_import = flowsa.getFlowByActivity(datasource, year) + df_import = flowsa.flowbyactivity.getFlowByActivity(datasource, year) df = (df_import[['ActivityConsumedBy']] .drop_duplicates() diff --git a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EPA_REI_waste.py b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EPA_REI_waste.py index cd9473a06..61e1447e7 100644 --- a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EPA_REI_waste.py +++ b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_EPA_REI_waste.py @@ -6,13 +6,14 @@ """ import flowsa +import flowsa.flowbyactivity from flowsa.settings import flowbysectoractivitysetspath datasource = 'EPA_REI' year = '2012' if __name__ == '__main__': - df_import = flowsa.getFlowByActivity(datasource, year) + df_import = flowsa.flowbyactivity.getFlowByActivity(datasource, year) df = (df_import[['ActivityProducedBy', 'ActivityConsumedBy', 'Description']] diff --git a/scripts/writeNAICScrosswalk.py b/scripts/writeNAICScrosswalk.py index 7148e64a4..217e05e1e 100644 --- a/scripts/writeNAICScrosswalk.py +++ b/scripts/writeNAICScrosswalk.py @@ -17,7 +17,7 @@ import numpy as np import pandas as pd -from flowsa import log +from flowsa.flowsa_log import log from flowsa.common import load_crosswalk from flowsa.settings import datapath, crosswalkpath From 87d88feb3753b7e9b0b0bb5b8c917e2413605c06 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 22 Sep 2023 14:50:51 -0600 Subject: [PATCH 1003/1127] import fxns from flowsa rather than py script --- examples/get_flows_by_activity.py | 16 +++++++--------- examples/get_flows_by_sector.py | 11 +++++------ 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/examples/get_flows_by_activity.py b/examples/get_flows_by_activity.py index 20ef3c979..a3b610638 100644 --- a/examples/get_flows_by_activity.py +++ b/examples/get_flows_by_activity.py @@ -21,23 +21,21 @@ :return: a pandas DataFrame in FlowByActivity format """ - -from flowsa.common import seeAvailableFlowByModels -import flowsa.flowbyactivity +from flowsa import getFlowByActivity, seeAvailableFlowByModels from flowsa.settings import fbaoutputpath # see all datasources and years available in flowsa seeAvailableFlowByModels('FBA') # Load all information for EIA MECS Land -fba_mecs = flowsa.flowbyactivity.getFlowByActivity(datasource="EIA_MECS_Land", year=2014) +fba_mecs = getFlowByActivity(datasource="EIA_MECS_Land", year=2014) # only load state level water data and save as csv -fba_usgs = flowsa.flowbyactivity.getFlowByActivity(datasource="USGS_NWIS_WU", - year=2015, - flowclass='Water', - geographic_level='state' - ) +fba_usgs = getFlowByActivity(datasource="USGS_NWIS_WU", + year=2015, + flowclass='Water', + geographic_level='state' + ) # save output to csv, maintain leading 0s in location col fba_usgs.Location = fba_usgs.Location.apply('="{}"'.format) diff --git a/examples/get_flows_by_sector.py b/examples/get_flows_by_sector.py index d13372443..1f5a538dd 100644 --- a/examples/get_flows_by_sector.py +++ b/examples/get_flows_by_sector.py @@ -27,17 +27,16 @@ :return: dataframe in flow by sector format """ - -from flowsa.common import seeAvailableFlowByModels -import flowsa.flowbysector +from flowsa import getFlowBySector, collapse_FlowBySector, \ + seeAvailableFlowByModels # see available FBS models seeAvailableFlowByModels('FBS') # load FBS from local directory, if does not exist, method will download -fbs_water = flowsa.flowbysector.getFlowBySector('Water_national_2015_m1', - download_FBAs_if_missing=True) +fbs_water = getFlowBySector('Water_national_2015_m1', + download_FBAs_if_missing=True) # collapse the FBS - output has 'Sector' column instead of # 'SectorProducedBy' and 'SectorConsumedBy' columns -fbs_water_collapsed = flowsa.flowbysector.collapse_FlowBySector('Water_national_2015_m1') +fbs_water_collapsed = collapse_FlowBySector('Water_national_2015_m1') From 98ce6689881f4d348bef1a5574e37f3d9804ed3a Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 22 Sep 2023 14:51:12 -0600 Subject: [PATCH 1004/1127] update import statements to avoid circular reasoning --- flowsa/flowbysector.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/flowsa/flowbysector.py b/flowsa/flowbysector.py index 5ecb20239..7680c4b30 100644 --- a/flowsa/flowbysector.py +++ b/flowsa/flowbysector.py @@ -14,10 +14,9 @@ from flowsa import settings, metadata, common, exceptions, geo, naics from flowsa.common import get_catalog_info from flowsa.flowby import _FlowBy, flowby_config, get_flowby_from_config +from flowsa.flowbyfunctions import collapse_fbs_sectors from flowsa.settings import DEFAULT_DOWNLOAD_IF_MISSING from flowsa.flowsa_log import reset_log_file, log -from flowsa.validation import check_for_negative_flowamounts, \ - check_for_nonetypes_in_sector_col class FlowBySector(_FlowBy): @@ -404,9 +403,11 @@ def collapse_FlowBySector( :param methodname: string, Name of an available method for the given class :return: dataframe in flow by sector format """ - fbs = flowsa.flowbysector.getFlowBySector(methodname, fbsconfigpath, - download_FBAs_if_missing, - download_FBS_if_missing) + from flowsa.validation import check_for_negative_flowamounts, \ + check_for_nonetypes_in_sector_col + + fbs = getFlowBySector(methodname, fbsconfigpath, + download_FBAs_if_missing, download_FBS_if_missing) fbs_collapsed = collapse_fbs_sectors(fbs) # check data for NoneType in sector column From bc7f0eb225e3b5ffbd945a28a64d206ed9ba6637 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 26 Sep 2023 12:47:24 -0600 Subject: [PATCH 1005/1127] move tests to new directory --- .github/workflows/compare_single_FBS.yml | 2 +- .github/workflows/generate_FBA.yml | 2 +- .github/workflows/test_methods.yml | 6 +++--- {flowsa => tests}/test_FBS_against_remote.py | 2 +- {flowsa => tests}/test_examples.py | 0 {flowsa => tests}/test_methods.py | 0 {flowsa => tests}/test_single_FBA.py | 0 {flowsa => tests}/test_single_FBS.py | 0 8 files changed, 6 insertions(+), 6 deletions(-) rename {flowsa => tests}/test_FBS_against_remote.py (97%) rename {flowsa => tests}/test_examples.py (100%) rename {flowsa => tests}/test_methods.py (100%) rename {flowsa => tests}/test_single_FBA.py (100%) rename {flowsa => tests}/test_single_FBS.py (100%) diff --git a/.github/workflows/compare_single_FBS.yml b/.github/workflows/compare_single_FBS.yml index 7a002bd3a..a023bccd2 100644 --- a/.github/workflows/compare_single_FBS.yml +++ b/.github/workflows/compare_single_FBS.yml @@ -39,7 +39,7 @@ jobs: METHOD: ${{ github.event.inputs.method }} run: | echo "Method: ${{ github.event.inputs.method }}" - python flowsa/test_single_FBS.py --method $METHOD + python tests/test_single_FBS.py --method $METHOD - name: Upload files if: always() diff --git a/.github/workflows/generate_FBA.yml b/.github/workflows/generate_FBA.yml index 31de04f24..7abc08dfa 100644 --- a/.github/workflows/generate_FBA.yml +++ b/.github/workflows/generate_FBA.yml @@ -45,7 +45,7 @@ jobs: run: | echo "Source: ${{ github.event.inputs.source }}" echo "Year: ${{ github.event.inputs.year }}" - python flowsa/test_single_FBA.py --source $SOURCE --year $YEAR + python tests/test_single_FBA.py --source $SOURCE --year $YEAR - name: Upload files if: always() diff --git a/.github/workflows/test_methods.yml b/.github/workflows/test_methods.yml index 56bcf77f2..0f235849b 100644 --- a/.github/workflows/test_methods.yml +++ b/.github/workflows/test_methods.yml @@ -34,7 +34,7 @@ jobs: - name: Test FBA config run: | - python flowsa/test_methods.py + python tests/test_methods.py FBS_testing: runs-on: macos-latest @@ -61,9 +61,9 @@ jobs: id: FBS if: always() # Proceed even if Test FBA fails run: | - for m in $(python flowsa/test_FBS_against_remote.py list) + for m in $(python tests/test_FBS_against_remote.py list) do - python flowsa/test_FBS_against_remote.py "$m" + python tests/test_FBS_against_remote.py "$m" done - name: Upload csv files diff --git a/flowsa/test_FBS_against_remote.py b/tests/test_FBS_against_remote.py similarity index 97% rename from flowsa/test_FBS_against_remote.py rename to tests/test_FBS_against_remote.py index 56fa7e394..05ec67e25 100644 --- a/flowsa/test_FBS_against_remote.py +++ b/tests/test_FBS_against_remote.py @@ -10,7 +10,7 @@ from flowsa.flowbysector import FlowBySector from flowsa.common import check_method_status, seeAvailableFlowByModels from flowsa.settings import diffpath -from flowsa.test_single_FBS import compare_single_FBS_against_remote +from tests.test_single_FBS import compare_single_FBS_against_remote @pytest.mark.generate_fbs diff --git a/flowsa/test_examples.py b/tests/test_examples.py similarity index 100% rename from flowsa/test_examples.py rename to tests/test_examples.py diff --git a/flowsa/test_methods.py b/tests/test_methods.py similarity index 100% rename from flowsa/test_methods.py rename to tests/test_methods.py diff --git a/flowsa/test_single_FBA.py b/tests/test_single_FBA.py similarity index 100% rename from flowsa/test_single_FBA.py rename to tests/test_single_FBA.py diff --git a/flowsa/test_single_FBS.py b/tests/test_single_FBS.py similarity index 100% rename from flowsa/test_single_FBS.py rename to tests/test_single_FBS.py From d9bd436202652cec876cdf0c52a8137d888fcbf4 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 26 Sep 2023 13:46:12 -0600 Subject: [PATCH 1006/1127] expand on text explanation in FBS examples --- examples/get_flows_by_sector.py | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/examples/get_flows_by_sector.py b/examples/get_flows_by_sector.py index 1f5a538dd..84f54f2c6 100644 --- a/examples/get_flows_by_sector.py +++ b/examples/get_flows_by_sector.py @@ -11,7 +11,9 @@ master/flowsa/methods/flowbysectormethods/Water_national_2015_m1.yaml) captures the flow of withdrawn water through the economy. This dataset tracks water withdrawn by Public Supply (SectorProducedBy) that flows to -Domestic use (SectorConsumedBy). Not all FBS contain data in both the +Domestic use (SectorConsumedBy). + +Not all FBS contain data in both the SectorProducedBy and SectorConsumedBy columns. For example Employment_national_2018 (https://github.com/USEPA/flowsa/blob/master/ flowsa/methods/flowbysectormethods/Employment_national_2018.yaml) only contains @@ -21,9 +23,16 @@ Tables are standardized into a table format defined in https://github.com/USEPA/flowsa/blob/master/format%20specs/FlowBySector.md. -Retrieves stored data in the FlowBySector format - :param methodname: string, Name of an available method for the given class. - Method files found in flowsa/data/flowbysectormethods +`getFlowBySector()` has required and optional parameters + :param methodname: str, name of an available method + :param fbsconfigpath: str, path to the FBS method file if loading a file + from outside the flowsa repository, optional + :param download_FBAs_if_missing: bool, if True will attempt to load FBAs + used in generating the FBS from remote server prior to generating if + file not found locally, optional, default is False + :param download_FBS_if_missing: bool, if True will attempt to load from + remote server prior to generating if file not found locally, + optional, default is False :return: dataframe in flow by sector format """ @@ -33,10 +42,15 @@ # see available FBS models seeAvailableFlowByModels('FBS') -# load FBS from local directory, if does not exist, method will download +# load FBS from local directory, if does not exist, method will run, option +# to download the FBAs from Data Commons +# (https://dmap-data-commons-ord.s3.amazonaws.com/index.html?prefix=flowsa/) +# to run the method fbs_water = getFlowBySector('Water_national_2015_m1', download_FBAs_if_missing=True) # collapse the FBS - output has 'Sector' column instead of -# 'SectorProducedBy' and 'SectorConsumedBy' columns +# 'SectorProducedBy' and 'SectorConsumedBy' columns. The collapsed +# `Water_national_2015_m1` FBS will have 2 fewer rows, as the df is aggregated +# after dropping "SectorProducedBy" information fbs_water_collapsed = collapse_FlowBySector('Water_national_2015_m1') From 67a95a607c1336a40f7e724702c1c074c9ea5bd9 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 26 Sep 2023 13:48:48 -0600 Subject: [PATCH 1007/1127] add FBA parameter --- examples/get_flows_by_activity.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/get_flows_by_activity.py b/examples/get_flows_by_activity.py index a3b610638..a297bf431 100644 --- a/examples/get_flows_by_activity.py +++ b/examples/get_flows_by_activity.py @@ -10,14 +10,15 @@ These data are generally unchanged from the source data, with the exception of formatting. -See source_catalog.yaml for available FlowByActivity datasets and -available parameters for getFlowByActivity(). -Examples of use of flowsa. Read parquet files as dataframes. +`getFlowByActivity()` has required and optional parameters :param datasource: str, the code of the datasource. :param year: int, a year, e.g. 2012 :param flowclass: str, a 'Class' of the flow. Optional. E.g. 'Water' :param geographic_level: str, a geographic level of the data. - Optional. E.g. 'national', 'state', 'county'. + Optional. E.g. 'national', 'state', 'county'. + :param download_FBA_if_missing: bool, if True will attempt to load from + remote server prior to generating if file not found locally, + optional, default is False :return: a pandas DataFrame in FlowByActivity format """ From 97215e8d580ae470c0eef03e23e6370091543682 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 26 Sep 2023 14:31:14 -0600 Subject: [PATCH 1008/1127] simplify readme example so does not require api key --- README.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 238680305..13db6421e 100644 --- a/README.md +++ b/README.md @@ -28,17 +28,26 @@ exception of formatting. A list of available FBA datasets can be found in the [Wiki](https://github.com/USEPA/flowsa/wiki/Available-Data#flow-by-activity-datasets). `import flowsa` \ +Return list of all availble FBA datasets, including years `flowsa.seeAvailableFlowByModels('FBA')` \ -`flowsa.return_FBA(datasource="USDA_CoA_Cropland", year=2017)` +Generate and return pandas dataframe for 2014 Energy Information +Administration (EIA) Manufacturing Energy Consumption Survey (MECS) land use \ +`fba = getFlowByActivity(datasource="EIA_MECS_Land", year=2014)` ### Flow-By-Sector (FBS) Datasets Flow-By-Sector datasets are tables of environmental and other data attributed to [sectors](https://www.census.gov/naics/). A list of available -FBS datasets can be found in the [Wiki](https://github.com/USEPA/flowsa/wiki/Available-Data#flow-by-sector-datasets). +FBS datasets can be found in the +[Wiki](https://github.com/USEPA/flowsa/wiki/Available-Data#flow-by-sector-datasets). `import flowsa` \ +Return list of all available FBS datasets, including years `flowsa.seeAvailableFlowByModels('FBS')` \ -`flowsa.return_FBS('Water_national_2015_m1')` +Generate and return pandas dataframe for national water withdrawals +attributed to 6-digit sectors. Download all required FBA datasets from +Data Commons. \ +`fbs_water = getFlowBySector('Water_national_2015_m1', +download_FBAs_if_missing=True)` ## Installation `pip install git+https://github.com/USEPA/flowsa.git@vX.X.X#egg=flowsa` @@ -50,7 +59,8 @@ where vX.X.X can be replaced with the version you wish to install under For more information on `flowsa` see the [wiki](https://github.com/USEPA/flowsa/wiki). ### Accessing datsets output by FLOWSA -FBA and FBS datasets can be accessed on [EPA's Data Commons](https://dmap-data-commons-ord.s3.amazonaws.com/index.html?prefix=flowsa/) without running the Python code. +FBA and FBS datasets can be accessed on +[EPA's Data Commons](https://dmap-data-commons-ord.s3.amazonaws.com/index.html?prefix=flowsa/) without running the Python code. ## Disclaimer From 0fcafd2d9015f6f211c29653158996a589966030 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 26 Sep 2023 14:56:01 -0600 Subject: [PATCH 1009/1127] convert log statements to f-strings --- flowsa/bibliography.py | 4 +- flowsa/data_source_scripts/USGS_MYB.py | 4 +- flowsa/flowby.py | 107 ++++++++++--------------- flowsa/flowbyactivity.py | 31 ++++--- flowsa/sectormapping.py | 7 +- 5 files changed, 65 insertions(+), 88 deletions(-) diff --git a/flowsa/bibliography.py b/flowsa/bibliography.py index 7f985a0d2..1ebcc8b8a 100644 --- a/flowsa/bibliography.py +++ b/flowsa/bibliography.py @@ -33,8 +33,8 @@ def generate_list_of_sources_in_fbs_method(methodname): try: sources.append([fbs_k, fbs_v['year']]) except KeyError: - log.info('Could not append %s to datasource ' - 'list because missing year', fbs_k) + log.info(f'Could not append {fbs_k} to datasource ' + 'list because missing year') continue activities = fbs_v['activity_sets'] for aset, attr in activities.items(): diff --git a/flowsa/data_source_scripts/USGS_MYB.py b/flowsa/data_source_scripts/USGS_MYB.py index 52d6ceaf7..dce9375df 100644 --- a/flowsa/data_source_scripts/USGS_MYB.py +++ b/flowsa/data_source_scripts/USGS_MYB.py @@ -82,8 +82,8 @@ def usgs_myb_year(years, current_year_str): column_val = current_year - lower_year + 1 return "year_" + str(column_val) else: - log.info("Your year is out of scope. Pick a year between %s and %s", - lower_year, upper_year) + log.info(f"Your year is out of scope. Pick a year between " + f"{lower_year} and {upper_year}") def usgs_myb_name(USGS_Source): diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 37ed8e303..2d656a7c8 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -75,8 +75,8 @@ def get_flowby_from_config( config=config ) else: - log.critical('Unrecognized data format %s for source %s', - config['data_format'], name) + log.critical(f'Unrecognized data format {config["data_format"]} for ' + f'source {name}') raise ValueError('Unrecognized data format') @@ -234,10 +234,8 @@ def _getFlowBy( if download_ok else ['import local', 'generate']) for attempt in attempt_list: - log.info( - 'Attempting to %s %s %s', - attempt, file_metadata.name_data, file_metadata.category - ) + log.info(f'Attempting to {attempt} {file_metadata.name_data} ' + f'{file_metadata.category}') if attempt == 'download': esupy.processed_data_mgmt.download_from_remote( file_metadata, @@ -250,34 +248,24 @@ def _getFlowBy( paths ) if df is None: - log.info( - '%s %s not found in %s', - file_metadata.name_data, - file_metadata.category, - paths.local_path - ) + log.info(f'{file_metadata.name_data} {file_metadata.category} ' + f'not found in {paths.local_path}') else: - log.info( - 'Successfully loaded %s %s from %s', - file_metadata.name_data, - file_metadata.category, - output_path - ) + log.info(f'Successfully loaded {file_metadata.name_data} ' + f'{file_metadata.category} from {output_path}') break else: - log.error( - '%s %s could not be found locally, downloaded, or generated', - file_metadata.name_data, file_metadata.category - ) + log.error(f'{file_metadata.name_data} {file_metadata.category} ' + f'could not be found locally, downloaded, or generated') fb = cls(df, full_name=full_name or '', config=config or {}) return fb def convert_daily_to_annual(self: FB) -> FB: daily_list = ['/d', '/day'] if any(self.Unit.str.endswith(tuple(daily_list))): - log.info('Converting daily flows %s to annual', - [unit for unit in self.Unit.unique() if any( - x in unit for x in daily_list)]) + log.info(f'Converting daily flows ' + f'{[unit for unit in self.Unit.unique() if any(x in unit for x in daily_list)]} ' + f'to annual') return ( self .assign(FlowAmount=self.FlowAmount.mask( @@ -508,7 +496,7 @@ def select_by_fields( filtered_fb = filtered_fb.query(f'{field} in @check_values') if filtered_fb.empty: - log.warning('%s FBA is empty', filtered_fb.full_name) + log.warning(f'{filtered_fb.full_name} FBA is empty') for k in ['Activity', 'Sector']: if isinstance(other_fields.get(f'Primary{k}'), dict): @@ -732,21 +720,21 @@ def attribute_flows_to_sectors( attributed_fb = fb.equally_attribute() elif attribution_method != 'direct': - log.error('Attribution method for %s not recognized: %s', - fb.full_name, attribution_method) + log.error(f'Attribution method for {fb.full_name} not ' + f'recognized: {attribution_method}') raise ValueError('Attribution method not recognized') else: if all(fb.groupby('group_id')['group_id'].agg('count') == 1): - log.info('No attribution needed for %s at the given industry ' - 'aggregation level', fb.full_name) + log.info(f'No attribution needed for {fb.full_name} at ' + f'the given industry aggregation level') attributed_fb = fb.copy() validate = False else: if step_config.get('attribution_method') is None: - log.warning('No attribution method specified for %s. ' - 'Using equal attribution as default.', - fb.full_name) + log.warning(f'No attribution method specified for ' + f'{fb.full_name}. Using equal attribution ' + f'as default.') log.info(f"Equally attributing {self.full_name} to " f"target sectors.") attributed_fb = fb.equally_attribute() @@ -769,8 +757,8 @@ def attribute_flows_to_sectors( 'ActivityProducedBy', 'ActivityConsumedBy', 'SectorProducedBy', 'SectorConsumedBy', 'Location', 'FlowAmount', 'group_total', 'validation_total']]) - log.error('Errors in attributing flows from %s:\n%s', - self.full_name, errors) + log.error(f'Errors in attributing flows from ' + f'{self.full_name}:\n{errors}') # calculate the percent change in df caused by attribution fbsum = (fb[['group_id', 'group_total']] .drop_duplicates())['group_total'].sum() @@ -814,7 +802,7 @@ def activity_sets(self) -> List['FB']: if 'activity_sets' not in self.config: return [self] - log.info('Splitting %s into activity sets', self.full_name) + log.info(f'Splitting {self.full_name} into activity sets') activities = self.config['activity_sets'] parent_config = {k: v for k, v in self.config.items() if k not in ['activity_sets', @@ -825,7 +813,7 @@ def activity_sets(self) -> List['FB']: child_df_list = [] assigned_rows = set() for activity_set, activity_config in activities.items(): - log.info('Creating subset for %s', activity_set) + log.info(f'Creating subset for {activity_set}') child_df = ( parent_df @@ -840,14 +828,10 @@ def activity_sets(self) -> List['FB']: child_df = child_df.assign(SourceName=child_df.full_name) if set(child_df.row) & assigned_rows: - log.critical( - 'Some rows from %s assigned to multiple activity ' - 'sets. This will lead to double-counting:\n%s', - parent_df.full_name, - child_df.query( - f'row in {list(set(child_df.row) & assigned_rows)}' - ) - ) + log.critical(f"Some rows from {parent_df.full_name} assigned " + f"to multiple activity sets. This will lead to " + f"double-counting:" + f"\n{child_df.query(f'row in {list(set(child_df.row) & assigned_rows)}')}") # raise ValueError('Some rows in multiple activity sets') assigned_rows.update(child_df.row) @@ -858,8 +842,8 @@ def activity_sets(self) -> List['FB']: 'Check activity set definition!') if set(parent_df.row) - assigned_rows: - log.warning('Some rows from %s not assigned to an activity ' - 'set. Is this intentional?', parent_df.full_name) + log.warning(f'Some rows from {parent_df.full_name} not assigned ' + f'to an activity set. Is this intentional?') unassigned = parent_df.query('row not in @assigned_rows') return child_df_list @@ -914,17 +898,17 @@ def harmonize_geoscale( # Don't harmonize geoscales when updating Location pass elif other_geoscale < fb_geoscale: - log.info('Aggregating %s from %s to %s', other.full_name, - other_geoscale, fb_geoscale) + log.info(f'Aggregating {other.full_name} from {other_geoscale} to ' + f'{fb_geoscale}') other = ( other .convert_fips_to_geoscale(fb_geoscale) .aggregate_flowby() ) elif other_geoscale > fb_geoscale: - log.info('%s is %s, while %s is %s, so attributing %s to ' - '%s', other.full_name, other_geoscale, self.full_name, - fb_geoscale, other_geoscale, fb_geoscale) + log.info(f'{other.full_name} is {other_geoscale}, while ' + f'{self.full_name} is {fb_geoscale}, so attributing ' + f'{other_geoscale} to {fb_geoscale}') self = ( self .assign(temp_location=self.Location) @@ -968,8 +952,8 @@ def proportionally_attribute( flows from other (an FBS). """ - log.info('Attributing flows in %s using %s.', - self.full_name, other.full_name) + log.info(f'Attributing flows in {self.full_name} using ' + f'{other.full_name}.') fb_geoscale, other_geoscale, fb, other = self.harmonize_geoscale(other) @@ -1024,15 +1008,12 @@ def proportionally_attribute( unattributable = with_denominator.query(f'denominator == 0 ') if not unattributable.empty: - vlog.warning( - 'Could not attribute activities in %s due to lack of ' - 'flows in attribution source %s for mapped %s sectors %s. ' - 'See validation_log for details.', - unattributable.full_name, - other.full_name, - rank, - sorted(set(unattributable[f'{rank}Sector'])) - ) + vlog.warning(f'Could not attribute activities in ' + f'{unattributable.full_name} due to lack of ' + f'flows in attribution source ' + f'{other.full_name} for mapped {rank} sectors' + f' {sorted(set(unattributable[f"{rank}Sector"]))}. ' + f'See validation_log for details.') if other_geoscale.aggregation_level < 5: # if other_geoscale < 5: vlog.warning('This can occur when combining datasets ' diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index d7eaf29df..f5891af94 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -171,8 +171,8 @@ def map_to_fedefl_list( .assign(ConversionFactor=lambda x: x.ConversionFactor.fillna(1)) ) if mapping.empty: - log.error('Elementary flow list entries for %s not found', - mapping_subset) + log.error(f'Elementary flow list entries for {mapping_subset} not ' + f'found') return FlowByActivity(self, mapped=True) mapped_fba = fba.merge(mapping, @@ -200,13 +200,13 @@ def map_to_fedefl_list( ) if any(mapped_fba.mapped == 'both'): - log.info('Units standardized to %s by mapping to federal ' - 'elementary flow list', list(mapping.TargetUnit.unique())) + log.info(f'Units standardized to ' + f'{list(mapping.TargetUnit.unique())} by mapping to ' + f'federal elementary flow list') if any(mapped_fba.mapped == 'left_only'): - log.warning('Some units not standardized by mapping to federal ' - 'elementary flows list: %s', - list(mapped_fba - .query('mapped == "left_only"').Unit.unique())) + log.warning(f"Some units not standardized by mapping to federal " + f"elementary flows list: " + f"{list(mapped_fba.query('mapped == left_only').Unit.unique())}") return mapped_fba.drop(columns='mapped') @@ -269,10 +269,9 @@ def convert_to_geoscale( geoscale_name_columns = [s.name.title() for s in geo.scale if s.has_fips_level] - log.info('Determining appropriate source geoscale for %s; ' - 'target geoscale is %s', - self.full_name, - target_geoscale.name.lower()) + log.info(f'Determining appropriate source geoscale for ' + f'{self.full_name}; target geoscale is ' + f'{target_geoscale.name.lower()}') highest_reporting_level_by_geoscale = [ (self @@ -323,11 +322,9 @@ def convert_to_geoscale( ) if len(fba_at_source_geoscale.source_geoscale.unique()) > 1: - log.warning('%s has multiple source geoscales: %s', - fba_at_source_geoscale.full_name, - ', '.join([s.name.lower() for s in - fba_at_source_geoscale - .source_geoscale.unique()])) + log.warning(f"{fba_at_source_geoscale.full_name} has multiple " + f"source geoscales: " + f"{', '.join([s.name.lower() for s in fba_at_source_geoscale.source_geoscale.unique()])}") else: log.info('%s source geoscale is %s', fba_at_source_geoscale.full_name, diff --git a/flowsa/sectormapping.py b/flowsa/sectormapping.py index 3c8c57f2e..5a2c94147 100644 --- a/flowsa/sectormapping.py +++ b/flowsa/sectormapping.py @@ -143,12 +143,11 @@ def map_fbs_flows(fbs, from_fba_source, v, **kwargs): ignore_source_name = False if 'mfl_mapping' in v: mapping_files = v['mfl_mapping'] - log.info("Mapping flows in %s to material flow list", from_fba_source) + log.info(f"Mapping flows in {from_fba_source} to material flow list") flow_type = 'WASTE_FLOW' ignore_source_name = True else: - log.info("Mapping flows in %s to federal elementary flow list", - from_fba_source) + log.info(f"Mapping flows in {from_fba_source} to federal elementary flow list") if 'fedefl_mapping' in v: mapping_files = v['fedefl_mapping'] ignore_source_name = True @@ -271,7 +270,7 @@ def map_to_material_crosswalk(df, source, source_attr): material_crosswalk = source_attr.get('material_crosswalk') field_names = source_attr.get('material_crosswalk_field_dict') - log.info(f'Mapping flows in %s to %s', source, material_crosswalk) + log.info(f'Mapping flows in {source} to {material_crosswalk}') mapped_df = apply_flow_mapping(df, source, flow_type='ELEMENTARY_FLOW', field_dict=field_names, From 1a1dc29d4ac80f9a7ecd2f449d05a02ef7a84860 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 26 Sep 2023 15:33:34 -0600 Subject: [PATCH 1010/1127] import main branch version of github repos --- requirements.txt | 6 +++--- setup.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/requirements.txt b/requirements.txt index 7a3b5c6e9..9949cafd2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git@develop#egg=fedelemflowlist -git+https://github.com/USEPA/esupy.git@develop#egg=esupy -git+https://github.com/USEPA/standardizedinventories.git@develop#egg=StEWI +git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List#egg=fedelemflowlist +git+https://github.com/USEPA/esupy#egg=esupy +git+https://github.com/USEPA/standardizedinventories#egg=StEWI appdirs >= 1.4.3 # Storing user data bibtexparser>=1.2.0 # Generates bibtex kaleido == 0.1.0.post1; platform_system == "Windows" # export plotly.py figures as static images diff --git a/setup.py b/setup.py index 93798c315..0952b06eb 100644 --- a/setup.py +++ b/setup.py @@ -12,9 +12,9 @@ include_package_data=True, python_requires=">=3.9", install_requires=[ - 'fedelemflowlist @ git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git@develop#egg=fedelemflowlist', - 'esupy @ git+https://github.com/USEPA/esupy.git@develop#egg=esupy', - 'StEWI @ git+https://github.com/USEPA/standardizedinventories.git@develop#egg=StEWI', + 'fedelemflowlist @ git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List#egg=fedelemflowlist', + 'esupy @ git+https://github.com/USEPA/esupy#egg=esupy', + 'StEWI @ git+https://github.com/USEPA/standardizedinventories#egg=StEWI', 'appdirs>=1.4.3', 'bibtexparser>=1.2.0', "kaleido==0.1.0.post1;platform_system=='Windows'", From 9aa771ac9e0b9d6e946e6a5b624b70214046ccbe Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 26 Sep 2023 15:50:24 -0600 Subject: [PATCH 1011/1127] add ".git" to each package to align with syntax in stewi and fedelemflowlist --- requirements.txt | 6 +++--- setup.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/requirements.txt b/requirements.txt index 9949cafd2..71c0b0fa9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List#egg=fedelemflowlist -git+https://github.com/USEPA/esupy#egg=esupy -git+https://github.com/USEPA/standardizedinventories#egg=StEWI +git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git#egg=fedelemflowlist +git+https://github.com/USEPA/esupy.git#egg=esupy +git+https://github.com/USEPA/standardizedinventories.git#egg=StEWI appdirs >= 1.4.3 # Storing user data bibtexparser>=1.2.0 # Generates bibtex kaleido == 0.1.0.post1; platform_system == "Windows" # export plotly.py figures as static images diff --git a/setup.py b/setup.py index 0952b06eb..2d2ba627f 100644 --- a/setup.py +++ b/setup.py @@ -12,9 +12,9 @@ include_package_data=True, python_requires=">=3.9", install_requires=[ - 'fedelemflowlist @ git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List#egg=fedelemflowlist', - 'esupy @ git+https://github.com/USEPA/esupy#egg=esupy', - 'StEWI @ git+https://github.com/USEPA/standardizedinventories#egg=StEWI', + 'fedelemflowlist @ git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git#egg=fedelemflowlist', + 'esupy @ git+https://github.com/USEPA/esupy.git#egg=esupy', + 'StEWI @ git+https://github.com/USEPA/standardizedinventories.git#egg=StEWI', 'appdirs>=1.4.3', 'bibtexparser>=1.2.0', "kaleido==0.1.0.post1;platform_system=='Windows'", From 2440aa053594872ac5a30c74f212934be82764f8 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 4 Oct 2023 13:41:54 -0400 Subject: [PATCH 1012/1127] fix USGS year error in 2020 m2; update 3_22 table name --- .../flowbysectormethods/GHG_national_2020_m2.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml index 6ee81cee1..ee2ee1b3f 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml @@ -7,6 +7,7 @@ !include:GHG_national_m2_common.yaml ghgi_year: &ghgi_year 2020 mecs_year: &mecs_year 2018 +usgs_year: &usgs_year 2019 # 2020 FBA not yet available source_names: GHG_national_2020_m1: # National Summary model @@ -57,6 +58,12 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy year: *mecs_year + lead: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:lead + attribution_source: + USGS_MYB_Lead: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:lead:attribution_source:USGS_MYB_Lead + year: *usgs_year EPA_GHGI_T_2_1: #U.S. GHG emissions !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 @@ -119,7 +126,7 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_4_46 year: *ghgi_year - EPA_GHGI_T_3_22b: # Fossil fuel for non-energy uses + EPA_GHGI_T_3_22: # Fossil fuel for non-energy uses !include:GHG_national_m2_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions year: *ghgi_year From 9bb61262612e0e031d7049679239fe05e3eedc58 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 4 Oct 2023 13:54:57 -0400 Subject: [PATCH 1013/1127] fix error in where lead is updated --- .../flowbysectormethods/GHG_national_2020_m2.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml index ee2ee1b3f..17d2ab09b 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml @@ -58,16 +58,18 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy year: *mecs_year + EPA_GHGI_T_2_1: #U.S. GHG emissions + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 + year: *ghgi_year + activity_sets: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets lead: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:lead + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead attribution_source: USGS_MYB_Lead: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:lead:attribution_source:USGS_MYB_Lead + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead year: *usgs_year - EPA_GHGI_T_2_1: #U.S. GHG emissions - !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 - year: *ghgi_year EPA_GHGI_T_3_68: #CH4 from Natural Gas Systems !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year From 1ba15d5bb790335900d6d2044b87b3e6a76abf69 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 4 Oct 2023 14:07:43 -0400 Subject: [PATCH 1014/1127] proportionally attribute national flows for transport (CO2) based on each states use of petroleum in that sector --- .../GHG_state_m1_common.yaml | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml index 79db8e57c..da9bc3b17 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml @@ -7,6 +7,20 @@ # year: &ghg_year 2019 geoscale: state +_allocation_types: + _use_allocation: &use_table_allocation + # year: *ghg_year + geoscale: state + activity_to_sector_mapping: BEA_2012_Summary + # selection_fields: + # ActivityProducedBy: {'324': ''} # Petroleum 324110 + exclusion_fields: + ActivityConsumedBy: ['F030', 'F040', 'F050', 'F051', + 'F02E', 'F06E', 'F07E', 'F10E'] + attribution_method: equal + ## No attribution supplied (will use equal) because target level for + ## modeling is BEA summary level. + source_names: EPA_StateGHGI: ## Directly sourced from State Inventory FBA @@ -231,14 +245,15 @@ source_names: - 'EPA_GHGI_T_3_13.direct_petroleum' - 'EPA_GHGI_T_3_13.petroleum_fuels' attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] + attribute_on: ['PrimarySector'] # SPB for emissions, SCB for Use table fill_columns: Location attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI + stateio_Use_Summary: + <<: *use_table_allocation + # year: *ghg_year selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_petroleum + ActivityProducedBy: {'324': ''} # Petroleum fuel + transport_ng: selection_fields: From fe60efdd627e6699ec0210f3ea248f2fa327b755 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 5 Oct 2023 19:10:25 -0400 Subject: [PATCH 1015/1127] use use table for additional transport sectors --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 72 +++++++++---------- .../GHG_state_m1_common.yaml | 32 ++++----- 2 files changed, 48 insertions(+), 56 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index a65c1918f..142e36ec0 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -154,9 +154,6 @@ EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Indus EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,31,,ind_com_ch4_n2o EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,32,,ind_com_ch4_n2o EPA_State_GHGI,Industry - Stationary Combustion - Fossil Fuel Combustion - Industrial,NAICS_2012_Code,33,,ind_com_ch4_n2o -EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal - Manufacturing,NAICS_2012_Code,31,,industrial_coal (only used in m1) -EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal - Manufacturing,NAICS_2012_Code,32,,industrial_coal (only used in m1) -EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal - Manufacturing,NAICS_2012_Code,33,,industrial_coal (only used in m1) EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,31,,use_table_coal EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,32,,use_table_coal EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,33,,use_table_coal @@ -164,9 +161,6 @@ EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combusti EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,21,,use_table_coal EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,2212,,use_table_coal EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Coal,NAICS_2012_Code,23,,use_table_coal -EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas - Manufacturing,NAICS_2012_Code,31,,industrial_gas (only used in m1) -EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas - Manufacturing,NAICS_2012_Code,32,,industrial_gas (only used in m1) -EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas - Manufacturing,NAICS_2012_Code,33,,industrial_gas (only used in m1) EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,31,,use_table_gas EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,32,,use_table_gas EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Natural Gas,NAICS_2012_Code,33,,use_table_gas @@ -192,30 +186,30 @@ EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Oth EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway,NAICS_2012_Code,491,,transport_alt_fuel EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway,NAICS_2012_Code,492,,transport_alt_fuel EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Other - Alternative Fuel Highway,NAICS_2012_Code,F010,,transport_alt_fuel -EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,48,,transport_petroleum -EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,491,,transport_petroleum -EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,492,,transport_petroleum -EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,922,,transport_petroleum -EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,928,,transport_petroleum -EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,F010,,transport_petroleum -EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,S00201,,transport_petroleum -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,NAICS_2012_Code,48,,transport_diesel -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,NAICS_2012_Code,491,,transport_diesel -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,NAICS_2012_Code,492,,transport_diesel -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,NAICS_2012_Code,922,,transport_diesel -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,NAICS_2012_Code,928,,transport_diesel -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,NAICS_2012_Code,F010,,transport_diesel -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,NAICS_2012_Code,S00201,,transport_diesel -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,NAICS_2012_Code,48,,transport_gasoline -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,NAICS_2012_Code,491,,transport_gasoline -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,NAICS_2012_Code,492,,transport_gasoline -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,NAICS_2012_Code,922,,transport_gasoline -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,NAICS_2012_Code,928,,transport_gasoline -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,NAICS_2012_Code,F010,,transport_gasoline -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,NAICS_2012_Code,S00201,,transport_gasoline -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Non-Highway,NAICS_2012_Code,481,,transport_nonroad -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Non-Highway,NAICS_2012_Code,482,,transport_nonroad -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Non-Highway,NAICS_2012_Code,483,,transport_nonroad +EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,48,,transport_petroleum - replaced by stateio_Use +EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,491,,transport_petroleum - replaced by stateio_Use +EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,492,,transport_petroleum - replaced by stateio_Use +EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,922,,transport_petroleum - replaced by stateio_Use +EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,928,,transport_petroleum - replaced by stateio_Use +EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,F010,,transport_petroleum - replaced by stateio_Use +EPA_State_GHGI,Transportation - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Petroleum,NAICS_2012_Code,S00201,,transport_petroleum - replaced by stateio_Use +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,NAICS_2012_Code,48,,transport_diesel - replaced by stateio_Use +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,NAICS_2012_Code,491,,transport_diesel - replaced by stateio_Use +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,NAICS_2012_Code,492,,transport_diesel - replaced by stateio_Use +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,NAICS_2012_Code,922,,transport_diesel - replaced by stateio_Use +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,NAICS_2012_Code,928,,transport_diesel - replaced by stateio_Use +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,NAICS_2012_Code,F010,,transport_diesel - replaced by stateio_Use +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Diesel Highway,NAICS_2012_Code,S00201,,transport_diesel - replaced by stateio_Use +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,NAICS_2012_Code,48,,transport_gasoline - replaced by stateio_Use +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,NAICS_2012_Code,491,,transport_gasoline - replaced by stateio_Use +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,NAICS_2012_Code,492,,transport_gasoline - replaced by stateio_Use +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,NAICS_2012_Code,922,,transport_gasoline - replaced by stateio_Use +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,NAICS_2012_Code,928,,transport_gasoline - replaced by stateio_Use +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,NAICS_2012_Code,F010,,transport_gasoline - replaced by stateio_Use +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Gasoline Highway,NAICS_2012_Code,S00201,,transport_gasoline - replaced by stateio_Use +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Non-Highway,NAICS_2012_Code,481,,transport_nonroad - replaced by stateio_Use +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Non-Highway,NAICS_2012_Code,482,,transport_nonroad - replaced by stateio_Use +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Non-Highway,NAICS_2012_Code,483,,transport_nonroad - replaced by stateio_Use EPA_State_GHGI,U.S. Territories - Stationary Combustion - Fossil Fuel Combustion - US Territories,,,,exclude - territories EPA_State_GHGI,U.S. Territories - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - US Territories - Coal,,,,exclude - territories EPA_State_GHGI,U.S. Territories - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - US Territories - Natural Gas,,,,exclude - territories @@ -239,15 +233,15 @@ EPA_State_GHGI,Industry - Petroleum Systems - Fugitive,NAICS_2012_Code,3241,,pet EPA_State_GHGI,Industry - Petroleum Systems - Fugitive,NAICS_2012_Code,486,,pet_systems EPA_State_GHGI,Agriculture - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,NAICS_2012_Code,111,,use_table_pet EPA_State_GHGI,Agriculture - Stationary Combustion - Fossil Fuel Combustion - Industrial - AG Stationary,NAICS_2012_Code,112,,use_table_pet -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,481,,transport_nonroad -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,482,,transport_nonroad -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,483,,transport_nonroad -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,NAICS_2012_Code,481,,transport_nonroad -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,NAICS_2012_Code,482,,transport_nonroad -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,NAICS_2012_Code,483,,transport_nonroad -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,481,,transport_nonroad -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,482,,transport_nonroad -EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,483,,transport_nonroad +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,481,,transport_nonroad - replaced by stateio_Use +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,482,,transport_nonroad - replaced by stateio_Use +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,483,,transport_nonroad - replaced by stateio_Use +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,NAICS_2012_Code,481,,transport_nonroad - replaced by stateio_Use +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,NAICS_2012_Code,482,,transport_nonroad - replaced by stateio_Use +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,NAICS_2012_Code,483,,transport_nonroad - replaced by stateio_Use +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,481,,transport_nonroad - replaced by stateio_Use +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,482,,transport_nonroad - replaced by stateio_Use +EPA_State_GHGI,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,NAICS_2012_Code,483,,transport_nonroad - replaced by stateio_Use EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,2213,,ods_substitutes EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,42,,ods_substitutes EPA_State_GHGI,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,NAICS_2012_Code,44,,ods_substitutes diff --git a/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml index da9bc3b17..669b44234 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml @@ -272,18 +272,16 @@ source_names: selection_fields: MetaSources: - 'EPA_GHGI_T_3_14.petroleum_fuels_diesel' - - 'EPA_GHGI_T_3_14.direct_diesel' - 'EPA_GHGI_T_3_15.petroleum_fuels_diesel' - - 'EPA_GHGI_T_3_15.direct_diesel' attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] + attribute_on: ['PrimarySector'] # SPB for emissions, SCB for Use table fill_columns: Location attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI + stateio_Use_Summary: + <<: *use_table_allocation + # year: *ghg_year selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_diesel + ActivityProducedBy: {'324': ''} # Petroleum fuel transport_ch4_n2o_gasoline: selection_fields: @@ -293,14 +291,14 @@ source_names: - 'EPA_GHGI_T_3_15.petroleum_fuels_gasoline' - 'EPA_GHGI_T_3_15.direct_gasoline' attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] + attribute_on: ['PrimarySector'] # SPB for emissions, SCB for Use table fill_columns: Location attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI + stateio_Use_Summary: + <<: *use_table_allocation + # year: *ghg_year selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_gasoline + ActivityProducedBy: {'324': ''} # Petroleum fuel transport_ch4_n2o_alt: selection_fields: @@ -323,14 +321,14 @@ source_names: - 'EPA_GHGI_T_3_14.direct_non_road' - 'EPA_GHGI_T_3_15.direct_non_road' attribution_method: proportional - attribute_on: ['Flowable', 'SectorProducedBy'] + attribute_on: ['PrimarySector'] # SPB for emissions, SCB for Use table fill_columns: Location attribution_source: - EPA_StateGHGI: - geoscale: state - fedefl_mapping: GHGI + stateio_Use_Summary: + <<: *use_table_allocation + # year: *ghg_year selection_fields: - PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv transport_nonroad + ActivityProducedBy: {'324': ''} # Petroleum fuel transport_ch4_n2o_nonroad_other: selection_fields: From c93e7a015eb83de5c6c88ed520fbad889aa9622e Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 11 Oct 2023 11:23:47 -0600 Subject: [PATCH 1016/1127] update BEA data import notes --- flowsa/data_source_scripts/BEA.py | 4 +- scripts/pull_BEA_Make_and_Use_csv.py | 75 ++++++++++++++++++++++++ scripts/write_BEA_Use_from_useeior.py | 84 --------------------------- 3 files changed, 77 insertions(+), 86 deletions(-) create mode 100644 scripts/pull_BEA_Make_and_Use_csv.py delete mode 100644 scripts/write_BEA_Use_from_useeior.py diff --git a/flowsa/data_source_scripts/BEA.py b/flowsa/data_source_scripts/BEA.py index 5b99c4191..a6013ced3 100644 --- a/flowsa/data_source_scripts/BEA.py +++ b/flowsa/data_source_scripts/BEA.py @@ -5,9 +5,9 @@ """ Supporting functions for BEA data. -Generation of BEA Gross Output data and industry transcation data as FBA, +Generation of BEA Gross Output data and industry transaction data as FBA, Source csv files for BEA data are documented -in scripts/write_BEA_Use_from_useeior.py +in scripts/pull_BEA_Make_and_Use_csv.py """ import pandas as pd diff --git a/scripts/pull_BEA_Make_and_Use_csv.py b/scripts/pull_BEA_Make_and_Use_csv.py new file mode 100644 index 000000000..1276ad0d7 --- /dev/null +++ b/scripts/pull_BEA_Make_and_Use_csv.py @@ -0,0 +1,75 @@ +# pull_BEA_Make_and_Use_csv.py (scripts) +# !/usr/bin/env python3 +# coding=utf-8 + +""" +BEA data are imported from useeior and stored as csv files in 'external_data' +folder of flowsa + +--- +The BEA_Detail_Use_PRO_BeforeRedef was pulled from +USEEIOR's Detail_Use_YEAR_PRO_BeforeRedef.rda on 09/06/2023. + +One of the original files is found here: +https://github.com/USEPA/useeior/blob/master/data/Detail_Use_2012_PRO_BeforeRedef.rda + +csv obtained by running the following code in Rstudio: +bea <- get('Detail_Use_2012_PRO_BeforeRedef') +write.csv(bea, file='BEA_Detail_Use_2012_PRO_BeforeRedef.csv') + +CSV manually added to flowsa + +--- + +The BEA_YEAR_Detail_Make_BeforeRedef was pulled from USEEIOR's +Detail_Make_YEAR_BeforeRedef.rda on 09/06/2023. + +One of the original files is found here: +https://github.com/USEPA/useeior/blob/master/data/Detail_Make_2012_BeforeRedef.rda + +csv obtained by running the following code in Rstudio: +bea <- get('Detail_Make_2012_BeforeRedef') +write.csv(bea, file='BEA_Detail_Make_2012_BeforeRedef.csv') + +CSV manually added to flowsa + +--- +The BEA_Detail_GrossOutput was pulled from +USEEIOR's Detail_GrossOutput_IO.rda on 09/06/2023. + +The original file is found here: +https://github.com/USEPA/useeior/blob/master/data/Detail_GrossOutput_IO.rda + +csv obtained by running the following code in Rstudio: +bea <- get('Detail_GrossOutput_IO') +write.csv(bea, file='BEA_Detail_GrossOutput_IO.csv') + +CSV manually added to flowsa + +""" + +# package to read r code no longer working, so reverting to manually +# importing BEA data from useeior + +# from rpy2.robjects.packages import importr +# from rpy2.robjects import pandas2ri +# from flowsa.settings import externaldatapath +# +# pandas2ri.activate() +# +# useeior = importr('useeior') +# +# model_with_detail_2012_tables = 'USEEIOv2.0-GHG' +# model = useeior.buildEEIOModel(model_with_detail_2012_tables) +# +# # Get the UseTransactions object embedded within the BEA data +# UseIndustryTransactions = model.rx2("BEA").rx2("UseTransactions") +# # Convert to a pandas dataframe +# UseIndustryTransactions = pandas2ri.ri2py_dataframe(UseIndustryTransactions) +# +# # Get the vector of model industries +# Industries = model.rx2("BEA").rx2("Industries") +# # Apply it to the df index +# UseIndustryTransactions.index = Industries +# # Write out to csv +# UseIndustryTransactions.to_csv(f"{externaldatapath}/BEA_2012_Detail_Use_Industry_Transactions.csv") diff --git a/scripts/write_BEA_Use_from_useeior.py b/scripts/write_BEA_Use_from_useeior.py deleted file mode 100644 index 57dd91633..000000000 --- a/scripts/write_BEA_Use_from_useeior.py +++ /dev/null @@ -1,84 +0,0 @@ -# write_BEA_Use_from_useeior.py (scripts) -# !/usr/bin/env python3 -# coding=utf-8 - -""" -A script to get Use table transactions from a useeior EEIOmodel. - -- Store them as .csv -- Depends on rpy2 and tzlocal as well as having R installed and useeior installed. - - ---- -The BEA_Detail_Use_PRO_BeforeRedef was pulled from -USEEIOR's Detail_Use_2012_PRO_BeforeRedef.rda on 08/11/2022. - -The original file is found here: -https://github.com/USEPA/useeior/blob/master/data/Detail_Use_2012_PRO_BeforeRedef.rda - -csv obtained by running the following code in Rstudio: -bea <- get('Detail_Use_2012_PRO_BeforeRedef') -write.csv(bea, file='BEA_Detail_Use_2012_PRO_BeforeRedef.csv') - -CSV manually added to flowsa - ---- - -The BEA_2012_Detail_Make_BeforeRedef was pulled from USEEIOR's -Detail_Make_2012_BeforeRedef.rda on 08/11/2022. - -The original file is found here: -https://github.com/USEPA/useeior/blob/master/data/Detail_Make_2012_BeforeRedef.rda - -csv obtained by running the following code in Rstudio: -bea <- get('Detail_Make_2012_BeforeRedef') -write.csv(bea, file='BEA_Detail_Make_2012_BeforeRedef.csv') - -CSV manually added to flowsa - -https://github.com/USEPA/useeior/commit/2eece7a -"date_last_modified": ["2021-09-29"], -"date_accessed": ["2022-07-27"] - ---- -The BEA_Detail_GrossOutput was pulled from -USEEIOR's Detail_GrossOutput_IO.rda on 08/11/2022. - -The original file is found here: -https://github.com/USEPA/useeior/blob/master/data/Detail_GrossOutput_IO.rda - -csv obtained by running the following code in Rstudio: -bea <- get('Detail_GrossOutput_IO') -write.csv(bea, file='BEA_Detail_GrossOutput_IO.csv') - -https://github.com/USEPA/useeior/commit/2eece7a -"date_last_modified": ["2021-10-04"], -"date_accessed": ["2022-07-27"] - -CSV manually added to flowsa - - -""" - -from rpy2.robjects.packages import importr -from rpy2.robjects import pandas2ri -from flowsa.settings import externaldatapath - -pandas2ri.activate() - -useeior = importr('useeior') - -model_with_detail_2012_tables = 'USEEIOv2.0-GHG' -model = useeior.buildEEIOModel(model_with_detail_2012_tables) - -# Get the UseTransactions object embedded within the BEA data -UseIndustryTransactions = model.rx2("BEA").rx2("UseTransactions") -# Convert to a pandas dataframe -UseIndustryTransactions = pandas2ri.ri2py_dataframe(UseIndustryTransactions) - -# Get the vector of model industries -Industries = model.rx2("BEA").rx2("Industries") -# Apply it to the df index -UseIndustryTransactions.index = Industries -# Write out to csv -UseIndustryTransactions.to_csv(f"{externaldatapath}/BEA_2012_Detail_Use_Industry_Transactions.csv") From bccf174eb7a31680c4576865892f5f50423235b2 Mon Sep 17 00:00:00 2001 From: WesIngwersen Date: Thu, 12 Oct 2023 09:21:17 -0400 Subject: [PATCH 1017/1127] Add 2017 SUT Detail Use --- .../external_data/Detail_Use_SUT_2017.csv | 412 ++++++++++++++++++ .../Detail_Use_SUT_2017_metadata.json | 14 + scripts/write_BEA_Use_from_useeior.py | 18 +- 3 files changed, 443 insertions(+), 1 deletion(-) create mode 100644 flowsa/data/external_data/Detail_Use_SUT_2017.csv create mode 100644 flowsa/data/external_data/Detail_Use_SUT_2017_metadata.json diff --git a/flowsa/data/external_data/Detail_Use_SUT_2017.csv b/flowsa/data/external_data/Detail_Use_SUT_2017.csv new file mode 100644 index 000000000..1960509fb --- /dev/null +++ b/flowsa/data/external_data/Detail_Use_SUT_2017.csv @@ -0,0 +1,412 @@ +"","1111A0","1111B0","111200","111300","111400","111900","112120","1121A0","112300","112A00","113000","114000","115000","211000","212100","212230","2122A0","212310","2123A0","213111","21311A","221100","221200","221300","233210","233262","230301","230302","2332A0","233412","2334A0","233230","2332D0","233240","233411","2332C0","321100","321200","321910","3219A0","327100","327200","327310","327320","327330","327390","327400","327910","327991","327992","327993","327999","331110","331200","331314","331313","33131B","331410","331420","331490","331510","331520","332114","33211A","332119","332200","332310","332320","332410","332420","332430","332500","332600","332710","332720","332800","332913","33291A","332991","332996","33299A","332999","333111","333112","333120","333130","333242","33329A","333314","333316","333318","333414","333415","333413","333511","333514","333517","33351B","333611","333612","333613","333618","333912","333914","333920","333991","333993","333994","33399A","33399B","334111","334112","334118","334210","334220","334290","334413","334418","33441A","334510","334511","334512","334513","334514","334515","334516","334517","33451A","334300","334610","335110","335120","335210","335220","335311","335312","335313","335314","335911","335912","335920","335930","335991","335999","336111","336112","336120","336211","336212","336213","336214","336310","336320","336350","336360","336370","336390","3363A0","336411","336412","336413","336414","33641A","336500","336611","336612","336991","336992","336999","337110","337121","337122","337127","33712N","337215","33721A","337900","339112","339113","339114","339115","339116","339910","339920","339930","339940","339950","339990","311111","311119","311210","311221","311225","311224","311230","311300","311410","311420","311513","311514","31151A","311520","311615","31161A","311700","311810","3118A0","311910","311920","311930","311940","311990","312110","312120","312130","312140","312200","313100","313200","313300","314110","314120","314900","315000","316000","322110","322120","322130","322210","322220","322230","322291","322299","323110","323120","324110","324121","324122","324190","325110","325120","325130","325180","325190","325211","3252A0","325411","325412","325413","325414","325310","325320","325510","325520","325610","325620","325910","3259A0","326110","326120","326130","326140","326150","326160","326190","326210","326220","326290","423100","423400","423600","423800","423A00","424200","424400","424700","424A00","425000","4200ID","441000","445000","452000","444000","446000","447000","448000","454000","4B0000","481000","482000","483000","484000","485000","486000","48A000","492000","493000","511110","511120","511130","5111A0","511200","512100","512200","515100","515200","517110","517210","517A00","518200","519130","5191A0","522A00","52A000","523900","523A00","524113","5241XX","524200","525000","531HSO","531HST","531ORE","532100","532400","532A00","533000","541100","541511","541512","54151A","541200","541300","541610","5416A0","541700","541800","541400","541920","541940","5419A0","550000","561300","561700","561100","561200","561400","561500","561600","561900","562000","611100","611A00","611B00","621100","621200","621300","621400","621500","621600","621900","622000","623A00","623B00","624100","624400","624A00","711100","711200","711500","711A00","712000","713100","713200","713900","721000","722110","722211","722A00","811100","811200","811300","811400","812100","812200","812300","812900","813100","813A00","813B00","814000","S00500","S00600","491000","S00101","S00102","GSLGE","GSLGH","GSLGO","S00201","S00202","S00203","T001","F01000","F02E00","F02N00","F02R00","F02S00","F03000","F04000","F06C00","F06E00","F06N00","F06S00","F07C00","F07E00","F07N00","F07S00","F10C00","F10E00","F10N00","F10S00","T019" +"1111A0",12160,665,59,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1207,913,24360,0,0,0,0,0,0,0,0,0,0,0,0,0,328,0,13,12,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,1421,0,0,28,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-240,0,0,0,0,0,0,0,0,0,40949,0,0,0,0,0,-1032,21287,0,0,0,0,0,0,0,0,0,0,0,0,61204 +"1111B0",0,11802,0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,5,3,4,141,412,447,179,30,36,373,11,11,65,72,34,2119,61,42,58,120,39,27,43,60,68,0,2,0,0,2,3,0,0,0,0,0,2,2,4,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,1,0,3,0,0,2,1,1,0,10,0,2,0,0,1,7,3,5,0,6,7,4,6,14,0,0,6,2,4,0,0,0,0,4,0,1,0,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,42,45,25,81,8,50,79,211,77,120,69,74,77,13,56,167,65,128,58,86,12,12,21,45,66,65,16,24,60,8,32,30,4,0,2,0,0,142,871,746,188,86,3,27,22,0,0,1663,108,20,318,109,30,4,32,327,103,10,3,10,0,5,17,2,2,3,9,2,0,10,39,15,7,19,10,9,89,40,7,21,0,4,0,0,4,0,4,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,0,0,114,0,0,0,0,0,50,0,0,0,10,0,0,0,0,20,17,4,0,0,0,0,0,0,0,0,34,15,2,2,4,1,0,0,0,0,2,0,4,8,23,563,542,145,9,0,4,0,0,0,8,0,0,0,13,0,0,4456,0,0,0,416,537,210,0,6995,0,33971,221,0,0,0,0,-1172,9597,0,0,0,0,0,0,0,0,0,0,0,0,42616 +"212230",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,408,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,41,0,0,389,22,117,0,0,261,66,485,0,0,0,0,0,0,0,0,0,0,0,0,72,0,0,418,0,0,0,0,0,46,52,0,0,35,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0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,0,0,0,0,0,0,0,128,0,7,1,0,3,0,0,0,0,0,0,0,0,0,0,2,4,0,1,3,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,134,0,0,53,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,174,0,0,125,20342,0,0,0,0,0,-11,140,0,0,0,0,0,0,0,0,0,0,0,0,20470 +"2123A0",1,482,2,5,0,192,3,0,0,2,0,0,0,0,10,1,1,34,515,23,38,982,29,260,66,173,127,171,595,209,670,215,152,122,2250,406,0,0,0,0,860,214,106,5023,542,252,463,83,176,289,243,428,343,0,0,0,0,0,0,0,550,19,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,152,1,61,1,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,17,0,0,0,1,0,0,10,278,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,337,132,0,0,0,0,0,0,0,106,2065,818,0,0,14,28,614,8,0,0,0,0,0,0,1043,0,569,379,0,42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,18,0,0,0,0,0,0,0,0,0,0,0,0,1,6,0,0,0,0,0,0,0,0,0,0,126,0,0,316,0,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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112,1808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16455,0,2288,0,0,69029,-77,3045,0,0,0,0,0,0,0,0,0,0,0,0,90739 +"221100",153,204,318,331,75,392,1021,187,236,153,8,9,67,2613,880,325,1183,510,665,156,504,9500,102,268,169,494,1058,405,826,464,1465,252,480,364,1579,678,621,529,266,249,227,1128,703,193,72,89,238,62,45,200,252,93,2149,321,50,430,407,282,169,172,465,310,109,331,144,109,341,307,54,65,201,71,98,481,476,607,38,227,97,53,114,148,126,18,149,147,20,243,36,4,121,39,150,40,107,104,48,118,73,30,60,171,42,120,132,22,30,18,157,98,4,4,11,7,68,3,1180,38,114,89,153,0,9,10,21,39,25,20,0,3,1,53,7,72,21,44,53,31,88,1,59,92,55,74,51,241,32,63,46,1,63,407,172,305,367,326,402,239,490,561,188,171,247,90,185,60,39,23,28,142,65,35,44,27,77,142,40,191,124,30,33,34,30,106,5,25,82,193,139,223,229,285,22,91,93,432,353,272,271,186,328,106,403,755,102,485,285,244,56,52,112,207,420,230,95,49,211,175,293,109,89,20,90,4,13,230,1245,2280,870,250,79,134,106,1279,42,3932,305,98,124,503,1469,132,1598,2282,1919,262,153,532,37,264,432,69,126,110,296,137,28,478,787,370,61,168,93,440,1959,278,68,274,943,959,1055,1292,2566,1142,2089,322,3089,445,0,4475,9322,8193,2037,2024,4693,1872,2485,2977,240,26,103,3635,251,528,830,233,2174,109,59,148,50,626,489,4,294,99,2603,1017,165,1440,744,22,708,3411,692,242,67,329,308,7,0,602,36155,216,347,264,113,687,249,210,45,381,799,1124,110,1923,440,119,100,111,398,5064,291,735,366,214,441,168,151,348,679,240,2483,96,1585,383,390,1498,121,162,159,8314,3165,480,424,607,266,79,211,58,324,289,373,427,2379,5840,6833,10455,879,1421,99,225,187,1028,42,606,541,54,86,1111,0,1580,302,65,1723,138,2981,622,1897,103,258,903,277787,177661,0,0,0,0,0,2744,0,0,0,0,0,0,0,0,0,0,0,0,458193 +"221200",23,326,23,59,175,123,71,141,182,37,2,3,5,226,11,15,19,11,68,4,31,47,1,41,4,0,42,6,21,7,35,7,14,9,23,37,51,47,19,28,37,109,118,47,8,9,99,3,4,17,19,9,146,16,11,16,32,11,7,11,16,18,31,57,18,20,46,44,6,12,16,9,15,57,38,133,6,18,10,7,16,23,17,1,19,17,1,23,3,0,12,6,17,5,9,5,4,9,7,3,5,16,4,11,18,2,5,2,16,7,0,1,0,0,1,0,45,3,2,6,34,0,1,0,0,6,0,0,0,0,1,9,0,6,2,6,7,1,28,1,3,7,9,4,2,48,5,14,6,0,7,32,11,25,32,31,35,18,25,59,30,18,28,16,16,10,9,5,3,19,6,3,6,4,11,22,4,11,5,2,0,4,2,12,1,2,13,21,25,28,14,49,5,30,47,127,46,71,41,43,45,8,34,99,38,76,34,51,8,7,13,26,34,33,8,12,30,5,21,20,7,3,6,1,1,58,358,307,76,35,2,11,9,67,2,1136,74,13,31,627,70,14,290,570,241,24,6,24,1,11,696,5,6,5,20,3,0,23,44,17,8,21,11,9,98,44,8,23,10,8,40,3,35,1,23,14,51,3,0,206,25,29,56,7,4,7,10,31,42,30,166,631,16,163,442,62,527,6,0,3,1,1,6,0,3,3,9,3,13,5,6,0,31,329,30,4,5,25,42,1272,0,0,4820,326,51,25,15,6,2,0,0,20,14,1,1,10,3,2,1,1,8,79,9,119,35,44,9,8,20,17,202,481,656,76,14,1,3,14,0,1,13,118,64,11,9,24,4,3,2,1,6,8,7,8,32,137,203,178,12,50,2,16,5,17,2,39,13,64,1,49,0,653,308,326,76,136,3143,1057,2211,42,3,264,31503,48152,0,0,0,0,0,559,0,0,0,0,0,0,0,0,0,0,0,0,80214 +"221300",570,1847,633,709,90,919,66,85,77,28,0,2,7,1221,7,0,6,20,20,16,16,1186,63,130,8,8,111,51,59,29,245,40,34,46,171,87,12,15,11,12,13,49,2,23,3,9,5,2,5,3,13,6,69,13,4,1,12,4,6,9,16,13,8,9,7,7,16,17,6,4,4,6,6,20,20,46,5,11,5,2,9,8,5,2,6,5,4,13,2,0,5,3,6,2,3,4,2,4,3,1,2,6,1,5,4,1,2,1,9,3,0,0,0,0,2,0,29,1,2,5,33,0,0,0,4,3,0,2,0,0,0,6,0,3,0,2,3,1,4,0,1,3,4,4,3,29,2,6,3,4,201,15,6,10,20,10,17,10,13,47,13,20,49,5,15,5,3,3,0,10,5,1,3,2,3,11,5,11,12,2,3,3,1,4,1,2,8,11,12,9,8,17,2,5,6,33,29,41,28,24,53,13,69,79,10,36,20,28,4,10,18,27,54,32,8,10,16,4,13,10,9,2,6,0,1,9,36,54,37,16,2,6,7,46,3,236,8,13,26,30,21,9,90,634,103,18,11,45,5,25,11,13,19,13,24,13,2,63,24,16,7,7,7,6,65,14,6,12,10,56,393,71,221,33,180,19,170,28,0,433,255,140,87,95,211,84,74,157,2,14,5,95,36,7,25,42,49,5,4,15,1,21,40,1,23,25,62,17,35,31,29,0,50,131,62,16,13,44,21,1562,1,0,1271,33,43,35,64,80,12,22,6,40,84,66,22,61,9,20,10,4,24,109,16,167,28,148,48,22,17,30,614,139,2629,12,154,32,2,67,12,14,11,638,303,53,2,18,23,7,13,4,41,20,24,45,139,608,598,492,52,162,7,19,20,121,5,129,22,93,6,271,0,1278,591,141,75,112,1960,1824,5566,23,835,415,40658,39603,0,0,0,0,0,705,0,0,0,0,0,0,0,0,0,0,0,0,80967 +"233210",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,20501,0,0,0,0,0,1256,0,0,0,211,0,0,0,79213,101181 +"230301",198,354,184,159,155,250,93,0,39,112,0,14,19,180,967,480,180,481,580,236,1868,6988,388,23,2,2,50,7,26,10,39,13,19,19,32,29,132,72,54,50,60,186,87,197,46,62,43,13,22,28,39,33,369,93,30,11,85,30,34,44,104,82,43,84,45,42,134,102,16,18,29,23,41,164,166,138,14,72,32,18,31,44,51,7,79,59,7,72,15,4,51,8,54,14,33,28,19,38,33,12,27,59,11,54,52,11,11,5,51,35,0,0,3,0,16,1,232,18,52,42,53,0,6,69,6,15,4,10,0,0,1,14,0,22,8,9,15,9,17,0,10,21,6,10,13,125,9,18,13,0,15,97,31,78,82,108,98,72,59,198,43,24,37,26,88,11,14,7,6,27,17,5,9,9,14,33,12,74,54,14,12,14,14,18,1,7,30,56,45,46,29,21,4,12,12,93,61,68,52,47,101,30,102,241,33,120,53,81,15,15,39,62,87,32,25,15,68,10,32,18,10,5,12,1,3,74,145,275,299,56,13,26,15,284,11,9096,68,34,81,241,70,28,189,456,331,38,27,141,12,77,79,24,28,21,69,37,6,114,112,63,11,26,21,45,290,65,12,40,518,171,306,446,525,137,284,200,693,83,0,1383,911,1876,506,293,1348,410,288,526,227,2394,68,561,313,470,965,344,813,19,16,29,3,67,106,2,30,21,513,1611,162,184,368,1,850,5080,929,360,205,74,385,103,0,0,43151,95,426,116,0,177,19,35,5,123,687,37,9,357,39,59,24,76,139,737,69,183,29,305,36,80,46,51,130,24,1696,270,257,52,49,295,25,17,22,1110,423,158,130,281,68,9,31,5,75,92,70,100,313,2809,668,887,119,343,37,101,35,324,35,98,100,1124,80,1043,0,6137,362,10,530,0,9603,4506,17479,2,92,41262,204348,0,0,0,0,0,0,81,0,0,0,0,0,0,0,0,0,0,0,0,204428 +"230302",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,2377,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,114,0,27,0,0,0,0,0,0,0,0,0,0,5,4,0,0,127,0,0,0,0,0,0,0,194,0,0,66,0,0,0,0,0,3,0,3,0,0,8,0,0,10,5,0,2,0,245,1,0,9,0,0,3,54,0,0,5,32,123,5,0,0,0,0,2,12,59,12,28,5,2,0,0,0,30,0,0,0,0,25,0,42,0,2,20,0,0,0,49,0,77,0,1,146,49764,0,0,0,0,0,-51,4467,0,0,0,0,0,0,0,0,0,0,0,0,54181 +"321200",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,815,2532,2227,1154,2593,1278,4693,720,1174,668,4990,1876,0,3509,1197,792,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,236,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,120,0,0,0,807,0,540,0,0,0,1,0,0,0,0,73,0,0,0,1419,368,143,210,110,177,1247,0,0,361,0,0,0,0,0,0,7,160,92,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,3,655,0,0,0,0,4,1,1,5,0,0,0,0,0,0,0,0,0,0,0,0,11,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,34,221,0,396,0,0,0,0,0,0,0,0,0,0,6,4,0,0,177,0,0,0,0,0,0,0,0,0,0,20,0,56,0,0,0,0,0,0,0,205,0,0,0,0,0,0,7,0,3,0,0,2,0,0,4,160,0,0,50,78,227,1,0,0,0,0,0,0,76,1,276,16,3,0,0,0,19,0,0,0,0,21,0,91,0,0,3,0,0,0,980,3,9,0,0,79,40258,0,0,0,0,0,66,1274,0,0,0,0,0,0,0,0,0,0,0,0,41599 +"321910",2,0,0,0,0,28,0,0,0,0,0,133,0,0,0,0,0,0,0,3,5,0,0,0,447,568,2326,1272,2555,1905,4760,32,965,187,2818,488,1,38,1840,179,2,0,0,0,1,1,0,0,1,0,1,1,2,0,2,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,1,0,0,0,0,0,0,0,0,0,56,0,0,0,0,0,0,0,0,0,0,0,0,0,181,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,94,3,114,0,0,0,505,0,461,58,0,0,0,0,0,23,91,0,0,0,0,381,2,1,2,0,0,7,260,0,0,0,0,0,0,0,0,6,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,325,0,0,0,3,3,1,1,517,0,0,0,0,0,0,0,0,23,12,0,0,7,43,15,0,306,0,0,0,0,0,0,0,15,0,13,20,0,30,11,130,21,84,161,16,349,95,0,0,0,0,0,0,0,0,0,12,6,7362,2,57,0,0,0,0,0,0,0,144,0,0,138,0,246,0,0,0,3,0,0,0,0,312,0,0,439,0,3,13,1,2,0,0,2,0,0,6,91,0,0,31,51,49,1,0,0,0,0,0,1,48,46,238,35,12,0,0,0,0,0,0,0,0,10,1,113,0,3,2,0,0,0,37,1,38,0,0,67,34643,0,0,0,0,0,164,347,0,0,0,0,0,0,0,0,0,0,0,0,35155 +"3219A0",6,7,248,205,1,21,10,5,2,0,0,0,0,0,0,4,204,85,45,119,268,5,0,0,26,75,702,217,195,72,672,50,374,35,265,128,11,148,1457,771,12,87,16,0,3,21,6,0,0,0,30,9,7,0,6,0,0,0,87,176,4,101,0,0,0,125,0,0,0,0,0,0,4,0,0,37,0,0,0,0,0,0,0,0,0,0,0,13,0,0,6,0,108,27,0,0,25,6,0,0,0,215,0,0,0,0,0,0,0,0,0,0,0,0,14,25,11,36,52,0,31,0,0,0,0,0,0,0,196,0,0,0,0,0,0,0,0,0,0,0,528,0,0,0,0,0,0,0,0,0,0,0,0,0,1,364,6,174,1,0,0,0,0,0,0,0,0,0,0,214,0,0,0,9,20,0,56,20,0,0,0,0,0,37,0,6,0,110,10,0,0,0,0,0,0,0,0,0,0,0,0,55,0,0,0,0,0,0,0,0,0,0,0,0,53,196,0,0,0,0,0,57,0,0,0,35,403,294,10,0,29,0,0,2,0,0,0,0,0,0,0,0,0,3,0,2,0,0,0,2,2,1,8,10,6,0,3,20,0,2,1,0,0,0,194,0,1,7,773,235,450,435,1164,297,977,292,1281,146,0,169,617,140,56,190,51,127,331,133,0,0,0,175,0,3,22,66,109,0,3,0,2,8,2,0,0,0,9,58,0,21,0,1,66,79,3,1,0,0,0,0,1,0,123,3,53,0,0,10,1,22,2,2,25,11,2,33,13,2,7,3,6,0,6,50,2,116,40,1,5,15,20,0,10,1,17,30,5,55,0,1,22,52,3,1,1,13,69,0,0,0,0,0,0,0,7,664,61,69,0,8,5,5,0,17,0,0,3,42,12,35,0,15,44,0,1,4,1005,22,387,0,0,0,22631,6760,0,0,9663,619,115,918,0,0,0,0,0,20,0,0,0,0,0,0,40727 +"327100",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1185,1213,524,263,1411,370,1906,523,558,469,1210,789,0,0,0,7,733,115,66,53,10,19,15,0,82,0,0,1,463,82,0,0,0,164,8,0,29,0,0,0,0,0,13,0,31,17,0,0,0,8,0,24,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,58,0,0,0,0,0,0,0,0,0,0,10,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,3,52,1,0,0,0,0,0,0,0,9,0,0,0,0,0,10,10,10,0,0,177,39,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,7,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,3,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,129,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,21,17,11,0,0,7,67,39,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,484,1222,75,0,36,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,132,0,0,58,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,8,2,0,0,0,18,0,0,0,0,1114,55,7,5,16,5,0,0,0,0,0,0,0,28,2,193,73,22,0,0,2,0,0,0,0,0,1,0,16,0,60,73,0,0,0,81,25,1,0,2,74,17071,4685,0,0,0,0,135,1990,0,0,0,0,0,0,0,0,0,0,0,0,23880 +"327200",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,1313,102,39,2443,159,270,35,235,0,157,70,0,0,251,14,12,3058,28,206,30,43,11,0,0,0,597,4,0,17,0,0,0,0,0,0,5,0,0,0,0,0,0,430,0,0,0,5,0,32,0,0,0,0,0,0,0,15,0,0,0,0,0,0,151,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,4,32,0,6,0,26,4,19,57,0,52,0,0,58,11,0,0,0,0,0,0,0,0,1155,0,0,0,2058,1546,255,230,2,15,73,46,44,34,0,0,519,168,0,0,0,0,0,0,274,111,0,0,0,0,13,63,2,25,44,88,0,4,73,10,6,9,0,0,0,0,0,0,0,0,0,0,2,0,0,6,0,163,74,142,31,0,0,0,0,0,9,146,49,0,87,23,115,2195,895,639,0,0,44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,821,0,0,2,0,6,21,87,0,23,22,41,228,0,1,0,2,0,150,0,343,1,67,40,19,52,0,729,0,0,0,0,0,0,2,1,1,21,0,38,0,0,53,47,0,0,0,0,0,45,0,0,0,0,31,0,0,10,22,12,0,0,0,2,3,2,0,0,0,56,324,0,3,0,0,40,43,27,18,0,0,23,0,0,0,0,39,5,5,56,1,0,0,2,0,51,17,574,884,27,270,0,0,4,59,0,73,97,33,34,0,0,19,10,22,17,70,971,519,167,32,46,1247,20,1468,148,20,3,4,1,0,0,5,0,0,0,0,9,161,88,718,232,422,2,3,2,6,0,0,0,10,0,21,0,6,623,0,0,0,61,89,174,0,0,1,34848,10837,0,0,0,0,333,5131,0,0,0,0,0,0,0,0,0,0,0,0,51149 +"327310",0,0,0,0,0,0,0,0,0,0,0,1,0,658,1,1,0,0,0,101,399,0,0,0,35,106,314,96,173,47,239,24,108,126,298,135,0,0,0,0,0,0,111,6908,581,657,27,0,0,13,3,783,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,0,0,0,0,0,0,0,0,0,0,1,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77,0,1,52,61,894,268,3140,1803,644,664,1463,233,970,1968,0,0,0,0,2,0,5,42,15,154,0,0,0,0,0,80,0,3,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,198,0,0,0,0,0,0,0,0,0,0,12,0,0,0,29,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,10,11,7,45,0,157,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,659,0,0,0,0,1,0,39,6,0,2,2,1,0,0,120,1,439,11,0,1,25,72,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,73,467,0,239,0,0,0,0,0,0,0,0,0,0,0,0,9,0,114,0,0,0,0,0,0,0,396,0,0,128,0,0,0,0,0,6,0,129,0,0,1,0,0,0,208,0,0,0,5,2,54,1,0,0,4,92,0,0,28,38,35,1,0,0,0,0,0,1,37,5,142,218,63,0,0,0,0,2,684,0,0,0,0,68,0,0,0,0,0,0,0,0,204,0,35,681,18674,143,0,0,0,0,42,277,0,0,0,0,0,0,0,0,0,0,0,0,19136 +"327400",1,0,0,0,0,0,0,0,0,0,0,5,0,0,0,32,176,0,0,0,0,0,0,0,13,10,769,436,416,177,1393,39,375,99,1200,148,0,19,0,93,13,72,81,0,0,0,11,2,0,30,0,32,643,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,0,0,0,0,0,0,0,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,129,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,208,21,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,113,136,437,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,136,0,0,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,6,4,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51,329,9,3,3,0,0,0,0,0,0,0,0,0,2,0,0,0,117,0,0,0,0,274,0,0,316,0,52,65,0,0,0,0,0,3,0,11,0,791,0,0,0,0,20,0,2,0,0,0,0,0,0,0,2,88,0,0,20,43,27,0,0,0,0,0,0,0,28,0,85,240,60,0,0,0,0,0,0,0,0,0,0,101,0,0,42,0,0,0,1,30,0,0,0,371,10865,71,0,0,0,0,55,283,0,0,0,0,0,0,0,0,0,0,0,0,11274 +"327910",0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,11,258,110,25,74,29,77,17,244,35,152,200,96,22,22,38,12,4,15,74,16,34,23,318,71,0,42,0,27,5,6,0,8,0,4,5,161,17,0,4,20,35,319,47,17,10,6,104,3,147,138,146,15,50,21,4,56,55,14,7,29,84,20,191,0,0,26,6,38,7,49,39,78,84,162,3,3,28,26,85,59,11,7,1,51,211,0,0,0,0,14,0,10,6,7,0,23,0,5,1,9,7,0,10,0,0,0,0,6,3,2,4,5,12,0,0,0,72,0,4,0,8,15,62,3,1,3,17,13,8,24,45,187,48,124,0,17,0,1,7,15,7,0,0,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,0,9178 +"327999",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,21,8,124,554,194,54,226,35,1219,713,0,0,0,0,12,0,25,121,10,28,15,8,35,0,0,156,0,7,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,312,0,0,531,0,0,0,0,0,0,0,0,0,21,0,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,208,0,0,18,1,0,0,0,0,21,21,17,0,0,279,80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,1184,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,4,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,84,6801,0,0,0,0,0,13,618,0,0,0,0,0,0,0,0,0,0,0,0,7431 +"331110",0,0,0,0,0,0,0,0,0,0,0,0,0,1735,28,23,140,84,239,238,284,0,0,0,5,2,550,0,12,235,147,0,192,46,227,40,0,0,5,113,0,0,0,0,30,102,0,47,0,214,26,3,8615,8992,0,0,58,0,0,71,984,0,2287,2084,2778,1268,13942,8728,794,1708,972,949,689,2326,2839,1078,11,949,302,1218,153,2077,3076,339,3609,1784,37,1104,39,2,681,576,1717,476,292,262,497,383,369,55,344,619,138,519,4902,188,28,133,2070,533,0,1,2,71,42,9,64,60,183,60,13,8,30,17,6,103,41,9,15,0,0,102,37,1233,370,129,742,222,340,23,17,554,0,32,12,2177,97,901,674,5,344,476,246,525,59,13254,1828,1476,4190,20,204,19,14,1002,377,56,261,749,452,0,204,0,191,203,632,648,23,263,150,11,0,17,6,166,5,9,553,1062,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,0,0,0,0,61,0,0,0,0,1,15,0,0,0,0,0,0,11,41,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,73,0,0,862,0,0,0,0,251,23,1,0,4,0,0,6,0,0,0,0,0,1,0,0,0,229,0,0,0,0,152,0,0,2,0,5,3,0,1,2,23,10,49,12,11,13,113,0,0,0,0,0,0,0,0,0,0,0,2775,0,62,0,0,0,0,0,0,4,468,0,0,175,0,0,0,0,0,31,0,260,0,0,0,0,215,0,303,0,0,159,4,7,26,62,2,9,33,3,8,7,8,20,214,0,1,0,21,0,0,23,255,31,2,10,3,12,31,111,63,105,0,0,7,0,4,26,0,0,0,0,0,0,9,0,0,0,0,175,141254,0,0,0,0,0,1200,13196,0,0,0,0,0,0,0,0,0,0,0,0,155649 +"331200",3,30,3,2,3,17,16,7,1,1,0,0,0,1273,5,1,14,9,24,18,17,0,0,0,162,725,435,140,274,48,322,13,110,85,272,68,0,4,0,0,0,0,0,0,192,854,0,0,0,0,0,0,744,270,0,0,0,0,0,3,0,0,0,0,38,70,1019,49,12,8,0,51,1723,301,1836,0,0,8,0,0,18,168,0,0,0,0,11,391,0,0,0,0,100,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,162,0,0,0,0,0,0,0,0,6,5,0,0,0,0,0,0,0,0,0,0,0,0,305,3,0,1,93,0,0,0,0,89,0,0,0,0,0,0,0,0,0,0,16,4,1,0,114,16,1,0,0,0,0,0,0,0,0,0,0,0,0,0,4,7,0,0,0,0,0,2,0,0,0,0,0,0,0,4,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,70,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,385,117,119,4,3,1,0,33,0,0,0,12,2,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,10,0,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,3,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,0,1,1,0,49,0,0,0,8,0,0,2,1,3,0,0,0,0,0,0,0,2,1,3,0,0,0,0,0,0,0,0,0,0,0,1,5,0,0,32,0,0,0,10,14,35,0,0,1,13806,1300,0,0,0,0,-53,819,0,0,0,0,0,0,0,0,0,0,0,0,15872 +"331313",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,34,0,0,0,0,0,0,0,0,0,0,0,0,400,66,805,803,9560,0,10,1,14,1339,73,419,32,57,0,74,140,8,1082,86,27,277,0,25,0,20,0,8,79,6,0,0,0,0,6,56,53,0,1,11,32,52,35,20,0,7,0,0,0,0,39,121,70,0,18,12,234,3,0,0,0,9,28,6,1,2,41,0,21,1,15,6,3,43,0,2,0,0,0,28,1,88,1,24,0,0,0,0,0,24,0,94,3,544,20,5,10,19,333,54,63,363,5,22,84,90,9,0,39,34,3,0,13,12,55,1250,45,0,46,0,90,137,117,118,70,0,4,1,0,1,1,18,0,0,0,55,1,1,0,0,0,0,1,2,0,1,1,1,1,1,0,1,1,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,6,3,0,1,3,25,12,51,0,12,11,118,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,87,0,0,23,0,0,0,0,0,9,0,41,0,0,0,0,1,0,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,0,0,0,0,0,0,115,51,0,0,0,0,0,0,0,9,41,21122,0,0,0,0,0,157,742,0,0,0,0,0,0,0,0,0,0,0,0,22021 +"33131B",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,20,40,6,13,3,36,0,6,26,23,6,0,0,20,31,0,0,0,0,0,42,0,0,0,0,20,0,0,0,235,41,3944,0,10,2,0,0,394,16,245,90,476,2416,342,165,4005,201,60,575,620,0,11,2,0,42,3,1248,2,0,0,0,89,225,26,0,104,7,998,48,147,310,0,71,111,9,19,6,15,151,31,0,6,54,51,103,0,0,1,0,31,3,17,130,52,0,12,1,5,5,2,44,0,2,0,0,0,734,0,61,13,7,119,38,0,0,575,5,0,0,7,1241,53,467,1027,6,50,22,41,43,19,893,71,13,164,2,513,0,8,0,489,428,394,81,28,86,262,1,92,204,139,209,118,0,8,1,0,1,1,158,0,2,0,70,2,3,0,0,0,0,3,5,0,2,3,3,2,2,1,2,2,0,3,3,2,2,2,2,2031,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,109,872,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,193,0,0,0,0,0,125,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,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,166,0,0,0,12,0,0,0,0,208,34095,0,0,0,0,0,282,4683,0,0,0,0,0,0,0,0,0,0,0,0,39059 +"331420",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,22,3,161,58,2,37,173,2,67,352,198,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,123,0,6456,10,0,292,0,6,101,18,474,145,136,123,0,37,62,185,450,0,672,225,0,200,492,90,76,27,0,0,2,0,65,0,10,61,1079,261,0,0,0,0,0,54,82,89,0,0,34,83,0,0,74,0,4,1,9,0,123,12,2,47,155,601,75,13,24,41,20,115,116,11,2,0,0,91,13,90,627,244,0,0,0,0,2843,105,0,275,0,0,0,0,0,0,0,62,1442,538,0,292,108,934,142,0,5,0,0,0,0,0,0,17,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,25,42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,125,0,0,0,9,0,0,0,26,0,0,0,0,1,0,0,0,0,0,0,0,1,1,3,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,4,3,9,0,0,0,0,0,0,3,7,1,30,6,2,0,2,0,0,0,0,0,0,0,0,14,0,3,215,0,0,0,0,0,0,0,0,19,23246,0,0,0,0,0,59,2834,0,0,0,0,0,0,0,0,0,0,0,0,26138 +"331490",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,19,0,3,0,1,0,0,2,0,2,0,0,0,0,0,0,0,0,1,16,0,0,0,0,0,0,328,274,0,0,34,120,94,703,53,222,25,1189,70,38,10,211,10,5,36,283,28,58,219,261,6,10,2,17,96,57,44,24,4,182,16,15,0,0,18,4,54,13,8,87,4,132,47,0,1,194,0,7,78,0,0,5,15,24,0,0,7,47,63,3,78,62,208,95,101,31,19,45,5,24,4,14,5,0,23,40,4,66,26,29,77,63,76,103,1,49,1,446,0,135,5,2,14,0,6,21,127,225,27,31,20,115,22,1,2,20,0,2,215,6,12,4,0,0,0,0,0,0,0,0,0,28,74,16,0,15,17,10,0,0,42,292,7,9,0,0,0,0,9,16,0,6,8,9,7,7,4,8,6,0,8,8,8,6,7,5,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,39,24,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80,0,0,0,0,0,3,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,5,42,0,0,13,6,0,0,34,19,0,0,0,0,0,0,0,0,0,66,0,0,0,0,0,0,0,0,137,9738,90,0,0,0,0,87,4917,0,0,0,0,0,0,0,0,0,0,0,0,14832 +"331510",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,1,0,130,7,1,0,32,0,8,6,4,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,180,13,0,0,0,0,0,0,42,109,16,33,4,45,38,245,45,85,0,64,11,86,622,29,381,1136,55,32,99,89,115,38,269,391,19,470,14,2,103,100,899,12,153,122,108,147,155,31,193,1230,681,476,298,98,21,19,244,452,0,0,0,25,2,10,33,0,48,45,30,10,14,17,5,9,7,10,10,0,0,32,10,47,6,12,54,14,0,0,0,29,1,4,6,50,0,30,5,0,4,544,279,1752,8,281,604,1735,0,13,559,0,9,191,6,14,15,59,39,0,1,0,8,2,7,24,0,132,208,6,0,6,4,66,0,0,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,492,0,0,0,0,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18325,0,0,0,0,0,62,1202,0,0,0,0,0,0,0,0,0,0,0,0,19589 +"331520",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,21,3,52,78,13,128,35,19,0,31,12,862,223,41,183,324,15,5,76,26,12,12,40,34,13,394,19,0,187,13,98,18,187,87,153,124,10,14,27,1024,40,77,77,79,4,15,413,41,0,0,0,9,4,3,12,1,7,12,8,0,6,18,1,8,5,1,2,0,0,172,42,83,1,16,74,16,2,0,0,663,2,3,10,70,0,12,5,0,4,2682,448,923,1,26,1051,1544,14,2,22,0,23,10,35,6,22,0,50,0,1,1,11,1,10,26,0,37,26,1,0,1,1,99,0,0,0,6,1,1,0,0,0,0,1,2,0,1,1,1,1,1,0,1,1,0,1,1,1,1,1,1,1,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0,0,0,0,0,0,0,0,0,0,0,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,8,8,13,0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7540,0,0,0,0,0,9,24,0,0,0,0,0,0,0,0,0,0,0,0,7573 +"33211A",0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,27,0,0,0,0,0,0,0,0,0,43,15,25,9,135,0,51,0,46,4,0,0,0,3,0,0,0,0,0,0,4,0,0,0,6,3,0,0,0,0,0,0,0,0,0,43,240,1626,34,104,32,25,55,72,3,116,15,330,553,72,356,318,104,148,301,39,147,16,1,945,6,234,4,1,52,11,57,15,54,24,27,22,181,33,93,1111,98,283,174,24,34,13,71,95,6,0,15,12,90,25,9,0,17,83,28,5,34,30,2,7,239,20,2,0,0,152,3,52,12,18,168,22,38,5,0,95,0,10,2,10,4,5,3,0,5,784,93,59,162,37,171,122,136,795,153,156,47,116,217,49,1,14,31,0,17,0,13,3,27,44,2,11,62,0,0,1,1,1,1,3,3,27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,19,120,4,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,273,0,6,45,0,0,0,0,0,4,0,0,0,0,3,0,1,3,129,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,156,31,0,0,74,2,0,0,0,0,0,0,3,0,0,23,0,0,0,0,0,0,0,29,104,14449,0,0,0,0,0,136,24,0,0,0,0,0,0,0,0,0,0,0,0,14609 +"332119",0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,31,26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,9,357,25,127,21,29,9,6,35,25,57,18,46,135,26,7,4,54,82,482,172,21,127,25,166,15,4,34,10,325,5,9,8,6,8,27,2,9,38,6,6,62,9,21,10,23,9,1,1,15,3,32,8,24,13,102,75,83,42,31,13,37,12,137,12,6,0,0,23,45,1173,17,120,164,56,91,59,0,343,0,305,3,13,5,6,3,2,39,38,19,22,909,105,213,73,15,20,27,4,3,5,5,4,7,22,8,2,78,2,11,43,118,440,4,24,20,5,0,5,4,7,4,8,7,33,0,0,0,0,0,3,0,0,1,1,2,0,0,0,1,0,0,0,0,4,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,724,0,75,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,182,0,2,11,17,0,0,0,105,0,0,268,0,8,0,0,0,0,0,0,10,11,0,411,0,0,0,250,61,0,0,0,0,12,0,0,0,0,0,0,0,9,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,370,278,120,4,234,0,0,0,0,0,0,0,0,0,0,0,0,0,0,193,0,0,0,0,0,0,0,0,0,0,63,0,0,0,0,0,2,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,755,0,2,36,28,48,0,0,0,0,0,0,0,54,0,16,0,0,0,58,49,57,0,0,0,0,0,0,0,0,244,37,0,0,1,16,554,74,0,16,190,13899,279,0,0,0,0,138,529,0,0,0,0,0,0,0,0,0,0,0,0,14844 +"332200",36,106,36,28,40,41,204,155,20,20,0,3,0,532,28,0,22,0,0,71,471,2,0,0,93,217,48,109,144,61,733,49,79,63,635,73,58,2,4,7,0,1,0,5,0,3,0,0,96,1,1,0,25,1,2,0,2,0,2,2,7,7,14,14,28,26,64,25,40,13,17,50,31,86,24,65,13,94,5,17,81,18,7,5,6,97,26,59,9,3,42,11,26,4,13,11,9,9,33,2,14,21,8,8,25,13,58,12,25,11,0,0,0,0,5,1,2,1,2,25,9,0,20,5,5,22,47,59,0,0,0,1,3,15,6,7,46,22,10,3,1,27,0,2,9,32,13,17,11,0,10,34,16,18,47,131,32,43,20,20,34,0,3,295,10,7,9,41,12,1,10,0,8,14,32,60,6,39,35,7,1,5,5,9,4,4,15,32,0,0,0,0,0,0,0,2,0,1,0,0,0,0,22,40,0,6,2,2,0,0,1,0,8,0,0,0,0,0,0,0,0,0,1,0,0,1,44,20,9,3,1,1,1,2,0,0,0,0,0,0,0,0,1,1,4,1,0,0,0,0,0,0,0,0,2,1,0,9,13,7,2,5,2,4,171,14,2,112,0,225,0,7,32,0,108,0,19,17,0,13,65,90,2,26,15,0,0,0,5,17,0,35,28,61,2,0,20,0,61,0,18,0,0,0,0,0,2,11,0,0,104,0,13,25,9,1,0,0,0,0,1,0,1389,154,137,0,0,0,0,0,0,0,6,17,5,91,14,0,0,0,3,17,0,182,4,0,22,0,17,19,2,11,39,26,0,0,0,0,0,0,0,16,8,0,2,8,381,0,0,0,0,0,4,9,129,69,223,401,81,55,4,177,156,270,0,0,4,30,2,87,0,1404,237,0,0,5,502,107,1368,0,0,1,16576,16127,197,0,0,0,242,2264,0,1,0,0,0,2,0,0,0,41,0,0,35449 +"332310",19,33,11,10,12,14,67,36,7,6,42,0,26,1024,0,12,4,0,0,143,52,10,0,0,1328,406,1850,449,5049,851,3566,206,3367,4583,1504,8074,0,68,0,35,0,0,0,0,4,139,0,0,0,0,0,0,0,29,0,0,0,0,0,0,0,0,20,23,107,9,1536,22,52,16,8,38,25,672,16,45,8,73,3,9,47,9,2,2,108,41,11,352,0,2,29,3,203,49,8,6,5,5,141,2,6,203,98,92,355,7,22,8,33,6,1,1,3,0,9,1,102,7,32,18,5,0,0,0,0,0,16,6,5,0,0,31,2,21,15,15,130,43,53,15,0,59,0,23,4,18,8,16,7,0,3,753,18,207,8,92,41,46,1967,1,611,210,3,364,219,238,3,38,7,0,11,0,8,2,18,28,2,0,0,8,0,9,6,16,2,3,6,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,186,9,0,69,2,5,39,872,101,5,1,18,9,31,0,1,0,41,6,0,0,10,0,10,0,6,2133,0,0,1751,1,1,7,0,0,0,0,0,0,0,0,1,17,100,1,56,0,0,0,0,0,0,0,0,0,0,1,0,0,268,138,0,0,0,0,691,0,0,847,0,1,395,0,0,0,0,1,13,0,6,3,188,0,0,0,0,407,0,28,0,3,0,0,2,0,0,4,142,4,0,46,29,51,9,2,2,6,3,9,3,59,5,213,4,1,0,0,2,0,0,0,0,0,0,0,168,0,126,33,0,0,0,56,0,275,0,4,2184,55120,290,167,0,0,0,97,1200,0,0,0,0,0,12,0,0,0,0,0,0,56885 +"332320",0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,14,0,0,0,67,125,0,0,0,619,1128,5800,1247,7422,1868,6375,1462,2024,728,6669,1117,0,12,114,168,0,2,0,0,5,40,0,0,0,0,0,3,5,0,4,0,0,0,1,3,0,0,48,1,24,0,126,437,12,4,7,0,44,118,6,0,0,43,0,1,0,25,29,1,11,0,12,172,24,0,1072,2,8,57,0,3,1,0,0,0,1,489,2,0,44,0,0,1,120,0,35,215,29,8,156,24,111,54,167,14,221,122,43,15,48,96,0,24,0,0,0,7,2,18,0,13,598,445,0,0,0,26,0,247,10,5,3,81,2,12,247,48,2,17,132,168,386,19,1,3,0,0,0,1,1,0,0,87,1,0,0,0,41,0,72,24,0,229,267,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,73,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1467,0,0,0,11,5,1,18,94,0,0,0,0,1,0,1,0,0,0,0,0,19,0,5,0,2,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,182,1260,18,535,6,0,0,0,0,0,0,0,0,0,12,0,0,0,143,0,0,0,0,1456,0,0,972,1,0,315,0,0,0,0,0,17,0,17,0,0,0,0,0,0,1977,0,34,0,0,0,1,0,0,0,4,273,0,0,86,178,89,7,0,1,2,1,4,0,125,21,558,562,59,0,44,0,0,0,0,0,0,0,0,272,0,21,117,0,0,0,0,0,51,4,37,1178,56922,0,637,0,0,0,304,1083,0,0,0,0,0,0,0,0,0,0,0,0,58946 +"332410",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,84,935,97,25,562,69,259,473,69,38,79,47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,20,0,0,4,60,0,0,0,4,0,0,0,2,0,0,0,0,14,500,0,0,0,15,6,0,0,0,0,0,47,0,0,59,0,0,0,0,0,0,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,19,0,0,12,7,103,0,0,0,2,0,17,0,5,233,67,275,120,32,47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,827,0,0,0,0,0,107,0,0,1,4935,0,3854,0,0,0,12,1271,0,0,0,0,0,0,0,0,0,4,0,0,10076 +"332430",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,17,3,0,0,0,4,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,14,21,12,75,7,54,16,3786,41,16,36,20,50,10,67,4,13,59,14,5,3,85,43,16,79,0,1,34,4,22,49,10,9,8,8,154,2,10,152,91,90,173,10,25,9,16,11,0,0,1,0,11,8,1,2,23,22,37,0,0,0,0,0,33,1,0,0,0,9,2,23,4,5,27,15,6,1,0,27,0,8,6,26,11,16,7,0,6,5,22,24,34,101,41,51,16,11,25,1,4,5,5,5,8,51,10,0,14,0,11,5,19,37,3,0,4,5,0,4,3,5,2,3,8,26,1361,8,0,0,9,3,0,40,28,2630,89,137,254,1,28,6,112,0,12,251,59,51,63,85,117,3576,0,0,1977,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,2,1,209,0,10,4,33,195,0,0,3,5,19,10,0,86,352,77,156,10,41,230,0,0,0,0,0,0,38,12,0,99,2,0,0,12,0,0,0,0,49,0,0,10,0,0,3,0,0,2,0,0,0,0,0,0,0,0,1,12,6,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,4,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43,0,0,0,0,0,0,0,0,0,0,19064,513,215,0,0,0,214,1073,0,0,0,0,0,4,0,0,0,34,0,0,21117 +"332500",0,0,0,0,0,0,0,5,0,0,0,93,5,51,24,0,0,16,0,0,0,0,0,0,194,165,1494,587,107,898,1518,47,478,250,1997,100,0,127,192,223,0,0,1,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,4,659,2,0,1,745,11,75,538,1,1,13,0,1,2,6,1,1,29,2,7,2,0,0,2,1,146,0,0,1,0,0,0,0,0,53,1,0,0,1,1,0,12,0,0,0,14,0,0,0,16,0,0,17,0,0,0,0,0,0,2,0,0,0,0,0,0,2,0,1,0,0,0,0,0,0,0,0,146,498,74,259,218,0,1,2,6,1,6,1,112,4,363,131,409,0,0,0,4,370,1,2,1,275,369,72,35,47,57,459,0,2,2,0,0,0,0,1,0,0,154,35,0,0,0,0,0,0,0,0,0,0,10,0,7,0,0,0,0,11,0,0,0,0,0,0,39,4,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,136,0,0,0,0,0,0,0,0,247,0,469,0,0,2,2,16,16,0,101,8,40,3,0,31,96,20,84,30,95,11,169,1209,0,87,0,119,0,0,3,8,19,1,0,0,17,0,0,0,0,0,263,323,11,7,0,0,0,0,0,0,0,0,0,0,4,0,0,14,93,0,0,0,0,101,0,0,274,6,0,143,9,158,0,6,0,4,23,339,7,2,44,0,26,28,144,0,1,0,0,0,0,0,2,9,12,143,0,0,343,31,1086,0,0,0,0,0,0,2,38,9,245,180,42,210,0,34,14,0,0,8,0,0,88,91,0,377,8,0,0,0,0,8,0,50,35,58,23334,3572,792,0,0,0,226,2602,0,0,0,0,0,0,0,0,0,0,0,0,30526 +"332600",0,0,0,0,0,0,0,1041,0,0,0,19,0,0,0,2,0,0,0,8,13,0,0,0,2,13,53,32,27,1,23,5,3,12,19,25,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,153,0,0,0,0,0,0,0,2,1,1,4,7,2,5,2,1,0,17,497,47,147,2,1,27,0,1,4,4,1,1,1,3,26,11,1,1,2,1,9,0,1,1,1,1,1,0,1,1,1,1,0,1,1,1,40,1,0,0,0,0,0,0,0,0,0,87,1,0,0,0,0,0,1,1,0,0,0,3,1,2,0,3,5,1,1,1,0,2,0,0,32,573,48,331,0,0,3,3,1,1,3,12,3,3,372,566,374,0,0,468,1,0,1,3,1,0,201,4,8,2,1,1,503,2,2,0,0,0,1,1,1,0,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,0,0,105,0,0,0,0,0,0,0,0,0,0,0,0,44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,0,1,1,1,0,11,0,2,0,0,66,3,4,0,0,5,0,0,0,0,0,0,55,34,0,0,1,16,0,0,0,0,0,0,0,0,0,1,7,0,31,0,0,0,0,0,0,0,0,0,0,1,0,0,7,0,0,0,0,0,20,0,0,31,0,0,67,0,0,0,0,0,18,0,55,0,0,6,0,0,7,91,0,0,0,0,0,0,0,0,0,0,21,0,0,2,2,7,0,0,8,0,0,0,0,6,0,6,10,0,207,0,2,5,0,0,0,0,0,0,0,0,0,0,0,0,0,8,1,1,1,29,146,7153,239,0,0,0,0,80,930,0,0,0,0,0,0,0,0,0,0,0,0,8402 +"332710",2,11,2,2,2,4,12,2,0,1,0,5,1,22,12,5,37,7,24,11,29,36,0,0,5,1,326,150,275,52,1013,44,135,96,297,109,297,253,25,71,15,41,24,132,18,39,15,8,15,47,24,5,255,98,64,5,522,68,87,90,281,208,40,80,114,74,379,1078,156,43,41,264,90,539,213,356,59,393,48,50,285,91,18,11,90,316,70,995,28,0,231,22,188,21,106,88,66,49,58,10,61,61,26,43,488,63,193,52,76,123,11,5,8,5,193,27,38,40,115,107,35,2,95,44,79,116,187,19,3,1,5,56,31,113,33,36,151,123,44,3,40,339,20,75,32,135,51,147,51,1,20,773,137,250,288,580,799,349,159,4,169,66,57,105,21,76,18,229,39,107,147,6,91,10,119,183,44,296,188,8,19,10,4,20,1,20,42,330,2,3,0,0,0,0,3,80,5,31,5,0,6,0,6,6,0,102,0,113,0,14,33,9,328,15,16,53,215,8,11,29,28,20,44,3,6,62,435,498,562,361,63,144,56,349,41,137,1,30,22,13,18,47,59,164,220,106,2,1,1,5,22,17,121,158,673,148,38,272,250,78,24,65,29,58,836,85,25,485,0,84,32,23,79,2,34,8,34,4,0,94,6,17,0,34,3,5,6,4,192,275,32,489,152,7,126,27,60,50,41,37,31,41,3,4,0,0,394,250,49,17,6,0,15,8,5,1,0,0,0,0,1,0,23,7,144,0,0,0,5,102,6,0,144,61,15,377,22,18,0,5,12,392,20,234,25,5,126,2,24,48,10,11,3,247,6,0,0,60,5,10,5,6,6,2,0,0,0,0,0,0,0,0,1,3,19,2,0,0,0,154,14,177,235,0,0,7,22,0,0,8,0,0,0,21,3,0,5,0,697,29,3,531,36652,0,0,0,0,0,-50,353,0,0,0,0,0,1135,0,0,0,0,0,0,38090 +"332720",0,0,0,0,0,0,0,0,0,0,0,0,0,75,443,12,103,10,60,40,99,19,0,1,12,15,159,74,89,25,257,16,71,2595,146,41,132,88,105,125,6,15,10,55,8,17,6,3,6,19,11,2,145,26,13,1,28,15,20,8,40,38,355,40,159,132,564,944,127,30,33,242,112,567,1487,216,35,630,100,11,107,453,130,94,108,31,229,581,24,1,303,27,408,19,66,52,61,36,43,21,62,204,130,162,157,64,97,36,543,254,1,2,6,17,275,218,5,59,282,521,112,5,173,123,75,149,550,49,8,1,1,250,56,634,237,228,180,109,164,2,7,270,6,37,185,515,463,670,316,2,80,570,49,375,138,1394,2736,586,499,16,617,7,41,596,47,312,15,39,32,46,51,2,36,8,80,131,21,275,193,11,3,8,3,183,1,7,29,80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,602,39,7,24,0,4,7,15,12,9,19,1,3,20,122,144,170,101,17,50,16,141,14,138,1,34,9,10,7,21,26,70,70,22,0,0,0,0,10,7,52,69,282,65,17,106,107,35,10,28,12,17,293,55,11,367,11,0,0,0,2,17,0,0,4,0,0,10,41,0,0,3,0,3,2,4,1,2,14,215,2,3,167,334,304,21,19,15,19,80,12,1,0,2,113,50,9,39,146,0,0,0,0,0,0,0,0,0,0,0,0,5,56,14,0,0,0,6,0,0,2,47,6,8,33,3,6,0,18,0,20,49,2,0,23,0,16,51,34,0,2,0,21,19,2,12,2,9,1,3,2,0,0,0,111,0,0,0,0,1,0,0,4,11,7,35,2,138,20,484,158,33,0,1,2,0,0,4,0,29,24,6,0,0,38,38,54,0,0,0,38698,2157,0,0,0,0,98,4012,0,0,0,0,0,0,0,0,0,0,0,0,44965 +"332800",0,0,0,0,0,0,0,0,0,0,0,0,0,58,29,7,99,18,65,31,77,35,0,0,5,2,385,172,223,57,1209,48,178,68,339,122,248,190,113,66,13,38,25,149,20,44,17,9,17,52,27,5,387,68,34,4,151,63,50,27,130,137,25,39,62,32,232,15,91,24,25,133,45,193,64,890,27,205,7,28,153,40,9,6,13,253,22,138,16,2,97,12,65,4,30,23,18,13,100,2,22,31,9,7,248,23,73,26,25,23,6,3,5,4,67,14,12,19,64,79,83,1,52,20,33,69,116,10,2,1,2,33,14,79,47,19,90,60,26,39,19,124,14,30,25,99,35,201,31,0,13,119,75,158,97,535,124,164,95,2,109,284,29,21,10,36,11,138,24,119,86,6,52,7,70,114,46,139,100,4,8,7,2,18,1,9,22,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1494,97,17,0,237,9,20,32,31,22,49,3,4,54,328,376,444,252,45,133,38,319,35,385,4,89,24,15,20,53,69,184,189,65,2,1,1,0,20,19,136,177,753,166,34,279,279,87,26,72,32,47,473,61,29,272,3,0,1,0,10,0,0,3,1,0,0,125,0,0,4,1,19,2,30,0,22,2,373,711,17,8,39,0,70,52,46,36,29,509,0,7,60,7,875,416,58,0,68,0,0,0,0,0,0,0,0,0,1,0,0,0,18,0,0,0,0,35,0,0,41,1,2,34,0,0,0,0,0,0,0,0,0,3,12,0,225,8,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0,0,0,0,0,0,4107,0,7,0,0,0,32,53,0,747,0,484,1435,376,44,650,166,490,381,1753,61,1072,900,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,89,2,0,1,0,0,0,0,13,0,18,25,34,30,258,120,111,103,5,37,40,206,19,31,15,2260,11,104,89,15,131,24,1106,283,214,497,23,6,559,9,267,130,21,20,54,46,416,0,14,151,443,107,324,16,15,17,536,50,0,0,1,10,73,2,0,1,9,13,2,0,29,8,6,31,13,73,0,0,0,11,1,25,28,3,0,0,91,23,0,0,0,17,232,638,117,61,27,0,2,312,101,36,0,167,189,373,2049,27,552,149,36,37,201,3,13,486,15,0,7,0,5,1,11,19,2,59,58,11,0,0,0,11,2,3,0,15,0,0,0,0,0,0,0,14,0,0,12,31,12,3,0,0,0,0,0,12,0,14,0,0,269,32,4,0,3,0,0,0,0,0,0,0,0,72,241,270,0,0,0,0,0,0,0,0,14,0,0,14,19,29,76,239,42,6,0,0,0,0,2,13,43,0,0,531,0,206,0,0,0,0,23,0,215,15,0,117,0,0,1,0,2,0,0,0,27,0,0,42,11,0,0,0,0,3,0,1,1,0,0,326,8,0,0,7,75,0,13,0,0,0,0,0,0,3444,869,159,2,33,29,0,0,0,0,0,0,0,0,0,0,0,0,0,44,0,0,0,0,259,0,0,260,0,0,157,0,0,0,0,0,9,0,109,0,0,0,0,0,0,198,0,2,0,0,0,0,0,0,0,0,4,0,0,5,29,16,0,0,0,0,0,0,0,7,14,23,14,0,130,0,656,142,0,0,0,0,0,0,18,0,782,1,0,0,0,0,4,21,0,57,1002,40015,0,3671,0,0,0,250,11108,0,347,0,0,0,1,0,0,0,17,0,0,55410 +"332991",0,0,0,0,0,0,0,0,0,0,0,0,0,161,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,88,0,0,0,0,0,0,0,0,8,14,23,11,89,6,35,8,10,45,13,42,16,57,9,71,1326,11,55,12,221,93,59,39,26,168,8,3,35,5,136,13,10,7,49,26,166,26,166,24,80,71,115,63,126,10,17,230,0,1,1,0,8,2,0,1,34,27,7,0,18,5,6,20,24,37,5,0,0,19,0,29,15,94,116,43,14,12,0,63,0,22,20,42,25,18,10,0,4,162,99,100,37,113,417,268,177,11,112,0,5,23,4,5,5,16,8,0,11,0,10,3,22,35,4,37,31,2,0,5,3,4,3,5,8,26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,15,0,110,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,1,0,0,0,0,0,0,83,2,0,0,0,0,0,0,0,0,0,0,0,16,264,1225,46,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,0,0,0,0,0,2,0,0,0,0,0,0,7,0,146,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,40,231,29,0,0,0,0,0,0,0,0,657,1,0,0,2,0,0,0,0,0,42,9590,0,0,0,0,0,104,2030,0,0,0,0,0,0,0,0,0,0,0,0,11724 +"332996",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,540,262,364,117,638,553,172,108,811,296,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,141,0,88,239,0,0,1,0,0,0,0,1071,0,447,0,9,0,0,0,0,1,0,0,0,69,19,36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,189,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,139,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,380,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,1035,0,0,0,0,0,0,0,0,3646,82,0,0,0,0,8,992,0,0,0,7423,16439,0,0,0,0,-132,4164,0,393,0,0,0,0,0,0,0,0,0,0,28288 +"332999",3,12,3,2,2,3,17,1,1,1,0,5,2,76,6,1,14,1,1,3,32,0,244,0,111,799,305,111,435,35,224,1886,231,55,248,210,51,59,18,26,35,9,7,34,42,307,3,1,4,11,26,26,4,51,7,1,15,35,9,7,117,525,8,10,17,32,75,15,27,8,8,30,28,51,36,47,12,64,5,9,44,677,28,35,7,58,23,208,5,3,32,11,23,6,6,9,6,7,36,1,15,57,13,7,157,15,21,5,73,8,0,0,4,7,22,4,6,0,52,30,92,0,14,9,21,24,12,5,6,0,1,33,6,23,10,7,131,54,27,7,4,42,4,16,5,21,9,18,3,0,5,33,19,20,90,89,40,43,16,20,25,7,3,3,5,45,17,36,80,26,9,0,8,15,20,37,16,70,35,6,0,5,8,11,4,3,8,481,9,39,6,17,2,32,1,158,3,41,75,124,9,30,33,99,3,55,79,123,196,40,117,61,29,0,5,13,72,2,5,10,7,5,15,1,2,11,14,54,93,17,8,220,7,37,10,0,2,26,7,0,4,13,93,10,55,13,9,0,4,24,7,4,40,39,68,1,13,82,43,13,4,1,5,7,87,35,4,145,18,17,23,29,69,56,27,53,60,3,0,52,35,14,11,16,32,20,34,39,0,73,8,9,70,8,8,2,301,0,1,0,2,23,0,0,0,0,827,137,2,25,24,2,203,145,133,29,0,0,0,40,1,1,1469,2,26,0,0,32,6,176,6,18,260,7,2,68,14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2,297,1,1,1,3,1,14,12,10,1,7,3,1,2,2,1,1,3,3,3,33,0,0,43,0,4,2,4,11,7,3,8,1,2,1,4,14,11,1,2,0,8,31,0,0,0,0,3,0,0,0,1,0,2,0,1,2,2,1,0,4,0,0,0,0,1,0,0,0,0,1,0,0,0,7,0,1,0,0,0,3,0,0,0,16,0,26,0,2,38,1,6,0,0,0,1,1,2,1,0,0,0,0,0,0,0,0,0,1,1,6,4,0,1,0,0,0,0,0,8,6,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,2,0,0,0,0,0,1,0,0,0,1,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,10,8,17,5,0,11,0,0,0,0,0,21,23,0,0,3726,0,75,0,0,0,0,0,1,0,2,1,38,228,9,1,1,0,0,0,0,0,0,627,0,0,0,0,70,0,0,0,0,0,0,0,0,81,0,0,0,8,2,0,0,0,2,196,0,59,0,0,0,459,0,0,0,1056,0,114,3,0,0,0,0,0,0,7,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,623,0,0,0,100,203,0,0,0,0,0,5,64,2,1,756,144,64,16,4,1,14115,346,19273,0,0,0,562,2197,0,377,0,0,0,21,0,0,0,871,0,0,37762 +"333414",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,143,507,565,272,594,189,900,238,339,29,684,206,0,0,9,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,438,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,26,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,112,0,9,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,152,0,0,33,0,0,0,0,0,3,0,9,0,0,0,0,0,0,199,124,212,0,25,0,0,0,0,0,0,22,0,0,1,0,3,0,0,0,0,0,0,0,2,2,0,14,5,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,129,0,0,11,6539,2528,103,0,0,0,64,444,0,0,0,0,0,0,0,0,0,0,0,0,9678 +"333415",0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,326,2151,2857,1375,2852,774,3452,403,986,284,2480,509,1,0,60,159,0,5,0,3,0,0,0,0,0,0,0,0,10,0,0,0,0,9,0,0,0,1,5,0,6,1,21,48,2,6,0,0,0,2,3,2,0,2,0,1,0,6,5,4,3,0,0,4,0,0,121,1,4551,3,0,1,1,0,2,0,0,46,0,0,7,0,0,0,2,0,0,0,0,0,1,0,0,2,3,2,1,0,0,0,0,0,0,0,1,0,0,26,0,181,0,5,1,0,0,0,0,8,0,0,288,2028,216,2,102,0,5,6,0,15,36,51,245,3,1,1,2,0,0,2,0,0,0,0,0,0,0,0,1,0,5,14,0,41,21,0,0,0,0,4,4,0,56,21,18,1,0,0,1,0,38,68,30,608,36,88,43,69,1,1,2,68,117,171,0,0,0,3,574,28,0,0,1,0,0,0,0,0,0,0,0,0,1,1,3,0,0,0,0,3,0,2,4,0,0,0,0,0,2,6,11,0,1,0,0,0,0,0,0,47,234,35,0,397,32,0,0,13,227,16,126,0,0,0,7,92,119,170,188,9,170,34,165,11,0,101,81,120,41,24,93,26,79,48,0,0,0,2,0,58,6,0,0,2,1,3,0,5,11,0,0,784,44,72,0,198,0,0,0,6,45,0,0,0,0,0,6,0,63,0,148,0,0,29,3,551,8,37,34,139,10,37,43,9,0,4,9,21,65,2293,4,4,7,9,3,7,587,4,126,7,154,13,10,97,2,8,38,590,87,91,58,40,55,3,5,0,2,3,5,25,52,97,222,236,18,18,2,592,0,16,0,5,5,4,1,300,0,100,161,0,0,0,508,803,567,4,0,115,42294,5636,14415,0,0,0,770,5626,0,165,0,0,0,0,0,0,0,350,0,0,69255 +"333413",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,179,236,0,0,320,97,572,243,149,33,93,218,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,75,0,238,82,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,143,80,0,0,0,0,0,0,0,0,0,0,0,0,165,0,0,0,0,0,0,355,0,0,0,0,0,0,0,16,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,7,0,43,0,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,0,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,0,4,0,0,0,0,0,0,0,13,0,124,8063,0,0,0,0,0,10,2031,0,0,0,0,0,0,0,0,0,0,0,0,10104 +"333618",0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,0,0,19,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,217,1934,651,0,0,0,0,0,0,1,0,0,0,0,0,2,24,51,2070,1080,417,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1097,0,0,0,0,0,0,0,0,1598,3513,3450,0,0,0,0,6920,7,194,0,0,0,1,0,2,0,0,0,0,575,405,0,0,1004,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,131,23,69,37,8,81,29,0,126,0,0,0,0,0,3,36,2,0,0,0,562,68,0,0,1,0,1,0,0,0,0,0,0,0,2,4,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,119,15,0,0,0,0,0,0,86,0,0,72,7,0,0,0,2,1,0,7,0,0,3,0,92,4,60,0,0,0,0,0,0,0,0,0,0,2,2,0,9,0,8,0,0,0,0,0,0,0,2,0,11,8,0,1442,70,797,86,0,0,2,0,0,26,0,0,126,0,0,0,0,0,0,285,33,5,64,30134,382,3533,0,0,0,186,11640,0,0,0,0,0,28,0,0,0,613,0,0,46517 +"333912",0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,82,377,29,67,55,73,206,1,151,40,212,181,0,0,0,0,0,0,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43,16,79,29,3,6,13,19,6,9,2,8,2,3,2,8,1,1,2,2,4,6,0,1,17,1,1,3,9,6,1,1,1,4,168,54,52,47,9,0,1,43,23,166,0,5,3,1,1,7,75,12,91,77,77,107,0,0,35,1,18,1,8,27,25,10,212,0,1,158,7,21,22,0,1,6,1543,35,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,0,0,0,2,0,1,20,72,44,201,16,0,2,120,39,154,1,1,117,44,312,5,4,1,4,30,31,8,0,0,0,8,4,2,2,0,3,6,0,2,1,0,0,0,2,1,1,1,3,70,0,0,0,0,0,0,0,1,1,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,2,1,0,0,0,0,2,0,0,0,2,1,2,1,0,0,0,2,0,14,0,0,0,1,0,0,1,4,19,0,0,1,0,0,0,0,223,0,0,0,0,32,1,0,0,0,0,0,5,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,11,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,85,0,0,1,0,0,0,0,0,1,0,1,0,0,0,3,0,42,0,7,0,0,0,0,34,0,13,0,0,0,147,0,4,6,0,0,20,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,14,0,0,0,1584,19,0,0,0,0,0,0,1,0,6,10,0,0,0,1,0,0,26,3,143,12462,1077,18919,0,0,0,45,13582,0,23,0,0,0,6,0,0,0,84,0,0,46198 +"33399B",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,32,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,168,0,0,0,0,78,0,0,46,298,127,530,257,97,567,0,0,139,0,9,6,29,113,121,73,6,6,5,111,60,235,784,0,46,34,245,1868,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,18,0,0,8,7,7,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,111,0,19,26,0,0,0,1,0,0,7,1,2,7,0,0,9,0,0,1,0,0,0,2,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,42,10,0,0,0,71,7,9,0,0,0,2031,4746,4775,0,0,0,-583,2223,0,265,0,0,0,21,0,0,0,393,0,0,13872 +"334118",0,2,1,1,0,0,0,0,0,0,0,0,0,0,12,0,0,2,1,12,47,13,0,0,124,151,42,7,4,7,65,16,9,10,59,34,16,5,5,5,1,13,0,16,1,6,0,0,2,1,3,2,0,3,0,0,0,11,3,1,3,11,4,1,1,5,17,12,1,2,2,5,0,7,7,9,0,2,0,1,0,0,0,0,1,2,2,5,5,0,42,2,2,0,0,0,1,1,0,0,1,0,2,1,0,0,1,0,8,0,351,54,823,51,117,16,271,93,18,0,788,69,55,61,147,67,138,145,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,147,29,0,0,0,0,0,1,0,0,0,6,3,0,3,0,0,0,0,5,2,1,0,0,6,0,1,0,1,2,10,1,5,4,1,0,1,3,2,0,0,3,2,0,0,0,1,0,0,0,2,0,5,0,0,12,0,13,10,3,5,4,0,2,0,6,7,2,0,0,0,0,0,1,0,0,0,2,0,0,2,0,4,22,1,1,0,0,336,0,53,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,8,0,0,1,91,1,40,5,0,5,0,0,0,0,0,15,0,0,0,0,0,321,267,473,98,96,194,94,208,136,0,0,0,157,2,5,116,0,95,44,52,111,16,0,0,14,1,14,350,567,75,340,288,0,234,212,811,26,0,0,3,856,0,0,922,0,11,18,0,872,106,138,294,390,556,961,146,222,452,121,113,31,689,1643,470,994,156,101,278,21,108,153,229,57,42,105,195,0,102,0,55,133,76,0,53,0,262,3,190,0,7,0,17,0,7,78,40,153,0,0,101,8,13,2,0,51,0,0,3,82,196,21,0,373,328,0,0,0,937,296,275,0,0,86,25879,15170,15411,0,0,0,195,6060,0,175,0,0,0,152,0,0,0,1858,0,0,64901 +"334210",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,8,0,3,0,14,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,135,11,1,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,323,4275,2328,698,2,13,0,118,121,108,23,0,0,0,0,0,0,0,0,0,0,0,268,0,0,0,139,0,0,0,0,0,0,0,49,0,3822,0,0,0,0,0,0,0,0,0,8,0,0,73,0,0,0,0,0,0,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,118,0,0,0,0,0,0,0,0,1,12744,823,9279,0,0,0,513,2612,0,992,0,0,0,477,0,0,0,486,0,0,27925 +"334220",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,4,0,0,130,1277,14,30,9,73,10,41,14,3,8,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,21,0,0,0,0,0,0,216,0,0,0,10,0,0,0,0,0,0,0,0,0,0,18,1238,2049,69,84,102,114,0,2352,25,232,144,366,577,0,661,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,41,0,0,0,0,0,9780,0,271,1112,85,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,5,216,288,0,234,376,0,145,154,0,0,41,49,89,6,7,11,6,33,8,0,0,0,72,2,1,0,0,50,0,177,346,63,1,0,24,3,37,314,1901,196,2113,583,0,0,0,0,0,0,58,0,702,0,1,41,0,1,0,71,181,6,120,19,69,66,562,12,55,74,5,10,3,50,1351,1553,399,57,32,49,4,20,40,98,0,10,6,441,0,31,0,0,0,12,0,0,0,57,0,58,0,1,0,3,0,0,10,6,2,0,0,2,94,732,0,0,0,0,0,0,36,94,50,0,7118,397,0,0,0,316,0,0,0,0,0,43993,28272,87439,0,0,0,1408,17307,0,9121,0,0,0,7467,0,0,0,3631,0,0,198637 +"334290",0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,5,2,0,0,229,71,337,20,84,199,602,15,105,20,63,1749,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,307,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,2,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,10,18,0,3,7,1,7,0,0,104,0,33,1,0,1,0,9,0,41,88,13,0,0,11,0,11,76,453,55,508,191,0,0,0,0,0,0,0,0,211,0,0,52,48,0,0,0,39,0,28,10,14,16,26,6,21,1,3,4,1,27,549,315,88,12,7,18,2,851,11,21,61,0,1,108,0,7,0,0,0,5,0,1,0,21,4,15,0,0,0,2,0,0,6,9,0,0,0,0,0,0,0,0,0,0,0,0,7,20,10,0,0,0,0,0,0,0,0,37,0,0,0,8165,18,1026,0,0,0,128,523,0,55,0,0,0,4,0,0,0,248,0,0,10167 +"334413",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,190,215,125,172,10,43,6,155,4,10,9,8,0,58,31,5,114,77,36,4,202,137,56,17,20,27,65,64,58,66,47,659,96,55,102,141,22,204,219,380,23,321,50,33,88,67,84,66,115,286,49,43,110,90,228,23,102,23,51,146,6,49,29,16,34,195,61,189,295,11,16,6,15,201,28,99,139,3,361,19,5025,901,153,562,419,12,43,7,39,51,5,142,10,2,3,53,21,71,24,107,25,32,38,3,21,196,16,343,103,1205,70,91,19,4,116,323,1676,215,131,153,117,370,569,223,55,138,11,18,124,100,20,1,34,133,63,14,69,78,81,147,48,116,36,114,8,9,5,54,15,26,327,184,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1741,114,21,0,0,10,24,36,35,25,57,3,4,0,0,0,1,1,0,0,0,366,31,38,4,101,26,28,21,61,24,200,201,40,3,635,17,224,28,20,149,201,296,185,47,287,311,95,28,79,33,0,28,91,30,139,551,600,1413,318,711,26156,0,7,626,110,0,147,0,37,12,154,0,1,304,2,0,0,0,0,0,0,4,0,0,4,4,11,0,248,0,0,0,0,4076,931,425,181,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,418,1005,129,0,79,0,0,11,0,0,1,0,106,0,0,0,0,0,0,0,95,0,0,0,0,57,0,0,0,0,0,0,0,37,17,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,201,1040,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,69810,0,0,0,0,0,732,27419,0,0,0,0,0,0,0,0,0,0,0,0,97961 +"334418",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88,30,62,77,5,22,14,77,13,23,8,4,0,20,16,3,209,33,19,3,39,83,23,20,18,33,33,34,31,32,173,49,45,26,54,73,11,99,104,197,11,153,27,15,51,38,41,30,55,141,45,295,11,11,494,11,44,11,22,69,29,33,154,9,18,55,33,88,155,6,8,3,18,101,150,213,108,20,1003,103,68,1799,672,349,361,109,115,253,249,453,20,194,27,1,1,29,7,5,11,15,46,143,20,2,12,194,9,644,3,14,27,47,9,2,52,83,76,138,61,111,280,150,37,50,13,0,4,10,87,47,8,0,16,68,28,7,39,42,39,65,21,139,68,94,4,0,3,67,9,12,179,93,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,450,60,10,0,46,5,10,19,18,15,33,1,13,9,159,182,259,160,24,74,25,175,15,18,1,26,11,16,6,28,10,105,95,31,1,0,0,0,14,10,74,93,137,108,24,207,180,52,15,46,18,0,270,52,17,81,112,99,111,118,222,0,0,0,0,96,0,58,0,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,8,9,0,17,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,44,692,12,9,39,0,0,16,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,1,5,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,84,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,1,10,0,0,0,19202,93,0,0,0,0,995,2839,0,0,0,0,0,1,0,0,0,0,0,0,23130 +"33441A",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,8,7,2,2,21,8,1,2,0,50,55,29,3,11,8,0,3,2,14,1,4,0,0,1,4,2,0,37,8,2,0,7,6,5,3,6,5,6,4,4,13,29,20,8,4,7,11,1,14,15,29,2,25,4,3,1,5,200,7,134,44,205,190,26,16,230,2,96,39,4,22,39,47,25,1,3,120,32,94,247,1,1,20,97,17,30,136,80,95,582,71,232,836,1710,757,1590,121,115,76,96,157,491,111,54,0,0,4,5,18,12,18,51,92,3,0,1,38,1,936,1,12,7,8,1,0,6,97,1993,1588,14,26,686,253,33,32,124,0,2,2,11,9,2,0,3,11,7,1,6,5,7,8,5,125,59,0,1,0,0,9,2,1,25,18,5,9,0,3,1,19,2,15,9,10,19,22,25,4,7,17,0,8,13,27,32,19,21,11,154,4,1,2,60,1,1,2,3,2,4,0,0,2,11,13,26,25,3,11,4,17,2,28,0,14,2,5,8,5,3,98,44,5,1,1,0,2,3,1,13,18,39,13,4,33,25,8,2,6,3,2,128,6,2,11,1,137,765,95,4,5941,0,0,1,17,0,32,0,7,0,0,0,0,69,1,3,1,1,4,0,1,0,0,0,1,5,0,3,1893,0,0,0,2,523,920,37,1920,2,0,67,85,73,16,0,0,0,0,0,0,0,0,0,0,0,0,506,988,1177,49,68,0,2,1106,0,0,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0,0,0,8,0,0,0,0,1,0,0,0,0,3,14,0,3,2,0,0,0,2,9,0,288,1,1,1,0,0,0,0,19,3,0,4,0,0,0,0,0,1,16,2,0,0,1,1,0,0,0,0,0,0,0,1,3,0,3,0,4,0,0,0,0,0,0,0,0,0,2,0,0,330,0,0,0,149,97,190,0,0,0,2463,2817,0,0,0,0,20,379,0,0,0,0,0,0,0,0,0,0,0,0,5678 +"335120",0,0,0,0,0,0,0,0,0,0,0,78,0,56,26,3,0,18,0,11,68,5,0,2,742,19,3386,258,1621,192,2055,2342,3461,372,2275,1206,0,0,0,182,0,0,0,0,0,0,0,0,0,0,0,0,13,33,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,0,0,0,11,0,0,1,0,0,0,1,1,0,0,0,72,0,1,0,0,0,0,1,0,0,0,1,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,225,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,157,0,2,0,0,1,0,0,0,77,1,0,3,0,0,0,194,0,36,17,0,0,0,0,0,0,0,0,37,0,0,6,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,44,0,0,0,70,0,0,0,2,10,4,5,3,0,12,11,11,0,0,8,11,11,28,2,7,20,19,18,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,223,69,22,22,0,0,85,84,18,9,0,0,0,0,1,0,2088,0,14,0,0,0,0,231,0,62,346,17,0,271,0,151,0,0,460,58,12,435,49,110,62,0,32,64,692,125,87,0,3,3,0,0,0,0,0,789,1005,3,3,18,3,56,0,0,0,0,8,248,57,1189,11,39,1,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,110,184,573,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,3,2,0,9,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,106,3,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,3,0,2,0,11,0,7,1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,0,0,0,0,0,0,4,2,0,35,1,3,0,0,0,0,0,0,0,50,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,132,0,0,0,0,0,0,0,0,0,1416,11,7595,0,0,0,43,522,0,0,0,0,0,236,0,0,0,86,0,0,9909 +"335312",3,11,1,1,1,0,11,0,0,0,0,19,0,38,0,1,0,0,0,20,0,1,3,0,196,439,462,164,118,22,185,4,167,50,267,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,30,0,467,0,0,0,299,14,0,0,217,173,16,160,66,40,564,4,20,271,69,1294,332,0,0,160,151,335,15,27,92,574,1330,308,126,49,0,94,267,0,3,10,18,26,11,40,1,31,14,199,0,12,8,11,67,1,136,0,0,0,0,326,652,0,2178,0,0,0,0,0,0,0,32,0,0,1,0,0,0,0,6,6,12,0,0,130,4,259,15,0,21,0,16,275,80,0,0,0,0,0,0,0,0,0,0,0,215,187,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,5,228,446,47,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43,0,0,0,0,0,0,103,256,29,1,39,0,0,0,0,772,1,20,1,85,424,60,0,1,0,2,0,2,0,0,0,0,0,0,0,0,27,0,0,8,25,9,0,0,0,0,0,0,0,10,1,78,27,5,0,12,118,0,0,0,0,0,0,0,41,0,1845,384,0,0,0,0,0,0,0,1,82,10325,321,7775,0,0,0,118,1927,0,0,0,0,0,13,0,0,0,2,0,0,20481 +"335314",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,13,38,8,0,6,3,47,4,9,2,1,0,10,5,1,112,60,0,1,28,18,12,12,6,0,21,10,13,46,90,78,23,13,0,32,5,28,33,84,6,66,10,8,8,15,24,23,181,45,59,773,15,0,16,5,358,10,5,74,266,240,89,3,7,4,114,474,1257,2,266,129,299,41,0,0,1,0,5,63,4,64,66,21,8,2,64,32,278,92,1,71,1,0,0,12,14,114,6,110,567,1642,32,1,7,71,3,9,0,0,28,0,7,1,36,66,11,104,40,45,295,42,0,55,0,0,5,14,78,31,0,0,12,23,5,3,11,6,14,12,10,13,9,14,0,0,1,0,2,4,51,33,8,47,0,16,3,61,11,48,26,0,67,115,77,0,46,121,0,57,72,61,0,0,61,0,452,19,5,0,0,1,4,8,9,6,9,1,0,0,95,93,156,76,0,49,10,81,2,70,0,13,5,0,6,12,355,45,263,13,5,3,2,9,7,1,0,45,48,0,12,146,14,9,3,14,94,0,5,0,2,24,0,0,0,0,4,0,0,0,0,0,0,0,2,1,0,0,0,0,0,0,0,0,0,16,16,0,1,0,69,0,0,0,0,5,0,0,0,0,6,31,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,2,0,87,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,3,0,0,0,0,0,0,0,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,45,0,0,0,0,0,0,0,0,0,238,683,0,0,0,5,107,17,1,0,19,14889,0,2991,0,0,0,183,6821,0,847,0,0,0,64,0,0,0,40,0,0,25835 +"335911",165,628,94,94,94,238,569,0,19,107,0,12,1,0,0,12,0,0,0,165,276,0,0,0,0,16,25,16,7,0,32,0,1,6,9,14,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,120,0,194,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,347,140,0,0,0,0,19,9,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,0,0,0,0,0,101,1727,87,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,286,0,0,0,0,0,11,0,5,2,0,69,39,12,39,0,38,0,67,13,0,0,0,15,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,39,49,43,10,0,0,23,0,0,0,255,20,0,0,0,0,0,315,0,0,226,0,0,67,8,0,0,1,10,36,0,37,6,3,12,0,1,6,501,0,1,0,5,0,0,0,0,0,0,32,0,0,83,359,12,0,0,0,0,0,0,0,39,6,4,12,3,135,0,0,0,0,0,8,3,0,0,1,0,0,0,0,0,0,30,25,52,0,0,324,8863,8100,112,0,0,0,103,2850,0,0,0,0,0,0,0,0,0,0,0,0,20027 +"335912",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,3,0,0,18,0,3,43,39,0,0,0,0,375,165,0,42,0,0,0,348,0,0,0,35,152,161,21,351,187,78,149,20,82,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,105,0,0,0,1,3,0,0,1,0,11,0,0,2,0,1,1,3,1,0,0,4,12,5,0,0,21,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,428,2683,104,26,0,0,0,0,0,0,0,0,0,0,0,0,0,6,90,0,0,0,0,2914,0,22,959,6,0,30,0,0,0,0,159,1,4,5,17,58,14,0,1,2,1,0,0,0,0,0,0,0,0,0,2,33,0,0,17,26,17,0,0,0,0,0,0,0,22,1,81,163,44,6,26,2,0,0,0,1,0,0,0,33,0,42,2,0,49,0,0,0,0,0,0,35,18837,0,567,0,0,0,175,5461,0,12,0,0,0,212,0,0,0,0,0,0,25264 +"335930",0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,123,256,1325,612,1584,258,2708,551,459,564,2401,1148,0,0,0,12,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,7,0,0,0,0,185,0,129,35,0,0,3,3,0,0,0,189,0,5,0,0,0,0,8,0,2,4,8,0,30,11,35,19,117,0,19,8,44,5,71,84,0,68,6,0,0,291,61,668,27,0,0,0,0,0,12,633,0,272,0,0,0,0,0,1,72,101,368,621,0,0,720,159,587,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,181,92,0,1,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,0,0,0,0,0,0,0,0,13,10,8,7,0,1,6,37,3,10,1,0,0,5,0,0,0,2,0,0,2,0,0,2,3,0,0,0,0,0,13,7,0,2,0,0,0,3,1,8,0,3,0,0,0,0,61,920,398,166,1,5,0,0,0,0,1,0,0,3,1,2,18,0,0,1839,3,4,63,0,0,0,5,0,0,0,0,0,0,0,0,0,0,2,0,0,1,0,0,2,0,0,0,0,0,0,0,0,0,597,0,1,0,0,0,4,0,0,4159,17609,582,0,0,0,3,10,4,311,3,0,17,21,0,37,0,0,0,1,2,1531,0,0,1035,3,0,0,0,0,0,6,0,3,1,0,1,0,0,0,0,0,6,2,2,4,0,0,0,5,3,0,3,1,29,47,5,12,3,7,0,80,2,6,0,20,7,2,135,11,2,13,0,0,0,0,0,0,0,0,0,0,9,9,17,4,0,0,0,15,0,0,0,0,0,0,0,0,0,3,0,0,2,1,1,0,0,0,0,4,4,1,0,2,0,0,0,0,0,0,5,0,0,0,449,6,18,157,435,0,331,56,166,33,0,4810,156,283,92,26,164,31,228,116,0,2,0,5327,2,0,41,2,74,16,0,0,39,10,22,0,0,0,13,76,0,22,0,0,0,0,0,0,0,0,0,0,0,0,0,592,15,0,0,0,13,14,4,0,118,6,0,96,15,2,0,0,12,3,29,2036,20,5,191,8,82,74,233,0,1,0,16,0,0,0,4,36,52,27,14,0,105,1,24,0,0,0,0,0,0,5,6,5,14,42,8,7543,0,0,0,10,0,25,94,4,197,42,0,358,3,792,0,0,511,75,157,106,2,0,57735,8104,0,0,0,0,348,7981,0,0,0,0,0,0,0,0,0,0,0,0,74168 +"336320",49,155,33,34,23,57,217,57,6,32,0,8,4,144,67,0,12,9,12,15,26,0,0,0,0,0,737,61,0,0,6,0,1,3,0,0,28,0,12,10,0,0,2,55,2,16,2,0,0,0,0,1,20,0,0,0,0,0,0,0,0,0,0,0,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1270,85,331,2,0,0,0,0,2,0,5,0,0,0,1,1,205,0,0,116,0,2,0,0,0,0,1,0,2,0,0,0,209,12,3,0,64,2,73,0,4,6,20,12,3,29,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,566,3801,407,255,175,0,41,1529,3313,1375,0,15,515,699,0,4,0,0,0,0,127,0,0,0,18,0,13,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,4,0,0,0,4,0,0,0,0,8,2,5,0,2,12,0,39,0,0,0,0,0,6,31,3,0,0,0,0,0,0,1,0,0,0,0,0,23,21,6,0,0,0,0,18,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,472,33,131,194,400,42,705,37,346,159,0,1875,603,111,359,200,54,7,433,20,0,9,0,211,21,0,19,2,813,22,3,3,122,9,25,0,0,0,31,57,0,10,77,0,0,0,0,0,0,0,0,0,0,0,0,222,18,0,0,0,0,11,2,1,81,171,0,384,171,38,0,0,111,155,254,3172,19,4,185,25,159,76,142,0,243,26,18,0,0,102,21,32,42,955,36,7,444,50,201,0,0,0,0,0,4,12,18,10,54,61,7,3127,0,69,0,8,0,33,151,8,107,54,0,4426,75,0,0,0,478,24,825,30,0,23,42283,8277,0,0,0,0,364,4387,0,0,0,0,0,0,0,0,0,0,0,0,55311 +"336350",0,0,0,0,0,0,0,0,0,0,0,48,3,251,116,7,39,79,99,32,80,1,0,0,0,0,232,64,0,0,0,0,0,0,0,0,32,12,11,10,0,2,6,46,5,12,5,0,0,6,1,1,17,3,2,0,5,0,1,1,2,0,5,0,1,1,21,16,4,3,0,3,0,6,2,13,0,4,3,0,0,1,375,421,1360,13,2,9,0,0,1,0,3,0,1,4,2,4,0,1,0,2,2,6,6,0,0,0,7,0,0,0,0,0,2,0,1,1,0,3,2,0,1,0,0,3,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,5,0,0,1881,17397,3085,191,9,0,2,3500,9,37,5,2,9,1047,3,0,1,0,0,2,6,4,0,0,1,6,16,5,3,0,4,14,3,6,6,0,2,0,0,3,1,0,10,3,2,6,0,2,1,8,3,1,3,4,54,80,53,19,6,4,0,131,3,34,0,45,20,5,218,17,3,18,32,1,0,0,2,0,0,0,0,2,15,14,23,7,1,2,1,24,1,44,0,3,1,1,0,0,1,4,1,0,5,3,2,16,0,1,4,6,8,2,0,3,3,0,0,2,0,0,9,3,0,2,0,67,177,362,856,49,967,74,519,207,0,529,884,77,528,322,108,52,676,238,0,11,0,371,493,1,9,2,215,38,0,8,77,13,32,0,13,0,166,51,8,3,105,0,0,0,0,0,0,0,0,0,0,0,0,578,28,0,0,0,0,27,28,2,49,132,0,582,208,33,0,2,453,157,164,3648,34,11,266,18,134,121,326,4,132,46,26,5,4,0,35,39,73,343,24,7,227,7,1459,2,1,0,7,7,4,26,20,114,19,30,0,1637,0,0,0,5,0,35,204,4,192,50,0,1751,8,2370,0,77,1252,184,2613,434,0,107,60701,6923,0,0,0,0,229,6109,0,0,0,0,0,0,0,0,0,0,0,0,73962 +"336360",2,8,3,2,3,8,15,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4631,22751,3579,459,15,0,0,0,0,0,9091,0,0,0,599,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,130,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,0,0,40176,0,0,0,0,0,65,1782,0,0,0,0,0,0,0,0,0,0,0,0,42023 +"336390",35,131,19,19,20,51,118,0,4,23,0,46,16,129,96,9,80,36,107,83,155,45,4,1,0,0,249,52,0,1,6,1,0,0,1,0,715,281,191,814,1,35,20,266,17,48,6,0,0,37,24,7,285,119,1,4,94,0,53,14,81,34,0,0,54,28,336,208,0,58,34,132,0,140,33,236,0,159,47,0,0,57,432,45,1553,233,0,258,0,0,255,0,93,329,0,0,31,17,133,1,0,383,78,191,1092,9,0,0,185,0,6,5,8,9,251,0,32,1,44,101,156,0,24,0,64,65,0,0,5,0,0,0,0,0,0,25,0,55,37,0,18,139,0,0,1798,8121,1314,471,2112,29,3052,1370,561,2528,201,303,11153,657,1214,0,56,0,0,25,128,136,0,0,484,128,115,4,61,45,87,57,56,341,178,0,7,0,4,115,13,0,284,100,0,273,0,76,15,5,52,0,99,184,572,649,29,11,199,134,0,71,110,13,0,14,192,0,2461,111,2,10,35,16,16,0,57,0,0,1,0,3,329,412,726,187,0,0,0,156,0,0,58,94,26,0,0,0,49,295,325,0,3,2,11,12,5,17,197,233,490,128,0,175,181,0,0,0,0,0,493,1,0,115,42,47,136,264,752,20,547,50,377,304,0,1201,1099,161,689,490,161,36,993,175,0,16,0,2661,281,0,60,2,645,28,0,5,23,5,17,0,0,297,14,49,0,12,11,0,70,119,11,16,0,0,0,0,0,0,0,435,21,0,0,0,6,12,6,3,254,269,0,484,135,23,0,1,36,422,120,2252,26,14,239,17,105,194,727,2,130,53,19,48,7,0,20,38,32,345,40,26,174,11,172,0,4,0,26,0,4,8,24,69,399,397,28,1946,0,44,0,8,0,25,128,10,536,69,0,646,58,638,0,0,791,141,1134,503,230,62,86743,12301,0,0,0,0,297,27336,0,0,0,0,0,0,0,0,0,0,0,0,126677 +"3363A0",0,0,0,0,0,0,0,0,0,0,0,2,0,227,106,8,70,35,135,77,164,0,0,0,0,0,1147,542,0,0,10,0,0,0,0,0,44,0,5,87,0,0,4,33,2,12,1,0,0,6,0,0,4,1,0,0,3,0,0,0,5,0,0,0,0,0,7,4,0,3,0,3,0,3,2,11,0,0,2,0,0,2,737,380,794,60,0,10,0,0,0,0,1,0,0,0,1,2,0,0,0,2,4,4,7,0,0,0,9,0,0,0,0,0,2,0,0,1,0,3,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,933,5744,949,339,303,4,351,1916,4,4886,2,0,1015,2088,6,0,1,0,0,1,0,0,0,0,51,3,0,0,2,0,0,5,3,4,4,0,1,0,0,2,0,0,14,0,0,1,9,0,0,3,0,0,0,2,30,37,15,8,3,5,0,65,15,8,0,0,0,0,118,9,2,10,0,0,0,0,0,0,0,0,0,0,10,6,13,0,0,0,0,9,0,5,0,0,0,0,0,0,1,2,0,0,3,2,1,13,0,0,0,3,8,1,0,0,2,0,0,0,0,0,0,0,0,0,0,7,17,45,264,9,335,64,144,29,0,428,210,88,140,99,192,24,419,101,0,15,0,2221,81,0,13,2,498,13,0,0,17,8,16,0,0,921,1,16,0,10,3,0,0,0,0,0,0,0,0,0,0,0,0,366,13,0,0,0,4,20,10,0,19,190,0,133,101,0,0,0,30,1,38,1485,19,3,168,5,65,101,395,0,1,16,19,0,17,0,6,35,35,97,0,5,222,73,85,0,3,0,0,0,3,7,9,63,111,102,19,6213,0,0,0,23,0,31,94,2,163,150,0,231,0,655,0,0,425,17,804,48,0,0,43232,3551,0,0,0,0,375,4555,0,0,0,0,0,0,0,0,0,0,0,0,51713 +"336411",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,0,0,0,0,0,19,0,1492,6690,4155,0,0,0,179,438,0,45,0,0,0,0,0,0,0,50,0,0,13049 +"337110",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,2,1459,1822,1928,626,3919,113,631,106,6157,240,0,12,0,184,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,355,0,0,0,0,0,0,0,0,0,0,13,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,154,0,0,0,0,0,500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,378,0,0,0,2,3,0,1,67,0,0,0,0,0,0,75,0,0,21,0,0,20,95,68,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,152,2,322,0,0,0,0,0,0,0,0,0,0,7593,58,30,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,5,91,0,1,40,96,49,0,0,0,0,0,0,0,57,2,187,84,24,0,0,0,0,0,0,0,0,0,0,146,0,0,0,0,0,0,0,0,0,0,0,392,28452,0,136,0,0,0,117,139,0,0,0,0,0,0,0,0,0,0,0,0,28843 +"337121",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1368,0,12610,0,0,0,17,347,0,0,0,0,0,3,0,0,0,0,0,0,14344 +"339990",6,20,6,5,1,7,42,43,4,0,0,1,0,21,10,2,8,7,8,11,18,0,0,0,4,33,65,19,19,9,192,4,6,11,118,24,0,0,0,25,0,16,0,0,0,0,0,2,0,0,0,0,4,0,3,0,0,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,2,3,0,0,0,48,0,0,0,1,0,114,8,490,86,586,40,6,98,37,64,21,0,0,0,0,211,0,0,115,49,144,521,0,7,0,8,150,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43,77,513,0,0,2,0,0,0,127,322,23,0,0,0,0,534,162,279,22,0,536,754,0,0,0,179,0,0,0,0,0,0,0,0,0,0,17,0,0,0,0,0,3,0,0,0,13,0,0,0,0,1293,0,0,0,0,0,0,3,3,3,2,3,0,3,4,0,0,0,5,5,11,0,0,0,1,12,2,0,0,0,0,4,0,0,7,0,99,5,0,0,0,0,0,0,0,0,4,0,0,4,0,0,0,1,0,14,401,16,0,0,0,0,0,0,0,0,0,23,3,0,0,0,0,0,0,0,1,78,0,0,0,1,43,58,6,183,175,242,24,129,4,0,183,142,10,76,18,9,538,89,13,0,1,0,10,17,0,18,76,159,0,0,0,1,4,2,0,0,0,72,143,10,15,0,0,49,50,7,12,0,0,4,0,0,0,262,7,7,3,0,0,0,36,0,277,394,24,44,86,36,244,1,8,7,13,13,1787,1,2,19,0,43,22,8,151,15,13,15,12,1,59,6,27,19,288,10,2,269,48,466,61,0,0,0,34,154,24,45,23,104,102,25,1,2,77,87,938,817,39,68,92,173,193,0,4,61,0,0,0,258,140,206,0,0,5,20279,52600,5681,0,0,0,217,7657,0,42,0,0,0,0,0,0,0,186,0,0,86662 +"311111",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,2,3,1,9,1,4,0,0,0,0,0,0,0,0,1,120,60,17,0,0,0,0,0,0,0,0,0,0,2,0,1,0,0,0,0,9,64,6,0,0,0,8248,5469,0,0,0,0,87,497,0,0,0,0,0,0,0,0,0,0,0,0,14302 +"311224",0,0,0,0,0,0,539,127,915,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2431,5037,54,0,6101,3149,3549,737,581,6,97,309,97,6,68,179,90,628,235,3797,0,0,690,765,95,0,0,0,0,0,2,0,0,0,34,0,0,0,100,16,0,0,0,0,0,0,0,29,10,0,234,0,0,0,0,0,12,0,0,0,0,0,0,0,558,0,733,501,0,265,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,47,0,0,7,31,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,79,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,341,1742,2291,940,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,0,22,0,0,0,38640,5006,0,0,0,0,365,6629,0,0,0,0,0,0,0,0,0,0,0,0,50641 +"311230",0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,315,304,0,1,0,0,0,0,0,0,873,517,22,88,652,60,15,62,0,88,25,253,41,279,415,2394,2851,514,0,0,0,0,0,0,0,0,9,0,93,0,539,0,0,0,94,431,463,668,0,0,0,28807,28347,0,0,0,0,110,1845,0,0,0,0,0,0,0,0,0,0,0,0,59110 +"311514",0,0,0,0,0,0,0,0,67,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,109,216,0,0,0,0,0,216,0,0,989,2274,1832,693,0,0,0,263,318,0,0,0,63,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,26,5,39,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1372,15,0,0,10,23,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,4,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,120,147,0,0,0,0,0,0,0,0,33,26,1,10,142,0,0,0,0,0,0,0,0,4,54,703,505,32,0,0,0,0,0,0,0,0,5,0,11,0,0,0,0,0,2,1323,412,673,0,0,0,12823,17285,0,0,0,0,143,3301,0,0,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,3,3,0,0,0,0,0,0,0,0,0,2776,111,0,0,0,0,-27,1842,0,0,0,0,0,0,0,0,0,0,0,0,4702 +"313200",0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,38,11,8,5,29,1,4,15,81,17,0,0,19,78,0,0,0,0,0,0,0,160,0,0,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80,0,0,270,0,0,0,0,0,0,0,0,0,0,0,0,41,0,440,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,2,0,0,0,0,182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,942,24,16,17,10,72,947,250,146,0,22,0,0,0,2,1,142,126,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,881,1694,706,646,159,1207,11,0,1167,27,0,1,0,1631,0,144,59,0,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,0,58,0,739,286,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,0,471,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,0,0,0,0,0,0,0,39,0,0,0,62,0,3,0,0,0,0,0,0,0,0,0,0,0,0,39,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,3,0,0,13,0,0,5,0,0,0,0,0,72,8,0,0,0,301,10,115,0,0,0,15096,2236,18,0,0,0,-133,3039,0,0,0,0,0,0,0,0,0,0,0,0,20255 +"313300",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,0,0,0,0,0,0,0,36,403,817,1520,931,0,440,0,0,0,0,0,0,0,41,2158,109,126,41,0,0,0,0,12,0,600,0,0,0,0,0,186,153,0,0,0,27,1329,211,0,0,0,9227,34126,0,0,0,0,-11,932,0,0,0,0,0,0,0,0,0,0,0,0,44273 +"314900",0,1,42,47,0,25,2,3,0,0,0,43,32,0,0,0,0,0,0,0,0,0,0,0,46,128,358,116,220,121,537,6,10,18,476,103,0,0,5,82,0,0,0,0,0,0,0,0,113,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,93,9,59,0,0,0,0,0,0,105,0,3,0,0,0,0,0,0,762,52,184,0,0,0,16,286,39,6,20,7,22,12,1,0,0,0,0,0,0,2,0,25,0,1,84,67,1,1,3,0,1,0,0,0,0,0,0,0,4,0,51,0,0,0,0,0,0,21,0,0,0,0,8,0,3,81,0,196,57,0,0,0,0,0,0,0,0,0,0,0,0,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,6,1766,0,0,164,306,418,87,459,521,235,232,422,35,0,71,135,4012,9,34,9,514,82,15,0,0,127,31,0,1,77,34,10,0,0,0,0,0,0,0,0,0,1,7,0,5,0,0,0,0,0,0,0,0,0,0,1,0,228,150,4,71,0,0,0,0,0,0,14,1,0,145,1,0,0,1,0,4,0,122,0,0,0,0,0,1,190,0,3,0,1,1,0,0,0,0,0,56,0,0,3,3,3,0,0,0,0,0,11,33,415,40,8,18,4,6,0,0,11,0,0,83,4,41,0,97,0,1236,205,0,1,5,101,221,431,0,18,0,18673,12627,0,0,0,0,151,3233,0,0,0,0,0,102,0,0,0,0,0,0,34786 +"315000",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,27,1,0,82,356,0,0,0,0,0,0,0,0,0,2003,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,434,221,0,1,0,416,0,0,0,120,0,0,0,0,0,0,0,0,0,0,0,20,18,49,0,0,23,0,0,8,122,530,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,120,0,0,0,0,0,0,0,0,0,28,0,0,0,0,0,9,0,83,0,0,35,0,24,52,133,0,54,63,29,0,0,1,0,6,0,11,0,0,626,0,0,116,0,0,0,0,0,0,24,9,43,116,27,0,0,124,90,66,0,13,0,20,0,1754,0,32,20,0,16,8,797,484,1358,0,36,2,10890,297647,0,0,0,0,-139,3203,0,0,0,0,0,0,0,0,0,0,0,0,311601 +"316000",0,0,0,0,0,0,0,4,0,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,113,238,0,0,0,0,0,0,0,0,1808,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,145,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,161,110,812,0,0,0,0,0,0,0,0,276,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,20,5,0,17,23,71,0,60,0,0,79,3,15,7,6,17,178,44,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0,0,4,0,0,5,0,0,0,0,15,0,0,0,0,0,6,60,0,0,1,10,0,0,18,0,0,0,0,0,16,5,0,0,0,95,0,0,104,0,0,2,0,7,0,47,0,262,46,58,0,0,55,4,122,0,0,0,5275,115483,0,0,0,0,327,3021,0,0,0,0,0,0,0,0,0,0,0,0,124107 +"322110",0,0,0,0,0,0,0,0,0,0,0,0,0,0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,1,0,0,2,0,1,1,0,0,0,64,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,15,4,0,93,2,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,3,5,0,1,1,33,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,3,0,43,41,0,1,0,0,1,1,8,3,5,1,0,0,0,0,0,5,20,3,17,7,7,4,10,0,0,0,14,23,13,0,0,1,1,28,5,0,0,4,0,36,5,0,0,0,0,0,0,164,223,8764,1631,432,613,195,4964,49,0,0,43,1,0,0,0,1,2,1,1,0,0,0,0,0,0,0,5,53,8,0,79,101,12,71,16,13,4,93,0,0,1,8,25,14,51,78,51,66,69,78,2,0,23,35,27,10,27,25,24,52,56,2,30,2,0,937,11,661,38,77,178,187,569,34,12,13,0,0,0,1,1,0,18,0,3,0,0,0,0,0,0,35,0,0,0,356,1,2,4,20,31,5,63,3,11,73,35,3,20,24,2,17,7,20,460,5,685,8,7,218,4,13,145,19,38,42,8,46,68,14,21,0,3,39,70,16,2,99,6,40,6,3,0,7,1,4,2,23,1433,64,194,24,20,5,9,2,40,0,1,4,87,6,29,0,4,289,11,0,0,2744,442,1160,0,0,0,31273,27806,0,0,0,0,-41,10165,0,0,0,0,0,0,0,0,0,0,0,0,69202 +"322130",0,0,0,0,0,0,0,0,0,0,0,0,0,10,5,1,10,3,10,5,13,27,0,0,0,0,59,27,0,0,0,0,0,0,0,0,48,40,14,72,3,7,5,24,4,7,434,31,5,11,37,8,50,8,4,0,9,189,7,3,16,14,8,5,5,8,12,38,12,6,12,15,3,25,24,44,2,37,6,4,11,42,10,8,14,30,6,46,4,0,7,3,12,2,6,16,7,7,42,2,4,12,7,21,32,1,2,1,20,22,0,0,0,1,22,5,6,8,11,13,26,0,5,4,12,12,9,27,0,2,0,6,4,5,3,4,7,9,4,0,3,37,2,5,16,103,16,11,3,0,15,21,30,37,12,0,68,37,42,0,8,3,8,3,18,11,32,0,4,15,13,2,7,8,9,17,6,58,35,47,1,0,1,13,23,4,93,56,4,17,0,7,1,16,9,40,13,21,31,15,27,11,18,61,0,38,50,64,80,21,52,30,184,12,2,7,29,1,2,5,4,3,8,1,1,7,45,53,23606,1429,1152,25,518,202,31,52,3,11,3,0,2,6,9,24,25,7,0,0,0,0,3,2,17,21,96,21,5,30,34,18,3,10,3,3,73,12,4,15,21,47,27,24,172,9,71,37,209,6,0,25,74,94,22,19,29,75,36,35,7,6,5,71,7,2,60,58,7,31,44,68,19,355,17,1,0,7,71,140,10,4,74,0,455,398,307,67,0,23,0,2,0,0,495,10,3,62,821,187,27,82,122,80,106,282,101,79,124,53,25,6,418,21,1326,373,48,28,91,8,40,48,93,14,1,33,50,36,30,4,29,33,17,23,14,12,151,41,39,5,1,0,6,0,2,36,19,49,0,185,35,13,2,18,19,9,0,2,9,33,70,7,0,1,0,54,7,1,312,0,0,1,0,0,41434,0,0,0,0,0,314,287,0,0,0,0,0,0,0,0,0,0,0,0,42035 +"322210",0,1,100,81,0,26,0,0,0,0,0,0,0,21,10,2,23,6,21,11,23,6,0,0,10,36,321,12,8,118,501,136,146,142,100,142,469,244,92,153,69,627,12,178,15,33,148,64,10,29,24,8,448,96,59,3,135,94,55,45,88,82,72,54,51,158,99,85,76,45,32,70,17,107,112,277,46,41,35,28,478,28,28,18,34,81,15,139,4,5,78,128,152,8,15,40,9,18,99,20,10,38,31,729,70,22,5,1,110,89,1,1,1,21,62,20,6,68,59,107,8,2,37,19,18,67,43,77,3,0,13,206,105,343,34,32,21,19,111,61,6,136,3,7,252,1718,245,88,26,5,150,74,63,83,56,215,857,210,391,5,41,9,37,27,100,108,20,0,42,363,436,98,125,52,231,176,138,355,273,106,27,24,6,164,56,282,63,474,305,50,254,11,78,77,588,1230,1032,459,489,436,788,390,643,1108,159,1537,1537,368,54,82,446,630,468,1049,389,99,3336,13,128,46,45,26,75,2,14,6,1119,977,760,1137,697,662,229,1778,61,0,8,110,114,0,10,10,253,172,492,135,71,173,50,158,35,138,154,303,1174,2426,51,740,789,220,50,448,64,216,2118,4,76,107,383,152,112,218,376,310,714,123,1084,88,0,90,922,283,41,120,51,93,264,84,19,9,0,176,7,15,323,582,190,17,20,23,24,46,28,3,0,0,43,228,10,45,40,0,0,12,0,0,0,0,302,0,0,0,82,10,53,52,0,265,22,215,56,103,137,227,93,110,337,50,70,29,238,70,134,935,124,42,221,25,67,237,141,12,5,92,136,47,21,87,7,62,21,96,0,0,215,62,122,8,26,0,24,3,8,16,38,15,18,2675,6,8,19,38,22,81,0,3,5,136,310,26,0,61,322,124,0,0,436,407,178,0,0,1,73735,1820,0,0,0,0,371,2561,0,0,0,0,0,0,0,0,0,0,0,0,78488 +"322220",0,1,165,198,0,0,0,0,0,0,0,0,0,14,15,1,13,4,13,7,12,2,0,0,22,37,42,29,35,26,52,1,14,4,1336,11,0,8,1,0,0,0,20,1,0,0,20,3,0,0,43,35,4,0,0,0,3,0,0,0,1,0,0,0,1,2,2,3,0,0,1,0,5,2,1,3,0,13,0,0,0,1,2,1,2,6,1,9,0,9,4,1,4,5,1,3,1,1,8,0,1,3,2,6,6,1,0,0,6,4,0,0,0,0,2,0,1,1,1,1,1,0,0,0,1,1,0,1,0,0,1,8,2,3,1,2,1,2,0,0,0,3,0,1,1,6,1,1,0,0,0,3,1,0,12,2,74,92,3,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,4,2,0,0,0,0,1,0,0,1,0,312,122,136,86,19,265,36,509,171,25,224,293,122,34,235,365,56,628,325,386,35,11,410,519,15,1,0,0,0,0,0,0,0,0,0,0,2,4,1008,89,16,76,4,515,17,4386,14,0,0,0,1,0,1,0,3,13,4,2,1,3,2,15,117,0,1,1,6,4,0,131,1,0,0,0,128,0,204,0,0,1,349,144,239,195,475,241,594,158,800,86,0,81,381,99,22,102,26,82,215,80,0,2,0,14,11,9,34,79,45,53,49,126,37,27,8,0,0,0,3,8,0,36,0,2,173,199,11,5,0,2,104,0,0,0,416,4,5,14,277,0,7,50,14,24,71,46,14,44,64,56,22,8,46,6,199,257,17,9,252,9,22,210,152,1,13,9,55,70,16,174,1,15,37,71,7,2,30,17,45,0,0,0,0,1,0,7,20,1523,44,204,2,6,8,14,6,44,0,1,4,66,8,19,0,99,80,4,0,0,490,129,591,0,32,0,26354,4477,0,0,0,0,67,4660,0,0,0,0,0,0,0,0,0,0,0,0,35557 +"322230",0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,1,0,1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,0,210,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,3,2,6,9,0,4,16,0,0,0,2,3,2,0,4,2,5,14,11,0,6,0,0,65,4,857,1,0,0,0,0,0,1,0,0,0,0,0,0,0,4,0,1,201,193,11,24,0,0,3,0,0,0,42,0,0,7,0,6,0,13,0,0,16,0,0,2,3,0,2,1,0,9,0,18,0,1,25,0,2,1,1,0,33,1,8,15,2,1,0,0,9,21,0,0,0,0,1,0,0,0,0,0,0,0,3,1272,15,13,0,1,0,1,0,5,0,0,0,17,0,0,0,12,1286,0,0,0,1144,222,891,0,0,0,6820,1450,0,0,0,0,-31,492,0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,43,1,12,0,0,0,2,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,646,10,0,3,0,0,0,0,0,0,0,2,0,9,92,20,76,0,0,0,0,85,0,0,0,0,0,0,0,0,0,0,0,0,0,1287,2087,1305,524,1482,3309,888,162,1784,535,0,295,216,236,30,100,103,77,5725,235,9,13,0,265,114,5,293,31,20,857,739,1182,471,156,321,153,0,66,206,74,34,313,3403,1,853,727,1080,190,1231,2245,611,0,0,0,208,28,44,31,429,1025,190,155,92,256,586,1047,193,175,2465,434,114,12,266,834,268,75,75,15,905,391,33,1679,20,0,127,787,946,326,122,226,40,143,82,3150,117,28,1679,19,923,82,52,31,104,651,11,114,119,1174,317,674,67,110,4,11,0,185,0,27,384,77,666,587,0,587,1793,21,0,2,4865,1421,1798,0,0,514,74379,8499,0,0,0,0,331,2231,0,0,0,0,0,0,0,0,0,0,0,0,85440 +"323120",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,864,44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,84,42,1507,46,0,0,0,0,176,21,47,3,0,161,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,1,87,0,4,6,196,0,189,0,50,409,0,0,0,0,29,0,0,26,0,0,3,1,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,12,35,0,0,445,16,7,0,0,0,4562,0,0,0,0,0,-18,66,0,0,0,0,0,0,0,0,0,0,0,0,4610 +"324110",785,3175,561,432,1043,1502,1633,1306,910,381,53,370,80,2555,1324,570,925,685,706,410,1802,15249,4,404,646,1652,5756,1318,3296,1023,5019,1303,2199,2228,3723,4071,177,460,69,172,52,142,145,76,11,16,121,8,10,22,26,15,185,28,8,11,24,8,9,9,12,19,29,52,16,23,54,44,6,12,14,11,16,126,52,357,11,16,8,8,19,47,25,2,149,22,3,37,6,0,276,8,22,5,10,6,6,10,8,4,5,21,6,11,22,2,5,2,50,8,0,0,6,0,1,0,48,1,1,7,20,0,1,0,0,5,0,3,0,0,1,6,0,2,7,5,6,1,20,0,4,4,6,3,1,40,8,14,5,0,7,28,9,23,25,33,35,17,24,53,51,14,17,19,21,9,1,3,2,39,7,4,9,5,14,33,9,16,14,2,0,5,4,16,1,2,22,42,19,26,13,36,3,17,39,96,37,55,31,33,42,4,34,87,30,97,30,46,7,8,15,24,45,40,10,14,62,6,24,21,15,5,12,0,2,96,595,493,528,58,4,18,15,668,6,7614,5042,1741,2709,1526,752,88,909,3210,2400,298,56,150,19,96,421,650,187,517,452,321,58,555,64,29,14,40,99,11,125,56,12,31,670,241,1400,324,1078,106,735,267,1213,126,0,1099,455,292,700,102,315,68,288,276,27730,6584,6864,35622,3744,115,2293,9565,6424,33,31,42,11,144,75,13,13,46,139,196,81,632,96,1,5003,4249,3379,591,0,0,35,1619,41,34,6361,858,681,347,242,69,159,1341,295,108,835,71,19,349,40,22,13,50,84,1122,122,3425,105,330,209,66,242,180,1846,14,367,997,153,12,24,119,6,46,136,1449,635,109,211,164,86,42,38,16,81,63,93,330,487,1004,1772,1954,119,502,22,151,49,175,13,328,142,429,151,604,0,11609,1652,395,1534,165,33027,3006,37661,17586,568,7800,380158,311032,0,0,0,0,-7387,97680,0,0,0,0,0,0,0,0,0,0,0,0,781483 +"324121",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,12,20,0,0,0,7,8,2222,640,299,122,4491,45,237,69,2043,1031,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,0,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,6,0,6,0,0,0,0,0,0,0,0,0,0,2,0,0,0,18,0,0,0,0,0,0,0,8,0,0,4,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,0,62,0,0,0,0,0,1,42,0,0,2,1,0,0,0,0,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436,198,58,78,822,18,49,299,490,156,44,0,15,220,7,30,14,12,2,5,11,3,3,2,7,5,795,89,26,36,82,26,16,26,37,43,0,2,11,7,6,83,5,4,5,27,3,13,28,11,8,45,0,0,3,16,0,0,0,0,2,2,8,0,9,8,16,4,0,0,0,0,0,0,0,16,8,16,0,0,0,0,17,138,2,0,1,1,10,8,2,11,15,0,9,0,3,6,12,21,0,29,0,0,1,56,21,22,38,11,10,1,5,1,0,0,455,5,1,11,8,9,0,0,0,15,38,47,24,24,79,3,22,2,36,0,0,0,0,0,0,0,0,33,5,7,8,57,26,60,20,131,100,116,2,0,1,36,11,7,152,270,20,5,0,0,4,6,77,263,60,66,64,171,119,145,3,1,4,141,93,245,0,44,42,32,363,58,4,11,85,1,1,3,0,0,0,0,2,1,12,37,2,0,0,0,0,2,0,1870,77,0,25,22,11,144,467,608,53,14,0,0,0,0,0,5,0,61,114,50,0,63,98,22,6,15,7,54,74,8,12,24,23,14,44,8,80,0,16,0,36,5,0,257,196,101,43,24,140,46,314,63,6,49,0,152,0,0,45,0,0,3,0,0,2,4,3,0,0,0,5,19,0,6,0,0,15,23,0,0,0,8,0,0,1,0,2031,287,18,11,0,0,3,14,3,0,521,7,0,219,2,1,0,0,2,16,0,1528,4,2,32,0,6,47,11,24,2,48,218,3,0,0,10,7,5,115,181,20,119,71,8,0,0,0,0,0,1,4,21,207,124,313,37,468,1,12,27,3,0,3,25,15,7,38,0,37,0,0,0,0,255,385,290,13,0,423,24992,13152,0,0,0,0,-41,1683,0,0,0,0,0,0,0,0,0,0,0,0,39786 +"325110",0,0,0,0,0,0,0,0,0,0,0,0,0,970,9,6,39,0,0,5,78,280,3,0,0,0,1,0,0,0,0,0,0,0,7,52,0,0,0,0,3,3,0,1,0,0,0,6,0,0,5,5,3,3,0,0,0,0,4,1,0,0,0,0,0,1,0,3,0,0,0,0,0,2,0,10,0,0,0,0,0,0,2,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,3,0,0,0,2,1,6,0,1,3,6,0,0,0,0,4,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,1,0,0,0,5,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,8,0,0,0,0,0,0,49,27,31,0,2,0,0,0,0,0,15575,0,0,2121,13106,81,12,555,19165,14043,2466,20,21,83,41,0,31,563,183,71,56,1,1903,76,49,9,6,36,3,462,10,1,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,2,0,0,0,7,13,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,0,0,0,0,0,0,0,3,0,0,14,0,2,12,40,3,1,0,84,0,227,0,32,1,1,29,56,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,8,0,0,0,0,0,0,14,0,0,36,0,0,0,1,1483,251,0,0,5,74824,0,0,0,0,0,172,6380,0,0,0,0,0,0,0,0,0,0,0,0,81376 +"325120",0,0,0,0,0,0,0,0,0,0,0,0,0,1094,25,26,123,0,0,19,315,827,4,109,0,0,4,0,0,0,0,0,0,34,0,0,0,0,0,0,13,41,5,5,0,0,8,12,0,0,21,17,748,86,11,19,0,0,12,2,1,3,0,0,0,0,7,9,4,2,0,0,6,14,0,139,0,1,0,0,0,0,4,0,4,5,0,2,0,1,0,0,3,10,0,1,0,0,0,0,0,0,0,2,4,0,0,0,15,0,0,0,0,0,0,0,88,1,20,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,17,11,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,2,10,9,0,0,88,0,1,1,4,0,0,0,0,0,0,0,0,0,0,0,0,0,2,4,0,4,0,9,0,9,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,12,18,21,0,2,0,0,0,0,0,0,0,0,0,33,58,27,292,396,43,16,2,5,307,75,0,33,13,91,0,0,0,196,36,36,22,14,70,0,49,13,0,7,0,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,70,0,0,79,1,0,148,15,18,0,0,6,1,0,11,1,73,24,0,5,6,139,5,0,0,435,48,475,6,88,79,111,776,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,70,26,0,0,1,0,0,0,0,0,0,68,0,0,0,212,2298,180,0,0,62,11574,1196,0,0,0,0,-262,569,0,0,0,0,0,0,0,0,0,0,0,0,13077 +"325130",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,9,8,22,1,6,0,0,0,6,8,0,11,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,12,0,7,26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,69,7,0,0,0,0,0,0,0,0,0,0,0,1,1,4,0,1,5,7,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,3,0,5,0,57,0,29,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,4,75,242,203,0,1,0,0,19,95,95,0,156,0,0,0,0,0,0,0,0,4,2,0,6,3,184,41,130,0,0,0,0,0,9,1540,1,23,40,739,344,79,75,7,6,3,43,504,55,4,39,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,53,0,18,0,0,0,6,0,0,32,9,9,0,2,2,1,3,1,1,115,7,159,9,57,75,80,166,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,11,0,0,2,0,0,0,0,0,0,37,0,0,0,202,1162,67,0,0,21,7451,0,0,0,0,0,79,3133,0,0,0,0,0,0,0,0,0,0,0,0,10662 +"325180",82,168,47,30,17,38,4,1,0,2,0,0,0,614,15,7,57,0,114,8,121,195,3,66,0,4,8,0,2,0,0,0,0,0,0,0,201,0,0,0,16,991,6,157,0,0,10,47,87,0,51,18,88,76,1,97,0,0,11,2,0,0,0,0,0,4,5,16,3,1,2,0,1,2,0,55,0,0,0,0,1,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,0,0,1,0,486,84,132,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,145,10,11,0,0,0,0,0,1,0,0,0,0,5,3,25,0,2,26,49,0,0,0,0,11,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,9,10,0,14,0,9,0,31,0,0,38,1295,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,109,0,0,0,0,0,0,522,1108,1087,0,234,3,0,15,0,0,1295,15,0,183,62,203,188,3060,1565,1529,249,1,3,7,2,665,413,42,306,1223,24,151,2586,289,140,128,301,1737,0,804,688,34,380,0,0,0,0,0,0,0,0,115,2,0,0,0,0,0,0,0,0,0,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,5,0,0,0,0,0,0,0,0,0,0,0,0,456,8,140,0,0,0,0,0,0,0,0,0,0,10,0,264,0,52,0,14,3,2,0,878,0,50,19,0,2,8,65,16,1,30,418,48,421,186,398,293,392,290,10,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,12,0,0,4,0,0,0,0,0,624,194,0,0,0,476,2761,845,0,1,142,37027,36,1628,0,0,0,-94,13313,0,0,0,0,0,0,0,0,0,0,0,0,51909 +"325190",0,0,0,0,0,728,0,0,0,0,0,0,0,729,28,37,152,0,188,28,502,920,8,26,16,72,58,12,5,3,57,3,6,9,0,6,107,18,10,12,33,123,6,384,2,7,13,32,101,61,158,14,115,73,9,0,52,0,92,17,9,2,3,5,2,5,26,460,10,7,15,7,3,12,11,154,1,19,4,1,112,0,11,4,40,16,1,20,2,9,3,1,93,1,4,10,3,3,18,1,2,6,3,13,22,1,1,0,41,8,1,0,0,1,19,2,14,3,8,105,11,0,2,2,0,5,3,11,0,0,2,2,2,0,1,1,1,0,2,1,26,17,149,2,17,102,9,11,1,7,141,64,18,163,5,14,52,141,21,0,0,36,96,2,35,12,0,2,2,8,7,1,5,5,5,9,6,50,41,88,1,24,0,16,1,143,21,34,2,7,1,219,0,7,5,1073,6,2,19,26,20,6,9,26,0,74,53,46,31,98,47,157,209,7,1,4,36,1,119,94,0,1,3,0,4,155,790,543,58,232,7,16,18,1403,4,12878,167,47,220,8010,513,474,317,12687,22842,1433,353,1046,700,565,2,5699,2894,1232,1639,2016,81,2361,1392,149,63,71,389,927,726,1188,129,790,0,27,16,0,194,0,52,31,194,5,0,28,21,20,0,6,7,0,15,0,0,17,6,112,2,1,2,19,3,16,6,22,6,0,6,0,0,0,332,75,33,4,0,0,0,0,0,0,0,0,0,0,0,0,11245,0,0,0,0,2,0,0,5,32,2983,170,15,779,62,85,11,77,50,19,1,788,623,232,165,4,10,59,959,66,10,74,944,168,1447,0,543,781,901,1492,137,12,15,19,0,0,0,0,0,0,0,10,4,19,182,673,138,14,8,284,175,0,0,10,0,0,0,10,0,1,713,37,5,0,1541,9583,1076,1085,0,1016,140533,1073,0,0,0,0,184,32439,0,0,0,0,0,0,0,0,0,0,0,0,174230 +"325211",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,926,0,42,1,1370,7,0,0,0,0,3,1,0,34,48,2,3,0,0,0,0,0,13,0,0,0,1,28,234,0,0,0,0,1,37,0,0,0,123,43,0,0,21,128,64,0,0,0,0,0,0,2,119,33,0,131,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,11,3,3,4,144,0,22,1,13,12,15,11,0,17,0,7,0,18,94,232,0,9,46,16,118,3,567,240,0,0,0,0,1,0,0,3,202,249,332,79,429,101,1072,188,0,0,0,0,0,0,0,230,0,5,0,0,12,4,77,81,165,112,0,820,207,0,481,0,0,160,96,4,195,510,0,0,0,0,0,0,0,0,0,0,16,52,481,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1011,179,0,0,198,0,28,0,0,208,6,694,3,671,0,0,0,0,0,0,0,25,0,2,0,193,11204,2245,0,0,0,0,0,0,2671,1206,0,0,306,3067,13935,7492,666,2946,817,4056,23288,75,163,342,1,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,103,0,0,124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,0,0,0,34,0,5,9,0,0,89396,0,0,0,0,0,683,30776,0,0,0,0,0,0,0,0,0,0,0,0,120856 +"3252A0",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,179,1,4,32,0,0,0,0,0,9,11,0,52,2,297,5,0,0,0,0,26,0,0,0,0,1,1,0,0,0,0,0,5,0,0,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0,52,91560,0,0,0,0,0,2484,22574,0,0,0,0,0,0,0,0,0,0,0,0,116618 +"325310",756,5674,1229,825,784,1063,633,0,0,0,0,0,1562,0,476,0,0,0,0,6,0,0,0,2,154,566,319,201,489,158,722,130,252,103,728,188,0,0,0,0,3,11,0,0,0,0,0,1,0,0,13,5,4,5,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,2,1,5,0,2,3,6,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,4,0,0,13,94,17,11,508,1077,76,4,0,1,0,0,4091,28,8,23,79,0,0,419,19,9,9,3,12,0,7,9,1,0,0,0,0,0,0,0,0,0,856,8,0,0,0,0,25,0,0,0,0,1,0,3,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,221,15,0,0,0,0,0,0,0,0,0,0,5,0,0,60,124,0,0,0,7,3,0,2198,0,0,0,0,0,0,0,26,1,14,0,0,0,0,0,0,0,89,1,0,0,0,0,1,0,0,0,0,88,3,72,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,302,0,0,0,177,352,4196,0,0,555,33066,312,0,0,0,0,435,3495,0,0,0,0,0,0,0,0,0,0,0,0,37308 +"325320",1534,6460,1807,1727,621,2555,1214,537,208,248,0,11,550,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,16,0,0,0,9,0,0,194,0,0,0,0,0,0,0,0,17,1,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,11,14,17,1,0,4,0,0,0,0,0,0,0,0,0,3,0,4,0,5,94,0,0,0,401,363,988,0,0,0,19760,2501,0,0,0,0,265,3797,0,0,0,0,0,0,0,0,0,0,0,0,26323 +"325510",0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,6,0,0,0,4,69,0,0,0,77,211,1628,1083,588,688,1708,71,374,129,2041,924,0,58,19,85,49,0,0,0,59,115,0,0,0,0,2,14,1,0,0,0,0,0,0,0,0,0,75,44,135,2,199,197,16,100,332,47,0,289,0,939,0,0,0,0,0,1,172,260,150,51,0,0,0,0,9,140,60,63,0,0,148,0,0,0,0,119,87,217,28,0,0,0,54,85,0,0,0,0,0,0,0,0,0,178,88,0,0,0,0,0,0,0,0,0,0,59,58,601,70,32,57,0,0,0,16,0,0,0,250,2217,230,255,173,16,389,23,11,153,408,119,783,211,150,0,66,0,69,49,257,187,0,0,110,592,33,148,206,26,183,581,0,0,0,0,0,0,1,326,0,10,259,462,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,2,2,177,36,0,0,0,34,0,0,0,0,0,3,3,9,4,41,6,0,0,0,0,0,0,0,467,0,8,88,599,2,0,0,0,0,0,0,57,0,0,0,1,4,0,62,10,76,13,4,12,11,0,70,23,1,27,0,30,6,40,3,2,230,0,37,24,0,13,5,223,2,0,4,5,0,8,1,6,9,59,158,4,185,8,0,0,0,0,0,0,0,0,0,0,0,0,29,45,0,0,0,0,0,0,0,154,70,2,37,2,0,0,1,0,6,0,133,0,0,4,0,353,5,170,0,159,86,2,4,14,45,1,6,21,72,4,4,62,99,150,0,1,0,4,5,0,5,196,30,158,12,3,125,18,196,17,55,0,0,4,0,11,57,0,0,10,0,0,0,273,422,51,74,4,265,30796,4831,0,0,0,0,260,2909,0,0,0,0,0,0,0,0,0,0,0,0,38796 +"325520",0,0,0,0,0,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,418,120,15,54,318,1,111,109,413,164,74,976,465,8,1,25,0,0,0,0,0,46,0,0,73,4,6,8,0,1,0,0,6,1,0,0,0,0,0,1,0,1,0,0,45,0,0,0,0,18,0,0,0,0,1,50,0,0,0,0,0,0,0,1,9,0,0,0,0,0,0,0,0,0,0,107,0,0,0,0,0,0,3,0,0,0,0,0,4,2,2,16,10,250,9,0,0,0,0,0,0,0,1,0,2,0,0,0,0,0,0,0,8,3,1,0,0,0,13,2279,10,0,0,0,0,5,6,18,102,1,21,24,0,0,0,0,8,0,0,0,0,0,0,72,24,64,8,0,17,81,0,175,318,4,2,3,0,2,0,12,0,0,0,0,0,0,0,0,3,1,3,4,6,0,3,8,0,0,0,0,10,21,0,0,0,1,23,2,0,0,3,0,231,39,0,0,8,0,4,34,215,85,919,1471,78,228,33,354,2,6,0,0,25,8,0,39,93,433,36,16,0,6,0,0,0,50,15,236,152,4,0,549,295,51,50,12,123,0,41,15,3,0,0,5,3,2,0,0,9,3,0,0,0,5,1,3,10,1,0,2,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,36,0,0,9,10,7,2,0,0,1,0,1,0,32,0,26,0,0,2,0,4,0,0,4,1,0,0,4,0,0,0,0,0,0,285,3,1,7,0,0,0,0,0,1,0,7,5,0,65,0,4,5,31,0,0,4,5,6,0,0,0,0,0,0,0,7,5,0,0,0,4,0,0,3,2,0,0,0,3,0,19,0,0,0,0,0,0,0,184,101,0,0,0,14243,3105,0,0,0,0,105,2115,0,0,0,0,0,0,0,0,0,0,0,0,19567 +"325610",0,0,0,0,0,162,46,0,3,0,0,0,0,0,2,1,3,1,7,1,4,12,2,1,0,0,347,3,2,0,33,0,1,0,1,1,1,3,1,61,1,20,1,1,1,1,2,2,4,1,1,1,1,2,1,2,1,2,1,1,0,2,1,3,1,3,2,1,2,1,1,3,1,1,2,3,1,1,1,2,4,1,1,1,1,2,2,3,2,1,2,1,2,1,1,1,1,1,2,1,1,2,1,1,2,1,1,1,12,2,1,0,0,1,6,2,3,1,3,1,22,0,1,1,4,1,1,3,1,0,0,4,2,3,2,1,1,1,2,1,0,2,1,1,1,2,1,3,1,1,2,1,2,3,1,1,3,5,3,0,1,1,1,1,2,2,1,0,1,3,1,1,1,1,1,5,3,12,8,1,3,1,1,3,1,1,11,7,2,1,2,1,0,1,36,54,13,9,42,12,39,61,0,1,2,35,36,92,1,11,1,11,41,7,0,0,17,1,112,2,2,1,3,7,90,2,3,1,5,2,1,1,1,3,0,8,23,1,4,3,1,1,1,11,7,3,1,1,0,1,7,118,1,6,3690,607,1,96,51,2,1,5,5,8,10,1,1,4,5,12,10,3,15,10,168,3,19,1,0,25,24,8,0,9,21,11,1,13,0,0,0,3,0,0,8,1,0,1,1,1,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,20,110,5,37,7,23,3,7,3,6,12,8,25,7,64,5,28,3,18,14,17,7,33,1,9,68,5,8,445,1271,196,74,2,20,29,171,33,585,3,46,7,5,126,0,12,9,20,40,12,92,67,11,23,3,34,3,13,38,12,25,59,3,7,15,10,29,76,2,7,1,43,31,9,3,3,14,29,7,55,143,213,26,38,0,6,6,16,226,12,178,1,0,2,8,5,9,6,2,3,4,9,3,16,58,39,12,18,108,20,14,3,1,16,5,13,13,108,199,22,19,664,1,23,19,26,4,22,14,0,0,5,19,15,2,10,10,11,22,7,80,71,7,1,3,1,4,2,14,53,41,17,0,0,0,0,13,3,115,65,320,0,170,10,0,64,90,0,163,132,380,0,0,503,105,362,17,4,10,13,1,3,6,5,3,7,1,1,19,119,240,163,59,8,21,14,688,35,1064,36,14,2922,28,26,154,551,1103,196,154,78,122,4,277,4,68,84,183,350,493,7,2816,240,286,59,46,183,45,1371,20,3,63,8,18,5,58,27,11,93,9,44,4,0,12,5,33,5,22,3,4,6,149,0,58,6,157,2,2,116,1,594,10,10,7,13,441,195,0,0,0,41,107,5,17,126,0,42,57,10,96,0,12,59,0,0,0,583,7,0,0,0,264,23,108,13,13,850,205,29,468,100,142,648,208,43,45,89,715,10,39,171,2,12,153,0,9,26,21,97,41,15,167,101,87,102,459,119,6,35,13,28,0,0,0,1,0,21,61,18,13,3,22,0,70,2,47,25,9,1,0,174,7,67,113,0,877,1515,2,18,0,1035,3000,832,8,0,1,47130,4583,0,0,0,0,116,8052,0,0,0,0,0,0,0,0,0,0,0,0,59881 +"326110",0,5,13,2,22,5,0,0,0,0,0,0,2,0,19,0,0,0,0,0,0,0,0,0,13,45,118,14,85,61,873,6,115,108,172,71,48,20,44,39,0,554,0,0,0,0,0,3,0,0,77,6,191,0,0,2,37,0,18,15,33,0,0,1,31,85,101,69,34,20,0,25,92,66,54,81,0,95,0,0,0,77,0,0,61,54,23,191,45,1,644,3,289,14,14,40,19,26,0,1,13,60,12,45,124,40,8,0,114,0,15,3,3,17,54,9,356,12,71,1241,49,0,0,22,0,36,6,0,2,9,1,149,43,431,7,19,95,71,23,27,14,191,29,22,42,764,129,22,11,1,40,104,99,74,479,190,577,91,0,0,17,0,0,0,39,165,0,0,545,46,50,0,0,29,0,0,187,287,326,103,138,0,0,117,8,172,318,288,173,75,68,10,1,0,70,406,278,110,125,58,293,45,185,693,39,402,375,518,25,12,253,233,0,39,0,0,0,0,6,106,0,20,86,0,8,23,386,22,130,1152,177,525,56,1661,15,53,2,49,0,0,4,23,38,133,120,17,0,35,10,9,14,0,0,0,41,0,0,390,3281,464,439,200,531,618,3487,135,13,179,635,169,354,422,715,335,770,205,1090,141,0,111,740,85,49,160,398,84,268,144,0,1,0,16,0,0,61,133,74,2,3,1,11,31,16,0,0,0,150,14,0,18,0,0,0,0,0,0,0,0,65,0,1,0,0,2,28,7,102,5,2,11,0,0,67,70,10,11,50,6,10,0,25,41,26,87,3,2,33,0,4,78,49,0,0,12,31,29,2,63,7,8,1,15,0,0,3,40,9,0,1,0,1,1,3,9,7,7,75,53,4,2,12,22,14,48,0,2,3,5,0,8,0,11,194,0,0,0,406,1016,144,12,0,1,43624,6541,0,0,0,0,136,5185,0,0,0,0,0,0,0,0,0,0,0,0,55486 +"326120",0,100,0,0,0,15,0,92,0,0,0,11,0,0,0,4,0,0,0,48,81,1,0,0,69,75,1544,400,1239,266,1126,99,656,534,1561,555,0,0,7,298,0,1,0,0,0,0,0,0,0,0,9,2,0,0,0,0,20,0,0,0,0,0,0,0,3,8,0,58,0,0,0,4,18,76,3,0,0,20,0,0,0,7,0,0,0,13,1,15,18,1,61,0,25,4,1,4,0,9,0,0,0,89,2,9,35,0,1,0,15,0,0,0,42,1,0,0,42,0,0,138,30,0,0,0,0,0,1,0,0,2,5,14,5,57,2,2,11,6,2,2,1,20,9,1,9,192,4,0,0,0,5,11,12,11,67,10,111,9,0,0,0,0,0,0,239,17,0,0,63,0,0,0,0,0,0,0,22,38,42,0,10,0,0,10,1,16,40,68,0,0,0,0,0,0,0,15,0,0,3,10,20,0,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,0,10,0,8,0,20,0,0,101,23,22,5,416,0,38,13,0,0,0,19,0,166,1172,115,5,0,0,0,0,0,0,0,0,0,364,0,12,163,222,53,21,287,73,798,26,0,20,3,0,0,7,0,27,21,0,53,1,0,153,0,5,10,0,0,9,6,25,0,0,0,0,0,0,0,0,0,1,1,0,4,12,6,0,0,1501,1102,167,13,9,0,0,0,0,0,0,0,0,0,0,4,0,0,0,147,0,0,2,1,508,0,0,585,28,4,160,20,1,4,0,10,6,9,77,1,1,13,0,1,31,94,0,1,0,128,12,1,4,1,3,3,85,0,7,37,41,48,1,0,0,1,0,0,0,42,14,204,154,39,1,5,9,6,19,0,1,1,28,0,30,0,0,0,0,0,0,48,0,78,28,30,1529,22465,0,0,0,0,0,308,1528,0,0,0,0,0,0,0,0,0,0,0,0,24302 +"326130",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,5,0,0,0,0,0,0,0,0,0,0,6,2,0,0,0,0,0,0,0,0,0,0,0,24,2,5,0,5,0,0,0,2,7,206,13,0,30,13,0,36,14,5,3,9,6,9,12,61,0,1,46,0,17,4,0,0,0,0,0,0,0,7,13,37,48,13,0,0,1,0,0,0,0,0,0,0,0,3,16,98,70,0,58,0,0,0,0,0,0,2,0,20,4,38,0,1,8,4,8,4,1,14,0,0,4,71,2,0,0,0,7,5,12,6,39,8,32,5,6,0,8,0,0,0,47,12,0,0,44,353,4,8,67,9,85,184,15,69,59,18,7,10,0,7,1,11,27,45,0,0,0,0,0,0,0,2,0,0,2,1,14,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,78,0,4,9,0,1,7,0,3,0,13,0,0,62,15,16,4,1,3,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,12,42,39,108,15,44,53,722,11,0,10,4,8,0,0,0,14,140,0,76,5,0,3,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43,65,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,74,0,0,0,0,108,0,0,183,0,0,11,0,0,0,0,0,0,0,0,0,0,38,0,24,14,0,0,1,0,0,0,0,0,0,0,0,288,0,1,0,0,0,0,0,0,0,0,0,0,4,9,25,76,14,0,0,174,119,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,9,5152,0,0,0,0,0,13,17,0,0,0,0,0,0,0,0,0,0,0,0,5182 +"326140",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,5,322,55,612,0,343,247,77,113,388,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,2,7,0,0,0,0,4,0,0,0,0,0,0,0,3,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,13,154,2,1,1,0,0,2,3,0,0,0,7,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,9,0,0,0,0,0,0,0,0,3,0,0,0,0,4,0,1,13,0,7,2,9,44,5,0,0,0,0,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,8,0,0,0,0,0,0,0,0,0,23,0,0,0,0,1,0,0,73,168,75,123,0,6,11,0,173,0,0,14,0,0,0,9,7,0,13,6,0,3,233,58,93,63,135,225,667,69,535,47,0,42,126,57,25,76,63,25,101,58,0,1,0,0,0,0,101,3,2,0,0,0,3,6,2,0,0,36,121,19,0,6,0,0,0,0,0,0,0,0,0,0,1,0,0,1,4,0,0,1,0,301,0,0,346,17,2,107,15,10,1,0,3,8,0,105,0,0,6,0,0,253,12,0,1,0,31,73,0,136,5,258,73,196,66,10,8,0,1,2,5,0,7,2,16,3,25,3,261,3143,84,0,4,6,0,10,0,0,0,0,0,19,0,1,3,0,0,0,0,28,12,4,0,131,12071,1721,3,0,0,0,144,3,0,0,0,0,0,0,0,0,0,0,0,0,13944 +"326150",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,707,80,22,93,652,50,111,216,71,105,0,0,0,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,15,0,0,0,0,7,0,0,0,0,0,0,0,5,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,7,0,0,0,0,0,0,0,0,0,1,12,0,0,1,1,0,7,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,68,421,5,7,1,0,0,5,3,1,968,0,8,3,0,0,0,0,0,0,0,0,0,0,0,0,547,62,30,71,38,101,1572,7,39,0,8,0,0,0,0,0,0,6,0,0,0,0,0,0,0,25,0,4,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,0,0,0,7,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,3,0,0,0,0,0,0,0,0,0,0,0,0,0,194,0,160,10,0,6,158,43,79,94,150,87,194,35,209,27,0,30,93,21,16,29,6,19,54,52,0,0,0,0,0,0,32,9,4,0,1,0,1,6,3,0,0,0,25,143,4,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,154,0,0,0,0,54,0,3,61,15,0,122,104,10,0,0,4,8,0,56,0,0,11,0,0,131,20,0,10,0,2453,277,64,44,4,288,51,342,694,64,7,3,19,0,0,3,0,0,0,0,14,41,441,1580,356,0,5,5,267,9,0,0,0,0,0,47,0,1,4,0,0,0,0,0,6,97,0,0,16258,1540,137,0,232,0,153,6,0,0,0,0,0,0,0,0,0,0,0,0,18325 +"326160",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,0,1,60,0,0,182,276,358,91,0,0,2,0,0,1331,1208,1,2348,65,4393,0,0,69,0,0,0,0,0,0,0,0,0,0,0,0,52,0,0,0,0,0,0,8,0,0,155,0,4,0,0,17,0,0,2,112,14,40,0,159,196,272,683,1427,0,171,0,0,0,0,0,26,0,0,0,0,0,0,0,0,0,11,89,0,3,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,5,18,9,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,96,0,0,0,0,4,16,12,182,3,1,4,0,0,2,40,6,14,27,4,5,0,14,0,12,50,2,1,19,0,2,43,27,0,0,0,25,14,1,66,1,5,0,2,0,0,0,22,5,0,0,0,0,1,0,0,0,5,5,29,2,1,7,13,8,26,0,1,2,0,0,4,0,0,0,0,0,0,0,0,88,3,0,1,14847,0,0,0,0,0,49,651,0,0,0,0,0,0,0,0,0,0,0,0,15547 +"326190",32,33,0,0,354,31,0,0,0,0,21,17,43,57,65,6,50,31,88,24,708,26,0,0,664,413,6329,2250,2081,778,4101,266,974,817,6209,768,1,3,5,741,6,7,0,33,40,340,0,11,5,0,4,27,80,44,0,0,1,14,0,6,10,8,3,0,18,44,14,8,12,7,5,17,37,23,16,32,201,50,5,0,135,17,408,95,220,211,9,75,13,5,188,73,651,28,225,15,18,30,2,0,0,1399,278,1116,19,139,0,0,177,2,1,1,62,2,45,54,4,41,176,3,61,25,24,18,18,205,0,270,24,112,1,97,116,460,19,9,1,9,261,24,2,10,0,6,408,1109,228,149,210,4,131,282,911,810,381,1196,1778,243,1846,2,913,32,0,3,146,0,0,4,1,237,91,57,70,71,71,270,7,1002,314,129,677,84,3,9,7,24,953,110,6,34,3,16,32,33,18,122,34,26,82,81,493,45,426,139,10,46,55,956,2371,56,1079,787,675,13,1,1,22,2,2,3,7,0,0,0,23,0,87,4,142,18,2,18,5,534,0,59,8,1,193,0,1,8,38,74,911,10,46,479,78,163,0,52,1081,46,961,2197,0,277,56,8,0,17,11,3,5470,79,4,169,4138,515,375,1540,1301,712,1576,281,2672,314,0,1636,1081,398,530,315,831,327,585,592,0,4,0,644,32,79,81,2934,299,8,102,11,67,68,46,0,1,267,880,1105,42,152,135,0,13,21,92,3,0,3,246,0,7,5,39,293,172,42,476,32,6,1344,16,33,1581,154,32,1281,152,436,17,6,109,35,74,1065,17,7,120,16,96,336,152,22,304,41,3147,390,102,366,112,1010,1012,2570,828,159,335,362,247,1,9,1,7,7,9,44,121,93,667,1399,158,2718,93,157,106,114,0,19,227,79,33,151,0,2,149,0,1,30,1232,2773,294,271,42,1091,131125,20451,0,0,0,0,1028,12900,0,0,0,0,0,0,0,0,0,0,0,0,165504 +"326210",108,380,56,58,64,153,350,0,12,69,0,1,3,8,249,68,496,87,29,4,7,0,0,0,75,2746,120,1587,368,5,434,4,24,11,239,48,5,0,71,39,0,0,0,2,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,554,315,391,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,3664,283,50,691,0,132,0,0,1,0,0,1,0,0,0,0,0,0,0,1,0,81,0,807,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,2,0,0,0,0,0,18,12,0,0,10,1,0,28,3,0,4,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,254,0,0,2,1,1,13,38,0,137,5,39,3,0,89,62,17,34,3,63,5,173,22,477,0,0,573,1,0,2,1,11,2,0,0,10,1,5,0,0,0,17,102,0,1,9,0,29,38,19,3,0,0,0,0,0,0,0,262,23,0,0,0,0,2,0,0,124,1,0,39,15,2,0,4,2,11,11,162,8,2,30,0,45,30,119,5,0,329,2,0,1,0,0,33,0,15,19,0,275,0,94,0,0,0,0,0,0,1,1,9,55,65,13,33,0,349,4,1,0,0,12,38,87,22,0,969,250,0,0,0,125,41,343,303,30,3,22219,37019,0,0,0,0,96,4179,0,0,0,0,0,0,0,0,0,0,0,0,63512 +"326220",9,37,5,4,3,5,34,0,0,6,0,0,0,0,351,0,0,84,20,0,0,15,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,61,0,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,4,9,51,0,0,0,252,0,0,0,27,419,198,345,46,0,0,0,0,1,0,55,11,0,0,0,0,360,0,0,125,2,11,906,0,0,0,14,0,0,0,0,0,0,0,0,0,0,4,2,0,0,0,0,0,0,0,0,0,0,0,22,173,0,0,0,0,0,0,0,0,0,0,152,974,83,328,0,0,0,39,56,5,0,55,892,34,0,0,0,0,0,36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,129,0,0,0,0,0,0,286,0,0,0,0,0,0,7,0,0,0,9,0,0,0,0,0,0,0,126,0,0,170,0,0,0,0,0,0,147,0,0,10,8,10,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,63,0,0,0,0,0,20,0,0,0,0,0,0,0,1,6,0,0,36,0,0,0,0,0,0,0,0,0,0,0,771,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,8,0,0,0,0,0,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,84,0,128,8,0,0,0,0,0,0,0,0,48,0,0,0,0,326,88,136,0,0,0,9052,1389,0,0,0,0,98,2423,0,0,0,0,0,0,0,0,0,0,0,0,12963 +"326290",0,0,0,0,0,0,0,0,0,0,0,10,0,0,69,0,0,82,16,0,0,0,0,0,0,0,361,10,205,0,84,0,0,0,197,998,0,0,0,6,4,4,2,0,9,71,2,6,0,0,10,6,0,0,0,0,0,0,0,0,0,63,0,0,0,0,0,0,0,0,0,14,26,19,0,0,0,77,0,0,0,9,660,7,622,8,0,35,2,0,50,2,0,2,2,6,5,4,31,1,3,74,10,65,30,1,1,0,18,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,0,0,0,0,0,0,0,0,0,0,227,524,215,200,91,14,544,129,0,220,264,0,1307,189,0,14,0,0,31,37,75,72,0,0,147,0,26,1,0,0,0,176,199,40,240,0,0,0,0,0,0,5,0,26,0,0,0,0,0,0,0,43,0,0,0,25,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,0,43,0,0,0,31,0,0,0,0,0,0,0,0,193,0,0,3,0,0,0,0,0,0,0,43,0,0,0,0,0,0,0,0,0,0,148,0,0,0,0,0,0,20,0,0,664,316,1921,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,101,208,10,1,29,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,176,0,0,412,0,0,836,0,8,0,0,0,30,0,12,0,0,0,0,2,0,19,0,3,0,0,28,8,6,86,124,121,442,121,14,0,0,0,0,0,1,0,0,0,0,0,15,0,31,7,752,2,11,49,25,0,0,300,27,0,2,0,1099,404,0,0,0,9,1464,1484,48,2,142,21295,3585,423,0,59,0,231,2510,0,0,0,0,0,60,0,0,0,0,0,0,28164 +"423100",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,38,0,39,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,0,0,0,0,0,351,994,205,29,6,0,10,371,169,53,33,113,109,162,0,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,9,9,0,127,1285,9,22,30,536,108,50,94,9,39,0,132,0,0,46,0,0,0,0,0,0,109,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5480,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,1,0,0,0,4,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,1,0,0,6,2,2,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,1,2,1,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,42,0,0,0,0,0,0,0,0,0,9,0,36,0,25,0,0,0,0,0,35,1,0,1,1,0,0,0,0,0,0,0,20,0,0,0,0,1,9,71,23,182,0,4,9,0,0,4,5,1,0,164,87,110,90,31,32,5,114,0,0,0,0,0,71,165,31,263,977,103,11,0,10,0,1,12,109,168,22,388,2,1,154,121,114,60,9,4,0,43,1,1,1,306,375,433,243,512,75,105,80,740,0,0,245,63,0,61,17,10,21,512,43,0,0,0,0,0,0,0,0,0,9,12,87,29,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,1,0,0,0,8166,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8166 +"425000",0,1,4,19,1,8,1001,131,7,171,0,0,2,4,9,1,1,0,0,0,0,30,1167,0,0,0,0,0,0,0,0,0,0,0,0,0,6,1,1,4,1,8,1,1,0,1,1,1,5,0,1,1,100,5,0,0,25,2,2,2,11,0,1,5,0,11,11,18,1,1,0,2,2,0,7,0,1,9,1,1,9,10,0,0,10,2,1,18,0,0,2,3,7,2,1,2,1,2,2,2,3,7,4,8,11,0,1,1,7,2,0,0,0,0,0,0,1,1,3,15,0,0,0,0,0,0,4,1,10,0,2,80,3,0,8,6,13,14,12,0,16,33,3,24,3,181,48,1,1,0,11,16,5,3,3,4,4,4,0,0,0,0,0,0,0,1,4,0,0,1,18,5,2,5,6,30,2,10,191,0,0,0,1,8,0,0,0,12,1,3,0,0,0,0,0,96,227,0,21,16,9,5,11,7,4,10,176,113,0,0,1,1,0,0,0,0,4,0,4,11,2,7,1,1,0,0,42,14,43,14,1,10,2,2,0,4,0,0,0,0,1,0,2,11,48,0,2,20,0,8,0,2,7,0,10,21,0,6,20,20,2,2,4,1,58,1,1,5,502,1421,1299,677,1351,195,389,240,2278,13,0,325,180,0,216,159,38,78,5427,221,74,0,0,1,0,5,0,0,0,8,13,66,10,26,11,0,0,0,1750,251,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,764,7971,1840,0,0,0,59,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,43,0,28,0,29,0,0,0,38,2,0,23,4,24,0,0,0,0,0,0,0,0,0,0,33,0,12,0,1,2,0,2,10,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33050,0,0,0,0,0,0,2385,0,0,0,0,0,0,0,0,0,0,0,0,35435 +"4200ID",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,1,20,2,7,2,12,22,6,13,33,12,31,10,0,28,9,29,3,4,13,9,7,0,1,5,42,8,9,13,0,12,2,21,4,0,0,0,0,0,0,0,0,1,33,2,0,4,1,4,11,1,12,0,0,0,8,1,0,0,0,3,0,2,0,5,4,0,9,13,17,0,14,3,0,16,19,11,19,18,67,31,20,11,29,33,0,0,31,28,6,3,0,0,51,9,5,14,8,10,47,13,23,73,5,0,6,16,21,0,2,30,27,7,29,5,3,0,0,0,10,3,10,7,3,37,2,45,53,6,147,26,4,5,9,20,16,38,9,13,1,6,2,7,5,1,0,8,2,1,7,14,16,111,11,7,3,1,223,3,97,18,4,3,0,2,1,24,143,62,7,1,2,8,0,4,2,12,6,10,0,0,16,85,8,1,84,13,5,206,14,6,19,3276,709,1079,1114,1644,344,637,31,1362,125,0,275,67,93,56,33,29,37,190,52,322,25,224,3552,48,3,1560,59,518,55,98,145,35,310,164,53,9,24,164,454,225,1646,416,0,2988,4142,3193,361,0,37,119,804,0,18,14885,558,767,135,67,1266,429,3321,1090,1342,1554,957,297,590,481,123,94,130,271,547,2827,927,226,172,693,439,453,272,593,38,773,188,2081,259,201,258,64,214,87,361,304,55,453,115,138,19,41,9,92,9,19,122,95,244,734,1054,259,61,22,60,15,145,0,25,92,0,415,177,0,5851,4138,308,11,61,952,980,2178,11,3,72,98387,129785,0,0,0,0,0,42609,0,0,0,0,0,0,0,0,0,0,0,0,270780 +"482000",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,105,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,4,1066,0,4,0,0,0,85,0,0,0,0,0,0,0,5,5,0,232,0,0,0,0,0,2,0,3,47,0,0,6,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,2,0,3,0,0,2,0,0,0,0,1191,118,887,0,0,0,0,118,0,0,0,3826,22027,0,0,0,0,0,4858,0,0,0,0,0,0,0,0,0,0,0,0,30710 +"484000",0,11,6,9,0,9,13,0,64,22,0,0,0,0,0,0,0,0,0,39,87,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,12,18,25,0,25,7,28,10,14,0,0,0,0,0,0,40,0,0,0,21,0,0,0,27,0,5,9,17,15,40,42,5,5,7,13,10,42,32,28,5,19,6,4,6,15,10,2,8,10,4,25,3,1,11,3,17,0,7,8,5,4,5,0,2,11,3,8,14,0,4,0,17,6,0,0,0,2,3,1,5,2,4,7,13,1,2,1,27,4,1,2,0,1,0,0,0,0,0,13,0,17,0,0,0,0,0,23,3,16,0,0,0,0,0,14,10,10,13,9,8,4,15,26,11,19,9,0,12,0,0,0,0,18,23,9,12,0,13,0,0,40,43,8,5,16,10,18,1,5,23,36,0,0,0,0,0,0,0,0,8,12,0,0,7,0,11,25,3,19,5,0,0,0,0,7,35,0,15,0,0,8,7,6,0,3,7,6,0,4,41,22,82,26,10,6,6,44,4,163,20,9,14,0,0,0,22,45,23,0,2,20,2,1,0,0,8,0,8,8,0,14,28,9,0,7,7,8,102,16,0,21,314,316,587,266,731,425,396,108,828,137,0,2058,1019,721,208,97,856,648,1978,604,876,128,77,10714,97,6,3341,125,1143,20,23,43,14,6,29,3,0,0,0,0,2,135,77,0,0,0,0,0,0,0,6,4,0,0,0,25,57,5,135,74,15,46,18,76,17,677,17,139,67,6,1,1,33,5,37,2,27,2,74,39,4,32,38,0,0,20,54,11,4,27,8,11,12,201,7,13,47,0,34,3,1,1,1,17,0,0,3,14,48,46,41,25,7,10,7,27,0,6,25,0,20,16,0,3910,69,962,0,0,121,5,60,0,0,12,39328,11700,0,0,0,0,0,1629,0,0,0,0,0,0,0,0,0,0,0,0,52658 +"485000",0,0,0,0,0,0,0,0,0,0,0,1,0,0,2,0,0,1,0,3,80,157,619,1,6,1,98,12,60,12,88,7,20,4,89,27,9,6,7,12,1,13,2,28,1,9,1,1,3,1,4,4,24,5,1,0,4,1,2,2,5,6,3,3,6,3,24,14,2,3,2,4,4,22,15,13,0,6,0,2,0,3,6,1,4,10,3,9,2,0,7,2,8,1,1,4,2,2,0,0,1,12,2,2,4,0,3,0,6,1,0,0,0,0,0,0,0,0,0,9,1,0,1,0,1,3,0,3,0,0,0,2,0,0,0,0,1,0,0,0,1,1,0,2,4,3,0,4,1,0,4,5,4,5,5,19,9,6,3,8,9,0,0,8,7,2,1,0,0,13,3,1,4,2,3,13,3,6,33,1,0,1,4,6,0,0,8,7,2,8,2,1,0,0,0,2,1,2,2,1,10,0,12,14,2,38,7,2,1,2,5,4,10,3,4,0,2,0,1,1,0,0,2,0,0,2,4,5,29,3,2,1,0,57,1,25,5,1,1,0,0,0,6,39,17,2,0,3,2,0,1,0,3,2,3,1,0,4,22,1,0,22,4,1,54,4,2,5,144,130,130,102,174,25,200,0,259,1,0,109,4,21,26,0,18,1,50,0,1,270,0,0,0,1,167,0,4,12,23,34,7,117,40,14,2,6,52,468,63,713,101,0,1131,1610,865,145,797,344,49,217,0,20,5094,337,208,41,0,552,176,1338,338,445,586,1456,106,257,177,30,25,33,138,184,1144,116,313,46,190,198,120,149,154,179,209,56,1217,67,52,69,16,58,26,1848,490,14,111,29,30,5,31,2,2113,0,18,13,26,91,274,396,69,12,5,15,4,38,0,7,22,0,150,61,0,27,5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76,7,20,29,12,4,12,0,7,27,7,0,0,49,0,0,0,0,0,0,0,0,0,6,0,20,0,0,0,0,0,4,6,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,323,0,20,0,0,0,0,109,0,0,0,41,0,5,33,50,0,0,0,14,8,8,0,7,0,0,0,3,45,0,209,0,0,0,0,0,11,10,14,0,0,0,0,0,15,0,27,0,0,16,0,36,225,26,0,0,92,346,0,626,120,29,40,0,0,0,5,0,89,31,0,0,0,0,11,0,6,8,4,0,0,21,42,31,0,19,76,17,145,148,0,11,1822,1593,2879,1641,3517,1382,1365,270,4599,400,0,1099,437,160,742,297,156,294,1637,907,23545,1023,3684,29523,453,244,15747,9414,4144,81,94,175,58,25,124,15,0,2,25,89,12,563,325,0,11,12,9,2,0,0,1,0,0,0,0,102,539,34,9,215,59,186,56,210,86,412,39,2599,257,33,21,44,92,607,116,28,22,7,295,68,24,87,1332,0,0,90,216,40,30,109,34,40,29,829,28,60,194,4,143,17,30,7,15,142,24,295,185,46,90,108,7,54,12,14,3,47,0,8,87,5,82,52,0,3,239,854,243,0,51,15,235,61,0,2721,143680,11399,0,0,0,0,0,685,0,0,0,0,0,0,0,0,0,0,0,0,155764 +"492000",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,2360,3672,6272,3666,7175,3610,3456,679,7925,818,0,1124,1086,360,658,622,345,725,4143,1173,1,1,564,15114,381,14,231,1234,1444,206,240,448,149,64,319,39,0,0,3,0,23,1387,845,0,430,470,2879,427,0,8,59,0,0,0,0,263,642,84,1569,532,149,465,58,543,223,1469,102,286,636,92,54,38,157,6,295,52,54,18,757,171,62,220,243,10,28,240,549,102,77,231,86,82,74,2113,71,153,522,11,480,44,13,20,43,179,7,13,39,52,228,274,19,47,32,37,10,121,0,20,197,122,231,144,0,3,0,11,0,6,86,39,244,0,0,211,93464,6456,0,0,0,0,0,9411,0,0,0,0,0,0,0,0,0,0,0,0,109331 +"493000",164,54,70,82,29,96,18,27,83,118,0,0,0,4,12,0,2,110,0,0,0,663,65,45,0,0,0,0,0,0,0,0,0,0,0,0,188,229,235,318,179,469,92,356,130,178,74,55,62,28,80,35,14,8,2,5,7,4,5,4,9,13,8,15,30,26,72,75,8,10,12,23,18,76,58,50,9,36,10,7,13,28,29,6,19,27,11,61,8,2,37,7,45,8,18,20,12,19,11,4,5,29,8,21,35,4,9,4,42,15,0,1,2,14,21,5,38,14,31,53,95,5,14,8,189,26,10,17,3,4,1,8,2,11,3,7,7,9,3,0,9,3,1,14,2,13,3,3,0,0,4,11,8,8,10,7,6,6,19,32,13,23,14,7,14,5,4,1,2,16,20,7,11,0,11,26,13,82,86,17,9,33,19,36,2,10,47,85,42,47,102,30,15,0,0,159,110,161,71,35,91,23,146,315,44,251,118,99,20,50,52,92,463,278,193,68,0,95,283,100,52,42,115,82,5,55,536,280,1054,310,121,83,82,699,47,587,74,39,108,86,109,70,283,593,292,84,25,264,29,14,54,25,100,53,110,101,29,238,367,195,49,100,94,101,1314,213,58,266,1884,2941,4595,1830,4086,2460,2241,919,4236,1279,0,7813,5744,4171,970,379,4259,3334,9383,3009,72,1,736,5383,199,47,379,513,6810,87,93,189,56,86,125,13,73,66,168,40,20,738,308,1,0,0,0,0,0,0,19,0,0,2,142,101,231,81,131,215,61,176,23,193,98,264,35,146,192,28,15,5,50,10,7908,1237,438,193,1001,358,553,279,263,20,113,77,198,84,54,157,42,65,38,1064,88,87,184,53,127,40,9,31,23,97,12,21,58,572,346,291,331,115,30,43,42,112,2,28,104,0,76,64,0,305,1288,0,0,0,1174,1409,2707,34,0,69,128203,251,0,0,0,0,0,166,0,0,0,0,0,0,0,0,0,0,0,0,128619 +"511110",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,3,12,4,8,3,70,28,2,599,1,334,0,0,0,1,0,1,5,7,31,30,40,8,3,0,3,0,14,0,11,40,7,37,3,0,0,31,0,0,0,50,16,12,0,0,0,5488,11101,0,124,0,0,58,1236,0,0,0,0,0,0,0,0,0,0,0,0,18007 +"511130",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,7,10,32,0,14,0,4,22,0,0,3,4,0,4,3,1,0,4,0,1,0,12,0,0,480,3,16,0,0,1045,0,7,0,0,0,0,5,25,0,14,0,5,25,25,17,4,0,0,0,0,0,0,292,18,11,0,0,417,12,13,2,77,23,0,0,84,5,0,0,17,0,72,0,5,6,3,11,0,0,8,0,3,3,232,184,6,8,1369,0,19,6,79,12,0,216,0,131,0,0,0,0,0,0,0,0,22,0,13,0,3,0,0,0,0,0,6,34,44,30,8,0,0,656,0,0,4,5164,72,112,0,0,0,11338,26230,0,9627,0,0,-46,2598,0,0,0,0,0,0,0,0,0,0,0,0,49747 +"5111A0",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,108,91,62,34,50,52,31,0,36,13,0,10,5,7,0,2,3,0,127,1,0,0,0,5,0,0,42,0,0,14,7,27,530,0,7,3,0,0,0,0,0,9,229,0,0,5,107,21,28,93,3,0,0,0,0,0,0,0,710,41,4,0,11,24,14,148,10,26,54,9,1,0,13,122,12,0,17,0,58,22,0,45,0,15,0,47,26,6,3,62,0,10,18,92,3,0,90,0,31,0,0,0,1,13,0,0,3,2,7,21,0,2,0,0,0,3,0,0,178,17,21,21,0,58,219,0,0,35,380,134,132,0,0,3,4762,14288,0,372,0,0,19,339,0,0,0,0,0,0,0,0,0,0,0,0,19779 +"511200",0,17,10,9,5,5,4,3,6,2,0,0,0,14,0,0,0,0,1,3,5,143,114,0,12,42,114,27,44,29,178,39,32,49,91,58,2,5,2,6,0,0,0,0,0,0,0,0,0,0,0,0,4,2,0,0,1,1,1,1,1,1,3,4,2,7,5,4,3,2,0,3,2,4,4,1,2,3,1,1,14,1,2,0,4,2,0,5,0,0,6,0,5,0,0,0,0,0,3,0,0,2,0,3,3,0,0,0,4,3,7,11,19,0,3,0,1,1,1,8,5,0,1,0,1,3,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,0,0,3,0,186,34,11,15,1,2,7,0,0,0,0,2,2,0,1,0,0,5,1,5,8,0,1,0,1,2,0,0,0,5,0,0,0,0,0,0,0,0,1,2,0,0,0,0,0,1,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,4,1,0,0,0,26,0,5,0,0,0,0,0,0,0,6,4,0,0,22,0,3,0,0,0,0,1,2,0,1,0,0,0,0,0,0,7,0,0,0,103,478,677,408,583,58,122,33,240,17,0,428,35,208,77,48,39,36,189,84,14,55,0,11,8,0,17,0,98,36,36,77,19,43780,22,0,10,19,174,287,123,1234,472,0,415,519,406,368,276,57,119,75,0,0,407,13,21,3,6,942,119,704,138,84,1842,269,657,1175,64,11,27,4,206,225,887,217,89,95,205,180,127,97,17,20,86,282,189,18,14,55,4,13,10,1070,62,8,177,19,59,0,4,4,12,9,8,19,20,82,25,24,0,37,10,18,0,28,0,6,23,39,36,52,0,0,373,3,0,0,716,779,1378,10,0,252,69119,79659,0,114869,0,0,175,40953,0,0,4058,0,0,0,5266,0,0,0,10584,0,324683 +"512100",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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0,0,0,0,0,22500 +"517110",41,50,7,29,42,59,115,80,101,31,3,1,9,118,16,1,10,34,22,103,315,922,63,88,45,100,444,194,237,93,567,84,150,146,385,162,85,38,47,72,46,145,30,108,17,27,30,28,35,35,29,44,73,15,6,2,11,5,6,7,11,30,15,17,23,34,107,97,17,18,7,31,23,107,79,56,25,50,4,9,22,29,44,8,61,30,8,86,14,5,88,15,60,17,46,25,24,35,27,7,13,38,21,34,52,9,19,8,47,40,0,1,5,0,55,1,20,0,12,58,88,1,2,1,5,7,1,9,0,0,3,8,0,3,0,3,10,11,2,0,4,5,0,26,1,1,1,8,2,0,4,4,7,28,11,21,55,5,305,133,45,25,13,25,41,5,3,7,2,28,7,2,5,4,5,42,9,43,50,20,7,34,25,24,3,10,46,51,8,6,4,2,3,3,3,20,7,22,6,10,42,5,47,64,14,140,12,14,4,16,25,25,30,6,19,10,7,1,7,4,3,5,10,3,4,3,8,8,144,14,7,4,4,320,10,41,6,6,2,3,13,3,20,51,14,4,20,71,8,33,17,6,17,11,8,9,2,45,36,28,10,10,11,11,109,16,9,20,289,439,679,566,860,461,519,85,967,116,0,950,304,243,459,407,434,378,619,574,305,0,60,429,625,81,441,133,283,88,91,188,40,640,352,106,242,140,22720,15390,6867,1456,3369,5,1405,2439,951,931,124,1611,331,615,0,38,3007,163,485,59,50,1423,347,662,122,327,914,606,244,347,410,114,44,81,484,809,882,1089,364,160,648,371,398,213,332,39,431,526,772,136,370,862,102,230,112,1033,359,198,180,215,41,56,58,113,86,51,44,99,323,591,1002,1109,248,260,106,124,105,333,14,49,404,164,247,291,0,868,1196,1246,52,274,14004,15473,8669,97,83,568,151832,201552,7351,0,0,0,0,7503,0,0,0,0,0,0,0,0,0,0,0,0,368238 +"517210",32,52,10,14,15,9,86,4,31,21,1,0,0,69,6,7,3,13,13,17,112,473,75,17,38,93,459,146,301,171,622,91,181,135,368,236,22,10,19,21,4,23,3,48,4,16,0,1,7,1,4,5,34,9,1,0,7,1,3,4,7,11,4,4,12,9,48,41,3,4,3,8,7,55,33,28,2,18,2,4,3,11,4,0,4,13,0,26,6,3,26,3,8,3,13,9,5,12,4,1,2,1,2,10,16,0,4,2,13,7,0,0,2,0,21,0,7,0,2,18,5,0,2,0,3,5,1,6,0,0,0,12,0,0,0,4,14,4,3,0,6,7,0,10,4,6,1,12,4,0,8,10,11,10,16,27,22,13,80,43,24,11,19,16,18,8,4,0,2,25,11,4,9,6,9,33,14,16,24,4,1,11,5,10,0,1,18,14,8,10,4,1,0,0,2,16,6,10,5,5,17,3,19,29,7,62,15,13,4,19,12,13,19,7,21,10,9,1,5,3,2,4,9,2,2,2,6,7,58,9,3,2,2,154,5,15,4,2,2,0,4,1,8,23,5,1,2,27,3,9,3,1,5,3,6,6,1,19,11,9,3,3,5,3,50,1,3,8,410,686,957,857,993,425,490,85,975,166,0,995,425,213,421,400,406,364,782,588,294,15,27,605,186,1,359,47,166,56,63,162,34,789,118,16,70,61,101,7065,876,1558,298,4,1359,6418,943,757,0,158,404,315,0,7,3050,144,387,57,67,1619,233,847,122,345,1093,1086,258,471,338,118,53,99,371,936,1851,1285,276,203,973,559,607,231,300,75,709,454,1346,236,451,266,100,279,117,923,452,140,213,171,103,30,43,88,97,22,35,295,218,538,870,1096,188,328,9,22,134,460,19,44,393,83,304,299,0,4223,5296,88,2,34,3233,2579,14963,22,20,160,100487,122323,0,0,0,0,0,4702,0,0,0,0,0,0,0,0,0,0,0,0,227512 +"517A00",7,7,3,5,8,34,24,17,20,2,0,1,2,15,0,0,2,2,9,6,37,240,19,12,12,22,119,32,56,15,139,25,31,23,91,30,0,2,11,0,13,27,6,18,9,12,6,4,10,4,4,7,0,7,0,0,7,3,4,4,5,0,2,3,8,4,5,5,2,2,2,3,2,7,14,16,7,9,1,1,5,7,0,0,7,9,0,15,0,0,10,0,11,0,0,0,0,0,3,0,0,6,0,4,13,0,6,0,8,0,0,0,2,0,9,0,2,0,3,4,3,0,0,0,2,2,0,1,0,0,1,0,0,1,0,0,0,3,0,0,7,5,0,0,5,23,4,9,0,0,6,25,15,19,29,27,0,20,17,8,0,20,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,13,4,0,0,0,0,6,0,0,7,5,14,14,8,3,1,3,2,10,17,15,19,14,20,2,2,3,3,7,18,35,2,2,12,11,34,35,16,3,53,3,7,4,3,3,8,1,1,3,7,8,20,10,4,3,4,25,4,2,24,7,12,8,17,1,10,6,32,4,3,7,3,5,4,2,10,4,18,11,1,28,16,10,4,3,3,5,14,4,3,9,82,242,237,164,169,72,78,13,163,32,0,180,63,41,59,57,62,39,160,20,72,88,4,122,48,18,131,1,41,5,6,25,3,291,26,10,26,16,97,1185,552,326,694,2,303,772,277,278,52,3,56,35,0,9,745,15,134,74,2,285,85,232,40,78,209,157,51,76,68,2,1,14,32,229,291,257,54,143,111,111,56,17,379,8,73,84,223,42,48,169,10,42,11,334,77,4,28,12,5,0,2,1,12,1,1,28,24,99,105,122,7,55,32,42,3,47,1,8,22,88,24,58,0,195,260,34,24,135,608,291,1266,447,18,261,19476,13485,0,0,0,0,0,727,0,0,0,0,0,0,0,0,0,0,0,0,33689 +"518200",0,0,0,0,0,0,0,0,0,0,0,0,0,35,1,0,4,2,2,3,9,4379,169,0,24,6,406,156,113,5,340,76,141,82,231,102,129,75,86,123,30,173,29,291,19,95,12,13,36,12,47,44,154,78,6,1,47,11,36,29,64,87,32,40,69,48,307,178,26,36,30,51,52,40,194,141,20,87,14,24,26,47,86,38,150,29,50,160,39,6,157,37,98,22,32,43,45,44,29,4,22,130,41,73,89,11,45,10,112,44,0,1,2,1,20,1,11,5,6,55,41,1,9,1,24,20,2,16,1,1,6,54,15,17,3,13,23,36,18,2,27,27,23,58,7,22,0,33,11,0,47,43,32,51,51,40,75,69,1275,284,126,113,14,63,132,22,10,1,0,144,48,15,45,26,39,155,34,98,174,19,12,31,34,47,3,8,97,116,27,24,20,12,0,1,4,39,26,50,32,15,106,9,138,128,21,215,89,22,18,4,71,64,76,26,35,20,14,10,21,22,6,4,28,9,3,2,72,68,387,54,26,20,7,273,10,81,51,15,17,2,5,5,71,92,25,25,6,153,34,21,12,1,21,16,24,18,2,50,102,28,7,51,21,13,137,27,13,35,22,389,551,421,581,239,352,81,695,134,0,4010,1092,596,959,670,1320,703,2751,1001,601,0,0,108,112,20,490,306,173,105,65,142,100,1535,76,0,71,137,1121,2174,120,2492,1025,1,23869,9085,2205,1799,149,615,378,2448,0,1,1021,75,130,47,13,3057,384,2256,179,498,1666,1894,123,2257,406,63,14,43,510,746,11350,1669,840,573,1411,4480,1593,477,1058,0,176,366,494,27,32,257,14,33,6,1898,93,38,112,57,195,33,114,25,321,25,85,191,274,594,1193,4402,319,270,75,46,62,507,0,25,219,447,1729,460,0,1303,3730,2,37,355,1260,7845,14163,34,23,1616,171347,31753,0,35440,0,0,0,1370,0,0,1781,0,0,0,2310,0,0,0,4545,0,248546 +"519130",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,2,0,0,497,242,619,65,87,182,77,171,134,3,0,0,6,0,0,29,0,0,31,33,234,28,133,30,3,0,0,96,389,50,361,7664,0,0,0,0,0,196,1012,29,809,0,3,50,58,62,33,272,1188,55,168,153,382,448,1934,431,285,534,72,99,26,2087,602,1011,393,592,64,1579,630,378,1054,202,211,474,3395,549,57,27,16,16,40,15,775,119,21,294,14,107,18,118,31,163,19,11,99,479,263,884,1014,204,48,25,46,8,10,0,41,3423,115,54,117,0,0,0,0,0,0,378,141,679,31,87,747,43440,10416,0,0,0,0,0,3877,0,0,0,0,0,0,0,0,0,0,0,0,57732 +"5191A0",0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,2,11,97,3,0,0,0,1,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,20,11,5,10,4,3,0,12,2,0,20,4,3,8,4,8,4,22,3,1,0,0,7,0,0,28,0,3,1239,115,2,0,45,1,0,4,0,0,0,19,39,133,0,123,46,103,23,5,0,7,0,0,0,149,1,11,1,28,15,7,8,3,3,53,150,5,216,3,0,0,0,6,5,17,2,4,1,10,8,2,3,0,0,1,0,8,2,3,2,0,2,1,11,2,0,1,1,0,0,0,2,3,0,0,41,1,7,4,4,1,4,7,7,2,2,0,2,0,63,83,38,0,284,7,1,21,111,361,249,955,0,0,12,5231,4546,0,0,0,0,0,829,0,0,0,0,0,0,0,0,0,0,0,0,10606 +"522A00",16,16,11,11,2,53,8,5,19,27,0,8,12,167,63,3,13,33,50,93,148,569,94,14,15,1,111,102,89,34,204,15,38,5,159,49,40,17,12,33,36,58,10,42,3,15,8,7,7,1,6,13,52,23,6,16,20,19,5,17,11,36,8,7,13,22,40,23,12,21,6,8,12,26,33,14,0,30,4,7,34,9,19,7,17,6,5,29,9,1,21,10,10,9,8,9,17,13,15,9,2,38,7,31,15,2,19,7,13,8,0,0,1,0,0,0,0,1,11,13,0,0,2,2,1,5,5,7,21,0,2,12,9,29,7,6,30,1,3,0,7,13,3,9,8,90,35,20,21,0,17,24,10,34,44,19,32,29,13,17,28,0,0,23,30,7,2,0,2,22,18,6,24,12,11,50,12,14,22,3,38,8,12,8,1,4,19,35,29,15,16,4,6,1,5,123,15,9,6,17,38,13,31,28,10,85,24,54,11,34,23,28,23,51,50,28,33,2,14,10,3,3,11,6,3,6,14,15,67,19,12,13,2,137,1,99,15,11,16,0,20,3,22,37,42,20,31,14,17,32,17,15,12,13,19,29,11,31,44,15,5,22,13,7,114,14,4,19,2273,2665,3774,3328,5079,478,2464,703,3853,410,0,1600,1533,1660,539,921,1471,1282,1238,1540,171,5211,199,177,2911,6,393,27,112,13,14,33,7,57,134,15,0,0,28,137,206,127,59,0,20299,23862,10361,12652,0,6,0,331,72720,2255,11226,950,516,237,5223,926,88,193,424,1492,177,1065,277,120,532,18,9,17,588,15539,426,197,761,26,249,712,38,391,22,36,913,262,665,86,41,384,14,61,51,1391,180,123,185,8,102,18,56,1,98,37,21,506,285,2505,1113,1480,1542,231,4,108,15,262,0,81,142,1663,1568,6334,0,0,0,181,110,430,1650,1424,7598,0,17,2927,275096,42387,0,0,0,0,0,29227,0,0,0,0,0,0,0,0,0,0,0,0,346710 +"52A000",263,198,170,294,182,279,308,510,249,218,79,47,129,1370,237,57,77,147,142,153,377,7021,3368,213,90,198,936,276,429,571,1508,156,344,655,1020,599,137,92,94,109,55,159,32,162,27,57,32,20,22,15,27,21,261,82,23,14,94,41,75,45,53,62,34,59,48,49,221,186,33,38,50,42,39,189,159,117,27,116,26,28,61,61,113,21,120,76,18,138,23,6,96,21,155,34,34,30,40,48,59,16,21,160,41,87,131,15,35,13,110,55,125,14,65,27,102,22,182,45,109,199,154,8,29,25,45,59,31,49,19,6,5,77,20,92,19,49,100,49,38,3,47,71,12,70,76,626,54,46,31,2,57,122,59,114,181,95,146,68,489,341,86,81,75,53,77,26,29,19,20,66,63,14,27,19,32,100,59,346,305,57,55,57,71,96,4,29,143,241,86,83,48,18,13,27,27,158,87,99,115,75,146,30,152,349,43,187,97,165,39,66,68,82,107,101,60,64,367,24,66,34,39,17,41,102,32,29,163,138,425,106,30,55,23,611,22,1083,45,28,47,312,76,33,179,656,490,73,78,824,65,139,92,69,133,73,211,229,21,229,241,118,23,56,64,59,609,102,27,114,1597,2210,1996,1485,2084,1240,1488,1147,2409,1094,0,4343,1305,1647,739,458,689,509,1294,904,1010,1303,865,1786,1900,852,1073,480,251,371,308,553,137,3430,2093,192,1048,3655,6720,4976,939,1498,1411,31,21290,34451,20424,6021,114,915,198,3842,26085,1136,70435,697,837,278,5116,1623,736,2910,421,1228,2430,2529,514,2085,772,220,94,259,683,9851,3664,878,400,160,531,395,259,279,1046,52,261,845,2214,247,118,1224,89,231,148,4189,563,207,526,262,308,112,143,194,236,79,135,477,458,4314,1368,1441,486,331,61,181,78,353,2941,95,276,281,117,2049,0,0,2172,21,669,23,0,0,4623,10,49,308,373110,236363,0,0,0,0,0,30778,0,0,0,0,0,0,0,0,0,0,0,0,640251 +"523900",4,6,2,2,2,2,2,1,3,2,0,0,1,1507,928,18,88,143,161,335,5596,50,17,1,2,0,14,3,10,3,10,5,8,1,12,8,3,1,1,1,0,3,0,3,0,1,0,0,0,0,0,0,4,1,0,0,1,0,0,1,1,1,0,0,0,1,2,2,0,0,0,0,1,2,2,1,0,1,0,0,0,1,1,0,0,0,0,1,0,0,1,0,1,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,1,1,1,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,0,0,2,0,1,1,0,0,0,1,0,0,0,1,1,1,1,1,0,0,0,0,1,1,1,0,0,2,0,2,2,0,4,1,0,1,0,1,1,1,1,0,0,0,0,1,0,0,0,0,0,0,0,1,1,4,1,0,0,0,5,0,8,1,0,0,0,0,0,1,2,2,0,0,0,1,0,0,0,0,0,0,0,0,0,3,1,0,0,1,0,9,1,0,1,79,93,89,67,71,5,30,2,64,5,0,7,15,18,6,7,14,6,15,9,149,200,0,43,57,1,12,2,2,2,2,5,1,6,5,0,0,0,5,21,1,12,3,0,12970,11425,5275,3074,2,15,4,78077,0,2,945,11,7,2,1577,40,8,85,10,237,41,19,9,187,13,3,1,2,14,292,41,9,8,3,9,10,4,7,7,3,5,8,80,10,7,15,2,38,19,5051,26,9,412,91,828,3,1,0,2,5,1,1,9,16,101,54,8,3,2,4,1,12,0,3,4,1277,522,166,0,0,4,2,0,0,1,0,17172,0,0,2173,152813,177895,0,0,0,0,0,58535,0,0,0,0,0,0,0,0,0,0,0,0,389244 +"523A00",0,37,4,4,0,20,4,137,3,1,0,6,7,24,15,1,1,1,2,12,26,432,123,4,17,2,125,67,130,20,220,18,66,14,304,101,1,0,0,7,0,9,1,12,0,5,2,1,1,0,2,1,384,117,27,17,129,20,46,77,100,117,21,37,32,60,251,190,38,45,35,44,57,172,193,104,7,135,14,28,24,61,96,48,45,44,40,150,20,3,126,28,90,19,26,35,41,39,34,5,16,128,36,90,105,4,31,9,88,38,0,0,0,0,0,0,0,0,7,55,4,0,5,2,10,15,13,17,1,0,5,54,6,13,7,5,23,6,17,3,26,42,4,50,21,68,49,75,68,1,89,65,113,160,183,79,144,120,71,96,99,3,30,124,75,41,22,0,6,71,79,19,43,38,31,240,34,114,159,22,30,26,55,48,3,13,63,162,1,1,1,1,0,0,0,2,1,1,1,2,7,1,9,4,1,18,2,0,0,0,1,2,4,2,1,0,0,0,1,0,0,0,1,0,0,0,0,1,2,0,0,0,0,18,0,6,5,2,1,0,0,0,2,1,7,0,0,0,1,0,1,0,1,1,0,0,0,1,11,3,1,0,3,0,21,1,1,2,429,244,394,52,286,12,255,4,366,8,0,78,183,418,42,64,139,90,68,89,1414,141,733,265,1469,39,1107,11,23,15,18,199,6,58,26,209,0,55,24,67,2,69,10,0,4212,8139,13850,4842,2510,0,18,18628,1,0,5071,73,119,8,75,466,91,144,117,380,125,337,83,28,118,8,4,7,202,6764,91,143,171,30,80,155,36,94,23,21,825,125,398,94,60,154,24,69,47,883,195,31,148,3,17,1,9,0,687,0,5,21,26,3526,403,383,2980,14,4,20,3,4,0,10,15,1501,19,342,0,0,0,1,10,0,2347,0,486,4,0,162,102108,47331,0,0,0,0,0,13343,0,0,0,0,0,0,0,0,0,0,0,0,162782 +"524113",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,90314,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,90314 +"5241XX",183,278,275,441,297,1022,314,62,247,264,0,445,135,1698,27,49,30,11,227,824,2322,732,74,53,1,19,289,13,13,8,18,6,3,5,18,10,2,4,1,20,53,67,22,50,6,15,17,13,15,4,18,21,12,25,10,22,23,16,3,15,2,42,6,9,13,12,4,9,18,11,15,8,13,10,33,10,1,14,5,8,61,16,18,4,30,7,3,13,14,7,21,2,12,13,2,2,21,27,28,15,12,44,18,37,11,21,15,15,15,9,0,0,2,0,0,0,1,4,18,19,0,1,4,7,0,7,8,12,31,1,5,16,13,49,12,9,67,24,8,1,32,22,6,12,51,168,38,28,29,0,20,46,13,42,62,27,35,72,8,19,43,53,116,21,282,442,1,0,11,2,21,11,15,18,1,55,20,9,12,2,54,12,25,7,1,10,4,48,41,17,19,6,10,0,12,214,16,29,8,25,26,23,17,6,9,32,30,89,11,63,26,27,14,90,86,51,70,2,23,13,2,9,20,10,6,4,7,5,4,20,11,16,4,58,5,3,10,15,62,51,39,19,27,36,43,40,46,27,20,46,44,47,19,29,46,70,16,54,53,9,4,28,12,11,18,25,13,20,4382,5036,5428,3866,4440,5824,3373,2570,4376,2021,0,2961,1016,1301,764,427,1104,296,1219,762,612,11,766,13080,1536,206,1249,442,1582,101,54,88,16,209,512,32,2,0,166,48,606,387,358,0,1731,642,6137,1261,5182,45267,408,382,7200,164,56005,2063,1165,427,3664,3544,668,1235,360,2384,2997,999,589,893,362,113,94,0,625,166,1082,2440,348,188,315,358,585,450,1215,54,92,700,8348,407,710,904,234,664,830,13707,2551,484,6069,365,2754,129,133,92,244,1184,102,239,879,1364,2801,3034,707,439,54,181,66,680,9,86,463,6,512,965,0,0,807,2,37,99,802,1884,513,61,42,3014,303702,308251,0,0,5033,0,0,19554,0,0,0,0,0,0,0,0,0,0,0,0,636540 +"524200",72,70,50,92,32,278,46,25,79,123,5,10,57,88,74,71,76,31,204,45,197,1143,114,139,0,0,50,39,0,0,0,0,0,0,0,0,34,54,14,70,135,180,41,52,12,43,28,30,34,12,52,60,33,75,24,51,55,47,26,33,32,121,34,39,24,34,36,24,54,30,17,23,40,31,89,30,20,45,16,25,138,23,36,63,58,13,35,56,43,6,72,21,26,44,40,38,57,75,64,34,24,166,29,110,29,45,51,33,33,26,0,0,4,0,0,0,1,4,48,59,3,0,7,13,4,20,25,37,69,2,12,45,44,148,26,23,169,24,36,8,28,54,13,29,27,388,109,84,87,2,63,104,38,127,186,74,88,115,22,52,117,0,0,58,17,27,18,0,33,26,66,30,48,46,28,147,57,28,32,23,122,36,44,21,4,23,36,132,92,51,53,18,24,0,25,465,50,23,23,73,77,71,50,18,27,95,91,201,33,139,81,58,41,265,254,116,139,4,86,51,13,21,52,31,14,44,19,53,36,58,31,45,10,24,9,26,64,39,151,0,115,43,77,103,123,117,104,60,59,130,79,79,56,67,98,159,47,200,151,102,62,80,35,24,51,36,31,57,122,200,258,209,661,300,199,802,804,327,0,1137,484,403,575,612,156,649,714,1407,68,30,94,39,4543,26,1939,50,1045,20,13,60,44,0,567,139,8,0,0,108,1264,125,124,2,2616,119,2288,23,11342,146788,134293,12700,0,5,436,110,286,466,434,188,139,234,102,338,200,476,235,280,119,340,199,18,140,193,52,298,67,46,639,69,207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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,467675,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,467675 +"531ORE",543,2115,211,131,89,581,728,472,38,119,13,4,3,965,11,1,19,54,75,189,557,5832,1430,221,223,552,1828,999,1305,499,4085,407,731,444,1400,808,58,88,191,255,69,298,22,179,52,126,13,20,90,15,31,40,44,101,10,13,56,18,29,36,46,83,64,77,169,93,582,669,50,76,68,67,124,836,562,426,42,145,20,73,73,212,49,9,36,63,70,259,31,36,85,53,156,59,118,100,78,111,92,17,24,49,56,114,142,4,59,27,181,47,1255,74,132,158,251,72,781,104,269,82,170,16,62,44,77,38,16,74,13,4,3,168,16,48,18,35,61,50,66,4,32,18,4,115,152,82,29,88,30,10,31,256,208,87,73,102,511,79,506,207,205,176,106,47,163,80,23,73,26,222,147,68,88,68,104,293,103,240,175,28,35,44,142,160,16,29,363,277,49,62,41,23,8,5,5,437,143,155,73,51,76,31,41,160,53,651,379,184,86,55,145,188,313,353,228,105,129,18,70,73,49,85,150,102,22,2,74,50,944,201,66,75,83,1645,98,8,89,29,15,22,14,29,157,143,97,27,240,1856,203,274,59,22,43,65,205,319,19,173,243,139,40,120,115,229,1271,37,29,135,7238,5325,9458,8234,14646,5306,5960,1559,14194,2411,0,17886,21785,15886,8192,15696,8785,24772,10992,24974,222,150,784,6001,1932,162,4906,1856,8687,221,552,993,213,4964,3297,243,666,845,3690,13221,2646,5450,3195,97,7817,19112,16823,5139,1011,14943,4586,692,10984,97,171613,3529,1853,1553,1768,22404,3290,4180,990,7294,10207,8799,1428,14487,4842,1173,1040,1038,4073,32165,10537,7619,2455,779,3584,2013,1739,1685,2510,2556,26009,3522,23279,5644,7180,7980,932,3959,1319,62547,20839,6391,6707,9214,2945,3064,487,818,4571,2594,782,578,15057,2388,18485,26683,3719,5217,529,1045,1300,11045,430,1559,10480,16067,1507,2140,0,224,9970,417,6,70,13177,1035,8839,55,701,1857,1119061,5861,0,0,129878,33104,0,3274,0,0,0,0,0,0,0,0,0,0,0,0,1291178 +"532100",98,108,132,86,4,116,175,109,57,36,0,0,1,16,5,0,1,3,6,10,68,492,53,21,4,11,48,13,26,18,30,11,20,14,23,59,19,22,14,21,5,21,18,47,11,24,14,1,4,6,5,12,55,12,5,2,17,10,5,7,8,10,7,6,7,8,56,39,4,7,5,6,6,44,46,23,7,12,4,4,7,9,9,1,12,11,0,17,1,0,9,1,12,2,6,7,4,7,6,1,1,6,2,9,20,1,2,1,8,8,0,0,1,0,2,0,6,2,1,10,8,0,0,0,0,3,0,0,0,1,0,4,0,7,0,4,4,3,2,0,2,3,0,4,1,5,1,6,2,3933,3,17,10,11,30,24,26,9,38,25,18,14,50,4,28,9,2,3,4,9,19,2,4,3,5,13,9,9,8,2,0,3,2,3,0,0,10,7,9,10,10,5,2,3,1,30,22,41,17,14,36,3,20,40,6,56,35,26,6,5,13,31,24,20,16,9,11,1,3,1,2,2,2,520,1017,7,35,30,79,11,3,3,2,121,3,215,42,11,15,27,18,2,44,122,75,5,7,25,1,7,17,15,7,6,17,12,1,23,20,14,2,7,9,6,83,10,2,14,394,299,256,585,1211,93,766,328,1758,149,0,343,196,267,430,273,205,95,291,186,1,1,688,2949,644,17,638,69,2989,21,28,36,2,140,92,0,3,6,1766,1149,30,513,18,0,660,1292,691,133,1,74,186,26,3975,460,453,837,2106,186,1603,666,84,107,97,273,827,218,63,759,66,52,23,31,184,1133,329,1038,89,140,186,100,318,303,1257,29,46,30,752,19,36,217,181,82,155,1801,239,57,72,83,57,157,114,127,152,44,53,146,281,469,187,180,78,193,47,224,57,337,8,71,260,15,34,140,0,217,146,0,17,93,57,72,404,0,5,129,59731,78600,0,0,0,0,0,2192,0,0,0,0,0,0,0,0,0,0,0,0,140524 +"532400",106,631,140,93,132,253,183,112,58,36,25,0,74,2245,698,57,146,475,482,1277,2287,1397,265,18,332,922,4600,1031,1905,705,3642,962,1839,1709,1662,3591,29,21,22,26,10,38,28,71,17,36,22,3,7,10,8,18,82,19,4,4,27,15,8,12,12,14,10,10,10,15,84,59,7,11,7,9,7,66,69,35,8,19,6,6,14,13,13,3,18,17,1,29,4,1,16,3,19,6,10,11,7,15,9,3,4,9,6,16,30,2,4,2,13,13,0,0,1,0,4,0,9,3,2,15,12,0,1,0,0,5,0,1,0,0,1,6,0,19,1,7,8,5,3,0,3,5,0,11,2,8,4,10,6,0,5,26,16,16,48,35,40,17,57,38,28,21,114,10,42,14,5,9,10,14,45,3,5,5,8,21,13,15,12,5,1,5,6,5,0,3,15,14,14,16,16,7,4,4,4,69,34,64,27,22,56,9,30,63,10,86,58,41,10,13,20,35,37,34,26,24,33,2,9,4,3,5,8,1,1,17,53,45,118,17,5,8,6,180,7,323,63,17,28,42,28,3,68,181,113,12,12,39,3,11,32,22,11,10,27,19,2,39,34,23,6,10,14,10,123,16,6,21,232,170,146,283,707,54,445,191,1026,81,0,251,119,115,214,156,116,55,172,114,12293,5841,5720,3414,276,35,1852,142,2378,13,17,22,2,83,694,0,703,1402,1226,769,24,409,2992,0,398,792,416,80,0,1946,112,15,0,0,289,505,1296,4,35,398,48,49,56,166,491,131,39,449,2049,32,14,19,111,681,173,629,53,83,113,59,191,183,759,7,22,25,667,17,32,195,161,151,141,1785,214,55,67,69,38,95,69,77,90,26,31,1107,168,292,116,103,87,119,28,137,35,210,5,43,156,1,17,85,0,1,5,0,10,72,32,2866,174,0,3,134,106880,441,0,0,0,0,0,3883,0,0,0,0,0,0,0,0,0,0,0,0,111204 +"532A00",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,3,2,3,3,2,6,3,8,2,4,2,2,1,1,1,2,9,2,0,0,3,2,1,1,1,1,1,1,1,1,10,7,1,1,1,0,1,7,8,4,0,2,1,1,1,2,1,0,2,2,0,3,0,0,1,0,2,0,1,1,1,1,1,0,0,1,1,1,4,0,0,0,1,1,0,0,0,0,0,0,1,0,0,2,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,1,1,0,0,0,0,0,1,0,1,0,1,1,0,1,3,2,2,5,4,4,2,6,4,3,2,11,1,5,2,0,0,0,2,5,0,1,0,1,2,1,2,1,0,0,1,1,1,0,0,2,1,2,2,2,1,0,0,0,7,4,7,3,2,6,1,3,7,1,9,6,5,1,2,2,4,4,3,3,0,3,0,1,0,0,0,0,0,0,2,6,5,13,2,0,1,1,20,1,36,7,2,2,5,3,0,7,20,13,1,1,4,0,1,3,2,1,1,3,2,0,4,4,2,0,1,1,1,14,2,1,2,34,26,22,43,101,8,64,28,149,13,0,36,16,50,32,23,17,8,24,15,0,9,0,1558,0,6,225,530,439,2,2,3,0,11,81,0,2,6,177,105,2,40,1,0,55,109,58,11,0,273,16,0,0,0,37,70,177,16,135,147,7,7,42,88,72,86,24,64,43,4,2,3,62,1133,48,1469,62,12,27,65,27,79,104,393,584,2,63,2,3,16,15,7,13,148,20,5,6,6,3,19,8,11,13,4,4,12,24,39,15,14,6,17,4,19,5,29,0,6,22,0,2,12,0,0,0,0,0,0,778,1153,175,0,0,26,12770,18051,0,0,0,0,0,920,0,0,0,0,0,0,0,0,0,0,0,0,31741 +"533000",4,23,14,12,6,8,0,0,0,0,0,0,8,85,216,11,7,17,28,77,610,536,27,19,5,1,81,51,41,16,107,51,25,91,73,81,6,2,14,10,7,51,10,72,3,27,2,3,7,2,10,9,73,21,5,2,22,3,13,13,19,25,10,16,28,31,134,87,17,20,17,20,26,79,89,51,3,55,6,12,9,28,48,23,20,18,19,65,10,3,79,15,50,9,13,16,15,18,19,2,8,65,18,42,48,6,15,3,44,16,0,0,0,0,0,0,1,1,14,213,15,0,16,6,26,55,9,63,0,1,3,52,3,9,5,1,20,0,16,3,19,35,2,52,13,52,18,54,35,1,76,39,79,125,141,58,103,86,56,69,73,2,15,84,92,34,19,0,5,12,3,2,7,1,1,10,4,85,133,16,17,18,43,37,2,7,46,122,25,13,14,3,3,1,3,22,14,21,11,12,48,6,56,43,12,123,26,17,8,0,26,30,280,167,151,0,48,4,13,8,0,0,0,11,2,16,27,42,141,28,11,24,2,121,1,160,25,8,5,40,31,31,174,487,459,88,0,35,149,21,60,14,95,73,70,0,13,151,44,19,3,3,10,7,219,8,5,16,1634,1154,1612,821,1476,707,1847,113,3635,1,0,296,640,2228,1652,193,255,361,634,346,280,29,3,842,0,0,50,0,60,95,396,361,64,433,4,59,594,95,244,635,539,2941,174,0,682,555,3181,75,14,989,42,0,0,0,1345,74,260,163,2209,810,669,1094,491,879,734,2905,196,1389,509,67,25,24,685,12661,765,191,102,175,206,418,131,116,280,16,432,79,695,44,108,72,13,32,19,247,0,1,82,14,55,1,76,0,601,1,5,98,87,984,2578,3732,398,21,2,4,0,116,0,6,12,1,1,14,0,0,97,9,0,15,663,4,11,0,0,251,85211,0,0,0,0,0,0,73049,0,0,0,0,0,0,0,0,0,0,0,0,158260 +"541100",18,79,34,30,6,30,43,30,77,34,1,1,101,582,122,22,144,60,98,245,162,6652,783,94,103,73,899,250,553,260,1094,472,397,211,696,682,130,23,119,75,33,117,7,161,7,91,3,5,10,3,7,7,205,21,3,2,20,9,11,10,117,18,21,35,83,72,245,210,26,35,35,64,50,233,165,147,25,149,27,21,20,81,80,9,67,36,104,174,45,35,131,14,128,18,40,54,41,74,50,7,19,105,13,72,116,6,36,8,125,44,1276,76,135,169,269,77,819,115,289,137,233,21,71,56,189,65,23,91,14,6,2,41,15,30,14,20,27,37,10,4,13,18,3,45,166,280,29,41,23,10,33,265,229,143,77,132,557,91,565,323,209,256,118,58,95,23,29,72,27,96,22,43,11,7,24,80,14,438,446,31,34,105,67,119,21,12,117,199,16,19,15,9,3,3,5,90,26,100,23,34,76,6,120,158,18,158,42,21,15,23,32,50,42,14,38,14,63,6,21,48,13,20,16,63,5,11,204,150,83,134,47,48,48,302,17,384,36,42,33,27,14,31,224,380,138,32,243,2074,215,277,36,20,54,15,81,146,4,120,89,15,5,12,12,13,716,82,7,115,575,2496,3599,1647,2257,1649,1389,391,2956,317,0,668,674,679,386,573,361,313,2131,547,612,907,153,217,204,48,439,200,328,169,193,318,43,3961,435,141,297,353,1288,1407,365,2083,2525,97,4260,2315,7855,2682,2209,9242,1666,2781,1983,3,13358,284,225,68,188,2930,1470,2029,483,922,1928,2844,359,7662,295,181,24,140,659,10566,3721,1672,750,162,1123,470,389,289,487,11,107,326,2411,376,635,534,182,343,1336,15327,1317,311,177,210,183,240,163,966,700,165,89,1002,476,1280,981,959,251,408,222,184,155,532,9,121,481,358,430,1564,0,0,115,76,0,0,1858,2432,7141,6,0,1187,217452,104093,0,0,22342,0,0,14209,0,0,0,0,0,0,0,0,0,0,0,0,358096 +"541511",0,0,0,0,0,0,0,0,0,0,0,0,0,2220,0,497,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,0,0,0,0,0,0,0,614,0,0,0,0,0,0,167,22,0,0,0,0,167,597,57,0,32,0,0,0,19,108,174,131,0,0,0,0,0,0,0,0,0,0,145,119,0,0,1,1,1,0,3,2,9,10,58,3,30,19,33,88,3,92,6,2,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,174,12,0,0,0,0,0,99,258,265,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,86,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,139,0,0,0,452,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,161,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,708,789,2777,1,0,0,20,0,0,0,0,0,0,787,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12200,0,0,224926,0,0,0,11016,0,0,7374,0,0,0,21084,0,0,0,8235,0,284835 +"541512",1,84,51,47,23,29,19,12,27,12,2,2,22,232,7,17,17,8,8,33,67,1080,413,71,68,236,506,123,272,146,420,216,203,180,392,332,81,35,33,51,14,82,16,89,7,42,6,7,15,5,14,14,104,29,6,1,27,4,19,16,23,31,10,14,18,25,99,70,14,13,9,18,20,71,88,40,5,58,11,10,85,26,42,12,47,20,13,73,17,2,90,15,59,12,18,25,19,26,41,2,10,57,15,46,42,6,16,9,51,40,0,1,1,1,33,0,15,7,4,81,59,0,9,1,4,11,5,11,0,0,0,18,0,1,0,5,15,7,7,0,11,10,0,20,13,40,8,32,13,0,25,33,35,62,51,36,51,46,2163,417,143,179,26,52,91,23,8,7,7,41,34,8,20,18,19,105,28,66,98,16,18,22,30,31,4,7,50,97,30,18,16,8,4,2,7,50,27,42,46,22,57,7,61,55,18,147,33,27,12,26,40,37,52,32,27,0,61,8,22,14,8,9,20,4,3,16,48,33,127,29,12,17,9,293,8,63,13,7,8,5,25,8,11,49,24,7,10,61,15,35,5,2,17,8,19,25,1,16,76,39,14,4,23,16,293,19,16,40,794,1754,2379,1332,2168,545,1153,316,2282,155,0,3307,707,1081,604,584,713,436,1282,674,331,1091,13,426,134,4,104,0,238,190,140,367,65,2614,262,16,88,139,1208,1823,172,3807,1698,1,1832,2921,3442,3972,1044,3205,1013,1264,725,1,2803,96,153,58,18,2329,514,2224,590,671,333,1254,516,1404,546,78,24,18,685,1809,2869,667,545,1372,1960,1184,944,754,357,27,27,536,1281,192,158,593,34,146,107,2663,459,106,289,147,372,31,50,48,111,48,80,420,222,785,936,2199,283,394,122,216,80,236,5,96,300,264,214,556,0,2427,11139,27,0,0,4527,5685,14264,56,6,4354,155614,0,37753,0,0,0,0,11216,0,3669,0,0,0,0,0,0,0,2338,0,0,210591 +"54151A",1,48,29,27,13,16,12,7,16,7,1,1,6,31,1,0,3,1,2,4,9,572,306,24,41,127,291,71,158,111,235,115,105,106,257,198,9,2,3,3,1,6,1,10,1,3,0,0,1,0,1,1,11,2,1,0,2,0,1,1,2,3,1,1,1,1,10,7,1,1,1,1,1,7,8,4,0,5,0,1,8,2,4,1,4,2,1,7,0,0,8,1,6,1,1,1,2,1,3,0,0,6,2,4,5,0,1,0,5,3,0,0,0,0,2,0,1,0,1,7,4,0,1,0,1,2,1,1,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,2,1,2,0,2,1,0,3,1,3,6,4,2,5,4,149,29,11,12,1,5,7,1,1,0,0,4,3,0,2,1,1,9,1,7,10,1,1,1,2,3,0,0,3,9,2,1,1,0,0,0,0,2,2,4,1,1,6,1,7,6,1,16,2,1,1,0,3,3,3,2,2,0,0,0,1,1,1,0,1,0,0,1,4,3,13,3,1,1,0,30,0,4,3,1,0,0,0,0,2,3,2,0,0,4,2,2,0,0,1,1,1,2,0,1,3,3,0,0,1,1,5,1,1,3,233,1137,1623,943,1387,169,377,107,751,42,0,1181,150,590,213,147,143,120,477,248,90,130,3,146,34,1,122,0,63,111,98,233,49,747,77,5,24,43,399,702,252,2495,1015,1,1113,8322,910,884,711,676,268,373,149,0,834,25,49,20,5,2013,607,1796,217,177,344,1550,162,1282,144,32,14,9,287,359,1968,504,210,251,475,416,311,223,90,42,173,719,830,66,54,168,11,51,39,1690,237,36,156,56,169,10,15,11,40,21,21,129,57,205,152,415,52,106,34,56,23,92,2,25,77,109,92,121,0,1551,220,3,24,50,426,1053,1240,13,15,335,59606,0,0,0,0,0,0,8269,0,0,0,0,0,0,0,0,0,0,0,0,67875 +"541200",124,190,85,82,60,89,372,73,168,66,2,18,56,239,90,9,53,60,77,27,52,2065,1224,283,60,61,620,175,366,136,565,270,224,115,488,430,101,41,56,69,18,77,11,88,11,47,6,7,13,2,12,8,78,29,4,1,26,3,11,17,28,19,8,14,26,27,87,74,10,12,10,17,17,79,74,60,12,33,8,8,12,25,29,10,12,12,12,58,8,9,30,11,32,9,9,25,11,15,8,2,11,27,8,20,35,23,18,4,39,9,0,0,0,2,3,1,4,4,9,23,9,4,3,4,16,6,3,5,9,1,1,27,0,48,1,9,15,15,6,0,13,7,3,34,4,20,3,17,9,1,18,15,26,33,34,26,29,23,21,29,22,17,215,41,26,16,4,3,4,73,42,14,24,9,26,81,16,47,78,13,4,15,16,26,1,4,52,56,14,17,15,3,3,1,7,66,24,48,13,12,66,21,67,63,16,156,33,11,13,4,27,45,53,90,53,29,3,10,26,15,9,7,18,6,1,15,43,34,151,33,15,16,10,165,3,303,39,32,28,7,22,3,22,67,49,12,2,24,4,2,26,28,16,8,31,27,3,76,58,33,6,17,19,17,191,32,8,31,488,1946,3343,2871,2927,875,1666,350,3159,394,0,2872,1646,769,669,716,842,503,1059,1091,242,431,106,1301,250,12,546,72,437,113,196,319,47,1039,323,106,178,335,1261,2694,360,467,1051,1,1547,2216,4852,995,1794,6529,2220,2169,367,1,5689,299,331,154,213,2280,832,1471,232,4793,1974,2229,493,2273,283,422,105,382,745,5727,3845,809,1649,176,920,562,438,432,452,24,141,461,3341,531,659,568,196,466,312,8209,1633,524,334,451,309,365,117,933,365,151,61,742,632,1159,1367,1069,356,902,282,684,525,1539,14,115,627,206,621,899,0,0,9,28,178,38,1798,3195,4122,87,125,1711,161458,17900,0,0,0,0,0,2679,0,0,0,0,0,0,0,0,0,0,0,0,182037 +"541300",3,0,0,0,0,3,0,0,0,2,10,4,407,1115,556,40,28,232,244,160,1118,1136,1020,579,457,1273,4655,1845,3896,1383,8453,732,2331,2453,5801,3151,99,118,72,187,47,118,62,119,8,78,16,8,24,16,23,67,481,60,6,1,44,29,22,24,41,55,14,36,15,60,204,221,20,37,20,36,30,111,93,38,5,82,7,14,30,41,144,34,62,52,40,93,27,17,78,20,33,9,12,16,22,30,37,6,21,61,20,27,78,3,18,10,56,34,542,32,57,68,108,31,338,45,117,108,84,7,33,21,43,36,11,57,4,2,2,60,9,11,8,7,18,11,20,3,23,35,2,68,66,110,22,93,21,5,131,131,134,123,59,68,253,99,61,173,206,90,41,160,498,14,55,32,15,42,20,9,19,33,19,78,26,147,138,43,23,27,41,23,8,19,41,125,105,89,54,10,10,5,14,94,43,55,78,77,76,36,47,132,85,203,80,85,60,3,131,93,103,13,67,1,27,6,52,26,5,11,24,32,8,35,165,225,362,69,23,25,9,569,14,417,54,18,20,52,34,42,165,560,217,85,103,807,108,120,38,22,23,62,52,65,8,64,144,70,19,27,41,56,457,31,42,100,0,382,600,1362,934,6866,960,145,1250,67,0,314,167,501,225,148,125,187,585,240,279,1239,2,230,35,177,209,3,299,13,43,65,14,730,159,11,52,38,1640,9708,413,767,334,20,96,19,12,1089,3,235,241,1383,2336,4,30588,69,211,8,1063,498,697,9201,132,373,16150,1095,3886,7298,57,229,40,160,132,3338,603,1581,424,960,289,464,523,253,747,56,976,120,1142,39,273,157,206,65,60,1434,419,20,366,38,141,24,26,2,36,16,64,132,399,428,268,817,204,20,1,30,2,66,0,16,126,320,132,107,0,34647,3637,9,520,54,5346,2845,19266,1960,681,10656,266697,0,51774,0,3058,0,0,33253,0,0,0,0,0,0,0,0,0,0,0,0,354782 +"541610",0,0,0,0,0,0,0,0,0,0,0,1,1,95,18,2,3,3,3,35,66,194,157,53,40,153,94,199,101,176,184,48,60,43,145,71,29,18,20,17,11,15,3,15,6,13,3,4,3,1,2,2,15,12,2,2,12,18,5,6,3,7,2,5,10,15,28,16,4,7,3,7,5,23,15,24,5,40,4,4,14,9,20,3,22,21,61,44,19,21,49,6,41,7,5,15,23,33,16,4,13,35,8,43,28,2,10,4,34,30,800,47,84,101,161,46,498,67,172,77,109,12,40,31,50,28,9,47,7,2,2,16,11,10,13,17,31,28,11,3,10,15,4,38,98,172,18,20,11,6,16,165,152,57,54,67,328,63,307,135,98,113,42,27,38,9,17,45,17,11,13,4,11,7,12,47,13,170,201,21,21,26,16,26,10,7,17,42,12,8,9,8,1,2,3,79,26,27,12,17,36,11,37,81,17,25,20,20,5,8,27,22,27,13,39,6,173,3,14,12,6,4,7,23,3,10,56,52,33,25,2,10,12,82,1,448,15,3,9,44,10,21,62,214,45,29,152,1396,130,174,28,12,14,12,63,58,5,58,26,11,2,20,13,8,189,17,5,15,980,2548,3283,3651,2911,1521,924,116,3911,37,0,1257,787,305,282,596,297,491,3094,388,13,30,144,343,374,5,413,104,467,166,250,667,57,3272,458,70,220,180,928,992,277,3986,2623,63,6005,7306,11311,2149,14,210,2601,259,0,0,1053,211,126,65,316,1133,1624,1489,681,663,7147,3845,708,12614,256,254,48,62,897,8727,1074,1192,884,455,953,290,251,270,548,1,29,555,5996,198,426,1295,701,411,357,10755,3088,268,588,226,246,519,94,1082,302,271,126,301,328,1269,684,1187,96,193,306,136,149,191,17,69,631,69,2178,1760,0,2,5195,16,0,0,1931,997,3739,25,0,379,183376,0,0,0,0,0,0,51279,0,0,0,0,0,0,0,0,0,0,0,0,234655 +"5416A0",0,0,0,0,0,0,0,0,0,0,0,3,0,0,8,0,2,2,1,36,23,42,47,62,4,1,47,2,41,8,114,13,20,8,42,37,8,4,6,7,0,2,1,3,1,3,0,1,0,0,0,0,3,2,1,1,2,5,1,1,0,1,1,3,2,3,2,1,1,1,1,2,1,2,4,6,1,3,1,1,3,1,3,0,2,1,7,8,1,0,4,2,8,0,0,3,1,1,0,0,3,5,1,12,4,0,3,1,7,2,0,0,0,0,1,0,0,1,2,9,0,2,1,3,0,2,0,0,1,0,0,2,0,0,1,1,7,3,2,0,1,0,0,14,0,38,0,1,0,0,0,1,6,1,6,5,2,5,1,3,0,0,0,9,12,3,0,0,0,3,4,1,3,2,2,13,4,9,30,2,0,0,0,6,0,0,2,4,3,2,2,1,0,0,0,7,6,7,2,5,8,3,10,22,5,6,3,4,1,0,6,4,5,0,10,4,52,0,4,0,2,0,1,0,0,3,15,15,8,3,0,3,0,17,0,138,5,0,2,10,0,1,7,42,11,5,0,66,0,0,3,0,0,1,8,10,1,12,3,0,0,10,3,1,19,3,0,2,294,571,640,286,422,466,314,36,690,12,0,331,243,91,90,182,91,148,893,106,8,1,44,155,142,32,180,45,139,51,75,205,17,750,128,21,46,48,262,301,81,1095,669,1,3172,3104,5104,767,0,38,1075,0,0,0,213,75,48,27,105,342,448,420,197,176,2798,831,220,3881,78,78,15,5,271,2826,324,319,251,138,282,82,129,75,135,0,2,168,1847,61,127,400,215,130,109,3165,944,82,178,70,76,158,27,331,97,83,39,32,96,394,198,349,29,69,94,43,46,76,6,21,193,361,670,303,0,76,80,0,0,0,1066,237,4559,16,16,257,57627,0,0,0,0,0,0,206,0,0,0,0,0,0,0,0,0,0,0,0,57833 +"541700",0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,1,0,1,0,0,1394,127,19,0,0,15,0,0,0,0,0,0,0,0,0,7,2,6,3,1,5,0,9,0,3,0,0,1,0,0,0,8,2,1,0,3,1,1,1,2,2,1,1,13,4,7,4,0,3,1,1,1,4,5,8,0,4,0,1,1,1,2,0,1,0,0,3,0,0,5,2,2,0,0,0,1,0,0,0,0,3,1,2,2,0,2,0,2,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,2,1,0,2,0,2,4,0,2,3,2,219,5,2,0,53,3,12,1,0,0,0,23,2,0,3,1,2,7,1,3,7,0,0,0,2,1,0,0,4,4,0,0,1,0,0,0,0,1,1,2,0,1,5,0,6,5,2,13,8,1,1,0,3,12,4,2,0,0,0,0,0,0,1,0,1,1,2,0,2,3,12,2,2,2,8,19,0,24,4,1,0,0,0,0,2,5,5,0,0,0,2,0,0,2,1,0,0,0,0,1,7,2,0,6,2,0,36,1,0,3,14,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,15,1,0,2,6,41,0,0,0,0,0,0,12,2,2,0,0,37,67,17,29,4,0,271,248,227,50,0,0,0,0,0,6,1,1,1,1,3,0,31,771,31,0,349,0,48,4668,0,0,0,0,0,1785,0,0,0,0,0,0,0,0,55,0,3,1,0,0,0,0,0,0,0,1178,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57,13,8,0,0,0,0,153,0,0,0,354,0,99,0,12978,5303,0,437476,0,0,0,39414,0,0,50501,0,0,0,80601,0,0,0,21404,0,647677 +"541800",0,1,2,0,0,1,0,0,0,0,0,2,2,88,5,5,3,11,15,39,179,1612,289,4,71,103,670,112,330,58,826,153,174,110,755,230,48,54,145,98,58,115,17,86,60,51,14,19,35,7,15,14,91,60,11,30,49,27,39,31,64,88,19,25,54,137,153,194,23,22,19,58,41,140,117,86,44,80,16,15,115,75,69,18,76,48,11,212,44,11,142,26,92,21,47,33,92,42,28,7,14,51,23,67,108,43,29,12,115,32,2,1,30,5,91,7,23,14,22,139,207,5,25,13,93,46,9,50,20,2,6,105,17,60,16,37,45,53,19,1,40,29,3,100,10,143,13,46,11,1,56,49,47,35,39,28,72,38,235,114,43,69,35,21,44,96,21,6,22,81,107,35,52,25,50,131,247,205,223,79,117,72,97,273,10,90,118,257,84,34,46,8,5,3,8,489,76,236,60,95,243,57,63,242,34,188,302,1055,98,1355,168,93,945,158,147,131,84,19,62,31,16,19,48,31,18,9,110,52,210,73,29,25,27,400,15,111,30,25,45,16,31,16,53,147,73,24,158,1115,27,82,22,16,46,50,61,448,6,114,98,67,28,24,30,24,496,70,20,88,6673,5183,7697,2367,8286,9888,2418,666,10987,1550,0,18255,5316,2631,3128,2332,895,4344,19526,7131,1158,161,1108,670,425,6,354,228,572,173,643,783,219,8697,2735,345,1706,3383,6195,6764,1068,6087,13217,1,24106,5276,1979,2324,2128,12646,1273,118,0,26,10530,804,83,408,2401,5968,911,3864,334,903,1032,5052,294,8751,2383,345,201,175,1211,15287,4548,3366,686,125,1169,8411,1457,990,540,4,557,2808,1900,968,916,603,57,309,206,3456,752,247,213,257,179,633,441,295,905,425,715,1705,1396,5856,4787,9203,544,1005,123,134,445,1931,72,87,3577,109,703,1502,0,342,458,0,24,174,898,1707,2679,15,58,1098,391922,766,0,0,0,0,0,20441,0,0,0,0,0,0,0,0,0,0,0,0,413130 +"541400",0,0,0,0,0,0,0,0,0,0,0,0,0,12,4,0,0,1,1,1,29,201,30,2,7,0,7,1,74,41,6,30,40,38,1,20,2,2,15,12,2,21,6,6,0,30,1,2,5,0,3,1,43,15,1,0,4,8,6,10,9,10,4,10,2,14,76,49,7,8,4,22,11,41,31,4,3,20,2,5,23,16,31,4,11,21,0,36,7,0,3,1,1,0,0,0,2,4,9,2,0,9,3,2,32,0,0,0,18,1,0,0,0,0,0,0,0,1,1,48,6,1,1,2,2,1,2,1,1,0,2,51,2,7,2,0,0,0,2,2,2,3,0,14,1,16,1,47,3,0,15,1,27,3,34,20,12,24,65,60,17,14,14,1,379,4,11,2,0,2,52,12,1,28,0,109,0,87,4,0,0,4,10,31,2,1,1,16,25,12,1,4,2,2,2,19,20,1,17,20,19,0,2,20,0,46,21,26,4,0,12,23,22,1,5,0,1,0,3,3,0,4,4,4,1,22,68,79,61,17,4,11,5,190,7,366,0,1,12,9,0,12,24,31,38,32,0,5,0,0,17,2,0,14,9,45,2,4,31,28,6,4,12,2,89,6,9,16,0,542,600,477,596,577,623,594,914,135,0,179,463,422,187,77,154,27,299,51,8,23,0,54,1,0,117,1,29,4,9,12,12,12,10,2,5,18,117,724,33,83,29,0,911,1069,764,264,89,1305,0,95,1,0,754,18,128,5,44,59,11,1886,7,313,1541,698,49,68,1357,244,56,7,219,3,287,34,9,7,24,11,15,19,24,25,22,5,698,16,9,18,8,21,10,27,23,4,10,3,10,1,4,0,8,0,1,14,42,18,75,108,20,2,0,2,0,4,0,4,2,29,4,40,0,0,0,1,11,32,123,202,2159,84,3,1464,30211,7558,0,0,0,0,0,176,0,0,0,0,0,0,0,0,0,0,0,0,37945 +"541920",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,135,0,0,0,0,0,9,0,0,0,0,0,0,17,0,0,0,0,0,0,0,0,0,0,0,0,3071,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1511,0,0,0,5683,33726,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39409 +"5419A0",0,103,0,0,0,25,0,0,0,0,0,2,3,289,24,3,2,5,6,25,114,5618,309,29,30,71,48,8,47,38,424,45,41,42,347,100,23,8,11,25,11,158,24,198,8,77,2,10,20,6,29,27,195,55,14,1,62,2,31,32,48,66,13,20,33,34,164,110,20,27,21,25,34,146,112,78,4,77,7,16,9,36,57,24,8,14,35,74,16,11,92,17,59,11,15,19,23,24,8,3,10,74,20,42,52,6,18,4,49,25,297,17,31,37,59,17,185,24,65,52,43,4,17,11,22,17,6,28,2,1,2,27,4,5,5,4,13,8,10,1,12,19,1,29,37,20,7,47,16,2,62,81,99,53,112,24,189,83,31,100,93,42,15,8,47,26,7,17,10,109,43,11,38,20,19,134,20,119,144,18,18,25,35,45,5,8,41,107,19,18,27,10,4,1,5,52,32,49,17,31,112,17,39,89,34,302,77,32,24,2,73,80,79,34,17,1,14,11,34,25,2,6,25,14,3,4,8,10,35,12,7,5,1,66,0,84,34,13,12,15,10,13,57,124,114,24,57,439,108,71,19,8,26,19,28,11,1,49,183,67,14,13,43,5,637,35,20,67,188,503,770,563,920,95,743,81,1338,60,0,147,324,270,483,369,522,83,920,161,227,74,0,402,368,354,135,18,202,442,540,1346,293,435,1444,87,80,161,756,1881,204,203,954,13,4593,2461,3848,1110,0,329,1,0,0,2,2846,115,335,31,0,535,230,927,92,1361,4126,879,81,4073,2031,27,75,13,1003,4180,539,200,130,70,278,199,204,124,104,66,628,105,1024,124,68,263,123,91,36,2300,351,38,235,130,426,4,64,9,173,3,7,154,91,67,161,682,114,46,23,51,8,48,0,23,46,937,41,26,0,0,305,14,83,0,1424,358,1035,6,81,426,86802,0,0,0,0,0,0,4776,0,0,0,0,0,0,0,0,0,0,0,0,91578 +"550000",0,0,0,0,0,0,0,0,0,0,0,0,0,13607,1804,324,637,1146,1086,2000,2734,60,2,0,175,484,0,0,750,1077,2337,174,622,1329,1791,842,73,100,103,77,312,667,96,377,151,233,88,75,78,33,97,39,136,114,17,68,113,37,81,47,202,241,58,110,82,268,553,594,68,76,73,224,150,686,483,347,89,301,91,60,87,227,519,124,1089,468,311,2159,216,140,979,245,1366,280,471,566,367,817,287,142,200,711,235,642,884,134,359,140,1177,434,530,145,269,134,181,61,900,268,533,549,832,61,137,99,86,217,82,168,136,168,56,231,79,348,96,224,242,265,95,5,190,116,30,251,205,1161,117,277,106,10,84,978,742,833,625,829,737,664,1086,1538,638,986,263,218,146,274,171,60,86,69,71,68,48,0,62,107,56,529,668,136,106,201,222,386,56,107,606,997,362,319,149,69,25,39,264,1146,1006,1416,420,296,910,337,1622,1975,384,4372,1289,901,204,89,577,871,680,493,170,124,1944,56,327,222,7,27,26,192,15,59,696,311,553,295,193,102,138,437,40,2626,475,216,284,349,643,397,344,1238,1945,799,427,6509,453,262,332,513,1036,470,1172,2081,335,2449,223,123,32,54,50,54,834,198,43,174,6256,11194,16460,4716,10827,10799,9458,3313,13954,1114,0,1930,4364,11001,302,261,147,18304,2168,5102,3077,7,1539,4373,150,2,3395,2902,1672,456,280,924,138,2316,255,38,1025,748,1257,297,83,2517,140,36,2890,6591,10450,200,707,4682,1253,1316,0,88,7069,2788,3250,2038,1227,5228,1513,2221,966,2691,4280,2260,721,2020,945,359,125,331,1408,53,12618,2754,2153,405,1317,1395,1193,861,3018,89,3835,3515,34737,3743,1311,6306,1281,2137,1880,10607,5039,1366,2529,1313,1077,979,194,928,356,28,179,640,1264,19069,20750,15541,9435,2139,469,685,735,1691,52,509,1260,0,0,0,0,0,0,0,0,81,0,0,4,0,0,0,547574,0,0,0,0,0,0,4296,0,0,0,0,0,0,0,0,0,0,0,0,551870 +"561300",1,0,0,0,0,1,3,0,0,13,0,0,4,31,8,1,1,2,0,9,915,10492,1837,88,123,17,394,92,51,297,1148,240,185,284,566,264,4,0,6,49,12,73,78,6,1,95,45,2,64,0,13,0,467,95,10,4,210,33,37,148,206,219,21,445,3,89,1233,479,61,81,4,71,39,865,243,7,16,234,64,18,95,42,65,9,138,273,32,130,22,13,29,2,93,13,10,26,17,49,61,41,34,19,19,6,199,31,2,7,51,102,409,30,46,55,225,32,409,34,164,31,397,6,20,22,27,29,8,25,6,6,1,34,12,13,8,5,7,9,2,3,24,38,20,7,49,38,39,9,10,3,19,103,238,56,167,111,540,85,2,1230,294,728,230,2,1021,35,55,50,58,4,1,0,10,13,2,7,1,195,64,8,67,80,103,22,14,4,7,127,54,7,20,20,1,5,9,107,6,6,116,4,120,1,149,33,3,49,10,49,1,2,17,97,135,3,6,1,247,1,40,15,1,7,16,99,4,52,26,39,115,37,50,6,4,1188,81,606,17,0,42,10,33,12,160,69,89,20,80,675,83,137,159,6,8,17,26,97,1,36,82,13,22,43,9,2,334,8,18,46,1055,2925,4132,1975,4742,1095,1703,107,3594,310,0,2801,547,307,979,1016,454,646,3388,1370,394,15,334,7548,2200,315,3033,1584,4276,220,314,798,182,10936,821,58,908,569,21297,8655,437,4308,7693,49,7362,6340,6512,1948,802,354,1985,14,0,2,8567,617,947,329,840,3904,13193,8265,1771,3165,7369,6884,2456,4907,2340,817,248,8,2221,6602,35992,4329,1450,1193,3546,1618,1164,1901,2999,6,250,1792,7631,81,648,3347,424,2856,409,23600,4819,497,840,274,233,331,188,595,1680,166,288,251,823,1987,1607,1343,1270,2044,913,1868,304,1547,26,171,990,25,446,862,0,2314,19,33,15,91,1787,670,5175,36,12,1551,382821,1879,0,0,0,0,0,975,0,0,0,0,0,0,0,0,0,0,0,0,385674 +"561700",12,136,72,58,40,51,52,43,60,21,1,4,27,190,175,56,101,77,124,286,499,336,398,7,30,6,262,63,143,109,904,115,140,118,271,200,170,89,68,69,15,68,24,60,17,31,7,6,8,6,11,8,152,38,7,2,32,13,18,21,34,31,15,24,24,28,72,59,11,11,9,17,20,84,89,68,9,37,10,10,18,25,26,3,40,28,6,45,8,1,29,5,37,9,17,16,8,18,14,4,17,35,5,29,31,4,7,3,32,11,0,0,0,0,1,0,21,2,5,35,9,1,2,17,4,9,3,5,1,0,1,19,0,24,9,10,17,10,19,0,12,25,7,14,15,143,11,25,17,0,22,111,41,97,104,126,118,86,71,226,55,28,41,37,105,15,17,7,7,36,24,6,13,13,18,49,16,39,38,7,6,7,6,13,0,3,18,28,57,54,36,25,5,13,14,107,71,79,60,55,126,35,131,284,40,168,62,93,19,17,52,76,107,39,32,17,75,12,39,22,13,6,15,2,4,86,168,318,368,69,16,34,17,365,12,406,77,37,91,269,78,31,211,513,371,42,29,159,14,86,86,26,32,23,76,40,7,127,124,68,12,29,23,49,331,72,14,45,428,848,1213,1090,1574,386,1003,328,1606,152,0,1228,1145,2970,693,429,961,569,618,786,955,380,8,274,1844,38,1091,46,267,49,51,97,16,367,204,17,51,52,458,454,236,417,655,1,755,793,1486,158,411,1076,8,198,293,261,73983,147,676,65,1841,629,137,156,21,190,516,301,69,555,222,100,32,75,215,1337,1493,1047,182,523,329,191,239,247,492,138,301,469,810,107,117,638,69,72,73,3808,893,252,390,393,249,38,86,31,153,134,116,585,521,2105,1538,2099,225,263,73,87,58,245,18,51,230,820,181,435,0,93,44,46,99,27,1325,792,11375,70,137,1009,167973,21348,0,0,0,0,0,58,0,0,0,0,0,0,0,0,0,0,0,0,189379 +"561100",1,0,0,0,0,0,0,0,0,0,0,0,1,6,5,0,0,1,1,0,17,41,0,2,13,1,45,15,91,38,151,38,39,36,89,77,8,2,3,3,0,1,0,1,1,1,0,0,1,0,0,0,1,1,1,0,1,2,0,1,0,0,1,2,1,2,5,0,0,1,0,1,0,3,2,3,0,1,0,1,2,1,1,0,1,0,3,3,1,0,1,1,3,0,0,1,0,0,0,0,1,1,0,5,2,0,1,0,3,1,0,0,0,0,0,0,0,0,1,4,0,1,0,1,0,1,0,0,1,0,0,1,0,0,0,1,3,1,1,0,1,0,0,4,0,18,0,1,0,0,0,0,3,0,3,2,1,2,0,1,0,0,0,4,7,2,0,0,0,3,2,1,2,1,2,6,3,4,14,1,0,0,0,3,0,0,1,2,1,1,1,1,0,0,0,15,3,3,1,2,4,1,5,11,2,3,2,2,1,0,3,4,3,0,5,0,24,0,2,0,1,0,0,0,0,2,7,7,4,1,0,1,0,17,0,62,2,0,0,4,0,1,3,20,5,2,0,31,0,0,1,0,0,1,4,4,1,5,2,0,0,7,2,0,20,1,0,1,236,308,337,158,465,127,167,9,337,24,0,334,52,28,88,121,43,83,137,124,3,15,0,868,22,0,85,20,401,23,40,117,12,1492,134,20,4,25,675,700,86,400,1014,0,81,1176,244,242,14,18,198,0,0,0,879,85,209,40,854,304,927,619,167,205,1641,1072,419,2524,289,74,20,2,191,917,1038,308,282,102,322,100,81,126,266,0,2,207,948,7,63,401,66,276,35,3940,662,43,165,29,17,138,18,214,144,54,32,8,72,260,196,194,47,11,47,37,10,40,1,5,60,0,279,353,0,0,16,7,0,0,602,372,981,7,0,411,38077,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38077 +"561200",0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,4,0,12,2,0,0,1,0,6,0,0,1,0,0,0,4,0,9,10,0,0,12,5,0,9,0,2,0,66,12,1,0,27,9,4,20,27,29,3,59,26,11,169,63,8,11,2,9,5,111,34,0,2,29,8,2,11,2,8,1,15,35,1,16,2,0,3,0,12,2,2,3,1,6,7,5,3,1,2,14,19,4,9,1,5,12,1,1,0,1,20,1,22,0,5,1,49,0,0,1,0,2,0,0,2,1,0,2,0,1,0,0,0,0,0,1,3,4,3,0,0,0,4,0,1,0,1,2,23,4,21,12,28,8,0,173,33,92,30,0,135,4,7,4,7,0,0,0,0,2,0,0,0,16,39,12,9,9,12,20,1,5,14,56,7,1,0,2,0,0,1,2,0,0,14,0,11,0,0,3,0,8,0,6,0,0,2,12,11,0,0,0,0,0,5,1,0,0,0,18,0,7,2,4,10,0,1,0,1,151,11,81,0,0,6,0,5,0,18,2,11,1,0,7,2,7,19,0,0,2,1,10,0,0,10,1,3,1,1,0,29,0,2,5,35,88,112,55,148,34,49,3,95,11,0,110,44,10,35,36,16,20,104,48,40,8,12,277,79,13,126,70,155,8,11,28,6,497,40,4,2,11,237,322,35,131,265,1,262,226,223,69,438,985,71,0,1529,0,173,22,33,12,21,109,858,94,115,113,298,494,123,207,83,28,9,0,78,5,673,108,42,121,147,23,32,53,89,156,1,65,257,2,22,118,13,103,14,816,165,17,84,9,6,14,3,10,52,7,7,5,25,33,52,42,43,5,19,12,4,24,0,2,19,0,25,14,0,3412,9421,0,0,0,514,879,2953,22,0,287,33602,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33602 +"561400",1,2,0,0,0,0,4,0,2,1,0,0,2,4,17,0,0,5,3,6,112,664,96,8,13,2,33,17,90,13,120,19,31,6,118,39,16,4,7,11,2,24,20,15,1,28,10,1,17,0,4,1,137,25,3,2,54,11,9,38,52,55,6,111,50,23,328,123,16,20,5,20,10,217,72,11,4,56,15,5,22,7,19,2,32,65,5,35,5,1,10,2,26,3,1,7,2,11,15,8,5,9,5,31,42,7,19,2,14,23,2,2,1,1,37,2,40,0,9,5,89,0,0,2,1,5,1,0,5,1,0,5,0,1,1,1,3,1,0,1,6,8,5,5,3,17,7,2,2,0,5,5,45,9,40,25,57,18,2,323,72,168,56,9,261,13,12,7,12,9,2,0,6,5,2,11,2,36,73,15,11,17,24,28,2,6,19,97,14,5,2,5,0,0,2,16,3,4,27,2,30,0,11,23,3,33,6,13,0,2,8,27,28,1,6,0,22,0,11,3,0,1,1,33,0,15,13,16,40,2,4,2,1,310,19,217,3,1,11,4,10,0,38,31,36,4,1,43,5,12,35,0,1,4,6,23,0,7,32,2,5,38,5,0,101,4,4,13,887,2114,2328,1715,2334,2035,2132,2334,3563,692,0,887,785,1267,517,272,582,173,1453,234,538,24,27,202,115,15,630,39,196,41,73,150,25,539,74,19,40,42,283,455,59,778,415,0,1951,416,304,246,0,64,129,0,352,22,5080,91,473,31,9546,4045,441,941,251,389,1394,1107,255,1392,110,45,22,29,365,1479,1849,580,212,139,452,180,293,154,398,43,36,101,2666,85,106,259,112,110,69,2287,585,53,223,46,69,42,19,69,68,26,21,19,137,249,382,578,89,42,45,29,22,73,3,16,97,53,325,308,0,8,23,3,40,5,95,362,1312,2,10,1471,85947,6344,0,0,0,0,0,245,0,0,0,0,0,0,0,0,0,0,0,0,92536 +"561500",0,4,9,0,0,4,0,0,0,0,0,0,4,0,21,0,0,12,7,0,167,283,69,15,0,0,21,24,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,2,1,0,0,0,0,0,0,6,0,7,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,18,0,1,2,0,0,0,1,0,2,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,7,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,12,0,0,0,1,52,0,18,530,0,2,0,240,0,0,137,36,16,38,84,13,51,133,93,2233,278,4158,2,1708,29,51,0,48,0,25,74,20,12,0,2,0,13,33,0,29,8,7,0,7,9,1,4,575,1432,1,1,0,0,2176,17,172,9,2053,84,0,335,0,103,176,931,278,1093,511,0,0,0,102,5808,115,0,108,83,18,401,0,868,151,0,29,14,916,55,53,95,0,0,93,47,94,0,1,0,0,0,222,0,593,6,26,20,54,375,0,1,55,9,0,0,0,120,0,0,3,208,363,288,0,0,182,20,131,0,8,7,583,0,98,481,33805,23394,0,0,0,0,0,622,0,0,0,0,0,0,0,0,0,0,0,0,57822 +"561600",0,0,0,0,0,0,0,0,0,0,0,0,0,81,8,0,1,2,1,23,44,260,46,2,12,2,80,62,105,19,78,20,41,16,78,42,13,8,2,16,0,20,19,8,0,35,8,0,18,0,3,0,103,23,2,1,43,13,9,35,50,50,5,96,37,23,351,135,22,23,6,23,13,193,58,8,7,57,15,4,23,11,19,2,29,63,2,29,3,0,6,0,16,2,6,4,2,8,17,8,3,6,6,20,37,7,13,1,8,18,1,1,1,1,29,1,33,0,7,3,75,2,1,2,2,4,2,1,3,1,0,5,0,2,0,0,0,0,0,1,8,11,6,2,1,1,10,0,1,0,5,6,56,9,50,17,71,20,1,429,92,227,76,2,338,6,16,6,16,4,4,1,11,5,8,10,13,41,7,0,0,21,31,0,1,0,1,101,17,4,0,6,0,0,1,5,0,1,34,0,19,0,3,7,1,26,2,9,1,1,3,31,17,1,1,0,0,0,12,3,0,0,1,43,0,9,6,11,31,0,4,1,1,387,26,208,0,0,13,0,6,0,45,6,32,1,0,11,3,9,44,0,0,5,2,26,0,0,31,3,3,28,2,1,91,1,3,15,600,792,904,642,961,665,806,782,1290,208,0,433,266,540,227,131,275,106,535,153,47,45,106,892,245,423,2682,12,279,22,31,64,16,907,84,11,4,19,406,597,64,335,460,1,2324,2510,1021,355,320,709,116,1,980,13,4834,106,187,22,314,306,1438,258,234,459,960,564,246,286,174,48,16,8,168,4,1743,260,125,374,295,91,209,122,181,23,14,447,1078,31,49,224,23,192,30,1856,301,52,95,18,20,23,10,20,92,13,17,18,73,129,183,304,121,14,31,25,7,53,1,10,44,42,55,52,0,0,78,5,25,4,666,691,4203,21,73,516,58708,11365,0,0,0,0,0,140,0,0,0,0,0,0,0,0,0,0,0,0,70214 +"561900",0,1,3,0,0,2,0,0,0,0,0,0,2,1,1,0,0,2,1,8,17,222,51,3,2,1,11,10,37,16,27,14,16,18,23,20,0,0,62,8,0,28,29,3,0,33,17,1,23,0,5,0,182,34,4,1,75,9,12,58,76,79,7,167,76,37,471,174,23,30,6,26,13,311,97,2,6,81,23,7,35,8,23,3,46,96,3,44,5,1,17,0,32,4,0,8,3,18,21,13,7,3,6,40,61,11,26,2,14,34,1,2,1,1,55,3,60,0,12,2,134,0,0,2,0,6,1,0,3,1,0,6,1,3,2,0,0,0,0,1,8,12,7,1,0,1,11,0,2,0,4,7,62,10,55,31,78,22,0,479,100,254,85,0,379,16,18,10,18,28,2,1,3,5,0,5,1,45,2,0,0,23,36,1,3,0,0,122,18,2,0,7,0,0,3,7,0,1,39,0,31,0,0,8,0,28,37,15,0,0,5,86,28,0,0,0,0,0,14,4,0,2,1,72,0,19,6,12,28,4,5,2,2,426,29,228,0,0,16,0,15,1,49,5,31,4,1,21,6,18,50,0,1,5,2,29,0,2,30,4,7,0,3,0,103,1,6,17,84,217,235,186,692,242,1032,41,4338,63,0,1008,154,253,468,146,386,95,336,284,94,42,1045,141,0,0,31,8,111,2,89,342,21,790,0,0,0,0,3,0,3,21,2,0,90,25,25,7,120,2,383,0,1,0,2132,1,7,0,678,510,1,1104,13,31,624,261,163,297,266,0,0,2,17,403,11,106,208,89,103,151,6,79,48,29,569,100,256,32,8,27,15,9,9,1007,5,0,114,0,0,0,75,3,328,2,4,20,17,81,5,20,27,4,0,0,0,14,0,14,316,49,126,56,0,0,12,2,23,1,87,105,1660,8,122,612,34184,159,0,0,0,0,0,394,0,0,0,0,0,0,0,0,0,0,0,0,34737 +"562000",18,57,13,14,14,22,54,46,44,13,0,2,4,330,46,7,9,16,24,35,114,419,106,45,28,52,383,142,165,88,339,78,102,113,414,171,27,30,23,29,20,91,5,48,5,20,12,3,7,6,24,10,124,23,8,3,22,6,11,16,30,26,6,16,9,16,33,32,7,8,7,7,7,38,30,83,8,21,5,4,14,14,15,2,17,16,3,33,4,1,16,7,18,5,7,5,5,8,11,2,5,21,4,14,16,1,5,3,27,9,0,1,1,0,3,0,48,3,5,13,57,0,0,1,9,7,0,5,0,0,1,10,0,4,0,4,6,2,7,1,3,6,6,10,5,32,2,9,5,0,9,23,10,20,31,18,32,18,20,81,25,16,66,10,33,8,3,3,3,31,10,3,7,5,7,27,12,29,34,5,4,7,6,10,0,3,17,26,19,15,13,29,3,8,9,49,48,67,46,41,95,21,123,134,19,73,36,47,7,15,32,54,90,55,13,11,28,6,20,16,14,3,7,1,1,16,63,92,71,27,4,11,10,91,4,418,15,23,39,47,35,14,151,1068,174,28,19,72,10,41,16,21,31,21,39,22,3,103,46,25,10,13,12,9,144,25,10,23,151,108,752,153,743,81,343,36,470,54,0,1024,484,297,150,175,563,155,117,282,63,142,10,782,34,15,169,96,277,8,7,25,1,35,52,1,7,19,7,3,83,51,35,0,202,512,111,29,1085,870,33,845,3,0,30034,57,99,18,472,309,18,183,106,265,139,326,89,727,125,13,3,33,167,859,104,967,206,103,87,200,28,186,11003,56,50,197,779,117,206,224,38,71,57,1713,683,119,475,33,46,11,27,5,43,38,49,147,278,1130,1080,899,99,310,9,31,33,223,6,247,115,51,10,498,0,92,1299,119,103,24,2135,778,17881,55,628,2787,104899,28334,0,0,0,0,0,156,0,0,0,0,0,0,0,0,0,0,0,0,133389 +"611100",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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0,0,0,0,0,0,0,0,0,0,55383 +"711100",5,6,2,2,2,1,13,1,2,3,0,0,0,0,0,0,0,0,0,0,8,63,5,0,0,0,16,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,1,0,0,1,0,3,2,0,0,0,1,0,3,1,2,0,0,0,0,0,0,0,0,1,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,0,0,0,0,0,0,1,1,0,0,0,0,2,0,0,0,0,0,0,0,1,5,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,2,0,3,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,9,0,3,0,0,0,0,0,0,1,5,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,0,0,8,0,0,0,58,39,36,49,93,0,118,0,118,0,0,0,0,0,0,0,0,0,0,0,0,141,0,0,0,0,1,0,0,7,8,11,2,25,54,8,0,0,8,30,10,116,13,0,183,262,139,23,0,30,10,40,0,1,602,23,24,4,0,174,29,226,102,159,92,141,42,25,425,0,0,6,79,1299,216,57,96,7,38,110,16,112,22,191,39,10,143,12,5,33,1,8,2,36,16,4,15,4,7,5,3,0,9,0,16,87,93,88,342,1492,94,1,0,2,0,4,0,1,0,5,24,88,0,0,0,0,0,0,183,97,0,0,0,25,9183,32596,0,4817,0,0,0,347,0,0,0,0,0,0,0,0,0,0,0,0,46944 +"711200",5,8,2,3,3,2,14,1,5,4,0,0,0,0,0,0,0,0,0,0,14,63,3,3,1,2,20,2,12,2,45,1,3,1,28,6,2,0,1,1,0,2,0,5,0,2,0,0,0,0,0,1,4,1,0,0,1,0,0,0,1,1,0,0,1,1,4,2,0,1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2,2,3,2,3,2,1,2,2,0,0,3,1,1,0,0,0,1,1,0,0,1,1,5,0,2,2,0,0,1,1,1,0,0,1,2,2,1,2,0,0,0,0,2,1,2,1,1,4,0,6,4,1,14,1,1,1,0,2,2,2,2,1,0,0,0,1,1,0,0,1,0,0,1,2,3,10,2,1,1,0,12,0,19,2,1,0,0,0,0,2,4,4,1,0,0,2,0,0,0,1,1,1,0,0,1,6,2,0,0,1,1,20,1,1,2,0,258,321,285,419,20,151,7,236,2,0,86,63,62,40,22,55,22,98,42,0,1,0,41,17,0,15,2,6,24,32,0,0,42,2797,1,3,2932,13064,30,0,62,10,0,197,1023,87,128,0,117,0,216,0,0,2952,49,16,66,0,199,61,66,35,183,160,73,41,44,1543,18,11,1,16,753,201,70,15,15,34,32,23,26,34,48,2,18,185,23,14,37,5,29,3,685,60,52,41,153,19,1761,4,0,2287,3,49,257,7,126,164,210,14,12,1,9,2,3,0,6,695,14,4,8,0,0,14,0,0,0,41,26,601,7,0,0,37898,472,0,660,0,0,0,371,0,0,0,0,0,0,0,0,0,0,0,0,39400 +"711A00",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,2,0,0,0,1,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,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1,1,0,0,1,0,3,2,0,0,0,0,0,3,2,2,0,1,0,0,0,0,1,0,0,1,0,1,0,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,2,1,1,0,1,1,0,0,1,1,0,0,0,0,2,0,0,0,0,0,1,1,1,4,0,0,0,1,1,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,2,2,0,5,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,4,0,0,0,0,8,0,3,1,0,0,0,0,0,1,5,2,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,3,0,0,7,0,0,1,46,26,43,48,55,0,117,0,98,0,0,7,28,2,43,0,48,0,70,134,0,0,0,0,0,0,5,0,1,2,3,4,1,16,5,2,0,1,7,24,8,96,14,0,151,213,114,19,0,22,6,29,0,1,0,19,26,5,0,83,23,179,51,70,77,73,17,27,30,4,3,5,26,569,156,26,27,6,27,35,16,41,22,2,33,7,183,9,7,7,2,7,3,10,19,3,15,4,28,1,77,0,45,0,1,2,4,159,38,54,495,2,1,2,1,10,0,1,3,0,20,9,0,2,2,0,0,0,56,0,462,0,0,3,5239,80832,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,86072 +"721000",0,0,0,0,0,0,1,0,0,0,0,0,0,1,4,0,0,2,2,7,194,1065,148,7,3,11,307,37,14,1,17,2,4,1,11,4,20,14,15,24,3,30,5,66,3,21,3,2,7,2,8,10,57,12,2,1,10,2,5,4,10,13,6,7,13,8,57,34,4,7,5,9,9,53,36,31,1,14,1,4,2,7,14,4,9,24,8,21,6,1,18,5,18,2,3,9,6,5,5,1,3,28,5,6,9,2,7,1,13,3,0,0,0,0,0,0,0,0,1,21,1,0,2,0,3,7,1,7,0,0,0,6,1,0,0,0,2,0,2,0,4,3,0,6,9,12,1,9,2,0,10,12,8,12,12,43,21,13,7,18,20,0,0,20,17,4,2,0,0,30,6,3,9,5,7,29,8,15,76,3,1,3,10,13,0,1,19,19,5,18,4,2,0,0,0,6,2,6,5,2,23,2,28,33,4,90,16,5,3,5,12,10,24,7,9,0,4,1,4,4,1,1,5,1,1,4,9,11,69,7,4,3,1,189,2,60,12,2,2,0,2,1,14,93,39,5,0,6,5,1,3,2,8,4,7,2,0,10,53,6,0,106,8,3,128,9,4,12,1020,185,799,244,606,0,268,0,373,6,0,42,57,52,78,2,71,3,85,8,0,14,0,0,0,3,332,1,15,35,65,94,21,334,114,57,7,18,148,498,176,2025,286,0,3182,4442,2424,404,0,465,127,614,0,21,13791,399,588,110,73,1384,496,4048,861,1061,1750,2159,241,489,391,130,85,94,263,942,3152,459,230,129,504,392,338,252,534,28,637,144,2271,191,146,188,44,149,59,212,224,36,62,83,6,13,32,6,72,2,14,131,72,502,815,1142,212,38,15,43,10,104,0,18,62,0,409,132,0,1434,900,0,8,40,839,355,1806,18,4,150,73618,163295,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,236913 +"722110",20,83,15,18,22,25,55,47,55,15,2,1,0,7,3,4,2,2,6,3,70,2024,117,4,0,0,217,21,4,0,1,0,3,3,0,16,22,9,9,13,3,21,3,37,2,11,3,2,4,1,5,6,38,9,2,0,9,1,4,5,8,9,2,4,6,5,30,20,3,5,3,5,6,26,21,15,0,10,1,3,2,5,9,3,5,11,4,15,3,4,11,3,10,2,2,5,4,3,0,0,2,15,4,5,7,12,4,1,8,2,0,0,0,0,0,0,0,0,3,10,1,0,1,0,1,3,1,3,3,0,0,4,0,7,1,1,2,4,1,0,3,2,0,4,4,5,1,6,3,0,6,7,7,8,10,19,13,10,4,11,11,2,9,13,9,3,1,3,1,13,5,2,5,3,4,20,4,10,35,2,1,2,6,7,0,1,9,14,6,10,4,1,1,0,1,21,4,6,4,3,17,1,20,20,3,57,8,5,4,2,9,7,13,6,6,7,2,1,5,3,1,1,5,1,1,3,7,9,42,6,3,4,1,70,2,55,9,3,5,1,4,1,9,42,22,3,7,3,5,1,2,1,5,3,4,2,0,8,30,7,1,8,6,3,83,5,2,9,363,474,932,554,598,59,443,18,687,44,0,391,151,150,104,63,106,66,188,105,69,1,17,124,96,7,257,7,17,26,42,68,15,213,97,26,4,13,103,340,104,1473,172,0,2295,5558,1671,234,4,2031,74,1004,0,12,26664,435,560,113,406,1369,468,3109,581,1143,2388,1636,254,447,269,145,80,94,180,1482,2407,278,162,118,399,308,269,223,391,19,324,133,3816,177,124,242,45,160,45,8532,286,43,433,362,1078,12,25,6,68,30,12,69,59,148,939,878,188,55,13,60,14,147,0,29,63,42,264,75,0,228,117,15,28,13,90,158,602,10,5,270,93153,279233,0,0,0,0,0,1177,0,0,0,0,0,0,0,0,0,0,0,0,373564 +"722211",4,7,3,6,4,3,13,1,6,4,1,1,3,1,2,7,1,1,2,2,293,128,35,3,0,0,57,6,0,0,0,0,0,0,0,70,20,8,8,12,2,20,3,34,2,10,1,2,3,1,4,5,35,8,1,0,7,1,3,4,7,9,3,4,6,5,27,18,3,4,3,5,5,25,19,14,0,9,1,2,1,4,8,3,5,10,4,12,3,2,10,3,9,1,2,4,4,3,0,0,2,14,3,5,6,6,4,1,7,2,0,0,0,0,0,0,0,0,0,9,1,0,1,0,1,3,1,3,1,0,0,4,0,2,0,0,1,0,1,0,2,2,0,4,4,5,1,6,3,0,6,7,6,7,9,18,12,8,4,10,10,0,0,12,8,2,1,0,0,13,4,2,5,3,3,18,4,9,33,2,1,2,6,6,0,1,8,11,5,9,4,1,1,0,1,11,3,5,3,3,15,1,18,19,3,53,8,4,3,2,8,6,12,5,5,4,2,1,4,3,1,1,4,1,0,3,6,8,39,6,2,3,1,67,1,53,8,2,2,1,1,1,8,38,20,3,3,3,5,1,2,1,4,2,4,2,0,6,27,6,2,8,5,2,80,5,3,8,0,405,572,388,364,36,272,12,422,8,0,174,86,85,44,40,45,41,98,64,41,1,0,71,46,9,24,4,7,6,8,13,3,71,25,5,1,2,20,67,12,231,21,0,529,2132,612,60,0,1239,9,429,0,1,11680,148,174,32,297,450,141,1381,121,400,816,299,88,142,129,163,80,33,44,622,573,151,44,33,99,86,61,150,91,31,34,35,1506,53,36,80,12,57,11,1489,109,13,85,15,50,4,4,2,14,1,4,3,29,120,260,851,93,24,4,24,6,59,0,12,21,33,49,34,0,254,133,25,43,7,1265,1363,1088,5,1,134,39130,344723,0,0,0,0,0,1130,0,0,0,0,0,0,0,0,0,0,0,0,384984 +"722A00",4,7,1,1,2,0,13,0,4,3,0,0,0,0,0,0,0,0,0,1,23,79,29,0,0,0,24,2,6,1,15,4,1,0,40,11,5,0,2,0,0,5,0,9,0,3,0,0,0,0,0,0,10,0,0,0,0,0,0,0,1,1,0,0,0,0,8,5,0,0,0,0,0,7,5,4,0,2,0,0,0,0,2,0,0,3,0,1,0,0,3,0,1,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,6,3,0,1,2,1,0,0,1,2,0,0,0,0,3,0,0,0,0,0,1,1,2,10,0,0,0,0,2,0,0,1,3,0,3,0,0,0,0,0,0,0,0,0,0,3,0,5,5,0,14,0,0,0,0,0,0,3,0,0,0,0,0,1,1,0,0,1,1,1,0,2,1,12,0,1,0,0,34,1,24,3,0,1,0,0,0,2,12,5,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,39,0,0,22,0,0,0,209,92,191,251,268,0,506,0,472,1,0,387,569,853,532,151,696,102,807,309,7193,0,0,615,0,0,39,976,279,2,3,4,1,17,94,2,0,0,18,117,15,152,22,0,301,395,244,58,0,27,12,31,0,3,1211,25,47,31,674,700,33,997,371,1096,971,2162,199,1767,492,372,29,5,745,2542,674,106,657,156,509,925,233,1991,21,278,859,17,3715,10,751,9891,1,18,2,2942,5731,585,21,205,13,0,133,0,215,0,118,746,174,7556,756,1279,371,37,0,72,0,606,0,0,183,216,37,102,0,37,38,5,81,20,1888,1420,1068,0,0,139,79708,107894,0,0,0,0,0,400,0,0,0,0,0,0,0,0,0,0,0,0,188002 +"811100",11,25,3,3,0,8,20,0,3,7,5,0,0,2,8,2,3,3,6,27,30,68,14,0,10,3,151,33,57,22,95,29,54,77,67,154,33,18,13,12,15,45,22,49,11,15,10,3,5,7,10,8,92,23,7,3,21,8,8,11,26,20,11,20,11,10,33,25,4,5,7,5,10,41,41,34,3,18,8,4,7,10,13,2,19,14,2,17,3,1,13,2,13,3,8,7,4,9,8,3,6,15,2,13,13,2,2,1,13,9,0,0,1,0,4,0,58,4,12,10,13,0,1,15,1,4,1,3,0,0,0,3,0,5,2,2,4,2,4,0,3,5,1,2,3,31,2,5,3,0,3,24,8,19,20,27,24,18,15,50,11,5,8,6,22,2,3,1,1,7,4,1,2,2,4,8,3,20,13,3,3,3,3,4,0,2,7,13,11,12,7,5,1,3,3,21,15,17,13,12,25,8,25,60,8,30,13,20,3,3,10,16,22,7,6,3,17,2,8,4,2,1,3,0,0,19,36,69,75,14,3,7,3,71,2,85,17,8,20,30,17,7,47,114,83,10,7,35,3,19,19,6,7,5,17,9,1,28,28,16,2,7,5,11,73,16,3,10,151,30,143,245,458,73,424,137,805,66,0,211,333,337,185,74,278,41,141,92,0,7,0,4538,537,98,431,0,145,14,12,13,3,195,44,1,14,19,323,26,40,195,173,0,114,630,258,56,3,569,6,23,0,0,1633,890,409,35,29,125,62,79,24,52,170,32,39,72,54,9,5,13,51,954,63,976,118,46,63,44,60,48,706,1,58,61,268,29,30,117,110,22,68,1351,88,23,22,19,15,10,8,4,15,11,20,16,84,337,461,593,83,115,21,51,19,46,3,19,64,0,12,45,0,0,52,5,0,0,827,29,448,11,0,13,29356,164881,0,0,0,0,0,49,0,0,0,0,0,0,0,0,0,0,0,0,194285 +"811200",17,39,5,4,4,12,33,0,5,12,5,0,0,9,7,3,4,6,12,100,180,131,169,108,7,4,176,36,57,26,132,28,74,87,83,190,20,11,14,15,8,26,9,35,5,13,3,1,3,3,4,3,57,10,2,1,9,3,4,4,23,9,7,14,13,11,32,30,4,4,6,10,9,36,32,27,10,17,6,3,5,12,10,1,12,11,3,18,3,0,11,1,13,2,7,7,2,6,6,1,2,11,1,8,12,1,4,1,13,4,0,0,0,1,3,0,27,3,5,8,12,0,1,7,12,3,1,2,0,0,0,2,0,0,1,1,1,1,2,0,1,2,0,1,2,21,1,2,1,0,1,17,8,14,9,15,14,8,13,32,9,13,2,3,14,0,1,0,0,11,2,5,1,0,2,4,2,27,25,5,1,9,5,10,1,0,13,19,5,5,3,2,0,1,1,8,7,13,5,5,11,3,16,36,5,21,5,9,1,1,4,6,9,4,3,0,5,1,3,4,1,2,0,3,0,8,34,39,31,17,5,6,4,50,2,55,16,8,14,25,7,3,30,70,46,4,3,24,2,8,8,2,6,2,11,7,0,17,17,6,0,3,2,5,77,14,1,14,159,351,190,232,642,92,386,184,650,100,0,586,400,359,198,84,301,68,308,125,326,24,9,330,213,11,388,31,209,18,13,17,5,261,59,1,14,32,415,284,51,224,179,0,230,395,271,59,0,537,6,15,0,0,181,1126,507,74,40,177,90,287,58,75,251,42,341,386,73,21,6,18,74,1208,179,992,204,80,99,69,398,71,852,168,831,49,522,326,46,198,145,50,111,2090,171,41,38,44,22,31,27,39,48,35,48,122,242,326,807,941,146,302,36,143,51,165,5,245,139,4,19,102,0,7089,197,4,25,387,3180,1596,3005,7,0,62,46322,4114,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,50441 +"811300",2,5,1,1,8,1,4,0,1,2,13,0,0,1,0,0,0,0,1,9,13,201,0,41,10,8,387,85,146,57,291,73,141,183,190,385,82,45,34,31,38,116,54,123,29,39,26,8,14,18,24,20,230,58,19,7,53,19,21,27,65,51,27,52,28,27,83,64,10,11,18,14,25,102,104,86,9,46,20,11,19,27,32,4,49,37,5,44,9,2,32,5,33,9,20,17,12,24,20,8,16,37,7,34,33,7,7,3,32,22,0,0,2,0,10,1,145,11,32,26,33,0,3,42,4,10,2,6,0,0,1,9,0,14,5,6,9,6,10,0,7,13,4,6,8,78,6,11,8,0,9,61,19,48,51,68,61,43,37,123,27,14,23,16,50,7,8,4,4,17,11,3,5,6,9,20,7,51,34,9,8,9,9,11,0,5,19,34,28,29,19,13,2,7,8,58,38,42,32,29,63,19,63,150,21,75,33,51,9,10,24,39,54,19,16,10,43,6,20,11,6,3,7,0,2,46,91,172,186,35,8,17,9,178,7,219,43,21,51,151,43,18,118,285,206,24,17,88,8,48,49,15,18,13,43,23,4,71,70,39,7,16,13,28,181,41,8,25,504,69,343,603,1098,185,831,347,1273,166,0,563,845,870,468,188,708,104,340,240,30,1,0,615,57,36,103,6,365,36,31,34,9,492,111,2,36,48,811,64,107,493,428,0,287,1586,698,152,0,1430,16,55,0,0,322,2237,1026,88,0,313,157,437,54,124,432,71,95,180,135,26,13,32,120,2335,155,2464,286,116,160,99,154,117,1693,2,251,144,675,73,77,297,277,57,172,3418,224,58,56,47,38,28,21,12,39,28,52,80,211,877,1162,1495,209,290,53,128,49,116,7,49,165,16,30,112,0,685,8143,0,0,0,647,561,1382,12,0,95,64081,0,0,0,0,0,0,17,0,0,0,0,0,0,0,0,0,0,0,0,64098 +"811400",0,0,0,0,0,0,0,0,0,0,6,1,0,22,40,0,0,1,1,88,3,97,498,1,69,565,163,36,55,23,116,31,54,79,77,152,8,3,3,2,5,9,5,12,3,4,5,0,1,1,1,1,24,5,1,1,5,2,2,2,6,4,1,7,2,4,8,6,0,1,2,1,2,10,9,8,3,4,2,1,4,2,3,0,4,4,0,4,0,0,3,0,3,1,2,2,1,2,2,1,1,3,0,3,3,0,0,0,3,2,0,0,0,0,1,0,15,1,2,2,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0,1,7,0,1,0,0,0,6,1,5,4,7,6,3,3,11,3,1,1,1,6,0,0,0,0,1,0,0,0,0,0,1,0,5,3,0,0,0,0,1,0,0,2,1,3,3,2,1,0,1,1,3,3,4,3,3,6,2,6,15,2,7,3,4,1,0,2,3,6,1,1,0,2,0,1,0,0,0,0,0,0,4,9,17,19,3,0,1,0,18,0,22,4,1,5,15,4,2,12,29,21,2,2,9,0,4,4,1,2,1,4,2,0,7,6,3,0,2,1,3,19,4,0,2,170,30,157,343,487,82,369,156,570,75,0,278,371,417,209,92,313,50,152,109,0,11,396,838,385,2,587,4,162,16,14,15,3,220,49,0,17,21,415,157,49,216,195,0,113,191,315,69,0,581,7,5,0,0,2714,998,466,33,32,321,68,407,143,58,260,236,115,135,59,9,3,15,65,1206,151,1694,333,1482,104,238,733,144,1138,485,133,10,301,34,34,127,124,24,75,1581,109,28,27,28,18,15,88,9,24,13,23,38,115,279,524,825,91,132,23,59,62,63,3,31,74,6,16,65,0,108,6,35,48,0,567,496,2800,73,793,1218,37588,22333,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,59925 +"812100",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21338,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21338 +"812300",0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,59,0,4,0,3,0,0,0,0,0,0,22,0,0,0,0,0,16,1,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,85,0,0,0,0,0,0,0,0,0,0,4,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,1,0,0,1,0,14,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,1,12,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,2,2,2,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,7,239,125,94,477,0,46,0,35,37,0,539,56,57,22,5,258,0,28,10,1,25,0,5,72,0,670,7,0,0,0,0,0,0,7,0,0,0,4,16,1,0,0,0,0,0,0,0,0,0,0,0,0,0,667,0,52,5,0,26,4,32,16,28,3,29,12,291,28,0,33,20,26,0,29,66,28,1,9,31,12,36,15,7,46,5,276,236,63,294,35,27,16,2859,526,90,129,58,45,0,2,0,4,1,8,31,106,276,167,505,201,144,96,15,9,819,0,568,314,36,8,19,0,153,11,19,0,0,410,621,1185,2,15,12,15104,14091,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29195 +"812900",0,0,0,0,0,0,0,0,0,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0,23,1,1,3,130,0,114,124,123,0,321,0,111,0,0,76,38,19,72,21,97,32,109,55,52,39,0,111,33,2,40,9,27,6,6,15,4,25,21,3,0,2,24,116,5,61,5,0,1161,1933,1372,371,230,2689,1,151,2221,16393,728,44,103,7,1566,144,75,249,27,84,137,75,25,357,30,10,5,25,11,354,92,65,14,13,27,19,19,22,25,4,5,47,312,84,61,64,14,28,62,300,102,14,60,1,1,0,3,1,132,0,2,0,8,10,171,90,24,15,11,22,2,282,0,9,17,21,26,32,0,0,0,2,2,2,0,0,0,3,0,15,36567,58624,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,95191 +"814000",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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0,0,14,4,1,0,1,2,12,2,31,1,1,36,7,23,19,2,6,1,19,3,0,0,2,0,0,3,4,3,11,7,6,3,5,10,8,10,3,6,4,2,0,18,10,8,5,6,39,10,0,0,6,39,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,0,43,0,0,0,0,0,0,8,54,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,747,1846,2949,1644,3896,3015,1801,720,4003,397,0,972,653,368,459,547,268,438,2117,640,3,0,2480,3029,342,29,169,602,691,101,118,219,73,34,173,21,0,0,33,156,20,796,420,0,731,694,1671,237,68,5,32,0,0,0,615,145,350,56,784,367,84,395,43,325,288,701,64,217,333,59,57,15,108,242,157,30,43,14,539,109,64,143,130,13,413,144,378,106,96,137,44,44,213,2225,106,148,266,10,300,23,11,9,21,89,6,2,72,755,2939,2456,37,37,20,25,6,109,0,20,123,252,101,46,0,1,107,0,21,61,324,233,1471,8,0,98,62229,6914,0,0,0,0,0,710,0,0,0,0,0,0,0,0,0,0,0,0,69853 +"S00102",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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0,836043,0,0,0,836043 +"S00203",0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,176,25,176,0,0,0,0,0,0,0,0,0,0,0,0,13,18,14,14,16,61,3,28,4,11,7,2,5,4,17,8,85,15,5,1,15,5,7,11,20,15,9,10,8,9,19,20,6,4,5,7,5,24,24,57,6,13,5,3,9,9,10,1,12,12,1,24,3,0,11,6,13,5,6,4,5,7,7,2,4,14,3,11,10,1,3,2,15,7,0,0,0,0,2,0,36,1,2,5,42,0,0,0,5,4,0,2,0,0,0,7,0,3,0,2,4,1,4,0,2,4,6,5,3,24,2,7,4,0,5,17,6,12,24,12,23,12,16,59,16,0,67,6,19,6,4,3,4,12,6,1,3,2,4,13,6,20,21,4,2,6,3,6,0,3,13,17,15,11,9,21,2,6,8,40,35,49,34,30,65,17,86,96,13,44,23,34,5,13,21,34,65,39,10,10,21,4,15,12,10,3,6,0,1,11,45,67,45,18,3,8,8,54,3,290,8,16,32,35,26,10,111,788,125,22,14,54,6,30,12,16,23,15,28,16,3,76,29,20,8,10,8,7,73,18,7,14,142,70,537,102,284,40,231,24,243,34,0,607,344,190,112,124,314,107,81,207,4,0,0,420,6,7,63,52,185,6,5,18,2,39,49,2,5,14,9,10,59,59,30,0,257,402,153,37,0,69,29,0,0,0,2086,975,66,22,29,558,37,92,142,71,106,204,37,337,34,9,3,23,192,580,106,312,260,115,79,240,25,148,702,17,14,103,369,38,80,125,28,39,22,758,430,67,159,188,30,9,18,5,35,26,32,0,176,804,753,618,66,205,15,42,26,180,6,180,91,26,8,359,0,1280,740,258,0,0,2040,1387,2950,10,0,1377,34550,72509,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,107059 +"S00401",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,0,0,0,0,0,0,0,0,0,0,30485,1830,3107,13,1727,56,1423,699,3895,412,0,3,0,0,52,185,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,136,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,54,0,0,0,0,0,0,275,0,13,0,-183,1024,6,159,4368,1738,0,0,0,0,0,0,182,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,739,0,0,0,0,0,0,0,0,0,0,0,851,0,0,0,0,0,0,0,0,0,0,0,0,0,-139,0,0,0,39,0,461,652,0,0,0,0,10586,0,0,0,0,0,16,0,142,1,0,0,-43,0,0,0,0,0,0,0,0,0,0,33816,222777,-97599,0,1883,-2586,3969,15515,0,0,0,-4,0,-4,0,-2683,0,-14497,0,3909,164495 +"S00300",111,371,0,0,0,0,181,172,133,119,2,1,46,512,4,9,5,0,1,74,343,1797,90,13,75,0,0,0,153,126,446,0,130,223,366,263,68,44,50,30,21,101,22,10,10,34,11,14,9,8,14,15,326,35,0,6,29,82,67,47,48,0,23,28,36,32,166,111,29,12,71,20,23,0,32,0,22,90,17,0,13,46,130,35,161,161,31,102,15,5,83,17,145,15,14,21,28,22,48,10,15,162,30,55,94,12,15,6,99,53,2,4,12,81,356,22,127,64,66,255,192,4,53,48,79,88,42,18,11,5,7,35,8,42,14,30,32,37,18,2,48,58,8,31,237,333,66,0,0,0,0,149,45,120,182,107,146,79,305,569,143,0,0,90,0,16,0,0,0,25,44,16,17,0,27,41,3,139,165,19,19,12,40,36,3,8,44,69,70,125,39,22,19,71,30,55,120,101,169,98,104,17,34,171,14,101,49,132,35,12,63,64,145,79,45,22,145,15,36,5,23,7,19,15,0,20,146,10,309,71,5,42,8,302,0,5608,63,0,10,513,23,23,108,580,292,38,51,290,0,140,92,30,52,30,139,66,11,82,121,62,0,0,0,51,344,58,19,72,575,990,1190,1134,1011,434,796,858,857,397,0,120,512,1016,0,177,107,284,2601,139,15226,138,1681,947,15,47,455,92,108,101,8,87,34,663,274,45,49,159,2872,3886,442,525,240,11,1719,2573,779,32051,255,547,577,249,0,98,1316,49,468,126,912,278,514,1859,161,150,1180,702,261,321,260,11,42,117,218,2114,665,286,48,31,294,34,5,29,108,0,429,106,0,0,0,0,0,0,0,0,268,25,0,0,0,32,51,171,88,0,36,67,131,666,1074,764,103,102,48,51,58,53,4276,10,30,0,0,0,0,11756,2797,8,0,0,0,0,0,0,0,0,142489,110221,0,7711,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,260421 +"S00900",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-200997,0,0,0,0,0,204439,0,0,0,0,0,0,0,0,0,0,0,0,3441 +"T005",20547,48075,10655,11723,9635,17494,28922,60750,38756,10239,8139,2043,5093,92883,17700,6540,9136,7490,8720,13877,39126,130971,24038,5398,15711,41235,98982,36118,79023,34123,141915,27220,48243,32647,118749,63781,23712,15793,16379,16883,4131,14406,3796,20217,3164,6440,4076,1679,2790,2352,3091,2691,66944,16165,5098,2119,20420,7187,17999,9534,10059,7582,4914,8434,6626,5053,30718,25612,4184,4757,11788,5665,5403,18507,17627,13458,3112,14318,3137,3159,6781,8254,15334,5180,20080,11428,3615,19590,2692,872,11856,2574,20287,3497,3574,4526,4484,5365,7484,1864,2768,19556,5992,10431,18849,1905,4193,1599,13678,7350,6143,1576,3045,2771,8916,1699,15700,6136,9007,12034,14446,823,2796,2709,3903,4730,3164,4393,1090,482,636,6317,1671,9828,2408,6343,6644,5520,4853,634,7503,6470,1564,6237,28051,157114,20600,10773,8164,4197,11640,31083,17682,29474,23691,26731,47759,21086,75146,28302,19624,9725,7025,9665,13298,7735,3869,4256,6010,8330,8098,2477,2992,2402,4272,11911,6904,15485,14540,2267,2465,2552,5033,5504,713,1893,7790,13999,16958,26923,12912,7503,8064,29303,7148,27224,23190,25513,39784,16624,35245,5797,49784,123898,10766,28176,17962,25905,10425,5905,14974,22783,31568,17524,12792,7416,15789,5454,8881,4824,6186,2225,4848,3668,2594,4828,25038,22022,48072,14600,4347,7583,2911,41981,1340,397458,10304,6893,13483,31466,6077,4431,17113,85424,66124,10003,7585,71951,8183,13945,9686,9047,17278,8934,19559,20144,2939,27676,27720,12198,2612,7152,7631,7802,67072,13019,3253,12100,69921,84999,118713,76097,133509,107527,80140,26450,159868,20508,0,119953,87171,81822,38880,37824,45675,70828,113633,72234,107619,35235,41020,189187,34893,7067,73182,40528,62718,8175,10613,20427,4469,105590,48433,4577,52005,47205,158076,119187,23453,79853,70686,533,190188,218868,172095,93795,37055,273841,163355,150527,212560,25763,747583,30603,39248,11728,54885,88283,38249,93822,17586,46338,120683,79697,22011,134462,40413,11146,5189,12908,32612,198490,137429,93637,23607,16310,37389,32962,23171,25368,62457,11064,65336,35482,186753,30505,26134,62354,15463,24955,16518,360018,77963,18554,42097,24149,30061,11300,13225,13691,25272,8708,7949,16151,42447,106617,152514,184662,39256,60503,7818,18084,11545,36157,9564,9885,32512,31179,20445,38024,0,218671,108827,12702,9310,8492,211797,155740,356474,26997,33921,148806,14856027,13290625,1159953,906246,773891,594900,32674,2082977,599358,77264,63714,7956,379143,19195,109261,10161,1737213,44204,44768,304902,37094434 +"V00100",1062,3149,2497,5182,5456,4823,2179,1231,2521,2761,8288,895,16148,29293,5561,1562,2866,3221,4414,6659,23306,60608,16820,4150,20279,34543,61068,27928,54088,25691,52475,23542,42882,38811,94603,44513,5479,4885,5811,6087,2719,6235,1426,7003,1876,3575,1290,776,1699,571,1435,864,9112,4560,378,489,3665,798,2489,2057,4608,3607,675,3145,3491,2858,11440,13208,1850,2549,3908,1987,2849,16680,5736,8249,836,7179,2122,2316,3885,4378,5737,2002,6412,5349,4183,7868,2153,704,5428,1003,6400,2057,2714,4659,3127,2869,2892,940,1025,4853,1972,2679,6402,769,1783,793,4891,3117,7655,2274,3272,2971,12673,2233,26798,8431,16720,11072,23071,1467,8013,1559,4816,6764,3723,5166,1159,869,803,3406,1002,4761,2472,3097,3309,4911,1839,1086,2330,3960,715,2767,6382,14210,2619,3658,2103,1318,2885,5110,4364,7132,4702,6486,9975,4394,29130,9060,9554,9833,1973,1480,10395,2055,2188,1840,1457,6033,2962,1502,1514,638,2698,4556,2055,15116,11166,1477,2289,2680,1723,3403,1139,791,5201,8819,2252,2497,1576,1565,538,716,1262,4924,5260,4977,3433,2428,4483,1312,9788,15290,2049,10867,4624,3548,1465,2398,3198,4562,7570,4290,3727,1208,1673,1394,3137,1823,1884,941,3122,6329,1556,546,6588,3313,11028,4281,1063,2476,1091,24702,1531,14705,1601,1314,1810,4508,2454,1359,4986,6309,7285,3752,3941,31768,3391,4648,2291,1607,3705,2209,5616,4343,753,6756,6831,3541,1372,1959,2214,2279,19074,4568,1635,3682,28670,81746,45681,63904,76780,43090,55047,16763,97018,24242,0,118071,96461,93086,52804,50169,24942,37806,42272,91257,57095,21893,7144,96307,21954,7617,47282,38870,53892,9580,10016,5911,2805,71879,33679,1757,17950,10426,61328,12221,10248,42813,52084,6076,97437,165916,153414,97818,34310,116031,120664,2059,0,18920,93508,11024,13103,9111,2990,131525,99401,140481,24875,88558,149700,125104,27523,97150,45888,11468,2172,19253,27448,324518,176327,75161,38562,8062,33176,17878,37273,22892,30195,34563,121810,36048,279251,57872,43302,73909,20867,52907,17101,396274,98255,33285,68790,25402,19894,7264,25961,9125,10192,6975,8012,9103,37082,82723,153383,92629,52024,45483,8659,15059,6344,29909,7741,13444,18426,57158,29428,55157,18684,246097,184220,54249,1997,2973,731648,139316,467952,26850,10203,69979,10434980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00OTOP",1112,1293,489,826,362,544,853,1890,1051,985,424,198,561,23283,1044,381,411,447,500,538,1488,26174,5232,1033,198,408,1008,404,679,541,1484,293,627,591,1308,718,197,147,158,148,91,292,94,356,73,142,91,53,56,49,69,57,982,240,61,31,280,109,220,153,198,139,58,103,89,83,411,360,59,67,141,76,76,313,260,216,46,216,50,47,95,113,227,69,302,164,71,240,43,15,188,42,318,56,63,86,73,84,118,30,47,239,83,171,278,32,62,24,220,106,416,106,219,164,675,135,1420,367,703,832,1206,75,257,140,275,370,226,302,71,45,13,116,33,173,45,89,114,96,68,14,102,130,30,99,376,1366,128,76,53,27,85,203,122,210,161,192,337,143,1185,311,293,163,78,105,219,95,57,63,72,74,63,17,24,16,35,97,49,418,345,50,63,59,79,103,15,29,142,260,176,214,114,67,67,239,72,251,225,247,330,176,303,53,483,1002,86,326,189,298,88,83,155,209,297,219,158,145,512,87,163,81,116,41,107,191,90,64,342,305,602,194,52,102,42,693,28,3189,104,85,140,903,191,121,560,2040,1508,260,251,3213,312,617,303,256,478,259,708,792,71,746,254,127,29,63,70,71,669,125,33,123,965,1238,1569,1088,1749,1340,1123,966,2325,296,0,3108,3223,2493,1921,1479,1419,1833,3840,2810,3542,1436,807,3965,861,3256,1290,933,771,295,311,418,123,3677,2627,975,209,654,1608,1171,119,1696,1808,94,5896,11505,3013,1290,595,3740,2373,701,178599,75504,27704,1616,2234,641,4292,1243,646,1122,207,1175,2363,1813,390,1553,893,254,56,285,619,7648,1547,805,271,145,384,258,285,241,1896,1206,5200,1954,4095,966,641,960,408,725,300,11590,2678,760,606,285,259,346,676,596,685,265,602,737,2310,5831,1911,1751,540,2155,345,814,438,1515,391,479,1367,234,918,1637,0,0,0,0,0,0,0,0,0,0,0,0,608532,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V00300",15495,14896,5165,12227,4415,4298,6583,24181,2239,19081,1916,5344,3848,100192,11518,4873,3212,5303,4575,5888,15832,148096,18036,4230,8837,18600,39466,15823,26452,14739,54293,12468,22411,30037,39980,26576,3580,3722,3266,2088,1196,5437,3038,4092,1311,2380,2653,2328,481,1389,1698,1455,11070,1976,351,156,2568,2157,1214,2306,2223,1441,1144,1278,1025,1457,4156,4299,1051,1018,2118,922,875,2440,5946,4006,857,4356,889,674,2281,1129,3770,697,5691,645,959,3747,25,54,2378,833,6250,418,244,194,207,666,2503,341,1137,1007,1113,4231,4818,648,967,236,4325,1078,4822,1342,2215,2002,7477,1381,20266,5078,3628,9488,15138,829,405,1497,3048,4026,2412,3338,791,471,48,2112,889,4282,420,761,2026,139,742,689,1476,3754,1131,1731,5192,40156,2845,385,721,24,3094,3493,1857,5151,3241,4501,7606,1829,44108,8994,7669,81,430,1550,1610,581,1466,1488,1229,623,1182,91,380,320,288,2456,1181,11929,9031,966,1651,380,1115,1276,149,138,594,3783,3862,1890,1779,602,803,2402,1657,4606,3799,2779,4238,4642,3688,609,7504,8436,917,3742,3600,9025,1793,3401,3400,2254,5427,7523,4507,3398,29452,150,1092,307,1567,299,987,680,588,1387,5773,7194,4946,2385,225,1220,558,13301,298,78929,1194,2541,4567,17305,873,1058,8826,22500,13728,1119,3231,75346,5736,16555,4861,3989,6356,3635,13663,17723,514,7688,4390,2931,452,691,1015,980,12796,2024,437,2352,33161,33508,62785,32627,58493,59997,36990,17682,77766,6829,0,68657,40131,18546,27879,13624,21627,13408,116764,18998,46346,22481,5828,77160,19576,30054,19739,16597,6319,7987,6702,11737,3445,99964,45022,10907,22637,49756,109598,116524,10336,50886,55437,1740,105317,260765,20528,6083,16487,174298,76517,4036,1164524,376515,396339,20862,33201,5895,95037,118269,14390,34127,6412,34999,56463,45077,3399,22155,41656,12365,5073,10043,27553,36459,70536,23875,2442,5037,8578,7663,5324,6684,19317,1265,41574,1090,24262,40384,33720,25868,18285,11531,833,76051,7290,2136,6311,2826,2828,8020,9100,21794,15172,4580,4595,9413,5216,63036,39297,38095,9080,23211,4176,8394,5625,11995,5520,4365,15077,11860,8858,4905,0,159521,112305,2781,4566,4080,76537,17879,111540,-36919,19288,74058,7873026,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"VABAS",17670,19338,8151,18235,10233,9665,9616,27302,5812,22827,10628,6436,20557,152768,18123,6815,6489,8971,9488,13085,40626,234877,40088,9414,29314,53551,101542,44155,81219,40970,108252,36302,65920,69439,135891,71807,9256,8754,9235,8323,4006,11964,4559,11451,3261,6097,4034,3157,2236,2009,3202,2376,21164,6776,791,676,6513,3064,3923,4516,7030,5186,1876,4526,4605,4398,16007,17867,2960,3634,6167,2985,3800,19433,11942,12471,1739,11751,3061,3036,6261,5621,9733,2768,12405,6158,5213,11854,2220,773,7994,1878,12968,2531,3021,4939,3407,3619,5513,1311,2208,6098,3167,7082,11499,1450,2813,1053,9436,4301,12892,3722,5706,5137,20825,3749,48484,13876,21051,21391,39415,2371,8675,3196,8139,11160,6362,8807,2021,1386,864,5634,1923,9217,2937,3947,5449,5146,2649,1789,3908,7844,1876,4598,11949,55732,5592,4119,2878,1368,6064,8805,6344,12493,8104,11179,17918,6366,74423,18364,17515,10078,2481,3135,12224,2732,3710,3391,2758,6730,4206,1610,1919,975,3021,7109,3285,27463,20542,2493,4002,3119,2918,4783,1303,958,5937,12862,6290,4602,3468,2234,1407,3357,2992,9781,9284,8003,8001,7247,8474,1975,17776,24729,3052,14935,8414,12871,3345,5883,6753,7026,13294,12032,8392,4751,31636,1631,4391,2211,3566,1281,4216,7199,2235,1996,12703,10812,16577,6859,1340,3798,1692,38696,1856,96823,2898,3940,6517,22717,3518,2539,14372,30849,22522,5130,7423,110326,9439,21821,7455,5853,10540,6104,19987,22858,1337,15190,11476,6599,1853,2713,3300,3329,32539,6716,2105,6157,62796,116492,110034,97618,137022,104428,93160,35411,177109,31367,0,189835,139814,114125,82604,65272,47988,53047,162877,113065,106983,45810,13780,177432,42391,40928,68311,56400,60983,17862,17029,18067,6373,175519,81328,13639,40796,60835,172534,129917,20703,95395,109329,7910,208650,438187,176955,105192,51392,294069,199554,6796,1343122,470939,517552,33503,48538,15647,102319,251036,114436,175730,31495,124732,208525,171994,31312,120857,88436,24087,7301,29581,55620,368625,248410,99841,41275,13244,42138,25800,42882,29818,51408,37035,168584,39092,307608,99222,77662,100737,39559,65163,18234,483915,108223,36181,75706,28514,22982,15631,35737,31515,26049,11820,13209,19253,44608,151590,194591,132474,61643,70849,13179,24267,12407,43418,13652,18288,34869,69252,39204,61699,18684,405619,296526,57030,6563,7053,808185,157195,579493,-10069,29491,144037,18916538,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T018",38216,67413,18806,29958,19868,27160,38538,88052,44568,33065,18766,8480,25650,245652,35823,13355,15624,16462,18208,26962,79752,365849,64126,14813,45025,94786,200524,80273,160242,75093,250167,63523,114163,102085,254640,135588,32968,24547,25614,25206,8137,26370,8355,31668,6424,12537,8110,4835,5026,4361,6293,5067,88108,22941,5889,2796,26934,10252,21923,14050,17089,12768,6790,12960,11231,9451,46725,43479,7144,8392,17955,8650,9202,37941,29569,25930,4851,26070,6198,6195,13043,13875,25067,7948,32486,17586,8827,31444,4912,1645,19850,4453,33255,6028,6595,9465,7891,8983,12997,3175,4976,25654,9160,17513,30348,3355,7006,2653,23115,11651,19035,5298,8751,7908,29741,5448,64183,20012,30058,33425,53861,3195,11471,5904,12042,15890,9526,13200,3111,1867,1500,11951,3595,19044,5345,10290,12093,10666,7502,2423,11411,14313,3439,10835,40000,212846,26192,14892,11042,5565,17704,39889,24026,41967,31795,37909,65677,27452,149569,46666,37139,19803,9506,12800,25522,10467,7579,7647,8768,15060,12304,4086,4910,3377,7293,19020,10189,42948,35082,4760,6467,5671,7951,10286,2016,2851,13727,26862,23248,31524,16381,9737,9471,32660,10140,37006,32474,33515,47785,23871,43719,7772,67560,148627,13818,43112,26376,38776,13770,11788,21727,29809,44863,29556,21184,12167,47425,7085,13273,7035,9751,3506,9064,10867,4829,6825,37741,32834,64649,21459,5687,11382,4603,80677,3196,494281,13203,10833,20000,54183,9594,6970,31485,116273,88646,15134,15008,182277,17621,35766,17141,14900,27818,15038,39545,43002,4276,42866,39196,18797,4465,9865,10931,11131,99611,19736,5359,18257,132717,201491,228747,173715,270531,211954,173300,61861,336977,51875,0,309788,226985,195946,121484,103096,93663,123876,276509,185299,214601,81045,54799,366619,77284,47995,141492,96928,123701,26038,27642,38494,10842,281109,129761,18217,92801,108040,330610,249104,44156,175248,180015,8443,398838,657055,349050,198987,88447,567910,362909,157323,1555683,496703,1265134,64106,87786,27375,157204,339319,152686,269552,49081,171070,329208,251691,53324,255320,128849,35233,12489,42489,88232,567114,385839,193478,64882,29554,79528,58762,66053,55186,113865,48099,233920,74574,494361,129727,103796,163091,55022,90118,34752,843933,186186,54735,117803,52663,53043,26930,48962,45205,51321,20528,21158,35404,87055,258207,347105,317136,100899,131352,20997,42351,23952,79575,23216,28173,67381,100432,59649,99722,18684,624290,405353,69731,15873,15546,1019982,312935,935967,16928,63412,292843,33772564,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00TOP",0,0,0,0,0,0,0,0,0,0,37,449,0,8342,1094,258,316,289,423,48,166,23580,5427,325,0,0,605,290,0,0,962,0,0,0,0,0,47,24,38,11,14,5,7,30,27,9,7,12,1,2,4,19,14,14,6,0,32,3,19,7,27,15,1,2,0,18,55,38,4,1,3,2,3,2,16,4,7,18,1,4,440,9,4,0,16,4,11,13,0,0,3,9,17,9,2,10,4,12,4,0,0,2,2,18,39,7,5,1,14,22,18,3,12,5,1,8,59,42,39,104,19,4,7,10,4,19,6,6,12,1,3,24,10,14,3,4,14,5,6,0,7,16,5,1,26,0,3,6,2,0,3,10,24,13,0,12,91,23,29,24,8,0,0,2,0,18,1,17,1,1,9,3,3,6,7,11,3,21,51,10,13,1,5,108,2,3,2,12,41,167,36,10,23,526,2,49,3,12,94,7,145,18,6,66,19,90,192,214,29,8,40,23,174,2913,890,4121,13345,0,2,2,6,2,4,10,5,0,1,2,90,9,5,9,2,55,1,397,26,51,4,29,5,12,20,88,71,21,0,4151,1,216,18,6,49,7,88,255,10,76,38,12,1,0,5,0,29,309,4,18,5256,7063,6991,7743,16113,2783,2363,88362,35487,33,38513,45947,22253,37990,21701,6833,12963,17160,20524,24926,21938,787,224,535,1017,77,153,132,133,66,38,85,19,958,2624,134,2011,775,17233,12438,4886,990,525,14,2524,46,1182,99,3405,20469,0,38,0,0,1309,4637,5531,2082,2,15394,1360,2828,524,449,1363,938,106,87,830,934,443,123,120,1509,781,2489,214,102,806,340,1118,450,1751,4,459,414,308,4,679,241,54,129,59,2616,2532,431,408,383,162,972,1899,1247,1462,472,2811,1393,5677,24709,24646,23633,4112,6420,466,741,990,1407,482,1220,1338,0,10,323,0,0,0,0,0,0,0,0,0,0,0,538,755440,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00SUB",0,9531,0,0,0,585,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,264,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,238,2263,47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,546,0,0,0,0,0,0,2441,16307,1417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6339,0,0,0,0,0,19471,59875,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"VAPRO",17670,9807,8151,18235,10233,9081,9616,27302,5812,22827,10665,6886,20557,161111,19217,7073,6804,9260,9911,13134,40792,258457,45515,9739,29314,53551,102147,44445,81219,40970,109213,36302,65920,69439,135891,71807,9303,8778,9273,8333,4020,11968,4566,11481,3288,6106,4041,3168,2237,2011,3207,2395,21178,6790,797,676,6545,3068,3942,4523,7057,5201,1877,4529,4605,4416,16061,17906,2965,3635,6170,2986,3802,19435,11958,12476,1746,11769,3062,3040,6702,5630,9737,2768,12421,6162,5224,11868,2221,774,7997,1887,12984,2540,3023,4949,3411,3631,5517,1311,2208,6100,3170,7100,11538,1457,2818,1054,9450,4324,12910,3724,5718,5142,20825,3756,48543,13917,21090,21495,39434,2375,8682,3206,8143,11179,6368,8813,2032,1387,866,5658,1933,9231,2940,3951,5463,5151,2655,1525,3915,7860,1881,4599,11976,55732,5595,4125,2880,1368,6067,8815,6368,12506,8104,11191,18009,6389,74452,18388,17523,10078,2481,3137,12224,2750,3711,3408,2759,6731,4216,1613,1921,981,3028,7120,3288,27484,20593,2503,4016,3120,2922,4890,1305,961,5939,12875,6330,4769,3504,2244,1430,3883,2993,9830,9287,8015,8096,7254,8618,1993,17782,24794,3071,15025,8606,13086,3374,5891,6793,7049,13468,14945,9282,8872,44981,1632,4394,2213,3572,1283,4193,7209,2240,1997,12704,10814,16667,6868,1345,3807,1694,38751,1857,97220,2924,3991,6521,22746,3522,2551,14392,30937,22592,5151,7423,114477,9440,22023,7473,5859,10589,6110,20074,23113,1347,15266,11513,6611,1854,2713,3304,3329,32568,7025,2110,6174,68051,123555,117026,105361,153136,107211,95524,123774,212596,31400,38513,235782,162067,152115,104305,72105,60950,70208,183401,137990,128682,44334,13957,177967,43408,41004,68464,56532,61116,17928,17067,18152,6392,176477,83952,13773,42807,61599,189767,142354,25589,96385,109854,7924,211174,437687,178136,105291,54796,314538,199554,6835,1340682,454633,517444,38140,54069,17729,102321,266430,115796,178559,32019,125181,209889,172932,31418,120944,89266,25021,7744,29704,55740,370134,249191,102331,41489,13346,42944,26140,44000,30268,53159,37038,169043,39506,307916,99226,78341,100978,39613,65291,18293,486155,110755,36612,76113,28896,23144,16602,37635,32762,27511,12292,16020,20646,50285,176299,219237,156107,65755,77269,13645,25008,13397,44825,14134,19508,36207,69252,39214,62022,18684,405619,296526,57030,6563,714,808185,157195,579493,-10069,29491,125103,19612103,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/flowsa/data/external_data/Detail_Use_SUT_2017_metadata.json b/flowsa/data/external_data/Detail_Use_SUT_2017_metadata.json new file mode 100644 index 000000000..4459204da --- /dev/null +++ b/flowsa/data/external_data/Detail_Use_SUT_2017_metadata.json @@ -0,0 +1,14 @@ +{ + "tool": ["useeior"], + "name_data": ["Detail_Use_SUT_2017"], + "tool_version": ["1.4.0"], + "ext": ["json"], + "date_created": ["2023-10-12"], + "data_meta": { + "data_year": [2017], + "author": ["US Bureau of Economic Analysis"], + "source_url": ["https://apps.bea.gov/industry/iTables%20Static%20Files/AllTablesSUP.zip"], + "date_last_modified": ["2023-09-25"], + "date_accessed": ["2023-10-12"] + } +} diff --git a/scripts/write_BEA_Use_from_useeior.py b/scripts/write_BEA_Use_from_useeior.py index 57dd91633..85fa61004 100644 --- a/scripts/write_BEA_Use_from_useeior.py +++ b/scripts/write_BEA_Use_from_useeior.py @@ -10,7 +10,7 @@ --- -The BEA_Detail_Use_PRO_BeforeRedef was pulled from +The BEA_Detail_Use_PRO_BeforeRedef_2012 was pulled from USEEIOR's Detail_Use_2012_PRO_BeforeRedef.rda on 08/11/2022. The original file is found here: @@ -24,6 +24,22 @@ --- +--- +The Detail_Use_SUT_2017 was pulled from +USEEIOR's Detail_Use_SUT_2017.rda on 10/12/2023. + +The original file is found here: +https://github.com/USEPA/useeior/blob/master/data/Detail_Use_2012_PRO_BeforeRedef.rda + +csv obtained by running the following code in Rstudio: +use2017 <- get('Detail_Use_SUT_2017') +write.csv(use2017, file='Detail_Use_SUT_2017.csv') +CSV manually added to flowsa +The metadata file 'Detail_Use_SUT_2017_metadata.json' was manually copied from useeior/extdata/metadata + +--- + + The BEA_2012_Detail_Make_BeforeRedef was pulled from USEEIOR's Detail_Make_2012_BeforeRedef.rda on 08/11/2022. From 31e34c634ba16d4f1cd264d46a0f94c18ca8535e Mon Sep 17 00:00:00 2001 From: WesIngwersen Date: Thu, 12 Oct 2023 09:29:00 -0400 Subject: [PATCH 1018/1127] Add 2017 SUT Detail Make, update script name to be more generic --- .../data/external_data/Detail_Supply_2017.csv | 404 ++++++++++++++++++ .../Detail_Supply_2017_metadata.json | 14 + flowsa/data_source_scripts/BEA.py | 2 +- ...eior.py => write_BEA_data_from_useeior.py} | 18 +- 4 files changed, 435 insertions(+), 3 deletions(-) create mode 100644 flowsa/data/external_data/Detail_Supply_2017.csv create mode 100644 flowsa/data/external_data/Detail_Supply_2017_metadata.json rename scripts/{write_BEA_Use_from_useeior.py => write_BEA_data_from_useeior.py} (85%) diff --git a/flowsa/data/external_data/Detail_Supply_2017.csv b/flowsa/data/external_data/Detail_Supply_2017.csv new file mode 100644 index 000000000..f85424cac --- /dev/null +++ b/flowsa/data/external_data/Detail_Supply_2017.csv @@ -0,0 +1,404 @@ +"","1111A0","1111B0","111200","111300","111400","111900","112120","1121A0","112300","112A00","113000","114000","115000","211000","212100","212230","2122A0","212310","2123A0","213111","21311A","221100","221200","221300","233210","233262","230301","230302","2332A0","233412","2334A0","233230","2332D0","233240","233411","2332C0","321100","321200","321910","3219A0","327100","327200","327310","327320","327330","327390","327400","327910","327991","327992","327993","327999","331110","331200","331314","331313","33131B","331410","331420","331490","331510","331520","332114","33211A","332119","332200","332310","332320","332410","332420","332430","332500","332600","332710","332720","332800","332913","33291A","332991","332996","33299A","332999","333111","333112","333120","333130","333242","33329A","333314","333316","333318","333414","333415","333413","333511","333514","333517","33351B","333611","333612","333613","333618","333912","333914","333920","333991","333993","333994","33399A","33399B","334111","334112","334118","334210","334220","334290","334413","334418","33441A","334510","334511","334512","334513","334514","334515","334516","334517","33451A","334300","334610","335110","335120","335210","335220","335311","335312","335313","335314","335911","335912","335920","335930","335991","335999","336111","336112","336120","336211","336212","336213","336214","336310","336320","336350","336360","336370","336390","3363A0","336411","336412","336413","336414","33641A","336500","336611","336612","336991","336992","336999","337110","337121","337122","337127","33712N","337215","33721A","337900","339112","339113","339114","339115","339116","339910","339920","339930","339940","339950","339990","311111","311119","311210","311221","311225","311224","311230","311300","311410","311420","311513","311514","31151A","311520","311615","31161A","311700","311810","3118A0","311910","311920","311930","311940","311990","312110","312120","312130","312140","312200","313100","313200","313300","314110","314120","314900","315000","316000","322110","322120","322130","322210","322220","322230","322291","322299","323110","323120","324110","324121","324122","324190","325110","325120","325130","325180","325190","325211","3252A0","325411","325412","325413","325414","325310","325320","325510","325520","325610","325620","325910","3259A0","326110","326120","326130","326140","326150","326160","326190","326210","326220","326290","423100","423400","423600","423800","423A00","424200","424400","424700","424A00","425000","4200ID","441000","445000","452000","444000","446000","447000","448000","454000","4B0000","481000","482000","483000","484000","485000","486000","48A000","492000","493000","511110","511120","511130","5111A0","511200","512100","512200","515100","515200","517110","517210","517A00","518200","519130","5191A0","522A00","52A000","523900","523A00","524113","5241XX","524200","525000","531HSO","531HST","531ORE","532100","532400","532A00","533000","541100","541511","541512","54151A","541200","541300","541610","5416A0","541700","541800","541400","541920","541940","5419A0","550000","561300","561700","561100","561200","561400","561500","561600","561900","562000","611100","611A00","611B00","621100","621200","621300","621400","621500","621600","621900","622000","623A00","623B00","624100","624400","624A00","711100","711200","711500","711A00","712000","713100","713200","713900","721000","722110","722211","722A00","811100","811200","811300","811400","812100","812200","812300","812900","813100","813A00","813B00","814000","S00500","S00600","491000","S00101","S00102","GSLGE","GSLGH","GSLGO","S00201","S00202","S00203","T007","MCIF","MADJ","T013","TRADE","TRANS","T014","MDTY","TOP","SUB","T015","T016" +"1111A0",37922,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1096,0,0,0,0,0,251333,0,0,251333,0,0,0,0,962,0,962,252295 +"233230",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63523,0,0,0,0,46,101,234,221,51,164,41,145,40,61,42,37,26,25,34,29,77,21,7,7,29,7,10,10,14,10,14,24,20,11,1178,320,66,83,165,8,14,111,5,16,6,47,12,14,23,24,43,10,50,41,13,109,4,2,15,9,58,12,5,6,38,20,31,1,1,8,13,20,38,5,7,3,43,14,1,1,2,2,6,1,3,1,2,5,9,0,2,1,2,3,2,2,0,0,1,6,2,9,5,10,10,9,2,1,5,4,1,3,41,121,22,32,23,7,30,26,17,31,20,26,54,20,57,21,17,10,3,13,466,148,1,1,1,138,65,27,31,0,44,108,8,4,4,0,1,1,15,19,3,5,22,277,1,3,3,2,2,5,1,17,13,14,3,2,3,1,10,24,2,5,3,5,2,2,3,4,10,7,4,3,15,7,8,3,7,3,19,1,1,4,29,18,16,6,2,4,2,14,1,246,4,3,8,17,1,2,7,29,19,4,1,10,1,2,5,3,3,1,5,4,1,8,15,6,1,3,4,5,31,14,4,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33,4,47,361,255,236,633,98,24,44,61,22,117,38,34,72,1,48,454,180,259,59,0,255,94,113,1,123,294,92,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,210821,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,214892,0,0,214892,-207338,0,-207338,0,0,0,0,7554 +"423800",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1415,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,113,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71,0,0,0,0,0,0,0,0,66,1,275,71,181,226,0,0,0,0,0,0,0,170,65,209,62,6,8,27,41,299,668,121,90,10,235,381,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,229,189,65,0,0,15,1,137,8,134,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,718,230,25,8,87,4,550,0,87,345,0,0,0,153310,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,34,1,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,161262,0,0,161262,-158324,0,-158324,0,0,0,0,2939 +"423A00",0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,0,1,16,46,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,377,193,306,45,69,24,59,243,220,73,54,96,7,15,36,155,100,103,46,2,227,22,134,49,195,109,41,153,28,319,981,688,80,19,52,30,176,0,288,79,123,317,11,70,184,160,0,0,0,0,0,0,0,0,0,69,129,71,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,213,8,60,244,151,245,67,0,0,0,0,0,229,229,83,140,100,150,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,147,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,261244,0,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,180657,0,0,0,0,0,0,0,0,0,31,19,13,18,1836,184,2,30,36,94,2974,423,79,0,1,0,0,0,0,0,0,0,0,0,0,0,0,12,171,0,0,112,464,246,0,20,71,23,230,29,71,20,935,8,0,58,24,53,12,85,746,18,19,0,0,97,210,0,0,0,0,0,0,0,0,0,0,0,0,0,128,182,31,182,571,1398,100,531,524,820,274,160,0,87,0,44,0,2265,6,105,0,63,200,0,0,0,0,0,3,0,0,0,0,0,0,197807,0,0,197807,-197807,0,-197807,0,0,0,0,0 +"481000",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77,0,0,0,0,0,0,0,0,338765,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,338842,3861,0,342702,0,0,0,0,15394,0,15394,358096 +"541511",0,0,0,0,0,0,0,0,0,0,0,0,0,115,1,0,0,0,0,7,30,357,135,1,0,0,386,0,0,0,0,0,0,0,0,0,0,1,7,9,4,8,1,9,3,5,1,1,3,1,2,1,24,8,1,1,6,2,6,5,9,8,2,15,20,14,29,38,4,6,6,9,16,36,11,6,4,28,10,12,17,30,45,13,49,49,15,73,19,7,61,11,67,23,11,18,12,11,14,6,7,24,15,22,62,7,16,7,44,26,168,29,65,29,71,27,241,74,168,83,149,21,75,12,46,44,16,44,29,14,4,23,3,12,21,29,27,37,12,8,16,29,5,20,33,18,8,11,7,4,9,24,24,31,28,34,58,24,244,89,118,66,17,13,15,7,3,2,4,12,6,3,3,1,5,7,1,100,83,13,21,37,15,26,7,7,48,71,2,2,3,2,1,1,2,7,3,3,9,3,10,4,7,8,0,8,3,4,2,1,3,7,14,9,9,2,3,0,3,0,4,2,4,20,1,0,5,3,23,9,3,4,3,187,11,21,4,3,5,14,10,7,21,27,30,18,24,168,21,27,12,7,16,9,22,22,4,39,21,11,4,7,8,7,69,11,4,11,106,1189,265,468,812,107,102,29,291,1485,0,67,8,0,8,29,0,13,1168,286,99,115,8,80,1,20,230,43,123,210,121,79,44,7746,303,14,166,80,1154,238,179,5065,392,107,1157,1979,660,641,325,1282,1166,2,0,75,230,31,27,34,36,359,116107,67636,2678,819,1691,3369,387,1073,611,100,52,368,276,11270,5064,5,1129,25,597,480,133,185,19,674,3352,659,172,1,26,229,193,51,88,2493,6,23,73,2,36,11,21,4,26,34,3,31,9,37,1,1,0,1,144,25,0,0,0,0,63,39,231,489,0,1769,1959,61,125,376,748,2435,1708,0,0,0,269868,13253,0,283121,0,0,0,0,1714,0,1714,284835 +"541512",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,37,0,0,0,0,0,0,237,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3555,0,0,0,0,40,12,123,5263,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9598,163940,9162,0,0,2880,87,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,7,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1580,51928,2589,0,0,0,0,0,0,0,0,4,109,0,0,190,0,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,153,0,0,0,0,0,0,1026,0,0,0,57726,0,0,57726,0,0,0,0,107,0,107,57833 +"541700",0,0,0,0,0,0,0,0,0,0,0,0,0,946,8,24,44,12,16,75,269,107,28,3,0,0,15,0,0,0,0,0,0,0,0,0,39,19,20,22,69,155,36,181,50,94,32,19,47,15,36,23,149,152,5,9,42,17,48,44,44,36,9,57,67,139,473,335,16,131,24,37,55,383,56,93,15,799,39,45,79,103,348,60,385,462,272,507,413,141,1032,65,407,132,106,154,132,178,393,107,119,576,124,166,405,47,115,52,315,621,9918,1194,1965,2549,4059,1167,12646,1668,4348,1170,2745,254,985,673,1250,583,218,1178,131,49,38,163,60,266,202,257,269,403,97,63,134,229,40,166,2449,1249,452,441,249,158,362,1079,874,1378,933,1274,2287,1211,7404,3203,2466,2854,1723,0,0,0,368,1140,421,0,0,0,0,0,82,135,26,3567,2658,352,532,655,98,192,65,44,300,677,87,97,79,80,26,34,59,184,150,159,148,71,190,56,106,164,18,143,61,158,64,105,141,206,229,129,116,37,50,18,86,89,35,18,46,180,62,13,152,79,43,108,27,62,266,119,7,131,15,12,17,348,205,110,398,510,265,130,3869,30040,3274,4415,429,288,269,158,906,727,54,484,297,154,59,86,97,97,839,220,80,185,4,357,11,10,24,9,5,2,16,51,0,3,1,0,1,2,0,1,4565,34,261,314,34,217,55,189,558,162,400,12,13,8,4,21158,1123,68,1836,672,1898,397,332,9556,10629,1482,748,1198,308,795,365,1360,483,4,0,54,231,28,31,21,88,79,4317,4429,827,148,2336,1016,282,250340,108,14,6,55,78,5408,139,1,1066,1,22,9,4,4,5,0,30082,20,61,1,47,37,32,7,8,7057,1,8,11,1,3,0,1,0,1,2,1,1,1,2,0,0,0,0,10,1,0,0,0,0,2,0,0,0,0,19508,17239,0,0,0,47086,730,0,0,0,0,616804,30833,0,647637,0,0,0,0,40,0,40,647677 +"541800",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,1,0,0,0,0,0,0,0,0,11,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,20,0,283,0,0,0,0,0,1,78,8,2673,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,3,0,1,0,0,0,224,9,2,0,32,16413,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,1,0,0,174,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,11412,12650,961,2325,0,197,0,54998,38057,5020,4,170,0,106888,133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127776,0,0,0,0,0,301,0,0,0,19,0,0,12946,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,5450,137,1856,124,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,93,882,0,0,0,0,0,0,0,0,0,0,0,0,402582,7593,0,410175,0,0,0,0,2955,0,2955,413130 +"541400",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3468,0,0,0,0,0,0,0,0,0,3468,-26,0,3441,0,0,0,0,0,0,0,3441 +"T017",38216,67413,18806,29958,19868,27160,38538,88052,44568,33065,18766,8480,25650,245652,35823,13355,15624,16462,18208,26962,79752,365849,64126,14813,45025,94786,200524,80273,160242,75093,250167,63523,114163,102085,254640,135588,32968,24547,25614,25206,8137,26370,8355,31668,6424,12537,8110,4835,5026,4361,6293,5067,88108,22941,5889,2796,26934,10252,21923,14050,17089,12768,6790,12960,11231,9451,46725,43479,7144,8392,17955,8650,9202,37941,29569,25930,4851,26070,6198,6195,13043,13875,25067,7948,32486,17586,8827,31444,4912,1645,19850,4453,33255,6028,6595,9465,7891,8983,12997,3175,4976,25654,9160,17513,30348,3355,7006,2653,23115,11651,19035,5298,8751,7908,29741,5448,64183,20012,30058,33425,53861,3195,11471,5904,12042,15890,9526,13200,3111,1867,1500,11951,3595,19044,5345,10290,12093,10666,7502,2423,11411,14313,3439,10835,40000,212846,26192,14892,11042,5565,17704,39889,24026,41967,31795,37909,65677,27452,149569,46666,37139,19803,9506,12800,25522,10467,7579,7647,8768,15060,12304,4086,4910,3377,7293,19020,10189,42948,35082,4760,6467,5671,7951,10286,2016,2851,13727,26862,23248,31524,16381,9737,9471,32660,10140,37006,32474,33515,47785,23871,43719,7772,67560,148627,13818,43112,26376,38776,13770,11788,21727,29809,44863,29556,21184,12167,47425,7085,13273,7035,9751,3506,9064,10867,4829,6825,37741,32834,64649,21459,5687,11382,4603,80677,3196,494281,13203,10833,20000,54183,9594,6970,31485,116273,88646,15134,15008,182277,17621,35766,17141,14900,27818,15038,39545,43002,4276,42866,39196,18797,4465,9865,10931,11131,99611,19736,5359,18257,132717,201491,228747,173715,270531,211954,173300,61861,336977,51875,0,309788,226985,195946,121484,103096,93663,123876,276509,185299,214601,81045,54799,366619,77284,47995,141492,96928,123701,26038,27642,38494,10842,281109,129761,18217,92801,108040,330610,249104,44156,175248,180015,8443,398838,657055,349050,198987,88447,567910,362909,157323,1555683,496703,1265134,64106,87786,27375,157204,339319,152686,269552,49081,171070,329208,251691,53324,255320,128849,35233,12489,42489,88232,567114,385839,193478,64882,29554,79528,58762,66053,55186,113865,48099,233920,74574,494361,129727,103796,163091,55022,90118,34752,843933,186186,54735,117803,52663,53043,26930,48962,45205,51321,20528,21158,35404,87055,258207,347105,317136,100899,131352,20997,42351,23952,79575,23216,28173,67381,100432,59649,99722,18684,624290,405353,69731,15873,15546,1019982,312935,935967,16928,63412,292843,33772564,2689895,-63591,36398869,0,0,0,38513,716927,-59875,695566,37094434 diff --git a/flowsa/data/external_data/Detail_Supply_2017_metadata.json b/flowsa/data/external_data/Detail_Supply_2017_metadata.json new file mode 100644 index 000000000..0f40452e5 --- /dev/null +++ b/flowsa/data/external_data/Detail_Supply_2017_metadata.json @@ -0,0 +1,14 @@ +{ + "tool": ["useeior"], + "name_data": ["Detail_Supply_2017"], + "tool_version": ["1.4.0"], + "ext": ["json"], + "date_created": ["2023-10-12"], + "data_meta": { + "data_year": [2017], + "author": ["US Bureau of Economic Analysis"], + "source_url": ["https://apps.bea.gov/industry/iTables%20Static%20Files/AllTablesSUP.zip"], + "date_last_modified": ["2023-09-25"], + "date_accessed": ["2023-10-12"] + } +} diff --git a/flowsa/data_source_scripts/BEA.py b/flowsa/data_source_scripts/BEA.py index 5b99c4191..59de1c71a 100644 --- a/flowsa/data_source_scripts/BEA.py +++ b/flowsa/data_source_scripts/BEA.py @@ -7,7 +7,7 @@ Generation of BEA Gross Output data and industry transcation data as FBA, Source csv files for BEA data are documented -in scripts/write_BEA_Use_from_useeior.py +in scripts/write_BEA_data_from_useeior.py """ import pandas as pd diff --git a/scripts/write_BEA_Use_from_useeior.py b/scripts/write_BEA_data_from_useeior.py similarity index 85% rename from scripts/write_BEA_Use_from_useeior.py rename to scripts/write_BEA_data_from_useeior.py index 85fa61004..93e0afaa3 100644 --- a/scripts/write_BEA_Use_from_useeior.py +++ b/scripts/write_BEA_data_from_useeior.py @@ -1,4 +1,4 @@ -# write_BEA_Use_from_useeior.py (scripts) +# write_BEA_data_from_useeior.py (scripts) # !/usr/bin/env python3 # coding=utf-8 @@ -29,7 +29,7 @@ USEEIOR's Detail_Use_SUT_2017.rda on 10/12/2023. The original file is found here: -https://github.com/USEPA/useeior/blob/master/data/Detail_Use_2012_PRO_BeforeRedef.rda +https://github.com/USEPA/useeior/blob/master/data/Detail_Use_SUT_2017.rd csv obtained by running the following code in Rstudio: use2017 <- get('Detail_Use_SUT_2017') @@ -56,6 +56,20 @@ "date_last_modified": ["2021-09-29"], "date_accessed": ["2022-07-27"] +--- +The Detail_Supply_2017 was pulled from +USEEIOR's Detail_Supply_2017.rda on 10/12/2023. + +The original file is found here: +https://github.com/USEPA/useeior/blob/master/data/Detail_Use_2012_PRO_BeforeRedef.rda + +csv obtained by running the following code in Rstudio: +supply2017 <- get('Detail_Supply_2017') +write.csv(supply2017, file='Detail_Supply_2017.csv') +CSV manually added to flowsa +The metadata file 'Detail_Supply_2017_metadata.json' was manually copied from useeior/extdata/metadata +--- + --- The BEA_Detail_GrossOutput was pulled from USEEIOR's Detail_GrossOutput_IO.rda on 08/11/2022. From 660a40ef03d906fb6526316ed1c10d996e7f3d1b Mon Sep 17 00:00:00 2001 From: Wesley Ingwersen Date: Thu, 12 Oct 2023 09:37:46 -0400 Subject: [PATCH 1019/1127] Fix permalinks to useeior 2017 detail Supply and Use rdata --- scripts/write_BEA_data_from_useeior.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/write_BEA_data_from_useeior.py b/scripts/write_BEA_data_from_useeior.py index 93e0afaa3..029981b0d 100644 --- a/scripts/write_BEA_data_from_useeior.py +++ b/scripts/write_BEA_data_from_useeior.py @@ -29,7 +29,7 @@ USEEIOR's Detail_Use_SUT_2017.rda on 10/12/2023. The original file is found here: -https://github.com/USEPA/useeior/blob/master/data/Detail_Use_SUT_2017.rd +https://github.com/USEPA/useeior/blob/e02d979f099bbd60625e9c31099f89c111f2d654/data/Detail_Use_SUT_2017.rda csv obtained by running the following code in Rstudio: use2017 <- get('Detail_Use_SUT_2017') @@ -61,7 +61,7 @@ USEEIOR's Detail_Supply_2017.rda on 10/12/2023. The original file is found here: -https://github.com/USEPA/useeior/blob/master/data/Detail_Use_2012_PRO_BeforeRedef.rda +https://github.com/USEPA/useeior/blob/e02d979f099bbd60625e9c31099f89c111f2d654/data/Detail_Supply_2017.rda csv obtained by running the following code in Rstudio: supply2017 <- get('Detail_Supply_2017') From 39a0f87d7afe5abc89a42fbc83cd58328cc88011 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 12 Oct 2023 10:01:18 -0400 Subject: [PATCH 1020/1127] consolidate scripts from merge conflict replicate c93e7a0 --- scripts/pull_BEA_Make_and_Use_csv.py | 75 -------------------------- scripts/write_BEA_data_from_useeior.py | 70 ++++++++++-------------- 2 files changed, 29 insertions(+), 116 deletions(-) delete mode 100644 scripts/pull_BEA_Make_and_Use_csv.py diff --git a/scripts/pull_BEA_Make_and_Use_csv.py b/scripts/pull_BEA_Make_and_Use_csv.py deleted file mode 100644 index 1276ad0d7..000000000 --- a/scripts/pull_BEA_Make_and_Use_csv.py +++ /dev/null @@ -1,75 +0,0 @@ -# pull_BEA_Make_and_Use_csv.py (scripts) -# !/usr/bin/env python3 -# coding=utf-8 - -""" -BEA data are imported from useeior and stored as csv files in 'external_data' -folder of flowsa - ---- -The BEA_Detail_Use_PRO_BeforeRedef was pulled from -USEEIOR's Detail_Use_YEAR_PRO_BeforeRedef.rda on 09/06/2023. - -One of the original files is found here: -https://github.com/USEPA/useeior/blob/master/data/Detail_Use_2012_PRO_BeforeRedef.rda - -csv obtained by running the following code in Rstudio: -bea <- get('Detail_Use_2012_PRO_BeforeRedef') -write.csv(bea, file='BEA_Detail_Use_2012_PRO_BeforeRedef.csv') - -CSV manually added to flowsa - ---- - -The BEA_YEAR_Detail_Make_BeforeRedef was pulled from USEEIOR's -Detail_Make_YEAR_BeforeRedef.rda on 09/06/2023. - -One of the original files is found here: -https://github.com/USEPA/useeior/blob/master/data/Detail_Make_2012_BeforeRedef.rda - -csv obtained by running the following code in Rstudio: -bea <- get('Detail_Make_2012_BeforeRedef') -write.csv(bea, file='BEA_Detail_Make_2012_BeforeRedef.csv') - -CSV manually added to flowsa - ---- -The BEA_Detail_GrossOutput was pulled from -USEEIOR's Detail_GrossOutput_IO.rda on 09/06/2023. - -The original file is found here: -https://github.com/USEPA/useeior/blob/master/data/Detail_GrossOutput_IO.rda - -csv obtained by running the following code in Rstudio: -bea <- get('Detail_GrossOutput_IO') -write.csv(bea, file='BEA_Detail_GrossOutput_IO.csv') - -CSV manually added to flowsa - -""" - -# package to read r code no longer working, so reverting to manually -# importing BEA data from useeior - -# from rpy2.robjects.packages import importr -# from rpy2.robjects import pandas2ri -# from flowsa.settings import externaldatapath -# -# pandas2ri.activate() -# -# useeior = importr('useeior') -# -# model_with_detail_2012_tables = 'USEEIOv2.0-GHG' -# model = useeior.buildEEIOModel(model_with_detail_2012_tables) -# -# # Get the UseTransactions object embedded within the BEA data -# UseIndustryTransactions = model.rx2("BEA").rx2("UseTransactions") -# # Convert to a pandas dataframe -# UseIndustryTransactions = pandas2ri.ri2py_dataframe(UseIndustryTransactions) -# -# # Get the vector of model industries -# Industries = model.rx2("BEA").rx2("Industries") -# # Apply it to the df index -# UseIndustryTransactions.index = Industries -# # Write out to csv -# UseIndustryTransactions.to_csv(f"{externaldatapath}/BEA_2012_Detail_Use_Industry_Transactions.csv") diff --git a/scripts/write_BEA_data_from_useeior.py b/scripts/write_BEA_data_from_useeior.py index 029981b0d..2fbab8532 100644 --- a/scripts/write_BEA_data_from_useeior.py +++ b/scripts/write_BEA_data_from_useeior.py @@ -3,17 +3,14 @@ # coding=utf-8 """ -A script to get Use table transactions from a useeior EEIOmodel. - -- Store them as .csv -- Depends on rpy2 and tzlocal as well as having R installed and useeior installed. - +BEA data are imported from useeior and stored as csv files in 'external_data' +folder of flowsa --- -The BEA_Detail_Use_PRO_BeforeRedef_2012 was pulled from -USEEIOR's Detail_Use_2012_PRO_BeforeRedef.rda on 08/11/2022. +The BEA_Detail_Use_PRO_BeforeRedef was pulled from +USEEIOR's Detail_Use_YEAR_PRO_BeforeRedef.rda on 09/06/2023. -The original file is found here: +One of the original files is found here: https://github.com/USEPA/useeior/blob/master/data/Detail_Use_2012_PRO_BeforeRedef.rda csv obtained by running the following code in Rstudio: @@ -22,8 +19,6 @@ CSV manually added to flowsa ---- - --- The Detail_Use_SUT_2017 was pulled from USEEIOR's Detail_Use_SUT_2017.rda on 10/12/2023. @@ -39,11 +34,10 @@ --- +The BEA_YEAR_Detail_Make_BeforeRedef was pulled from USEEIOR's +Detail_Make_YEAR_BeforeRedef.rda on 09/06/2023. -The BEA_2012_Detail_Make_BeforeRedef was pulled from USEEIOR's -Detail_Make_2012_BeforeRedef.rda on 08/11/2022. - -The original file is found here: +One of the original files is found here: https://github.com/USEPA/useeior/blob/master/data/Detail_Make_2012_BeforeRedef.rda csv obtained by running the following code in Rstudio: @@ -52,10 +46,6 @@ CSV manually added to flowsa -https://github.com/USEPA/useeior/commit/2eece7a -"date_last_modified": ["2021-09-29"], -"date_accessed": ["2022-07-27"] - --- The Detail_Supply_2017 was pulled from USEEIOR's Detail_Supply_2017.rda on 10/12/2023. @@ -72,7 +62,7 @@ --- The BEA_Detail_GrossOutput was pulled from -USEEIOR's Detail_GrossOutput_IO.rda on 08/11/2022. +USEEIOR's Detail_GrossOutput_IO.rda on 09/06/2023. The original file is found here: https://github.com/USEPA/useeior/blob/master/data/Detail_GrossOutput_IO.rda @@ -81,34 +71,32 @@ bea <- get('Detail_GrossOutput_IO') write.csv(bea, file='BEA_Detail_GrossOutput_IO.csv') -https://github.com/USEPA/useeior/commit/2eece7a -"date_last_modified": ["2021-10-04"], -"date_accessed": ["2022-07-27"] - CSV manually added to flowsa - """ -from rpy2.robjects.packages import importr -from rpy2.robjects import pandas2ri -from flowsa.settings import externaldatapath +# package to read r code no longer working, so reverting to manually +# importing BEA data from useeior + +# from rpy2.robjects.packages import importr +# from rpy2.robjects import pandas2ri +# from flowsa.settings import externaldatapath -pandas2ri.activate() +# pandas2ri.activate() -useeior = importr('useeior') +# useeior = importr('useeior') -model_with_detail_2012_tables = 'USEEIOv2.0-GHG' -model = useeior.buildEEIOModel(model_with_detail_2012_tables) +# model_with_detail_2012_tables = 'USEEIOv2.0-GHG' +# model = useeior.buildEEIOModel(model_with_detail_2012_tables) -# Get the UseTransactions object embedded within the BEA data -UseIndustryTransactions = model.rx2("BEA").rx2("UseTransactions") -# Convert to a pandas dataframe -UseIndustryTransactions = pandas2ri.ri2py_dataframe(UseIndustryTransactions) +# # Get the UseTransactions object embedded within the BEA data +# UseIndustryTransactions = model.rx2("BEA").rx2("UseTransactions") +# # Convert to a pandas dataframe +# UseIndustryTransactions = pandas2ri.ri2py_dataframe(UseIndustryTransactions) -# Get the vector of model industries -Industries = model.rx2("BEA").rx2("Industries") -# Apply it to the df index -UseIndustryTransactions.index = Industries -# Write out to csv -UseIndustryTransactions.to_csv(f"{externaldatapath}/BEA_2012_Detail_Use_Industry_Transactions.csv") +# # Get the vector of model industries +# Industries = model.rx2("BEA").rx2("Industries") +# # Apply it to the df index +# UseIndustryTransactions.index = Industries +# # Write out to csv +# UseIndustryTransactions.to_csv(f"{externaldatapath}/BEA_2012_Detail_Use_Industry_Transactions.csv") From d51143684cecc7d32dca410daefe7551db9fdd1e Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 12 Oct 2023 12:22:32 -0400 Subject: [PATCH 1021/1127] add state/detail methods for individual CAP_HAP sources, add revised state and national 2017 CAP_HAP built from state detail fbs --- .../CAP_HAP_Nonpoint_2017.yaml | 79 +++++++++++++++++++ .../CAP_HAP_Nonroad_2017.yaml | 38 +++++++++ .../CAP_HAP_Onroad_2017.yaml | 37 +++++++++ .../flowbysectormethods/CAP_HAP_common.yaml | 28 +++---- .../CAP_HAP_national_2017_m1.yaml | 45 +++-------- .../CAP_HAP_state_2017_m1.yaml | 28 +++++++ 6 files changed, 201 insertions(+), 54 deletions(-) create mode 100644 flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2017.yaml create mode 100644 flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2017.yaml create mode 100644 flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2017.yaml create mode 100644 flowsa/methods/flowbysectormethods/CAP_HAP_state_2017_m1.yaml diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2017.yaml new file mode 100644 index 000000000..c0d281e33 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2017.yaml @@ -0,0 +1,79 @@ +# This is the 2017 target year method for CAP_HAP which builds off the generic +# method in CAP_HAP_common. This state level method is at the detail level. +# This FBS is for the Nonpoint portion ONLY + +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: state + +_emission_year: &year 2017 + +_attribution_sources: + BEA_Detail_Use_PRO_BeforeRedef: &bea + # UPDATE_BEA_2017_DETAIL: &bea + year: 2012 + geoscale: national + activity_to_sector_mapping: BEA_2012_Detail + # activity_to_sector_mapping: BEA_2017_Detail + attribution_method: proportional + attribution_source: + Employment_national_2012: + data_format: FBS + year: 2012 + +sources_to_cache: + EIA_MECS_Energy: + !include:CAP_HAP_common.yaml:sources_to_cache:EIA_MECS_Energy_state + year: 2018 + attribution_source: + Employment_state_2018: # Update to MECS year + geoscale: national # Uses national at this stage prior to attributing to states + year: 2018 + clean_source: Employment_state_2018 + +source_names: + EPA_NEI_Nonpoint: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint + year: *year + activity_sets: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets + + # Update some activities with correct BEA year + mobile_and_fuel_storage: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:mobile_and_fuel_storage + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # Petroleum + + fertilizers: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:fertilizers + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + + pesticides: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:pesticides + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325320': ''} # Pesticides + + output_allocation: # Gross Output + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:output_allocation + attribution_source: + BEA_Detail_GrossOutput_IO: + year: 2017 + geoscale: national + activity_to_sector_mapping: BEA_2012_Detail + attribution_method: proportional + attribution_source: + Employment_national_2017: + data_format: FBS + year: 2017 + diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2017.yaml new file mode 100644 index 000000000..ddea6cd32 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2017.yaml @@ -0,0 +1,38 @@ +# This is the 2017 target year method for CAP_HAP which builds off the generic +# method in CAP_HAP_common. This state level method is at the detail level. +# This FBS is for the Nonroad portion ONLY + +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: state + +_emission_year: &year 2017 + +_attribution_sources: + BEA_Detail_Use_PRO_BeforeRedef: &bea + # UPDATE_BEA_2017_DETAIL: &bea + year: 2012 + geoscale: national + activity_to_sector_mapping: BEA_2012_Detail + # activity_to_sector_mapping: BEA_2017_Detail + attribution_method: proportional + attribution_source: + Employment_national_2012: + data_format: FBS + year: 2012 + +source_names: + EPA_NEI_Nonroad: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad + year: *year + activity_sets: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad:activity_sets + offroad_vehicles_equipment: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad:activity_sets:offroad_vehicles_equipment + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # Petroleum + diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2017.yaml new file mode 100644 index 000000000..8637d7cc3 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2017.yaml @@ -0,0 +1,37 @@ +# This is the 2017 target year method for CAP_HAP which builds off the generic +# method in CAP_HAP_common. This state level method is at the detail level. +# This FBS is for the Onroad portion ONLY + +industry_spec: + default: NAICS_6 +target_naics_year: 2012 +geoscale: state + +_emission_year: &year 2017 + +_attribution_sources: + BEA_Detail_Use_PRO_BeforeRedef: &bea + # UPDATE_BEA_2017_DETAIL: &bea + year: 2012 + geoscale: national + activity_to_sector_mapping: BEA_2012_Detail + # activity_to_sector_mapping: BEA_2017_Detail + attribution_method: proportional + attribution_source: + Employment_national_2012: + data_format: FBS + year: 2012 + +source_names: + EPA_NEI_Onroad: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad + year: *year + activity_sets: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad:activity_sets + onroad_vehicles_gas_stations: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad:activity_sets:onroad_vehicles_gas_stations + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # Petroleum diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml index 68164c06a..27958d132 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml @@ -2,11 +2,6 @@ # Year-specific CAP_HAP files import this file to define attribution rules # that are further customized -industry_spec: - default: NAICS_6 -target_naics_year: 2012 -geoscale: national - sources_to_cache: EIA_MECS_Energy: # year: 2018 # Specify target MECS year @@ -227,19 +222,16 @@ source_names: selection_fields: PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv output_allocation attribution_method: proportional - # attribution_source: # document in primary method file - # BEA_Detail_GrossOutput_IO: - # year: 2017 - # geoscale: national - # activity_to_sector_mapping: BEA_2012_Detail - # selection_fields: - # Class: Money - # FlowName: Gross Output - # attribution_method: proportional - # attribution_source: - # Employment_national_2017: - # data_format: FBS - # year: 2017 + attribution_source: + BEA_Detail_GrossOutput_IO: + # year: 2017 + geoscale: national + activity_to_sector_mapping: BEA_2012_Detail + # attribution_method: proportional + # attribution_source: + # Employment_national_2017: + # data_format: FBS + # year: 2017 EPA_NEI_Nonroad: diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m1.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m1.yaml index 609a0eab3..ef2f819c9 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m1.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m1.yaml @@ -1,5 +1,5 @@ -# This is the 2017 target year method for CAP_HAP which builds off the generic -# method in CAP_HAP_common +# This is the 2017 target year method for National detail models +# It aggregates the state detail models industry_spec: default: NAICS_6 @@ -8,47 +8,20 @@ geoscale: national _emission_year: &year 2017 -sources_to_cache: - EIA_MECS_Energy: - !include:CAP_HAP_common.yaml:sources_to_cache:EIA_MECS_Energy - year: 2018 - attribution_source: - Employment_national_2018: - data_format: FBS - year: 2018 - source_names: - EPA_NEI_Nonpoint: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint + CAP_HAP_Nonpoint_2017: # detail state model year: *year - activity_sets: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets - output_allocation: # Gross Output - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv output_allocation - attribution_method: proportional - attribution_source: - BEA_Detail_GrossOutput_IO: - year: 2017 - geoscale: national - activity_to_sector_mapping: BEA_2012_Detail - selection_fields: - Class: Money - FlowName: Gross Output - attribution_method: proportional - attribution_source: - Employment_national_2017: - data_format: FBS - year: 2017 + data_format: FBS - EPA_NEI_Nonroad: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad + CAP_HAP_Nonroad_2017: # detail state model year: *year + data_format: FBS - EPA_NEI_Onroad: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad + CAP_HAP_Onroad_2017: # detail state model year: *year + data_format: FBS + # If necessary can get stewi data directly from source stewiFBS: !include:CAP_HAP_common.yaml:source_names:stewiFBS inventory_dict: diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017_m1.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017_m1.yaml new file mode 100644 index 000000000..8bcb9877f --- /dev/null +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017_m1.yaml @@ -0,0 +1,28 @@ +# This is the 2017 target year method for Summary state models +# It aggregates the detail models to the summary level + +!include:USEEIO_summary_target.yaml +target_naics_year: 2012 +geoscale: state +_emission_year: &year 2017 + +source_names: + CAP_HAP_Nonpoint_2017: # detail state model + year: *year + data_format: FBS + + CAP_HAP_Nonroad_2017: # detail state model + year: *year + data_format: FBS + + CAP_HAP_Onroad_2017: # detail state model + year: *year + data_format: FBS + + # If necessary can get stewi data directly from source + stewiFBS: + !include:CAP_HAP_common.yaml:source_names:stewiFBS + inventory_dict: + NEI: *year + TRI: *year + local_inventory_name: NEI_TRI_air_2017 From 006d4b115911db77679af3ad7ca35189379756bc Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 12 Oct 2023 12:23:17 -0400 Subject: [PATCH 1022/1127] temporarily maintain m2 without pulling from new m1 --- .../CAP_HAP_national_2017_m2.yaml | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m2.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m2.yaml index cc67eb5f0..5d9c8a0d1 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m2.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m2.yaml @@ -19,9 +19,28 @@ sources_to_cache: source_names: EPA_NEI_Nonpoint: - !include:CAP_HAP_national_2017_m1.yaml:source_names:EPA_NEI_Nonpoint + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint apply_urban_rural: True year: *year + activity_sets: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets + output_allocation: # Gross Output + selection_fields: + PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv output_allocation + attribution_method: proportional + attribution_source: + BEA_Detail_GrossOutput_IO: + year: 2017 + geoscale: national + activity_to_sector_mapping: BEA_2012_Detail + selection_fields: + Class: Money + FlowName: Gross Output + attribution_method: proportional + attribution_source: + Employment_national_2017: + data_format: FBS + year: 2017 EPA_NEI_Nonroad: !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad From d11e9de13f70f194ca6764021dbd6cb40bb7cce6 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 12 Oct 2023 12:23:47 -0400 Subject: [PATCH 1023/1127] remove comment --- flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m1.yaml | 1 - flowsa/methods/flowbysectormethods/CAP_HAP_state_2017_m1.yaml | 1 - 2 files changed, 2 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m1.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m1.yaml index ef2f819c9..0bbbd25dd 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m1.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m1.yaml @@ -21,7 +21,6 @@ source_names: year: *year data_format: FBS - # If necessary can get stewi data directly from source stewiFBS: !include:CAP_HAP_common.yaml:source_names:stewiFBS inventory_dict: diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017_m1.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017_m1.yaml index 8bcb9877f..295cac383 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017_m1.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017_m1.yaml @@ -19,7 +19,6 @@ source_names: year: *year data_format: FBS - # If necessary can get stewi data directly from source stewiFBS: !include:CAP_HAP_common.yaml:source_names:stewiFBS inventory_dict: From 9fffbd93832530cbd63ca6f99ada3e06ce351cbe Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 12 Oct 2023 10:41:09 -0600 Subject: [PATCH 1024/1127] new 2017 bea FBAs --- ...pply_2017.csv => BEA_Detail_Supply_2017.csv} | 0 ...son => BEA_Detail_Supply_2017_metadata.json} | 0 ...SUT_2017.csv => BEA_Detail_Use_SUT_2017.csv} | 0 ...on => BEA_Detail_Use_SUT_2017_metadata.json} | 0 flowsa/data_source_scripts/BEA.py | 17 +++++++++++++++-- .../BEA_Detail_Supply.yaml | 10 ++++++++++ .../BEA_Detail_Use_SUT.yaml | 10 ++++++++++ scripts/write_BEA_data_from_useeior.py | 8 ++++---- 8 files changed, 39 insertions(+), 6 deletions(-) rename flowsa/data/external_data/{Detail_Supply_2017.csv => BEA_Detail_Supply_2017.csv} (100%) rename flowsa/data/external_data/{Detail_Supply_2017_metadata.json => BEA_Detail_Supply_2017_metadata.json} (100%) rename flowsa/data/external_data/{Detail_Use_SUT_2017.csv => BEA_Detail_Use_SUT_2017.csv} (100%) rename flowsa/data/external_data/{Detail_Use_SUT_2017_metadata.json => BEA_Detail_Use_SUT_2017_metadata.json} (100%) create mode 100644 flowsa/methods/flowbyactivitymethods/BEA_Detail_Supply.yaml create mode 100644 flowsa/methods/flowbyactivitymethods/BEA_Detail_Use_SUT.yaml diff --git a/flowsa/data/external_data/Detail_Supply_2017.csv b/flowsa/data/external_data/BEA_Detail_Supply_2017.csv similarity index 100% rename from flowsa/data/external_data/Detail_Supply_2017.csv rename to flowsa/data/external_data/BEA_Detail_Supply_2017.csv diff --git a/flowsa/data/external_data/Detail_Supply_2017_metadata.json b/flowsa/data/external_data/BEA_Detail_Supply_2017_metadata.json similarity index 100% rename from flowsa/data/external_data/Detail_Supply_2017_metadata.json rename to flowsa/data/external_data/BEA_Detail_Supply_2017_metadata.json diff --git a/flowsa/data/external_data/Detail_Use_SUT_2017.csv b/flowsa/data/external_data/BEA_Detail_Use_SUT_2017.csv similarity index 100% rename from flowsa/data/external_data/Detail_Use_SUT_2017.csv rename to flowsa/data/external_data/BEA_Detail_Use_SUT_2017.csv diff --git a/flowsa/data/external_data/Detail_Use_SUT_2017_metadata.json b/flowsa/data/external_data/BEA_Detail_Use_SUT_2017_metadata.json similarity index 100% rename from flowsa/data/external_data/Detail_Use_SUT_2017_metadata.json rename to flowsa/data/external_data/BEA_Detail_Use_SUT_2017_metadata.json diff --git a/flowsa/data_source_scripts/BEA.py b/flowsa/data_source_scripts/BEA.py index 0863d0920..892d1570f 100644 --- a/flowsa/data_source_scripts/BEA.py +++ b/flowsa/data_source_scripts/BEA.py @@ -10,6 +10,7 @@ in scripts/write_BEA_data_from_useeior.py """ +import numpy as np import pandas as pd from flowsa.location import US_FIPS from flowsa.settings import externaldatapath @@ -25,14 +26,18 @@ def bea_parse(*, source, year, **_): if 'Make' in source: filename = source.replace('_Make_', f'_Make_{year}_') + elif 'Use_SUT' in source: + filename = f'{source}_{year}' elif 'Use' in source: filename = source.replace('_Use_', f'_Use_{year}_') + elif 'Supply' in source: + filename = f'{source}_{year}' else: filename = source df = pd.read_csv(externaldatapath / f"{filename}.csv") - if 'BeforeRedef' in source: + if any(substring in source for substring in ['BeforeRedef', 'SUT']): df = df.rename(columns={'Unnamed: 0': 'ActivityProducedBy'}) # use "melt" fxn to convert colummns into rows df = df.melt(id_vars=["ActivityProducedBy"], @@ -57,7 +62,15 @@ def bea_parse(*, source, year, **_): var_name="Year", value_name="FlowAmount") df = df[df['Year'] == year] - + elif 'Supply' in source: + df = np.transpose(df) + df.columns = df.iloc[0] + df = df.reset_index().rename(columns={'index' :'ActivityProducedBy'}) + df = df.drop(df.index[0]) + # use "melt" fxn to convert colummns into rows + df = df.melt(id_vars=["ActivityProducedBy"], + var_name="ActivityConsumedBy", + value_name="FlowAmount") df = df.reset_index(drop=True) # columns relevant to all BEA data diff --git a/flowsa/methods/flowbyactivitymethods/BEA_Detail_Supply.yaml b/flowsa/methods/flowbyactivitymethods/BEA_Detail_Supply.yaml new file mode 100644 index 000000000..04a0d53a6 --- /dev/null +++ b/flowsa/methods/flowbyactivitymethods/BEA_Detail_Supply.yaml @@ -0,0 +1,10 @@ +author: U.S. Bureau of Economic Analysis +source_name: Detail Supply +source_url: 'https://www.bea.gov/industry/input-output-accounts-data#supplemental-estimate-tables' +original_data_download_date: '2023-10-12' +bib_id: BEA_Detail_Supply +format: csv +url: None +parse_response_fxn: !script_function:BEA bea_parse +years: + - 2017 diff --git a/flowsa/methods/flowbyactivitymethods/BEA_Detail_Use_SUT.yaml b/flowsa/methods/flowbyactivitymethods/BEA_Detail_Use_SUT.yaml new file mode 100644 index 000000000..b57f5124a --- /dev/null +++ b/flowsa/methods/flowbyactivitymethods/BEA_Detail_Use_SUT.yaml @@ -0,0 +1,10 @@ +author: U.S. Bureau of Economic Analysis +source_name: Detail Use SUT +source_url: 'https://www.bea.gov/industry/input-output-accounts-data#supplemental-estimate-tables' +original_data_download_date: '2023-10-12' +bib_id: BEA_Detail_Use_SUT +format: csv +url: None +parse_response_fxn: !script_function:BEA bea_parse +years: + - 2017 diff --git a/scripts/write_BEA_data_from_useeior.py b/scripts/write_BEA_data_from_useeior.py index 2fbab8532..cc552bf6a 100644 --- a/scripts/write_BEA_data_from_useeior.py +++ b/scripts/write_BEA_data_from_useeior.py @@ -28,9 +28,9 @@ csv obtained by running the following code in Rstudio: use2017 <- get('Detail_Use_SUT_2017') -write.csv(use2017, file='Detail_Use_SUT_2017.csv') +write.csv(use2017, file='BEA_Detail_Use_SUT_2017.csv') CSV manually added to flowsa -The metadata file 'Detail_Use_SUT_2017_metadata.json' was manually copied from useeior/extdata/metadata +The metadata file 'BEA_Detail_Use_SUT_2017_metadata.json' was manually copied from useeior/extdata/metadata --- @@ -55,9 +55,9 @@ csv obtained by running the following code in Rstudio: supply2017 <- get('Detail_Supply_2017') -write.csv(supply2017, file='Detail_Supply_2017.csv') +write.csv(supply2017, file='BEA_Detail_Supply_2017.csv') CSV manually added to flowsa -The metadata file 'Detail_Supply_2017_metadata.json' was manually copied from useeior/extdata/metadata +The metadata file 'BEA_Detail_Supply_2017_metadata.json' was manually copied from useeior/extdata/metadata --- --- From 9b8152edb1398cb439793dffcab95bd2c8e36b30 Mon Sep 17 00:00:00 2001 From: WesIngwersen Date: Thu, 12 Oct 2023 15:09:17 -0400 Subject: [PATCH 1025/1127] add updated Summary 2017-2022 Supply and Use tables and metadata --- .../external_data/BEA_Summary_Supply_2017.csv | 75 +++++++++++++++++ .../external_data/BEA_Summary_Supply_2018.csv | 75 +++++++++++++++++ .../external_data/BEA_Summary_Supply_2019.csv | 75 +++++++++++++++++ .../external_data/BEA_Summary_Supply_2020.csv | 75 +++++++++++++++++ .../external_data/BEA_Summary_Supply_2021.csv | 75 +++++++++++++++++ .../external_data/BEA_Summary_Supply_2022.csv | 75 +++++++++++++++++ .../BEA_Summary_Use_SUT_2017.csv | 84 +++++++++++++++++++ .../BEA_Summary_Use_SUT_2018.csv | 84 +++++++++++++++++++ .../BEA_Summary_Use_SUT_2019.csv | 84 +++++++++++++++++++ .../BEA_Summary_Use_SUT_2020.csv | 84 +++++++++++++++++++ .../BEA_Summary_Use_SUT_2021.csv | 84 +++++++++++++++++++ .../BEA_Summary_Use_SUT_2022.csv | 84 +++++++++++++++++++ .../Summary_Supply_2017_metadata.json | 14 ++++ .../Summary_Supply_2018_metadata.json | 14 ++++ .../Summary_Supply_2019_metadata.json | 14 ++++ .../Summary_Supply_2020_metadata.json | 14 ++++ .../Summary_Supply_2021_metadata.json | 14 ++++ .../Summary_Supply_2022_metadata.json | 14 ++++ .../Summary_Use_SUT_2017_metadata.json | 14 ++++ .../Summary_Use_SUT_2018_metadata.json | 14 ++++ .../Summary_Use_SUT_2019_metadata.json | 14 ++++ .../Summary_Use_SUT_2020_metadata.json | 14 ++++ .../Summary_Use_SUT_2021_metadata.json | 14 ++++ .../Summary_Use_SUT_2022_metadata.json | 14 ++++ scripts/write_BEA_data_from_useeior.py | 23 +++++ 25 files changed, 1145 insertions(+) create mode 100644 flowsa/data/external_data/BEA_Summary_Supply_2017.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Supply_2018.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Supply_2019.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Supply_2020.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Supply_2021.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Supply_2022.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Use_SUT_2017.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Use_SUT_2018.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Use_SUT_2019.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Use_SUT_2020.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Use_SUT_2021.csv create mode 100644 flowsa/data/external_data/BEA_Summary_Use_SUT_2022.csv create mode 100644 flowsa/data/external_data/Summary_Supply_2017_metadata.json create mode 100644 flowsa/data/external_data/Summary_Supply_2018_metadata.json create mode 100644 flowsa/data/external_data/Summary_Supply_2019_metadata.json create mode 100644 flowsa/data/external_data/Summary_Supply_2020_metadata.json create mode 100644 flowsa/data/external_data/Summary_Supply_2021_metadata.json create mode 100644 flowsa/data/external_data/Summary_Supply_2022_metadata.json create mode 100644 flowsa/data/external_data/Summary_Use_SUT_2017_metadata.json create mode 100644 flowsa/data/external_data/Summary_Use_SUT_2018_metadata.json create mode 100644 flowsa/data/external_data/Summary_Use_SUT_2019_metadata.json create mode 100644 flowsa/data/external_data/Summary_Use_SUT_2020_metadata.json create mode 100644 flowsa/data/external_data/Summary_Use_SUT_2021_metadata.json create mode 100644 flowsa/data/external_data/Summary_Use_SUT_2022_metadata.json diff --git a/flowsa/data/external_data/BEA_Summary_Supply_2017.csv b/flowsa/data/external_data/BEA_Summary_Supply_2017.csv new file mode 100644 index 000000000..b3e1ed354 --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Supply_2017.csv @@ -0,0 +1,75 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","T007","MCIF","MADJ","T013","Trade","Trans","T014","MDTY","TOP","SUB","T015","T016" +"111CA",400552,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,191,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,534,0,401305,41152,0,442458,130784,54070,184854,44,7481,-10115,-2590,624721 +"113FF",3720,52030,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,79,0,0,0,0,735,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,98,0,3133,0,59796,17908,0,77703,9441,4045,13486,10,784,0,794,91983 +"211",0,0,203939,0,254,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,204500,146608,0,351108,15477,47613,63090,138,9035,0,9173,423371 +"212",0,0,53,81145,0,0,0,0,473,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,723,0,82442,5114,0,87556,6559,28257,34817,3,2939,0,2941,125314 +"213",0,0,12925,6022,99321,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,118270,1048,0,119318,0,0,0,0,0,0,0,119318 +"22",0,0,0,0,0,432534,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,79,15731,1151,137560,587217,2431,0,589648,0,0,0,0,29725,0,29725,619374 +"23",0,838,835,9694,6194,2636,1575709,601,695,192,2345,625,46,68,470,739,421,755,166,47,2,80,14,261,122,94,5558,6,0,2287,4618,36,162,1,32,0,116,86,63,16,56,1539,532,2,1,3,0,20343,295,50,2,7,511,75,1075,1,694,414,1226,41,136,581,510,1577,738,488,3,255,0,19991,0,1667776,0,0,1667776,0,0,0,0,1907,0,1907,1669683 +"321",15,0,0,0,0,0,0,105613,29,0,166,0,0,0,0,0,585,66,0,0,0,382,22,0,4,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,107094,21042,0,128135,32051,7387,39438,232,3855,0,4087,171661 +"327",0,0,0,189,0,0,0,141,123693,11,41,61,50,334,1,0,20,37,0,2,17,61,0,167,108,42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124976,24956,0,149931,44278,22681,66959,833,5189,0,6022,222912 +"331",0,0,0,0,0,0,0,0,1,216051,3402,9,41,686,23,1,31,14,0,1,0,0,0,84,5,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,220363,79669,0,300032,29413,11430,40844,371,1706,0,2077,342953 +"332",0,0,0,0,371,0,0,159,96,1416,324953,1547,62,78,808,215,93,313,0,33,0,1,69,1,38,201,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,330454,63659,0,394114,110444,11040,121484,1648,11616,0,13264,528862 +"333",0,0,130,0,0,0,0,0,7,366,2376,359928,508,473,1486,386,86,143,0,3,0,0,2,0,85,227,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,366209,157546,0,523755,166989,15128,182117,1441,12001,0,13442,719315 +"334",0,0,0,0,0,0,0,0,0,1,266,530,298629,208,140,667,14,186,0,15,0,578,5,0,1017,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,463,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,302745,329683,0,632428,246394,9662,256056,915,17666,0,18582,907065 +"335",0,0,0,0,0,0,0,0,136,522,199,1658,585,116723,109,443,29,21,0,0,0,0,1,11,34,187,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,120659,98516,0,219176,95033,7181,102214,2070,7181,-264,8987,330377 +"3361MV",0,0,0,0,0,0,0,0,0,0,493,981,6,579,572007,2236,1,28,0,503,0,0,0,0,1,444,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,577337,321770,0,899107,257115,14709,271824,4108,31520,0,35628,1206559 +"3364OT",0,0,0,0,0,0,0,0,3,0,111,161,683,9,2031,309552,0,24,0,0,0,0,0,0,0,80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,312655,48993,0,361648,26186,4182,30368,243,2394,0,2637,394653 +"337",0,0,0,0,0,0,0,256,22,0,59,8,1,8,5,0,73328,192,0,33,0,0,11,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,74027,43456,0,117483,73511,13446,86957,76,8544,0,8620,213060 +"339",0,0,0,0,0,0,0,0,7,0,161,77,678,25,38,16,161,137959,4,22,10,86,581,0,669,946,4,0,0,0,1635,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,93,0,1135,0,144306,93486,0,237792,202566,13815,216381,1455,14540,0,15995,470168 +"311FT",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,915873,0,902,0,0,0,7994,0,1133,0,8375,2003,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1792,0,938073,91445,0,1029517,524612,24116,548728,1092,91546,0,92638,1670883 +"313TT",0,0,0,0,0,0,0,0,9,2,39,0,0,4,647,0,94,25,0,43865,195,224,503,0,2,222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45831,30000,0,75830,61335,3714,65050,1928,5782,-27,7683,148563 +"315AL",0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,1,1,608,643,115,13843,1,8,0,70,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1243,0,16549,124016,0,140564,245269,6727,251996,18074,25074,0,43148,435708 +"322",0,0,0,0,0,0,0,5,20,2,1,0,4,231,0,0,1,47,22,2,0,179430,761,0,230,534,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,635,0,181924,22436,0,204360,61033,11137,72170,117,6248,0,6365,282894 +"323",0,0,0,0,0,0,0,0,0,0,120,0,3,0,0,0,10,158,0,171,16,101,63367,0,0,37,0,0,0,0,0,0,0,0,0,0,0,0,0,1743,0,0,0,0,0,0,0,0,0,0,0,0,7,0,1474,0,0,0,0,0,0,0,0,0,0,0,0,11,0,1680,0,68897,2599,0,71497,14602,2919,17521,1,1032,0,1033,90050 +"324",0,0,25354,96,34,0,0,0,35,1706,7,1,0,19,0,0,0,1,19,0,0,0,0,495116,7099,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,529544,52611,0,582154,139684,28330,168014,139,100422,0,100560,850729 +"325",0,0,171,2143,0,0,0,2,56,124,22,96,125,4,12,37,9,184,1643,3569,56,88,0,32077,695855,1343,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,105,0,737732,237029,0,974762,420280,32223,452504,2053,27588,-14,29627,1456893 +"326",0,0,0,0,0,0,0,123,41,0,604,9,62,90,178,171,30,285,0,527,3,594,244,0,2832,227359,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,233151,50139,0,283290,103707,5668,109375,1494,8769,0,10263,402928 +"42",0,0,1183,77,158,1415,0,1034,1050,987,3871,3562,2249,2235,3640,786,1016,4957,8208,498,390,2034,946,10338,14001,2693,1748266,0,0,0,0,0,0,0,0,0,0,0,0,1419,3,113,2612,0,0,0,0,0,0,0,0,125,0,0,0,0,0,0,0,0,0,0,0,0,30,562,0,0,0,0,0,1820458,0,0,1820458,-1718990,0,-1718990,0,0,0,0,101468 +"441",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255952,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,449,0,0,0,0,0,0,0,0,0,0,0,0,1,2,0,1172,0,0,0,0,0,257577,0,0,257577,-257577,0,-257577,0,0,0,0,0 +"445",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209336,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,122,315,0,0,0,0,0,5076,214859,0,0,214859,-214859,0,-214859,0,0,0,0,0 +"452",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,183000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2619,0,0,510,0,0,0,0,0,0,0,0,0,0,313,0,81,0,0,3070,0,0,189593,0,0,189593,-189593,0,-189593,0,0,0,0,0 +"4A0",0,0,0,0,0,833,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,861413,0,0,0,0,0,0,0,0,1917,186,3555,99,0,0,0,0,0,0,234,0,822,1471,0,1236,75,613,7890,1355,18,73,1094,2029,566,1253,4130,0,0,61,0,0,890922,0,0,890922,-883912,0,-883912,0,0,0,0,7010 +"481",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209902,0,0,0,0,0,29,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209931,49487,-4044,255374,0,-6225,-6225,0,21870,-238,21632,270780 +"482",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80080,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,125,80205,367,-779,79793,0,-68590,-68590,0,726,-2263,-1537,9666 +"483",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52085,0,0,0,372,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,395,52852,29254,-42048,40058,0,-9506,-9506,0,205,-47,158,30710 +"484",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,336846,0,0,555,318,0,0,0,0,0,0,0,0,0,0,1060,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,338779,2984,-7884,333879,0,-281589,-281589,0,368,0,368,52658 +"485",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77217,0,468,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16911,94596,0,0,94596,0,0,0,0,1015,0,1015,95611 +"486",0,0,0,0,0,2550,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,0,0,0,0,0,0,0,0,0,47507,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50119,0,0,50119,0,-49660,-49660,0,77,0,77,536 +"487OS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,524,0,0,0,0,1567,0,2379,18557,8,0,229405,1548,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,450,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13600,268039,4818,-8136,264721,0,0,0,0,374,0,374,265095 +"493",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,319,0,0,0,0,0,0,0,5857,0,0,1218,121063,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128457,0,0,128457,0,0,0,0,162,0,162,128619 +"511",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,284300,0,0,11599,0,0,0,0,0,0,0,0,11922,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,293,0,522,0,308635,4463,0,313098,102511,5028,107539,0,9936,0,9936,430574 +"512",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,407,0,0,0,0,0,0,0,0,0,145792,1245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,0,18,1,0,147500,11126,0,158626,6276,94,6369,0,3261,0,3261,168256 +"513",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,703019,1897,0,0,0,0,0,0,0,0,155,0,0,0,0,0,0,0,0,0,0,0,138,0,0,0,0,0,0,0,705210,159,0,705369,0,0,0,0,28291,-11,28280,733649 +"514",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33920,0,7,203632,0,0,0,0,0,0,0,0,18270,54753,0,0,0,0,0,0,0,0,0,0,0,0,710,13,0,0,2773,0,314078,1253,0,315331,0,0,0,0,1553,0,1553,316885 +"521CI",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3572,35,0,293,0,0,0,0,0,0,0,0,0,0,0,0,954391,21008,0,0,0,1475,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,980861,6646,0,987507,0,0,0,0,0,-546,-546,986961 +"523",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27471,521344,1340,0,0,0,65,0,0,450,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,550670,57,0,550728,0,0,0,0,1298,0,1298,552026 +"524",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3279,1012864,0,0,385,555,0,0,0,0,129,0,108,0,0,0,0,0,0,0,0,0,0,0,9091,0,407,1026818,53392,-699,1079510,0,0,0,0,23890,-6339,17551,1097061 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,157317,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,0,29014,0,186456,0,0,186456,0,0,0,0,38,0,38,186494 +"HS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2031912,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27159,2059072,0,0,2059072,0,0,0,0,0,-38219,-38219,2020853 +"ORE",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,132,0,0,0,0,0,0,0,1262195,968,0,0,0,0,243,0,63,0,0,157,0,971,58,1024,0,1291,0,0,793,0,23396,1291291,0,0,1291291,0,0,0,0,1304,-1417,-113,1291178 +"532RL",0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10909,153,7,0,1156,545,373,0,305,0,0,3,0,0,52,9174,16,68947,0,0,0,0,0,329148,0,109,34,0,196,127,0,382,133,0,0,1444,183,886,0,343,0,0,0,0,0,424640,0,0,424640,0,0,0,0,17089,0,17089,441728 +"5411",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77,0,0,0,0,338765,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,338842,3861,0,342702,0,0,0,0,15394,0,15394,358096 +"5415",0,0,115,2,37,493,386,16,38,70,312,734,1405,246,311,577,38,427,131,13,21,49,198,33,497,154,7186,67,8,0,1503,99,115,8,80,1,20,273,123,11754,317,1992,12720,3136,1301,2773,2,75,230,128,359,421359,12238,11270,11138,19,4684,760,2493,29,111,96,43,37,2,991,1769,1959,563,4891,0,525031,34142,0,559173,0,0,0,0,4127,0,4127,563301 +"5412OP",0,0,946,104,344,138,15,99,757,545,2971,7833,48791,2388,14396,19580,272,12188,3150,295,243,1018,16570,175,46880,2308,490,3,1,0,4626,1633,314,34,292,56,189,5108,586,48557,1391,103386,129929,1945,1103,2209,4,54,280,169,193,9641,1294821,5408,40058,142,30132,192,7057,10,14,7639,72,2,0,1043,21546,17239,0,54380,0,1973954,91260,0,2065215,0,0,0,0,6915,0,6915,2072130 +"55",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,550361,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,550361,0,0,550361,0,0,0,0,1509,0,1509,551870 +"561",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,362,0,0,0,21,0,2,0,91,0,0,0,0,0,0,3,0,179,0,0,47,0,0,0,0,0,0,0,0,4872,1352,0,877316,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9751,0,893997,1938,0,895935,0,0,0,0,6106,0,6106,902041 +"562",0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4651,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,364,111995,0,0,0,0,0,0,0,0,0,0,0,0,0,14384,0,131400,234,0,131634,0,0,0,0,1755,0,1755,133389 +"61",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,99,0,0,0,0,0,0,0,0,317,0,0,87,0,0,0,0,0,0,2,0,344,0,0,23,0,277893,0,0,0,0,286,2714,0,0,9,201,0,0,98578,0,380553,1731,0,382284,0,0,0,0,462,0,462,382746 +"621",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1061189,3509,135,258,0,0,0,0,0,0,0,0,19145,0,1084328,102,0,1084430,0,0,0,0,364,0,364,1084794 +"622",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,826667,0,0,0,0,0,0,0,1342,2068,0,221928,0,1052005,4439,0,1056443,0,0,0,0,2172,-375,1796,1058239 +"623",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,239512,1957,0,0,0,0,0,0,0,0,0,0,241469,29,0,241498,0,0,0,0,2788,0,2788,244286 +"624",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,0,0,0,596,220958,0,588,0,0,0,0,0,0,3699,0,225869,0,0,225869,0,0,0,0,819,0,819,226688 +"711AS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1611,0,0,0,0,174669,12,903,0,0,18,0,0,3165,138,180516,1325,0,181841,0,0,0,0,5518,0,5518,187359 +"713",1358,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88,0,0,305,0,0,293,0,0,0,0,0,0,42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2223,126631,29358,1300,0,0,0,0,2703,42299,206600,0,0,206600,0,0,0,0,9707,0,9707,216307 +"721",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,59,0,0,0,0,0,0,0,26764,0,0,0,0,7,143,181253,15,0,0,0,0,10383,0,218625,0,0,218625,0,0,0,0,18288,0,18288,236913 +"722",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9221,6866,16292,0,0,0,0,0,0,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14013,41,1494,425,0,3623,8526,40320,761479,2750,0,0,1533,18768,0,885387,0,0,885387,0,0,0,0,61162,0,61162,946550 +"81",0,0,0,0,0,0,0,0,0,0,215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68557,49947,0,1790,11289,0,0,0,0,0,0,852,0,1,0,681,73,0,0,0,0,0,214,956,0,3694,1758,0,0,0,16,0,0,0,0,315,2108,1706,0,681913,0,0,0,1145,3145,830374,4786,0,835160,0,0,0,0,17622,0,17622,852782 +"GFGD",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,599358,0,0,0,0,599358,0,0,599358,0,0,0,0,0,0,0,599358 +"GFGN",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,379143,0,0,0,379143,0,0,379143,0,0,0,0,0,0,0,379143 +"GFE",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,508,70289,0,0,70797,289,0,71086,0,0,0,0,0,0,0,71086 +"GSLG",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1737213,0,1737213,0,0,1737213,0,0,0,0,0,0,0,1737213 +"GSLE",0,0,0,0,0,4107,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102952,107059,0,0,107059,0,0,0,0,0,0,0,107059 +"Used",0,0,0,0,0,0,0,286,3,752,2918,201,0,0,658,58,0,0,1,0,0,454,208,0,0,269,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,829,0,0,0,0,0,0,0,0,8,0,0,0,0,4118,0,10763,14046,0,24809,139381,30966,170347,29,16217,0,16246,211403 +"Other",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3468,0,0,0,3468,260394,0,263862,0,0,0,0,0,0,0,263862 +"T017",405644,52896,245652,99472,106714,444787,1576110,108335,127184,222749,345651,378037,353926,124407,596957,335465,76239,158621,929860,49714,15696,185180,83873,538316,777544,237346,1843169,309788,226985,195946,903927,214601,81045,54799,366619,77284,47995,238420,123701,384124,147978,824711,363706,1055893,548036,1019265,157323,2052386,1265134,336471,339319,471319,1367904,567114,933280,113865,356593,1070868,843933,240921,223508,192947,143617,258207,765141,695484,624290,405353,101150,2268884,373183,33772564,2689895,-63591,36398869,0,0,0,38513,716927,-59875,695566,37094434 diff --git a/flowsa/data/external_data/BEA_Summary_Supply_2018.csv b/flowsa/data/external_data/BEA_Summary_Supply_2018.csv new file mode 100644 index 000000000..4c27a23c8 --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Supply_2018.csv @@ -0,0 +1,75 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","T007","MCIF","MADJ","T013","Trade","Trans","T014","MDTY","TOP","SUB","T015","T016" +"111CA",400764,26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,193,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,584,0,401567,41843,0,443410,131010,58708,189718,57,7709,-12446,-4679,628449 +"113FF",4699,51783,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,79,0,0,0,0,787,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,3366,0,60810,17899,0,78709,9564,4347,13911,50,939,0,989,93609 +"211",0,0,280322,0,374,193,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,311,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,281204,168802,0,450006,19729,55366,75095,143,13284,0,13427,538528 +"212",0,0,49,84477,0,0,0,0,676,0,0,0,0,0,0,0,0,0,0,0,0,0,0,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,715,0,85969,5674,0,91644,7597,30340,37937,3,3749,0,3752,133333 +"213",0,0,16755,6272,123691,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,146718,711,0,147429,0,0,0,0,0,0,0,147429 +"22",0,0,0,0,0,471873,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49,18080,1250,144937,636372,2435,0,638807,0,0,0,0,30815,0,30815,669622 +"23",0,604,848,10355,6603,2812,1659546,583,766,207,2413,580,53,71,501,752,369,667,166,46,0,78,12,269,133,96,6279,6,0,2362,4484,44,183,1,43,0,88,110,66,21,50,1333,803,3,1,3,0,18993,302,57,2,7,571,82,1214,1,733,433,1258,39,116,625,555,1711,785,496,3,284,0,21037,0,1753718,0,0,1753718,0,0,0,0,2064,0,2064,1755781 +"321",11,0,0,0,0,0,0,117436,15,0,255,0,0,0,0,0,475,87,0,0,0,314,23,0,1,330,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,220,0,119166,22397,0,141563,37315,8630,45945,381,4355,0,4737,192245 +"327",0,0,0,197,0,0,0,134,127050,90,33,35,17,150,1,0,30,40,0,2,47,11,0,196,101,42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128176,27419,0,155595,47030,24971,72001,1063,5315,0,6378,233974 +"331",0,0,0,0,0,0,0,0,1,248118,3296,17,54,380,24,1,9,10,0,1,0,0,0,100,5,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,252024,83955,0,335979,35303,13234,48537,4649,1869,0,6518,391034 +"332",0,0,0,0,562,0,0,124,28,1397,350378,1442,54,121,1011,110,113,553,0,27,0,0,110,1,19,606,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,356656,70564,0,427220,120025,12172,132197,2603,12197,0,14800,574217 +"333",0,0,145,0,0,0,0,0,9,242,2282,369726,424,452,1600,384,58,144,0,8,0,0,2,0,146,191,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,375817,177243,0,553060,181836,16394,198230,2987,12666,0,15653,766943 +"334",0,0,0,0,0,0,0,0,0,1,344,414,307313,179,96,755,6,140,0,24,0,86,4,0,1078,108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,541,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,311096,340953,0,652049,258903,10525,269428,2844,18436,0,21280,942757 +"335",0,0,0,0,0,0,0,0,91,318,243,1324,474,121240,234,200,33,18,0,0,0,0,26,18,34,233,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124485,107515,0,232000,100223,8248,108470,3569,7413,-260,10722,351192 +"3361MV",0,0,0,0,0,0,0,0,37,0,777,677,7,222,611404,5402,1,14,0,610,0,0,0,0,1,680,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,619895,333724,0,953619,269642,16056,285698,4922,33602,0,38524,1277841 +"3364OT",0,0,0,0,0,0,0,0,1,0,121,267,444,1,2551,324661,0,35,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,328123,52573,0,380696,27741,4843,32585,448,2475,0,2923,416204 +"337",0,0,0,0,0,0,0,269,41,0,29,4,0,5,0,0,73869,215,0,29,0,0,16,0,0,47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,74525,47064,0,121589,77375,15105,92479,762,8953,0,9715,223784 +"339",0,0,0,0,0,0,0,0,2,0,170,41,653,15,24,18,197,144912,5,22,20,43,857,0,1299,658,4,0,0,0,1686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,57,0,1204,0,151890,99550,0,251441,215059,15800,230859,1509,15237,0,16746,499046 +"311FT",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,917434,0,832,0,0,0,8165,0,1159,0,8594,2068,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3134,0,941386,97366,0,1038752,543303,25545,568848,1328,92303,0,93630,1701230 +"313TT",0,0,0,0,0,0,0,0,23,2,54,0,15,0,605,0,72,34,0,44600,187,203,546,0,2,821,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47163,32019,0,79182,64241,4243,68485,2109,5959,-28,8039,155706 +"315AL",0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,1,2,575,617,181,14976,33,8,0,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1287,0,17796,128442,0,146238,256117,7608,263725,18870,25703,0,44573,454536 +"322",0,0,0,0,0,0,0,9,5,2,1,0,1,46,0,0,1,49,24,1,0,186881,691,0,51,503,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,659,0,188923,24901,0,213823,59821,12405,72226,267,6497,0,6765,292814 +"323",0,0,0,0,0,0,0,0,0,0,100,0,2,0,0,0,7,303,0,130,10,203,61889,0,0,45,0,0,0,0,0,0,0,0,0,0,0,0,0,1692,0,0,0,0,0,0,0,0,0,0,0,0,7,0,1523,0,0,0,0,0,0,0,0,0,0,0,0,8,0,1793,0,67714,2762,0,70476,13387,3131,16518,19,943,0,962,87957 +"324",0,0,33658,101,63,0,0,0,186,1946,5,0,0,7,0,0,0,1,36,0,0,0,0,615833,9284,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,661123,68352,0,729475,161992,30648,192640,165,106536,0,106701,1028816 +"325",0,0,191,2189,0,0,0,1,53,143,24,45,65,1,8,37,8,157,1847,3759,151,22,0,35493,731408,1754,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,111,0,777471,263279,0,1040750,429677,34231,463907,2516,29060,-14,31562,1536219 +"326",0,0,0,0,0,0,0,70,43,0,641,7,131,68,236,144,16,315,0,467,2,237,255,0,2676,241567,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246874,55669,0,302543,107108,5799,112907,1973,9018,0,10991,426441 +"42",0,0,1437,82,192,1508,0,1205,1370,763,4038,5090,2275,2411,3116,1505,1042,5256,10547,480,403,963,718,15654,12273,2418,1839498,0,0,0,0,0,0,0,0,0,0,0,0,1486,3,114,3045,0,0,0,0,0,0,0,0,131,0,0,0,0,0,0,0,0,0,0,0,0,32,491,0,0,0,0,0,1919545,0,0,1919545,-1817053,0,-1817053,0,0,0,0,102492 +"441",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,266628,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,460,0,0,0,0,0,0,0,0,0,0,0,0,13,2,0,1403,0,0,0,0,0,268505,0,0,268505,-268505,0,-268505,0,0,0,0,0 +"445",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,211426,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,130,342,0,0,0,0,0,5348,217259,0,0,217259,-217259,0,-217259,0,0,0,0,0 +"452",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,190243,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2808,0,0,536,0,0,0,0,0,0,0,0,0,0,322,0,105,0,0,3044,0,0,197057,0,0,197057,-197057,0,-197057,0,0,0,0,0 +"4A0",0,0,0,0,0,898,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,912763,0,0,0,0,0,0,0,0,2037,204,3757,115,0,0,0,0,0,0,245,0,969,1569,0,1161,76,643,8229,1413,18,76,1118,2131,610,1349,4198,0,0,62,0,0,943641,0,0,943641,-935839,0,-935839,0,0,0,0,7802 +"481",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,225113,0,0,0,0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,225143,53553,-4593,274102,0,-6164,-6164,0,23504,-226,23277,291216 +"482",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,87074,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,132,87206,374,-801,86779,0,-74833,-74833,0,746,-2598,-1852,10094 +"483",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56646,0,0,0,383,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,421,57451,31037,-44789,43699,0,-9868,-9868,0,230,-23,207,34038 +"484",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,368787,0,0,609,333,0,0,0,0,0,0,0,0,0,0,1208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,370937,3042,-8112,365867,0,-310108,-310108,0,380,0,380,56139 +"485",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,94165,0,514,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17053,111732,0,0,111732,0,0,0,0,1105,-1,1104,112836 +"486",0,0,0,0,0,2859,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,75,0,0,0,0,0,0,0,0,0,54897,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57832,0,0,57832,0,-57258,-57258,0,80,0,80,653 +"487OS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,537,0,0,0,0,1723,0,2542,20043,9,0,246174,1631,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,491,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14854,288004,5495,-9242,284257,0,0,0,0,409,0,409,284666 +"493",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,334,0,0,0,0,0,0,0,6329,0,0,1331,126693,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134688,0,0,134688,0,0,0,0,176,0,176,134864 +"511",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,297061,0,0,13351,0,0,0,0,0,0,0,0,12914,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,168,0,568,0,324061,4424,0,328484,108036,5511,113548,0,10388,0,10388,452420 +"512",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,451,0,0,0,0,0,0,0,0,0,157424,1285,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,0,18,1,0,159222,11646,0,170868,6891,108,6998,0,3112,0,3112,180979 +"513",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,719320,2202,0,0,0,0,0,0,0,0,165,0,0,0,0,0,0,0,0,0,0,0,146,0,0,0,0,0,0,0,721833,162,0,721994,0,0,0,0,30240,-5,30236,752230 +"514",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36197,0,7,235120,0,0,0,0,0,0,0,0,19871,56724,0,0,0,0,0,0,0,0,0,0,0,0,725,14,0,0,2459,0,351116,976,0,352091,0,0,0,0,1738,0,1738,353829 +"521CI",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3624,36,0,305,0,0,0,0,0,0,0,0,0,0,0,0,1004857,24286,0,0,0,1488,71,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,1034686,7389,0,1042075,0,0,0,0,0,-478,-478,1041597 +"523",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29938,548222,1412,0,0,0,71,0,0,469,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,580111,58,0,580170,0,0,0,0,1345,0,1345,581515 +"524",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3615,1051401,0,0,393,665,0,0,0,0,138,0,125,0,0,0,0,0,0,0,0,0,0,0,9078,0,408,1065824,43924,-751,1108996,0,0,0,0,39572,-6321,33251,1142247 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,149125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,75,0,32132,0,181332,0,0,181332,0,0,0,0,44,0,44,181375 +"HS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2115423,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29835,2145258,0,0,2145258,0,0,0,0,0,-39684,-39684,2105575 +"ORE",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,146,0,0,0,0,0,0,0,1337279,1077,0,0,0,0,256,0,69,0,0,161,0,990,62,1085,0,1384,0,0,830,0,25657,1368996,0,0,1368996,0,0,0,0,1404,-1224,180,1369176 +"532RL",0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11803,162,6,0,1192,601,428,0,329,0,0,3,0,0,57,9162,19,69359,0,0,0,0,0,358774,0,118,37,0,210,139,0,416,139,0,0,1529,192,935,0,363,0,0,0,0,0,455987,0,0,455987,0,0,0,0,18578,0,18578,474564 +"5411",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,81,0,0,0,0,342070,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,342150,4258,0,346409,0,0,0,0,16102,0,16102,362511 +"5415",0,0,116,2,37,469,385,19,40,84,341,780,1364,268,281,654,49,512,127,13,20,51,175,32,528,180,7209,48,6,0,1067,131,115,12,71,1,31,283,140,12521,316,1988,14588,3431,1425,2776,1,83,253,141,372,458783,12838,11633,11581,20,4962,796,2612,30,116,108,48,43,2,930,1757,1940,584,5180,0,567494,33328,0,600822,0,0,0,0,4610,0,4610,605432 +"5412OP",0,0,638,70,233,118,19,121,826,588,2777,8690,52881,2564,15623,18100,288,13029,3290,329,272,714,17360,756,52929,1722,700,3,1,0,6192,1944,526,57,444,93,317,5933,866,47094,1710,109440,156607,2043,877,2196,4,98,465,148,234,11240,1380154,5660,43292,156,32238,303,7562,15,18,8163,78,3,0,1075,22323,18362,0,56903,0,2119473,94227,0,2213700,0,0,0,0,7581,0,7581,2221281 +"55",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,581971,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,581971,0,0,581971,0,0,0,0,1598,0,1598,583569 +"561",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,293,0,0,0,20,0,2,0,84,0,0,0,0,0,0,3,0,174,0,0,55,0,0,0,0,0,0,0,0,5418,1378,0,950063,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9375,0,966866,1857,0,968723,0,0,0,0,6530,0,6530,975253 +"562",0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4713,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,397,119438,0,0,0,0,0,0,0,0,0,0,0,0,0,14750,0,139305,226,0,139531,0,0,0,0,1914,0,1914,141445 +"61",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,104,0,0,0,0,0,0,0,0,329,0,0,100,0,0,0,0,0,0,3,0,372,0,0,23,0,287190,0,0,0,0,296,2817,0,0,10,233,0,0,101960,0,393439,1586,0,395025,0,0,0,0,505,0,505,395529 +"621",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1097377,2333,22,271,0,0,0,0,0,0,0,0,35478,0,1135576,118,0,1135695,0,0,0,0,394,0,394,1136089 +"622",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,863782,0,0,0,0,0,0,0,1484,1245,0,218468,0,1084979,4297,0,1089275,0,0,0,0,2559,-12,2546,1091822 +"623",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,245875,2046,0,0,0,0,0,0,0,0,0,0,247921,34,0,247955,0,0,0,0,2825,0,2825,250780 +"624",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,0,0,0,0,569,232616,0,610,0,0,0,0,0,0,3859,0,237688,0,0,237688,0,0,0,0,901,0,901,238589 +"711AS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1676,0,0,0,0,186951,12,951,0,0,21,0,0,3295,146,193053,1049,0,194102,0,0,0,0,5429,0,5429,199532 +"713",2046,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,92,0,0,326,0,0,321,0,0,0,0,0,0,46,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2205,133047,30556,1334,0,0,0,0,2735,43366,216074,6,0,216081,0,0,0,0,11065,0,11065,227146 +"721",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,0,0,0,0,0,0,0,27600,0,0,0,0,7,152,190748,16,0,0,0,0,10914,0,229498,0,0,229498,0,0,0,0,19635,0,19635,249133 +"722",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9801,7294,17314,0,0,0,0,0,0,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13318,43,1566,440,0,3827,8984,42378,803622,2872,0,0,1539,19590,0,932626,0,0,932626,0,0,0,0,65177,0,65177,997803 +"81",0,0,0,0,0,0,0,0,0,0,572,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73300,52457,0,1840,12239,0,0,0,0,0,0,896,0,1,0,696,85,0,0,0,0,0,215,1070,0,4001,1820,0,0,0,17,0,0,0,0,322,2216,1798,0,713096,0,0,0,1190,3244,871076,5059,0,876135,0,0,0,1,18613,0,18614,894749 +"GFGD",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,633618,0,0,0,0,633618,0,0,633618,0,0,0,0,0,0,0,633618 +"GFGN",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400800,0,0,0,400800,0,0,400800,0,0,0,0,0,0,0,400800 +"GFE",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,416,71845,0,0,72261,294,0,72555,0,0,0,0,0,0,0,72555 +"GSLG",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1825314,0,1825314,0,0,1825314,0,0,0,0,0,0,0,1825314 +"GSLE",0,0,0,0,0,4374,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,107474,111848,0,0,111848,0,0,0,0,0,0,0,111848 +"Used",0,0,0,0,0,0,0,258,5,539,3699,282,0,0,481,36,0,0,1,0,0,247,172,0,0,206,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,905,0,0,0,0,0,0,0,0,8,0,0,0,0,4295,0,11135,16119,0,27254,146789,34263,181052,44,16734,0,16778,225083 +"Other",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3978,0,0,0,3978,270906,0,274884,0,0,0,0,0,0,0,274884 +"T017",407519,52414,334159,103746,131755,485109,1659950,120229,131272,254439,372593,389432,366227,128201,637796,352759,76644,167066,934092,50728,16921,190087,83156,668410,820244,252258,1941063,323020,229873,203807,958407,230432,88326,59579,400761,94269,55515,256320,129729,398614,159963,847101,426629,1109630,578426,1057869,149131,2134597,1340455,366799,342677,513988,1456102,599346,1009892,121537,368571,1107597,880664,247170,235261,206140,150918,271419,807492,727148,659499,427483,105080,2383827,392897,35742229,2868555,-68290,38542495,0,0,0,53284,772322,-63320,762286,39304780 diff --git a/flowsa/data/external_data/BEA_Summary_Supply_2019.csv b/flowsa/data/external_data/BEA_Summary_Supply_2019.csv new file mode 100644 index 000000000..c720386b2 --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Supply_2019.csv @@ -0,0 +1,75 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","T007","MCIF","MADJ","T013","Trade","Trans","T014","MDTY","TOP","SUB","T015","T016" +"111CA",401744,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,193,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,604,0,402565,43066,0,445631,132321,60235,192556,124,8097,-21108,-12887,625300 +"113FF",4864,50348,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,89,0,0,0,0,707,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77,0,3300,0,59385,17792,0,77178,9008,4322,13330,159,921,0,1080,91588 +"211",0,0,257358,0,359,189,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,313,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258221,136821,0,395042,18727,60812,79539,149,12060,0,12210,486791 +"212",0,0,51,82063,0,0,0,0,512,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,0,83413,5747,0,89160,7323,28228,35551,11,3457,0,3468,128179 +"213",0,0,16447,6602,125352,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,148402,751,0,149153,0,0,0,0,0,0,0,149153 +"22",0,0,0,0,0,473947,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,18548,1293,146900,640929,2078,0,643007,0,0,0,0,31138,0,31138,674145 +"23",0,677,1671,11960,8356,2738,1731399,708,964,246,2466,617,57,83,553,867,411,633,176,44,2,96,17,279,159,129,6218,6,0,1658,4337,33,166,1,42,0,131,108,67,23,79,1153,787,4,1,5,0,19125,321,79,2,9,644,86,1405,2,699,501,1273,43,157,615,570,1816,842,495,3,365,0,22433,0,1831610,0,0,1831610,0,0,0,0,2274,0,2274,1833884 +"321",10,0,0,0,0,0,0,109226,18,0,254,0,0,0,0,0,334,105,0,0,0,346,20,0,3,215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,228,0,110758,19133,0,129891,35626,8171,43797,668,4363,0,5031,178719 +"327",0,0,0,209,0,0,0,83,130778,100,217,37,14,122,0,0,28,37,0,2,40,8,0,205,94,29,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,132002,26077,0,158079,47536,26778,74314,1676,5697,0,7373,239766 +"331",0,0,0,0,0,0,0,0,1,230787,3336,15,47,642,45,1,19,8,0,0,0,0,0,115,4,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,235028,73218,0,308246,30741,12715,43456,4595,1884,0,6479,358181 +"332",0,0,0,0,518,0,0,234,38,1535,355664,1627,99,195,1462,61,97,739,0,79,0,0,107,0,40,433,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,362930,68272,0,431202,122222,12699,134921,4761,13403,0,18164,584287 +"333",0,0,145,0,0,0,0,0,6,224,2375,371074,412,376,1533,386,51,164,0,8,0,0,71,0,139,283,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,377249,181072,0,558321,182250,17154,199405,5557,13595,0,19152,776878 +"334",0,0,0,0,0,0,0,0,0,1,399,411,307825,263,75,432,12,703,0,31,0,71,10,0,1114,165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,599,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,312118,317418,0,629536,256237,10677,266915,7503,18867,0,26370,922820 +"335",0,0,0,0,0,0,0,0,151,253,210,1276,500,124082,151,426,29,46,0,0,0,0,20,13,53,291,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127503,105449,0,232951,99324,8188,107511,6806,7610,-304,14112,354574 +"3361MV",0,0,0,0,0,0,0,0,22,0,704,1998,6,213,613352,7825,0,17,0,588,0,0,0,0,1,1020,65,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,625813,335506,0,961319,270584,16258,286842,6615,37315,0,43930,1292092 +"3364OT",0,0,0,0,0,0,0,0,1,0,112,396,492,0,2119,305564,0,33,0,0,0,0,0,0,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,308767,57379,0,366146,24658,4642,29300,661,2606,0,3267,398713 +"337",0,0,0,0,0,0,0,366,76,0,42,6,0,6,0,0,71713,259,0,32,0,0,17,0,0,143,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72661,43904,0,116565,77763,14769,92532,3136,9280,0,12416,221514 +"339",0,0,0,0,0,0,0,0,6,0,147,56,1245,12,14,12,142,142295,3,19,16,7,651,0,2084,1153,4,0,0,0,1707,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,46,0,1246,0,150866,100589,0,251456,219149,15838,234987,2141,16360,0,18501,504944 +"311FT",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,940218,0,707,0,0,0,8628,0,1172,0,8893,2130,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3243,0,964993,100236,0,1065229,562629,25966,588595,1827,94231,0,96058,1749882 +"313TT",0,0,0,0,0,0,0,0,23,2,99,0,12,0,563,0,67,75,0,43923,280,187,548,0,2,878,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46660,32004,0,78664,65559,4243,69802,2839,6322,-27,9134,157599 +"315AL",0,0,0,0,0,0,0,0,18,0,0,0,0,0,0,1,2,632,514,187,15479,0,7,0,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1331,0,18284,128841,0,147124,257832,7913,265745,21238,26898,0,48135,461004 +"322",0,0,0,0,0,0,0,10,24,1,1,0,1,47,0,0,1,57,32,1,0,186941,628,0,154,577,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,682,0,189156,23971,0,213127,63383,12537,75921,701,7039,0,7740,296788 +"323",0,0,0,0,0,0,0,0,0,0,66,0,1,0,0,0,7,412,0,155,17,211,60800,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,1652,0,0,0,0,0,0,0,0,0,0,0,0,8,0,1636,0,0,0,0,0,0,0,0,0,0,0,0,6,0,1855,0,66874,2748,0,69622,13889,3167,17056,146,1004,0,1151,87829 +"324",0,0,28369,110,56,0,0,0,106,1212,4,0,0,10,0,0,0,1,32,0,0,0,0,556015,7871,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,593794,68304,0,662098,160800,33060,193860,181,109193,0,109374,965332 +"325",0,0,189,2199,0,0,0,22,55,169,31,91,149,1,7,23,9,169,1855,3558,125,22,0,27063,707911,1447,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,114,0,745216,272731,0,1017947,442470,34956,477426,3024,29602,-9,32617,1527990 +"326",0,0,0,0,0,0,0,79,152,0,576,13,131,92,198,138,12,550,0,549,3,318,231,0,2315,238929,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,244287,56780,0,301066,110023,6005,116027,3100,9713,0,12814,429907 +"42",0,0,1367,82,183,1499,0,1103,1243,818,3522,4807,2099,2355,2891,1285,813,5467,9153,504,359,1153,636,12151,10917,1959,1859358,0,0,0,0,0,0,0,0,0,0,0,0,1576,5,119,3430,0,0,0,0,0,0,0,0,133,0,0,0,0,0,0,0,0,0,0,0,0,34,505,0,0,0,0,0,1931527,0,0,1931527,-1826027,0,-1826027,0,0,0,0,105500 +"441",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,259156,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,467,0,0,0,0,0,0,0,0,0,0,0,0,1,2,0,1595,0,0,0,0,0,261221,0,0,261221,-261221,0,-261221,0,0,0,0,0 +"445",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219638,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,410,0,0,0,0,0,5649,225837,0,0,225837,-225837,0,-225837,0,0,0,0,0 +"452",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,190040,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2855,0,0,570,0,0,0,0,0,0,0,0,0,0,330,0,122,0,0,2976,0,0,196894,0,0,196894,-196894,0,-196894,0,0,0,0,0 +"4A0",0,0,0,0,0,896,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,945024,0,0,0,0,0,0,0,0,2194,203,3820,127,0,0,0,0,0,0,246,0,1075,1802,0,1111,78,657,8530,1513,19,78,1208,2234,598,1436,4336,0,0,64,0,0,977251,0,0,977251,-968459,0,-968459,0,0,0,0,8792 +"481",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,242477,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,242509,55545,-4321,293733,0,-6519,-6519,0,24854,-288,24566,311781 +"482",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,84746,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,132,84878,381,-815,84444,0,-72903,-72903,0,743,-2191,-1448,10092 +"483",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57789,0,0,0,368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,458,58615,30759,-43770,45604,0,-10428,-10428,0,288,-16,273,35448 +"484",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,375942,0,0,615,344,0,0,0,0,0,0,0,0,0,0,1284,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,378185,2883,-8246,372822,0,-316382,-316382,0,380,0,380,56821 +"485",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,103365,0,530,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17334,121228,0,0,121228,0,0,0,0,1203,-1,1202,122430 +"486",0,0,0,0,0,2902,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,0,0,60715,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63689,0,0,63689,0,-63091,-63091,0,85,0,85,683 +"487OS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,0,0,0,0,1419,0,2691,20606,9,0,255398,1694,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,517,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15851,298748,5195,-8693,295250,0,0,0,0,443,0,443,295692 +"493",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,352,0,0,0,0,0,0,0,6471,0,0,1349,131307,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,139478,0,0,139478,0,0,0,0,184,0,184,139662 +"511",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,312835,0,0,14744,0,0,0,0,0,0,0,0,13081,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,135,0,588,0,341383,4624,0,346007,114327,5749,120076,31,11273,0,11304,477386 +"512",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,504,0,0,0,0,0,0,0,0,0,161405,1235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44,0,18,1,0,163208,12400,0,175608,7104,113,7217,1,2948,0,2949,185774 +"513",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,725929,2431,0,0,0,0,0,0,0,0,164,0,0,0,0,0,0,0,0,0,0,0,151,0,0,0,0,0,0,0,728675,167,0,728843,0,0,0,0,30320,-6,30314,759157 +"514",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38891,0,7,259909,0,0,0,0,0,0,0,0,20187,60841,0,0,0,0,0,0,0,0,0,0,0,0,751,15,0,0,2543,0,383144,1313,0,384457,0,0,0,0,2019,0,2019,386476 +"521CI",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3717,37,0,310,0,0,0,0,0,0,0,0,0,0,0,0,1014326,25278,0,0,0,1555,77,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,1045322,7273,0,1052595,0,0,0,0,0,-439,-439,1052156 +"523",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28929,574980,1490,0,0,0,81,0,0,494,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,605973,60,0,606034,0,0,0,0,1392,0,1392,607425 +"524",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3835,1093385,0,0,395,713,0,0,0,0,144,0,131,0,0,0,0,0,0,0,0,0,0,0,9169,0,436,1108208,51351,-732,1158826,0,0,0,0,27009,-6455,20554,1179380 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,144857,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,0,33242,0,178159,0,0,178159,0,0,0,0,50,0,50,178209 +"HS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2211526,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30254,2241780,0,0,2241780,0,0,0,0,0,-40761,-40761,2201020 +"ORE",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,146,0,0,0,0,0,0,0,1482466,1161,0,0,0,0,265,0,73,0,0,166,0,1087,65,1125,0,1442,0,0,846,0,29728,1518572,0,0,1518572,0,0,0,0,1580,-1340,240,1518812 +"532RL",0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12303,174,5,0,1194,495,477,0,337,0,0,3,0,0,58,9252,21,68886,0,0,0,0,0,380321,0,119,36,0,234,147,0,446,150,0,0,1608,202,968,0,378,0,0,0,0,0,477829,0,0,477829,0,0,0,0,19555,0,19555,497384 +"5411",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,0,0,0,0,353916,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,354001,4743,0,358745,0,0,0,0,16607,0,16607,375351 +"5415",0,0,162,3,51,413,361,22,42,96,324,625,1170,186,280,572,60,352,137,12,18,55,190,45,421,180,7204,81,10,0,1810,244,104,16,112,2,34,340,197,14005,466,2853,16560,2521,1047,2393,5,100,304,169,361,469271,12899,12479,12373,22,4976,851,2792,32,124,142,64,54,3,1126,1850,2035,585,4752,0,583147,34471,0,617618,0,0,0,0,5061,0,5061,622679 +"5412OP",0,0,934,103,340,128,24,110,897,486,2999,9413,52953,2976,14882,14252,280,13952,2990,292,242,819,16562,733,58175,1762,884,4,1,1,6973,1860,738,80,593,131,445,6587,1142,45540,2090,108851,180023,2603,1111,2796,6,129,599,219,277,13080,1483552,6330,45900,166,33770,427,8106,21,23,8672,83,4,0,1116,23351,20503,0,58673,0,2263762,95573,0,2359335,0,0,0,3,8032,0,8034,2367370 +"55",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609842,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,609842,0,0,609842,0,0,0,0,1720,0,1720,611561 +"561",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,280,0,0,0,25,0,2,0,80,0,0,0,0,0,0,4,0,174,0,0,61,0,0,0,0,0,0,0,0,5624,1451,0,1013929,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9470,0,1031098,2393,0,1033492,0,0,0,0,6929,0,6929,1040420 +"562",0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4595,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,422,125242,0,0,0,0,0,0,0,0,0,0,0,0,0,14213,0,144479,290,0,144769,0,0,0,0,2034,0,2034,146803 +"61",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,109,0,0,0,0,0,0,0,0,347,0,0,110,0,0,0,0,0,0,3,0,378,0,0,26,0,296027,0,0,0,0,308,2958,0,0,10,244,0,0,104691,0,405212,1673,0,406885,0,0,0,0,540,0,540,407425 +"621",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,74,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1151230,2547,27,282,0,0,0,0,0,0,0,0,35456,0,1189621,410,0,1190031,0,0,0,0,424,0,424,1190454 +"622",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,904716,0,0,0,0,0,0,0,1554,1001,0,230209,0,1137481,5557,0,1143037,0,0,0,0,2665,-12,2653,1145690 +"623",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,256312,2033,0,0,0,0,0,0,0,0,0,0,258345,117,0,258462,0,0,0,0,2946,0,2946,261408 +"624",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,0,0,0,0,592,244326,0,630,0,0,0,0,0,0,3992,0,249581,0,0,249581,0,0,0,0,1004,0,1004,250586 +"711AS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1722,0,0,0,0,198155,13,982,0,0,22,0,0,3409,99,204403,1363,0,205766,0,0,0,0,5167,0,5167,210934 +"713",2012,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,97,0,0,349,0,0,318,0,0,0,0,0,0,46,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2105,140172,31380,1297,0,0,0,0,2518,43391,223686,28,0,223714,0,0,0,0,12264,0,12264,235978 +"721",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,0,0,0,0,0,0,0,28490,0,0,0,0,8,161,197135,17,0,0,0,0,11292,0,237164,0,0,237164,0,0,0,0,19721,0,19721,256885 +"722",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10401,7742,18374,0,0,0,0,0,0,41,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12770,44,1681,458,0,4100,9474,43804,847222,3005,0,0,1524,20267,0,980909,0,0,980909,0,0,0,0,67254,0,67254,1048163 +"81",0,0,0,0,0,0,0,0,0,0,388,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77192,54363,0,1879,13204,0,0,0,0,0,0,973,0,1,0,715,94,0,0,0,0,0,225,1138,0,4043,1972,0,0,0,17,0,0,0,0,341,2309,1860,0,747863,0,0,0,1231,3262,913072,4882,0,917954,0,0,0,11,19886,0,19897,937851 +"GFGD",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,676677,0,0,0,0,676677,0,0,676677,0,0,0,0,0,0,0,676677 +"GFGN",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,413042,0,0,0,413042,0,0,413042,0,0,0,0,0,0,0,413042 +"GFE",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,335,71396,0,0,71731,263,0,71995,0,0,0,0,0,0,0,71995 +"GSLG",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1925199,0,1925199,0,0,1925199,0,0,0,0,0,0,0,1925199 +"GSLE",0,0,0,0,0,4473,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,110075,114547,0,0,114547,0,0,0,0,0,0,0,114547 +"Used",0,0,0,0,0,0,0,289,4,505,3429,310,0,0,374,40,0,0,0,0,0,495,162,0,0,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,964,0,0,0,0,0,0,0,0,9,0,0,0,0,4443,0,11232,17294,0,28525,146952,34129,181081,88,17782,0,17870,227476 +"Other",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4355,0,0,0,4355,282902,0,287257,0,0,0,0,0,0,0,287257 +"T017",408630,51049,306694,103331,135217,487191,1731784,112252,135138,236435,377366,392786,367215,131662,638499,331883,74084,166711,955110,49985,17289,190729,80959,596668,800197,249912,1965503,317599,238987,203451,994174,247308,86231,60895,408697,103507,61527,266359,134751,417238,164506,853936,478896,1117269,606252,1100153,144868,2230880,1485927,388814,354557,527164,1564269,628737,1077486,127450,379332,1162031,922779,257672,247023,218350,158936,280337,851271,762745,703763,442006,105126,2503257,403590,36884383,2843801,-66578,39661606,0,0,0,77752,787290,-72957,792085,40453692 diff --git a/flowsa/data/external_data/BEA_Summary_Supply_2020.csv b/flowsa/data/external_data/BEA_Summary_Supply_2020.csv new file mode 100644 index 000000000..3a77a7221 --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Supply_2020.csv @@ -0,0 +1,75 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","T007","MCIF","MADJ","T013","Trade","Trans","T014","MDTY","TOP","SUB","T015","T016" +"111CA",421211,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,596,0,422006,44016,0,466022,144277,61455,205732,134,8321,-38645,-30190,641563 +"113FF",4592,53086,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88,0,0,0,0,676,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43,0,3108,0,61593,16691,0,78284,10466,4273,14739,168,858,0,1026,94048 +"211",0,0,169453,0,177,85,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,263,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169979,84049,0,254027,14202,56418,70620,125,8375,0,8500,333148 +"212",0,0,58,73486,0,0,0,0,584,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,729,0,74901,4509,0,79410,6786,22851,29637,9,2815,0,2823,111871 +"213",0,0,10024,4911,70558,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85495,1586,0,87081,0,0,0,0,0,0,0,87081 +"22",0,0,0,0,0,450175,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,193,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,16586,1274,143609,611859,2077,0,613936,0,0,0,0,31176,0,31176,645112 +"23",0,711,878,13439,6405,2918,1803986,660,898,229,2197,630,53,77,515,808,383,595,164,41,2,89,16,260,148,120,6234,7,0,1239,4672,31,158,1,36,0,97,102,81,23,82,1239,846,4,1,5,0,22277,353,82,2,9,669,89,1454,1,598,598,1228,51,187,528,489,1541,792,518,3,426,0,22975,0,1905952,0,0,1905952,0,0,0,0,2263,0,2263,1908216 +"321",10,0,0,0,0,0,0,119768,14,0,228,0,0,0,0,0,520,79,0,0,0,227,17,0,3,198,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,0,121287,22593,0,143880,39931,9033,48965,650,4989,0,5640,198484 +"327",0,0,0,204,0,0,0,64,128998,94,225,171,12,84,0,0,32,30,0,1,21,21,0,139,92,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,130249,23518,0,153766,48576,25914,74490,1424,6054,0,7478,235735 +"331",0,0,0,0,0,0,0,0,1,194693,3309,23,48,657,16,1,19,8,0,0,0,0,0,99,3,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,198883,63304,0,262187,24875,11028,35902,2102,1691,0,3793,301883 +"332",0,0,0,0,346,0,0,469,28,1255,325661,1470,100,148,1080,34,159,848,0,71,0,0,110,0,43,422,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,332242,64259,0,396501,121594,11976,133570,4673,13614,0,18287,548359 +"333",0,0,111,0,0,0,0,0,7,185,2303,332018,575,457,1358,532,38,154,0,8,0,0,59,0,129,251,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,338189,162785,0,500975,180508,15791,196299,5339,15065,0,20404,717678 +"334",0,0,0,0,0,0,0,0,0,0,337,515,298083,174,43,403,9,684,0,31,0,53,9,0,1069,155,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,649,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,302220,328098,0,630318,255088,11048,266136,6507,18559,0,25066,921520 +"335",0,0,0,0,0,0,0,0,58,192,218,1015,482,120410,129,282,27,48,0,0,0,0,17,7,49,393,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,123328,107989,0,231317,102669,8779,111448,6902,7976,-309,14569,357334 +"3361MV",0,0,0,0,0,0,0,0,19,0,770,1043,7,121,555947,6458,0,14,0,561,0,0,0,0,1,944,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,565947,277587,0,843535,243161,14412,257573,5827,33873,0,39700,1140808 +"3364OT",0,0,0,0,0,0,0,0,1,0,151,198,541,0,2026,251503,0,15,0,0,0,0,0,0,0,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,254487,40277,0,294763,21842,4221,26063,568,2933,0,3501,324327 +"337",0,0,0,0,0,0,0,789,86,0,35,5,0,5,0,0,67204,205,0,54,0,0,15,0,0,174,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68573,44980,0,113552,80019,15599,95618,3097,9455,0,12553,221723 +"339",0,0,0,0,0,0,0,0,13,0,232,47,1325,12,805,2,101,133126,3,24,8,359,623,0,1554,1304,4,0,0,0,1620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,25,0,1228,0,142416,100825,0,243241,225033,16733,241766,2189,16650,0,18840,503847 +"311FT",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,963861,0,545,0,0,0,8032,0,1156,0,9784,2250,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3195,0,988827,105141,0,1093967,595366,25393,620758,2391,95067,0,97458,1812184 +"313TT",0,0,0,0,0,0,0,0,19,2,99,0,12,0,451,0,59,69,0,40876,171,186,468,0,2,884,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43297,46262,0,89559,73199,4900,78099,3754,6837,-26,10565,178222 +"315AL",0,0,0,0,0,0,0,0,54,0,1,1,0,0,0,1,5,2008,596,274,15940,0,6,0,137,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1311,0,20335,103069,0,123404,209858,6735,216593,15322,23176,0,38498,378495 +"322",0,0,0,0,0,0,0,9,27,1,0,0,0,20,0,0,0,53,30,1,0,176099,590,0,111,658,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,672,0,178270,22489,0,200760,65282,12169,77451,658,7143,0,7801,286012 +"323",0,0,0,0,0,0,0,0,0,0,48,0,1,0,0,0,5,367,0,161,8,252,56552,0,0,42,0,0,0,0,0,0,0,0,0,0,0,0,0,1554,0,0,0,0,0,0,0,0,0,0,0,0,9,0,1672,0,0,0,0,0,0,0,0,0,0,0,0,3,0,1828,0,62502,2420,0,64923,13311,3066,16377,127,893,0,1019,82319 +"324",0,0,20609,111,32,0,0,0,143,810,3,0,0,5,0,0,0,0,34,0,0,0,0,331559,6171,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,359479,38703,0,398182,143438,31108,174545,130,97940,0,98070,670798 +"325",0,0,145,1813,0,0,0,16,118,144,28,83,227,0,2,23,9,104,1733,2702,66,19,0,15930,665884,1317,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,113,0,690481,284990,0,975472,469110,35127,504237,3067,31943,-13,34997,1514705 +"326",0,0,0,0,0,0,0,91,130,1,661,42,142,80,90,136,10,780,0,562,2,381,200,0,2304,224212,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,229824,57688,0,287511,107522,5956,113478,3351,9507,0,12858,413847 +"42",0,0,971,73,130,1429,0,1140,1233,746,3066,4199,1944,1944,2055,897,779,5236,8536,418,326,1051,526,7711,10021,1781,1781551,0,0,0,0,0,0,0,0,0,0,0,0,1676,2,120,3833,0,0,0,0,0,0,0,0,132,0,0,0,0,0,0,0,0,0,0,0,0,33,492,0,0,0,0,0,1844053,0,0,1844053,-1741789,0,-1741789,0,0,0,0,102265 +"441",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,244857,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,475,0,0,0,0,0,0,0,0,0,0,0,0,28,3,0,1452,0,0,0,0,0,246816,0,0,246816,-246816,0,-246816,0,0,0,0,0 +"445",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,245590,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,164,224,0,0,0,0,0,6480,252463,0,0,252463,-252463,0,-252463,0,0,0,0,0 +"452",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,201145,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2559,0,0,562,0,0,0,0,0,0,0,0,0,0,397,0,172,0,0,2740,0,0,207575,0,0,207575,-207575,0,-207575,0,0,0,0,0 +"4A0",0,0,0,0,0,848,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,999245,0,0,0,0,0,0,0,0,2403,67,3857,139,0,0,0,0,0,0,217,0,1570,1976,0,1087,86,637,8090,1433,19,88,866,1337,452,1203,3430,0,0,48,0,0,1029097,0,0,1029097,-1017225,0,-1017225,0,0,0,0,11872 +"481",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112335,0,0,0,0,0,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112368,16547,-4693,124222,0,-7008,-7008,0,10595,-231,10364,127579 +"482",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,75875,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,122,75998,372,-802,75568,0,-64733,-64733,0,696,-4110,-3414,7421 +"483",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37508,0,0,0,344,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,294,38146,32372,-43788,26731,0,-9192,-9192,0,156,-58,98,17637 +"484",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,372413,0,0,683,352,0,0,0,0,0,0,0,0,0,0,1151,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,374599,2743,-8117,369225,0,-311540,-311540,0,374,0,374,58059 +"485",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64857,0,274,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24498,89630,0,0,89630,0,0,0,0,1085,-15617,-14532,75098 +"486",0,0,0,0,0,2836,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51,0,0,0,0,0,0,0,0,0,58701,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,61587,0,0,61587,0,-61017,-61017,0,84,0,84,655 +"487OS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,623,0,0,0,0,1062,0,1730,20360,4,0,278155,1744,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,552,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9924,314154,5712,-9442,310424,0,0,0,0,455,0,455,310879 +"493",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,331,0,0,0,0,0,0,0,6428,0,0,1491,134188,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,142439,0,0,142439,0,0,0,0,212,0,212,142651 +"511",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,335939,0,0,16135,0,0,0,0,0,0,0,0,13571,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,75,0,579,0,366299,4064,0,370362,118721,6133,124854,41,11603,0,11644,506860 +"512",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,666,0,0,0,0,0,0,0,0,0,143971,1228,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,0,13,1,0,145925,12092,0,158017,8110,115,8225,1,1810,0,1810,168052 +"513",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,724181,2655,0,0,0,0,0,0,0,0,170,0,0,0,0,0,0,0,0,0,0,0,83,0,0,0,0,0,0,0,727089,123,0,727212,0,0,0,0,30645,-16,30629,757841 +"514",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42595,0,7,285818,0,0,0,0,0,0,0,0,21010,63295,0,0,0,0,0,0,0,0,0,0,0,0,823,15,0,0,2506,0,416070,1398,0,417467,0,0,0,0,2274,0,2274,419741 +"521CI",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3601,41,0,333,0,0,0,0,0,0,0,0,0,0,0,0,1043349,24336,0,0,0,1711,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,1073454,7484,0,1080938,0,0,0,0,0,-478,-478,1080460 +"523",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30450,596724,1575,0,0,0,75,0,0,508,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,629332,44,0,629376,0,0,0,0,1465,0,1465,630842 +"524",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3795,1121684,0,0,398,602,0,0,0,0,146,0,134,0,0,0,0,0,0,0,0,0,0,0,9876,0,424,1137058,57840,-743,1194154,0,0,0,0,43284,-7104,36181,1230335 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,154799,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33,0,32753,0,187585,0,0,187585,0,0,0,0,63,0,63,187648 +"HS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2332057,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34193,2366250,0,0,2366250,0,0,0,0,0,-44736,-44736,2321514 +"ORE",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51,0,0,0,0,0,0,0,1447820,1055,0,0,0,0,269,0,80,0,0,161,0,792,27,621,0,1457,0,0,703,0,16545,1469581,0,0,1469581,0,0,0,0,1557,-7019,-5462,1464119 +"532RL",0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10364,144,4,0,971,369,583,0,335,0,0,4,0,0,55,9123,23,65106,0,0,0,0,0,396692,0,123,30,0,226,144,0,437,141,0,0,1168,101,533,0,358,0,0,0,0,0,487043,0,0,487043,0,0,0,0,18697,0,18697,505740 +"5411",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,90,0,0,0,0,358647,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,358738,5026,0,363764,0,0,0,0,17190,0,17190,380954 +"5415",0,0,140,2,45,389,435,23,40,75,342,635,1281,183,277,571,42,359,166,10,15,52,222,50,438,186,7166,166,20,0,3711,177,222,22,126,2,33,374,230,15318,494,3013,18014,2594,1077,2468,8,105,320,178,383,487759,13360,13274,12030,21,4974,840,2755,32,123,160,71,48,3,1194,1954,2147,535,4920,0,608395,34964,0,643359,0,0,0,0,5431,0,5431,648790 +"5412OP",0,0,430,47,158,126,27,112,994,583,3504,10337,62171,2760,14450,17825,331,13961,3712,274,227,744,14296,751,61068,1674,835,5,1,1,9050,1263,400,43,359,71,241,6224,721,44789,2179,110997,206314,3003,1296,3230,6,315,1393,469,302,12328,1499272,6337,44949,177,34822,317,7810,16,25,6150,34,4,0,1072,24992,27465,0,60528,0,2330371,94112,0,2424483,0,0,0,3,8490,0,8493,2432976 +"55",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615715,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615715,0,0,615715,0,0,0,0,1757,0,1757,617472 +"561",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,25,0,2,0,77,0,0,0,0,0,0,4,0,159,0,0,66,0,0,0,0,0,0,0,0,5904,1472,0,967588,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9150,0,984702,2634,0,987336,0,0,0,0,7028,0,7028,994364 +"562",0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4915,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,460,125426,0,0,0,0,0,0,0,0,0,0,0,0,0,14378,0,145185,319,0,145504,0,0,0,0,2047,0,2047,147552 +"61",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,0,0,0,0,0,0,0,0,369,0,0,119,0,0,0,0,0,0,3,0,391,0,0,25,0,294421,0,0,0,0,223,2877,0,0,6,250,0,0,103726,0,402513,1936,0,404448,0,0,0,0,513,0,513,404961 +"621",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1090663,2276,24,274,0,0,0,0,0,0,0,0,35389,0,1128685,490,0,1129175,0,0,0,0,442,0,442,1129617 +"622",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,899243,0,0,0,0,0,0,0,1592,555,0,230331,0,1131721,6118,0,1137839,0,0,0,0,2515,-5,2511,1140350 +"623",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252779,2018,0,0,0,0,0,0,0,0,0,0,254797,140,0,254937,0,0,0,0,2791,0,2791,257729 +"624",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,79,0,0,0,0,584,247860,0,597,0,0,0,0,0,0,3934,0,253054,0,0,253054,0,0,0,0,1025,0,1025,254079 +"711AS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1730,0,0,0,0,129726,10,543,0,0,22,0,0,3359,114,135505,1437,0,136942,0,0,0,0,3647,0,3647,140589 +"713",2154,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,99,1,0,270,0,0,170,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2161,101359,18748,1513,0,0,0,0,2715,36134,165340,19,0,165359,0,0,0,0,11409,0,11409,176768 +"721",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,70,0,0,0,0,0,0,0,9351,0,0,0,0,7,65,113403,13,0,0,0,0,11125,0,134033,0,0,134033,0,0,0,0,16418,0,16418,150451 +"722",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10116,7529,17856,0,0,0,0,0,0,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5462,43,1591,451,0,2529,5811,24537,720392,2678,0,0,1287,14969,0,815270,0,0,815270,0,0,0,0,59530,0,59530,874800 +"81",0,0,0,0,0,0,0,0,0,0,374,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72659,51374,0,1938,15608,0,0,0,0,0,0,1031,0,2,0,717,102,0,0,0,0,0,248,1030,0,4190,2082,0,0,0,17,0,0,0,0,249,2000,1027,0,691060,0,0,0,1213,2466,849386,3895,0,853281,0,0,0,9,19419,0,19429,872709 +"GFGD",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,697519,0,0,0,0,697519,0,0,697519,0,0,0,0,0,0,0,697519 +"GFGN",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,461096,0,0,0,461096,0,0,461096,0,0,0,0,0,0,0,461096 +"GFE",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,186,75950,0,0,76136,283,0,76419,0,0,0,0,0,0,0,76419 +"GSLG",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2019672,0,2019672,0,0,2019672,0,0,0,0,0,0,0,2019672 +"GSLE",0,0,0,0,0,4689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,106640,111329,0,0,111329,0,0,0,0,0,0,0,111329 +"Used",0,0,0,0,0,0,0,391,8,583,2964,298,0,0,268,37,0,0,1,0,0,622,193,0,0,258,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1249,0,0,0,0,0,0,0,0,9,0,0,0,0,4378,0,11258,17145,0,28403,142925,33256,176181,58,17997,0,18055,222639 +"Other",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3252,0,0,0,3252,182600,0,185853,0,0,0,0,0,0,0,185853 +"T017",427966,53821,202820,94088,77851,463500,1804448,123530,133473,199593,346756,352742,367004,127138,579512,279512,69733,158751,978837,46068,17329,180155,74177,356552,757257,235094,1881150,300254,265559,214102,1054360,115969,77238,39474,404972,64935,59265,288743,137317,444829,146922,854483,534714,1144505,627231,1129051,154813,2354753,1452312,404649,359335,547158,1583235,635415,1029984,127919,352226,1100988,916476,254116,250575,144558,114806,162104,724183,704712,726398,495330,107738,2592876,381464,35970903,2541813,-67585,38445132,0,0,0,68627,759880,-118366,710141,39155273 diff --git a/flowsa/data/external_data/BEA_Summary_Supply_2021.csv b/flowsa/data/external_data/BEA_Summary_Supply_2021.csv new file mode 100644 index 000000000..81b049aef --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Supply_2021.csv @@ -0,0 +1,75 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","T007","MCIF","MADJ","T013","Trade","Trans","T014","MDTY","TOP","SUB","T015","T016" +"111CA",482037,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,633,0,482923,50681,0,533604,165841,72663,238504,138,9855,-17266,-7274,764834 +"113FF",5422,61620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88,0,0,0,0,722,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,156,0,3207,0,71214,23056,0,94271,13523,5615,19138,222,1246,0,1468,114876 +"211",0,0,338466,0,216,104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,339087,144385,0,483472,22312,61821,84133,132,16216,0,16349,583954 +"212",0,0,57,90583,0,0,0,0,642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,774,0,92101,6317,0,98418,9198,26676,35874,11,4551,0,4562,138855 +"213",0,0,16835,6126,68538,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,91499,1672,0,93172,0,0,0,0,0,0,0,93172 +"22",0,0,0,0,0,549948,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,207,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,79,23495,1354,151491,726574,2854,0,729428,0,0,0,0,32828,0,32828,762256 +"23",0,717,381,13538,6360,3042,1981567,718,977,249,2399,683,58,84,560,878,417,652,179,45,2,97,17,283,161,130,8300,8,0,1178,4894,33,154,1,41,0,102,108,100,23,79,1192,813,4,1,5,0,22045,393,79,2,9,644,86,1401,1,545,673,1213,49,179,533,494,1043,753,480,3,391,0,22334,0,2084575,0,0,2084575,0,0,0,0,2616,0,2616,2087191 +"321",11,0,0,0,0,0,0,158280,20,0,230,0,0,0,0,0,531,104,0,0,0,211,17,0,3,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,238,0,159846,35805,0,195651,56491,11964,68455,828,6724,0,7552,271658 +"327",0,0,0,222,0,0,0,50,140450,121,215,184,13,88,0,0,35,34,0,1,54,30,0,182,110,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,141885,30691,0,172576,56824,28894,85717,1907,6727,0,8633,266927 +"331",0,0,0,0,0,0,0,0,1,274027,3647,25,50,585,14,1,21,9,0,0,0,0,0,121,3,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,278511,105138,0,383650,43489,14866,58355,3324,2320,0,5644,447649 +"332",0,0,0,0,1294,0,0,615,29,1396,366999,1791,102,162,979,38,204,971,0,100,0,0,121,0,46,508,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,375355,82819,0,458174,146223,13693,159916,6286,15356,0,21641,639731 +"333",0,0,215,0,0,0,0,0,9,231,2856,369985,567,424,1352,660,41,222,0,7,0,0,83,0,148,383,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,377188,199133,0,576322,216367,18304,234671,7838,17843,0,25681,836674 +"334",0,0,0,0,0,0,0,0,0,1,361,520,313647,165,55,454,10,830,0,38,0,59,10,0,1211,181,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,797,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,318347,390238,0,708585,304492,12860,317352,7959,21145,0,29104,1055042 +"335",0,0,0,0,0,0,0,0,62,321,223,1139,533,135416,136,412,26,56,0,0,0,0,11,8,103,363,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138808,137720,0,276528,122216,10616,132832,9617,8767,-336,18049,427408 +"3361MV",0,0,0,0,0,0,0,0,19,0,827,892,7,66,642699,4687,0,44,0,730,0,0,0,0,1,1149,68,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,651187,309265,0,960452,294198,16957,311155,7563,39323,0,46886,1318494 +"3364OT",0,0,0,0,0,0,0,0,1,0,157,179,535,1,4724,254564,0,15,0,0,0,0,0,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,260275,39975,0,300250,32447,4871,37318,1108,3336,0,4443,342011 +"337",0,0,0,0,0,0,0,945,107,2,54,6,0,11,0,0,72240,230,0,53,0,0,18,0,0,244,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73910,56923,0,130833,98839,17835,116675,4288,11164,0,15452,262959 +"339",0,0,0,0,0,0,0,31,21,0,468,54,1724,12,9,5,116,146983,3,29,21,434,682,0,1646,1419,6,0,0,0,2457,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,93,0,1304,0,157520,139552,0,297072,287003,21064,308067,3043,20695,0,23738,628878 +"311FT",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,1047087,0,775,0,0,0,11960,0,1301,0,10235,2446,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3394,0,1077202,125500,0,1202702,661342,29867,691209,2258,104725,0,106983,2000895 +"313TT",0,0,0,0,0,0,0,0,23,2,113,0,17,0,496,0,71,95,0,44824,241,231,560,0,2,1103,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47779,41429,0,89208,81268,5117,86384,3405,7366,-20,10751,186343 +"315AL",0,0,0,0,0,0,0,0,77,0,1,1,0,0,0,0,2,1819,641,243,16467,0,6,0,142,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1393,0,20793,130523,0,151316,300515,8540,309055,18987,29405,0,48393,508764 +"322",0,0,0,0,0,0,0,25,28,2,0,0,0,8,0,0,1,59,38,1,0,191837,604,0,115,725,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,714,0,194156,26543,0,220699,69991,13909,83900,774,8006,0,8779,313378 +"323",0,0,0,0,0,0,0,0,0,0,62,0,1,0,0,0,5,363,0,249,10,283,59958,0,0,44,0,0,0,0,0,0,0,0,0,0,0,0,0,1637,0,0,0,0,0,0,0,0,0,0,0,0,10,0,1730,0,0,0,0,0,0,0,0,0,0,0,0,12,0,1941,0,66308,2910,0,69218,13876,3364,17240,136,959,0,1095,87553 +"324",0,0,44236,122,120,0,0,0,123,846,3,0,0,3,0,0,0,0,41,0,0,0,0,562298,10808,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,618602,69615,0,688217,187453,35137,222589,174,115610,0,115785,1026591 +"325",0,0,283,2082,0,0,0,25,186,211,32,83,260,0,2,26,9,127,2328,3057,174,22,0,32385,784985,1785,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,120,0,828193,322090,0,1150282,529998,40576,570574,4420,35573,-19,39974,1760830 +"326",0,0,0,0,0,0,0,126,178,1,701,74,138,92,91,220,10,955,0,678,2,415,198,0,2724,260854,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,267459,72500,0,339960,126063,7170,133234,4533,10830,0,15363,488557 +"42",0,0,1553,83,208,1700,0,1496,1361,921,3370,4672,2051,2154,2223,1000,818,5982,9193,436,365,1109,527,12550,11366,1990,2131157,0,0,0,0,0,0,0,0,0,0,0,0,1920,2,129,4829,0,0,0,0,0,0,0,0,142,0,0,0,0,0,0,0,0,0,0,0,0,40,538,0,0,0,0,0,2205885,0,0,2205885,-2096895,0,-2096895,0,0,0,0,108989 +"441",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,323360,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,555,0,0,0,0,0,0,0,0,0,0,0,0,5,3,0,1603,0,0,0,0,0,325525,0,0,325525,-325525,0,-325525,0,0,0,0,0 +"445",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,259384,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,197,472,0,0,0,0,0,6994,267057,0,0,267057,-267057,0,-267057,0,0,0,0,0 +"452",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219758,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3047,0,0,593,0,0,0,0,0,0,0,0,0,0,397,0,175,0,0,2904,0,0,226874,0,0,226874,-226874,0,-226874,0,0,0,0,0 +"4A0",0,0,0,0,0,1066,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1241035,0,0,0,0,0,0,0,0,2779,116,4083,172,0,0,0,0,0,0,284,0,1456,2341,0,1161,97,695,9135,1631,19,101,1139,2268,628,1667,3954,0,0,51,0,0,1275878,0,0,1275878,-1262156,0,-1262156,0,0,0,0,13722 +"481",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,171734,0,0,0,0,0,36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,171770,22533,-6636,187667,0,-9034,-9034,0,17907,-276,17631,196264 +"482",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,86316,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,139,86455,399,-942,85912,0,-72959,-72959,0,730,-5055,-4325,8627 +"483",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38011,0,0,0,382,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,442,38835,53738,-68513,24060,0,-9687,-9687,0,162,-1,161,14534 +"484",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,445387,0,0,941,409,0,0,0,0,0,0,0,0,0,0,1297,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,448033,3233,-9539,441728,0,-373951,-373951,0,384,0,384,68160 +"485",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,79437,0,426,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24406,104269,0,0,104269,0,0,0,0,1252,-14929,-13677,90592 +"486",0,0,0,0,0,3501,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,82,0,0,0,0,0,0,0,0,0,62210,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65793,0,0,65793,0,-65222,-65222,0,78,0,78,649 +"487OS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,721,0,0,0,0,1306,0,1625,24455,6,0,341819,2059,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15450,388053,8294,-13352,382995,0,0,0,0,534,0,534,383529 +"493",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,349,0,0,0,0,0,0,0,7691,0,0,2053,155674,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,165767,0,0,165767,0,0,0,0,250,0,250,166017 +"511",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,377095,0,0,19906,0,0,0,0,0,0,0,0,14977,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,273,0,615,0,412868,4927,0,417795,137808,7253,145061,45,13043,0,13087,575943 +"512",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,774,0,0,0,0,0,0,0,0,0,163204,1342,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,5,1,0,165373,14519,0,179892,9680,147,9828,0,2095,0,2095,191815 +"513",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,756043,3260,0,0,0,0,0,0,0,0,184,0,0,0,0,0,0,0,0,0,0,0,119,0,0,0,0,0,0,0,759605,160,0,759765,0,0,0,0,31012,0,31012,790777 +"514",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49333,0,7,353588,0,0,0,0,0,0,0,0,23365,71062,0,0,0,0,0,0,0,0,0,0,0,0,804,16,0,0,2662,0,500837,2069,0,502906,0,0,0,0,2474,0,2474,505380 +"521CI",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4409,42,0,354,0,0,0,0,0,0,0,0,0,0,0,0,1097245,26378,0,0,0,1966,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,1130495,7189,0,1137683,0,0,0,0,0,-275,-275,1137408 +"523",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33395,683722,1681,0,0,0,87,0,0,552,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,719436,58,0,719494,0,0,0,0,1733,0,1733,721227 +"524",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4163,1184782,0,0,403,662,0,0,0,0,156,0,125,0,0,0,0,0,0,0,0,0,0,0,12587,0,494,1203372,58785,-1101,1261056,0,0,0,0,29271,-9716,19555,1280612 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,146305,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,122,0,34794,0,181220,0,0,181220,0,0,0,0,66,0,66,181286 +"HS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2468334,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34108,2502442,0,0,2502442,0,0,0,0,0,-46723,-46723,2455719 +"ORE",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,0,0,0,0,0,0,0,1620116,1206,0,0,0,0,291,0,89,0,0,160,0,1040,57,882,0,1610,0,0,792,0,26427,1652756,0,0,1652756,0,0,0,0,1799,-9065,-7266,1645490 +"532RL",0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12326,182,3,0,1266,454,581,0,400,0,0,5,0,0,63,9340,28,63122,0,0,0,0,0,464885,0,133,36,0,235,162,0,484,161,0,0,1441,186,765,0,392,0,0,0,0,0,556659,0,0,556659,0,0,0,0,21170,0,21170,577829 +"5411",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,0,0,389614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,389710,5365,0,395074,0,0,0,0,24381,0,24381,419455 +"5415",0,0,113,2,36,399,459,21,31,73,317,512,1359,211,250,484,67,307,119,12,19,83,206,40,454,178,7438,94,11,0,2103,128,173,15,91,24,14,279,181,17531,516,3151,21746,2546,1057,2553,11,93,283,157,386,542698,14007,14357,14180,25,4776,849,2786,32,124,132,59,77,4,1129,2000,2202,647,4983,0,671403,39149,0,710552,0,0,0,0,5912,0,5912,716464 +"5412OP",0,0,418,46,154,1258,27,252,865,667,4591,10923,59071,2882,15858,16078,275,14784,3565,258,214,886,14409,548,62767,1779,1201,5,1,1,9947,1616,570,62,492,101,344,8436,978,45829,2707,121499,252751,4994,2117,5360,11,197,903,295,333,11186,1689068,6555,50501,196,35455,453,8750,23,26,7427,73,4,0,1143,27273,38342,0,61611,0,2611414,107532,0,2718947,0,0,0,3,9525,0,9528,2728474 +"55",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,665191,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,665191,0,0,665191,0,0,0,0,1928,0,1928,667118 +"561",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,273,0,0,0,26,0,2,0,77,0,0,0,0,0,0,5,0,168,0,0,81,0,0,0,0,0,0,0,0,6813,1606,0,1131701,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9601,0,1150353,3676,0,1154029,0,0,0,0,7986,0,7986,1162016 +"562",0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5346,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,492,139233,0,0,0,0,0,0,0,0,0,0,0,0,0,15120,0,160199,445,0,160643,0,0,0,0,2213,0,2213,162856 +"61",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,111,0,0,0,0,0,0,0,0,424,0,0,147,0,0,0,0,0,0,3,0,435,0,0,25,0,305888,0,0,0,0,270,3357,0,0,7,265,0,0,110169,0,421102,2301,0,423403,0,0,0,0,649,0,649,424052 +"621",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,68,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1230840,2667,23,300,0,0,0,0,0,0,0,0,37082,0,1270989,403,0,1271391,0,0,0,0,542,0,542,1271934 +"622",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,988225,0,0,0,0,0,0,0,1685,2028,0,246941,0,1238879,8476,0,1247355,0,0,0,0,2900,-7,2893,1250248 +"623",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,257819,2179,0,0,0,0,0,0,0,0,0,0,259998,115,0,260113,0,0,0,0,3225,0,3225,263339 +"624",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,250,0,0,0,0,592,273580,0,718,0,0,0,0,0,0,4179,0,279320,0,0,279320,0,0,0,0,1244,0,1244,280563 +"711AS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1763,0,0,0,0,174276,13,781,0,0,24,0,0,3568,155,180580,1566,0,182146,0,0,0,0,4593,0,4593,186739 +"713",1876,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,130,1,0,371,0,0,91,0,0,0,0,0,0,73,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2474,133882,26447,2002,0,0,0,0,2569,48042,217957,26,0,217983,0,0,0,0,15702,0,15702,233685 +"721",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80,0,0,0,0,0,0,0,17943,0,0,0,0,8,143,158898,19,0,0,0,0,11819,0,188910,0,0,188910,0,0,0,0,18894,0,18894,207804 +"722",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12005,8943,21204,0,0,0,0,0,0,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5389,47,1809,462,0,3308,9109,35037,954520,2904,0,0,1400,15213,0,1071385,0,0,1071385,0,0,0,0,71245,0,71245,1142630 +"81",0,0,0,0,0,0,0,0,0,0,418,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,81325,58665,0,2114,18227,0,0,0,0,0,0,1287,0,2,0,757,126,0,0,0,0,0,285,1171,0,4582,2424,0,0,0,17,0,0,0,0,318,2458,1470,0,774558,0,0,0,1289,3021,954514,3733,0,958247,0,0,0,9,22229,0,22238,980485 +"GFGD",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,709095,0,0,0,0,709095,0,0,709095,0,0,0,0,0,0,0,709095 +"GFGN",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,507268,0,0,0,507268,0,0,507268,0,0,0,0,0,0,0,507268 +"GFE",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,679,77544,0,0,78223,273,0,78496,0,0,0,0,0,0,0,78496 +"GSLG",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2149907,0,2149907,0,0,2149907,0,0,0,0,0,0,0,2149907 +"GSLE",0,0,0,0,0,4957,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,114129,119086,0,0,119086,0,0,0,0,0,0,0,119086 +"Used",0,0,0,0,0,0,0,398,6,578,3235,369,0,0,343,38,0,0,1,0,0,515,166,0,0,285,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1145,0,0,0,0,0,0,0,0,10,0,0,0,0,4650,0,11737,25540,0,37278,191051,41073,232124,94,21579,0,21672,291074 +"Other",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4222,0,0,0,4222,221020,0,225242,0,0,0,0,0,0,0,225242 +"T017",489346,62364,402557,112803,76926,565982,1982054,162982,145214,279647,391279,392105,380133,142363,669791,279545,74900,174647,1063195,50761,18345,196213,77867,608462,888756,273522,2244388,386852,281686,234439,1303055,176062,87794,39805,483904,79568,62875,355820,159401,496744,166851,897542,658244,1201305,717440,1194477,146327,2490668,1624428,473804,390335,605979,1782345,686188,1202123,141773,372685,1242482,1007242,259179,276489,192367,152823,226748,959488,789297,740413,555879,119424,2754177,425321,40807998,3142858,-100084,43850772,0,0,0,89101,871894,-103689,857306,44708079 diff --git a/flowsa/data/external_data/BEA_Summary_Supply_2022.csv b/flowsa/data/external_data/BEA_Summary_Supply_2022.csv new file mode 100644 index 000000000..8ade4dd99 --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Supply_2022.csv @@ -0,0 +1,75 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","T007","MCIF","MADJ","T013","Trade","Trans","T014","MDTY","TOP","SUB","T015","T016" +"111CA",569652,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,274,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,683,0,570639,57971,0,628610,192675,86656,279331,158,11373,-13234,-1703,906238 +"113FF",6066,65943,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,95,0,0,0,0,1430,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1015,0,3965,0,78514,24157,0,102670,13445,5921,19366,224,1603,0,1826,123863 +"211",0,0,519504,0,296,140,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,335,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,520275,219545,0,739820,28979,69066,98045,142,25504,0,25645,863509 +"212",0,0,56,107782,0,0,0,0,697,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,836,0,109419,7186,0,116605,10268,35485,45752,10,6428,0,6438,168795 +"213",0,0,27291,8786,76403,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112481,1538,0,114020,0,0,0,0,0,0,0,114020 +"22",0,0,0,0,0,647971,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,516,26282,1462,170745,847203,4508,0,851711,0,0,0,0,36434,0,36434,888145 +"23",0,840,284,12175,5898,2783,2131476,1004,1366,348,3088,889,81,118,782,1228,582,748,250,62,3,136,24,396,225,182,9607,10,0,1605,4821,32,169,1,55,0,96,111,125,23,80,1259,859,4,1,5,0,26672,371,80,2,9,652,87,1420,2,624,817,1274,39,142,622,576,1085,993,526,3,370,0,23249,0,2243447,0,0,2243447,0,0,0,0,2894,0,2894,2246341 +"321",12,0,0,0,0,0,0,168696,23,0,262,0,0,0,0,0,568,111,0,0,0,222,19,0,3,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,257,0,170393,36536,0,206930,60588,13810,74398,864,7298,0,8162,289489 +"327",0,0,0,231,0,0,0,50,151617,134,238,192,16,100,0,0,39,36,0,1,75,31,0,188,121,104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,153172,36311,0,189483,62996,38397,101393,2189,7433,0,9622,300498 +"331",0,0,0,0,0,0,0,0,1,318235,4038,26,56,671,17,1,24,10,0,0,0,0,0,145,3,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,323240,126078,0,449318,48558,17747,66306,4198,2644,0,6843,522467 +"332",0,0,0,0,1144,0,0,647,32,1604,402303,1960,105,172,1076,51,230,1043,0,105,0,0,134,0,50,555,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,411214,95721,0,506935,167889,15515,183404,7424,17964,0,25388,715726 +"333",0,0,336,0,0,0,0,0,8,277,3078,418093,576,447,1496,714,47,228,0,7,0,0,92,0,146,361,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,425910,226837,0,652747,236799,21521,258319,8579,19121,0,27700,938766 +"334",0,0,0,0,0,0,0,0,0,1,377,545,334845,183,61,563,9,903,0,41,0,61,12,0,1166,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,934,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,339913,430041,0,769954,324646,15546,340191,7798,22574,0,30372,1140517 +"335",0,0,0,0,0,0,0,0,67,359,246,1272,587,148419,150,504,28,60,0,0,0,0,13,8,112,393,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,152218,161731,0,313949,133108,13698,146806,10260,9515,-378,19397,480153 +"3361MV",0,0,0,0,0,0,0,0,21,0,887,959,7,73,711692,4166,0,47,0,765,0,0,0,0,1,1250,75,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,719944,354144,0,1074088,317820,22554,340374,8908,43838,0,52745,1467207 +"3364OT",0,0,0,0,0,0,0,0,1,0,167,199,540,1,5710,317497,0,17,0,0,0,0,0,0,0,107,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,324238,50606,0,374844,37646,6761,44408,941,3819,0,4760,424012 +"337",0,0,0,0,0,0,0,995,119,2,60,7,0,11,0,0,79024,248,0,55,0,0,20,0,0,266,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80808,61892,0,142701,106647,23764,130411,4080,12144,0,16224,289336 +"339",0,0,0,0,0,0,0,31,23,0,503,57,1792,13,9,6,126,159531,3,30,29,404,753,0,1791,1536,6,0,0,0,2480,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,605,0,1408,0,171138,142444,0,313582,295545,28188,323733,3169,21647,0,24816,662131 +"311FT",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,1119900,0,921,0,0,0,13085,0,1452,0,11176,2655,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3665,0,1152859,147734,0,1300593,719076,35854,754929,2776,108897,0,111674,2167196 +"313TT",0,0,0,0,0,0,0,0,25,2,125,0,18,0,553,0,73,101,0,46277,293,238,620,0,2,1202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49530,40218,0,89748,86255,5657,91912,3437,7916,-20,11333,192993 +"315AL",0,0,0,0,0,0,0,0,79,0,0,0,0,0,0,0,2,628,604,234,17428,0,7,0,146,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1504,0,20633,161603,0,182236,319732,11244,330976,24931,32239,0,57170,570383 +"322",0,0,0,0,0,0,0,26,31,2,0,0,1,9,0,0,1,63,50,1,0,199095,672,0,126,794,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,771,0,201639,32404,0,234043,74926,16166,91091,915,8657,0,9573,334707 +"323",0,0,0,0,0,0,0,0,0,0,67,0,1,0,0,0,6,383,0,263,13,290,66730,0,0,49,0,0,0,0,0,0,0,0,0,0,0,0,0,1670,0,0,0,0,0,0,0,0,0,0,0,0,12,0,1914,0,0,0,0,0,0,0,0,0,0,0,0,81,0,2096,0,73575,3305,0,76880,16070,4028,20098,155,1127,0,1282,98260 +"324",0,0,64494,130,106,0,0,0,133,996,4,0,0,3,0,0,0,0,46,0,0,0,0,857351,11465,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,934730,94136,0,1028866,245186,40025,285210,163,116177,0,116340,1430416 +"325",0,0,443,2435,0,0,0,26,202,233,33,92,336,0,2,33,11,135,2570,3195,241,23,0,43017,874741,1945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,0,129,0,929909,365182,0,1295091,591249,42798,634048,5675,39297,-24,44948,1974086 +"326",0,0,0,0,0,0,0,132,201,1,769,82,145,98,101,244,11,1033,0,714,3,426,220,0,2976,288941,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,296098,82095,0,378192,138297,8183,146480,5169,12018,0,17188,541860 +"42",0,0,2047,98,274,1987,0,1582,1479,1049,3620,5301,2217,2309,2508,1178,893,6408,9734,452,411,1139,587,16021,12506,2218,2358915,0,0,0,0,0,0,0,0,0,0,0,0,2157,4,134,5211,0,0,0,0,0,0,0,0,154,0,0,0,0,0,0,0,0,0,0,0,0,44,581,0,0,0,0,0,2443219,0,0,2443219,-2321421,0,-2321421,0,0,0,0,121798 +"441",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,347425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,601,0,0,0,0,0,0,0,0,0,0,0,0,25,2,0,1878,0,0,0,0,0,349930,0,0,349930,-349930,0,-349930,0,0,0,0,0 +"445",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,278370,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,179,674,0,0,0,0,0,7526,286760,0,0,286760,-286760,0,-286760,0,0,0,0,0 +"452",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,238460,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3400,0,0,671,0,0,0,0,0,0,0,0,0,0,429,0,173,0,0,3045,0,0,246179,0,0,246179,-246179,0,-246179,0,0,0,0,0 +"4A0",0,0,0,0,0,1233,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1360237,0,0,0,0,0,0,0,0,3165,136,4277,198,0,0,0,0,0,0,309,0,1798,2540,0,1062,106,767,9752,1694,20,106,1313,2813,698,1968,4425,0,0,53,0,0,1398671,0,0,1398671,-1383281,0,-1383281,0,0,0,0,15390 +"481",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,279928,0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,279963,50888,-6263,324588,0,-14838,-14838,0,25518,-366,25151,334901 +"482",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,95539,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,95712,430,-1137,95005,0,-83138,-83138,0,814,-3200,-2386,9481 +"483",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51785,0,0,0,418,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,485,52687,74485,-91623,35549,0,-15130,-15130,0,199,-8,192,20610 +"484",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,535168,0,0,1034,477,0,0,0,0,0,0,0,0,0,0,1582,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,538261,3395,-11507,530148,0,-450073,-450073,0,426,0,426,80501 +"485",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,104890,0,490,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34232,139612,0,0,139612,0,0,0,0,1360,-21948,-20589,119024 +"486",0,0,0,0,0,4682,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,107,0,0,0,0,0,0,0,0,0,68493,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73282,0,0,73282,0,-72703,-72703,0,87,0,87,667 +"487OS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,792,0,0,0,0,2175,0,2608,31982,9,0,374153,2395,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21523,436323,7614,-12601,431335,0,0,0,0,588,0,588,431923 +"493",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,405,0,0,0,0,0,0,0,9245,0,0,2258,180888,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192797,0,0,192797,0,0,0,0,278,0,278,193074 +"511",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,426021,0,0,22611,0,0,0,0,0,0,0,0,16342,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1777,0,664,0,467415,5510,0,472925,152193,9307,161500,50,14360,0,14410,648835 +"512",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,865,0,0,0,0,0,0,0,0,0,192167,1376,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88,0,18,1,0,194515,13573,0,208088,10246,195,10440,0,2324,0,2324,220852 +"513",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,775538,3829,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,168,0,0,0,0,0,0,0,779736,170,0,779906,0,0,0,0,34459,0,34459,814364 +"514",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56339,0,7,402929,0,0,0,0,0,0,0,0,25500,81804,0,0,0,0,0,0,0,0,0,0,0,0,808,29,0,0,2875,0,570291,2124,0,572416,0,0,0,0,2796,0,2796,575212 +"521CI",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4525,46,0,363,0,0,0,0,0,0,0,0,0,0,0,0,1160847,27789,0,0,0,1825,88,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,1195507,11214,0,1206721,0,0,0,0,0,-588,-588,1206133 +"523",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31266,702538,1804,0,0,0,96,0,0,623,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,736327,61,0,736388,0,0,0,0,1864,0,1864,738252 +"524",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4228,1174964,0,0,402,824,0,0,0,0,172,0,147,0,0,0,0,0,0,0,0,0,0,0,14457,0,503,1195698,59648,-1370,1253977,0,0,0,0,33002,-11939,21063,1275040 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127741,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,791,0,37570,0,166102,0,0,166102,0,0,0,0,73,0,73,166175 +"HS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2628259,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37111,2665370,0,0,2665370,0,0,0,0,0,-49766,-49766,2615605 +"ORE",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,1739718,1453,0,0,0,0,322,0,98,0,0,171,0,1360,78,1245,0,1715,0,0,843,0,38841,1785945,0,0,1785945,0,0,0,0,1991,-1605,385,1786331 +"532RL",0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13879,206,3,0,1412,750,536,0,481,0,0,5,0,0,74,9372,33,57491,0,0,0,0,0,552597,0,146,36,0,247,181,0,513,167,0,0,1703,241,1075,0,437,0,0,0,0,0,641598,0,0,641598,0,0,0,0,23281,0,23281,664879 +"5411",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,103,0,0,0,0,402892,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,402996,5711,0,408707,0,0,0,0,24470,0,24470,433177 +"5415",0,0,100,2,32,396,437,24,45,73,372,604,1372,230,406,517,88,365,151,15,24,99,209,35,462,196,8650,86,10,0,1911,145,167,17,87,0,28,448,276,19625,472,2910,25036,2619,1088,2676,12,98,300,167,428,592849,15806,16373,16482,30,5140,913,2994,34,133,181,81,92,5,1214,1808,1994,695,5046,0,735378,42774,0,778152,0,0,0,0,6566,0,6566,784718 +"5412OP",0,0,398,44,148,1195,26,272,932,729,5081,11849,70453,3108,17537,18760,299,15938,3844,278,231,944,16088,590,68403,1919,1259,4,1,1,11381,2763,542,58,493,97,327,9086,983,48536,2613,126231,269104,4747,2021,5098,10,187,857,280,329,13101,1898724,8762,59819,218,40807,430,10106,22,25,9314,100,4,0,1209,30502,40876,0,64509,0,2904599,114560,0,3019159,0,0,0,2,10544,0,10546,3029705 +"55",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728388,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728388,0,0,728388,0,0,0,0,2138,0,2138,730527 +"561",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,305,0,0,0,27,0,2,0,76,0,0,0,0,0,0,5,0,169,0,0,96,0,0,0,0,0,0,0,0,7438,1826,0,1271551,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10999,0,1292494,3837,0,1296331,0,0,0,0,8875,0,8875,1305206 +"562",0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6323,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,547,156692,0,0,0,0,0,0,0,0,0,0,0,0,0,17414,0,180985,464,0,181449,0,0,0,0,2439,0,2439,183889 +"61",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,482,0,0,174,0,0,0,0,0,0,4,0,476,0,0,27,0,325815,0,0,0,0,310,3779,0,0,9,490,0,0,119342,0,451036,2393,0,453429,0,0,0,0,728,0,728,454157 +"621",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,142,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1304450,2782,21,320,0,0,0,0,0,0,0,0,41681,0,1349401,404,0,1349806,0,0,0,0,600,0,600,1350405 +"622",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1050023,0,0,0,0,0,0,0,3116,13193,0,254774,0,1321106,8852,0,1329959,0,0,0,0,3135,-4,3131,1333090 +"623",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,283899,2258,0,0,0,0,0,0,0,0,0,0,286157,115,0,286272,0,0,0,0,3495,0,3495,289767 +"624",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,293,0,0,0,0,628,294894,0,827,0,0,0,0,0,0,4512,0,301154,0,0,301154,0,0,0,0,1395,0,1395,302549 +"711AS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1879,0,0,0,0,231171,14,1095,0,0,44,0,0,3853,171,238228,1942,0,240170,0,0,0,0,5199,0,5199,245369 +"713",2212,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,143,1,0,444,0,0,104,0,0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1884,159797,34490,1533,0,0,0,0,3248,49214,253097,31,0,253129,0,0,0,0,17548,0,17548,270676 +"721",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,74,0,0,0,0,0,0,0,28618,0,0,0,0,9,195,203182,22,0,0,0,0,12762,0,244861,0,0,244861,0,0,0,0,20703,0,20703,265564 +"722",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13494,10058,23825,0,0,0,0,0,0,43,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5317,50,1869,494,0,4559,11444,48619,1097015,3055,0,0,1461,22906,0,1244210,0,0,1244210,0,0,0,0,78719,0,78719,1322929 +"81",0,0,0,0,0,0,0,0,0,0,465,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,86104,64913,0,2278,20359,0,0,0,0,0,0,1415,0,2,0,781,148,0,0,0,0,0,265,1388,0,4999,2716,0,0,0,18,0,0,0,0,344,2827,2054,0,855118,0,0,0,1391,3316,1050901,3524,0,1054425,0,0,0,10,24574,0,24584,1079009 +"GFGD",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,726008,0,0,0,0,726008,0,0,726008,0,0,0,0,0,0,0,726008 +"GFGN",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,502989,0,0,0,502989,0,0,502989,0,0,0,0,0,0,0,502989 +"GFE",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4415,78879,0,0,83294,312,0,83606,0,0,0,0,0,0,0,83606 +"GSLG",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2341080,0,2341080,0,0,2341080,0,0,0,0,0,0,0,2341080 +"GSLE",0,0,0,0,0,5038,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,121190,126228,0,0,126228,0,0,0,0,0,0,0,126228 +"Used",0,0,0,0,0,0,0,397,6,633,3538,393,0,0,377,43,0,0,1,0,0,500,175,0,0,296,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1204,0,0,0,0,0,0,0,0,11,0,0,0,0,5021,0,12596,24294,0,36890,196733,47797,244531,104,23201,0,23305,304725 +"Other",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5476,0,0,0,5476,293560,0,299036,0,0,0,0,0,0,0,299036 +"T017",577943,66813,614954,131683,84301,665432,2131939,173884,157105,324677,429320,442533,413147,155965,742478,345505,82061,188040,1137153,52496,19672,203608,86679,917800,987530,302748,2481375,417312,303105,255058,1428580,287365,96953,54573,583833,104996,69170,389513,185145,558191,195683,921885,731163,1256975,737665,1184650,127764,2655216,1743814,562870,403650,663011,2005409,753610,1353857,159455,409230,1316925,1070909,285328,297878,252769,182798,294418,1102266,871147,762096,574171,125733,2989673,485053,45127704,3695807,-124501,48699009,0,0,0,102333,956309,-103080,955563,49654572 diff --git a/flowsa/data/external_data/BEA_Summary_Use_SUT_2017.csv b/flowsa/data/external_data/BEA_Summary_Use_SUT_2017.csv new file mode 100644 index 000000000..630cf2f1f --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Use_SUT_2017.csv @@ -0,0 +1,84 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","T001","F010","F02E","F02N","F02R","F02S","F030","F040","F06C","F06E","F06N","F06S","F07C","F07E","F07N","F07S","F10C","F10E","F10N","F10S","T019" +"111CA",100821,613,0,25,19,0,1717,0,0,0,0,0,0,0,0,0,0,236,271958,2582,0,0,0,0,20768,0,861,744,1081,201,389,0,0,0,0,0,0,61,0,0,0,0,0,1,0,0,0,0,7,0,2,1,1302,34,1565,0,257,0,0,0,0,0,486,55,4123,25,14,-20,0,3230,0,413157,153165,0,0,0,0,-2307,60707,0,0,0,0,0,0,0,0,0,0,0,0,624721 +"113FF",22915,7798,0,101,0,0,0,15227,1,0,0,0,0,0,0,0,122,296,9560,0,64,3842,30,0,452,2395,0,0,818,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,296,22,2,0,74,0,0,0,0,0,242,443,5433,130,0,51,18,4146,0,74482,8819,0,0,0,0,655,8028,0,0,0,0,0,0,0,0,0,0,0,0,91983 +"211",0,0,21742,0,4,12414,0,3,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,323633,5565,0,4,4,0,1,5,0,0,0,0,0,7,0,80,4,0,2,6,0,0,0,0,0,35,0,0,0,4,3,0,2,196,1,0,0,0,0,23,0,0,3,0,0,1911,0,23385,389039,0,0,0,0,0,-7577,41909,0,0,0,0,0,0,0,0,0,0,0,0,423371 +"212",1841,0,110,9766,130,5310,19359,18,13579,11430,582,132,8,101,90,253,22,95,2143,76,0,2554,0,5165,7549,256,29,0,0,0,2,0,128,0,7,1,0,3,4,41,21,384,456,0,0,0,0,11,0,0,0,0,1509,70,1025,90,493,0,40,48,182,328,1036,198,1279,1499,0,4657,0,2655,7204,103970,334,121,0,0,0,-1735,22624,0,0,0,0,0,0,0,0,0,0,0,0,125314 +"213",0,0,12509,1040,2919,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16493,0,2288,0,0,97579,-87,3045,0,0,0,0,0,0,0,0,0,0,0,0,119318 +"22",9254,103,4060,3740,729,11338,9328,1860,3916,5187,4866,2771,1978,767,3318,2476,687,981,8518,882,19,6219,1439,5996,14612,4945,15273,5114,9602,8363,16909,284,71,274,4361,303,698,1634,2751,1050,541,4373,2276,4660,1045,854,2841,604,42245,1531,774,547,5904,5253,3450,1496,6811,4636,9070,4076,1376,1066,3435,6585,19703,6511,3511,1201,2793,21260,2846,349948,265417,0,0,0,0,0,4009,0,0,0,0,0,0,0,0,0,0,0,0,619374 +"23",1545,33,180,2689,2104,7400,248,308,817,880,1256,900,529,142,760,513,126,294,1610,87,4,905,295,9279,1990,685,3363,1383,911,1876,3371,227,2394,68,561,313,470,1308,813,135,108,2337,553,5930,1288,664,103,75764,43151,637,177,60,1549,737,800,130,1990,717,1110,581,480,211,482,2809,1674,3321,9838,652,540,31588,51847,294593,0,0,0,587008,466185,0,99,0,0,0,7960,0,0,0,12845,0,0,0,300993,1669683 +"321",540,135,0,351,402,5,61402,30110,220,394,190,998,366,528,3807,288,7934,1343,321,57,0,5748,2,0,257,1373,6634,169,617,164,984,0,2683,0,175,0,3,88,109,61,63,867,889,145,4,0,0,37,7485,420,10,25,967,5,1211,25,35,407,357,3,729,8,205,722,744,481,20,69,5,2608,292,147297,6760,0,0,9663,619,295,7007,0,0,0,0,0,20,0,0,0,0,0,0,171661 +"327",34,78,690,593,1326,80,102343,857,18797,2613,1779,2943,496,2087,7722,559,452,1175,4580,44,0,708,1,2219,2268,2250,172,275,70,456,813,0,18,0,223,0,0,33,93,5,2,3888,789,83,45,23,0,188,130,705,1,276,4871,79,1260,300,142,3267,2886,231,481,14,197,170,2750,1730,153,840,0,1905,3368,189627,21299,0,0,0,0,757,11229,0,0,0,0,0,0,0,0,0,0,0,0,222912 +"331",83,0,3008,579,558,5,5659,236,1562,68668,77294,42241,6111,16101,45771,12676,3693,5184,2255,87,0,1043,16,16,63,2007,524,7,0,0,310,0,722,0,0,0,0,268,0,23,6,485,330,0,0,0,0,1,2775,72,0,0,1412,45,539,376,160,195,20,15,265,23,360,33,113,820,150,560,0,89,603,306216,1415,0,0,0,0,2025,33297,0,0,0,0,0,0,0,0,0,0,0,0,342953 +"332",2031,206,6105,1109,1355,1094,117559,2984,1879,4433,42004,30704,9057,10335,28729,17653,5170,5159,16540,411,28,6505,948,1290,10392,8878,2955,449,257,185,2011,221,467,2560,1958,393,1840,741,898,1167,28,12715,1605,407,178,0,40,30,2881,1631,32,2985,5736,600,2759,3842,491,409,1502,33,2830,48,618,1628,3414,6803,7334,1422,224,5064,6058,422010,44258,17216,0,0,0,2032,40786,0,746,0,0,0,1471,0,0,0,344,0,0,528862 +"333",2302,86,6525,4817,6969,1611,49928,486,137,1664,6581,40031,516,1908,31908,5738,117,1202,4299,26,2,787,1634,79,4874,2123,2622,310,154,159,820,13,41,93,622,73,77,3897,1793,130,51,1666,663,9,46,627,0,131,134,981,30,2359,2801,308,3753,5080,2608,828,739,180,176,34,197,100,765,7858,847,246,132,5322,2387,228216,28856,313580,0,0,0,4386,124456,0,2572,0,0,0,646,0,0,0,16604,0,0,719315 +"334",81,1,42,36,232,150,9428,1079,630,1280,5666,7737,43589,3906,15213,23875,1014,2244,3034,303,21,1040,1062,357,5656,2325,39928,1071,448,642,1769,4,105,1,274,4,8,146,165,3247,522,18806,6315,913,1092,62,1769,2,1016,182,1589,6663,10311,7525,6803,973,1262,10096,695,162,756,30,158,438,190,4074,21362,3302,0,2713,2123,289720,152826,277315,0,354,0,4145,120954,0,31340,0,0,0,13408,0,0,0,17004,0,0,907065 +"335",2039,112,114,61,540,23,53292,427,95,1163,2786,15117,3408,10839,6874,2579,123,956,1409,37,1,480,82,134,1110,1007,501,419,122,894,401,1,316,21,155,179,3,126,235,5,0,5005,284,257,80,24,0,8,2362,273,1,3564,6162,112,2258,1314,698,18,983,1010,629,59,422,1216,483,5120,2414,3398,49,1783,4119,152289,83750,39678,0,11318,0,1815,38026,0,1355,0,0,0,706,0,0,0,1440,0,0,330377 +"3361MV",1157,135,857,1306,806,52,3234,2290,747,758,2031,16045,1236,890,204391,5482,643,1113,6944,93,1,1836,227,232,2054,819,10899,9058,2952,720,7217,0,97,0,10820,913,1,301,2510,460,112,1712,253,189,26,0,0,0,0,2422,0,158,4708,743,16438,1941,653,788,1768,158,3257,148,151,261,1291,23355,7413,144,4532,9605,1618,385165,350153,323939,0,0,0,11620,120041,0,967,0,0,0,514,0,0,0,14160,0,0,1206559 +"3364OT",0,6,0,5,0,0,64,11,0,0,53,107,0,0,464,64790,0,0,0,0,0,0,0,0,0,0,0,59,0,0,0,1709,1143,2000,13,61,0,2604,0,0,0,5,0,0,0,0,0,0,0,0,0,0,1952,64,32,50,0,0,0,0,0,0,28,0,0,270,48513,204,3,0,62,124271,37019,76831,0,0,0,-4875,122516,0,36365,0,0,0,1958,0,0,0,568,0,0,394653 +"337",0,0,0,0,0,0,27064,724,1,0,0,356,113,1,35,460,4666,224,0,0,0,0,0,0,0,378,874,205,0,20,1670,0,0,0,0,0,0,0,0,1,0,178,325,0,0,0,0,7659,106,0,13,4,650,7,3,0,0,278,108,1,184,619,730,2,296,730,0,0,143,15,412,49255,110214,43172,0,828,0,662,4811,0,2,0,0,0,154,0,0,0,3964,0,0,213060 +"339",135,1,21,34,29,0,2009,30,132,30,74,2879,3,668,2827,193,17,10144,56,11,104,0,5,4,520,146,1066,845,152,10,2222,0,1,0,10,29,1,218,175,7,2,229,98,148,27,12,0,0,397,65,17,54,2391,17,2361,327,469,27538,35771,1031,1908,132,375,77,859,2504,1123,566,0,7054,44,110406,245077,66555,0,0,0,295,45191,0,250,0,0,0,156,0,0,0,2239,0,0,470168 +"311FT",40169,267,0,0,0,0,0,26,610,7,0,0,0,0,0,0,0,6,209571,36,232,503,321,554,6195,233,3088,1,2836,1140,2260,849,2,549,43,0,0,14,0,56,23,0,89,0,0,0,0,0,0,0,0,0,7950,140,0,0,9292,5,8019,6718,15208,1435,7982,10010,101708,2653,4599,81,1328,56126,0,502932,1083133,0,0,0,0,8147,76671,0,0,0,0,0,0,0,0,0,0,0,0,1670883 +"313TT",121,75,0,2,0,0,3713,558,357,0,1,831,1,0,3655,2049,4062,2269,238,9147,1484,4146,285,36,3,3179,3658,86,141,4012,1919,0,0,127,31,0,1,111,10,2,200,9,7,0,0,0,0,1,228,243,0,0,516,22,134,190,57,78,463,2338,1596,0,631,2198,355,939,1496,431,6,2811,18,61273,67219,6896,0,2235,0,-316,11110,0,0,0,0,0,108,0,0,0,40,0,0,148563 +"315AL",60,0,0,0,0,0,0,0,1,0,0,0,0,0,2165,0,0,145,22,273,1278,0,2278,14,0,1,856,80,3,432,377,0,0,0,0,0,0,0,0,87,23,679,0,0,0,0,0,0,0,120,0,0,28,9,223,133,117,57,72,0,637,134,40,15,186,2321,295,65,82,2820,39,16165,413131,0,0,0,0,188,6224,0,0,0,0,0,0,0,0,0,0,0,0,435708 +"322",587,0,45,158,78,35,3570,1144,1947,1415,2290,2537,800,1329,4663,913,1705,2285,26699,396,21,53173,11697,365,7474,4916,8166,227,1441,514,1646,29,52,7,260,1027,42,2706,318,1919,69,522,227,1630,425,470,2,1,1391,1345,489,679,3414,567,5898,406,302,1765,2015,1135,1334,90,179,4293,4976,1231,178,2541,201,11345,34,197752,59714,0,0,0,0,912,24516,0,0,0,0,0,0,0,0,0,0,0,0,282894 +"323",16,0,5,2,0,12,51,6,0,0,14,9,0,3,5,0,0,0,65,0,1,0,1563,3,285,0,13363,295,216,236,6269,9,13,0,265,114,5,324,20,5085,473,628,3891,1580,1271,4087,0,0,208,532,1025,443,6080,1243,3497,20,918,1883,3150,145,2635,919,244,1174,1058,2065,587,1805,58,8554,514,78941,8499,0,0,0,0,313,2297,0,0,0,0,0,0,0,0,0,0,0,0,90050 +"324",11791,584,3364,4486,3043,15664,56863,1159,745,1488,1203,993,224,693,584,275,336,950,3131,88,5,1860,677,19758,14277,871,6390,1356,651,393,2385,27736,6633,6864,35775,3744,115,11903,6424,270,90,677,740,9290,3970,43,1619,84,8391,2461,69,1815,2360,1141,6392,2011,1459,971,1606,945,663,241,942,1213,4463,3221,11646,1652,2094,79206,27083,434310,324184,0,0,0,0,-7675,99910,0,0,0,0,0,0,0,0,0,0,0,0,850729 +"325",32336,2665,4726,2387,2267,2468,18962,3817,4702,2121,7632,3546,3055,2949,12762,2304,2646,7417,8741,13108,141,11698,4996,36629,245092,74189,2546,164,74,66,1256,2,311,12,311,28,3,164,820,779,216,946,661,142,125,72,0,704,14343,116,267,374,16877,1093,10190,2247,976,44291,24624,3658,737,629,1206,93,1226,6125,7619,3613,96,38564,3344,705067,554972,1628,0,0,0,12734,182492,0,0,0,0,0,0,0,0,0,0,0,0,1456893 +"326",2056,109,65,1811,872,42,47299,1372,1318,553,2563,13357,3587,2632,24541,5451,4756,5935,23070,425,103,3233,3111,605,13390,21656,22161,2087,2102,583,5166,487,6,0,1234,96,79,3359,390,412,88,6149,412,100,117,410,0,19,810,2007,42,2533,7436,138,3166,492,730,10718,3985,1983,1555,52,299,195,8938,6574,2130,1004,31,10141,3781,298109,72246,564,0,290,0,2257,29402,0,0,0,0,0,60,0,0,0,0,0,0,402928 +"42",1825,10,162,52,0,1348,78,212,320,794,883,1915,1195,1756,2933,63,427,1762,3828,101,16,1176,140,124,4633,2944,40695,2496,729,27,11772,167,0,0,89,0,5,0,0,659,11,2016,49,16,26,65,6,0,0,10763,0,400,0,0,72,28,29,68,24,0,0,0,45,0,43,60,0,0,5,24,0,99083,0,0,0,0,0,0,2385,0,0,0,0,0,0,0,0,0,0,0,0,101468 +"441",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"445",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"452",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"4A0",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,338,0,401,298,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1036,5974,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7010 +"481",0,0,1,14,340,1276,421,124,255,178,486,345,70,32,248,140,157,203,516,23,3,170,227,121,300,442,10321,275,67,93,397,322,25,224,3552,48,3,1619,518,644,217,876,2062,7130,3554,156,804,18,14885,1527,1266,4840,5841,547,6010,593,999,3164,361,359,705,171,236,244,2047,1011,5851,4138,380,4110,86,98387,129785,0,0,0,0,0,42609,0,0,0,0,0,0,0,0,0,0,0,0,270780 +"482",0,0,0,0,0,105,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,109,6,7,0,36,0,27,0,4219,0,1,153,5,0,0,304,1,13,6,135,0,0,0,9,31,16,257,2,84,0,0,7,21,0,0,0,0,0,0,11,108,83,841,252,0,6850,1458,0,0,0,0,0,1358,0,0,0,0,0,0,0,0,0,0,0,0,9666 +"483",0,0,0,0,0,10,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,16,6,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1075,85,5,5,232,5,47,0,6,1,0,0,0,8,1191,118,887,118,0,3826,22027,0,0,0,0,0,4858,0,0,0,0,0,0,0,0,0,0,0,0,30710 +"484",134,0,0,0,126,0,0,70,84,88,322,190,75,53,86,91,75,205,148,30,6,197,48,206,153,198,4109,2058,1019,721,4392,876,128,77,10714,97,6,3466,1143,105,32,2,211,0,0,6,4,0,0,221,74,80,1035,5,218,38,20,127,201,20,81,22,3,14,135,144,3910,69,962,186,12,39328,11700,0,0,0,0,0,1629,0,0,0,0,0,0,0,0,0,0,0,0,52658 +"485",0,1,0,3,83,776,424,33,68,49,129,95,19,9,70,37,41,66,137,5,0,46,58,32,84,114,1166,109,4,21,95,1,270,0,0,0,1,167,4,193,54,592,814,2741,1010,1189,217,20,5094,586,552,1851,3253,184,2276,154,444,1505,1848,504,171,2151,57,91,739,314,27,5,13,14484,799,48152,47460,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,95611 +"486",0,0,280,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,280,0,0,0,0,0,0,256,0,0,0,0,0,0,0,0,0,0,0,0,536 +"487OS",0,82,12,423,6,8859,0,530,618,118,79,18,0,3,10,0,323,170,418,42,0,395,370,815,174,491,59100,2223,1523,520,11700,23547,1023,4248,44636,834,257,26626,5589,1541,496,155,3120,923,3317,68,0,0,0,3241,747,973,7394,613,2276,1575,368,1698,2942,311,1354,510,562,98,726,1326,5,239,1114,671,2992,237144,17855,0,0,0,0,0,10096,0,0,0,0,0,0,0,0,0,0,0,0,265095 +"493",740,0,4,124,0,774,0,971,1740,70,584,519,548,80,81,134,105,426,3074,686,87,2520,746,807,2558,2756,26470,7813,5744,4171,21335,72,1,736,5383,199,47,892,6810,511,138,367,1047,0,0,19,0,2,142,544,215,260,1026,10,11966,263,209,639,1064,176,365,200,91,572,968,616,305,1288,0,5290,103,128203,251,0,0,0,0,0,166,0,0,0,0,0,0,0,0,0,0,0,0,128619 +"511",78,0,14,1,8,270,715,15,2,13,69,43,64,3,16,257,10,28,9,0,0,8,52,5,45,7,3473,441,120,219,947,17,56,0,37,8,0,609,134,47511,38,688,1988,1105,1016,630,99,0,876,884,1427,1059,5375,660,2174,20,792,2141,1310,115,1737,46,63,138,169,733,58,1293,42,8950,265,91197,149041,0,124991,0,0,-171,45606,0,0,4058,0,0,0,5266,0,0,0,10584,0,430574 +"512",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,78,264,230,0,32,8,0,0,1,0,16,11,0,98,23340,41518,170,30,20,0,0,0,60,351,8,37,2609,286,42,0,364,35,9,478,872,295,38,440,3036,442,17,909,76,341,0,76563,29445,0,38541,0,0,38,23669,0,0,0,0,0,0,0,0,0,0,0,0,168256 +"513",957,18,317,144,590,1910,6043,328,810,275,1173,1172,365,152,475,885,212,453,1299,84,11,344,517,123,658,428,12274,2125,793,498,6229,670,103,91,1156,858,100,1111,489,2482,628,101202,13791,12696,4137,2740,965,54,6802,1637,3327,2690,8738,1975,11151,1011,2400,5927,2291,1230,967,660,1066,3999,4746,4571,5978,7077,2108,66854,1675,333816,349013,7351,30517,0,0,0,12951,0,0,0,0,0,0,0,0,0,0,0,0,733649 +"514",0,0,36,9,25,4647,1687,413,802,514,1462,1646,218,323,482,2040,506,640,1308,91,12,638,282,164,584,434,3541,4528,1337,1219,8169,605,0,0,121,112,20,853,176,3806,110,4181,11715,33122,4130,2392,3257,4,1220,732,4260,3214,14208,1352,28139,1261,4622,1601,2684,273,781,870,1180,864,8025,7936,1587,3737,527,26032,2551,220017,46715,0,35440,0,0,0,6075,0,0,1781,0,0,0,2310,0,0,0,4545,0,316885 +"521CI",2838,277,1537,822,771,11279,7603,534,837,953,1910,2073,1386,784,2058,1418,536,1567,3770,265,142,1115,771,1344,4368,1670,41776,5943,2838,3308,11582,1181,6515,1065,1963,4811,858,1973,362,4924,2434,17709,3126,99902,49459,1233,4173,102196,81661,13853,2550,4774,15110,25390,9366,1068,2370,5574,5580,1075,1390,975,1881,6819,7430,17173,0,2172,1434,15295,3311,648207,278750,0,0,0,0,0,60005,0,0,0,0,0,0,0,0,0,0,0,0,986961 +"523",235,15,1531,1359,5969,626,1158,14,44,1044,1563,1447,131,262,1243,570,560,699,84,4,0,12,24,23,21,58,2555,85,198,437,550,1563,341,733,308,1525,41,1132,26,311,240,175,94,36747,27042,2548,96704,3,6016,1872,505,455,1819,7056,891,30,987,1016,5934,261,1499,706,63,3542,3930,3924,0,4,13,20006,2339,254922,225226,0,0,0,0,0,71878,0,0,0,0,0,0,0,0,0,0,0,0,552026 +"524",4251,652,1785,801,3389,2255,494,199,980,667,1047,1762,410,934,2124,1340,591,684,3722,295,60,367,96,369,2432,823,45201,4099,1500,1704,8686,680,41,860,13119,6079,232,3680,2626,605,1250,2203,997,5107,9708,343280,13083,7369,56441,8615,3732,2738,11403,359,7413,1356,2487,12837,13764,3147,9952,2386,1512,1534,6745,4306,0,807,3477,3380,10880,673909,398564,0,0,5033,0,0,19554,0,0,0,0,0,0,0,0,0,0,0,0,1097061 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4758,10344,0,0,0,0,0,0,94,0,0,0,0,0,0,0,0,0,0,0,0,0,99,0,672,0,15967,170526,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,186494 +"HS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2020853,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2020853 +"ORE",5027,21,965,161,746,7482,13281,592,955,436,4429,2124,3691,637,1737,1612,1093,1509,4226,444,124,1495,1743,141,3968,2358,74330,17886,21785,15886,93412,222,150,784,6001,1932,162,6762,8687,6943,3540,21068,8741,26929,21962,20541,692,11081,171613,8703,22404,8459,54382,32165,30411,2510,32087,50294,62547,27230,18866,11534,16418,2388,48887,51320,224,9970,493,23051,2613,1119061,5861,0,0,129878,33104,0,3274,0,0,0,0,0,0,0,0,0,0,0,0,1291178 +"532RL",2730,108,2346,2154,4329,2828,23803,217,670,541,1560,1183,514,328,5215,1025,232,661,2662,68,1553,761,454,958,3169,792,22660,926,970,2661,5868,12575,5880,6411,8764,921,57,3506,5865,1731,930,9476,7088,4543,4646,3653,41,4435,2124,9677,2020,2750,13857,15608,7876,2400,1668,3906,3981,590,553,1686,2017,1784,7494,2514,218,247,216,6388,549,264592,97091,0,0,0,0,0,80045,0,0,0,0,0,0,0,0,0,0,0,0,441728 +"5411",380,102,582,445,408,7529,5690,347,452,415,1746,1651,4131,279,2075,1775,297,1588,1234,123,67,725,320,495,4132,1066,17274,668,674,679,4310,612,907,153,217,204,48,639,328,4685,575,3711,4704,6574,10536,13116,2781,1986,13358,764,2930,3982,15014,10566,8577,487,444,5817,15327,1627,570,2234,1567,1280,2190,4465,0,115,76,11431,1192,217452,104093,0,0,22342,0,0,14209,0,0,0,0,0,0,0,0,0,0,0,0,358096 +"5415",482,33,2483,561,113,2467,4908,218,335,283,1589,2440,624,102,663,3953,294,494,1119,85,8,318,470,552,526,558,19647,4489,857,1671,5641,421,1221,16,572,168,4,226,302,8891,380,4850,9804,14189,9208,6917,1638,875,3637,423,4342,5947,9527,2167,14653,447,1524,3729,4353,839,1188,386,930,990,4037,3220,3977,11359,105,27195,4779,227420,0,37753,224926,0,0,0,30501,0,3669,7374,0,0,0,21084,0,0,2338,8235,0,563301 +"5412OP",2342,561,1839,1519,1905,16495,46700,1310,2131,2195,4835,4802,6071,1455,4510,4585,2049,3836,11989,575,148,2394,1546,2293,9720,4037,120853,23365,8953,4990,53787,1934,1974,1404,3156,1596,592,2465,2144,21722,5902,43228,31695,62402,36844,32733,4024,2743,51754,7729,10951,26721,123869,41887,44471,2609,6758,27763,33594,8392,4484,7976,7078,9192,22327,26383,35068,9685,1336,61591,19246,1201215,72410,51774,438643,3058,0,0,152526,0,0,50501,0,0,0,80601,0,0,0,21404,0,2072130 +"55",0,0,13607,4998,4734,62,9581,353,2247,1057,4630,15461,5557,2231,7369,5468,481,4013,22454,666,207,2348,477,3602,21755,1785,88091,1930,4364,11001,26284,3077,7,1539,4373,150,2,6297,1672,4113,293,3411,2693,9481,10650,6642,1316,88,7069,9303,5228,4700,15140,53,22696,3018,7440,51395,10607,6405,4919,2485,2083,19069,45726,7540,0,0,81,4,0,547574,0,0,0,0,0,0,4296,0,0,0,0,0,0,0,0,0,0,0,0,551870 +"561",597,45,314,631,2102,14922,7974,627,1079,3228,9198,3493,2872,489,3286,8324,396,1842,4219,249,275,1690,3028,2125,4802,2010,68822,6938,3029,5392,19550,4302,806,5691,10204,6213,833,9509,5733,18510,1488,37265,16961,24326,12846,10211,214,3452,97825,20446,9892,31339,53452,16555,68427,4622,4791,26210,37360,8435,3276,5668,3160,5220,10423,15542,5828,9796,576,37204,6956,835118,64490,0,0,0,0,0,2433,0,0,0,0,0,0,0,0,0,0,0,0,902041 +"562",295,5,330,100,149,569,2074,109,249,269,365,279,153,59,215,269,103,141,1202,66,1,295,94,495,1915,316,2891,1024,484,297,1442,63,142,10,782,34,15,265,277,76,54,119,86,714,141,1988,845,3,30034,646,309,307,1888,859,1880,11003,303,1492,1713,802,554,124,474,1130,2078,1533,92,1299,245,20795,3469,104899,28334,0,0,0,0,0,156,0,0,0,0,0,0,0,0,0,0,0,0,133389 +"61",2,0,0,0,0,157,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,5,0,1,1869,74,481,0,2888,176,12,0,0,0,2,38,0,0,0,22,111,26,5,0,0,0,0,0,0,111,42,0,286,0,2073,0,3,0,0,2013,200,0,0,1766,0,15,61,7486,7,19961,360205,0,0,0,0,0,2580,0,0,0,0,0,0,0,0,0,0,0,0,382746 +"621",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,0,66,0,0,14285,8686,60,1,94,2,0,0,51,0,994,0,8832,0,33137,1050872,0,0,0,0,0,785,0,0,0,0,0,0,0,0,0,0,0,0,1084794 +"622",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16228,0,0,0,0,0,0,0,0,0,0,0,0,16228,1039196,0,0,0,0,0,2815,0,0,0,0,0,0,0,0,0,0,0,0,1058239 +"623",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1568,0,899,0,2467,241619,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,244286 +"624",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1409,0,1409,225279,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,226688 +"711AS",84,0,0,0,23,205,174,19,30,35,64,50,7,4,34,19,18,29,91,5,0,31,32,32,37,93,3017,405,376,68,499,0,141,0,49,17,0,234,6,202,6751,29597,380,2198,577,200,341,1,5133,270,595,951,3864,3925,1891,88,1293,757,790,161,278,20733,581,247,2717,1627,0,14,24,1217,34,93362,86972,0,5477,0,0,0,1546,0,0,0,0,0,0,0,0,0,0,0,0,187359 +"713",20,0,0,0,12,47,85,4,10,6,16,11,2,1,8,5,5,8,17,0,0,6,8,4,10,15,432,7,28,2,295,0,0,0,0,0,0,5,1,26,7,40,110,364,133,29,29,1,0,50,83,254,332,776,403,22,50,219,10,21,46,139,205,316,699,47,2,2,0,517,89,6091,210212,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,216307 +"721",1,0,1,8,201,1220,412,74,160,116,308,236,45,24,165,88,97,161,327,16,2,108,191,76,202,329,3500,42,57,52,247,0,14,0,0,0,3,333,15,549,172,848,2311,7624,2829,592,614,21,13791,1170,1384,5405,6664,942,5457,534,810,3048,212,260,151,125,217,502,2169,832,1434,900,48,2999,171,73618,163295,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,236913 +"722",443,8,8,30,391,2419,500,108,202,174,366,308,51,48,204,122,113,183,493,34,6,159,174,167,246,366,8641,952,806,1087,3561,7303,3,17,810,141,17,1308,303,492,249,816,2073,11209,2879,3395,1464,17,39555,2942,2520,7201,16667,4646,10612,502,1731,20754,12962,6768,2264,513,1214,7824,5613,2284,519,288,236,8941,566,211991,731851,0,0,0,0,0,2708,0,0,0,0,0,0,0,0,0,0,0,0,946550 +"81",345,45,49,109,495,1558,5855,361,959,1001,1577,1039,569,142,840,586,153,416,1742,98,6,1009,341,620,2115,819,17915,2274,2042,2060,5903,410,105,405,6439,1297,149,2277,908,1494,299,3509,2175,6724,3671,6085,249,18614,6378,9768,1192,2278,7902,6068,12548,4428,2308,6006,11600,1482,706,786,1302,2169,8495,6405,8035,8410,540,20379,2362,239398,613310,0,0,0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0,852782 +"GFGD",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,599358,0,0,0,0,0,0,0,0,0,0,0,599358 +"GFGN",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,379143,0,0,0,0,0,0,0,379143 +"GFE",11,4,0,3,0,312,9,0,0,33,120,291,87,149,0,0,0,17,0,1,0,0,55,43,62,0,21017,976,653,368,4470,3,0,2480,3029,342,29,771,691,545,193,210,1217,1782,2778,105,0,0,618,1335,367,521,2168,242,1099,130,570,1018,2225,254,577,153,80,755,5432,739,1,107,81,2028,106,63462,6914,0,0,0,0,0,710,0,0,0,0,0,0,0,0,0,0,0,0,71086 +"GSLG",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1737213,0,0,0,1737213 +"GSLE",0,1,0,0,0,377,0,60,164,179,252,200,100,39,152,199,47,97,853,50,2,204,58,347,1410,194,1708,607,344,190,945,4,0,0,420,6,7,116,185,69,50,97,89,659,190,99,0,0,2086,1092,558,270,1016,580,1286,702,133,702,758,497,377,93,208,804,1437,1139,1280,740,258,6378,1388,34550,72509,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,107059 +"Used",-18,229,0,0,1292,8024,3190,0,169,43646,1107,14,0,0,0,0,0,139,0,35,0,3980,0,0,78,96,0,54,0,0,275,13,0,-183,1024,6,159,6106,0,0,182,1,0,0,0,0,0,0,0,16,0,0,0,739,0,0,851,0,0,0,0,-100,1113,0,0,10744,-43,0,0,0,0,82941,209786,-106707,0,1883,-2586,4141,35225,0,0,0,-4,0,-4,0,-2683,0,-14497,0,3909,211403 +"Other",1086,48,512,18,417,1900,1780,192,268,642,771,1582,1531,369,1464,1124,172,554,2150,106,15,611,302,5681,2560,726,8244,120,512,1016,3308,15226,138,1681,947,15,47,548,108,893,318,7407,776,4292,32829,1378,249,98,1316,1555,278,2534,3262,2114,1392,108,535,0,0,294,0,342,234,666,1942,4627,11756,2797,8,0,0,142489,-90776,0,7711,0,0,0,204439,0,0,0,0,0,0,0,0,0,0,0,0,263862 +"T005",256796,15275,92883,49586,53003,160408,737746,72767,68832,163109,201509,230625,105563,66627,438047,184654,47384,72242,677856,32418,6262,129401,43321,428137,437567,160560,877731,119953,87171,81822,379075,107619,35235,41020,189187,34893,7067,113710,62718,149274,53011,399926,151072,409057,265890,474251,150527,238324,747583,136465,88283,149658,505459,198490,389872,62457,111882,362683,360018,96517,96307,72195,66547,106617,376432,275716,218671,108827,30505,724012,209724,14856027,13290625,1159953,906246,773891,594900,32674,2082977,599358,77264,63714,7956,379143,19195,109261,10161,1737213,44204,44768,304902,37094434 +"V001",30860,25331,29293,17623,29965,81578,520422,22261,29470,31764,99341,94780,150705,36458,75338,78965,21959,53804,113482,12300,7885,30386,26233,19430,101682,47155,532941,118071,96461,93086,299250,57095,21893,7144,96307,21954,7617,86152,53892,100191,35436,112173,100973,263353,251232,271004,2059,18920,93508,36227,131525,264757,594263,324518,409331,30195,192422,545209,396274,131540,114086,59516,54197,82723,298036,305492,246097,184220,59219,1338917,107032,10434980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00OTOP",9408,1182,23283,2783,2026,32439,8259,650,1423,2414,2878,3449,8005,1122,3477,2641,375,1562,6782,595,281,1704,721,3517,13589,1564,12659,3108,3223,2493,13302,3542,1436,807,3965,861,3256,2223,771,4824,3602,3761,3598,17401,4303,6709,701,254103,27704,8783,1243,1976,9399,7648,3936,1896,8360,8095,11590,3438,1150,2568,3649,5831,4201,10291,0,0,0,0,0,608532,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00OSUB",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V003",108581,11108,100192,29480,21720,170362,309683,12656,27458,25463,41922,49184,89654,20200,80095,69205,6521,31013,131740,4401,1268,23688,13598,87231,224706,28068,419837,68657,40131,18546,212301,46346,22481,5828,77160,19576,30054,36336,6319,129835,55929,308850,108063,366083,26611,267302,4036,1541039,396339,154996,118269,54929,258783,36459,130141,19317,43929,154882,76051,9426,11965,58667,19224,63036,86471,103985,159521,112305,11427,205956,56427,7873026,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"VABAS",148848,37621,152768,49887,53711,284379,838364,35568,58351,59640,144142,147412,248364,57780,158910,150811,28855,86379,252004,17296,9434,55778,40552,110179,339978,76787,965437,189835,139814,114125,524853,106983,45810,13780,177432,42391,40928,124710,60983,234850,94967,424785,212634,646836,282147,545014,6796,1814062,517552,200006,251036,321661,862445,368625,543408,51408,244711,708185,483915,144405,127201,120751,77069,151590,388709,419768,405619,296526,70646,1544873,163459,18916538,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T018",405644,52896,245652,99472,106714,444787,1576110,108335,127184,222749,345651,378037,353926,124407,596957,335465,76239,158621,929860,49714,15696,185180,83873,538316,777544,237346,1843169,309788,226985,195946,903927,214601,81045,54799,366619,77284,47995,238420,123701,384124,147978,824711,363706,1055893,548036,1019265,157323,2052386,1265134,336471,339319,471319,1367904,567114,933280,113865,356593,1070868,843933,240921,223508,192947,143617,258207,765141,695484,624290,405353,101150,2268884,373183,33772564,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00TOP",0,486,8342,2379,215,29332,1857,120,136,138,628,230,376,111,214,100,43,228,23260,17,15,119,55,478,5120,416,210708,45947,22253,37990,104107,21938,787,224,535,1017,77,285,133,1165,2758,37342,1528,2570,1281,23874,38,0,1309,12253,15394,4712,5394,1509,6300,1751,877,1472,2616,2963,952,6052,9882,24709,52391,13396,0,0,0,0,538,755440,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00SUB",10115,0,0,0,0,0,0,0,0,0,0,0,0,264,0,0,0,0,0,27,0,0,0,0,14,0,0,0,0,0,0,238,2263,47,0,0,0,0,0,0,0,11,0,546,0,0,0,18747,1417,0,0,0,0,0,0,0,0,0,375,0,0,0,0,0,0,0,0,0,6339,0,19471,59875,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"VAPRO",138733,38107,161111,52266,53926,313711,840220,35688,58488,59778,144770,147642,248740,57627,159124,150911,28897,86607,275264,17286,9449,55897,40608,110656,345084,77203,1176146,235782,162067,152115,628959,128682,44334,13957,177967,43408,41004,124996,61116,236015,97725,462117,214162,648860,283427,568888,6835,1795315,517444,212259,266430,326373,867839,370134,549708,53159,245588,709658,486155,147368,128153,126803,86951,176299,441100,433165,405619,296526,64306,1544873,144525,19612103,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/flowsa/data/external_data/BEA_Summary_Use_SUT_2018.csv b/flowsa/data/external_data/BEA_Summary_Use_SUT_2018.csv new file mode 100644 index 000000000..2af3b1ab5 --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Use_SUT_2018.csv @@ -0,0 +1,84 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","T001","F010","F02E","F02N","F02R","F02S","F030","F040","F06C","F06E","F06N","F06S","F07C","F07E","F07N","F07S","F10C","F10E","F10N","F10S","T019" +"111CA",102728,449,0,36,29,0,2467,0,0,0,0,0,0,0,0,0,0,356,271774,2126,0,0,0,0,20667,0,885,1035,1255,211,533,0,0,0,0,0,0,49,0,0,0,0,0,1,0,0,0,0,8,0,2,1,1364,32,2439,0,253,0,0,0,0,0,576,67,5794,24,16,-104,0,4303,0,419375,156088,0,0,0,0,-6196,59181,0,0,0,0,0,0,0,0,0,0,0,0,628449 +"113FF",23982,7296,0,119,0,0,0,17546,1,0,0,0,0,0,0,0,96,280,9346,0,74,3762,26,0,391,2350,0,0,828,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,359,26,3,0,71,0,0,0,0,0,258,475,5997,120,0,52,19,4627,0,78106,8465,0,0,0,0,-788,7826,0,0,0,0,0,0,0,0,0,0,0,0,93609 +"211",0,0,34285,0,4,20246,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,389926,5523,0,1,2,0,0,2,0,0,0,0,0,9,0,29,13,0,1,5,0,0,0,0,0,13,0,0,0,2,1,0,1,70,0,0,0,0,0,9,0,0,1,0,0,1819,0,23069,475032,0,0,0,0,0,-7146,70642,0,0,0,0,0,0,0,0,0,0,0,0,538528 +"212",1683,0,161,9421,136,7522,20754,17,14080,11708,635,150,7,118,93,205,20,100,1941,70,0,2240,0,5603,7014,209,30,0,0,0,2,0,150,0,7,1,0,3,3,32,28,385,862,0,0,0,0,8,0,0,0,0,1669,64,1083,71,469,0,35,41,333,326,930,197,1199,1486,0,3902,0,2955,6773,106932,337,79,0,0,0,-77,26063,0,0,0,0,0,0,0,0,0,0,0,0,133333 +"213",0,0,22123,1109,3064,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26320,0,3066,0,0,114846,138,3059,0,0,0,0,0,0,0,0,0,0,0,0,147429 +"22",8872,67,7504,4268,757,23524,9496,2022,4041,5975,4900,2491,1607,756,3367,2943,638,988,8907,1007,23,6106,1334,7325,13601,5112,16960,5548,9915,8983,18292,835,79,251,4583,426,1052,1596,2693,1087,590,5555,3722,3926,1211,889,2763,481,41650,1603,721,757,6186,5526,3591,1429,6502,4421,9392,3948,1356,1082,3520,6743,20954,7234,3586,1421,2765,21812,3220,378483,286817,0,0,0,0,0,4321,0,0,0,0,0,0,0,0,0,0,0,0,669622 +"23",1423,22,249,3151,2397,6988,257,321,870,1075,1276,887,522,148,742,518,117,319,1731,116,5,977,279,8871,1795,721,3828,1506,941,2018,3652,266,2433,70,537,431,602,1323,812,147,102,2362,875,6454,1481,817,103,71670,43328,809,173,73,1849,775,913,136,1913,698,1186,581,513,223,519,2894,1941,3510,10125,585,595,33212,54582,299336,0,0,0,624282,489616,0,103,0,0,0,8437,0,0,0,13244,0,0,0,320764,1755782 +"321",569,90,0,248,410,6,65255,34077,223,646,251,1178,476,880,3929,309,8004,1537,708,70,1,5327,2,0,340,2211,7739,211,678,195,1166,0,2972,0,179,0,8,93,155,68,99,1207,1388,367,9,0,0,25,9419,560,19,58,1102,6,1306,36,46,491,498,6,760,9,210,1496,956,538,14,68,3,2961,331,164202,7519,0,0,11007,287,2048,7027,0,0,0,0,0,154,0,0,0,0,0,0,192245 +"327",29,69,1338,634,1387,82,106522,1045,18622,2955,1894,2582,498,2211,9011,566,475,1120,5182,52,0,671,1,2138,2058,2646,136,300,64,526,865,0,20,0,160,0,0,27,101,5,2,3789,1041,65,43,48,0,111,113,855,0,302,6262,53,1214,333,111,3099,3408,212,561,14,186,165,2843,2214,73,694,0,2156,3680,199638,20281,0,0,0,0,2494,11561,0,0,0,0,0,0,0,0,0,0,0,0,233974 +"331",86,0,5905,651,682,4,6261,384,1839,81366,90359,45874,5795,16504,51302,13351,4086,5761,2517,95,0,1271,16,15,64,2193,695,8,0,0,333,0,783,0,0,0,0,259,0,19,11,479,606,0,0,0,0,0,3096,97,0,0,1682,49,649,347,179,204,24,15,312,27,375,40,129,910,154,541,0,96,758,349260,1206,0,0,0,0,5762,34806,0,0,0,0,0,0,0,0,0,0,0,0,391034 +"332",2018,147,10064,1325,1567,1309,125244,3749,2150,5363,47886,31426,9163,10827,31699,18851,5504,5420,18369,492,45,6749,912,1792,10706,9232,3598,478,296,222,2371,247,514,2547,1861,510,2266,697,1051,1147,41,14024,2463,596,261,0,41,18,2948,2070,33,3613,6665,625,3061,4233,505,450,1797,36,3099,52,646,2035,3596,6296,7388,1546,238,4711,6068,458970,45509,18679,0,0,0,5689,43778,0,489,0,0,0,858,0,0,0,244,0,0,574217 +"333",1973,56,10131,4718,7008,1721,50019,608,141,1739,6535,41517,593,2342,38385,6017,111,689,4668,29,0,984,1584,79,4641,2168,3025,333,157,165,961,18,40,93,604,87,91,4607,1811,102,47,1833,903,9,51,819,0,80,172,1281,26,2823,2904,270,4397,5700,2109,864,847,182,216,37,213,100,1002,8470,860,195,71,5071,2680,244783,30437,330713,0,0,0,8522,132553,0,3629,0,0,0,392,0,0,0,15913,0,0,766943 +"334",33,1,86,45,155,154,9172,1272,643,1587,5974,7661,46942,3787,16653,25948,973,2238,3050,346,22,1143,1024,412,5633,2426,39898,1228,504,740,2022,5,87,1,279,5,11,140,175,3452,707,21342,8551,999,1317,110,1921,1,1070,217,1493,7190,11827,8911,7782,1130,1316,11385,793,165,798,37,192,414,224,4156,20249,3769,0,2594,2185,308772,159099,292623,0,371,0,6554,123447,0,31027,0,0,0,9890,0,0,0,10975,0,0,942757 +"335",3072,67,190,83,922,24,55786,537,93,1754,3145,17176,3305,10819,7077,2688,116,1029,1314,39,1,454,72,149,1273,1125,1985,494,130,1340,394,2,361,20,107,287,4,174,179,7,0,4947,373,214,67,29,0,5,2294,349,1,4109,6404,88,2743,1364,734,17,1208,1167,374,64,587,1264,492,5315,2776,3785,46,1713,4662,164988,84833,45388,0,11735,0,2014,39432,0,1174,0,0,0,370,0,0,0,1258,0,0,351192 +"3361MV",1135,85,1388,1318,887,52,3151,2683,758,938,2166,15781,1402,862,217878,5254,641,1170,7061,96,1,1912,211,249,1999,859,11331,8778,2877,695,7348,0,110,0,9421,918,1,257,2317,394,159,1894,450,234,31,0,0,0,0,2829,0,158,4684,756,17726,1904,646,735,2062,158,3054,166,157,266,1348,22963,6764,153,4426,8191,1472,397772,358669,351327,0,0,0,15983,118346,0,3240,0,0,0,5350,0,0,0,27155,0,0,1277841 +"3364OT",0,7,0,2,0,0,57,9,0,0,46,27,0,0,470,73519,0,0,0,0,0,0,0,0,0,0,0,73,0,0,0,1265,1303,1897,6,81,0,2734,0,0,0,5,0,0,0,0,0,0,0,0,0,0,1437,49,38,52,0,0,0,0,0,0,16,0,0,302,44218,430,2,0,53,128100,37411,78434,0,0,0,-3138,130827,0,41304,0,0,0,2802,0,0,0,464,0,0,416204 +"337",0,0,0,0,0,0,28955,795,1,0,0,365,90,1,30,503,5112,169,0,0,0,0,0,0,0,358,1029,209,0,22,1946,0,0,0,0,0,0,0,0,3,0,159,457,0,0,0,0,6978,187,0,23,8,695,7,7,0,0,251,120,1,215,714,738,3,287,680,0,0,136,12,1064,52326,115882,45476,0,877,0,1313,5044,0,1,0,0,0,90,0,0,0,2775,0,0,223784 +"339",145,1,43,41,35,0,2080,37,127,36,84,2911,2,708,3211,203,29,9857,80,11,130,0,5,4,522,185,1385,940,164,12,2282,0,2,0,10,37,1,211,178,7,3,306,120,154,34,24,0,0,416,73,16,56,2775,26,2955,331,481,28375,38450,1092,2632,163,471,88,1158,3350,1747,551,0,7642,47,119253,257220,70262,0,0,0,3827,46370,0,202,0,0,0,75,0,0,0,1837,0,0,499046 +"311FT",41319,278,0,0,0,0,0,35,625,6,0,0,0,0,0,0,0,8,205000,27,312,454,356,660,6076,241,3170,2,2906,1023,2178,1067,2,553,58,0,0,13,0,46,19,0,186,0,0,0,0,0,0,0,0,0,7924,137,0,0,8398,6,7389,5652,18184,1426,8677,10307,101886,2326,3901,90,1115,54567,0,498603,1118999,0,0,0,0,4540,79088,0,0,0,0,0,0,0,0,0,0,0,0,1701230 +"313TT",91,49,0,2,0,0,3657,666,378,0,2,822,3,0,3886,2107,3649,2253,331,9687,1538,4251,266,32,7,3268,4253,93,144,4248,2286,0,0,110,31,0,2,85,10,2,292,9,8,0,0,0,0,0,372,289,0,0,657,20,170,209,71,74,513,2597,1612,0,584,2474,413,1017,1966,435,7,3252,20,65267,70201,6077,0,2354,0,407,11316,0,0,0,0,0,72,0,0,0,13,0,0,155706 +"315AL",113,0,0,0,0,0,0,0,1,0,0,0,0,0,1954,0,0,314,17,701,1767,0,3223,5,0,2,900,200,9,401,555,0,0,0,0,0,0,0,0,91,55,1534,0,0,0,0,0,0,0,194,0,0,24,11,295,121,163,114,225,0,783,222,80,36,496,2949,611,93,331,3472,36,22098,423865,0,0,0,0,1975,6597,0,0,0,0,0,0,0,0,0,0,0,0,454536 +"322",494,0,91,190,89,33,3861,1402,2038,1809,2449,2450,850,1381,5408,876,1727,2389,28776,450,20,53997,11263,427,7488,5099,8429,237,1452,542,1726,34,83,6,251,2089,55,2747,299,1829,88,475,314,1535,453,1114,2,1,1419,1260,443,741,3456,725,6418,481,315,1860,2417,1260,1439,97,196,4578,5281,1248,192,2455,214,13023,43,208381,58104,0,0,0,0,768,25561,0,0,0,0,0,0,0,0,0,0,0,0,292814 +"323",13,0,8,2,0,11,56,6,0,0,15,6,0,3,5,0,0,0,59,0,1,0,1217,2,196,0,12711,277,195,219,6460,8,13,0,251,134,7,307,17,4478,632,636,4741,1383,1270,5145,0,0,211,507,770,417,5906,1096,3465,19,834,1805,3376,136,2167,842,227,1157,1035,1712,721,1538,56,8470,457,77408,7861,0,0,0,0,416,2272,0,0,0,0,0,0,0,0,0,0,0,0,87957 +"324",13762,461,6701,6084,4143,24786,64414,1350,887,1854,1056,983,216,740,681,297,368,1136,3698,118,7,2209,724,26002,13973,988,8458,1696,776,488,3130,35295,8773,7783,41495,5655,222,16081,7220,548,147,919,1201,10735,5326,115,1877,42,9837,3190,88,2367,2934,1417,8623,2255,1694,1142,2069,1138,1093,330,1165,1449,5730,3918,17271,1455,2674,104646,31519,543624,367293,0,0,0,0,-3506,121406,0,0,0,0,0,0,0,0,0,0,0,0,1028816 +"325",31883,1794,7296,2599,2252,1848,19507,3958,4978,2332,7357,3251,3005,2881,13454,1991,2439,8092,9200,13261,65,11651,4566,45248,241440,82109,2815,235,111,70,1018,2,302,10,302,31,4,134,724,721,294,1009,1167,141,122,137,0,460,15890,135,212,410,20211,1154,12698,2137,728,49681,27747,3500,862,349,983,120,1167,8232,11815,3463,99,39359,3011,742226,590097,1890,0,0,0,4924,197082,0,0,0,0,0,0,0,0,0,0,0,0,1536219 +"326",1856,83,111,1713,1055,39,47906,1852,1259,690,2736,13865,3604,2653,27753,4708,4184,6433,25469,447,97,3428,2983,816,14970,22654,24629,2201,2094,604,5534,305,6,0,1206,117,104,2717,383,387,124,6996,681,91,128,1027,0,12,1161,2268,36,2713,8165,138,3491,583,790,11079,4856,2017,1830,60,296,210,9305,6390,2867,959,35,11741,3916,317615,74078,596,0,312,0,2700,31105,0,0,0,0,0,36,0,0,0,0,0,0,426441 +"42",1284,7,229,57,0,1334,78,243,342,911,870,1962,1105,1590,3113,62,394,1820,3804,107,15,1107,117,143,3836,3021,41901,2530,681,28,12111,180,0,0,90,0,5,0,0,677,12,1910,58,18,28,80,5,0,0,11002,0,381,0,0,74,29,29,71,23,0,0,0,44,0,51,59,0,0,5,36,0,99669,0,0,0,0,0,0,2823,0,0,0,0,0,0,0,0,0,0,0,0,102492 +"441",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"445",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"452",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"4A0",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,390,0,449,336,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1174,6628,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7802 +"481",0,0,2,14,374,1302,382,144,254,193,465,313,65,29,237,118,134,196,480,25,3,168,209,127,254,411,10649,277,67,92,440,403,25,246,3522,65,5,1738,499,644,298,794,2451,7857,3759,158,725,13,13685,1704,1071,4632,5783,521,6252,596,906,3218,387,358,790,171,246,241,2094,881,9127,4346,411,3943,82,102072,141749,0,0,0,0,0,47395,0,0,0,0,0,0,0,0,0,0,0,0,291216 +"482",0,0,0,0,0,114,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,109,6,7,0,37,0,32,0,4500,0,3,174,5,0,0,269,1,14,7,165,0,0,0,12,27,15,245,2,89,0,0,6,23,0,0,0,0,0,0,10,138,81,928,250,0,7274,1455,0,0,0,0,0,1366,0,0,0,0,0,0,0,0,0,0,0,0,10094 +"483",0,0,0,0,0,8,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,13,5,0,0,0,0,0,0,0,0,2,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1144,90,4,4,268,3,60,0,4,1,0,0,0,6,1499,124,1051,140,0,4434,24774,0,0,0,0,0,4830,0,0,0,0,0,0,0,0,0,0,0,0,34038 +"484",117,0,0,0,150,0,0,76,84,93,311,168,70,51,87,88,70,213,150,34,7,198,45,238,144,198,4547,2237,1051,788,4946,1094,141,76,10817,132,11,3737,1110,102,49,2,280,0,0,6,4,0,0,263,69,84,1094,5,251,43,21,138,246,21,73,24,3,15,144,148,4180,62,1018,201,13,41838,12669,0,0,0,0,0,1632,0,0,0,0,0,0,0,0,0,0,0,0,56139 +"485",0,1,1,4,123,1070,524,53,91,72,167,117,24,11,90,42,47,87,172,8,1,61,72,46,96,143,1510,135,5,27,135,1,317,0,0,0,1,189,5,265,98,685,1285,4031,1418,1580,261,17,6203,821,612,2358,4057,230,3061,206,502,1978,2434,593,257,2433,74,115,1008,358,39,6,18,15851,855,59154,53682,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112836 +"486",0,0,337,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,337,0,0,0,0,0,0,316,0,0,0,0,0,0,0,0,0,0,0,0,653 +"487OS",0,54,22,487,7,9557,0,688,710,141,78,19,0,3,10,0,244,173,471,55,0,442,375,944,173,541,64194,2301,1536,554,12862,25382,1117,4131,46373,1091,433,28789,5532,1472,735,150,4053,1069,3743,71,0,0,0,3762,675,1013,7953,600,2574,1628,364,1823,3557,320,1265,531,561,105,806,1217,1,208,1134,645,3208,254736,18772,0,0,0,0,0,11158,0,0,0,0,0,0,0,0,0,0,0,0,284666 +"493",647,0,6,139,0,798,0,1016,1723,71,550,454,498,77,80,124,95,431,3170,746,98,2465,691,896,2334,2676,28606,8272,5799,4430,23383,86,1,791,5686,249,76,978,6799,500,202,379,1341,0,0,20,0,1,173,631,192,268,1104,11,12354,279,196,650,1212,171,307,210,97,580,986,622,334,1168,0,5393,102,134423,267,0,0,0,0,0,174,0,0,0,0,0,0,0,0,0,0,0,0,134864 +"511",59,0,24,1,9,301,738,19,2,14,66,40,66,2,15,246,10,31,8,0,0,8,47,11,37,7,3801,479,102,232,946,19,63,0,38,16,0,601,129,44135,53,675,2559,970,1030,748,94,0,840,909,1276,1107,4854,608,2479,24,746,2021,1522,118,1378,51,68,142,177,665,80,1230,41,8734,279,87800,159635,0,136352,0,0,876,45080,0,0,4747,0,0,0,5928,0,0,0,12003,0,452420 +"512",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,292,232,0,53,8,0,0,1,0,24,13,0,131,29579,45488,216,39,26,0,0,0,65,421,8,42,2853,295,53,0,475,42,13,669,1059,332,48,635,3333,390,22,822,87,400,0,88236,30673,0,40617,0,0,97,21357,0,0,0,0,0,0,0,0,0,0,0,0,180979 +"513",741,12,545,161,663,1831,5973,351,843,318,1086,1023,336,128,459,855,187,433,1347,88,14,348,476,123,549,428,13149,2232,791,520,6506,1544,109,148,1546,1736,386,1306,411,2770,864,101161,16505,12800,4271,3601,1102,41,7841,2115,3274,3002,9044,1981,12328,1036,2289,6087,2504,1209,852,726,1223,4147,5121,5029,6047,8330,2155,67471,1712,348342,352704,7316,32104,0,0,0,11764,0,0,0,0,0,0,0,0,0,0,0,0,752230 +"514",0,0,51,9,26,5092,1704,520,866,588,1504,1622,210,321,507,1935,470,684,1356,110,15,691,272,207,525,400,3996,4961,1391,1314,9114,716,0,0,145,187,44,934,185,4083,160,4198,15028,29075,4333,3092,3251,3,1284,1048,4056,3968,15340,1454,31945,1428,4719,1742,2975,302,834,977,1276,954,9180,7997,1659,4095,523,26825,2624,233094,58986,0,44115,0,0,0,6667,0,0,2319,0,0,0,2896,0,0,0,5754,0,353829 +"521CI",3347,329,3685,895,831,11417,8130,351,1644,1230,1967,2188,2685,1109,2688,1062,506,1928,4457,419,512,1065,642,1472,4608,1720,42943,4803,2735,3161,12126,1513,7039,826,1971,5630,2220,2000,360,4713,2982,16665,4049,107258,51629,1742,3639,124398,61857,14120,2404,4316,14610,30700,7617,744,2313,5419,6114,1133,1300,1036,1890,6374,8390,13256,0,4673,1518,21168,3501,679741,296340,0,0,0,0,0,65516,0,0,0,0,0,0,0,0,0,0,0,0,1041597 +"523",223,9,1787,1668,7132,688,1188,23,52,1311,1750,1517,142,273,1390,566,560,806,92,6,1,16,25,30,22,66,2959,93,222,530,603,1812,377,851,345,2232,87,1298,25,324,389,190,125,43899,31214,3027,95089,3,6299,2318,477,512,2009,7800,1084,34,1054,1133,7234,287,1639,816,69,4317,4665,3602,0,4,14,22914,2573,277891,232749,0,0,0,0,0,70875,0,0,0,0,0,0,0,0,0,0,0,0,581515 +"524",3412,440,3274,903,3992,2446,470,249,1052,725,1090,1679,372,832,2230,1328,529,713,4397,329,65,357,91,426,2189,816,48715,4332,1516,1793,9062,894,45,895,13973,8825,339,4014,2561,628,1681,2239,1295,4614,10279,337663,13741,4235,56372,9892,3386,2846,12045,326,8477,1463,2433,12287,15565,3208,10110,2491,1601,1600,7326,4000,0,908,3154,3290,11171,681696,435265,0,0,5611,0,0,19675,0,0,0,0,0,0,0,0,0,0,0,0,1142247 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4433,9695,0,0,0,0,0,0,86,0,0,0,0,0,0,0,0,0,0,0,0,0,78,0,721,0,15012,166363,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,181375 +"HS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2105574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2105574 +"ORE",4285,15,1679,177,853,8482,13697,741,1171,465,4685,2133,3273,657,1936,1513,1160,1662,4934,522,140,1468,1706,187,4343,2354,82855,19482,22429,17082,98000,262,178,890,6686,2648,256,7115,8388,8087,4533,24192,11718,29971,25518,25247,716,5604,180932,10425,20701,9286,57567,33440,35582,2979,33489,50310,69384,27515,16373,12696,17566,2665,54340,56127,304,11813,617,23518,2689,1196415,6088,0,0,128797,34663,0,3213,0,0,0,0,0,0,0,0,0,0,0,0,1369176 +"532RL",2019,79,4514,2633,5278,2885,25643,240,699,593,1612,1384,587,340,5638,892,201,775,2886,76,1867,775,427,1026,3023,829,25521,959,1033,3049,6409,13292,6356,7626,20932,1243,35,2572,4871,1945,1096,9194,9266,4849,5501,4137,35,3699,2365,9975,1913,3337,15089,17411,8985,2360,1720,3640,3822,479,466,1870,2063,1940,9022,2398,308,284,211,8049,556,298804,98922,0,0,0,0,0,76838,0,0,0,0,0,0,0,0,0,0,0,0,474564 +"5411",296,65,864,491,414,7672,5557,384,459,448,1702,1532,3323,259,2077,1520,277,1646,1209,140,73,711,308,606,4067,999,18245,691,658,692,4549,555,992,195,216,263,66,665,322,4887,792,3596,5906,6353,10770,16197,2609,1040,12482,875,2587,4146,14605,10445,8742,486,422,5087,15837,1535,722,2201,1696,1270,2248,4442,0,120,75,11172,1198,219754,105161,0,0,22988,0,0,14609,0,0,0,0,0,0,0,0,0,0,0,0,362511 +"5415",383,23,3485,529,130,2735,5018,303,354,327,1453,1984,506,104,633,3627,261,523,1139,103,9,334,407,590,404,580,21976,4877,886,1776,6148,495,1374,47,657,302,9,259,319,8396,555,4824,12581,12313,9320,8852,1631,488,3943,602,4084,7163,10419,2266,17075,522,1588,3947,4744,930,1529,463,1063,1092,4683,3385,5079,12578,119,26098,5052,242455,0,42139,242282,0,0,0,32599,0,3039,8623,0,0,0,24091,0,0,1241,8961,0,605432 +"5412OP",1887,366,3173,1682,2186,17392,46992,1544,2250,2459,4775,4566,5565,1405,4914,4150,1883,4153,12139,657,155,2396,1467,2763,9888,4015,132757,25456,9146,5363,60270,1921,2181,1890,3224,2090,995,2563,2198,24468,7683,41922,43825,60119,39031,42511,3865,1542,52281,9661,10065,28721,130610,43663,48910,2770,7225,26890,35821,8087,5524,7983,7466,9110,23808,27192,47693,10424,1470,63298,19843,1288358,75457,50837,480791,3485,0,0,162337,0,0,53220,0,0,0,85053,0,0,0,21745,0,2221281 +"55",0,0,24071,5754,5354,69,9978,385,2308,1067,4517,13756,5077,2233,7468,5227,443,4176,23275,741,237,2235,438,4731,20184,1735,97953,2084,4465,11853,27886,3776,11,1594,4244,199,3,6640,1620,4436,421,3783,3494,9667,11649,7934,1304,55,8819,10528,4788,4930,15435,43,22789,3333,7145,49686,10604,6264,3770,2747,2262,19799,47320,8264,0,0,226,0,0,579284,0,0,0,0,0,0,4285,0,0,0,0,0,0,0,0,0,0,0,0,583569 +"561",490,30,537,730,2448,14452,8054,707,1104,3889,9178,3308,2476,521,3478,7164,360,1888,4394,292,263,1711,2664,2551,4806,2029,75752,7343,3079,5727,21083,4737,931,6138,9589,9050,1417,9994,5367,21455,2047,36883,24419,25450,13844,13629,214,1947,109962,23576,9449,32809,56526,17392,77796,4947,4789,26061,39600,8701,3604,5390,3293,5599,11262,16116,7195,10989,621,38212,7299,900810,71878,0,0,0,0,0,2565,0,0,0,0,0,0,0,0,0,0,0,0,975253 +"562",261,3,567,113,171,687,2094,126,239,289,357,264,126,56,206,247,93,129,1205,70,2,293,84,565,1666,291,3011,1039,457,293,1439,90,157,10,887,62,59,246,279,77,63,116,105,676,145,2323,753,2,35349,779,296,325,1955,830,2166,11715,301,1610,1959,782,512,127,524,1061,2038,1567,121,1091,260,20495,3771,112124,29151,0,0,0,0,0,169,0,0,0,0,0,0,0,0,0,0,0,0,141445 +"61",1,0,0,0,0,144,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,5,0,1,1807,76,431,0,2873,199,11,0,0,0,4,36,0,0,0,20,121,37,8,0,0,0,0,0,0,99,38,0,293,0,2186,0,4,0,0,2533,238,0,0,2089,0,19,83,7886,8,21275,372148,0,0,0,0,0,2107,0,0,0,0,0,0,0,0,0,0,0,0,395529 +"621",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,0,104,0,0,15049,11758,90,1,140,3,0,0,65,0,899,0,10583,0,38760,1096550,0,0,0,0,0,779,0,0,0,0,0,0,0,0,0,0,0,0,1136089 +"622",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,306,0,0,0,0,0,0,0,0,0,0,0,0,306,1088465,0,0,0,0,0,3051,0,0,0,0,0,0,0,0,0,0,0,0,1091822 +"623",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1680,0,922,0,2602,247981,0,0,0,0,0,197,0,0,0,0,0,0,0,0,0,0,0,0,250780 +"624",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,238589,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,238589 +"711AS",63,0,0,0,25,174,164,23,33,42,65,48,6,4,34,17,16,30,90,6,0,33,31,37,33,90,3307,442,379,74,568,0,152,0,55,24,0,248,6,210,9190,30306,464,2614,639,258,334,1,5121,280,539,945,4410,4029,2074,93,1314,817,978,171,576,22071,627,258,2901,1575,0,16,23,1268,34,100456,91765,0,5840,0,0,0,1470,0,0,0,0,0,0,0,0,0,0,0,0,199532 +"713",18,0,0,0,15,55,94,6,12,8,18,12,3,1,9,5,5,9,19,1,0,7,8,5,10,16,507,8,30,2,326,0,0,0,0,0,0,6,1,32,11,43,152,472,165,39,30,1,0,66,83,285,379,823,481,25,51,264,12,25,55,144,220,334,757,48,2,2,1,570,93,6880,220262,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,227146 +"721",1,0,1,9,233,1292,394,90,168,133,311,224,44,23,167,79,87,164,320,18,2,112,186,85,180,316,3744,44,57,53,269,0,16,0,0,0,5,342,15,595,247,808,2876,8892,3144,727,582,16,13311,1373,1229,5464,7046,946,5924,562,771,3286,228,272,299,131,231,531,2333,761,2340,988,53,3027,173,78348,170785,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249133 +"722",349,6,14,33,460,2541,494,132,216,200,372,295,48,43,207,109,102,190,510,38,6,166,170,186,220,366,9273,977,800,1103,3806,7802,3,17,877,180,31,1452,286,531,355,772,2560,13072,3193,4359,1386,13,38251,3357,2250,7284,17337,4693,11659,525,1648,22060,15265,7052,3103,531,1305,8353,6039,2055,853,320,251,9683,575,224771,770355,0,0,0,0,0,2678,0,0,0,0,0,0,0,0,0,0,0,0,997803 +"81",286,33,83,125,540,1480,5925,375,1010,1203,1586,1003,558,146,817,583,137,441,1841,126,7,1077,319,745,1901,846,19979,2480,2143,2249,6469,493,108,379,6796,1865,242,2371,888,1646,370,3830,2592,5382,3099,7146,204,16707,6151,9258,1060,2518,8431,6466,14620,4745,2546,5734,12256,1437,771,781,1439,2233,9384,6956,4218,9293,631,21085,2595,245235,649437,0,0,0,0,0,77,0,0,0,0,0,0,0,0,0,0,0,0,894749 +"GFGD",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,633618,0,0,0,0,0,0,0,0,0,0,0,633618 +"GFGN",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400800,0,0,0,0,0,0,0,400800 +"GFE",10,2,0,3,0,320,8,0,0,34,114,259,78,131,0,0,0,19,0,1,0,0,52,46,52,0,21465,970,616,363,4555,3,0,2512,3088,398,52,827,628,488,267,190,1477,1927,2828,111,0,0,581,1460,311,509,2175,234,1157,131,527,996,2516,245,519,151,78,756,5677,625,0,112,92,1929,101,64777,6882,0,0,0,0,0,897,0,0,0,0,0,0,0,0,0,0,0,0,72555 +"GSLG",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1825314,0,0,0,1825314 +"GSLE",0,1,0,0,0,580,0,68,158,196,252,197,83,39,150,189,44,88,889,55,3,210,51,409,1274,179,1825,636,341,196,973,6,0,0,455,9,28,102,194,74,65,98,113,678,207,108,0,0,2170,1268,513,276,1046,584,1437,805,131,726,857,490,302,99,230,787,1470,1201,1274,858,258,6421,1701,36129,75719,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,111848 +"Used",-18,236,0,0,1426,8014,3135,0,153,47306,1018,12,0,0,0,0,0,159,0,36,0,3364,0,0,65,87,0,47,0,0,275,96,0,-183,941,6,202,6919,0,0,267,2,0,0,0,0,0,0,0,20,0,0,0,764,0,0,1265,0,0,0,0,-81,1178,0,0,10360,-68,0,0,0,0,87005,223959,-117281,0,74,-2779,6213,41097,0,0,0,-4,0,39,0,-909,0,-16497,0,4166,225083 +"Other",808,28,818,20,415,1846,1566,212,265,634,687,1343,1275,304,1297,917,138,502,2037,99,14,554,266,5678,1944,663,7999,123,451,941,3481,15905,136,1723,912,18,84,528,93,881,395,7082,859,4245,35459,1627,229,65,1122,1545,235,2266,3086,1913,1393,109,454,0,0,276,0,326,219,640,1883,4822,9662,2135,5,0,0,139658,-83667,0,10116,0,0,0,208776,0,0,0,0,0,0,0,0,0,0,0,0,274884 +"T005",258248,12761,157445,54394,60237,195127,772884,83439,72018,186795,221370,234826,106679,68313,476922,193516,46741,75728,685993,34149,7617,129960,41731,514634,429206,171980,953023,127165,89033,87457,407092,122633,39909,44146,209912,49329,11564,122909,61257,153235,68901,412333,201891,425266,288057,501865,148204,239787,761063,152655,81684,160706,535522,212610,434899,66492,112282,369536,378230,96644,100188,76342,70713,112231,401677,283650,239418,117835,31703,772783,221456,15847998,13934443,1227620,992217,811892,636633,56408,2207189,633618,84106,68908,8433,400800,20128,117967,12335,1825314,45379,48463,324930,39304781 +"V001",28423,26777,29839,19021,35911,84491,558275,23537,30734,33977,105283,100457,158131,37625,79772,83345,22579,56378,117465,12544,7762,31315,26550,19902,104531,49309,545555,121988,98846,95703,311624,60234,23200,7364,103272,24560,7773,93058,60702,110275,36993,112990,116578,273775,257158,285664,2524,19932,100375,38778,137272,285894,636538,341754,431646,32703,202256,576264,411911,137396,121842,63560,56919,86451,314524,323026,257426,191008,61203,1393197,112046,10967689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00OTOP",9342,1267,23404,2843,1977,33679,8699,680,1481,2453,2971,3526,8463,1152,3593,2920,387,1604,6955,599,282,1736,732,3616,14305,1646,13357,3206,3231,2574,13921,3720,1484,857,4202,896,3561,2308,827,5011,3678,3773,4286,17957,4478,6991,680,262920,28906,9186,1282,2064,9922,7816,4190,1959,8747,8397,12122,3533,1202,2716,4057,6171,4323,10668,0,0,0,0,0,631488,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00OSUB",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V003",111506,11608,123471,27488,33630,171814,320092,12574,27039,31214,42970,50624,92954,21111,77509,72978,6937,33356,123680,3437,1259,27076,14143,130258,272202,29323,429129,70661,38763,18072,225769,43845,23734,7213,83374,19484,32617,38046,6943,130093,50392,318005,103874,392632,28734,263349,-2278,1611959,450111,166179,122441,65324,274120,37166,139156,20384,45286,153401,78401,9597,12029,63521,19230,66564,86969,109803,162655,118640,12174,217847,59395,8295054,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"VABAS",149271,39652,176714,49352,71518,289983,887065,36791,59254,67644,151223,154607,259548,59888,160874,159243,29903,91338,248100,16580,9303,60127,41425,153777,391037,80279,988041,195855,140840,116349,551314,107798,48418,15433,190849,44940,43951,133412,68472,245379,91062,434768,224738,684364,290369,556004,926,1894811,579392,214144,260994,353282,920580,386736,574993,55045,256289,738061,502433,150526,135073,129798,80205,159187,405816,443498,420081,309648,73377,1611044,171441,19894230,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T018",407519,52414,334159,103746,131755,485109,1659950,120229,131272,254439,372593,389432,366227,128201,637796,352759,76644,167066,934092,50728,16921,190087,83156,668410,820244,252258,1941063,323020,229873,203807,958407,230432,88326,59579,400761,94269,55515,256320,129729,398614,159963,847101,426629,1109630,578426,1057869,149131,2134597,1340455,366799,342677,513988,1456102,599346,1009892,121537,368571,1107597,880664,247170,235261,206140,150918,271419,807492,727148,659499,427483,105080,2383827,392897,35742229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00TOP",0,639,12480,3160,270,30386,2010,129,143,148,638,246,397,123,236,112,45,265,22348,17,15,121,56,466,5168,510,234079,47423,23219,38676,109873,23569,817,249,563,1108,80,312,145,1273,2580,39915,1740,2709,1325,39554,44,0,1410,13476,16102,5258,5846,1598,6710,1910,934,1584,2984,3057,1029,5999,11228,26552,55811,14156,0,0,0,0,583,825606,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00SUB",12446,0,0,0,0,0,0,0,0,0,0,0,0,260,0,0,0,0,0,28,0,0,0,0,14,0,0,0,0,0,0,226,2598,23,0,0,0,0,0,0,0,5,0,478,0,0,0,18583,1224,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,6321,0,21101,63320,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"VAPRO",136825,40291,189194,52512,71788,320369,889075,36919,59398,67791,151861,154853,259946,59751,161110,159355,29948,91603,270447,16569,9319,60248,41481,154243,396191,80788,1222120,243278,164059,155026,661188,131141,46637,15659,191412,46047,44031,133723,68617,246651,93642,474679,226478,686595,291694,595558,970,1876227,579578,227620,277096,358541,926426,388334,581703,56956,257222,739645,505405,153582,136101,135797,91433,185740,461627,457654,420081,309648,67056,1611044,150923,20656516,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/flowsa/data/external_data/BEA_Summary_Use_SUT_2019.csv b/flowsa/data/external_data/BEA_Summary_Use_SUT_2019.csv new file mode 100644 index 000000000..c27c1ee78 --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Use_SUT_2019.csv @@ -0,0 +1,84 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","T001","F010","F02E","F02N","F02R","F02S","F030","F040","F06C","F06E","F06N","F06S","F07C","F07E","F07N","F07S","F10C","F10E","F10N","F10S","T019" +"111CA",105190,357,0,36,33,0,2344,0,0,0,0,0,0,0,0,0,0,364,272253,1967,0,0,0,0,19948,0,875,822,1246,207,519,0,0,0,0,0,0,38,0,0,0,0,0,1,0,0,0,0,7,0,1,1,1328,27,2647,0,210,0,0,0,0,0,581,59,5795,21,16,71,0,4777,0,421745,160942,0,0,0,0,-13353,55966,0,0,0,0,0,0,0,0,0,0,0,0,625300 +"113FF",24403,5623,0,110,0,0,0,14616,1,0,0,0,0,0,0,0,106,292,9703,0,73,3432,24,0,402,2187,0,0,793,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,362,23,3,0,62,0,0,0,0,0,259,461,5902,104,0,42,18,4645,0,73647,8908,0,0,0,0,2308,6726,0,0,0,0,0,0,0,0,0,0,0,0,91588 +"211",0,0,22952,0,5,18058,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,324637,4067,0,1,1,0,0,2,0,0,0,0,0,11,0,27,20,0,1,5,0,0,0,0,0,13,0,0,0,1,1,0,1,61,0,0,0,0,0,8,0,0,1,0,0,1555,0,19512,390944,0,0,0,0,0,7554,88293,0,0,0,0,0,0,0,0,0,0,0,0,486791 +"212",1706,0,123,8525,218,7281,22377,14,13212,10015,588,128,8,100,91,164,20,111,1715,59,0,1904,0,5169,6662,183,26,0,0,0,2,0,162,0,7,1,0,2,2,21,32,337,956,0,0,0,0,8,0,0,0,0,1715,53,1005,63,398,0,30,35,235,312,791,177,1055,1390,0,3402,0,3069,6952,102612,347,68,0,0,0,930,24221,0,0,0,0,0,0,0,0,0,0,0,0,128179 +"213",0,0,21234,1253,3775,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26295,0,3041,0,0,117450,-130,2495,0,0,0,0,0,0,0,0,0,0,0,0,149153 +"22",9590,55,7103,4286,816,28813,9346,1884,3883,5290,4771,2365,1465,761,3267,3041,605,970,9356,983,20,5842,1155,8154,14997,5290,15741,4441,9895,8154,17472,1524,74,230,4484,414,1961,1388,2583,829,552,5768,4046,2866,1339,692,2275,354,44831,1422,657,831,6171,5557,3302,1475,5754,4011,9093,3706,1305,1092,3457,6376,20420,7541,4312,1520,2960,24734,3578,385293,284495,0,0,0,0,0,4357,0,0,0,0,0,0,0,0,0,0,0,0,674145 +"23",1494,18,187,3176,2573,6061,260,313,839,1044,1327,847,489,153,771,421,123,329,1952,115,4,1019,269,8914,2079,778,3572,1224,948,1845,3523,318,2461,56,506,493,1075,1165,811,122,77,2307,925,5543,1648,738,89,69852,48904,882,166,74,2158,786,892,139,1767,635,1224,570,526,242,538,2791,2082,3589,10486,532,680,34736,57286,306539,0,0,0,632726,526849,0,104,0,0,0,9392,0,0,0,15813,0,0,0,342461,1833884 +"321",722,73,0,216,386,6,60934,29833,237,554,227,942,413,838,3653,241,7067,1338,456,66,0,4822,1,0,310,2261,7950,174,753,193,1253,0,3076,0,191,0,13,81,154,47,113,951,1337,319,9,0,0,26,10073,546,15,50,1046,6,1164,39,39,461,546,5,734,9,185,1329,884,457,16,53,3,3006,349,153254,7806,0,0,11229,210,304,5867,0,0,0,0,0,49,0,0,0,0,0,0,178719 +"327",24,73,1445,674,1540,66,112079,1258,19836,2687,1953,2206,398,2362,9547,417,436,1051,5130,39,0,686,1,2323,2172,2421,125,246,61,485,857,0,21,0,142,0,0,22,101,3,2,3367,997,44,41,53,0,133,114,896,0,260,6455,35,1103,381,79,3096,3207,174,579,16,171,157,2795,2374,87,663,0,2283,4233,206682,20714,0,0,0,0,1507,10862,0,0,0,0,0,0,0,0,0,0,0,0,239766 +"331",98,0,5215,569,672,4,6187,329,1783,72746,85478,43210,5452,16488,49138,10511,3707,5958,2616,93,0,1174,14,15,63,2002,601,7,0,0,468,0,771,0,0,0,0,199,0,13,14,482,710,0,0,0,0,1,3264,102,0,0,1825,52,625,339,154,185,27,13,303,26,352,37,125,891,192,543,0,103,868,326818,1210,0,0,0,0,-746,30899,0,0,0,0,0,0,0,0,0,0,0,0,358181 +"332",2166,137,10356,1334,1585,1086,131025,3745,2384,4954,47556,31148,8998,11618,32379,17396,5368,5457,19211,533,46,6596,853,2013,11266,9500,3323,387,304,222,2373,273,499,2275,1803,513,2577,587,1025,803,51,13383,2569,603,312,0,39,23,3098,2313,32,3380,7200,656,3087,4423,509,467,2053,36,3080,55,633,2136,3695,6341,8094,1669,267,5086,6879,467843,47417,19426,0,0,0,4415,43821,0,519,0,0,0,632,0,0,0,213,0,0,584287 +"333",1792,41,11044,4972,7913,1428,51169,627,141,1401,6218,41325,475,2532,38218,4934,125,890,4846,33,2,1156,1570,91,4493,2412,2903,249,155,149,876,12,70,93,488,91,133,5764,2036,77,58,1718,1138,8,54,781,0,71,214,1180,23,2768,3226,352,4852,5994,2478,883,942,180,225,29,221,98,759,7818,1294,208,87,5685,2887,249177,30557,346829,0,0,0,5407,126924,0,4199,0,0,0,277,0,0,0,13507,0,0,776878 +"334",35,1,80,33,97,96,9278,1188,647,1438,5953,7407,43068,4115,16631,18440,947,2379,3273,368,21,1221,1012,452,5359,2535,39197,884,381,485,1554,5,89,1,203,4,12,65,137,2757,487,19103,8223,719,980,103,1390,1,676,200,1039,6572,10696,8445,6797,1040,1077,11641,869,145,567,29,139,312,166,3843,24261,3940,0,2425,2055,289785,164759,289405,0,384,0,2693,121614,0,37397,0,0,0,7457,0,0,0,9327,0,0,922820 +"335",2536,54,151,69,688,20,54784,523,97,1723,3447,17428,3064,11945,6933,2062,111,995,1507,43,1,467,69,181,1305,1194,1933,385,127,1393,366,2,302,17,95,294,5,120,159,6,0,4351,350,184,74,32,0,6,2170,375,0,4005,6447,100,2694,1339,742,16,1248,1119,535,61,504,1148,498,5676,2974,3886,57,1687,4541,163421,87480,48353,0,11845,0,1570,38924,0,1417,0,0,0,280,0,0,0,1284,0,0,354574 +"3361MV",1352,70,1364,1239,1000,44,3044,2434,739,835,2134,16274,1451,891,214768,4223,607,1182,7419,87,1,1829,189,278,2086,894,10336,7572,2821,616,6956,0,101,0,8256,768,2,175,2272,272,187,1636,507,223,35,0,0,0,0,3033,0,137,4791,748,17639,1871,518,772,2304,158,2826,88,160,262,1391,20252,8152,149,4441,9182,1632,389672,358003,369365,0,0,0,9680,120062,0,6932,0,0,0,7587,0,0,0,30791,0,0,1292092 +"3364OT",0,7,0,2,0,0,31,12,0,0,86,223,0,0,681,69328,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,1334,1302,1056,5,128,0,2828,0,0,0,4,0,0,0,0,0,0,0,0,0,0,681,21,75,100,0,0,0,0,0,0,14,0,0,33,47956,587,2,0,81,126584,37273,50131,0,0,0,17426,122798,0,40478,0,0,0,3830,0,0,0,193,0,0,398713 +"337",0,0,0,0,0,0,27424,524,0,0,0,309,64,0,26,311,4182,112,0,0,0,0,0,0,0,376,948,115,0,20,1768,0,0,0,0,0,0,0,0,1,0,125,418,0,0,0,0,6498,123,0,12,4,644,7,4,0,0,281,136,1,212,720,658,3,277,612,0,0,140,14,939,48009,119365,45362,0,907,0,834,4871,0,1,0,0,0,55,0,0,0,2109,0,0,221514 +"339",144,1,44,42,38,0,1769,34,108,39,89,2834,2,686,3060,36,10,8758,98,8,119,0,4,3,523,201,1277,692,157,11,1762,0,2,0,9,36,1,180,176,4,4,216,123,104,33,23,0,0,418,80,15,42,2742,21,3055,461,433,28019,34906,1005,2314,119,383,74,1088,2553,1840,534,0,7850,70,111486,270499,72746,0,0,0,1449,46825,0,245,0,0,0,51,0,0,0,1642,0,0,504944 +"311FT",42088,207,0,0,0,0,0,32,546,6,0,0,0,0,0,0,0,6,211367,16,206,443,343,619,5931,258,3135,1,3068,1048,2159,889,2,574,45,0,0,9,0,38,18,0,233,0,0,0,0,0,0,0,0,0,6861,117,0,0,6977,6,7458,5356,18929,1398,7884,9518,97929,1947,4151,62,1058,62613,0,505552,1156248,0,0,0,0,9860,78222,0,0,0,0,0,0,0,0,0,0,0,0,1749882 +"313TT",99,33,0,2,0,0,3268,669,355,0,2,791,3,0,3367,1924,3434,2246,332,9664,1501,4260,237,39,11,3221,3751,82,145,4770,2243,0,0,108,27,0,3,94,9,1,374,8,8,0,0,0,0,0,320,302,0,0,618,18,210,248,59,89,552,2760,1667,0,796,2452,413,930,2216,429,6,3339,29,64532,73422,6016,0,2310,0,365,10901,0,0,0,0,0,46,0,0,0,8,0,0,157599 +"315AL",122,0,0,0,0,0,0,0,1,0,0,0,0,0,2018,0,0,332,21,656,1989,0,3458,2,0,2,873,128,6,332,565,0,0,0,0,0,0,0,0,96,66,1974,0,0,0,0,0,0,0,210,0,0,27,11,326,128,142,111,174,0,873,214,105,51,824,3320,771,97,310,4081,43,24460,430253,0,0,0,0,-68,6359,0,0,0,0,0,0,0,0,0,0,0,0,461004 +"322",540,0,95,189,104,28,4107,1296,1914,1577,2473,2341,801,1422,5451,677,1585,2455,29725,452,18,53590,10713,475,7786,5299,8357,201,1494,509,1731,37,108,5,228,2666,87,2414,283,2078,97,420,304,1263,484,1277,2,1,1485,1037,386,687,3452,1308,6445,465,298,1639,2097,996,1476,95,206,4704,5747,1227,237,2291,221,14110,41,209808,62688,0,0,0,0,625,23666,0,0,0,0,0,0,0,0,0,0,0,0,296788 +"323",14,0,8,2,0,10,51,6,0,0,14,5,0,2,4,0,0,0,59,0,1,0,1074,2,231,0,12220,226,198,204,6583,9,12,0,270,119,12,267,17,3832,807,543,4421,1289,1605,4645,0,0,216,481,726,379,6383,1078,3520,20,769,1867,3914,145,2033,881,250,1137,1094,1539,591,1502,58,9210,490,77046,8230,0,0,0,0,241,2311,0,0,0,0,0,0,0,0,0,0,0,0,87829 +"324",13849,325,6178,5062,4037,22727,58994,1089,709,1478,912,870,173,761,603,253,318,1098,3510,94,5,1717,636,26433,11849,918,6585,1186,668,371,2570,35333,7139,6303,36825,4668,387,15933,5749,506,145,799,1015,7346,5082,115,1349,43,9468,2736,74,1879,2750,1166,8127,2086,1363,1061,1760,959,1040,302,1040,1158,4909,3173,16173,1211,2594,96087,31033,496866,353107,0,0,0,0,4948,110411,0,0,0,0,0,0,0,0,0,0,0,0,965332 +"325",33832,1421,7047,2342,2319,1372,19180,3694,4388,1730,7134,3054,2662,2672,12801,1588,2248,7557,8955,12301,80,10368,4092,43264,234038,72811,2591,188,107,58,1102,2,306,7,261,30,5,97,668,507,337,835,1334,94,131,149,0,462,14334,160,192,376,23481,1223,12994,2175,910,51208,23044,5638,757,502,1121,116,1204,6893,8107,3107,113,38395,3362,711633,615550,1696,0,0,0,9032,190078,0,0,0,0,0,0,0,0,0,0,0,0,1527990 +"326",2284,75,128,1548,1242,31,49862,1668,1215,579,2849,13322,3265,2619,28451,4253,4113,6554,24615,466,79,3349,2666,821,13909,22843,23164,1919,2148,577,5460,240,6,0,1220,123,150,2762,386,303,138,6531,895,70,149,1183,0,13,1196,2306,26,2713,9062,135,3336,585,738,11229,5555,2113,1864,66,306,223,10184,5858,3182,970,38,13131,4534,319597,77541,632,0,377,0,1807,29931,0,0,0,0,0,23,0,0,0,0,0,0,429907 +"42",1633,6,215,62,0,1393,76,251,369,976,936,1811,1148,1616,3759,61,391,1782,4486,114,19,1318,118,178,5544,3254,39941,2154,702,28,12585,166,0,0,75,0,6,0,0,543,13,2020,65,6,10,20,1,0,0,12461,0,184,0,0,77,32,30,80,26,0,0,0,47,0,48,64,0,0,1,54,0,102957,0,0,0,0,0,0,2543,0,0,0,0,0,0,0,0,0,0,0,0,105500 +"441",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"445",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"452",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"4A0",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,401,0,462,373,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1237,7555,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8792 +"481",0,0,2,15,429,1283,397,167,284,212,506,329,63,31,295,104,125,202,553,26,3,182,188,170,301,422,10080,225,61,84,379,428,28,238,3054,55,13,1393,431,564,376,724,2442,7993,4388,152,652,11,16303,1876,1038,4397,6552,547,6699,656,877,3614,428,390,847,190,255,255,2306,835,11193,4673,458,4834,91,109373,156682,0,0,0,0,0,45725,0,0,0,0,0,0,0,0,0,0,0,0,311781 +"482",0,0,0,0,0,122,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,106,5,7,0,38,0,32,0,4343,0,7,154,5,0,0,256,1,13,7,137,0,0,0,13,26,14,270,2,94,0,0,6,28,0,0,0,0,0,0,9,170,87,948,298,0,7201,1517,0,0,0,0,0,1374,0,0,0,0,0,0,0,0,0,0,0,0,10092 +"483",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1466,104,0,0,361,0,81,0,0,0,0,0,0,0,1671,119,1000,148,0,4956,26160,0,0,0,0,0,4333,0,0,0,0,0,0,0,0,0,0,0,0,35448 +"484",119,0,0,0,166,0,0,86,86,97,342,177,69,54,95,74,77,229,169,39,8,212,45,310,170,227,4238,1930,1126,736,5116,1313,134,73,10535,125,29,3344,1069,85,59,2,255,0,0,5,3,0,0,266,61,74,1124,5,244,45,19,141,276,21,63,24,4,16,148,150,4933,65,1072,249,13,42043,13203,0,0,0,0,0,1575,0,0,0,0,0,0,0,0,0,0,0,0,56821 +"485",0,1,1,5,158,1131,613,69,115,90,205,139,26,13,124,42,50,98,224,9,1,74,73,69,128,165,1644,121,6,29,158,1,317,0,0,0,4,175,6,261,142,619,1434,4555,1874,1286,266,14,8209,1001,657,2489,4855,272,3586,258,514,2413,3020,651,315,2647,89,133,1239,381,55,7,22,18086,1028,68462,53968,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,122430 +"486",0,0,372,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,372,0,0,0,0,0,0,311,0,0,0,0,0,0,0,0,0,0,0,0,683 +"487OS",0,44,20,514,8,9158,0,701,818,139,78,19,0,3,11,0,235,183,494,56,0,534,319,1170,201,531,63610,1844,1652,525,13378,27916,1195,3973,50033,1128,955,28812,5767,1345,968,135,4074,1084,4476,71,0,0,0,4228,661,976,8956,591,2786,1726,365,2055,4391,355,1258,591,577,114,901,1156,4,236,1251,849,3314,265522,19412,0,0,0,0,0,10757,0,0,0,0,0,0,0,0,0,0,0,0,295692 +"493",738,0,6,145,0,742,0,1133,1765,72,604,476,490,83,88,109,105,464,3569,846,112,2638,670,1155,2744,3056,28274,7137,6244,4192,24390,112,1,901,6215,243,185,1073,6915,441,256,381,1314,0,0,19,0,1,273,687,181,248,1253,11,12744,309,186,685,1396,179,278,236,109,592,1024,649,413,1248,0,6287,116,139212,282,0,0,0,0,0,169,0,0,0,0,0,0,0,0,0,0,0,0,139662 +"511",72,0,24,1,11,314,812,23,1,15,83,40,45,2,29,153,9,32,10,0,0,7,43,14,44,8,3721,422,93,232,911,23,68,0,41,20,0,549,137,42585,67,633,2580,736,1106,642,86,0,1025,821,1239,1235,5798,592,2712,30,713,1937,1841,130,1213,60,77,152,194,626,66,1266,36,9565,326,88101,169937,0,149923,0,0,699,43993,0,0,5235,0,0,0,6483,0,0,0,13016,0,477386 +"512",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,277,252,0,74,8,0,0,2,0,46,13,0,116,33612,45252,235,41,31,0,0,0,79,390,8,41,3327,322,60,0,529,48,16,815,1142,399,55,788,3712,369,23,875,76,508,0,93593,30194,0,41964,0,0,-242,20265,0,0,0,0,0,0,0,0,0,0,0,0,185774 +"513",792,9,471,157,693,1508,5913,386,832,296,1090,981,287,130,470,601,199,434,1485,93,15,330,387,135,535,430,12185,1838,790,449,6183,2155,104,248,1488,1317,1624,1113,350,2298,968,94612,15317,8566,4150,3390,1124,28,14711,2168,3290,2334,9917,1998,12531,1049,2094,5407,2651,1182,735,810,1327,4051,5418,5474,6858,9114,2058,75786,1817,351737,356762,7414,32509,0,0,0,10735,0,0,0,0,0,0,0,0,0,0,0,0,759157 +"514",0,0,50,10,28,5330,1927,632,1047,680,1868,1756,212,388,564,1359,484,760,1702,121,18,791,273,277,650,458,4174,4502,1560,1327,9976,930,0,0,178,257,131,963,219,3873,211,3976,16213,22516,4818,2768,3148,2,1691,1381,4238,4445,18200,1636,35971,1723,4832,1983,3573,352,882,1196,1444,1093,10820,8299,2036,4711,567,34510,3031,251744,69485,0,46819,0,0,0,7029,0,0,2437,0,0,0,3018,0,0,0,5945,0,386476 +"521CI",3477,243,4262,799,827,8684,7850,289,1560,1134,1872,2093,2479,1044,3042,796,490,1542,4402,391,363,1010,544,1700,4609,1776,39146,3820,2565,2749,11266,1632,6761,844,1864,5058,4006,1956,342,4416,1764,14951,3923,92942,57825,1304,1805,130060,79955,11991,2041,3477,14675,29540,7459,1008,2038,5465,6399,1112,1103,1067,1938,5934,8188,11347,0,5005,1515,20434,3757,673726,308535,0,0,0,0,0,69896,0,0,0,0,0,0,0,0,0,0,0,0,1052156 +"523",273,8,2086,1670,7863,664,1202,26,57,1481,1985,1644,144,307,1702,513,546,859,104,6,1,18,22,40,26,70,2833,80,237,566,594,2096,409,990,376,2110,210,1378,25,289,546,169,121,47267,38327,2625,94864,3,7478,2451,460,486,2284,8899,1194,37,1037,1225,9337,307,1889,982,74,4719,5135,3527,0,4,16,23907,2702,297579,237104,0,0,0,0,0,72742,0,0,0,0,0,0,0,0,0,0,0,0,607425 +"524",3771,419,3514,938,5067,2494,465,288,1289,871,1237,1837,344,993,3688,1445,532,800,5110,356,69,458,81,507,3164,863,48307,3778,1607,1722,9321,1258,49,1046,16341,10961,708,4298,2814,558,2100,2218,1293,5460,12783,351496,15079,4566,65179,10897,3281,2740,13833,362,9478,1643,2474,12585,18488,3524,10859,2919,1807,1700,8077,3886,0,1083,4018,4034,12801,734030,421585,0,0,4671,0,0,19094,0,0,0,0,0,0,0,0,0,0,0,0,1179380 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3478,8496,0,0,0,0,0,0,74,0,0,0,0,0,0,0,0,0,0,0,0,0,61,0,666,0,12775,165433,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178209 +"HS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2201020,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2201020 +"ORE",4125,15,1806,197,1067,9461,16009,821,1175,487,5403,2380,3816,776,2108,1395,1249,2062,5867,599,147,1676,1849,200,5421,3033,90107,19197,26041,17809,106793,350,221,1183,8405,3138,673,7942,9358,8421,5714,26853,13501,28847,33335,23485,787,5961,201190,12826,21827,10145,68349,38802,45874,3811,34899,55511,76647,29844,15941,14927,20300,3179,64793,65405,334,12887,634,24541,2513,1336445,5874,0,0,135998,37257,0,3238,0,0,0,0,0,0,0,0,0,0,0,0,1518812 +"532RL",2616,69,4426,2762,6173,2861,26926,276,736,640,1794,1438,560,365,5464,859,251,797,3340,84,1904,868,404,1384,3813,948,24742,818,1072,2858,6340,13768,6633,8380,19842,1545,99,2188,4919,1709,1328,8902,9184,4463,6194,3611,33,4806,2762,10058,1916,2923,16271,17774,9747,2637,1509,3821,3881,481,432,2149,2512,2023,9488,2620,426,347,228,8095,650,307940,103973,0,0,0,0,0,85471,0,0,0,0,0,0,0,0,0,0,0,0,497384 +"5411",356,57,910,517,498,7401,5881,420,485,451,1841,1611,3289,289,2226,1226,286,1733,1332,140,70,756,320,756,4439,1078,17759,598,693,656,4716,506,1053,262,230,256,119,701,349,4351,1020,3396,6169,5614,11825,13786,2373,1373,14144,984,2509,4145,15741,11106,8752,516,412,4948,17413,1565,820,2313,1910,1308,2348,4680,0,128,82,13762,1314,227072,108701,0,0,23637,0,0,15942,0,0,0,0,0,0,0,0,0,0,0,0,375351 +"5415",449,19,3524,570,147,2636,5139,317,382,338,1559,1906,465,113,675,2140,248,533,1402,101,10,328,362,691,427,598,20434,3976,895,1651,6010,575,1366,82,734,371,25,262,340,7320,683,4193,12017,8565,9201,7327,1433,624,5023,736,3917,7368,11232,2302,17578,590,1593,4098,5091,1011,1653,544,1162,1138,5059,3444,6134,12804,131,30102,5279,241153,0,43490,251196,0,0,0,39187,0,3767,8931,0,0,0,24912,0,0,1105,8938,0,622679 +"5412OP",2038,303,3107,1722,2492,16954,47324,1705,2427,2532,5229,4832,5745,1556,5414,3780,1917,4530,13160,706,155,2518,1416,3478,11376,4334,133854,22604,10024,5152,64435,1954,2259,2692,3490,2002,2093,2583,2428,22281,8672,37047,46099,51475,43411,39417,3578,1965,62360,11321,10004,28087,142892,47707,56025,3014,7695,27177,39911,8181,6233,8419,8165,9179,25627,29120,61905,10772,1696,75379,22591,1363722,81053,52635,534503,3432,0,0,168583,0,0,53483,0,0,0,88020,0,0,0,21939,0,2367370 +"55",0,0,23828,6351,6548,66,10819,431,2392,1089,4857,14607,4734,2393,8153,4439,498,4559,26543,843,266,2446,438,5154,22785,1984,99852,1800,4893,11597,27900,4952,16,1820,4424,228,4,7046,1684,4094,550,3938,3714,8600,13328,6717,1227,44,14062,11480,4742,4838,17239,55,22490,3834,6888,50334,11400,6539,3310,3270,2574,20506,49388,9308,0,0,209,0,0,607121,0,0,0,0,0,0,4440,0,0,0,0,0,0,0,0,0,0,0,0,611561 +"561",523,24,496,680,2692,13151,8180,701,1097,3870,9804,3408,2430,527,3538,5622,358,1948,4555,281,326,1724,2519,2874,5809,2066,73394,6185,3091,5136,21047,5337,959,7328,9740,9419,3606,10130,5450,18801,2499,35788,26043,23729,15503,12407,174,2369,136323,25092,9652,31338,62201,18356,90431,5380,4650,27300,42999,9257,3699,5333,3316,5669,11428,16720,8654,11334,703,45146,8059,960384,76892,0,0,0,0,0,3144,0,0,0,0,0,0,0,0,0,0,0,0,1040420 +"562",199,2,493,102,167,631,1785,111,201,223,298,208,72,49,164,159,78,98,1071,53,1,239,60,519,1349,250,2250,682,347,207,1078,118,151,11,709,47,270,194,200,50,51,81,75,368,110,1416,434,2,45934,696,255,274,1971,658,2159,11395,244,1453,1778,636,423,107,461,787,1551,1279,132,955,252,21450,4149,116432,30129,0,0,0,0,0,242,0,0,0,0,0,0,0,0,0,0,0,0,146803 +"61",2,0,0,0,0,127,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,6,0,1,1623,67,433,0,2795,162,10,0,0,0,10,32,0,0,0,16,109,35,8,0,0,0,0,0,0,84,37,0,260,0,2164,0,4,0,0,2886,254,0,0,2043,0,20,112,8820,8,22150,382844,0,0,0,0,0,2431,0,0,0,0,0,0,0,0,0,0,0,0,407425 +"621",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,90,0,95,0,0,15351,12749,86,1,137,3,0,0,53,0,538,0,9901,0,39005,1150431,0,0,0,0,0,1019,0,0,0,0,0,0,0,0,0,0,0,0,1190455 +"622",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,240,1140994,0,0,0,0,0,4456,0,0,0,0,0,0,0,0,0,0,0,0,1145690 +"623",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1853,0,1156,0,3010,258134,0,0,0,0,0,265,0,0,0,0,0,0,0,0,0,0,0,0,261408 +"624",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,250586,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,250586 +"711AS",79,0,0,0,30,141,176,26,36,46,72,52,6,5,38,15,15,31,105,6,1,37,28,51,39,89,3228,384,384,71,600,0,156,0,62,23,0,265,7,183,10870,30436,471,2647,767,221,306,1,6227,290,528,908,5199,4202,2236,105,1369,929,1189,190,724,23942,679,278,3109,1463,0,17,29,1545,30,107390,95740,0,6265,0,0,0,1538,0,0,0,0,0,0,0,0,0,0,0,0,210934 +"713",19,0,0,0,16,51,92,6,13,8,19,12,2,1,9,4,5,9,20,0,0,7,7,6,11,16,468,6,30,2,312,0,0,0,0,0,0,5,1,26,14,36,142,447,182,32,26,1,0,69,75,252,400,838,487,26,47,281,13,26,55,161,253,351,793,43,2,2,1,651,107,6996,228962,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,235978 +"721",1,0,1,9,255,1220,396,99,179,139,323,225,41,23,199,66,78,156,353,17,2,116,159,108,206,295,3490,36,58,49,263,0,15,0,0,0,13,340,14,499,307,692,2730,8563,3537,598,505,12,15019,1486,1132,4916,7345,962,6055,599,715,3533,254,287,362,143,246,542,2438,692,2890,1034,53,3523,182,80797,176088,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,256885 +"722",395,5,12,34,505,2360,492,141,228,209,387,297,43,46,237,92,91,181,545,37,6,174,146,236,253,362,8501,798,809,1021,3711,8577,3,18,958,163,73,1596,285,442,434,648,2411,12379,3560,3473,1194,10,43214,3487,2071,6515,18409,4752,11884,553,1561,22947,17628,7474,3386,571,1398,8704,6290,1823,1054,334,291,11354,614,234894,810443,0,0,0,0,0,2826,0,0,0,0,0,0,0,0,0,0,0,0,1048163 +"81",395,31,89,138,639,1341,6591,405,1070,1283,1795,1051,572,165,928,515,158,491,2277,136,7,1227,335,1015,2387,996,19970,2142,2328,2223,6733,563,120,377,8308,2394,627,2385,934,1329,420,3843,2286,6078,4562,6742,216,19165,7349,8881,1029,2590,9749,7171,16253,5136,2473,5731,13050,1524,825,870,1584,2274,10267,6782,4961,10061,673,25833,3248,268095,669678,0,0,0,0,0,79,0,0,0,0,0,0,0,0,0,0,0,0,937851 +"GFGD",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,676677,0,0,0,0,0,0,0,0,0,0,0,676677 +"GFGN",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,413042,0,0,0,0,0,0,0,413042 +"GFE",12,2,0,3,0,304,8,0,0,36,122,261,68,138,0,0,0,19,0,2,0,0,44,60,59,0,19890,779,613,326,4430,3,0,2796,3230,372,145,915,618,414,325,157,1381,1810,3050,89,0,0,675,1505,282,455,2340,232,1168,138,509,1031,2887,255,488,158,82,764,5914,547,1,105,83,2219,109,64432,6715,0,0,0,0,0,848,0,0,0,0,0,0,0,0,0,0,0,0,71995 +"GSLG",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1925199,0,0,0,1925199 +"GSLE",0,1,0,0,0,646,0,67,155,178,242,189,54,40,143,152,43,81,958,52,1,206,43,448,1255,182,1618,492,327,171,891,8,0,0,430,7,133,83,170,59,69,85,101,496,207,82,0,0,3039,1311,463,233,1157,565,1406,884,118,666,856,465,226,105,232,720,1379,1198,1510,916,258,7338,1827,37435,77113,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,114547 +"Used",-18,230,0,0,1435,5643,3122,0,170,42856,1000,12,0,0,0,0,0,177,0,46,0,3834,0,0,76,104,0,55,0,0,275,-41,0,-183,826,6,249,6068,0,0,319,2,0,0,0,0,0,0,0,22,0,0,0,503,0,0,1225,0,0,0,0,-99,979,0,0,23434,-55,0,0,0,0,92274,221411,-115156,0,-359,-3032,3049,39766,0,0,0,-4,0,39,0,-553,0,-14497,0,4537,227476 +"Other",914,23,764,20,440,1716,1525,214,285,641,724,1315,2012,321,1921,534,118,462,2187,98,15,566,224,7333,2465,651,7244,109,437,834,3439,16932,129,1876,979,18,219,505,90,699,461,6187,774,3844,38780,1511,199,49,1225,1529,211,1975,3267,1898,1405,114,402,0,0,290,0,347,225,632,1896,4215,9684,2040,5,0,0,144163,-73793,0,9714,0,0,0,207173,0,0,0,0,0,0,0,0,0,0,0,0,287257 +"T005",267061,10079,145234,53100,67398,186665,781236,75576,72292,169188,219485,232135,101466,71439,476944,166477,43753,75688,704148,33301,7686,128169,39518,453929,429773,165833,936222,110400,94850,84513,418674,131780,38693,45679,211980,51612,22722,122652,61525,140389,78380,393105,206990,379813,329331,498097,143156,248558,894374,160667,81158,154344,586553,224786,473841,70622,110079,380433,401081,102245,101240,83660,74902,112381,418213,300024,270163,122170,33090,841280,231075,16155072,14417616,1241451,1072893,827157,678733,72166,2198720,676677,94955,70085,9388,413042,20328,122433,15260,1925199,45682,49838,346998,40453693 +"V001",28627,27544,30827,18996,36414,87953,598472,24642,31793,34042,106872,101917,161201,38232,80308,87558,22398,57801,121610,12378,7645,32455,26643,20949,110256,50633,558573,128544,103414,96663,323314,62913,23010,7743,110467,30086,8566,102540,64775,120416,39209,113391,127181,289671,260552,298639,2843,23588,105239,40777,143707,309103,677712,357446,455237,34262,213520,606996,427465,141969,131714,66553,58836,91218,332508,337317,267981,195631,61391,1433618,115312,11459776,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00OTOP",9771,1332,24896,3020,2059,35695,9282,718,1556,2608,3140,3735,8686,1221,3808,2997,411,1704,7349,638,298,1843,775,3806,15194,1747,14042,3260,3465,2619,14888,3949,1475,909,4370,930,3780,2494,879,5325,3915,3739,4543,18720,4831,7294,709,278817,30706,9730,1353,2202,10552,8325,4446,2077,9288,8862,12886,3733,1274,2886,4063,6556,4589,11304,0,0,0,0,0,668075,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00OSUB",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V003",103172,12094,105737,28215,29346,176879,342794,11316,29496,30598,47869,55000,95862,20772,77439,74852,7523,31517,122003,3668,1660,28262,14024,117983,244974,31699,456665,75395,37258,19656,237298,48666,23053,6563,81881,20878,26459,38673,7572,151108,43002,343701,140181,429066,11539,296123,-1841,1679916,455608,177641,128340,61515,289452,38179,143962,20489,46444,165739,81347,9725,12794,65251,21135,70182,95961,114100,165619,124205,10644,228359,57203,8601459,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"VABAS",141569,40969,161461,50231,67819,300527,950548,36676,62845,67247,157881,160651,265749,60224,161555,165407,30332,91022,250962,16684,9603,62560,41442,142739,370424,84078,1029280,207199,144137,118938,575500,115529,47538,15216,196718,51894,38805,143707,73227,276849,86126,460831,271906,737456,276921,602056,1712,1982321,591553,228148,273399,372820,977716,403951,603645,56828,269253,781597,521698,155427,145782,134690,84034,167957,433058,462721,433600,319836,72035,1661977,172515,20729311,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T018",408630,51049,306694,103331,135217,487191,1731784,112252,135138,236435,377366,392786,367215,131662,638499,331883,74084,166711,955110,49985,17289,190729,80959,596668,800197,249912,1965503,317599,238987,203451,994174,247308,86231,60895,408697,103507,61527,266359,134751,417238,164506,853936,478896,1117269,606252,1100153,144868,2230880,1485927,388814,354557,527164,1564269,628737,1077486,127450,379332,1162031,922779,257672,247023,218350,158936,280337,851271,762745,703763,442006,105126,2503257,403590,36884383,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00TOP",0,612,11253,2818,284,30692,2219,136,149,155,850,256,441,131,258,124,46,345,21631,17,15,122,57,445,4071,692,266643,50113,24518,40865,116065,24923,814,309,575,1205,85,339,152,1394,2384,39941,2099,2919,1370,26991,50,0,1586,14198,16607,5759,6294,1720,7095,2030,992,1683,3112,3189,1127,5753,12449,26743,57517,15012,0,0,0,0,606,865042,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00SUB",21108,0,0,0,0,0,0,0,0,0,0,0,0,304,0,0,0,0,0,27,0,0,0,0,9,0,0,0,0,0,0,288,2191,16,0,0,0,0,0,0,0,6,0,439,0,0,0,18967,1340,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,6455,0,21795,72957,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"VAPRO",120461,41581,172713,53049,68103,331218,952767,36812,62995,67401,158731,160907,266190,60051,161813,165531,30378,91367,272593,16673,9618,62682,41498,143184,374486,84771,1295923,257312,168655,159803,691565,140164,46161,15509,197292,53099,38890,144046,73378,278244,88510,500767,274005,739937,278291,629047,1762,1963354,591799,242345,290005,378579,984010,405671,610740,58858,270245,783280,524798,158616,146909,140443,96482,194699,490575,477733,433600,319836,65580,1661977,151326,21521396,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/flowsa/data/external_data/BEA_Summary_Use_SUT_2020.csv b/flowsa/data/external_data/BEA_Summary_Use_SUT_2020.csv new file mode 100644 index 000000000..c0d3344c8 --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Use_SUT_2020.csv @@ -0,0 +1,84 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","T001","F010","F02E","F02N","F02R","F02S","F030","F040","F06C","F06E","F06N","F06S","F07C","F07E","F07N","F07S","F10C","F10E","F10N","F10S","T019" +"111CA",99662,293,0,24,18,0,2458,0,0,0,0,0,0,0,0,0,0,301,263493,2591,0,0,0,0,14600,0,801,490,1022,176,343,0,0,0,0,0,0,15,0,0,0,0,0,1,0,0,0,0,4,0,1,1,1236,30,2183,0,135,0,0,0,0,0,368,20,5297,10,18,1662,0,3474,0,400726,181522,0,0,0,0,-4808,64123,0,0,0,0,0,0,0,0,0,0,0,0,641563 +"113FF",25357,6224,0,82,0,0,0,17989,1,0,0,0,0,0,0,0,116,312,9208,0,93,3789,31,0,365,1754,0,0,758,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,264,19,4,0,55,0,0,0,0,0,184,232,5095,75,0,22,15,4596,0,76638,10012,0,0,0,0,1551,5848,0,0,0,0,0,0,0,0,0,0,0,0,94048 +"211",0,0,17774,0,3,16703,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,204206,3525,0,1,1,0,0,2,0,0,0,0,0,7,0,25,35,0,1,7,0,0,0,0,0,10,0,0,0,2,1,0,1,60,0,0,0,0,0,6,0,0,1,0,0,1381,0,17465,261221,0,0,0,0,0,1660,70266,0,0,0,0,0,0,0,0,0,0,0,0,333148 +"212",1966,0,71,8570,177,4812,23796,10,11624,9494,501,114,5,87,74,134,14,85,1474,41,0,1297,0,3910,5408,137,22,0,0,0,2,0,111,0,6,1,0,1,2,19,32,363,1227,0,0,0,0,18,0,0,0,0,1616,45,1069,55,386,0,22,26,120,170,505,105,824,1195,0,3226,0,2756,4952,92678,230,50,0,0,0,194,18719,0,0,0,0,0,0,0,0,0,0,0,0,111871 +"213",0,0,12373,1141,1907,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15463,0,1664,0,0,68303,-521,2172,0,0,0,0,0,0,0,0,0,0,0,0,87081 +"22",11071,60,5246,2925,427,26121,11462,1783,3601,4241,4437,2168,1390,721,3213,2758,572,861,10187,852,49,5113,1316,6387,12229,4991,13539,4017,10444,7556,18210,702,59,127,4494,219,1698,1437,2406,900,428,7723,4923,3089,1443,780,2620,1284,30189,1458,745,1115,6132,5837,3314,1396,4245,3276,7752,3149,1353,578,2541,3120,18516,6506,5460,1870,2762,30592,2996,357181,284858,0,0,0,0,0,3074,0,0,0,0,0,0,0,0,0,0,0,0,645112 +"23",1793,22,158,2523,1548,5434,391,394,1055,1119,1569,936,551,196,939,457,141,369,2757,125,9,1206,350,7059,2245,913,3721,1373,1242,2131,4416,122,2474,36,597,443,1233,1362,978,172,35,2415,1385,7576,2142,1082,128,76099,43133,1197,246,111,3081,1030,1033,176,639,630,1414,621,691,172,550,1540,2428,3976,11182,824,634,36031,58833,315591,0,0,0,695288,521090,0,107,0,0,0,11519,0,0,0,18556,0,0,0,346065,1908216 +"321",955,66,0,300,265,5,75585,33811,222,455,268,764,443,887,3440,272,7567,1504,382,65,0,5159,2,0,360,2121,7204,173,839,197,1453,0,3760,0,186,0,8,70,162,49,138,1084,1552,475,12,0,0,60,8679,696,21,72,1063,7,1310,36,54,511,536,6,783,6,144,841,721,387,21,66,4,4108,296,172688,8188,0,0,11862,312,351,5037,0,0,0,0,0,46,0,0,0,0,0,0,198484 +"327",34,71,1203,526,909,41,118974,1074,20149,1935,1746,1656,323,2061,8444,340,337,845,3770,27,0,614,1,2531,1694,2118,108,207,51,458,924,0,17,0,111,0,0,14,81,2,2,3237,1001,30,31,58,0,210,91,976,0,276,5959,28,1021,368,61,2394,2705,121,557,8,99,74,2145,1936,76,619,0,2238,3159,202873,23851,0,0,0,0,-410,9421,0,0,0,0,0,0,0,0,0,0,0,0,235735 +"331",117,0,3833,384,299,3,6959,268,1621,61461,72845,34697,5248,16122,42686,7331,2925,5402,2245,80,0,1009,17,19,53,1643,481,5,0,0,439,0,643,0,0,0,0,146,0,10,15,527,790,0,0,0,0,1,1875,110,0,0,1832,50,597,275,128,126,28,9,294,11,215,20,97,652,200,652,0,96,617,278208,1491,0,0,0,0,-5604,27788,0,0,0,0,0,0,0,0,0,0,0,0,301883 +"332",2158,123,8090,805,798,723,139824,3419,2300,3803,43803,25816,7561,11224,27856,13873,4729,4599,19338,465,72,5659,904,1326,9122,8364,2992,328,329,190,2485,71,362,1220,1571,221,1947,438,1019,664,51,13192,2767,823,393,0,46,34,2451,2422,39,3723,7175,670,3319,3748,527,393,1911,34,3240,39,474,1229,2971,4491,10214,1511,273,5466,5347,439560,54840,17563,0,0,0,-257,35264,0,662,0,0,0,529,0,0,0,198,0,0,548359 +"333",2565,58,9873,4029,4601,2017,51762,533,146,1129,5724,38141,417,2399,31958,4201,115,985,4963,30,2,974,1537,97,4902,2559,2061,202,143,117,857,9,72,41,425,49,72,5105,1873,58,39,1711,1101,9,46,709,0,96,173,1291,21,2713,3276,475,4761,5419,2665,800,777,137,209,14,149,57,817,5377,1300,317,74,6057,2310,229700,40246,320747,0,0,0,-5792,111912,0,5641,0,0,0,285,0,0,0,14940,0,0,717678 +"334",38,1,54,19,56,84,9707,1237,708,1276,5791,7125,42152,4470,19329,19188,957,2276,3547,377,56,1217,1243,459,4963,2566,38042,936,504,503,1959,1,64,0,206,3,7,71,140,2868,501,22187,8907,841,1139,97,1705,1,694,201,1243,7606,11888,9126,7229,878,1067,10306,797,141,644,15,150,178,157,2831,31268,5825,0,3137,1597,306561,168675,282562,0,363,0,1678,111239,0,35273,0,0,0,6955,0,0,0,8215,0,0,921520 +"335",2600,42,119,38,260,14,62752,532,111,1249,3518,16051,2789,11899,6901,1812,109,859,1823,45,1,509,90,155,1121,1155,1365,356,125,1057,403,0,267,20,116,146,3,83,172,6,0,4794,418,173,72,42,0,13,1582,472,0,3981,5927,97,2701,1270,662,15,954,1007,501,36,385,577,396,5045,3298,4592,48,1767,3585,165085,95210,47929,0,12889,0,-105,33453,0,1416,0,0,0,291,0,0,0,1165,0,0,357334 +"3361MV",1555,60,980,733,497,30,3424,2338,719,593,1866,12763,1285,738,195168,3447,535,1012,7256,69,2,1647,202,270,1725,811,7802,5153,2741,503,7637,0,69,0,7333,333,1,108,1827,244,212,1790,577,249,36,0,0,0,0,2939,0,138,4307,706,17814,1706,755,667,2063,136,2607,30,125,127,1241,11527,8645,179,4200,10119,1487,347857,371199,284716,0,0,0,-17663,95614,0,10922,0,0,0,12659,0,0,0,35504,0,0,1140808 +"3364OT",0,18,0,2,0,0,13,13,0,0,92,336,0,0,814,52117,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1016,974,220,0,63,0,2301,0,0,0,6,0,0,0,0,0,0,0,0,0,0,1178,30,94,115,0,0,0,0,0,0,0,0,0,1,52715,655,3,0,102,112882,44112,54106,0,0,0,-3679,74639,0,38244,0,0,0,3529,0,0,0,495,0,0,324327 +"337",0,0,0,0,0,0,29103,316,0,0,0,204,75,1,23,61,3884,112,0,0,0,0,0,0,0,350,923,123,0,15,1886,0,0,0,0,0,0,0,0,1,0,138,441,0,0,0,0,6873,76,0,7,2,589,8,2,0,0,244,130,1,216,345,396,1,216,415,0,0,75,12,725,47989,126955,40096,0,980,0,612,3903,0,1,0,0,0,13,0,0,0,1173,0,0,221723 +"339",124,1,34,28,18,0,1488,32,93,31,87,2553,2,703,2782,36,4,7148,75,34,135,0,5,2,399,244,968,552,151,7,1606,0,1,0,8,19,1,142,154,3,4,159,129,87,35,23,0,0,289,87,18,30,2534,12,3292,504,363,25149,31482,896,1689,55,154,26,829,1965,2911,723,0,8997,67,102179,293659,68558,0,0,0,-1564,39372,0,183,0,0,0,41,0,0,0,1418,0,0,503847 +"311FT",42522,239,0,0,0,0,0,26,633,4,0,0,0,0,0,0,0,13,217015,7,186,328,363,478,5162,234,2973,0,2718,846,1590,158,1,288,33,0,0,3,0,32,4,0,288,0,0,0,0,0,0,0,0,0,5553,120,0,0,4848,5,6088,4151,17740,705,3748,4030,76174,1163,4551,-195,758,65281,0,470868,1265212,0,0,0,0,-1407,77511,0,0,0,0,0,0,0,0,0,0,0,0,1812184 +"313TT",43,12,0,1,0,0,2977,526,285,0,1,873,0,0,2448,1404,3394,1844,276,9611,1858,4253,295,51,9,2600,5000,47,112,16033,1434,0,0,38,20,0,1,26,4,1,407,8,7,0,0,0,0,1,130,405,0,0,731,20,716,840,30,88,485,2432,1650,0,128,1212,366,967,1486,489,5,4096,87,72263,90299,4844,0,2475,0,-820,9057,0,0,0,0,0,101,0,0,0,3,0,0,178222 +"315AL",76,0,0,0,0,0,0,0,0,0,0,0,0,0,1301,0,0,261,18,17,1474,0,27,0,0,0,301,17,0,261,183,0,0,0,0,0,0,0,0,0,1,8,0,0,0,0,0,0,0,2,0,0,21,1,121,121,5,0,17,0,3,19,19,7,1,1046,118,35,225,5039,33,10776,372265,0,0,0,0,-9309,4761,0,0,0,0,0,0,0,0,0,0,0,0,378495 +"322",659,0,74,124,49,19,4641,1294,1941,1258,2410,2067,698,1350,5665,608,1536,2211,31049,417,50,47067,9854,457,6582,5237,7586,187,1694,501,1926,11,90,2,211,1581,45,1886,280,1464,102,479,318,1176,436,1727,3,1,1123,814,413,748,3317,1019,6726,439,349,1162,1286,575,1215,54,152,2263,5321,985,274,2325,238,15595,44,195461,68210,0,0,0,0,740,21601,0,0,0,0,0,0,0,0,0,0,0,0,286012 +"323",16,0,6,1,0,7,63,3,0,0,11,4,0,2,4,0,0,0,69,0,1,0,1170,2,143,0,9504,187,191,166,7987,2,9,0,260,50,6,226,15,3700,868,497,4251,1241,1616,4881,0,0,162,450,713,379,6103,998,3212,20,702,1529,3503,125,1927,461,205,524,982,1122,659,1556,53,9412,357,72314,7183,0,0,0,0,856,1967,0,0,0,0,0,0,0,0,0,0,0,0,82319 +"324",12233,229,3272,2304,1596,13793,56084,716,467,944,649,585,130,571,456,127,249,955,3070,55,9,985,491,14950,6667,708,3831,803,499,248,2104,8540,3691,2388,28052,1798,251,13418,3314,441,103,722,755,4796,3504,107,1072,56,6129,1999,58,1390,2155,757,6963,1364,1076,782,994,586,796,107,596,375,2908,1640,9774,708,1614,66598,20256,332411,258659,0,0,0,0,2055,77673,0,0,0,0,0,0,0,0,0,0,0,0,670798 +"325",38458,1344,5825,1525,1291,1067,20520,3817,4145,1206,7110,2511,2274,2401,12362,1432,1877,6408,9889,10073,163,8940,4407,27859,209201,68090,2273,107,86,47,1288,0,156,3,243,10,2,66,551,434,396,907,1529,79,122,180,0,640,9990,154,193,410,34252,1767,12147,1918,651,55792,23522,7039,695,292,751,48,1436,4272,5937,2995,108,39551,3097,670329,656757,1251,0,0,0,7351,179017,0,0,0,0,0,0,0,0,0,0,0,0,1514705 +"326",2303,72,90,928,608,23,54510,1735,1199,428,2729,10879,2737,2448,24810,3066,3683,5452,26909,392,228,3135,2988,614,11555,22158,20678,1414,2241,543,5770,72,4,0,1072,49,79,2181,367,290,149,6890,1143,67,151,1751,0,26,596,2285,28,2750,8723,133,3398,545,776,9682,5540,1780,1801,34,226,113,8720,3492,3006,1051,37,13741,3753,302827,82954,636,0,344,0,277,26788,0,0,0,0,0,23,0,0,0,0,0,0,413847 +"42",1512,6,194,45,0,1248,105,279,387,766,856,1570,994,1464,3316,45,306,1590,4542,92,22,1315,132,207,4309,3052,36947,2071,789,26,15664,93,0,0,72,0,5,0,0,693,13,2091,67,22,35,75,6,0,0,12079,0,385,0,0,85,33,42,82,26,0,0,0,22,0,50,62,0,0,5,37,0,99932,0,0,0,0,0,0,2332,0,0,0,0,0,0,0,0,0,0,0,0,102265 +"441",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"445",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"452",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"4A0",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,444,0,634,576,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1655,10218,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11872 +"481",0,0,1,5,94,477,219,70,134,81,217,134,22,14,133,37,50,79,274,10,2,94,94,70,124,169,4041,97,34,37,245,81,9,81,1650,16,6,852,212,299,208,366,1201,4237,2133,81,350,17,6809,953,540,2173,3394,266,3292,326,384,1579,217,174,400,44,114,65,1033,272,3680,1575,429,2645,40,49257,60527,0,0,0,0,0,17794,0,0,0,0,0,0,0,0,0,0,0,0,127579 +"482",0,0,0,0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,3,2,0,13,0,22,0,3813,0,6,150,4,0,0,83,0,4,2,44,0,0,0,13,9,5,89,1,28,0,0,2,8,0,0,0,0,0,0,2,98,45,907,167,0,5576,515,0,0,0,0,0,1330,0,0,0,0,0,0,0,0,0,0,0,0,7421 +"483",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,799,56,0,0,197,0,42,0,0,0,0,0,0,0,1447,109,897,145,0,3698,9733,0,0,0,0,0,4207,0,0,0,0,0,0,0,0,0,0,0,0,17637 +"484",125,0,0,0,79,0,0,79,86,89,347,176,61,54,108,71,73,215,182,37,11,215,56,296,147,224,3715,1735,1187,677,5667,433,109,43,10770,70,30,3892,1000,102,74,2,284,0,0,7,4,0,0,308,72,83,1322,5,261,48,19,135,284,19,66,15,3,10,148,126,5500,75,1187,345,11,42574,13997,0,0,0,0,0,1487,0,0,0,0,0,0,0,0,0,0,0,0,58059 +"485",0,1,0,2,42,708,414,35,66,42,107,69,11,7,67,18,24,47,135,4,1,47,44,35,63,81,776,78,4,15,111,0,244,0,0,0,2,191,3,166,93,477,862,2973,1100,1012,171,40,4240,716,439,1514,3615,161,2241,153,353,1554,2207,561,182,1336,48,47,680,157,28,4,11,14901,955,46493,28605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,75098 +"486",0,0,346,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,346,0,0,0,0,0,0,309,0,0,0,0,0,0,0,0,0,0,0,0,655 +"487OS",0,51,17,387,4,7794,0,681,930,133,75,20,0,4,12,0,206,196,547,59,0,692,380,1155,196,581,62119,2151,1979,581,18207,18133,1079,2506,57712,742,1377,34022,5983,1784,1335,143,4988,1431,5350,98,0,0,0,5434,848,1206,12430,1310,3341,1995,401,2173,4984,365,1515,382,462,71,1016,1037,5,312,1309,1274,3277,280980,18336,0,0,0,0,0,11562,0,0,0,0,0,0,0,0,0,0,0,0,310879 +"493",851,0,4,97,0,586,0,1107,1843,73,647,495,458,89,106,108,104,461,3967,857,162,2822,851,1169,2576,3191,24669,6736,6889,4046,28080,37,1,573,6835,144,175,1183,6214,530,320,465,1465,0,0,24,0,4,406,768,211,278,1426,12,13368,340,111,629,1404,162,287,142,95,342,1049,572,478,1400,0,7605,106,142208,277,0,0,0,0,0,167,0,0,0,0,0,0,0,0,0,0,0,0,142651 +"511",90,0,18,1,6,260,1040,23,1,14,80,39,29,1,28,121,8,33,11,0,0,7,46,9,27,9,3235,398,75,223,962,7,56,0,39,13,0,545,134,38044,75,724,2843,618,1016,681,98,1,1009,721,1403,1354,5129,530,2848,35,675,1315,1865,119,994,34,69,81,169,478,61,1636,29,10515,341,83097,194802,0,159007,0,0,3292,41155,0,0,5345,0,0,0,6416,0,0,0,13747,0,506860 +"512",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,254,277,0,127,1,0,0,1,0,30,13,0,137,29026,48598,274,42,29,0,0,0,67,285,8,39,3341,354,58,0,616,40,15,662,1037,222,46,515,3742,285,32,1019,54,638,0,91925,17339,0,41417,0,0,167,17204,0,0,0,0,0,0,0,0,0,0,0,0,168052 +"513",795,8,296,93,287,956,6598,286,686,215,928,746,207,117,439,445,154,353,1331,73,23,302,377,138,419,364,9682,1563,775,388,6118,204,75,184,1664,252,1451,1375,247,2418,913,97821,14736,6776,5004,4064,1395,84,18380,2833,3762,2861,10720,1936,12305,989,1905,3702,2197,917,663,252,859,1758,4755,3360,7155,10520,1749,82652,1432,351489,357349,7587,31188,0,0,0,10227,0,0,0,0,0,0,0,0,0,0,0,0,757841 +"514",0,0,27,5,11,4180,2307,577,1050,594,1739,1582,185,368,549,1029,428,694,1829,106,22,867,303,305,471,440,3569,3999,1622,1170,11279,274,0,0,198,170,144,1037,217,4280,238,4453,17299,17855,4524,2915,3529,8,2025,1637,4749,5360,19181,1675,35211,1831,4298,1748,3288,318,898,602,1245,584,10567,6402,1943,8155,466,40804,2707,254144,97343,0,50954,0,0,0,5433,0,0,2511,0,0,0,3015,0,0,0,6341,0,419741 +"521CI",3558,246,3718,484,383,6676,9367,282,1438,1059,1943,1678,1917,883,3396,725,433,1436,4066,315,456,982,629,1475,3159,1603,34735,3388,2749,2737,11962,597,5927,556,1995,2662,4170,2186,322,4697,1613,16649,4516,106791,50384,917,3135,159320,86838,16438,2271,3907,16142,29996,8059,806,1351,5025,6524,1055,1201,535,1803,3274,8311,9617,0,12683,1541,18288,3782,713761,299607,0,0,0,0,0,67092,0,0,0,0,0,0,0,0,0,0,0,0,1080460 +"523",326,8,1435,1553,5759,536,1560,23,59,1419,2064,1628,122,319,1822,445,491,832,115,4,1,18,25,39,23,65,2486,74,252,547,632,613,308,706,419,1078,236,1715,27,354,678,209,136,52321,37561,2470,98561,7,6830,3344,547,528,2528,9576,1287,42,261,1176,8654,305,2006,579,70,2748,5019,2430,0,2,15,22535,3499,296055,250961,0,0,0,0,0,83825,0,0,0,0,0,0,0,0,0,0,0,0,630842 +"524",4712,473,2995,642,2749,2011,621,271,1295,803,1286,1675,317,976,3971,1389,455,715,5015,312,94,515,97,595,2669,848,45395,3750,1917,1838,10834,474,40,728,19521,6644,663,5205,3028,724,2557,2478,1540,6031,14834,386042,17474,6413,61851,13533,4239,3355,17207,402,11644,1987,2525,12482,19754,3631,13103,1881,1741,1074,9108,3291,0,2201,3676,5534,10002,779846,424934,0,0,5037,0,0,20517,0,0,0,0,0,0,0,0,0,0,0,0,1230335 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3843,9779,0,0,0,0,0,0,72,0,0,0,0,0,0,0,0,0,0,0,0,0,34,0,690,0,14420,173228,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,187648 +"HS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2321514,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2321514 +"ORE",4785,16,1218,127,471,6673,18368,724,1106,443,5215,2201,3572,687,1853,1332,1129,1853,5458,532,140,1688,2182,202,4654,2806,71418,15373,25794,16034,96229,99,146,708,8470,1606,538,7942,8144,9081,4502,31617,13618,25760,32905,24072,887,7848,212910,13087,23330,10230,67418,38069,33302,4077,34283,44955,79992,27461,16820,9979,16554,2049,57866,61427,210,11839,418,23771,2095,1264365,5103,0,0,153884,36924,0,3842,0,0,0,0,0,0,0,0,0,0,0,0,1464119 +"532RL",3328,70,2894,1678,2962,4167,29221,261,875,635,2090,1441,578,447,6163,911,251,936,4044,85,1471,1077,542,1735,4168,1055,26580,838,1450,3563,9117,12677,6849,4726,17521,294,61,2496,4999,2576,1260,11043,11246,5296,8006,4332,38,2826,3627,10398,2543,4017,19631,24456,11315,2881,1374,3255,2758,256,445,1021,1404,1310,12675,3002,276,412,217,9111,595,327854,95513,0,0,0,0,0,82373,0,0,0,0,0,0,0,0,0,0,0,0,505740 +"5411",439,62,616,352,244,5873,7201,411,508,419,1956,1577,3130,249,2168,1199,270,1630,1504,134,80,771,379,725,3885,1098,15505,547,740,639,5543,99,831,182,239,124,84,705,311,4709,1192,3794,6525,5798,11785,15370,2775,2099,12361,1111,2893,4428,15351,11769,8946,552,374,4111,16610,1400,887,1185,1916,791,2093,4160,0,228,90,17394,1264,226388,109779,0,0,28878,0,0,15910,0,0,0,0,0,0,0,0,0,0,0,0,380954 +"5415",552,20,2168,278,67,2021,5954,265,363,270,1300,1523,341,105,610,1502,203,468,1335,83,16,325,370,525,321,533,17070,3411,895,1463,6418,164,997,64,765,231,25,297,324,7517,763,4508,12299,6858,7978,7670,1572,891,5080,847,4394,8529,11670,2277,17019,623,1628,3598,4645,931,1711,302,1076,608,4791,2872,7285,20902,125,34619,4852,244080,0,47456,263734,0,0,0,42399,0,3059,9920,0,0,0,27093,0,0,1090,9958,0,648790 +"5412OP",2259,319,2244,1093,1223,13475,55648,1555,2403,2162,5047,4497,5635,1498,5473,3371,1694,4167,14025,638,186,2536,1643,3050,9453,4070,118512,21361,11018,5021,80036,460,1710,1984,3632,926,1852,2693,2367,25634,8589,41738,52421,50460,42830,46246,4196,2818,52720,13991,11694,30856,144070,51296,47623,3258,8034,23356,39444,7090,6799,4238,7220,3979,23813,25918,66614,14998,1526,89138,18966,1372511,81983,50480,568261,3751,0,0,171680,0,0,62410,0,0,0,99866,0,0,0,22033,0,2432976 +"55",0,0,18928,4724,3551,61,14846,445,2633,1167,5406,16165,4835,2580,9956,4663,522,4888,31143,917,411,2652,547,4980,20055,2169,95768,1796,5927,12247,24363,1760,8,1202,4760,148,2,7487,1853,5052,706,5180,4419,9890,14670,7989,1576,176,22206,13186,5798,5530,19670,48,23026,4589,4258,47713,11827,6275,3397,2018,2457,12901,55312,8959,0,0,185,0,0,614579,0,0,0,0,0,0,2893,0,0,0,0,0,0,0,0,0,0,0,0,617472 +"561",663,24,353,429,1222,9003,9699,669,1099,2690,8107,2793,1830,495,3119,4617,299,1523,4775,222,325,1627,2775,2122,4620,1807,62362,5160,3204,4782,23434,1239,657,3235,8982,4316,3316,10766,4946,20287,2750,39216,29032,24221,15031,12323,201,3566,137777,28175,9919,32197,62413,17151,92150,5600,4139,23465,38454,8226,3955,2150,2610,2707,10259,13491,8915,15350,572,52406,7038,929053,61665,0,0,0,0,0,3647,0,0,0,0,0,0,0,0,0,0,0,0,994364 +"562",198,2,329,64,78,525,2130,95,179,176,257,166,58,47,146,98,68,84,1074,42,2,210,87,423,1057,216,1830,557,321,170,963,13,106,5,757,14,273,281,151,51,43,79,71,310,141,1349,418,3,47152,839,272,299,1941,612,2186,10944,230,1294,1648,539,449,37,314,347,1236,738,167,955,245,24858,3363,116380,30840,0,0,0,0,0,331,0,0,0,0,0,0,0,0,0,0,0,0,147552 +"61",2,0,0,0,0,97,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,5,0,0,1353,61,450,0,3294,32,8,0,0,0,10,37,0,0,0,17,115,45,10,0,0,0,0,0,0,88,39,0,264,0,2354,0,4,0,0,2108,273,0,0,1733,0,38,110,11752,8,24328,376314,0,0,0,0,0,4319,0,0,0,0,0,0,0,0,0,0,0,0,404961 +"621",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,0,5,0,0,15371,12976,6,1,4,0,0,0,3,0,1162,0,5093,0,34749,1093856,0,0,0,0,0,1013,0,0,0,0,0,0,0,0,0,0,0,0,1129617 +"622",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,389,0,0,0,0,0,0,0,0,0,0,0,0,389,1133827,0,0,0,0,0,6134,0,0,0,0,0,0,0,0,0,0,0,0,1140350 +"623",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2295,0,971,0,3266,254200,0,0,0,0,0,262,0,0,0,0,0,0,0,0,0,0,0,0,257729 +"624",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2057,0,2057,252022,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,254079 +"711AS",104,0,0,0,15,72,186,19,26,31,59,38,4,3,29,10,11,24,95,3,1,35,31,36,31,69,2550,344,426,50,690,0,69,0,52,7,0,168,4,176,9957,17471,520,2666,760,211,302,3,5122,270,477,957,4092,3182,1896,106,1408,824,851,144,548,15290,446,98,1962,1006,0,20,21,1749,39,77866,55562,0,5971,0,0,0,1189,0,0,0,0,0,0,0,0,0,0,0,0,140589 +"713",57,0,0,1,19,103,292,15,33,17,45,27,4,2,22,8,11,18,56,1,0,19,19,14,24,35,1020,14,80,4,726,0,1,0,0,0,0,17,2,76,41,101,389,1328,486,89,75,5,0,190,218,693,1140,1399,1074,71,87,700,34,63,142,61,154,138,822,77,10,9,1,1943,65,14388,162358,0,0,0,0,0,22,0,0,0,0,0,0,0,0,0,0,0,0,176768 +"721",1,0,1,4,77,611,291,58,117,74,192,126,20,14,124,32,43,85,242,9,2,83,111,62,116,158,1881,21,39,28,205,0,8,0,0,0,9,240,9,359,227,487,1864,6326,2345,421,368,27,8893,1028,811,3361,5076,640,4017,402,398,2159,172,174,248,44,150,178,1511,306,1234,498,31,2584,113,51542,98909,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,150451 +"722",352,4,4,14,187,1222,416,98,172,129,265,195,25,32,170,48,57,114,424,28,8,148,119,155,160,231,5124,539,649,740,3071,1959,2,2,671,54,57,1254,222,382,402,554,1978,10907,2798,2821,1028,25,29512,2656,1701,5230,14584,3111,8703,449,874,16282,13511,5724,2807,225,1107,3078,4714,1090,558,185,183,9655,352,166304,706787,0,0,0,0,0,1709,0,0,0,0,0,0,0,0,0,0,0,0,874800 +"81",385,34,53,78,270,787,6750,368,988,1014,1573,869,482,153,842,412,130,412,2361,108,10,1078,326,782,1927,860,15287,1750,2244,1863,6523,139,70,200,8186,1483,550,2435,765,1194,309,4172,1873,3380,2762,5124,158,11791,6039,5815,956,2470,8885,6650,16107,4688,2336,4014,10517,1255,768,360,1203,956,8565,5174,5648,15156,540,37163,2461,243035,629593,0,0,0,0,0,81,0,0,0,0,0,0,0,0,0,0,0,0,872709 +"GFGD",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,697519,0,0,0,0,0,0,0,0,0,0,0,697519 +"GFGN",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,461096,0,0,0,0,0,0,0,461096 +"GFE",16,2,0,2,0,277,10,0,0,40,142,250,73,145,0,0,0,25,0,2,0,0,54,51,59,0,19250,788,728,340,5889,1,0,1948,3637,225,166,1098,670,537,437,196,1659,2291,3357,106,0,0,656,1885,353,550,2831,242,1359,165,282,1052,3228,259,579,104,69,470,6655,465,1,138,70,2945,96,68925,6546,0,0,0,0,0,948,0,0,0,0,0,0,0,0,0,0,0,0,76419 +"GSLG",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2019672,0,0,0,2019672 +"GSLE",0,0,0,0,0,540,0,56,138,142,213,157,44,39,131,85,37,73,993,43,3,181,70,377,1024,161,1303,411,323,149,835,1,0,0,425,3,126,108,134,59,60,85,94,412,211,79,0,0,3623,1025,457,237,1069,555,1270,907,97,474,751,381,222,38,118,331,1155,704,1808,1068,263,8514,1438,35830,75499,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,111329 +"Used",-18,232,0,0,1433,6528,3467,0,74,37872,1208,11,0,0,0,0,0,2,0,20,0,1650,0,0,31,49,0,51,0,0,280,-95,0,-183,729,3,126,6280,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,202,0,0,1460,0,0,0,0,-160,84,0,0,45227,-40,0,0,0,0,106527,221893,-119482,0,725,-3463,-6413,35251,0,0,0,-4,0,46,0,-1765,0,-15814,0,5136,222639 +"Other",936,24,461,4,173,1057,1631,185,240,425,594,984,1154,245,1572,328,88,329,1805,86,13,493,199,5080,1661,517,5030,58,394,656,3375,12400,141,2997,781,5,80,430,76,686,418,6207,699,3444,39360,1128,82,133,431,1612,83,1825,2911,1649,1290,44,400,0,0,272,0,173,188,272,1596,937,9434,1908,3,0,0,123889,-31889,0,14985,0,0,0,78867,0,0,0,0,0,0,0,0,0,0,0,0,185853 +"T005",272331,10537,107397,39176,36734,149449,854836,80804,69948,143618,199119,203076,94187,69316,437000,135714,40291,67093,710163,30195,7848,115353,37794,296649,369460,155212,825455,96500,99121,92225,446373,62600,32294,26829,209239,26211,20935,126196,55739,144001,72288,409861,222552,379201,318582,543039,153753,283517,843939,173133,88742,159988,599188,232649,448609,69134,97396,337817,381283,91713,100860,48349,56188,57501,378333,266457,275663,158637,29383,883258,200060,15358092,14206232,1110761,1135518,916476,623167,-37568,1847838,697519,95401,80187,11515,461096,24518,136390,16791,2019672,48387,52080,351201,39155274 +"V001",30592,30131,27587,17528,25049,93523,597797,25438,31449,30948,101680,96137,169950,37376,72870,84284,21808,56148,127625,11525,6745,32020,24392,20029,114197,50572,562332,128426,113619,100141,327087,57397,20269,7175,109334,21576,8509,108206,76900,131837,33294,113396,147152,319342,273718,315962,3386,21207,111754,36399,146779,327406,704228,357016,450413,35448,215516,620592,445330,156814,139422,53966,47837,67749,270635,336531,280705,206933,63431,1473910,115809,11602289,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00OTOP",10339,1404,25732,3106,2119,36966,9853,747,1615,2700,3251,3902,9063,1265,3941,3193,426,1776,7659,656,309,1907,801,3966,15761,1798,14668,3062,3829,2688,15613,4086,1558,940,4514,971,3903,2595,916,5558,4056,3718,4523,19303,5169,7672,579,287625,32049,9772,1430,2323,11075,8868,4665,2175,9637,9253,13346,3877,1340,2995,4083,6790,4796,11729,0,0,0,0,0,692007,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00OSUB",5870,2127,587,968,3040,1434,65127,1931,1945,1639,9889,6888,3620,1628,2046,1733,2127,4075,6067,1015,1043,1009,2549,522,3277,2546,28218,16359,4922,849,21483,20290,88,351,9163,1538,78,4565,1036,3419,1348,1747,2608,2603,3413,6198,368,0,12940,2687,12172,10954,42335,1769,24507,2267,4495,61789,11218,9050,5358,2413,4066,8087,36200,20837,0,0,0,0,0,538490,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V003",120574,13876,42691,35246,16987,184996,407089,18472,32406,23965,52594,56514,97424,20809,67747,58054,9335,37808,139457,4706,3470,31885,13738,36431,261116,30058,506913,88624,53911,19896,286769,12175,23205,4881,91048,17714,25996,56311,4799,166852,38633,329255,163096,429262,33175,268577,-2537,1762404,477510,188032,134557,68396,311079,38652,150805,23428,34171,195115,87735,10763,14312,41661,10763,38151,106619,110831,170030,129760,14925,235708,65595,8857005,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"VABAS",155635,43284,95423,54912,41116,314051,949612,42725,63526,55974,147637,149666,272818,57822,142512,143798,29442,91658,268674,15872,9481,64802,36382,59904,387798,79882,1055695,203754,166438,121877,607987,53368,44944,12645,195733,38724,38331,162547,81578,300828,74634,444623,312162,765304,308648,586013,1061,2071236,608373,231517,270593,387171,984046,402766,581375,58784,254830,763170,535193,162403,149715,96209,58618,104603,345850,438254,450735,336693,78356,1709618,181404,20612811,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T018",427966,53821,202820,94088,77851,463500,1804448,123530,133473,199593,346756,352742,367004,127138,579512,279512,69733,158751,978837,46068,17329,180155,74177,356552,757257,235094,1881150,300254,265559,214102,1054360,115969,77238,39474,404972,64935,59265,288743,137317,444829,146922,854483,534714,1144505,627231,1129051,154813,2354753,1452312,404649,359335,547158,1583235,635415,1029984,127919,352226,1100988,916476,254116,250575,144558,114806,162104,724183,704712,726398,495330,107738,2592876,381464,35970903,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00TOP",0,504,7753,2159,202,30718,2210,142,151,146,498,245,458,134,222,125,46,214,20907,16,13,123,53,400,3878,327,244228,51049,24880,41604,118013,10676,804,183,567,1088,84,344,180,1528,1122,40403,2398,3260,1438,43268,63,0,1562,13031,17190,6169,6651,1757,7196,2053,1009,1739,2964,3045,1177,4071,11480,22494,50865,14596,0,0,0,0,633,828507,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00SUB",38645,0,0,0,0,0,0,0,0,0,0,0,0,309,0,0,0,0,0,26,0,0,0,0,13,0,0,0,0,0,0,231,4082,58,0,0,0,0,0,0,0,16,0,478,0,0,0,20768,7019,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,7104,0,39613,118366,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"VAPRO",116990,43789,103176,57070,41318,344769,951822,42867,63676,56121,148135,149911,273276,57647,142734,143924,29488,91872,289582,15862,9495,64926,36435,60304,391662,80209,1299923,254803,191318,163481,726000,63813,41666,12770,196300,39811,38414,162891,81758,302356,75756,485009,314560,768086,310086,629280,1124,2050469,602916,244547,287783,393340,990697,404523,588571,60837,255838,764909,538153,165448,150892,100280,70098,127096,396715,452850,450735,336693,71252,1709618,142425,21322951,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/flowsa/data/external_data/BEA_Summary_Use_SUT_2021.csv b/flowsa/data/external_data/BEA_Summary_Use_SUT_2021.csv new file mode 100644 index 000000000..97965a9df --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Use_SUT_2021.csv @@ -0,0 +1,84 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","T001","F010","F02E","F02N","F02R","F02S","F030","F040","F06C","F06E","F06N","F06S","F07C","F07E","F07N","F07S","F10C","F10E","F10N","F10S","T019" +"111CA",113045,412,0,43,24,0,3263,0,0,0,0,0,0,0,0,0,0,294,316846,3076,0,0,0,0,21419,0,929,531,1334,252,408,0,0,0,0,0,0,31,0,0,0,0,0,0,0,0,0,0,5,0,1,1,1783,35,2066,0,180,0,0,0,0,0,345,42,7132,12,13,249,0,4540,0,478308,206265,0,0,0,0,2417,77844,0,0,0,0,0,0,0,0,0,0,0,0,764834 +"113FF",25900,10012,0,122,0,0,0,21075,1,0,0,0,0,0,0,0,139,415,11018,0,107,4951,40,0,507,2691,0,0,1144,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,452,26,5,0,68,0,0,0,0,0,311,402,9318,112,0,76,22,5401,0,94314,11972,0,0,0,0,1433,7157,0,0,0,0,0,0,0,0,0,0,0,0,114876 +"211",0,0,48075,0,35,34400,0,18,0,3,0,0,0,0,0,0,0,0,0,0,0,2,0,368919,9382,0,34,27,0,9,54,0,0,0,0,0,14,0,499,646,7,22,174,0,0,0,0,0,202,0,0,0,40,22,1,15,1430,4,0,0,8,0,165,0,0,48,0,0,1962,0,24485,490705,0,0,0,0,0,-9723,102972,0,0,0,0,0,0,0,0,0,0,0,0,583954 +"212",1672,0,119,9883,171,6982,26602,9,13877,15315,863,179,7,114,104,78,13,123,1294,39,0,1269,0,3577,6498,135,39,0,0,0,5,0,132,0,8,1,0,2,2,27,42,495,2189,0,0,0,0,21,0,0,0,0,2573,46,1628,89,604,0,25,38,204,439,951,165,1005,1956,0,4887,0,3153,4618,114265,235,62,0,0,0,444,23848,0,0,0,0,0,0,0,0,0,0,0,0,138855 +"213",0,0,15743,1547,1793,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19142,0,2046,0,0,69971,122,1891,0,0,0,0,0,0,0,0,0,0,0,0,93172 +"22",10301,125,9931,4139,409,42651,13069,1995,4430,5771,5003,2375,1375,856,3926,2746,617,950,10375,974,43,6596,1461,6816,14384,6093,21662,5520,13388,10452,28685,1282,74,93,5877,309,1595,1784,2910,1019,591,9104,6995,2639,1768,908,1496,1354,36787,2015,1051,1158,7769,6891,4428,1695,4608,4195,9874,3708,1708,1105,3548,4544,27593,9309,4056,1983,3255,33612,3480,455286,303354,0,0,0,0,0,3616,0,0,0,0,0,0,0,0,0,0,0,0,762256 +"23",1709,43,372,3035,1555,6664,402,417,1181,1313,1560,930,454,205,1005,381,140,396,2570,133,9,1275,352,6309,2099,1002,5465,1708,1441,2667,6208,162,2587,31,839,525,898,1610,995,175,76,2644,1815,6783,2526,1091,67,78420,48166,1821,257,106,3387,1095,1160,265,1053,738,2094,700,924,268,721,2281,3581,4854,11564,1565,770,40430,65202,347248,0,0,0,856380,520543,0,115,0,0,0,11648,0,0,0,13920,0,0,0,337337,2087191 +"321",865,145,0,578,327,8,100124,47417,269,565,314,1092,473,1182,4877,326,10008,2081,416,74,1,6896,2,0,297,3068,11188,225,1031,256,2192,0,5507,0,250,0,7,76,177,55,159,1336,2283,411,13,0,0,80,10953,1118,24,71,1572,7,1529,49,52,694,753,6,1181,12,264,1179,1496,519,13,119,3,6095,339,234702,10218,0,0,16905,48,3110,6673,0,0,0,0,0,2,0,0,0,0,0,0,271658 +"327",33,78,1716,608,802,64,129965,1163,21526,2741,1928,1866,276,2171,9577,335,342,925,3766,31,0,606,1,2134,1802,2619,152,297,68,453,1328,0,18,0,141,0,0,15,89,3,2,3614,1241,26,37,62,0,245,116,1238,0,302,7567,32,1174,407,63,2760,3363,151,839,14,149,106,3285,2077,61,1140,0,2664,3848,226222,26870,0,0,0,0,2889,10946,0,0,0,0,0,0,0,0,0,0,0,0,266927 +"331",137,0,8103,655,350,4,8900,398,2202,97180,107801,49137,5444,22845,61781,7277,4051,7307,2386,116,0,1404,30,20,55,2432,1157,8,0,0,638,0,856,0,0,0,0,204,0,13,16,590,1211,0,0,0,0,2,2684,141,0,0,2691,64,727,355,166,167,38,12,408,23,324,27,192,1001,210,1480,0,121,832,406372,1129,0,0,0,0,4400,35747,0,0,0,0,0,0,0,0,0,0,0,0,447649 +"332",2216,224,11952,1161,831,1177,160472,4291,2792,5176,51883,30107,6624,13916,33422,13423,5376,5365,21214,595,84,6777,997,1373,10435,10437,4663,460,429,274,3618,142,472,1214,2114,363,1880,511,1223,868,60,14719,3690,669,414,0,31,42,3283,3431,48,4355,9778,820,3834,4919,577,451,2410,40,4137,59,713,1757,4764,6089,10500,2226,339,7328,6868,518904,58106,19226,0,0,0,2827,39439,0,679,0,0,0,355,0,0,0,194,0,0,639731 +"333",3044,95,14678,4829,4153,1543,57244,616,185,1562,6227,44974,347,2845,40879,4024,136,1599,6125,40,3,1099,1487,80,4935,2934,3223,278,191,147,1195,12,75,32,529,83,63,6358,2079,63,38,1690,1287,8,52,926,0,97,304,1530,23,2979,4116,625,5850,6647,2647,1185,906,145,271,35,201,66,1037,7991,1099,636,74,7193,3052,272719,51838,362610,0,0,0,-3293,130712,0,6291,0,0,0,215,0,0,0,15582,0,0,836674 +"334",37,1,71,25,90,95,10448,1450,835,1773,7297,8532,40356,5383,25696,18495,1028,2565,3360,460,53,1420,1356,413,5633,3114,49644,1383,689,786,3181,3,88,0,320,4,7,109,204,3736,727,26295,12280,931,1662,141,1138,2,995,296,1815,8714,15746,12429,9816,1263,1220,11962,1050,160,797,35,224,394,276,3861,33582,8127,0,3493,1762,361333,204864,308248,0,440,0,13409,120839,0,33388,0,0,0,5423,0,0,0,7098,0,0,1055042 +"335",4047,119,278,62,450,21,73306,680,145,1734,3989,19528,2345,14845,8667,1591,132,997,1961,63,2,661,110,153,1414,1591,1959,469,157,1834,605,1,317,31,163,190,2,85,212,8,0,5991,575,165,88,45,0,17,2078,678,0,4800,7993,111,3028,1421,750,17,1397,1140,679,60,536,853,752,6106,2912,6520,73,2002,4564,200273,113417,54650,0,15174,0,4280,36957,0,1288,0,0,0,213,0,0,0,1156,0,0,427408 +"3361MV",1212,130,1434,903,439,39,3385,2596,791,824,2074,13998,1044,764,225003,3005,563,1086,6622,83,2,1857,207,216,1855,942,11462,7114,3150,608,10181,0,71,0,8176,437,1,133,1864,234,182,1723,700,221,41,0,0,0,0,3770,0,151,5078,768,19294,1919,589,665,2230,141,2725,65,153,169,1729,15803,8126,275,4387,9736,1438,396585,449752,316866,0,0,0,-19675,107908,0,14513,0,0,0,14275,0,0,0,38271,0,0,1318494 +"3364OT",0,26,0,3,0,0,70,19,0,0,81,434,0,0,1260,51727,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,1322,1180,794,44,74,0,2889,0,0,0,9,0,0,0,0,0,0,0,0,0,0,2347,52,82,96,0,0,0,0,0,0,103,0,0,40,55665,934,3,0,114,119370,53338,56538,0,0,0,-7296,78802,0,37696,0,0,0,3094,0,0,0,470,0,0,342011 +"337",0,0,0,0,0,0,32631,379,0,0,0,262,128,2,25,80,3738,280,0,0,0,0,0,0,0,394,1166,181,0,14,2636,0,0,0,0,0,0,0,0,1,0,144,521,0,0,0,0,8171,117,0,12,4,901,8,4,0,0,300,153,1,307,556,461,2,352,482,0,0,110,13,1034,55572,152874,43854,0,1203,0,3877,4360,0,1,0,0,0,10,0,0,0,1209,0,0,262959 +"339",161,2,56,33,16,0,2180,34,184,54,97,2696,1,688,3275,29,8,9340,63,52,124,0,5,3,594,258,1634,1685,196,10,3393,0,2,0,11,25,0,160,169,5,4,191,136,92,51,24,0,0,420,94,16,41,3539,17,3629,572,391,30378,36700,1073,2771,108,313,39,1094,2435,2839,2028,0,15849,74,132161,369879,75018,0,0,0,6238,44237,0,148,0,0,0,26,0,0,0,1170,0,0,628878 +"311FT",48554,346,0,0,0,0,0,41,738,6,0,0,0,0,0,0,0,25,240627,9,225,357,551,613,8005,254,4088,1,3102,994,1569,292,1,178,47,0,0,8,0,34,5,0,355,0,0,0,0,0,0,0,0,0,6240,124,1,0,4766,5,6673,4377,20326,1335,5618,5868,105331,1301,4535,136,889,72907,0,551455,1350696,0,0,0,0,9502,89242,0,0,0,0,0,0,0,0,0,0,0,0,2000895 +"313TT",90,56,0,1,0,0,3816,698,319,0,2,926,0,0,4012,987,3783,1828,220,10808,1877,4594,321,37,3,3103,4598,75,173,5870,2404,0,0,36,30,0,1,73,8,1,382,9,10,0,0,0,0,1,187,376,0,0,675,20,246,282,35,99,586,2935,2161,0,493,1777,578,903,1839,890,7,4194,28,69462,97993,3282,0,2975,0,2164,10440,0,0,0,0,0,26,0,0,0,4,0,0,186343 +"315AL",75,0,0,0,0,0,0,0,0,0,0,0,0,0,1837,0,0,351,21,89,1624,0,177,0,0,0,683,54,1,358,276,0,0,0,0,0,0,0,0,3,4,50,0,0,0,0,0,0,0,20,0,0,28,1,131,112,16,10,35,0,35,46,32,10,22,1238,231,73,348,2898,34,10923,481331,0,0,0,0,10422,6088,0,0,0,0,0,0,0,0,0,0,0,0,508764 +"322",586,0,116,157,45,24,5361,1492,2284,1722,2662,2171,588,1594,7241,508,1621,2421,30602,483,45,53178,10008,398,6675,6077,10535,236,1801,593,2677,20,70,2,269,1423,35,1883,297,1541,110,497,364,946,507,1845,1,1,1301,1009,487,802,4015,850,7984,520,304,1310,1439,635,1363,78,199,2912,6779,1214,208,3681,265,17924,49,219042,68578,0,0,0,0,847,24911,0,0,0,0,0,0,0,0,0,0,0,0,313378 +"323",12,0,7,1,0,8,66,3,0,0,9,3,0,2,4,0,0,0,53,0,0,0,1124,1,138,0,11772,202,194,182,9373,3,8,0,273,61,4,247,14,3548,706,454,4265,983,1662,5014,0,0,170,477,695,386,5772,1007,3158,17,628,1519,3418,113,1811,603,218,626,1182,1160,546,2204,54,9715,399,76277,8009,0,0,0,0,770,2497,0,0,0,0,0,0,0,0,0,0,0,0,87553 +"324",13605,647,6886,3868,1952,22964,68715,974,723,1390,874,911,119,892,602,130,281,1098,3240,86,10,1702,816,23176,10108,1018,7710,1264,722,391,3553,20996,6006,3035,43785,2880,271,17801,4840,605,154,1040,1138,5525,5462,150,772,77,8549,3275,78,2198,3266,1128,9871,2207,1398,1007,1691,836,1195,260,1071,663,5596,2880,14057,1507,2470,128744,29593,518506,385239,0,0,0,0,-5440,128286,0,0,0,0,0,0,0,0,0,0,0,0,1026591 +"325",38819,3059,9656,2219,1404,1864,24743,5528,5113,2102,8806,2966,2172,3114,16336,1379,2050,7572,9880,11861,157,10380,4832,41657,262139,93683,3934,159,98,63,1753,1,208,3,347,14,2,88,572,560,359,1041,1874,62,136,187,0,783,14500,192,211,447,38642,1558,14514,2395,604,70707,32721,6574,857,466,1053,64,1848,4928,10512,5683,125,54410,4596,853341,678403,1736,0,0,0,-256,227605,0,0,0,0,0,0,0,0,0,0,0,0,1760830 +"326",2319,125,129,1190,673,27,60377,2122,1400,642,3024,12485,2336,2810,30546,2615,4189,5715,27779,476,203,3374,3372,568,12995,25701,29675,1744,2535,705,8074,175,5,0,1298,85,82,2036,428,358,177,7625,1406,57,181,2123,0,31,1236,3414,35,2899,11474,152,3928,665,788,11133,6762,2024,2600,58,317,158,11700,4428,2558,1979,65,19079,4521,357968,97335,713,0,403,0,882,31235,0,0,0,0,0,21,0,0,0,0,0,0,488557 +"42",1118,11,484,52,0,1446,110,304,351,972,814,1490,628,1273,3328,23,262,1607,3407,83,20,1221,104,178,3744,3035,42526,2242,742,27,17438,115,0,0,89,0,5,0,0,594,14,2129,77,15,32,73,3,0,0,12654,0,364,0,0,84,37,46,91,29,0,0,0,37,0,65,65,0,0,6,30,0,105694,0,0,0,0,0,0,3295,0,0,0,0,0,0,0,0,0,0,0,0,108989 +"441",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"445",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"452",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"4A0",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,709,0,663,617,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1989,11733,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13722 +"481",0,0,1,5,96,536,236,94,137,96,219,139,16,15,149,27,53,84,254,11,2,111,95,52,105,194,6056,128,49,51,438,166,12,68,2808,27,7,1828,292,318,205,384,1443,3788,2412,90,187,19,7692,1188,602,2642,3574,295,3597,329,394,1867,269,183,475,78,161,89,1495,347,3619,1971,513,2731,48,57663,117997,0,0,0,0,0,20604,0,0,0,0,0,0,0,0,0,0,0,0,196264 +"482",0,0,0,0,0,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,63,4,4,0,30,0,21,0,4348,0,5,221,5,0,0,135,1,5,3,89,0,0,0,13,15,9,156,1,48,0,0,3,16,0,0,0,0,0,0,4,89,51,859,208,0,6464,778,0,0,0,0,0,1386,0,0,0,0,0,0,0,0,0,0,0,0,8627 +"483",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,433,31,0,0,99,0,23,0,0,0,0,0,0,0,1330,107,1072,153,0,3253,6537,0,0,0,0,0,4744,0,0,0,0,0,0,0,0,0,0,0,0,14534 +"484",113,0,0,0,68,0,0,67,81,89,306,157,44,50,108,55,66,191,149,35,10,203,51,183,117,211,5351,2078,1340,873,7678,734,122,40,13834,89,22,6267,1038,105,67,2,313,0,0,7,2,0,0,380,76,95,1320,6,265,47,20,148,309,20,68,22,3,11,184,142,4522,65,1247,329,13,51607,14820,0,0,0,0,0,1733,0,0,0,0,0,0,0,0,0,0,0,0,68160 +"485",0,1,1,2,47,851,515,52,74,54,119,78,9,9,81,15,28,55,137,5,1,60,49,28,59,102,1286,95,5,21,164,0,256,0,0,0,2,301,4,189,101,539,1103,2898,1391,1353,103,41,5267,924,522,2007,3894,197,2672,173,362,1891,2593,554,239,1994,68,69,1067,218,45,6,17,16956,956,54976,35616,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,90592 +"486",0,0,345,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,345,0,0,0,0,0,0,304,0,0,0,0,0,0,0,0,0,0,0,0,649 +"487OS",0,107,29,418,3,9472,0,847,1005,137,72,20,0,3,11,0,242,184,472,64,0,746,356,808,171,611,84214,2704,2175,709,23841,23856,1001,2117,70833,911,985,49628,6252,1748,1154,123,5259,1124,5549,92,0,0,0,6139,848,1324,11578,1069,3207,1832,399,2304,5186,358,1492,533,473,83,1310,1152,4,221,1230,1034,3848,345673,22688,0,0,0,0,0,15168,0,0,0,0,0,0,0,0,0,0,0,0,383529 +"493",739,0,8,109,0,670,0,930,1742,68,564,439,327,82,104,83,92,404,3216,799,146,2638,781,721,2052,2975,35626,8063,7736,5107,37725,52,1,364,7891,182,111,1174,6770,532,288,434,1610,0,0,23,0,4,378,898,219,315,1474,13,13890,333,115,681,1500,165,300,205,100,394,1255,638,375,1258,0,7533,118,165535,299,0,0,0,0,0,182,0,0,0,0,0,0,0,0,0,0,0,0,166017 +"511",76,1,36,1,5,305,1124,29,1,15,81,41,17,1,34,98,8,36,10,0,0,8,46,5,28,9,4919,495,89,289,1371,11,65,0,46,18,0,690,155,44147,72,749,3266,592,1253,807,54,1,1181,841,1562,1671,6282,569,3279,76,737,1508,2147,127,1058,61,89,112,248,590,64,2574,29,10934,401,97244,224056,0,183583,0,0,102,44531,0,0,5395,0,0,0,6140,0,0,0,14892,0,575943 +"512",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80,511,338,0,136,3,0,0,3,0,34,21,0,156,34128,55449,368,44,40,0,0,0,102,280,10,58,3867,396,72,0,616,56,22,981,1534,370,65,654,5109,363,28,1793,72,646,0,108403,22775,0,42355,0,0,517,17765,0,0,0,0,0,0,0,0,0,0,0,0,191815 +"513",631,16,572,104,261,1252,6803,276,681,230,880,674,137,123,433,324,146,352,1163,76,22,342,366,71,388,389,13821,2039,894,492,8630,434,86,142,2369,414,900,1930,252,2353,838,102224,16802,4151,5176,4753,730,84,16489,2853,4102,2341,10746,2048,13092,986,1862,3651,2440,830,763,391,1117,2707,6570,5677,5842,10496,1998,82693,1507,367426,374236,7632,31245,0,0,0,10239,0,0,0,0,0,0,0,0,0,0,0,0,790777 +"514",0,0,62,7,12,4877,2631,774,1127,681,1820,1715,146,423,623,851,468,761,1797,116,24,1049,327,232,469,488,5715,5417,2066,1640,17009,456,0,0,247,261,129,1556,270,4693,242,4835,21990,17974,5803,3855,2031,9,2445,2057,5811,6362,23112,1974,42314,2277,5252,2177,4089,381,1100,1122,1684,867,15599,8764,1689,12078,656,44240,3454,307178,121265,0,59001,0,0,0,5946,0,0,2477,0,0,0,2819,0,0,0,6694,0,505380 +"521CI",3179,534,4137,537,308,8195,9731,319,1280,1061,1742,1428,1405,754,3755,485,407,1320,4340,232,398,880,594,852,2951,1463,44514,4107,2627,2809,14690,983,6228,376,2260,3333,3924,2501,345,5037,1634,15922,4716,96969,54022,814,1399,172170,95668,18734,2387,4248,16239,29304,7783,781,1375,5531,7009,1050,1267,854,2138,4251,11107,10227,0,8454,1707,16143,4091,744016,317880,0,0,0,0,0,75512,0,0,0,0,0,0,0,0,0,0,0,0,1137408 +"523",292,20,2510,1788,5232,709,2010,29,65,1611,2098,1693,90,357,2092,345,502,889,116,5,1,23,27,31,22,81,4030,152,321,683,1050,1010,533,547,570,1412,204,2143,52,409,714,231,174,71654,55091,4021,88351,8,8679,5028,659,706,3129,10672,1474,46,254,1532,16381,361,3655,1064,100,3927,7540,4277,0,3,20,4121,4431,334056,290556,0,0,0,0,0,96614,0,0,0,0,0,0,0,0,0,0,0,0,721227 +"524",4243,763,4114,729,1904,2340,598,312,1229,748,1211,1629,233,984,4548,895,426,678,4373,313,88,489,88,439,2501,868,58072,4291,1961,2029,13902,650,41,496,17659,8477,438,5866,2848,633,2261,2298,1526,4984,14109,409298,8626,5190,63774,14606,3776,3340,15051,391,10259,1664,2523,12535,18558,3490,11121,2381,1861,1226,10590,3290,0,2194,4708,4779,12590,807102,443742,0,0,6945,0,0,22822,0,0,0,0,0,0,0,0,0,0,0,0,1280612 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4083,4719,0,0,0,0,0,0,82,0,0,0,0,0,0,0,0,0,0,0,0,0,27,0,624,0,9535,171750,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,181286 +"HS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2455719,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2455719 +"ORE",4365,32,2067,140,410,8079,17552,700,1063,431,4852,2129,3519,711,1896,1220,1093,1805,4594,545,146,1727,1936,165,4722,2783,96429,20573,27765,18779,138524,162,160,520,10181,1999,340,8487,8349,8911,4472,31256,14369,19806,34794,26018,398,8008,225684,16156,22187,10267,69725,37592,47807,4838,34275,47914,84363,28246,18023,13778,19766,2573,74285,70579,275,18242,696,25211,2384,1423850,6279,0,0,175263,36972,0,3126,0,0,0,0,0,0,0,0,0,0,0,0,1645490 +"532RL",2844,141,5434,2067,2786,3473,29847,267,859,688,2071,1477,432,485,7883,698,248,1001,3725,87,1873,1163,504,1412,3812,1176,38913,1125,1743,4660,12948,13809,7027,6124,17514,598,74,3676,4522,2735,1348,11149,13121,4446,9730,5477,19,4147,4479,14730,2799,4706,22902,27331,12232,2893,1513,4041,4061,316,563,1795,2169,1868,18152,2418,273,649,303,10174,738,382461,105811,0,0,0,0,0,89557,0,0,0,0,0,0,0,0,0,0,0,0,577829 +"5411",293,104,965,375,179,5967,6680,415,496,474,1965,1684,3444,274,2567,1196,251,1727,1331,134,81,801,353,470,4397,1162,20169,671,768,718,6927,150,876,129,312,163,74,730,365,4418,1063,3509,7130,4766,12511,16096,1296,2027,12407,1212,3183,4271,17776,11260,9645,631,353,4429,16883,1337,909,2049,2040,884,2751,4698,0,281,88,15828,1288,236855,118996,0,0,45096,0,0,18508,0,0,0,0,0,0,0,0,0,0,0,0,419455 +"5415",428,36,5673,516,56,2191,5815,295,346,282,1550,1870,309,113,658,1182,193,462,1277,79,16,340,398,517,325,534,23643,3970,991,1750,8550,241,1048,48,817,304,20,377,357,8806,687,4248,13486,6697,9072,8491,788,916,5733,902,4800,9122,13609,2296,18225,956,1696,3881,5036,978,1818,514,1232,767,6254,3425,5317,26838,163,32230,5197,271753,0,55217,286100,0,0,0,44558,0,2058,12044,0,0,0,31828,0,0,829,12077,0,716464 +"5412OP",2040,610,4155,1356,1194,16040,60631,1791,2465,2599,5217,4782,6280,1658,6612,3227,1711,4460,12167,684,191,2853,1519,2061,10289,4556,157426,24156,11810,6107,102171,831,1979,768,5243,1273,1709,3232,2660,28191,8905,42050,61828,46712,48854,48804,2157,2964,61531,17051,13158,36017,166627,51909,61370,3817,8481,26317,43376,7240,7183,7374,8717,5287,30821,31499,56125,20243,1934,90439,21494,1548987,93898,45453,643381,6289,0,0,195535,0,0,61862,0,0,0,110505,0,0,0,22562,0,2728474 +"55",0,0,33830,5190,2847,135,14391,355,2414,1079,4791,13865,3694,2425,9384,3452,447,4332,25257,810,352,2452,502,4223,17011,1972,126326,2073,5686,14093,41080,2363,10,940,4737,168,3,7122,1798,4724,621,4916,4621,7733,14670,8735,765,169,19946,14086,5706,5112,18715,42,26946,4177,3782,46318,11721,6054,3439,2872,2381,14009,60466,9468,0,0,208,0,0,664016,0,0,0,0,0,0,3102,0,0,0,0,0,0,0,0,0,0,0,0,667118 +"561",533,47,611,513,1243,10984,10240,752,1105,3131,7807,2871,2066,573,3401,3776,297,1571,4425,245,358,1751,2728,1471,4916,1933,86276,6491,3568,5695,31994,2066,818,2445,11541,6005,2480,13090,5752,21879,3036,38602,39737,21429,17848,13578,105,3431,148380,34525,12664,36970,71749,19340,119465,7252,4436,26393,52904,9962,4658,7197,3762,4039,14612,17447,6394,18926,681,53320,7760,1090047,67525,0,0,0,0,0,4444,0,0,0,0,0,0,0,0,0,0,0,0,1162016 +"562",175,3,578,79,76,602,2401,109,201,212,268,176,51,45,171,83,73,93,1033,48,2,244,79,318,1049,249,2818,764,393,225,1458,33,133,6,1083,26,206,407,177,53,45,84,83,214,156,1662,235,4,52684,1063,280,349,2321,689,2407,11654,247,1529,1958,545,516,67,433,476,1796,1233,131,881,292,25450,4072,129755,32673,0,0,0,0,0,428,0,0,0,0,0,0,0,0,0,0,0,0,162856 +"61",2,0,0,0,0,41,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,1,0,0,1025,70,318,0,2569,62,4,0,0,0,3,17,0,0,0,10,45,42,12,0,0,0,0,0,0,36,13,0,240,0,2179,0,4,0,0,3363,363,0,0,2141,0,59,163,10900,7,23696,393969,0,0,0,0,0,6387,0,0,0,0,0,0,0,0,0,0,0,0,424052 +"621",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,145,0,7,0,0,18190,13775,7,1,9,0,0,0,4,0,1953,0,5829,0,39920,1231251,0,0,0,0,0,762,0,0,0,0,0,0,0,0,0,0,0,0,1271934 +"622",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,123,0,0,0,0,0,0,0,0,0,0,0,0,123,1242226,0,0,0,0,0,7899,0,0,0,0,0,0,0,0,0,0,0,0,1250248 +"623",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2846,0,840,0,3686,259466,0,0,0,0,0,187,0,0,0,0,0,0,0,0,0,0,0,0,263339 +"624",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,280563,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,280563 +"711AS",97,0,1,0,18,128,291,32,36,47,74,50,4,5,40,9,14,31,109,4,1,51,35,32,32,92,4334,652,510,82,1006,0,81,0,77,12,0,251,7,213,11436,27668,684,2865,1018,308,193,3,7391,437,612,1304,5458,3823,2371,127,1354,1111,1233,184,887,22362,655,186,2976,1368,0,38,39,1915,47,108510,70811,0,6080,0,0,0,1337,0,0,0,0,0,0,0,0,0,0,0,0,186739 +"713",54,1,0,1,22,130,366,22,37,22,50,31,4,2,26,6,12,22,57,1,0,25,22,12,23,44,1637,19,107,5,1082,0,1,0,0,0,0,25,2,86,45,117,498,1293,614,118,45,6,0,259,264,918,1309,1737,1318,80,98,908,44,73,177,127,221,231,1251,107,9,18,2,2267,87,18196,215458,0,0,0,0,0,31,0,0,0,0,0,0,0,0,0,0,0,0,233685 +"721",1,0,1,6,96,845,386,94,145,106,236,159,18,19,170,29,55,110,271,12,2,119,135,56,121,222,3338,30,56,44,334,0,11,0,0,0,8,357,12,450,272,619,2625,6778,3263,615,243,35,12107,1552,1083,4913,6409,855,5413,501,503,3076,244,224,371,95,232,318,2606,476,1605,802,54,3364,159,69462,138343,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,207804 +"722",383,11,17,26,234,2029,585,164,218,192,339,254,24,47,239,52,75,153,502,35,9,216,151,144,180,338,10087,999,1031,1245,5891,3857,3,7,1137,95,60,1869,337,494,492,733,2877,12279,4016,4481,712,33,42351,4559,2452,7991,20388,5051,12255,573,1269,24996,19722,7974,4219,524,1776,6009,8713,1783,721,294,273,13271,583,247099,893742,0,0,0,0,0,1789,0,0,0,0,0,0,0,0,0,0,0,0,1142630 +"81",331,68,110,98,230,1079,7046,381,1030,1144,1500,831,378,153,865,327,127,419,2117,108,10,1099,318,536,1718,915,22464,2202,2547,2273,9100,201,91,230,10056,1931,383,2956,808,1477,339,4197,2135,5162,4943,7628,112,17848,6382,7865,1038,2389,9889,7097,18660,6071,2211,4921,12568,1338,866,709,1539,1280,12160,8298,4293,18851,594,41453,3010,295504,684888,0,0,0,0,0,93,0,0,0,0,0,0,0,0,0,0,0,0,980485 +"GFGD",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,709095,0,0,0,0,0,0,0,0,0,0,0,709095 +"GFGN",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,507268,0,0,0,0,0,0,0,507268 +"GFE",10,4,0,3,0,258,8,0,0,30,114,208,44,122,0,0,0,20,0,1,0,0,43,30,38,0,23135,850,702,358,6790,1,0,1013,3664,242,100,907,617,463,332,164,1539,1728,3574,97,0,0,603,1945,312,533,2436,226,1144,134,304,982,2948,223,497,128,75,519,7606,457,0,160,74,2470,98,71086,6536,0,0,0,0,0,874,0,0,0,0,0,0,0,0,0,0,0,0,78496 +"GSLG",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2149907,0,0,0,2149907 +"GSLE",0,1,0,0,0,651,0,55,149,159,205,151,37,33,143,68,37,73,881,45,2,193,57,261,938,169,1844,491,364,182,1177,2,0,0,510,5,88,138,145,58,59,84,103,291,226,89,0,0,3411,1283,449,246,1148,574,1277,990,103,510,831,349,250,63,169,419,1545,1090,1179,1008,276,8266,1488,37087,81999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,119086 +"Used",-18,231,0,0,1425,8486,3416,0,85,49081,1105,10,0,0,0,0,0,7,0,25,0,1990,0,0,42,61,0,36,0,0,281,-37,0,-183,754,4,114,6546,0,0,12,1,0,0,0,0,0,0,0,0,0,0,0,518,0,0,1494,0,0,0,0,-137,279,0,0,43781,-27,0,0,0,0,119381,313782,-164956,0,-844,-3675,-13297,51804,0,0,0,-4,0,46,0,-446,0,-16240,0,5523,291074 +"Other",767,46,835,6,165,1253,1735,236,234,525,581,996,931,259,1915,280,87,347,1647,92,14,560,197,3631,1654,587,7793,64,472,853,4104,17104,154,1796,922,6,67,560,91,685,406,6952,795,2972,45473,1156,47,138,511,2007,99,2176,3006,1799,1391,48,374,0,0,278,0,289,242,414,2290,1551,9781,2735,5,0,0,141185,-9396,0,14553,0,0,0,78900,0,0,0,0,0,0,0,0,0,0,0,0,225242 +"T005",291132,18430,195899,49189,34438,211621,970288,103117,77648,205837,247144,236618,88375,85225,531310,127940,45636,75928,779268,34240,8336,131756,39113,475404,445243,194766,1121302,121895,111023,99378,614710,93725,38434,23443,256025,34428,17361,160980,60865,158053,79089,441098,268834,368927,370257,585228,116826,306596,937325,211122,96430,182216,681978,247076,542297,79231,101662,388798,446687,98635,114756,77874,72431,77773,507067,318325,268808,204519,35201,987882,240799,18071274,16042962,1188193,1266300,1126229,623859,11670,2184535,709095,96062,81779,11644,507268,23706,151292,13474,2149907,49743,56225,342860,44708077 +"V001",30590,30268,24160,18676,24192,93532,639701,28122,33076,33461,107745,101320,183741,39797,79397,83814,23609,60784,134990,12282,7295,32493,24615,19120,117942,54512,607066,155775,115405,110919,364514,58482,20020,7280,119255,24595,8235,126781,93989,162756,42715,117156,185389,349279,316507,323722,4072,22184,127594,39548,158619,375642,778623,391164,506212,37803,228974,674375,462131,150461,148148,61657,58128,79254,346032,352983,293009,214046,65727,1512985,118188,12556629,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00OTOP",10777,1443,26308,3183,2159,37881,10643,767,1660,2766,3330,4011,9327,1300,4036,3314,437,1829,7852,671,316,1950,819,4082,16153,1842,15139,3371,3472,2560,16485,4177,1645,960,4816,1020,3987,2702,946,5734,4149,3712,4657,19706,5337,7991,594,294446,33541,9835,1460,2417,11410,9259,4838,2249,9851,9456,13875,3729,1378,3063,4240,6943,4911,12008,0,0,0,0,0,710925,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00OSUB",7888,1042,563,437,2336,591,34881,878,764,821,6004,3465,1714,799,1347,1235,1324,2653,3329,455,917,325,2020,203,1631,1056,11163,6933,2999,1660,11485,22061,50,554,4172,3523,35,2019,397,1963,3362,943,825,1951,710,1740,81,0,4795,1537,5369,4390,19245,995,10418,738,5247,33930,5477,3812,10275,13343,3444,10329,68830,19574,0,0,0,0,0,379052,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V003",164735,13265,156752,42191,18472,223541,396304,31855,33594,38403,39065,53621,100404,16840,56395,65712,6543,38758,144414,4023,3315,30339,15341,110059,311049,23459,512043,112743,54785,23243,318830,41739,27745,8676,107980,23048,33328,67375,3998,172163,44261,336519,200189,465343,26049,279277,24917,1867442,530763,214836,139195,50095,329579,39685,159194,23228,37446,203784,90027,10165,22481,63117,21468,73108,170307,125555,178597,137314,18496,253309,66334,9848222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"VABAS",198213,43934,206658,63614,42487,354362,1011766,59865,67566,73810,144135,155487,291758,57138,138481,151605,29264,98719,283927,16521,10009,64458,38755,133058,443513,78757,1123085,264957,170663,135061,688344,82338,49360,16362,227879,45140,45515,194839,98536,338690,87763,456444,389410,832378,347183,609249,29501,2184072,687103,262682,293905,423763,1100367,439112,659826,62542,271023,853684,560555,160544,161733,114493,80392,148975,452421,470972,471606,351360,84223,1766295,184522,22736724,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T018",489346,62364,402557,112803,76926,565982,1982054,162982,145214,279647,391279,392105,380133,142363,669791,279545,74900,174647,1063195,50761,18345,196213,77867,608462,888756,273522,2244388,386852,281686,234439,1303055,176062,87794,39805,483904,79568,62875,355820,159401,496744,166851,897542,658244,1201305,717440,1194477,146327,2490668,1624428,473804,390335,605979,1782345,686188,1202123,141773,372685,1242482,1007242,259179,276489,192367,152823,226748,959488,789297,740413,555879,119424,2754177,425321,40807998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00TOP",0,789,15291,3757,202,32364,2551,162,173,162,580,282,527,175,251,146,54,254,22105,18,16,145,65,452,4054,381,292519,59811,29128,48739,138218,17987,843,203,602,1255,78,395,216,1704,1327,40827,2571,3620,1698,29252,66,0,1806,15078,24381,6700,7645,1928,8168,2220,1190,2151,3433,3530,1427,5055,15710,25890,61216,16796,0,0,0,0,658,960996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00SUB",17266,0,0,0,0,0,0,0,0,0,0,0,0,336,0,0,0,0,0,20,0,0,0,0,19,0,0,0,0,0,0,276,5028,1,0,0,0,0,0,0,0,0,0,275,0,0,0,21939,9065,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,9716,0,39741,103689,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"VAPRO",180947,44723,221950,67371,42689,386726,1014317,60027,67739,73972,144714,155769,292285,56977,138733,151750,29318,98973,306032,16519,10025,64602,38820,133510,447548,79138,1415604,324768,199791,183800,826562,100049,45175,16565,228480,46395,45593,195234,98752,340394,89090,497271,391981,835722,348880,638501,29567,2162133,679844,277760,318286,430463,1108012,441040,667994,64762,272213,855835,563980,164074,163160,119548,96102,174866,513637,487768,471606,351360,74507,1766295,145439,23594031,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/flowsa/data/external_data/BEA_Summary_Use_SUT_2022.csv b/flowsa/data/external_data/BEA_Summary_Use_SUT_2022.csv new file mode 100644 index 000000000..691bc881e --- /dev/null +++ b/flowsa/data/external_data/BEA_Summary_Use_SUT_2022.csv @@ -0,0 +1,84 @@ +"","111CA","113FF","211","212","213","22","23","321","327","331","332","333","334","335","3361MV","3364OT","337","339","311FT","313TT","315AL","322","323","324","325","326","42","441","445","452","4A0","481","482","483","484","485","486","487OS","493","511","512","513","514","521CI","523","524","525","HS","ORE","532RL","5411","5415","5412OP","55","561","562","61","621","622","623","624","711AS","713","721","722","81","GFGD","GFGN","GFE","GSLG","GSLE","T001","F010","F02E","F02N","F02R","F02S","F030","F040","F06C","F06E","F06N","F06S","F07C","F07E","F07N","F07S","F10C","F10E","F10N","F10S","T019" +"111CA",156211,436,0,63,27,0,4097,0,0,0,0,0,0,0,0,0,0,253,389907,1568,0,0,0,0,30248,0,1068,493,1733,354,520,0,0,0,0,0,0,38,0,0,0,0,0,0,0,0,0,0,4,0,1,1,2419,45,1952,0,316,0,0,0,0,0,436,98,8721,13,12,-105,0,6733,0,607665,233600,0,0,0,0,-25457,90431,0,0,0,0,0,0,0,0,0,0,0,0,906238 +"113FF",28194,10959,0,183,0,0,0,22828,1,0,0,0,0,0,0,0,138,388,10534,0,74,5023,43,0,514,3134,0,0,1240,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,35,5,0,77,0,0,0,0,0,416,533,10672,104,0,570,24,6565,0,102870,12886,0,0,0,0,926,7180,0,0,0,0,0,0,0,0,0,0,0,0,123863 +"211",0,0,64163,12,62,36273,0,21,3,7,7,0,0,0,4,0,0,0,13,0,0,8,4,543842,8310,20,75,34,11,15,154,0,0,0,0,0,44,0,501,867,65,44,205,0,0,0,0,0,217,0,0,4,87,21,23,30,1550,30,7,12,24,13,218,18,14,103,0,0,1512,0,22868,681516,0,0,0,0,0,8651,173343,0,0,0,0,0,0,0,0,0,0,0,0,863509 +"212",1829,0,248,10629,130,10511,28927,11,16010,16709,881,182,11,136,119,120,16,142,1318,50,0,1596,0,5624,7441,176,43,0,0,0,5,0,153,0,10,1,0,2,3,25,50,463,2463,0,0,0,0,23,0,0,0,0,2833,55,1625,94,620,0,29,42,287,616,1246,183,1326,1909,0,5215,0,3728,6914,132779,324,113,0,0,0,3625,31955,0,0,0,0,0,0,0,0,0,0,0,0,168795 +"213",0,0,21225,2233,1500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,59,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25022,0,2765,0,0,83010,925,2297,0,0,0,0,0,0,0,0,0,0,0,0,114020 +"22",10188,134,18120,4722,348,50897,13609,2164,4740,7320,5324,2571,1770,950,4262,3850,679,1009,9124,1119,22,6670,1576,14761,16092,6670,23752,5971,14171,11654,33895,3148,92,150,7233,431,1869,2099,3424,1352,714,9214,7930,2796,1710,588,997,1496,44325,2462,1053,1286,8535,7222,4942,1908,5598,4516,10158,4175,1747,1321,4543,6320,31188,10942,3036,1797,3332,36602,4219,524604,358884,0,0,0,0,0,4658,0,0,0,0,0,0,0,0,0,0,0,0,888145 +"23",1625,44,358,3652,1310,7757,412,440,1209,1602,1603,983,561,217,1049,499,149,422,2240,146,5,1209,371,6805,2229,1072,5957,1793,1493,2896,7191,300,2688,53,1049,674,548,1694,1131,218,93,2784,2055,7172,2357,891,41,71214,57232,2165,251,116,3755,1117,1279,293,1528,779,2074,763,934,313,865,2962,3949,5183,12017,1546,763,45429,70490,368059,0,0,0,916604,579945,0,118,0,0,0,12779,0,0,0,15693,0,0,0,353143,2246341 +"321",654,161,0,441,230,9,103097,50547,284,634,309,1185,555,1229,5683,370,11053,2091,451,84,1,6877,2,0,314,3299,11787,236,1034,273,2349,0,5628,0,306,0,6,85,179,59,197,1344,2696,370,11,0,0,82,12127,1439,21,68,1795,8,1650,54,49,686,794,6,1286,18,362,1333,1742,548,12,104,2,7070,425,247801,10808,0,0,22157,7,1503,7212,0,0,0,0,0,1,0,0,0,0,0,0,289489 +"327",31,104,3414,808,726,80,143256,1347,23469,3641,2098,2265,394,2591,11058,463,407,1093,4531,40,0,614,1,2533,2058,3038,167,371,84,548,1616,0,21,0,206,0,0,21,102,4,4,3879,1440,31,40,68,0,238,106,1666,0,362,9363,32,1311,474,78,3625,4027,211,955,21,226,158,4051,2692,51,1141,0,3302,4803,257555,28743,0,0,0,0,2232,11968,0,0,0,0,0,0,0,0,0,0,0,0,300498 +"331",150,0,15690,746,276,5,9997,449,2425,115002,120110,57992,6918,25735,71372,10032,4941,7741,2610,131,0,1515,34,18,57,2813,1342,14,0,0,575,0,978,0,0,0,0,231,0,14,23,609,1625,0,0,0,0,1,3903,210,0,0,3110,77,885,445,208,212,42,15,447,41,497,37,235,1298,184,1418,0,151,1011,476595,1993,0,0,0,0,3294,40585,0,0,0,0,0,0,0,0,0,0,0,0,522467 +"332",2203,281,17514,1489,727,1991,174029,4985,2924,6303,53498,33012,8085,14787,36916,16226,6113,5760,21205,648,84,6601,1082,2332,10968,11523,5113,496,461,309,4360,301,550,1682,2574,496,2229,638,1395,1093,74,15082,4271,679,394,0,19,38,3413,4269,47,5125,11539,841,4150,5708,672,518,2585,46,4183,83,1065,2234,5497,8052,6580,2019,302,6482,8035,566987,68505,20142,0,0,0,10510,49054,0,161,0,0,0,233,0,0,0,134,0,0,715726 +"333",2845,73,20753,5163,3013,1041,60974,688,198,1792,6098,46242,389,2922,42528,4407,159,1346,6938,45,2,1167,1782,82,6521,3233,4081,297,213,181,1418,22,75,49,578,94,73,5748,2374,81,56,1697,1946,9,60,831,0,84,335,1992,26,3644,4776,666,6997,7169,2629,1254,1001,180,309,33,290,93,1307,10503,828,562,63,7626,3215,295866,52492,403958,0,0,0,26138,145089,0,3296,0,0,0,134,0,0,0,11793,0,0,938766 +"334",35,1,138,36,87,124,10806,1624,900,2227,7668,9641,52700,6109,29035,28889,1161,2780,3466,519,22,1390,1538,654,6195,3475,58220,1558,768,917,4156,7,104,1,432,6,8,124,248,4754,986,28496,14814,1097,1761,59,752,2,903,378,1993,10278,18444,14908,11187,1437,1516,13400,1118,192,745,47,254,487,308,5244,28584,8442,0,3715,2049,416119,219344,333504,0,466,0,9841,125765,0,24942,0,0,0,4075,0,0,0,6461,0,0,1140517 +"335",7709,141,425,95,800,28,78414,689,152,2244,4332,21615,3023,15695,9875,2151,141,1104,1646,68,2,630,117,254,1552,1767,2255,512,169,1750,733,2,443,35,191,268,3,107,232,10,0,6242,679,170,86,45,0,17,1877,955,0,6064,9049,119,3020,1517,647,17,1639,1123,752,78,612,972,903,7183,2887,6621,74,2226,5430,222382,127086,64380,0,15781,0,6297,42263,0,995,0,0,0,147,0,0,0,822,0,0,480153 +"3361MV",1081,148,2637,1059,361,51,3490,2795,816,1039,2157,16017,1248,831,247481,3618,602,1123,5839,97,1,1773,222,276,1963,1010,12581,9172,3308,720,11700,0,83,0,10194,616,1,149,2131,234,199,1654,837,231,35,0,0,0,0,4455,0,167,5612,815,20682,2217,441,732,2307,159,2665,132,185,223,1963,25422,6676,258,4058,10206,1791,442747,481331,312365,0,0,0,24678,120841,0,18228,0,0,0,17924,0,0,0,49094,0,0,1467207 +"3364OT",0,31,0,1,0,0,40,26,0,0,88,455,0,0,1572,70657,0,0,0,0,0,0,0,0,0,0,0,117,0,0,0,1761,1219,1263,95,118,0,3284,0,0,0,8,0,0,0,0,0,0,0,0,0,0,2256,59,88,111,0,0,0,0,0,0,246,0,0,334,65103,982,3,0,126,150041,60091,68763,0,0,0,4201,94602,0,43216,0,0,0,2815,0,0,0,282,0,0,424012 +"337",0,0,0,0,0,0,35726,486,1,0,0,280,150,2,29,144,4266,294,0,0,0,1,0,0,0,435,1395,220,0,19,2928,0,0,0,0,0,0,0,0,2,0,145,601,0,0,0,0,9881,125,0,16,6,1100,9,5,0,0,395,172,1,343,699,693,3,408,588,0,0,129,16,1868,63579,162998,52310,0,1259,0,3040,5042,0,0,0,0,0,9,0,0,0,1098,0,0,289336 +"339",160,2,105,39,14,0,2218,38,153,49,101,3061,2,754,3521,36,17,10353,66,59,118,0,5,3,443,303,1971,1423,221,12,3701,0,2,0,13,35,0,174,183,6,6,218,152,104,51,24,0,0,557,116,15,51,4172,22,3736,644,470,33846,39842,1032,3372,275,420,56,1552,3796,2471,1141,0,11677,97,139277,386642,80022,0,0,0,4959,50214,0,111,0,0,0,19,0,0,0,886,0,0,662131 +"311FT",52790,408,0,0,0,0,0,53,829,7,0,0,0,0,0,0,0,36,241548,17,391,423,790,1229,10217,299,4421,1,4086,1434,2676,504,1,271,53,0,0,7,0,35,5,0,456,0,0,0,0,0,0,0,0,0,7660,148,1,0,5099,7,7207,5047,21761,1368,7153,8153,116933,1180,3817,149,859,104837,0,614366,1445555,0,0,0,0,9928,97346,0,0,0,0,0,0,0,0,0,0,0,0,2167195 +"313TT",38,32,0,2,0,0,4134,770,346,0,2,940,1,0,4510,1105,3880,1879,138,10822,1671,4270,334,34,3,3567,4447,75,143,6132,2409,0,0,52,36,0,2,40,5,1,432,9,11,0,0,0,0,1,194,443,0,0,705,19,242,292,71,93,529,2997,1863,0,367,2209,640,917,1452,790,7,4786,33,70923,101826,3648,0,3094,0,2158,11326,0,0,0,0,0,16,0,0,0,3,0,0,192993 +"315AL",100,0,0,0,0,0,0,0,0,0,0,0,0,0,2349,0,0,422,18,400,2828,0,1876,3,0,1,938,180,8,392,621,0,0,0,0,0,0,0,0,24,25,1553,0,0,0,0,0,0,0,102,0,0,32,5,249,130,81,51,146,0,272,123,112,39,889,2508,478,171,432,5657,44,23260,524717,0,0,0,0,15950,6456,0,0,0,0,0,0,0,0,0,0,0,0,570383 +"322",500,0,221,189,40,33,5434,1657,2460,2156,2700,2348,698,1657,7442,661,1710,2526,30975,524,15,55514,11200,534,7091,6568,11875,257,1789,638,3076,42,78,3,348,1903,37,2096,330,1786,137,497,411,997,542,1708,1,1,1292,1311,500,903,4674,908,8654,593,284,1638,1922,957,1454,117,261,3548,7746,1239,148,3386,241,21576,61,236821,70152,0,0,0,0,-709,28442,0,0,0,0,0,0,0,0,0,0,0,0,334707 +"323",12,0,15,2,0,14,73,3,0,0,11,4,0,2,5,0,0,0,54,0,0,0,1275,1,158,0,13232,230,215,218,12052,7,10,0,372,98,4,291,18,3745,846,470,5087,1117,1787,3664,0,0,191,646,806,459,7217,1144,3921,20,706,1771,3728,135,1723,701,290,885,1409,1226,512,2043,53,12364,479,87523,9298,0,0,0,0,-1464,2904,0,0,0,0,0,0,0,0,0,0,0,0,98260 +"324",12074,790,14916,5040,1733,29991,73191,1156,854,1886,1010,930,153,680,696,193,329,1179,3133,105,5,1826,776,35346,11787,1127,9586,1500,829,491,4552,53649,7398,5149,56437,4011,323,23387,6456,905,185,1143,1233,5843,5368,133,571,68,8661,3915,84,2428,3801,1378,11118,2494,1602,1083,1939,1056,1378,372,1395,994,7078,3945,22554,2319,2847,191007,41477,705050,509437,0,0,0,0,14793,201136,0,0,0,0,0,0,0,0,0,0,0,0,1430416 +"325",39429,3804,15468,2986,1255,1771,26392,5997,5106,2575,9152,3335,2646,3406,17989,1821,2428,8045,9245,12724,88,10050,4648,69325,281627,100502,4747,164,106,73,2006,2,214,5,412,21,2,95,713,690,460,978,2227,62,115,187,0,780,16142,238,223,501,41932,1735,16632,2556,765,81471,38439,7335,952,444,1371,82,2067,7027,11622,5829,120,66705,4619,964679,733412,2451,0,0,0,14736,258808,0,0,0,0,0,0,0,0,0,0,0,0,1974086 +"326",2349,141,242,1545,596,32,63537,2357,1522,868,3236,13834,2978,2986,33420,3544,4434,6128,26473,544,67,3392,3783,942,14516,28764,33516,1955,2720,818,9593,379,5,0,1639,130,87,2353,486,405,232,7676,1607,61,195,2076,0,31,2413,4432,37,3249,13064,168,4809,774,830,11964,7075,2298,2865,75,428,207,13356,6075,2245,1905,53,23926,5395,395835,102733,724,0,427,0,6982,35148,0,0,0,0,0,11,0,0,0,0,0,0,541860 +"42",1210,12,743,63,0,1719,121,339,380,1203,872,1649,650,1347,3502,26,293,1738,3541,90,17,1224,112,260,4224,3315,46748,2313,782,31,20586,204,0,0,113,0,5,0,0,673,18,2305,79,16,31,32,2,0,0,15043,0,400,0,0,94,45,53,104,33,0,0,0,45,0,73,79,0,0,5,32,0,118590,0,0,0,0,0,0,3208,0,0,0,0,0,0,0,0,0,0,0,0,121798 +"441",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"445",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"452",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"4A0",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,679,0,728,725,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2133,13257,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15390 +"481",0,0,3,8,101,879,297,115,166,144,267,176,19,19,187,41,67,101,252,13,2,122,118,111,131,244,8281,175,71,74,714,508,10,149,5091,55,8,2811,455,411,279,433,1744,4381,2895,80,141,22,9411,1792,678,3281,4908,365,4627,448,539,2195,341,251,596,124,228,141,1868,440,5071,3096,569,3682,63,77081,219527,0,0,0,0,0,38293,0,0,0,0,0,0,0,0,0,0,0,0,334901 +"482",0,0,0,0,0,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,3,3,0,21,0,21,0,5244,0,5,231,6,0,0,66,1,6,3,22,0,0,0,16,9,5,97,1,33,0,0,2,9,0,0,0,0,0,0,3,64,34,738,142,0,6877,1214,0,0,0,0,0,1390,0,0,0,0,0,0,0,0,0,0,0,0,9481 +"483",0,0,0,0,0,18,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,24,6,0,0,0,0,0,0,0,0,8,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,191,24,8,7,42,5,10,0,5,1,0,0,0,7,2078,152,1629,263,0,4493,10942,0,0,0,0,0,5176,0,0,0,0,0,0,0,0,0,0,0,0,20610 +"484",134,0,0,0,60,0,0,73,85,103,307,164,51,53,111,66,69,204,136,41,9,202,53,265,123,224,6256,2412,1526,1020,9861,1639,152,67,18331,138,24,7379,1233,112,80,2,368,0,0,7,1,0,0,531,83,114,1606,6,329,56,23,170,340,23,63,25,5,13,204,164,4410,56,1145,345,16,62870,15774,0,0,0,0,0,1856,0,0,0,0,0,0,0,0,0,0,0,0,80501 +"485",0,2,2,4,56,1673,695,73,100,91,161,110,12,12,114,24,39,77,152,7,1,74,68,67,82,142,1781,120,7,30,256,1,305,0,0,0,3,349,6,279,143,652,1554,3925,1768,1135,82,50,6956,1339,663,2881,5440,263,3740,249,478,2306,3079,686,315,3149,100,110,1545,297,85,13,20,19976,1339,71310,47714,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,119024 +"486",0,0,381,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,381,0,0,0,0,0,0,286,0,0,0,0,0,0,0,0,0,0,0,0,667 +"487OS",0,105,51,459,3,11045,0,875,1010,157,72,19,0,3,11,0,246,169,395,67,0,674,372,1424,184,671,89782,2674,2219,750,26831,34071,1060,3119,86910,1200,840,52542,6711,1684,1242,133,5589,1128,5308,79,0,0,0,7717,824,1438,11696,760,3458,2034,423,2385,5157,382,1308,579,593,107,1430,1154,6,169,1198,1056,4267,390027,24613,0,0,0,0,0,17283,0,0,0,0,0,0,0,0,0,0,0,0,431923 +"493",702,0,15,134,0,885,0,1013,1815,76,567,462,378,87,108,99,99,432,2929,929,125,2626,828,1033,2165,3154,40830,9323,8805,5989,48243,73,1,581,10470,255,117,1396,8112,576,334,443,1852,0,0,23,0,5,403,1115,229,367,1784,14,14565,368,132,774,1590,183,277,219,116,601,1369,731,343,1092,0,8063,144,192568,314,0,0,0,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,193074 +"511",71,1,71,1,5,501,1281,35,1,21,90,49,40,1,36,150,10,42,9,0,0,8,53,13,33,11,5647,576,93,351,1656,25,79,0,61,31,0,768,196,57453,83,790,3863,663,1222,615,36,1,1314,991,1681,2051,7663,598,3910,92,819,1722,2344,152,948,76,110,155,284,671,56,2259,24,11727,465,116847,244582,0,210251,0,0,-386,45768,0,0,6512,0,0,0,7569,0,0,0,17692,0,648835 +"512",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,86,553,411,0,173,7,0,0,5,0,46,28,0,228,42509,59658,462,56,48,0,0,0,126,306,13,80,5386,472,107,0,713,73,26,1295,1722,503,97,915,6438,412,26,1761,58,737,0,125535,26215,0,49060,0,0,-400,20441,0,0,0,0,0,0,0,0,0,0,0,0,220852 +"513",557,14,1023,115,215,1542,6969,271,638,269,849,660,148,128,442,409,156,339,1015,76,20,297,368,96,383,388,14837,2216,935,515,9713,917,94,206,3032,521,814,2072,263,2715,825,100447,18207,4463,4645,2638,524,80,17804,3462,4249,2573,12197,2110,14182,1031,1998,3840,2402,910,755,486,1309,3935,8180,6260,4758,9238,1601,79377,1639,372359,388726,7661,34567,0,0,0,11051,0,0,0,0,0,0,0,0,0,0,0,0,814364 +"514",0,0,123,9,11,7025,3024,918,1301,936,2081,2057,183,510,764,1278,562,910,1709,142,25,1111,389,369,564,598,6871,6245,2331,1844,21725,1057,0,0,342,385,154,1866,342,5587,275,4977,23918,20102,5865,2196,1326,9,2424,2541,6104,7717,26578,2088,50687,2737,5353,2234,4270,431,1098,1518,2012,1184,18428,9431,1553,10571,678,48366,3820,345842,138105,0,69158,0,0,0,7630,0,0,3008,0,0,0,3496,0,0,0,7974,0,575212 +"521CI",3300,641,7906,636,239,11469,11421,343,1347,1247,1719,1383,1730,836,3655,624,503,1305,4413,292,458,932,564,1374,3689,1586,44874,4486,2629,2751,16301,1619,6373,500,2640,3782,5419,2835,369,7533,1679,17956,6143,88365,50328,483,1002,166557,108371,20342,2316,4094,17135,29092,7927,968,1463,5783,6034,1023,1142,891,2389,5433,10901,9265,0,6877,1444,18928,4186,764241,358215,0,0,0,0,0,83677,0,0,0,0,0,0,0,0,0,0,0,0,1206133 +"523",251,12,3132,2301,4656,731,1360,32,48,1865,2007,1681,88,355,2102,411,507,866,74,5,1,24,21,49,19,67,3184,107,291,791,843,1920,691,796,482,1984,200,2112,39,334,711,173,128,93621,60621,3301,78991,10,6599,7322,514,664,3386,14049,1523,38,252,1157,21556,270,4479,1204,91,5698,7704,4841,0,37,13,5454,5034,365875,288208,0,0,0,0,0,84169,0,0,0,0,0,0,0,0,0,0,0,0,738252 +"524",3252,691,5991,820,1372,2936,497,352,1281,895,1223,1763,316,1044,4671,920,475,737,4479,345,66,490,83,568,2714,968,49744,3928,1776,1866,14389,1045,47,607,17657,12887,360,6059,2970,551,2251,2309,1383,8109,15314,420907,7667,4575,54880,14826,2880,3072,14175,493,9180,1454,2690,10409,13688,3054,8275,2510,1855,1296,9043,2956,0,1380,8576,3935,14196,800178,445444,0,0,6151,0,0,23268,0,0,0,0,0,0,0,0,0,0,0,0,1275040 +"525",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2509,2564,0,0,0,0,0,0,57,0,0,0,0,0,0,0,0,0,0,0,0,0,106,0,477,0,5713,160462,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,166175 +"HS",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2615605,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2615605 +"ORE",3903,34,3921,165,378,11390,19249,788,1169,530,5391,2393,4301,795,2143,1497,1253,1924,4461,614,162,1706,2195,178,5272,3154,111059,24466,30673,21775,158557,360,183,844,13733,2940,382,9953,10086,12102,5902,32841,16701,22229,35275,14226,304,6726,220787,20710,23361,12183,82798,41147,54847,5708,42871,54769,91118,32424,18404,15869,25044,3337,87723,78468,489,26489,1228,27081,2605,1579749,6468,0,0,155523,41285,0,3305,0,0,0,0,0,0,0,0,0,0,0,0,1786331 +"532RL",2519,155,10361,2818,2566,4604,32528,307,984,967,2429,1833,539,610,9870,1031,278,1252,4054,105,2094,1250,585,2935,4760,1413,48889,1295,2126,6161,16680,17535,8322,8272,23360,843,81,3789,4755,3455,1602,11864,16785,5128,11553,3681,12,4400,4427,20860,3052,6074,29423,33919,14298,3312,1775,4563,4315,354,618,2711,2313,3199,24585,2786,249,806,264,12373,968,470682,104470,0,0,0,0,0,89726,0,0,0,0,0,0,0,0,0,0,0,0,664879 +"5411",295,113,1691,460,145,8157,7216,458,526,587,2030,1819,4100,298,2744,1420,275,1868,1246,147,78,818,377,766,4770,1251,22577,726,839,816,8260,327,980,194,403,252,80,824,422,5299,1194,3472,7939,5062,12350,9010,835,1744,12957,1557,3280,4922,19592,12101,10582,731,380,4897,17550,1530,990,2527,2222,1230,3149,5273,0,230,81,16108,1412,250562,123013,0,0,40176,0,0,19426,0,0,0,0,0,0,0,0,0,0,0,0,433177 +"5415",389,40,9995,541,51,3299,6399,344,385,379,1641,2035,330,130,749,1709,225,528,1474,91,14,346,447,743,362,616,26962,4474,1104,2050,10441,543,1252,79,1100,460,23,428,438,9618,799,4284,15308,7683,8549,5385,521,820,6503,1150,5009,10614,16154,2531,21140,1137,1897,4277,5374,1164,1949,672,1413,1055,7496,4089,4753,22817,155,34210,5839,296981,0,65188,313581,0,0,0,49018,0,1432,12416,0,0,0,33693,0,0,426,11984,0,784718 +"5412OP",2229,694,8092,1881,1109,21975,68710,2057,2633,3375,5552,5276,7646,1847,7333,4106,1887,4866,11428,786,177,2965,1699,4023,11486,4997,175990,26330,12788,6826,120358,1784,2408,1223,6904,1947,1790,3690,3151,36437,10471,42686,71707,49352,49249,31027,1493,2788,73318,22719,13544,42444,192246,55780,72384,4485,9237,28837,45245,8579,7603,9684,10489,7376,35578,35480,49395,19541,1992,96845,26731,1718759,107540,56832,704504,6112,0,0,219242,0,0,75348,0,0,0,118237,0,0,0,23132,0,3029705 +"55",0,0,61673,6470,2452,143,15240,369,2398,1153,4644,13837,4658,2471,9278,3909,454,4334,22849,885,284,2377,515,5840,17320,1999,143137,2289,5828,15956,43678,3143,9,1097,5164,181,3,7519,1941,5377,692,4812,5113,8027,14002,4361,486,187,20227,15077,5565,5389,19390,52,29894,4809,4022,46500,11216,6288,3035,2678,2501,19415,60865,10625,0,0,231,0,0,726332,0,0,0,0,0,0,4195,0,0,0,0,0,0,0,0,0,0,0,0,730527 +"561",464,51,1086,637,1133,15336,10838,855,1172,4007,8396,3261,2514,623,3734,4986,325,1712,3949,268,347,1684,3004,2982,5320,2108,96600,7108,3752,6234,37717,4764,986,4373,15040,9503,2709,14575,6912,30116,3813,36346,47771,22776,17449,10347,68,3118,160792,45158,12965,42525,82882,21845,133031,8257,5007,27652,54574,11372,4537,9620,4563,5680,16373,20977,5908,17518,717,54887,8962,1218670,81074,0,0,0,0,0,5462,0,0,0,0,0,0,0,0,0,0,0,0,1305206 +"562",160,3,1100,103,69,833,2534,121,214,271,286,194,65,50,189,111,80,101,907,53,1,242,87,653,1126,277,3108,824,420,254,1800,73,157,9,1377,35,229,465,202,60,48,86,92,229,153,1018,141,4,61437,1452,292,397,2704,729,2754,13856,281,1669,2048,627,465,83,508,625,2036,1393,114,751,286,26191,4988,146300,37074,0,0,0,0,0,515,0,0,0,0,0,0,0,0,0,0,0,0,183889 +"61",1,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,497,64,191,0,1677,121,1,0,0,0,0,0,0,0,0,7,0,36,10,0,0,0,0,0,0,0,0,0,306,0,2145,0,5,0,0,3877,390,0,0,2014,0,38,109,11202,5,22698,425875,0,0,0,0,0,5584,0,0,0,0,0,0,0,0,0,0,0,0,454157 +"621",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,158,0,7,0,0,18358,15274,8,1,11,0,0,0,4,0,1980,0,7217,0,43018,1306603,0,0,0,0,0,784,0,0,0,0,0,0,0,0,0,0,0,0,1350405 +"622",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,500,0,0,0,0,0,0,0,0,0,0,0,0,500,1323066,0,0,0,0,0,9524,0,0,0,0,0,0,0,0,0,0,0,0,1333090 +"623",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3967,0,1518,0,5485,284090,0,0,0,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,289767 +"624",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,302549,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,302549 +"711AS",104,0,1,0,18,207,292,38,40,70,89,61,4,6,49,13,17,39,103,5,1,55,45,76,39,121,5661,705,622,107,1457,0,147,0,119,22,0,367,9,288,14698,30685,875,3619,1142,178,144,5,8942,594,756,1739,7980,5130,3293,166,1704,1364,1523,249,1193,30185,884,314,4750,1733,0,37,32,2513,70,137495,97132,0,9215,0,0,0,1527,0,0,0,0,0,0,0,0,0,0,0,0,245369 +"713",67,1,0,1,24,219,466,28,47,35,64,41,4,3,35,10,16,29,59,1,0,29,28,27,29,58,2163,25,138,7,1535,0,1,0,0,0,0,33,3,120,60,140,663,1656,738,77,34,8,0,382,322,1247,1814,2175,1799,110,133,1103,53,101,220,160,331,350,1611,138,2334,19,2,2845,133,26105,244516,0,0,0,0,0,55,0,0,0,0,0,0,0,0,0,0,0,0,270676 +"721",1,0,2,7,89,1183,431,102,155,140,253,177,19,21,187,38,61,122,237,13,2,115,150,105,132,246,3768,35,66,51,433,0,12,0,0,0,9,420,15,531,310,628,2960,7355,3322,336,156,39,12699,1966,1119,5666,7510,931,6133,576,573,3223,245,260,422,127,258,512,3031,516,1492,920,46,3716,178,76555,189009,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,265564 +"722",391,12,35,33,246,2960,687,196,254,277,399,306,30,55,288,77,91,186,477,42,7,229,183,307,217,412,12311,1130,1139,1464,7578,8467,3,13,1644,156,75,2333,412,617,580,778,3399,14356,4414,2195,482,41,48497,6455,2699,9840,25456,5944,15170,695,1662,27435,21569,9356,4782,673,1947,8773,10511,1989,737,389,317,17853,709,295445,1024940,0,0,0,0,0,2543,0,0,0,0,0,0,0,0,0,0,0,0,1322929 +"81",280,70,187,125,187,1586,7395,441,1166,1548,1687,968,517,182,999,470,147,487,2036,132,8,1157,369,1019,2028,1075,25817,2397,2812,2650,11378,405,98,227,13153,2611,442,3161,946,2098,429,4241,2458,4574,4069,3305,67,16279,6612,9682,1047,2666,11232,7574,20242,7064,2226,5468,13201,1502,887,893,1932,1897,14122,9879,3792,17591,593,41114,3510,314609,764303,0,0,0,0,0,97,0,0,0,0,0,0,0,0,0,0,0,0,1079009 +"GFGD",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,726008,0,0,0,0,0,0,0,0,0,0,0,726008 +"GFGN",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,502989,0,0,0,0,0,0,0,502989 +"GFE",8,3,0,3,0,331,8,0,0,33,106,213,47,123,0,0,0,18,0,1,0,0,43,61,36,0,23338,846,678,363,7179,2,0,1430,4007,297,99,974,664,421,337,152,1544,2502,6164,70,0,0,632,2304,286,548,2578,221,1156,139,386,984,2775,226,419,131,94,618,7713,424,1,155,57,2339,103,76387,6676,0,0,0,0,0,543,0,0,0,0,0,0,0,0,0,0,0,0,83606 +"GSLG",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2341080,0,0,0,2341080 +"GSLE",0,1,0,0,0,806,0,58,151,195,208,159,45,35,151,88,39,76,745,49,1,184,60,517,968,180,1957,514,375,196,1362,4,0,0,599,6,94,148,159,66,64,83,114,316,227,46,0,0,3504,1647,459,271,1261,583,1477,1081,113,550,828,388,227,76,216,531,1688,1194,840,854,241,8152,1713,38941,87288,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,126228 +"Used",-18,239,0,0,1330,7375,3334,0,116,45768,783,7,0,0,0,0,0,36,0,34,0,2580,0,0,58,86,0,33,0,0,276,61,0,-183,872,4,117,6037,0,0,108,2,0,0,0,0,0,0,0,27,0,0,0,827,0,0,1490,0,0,0,0,-115,911,0,0,21477,-58,0,0,0,0,93616,313763,-147673,0,-1384,-3774,10356,54501,0,0,0,-4,0,39,0,-38,0,-20483,0,5806,304725 +"Other",715,48,1554,9,148,1647,1800,252,247,692,600,1098,1193,284,1991,382,95,380,1655,100,13,537,216,7956,1804,647,8731,69,508,954,4535,19816,113,1519,1200,9,87,628,113,817,454,6942,876,3183,47679,801,36,148,656,2614,118,2446,3470,1903,1508,64,382,0,0,310,0,356,291,595,2611,2108,9888,2822,5,0,0,157425,-19483,0,15015,0,0,0,146079,0,0,0,0,0,0,0,0,0,0,0,0,299036 +"T005",341192,20636,314792,58937,29898,263142,1044657,111987,84231,233095,265156,260745,111910,92615,586357,172678,50893,80992,846255,35045,9310,134610,44493,718417,490347,212807,1244118,136220,120736,112447,719223,160617,43244,33832,321233,49402,19457,178455,70843,201868,96780,454601,312341,403657,378904,530363,99497,291573,1004296,262892,99187,212421,787493,275344,613552,90677,117100,422898,475070,111181,117049,98392,89206,106921,575259,345305,269654,202064,38929,1151113,278547,20339158,17511743,1327152,1405352,1166365,700472,157306,2600187,726008,92381,97284,12775,502989,25423,162994,15656,2341080,50516,60781,358949,49654571 +"V001",32831,31335,26384,20550,30977,95750,698135,31358,35583,37114,116010,110032,187145,42355,88035,90799,24869,65139,148388,13036,8087,34830,26308,20808,126506,58826,666328,162259,121414,114934,369509,67254,20661,8340,130659,27665,8904,136706,109062,162084,46191,119343,186662,343776,329409,348339,5349,25664,137462,45797,169206,399109,867526,425103,572783,41119,241384,719419,495498,160904,166851,75466,67625,92854,402826,392948,301498,223249,68173,1553722,123019,13455238,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00OTOP",11974,1506,27938,3375,2287,40179,11054,811,1757,2932,3522,4246,9881,1376,4278,3506,461,1936,8253,710,335,2066,865,4324,17123,1949,15891,3522,3618,2673,17518,4430,1659,1018,4995,1068,4233,2844,1000,6077,4403,3709,4935,20710,5609,8303,630,312331,34616,10337,1531,2545,12040,9745,5089,2364,10436,9930,14578,4073,1455,3248,4532,7366,5186,12691,0,0,0,0,0,751580,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00OSUB",17,2,2,2,9,13,76,1,0,0,4,2,1,0,1,0,1,2,1,0,1,0,1,0,1,1,15,34,9,1,42,289,0,2,26,17,0,12,1,4,711,3,2,84,4,8,0,0,31,8,10,8,35,14,12,1,13,7052,3236,544,8510,3347,7,14,52,73,0,0,0,0,0,24370,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"V003",191963,13339,245841,48823,21148,266374,378169,29729,35535,51536,44635,67512,104212,19620,63809,78523,5839,39976,134258,3705,1941,32103,15014,174251,353554,29166,555053,115345,57346,25005,322372,55353,31390,11386,126973,26879,36578,71520,4242,188165,49020,344234,227227,488916,23746,297654,22288,2025649,567472,243852,133737,48944,338385,43433,162445,25296,40324,171730,88998,9714,21032,79009,21442,87291,119047,120275,190944,148857,18630,284838,83487,10606097,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"VABAS",236750,46177,300162,72745,54403,402290,1087281,61897,72874,91582,164164,181788,301237,63350,156121,172827,31168,107049,290897,17450,10362,68998,42186,199383,497183,89941,1237257,281092,182368,142611,709357,126749,53709,20741,262600,55595,49714,211058,114302,356322,98903,467284,418822,853317,358760,654287,28267,2363644,739519,299978,304464,450590,1217916,478267,740304,68778,292130,894028,595839,174147,180828,154377,93591,187497,527007,525842,492441,372106,86803,1838560,206506,24788546,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T018",577943,66813,614954,131683,84301,665432,2131939,173884,157105,324677,429320,442533,413147,155965,742478,345505,82061,188040,1137153,52496,19672,203608,86679,917800,987530,302748,2481375,417312,303105,255058,1428580,287365,96953,54573,583833,104996,69170,389513,185145,558191,195683,921885,731163,1256975,737665,1184650,127764,2655216,1743814,562870,403650,663011,2005409,753610,1353857,159455,409230,1316925,1070909,285328,297878,252769,182798,294418,1102266,871147,762096,574171,125733,2989673,485053,45127704,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00TOP",0,1127,24362,5542,223,35916,2826,180,191,180,729,313,584,194,286,162,60,306,20961,20,18,160,72,535,4228,481,309569,66281,32237,54001,153084,25607,935,242,667,1363,87,437,240,1890,1474,45213,2853,4016,1822,32981,73,0,1998,16566,24470,7433,8481,2138,9061,2445,1321,2387,3720,3828,1583,5677,17580,28334,67569,18591,0,0,0,0,730,1058642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"T00SUB",13234,0,0,0,0,0,0,0,0,0,0,0,0,378,0,0,0,0,0,20,0,0,0,0,24,0,0,0,0,0,0,366,3164,8,0,0,0,0,0,0,0,0,0,588,0,0,0,23155,1605,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,11939,0,48595,103080,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +"VAPRO",223517,47304,324524,78287,54626,438206,1090107,62076,73065,91762,164893,182101,301821,63166,156406,172989,31228,107355,311858,17450,10380,69158,42259,199918,501387,90422,1546826,347373,214606,196612,862441,151989,51481,20976,263268,56957,49801,211495,114542,358213,100377,512497,421675,856745,360583,687269,28341,2340489,739912,316544,328934,458023,1226398,480405,749366,71223,293451,896414,599555,177975,182412,160054,111171,215831,594576,544433,492441,372106,74864,1838560,158641,25744108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/flowsa/data/external_data/Summary_Supply_2017_metadata.json b/flowsa/data/external_data/Summary_Supply_2017_metadata.json new file mode 100644 index 000000000..0107791be --- /dev/null +++ b/flowsa/data/external_data/Summary_Supply_2017_metadata.json @@ -0,0 +1,14 @@ +{ + "tool": ["useeior"], + "name_data": ["Summary_Supply_2017"], + "tool_version": ["1.4.0"], + "ext": ["json"], + "date_created": ["2023-10-12"], + "data_meta": { + "data_year": [2017], + "author": ["US Bureau of Economic Analysis"], + "source_url": ["https://apps.bea.gov/industry/iTables%20Static%20Files/AllTablesSUP.zip"], + "date_last_modified": ["2023-09-13"], + "date_accessed": ["2023-10-12"] + } +} diff --git a/flowsa/data/external_data/Summary_Supply_2018_metadata.json b/flowsa/data/external_data/Summary_Supply_2018_metadata.json new file mode 100644 index 000000000..946686507 --- /dev/null +++ b/flowsa/data/external_data/Summary_Supply_2018_metadata.json @@ -0,0 +1,14 @@ +{ + "tool": ["useeior"], + "name_data": ["Summary_Supply_2018"], + "tool_version": ["1.4.0"], + "ext": ["json"], + "date_created": ["2023-10-12"], + "data_meta": { + "data_year": [2018], + "author": ["US Bureau of Economic Analysis"], + "source_url": ["https://apps.bea.gov/industry/iTables%20Static%20Files/AllTablesSUP.zip"], + "date_last_modified": ["2023-09-13"], + "date_accessed": ["2023-10-12"] + } +} diff --git a/flowsa/data/external_data/Summary_Supply_2019_metadata.json b/flowsa/data/external_data/Summary_Supply_2019_metadata.json new file mode 100644 index 000000000..4900809a2 --- /dev/null +++ b/flowsa/data/external_data/Summary_Supply_2019_metadata.json @@ -0,0 +1,14 @@ +{ + "tool": ["useeior"], + "name_data": ["Summary_Supply_2019"], + "tool_version": ["1.4.0"], + "ext": ["json"], + "date_created": ["2023-10-12"], + "data_meta": { + "data_year": [2019], + "author": ["US Bureau of Economic Analysis"], + "source_url": ["https://apps.bea.gov/industry/iTables%20Static%20Files/AllTablesSUP.zip"], + "date_last_modified": ["2023-09-13"], + "date_accessed": ["2023-10-12"] + } +} diff --git a/flowsa/data/external_data/Summary_Supply_2020_metadata.json b/flowsa/data/external_data/Summary_Supply_2020_metadata.json new file mode 100644 index 000000000..f52a56d9d --- /dev/null +++ b/flowsa/data/external_data/Summary_Supply_2020_metadata.json @@ -0,0 +1,14 @@ +{ + "tool": ["useeior"], + "name_data": ["Summary_Supply_2020"], + "tool_version": ["1.4.0"], + "ext": ["json"], + "date_created": ["2023-10-12"], + "data_meta": { + "data_year": [2020], + "author": ["US Bureau of Economic Analysis"], + "source_url": ["https://apps.bea.gov/industry/iTables%20Static%20Files/AllTablesSUP.zip"], + "date_last_modified": ["2023-09-13"], + "date_accessed": ["2023-10-12"] + } +} diff --git a/flowsa/data/external_data/Summary_Supply_2021_metadata.json b/flowsa/data/external_data/Summary_Supply_2021_metadata.json new file mode 100644 index 000000000..d67387132 --- /dev/null +++ b/flowsa/data/external_data/Summary_Supply_2021_metadata.json @@ -0,0 +1,14 @@ +{ + "tool": ["useeior"], + "name_data": ["Summary_Supply_2021"], + "tool_version": ["1.4.0"], + "ext": ["json"], + "date_created": ["2023-10-12"], + "data_meta": { + "data_year": [2021], + "author": ["US Bureau of Economic Analysis"], + "source_url": ["https://apps.bea.gov/industry/iTables%20Static%20Files/AllTablesSUP.zip"], + "date_last_modified": ["2023-09-13"], + "date_accessed": ["2023-10-12"] + } +} diff --git a/flowsa/data/external_data/Summary_Supply_2022_metadata.json b/flowsa/data/external_data/Summary_Supply_2022_metadata.json new file mode 100644 index 000000000..827115e7a --- /dev/null +++ b/flowsa/data/external_data/Summary_Supply_2022_metadata.json @@ -0,0 +1,14 @@ +{ + "tool": ["useeior"], + "name_data": ["Summary_Supply_2022"], + "tool_version": ["1.4.0"], + "ext": ["json"], + "date_created": ["2023-10-12"], + "data_meta": { + "data_year": [2022], + "author": ["US Bureau of Economic Analysis"], + "source_url": ["https://apps.bea.gov/industry/iTables%20Static%20Files/AllTablesSUP.zip"], + "date_last_modified": ["2023-09-13"], + "date_accessed": ["2023-10-12"] + } +} diff --git a/flowsa/data/external_data/Summary_Use_SUT_2017_metadata.json b/flowsa/data/external_data/Summary_Use_SUT_2017_metadata.json new file mode 100644 index 000000000..c3f140ac1 --- /dev/null +++ b/flowsa/data/external_data/Summary_Use_SUT_2017_metadata.json @@ -0,0 +1,14 @@ +{ + "tool": ["useeior"], + "name_data": ["Summary_Use_SUT_2017"], + "tool_version": ["1.4.0"], + "ext": ["json"], + "date_created": ["2023-10-12"], + "data_meta": { + "data_year": [2017], + "author": ["US Bureau of Economic Analysis"], + "source_url": ["https://apps.bea.gov/industry/iTables%20Static%20Files/AllTablesSUP.zip"], + "date_last_modified": ["2023-09-13"], + "date_accessed": ["2023-10-12"] + } +} diff --git a/flowsa/data/external_data/Summary_Use_SUT_2018_metadata.json b/flowsa/data/external_data/Summary_Use_SUT_2018_metadata.json new file mode 100644 index 000000000..06762ae51 --- /dev/null +++ b/flowsa/data/external_data/Summary_Use_SUT_2018_metadata.json @@ -0,0 +1,14 @@ +{ + "tool": ["useeior"], + "name_data": ["Summary_Use_SUT_2018"], + "tool_version": ["1.4.0"], + "ext": ["json"], + "date_created": ["2023-10-12"], + "data_meta": { + "data_year": [2018], + "author": ["US Bureau of Economic Analysis"], + "source_url": ["https://apps.bea.gov/industry/iTables%20Static%20Files/AllTablesSUP.zip"], + "date_last_modified": ["2023-09-13"], + "date_accessed": ["2023-10-12"] + } +} diff --git a/flowsa/data/external_data/Summary_Use_SUT_2019_metadata.json b/flowsa/data/external_data/Summary_Use_SUT_2019_metadata.json new file mode 100644 index 000000000..c7efbd643 --- /dev/null +++ b/flowsa/data/external_data/Summary_Use_SUT_2019_metadata.json @@ -0,0 +1,14 @@ +{ + "tool": ["useeior"], + "name_data": ["Summary_Use_SUT_2019"], + "tool_version": ["1.4.0"], + "ext": ["json"], + "date_created": ["2023-10-12"], + "data_meta": { + "data_year": [2019], + "author": ["US Bureau of Economic Analysis"], + "source_url": ["https://apps.bea.gov/industry/iTables%20Static%20Files/AllTablesSUP.zip"], + "date_last_modified": ["2023-09-13"], + "date_accessed": ["2023-10-12"] + } +} diff --git a/flowsa/data/external_data/Summary_Use_SUT_2020_metadata.json b/flowsa/data/external_data/Summary_Use_SUT_2020_metadata.json new file mode 100644 index 000000000..92aa79b5c --- /dev/null +++ b/flowsa/data/external_data/Summary_Use_SUT_2020_metadata.json @@ -0,0 +1,14 @@ +{ + "tool": ["useeior"], + "name_data": ["Summary_Use_SUT_2020"], + "tool_version": ["1.4.0"], + "ext": ["json"], + "date_created": ["2023-10-12"], + "data_meta": { + "data_year": [2020], + "author": ["US Bureau of Economic Analysis"], + "source_url": ["https://apps.bea.gov/industry/iTables%20Static%20Files/AllTablesSUP.zip"], + "date_last_modified": ["2023-09-13"], + "date_accessed": ["2023-10-12"] + } +} diff --git a/flowsa/data/external_data/Summary_Use_SUT_2021_metadata.json b/flowsa/data/external_data/Summary_Use_SUT_2021_metadata.json new file mode 100644 index 000000000..2f345a0a2 --- /dev/null +++ b/flowsa/data/external_data/Summary_Use_SUT_2021_metadata.json @@ -0,0 +1,14 @@ +{ + "tool": ["useeior"], + "name_data": ["Summary_Use_SUT_2021"], + "tool_version": ["1.4.0"], + "ext": ["json"], + "date_created": ["2023-10-12"], + "data_meta": { + "data_year": [2021], + "author": ["US Bureau of Economic Analysis"], + "source_url": ["https://apps.bea.gov/industry/iTables%20Static%20Files/AllTablesSUP.zip"], + "date_last_modified": ["2023-09-13"], + "date_accessed": ["2023-10-12"] + } +} diff --git a/flowsa/data/external_data/Summary_Use_SUT_2022_metadata.json b/flowsa/data/external_data/Summary_Use_SUT_2022_metadata.json new file mode 100644 index 000000000..7cd64ff24 --- /dev/null +++ b/flowsa/data/external_data/Summary_Use_SUT_2022_metadata.json @@ -0,0 +1,14 @@ +{ + "tool": ["useeior"], + "name_data": ["Summary_Use_SUT_2022"], + "tool_version": ["1.4.0"], + "ext": ["json"], + "date_created": ["2023-10-12"], + "data_meta": { + "data_year": [2022], + "author": ["US Bureau of Economic Analysis"], + "source_url": ["https://apps.bea.gov/industry/iTables%20Static%20Files/AllTablesSUP.zip"], + "date_last_modified": ["2023-09-13"], + "date_accessed": ["2023-10-12"] + } +} diff --git a/scripts/write_BEA_data_from_useeior.py b/scripts/write_BEA_data_from_useeior.py index cc552bf6a..6436862c3 100644 --- a/scripts/write_BEA_data_from_useeior.py +++ b/scripts/write_BEA_data_from_useeior.py @@ -60,6 +60,29 @@ The metadata file 'BEA_Detail_Supply_2017_metadata.json' was manually copied from useeior/extdata/metadata --- +--- +The BEA_Summary_Supply and BEA_Summary_Supply csvs was pulled from +useeior @a89af7c5adff70ea743e4aab783cfa924a53c0bd using this code + +load_all() +for (y in 2017:2022) { + + name <- paste0('Summary_Supply_',y) + S <- get(name) + write.csv(S,paste0("BEA_",name,".csv")) + + # name <- paste0('Summary_Use_SUT_',y) +# S <- get(name) + # write.csv(S,paste0("BEA_",name,".csv")) + +} + +The original files are found here: +https://github.com/USEPA/useeior/blob/a89af7c5adff70ea743e4aab783cfa924a53c0bd/data/ + +The metadata were manually copied from useeior/extdata/metadata +--- + --- The BEA_Detail_GrossOutput was pulled from USEEIOR's Detail_GrossOutput_IO.rda on 09/06/2023. From dc55b74ca6db36e439adfbef94b2235598b1129f Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 12 Oct 2023 15:19:44 -0400 Subject: [PATCH 1026/1127] initial draft 2017 BEA crosswalk from https://github.com/USEPA/useeior/commit/b9b32cd8f4fed8506a97f05bd108e80fc63b045e --- flowsa/data/NAICS_to_BEA_Crosswalk_2017.csv | 4096 +++++++++++++++++++ scripts/write_NAICS_from_useeior.py | 8 +- 2 files changed, 4100 insertions(+), 4 deletions(-) create mode 100644 flowsa/data/NAICS_to_BEA_Crosswalk_2017.csv diff --git a/flowsa/data/NAICS_to_BEA_Crosswalk_2017.csv b/flowsa/data/NAICS_to_BEA_Crosswalk_2017.csv new file mode 100644 index 000000000..c6ba49ded --- /dev/null +++ b/flowsa/data/NAICS_to_BEA_Crosswalk_2017.csv @@ -0,0 +1,4096 @@ +BEA_2017_Sector_Code,BEA_2017_Summary_Code,BEA_2017_Detail_Code,NAICS_2017_Code,NAICS_2012_Code +11,111CA,1111A0,11,11 +11,111CA,1111B0,11,11 +11,111CA,111200,11,11 +11,111CA,111300,11,11 +11,111CA,111400,11,11 +11,111CA,111900,11,11 +11,111CA,112120,11,11 +11,111CA,1121A0,11,11 +11,111CA,112300,11,11 +11,111CA,112A00,11,11 +11,113FF,113000,11,11 +11,113FF,114000,11,11 +11,113FF,115000,11,11 +11,111CA,1111A0,111,111 +11,111CA,1111B0,111,111 +11,111CA,111200,111,111 +11,111CA,111300,111,111 +11,111CA,111400,111,111 +11,111CA,111900,111,111 +11,111CA,1111A0,1111,1111 +11,111CA,1111B0,1111,1111 +11,111CA,1111A0,11111,11111 +11,111CA,1111A0,111110,111110 +11,111CA,1111A0,11112,11112 +11,111CA,1111A0,111120,111120 +11,111CA,1111B0,11113,11113 +11,111CA,1111B0,111130,111130 +11,111CA,1111B0,11114,11114 +11,111CA,1111B0,111140,111140 +11,111CA,1111B0,11115,11115 +11,111CA,1111B0,111150,111150 +11,111CA,1111B0,11116,11116 +11,111CA,1111B0,111160,111160 +11,111CA,1111B0,11119,11119 +11,111CA,1111B0,111191,111191 +11,111CA,1111B0,111199,111199 +11,111CA,111200,1112,1112 +11,111CA,111200,11121,11121 +11,111CA,111200,111211,111211 +11,111CA,111200,111219,111219 +11,111CA,111300,1113,1113 +11,111CA,111300,11131,11131 +11,111CA,111300,111310,111310 +11,111CA,111300,11132,11132 +11,111CA,111300,111320,111320 +11,111CA,111300,11133,11133 +11,111CA,111300,111331,111331 +11,111CA,111300,111332,111332 +11,111CA,111300,111333,111333 +11,111CA,111300,111334,111334 +11,111CA,111300,111335,111335 +11,111CA,111300,111336,111336 +11,111CA,111300,111339,111339 +11,111CA,111400,1114,1114 +11,111CA,111400,11141,11141 +11,111CA,111400,111411,111411 +11,111CA,111400,111419,111419 +11,111CA,111400,11142,11142 +11,111CA,111400,111421,111421 +11,111CA,111400,111422,111422 +11,111CA,111900,1119,1119 +11,111CA,111900,11191,11191 +11,111CA,111900,111910,111910 +11,111CA,111900,11192,11192 +11,111CA,111900,111920,111920 +11,111CA,111900,11193,11193 +11,111CA,111900,111930,111930 +11,111CA,111900,11194,11194 +11,111CA,111900,111940,111940 +11,111CA,111900,11199,11199 +11,111CA,111900,111991,111991 +11,111CA,111900,111992,111992 +11,111CA,111900,111998,111998 +11,111CA,112120,112,112 +11,111CA,1121A0,112,112 +11,111CA,112300,112,112 +11,111CA,112A00,112,112 +11,111CA,112120,1121,1121 +11,111CA,1121A0,1121,1121 +11,111CA,1121A0,11211,11211 +11,111CA,1121A0,112111,112111 +11,111CA,1121A0,112112,112112 +11,111CA,112120,11212,11212 +11,111CA,112120,112120,112120 +11,111CA,1121A0,11213,11213 +11,111CA,1121A0,112130,112130 +11,111CA,112A00,1122,1122 +11,111CA,112A00,11221,11221 +11,111CA,112A00,112210,112210 +11,111CA,112300,1123,1123 +11,111CA,112300,11231,11231 +11,111CA,112300,112310,112310 +11,111CA,112300,11232,11232 +11,111CA,112300,112320,112320 +11,111CA,112300,11233,11233 +11,111CA,112300,112330,112330 +11,111CA,112300,11234,11234 +11,111CA,112300,112340,112340 +11,111CA,112300,11239,11239 +11,111CA,112300,112390,112390 +11,111CA,112A00,1124,1124 +11,111CA,112A00,11241,11241 +11,111CA,112A00,112410,112410 +11,111CA,112A00,11242,11242 +11,111CA,112A00,112420,112420 +11,111CA,112A00,1125,1125 +11,111CA,112A00,11251,11251 +11,111CA,112A00,112511,112511 +11,111CA,112A00,112512,112512 +11,111CA,112A00,112519,112519 +11,111CA,112A00,1129,1129 +11,111CA,112A00,11291,11291 +11,111CA,112A00,112910,112910 +11,111CA,112A00,11292,11292 +11,111CA,112A00,112920,112920 +11,111CA,112A00,11293,11293 +11,111CA,112A00,112930,112930 +11,111CA,112A00,11299,11299 +11,111CA,112A00,112990,112990 +11,113FF,113000,113,113 +11,113FF,113000,1131,1131 +11,113FF,113000,11311,11311 +11,113FF,113000,113110,113110 +11,113FF,113000,1132,1132 +11,113FF,113000,11321,11321 +11,113FF,113000,113210,113210 +11,113FF,113000,1133,1133 +11,113FF,113000,11331,11331 +11,113FF,113000,113310,113310 +11,113FF,114000,114,114 +11,113FF,114000,1141,1141 +11,113FF,114000,11411,11411 +11,113FF,114000,114111,114111 +11,113FF,114000,114112,114112 +11,113FF,114000,114119,114119 +11,113FF,114000,1142,1142 +11,113FF,114000,11421,11421 +11,113FF,114000,114210,114210 +11,113FF,115000,115,115 +11,113FF,115000,1151,1151 +11,113FF,115000,11511,11511 +11,113FF,115000,115111,115111 +11,113FF,115000,115112,115112 +11,113FF,115000,115113,115113 +11,113FF,115000,115114,115114 +11,113FF,115000,115115,115115 +11,113FF,115000,115116,115116 +11,113FF,115000,1152,1152 +11,113FF,115000,11521,11521 +11,113FF,115000,115210,115210 +11,113FF,115000,1153,1153 +11,113FF,115000,11531,11531 +11,113FF,115000,115310,115310 +21,211,211000,21,21 +21,212,212100,21,21 +21,212,212230,21,21 +21,212,2122A0,21,21 +21,212,212310,21,21 +21,212,2123A0,21,21 +21,213,213111,21,21 +21,213,21311A,21,21 +21,211,211000,211,211 +21,211,211000,2111,2111 +21,211,211000,21112,21111 +21,211,211000,211120,211111 +21,211,211000,21113,21111 +21,211,211000,211130,211111 +21,211,211000,211130,211112 +21,212,212100,212,212 +21,212,212230,212,212 +21,212,2122A0,212,212 +21,212,212310,212,212 +21,212,2123A0,212,212 +21,212,212100,2121,2121 +21,212,212100,21211,21211 +21,212,212100,212111,212111 +21,212,212100,212112,212112 +21,212,212100,212113,212113 +21,212,212230,2122,2122 +21,212,2122A0,2122,2122 +21,212,2122A0,21221,21221 +21,212,2122A0,212210,212210 +21,212,2122A0,21222,21222 +21,212,2122A0,212221,212221 +21,212,2122A0,212222,212222 +21,212,212230,21223,21223 +21,212,212230,212230,212231 +21,212,212230,212230,212234 +21,212,2122A0,21229,21229 +21,212,2122A0,212291,212291 +21,212,2122A0,212299,212299 +21,212,212310,2123,2123 +21,212,2123A0,2123,2123 +21,212,212310,21231,21231 +21,212,212310,212311,212311 +21,212,212310,212312,212312 +21,212,212310,212313,212313 +21,212,212310,212319,212319 +21,212,2123A0,21232,21232 +21,212,2123A0,212321,212321 +21,212,2123A0,212322,212322 +21,212,2123A0,212324,212324 +21,212,2123A0,212325,212325 +21,212,2123A0,21239,21239 +21,212,2123A0,212391,212391 +21,212,2123A0,212392,212392 +21,212,2123A0,212393,212393 +21,212,2123A0,212399,212399 +21,213,213111,213,213 +21,213,21311A,213,213 +21,213,213111,2131,2131 +21,213,21311A,2131,2131 +21,213,213111,21311,21311 +21,213,21311A,21311,21311 +21,213,213111,213111,213111 +21,213,21311A,213112,213112 +21,213,21311A,213113,213113 +21,213,21311A,213114,213114 +21,213,21311A,213115,213115 +22,22,221100,22,22 +22,22,221200,22,22 +22,22,221300,22,22 +22,22,221100,221,221 +22,22,221200,221,221 +22,22,221300,221,221 +22,22,221100,2211,2211 +22,22,221100,22111,22111 +22,22,221100,221111,221111 +22,22,221100,221112,221112 +22,22,221100,221113,221113 +22,22,221100,221114,221114 +22,22,221100,221115,221115 +22,22,221100,221116,221116 +22,22,221100,221117,221117 +22,22,221100,221118,221118 +22,22,221100,22112,22112 +22,22,221100,221121,221121 +22,22,221100,221122,221122 +22,22,221200,2212,2212 +22,22,221200,22121,22121 +22,22,221200,221210,221210 +22,22,221300,2213,2213 +22,22,221300,22131,22131 +22,22,221300,221310,221310 +22,22,221300,22132,22132 +22,22,221300,221320,221320 +22,22,221300,22133,22133 +22,22,221300,221330,221330 +23,23,230301,23,23 +23,23,230302,23,23 +23,23,233210,23,23 +23,23,233230,23,23 +23,23,233240,23,23 +23,23,233262,23,23 +23,23,2332A0,23,23 +23,23,2332C0,23,23 +23,23,2332D0,23,23 +23,23,233411,23,23 +23,23,233412,23,23 +23,23,2334A0,23,23 +23,23,230301,236,236 +23,23,230302,236,236 +23,23,233210,236,236 +23,23,233230,236,236 +23,23,233262,236,236 +23,23,2332A0,236,236 +23,23,2332D0,236,236 +23,23,233411,236,236 +23,23,233412,236,236 +23,23,2334A0,236,236 +23,23,230302,2361,2361 +23,23,233411,2361,2361 +23,23,233412,2361,2361 +23,23,2334A0,2361,2361 +23,23,230302,23611,23611 +23,23,233411,23611,23611 +23,23,233412,23611,23611 +23,23,2334A0,23611,23611 +23,23,233411,236115,236115 +23,23,233412,236116,236116 +23,23,233411,236117,236117 +23,23,233412,236117,236117 +23,23,2334A0,236117,236117 +23,23,230302,236118,236118 +23,23,230301,2362,2362 +23,23,233210,2362,2362 +23,23,233230,2362,2362 +23,23,233262,2362,2362 +23,23,2332A0,2362,2362 +23,23,2332D0,2362,2362 +23,23,230301,23621,23621 +23,23,233230,23621,23621 +23,23,230301,236210,236210 +23,23,233230,236210,236210 +23,23,230301,23622,23622 +23,23,233210,23622,23622 +23,23,233262,23622,23622 +23,23,2332A0,23622,23622 +23,23,230301,236220,236220 +23,23,233210,236220,236220 +23,23,233262,236220,236220 +23,23,2332A0,236220,236220 +23,23,233240,237,237 +23,23,2332C0,237,237 +23,23,2332D0,237,237 +23,23,233240,2371,2371 +23,23,233240,23711,23711 +23,23,233240,237110,237110 +23,23,233240,23712,23712 +23,23,233240,237120,237120 +23,23,233240,23713,23713 +23,23,233240,237130,237130 +23,23,233210,2372,2372 +23,23,233230,2372,2372 +23,23,233240,2372,2372 +23,23,233262,2372,2372 +23,23,2332A0,2372,2372 +23,23,2332C0,2372,2372 +23,23,2332D0,2372,2372 +23,23,233411,2372,2372 +23,23,233412,2372,2372 +23,23,2334A0,2372,2372 +23,23,233210,23721,23721 +23,23,233230,23721,23721 +23,23,233240,23721,23721 +23,23,233262,23721,23721 +23,23,2332A0,23721,23721 +23,23,2332C0,23721,23721 +23,23,2332D0,23721,23721 +23,23,233411,23721,23721 +23,23,233412,23721,23721 +23,23,2334A0,23721,23721 +23,23,233210,237210,237210 +23,23,233230,237210,237210 +23,23,233240,237210,237210 +23,23,233262,237210,237210 +23,23,2332A0,237210,237210 +23,23,2332C0,237210,237210 +23,23,2332D0,237210,237210 +23,23,233411,237210,237210 +23,23,233412,237210,237210 +23,23,2334A0,237210,237210 +23,23,2332C0,2373,2373 +23,23,2332C0,23731,23731 +23,23,2332C0,237310,237310 +23,23,2332D0,2379,2379 +23,23,2332D0,23799,23799 +23,23,2332D0,237990,237990 +23,23,230301,238,238 +23,23,230302,238,238 +23,23,233210,238,238 +23,23,233230,238,238 +23,23,233240,238,238 +23,23,233262,238,238 +23,23,2332A0,238,238 +23,23,2332D0,238,238 +23,23,2332D0,238,238 +23,23,233411,238,238 +23,23,233412,238,238 +23,23,2334A0,238,238 +23,23,230301,2381,2381 +23,23,230302,2381,2381 +23,23,233210,2381,2381 +23,23,233230,2381,2381 +23,23,233240,2381,2381 +23,23,233262,2381,2381 +23,23,2332A0,2381,2381 +23,23,2332D0,2381,2381 +23,23,2332D0,2381,2381 +23,23,233411,2381,2381 +23,23,233412,2381,2381 +23,23,2334A0,2381,2381 +23,23,230301,23811,23811 +23,23,230302,23811,23811 +23,23,233210,23811,23811 +23,23,233230,23811,23811 +23,23,233240,23811,23811 +23,23,233262,23811,23811 +23,23,2332A0,23811,23811 +23,23,2332D0,23811,23811 +23,23,2332D0,23811,23811 +23,23,233411,23811,23811 +23,23,233412,23811,23811 +23,23,2334A0,23811,23811 +23,23,230301,238110,238110 +23,23,230302,238110,238110 +23,23,233210,238110,238110 +23,23,233230,238110,238110 +23,23,233240,238110,238110 +23,23,233262,238110,238110 +23,23,2332A0,238110,238110 +23,23,2332D0,238110,238110 +23,23,2332D0,238110,238110 +23,23,233411,238110,238110 +23,23,233412,238110,238110 +23,23,2334A0,238110,238110 +23,23,230301,23812,23812 +23,23,230302,23812,23812 +23,23,233210,23812,23812 +23,23,233230,23812,23812 +23,23,233240,23812,23812 +23,23,233262,23812,23812 +23,23,2332A0,23812,23812 +23,23,2332D0,23812,23812 +23,23,2332D0,23812,23812 +23,23,233411,23812,23812 +23,23,233412,23812,23812 +23,23,2334A0,23812,23812 +23,23,230301,238120,238120 +23,23,230302,238120,238120 +23,23,233210,238120,238120 +23,23,233230,238120,238120 +23,23,233240,238120,238120 +23,23,233262,238120,238120 +23,23,2332A0,238120,238120 +23,23,2332D0,238120,238120 +23,23,2332D0,238120,238120 +23,23,233411,238120,238120 +23,23,233412,238120,238120 +23,23,2334A0,238120,238120 +23,23,230301,23813,23813 +23,23,230302,23813,23813 +23,23,233210,23813,23813 +23,23,233230,23813,23813 +23,23,233240,23813,23813 +23,23,233262,23813,23813 +23,23,2332A0,23813,23813 +23,23,2332D0,23813,23813 +23,23,2332D0,23813,23813 +23,23,233411,23813,23813 +23,23,233412,23813,23813 +23,23,2334A0,23813,23813 +23,23,230301,238130,238130 +23,23,230302,238130,238130 +23,23,233210,238130,238130 +23,23,233230,238130,238130 +23,23,233240,238130,238130 +23,23,233262,238130,238130 +23,23,2332A0,238130,238130 +23,23,2332D0,238130,238130 +23,23,2332D0,238130,238130 +23,23,233411,238130,238130 +23,23,233412,238130,238130 +23,23,2334A0,238130,238130 +23,23,230301,23814,23814 +23,23,230302,23814,23814 +23,23,233210,23814,23814 +23,23,233230,23814,23814 +23,23,233240,23814,23814 +23,23,233262,23814,23814 +23,23,2332A0,23814,23814 +23,23,2332D0,23814,23814 +23,23,2332D0,23814,23814 +23,23,233411,23814,23814 +23,23,233412,23814,23814 +23,23,2334A0,23814,23814 +23,23,230301,238140,238140 +23,23,230302,238140,238140 +23,23,233210,238140,238140 +23,23,233230,238140,238140 +23,23,233240,238140,238140 +23,23,233262,238140,238140 +23,23,2332A0,238140,238140 +23,23,2332D0,238140,238140 +23,23,2332D0,238140,238140 +23,23,233411,238140,238140 +23,23,233412,238140,238140 +23,23,2334A0,238140,238140 +23,23,230301,23815,23815 +23,23,230302,23815,23815 +23,23,233210,23815,23815 +23,23,233230,23815,23815 +23,23,233240,23815,23815 +23,23,233262,23815,23815 +23,23,2332A0,23815,23815 +23,23,2332D0,23815,23815 +23,23,2332D0,23815,23815 +23,23,233411,23815,23815 +23,23,233412,23815,23815 +23,23,2334A0,23815,23815 +23,23,230301,238150,238150 +23,23,230302,238150,238150 +23,23,233210,238150,238150 +23,23,233230,238150,238150 +23,23,233240,238150,238150 +23,23,233262,238150,238150 +23,23,2332A0,238150,238150 +23,23,2332D0,238150,238150 +23,23,2332D0,238150,238150 +23,23,233411,238150,238150 +23,23,233412,238150,238150 +23,23,2334A0,238150,238150 +23,23,230301,23816,23816 +23,23,230302,23816,23816 +23,23,233210,23816,23816 +23,23,233230,23816,23816 +23,23,233240,23816,23816 +23,23,233262,23816,23816 +23,23,2332A0,23816,23816 +23,23,2332D0,23816,23816 +23,23,2332D0,23816,23816 +23,23,233411,23816,23816 +23,23,233412,23816,23816 +23,23,2334A0,23816,23816 +23,23,230301,238160,238160 +23,23,230302,238160,238160 +23,23,233210,238160,238160 +23,23,233230,238160,238160 +23,23,233240,238160,238160 +23,23,233262,238160,238160 +23,23,2332A0,238160,238160 +23,23,2332D0,238160,238160 +23,23,2332D0,238160,238160 +23,23,233411,238160,238160 +23,23,233412,238160,238160 +23,23,2334A0,238160,238160 +23,23,230301,23817,23817 +23,23,230302,23817,23817 +23,23,233210,23817,23817 +23,23,233230,23817,23817 +23,23,233240,23817,23817 +23,23,233262,23817,23817 +23,23,2332A0,23817,23817 +23,23,2332D0,23817,23817 +23,23,2332D0,23817,23817 +23,23,233411,23817,23817 +23,23,233412,23817,23817 +23,23,2334A0,23817,23817 +23,23,230301,238170,238170 +23,23,230302,238170,238170 +23,23,233210,238170,238170 +23,23,233230,238170,238170 +23,23,233240,238170,238170 +23,23,233262,238170,238170 +23,23,2332A0,238170,238170 +23,23,2332D0,238170,238170 +23,23,2332D0,238170,238170 +23,23,233411,238170,238170 +23,23,233412,238170,238170 +23,23,2334A0,238170,238170 +23,23,230301,23819,23819 +23,23,230302,23819,23819 +23,23,233210,23819,23819 +23,23,233230,23819,23819 +23,23,233240,23819,23819 +23,23,233262,23819,23819 +23,23,2332A0,23819,23819 +23,23,2332D0,23819,23819 +23,23,2332D0,23819,23819 +23,23,233411,23819,23819 +23,23,233412,23819,23819 +23,23,2334A0,23819,23819 +23,23,230301,238190,238190 +23,23,230302,238190,238190 +23,23,233210,238190,238190 +23,23,233230,238190,238190 +23,23,233240,238190,238190 +23,23,233262,238190,238190 +23,23,2332A0,238190,238190 +23,23,2332D0,238190,238190 +23,23,2332D0,238190,238190 +23,23,233411,238190,238190 +23,23,233412,238190,238190 +23,23,2334A0,238190,238190 +23,23,230301,2382,2382 +23,23,230302,2382,2382 +23,23,233210,2382,2382 +23,23,233230,2382,2382 +23,23,233240,2382,2382 +23,23,233262,2382,2382 +23,23,2332A0,2382,2382 +23,23,2332D0,2382,2382 +23,23,2332D0,2382,2382 +23,23,233411,2382,2382 +23,23,233412,2382,2382 +23,23,2334A0,2382,2382 +23,23,230301,23821,23821 +23,23,230302,23821,23821 +23,23,233210,23821,23821 +23,23,233230,23821,23821 +23,23,233240,23821,23821 +23,23,233262,23821,23821 +23,23,2332A0,23821,23821 +23,23,2332D0,23821,23821 +23,23,2332D0,23821,23821 +23,23,233411,23821,23821 +23,23,233412,23821,23821 +23,23,2334A0,23821,23821 +23,23,230301,238210,238210 +23,23,230302,238210,238210 +23,23,233210,238210,238210 +23,23,233230,238210,238210 +23,23,233240,238210,238210 +23,23,233262,238210,238210 +23,23,2332A0,238210,238210 +23,23,2332D0,238210,238210 +23,23,2332D0,238210,238210 +23,23,233411,238210,238210 +23,23,233412,238210,238210 +23,23,2334A0,238210,238210 +23,23,230301,23822,23822 +23,23,230302,23822,23822 +23,23,233210,23822,23822 +23,23,233230,23822,23822 +23,23,233240,23822,23822 +23,23,233262,23822,23822 +23,23,2332A0,23822,23822 +23,23,2332D0,23822,23822 +23,23,2332D0,23822,23822 +23,23,233411,23822,23822 +23,23,233412,23822,23822 +23,23,2334A0,23822,23822 +23,23,230301,238220,238220 +23,23,230302,238220,238220 +23,23,233210,238220,238220 +23,23,233230,238220,238220 +23,23,233240,238220,238220 +23,23,233262,238220,238220 +23,23,2332A0,238220,238220 +23,23,2332D0,238220,238220 +23,23,2332D0,238220,238220 +23,23,233411,238220,238220 +23,23,233412,238220,238220 +23,23,2334A0,238220,238220 +23,23,230301,23829,23829 +23,23,230302,23829,23829 +23,23,233210,23829,23829 +23,23,233230,23829,23829 +23,23,233240,23829,23829 +23,23,233262,23829,23829 +23,23,2332A0,23829,23829 +23,23,2332D0,23829,23829 +23,23,2332D0,23829,23829 +23,23,233411,23829,23829 +23,23,233412,23829,23829 +23,23,2334A0,23829,23829 +23,23,230301,238290,238290 +23,23,230302,238290,238290 +23,23,233210,238290,238290 +23,23,233230,238290,238290 +23,23,233240,238290,238290 +23,23,233262,238290,238290 +23,23,2332A0,238290,238290 +23,23,2332D0,238290,238290 +23,23,2332D0,238290,238290 +23,23,233411,238290,238290 +23,23,233412,238290,238290 +23,23,2334A0,238290,238290 +23,23,230301,2383,2383 +23,23,230301,2383,2383 +23,23,230302,2383,2383 +23,23,230302,2383,2383 +23,23,233210,2383,2383 +23,23,233210,2383,2383 +23,23,233230,2383,2383 +23,23,233230,2383,2383 +23,23,233240,2383,2383 +23,23,233240,2383,2383 +23,23,233262,2383,2383 +23,23,233262,2383,2383 +23,23,2332A0,2383,2383 +23,23,2332A0,2383,2383 +23,23,2332D0,2383,2383 +23,23,2332D0,2383,2383 +23,23,2332D0,2383,2383 +23,23,2332D0,2383,2383 +23,23,233411,2383,2383 +23,23,233411,2383,2383 +23,23,233412,2383,2383 +23,23,233412,2383,2383 +23,23,2334A0,2383,2383 +23,23,2334A0,2383,2383 +23,23,230301,23831,23831 +23,23,230301,23831,23831 +23,23,230301,23831,23831 +23,23,230302,23831,23831 +23,23,230302,23831,23831 +23,23,230302,23831,23831 +23,23,233210,23831,23831 +23,23,233210,23831,23831 +23,23,233210,23831,23831 +23,23,233230,23831,23831 +23,23,233230,23831,23831 +23,23,233230,23831,23831 +23,23,233240,23831,23831 +23,23,233240,23831,23831 +23,23,233240,23831,23831 +23,23,233262,23831,23831 +23,23,233262,23831,23831 +23,23,233262,23831,23831 +23,23,2332A0,23831,23831 +23,23,2332A0,23831,23831 +23,23,2332A0,23831,23831 +23,23,2332D0,23831,23831 +23,23,2332D0,23831,23831 +23,23,2332D0,23831,23831 +23,23,2332D0,23831,23831 +23,23,2332D0,23831,23831 +23,23,2332D0,23831,23831 +23,23,233411,23831,23831 +23,23,233411,23831,23831 +23,23,233411,23831,23831 +23,23,233412,23831,23831 +23,23,233412,23831,23831 +23,23,233412,23831,23831 +23,23,2334A0,23831,23831 +23,23,2334A0,23831,23831 +23,23,2334A0,23831,23831 +23,23,230301,238310,238310 +23,23,230301,238310,238310 +23,23,230301,238310,238310 +23,23,230302,238310,238310 +23,23,230302,238310,238310 +23,23,230302,238310,238310 +23,23,233210,238310,238310 +23,23,233210,238310,238310 +23,23,233210,238310,238310 +23,23,233230,238310,238310 +23,23,233230,238310,238310 +23,23,233230,238310,238310 +23,23,233240,238310,238310 +23,23,233240,238310,238310 +23,23,233240,238310,238310 +23,23,233262,238310,238310 +23,23,233262,238310,238310 +23,23,233262,238310,238310 +23,23,2332A0,238310,238310 +23,23,2332A0,238310,238310 +23,23,2332A0,238310,238310 +23,23,2332D0,238310,238310 +23,23,2332D0,238310,238310 +23,23,2332D0,238310,238310 +23,23,2332D0,238310,238310 +23,23,2332D0,238310,238310 +23,23,2332D0,238310,238310 +23,23,233411,238310,238310 +23,23,233411,238310,238310 +23,23,233411,238310,238310 +23,23,233412,238310,238310 +23,23,233412,238310,238310 +23,23,233412,238310,238310 +23,23,2334A0,238310,238310 +23,23,2334A0,238310,238310 +23,23,2334A0,238310,238310 +23,23,230301,23832,23832 +23,23,230302,23832,23832 +23,23,233210,23832,23832 +23,23,233230,23832,23832 +23,23,233240,23832,23832 +23,23,233262,23832,23832 +23,23,2332A0,23832,23832 +23,23,2332D0,23832,23832 +23,23,2332D0,23832,23832 +23,23,233411,23832,23832 +23,23,233412,23832,23832 +23,23,2334A0,23832,23832 +23,23,230301,238320,238320 +23,23,230302,238320,238320 +23,23,233210,238320,238320 +23,23,233230,238320,238320 +23,23,233240,238320,238320 +23,23,233262,238320,238320 +23,23,2332A0,238320,238320 +23,23,2332D0,238320,238320 +23,23,2332D0,238320,238320 +23,23,233411,238320,238320 +23,23,233412,238320,238320 +23,23,2334A0,238320,238320 +23,23,230301,23833,23833 +23,23,230302,23833,23833 +23,23,233210,23833,23833 +23,23,233230,23833,23833 +23,23,233240,23833,23833 +23,23,233262,23833,23833 +23,23,2332A0,23833,23833 +23,23,2332D0,23833,23833 +23,23,2332D0,23833,23833 +23,23,233411,23833,23833 +23,23,233412,23833,23833 +23,23,2334A0,23833,23833 +23,23,230301,238330,238330 +23,23,230302,238330,238330 +23,23,233210,238330,238330 +23,23,233230,238330,238330 +23,23,233240,238330,238330 +23,23,233262,238330,238330 +23,23,2332A0,238330,238330 +23,23,2332D0,238330,238330 +23,23,2332D0,238330,238330 +23,23,233411,238330,238330 +23,23,233412,238330,238330 +23,23,2334A0,238330,238330 +23,23,230301,23834,23834 +23,23,230302,23834,23834 +23,23,233210,23834,23834 +23,23,233230,23834,23834 +23,23,233240,23834,23834 +23,23,233262,23834,23834 +23,23,2332A0,23834,23834 +23,23,2332D0,23834,23834 +23,23,2332D0,23834,23834 +23,23,233411,23834,23834 +23,23,233412,23834,23834 +23,23,2334A0,23834,23834 +23,23,230301,238340,238340 +23,23,230302,238340,238340 +23,23,233210,238340,238340 +23,23,233230,238340,238340 +23,23,233240,238340,238340 +23,23,233262,238340,238340 +23,23,2332A0,238340,238340 +23,23,2332D0,238340,238340 +23,23,2332D0,238340,238340 +23,23,233411,238340,238340 +23,23,233412,238340,238340 +23,23,2334A0,238340,238340 +23,23,230301,23835,23835 +23,23,230302,23835,23835 +23,23,233210,23835,23835 +23,23,233230,23835,23835 +23,23,233240,23835,23835 +23,23,233262,23835,23835 +23,23,2332A0,23835,23835 +23,23,2332D0,23835,23835 +23,23,2332D0,23835,23835 +23,23,233411,23835,23835 +23,23,233412,23835,23835 +23,23,2334A0,23835,23835 +23,23,230301,238350,238350 +23,23,230302,238350,238350 +23,23,233210,238350,238350 +23,23,233230,238350,238350 +23,23,233240,238350,238350 +23,23,233262,238350,238350 +23,23,2332A0,238350,238350 +23,23,2332D0,238350,238350 +23,23,2332D0,238350,238350 +23,23,233411,238350,238350 +23,23,233412,238350,238350 +23,23,2334A0,238350,238350 +23,23,230301,23839,23839 +23,23,230302,23839,23839 +23,23,233210,23839,23839 +23,23,233230,23839,23839 +23,23,233240,23839,23839 +23,23,233262,23839,23839 +23,23,2332A0,23839,23839 +23,23,2332D0,23839,23839 +23,23,2332D0,23839,23839 +23,23,233411,23839,23839 +23,23,233412,23839,23839 +23,23,2334A0,23839,23839 +23,23,230301,238390,238390 +23,23,230302,238390,238390 +23,23,233210,238390,238390 +23,23,233230,238390,238390 +23,23,233240,238390,238390 +23,23,233262,238390,238390 +23,23,2332A0,238390,238390 +23,23,2332D0,238390,238390 +23,23,2332D0,238390,238390 +23,23,233411,238390,238390 +23,23,233412,238390,238390 +23,23,2334A0,238390,238390 +23,23,230301,2389,2389 +23,23,230302,2389,2389 +23,23,233210,2389,2389 +23,23,233230,2389,2389 +23,23,233240,2389,2389 +23,23,233262,2389,2389 +23,23,2332A0,2389,2389 +23,23,2332D0,2389,2389 +23,23,2332D0,2389,2389 +23,23,233411,2389,2389 +23,23,233412,2389,2389 +23,23,2334A0,2389,2389 +23,23,230301,23891,23891 +23,23,230302,23891,23891 +23,23,233210,23891,23891 +23,23,233230,23891,23891 +23,23,233240,23891,23891 +23,23,233262,23891,23891 +23,23,2332A0,23891,23891 +23,23,2332D0,23891,23891 +23,23,2332D0,23891,23891 +23,23,233411,23891,23891 +23,23,233412,23891,23891 +23,23,2334A0,23891,23891 +23,23,230301,238910,238910 +23,23,230302,238910,238910 +23,23,233210,238910,238910 +23,23,233230,238910,238910 +23,23,233240,238910,238910 +23,23,233262,238910,238910 +23,23,2332A0,238910,238910 +23,23,2332D0,238910,238910 +23,23,2332D0,238910,238910 +23,23,233411,238910,238910 +23,23,233412,238910,238910 +23,23,2334A0,238910,238910 +23,23,230301,23899,23899 +23,23,230302,23899,23899 +23,23,233210,23899,23899 +23,23,233230,23899,23899 +23,23,233240,23899,23899 +23,23,233262,23899,23899 +23,23,2332A0,23899,23899 +23,23,2332D0,23899,23899 +23,23,2332D0,23899,23899 +23,23,233411,23899,23899 +23,23,233412,23899,23899 +23,23,2334A0,23899,23899 +23,23,230301,238990,238990 +23,23,230302,238990,238990 +23,23,233210,238990,238990 +23,23,233230,238990,238990 +23,23,233240,238990,238990 +23,23,233262,238990,238990 +23,23,2332A0,238990,238990 +23,23,2332D0,238990,238990 +23,23,2332D0,238990,238990 +23,23,233411,238990,238990 +23,23,233412,238990,238990 +23,23,2334A0,238990,238990 +31G,311FT,311111,31,31 +31G,311FT,311119,31,31 +31G,311FT,311210,31,31 +31G,311FT,311221,31,31 +31G,311FT,311224,31,31 +31G,311FT,311225,31,31 +31G,311FT,311230,31,31 +31G,311FT,311300,31,31 +31G,311FT,311410,31,31 +31G,311FT,311420,31,31 +31G,311FT,311513,31,31 +31G,311FT,311514,31,31 +31G,311FT,31151A,31,31 +31G,311FT,311520,31,31 +31G,311FT,311615,31,31 +31G,311FT,31161A,31,31 +31G,311FT,311700,31,31 +31G,311FT,311810,31,31 +31G,311FT,3118A0,31,31 +31G,311FT,311910,31,31 +31G,311FT,311920,31,31 +31G,311FT,311930,31,31 +31G,311FT,311940,31,31 +31G,311FT,311990,31,31 +31G,311FT,312110,31,31 +31G,311FT,312120,31,31 +31G,311FT,312130,31,31 +31G,311FT,312140,31,31 +31G,311FT,312200,31,31 +31G,313TT,313100,31,31 +31G,313TT,313200,31,31 +31G,313TT,313300,31,31 +31G,313TT,314110,31,31 +31G,313TT,314120,31,31 +31G,313TT,314900,31,31 +31G,315AL,315000,31,31 +31G,315AL,316000,31,31 +31G,311FT,311111,311,311 +31G,311FT,311119,311,311 +31G,311FT,311210,311,311 +31G,311FT,311221,311,311 +31G,311FT,311224,311,311 +31G,311FT,311225,311,311 +31G,311FT,311230,311,311 +31G,311FT,311300,311,311 +31G,311FT,311410,311,311 +31G,311FT,311420,311,311 +31G,311FT,311513,311,311 +31G,311FT,311514,311,311 +31G,311FT,31151A,311,311 +31G,311FT,311520,311,311 +31G,311FT,311615,311,311 +31G,311FT,31161A,311,311 +31G,311FT,311700,311,311 +31G,311FT,311810,311,311 +31G,311FT,3118A0,311,311 +31G,311FT,311910,311,311 +31G,311FT,311920,311,311 +31G,311FT,311930,311,311 +31G,311FT,311940,311,311 +31G,311FT,311990,311,311 +31G,311FT,311111,3111,3111 +31G,311FT,311119,3111,3111 +31G,311FT,311111,31111,31111 +31G,311FT,311119,31111,31111 +31G,311FT,311111,311111,311111 +31G,311FT,311119,311119,311119 +31G,311FT,311210,3112,3112 +31G,311FT,311221,3112,3112 +31G,311FT,311224,3112,3112 +31G,311FT,311225,3112,3112 +31G,311FT,311230,3112,3112 +31G,311FT,311210,31121,31121 +31G,311FT,311210,311211,311211 +31G,311FT,311210,311212,311212 +31G,311FT,311210,311213,311213 +31G,311FT,311221,31122,31122 +31G,311FT,311224,31122,31122 +31G,311FT,311225,31122,31122 +31G,311FT,311221,311221,311221 +31G,311FT,311224,311224,311224 +31G,311FT,311224,311224,311224 +31G,311FT,311225,311225,311225 +31G,311FT,311230,31123,31123 +31G,311FT,311230,311230,311230 +31G,311FT,311300,3113,3113 +31G,311FT,311300,31131,31131 +31G,311FT,311300,311313,311313 +31G,311FT,311300,311314,311314 +31G,311FT,311300,311314,311314 +31G,311FT,311300,31134,31134 +31G,311FT,311300,311340,311340 +31G,311FT,311300,31135,31135 +31G,311FT,311300,31135,31135 +31G,311FT,311300,311351,311351 +31G,311FT,311300,311352,311352 +31G,311FT,311410,3114,3114 +31G,311FT,311420,3114,3114 +31G,311FT,311410,31141,31141 +31G,311FT,311410,311411,311411 +31G,311FT,311410,311412,311412 +31G,311FT,311420,31142,31142 +31G,311FT,311420,311421,311421 +31G,311FT,311420,311422,311422 +31G,311FT,311420,311423,311423 +31G,311FT,311513,3115,3115 +31G,311FT,311514,3115,3115 +31G,311FT,31151A,3115,3115 +31G,311FT,311520,3115,3115 +31G,311FT,311513,31151,31151 +31G,311FT,311514,31151,31151 +31G,311FT,31151A,31151,31151 +31G,311FT,31151A,311511,311511 +31G,311FT,31151A,311512,311512 +31G,311FT,311513,311513,311513 +31G,311FT,311514,311514,311514 +31G,311FT,311520,31152,31152 +31G,311FT,311520,311520,311520 +31G,311FT,311615,3116,3116 +31G,311FT,31161A,3116,3116 +31G,311FT,311615,31161,31161 +31G,311FT,31161A,31161,31161 +31G,311FT,31161A,311611,311611 +31G,311FT,31161A,311612,311612 +31G,311FT,31161A,311613,311613 +31G,311FT,311615,311615,311615 +31G,311FT,311700,3117,3117 +31G,311FT,311700,31171,31171 +31G,311FT,311700,311710,311710 +31G,311FT,311700,311710,311710 +31G,311FT,311810,3118,3118 +31G,311FT,3118A0,3118,3118 +31G,311FT,311810,31181,31181 +31G,311FT,311810,311811,311811 +31G,311FT,311810,311812,311812 +31G,311FT,311810,311813,311813 +31G,311FT,3118A0,31182,31182 +31G,311FT,3118A0,311821,311821 +31G,311FT,3118A0,311824,311824 +31G,311FT,3118A0,311824,311824 +31G,311FT,3118A0,31183,31183 +31G,311FT,3118A0,311830,311830 +31G,311FT,311910,3119,3119 +31G,311FT,311920,3119,3119 +31G,311FT,311930,3119,3119 +31G,311FT,311940,3119,3119 +31G,311FT,311990,3119,3119 +31G,311FT,311910,31191,31191 +31G,311FT,311910,311911,311911 +31G,311FT,311910,311919,311919 +31G,311FT,311920,31192,31192 +31G,311FT,311920,311920,311920 +31G,311FT,311930,31193,31193 +31G,311FT,311930,311930,311930 +31G,311FT,311940,31194,31194 +31G,311FT,311940,311941,311941 +31G,311FT,311940,311942,311942 +31G,311FT,311990,31199,31199 +31G,311FT,311990,311991,311991 +31G,311FT,311990,311999,311999 +31G,311FT,312110,312,312 +31G,311FT,312120,312,312 +31G,311FT,312130,312,312 +31G,311FT,312140,312,312 +31G,311FT,312200,312,312 +31G,311FT,312110,3121,3121 +31G,311FT,312120,3121,3121 +31G,311FT,312130,3121,3121 +31G,311FT,312140,3121,3121 +31G,311FT,312110,31211,31211 +31G,311FT,312110,312111,312111 +31G,311FT,312110,312112,312112 +31G,311FT,312110,312113,312113 +31G,311FT,312120,31212,31212 +31G,311FT,312120,312120,312120 +31G,311FT,312130,31213,31213 +31G,311FT,312130,312130,312130 +31G,311FT,312140,31214,31214 +31G,311FT,312140,312140,312140 +31G,311FT,312200,3122,3122 +31G,311FT,312200,31223,31223 +31G,311FT,312200,31223,31223 +31G,311FT,312200,312230,312230 +31G,311FT,312200,312230,312230 +31G,311FT,312200,312230,312230 +31G,313TT,313100,313,313 +31G,313TT,313200,313,313 +31G,313TT,313300,313,313 +31G,313TT,313100,3131,3131 +31G,313TT,313100,31311,31311 +31G,313TT,313100,313110,313110 +31G,313TT,313100,313110,313110 +31G,313TT,313100,313110,313110 +31G,313TT,313200,3132,3132 +31G,313TT,313200,31321,31321 +31G,313TT,313200,313210,313210 +31G,313TT,313200,31322,31322 +31G,313TT,313200,313220,313220 +31G,313TT,313200,313220,313220 +31G,313TT,313200,31323,31323 +31G,313TT,313200,313230,313230 +31G,313TT,313200,31324,31324 +31G,313TT,313200,313240,313240 +31G,313TT,313200,313240,313240 +31G,313TT,313300,3133,3133 +31G,313TT,313300,31331,31331 +31G,313TT,313300,313310,313310 +31G,313TT,313300,313310,313310 +31G,313TT,313300,31332,31332 +31G,313TT,313300,313320,313320 +31G,313TT,314110,314,314 +31G,313TT,314120,314,314 +31G,313TT,314900,314,314 +31G,313TT,314110,3141,3141 +31G,313TT,314120,3141,3141 +31G,313TT,314110,31411,31411 +31G,313TT,314110,314110,314110 +31G,313TT,314120,31412,31412 +31G,313TT,314120,314120,314120 +31G,313TT,314120,314120,314120 +31G,313TT,314900,3149,3149 +31G,313TT,314900,31491,31491 +31G,313TT,314900,314910,314910 +31G,313TT,314900,314910,314910 +31G,313TT,314900,31499,31499 +31G,313TT,314900,314994,314994 +31G,313TT,314900,314994,314994 +31G,313TT,314900,314999,314999 +31G,315AL,315000,315,315 +31G,315AL,315000,3151,3151 +31G,315AL,315000,31511,31511 +31G,315AL,315000,315110,315110 +31G,315AL,315000,315110,315110 +31G,315AL,315000,31519,31519 +31G,315AL,315000,315190,315190 +31G,315AL,315000,315190,315190 +31G,315AL,315000,3152,3152 +31G,315AL,315000,31521,31521 +31G,315AL,315000,315210,315210 +31G,315AL,315000,315210,315210 +31G,315AL,315000,31522,31522 +31G,315AL,315000,315220,315220 +31G,315AL,315000,315220,315220 +31G,315AL,315000,315220,315220 +31G,315AL,315000,315220,315220 +31G,315AL,315000,315220,315220 +31G,315AL,315000,315220,315220 +31G,315AL,315000,31524,31524 +31G,315AL,315000,31524,31524 +31G,315AL,315000,315240,315240 +31G,315AL,315000,315240,315240 +31G,315AL,315000,315240,315240 +31G,315AL,315000,315240,315240 +31G,315AL,315000,315240,315240 +31G,315AL,315000,315240,315240 +31G,315AL,315000,31528,31528 +31G,315AL,315000,315280,315280 +31G,315AL,315000,315280,315280 +31G,315AL,315000,3159,3159 +31G,315AL,315000,31599,31599 +31G,315AL,315000,315990,315990 +31G,315AL,315000,315990,315990 +31G,315AL,315000,315990,315990 +31G,315AL,315000,315990,315990 +31G,315AL,316000,316,316 +31G,315AL,316000,3161,3161 +31G,315AL,316000,31611,31611 +31G,315AL,316000,316110,316110 +31G,315AL,316000,3162,3162 +31G,315AL,316000,31621,31621 +31G,315AL,316000,316210,316210 +31G,315AL,316000,316210,316210 +31G,315AL,316000,316210,316210 +31G,315AL,316000,316210,316210 +31G,315AL,316000,316210,316210 +31G,315AL,316000,3169,3169 +31G,315AL,316000,31699,31699 +31G,315AL,316000,316992,316992 +31G,315AL,316000,316998,316998 +31G,315AL,316000,316998,316998 +31G,315AL,316000,316998,316998 +31G,321,321100,32,32 +31G,321,321100,32,32 +31G,321,321200,32,32 +31G,321,321200,32,32 +31G,321,321910,32,32 +31G,321,321910,32,32 +31G,321,3219A0,32,32 +31G,321,3219A0,32,32 +31G,322,322110,32,32 +31G,322,322110,32,32 +31G,322,322120,32,32 +31G,322,322120,32,32 +31G,322,322130,32,32 +31G,322,322130,32,32 +31G,322,322210,32,32 +31G,322,322210,32,32 +31G,322,322220,32,32 +31G,322,322220,32,32 +31G,322,322230,32,32 +31G,322,322230,32,32 +31G,322,322291,32,32 +31G,322,322291,32,32 +31G,322,322299,32,32 +31G,322,322299,32,32 +31G,323,323110,32,32 +31G,323,323110,32,32 +31G,323,323120,32,32 +31G,323,323120,32,32 +31G,324,324110,32,32 +31G,324,324110,32,32 +31G,324,324121,32,32 +31G,324,324121,32,32 +31G,324,324122,32,32 +31G,324,324122,32,32 +31G,324,324190,32,32 +31G,324,324190,32,32 +31G,325,325110,32,32 +31G,325,325110,32,32 +31G,325,325120,32,32 +31G,325,325120,32,32 +31G,325,325130,32,32 +31G,325,325130,32,32 +31G,325,325180,32,32 +31G,325,325180,32,32 +31G,325,325190,32,32 +31G,325,325190,32,32 +31G,325,325211,32,32 +31G,325,325211,32,32 +31G,325,3252A0,32,32 +31G,325,3252A0,32,32 +31G,325,325310,32,32 +31G,325,325310,32,32 +31G,325,325320,32,32 +31G,325,325320,32,32 +31G,325,325411,32,32 +31G,325,325411,32,32 +31G,325,325412,32,32 +31G,325,325412,32,32 +31G,325,325413,32,32 +31G,325,325413,32,32 +31G,325,325414,32,32 +31G,325,325414,32,32 +31G,325,325510,32,32 +31G,325,325510,32,32 +31G,325,325520,32,32 +31G,325,325520,32,32 +31G,325,325610,32,32 +31G,325,325610,32,32 +31G,325,325620,32,32 +31G,325,325620,32,32 +31G,325,325910,32,32 +31G,325,325910,32,32 +31G,325,3259A0,32,32 +31G,325,3259A0,32,32 +31G,326,326110,32,32 +31G,326,326110,32,32 +31G,326,326120,32,32 +31G,326,326120,32,32 +31G,326,326130,32,32 +31G,326,326130,32,32 +31G,326,326140,32,32 +31G,326,326140,32,32 +31G,326,326150,32,32 +31G,326,326150,32,32 +31G,326,326160,32,32 +31G,326,326160,32,32 +31G,326,326190,32,32 +31G,326,326190,32,32 +31G,326,326210,32,32 +31G,326,326210,32,32 +31G,326,326220,32,32 +31G,326,326220,32,32 +31G,326,326290,32,32 +31G,326,326290,32,32 +31G,327,327100,32,32 +31G,327,327100,32,32 +31G,327,327200,32,32 +31G,327,327200,32,32 +31G,327,327310,32,32 +31G,327,327310,32,32 +31G,327,327320,32,32 +31G,327,327320,32,32 +31G,327,327330,32,32 +31G,327,327330,32,32 +31G,327,327390,32,32 +31G,327,327390,32,32 +31G,327,327400,32,32 +31G,327,327400,32,32 +31G,327,327910,32,32 +31G,327,327910,32,32 +31G,327,327991,32,32 +31G,327,327991,32,32 +31G,327,327992,32,32 +31G,327,327992,32,32 +31G,327,327993,32,32 +31G,327,327993,32,32 +31G,327,327999,32,32 +31G,327,327999,32,32 +31G,321,321100,321,321 +31G,321,321100,321,321 +31G,321,321200,321,321 +31G,321,321200,321,321 +31G,321,321910,321,321 +31G,321,321910,321,321 +31G,321,3219A0,321,321 +31G,321,3219A0,321,321 +31G,321,321100,3211,3211 +31G,321,321100,32111,32111 +31G,321,321100,321113,321113 +31G,321,321100,321114,321114 +31G,321,321200,3212,3212 +31G,321,321200,32121,32121 +31G,321,321200,321211,321211 +31G,321,321200,321212,321212 +31G,321,321200,321213,321213 +31G,321,321200,321214,321214 +31G,321,321200,321219,321219 +31G,321,321910,3219,3219 +31G,321,321910,3219,3219 +31G,321,3219A0,3219,3219 +31G,321,3219A0,3219,3219 +31G,321,321910,32191,32191 +31G,321,321910,321911,321911 +31G,321,321910,321912,321912 +31G,321,321910,321918,321918 +31G,321,3219A0,32192,32192 +31G,321,3219A0,321920,321920 +31G,321,3219A0,32199,32199 +31G,321,3219A0,32199,32199 +31G,321,3219A0,321991,321991 +31G,321,3219A0,321992,321992 +31G,321,3219A0,321999,321999 +31G,321,3219A0,321999,321999 +31G,322,322110,322,322 +31G,322,322120,322,322 +31G,322,322130,322,322 +31G,322,322210,322,322 +31G,322,322220,322,322 +31G,322,322230,322,322 +31G,322,322291,322,322 +31G,322,322299,322,322 +31G,322,322110,3221,3221 +31G,322,322120,3221,3221 +31G,322,322130,3221,3221 +31G,322,322110,32211,32211 +31G,322,322110,322110,322110 +31G,322,322120,32212,32212 +31G,322,322120,322121,322121 +31G,322,322120,322122,322122 +31G,322,322130,32213,32213 +31G,322,322130,322130,322130 +31G,322,322210,3222,3222 +31G,322,322220,3222,3222 +31G,322,322230,3222,3222 +31G,322,322291,3222,3222 +31G,322,322299,3222,3222 +31G,322,322210,32221,32221 +31G,322,322210,322211,322211 +31G,322,322210,322212,322212 +31G,322,322210,322219,322219 +31G,322,322210,322219,322219 +31G,322,322210,322219,322219 +31G,322,322220,32222,32222 +31G,322,322220,322220,322220 +31G,322,322220,322220,322220 +31G,322,322220,322220,322220 +31G,322,322220,322220,322220 +31G,322,322220,322220,322220 +31G,322,322220,322220,322220 +31G,322,322230,32223,32223 +31G,322,322230,322230,322230 +31G,322,322230,322230,322230 +31G,322,322230,322230,322230 +31G,322,322291,32229,32229 +31G,322,322299,32229,32229 +31G,322,322291,322291,322291 +31G,322,322299,322299,322299 +31G,323,323110,323,323 +31G,323,323120,323,323 +31G,323,323110,3231,3231 +31G,323,323120,3231,3231 +31G,323,323110,32311,32311 +31G,323,323110,323111,323111 +31G,323,323110,323111,323111 +31G,323,323110,323111,323111 +31G,323,323110,323111,323111 +31G,323,323110,323111,323111 +31G,323,323110,323111,323111 +31G,323,323110,323111,323111 +31G,323,323110,323111,323111 +31G,323,323110,323113,323113 +31G,323,323110,323117,323117 +31G,323,323120,32312,32312 +31G,323,323120,323120,323120 +31G,323,323120,323120,323120 +31G,324,324110,324,324 +31G,324,324121,324,324 +31G,324,324122,324,324 +31G,324,324190,324,324 +31G,324,324110,3241,3241 +31G,324,324121,3241,3241 +31G,324,324122,3241,3241 +31G,324,324190,3241,3241 +31G,324,324110,32411,32411 +31G,324,324110,324110,324110 +31G,324,324121,32412,32412 +31G,324,324122,32412,32412 +31G,324,324121,324121,324121 +31G,324,324122,324122,324122 +31G,324,324190,32419,32419 +31G,324,324190,324191,324191 +31G,324,324190,324199,324199 +31G,325,325110,325,325 +31G,325,325120,325,325 +31G,325,325130,325,325 +31G,325,325180,325,325 +31G,325,325190,325,325 +31G,325,325211,325,325 +31G,325,3252A0,325,325 +31G,325,325310,325,325 +31G,325,325320,325,325 +31G,325,325411,325,325 +31G,325,325412,325,325 +31G,325,325413,325,325 +31G,325,325414,325,325 +31G,325,325510,325,325 +31G,325,325520,325,325 +31G,325,325610,325,325 +31G,325,325620,325,325 +31G,325,325910,325,325 +31G,325,3259A0,325,325 +31G,325,325110,3251,3251 +31G,325,325120,3251,3251 +31G,325,325130,3251,3251 +31G,325,325180,3251,3251 +31G,325,325190,3251,3251 +31G,325,325110,32511,32511 +31G,325,325110,325110,325110 +31G,325,325120,32512,32512 +31G,325,325120,325120,325120 +31G,325,325130,32513,32513 +31G,325,325130,325130,325130 +31G,325,325130,325130,325130 +31G,325,325180,32518,32518 +31G,325,325180,325180,325180 +31G,325,325180,325180,325180 +31G,325,325180,325180,325180 +31G,325,325190,32519,32519 +31G,325,325190,325193,325193 +31G,325,325190,325194,325194 +31G,325,325190,325194,325194 +31G,325,325190,325199,325199 +31G,325,325211,3252,3252 +31G,325,3252A0,3252,3252 +31G,325,325211,32521,32521 +31G,325,3252A0,32521,32521 +31G,325,325211,325211,325211 +31G,325,3252A0,325212,325212 +31G,325,3252A0,32522,32522 +31G,325,3252A0,325220,325220 +31G,325,3252A0,325220,325220 +31G,325,325310,3253,3253 +31G,325,325320,3253,3253 +31G,325,325310,32531,32531 +31G,325,325310,325311,325311 +31G,325,325310,325312,325312 +31G,325,325310,325314,325314 +31G,325,325320,32532,32532 +31G,325,325320,325320,325320 +31G,325,325411,3254,3254 +31G,325,325412,3254,3254 +31G,325,325413,3254,3254 +31G,325,325414,3254,3254 +31G,325,325411,32541,32541 +31G,325,325412,32541,32541 +31G,325,325413,32541,32541 +31G,325,325414,32541,32541 +31G,325,325411,325411,325411 +31G,325,325412,325412,325412 +31G,325,325413,325413,325413 +31G,325,325414,325414,325414 +31G,325,325510,3255,3255 +31G,325,325520,3255,3255 +31G,325,325510,32551,32551 +31G,325,325510,325510,325510 +31G,325,325520,32552,32552 +31G,325,325520,325520,325520 +31G,325,325610,3256,3256 +31G,325,325620,3256,3256 +31G,325,325610,32561,32561 +31G,325,325610,325611,325611 +31G,325,325610,325612,325612 +31G,325,325610,325613,325613 +31G,325,325620,32562,32562 +31G,325,325620,325620,325620 +31G,325,325910,3259,3259 +31G,325,3259A0,3259,3259 +31G,325,325910,32591,32591 +31G,325,325910,325910,325910 +31G,325,3259A0,32592,32592 +31G,325,3259A0,325920,325920 +31G,325,3259A0,32599,32599 +31G,325,3259A0,325991,325991 +31G,325,3259A0,325992,325992 +31G,325,3259A0,325998,325998 +31G,326,326110,326,326 +31G,326,326120,326,326 +31G,326,326130,326,326 +31G,326,326140,326,326 +31G,326,326150,326,326 +31G,326,326160,326,326 +31G,326,326190,326,326 +31G,326,326210,326,326 +31G,326,326220,326,326 +31G,326,326290,326,326 +31G,326,326110,3261,3261 +31G,326,326120,3261,3261 +31G,326,326130,3261,3261 +31G,326,326140,3261,3261 +31G,326,326150,3261,3261 +31G,326,326160,3261,3261 +31G,326,326190,3261,3261 +31G,326,326110,32611,32611 +31G,326,326110,326111,326111 +31G,326,326110,326112,326112 +31G,326,326110,326113,326113 +31G,326,326120,32612,32612 +31G,326,326120,326121,326121 +31G,326,326120,326122,326122 +31G,326,326130,32613,32613 +31G,326,326130,326130,326130 +31G,326,326140,32614,32614 +31G,326,326140,326140,326140 +31G,326,326150,32615,32615 +31G,326,326150,326150,326150 +31G,326,326160,32616,32616 +31G,326,326160,326160,326160 +31G,326,326190,32619,32619 +31G,326,326190,326191,326191 +31G,326,326190,326199,326199 +31G,326,326190,326199,326199 +31G,326,326210,3262,3262 +31G,326,326220,3262,3262 +31G,326,326290,3262,3262 +31G,326,326210,32621,32621 +31G,326,326210,326211,326211 +31G,326,326210,326212,326212 +31G,326,326220,32622,32622 +31G,326,326220,326220,326220 +31G,326,326290,32629,32629 +31G,326,326290,326291,326291 +31G,326,326290,326299,326299 +31G,327,327100,327,327 +31G,327,327200,327,327 +31G,327,327310,327,327 +31G,327,327320,327,327 +31G,327,327330,327,327 +31G,327,327390,327,327 +31G,327,327400,327,327 +31G,327,327910,327,327 +31G,327,327991,327,327 +31G,327,327992,327,327 +31G,327,327993,327,327 +31G,327,327999,327,327 +31G,327,327100,3271,3271 +31G,327,327100,32711,32711 +31G,327,327100,327110,327110 +31G,327,327100,327110,327110 +31G,327,327100,327110,327110 +31G,327,327100,32712,32712 +31G,327,327100,327120,327120 +31G,327,327100,327120,327120 +31G,327,327100,327120,327120 +31G,327,327100,327120,327120 +31G,327,327100,327120,327120 +31G,327,327200,3272,3272 +31G,327,327200,32721,32721 +31G,327,327200,327211,327211 +31G,327,327200,327212,327212 +31G,327,327200,327213,327213 +31G,327,327200,327215,327215 +31G,327,327310,3273,3273 +31G,327,327320,3273,3273 +31G,327,327330,3273,3273 +31G,327,327390,3273,3273 +31G,327,327310,32731,32731 +31G,327,327310,327310,327310 +31G,327,327320,32732,32732 +31G,327,327320,327320,327320 +31G,327,327330,32733,32733 +31G,327,327330,327331,327331 +31G,327,327330,327332,327332 +31G,327,327390,32739,32739 +31G,327,327390,327390,327390 +31G,327,327400,3274,3274 +31G,327,327400,32741,32741 +31G,327,327400,327410,327410 +31G,327,327400,32742,32742 +31G,327,327400,327420,327420 +31G,327,327910,3279,3279 +31G,327,327991,3279,3279 +31G,327,327992,3279,3279 +31G,327,327993,3279,3279 +31G,327,327999,3279,3279 +31G,327,327910,32791,32791 +31G,327,327910,327910,327910 +31G,327,327991,32799,32799 +31G,327,327992,32799,32799 +31G,327,327993,32799,32799 +31G,327,327999,32799,32799 +31G,327,327991,327991,327991 +31G,327,327992,327992,327992 +31G,327,327993,327993,327993 +31G,327,327999,327999,327999 +31G,331,331110,33,33 +31G,331,331200,33,33 +31G,331,331313,33,33 +31G,331,331314,33,33 +31G,331,33131B,33,33 +31G,331,331410,33,33 +31G,331,331420,33,33 +31G,331,331490,33,33 +31G,331,331510,33,33 +31G,331,331520,33,33 +31G,332,332114,33,33 +31G,332,332119,33,33 +31G,332,33211A,33,33 +31G,332,332200,33,33 +31G,332,332310,33,33 +31G,332,332320,33,33 +31G,332,332410,33,33 +31G,332,332420,33,33 +31G,332,332430,33,33 +31G,332,332500,33,33 +31G,332,332600,33,33 +31G,332,332710,33,33 +31G,332,332720,33,33 +31G,332,332800,33,33 +31G,332,332913,33,33 +31G,332,33291A,33,33 +31G,332,332991,33,33 +31G,332,332996,33,33 +31G,332,332999,33,33 +31G,332,33299A,33,33 +31G,333,333111,33,33 +31G,333,333112,33,33 +31G,333,333120,33,33 +31G,333,333130,33,33 +31G,333,333242,33,33 +31G,333,33329A,33,33 +31G,333,333314,33,33 +31G,333,333316,33,33 +31G,333,333318,33,33 +31G,333,333413,33,33 +31G,333,333414,33,33 +31G,333,333415,33,33 +31G,333,333511,33,33 +31G,333,333514,33,33 +31G,333,333517,33,33 +31G,333,33351B,33,33 +31G,333,333611,33,33 +31G,333,333612,33,33 +31G,333,333613,33,33 +31G,333,333618,33,33 +31G,333,333912,33,33 +31G,333,333914,33,33 +31G,333,333920,33,33 +31G,333,333991,33,33 +31G,333,333993,33,33 +31G,333,333994,33,33 +31G,333,33399A,33,33 +31G,333,33399B,33,33 +31G,334,334111,33,33 +31G,334,334112,33,33 +31G,334,334118,33,33 +31G,334,334210,33,33 +31G,334,334220,33,33 +31G,334,334290,33,33 +31G,334,334300,33,33 +31G,334,334413,33,33 +31G,334,334418,33,33 +31G,334,33441A,33,33 +31G,334,334510,33,33 +31G,334,334511,33,33 +31G,334,334512,33,33 +31G,334,334513,33,33 +31G,334,334514,33,33 +31G,334,334515,33,33 +31G,334,334516,33,33 +31G,334,334517,33,33 +31G,334,33451A,33,33 +31G,334,334610,33,33 +31G,335,335110,33,33 +31G,335,335120,33,33 +31G,335,335210,33,33 +31G,335,335220,33,33 +31G,335,335311,33,33 +31G,335,335312,33,33 +31G,335,335313,33,33 +31G,335,335314,33,33 +31G,335,335911,33,33 +31G,335,335912,33,33 +31G,335,335920,33,33 +31G,335,335930,33,33 +31G,335,335991,33,33 +31G,335,335999,33,33 +31G,3361MV,336111,33,33 +31G,3361MV,336112,33,33 +31G,3361MV,336120,33,33 +31G,3361MV,336211,33,33 +31G,3361MV,336212,33,33 +31G,3361MV,336213,33,33 +31G,3361MV,336214,33,33 +31G,3361MV,336310,33,33 +31G,3361MV,336320,33,33 +31G,3361MV,336350,33,33 +31G,3361MV,336360,33,33 +31G,3361MV,336370,33,33 +31G,3361MV,336390,33,33 +31G,3361MV,3363A0,33,33 +31G,3364OT,336411,33,33 +31G,3364OT,336412,33,33 +31G,3364OT,336413,33,33 +31G,3364OT,336414,33,33 +31G,3364OT,33641A,33,33 +31G,3364OT,336500,33,33 +31G,3364OT,336611,33,33 +31G,3364OT,336612,33,33 +31G,3364OT,336991,33,33 +31G,3364OT,336992,33,33 +31G,3364OT,336999,33,33 +31G,337,337110,33,33 +31G,337,337121,33,33 +31G,337,337122,33,33 +31G,337,337127,33,33 +31G,337,33712N,33,33 +31G,337,337215,33,33 +31G,337,33721A,33,33 +31G,337,337900,33,33 +31G,339,339112,33,33 +31G,339,339113,33,33 +31G,339,339114,33,33 +31G,339,339115,33,33 +31G,339,339116,33,33 +31G,339,339910,33,33 +31G,339,339920,33,33 +31G,339,339930,33,33 +31G,339,339940,33,33 +31G,339,339950,33,33 +31G,339,339990,33,33 +31G,331,331110,331,331 +31G,331,331200,331,331 +31G,331,331313,331,331 +31G,331,331314,331,331 +31G,331,33131B,331,331 +31G,331,331410,331,331 +31G,331,331420,331,331 +31G,331,331490,331,331 +31G,331,331510,331,331 +31G,331,331520,331,331 +31G,331,331110,3311,3311 +31G,331,331110,33111,33111 +31G,331,331110,331110,331110 +31G,331,331110,331110,331110 +31G,331,331200,3312,3312 +31G,331,331200,33121,33121 +31G,331,331200,331210,331210 +31G,331,331200,33122,33122 +31G,331,331200,331221,331221 +31G,331,331200,331222,331222 +31G,331,331313,3313,3313 +31G,331,331314,3313,3313 +31G,331,33131B,3313,3313 +31G,331,331313,33131,33131 +31G,331,331314,33131,33131 +31G,331,33131B,33131,33131 +31G,331,331313,331313,331313 +31G,331,331313,331313,331313 +31G,331,331314,331314,331314 +31G,331,33131B,331315,331315 +31G,331,33131B,331318,331318 +31G,331,33131B,331318,331318 +31G,331,331410,3314,3314 +31G,331,331420,3314,3314 +31G,331,331490,3314,3314 +31G,331,331410,33141,33141 +31G,331,331410,331410,331410 +31G,331,331410,331410,331410 +31G,331,331420,33142,33142 +31G,331,331420,331420,331420 +31G,331,331420,331420,331420 +31G,331,331420,331420,331420 +31G,331,331490,33149,33149 +31G,331,331490,331491,331491 +31G,331,331490,331492,331492 +31G,331,331510,3315,3315 +31G,331,331520,3315,3315 +31G,331,331510,33151,33151 +31G,331,331510,331511,331511 +31G,331,331510,331512,331512 +31G,331,331510,331513,331513 +31G,331,331520,33152,33152 +31G,331,331520,331523,331523 +31G,331,331520,331523,331523 +31G,331,331520,331524,331524 +31G,331,331520,331529,331529 +31G,331,331520,331529,331529 +31G,332,332114,332,332 +31G,332,332119,332,332 +31G,332,33211A,332,332 +31G,332,332200,332,332 +31G,332,332310,332,332 +31G,332,332320,332,332 +31G,332,332410,332,332 +31G,332,332420,332,332 +31G,332,332430,332,332 +31G,332,332500,332,332 +31G,332,332600,332,332 +31G,332,332710,332,332 +31G,332,332720,332,332 +31G,332,332800,332,332 +31G,332,332913,332,332 +31G,332,33291A,332,332 +31G,332,332991,332,332 +31G,332,332996,332,332 +31G,332,332999,332,332 +31G,332,33299A,332,332 +31G,332,332114,3321,3321 +31G,332,332119,3321,3321 +31G,332,33211A,3321,3321 +31G,332,332114,33211,33211 +31G,332,332119,33211,33211 +31G,332,33211A,33211,33211 +31G,332,33211A,332111,332111 +31G,332,33211A,332112,332112 +31G,332,332114,332114,332114 +31G,332,33211A,332117,332117 +31G,332,332119,332119,332119 +31G,332,332119,332119,332119 +31G,332,332200,3322,3322 +31G,332,332200,33221,33221 +31G,332,332200,332215,332215 +31G,332,332200,332215,332215 +31G,332,332200,332216,332216 +31G,332,332200,332216,332216 +31G,332,332310,3323,3323 +31G,332,332320,3323,3323 +31G,332,332310,33231,33231 +31G,332,332310,332311,332311 +31G,332,332310,332312,332312 +31G,332,332310,332313,332313 +31G,332,332320,33232,33232 +31G,332,332320,332321,332321 +31G,332,332320,332322,332322 +31G,332,332320,332323,332323 +31G,332,332410,3324,3324 +31G,332,332420,3324,3324 +31G,332,332430,3324,3324 +31G,332,332410,33241,33241 +31G,332,332410,332410,332410 +31G,332,332420,33242,33242 +31G,332,332420,332420,332420 +31G,332,332430,33243,33243 +31G,332,332430,332431,332431 +31G,332,332430,332439,332439 +31G,332,332500,3325,3325 +31G,332,332500,33251,33251 +31G,332,332500,332510,332510 +31G,332,332600,3326,3326 +31G,332,332600,33261,33261 +31G,332,332600,332613,332613 +31G,332,332600,332613,332613 +31G,332,332600,332618,332618 +31G,332,332710,3327,3327 +31G,332,332720,3327,3327 +31G,332,332710,33271,33271 +31G,332,332710,332710,332710 +31G,332,332720,33272,33272 +31G,332,332720,332721,332721 +31G,332,332720,332722,332722 +31G,332,332800,3328,3328 +31G,332,332800,33281,33281 +31G,332,332800,332811,332811 +31G,332,332800,332812,332812 +31G,332,332800,332813,332813 +31G,332,332913,3329,3329 +31G,332,33291A,3329,3329 +31G,332,332991,3329,3329 +31G,332,332996,3329,3329 +31G,332,332999,3329,3329 +31G,332,33299A,3329,3329 +31G,332,332913,33291,33291 +31G,332,33291A,33291,33291 +31G,332,33291A,332911,332911 +31G,332,33291A,332912,332912 +31G,332,332913,332913,332913 +31G,332,33291A,332919,332919 +31G,332,332991,33299,33299 +31G,332,332996,33299,33299 +31G,332,332999,33299,33299 +31G,332,33299A,33299,33299 +31G,332,332991,332991,332991 +31G,332,33299A,332992,332992 +31G,332,33299A,332993,332993 +31G,332,33299A,332994,332994 +31G,332,33299A,332994,332994 +31G,332,332996,332996,332996 +31G,332,332999,332999,332999 +31G,332,332999,332999,332999 +31G,332,332999,332999,332999 +31G,333,333111,333,333 +31G,333,333111,333,333 +31G,333,333112,333,333 +31G,333,333112,333,333 +31G,333,333120,333,333 +31G,333,333120,333,333 +31G,333,333130,333,333 +31G,333,333130,333,333 +31G,333,333242,333,333 +31G,333,333242,333,333 +31G,333,33329A,333,333 +31G,333,33329A,333,333 +31G,333,333314,333,333 +31G,333,333314,333,333 +31G,333,333316,333,333 +31G,333,333316,333,333 +31G,333,333318,333,333 +31G,333,333318,333,333 +31G,333,333413,333,333 +31G,333,333413,333,333 +31G,333,333414,333,333 +31G,333,333414,333,333 +31G,333,333415,333,333 +31G,333,333415,333,333 +31G,333,333511,333,333 +31G,333,333511,333,333 +31G,333,333514,333,333 +31G,333,333514,333,333 +31G,333,333517,333,333 +31G,333,333517,333,333 +31G,333,33351B,333,333 +31G,333,33351B,333,333 +31G,333,333611,333,333 +31G,333,333611,333,333 +31G,333,333612,333,333 +31G,333,333612,333,333 +31G,333,333613,333,333 +31G,333,333613,333,333 +31G,333,333618,333,333 +31G,333,333618,333,333 +31G,333,333912,333,333 +31G,333,333912,333,333 +31G,333,333914,333,333 +31G,333,333914,333,333 +31G,333,333920,333,333 +31G,333,333920,333,333 +31G,333,333991,333,333 +31G,333,333991,333,333 +31G,333,333993,333,333 +31G,333,333993,333,333 +31G,333,333994,333,333 +31G,333,333994,333,333 +31G,333,33399A,333,333 +31G,333,33399A,333,333 +31G,333,33399B,333,333 +31G,333,33399B,333,333 +31G,333,333111,3331,3331 +31G,333,333112,3331,3331 +31G,333,333120,3331,3331 +31G,333,333130,3331,3331 +31G,333,333111,33311,33311 +31G,333,333112,33311,33311 +31G,333,333111,333111,333111 +31G,333,333112,333112,333112 +31G,333,333120,33312,33312 +31G,333,333120,333120,333120 +31G,333,333130,33313,33313 +31G,333,333130,333131,333131 +31G,333,333130,333132,333132 +31G,333,333242,3332,3332 +31G,333,33329A,3332,3332 +31G,333,333242,33324,33324 +31G,333,333242,33324,33324 +31G,333,333242,33324,33324 +31G,333,33329A,33324,33324 +31G,333,33329A,33324,33324 +31G,333,33329A,33324,33324 +31G,333,33329A,333241,333241 +31G,333,333242,333242,333242 +31G,333,33329A,333243,333243 +31G,333,33329A,333243,333243 +31G,333,33329A,333244,333244 +31G,333,33329A,333249,333249 +31G,333,33329A,333249,333249 +31G,333,33329A,333249,333249 +31G,333,333314,3333,3333 +31G,333,333314,3333,3333 +31G,333,333316,3333,3333 +31G,333,333316,3333,3333 +31G,333,333318,3333,3333 +31G,333,333318,3333,3333 +31G,333,333314,33331,33331 +31G,333,333314,33331,33331 +31G,333,333316,33331,33331 +31G,333,333316,33331,33331 +31G,333,333318,33331,33331 +31G,333,333318,33331,33331 +31G,333,333314,333314,333314 +31G,333,333316,333316,333316 +31G,333,333316,333316,333316 +31G,333,333318,333318,333318 +31G,333,333318,333318,333318 +31G,333,333318,333318,333318 +31G,333,333318,333318,333318 +31G,333,333413,3334,3334 +31G,333,333414,3334,3334 +31G,333,333415,3334,3334 +31G,333,333413,33341,33341 +31G,333,333414,33341,33341 +31G,333,333415,33341,33341 +31G,333,333413,333413,333413 +31G,333,333413,333413,333413 +31G,333,333414,333414,333414 +31G,333,333415,333415,333415 +31G,333,333511,3335,3335 +31G,333,333514,3335,3335 +31G,333,333517,3335,3335 +31G,333,33351B,3335,3335 +31G,333,333511,33351,33351 +31G,333,333514,33351,33351 +31G,333,333517,33351,33351 +31G,333,33351B,33351,33351 +31G,333,333511,333511,333511 +31G,333,333514,333514,333514 +31G,333,33351B,333515,333515 +31G,333,333517,333517,333517 +31G,333,333517,333517,333517 +31G,333,33351B,333519,333519 +31G,333,33351B,333519,333519 +31G,333,333611,3336,3336 +31G,333,333612,3336,3336 +31G,333,333613,3336,3336 +31G,333,333618,3336,3336 +31G,333,333611,33361,33361 +31G,333,333612,33361,33361 +31G,333,333613,33361,33361 +31G,333,333618,33361,33361 +31G,333,333611,333611,333611 +31G,333,333612,333612,333612 +31G,333,333613,333613,333613 +31G,333,333618,333618,333618 +31G,333,333912,3339,3339 +31G,333,333914,3339,3339 +31G,333,333920,3339,3339 +31G,333,333991,3339,3339 +31G,333,333993,3339,3339 +31G,333,333994,3339,3339 +31G,333,33399A,3339,3339 +31G,333,33399B,3339,3339 +31G,333,333912,33391,33391 +31G,333,333914,33391,33391 +31G,333,333912,333912,333912 +31G,333,333914,333914,333913 +31G,333,333914,333914,333911 +31G,333,333920,33392,33392 +31G,333,333920,333921,333921 +31G,333,333920,333922,333922 +31G,333,333920,333923,333923 +31G,333,333920,333924,333924 +31G,333,333991,33399,33399 +31G,333,333993,33399,33399 +31G,333,333994,33399,33399 +31G,333,33399A,33399,33399 +31G,333,33399B,33399,33399 +31G,333,333991,333991,333991 +31G,333,33399A,333992,333992 +31G,333,333993,333993,333993 +31G,333,333994,333994,333994 +31G,333,33399B,333995,333995 +31G,333,33399B,333996,333996 +31G,333,33399A,333997,333997 +31G,333,33399A,333999,333999 +31G,334,334111,334,334 +31G,334,334112,334,334 +31G,334,334118,334,334 +31G,334,334210,334,334 +31G,334,334220,334,334 +31G,334,334290,334,334 +31G,334,334300,334,334 +31G,334,334413,334,334 +31G,334,334418,334,334 +31G,334,33441A,334,334 +31G,334,334510,334,334 +31G,334,334511,334,334 +31G,334,334512,334,334 +31G,334,334513,334,334 +31G,334,334514,334,334 +31G,334,334515,334,334 +31G,334,334516,334,334 +31G,334,334517,334,334 +31G,334,33451A,334,334 +31G,334,334610,334,334 +31G,334,334111,3341,3341 +31G,334,334112,3341,3341 +31G,334,334118,3341,3341 +31G,334,334111,33411,33411 +31G,334,334112,33411,33411 +31G,334,334118,33411,33411 +31G,334,334111,334111,334111 +31G,334,334112,334112,334112 +31G,334,334118,334118,334118 +31G,334,334118,334118,334118 +31G,334,334210,3342,3342 +31G,334,334220,3342,3342 +31G,334,334290,3342,3342 +31G,334,334210,33421,33421 +31G,334,334210,334210,334210 +31G,334,334220,33422,33422 +31G,334,334220,334220,334220 +31G,334,334290,33429,33429 +31G,334,334290,334290,334290 +31G,334,334300,3343,3343 +31G,334,334300,33431,33431 +31G,334,334300,334310,334310 +31G,334,334413,3344,3344 +31G,334,334418,3344,3344 +31G,334,33441A,3344,3344 +31G,334,334413,33441,33441 +31G,334,334418,33441,33441 +31G,334,33441A,33441,33441 +31G,334,33441A,334412,334412 +31G,334,334413,334413,334413 +31G,334,33441A,334416,334416 +31G,334,33441A,334416,334416 +31G,334,33441A,334416,334416 +31G,334,33441A,334417,334417 +31G,334,334418,334418,334418 +31G,334,33441A,334419,334419 +31G,334,33441A,334419,334419 +31G,334,334510,3345,3345 +31G,334,334511,3345,3345 +31G,334,334512,3345,3345 +31G,334,334513,3345,3345 +31G,334,334514,3345,3345 +31G,334,334515,3345,3345 +31G,334,334516,3345,3345 +31G,334,334517,3345,3345 +31G,334,33451A,3345,3345 +31G,334,334510,33451,33451 +31G,334,334511,33451,33451 +31G,334,334512,33451,33451 +31G,334,334513,33451,33451 +31G,334,334514,33451,33451 +31G,334,334515,33451,33451 +31G,334,334516,33451,33451 +31G,334,334517,33451,33451 +31G,334,33451A,33451,33451 +31G,334,334510,334510,334510 +31G,334,334511,334511,334511 +31G,334,334512,334512,334512 +31G,334,334513,334513,334513 +31G,334,334514,334514,334514 +31G,334,334515,334515,334515 +31G,334,334516,334516,334516 +31G,334,334517,334517,334517 +31G,334,33451A,334519,334519 +31G,334,33451A,334519,334519 +31G,334,334610,3346,3346 +31G,334,334610,33461,33461 +31G,334,334610,334613,334613 +31G,334,334610,334614,334614 +31G,334,334610,334614,334614 +31G,335,335110,335,335 +31G,335,335120,335,335 +31G,335,335210,335,335 +31G,335,335220,335,335 +31G,335,335311,335,335 +31G,335,335312,335,335 +31G,335,335313,335,335 +31G,335,335314,335,335 +31G,335,335911,335,335 +31G,335,335912,335,335 +31G,335,335920,335,335 +31G,335,335930,335,335 +31G,335,335991,335,335 +31G,335,335999,335,335 +31G,335,335110,3351,3351 +31G,335,335120,3351,3351 +31G,335,335110,33511,33511 +31G,335,335110,335110,335110 +31G,335,335120,33512,33512 +31G,335,335120,335121,335121 +31G,335,335120,335122,335122 +31G,335,335120,335129,335129 +31G,335,335210,3352,3352 +31G,335,335220,3352,3352 +31G,335,335210,33521,33521 +31G,335,335210,335210,335210 +31G,335,335210,335210,335210 +31G,335,335220,33522,33522 +31G,335,335220,335220,335224 +31G,335,335220,335220,335221 +31G,335,335220,335220,335222 +31G,335,335220,335220,335228 +31G,335,335311,3353,3353 +31G,335,335312,3353,3353 +31G,335,335313,3353,3353 +31G,335,335314,3353,3353 +31G,335,335311,33531,33531 +31G,335,335312,33531,33531 +31G,335,335313,33531,33531 +31G,335,335314,33531,33531 +31G,335,335311,335311,335311 +31G,335,335312,335312,335312 +31G,335,335313,335313,335313 +31G,335,335314,335314,335314 +31G,335,335911,3359,3359 +31G,335,335912,3359,3359 +31G,335,335920,3359,3359 +31G,335,335930,3359,3359 +31G,335,335991,3359,3359 +31G,335,335999,3359,3359 +31G,335,335911,33591,33591 +31G,335,335912,33591,33591 +31G,335,335911,335911,335911 +31G,335,335912,335912,335912 +31G,335,335920,33592,33592 +31G,335,335920,335921,335921 +31G,335,335920,335929,335929 +31G,335,335930,33593,33593 +31G,335,335930,335931,335931 +31G,335,335930,335932,335932 +31G,335,335991,33599,33599 +31G,335,335999,33599,33599 +31G,335,335991,335991,335991 +31G,335,335999,335999,335999 +31G,3361MV,336111,336,336 +31G,3361MV,336112,336,336 +31G,3361MV,336120,336,336 +31G,3361MV,336211,336,336 +31G,3361MV,336212,336,336 +31G,3361MV,336213,336,336 +31G,3361MV,336214,336,336 +31G,3361MV,336310,336,336 +31G,3361MV,336320,336,336 +31G,3361MV,336350,336,336 +31G,3361MV,336360,336,336 +31G,3361MV,336370,336,336 +31G,3361MV,336390,336,336 +31G,3361MV,3363A0,336,336 +31G,3364OT,336411,336,336 +31G,3364OT,336412,336,336 +31G,3364OT,336413,336,336 +31G,3364OT,336414,336,336 +31G,3364OT,33641A,336,336 +31G,3364OT,336500,336,336 +31G,3364OT,336611,336,336 +31G,3364OT,336612,336,336 +31G,3364OT,336991,336,336 +31G,3364OT,336992,336,336 +31G,3364OT,336999,336,336 +31G,3361MV,336111,3361,3361 +31G,3361MV,336112,3361,3361 +31G,3361MV,336120,3361,3361 +31G,3361MV,336111,33611,33611 +31G,3361MV,336112,33611,33611 +31G,3361MV,336111,336111,336111 +31G,3361MV,336112,336112,336112 +31G,3361MV,336120,33612,33612 +31G,3361MV,336120,336120,336120 +31G,3361MV,336211,3362,3362 +31G,3361MV,336212,3362,3362 +31G,3361MV,336213,3362,3362 +31G,3361MV,336214,3362,3362 +31G,3361MV,336211,33621,33621 +31G,3361MV,336212,33621,33621 +31G,3361MV,336213,33621,33621 +31G,3361MV,336214,33621,33621 +31G,3361MV,336211,336211,336211 +31G,3361MV,336212,336212,336212 +31G,3361MV,336213,336213,336213 +31G,3361MV,336214,336214,336214 +31G,3361MV,336310,3363,3363 +31G,3361MV,336320,3363,3363 +31G,3361MV,336350,3363,3363 +31G,3361MV,336360,3363,3363 +31G,3361MV,336370,3363,3363 +31G,3361MV,336390,3363,3363 +31G,3361MV,3363A0,3363,3363 +31G,3361MV,336310,33631,33631 +31G,3361MV,336310,336310,336310 +31G,3361MV,336310,336310,336310 +31G,3361MV,336320,33632,33632 +31G,3361MV,336320,336320,336320 +31G,3361MV,336320,336320,336320 +31G,3361MV,3363A0,33633,33633 +31G,3361MV,3363A0,336330,336330 +31G,3361MV,3363A0,33634,33634 +31G,3361MV,3363A0,336340,336340 +31G,3361MV,336350,33635,33635 +31G,3361MV,336350,336350,336350 +31G,3361MV,336360,33636,33636 +31G,3361MV,336360,336360,336360 +31G,3361MV,336370,33637,33637 +31G,3361MV,336370,336370,336370 +31G,3361MV,336390,33639,33639 +31G,3361MV,336390,336390,336390 +31G,3361MV,336390,336390,336390 +31G,3364OT,336411,3364,3364 +31G,3364OT,336412,3364,3364 +31G,3364OT,336413,3364,3364 +31G,3364OT,336414,3364,3364 +31G,3364OT,33641A,3364,3364 +31G,3364OT,336411,33641,33641 +31G,3364OT,336412,33641,33641 +31G,3364OT,336413,33641,33641 +31G,3364OT,336414,33641,33641 +31G,3364OT,33641A,33641,33641 +31G,3364OT,336411,336411,336411 +31G,3364OT,336412,336412,336412 +31G,3364OT,336413,336413,336413 +31G,3364OT,336414,336414,336414 +31G,3364OT,33641A,336415,336415 +31G,3364OT,33641A,336419,336419 +31G,3364OT,336500,3365,3365 +31G,3364OT,336500,33651,33651 +31G,3364OT,336500,336510,336510 +31G,3364OT,336611,3366,3366 +31G,3364OT,336612,3366,3366 +31G,3364OT,336611,33661,33661 +31G,3364OT,336612,33661,33661 +31G,3364OT,336611,336611,336611 +31G,3364OT,336612,336612,336612 +31G,3364OT,336991,3369,3369 +31G,3364OT,336992,3369,3369 +31G,3364OT,336999,3369,3369 +31G,3364OT,336991,33699,33699 +31G,3364OT,336992,33699,33699 +31G,3364OT,336999,33699,33699 +31G,3364OT,336991,336991,336991 +31G,3364OT,336992,336992,336992 +31G,3364OT,336999,336999,336999 +31G,337,337110,337,337 +31G,337,337121,337,337 +31G,337,337122,337,337 +31G,337,337127,337,337 +31G,337,33712N,337,337 +31G,337,337215,337,337 +31G,337,33721A,337,337 +31G,337,337900,337,337 +31G,337,337110,3371,3371 +31G,337,337121,3371,3371 +31G,337,337122,3371,3371 +31G,337,337127,3371,3371 +31G,337,33712N,3371,3371 +31G,337,337110,33711,33711 +31G,337,337110,337110,337110 +31G,337,337121,33712,33712 +31G,337,337122,33712,33712 +31G,337,337127,33712,33712 +31G,337,33712N,33712,33712 +31G,337,337121,337121,337121 +31G,337,337122,337122,337122 +31G,337,33712N,337124,337124 +31G,337,33712N,337125,337125 +31G,337,337127,337127,337127 +31G,337,337215,3372,3372 +31G,337,33721A,3372,3372 +31G,337,337215,33721,33721 +31G,337,33721A,33721,33721 +31G,337,33721A,337211,337211 +31G,337,33721A,337212,337212 +31G,337,33721A,337214,337214 +31G,337,337215,337215,337215 +31G,337,337900,3379,3379 +31G,337,337900,33791,33791 +31G,337,337900,337910,337910 +31G,337,337900,33792,33792 +31G,337,337900,337920,337920 +31G,339,339112,339,339 +31G,339,339113,339,339 +31G,339,339114,339,339 +31G,339,339115,339,339 +31G,339,339116,339,339 +31G,339,339910,339,339 +31G,339,339920,339,339 +31G,339,339930,339,339 +31G,339,339940,339,339 +31G,339,339950,339,339 +31G,339,339990,339,339 +31G,339,339112,3391,3391 +31G,339,339113,3391,3391 +31G,339,339114,3391,3391 +31G,339,339115,3391,3391 +31G,339,339116,3391,3391 +31G,339,339112,33911,33911 +31G,339,339113,33911,33911 +31G,339,339114,33911,33911 +31G,339,339115,33911,33911 +31G,339,339116,33911,33911 +31G,339,339112,339112,339112 +31G,339,339113,339113,339113 +31G,339,339114,339114,339114 +31G,339,339115,339115,339115 +31G,339,339116,339116,339116 +31G,339,339910,3399,3399 +31G,339,339920,3399,3399 +31G,339,339930,3399,3399 +31G,339,339940,3399,3399 +31G,339,339950,3399,3399 +31G,339,339990,3399,3399 +31G,339,339910,33991,33991 +31G,339,339910,339910,339910 +31G,339,339910,339910,339910 +31G,339,339910,339910,339910 +31G,339,339910,339910,339910 +31G,339,339920,33992,33992 +31G,339,339920,339920,339920 +31G,339,339930,33993,33993 +31G,339,339930,339930,339930 +31G,339,339930,339930,339930 +31G,339,339940,33994,33994 +31G,339,339940,339940,339940 +31G,339,339940,339940,339940 +31G,339,339940,339940,339940 +31G,339,339940,339940,339940 +31G,339,339950,33995,33995 +31G,339,339950,339950,339950 +31G,339,339990,33999,33999 +31G,339,339990,339991,339991 +31G,339,339990,339992,339992 +31G,339,339990,339993,339993 +31G,339,339990,339994,339994 +31G,339,339990,339995,339995 +31G,339,339990,339999,339999 +42,42,423100,42,42 +42,42,423400,42,42 +42,42,423600,42,42 +42,42,423800,42,42 +42,42,423A00,42,42 +42,42,424200,42,42 +42,42,424400,42,42 +42,42,424700,42,42 +42,42,424A00,42,42 +42,42,425000,42,42 +42,42,423100,423,423 +42,42,423400,423,423 +42,42,423600,423,423 +42,42,423800,423,423 +42,42,423A00,423,423 +42,42,423100,4231,4231 +42,42,423100,42311,42311 +42,42,423100,423110,423110 +42,42,423100,42312,42312 +42,42,423100,423120,423120 +42,42,423100,42313,42313 +42,42,423100,423130,423130 +42,42,423100,42314,42314 +42,42,423100,423140,423140 +42,42,423A00,4232,4232 +42,42,423A00,42321,42321 +42,42,423A00,423210,423210 +42,42,423A00,42322,42322 +42,42,423A00,423220,423220 +42,42,423A00,4233,4233 +42,42,423A00,42331,42331 +42,42,423A00,423310,423310 +42,42,423A00,42332,42332 +42,42,423A00,423320,423320 +42,42,423A00,42333,42333 +42,42,423A00,423330,423330 +42,42,423A00,42339,42339 +42,42,423A00,423390,423390 +42,42,423400,4234,4234 +42,42,423400,42341,42341 +42,42,423400,423410,423410 +42,42,423400,42342,42342 +42,42,423400,423420,423420 +42,42,423400,42343,42343 +42,42,423400,423430,423430 +42,42,423400,42344,42344 +42,42,423400,423440,423440 +42,42,423400,42345,42345 +42,42,423400,423450,423450 +42,42,423400,42346,42346 +42,42,423400,423460,423460 +42,42,423400,42349,42349 +42,42,423400,423490,423490 +42,42,423A00,4235,4235 +42,42,423A00,42351,42351 +42,42,423A00,423510,423510 +42,42,423A00,42352,42352 +42,42,423A00,423520,423520 +42,42,423600,4236,4236 +42,42,423600,4236,4236 +42,42,423600,42361,42361 +42,42,423600,423610,423610 +42,42,423600,42362,42362 +42,42,423600,42362,42362 +42,42,423600,423620,423620 +42,42,423600,423620,423620 +42,42,423600,42369,42369 +42,42,423600,423690,423690 +42,42,423A00,4237,4237 +42,42,423A00,4237,4237 +42,42,423A00,42371,42371 +42,42,423A00,423710,423710 +42,42,423A00,42372,42372 +42,42,423A00,42372,42372 +42,42,423A00,423720,423720 +42,42,423A00,423720,423720 +42,42,423A00,42373,42373 +42,42,423A00,423730,423730 +42,42,423A00,42374,42374 +42,42,423A00,423740,423740 +42,42,423800,4238,4238 +42,42,423800,42381,42381 +42,42,423800,423810,423810 +42,42,423800,42382,42382 +42,42,423800,423820,423820 +42,42,423800,42383,42383 +42,42,423800,423830,423830 +42,42,423800,42384,42384 +42,42,423800,423840,423840 +42,42,423800,42385,42385 +42,42,423800,423850,423850 +42,42,423800,42386,42386 +42,42,423800,423860,423860 +42,42,423A00,4239,4239 +42,42,423A00,42391,42391 +42,42,423A00,423910,423910 +42,42,423A00,42392,42392 +42,42,423A00,423920,423920 +42,42,423A00,42393,42393 +42,42,423A00,423930,423930 +42,42,423A00,42394,42394 +42,42,423A00,423940,423940 +42,42,423A00,42399,42399 +42,42,423A00,423990,423990 +42,42,424200,424,424 +42,42,424400,424,424 +42,42,424700,424,424 +42,42,424A00,424,424 +42,42,424A00,4241,4241 +42,42,424A00,42411,42411 +42,42,424A00,424110,424110 +42,42,424A00,42412,42412 +42,42,424A00,424120,424120 +42,42,424A00,42413,42413 +42,42,424A00,424130,424130 +42,42,424200,4242,4242 +42,42,424200,42421,42421 +42,42,424200,424210,424210 +42,42,424A00,4243,4243 +42,42,424A00,42431,42431 +42,42,424A00,424310,424310 +42,42,424A00,42432,42432 +42,42,424A00,424320,424320 +42,42,424A00,42433,42433 +42,42,424A00,424330,424330 +42,42,424A00,42434,42434 +42,42,424A00,424340,424340 +42,42,424400,4244,4244 +42,42,424400,42441,42441 +42,42,424400,424410,424410 +42,42,424400,42442,42442 +42,42,424400,424420,424420 +42,42,424400,42443,42443 +42,42,424400,424430,424430 +42,42,424400,42444,42444 +42,42,424400,424440,424440 +42,42,424400,42445,42445 +42,42,424400,424450,424450 +42,42,424400,42446,42446 +42,42,424400,424460,424460 +42,42,424400,42447,42447 +42,42,424400,424470,424470 +42,42,424400,42448,42448 +42,42,424400,424480,424480 +42,42,424400,42449,42449 +42,42,424400,424490,424490 +42,42,424A00,4245,4245 +42,42,424A00,42451,42451 +42,42,424A00,424510,424510 +42,42,424A00,42452,42452 +42,42,424A00,424520,424520 +42,42,424A00,42459,42459 +42,42,424A00,424590,424590 +42,42,424A00,4246,4246 +42,42,424A00,42461,42461 +42,42,424A00,424610,424610 +42,42,424A00,42469,42469 +42,42,424A00,424690,424690 +42,42,424700,4247,4247 +42,42,424700,42471,42471 +42,42,424700,424710,424710 +42,42,424700,42472,42472 +42,42,424700,424720,424720 +42,42,424A00,4248,4248 +42,42,424A00,42481,42481 +42,42,424A00,424810,424810 +42,42,424A00,42482,42482 +42,42,424A00,424820,424820 +42,42,424A00,4249,4249 +42,42,424A00,42491,42491 +42,42,424A00,424910,424910 +42,42,424A00,42492,42492 +42,42,424A00,424920,424920 +42,42,424A00,42493,42493 +42,42,424A00,424930,424930 +42,42,424A00,42494,42494 +42,42,424A00,424940,424940 +42,42,424A00,42495,42495 +42,42,424A00,424950,424950 +42,42,424A00,42499,42499 +42,42,424A00,424990,424990 +42,42,425000,425,425 +42,42,425000,4251,4251 +42,42,425000,42511,42511 +42,42,425000,425110,425110 +42,42,425000,42512,42512 +42,42,425000,425120,425120 +44RT,441,441000,44,44 +44RT,441,441000,44,44 +44RT,4A0,444000,44,44 +44RT,4A0,444000,44,44 +44RT,445,445000,44,44 +44RT,445,445000,44,44 +44RT,4A0,446000,44,44 +44RT,4A0,446000,44,44 +44RT,4A0,447000,44,44 +44RT,4A0,447000,44,44 +44RT,4A0,448000,44,44 +44RT,4A0,448000,44,44 +44RT,4A0,4B0000,44,44 +44RT,4A0,4B0000,44,44 +44RT,441,441000,441,441 +44RT,441,441000,4411,4411 +44RT,441,441000,44111,44111 +44RT,441,441000,441110,441110 +44RT,441,441000,44112,44112 +44RT,441,441000,441120,441120 +44RT,441,441000,4412,4412 +44RT,441,441000,44121,44121 +44RT,441,441000,441210,441210 +44RT,441,441000,44122,44122 +44RT,441,441000,441222,441222 +44RT,441,441000,441228,441228 +44RT,441,441000,441228,441228 +44RT,441,441000,4413,4413 +44RT,441,441000,44131,44131 +44RT,441,441000,441310,441310 +44RT,441,441000,44132,44132 +44RT,441,441000,441320,441320 +44RT,4A0,4B0000,442,442 +44RT,4A0,4B0000,4421,4421 +44RT,4A0,4B0000,44211,44211 +44RT,4A0,4B0000,442110,442110 +44RT,4A0,4B0000,4422,4422 +44RT,4A0,4B0000,44221,44221 +44RT,4A0,4B0000,442210,442210 +44RT,4A0,4B0000,44229,44229 +44RT,4A0,4B0000,442291,442291 +44RT,4A0,4B0000,442299,442299 +44RT,4A0,4B0000,443,443 +44RT,4A0,4B0000,443,443 +44RT,4A0,4B0000,4431,4431 +44RT,4A0,4B0000,4431,4431 +44RT,4A0,4B0000,44314,44314 +44RT,4A0,4B0000,44314,44314 +44RT,4A0,4B0000,44314,44314 +44RT,4A0,4B0000,44314,44314 +44RT,4A0,4B0000,443141,443141 +44RT,4A0,4B0000,443142,443142 +44RT,4A0,4B0000,443142,443142 +44RT,4A0,4B0000,443142,443142 +44RT,4A0,4B0000,443142,443142 +44RT,4A0,444000,444,444 +44RT,4A0,444000,4441,4441 +44RT,4A0,444000,44411,44411 +44RT,4A0,444000,444110,444110 +44RT,4A0,444000,44412,44412 +44RT,4A0,444000,444120,444120 +44RT,4A0,444000,44413,44413 +44RT,4A0,444000,444130,444130 +44RT,4A0,444000,44419,44419 +44RT,4A0,444000,444190,444190 +44RT,4A0,444000,4442,4442 +44RT,4A0,444000,44421,44421 +44RT,4A0,444000,444210,444210 +44RT,4A0,444000,44422,44422 +44RT,4A0,444000,444220,444220 +44RT,445,445000,445,445 +44RT,445,445000,4451,4451 +44RT,445,445000,44511,44511 +44RT,445,445000,445110,445110 +44RT,445,445000,44512,44512 +44RT,445,445000,445120,445120 +44RT,445,445000,4452,4452 +44RT,445,445000,44521,44521 +44RT,445,445000,445210,445210 +44RT,445,445000,44522,44522 +44RT,445,445000,445220,445220 +44RT,445,445000,44523,44523 +44RT,445,445000,445230,445230 +44RT,445,445000,44529,44529 +44RT,445,445000,445291,445291 +44RT,445,445000,445292,445292 +44RT,445,445000,445299,445299 +44RT,445,445000,4453,4453 +44RT,445,445000,44531,44531 +44RT,445,445000,445310,445310 +44RT,4A0,446000,446,446 +44RT,4A0,446000,4461,4461 +44RT,4A0,446000,44611,44611 +44RT,4A0,446000,446110,446110 +44RT,4A0,446000,44612,44612 +44RT,4A0,446000,446120,446120 +44RT,4A0,446000,44613,44613 +44RT,4A0,446000,446130,446130 +44RT,4A0,446000,44619,44619 +44RT,4A0,446000,446191,446191 +44RT,4A0,446000,446199,446199 +44RT,4A0,447000,447,447 +44RT,4A0,447000,4471,4471 +44RT,4A0,447000,44711,44711 +44RT,4A0,447000,447110,447110 +44RT,4A0,447000,44719,44719 +44RT,4A0,447000,447190,447190 +44RT,4A0,448000,448,448 +44RT,4A0,448000,4481,4481 +44RT,4A0,448000,44811,44811 +44RT,4A0,448000,448110,448110 +44RT,4A0,448000,44812,44812 +44RT,4A0,448000,448120,448120 +44RT,4A0,448000,44813,44813 +44RT,4A0,448000,448130,448130 +44RT,4A0,448000,44814,44814 +44RT,4A0,448000,448140,448140 +44RT,4A0,448000,44815,44815 +44RT,4A0,448000,448150,448150 +44RT,4A0,448000,44819,44819 +44RT,4A0,448000,448190,448190 +44RT,4A0,448000,4482,4482 +44RT,4A0,448000,44821,44821 +44RT,4A0,448000,448210,448210 +44RT,4A0,448000,4483,4483 +44RT,4A0,448000,44831,44831 +44RT,4A0,448000,448310,448310 +44RT,4A0,448000,44832,44832 +44RT,4A0,448000,448320,448320 +44RT,452,452000,45,45 +44RT,4A0,454000,45,45 +44RT,4A0,4B0000,45,45 +44RT,4A0,4B0000,451,451 +44RT,4A0,4B0000,4511,4511 +44RT,4A0,4B0000,45111,45111 +44RT,4A0,4B0000,451110,451110 +44RT,4A0,4B0000,45112,45112 +44RT,4A0,4B0000,451120,451120 +44RT,4A0,4B0000,45113,45113 +44RT,4A0,4B0000,451130,451130 +44RT,4A0,4B0000,45114,45114 +44RT,4A0,4B0000,451140,451140 +44RT,4A0,4B0000,4512,4512 +44RT,4A0,4B0000,45121,45121 +44RT,4A0,4B0000,451211,451211 +44RT,4A0,4B0000,451212,451212 +44RT,452,452000,452,452 +44RT,452,452000,4522,4521 +44RT,452,452000,45221,45211 +44RT,452,452000,452210,452112 +44RT,452,452000,452210,452111 +44RT,452,452000,4523,4529 +44RT,452,452000,4523,4521 +44RT,452,452000,45231,45211 +44RT,452,452000,45231,45299 +44RT,452,452000,45231,45291 +44RT,452,452000,452311,452910 +44RT,452,452000,452311,452112 +44RT,452,452000,452319,452990 +44RT,4A0,4B0000,453,453 +44RT,4A0,4B0000,4531,4531 +44RT,4A0,4B0000,45311,45311 +44RT,4A0,4B0000,453110,453110 +44RT,4A0,4B0000,4532,4532 +44RT,4A0,4B0000,45321,45321 +44RT,4A0,4B0000,453210,453210 +44RT,4A0,4B0000,45322,45322 +44RT,4A0,4B0000,453220,453220 +44RT,4A0,4B0000,4533,4533 +44RT,4A0,4B0000,45331,45331 +44RT,4A0,4B0000,453310,453310 +44RT,4A0,4B0000,4539,4539 +44RT,4A0,4B0000,45391,45391 +44RT,4A0,4B0000,453910,453910 +44RT,4A0,4B0000,45392,45392 +44RT,4A0,4B0000,453920,453920 +44RT,4A0,4B0000,45393,45393 +44RT,4A0,4B0000,453930,453930 +44RT,4A0,4B0000,45399,45399 +44RT,4A0,4B0000,453991,453991 +44RT,4A0,4B0000,453998,453998 +44RT,4A0,454000,454,454 +44RT,4A0,454000,4541,4541 +44RT,4A0,454000,45411,45411 +44RT,4A0,454000,454110,454113 +44RT,4A0,454000,454110,454112 +44RT,4A0,454000,454110,454111 +44RT,4A0,454000,4542,4542 +44RT,4A0,454000,45421,45421 +44RT,4A0,454000,454210,454210 +44RT,4A0,454000,4543,4543 +44RT,4A0,454000,45431,45431 +44RT,4A0,454000,454310,454310 +44RT,4A0,454000,454310,454310 +44RT,4A0,454000,454310,454310 +44RT,4A0,454000,45439,45439 +44RT,4A0,454000,454390,454390 +48TW,481,481000,48,48 +48TW,482,482000,48,48 +48TW,483,483000,48,48 +48TW,484,484000,48,48 +48TW,485,485000,48,48 +48TW,486,486000,48,48 +48TW,487OS,48A000,48,48 +48TW,481,481000,481,481 +48TW,481,481000,4811,4811 +48TW,481,481000,48111,48111 +48TW,481,481000,481111,481111 +48TW,481,481000,481112,481112 +48TW,481,481000,4812,4812 +48TW,481,481000,48121,48121 +48TW,481,481000,481211,481211 +48TW,481,481000,481212,481212 +48TW,481,481000,481219,481219 +48TW,482,482000,482,482 +48TW,482,482000,4821,4821 +48TW,482,482000,48211,48211 +48TW,482,482000,482111,482111 +48TW,482,482000,482112,482112 +48TW,483,483000,483,483 +48TW,483,483000,4831,4831 +48TW,483,483000,48311,48311 +48TW,483,483000,483111,483111 +48TW,483,483000,483112,483112 +48TW,483,483000,483113,483113 +48TW,483,483000,483114,483114 +48TW,483,483000,4832,4832 +48TW,483,483000,48321,48321 +48TW,483,483000,483211,483211 +48TW,483,483000,483212,483212 +48TW,484,484000,484,484 +48TW,484,484000,4841,4841 +48TW,484,484000,48411,48411 +48TW,484,484000,484110,484110 +48TW,484,484000,48412,48412 +48TW,484,484000,484121,484121 +48TW,484,484000,484122,484122 +48TW,484,484000,4842,4842 +48TW,484,484000,48421,48421 +48TW,484,484000,484210,484210 +48TW,484,484000,48422,48422 +48TW,484,484000,484220,484220 +48TW,484,484000,48423,48423 +48TW,484,484000,484230,484230 +48TW,485,485000,485,485 +48TW,485,485000,4851,4851 +48TW,485,485000,48511,48511 +48TW,485,485000,485111,485111 +48TW,485,485000,485112,485112 +48TW,485,485000,485113,485113 +48TW,485,485000,485119,485119 +48TW,485,485000,4852,4852 +48TW,485,485000,48521,48521 +48TW,485,485000,485210,485210 +48TW,485,485000,4853,4853 +48TW,485,485000,48531,48531 +48TW,485,485000,485310,485310 +48TW,485,485000,48532,48532 +48TW,485,485000,485320,485320 +48TW,485,485000,4854,4854 +48TW,485,485000,48541,48541 +48TW,485,485000,485410,485410 +48TW,485,485000,4855,4855 +48TW,485,485000,48551,48551 +48TW,485,485000,485510,485510 +48TW,485,485000,4859,4859 +48TW,485,485000,48599,48599 +48TW,485,485000,485991,485991 +48TW,485,485000,485999,485999 +48TW,486,486000,486,486 +48TW,486,486000,4861,4861 +48TW,486,486000,48611,48611 +48TW,486,486000,486110,486110 +48TW,486,486000,4862,4862 +48TW,486,486000,48621,48621 +48TW,486,486000,486210,486210 +48TW,486,486000,4869,4869 +48TW,486,486000,48691,48691 +48TW,486,486000,486910,486910 +48TW,486,486000,48699,48699 +48TW,486,486000,486990,486990 +48TW,487OS,48A000,487,487 +48TW,487OS,48A000,4871,4871 +48TW,487OS,48A000,48711,48711 +48TW,487OS,48A000,487110,487110 +48TW,487OS,48A000,4872,4872 +48TW,487OS,48A000,48721,48721 +48TW,487OS,48A000,487210,487210 +48TW,487OS,48A000,4879,4879 +48TW,487OS,48A000,48799,48799 +48TW,487OS,48A000,487990,487990 +48TW,487OS,48A000,488,488 +48TW,487OS,48A000,4881,4881 +48TW,487OS,48A000,48811,48811 +48TW,487OS,48A000,488111,488111 +48TW,487OS,48A000,488119,488119 +48TW,487OS,48A000,48819,48819 +48TW,487OS,48A000,488190,488190 +48TW,487OS,48A000,4882,4882 +48TW,487OS,48A000,48821,48821 +48TW,487OS,48A000,488210,488210 +48TW,487OS,48A000,4883,4883 +48TW,487OS,48A000,48831,48831 +48TW,487OS,48A000,488310,488310 +48TW,487OS,48A000,48832,48832 +48TW,487OS,48A000,488320,488320 +48TW,487OS,48A000,48833,48833 +48TW,487OS,48A000,488330,488330 +48TW,487OS,48A000,48839,48839 +48TW,487OS,48A000,488390,488390 +48TW,487OS,48A000,4884,4884 +48TW,487OS,48A000,48841,48841 +48TW,487OS,48A000,488410,488410 +48TW,487OS,48A000,48849,48849 +48TW,487OS,48A000,488490,488490 +48TW,487OS,48A000,4885,4885 +48TW,487OS,48A000,48851,48851 +48TW,487OS,48A000,488510,488510 +48TW,487OS,48A000,4889,4889 +48TW,487OS,48A000,48899,48899 +48TW,487OS,48A000,488991,488991 +48TW,487OS,48A000,488999,488999 +G,GFE,491000,49,49 +48TW,487OS,492000,49,49 +48TW,493,493000,49,49 +G,GFE,491000,491,491 +G,GFE,491000,4911,4911 +G,GFE,491000,49111,49111 +G,GFE,491000,491110,491110 +48TW,487OS,492000,492,492 +48TW,487OS,492000,4921,4921 +48TW,487OS,492000,49211,49211 +48TW,487OS,492000,492110,492110 +48TW,487OS,492000,4922,4922 +48TW,487OS,492000,49221,49221 +48TW,487OS,492000,492210,492210 +48TW,493,493000,493,493 +48TW,493,493000,4931,4931 +48TW,493,493000,49311,49311 +48TW,493,493000,493110,493110 +48TW,493,493000,49312,49312 +48TW,493,493000,493120,493120 +48TW,493,493000,49313,49313 +48TW,493,493000,493130,493130 +48TW,493,493000,49319,49319 +48TW,493,493000,493190,493190 +51,511,511110,51,51 +51,511,511120,51,51 +51,511,511130,51,51 +51,511,5111A0,51,51 +51,511,511200,51,51 +51,512,512100,51,51 +51,512,512200,51,51 +51,513,515100,51,51 +51,513,515200,51,51 +51,513,517110,51,51 +51,513,517210,51,51 +51,513,517A00,51,51 +51,514,518200,51,51 +51,514,519130,51,51 +51,514,5191A0,51,51 +51,511,511110,511,511 +51,511,511120,511,511 +51,511,511130,511,511 +51,511,5111A0,511,511 +51,511,511200,511,511 +51,511,511110,5111,5111 +51,511,511120,5111,5111 +51,511,511130,5111,5111 +51,511,5111A0,5111,5111 +51,511,511110,51111,51111 +51,511,511110,511110,511110 +51,511,511120,51112,51112 +51,511,511120,511120,511120 +51,511,511130,51113,51113 +51,511,511130,511130,511130 +51,511,5111A0,51114,51114 +51,511,5111A0,511140,511140 +51,511,5111A0,51119,51119 +51,511,5111A0,511191,511191 +51,511,5111A0,511199,511199 +51,511,511200,5112,5112 +51,511,511200,51121,51121 +51,511,511200,511210,511210 +51,512,512100,512,512 +51,512,512200,512,512 +51,512,512100,5121,5121 +51,512,512100,51211,51211 +51,512,512100,512110,512110 +51,512,512100,51212,51212 +51,512,512100,512120,512120 +51,512,512100,51213,51213 +51,512,512100,512131,512131 +51,512,512100,512132,512132 +51,512,512100,51219,51219 +51,512,512100,512191,512191 +51,512,512100,512199,512199 +51,512,512200,5122,5122 +51,512,512200,51223,51223 +51,512,512200,512230,512230 +51,512,512200,51224,51224 +51,512,512200,512240,512240 +51,512,512200,51225,51222 +51,512,512200,51225,51221 +51,512,512200,512250,512220 +51,512,512200,512250,512210 +51,512,512200,51229,51229 +51,512,512200,512290,512290 +51,513,515100,515,515 +51,513,515200,515,515 +51,513,515100,5151,5151 +51,513,515100,51511,51511 +51,513,515100,515111,515111 +51,513,515100,515112,515112 +51,513,515100,51512,51512 +51,513,515100,515120,515120 +51,513,515200,5152,5152 +51,513,515200,51521,51521 +51,513,515200,515210,515210 +51,513,517110,517,517 +51,513,517210,517,517 +51,513,517A00,517,517 +51,513,517110,5173,5171 +51,513,517110,5173,5172 +51,513,517210,5173,5171 +51,513,517210,5173,5172 +51,513,517110,51731,51711 +51,513,517110,51731,51721 +51,513,517210,51731,51711 +51,513,517210,51731,51721 +51,513,517110,517311,517110 +51,513,517210,517312,517210 +51,513,517A00,5174,5174 +51,513,517A00,51741,51741 +51,513,517A00,517410,517410 +51,513,517A00,5179,5179 +51,513,517A00,51791,51791 +51,513,517A00,517911,517911 +51,513,517A00,517919,517919 +51,514,518200,518,518 +51,514,518200,5182,5182 +51,514,518200,51821,51821 +51,514,518200,518210,518210 +51,514,519130,519,519 +51,514,5191A0,519,519 +51,514,519130,5191,5191 +51,514,5191A0,5191,5191 +51,514,5191A0,51911,51911 +51,514,5191A0,519110,519110 +51,514,5191A0,51912,51912 +51,514,5191A0,519120,519120 +51,514,519130,51913,51913 +51,514,519130,519130,519130 +51,514,5191A0,51919,51919 +51,514,5191A0,519190,519190 +FIRE,521CI,522A00,52,52 +FIRE,523,523900,52,52 +FIRE,523,523A00,52,52 +FIRE,524,524113,52,52 +FIRE,524,5241XX,52,52 +FIRE,524,524200,52,52 +FIRE,525,525000,52,52 +FIRE,521CI,52A000,52,52 +FIRE,521CI,52A000,521,521 +FIRE,521CI,52A000,5211,5211 +FIRE,521CI,52A000,52111,52111 +FIRE,521CI,52A000,521110,521110 +FIRE,521CI,522A00,522,522 +FIRE,521CI,52A000,522,522 +FIRE,521CI,52A000,5221,5221 +FIRE,521CI,52A000,52211,52211 +FIRE,521CI,52A000,522110,522110 +FIRE,521CI,52A000,52212,52212 +FIRE,521CI,52A000,522120,522120 +FIRE,521CI,52A000,52213,52213 +FIRE,521CI,52A000,522130,522130 +FIRE,521CI,52A000,52219,52219 +FIRE,521CI,52A000,522190,522190 +FIRE,521CI,522A00,5222,5222 +FIRE,521CI,522A00,52221,52221 +FIRE,521CI,522A00,522210,522210 +FIRE,521CI,522A00,52222,52222 +FIRE,521CI,522A00,522220,522220 +FIRE,521CI,522A00,52229,52229 +FIRE,521CI,522A00,522291,522291 +FIRE,521CI,522A00,522292,522292 +FIRE,521CI,522A00,522293,522293 +FIRE,521CI,522A00,522294,522294 +FIRE,521CI,522A00,522298,522298 +FIRE,521CI,522A00,5223,5223 +FIRE,521CI,522A00,52231,52231 +FIRE,521CI,522A00,522310,522310 +FIRE,521CI,522A00,52232,52232 +FIRE,521CI,522A00,522320,522320 +FIRE,521CI,522A00,52239,52239 +FIRE,521CI,522A00,522390,522390 +FIRE,523,523900,523,523 +FIRE,523,523A00,523,523 +FIRE,523,523A00,5231,5231 +FIRE,523,523A00,52311,52311 +FIRE,523,523A00,523110,523110 +FIRE,523,523A00,52312,52312 +FIRE,523,523A00,523120,523120 +FIRE,523,523A00,52313,52313 +FIRE,523,523A00,523130,523130 +FIRE,523,523A00,52314,52314 +FIRE,523,523A00,523140,523140 +FIRE,523,523A00,5232,5232 +FIRE,523,523A00,52321,52321 +FIRE,523,523A00,523210,523210 +FIRE,523,523900,5239,5239 +FIRE,523,523900,52391,52391 +FIRE,523,523900,523910,523910 +FIRE,523,523900,52392,52392 +FIRE,523,523900,523920,523920 +FIRE,523,523900,52393,52393 +FIRE,523,523900,523930,523930 +FIRE,523,523900,52399,52399 +FIRE,523,523900,523991,523991 +FIRE,523,523900,523999,523999 +FIRE,524,524113,524,524 +FIRE,524,5241XX,524,524 +FIRE,524,524200,524,524 +FIRE,524,524113,5241,5241 +FIRE,524,5241XX,5241,5241 +FIRE,524,524113,52411,52411 +FIRE,524,5241XX,52411,52411 +FIRE,524,524113,524113,524113 +FIRE,524,5241XX,524114,524114 +FIRE,524,5241XX,52412,52412 +FIRE,524,5241XX,524126,524126 +FIRE,524,5241XX,524127,524127 +FIRE,524,5241XX,524128,524128 +FIRE,524,5241XX,52413,52413 +FIRE,524,5241XX,524130,524130 +FIRE,524,524200,5242,5242 +FIRE,524,524200,52421,52421 +FIRE,524,524200,524210,524210 +FIRE,524,524200,52429,52429 +FIRE,524,524200,524291,524291 +FIRE,524,524200,524292,524292 +FIRE,524,524200,524298,524298 +FIRE,525,525000,525,525 +FIRE,525,525000,5251,5251 +FIRE,525,525000,52511,52511 +FIRE,525,525000,525110,525110 +FIRE,525,525000,52512,52512 +FIRE,525,525000,525120,525120 +FIRE,525,525000,52519,52519 +FIRE,525,525000,525190,525190 +FIRE,525,525000,5259,5259 +FIRE,525,525000,52591,52591 +FIRE,525,525000,525910,525910 +FIRE,525,525000,52592,52592 +FIRE,525,525000,525920,525920 +FIRE,525,525000,52599,52599 +FIRE,525,525000,525990,525990 +FIRE,HS,531HSO,53,53 +FIRE,HS,531HST,53,53 +FIRE,ORE,531ORE,53,53 +FIRE,532RL,532100,53,53 +FIRE,532RL,532400,53,53 +FIRE,532RL,532A00,53,53 +FIRE,532RL,533000,53,53 +FIRE,HS,531HSO,531,531 +FIRE,HS,531HST,531,531 +FIRE,ORE,531ORE,531,531 +FIRE,HS,531HSO,5311,5311 +FIRE,HS,531HST,5311,5311 +FIRE,ORE,531ORE,5311,5311 +FIRE,HS,531HSO,53111,53111 +FIRE,HS,531HST,53111,53111 +FIRE,HS,531HSO,531110,531110 +FIRE,HS,531HST,531110,531110 +FIRE,ORE,531ORE,53112,53112 +FIRE,ORE,531ORE,531120,531120 +FIRE,ORE,531ORE,53113,53113 +FIRE,ORE,531ORE,531130,531130 +FIRE,ORE,531ORE,53119,53119 +FIRE,ORE,531ORE,531190,531190 +FIRE,ORE,531ORE,5312,5312 +FIRE,ORE,531ORE,53121,53121 +FIRE,ORE,531ORE,531210,531210 +FIRE,ORE,531ORE,5313,5313 +FIRE,ORE,531ORE,53131,53131 +FIRE,ORE,531ORE,531311,531311 +FIRE,ORE,531ORE,531312,531312 +FIRE,ORE,531ORE,53132,53132 +FIRE,ORE,531ORE,531320,531320 +FIRE,ORE,531ORE,53139,53139 +FIRE,ORE,531ORE,531390,531390 +FIRE,532RL,532100,532,532 +FIRE,532RL,532400,532,532 +FIRE,532RL,532A00,532,532 +FIRE,532RL,532100,5321,5321 +FIRE,532RL,532100,53211,53211 +FIRE,532RL,532100,532111,532111 +FIRE,532RL,532100,532112,532112 +FIRE,532RL,532100,53212,53212 +FIRE,532RL,532100,532120,532120 +FIRE,532RL,532A00,5322,5322 +FIRE,532RL,532A00,53221,53221 +FIRE,532RL,532A00,532210,532210 +FIRE,532RL,532A00,53228,53222 +FIRE,532RL,532A00,53228,53223 +FIRE,532RL,532A00,53228,53229 +FIRE,532RL,532A00,532281,532220 +FIRE,532RL,532A00,532282,532230 +FIRE,532RL,532A00,532283,532291 +FIRE,532RL,532A00,532284,532292 +FIRE,532RL,532A00,532289,532299 +FIRE,532RL,532A00,5323,5323 +FIRE,532RL,532A00,53231,53231 +FIRE,532RL,532A00,532310,532310 +FIRE,532RL,532400,5324,5324 +FIRE,532RL,532400,53241,53241 +FIRE,532RL,532400,532411,532411 +FIRE,532RL,532400,532412,532412 +FIRE,532RL,532400,53242,53242 +FIRE,532RL,532400,532420,532420 +FIRE,532RL,532400,53249,53249 +FIRE,532RL,532400,532490,532490 +FIRE,532RL,533000,533,533 +FIRE,532RL,533000,5331,5331 +FIRE,532RL,533000,53311,53311 +FIRE,532RL,533000,533110,533110 +PROF,5411,541100,54,54 +PROF,5412OP,541200,54,54 +PROF,5412OP,541300,54,54 +PROF,5412OP,541400,54,54 +PROF,5415,541511,54,54 +PROF,5415,541512,54,54 +PROF,5415,54151A,54,54 +PROF,5412OP,541610,54,54 +PROF,5412OP,5416A0,54,54 +PROF,5412OP,541700,54,54 +PROF,5412OP,541800,54,54 +PROF,5412OP,541920,54,54 +PROF,5412OP,541940,54,54 +PROF,5412OP,5419A0,54,54 +PROF,5411,541100,541,541 +PROF,5412OP,541200,541,541 +PROF,5412OP,541300,541,541 +PROF,5412OP,541400,541,541 +PROF,5415,541511,541,541 +PROF,5415,541512,541,541 +PROF,5415,54151A,541,541 +PROF,5412OP,541610,541,541 +PROF,5412OP,5416A0,541,541 +PROF,5412OP,541700,541,541 +PROF,5412OP,541800,541,541 +PROF,5412OP,541920,541,541 +PROF,5412OP,541940,541,541 +PROF,5412OP,5419A0,541,541 +PROF,5411,541100,5411,5411 +PROF,5411,541100,54111,54111 +PROF,5411,541100,541110,541110 +PROF,5411,541100,54112,54112 +PROF,5411,541100,541120,541120 +PROF,5411,541100,54119,54119 +PROF,5411,541100,541191,541191 +PROF,5411,541100,541199,541199 +PROF,5412OP,541200,5412,5412 +PROF,5412OP,541200,54121,54121 +PROF,5412OP,541200,541211,541211 +PROF,5412OP,541200,541213,541213 +PROF,5412OP,541200,541214,541214 +PROF,5412OP,541200,541219,541219 +PROF,5412OP,541300,5413,5413 +PROF,5412OP,541300,54131,54131 +PROF,5412OP,541300,541310,541310 +PROF,5412OP,541300,54132,54132 +PROF,5412OP,541300,541320,541320 +PROF,5412OP,541300,54133,54133 +PROF,5412OP,541300,541330,541330 +PROF,5412OP,541300,54134,54134 +PROF,5412OP,541300,541340,541340 +PROF,5412OP,541300,54135,54135 +PROF,5412OP,541300,541350,541350 +PROF,5412OP,541300,54136,54136 +PROF,5412OP,541300,541360,541360 +PROF,5412OP,541300,54137,54137 +PROF,5412OP,541300,541370,541370 +PROF,5412OP,541300,54138,54138 +PROF,5412OP,541300,541380,541380 +PROF,5412OP,541400,5414,5414 +PROF,5412OP,541400,54141,54141 +PROF,5412OP,541400,541410,541410 +PROF,5412OP,541400,54142,54142 +PROF,5412OP,541400,541420,541420 +PROF,5412OP,541400,54143,54143 +PROF,5412OP,541400,541430,541430 +PROF,5412OP,541400,54149,54149 +PROF,5412OP,541400,541490,541490 +PROF,5415,541511,5415,5415 +PROF,5415,541512,5415,5415 +PROF,5415,54151A,5415,5415 +PROF,5415,541511,54151,54151 +PROF,5415,541512,54151,54151 +PROF,5415,54151A,54151,54151 +PROF,5415,541511,541511,541511 +PROF,5415,541512,541512,541512 +PROF,5415,54151A,541513,541513 +PROF,5415,54151A,541519,541519 +PROF,5412OP,541610,5416,5416 +PROF,5412OP,5416A0,5416,5416 +PROF,5412OP,541610,54161,54161 +PROF,5412OP,541610,541611,541611 +PROF,5412OP,541610,541612,541612 +PROF,5412OP,541610,541613,541613 +PROF,5412OP,541610,541614,541614 +PROF,5412OP,541610,541618,541618 +PROF,5412OP,5416A0,54162,54162 +PROF,5412OP,5416A0,541620,541620 +PROF,5412OP,5416A0,54169,54169 +PROF,5412OP,5416A0,541690,541690 +PROF,5412OP,541700,5417,5417 +PROF,5412OP,541700,54171,54171 +PROF,5412OP,541700,541713,541711 +PROF,5412OP,541700,541713,541712 +PROF,5412OP,541700,541714,541711 +PROF,5412OP,541700,541715,541712 +PROF,5412OP,541700,54172,54172 +PROF,5412OP,541700,541720,541720 +PROF,5412OP,541800,5418,5418 +PROF,5412OP,541800,54181,54181 +PROF,5412OP,541800,541810,541810 +PROF,5412OP,541800,54182,54182 +PROF,5412OP,541800,541820,541820 +PROF,5412OP,541800,54183,54183 +PROF,5412OP,541800,541830,541830 +PROF,5412OP,541800,54184,54184 +PROF,5412OP,541800,541840,541840 +PROF,5412OP,541800,54185,54185 +PROF,5412OP,541800,541850,541850 +PROF,5412OP,541800,54186,54186 +PROF,5412OP,541800,541860,541860 +PROF,5412OP,541800,54187,54187 +PROF,5412OP,541800,541870,541870 +PROF,5412OP,541800,54189,54189 +PROF,5412OP,541800,541890,541890 +PROF,5412OP,541920,5419,5419 +PROF,5412OP,541940,5419,5419 +PROF,5412OP,5419A0,5419,5419 +PROF,5412OP,5419A0,54191,54191 +PROF,5412OP,5419A0,541910,541910 +PROF,5412OP,541920,54192,54192 +PROF,5412OP,541920,541921,541921 +PROF,5412OP,541920,541922,541922 +PROF,5412OP,5419A0,54193,54193 +PROF,5412OP,5419A0,541930,541930 +PROF,5412OP,541940,54194,54194 +PROF,5412OP,541940,541940,541940 +PROF,5412OP,5419A0,54199,54199 +PROF,5412OP,5419A0,541990,541990 +PROF,55,550000,55,55 +PROF,55,550000,551,551 +PROF,55,550000,5511,5511 +PROF,55,550000,55111,55111 +PROF,55,550000,551111,551111 +PROF,55,550000,551112,551112 +PROF,55,550000,551114,551114 +PROF,561,561100,56,56 +PROF,561,561200,56,56 +PROF,561,561300,56,56 +PROF,561,561400,56,56 +PROF,561,561500,56,56 +PROF,561,561600,56,56 +PROF,561,561700,56,56 +PROF,561,561900,56,56 +PROF,562,562000,56,56 +PROF,561,561100,561,561 +PROF,561,561200,561,561 +PROF,561,561300,561,561 +PROF,561,561400,561,561 +PROF,561,561500,561,561 +PROF,561,561600,561,561 +PROF,561,561700,561,561 +PROF,561,561900,561,561 +PROF,561,561100,5611,5611 +PROF,561,561100,56111,56111 +PROF,561,561100,561110,561110 +PROF,561,561200,5612,5612 +PROF,561,561200,56121,56121 +PROF,561,561200,561210,561210 +PROF,561,561300,5613,5613 +PROF,561,561300,56131,56131 +PROF,561,561300,561311,561311 +PROF,561,561300,561312,561312 +PROF,561,561300,56132,56132 +PROF,561,561300,561320,561320 +PROF,561,561300,56133,56133 +PROF,561,561300,561330,561330 +PROF,561,561400,5614,5614 +PROF,561,561400,56141,56141 +PROF,561,561400,561410,561410 +PROF,561,561400,56142,56142 +PROF,561,561400,561421,561421 +PROF,561,561400,561422,561422 +PROF,561,561400,56143,56143 +PROF,561,561400,561431,561431 +PROF,561,561400,561439,561439 +PROF,561,561400,56144,56144 +PROF,561,561400,561440,561440 +PROF,561,561400,56145,56145 +PROF,561,561400,561450,561450 +PROF,561,561400,56149,56149 +PROF,561,561400,561491,561491 +PROF,561,561400,561492,561492 +PROF,561,561400,561499,561499 +PROF,561,561500,5615,5615 +PROF,561,561500,56151,56151 +PROF,561,561500,561510,561510 +PROF,561,561500,56152,56152 +PROF,561,561500,561520,561520 +PROF,561,561500,56159,56159 +PROF,561,561500,561591,561591 +PROF,561,561500,561599,561599 +PROF,561,561600,5616,5616 +PROF,561,561600,56161,56161 +PROF,561,561600,561611,561611 +PROF,561,561600,561612,561612 +PROF,561,561600,561613,561613 +PROF,561,561600,56162,56162 +PROF,561,561600,561621,561621 +PROF,561,561600,561622,561622 +PROF,561,561700,5617,5617 +PROF,561,561700,56171,56171 +PROF,561,561700,561710,561710 +PROF,561,561700,56172,56172 +PROF,561,561700,561720,561720 +PROF,561,561700,56173,56173 +PROF,561,561700,561730,561730 +PROF,561,561700,56174,56174 +PROF,561,561700,561740,561740 +PROF,561,561700,56179,56179 +PROF,561,561700,561790,561790 +PROF,561,561900,5619,5619 +PROF,561,561900,56191,56191 +PROF,561,561900,561910,561910 +PROF,561,561900,56192,56192 +PROF,561,561900,561920,561920 +PROF,561,561900,56199,56199 +PROF,561,561900,561990,561990 +PROF,562,562000,562,562 +PROF,562,562000,5621,5621 +PROF,562,562000,56211,56211 +PROF,562,562000,562111,562111 +PROF,562,562000,562112,562112 +PROF,562,562000,562119,562119 +PROF,562,562000,5622,5622 +PROF,562,562000,56221,56221 +PROF,562,562000,562211,562211 +PROF,562,562000,562212,562212 +PROF,562,562000,562213,562213 +PROF,562,562000,562219,562219 +PROF,562,562000,5629,5629 +PROF,562,562000,56291,56291 +PROF,562,562000,562910,562910 +PROF,562,562000,56292,56292 +PROF,562,562000,562920,562920 +PROF,562,562000,56299,56299 +PROF,562,562000,562991,562991 +PROF,562,562000,562998,562998 +6,61,611100,61,61 +6,61,611A00,61,61 +6,61,611B00,61,61 +6,61,611100,611,611 +6,61,611A00,611,611 +6,61,611B00,611,611 +6,61,611100,6111,6111 +6,61,611100,61111,61111 +6,61,611100,611110,611110 +6,61,611A00,6112,6112 +6,61,611A00,61121,61121 +6,61,611A00,611210,611210 +6,61,611A00,6113,6113 +6,61,611A00,61131,61131 +6,61,611A00,611310,611310 +6,61,611B00,6114,6114 +6,61,611B00,61141,61141 +6,61,611B00,611410,611410 +6,61,611B00,61142,61142 +6,61,611B00,611420,611420 +6,61,611B00,61143,61143 +6,61,611B00,611430,611430 +6,61,611B00,6115,6115 +6,61,611B00,61151,61151 +6,61,611B00,611511,611511 +6,61,611B00,611512,611512 +6,61,611B00,611513,611513 +6,61,611B00,611519,611519 +6,61,611B00,6116,6116 +6,61,611B00,61161,61161 +6,61,611B00,611610,611610 +6,61,611B00,61162,61162 +6,61,611B00,611620,611620 +6,61,611B00,61163,61163 +6,61,611B00,611630,611630 +6,61,611B00,61169,61169 +6,61,611B00,611691,611691 +6,61,611B00,611692,611692 +6,61,611B00,611699,611699 +6,61,611B00,6117,6117 +6,61,611B00,61171,61171 +6,61,611B00,611710,611710 +6,621,621100,62,62 +6,621,621200,62,62 +6,621,621300,62,62 +6,621,621400,62,62 +6,621,621500,62,62 +6,621,621600,62,62 +6,621,621900,62,62 +6,622,622000,62,62 +6,623,623A00,62,62 +6,623,623B00,62,62 +6,624,624100,62,62 +6,624,624400,62,62 +6,624,624A00,62,62 +6,621,621100,621,621 +6,621,621200,621,621 +6,621,621300,621,621 +6,621,621400,621,621 +6,621,621500,621,621 +6,621,621600,621,621 +6,621,621900,621,621 +6,621,621100,6211,6211 +6,621,621100,62111,62111 +6,621,621100,621111,621111 +6,621,621100,621112,621112 +6,621,621200,6212,6212 +6,621,621200,62121,62121 +6,621,621200,621210,621210 +6,621,621300,6213,6213 +6,621,621300,62131,62131 +6,621,621300,621310,621310 +6,621,621300,62132,62132 +6,621,621300,621320,621320 +6,621,621300,62133,62133 +6,621,621300,621330,621330 +6,621,621300,62134,62134 +6,621,621300,621340,621340 +6,621,621300,62139,62139 +6,621,621300,621391,621391 +6,621,621300,621399,621399 +6,621,621400,6214,6214 +6,621,621400,62141,62141 +6,621,621400,621410,621410 +6,621,621400,62142,62142 +6,621,621400,621420,621420 +6,621,621400,62149,62149 +6,621,621400,621491,621491 +6,621,621400,621492,621492 +6,621,621400,621493,621493 +6,621,621400,621498,621498 +6,621,621500,6215,6215 +6,621,621500,62151,62151 +6,621,621500,621511,621511 +6,621,621500,621512,621512 +6,621,621600,6216,6216 +6,621,621600,62161,62161 +6,621,621600,621610,621610 +6,621,621900,6219,6219 +6,621,621900,62191,62191 +6,621,621900,621910,621910 +6,621,621900,62199,62199 +6,621,621900,621991,621991 +6,621,621900,621999,621999 +6,622,622000,622,622 +6,622,622000,6221,6221 +6,622,622000,62211,62211 +6,622,622000,622110,622110 +6,622,622000,6222,6222 +6,622,622000,62221,62221 +6,622,622000,622210,622210 +6,622,622000,6223,6223 +6,622,622000,62231,62231 +6,622,622000,622310,622310 +6,623,623A00,623,623 +6,623,623B00,623,623 +6,623,623A00,6231,6231 +6,623,623A00,62311,62311 +6,623,623A00,623110,623110 +6,623,623B00,6232,6232 +6,623,623B00,62321,62321 +6,623,623B00,623210,623210 +6,623,623B00,62322,62322 +6,623,623B00,623220,623220 +6,623,623A00,6233,6233 +6,623,623A00,62331,62331 +6,623,623A00,623311,623311 +6,623,623A00,623312,623312 +6,623,623B00,6239,6239 +6,623,623B00,62399,62399 +6,623,623B00,623990,623990 +6,624,624100,624,624 +6,624,624400,624,624 +6,624,624A00,624,624 +6,624,624100,6241,6241 +6,624,624100,62411,62411 +6,624,624100,624110,624110 +6,624,624100,62412,62412 +6,624,624100,624120,624120 +6,624,624100,62419,62419 +6,624,624100,624190,624190 +6,624,624A00,6242,6242 +6,624,624A00,62421,62421 +6,624,624A00,624210,624210 +6,624,624A00,62422,62422 +6,624,624A00,624221,624221 +6,624,624A00,624229,624229 +6,624,624A00,62423,62423 +6,624,624A00,624230,624230 +6,624,624A00,6243,6243 +6,624,624A00,62431,62431 +6,624,624A00,624310,624310 +6,624,624400,6244,6244 +6,624,624400,62441,62441 +6,624,624400,624410,624410 +7,711AS,711100,71,71 +7,711AS,711200,71,71 +7,711AS,711500,71,71 +7,711AS,711A00,71,71 +7,711AS,712000,71,71 +7,713,713100,71,71 +7,713,713200,71,71 +7,713,713900,71,71 +7,711AS,711100,711,711 +7,711AS,711200,711,711 +7,711AS,711500,711,711 +7,711AS,711A00,711,711 +7,711AS,711100,7111,7111 +7,711AS,711100,71111,71111 +7,711AS,711100,711110,711110 +7,711AS,711100,71112,71112 +7,711AS,711100,711120,711120 +7,711AS,711100,71113,71113 +7,711AS,711100,711130,711130 +7,711AS,711100,71119,71119 +7,711AS,711100,711190,711190 +7,711AS,711200,7112,7112 +7,711AS,711200,71121,71121 +7,711AS,711200,711211,711211 +7,711AS,711200,711212,711212 +7,711AS,711200,711219,711219 +7,711AS,711A00,7113,7113 +7,711AS,711A00,71131,71131 +7,711AS,711A00,711310,711310 +7,711AS,711A00,71132,71132 +7,711AS,711A00,711320,711320 +7,711AS,711A00,7114,7114 +7,711AS,711A00,71141,71141 +7,711AS,711A00,711410,711410 +7,711AS,711500,7115,7115 +7,711AS,711500,71151,71151 +7,711AS,711500,711510,711510 +7,711AS,712000,712,712 +7,711AS,712000,7121,7121 +7,711AS,712000,71211,71211 +7,711AS,712000,712110,712110 +7,711AS,712000,71212,71212 +7,711AS,712000,712120,712120 +7,711AS,712000,71213,71213 +7,711AS,712000,712130,712130 +7,711AS,712000,71219,71219 +7,711AS,712000,712190,712190 +7,713,713100,713,713 +7,713,713200,713,713 +7,713,713900,713,713 +7,713,713100,7131,7131 +7,713,713100,71311,71311 +7,713,713100,713110,713110 +7,713,713100,71312,71312 +7,713,713100,713120,713120 +7,713,713200,7132,7132 +7,713,713200,71321,71321 +7,713,713200,713210,713210 +7,713,713200,71329,71329 +7,713,713200,713290,713290 +7,713,713900,7139,7139 +7,713,713900,71391,71391 +7,713,713900,713910,713910 +7,713,713900,71392,71392 +7,713,713900,713920,713920 +7,713,713900,71393,71393 +7,713,713900,713930,713930 +7,713,713900,71394,71394 +7,713,713900,713940,713940 +7,713,713900,71395,71395 +7,713,713900,713950,713950 +7,713,713900,71399,71399 +7,713,713900,713990,713990 +7,721,721000,72,72 +7,722,722110,72,72 +7,722,722211,72,72 +7,722,722A00,72,72 +7,721,721000,721,721 +7,721,721000,7211,7211 +7,721,721000,72111,72111 +7,721,721000,721110,721110 +7,721,721000,72112,72112 +7,721,721000,721120,721120 +7,721,721000,72119,72119 +7,721,721000,721191,721191 +7,721,721000,721199,721199 +7,721,721000,7212,7212 +7,721,721000,72121,72121 +7,721,721000,721211,721211 +7,721,721000,721214,721214 +7,721,721000,7213,7213 +7,721,721000,72131,72131 +7,721,721000,721310,721310 +7,722,722110,722,722 +7,722,722211,722,722 +7,722,722A00,722,722 +7,722,722A00,7223,7223 +7,722,722A00,72231,72231 +7,722,722A00,722310,722310 +7,722,722A00,72232,72232 +7,722,722A00,722320,722320 +7,722,722A00,72233,72233 +7,722,722A00,722330,722330 +7,722,722A00,7224,7224 +7,722,722A00,72241,72241 +7,722,722A00,722410,722410 +7,722,722110,7225,7225 +7,722,722110,7225,7225 +7,722,722211,7225,7225 +7,722,722211,7225,7225 +7,722,722A00,7225,7225 +7,722,722A00,7225,7225 +7,722,722110,72251,72251 +7,722,722110,72251,72251 +7,722,722211,72251,72251 +7,722,722211,72251,72251 +7,722,722A00,72251,72251 +7,722,722A00,72251,72251 +7,722,722110,722511,722511 +7,722,722211,722513,722513 +7,722,722A00,722514,722514 +7,722,722A00,722515,722515 +81,81,811100,81,81 +81,81,811200,81,81 +81,81,811300,81,81 +81,81,811400,81,81 +81,81,812100,81,81 +81,81,812200,81,81 +81,81,812300,81,81 +81,81,812900,81,81 +81,81,813100,81,81 +81,81,813A00,81,81 +81,81,813B00,81,81 +81,81,814000,81,81 +81,81,811100,811,811 +81,81,811200,811,811 +81,81,811300,811,811 +81,81,811400,811,811 +81,81,811100,8111,8111 +81,81,811100,81111,81111 +81,81,811100,811111,811111 +81,81,811100,811112,811112 +81,81,811100,811113,811113 +81,81,811100,811118,811118 +81,81,811100,81112,81112 +81,81,811100,811121,811121 +81,81,811100,811122,811122 +81,81,811100,81119,81119 +81,81,811100,811191,811191 +81,81,811100,811192,811192 +81,81,811100,811198,811198 +81,81,811200,8112,8112 +81,81,811200,81121,81121 +81,81,811200,811211,811211 +81,81,811200,811212,811212 +81,81,811200,811213,811213 +81,81,811200,811219,811219 +81,81,811300,8113,8113 +81,81,811300,81131,81131 +81,81,811300,811310,811310 +81,81,811400,8114,8114 +81,81,811400,81141,81141 +81,81,811400,811411,811411 +81,81,811400,811412,811412 +81,81,811400,81142,81142 +81,81,811400,811420,811420 +81,81,811400,81143,81143 +81,81,811400,811430,811430 +81,81,811400,81149,81149 +81,81,811400,811490,811490 +81,81,812100,812,812 +81,81,812200,812,812 +81,81,812300,812,812 +81,81,812900,812,812 +81,81,812100,8121,8121 +81,81,812100,81211,81211 +81,81,812100,812111,812111 +81,81,812100,812112,812112 +81,81,812100,812113,812113 +81,81,812100,81219,81219 +81,81,812100,812191,812191 +81,81,812100,812199,812199 +81,81,812200,8122,8122 +81,81,812200,81221,81221 +81,81,812200,812210,812210 +81,81,812200,81222,81222 +81,81,812200,812220,812220 +81,81,812300,8123,8123 +81,81,812300,81231,81231 +81,81,812300,812310,812310 +81,81,812300,81232,81232 +81,81,812300,812320,812320 +81,81,812300,81233,81233 +81,81,812300,812331,812331 +81,81,812300,812332,812332 +81,81,812900,8129,8129 +81,81,812900,81291,81291 +81,81,812900,812910,812910 +81,81,812900,81292,81292 +81,81,812900,812921,812921 +81,81,812900,812922,812922 +81,81,812900,81293,81293 +81,81,812900,812930,812930 +81,81,812900,81299,81299 +81,81,812900,812990,812990 +81,81,813100,813,813 +81,81,813A00,813,813 +81,81,813B00,813,813 +81,81,813100,8131,8131 +81,81,813100,81311,81311 +81,81,813100,813110,813110 +81,81,813A00,8132,8132 +81,81,813A00,81321,81321 +81,81,813A00,813211,813211 +81,81,813A00,813212,813212 +81,81,813A00,813219,813219 +81,81,813A00,8133,8133 +81,81,813A00,81331,81331 +81,81,813A00,813311,813311 +81,81,813A00,813312,813312 +81,81,813A00,813319,813319 +81,81,813B00,8134,8134 +81,81,813B00,81341,81341 +81,81,813B00,813410,813410 +81,81,813B00,8139,8139 +81,81,813B00,81391,81391 +81,81,813B00,813910,813910 +81,81,813B00,81392,81392 +81,81,813B00,813920,813920 +81,81,813B00,81393,81393 +81,81,813B00,813930,813930 +81,81,813B00,81394,81394 +81,81,813B00,813940,813940 +81,81,813B00,81399,81399 +81,81,813B00,813990,813990 +81,81,814000,814,814 +81,81,814000,8141,8141 +81,81,814000,81411,81411 +81,81,814000,814110,814110 +G,GSLG,GSLGE,92,92 +G,GSLG,GSLGH,92,92 +G,GSLG,GSLGO,92,92 +G,GFE,S00102,92,92 +G,GSLE,S00203,92,92 +G,GFGD,S00500,92,92 +G,GFGN,S00600,92,92 +G,GSLG,GSLGO,921,921 +G,GFGN,S00600,921,921 +G,GSLG,GSLGO,9211,9211 +G,GFGN,S00600,9211,9211 +G,GSLG,GSLGO,92111,92111 +G,GFGN,S00600,92111,92111 +G,GSLG,GSLGO,921110,921110 +G,GFGN,S00600,921110,921110 +G,GSLG,GSLGO,92112,92112 +G,GFGN,S00600,92112,92112 +G,GSLG,GSLGO,921120,921120 +G,GFGN,S00600,921120,921120 +G,GSLG,GSLGO,92113,92113 +G,GFGN,S00600,92113,92113 +G,GSLG,GSLGO,921130,921130 +G,GFGN,S00600,921130,921130 +G,GSLG,GSLGO,92114,92114 +G,GFGN,S00600,92114,92114 +G,GSLG,GSLGO,921140,921140 +G,GFGN,S00600,921140,921140 +G,GSLG,GSLGO,92115,92115 +G,GSLG,GSLGO,921150,921150 +G,GSLG,GSLGO,92119,92119 +G,GFGN,S00600,92119,92119 +G,GSLG,GSLGO,921190,921190 +G,GFGN,S00600,921190,921190 +G,GSLG,GSLGO,922,922 +G,GSLE,S00203,922,922 +G,GFGN,S00600,922,922 +G,GSLG,GSLGO,9221,9221 +G,GFE,S00102,9221,9221 +G,GSLE,S00203,9221,9221 +G,GFGN,S00600,9221,9221 +G,GSLG,GSLGO,92211,92211 +G,GFGN,S00600,92211,92211 +G,GSLG,GSLGO,922110,922110 +G,GFGN,S00600,922110,922110 +G,GSLG,GSLGO,92212,92212 +G,GFE,S00102,92212,92212 +G,GSLE,S00203,92212,92212 +G,GFGN,S00600,92212,92212 +G,GSLG,GSLGO,922120,922120 +G,GFE,S00102,922120,922120 +G,GSLE,S00203,922120,922120 +G,GFGN,S00600,922120,922120 +G,GSLG,GSLGO,92213,92213 +G,GFGN,S00600,92213,92213 +G,GSLG,GSLGO,922130,922130 +G,GFGN,S00600,922130,922130 +G,GSLG,GSLGO,92214,92214 +G,GFE,S00102,92214,92214 +G,GSLE,S00203,92214,92214 +G,GFGN,S00600,92214,92214 +G,GSLG,GSLGO,922140,922140 +G,GFE,S00102,922140,922140 +G,GSLE,S00203,922140,922140 +G,GFGN,S00600,922140,922140 +G,GSLG,GSLGO,92215,92215 +G,GFGN,S00600,92215,92215 +G,GSLG,GSLGO,922150,922150 +G,GFGN,S00600,922150,922150 +G,GSLG,GSLGO,92216,92216 +G,GSLE,S00203,92216,92216 +G,GSLG,GSLGO,922160,922160 +G,GSLE,S00203,922160,922160 +G,GFGN,S00600,922160,922160 +G,GSLG,GSLGO,92219,92219 +G,GFGN,S00600,92219,92219 +G,GSLG,GSLGO,922190,922190 +G,GFGN,S00600,922190,922190 +G,GSLG,GSLGE,923,923 +G,GSLG,GSLGH,923,923 +G,GSLG,GSLGO,923,923 +G,GFGN,S00600,923,923 +G,GSLG,GSLGE,9231,9231 +G,GSLG,GSLGH,9231,9231 +G,GSLG,GSLGO,9231,9231 +G,GFGN,S00600,9231,9231 +G,GSLG,GSLGE,92311,92311 +G,GFGN,S00600,92311,92311 +G,GSLG,GSLGE,923110,923110 +G,GFGN,S00600,923110,923110 +G,GSLG,GSLGH,92312,92312 +G,GFGN,S00600,92312,92312 +G,GSLG,GSLGH,923120,923120 +G,GFGN,S00600,923120,923120 +G,GSLG,GSLGO,92313,92313 +G,GFGN,S00600,92313,92313 +G,GSLG,GSLGO,923130,923130 +G,GFGN,S00600,923130,923130 +G,GFGN,S00600,92314,92314 +G,GFGN,S00600,923140,923140 +G,GSLG,GSLGO,924,924 +G,GFGN,S00600,924,924 +G,GSLG,GSLGO,9241,9241 +G,GFGN,S00600,9241,9241 +G,GSLG,GSLGO,92411,92411 +G,GFGN,S00600,92411,92411 +G,GSLG,GSLGO,924110,924110 +G,GFGN,S00600,924110,924110 +G,GSLG,GSLGO,92412,92412 +G,GFGN,S00600,92412,92412 +G,GSLG,GSLGO,924120,924120 +G,GFGN,S00600,924120,924120 +G,GSLG,GSLGO,925,925 +G,GFGN,S00600,925,925 +G,GSLG,GSLGO,9251,9251 +G,GFGN,S00600,9251,9251 +G,GSLG,GSLGO,92511,92511 +G,GFGN,S00600,92511,92511 +G,GSLG,GSLGO,925110,925110 +G,GFGN,S00600,925110,925110 +G,GSLG,GSLGO,92512,92512 +G,GFGN,S00600,92512,92512 +G,GSLG,GSLGO,925120,925120 +G,GFGN,S00600,925120,925120 +G,GSLG,GSLGO,926,926 +G,GFGN,S00600,926,926 +G,GSLG,GSLGO,9261,9261 +G,GFGN,S00600,9261,9261 +G,GSLG,GSLGO,92611,92611 +G,GFGN,S00600,92611,92611 +G,GSLG,GSLGO,926110,926110 +G,GFGN,S00600,926110,926110 +G,GFGN,S00600,92612,92612 +G,GSLG,GSLGO,926120,926120 +G,GFGN,S00600,926120,926120 +G,GSLG,GSLGO,92613,92613 +G,GFGN,S00600,92613,92613 +G,GSLG,GSLGO,926130,926130 +G,GFGN,S00600,926130,926130 +G,GSLG,GSLGO,92614,92614 +G,GFGN,S00600,92614,92614 +G,GSLG,GSLGO,926140,926140 +G,GFGN,S00600,926140,926140 +G,GSLG,GSLGO,92615,92615 +G,GFGN,S00600,92615,92615 +G,GSLG,GSLGO,926150,926150 +G,GFGN,S00600,926150,926150 +G,GFE,S00102,927,927 +G,GFE,S00102,9271,9271 +G,GFE,S00102,92711,92711 +G,GFE,S00102,927110,927110 +G,GFGD,S00500,928,928 +G,GFGN,S00600,928,928 +G,GFGD,S00500,9281,9281 +G,GFGN,S00600,9281,9281 +G,GFGD,S00500,92811,92811 +G,GFGD,S00500,928110,928110 +G,GFGN,S00600,92812,92812 +G,GFGN,S00600,928120,928120 +F010,F010,F01000,F010,NA +F010,F010,F01000,F01000,NA +G,GFE,S00101,S00101,NA +G,GSLE,S00201,S00201,NA +G,GSLE,S00202,S00202,NA +42,42,4200ID,NA,NA +F020,F02E,F02E00,NA,NA +F020,F02N,F02N00,NA,NA +F020,F02R,F02R00,NA,NA +F020,F02S,F02S00,NA,NA +F030,F030,F03000,NA,NA +F040,F040,F04000,NA,NA +F050,F050,F05000,NA,NA +F100,F06C,F06C00,NA,NA +F100,F06E,F06E00,NA,NA +F100,F06N,F06N00,NA,NA +F100,F06S,F06S00,NA,NA +F100,F07C,F07C00,NA,NA +F100,F07E,F07E00,NA,NA +F100,F07N,F07N00,NA,NA +F100,F07S,F07S00,NA,NA +F100,F10C,F10C00,NA,NA +F100,F10E,F10E00,NA,NA +F100,F10N,F10N00,NA,NA +F100,F10S,F10S00,NA,NA +Other,Other,S00300,NA,NA +Used,Used,S00401,NA,NA +Used,Used,S00402,NA,NA +Other,Other,S00900,NA,NA +V001,V001,V00100,NA,NA +V002,V002,V00200,NA,NA +V003,V003,V00300,NA,NA diff --git a/scripts/write_NAICS_from_useeior.py b/scripts/write_NAICS_from_useeior.py index 7b35fde85..21963c74c 100644 --- a/scripts/write_NAICS_from_useeior.py +++ b/scripts/write_NAICS_from_useeior.py @@ -15,7 +15,7 @@ from flowsa.settings import datapath -def import_useeior_mastercrosswalk(): +def import_useeior_mastercrosswalk(year): """ Load USEEIOR's MasterCrosswalk that links BEA data to NAICS :return: @@ -25,11 +25,11 @@ def import_useeior_mastercrosswalk(): useeior = packages.importr('useeior') # load the .Rd file for cw = packages.data(useeior).fetch( - 'MasterCrosswalk2012')['MasterCrosswalk2012'] + f'MasterCrosswalk{year}')[f'MasterCrosswalk{year}'] # save as csv - cw.to_csv(f"{datapath}/NAICS_to_BEA_Crosswalk.csv", index=False) + cw.to_csv(datapath / f"NAICS_to_BEA_Crosswalk_{year}.csv", index=False) if __name__ == '__main__': - import_useeior_mastercrosswalk() + import_useeior_mastercrosswalk(year=2017) From eb72012cd2664c6a5856a8d449f8260421f30e85 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 12 Oct 2023 16:17:14 -0400 Subject: [PATCH 1027/1127] write BEA 2017 crosswalks --- flowsa/common.py | 3 +- .../NAICS_Crosswalk_BEA_2017_Detail.csv | 1297 +++++++++++++++++ .../NAICS_Crosswalk_BEA_2017_Summary.csv | 1091 ++++++++++++++ .../write_Crosswalk_BEA.py | 39 + .../write_Crosswalk_BEA_2012.py | 39 - 5 files changed, 2429 insertions(+), 40 deletions(-) create mode 100644 flowsa/data/activitytosectormapping/NAICS_Crosswalk_BEA_2017_Detail.csv create mode 100644 flowsa/data/activitytosectormapping/NAICS_Crosswalk_BEA_2017_Summary.csv create mode 100644 scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA.py delete mode 100644 scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_2012.py diff --git a/flowsa/common.py b/flowsa/common.py index d77cb961c..acc827b27 100644 --- a/flowsa/common.py +++ b/flowsa/common.py @@ -77,7 +77,8 @@ def load_crosswalk(crosswalk_name): 'sector_name': 'Sector_2012_Names', 'household': 'Household_SectorCodes', 'government': 'Government_SectorCodes', - 'BEA': 'NAICS_to_BEA_Crosswalk' + 'BEA': 'NAICS_to_BEA_Crosswalk', + 'BEA_2017': 'NAICS_to_BEA_Crosswalk_2017', } fn = cw_dict.get(crosswalk_name) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_BEA_2017_Detail.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_BEA_2017_Detail.csv new file mode 100644 index 000000000..697c8f3cb --- /dev/null +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_BEA_2017_Detail.csv @@ -0,0 +1,1297 @@ +ActivitySourceName,Activity,SectorSourceName,Sector,SectorType +BEA_2017_Detail_Code,1111A0,NAICS_2017_Code,111110, +BEA_2017_Detail_Code,1111A0,NAICS_2017_Code,111120, +BEA_2017_Detail_Code,1111B0,NAICS_2017_Code,111130, +BEA_2017_Detail_Code,1111B0,NAICS_2017_Code,111140, +BEA_2017_Detail_Code,1111B0,NAICS_2017_Code,111150, +BEA_2017_Detail_Code,1111B0,NAICS_2017_Code,111160, +BEA_2017_Detail_Code,1111B0,NAICS_2017_Code,111191, +BEA_2017_Detail_Code,1111B0,NAICS_2017_Code,111199, +BEA_2017_Detail_Code,111200,NAICS_2017_Code,111211, +BEA_2017_Detail_Code,111200,NAICS_2017_Code,111219, +BEA_2017_Detail_Code,111300,NAICS_2017_Code,111310, +BEA_2017_Detail_Code,111300,NAICS_2017_Code,111320, +BEA_2017_Detail_Code,111300,NAICS_2017_Code,111331, +BEA_2017_Detail_Code,111300,NAICS_2017_Code,111332, +BEA_2017_Detail_Code,111300,NAICS_2017_Code,111333, +BEA_2017_Detail_Code,111300,NAICS_2017_Code,111334, +BEA_2017_Detail_Code,111300,NAICS_2017_Code,111335, +BEA_2017_Detail_Code,111300,NAICS_2017_Code,111336, +BEA_2017_Detail_Code,111300,NAICS_2017_Code,111339, +BEA_2017_Detail_Code,111400,NAICS_2017_Code,111411, +BEA_2017_Detail_Code,111400,NAICS_2017_Code,111419, +BEA_2017_Detail_Code,111400,NAICS_2017_Code,111421, +BEA_2017_Detail_Code,111400,NAICS_2017_Code,111422, +BEA_2017_Detail_Code,111900,NAICS_2017_Code,111910, +BEA_2017_Detail_Code,111900,NAICS_2017_Code,111920, +BEA_2017_Detail_Code,111900,NAICS_2017_Code,111930, +BEA_2017_Detail_Code,111900,NAICS_2017_Code,111940, +BEA_2017_Detail_Code,111900,NAICS_2017_Code,111991, +BEA_2017_Detail_Code,111900,NAICS_2017_Code,111992, +BEA_2017_Detail_Code,111900,NAICS_2017_Code,111998, +BEA_2017_Detail_Code,1121A0,NAICS_2017_Code,112111, +BEA_2017_Detail_Code,1121A0,NAICS_2017_Code,112112, +BEA_2017_Detail_Code,112120,NAICS_2017_Code,112120, +BEA_2017_Detail_Code,1121A0,NAICS_2017_Code,112130, +BEA_2017_Detail_Code,112A00,NAICS_2017_Code,112210, +BEA_2017_Detail_Code,112300,NAICS_2017_Code,112310, +BEA_2017_Detail_Code,112300,NAICS_2017_Code,112320, +BEA_2017_Detail_Code,112300,NAICS_2017_Code,112330, +BEA_2017_Detail_Code,112300,NAICS_2017_Code,112340, +BEA_2017_Detail_Code,112300,NAICS_2017_Code,112390, +BEA_2017_Detail_Code,112A00,NAICS_2017_Code,112410, +BEA_2017_Detail_Code,112A00,NAICS_2017_Code,112420, +BEA_2017_Detail_Code,112A00,NAICS_2017_Code,112511, +BEA_2017_Detail_Code,112A00,NAICS_2017_Code,112512, +BEA_2017_Detail_Code,112A00,NAICS_2017_Code,112519, +BEA_2017_Detail_Code,112A00,NAICS_2017_Code,112910, +BEA_2017_Detail_Code,112A00,NAICS_2017_Code,112920, +BEA_2017_Detail_Code,112A00,NAICS_2017_Code,112930, +BEA_2017_Detail_Code,112A00,NAICS_2017_Code,112990, +BEA_2017_Detail_Code,113000,NAICS_2017_Code,113110, +BEA_2017_Detail_Code,113000,NAICS_2017_Code,113210, +BEA_2017_Detail_Code,113000,NAICS_2017_Code,113310, +BEA_2017_Detail_Code,114000,NAICS_2017_Code,114111, +BEA_2017_Detail_Code,114000,NAICS_2017_Code,114112, +BEA_2017_Detail_Code,114000,NAICS_2017_Code,114119, +BEA_2017_Detail_Code,114000,NAICS_2017_Code,114210, +BEA_2017_Detail_Code,115000,NAICS_2017_Code,115111, +BEA_2017_Detail_Code,115000,NAICS_2017_Code,115112, +BEA_2017_Detail_Code,115000,NAICS_2017_Code,115113, +BEA_2017_Detail_Code,115000,NAICS_2017_Code,115114, +BEA_2017_Detail_Code,115000,NAICS_2017_Code,115115, +BEA_2017_Detail_Code,115000,NAICS_2017_Code,115116, +BEA_2017_Detail_Code,115000,NAICS_2017_Code,115210, +BEA_2017_Detail_Code,115000,NAICS_2017_Code,115310, +BEA_2017_Detail_Code,211000,NAICS_2017_Code,211120, +BEA_2017_Detail_Code,211000,NAICS_2017_Code,211130, +BEA_2017_Detail_Code,212100,NAICS_2017_Code,212111, +BEA_2017_Detail_Code,212100,NAICS_2017_Code,212112, +BEA_2017_Detail_Code,212100,NAICS_2017_Code,212113, +BEA_2017_Detail_Code,2122A0,NAICS_2017_Code,212210, +BEA_2017_Detail_Code,2122A0,NAICS_2017_Code,212221, +BEA_2017_Detail_Code,2122A0,NAICS_2017_Code,212222, +BEA_2017_Detail_Code,212230,NAICS_2017_Code,212230, +BEA_2017_Detail_Code,2122A0,NAICS_2017_Code,212291, +BEA_2017_Detail_Code,2122A0,NAICS_2017_Code,212299, +BEA_2017_Detail_Code,212310,NAICS_2017_Code,212311, +BEA_2017_Detail_Code,212310,NAICS_2017_Code,212312, +BEA_2017_Detail_Code,212310,NAICS_2017_Code,212313, +BEA_2017_Detail_Code,212310,NAICS_2017_Code,212319, +BEA_2017_Detail_Code,2123A0,NAICS_2017_Code,212321, +BEA_2017_Detail_Code,2123A0,NAICS_2017_Code,212322, +BEA_2017_Detail_Code,2123A0,NAICS_2017_Code,212324, +BEA_2017_Detail_Code,2123A0,NAICS_2017_Code,212325, +BEA_2017_Detail_Code,2123A0,NAICS_2017_Code,212391, +BEA_2017_Detail_Code,2123A0,NAICS_2017_Code,212392, +BEA_2017_Detail_Code,2123A0,NAICS_2017_Code,212393, +BEA_2017_Detail_Code,2123A0,NAICS_2017_Code,212399, +BEA_2017_Detail_Code,213111,NAICS_2017_Code,213111, +BEA_2017_Detail_Code,21311A,NAICS_2017_Code,213112, +BEA_2017_Detail_Code,21311A,NAICS_2017_Code,213113, +BEA_2017_Detail_Code,21311A,NAICS_2017_Code,213114, +BEA_2017_Detail_Code,21311A,NAICS_2017_Code,213115, +BEA_2017_Detail_Code,221100,NAICS_2017_Code,221111, +BEA_2017_Detail_Code,221100,NAICS_2017_Code,221112, +BEA_2017_Detail_Code,221100,NAICS_2017_Code,221113, +BEA_2017_Detail_Code,221100,NAICS_2017_Code,221114, +BEA_2017_Detail_Code,221100,NAICS_2017_Code,221115, +BEA_2017_Detail_Code,221100,NAICS_2017_Code,221116, +BEA_2017_Detail_Code,221100,NAICS_2017_Code,221117, +BEA_2017_Detail_Code,221100,NAICS_2017_Code,221118, +BEA_2017_Detail_Code,221100,NAICS_2017_Code,221121, +BEA_2017_Detail_Code,221100,NAICS_2017_Code,221122, +BEA_2017_Detail_Code,221200,NAICS_2017_Code,221210, +BEA_2017_Detail_Code,221300,NAICS_2017_Code,221310, +BEA_2017_Detail_Code,221300,NAICS_2017_Code,221320, +BEA_2017_Detail_Code,221300,NAICS_2017_Code,221330, +BEA_2017_Detail_Code,233411,NAICS_2017_Code,236115, +BEA_2017_Detail_Code,233412,NAICS_2017_Code,236116, +BEA_2017_Detail_Code,233411,NAICS_2017_Code,236117, +BEA_2017_Detail_Code,233412,NAICS_2017_Code,236117, +BEA_2017_Detail_Code,2334A0,NAICS_2017_Code,236117, +BEA_2017_Detail_Code,230302,NAICS_2017_Code,236118, +BEA_2017_Detail_Code,230301,NAICS_2017_Code,236210, +BEA_2017_Detail_Code,233230,NAICS_2017_Code,236210, +BEA_2017_Detail_Code,230301,NAICS_2017_Code,236220, +BEA_2017_Detail_Code,233210,NAICS_2017_Code,236220, +BEA_2017_Detail_Code,233262,NAICS_2017_Code,236220, +BEA_2017_Detail_Code,2332A0,NAICS_2017_Code,236220, +BEA_2017_Detail_Code,233240,NAICS_2017_Code,237110, +BEA_2017_Detail_Code,233240,NAICS_2017_Code,237120, +BEA_2017_Detail_Code,233240,NAICS_2017_Code,237130, +BEA_2017_Detail_Code,233210,NAICS_2017_Code,237210, +BEA_2017_Detail_Code,233230,NAICS_2017_Code,237210, +BEA_2017_Detail_Code,233240,NAICS_2017_Code,237210, +BEA_2017_Detail_Code,233262,NAICS_2017_Code,237210, +BEA_2017_Detail_Code,2332A0,NAICS_2017_Code,237210, +BEA_2017_Detail_Code,2332C0,NAICS_2017_Code,237210, +BEA_2017_Detail_Code,2332D0,NAICS_2017_Code,237210, +BEA_2017_Detail_Code,233411,NAICS_2017_Code,237210, +BEA_2017_Detail_Code,233412,NAICS_2017_Code,237210, +BEA_2017_Detail_Code,2334A0,NAICS_2017_Code,237210, +BEA_2017_Detail_Code,2332C0,NAICS_2017_Code,237310, +BEA_2017_Detail_Code,2332D0,NAICS_2017_Code,237990, +BEA_2017_Detail_Code,230301,NAICS_2017_Code,238110, +BEA_2017_Detail_Code,230302,NAICS_2017_Code,238110, +BEA_2017_Detail_Code,233210,NAICS_2017_Code,238110, +BEA_2017_Detail_Code,233230,NAICS_2017_Code,238110, +BEA_2017_Detail_Code,233240,NAICS_2017_Code,238110, +BEA_2017_Detail_Code,233262,NAICS_2017_Code,238110, +BEA_2017_Detail_Code,2332A0,NAICS_2017_Code,238110, +BEA_2017_Detail_Code,2332D0,NAICS_2017_Code,238110, +BEA_2017_Detail_Code,233411,NAICS_2017_Code,238110, +BEA_2017_Detail_Code,233412,NAICS_2017_Code,238110, +BEA_2017_Detail_Code,2334A0,NAICS_2017_Code,238110, +BEA_2017_Detail_Code,230301,NAICS_2017_Code,238120, +BEA_2017_Detail_Code,230302,NAICS_2017_Code,238120, +BEA_2017_Detail_Code,233210,NAICS_2017_Code,238120, +BEA_2017_Detail_Code,233230,NAICS_2017_Code,238120, +BEA_2017_Detail_Code,233240,NAICS_2017_Code,238120, +BEA_2017_Detail_Code,233262,NAICS_2017_Code,238120, +BEA_2017_Detail_Code,2332A0,NAICS_2017_Code,238120, +BEA_2017_Detail_Code,2332D0,NAICS_2017_Code,238120, +BEA_2017_Detail_Code,233411,NAICS_2017_Code,238120, +BEA_2017_Detail_Code,233412,NAICS_2017_Code,238120, +BEA_2017_Detail_Code,2334A0,NAICS_2017_Code,238120, +BEA_2017_Detail_Code,230301,NAICS_2017_Code,238130, +BEA_2017_Detail_Code,230302,NAICS_2017_Code,238130, +BEA_2017_Detail_Code,233210,NAICS_2017_Code,238130, +BEA_2017_Detail_Code,233230,NAICS_2017_Code,238130, +BEA_2017_Detail_Code,233240,NAICS_2017_Code,238130, +BEA_2017_Detail_Code,233262,NAICS_2017_Code,238130, +BEA_2017_Detail_Code,2332A0,NAICS_2017_Code,238130, +BEA_2017_Detail_Code,2332D0,NAICS_2017_Code,238130, +BEA_2017_Detail_Code,233411,NAICS_2017_Code,238130, +BEA_2017_Detail_Code,233412,NAICS_2017_Code,238130, +BEA_2017_Detail_Code,2334A0,NAICS_2017_Code,238130, +BEA_2017_Detail_Code,230301,NAICS_2017_Code,238140, +BEA_2017_Detail_Code,230302,NAICS_2017_Code,238140, +BEA_2017_Detail_Code,233210,NAICS_2017_Code,238140, +BEA_2017_Detail_Code,233230,NAICS_2017_Code,238140, +BEA_2017_Detail_Code,233240,NAICS_2017_Code,238140, +BEA_2017_Detail_Code,233262,NAICS_2017_Code,238140, +BEA_2017_Detail_Code,2332A0,NAICS_2017_Code,238140, +BEA_2017_Detail_Code,2332D0,NAICS_2017_Code,238140, +BEA_2017_Detail_Code,233411,NAICS_2017_Code,238140, +BEA_2017_Detail_Code,233412,NAICS_2017_Code,238140, +BEA_2017_Detail_Code,2334A0,NAICS_2017_Code,238140, +BEA_2017_Detail_Code,230301,NAICS_2017_Code,238150, +BEA_2017_Detail_Code,230302,NAICS_2017_Code,238150, +BEA_2017_Detail_Code,233210,NAICS_2017_Code,238150, +BEA_2017_Detail_Code,233230,NAICS_2017_Code,238150, +BEA_2017_Detail_Code,233240,NAICS_2017_Code,238150, +BEA_2017_Detail_Code,233262,NAICS_2017_Code,238150, +BEA_2017_Detail_Code,2332A0,NAICS_2017_Code,238150, +BEA_2017_Detail_Code,2332D0,NAICS_2017_Code,238150, +BEA_2017_Detail_Code,233411,NAICS_2017_Code,238150, +BEA_2017_Detail_Code,233412,NAICS_2017_Code,238150, +BEA_2017_Detail_Code,2334A0,NAICS_2017_Code,238150, +BEA_2017_Detail_Code,230301,NAICS_2017_Code,238160, +BEA_2017_Detail_Code,230302,NAICS_2017_Code,238160, +BEA_2017_Detail_Code,233210,NAICS_2017_Code,238160, +BEA_2017_Detail_Code,233230,NAICS_2017_Code,238160, +BEA_2017_Detail_Code,233240,NAICS_2017_Code,238160, +BEA_2017_Detail_Code,233262,NAICS_2017_Code,238160, +BEA_2017_Detail_Code,2332A0,NAICS_2017_Code,238160, +BEA_2017_Detail_Code,2332D0,NAICS_2017_Code,238160, +BEA_2017_Detail_Code,233411,NAICS_2017_Code,238160, +BEA_2017_Detail_Code,233412,NAICS_2017_Code,238160, +BEA_2017_Detail_Code,2334A0,NAICS_2017_Code,238160, +BEA_2017_Detail_Code,230301,NAICS_2017_Code,238170, +BEA_2017_Detail_Code,230302,NAICS_2017_Code,238170, +BEA_2017_Detail_Code,233210,NAICS_2017_Code,238170, +BEA_2017_Detail_Code,233230,NAICS_2017_Code,238170, +BEA_2017_Detail_Code,233240,NAICS_2017_Code,238170, +BEA_2017_Detail_Code,233262,NAICS_2017_Code,238170, +BEA_2017_Detail_Code,2332A0,NAICS_2017_Code,238170, +BEA_2017_Detail_Code,2332D0,NAICS_2017_Code,238170, +BEA_2017_Detail_Code,233411,NAICS_2017_Code,238170, +BEA_2017_Detail_Code,233412,NAICS_2017_Code,238170, +BEA_2017_Detail_Code,2334A0,NAICS_2017_Code,238170, +BEA_2017_Detail_Code,230301,NAICS_2017_Code,238190, +BEA_2017_Detail_Code,230302,NAICS_2017_Code,238190, +BEA_2017_Detail_Code,233210,NAICS_2017_Code,238190, +BEA_2017_Detail_Code,233230,NAICS_2017_Code,238190, +BEA_2017_Detail_Code,233240,NAICS_2017_Code,238190, +BEA_2017_Detail_Code,233262,NAICS_2017_Code,238190, +BEA_2017_Detail_Code,2332A0,NAICS_2017_Code,238190, +BEA_2017_Detail_Code,2332D0,NAICS_2017_Code,238190, +BEA_2017_Detail_Code,233411,NAICS_2017_Code,238190, +BEA_2017_Detail_Code,233412,NAICS_2017_Code,238190, +BEA_2017_Detail_Code,2334A0,NAICS_2017_Code,238190, +BEA_2017_Detail_Code,230301,NAICS_2017_Code,238210, +BEA_2017_Detail_Code,230302,NAICS_2017_Code,238210, +BEA_2017_Detail_Code,233210,NAICS_2017_Code,238210, +BEA_2017_Detail_Code,233230,NAICS_2017_Code,238210, +BEA_2017_Detail_Code,233240,NAICS_2017_Code,238210, +BEA_2017_Detail_Code,233262,NAICS_2017_Code,238210, +BEA_2017_Detail_Code,2332A0,NAICS_2017_Code,238210, +BEA_2017_Detail_Code,2332D0,NAICS_2017_Code,238210, +BEA_2017_Detail_Code,233411,NAICS_2017_Code,238210, +BEA_2017_Detail_Code,233412,NAICS_2017_Code,238210, +BEA_2017_Detail_Code,2334A0,NAICS_2017_Code,238210, +BEA_2017_Detail_Code,230301,NAICS_2017_Code,238220, +BEA_2017_Detail_Code,230302,NAICS_2017_Code,238220, +BEA_2017_Detail_Code,233210,NAICS_2017_Code,238220, +BEA_2017_Detail_Code,233230,NAICS_2017_Code,238220, +BEA_2017_Detail_Code,233240,NAICS_2017_Code,238220, +BEA_2017_Detail_Code,233262,NAICS_2017_Code,238220, +BEA_2017_Detail_Code,2332A0,NAICS_2017_Code,238220, +BEA_2017_Detail_Code,2332D0,NAICS_2017_Code,238220, +BEA_2017_Detail_Code,233411,NAICS_2017_Code,238220, +BEA_2017_Detail_Code,233412,NAICS_2017_Code,238220, +BEA_2017_Detail_Code,2334A0,NAICS_2017_Code,238220, +BEA_2017_Detail_Code,230301,NAICS_2017_Code,238290, +BEA_2017_Detail_Code,230302,NAICS_2017_Code,238290, +BEA_2017_Detail_Code,233210,NAICS_2017_Code,238290, +BEA_2017_Detail_Code,233230,NAICS_2017_Code,238290, +BEA_2017_Detail_Code,233240,NAICS_2017_Code,238290, +BEA_2017_Detail_Code,233262,NAICS_2017_Code,238290, +BEA_2017_Detail_Code,2332A0,NAICS_2017_Code,238290, +BEA_2017_Detail_Code,2332D0,NAICS_2017_Code,238290, +BEA_2017_Detail_Code,233411,NAICS_2017_Code,238290, +BEA_2017_Detail_Code,233412,NAICS_2017_Code,238290, +BEA_2017_Detail_Code,2334A0,NAICS_2017_Code,238290, +BEA_2017_Detail_Code,230301,NAICS_2017_Code,238310, +BEA_2017_Detail_Code,230302,NAICS_2017_Code,238310, +BEA_2017_Detail_Code,233210,NAICS_2017_Code,238310, +BEA_2017_Detail_Code,233230,NAICS_2017_Code,238310, +BEA_2017_Detail_Code,233240,NAICS_2017_Code,238310, +BEA_2017_Detail_Code,233262,NAICS_2017_Code,238310, +BEA_2017_Detail_Code,2332A0,NAICS_2017_Code,238310, +BEA_2017_Detail_Code,2332D0,NAICS_2017_Code,238310, +BEA_2017_Detail_Code,233411,NAICS_2017_Code,238310, +BEA_2017_Detail_Code,233412,NAICS_2017_Code,238310, +BEA_2017_Detail_Code,2334A0,NAICS_2017_Code,238310, +BEA_2017_Detail_Code,230301,NAICS_2017_Code,238320, +BEA_2017_Detail_Code,230302,NAICS_2017_Code,238320, +BEA_2017_Detail_Code,233210,NAICS_2017_Code,238320, +BEA_2017_Detail_Code,233230,NAICS_2017_Code,238320, +BEA_2017_Detail_Code,233240,NAICS_2017_Code,238320, +BEA_2017_Detail_Code,233262,NAICS_2017_Code,238320, +BEA_2017_Detail_Code,2332A0,NAICS_2017_Code,238320, +BEA_2017_Detail_Code,2332D0,NAICS_2017_Code,238320, +BEA_2017_Detail_Code,233411,NAICS_2017_Code,238320, +BEA_2017_Detail_Code,233412,NAICS_2017_Code,238320, +BEA_2017_Detail_Code,2334A0,NAICS_2017_Code,238320, +BEA_2017_Detail_Code,230301,NAICS_2017_Code,238330, +BEA_2017_Detail_Code,230302,NAICS_2017_Code,238330, +BEA_2017_Detail_Code,233210,NAICS_2017_Code,238330, +BEA_2017_Detail_Code,233230,NAICS_2017_Code,238330, +BEA_2017_Detail_Code,233240,NAICS_2017_Code,238330, +BEA_2017_Detail_Code,233262,NAICS_2017_Code,238330, +BEA_2017_Detail_Code,2332A0,NAICS_2017_Code,238330, +BEA_2017_Detail_Code,2332D0,NAICS_2017_Code,238330, +BEA_2017_Detail_Code,233411,NAICS_2017_Code,238330, +BEA_2017_Detail_Code,233412,NAICS_2017_Code,238330, +BEA_2017_Detail_Code,2334A0,NAICS_2017_Code,238330, +BEA_2017_Detail_Code,230301,NAICS_2017_Code,238340, +BEA_2017_Detail_Code,230302,NAICS_2017_Code,238340, +BEA_2017_Detail_Code,233210,NAICS_2017_Code,238340, +BEA_2017_Detail_Code,233230,NAICS_2017_Code,238340, +BEA_2017_Detail_Code,233240,NAICS_2017_Code,238340, +BEA_2017_Detail_Code,233262,NAICS_2017_Code,238340, +BEA_2017_Detail_Code,2332A0,NAICS_2017_Code,238340, +BEA_2017_Detail_Code,2332D0,NAICS_2017_Code,238340, +BEA_2017_Detail_Code,233411,NAICS_2017_Code,238340, +BEA_2017_Detail_Code,233412,NAICS_2017_Code,238340, +BEA_2017_Detail_Code,2334A0,NAICS_2017_Code,238340, +BEA_2017_Detail_Code,230301,NAICS_2017_Code,238350, +BEA_2017_Detail_Code,230302,NAICS_2017_Code,238350, +BEA_2017_Detail_Code,233210,NAICS_2017_Code,238350, +BEA_2017_Detail_Code,233230,NAICS_2017_Code,238350, +BEA_2017_Detail_Code,233240,NAICS_2017_Code,238350, +BEA_2017_Detail_Code,233262,NAICS_2017_Code,238350, +BEA_2017_Detail_Code,2332A0,NAICS_2017_Code,238350, +BEA_2017_Detail_Code,2332D0,NAICS_2017_Code,238350, +BEA_2017_Detail_Code,233411,NAICS_2017_Code,238350, +BEA_2017_Detail_Code,233412,NAICS_2017_Code,238350, +BEA_2017_Detail_Code,2334A0,NAICS_2017_Code,238350, +BEA_2017_Detail_Code,230301,NAICS_2017_Code,238390, +BEA_2017_Detail_Code,230302,NAICS_2017_Code,238390, +BEA_2017_Detail_Code,233210,NAICS_2017_Code,238390, +BEA_2017_Detail_Code,233230,NAICS_2017_Code,238390, +BEA_2017_Detail_Code,233240,NAICS_2017_Code,238390, +BEA_2017_Detail_Code,233262,NAICS_2017_Code,238390, +BEA_2017_Detail_Code,2332A0,NAICS_2017_Code,238390, +BEA_2017_Detail_Code,2332D0,NAICS_2017_Code,238390, +BEA_2017_Detail_Code,233411,NAICS_2017_Code,238390, +BEA_2017_Detail_Code,233412,NAICS_2017_Code,238390, +BEA_2017_Detail_Code,2334A0,NAICS_2017_Code,238390, +BEA_2017_Detail_Code,230301,NAICS_2017_Code,238910, +BEA_2017_Detail_Code,230302,NAICS_2017_Code,238910, +BEA_2017_Detail_Code,233210,NAICS_2017_Code,238910, +BEA_2017_Detail_Code,233230,NAICS_2017_Code,238910, +BEA_2017_Detail_Code,233240,NAICS_2017_Code,238910, +BEA_2017_Detail_Code,233262,NAICS_2017_Code,238910, +BEA_2017_Detail_Code,2332A0,NAICS_2017_Code,238910, +BEA_2017_Detail_Code,2332D0,NAICS_2017_Code,238910, +BEA_2017_Detail_Code,233411,NAICS_2017_Code,238910, +BEA_2017_Detail_Code,233412,NAICS_2017_Code,238910, +BEA_2017_Detail_Code,2334A0,NAICS_2017_Code,238910, +BEA_2017_Detail_Code,230301,NAICS_2017_Code,238990, +BEA_2017_Detail_Code,230302,NAICS_2017_Code,238990, +BEA_2017_Detail_Code,233210,NAICS_2017_Code,238990, +BEA_2017_Detail_Code,233230,NAICS_2017_Code,238990, +BEA_2017_Detail_Code,233240,NAICS_2017_Code,238990, +BEA_2017_Detail_Code,233262,NAICS_2017_Code,238990, +BEA_2017_Detail_Code,2332A0,NAICS_2017_Code,238990, +BEA_2017_Detail_Code,2332D0,NAICS_2017_Code,238990, +BEA_2017_Detail_Code,233411,NAICS_2017_Code,238990, +BEA_2017_Detail_Code,233412,NAICS_2017_Code,238990, +BEA_2017_Detail_Code,2334A0,NAICS_2017_Code,238990, +BEA_2017_Detail_Code,311111,NAICS_2017_Code,311111, +BEA_2017_Detail_Code,311119,NAICS_2017_Code,311119, +BEA_2017_Detail_Code,311210,NAICS_2017_Code,311211, +BEA_2017_Detail_Code,311210,NAICS_2017_Code,311212, +BEA_2017_Detail_Code,311210,NAICS_2017_Code,311213, +BEA_2017_Detail_Code,311221,NAICS_2017_Code,311221, +BEA_2017_Detail_Code,311224,NAICS_2017_Code,311224, +BEA_2017_Detail_Code,311225,NAICS_2017_Code,311225, +BEA_2017_Detail_Code,311230,NAICS_2017_Code,311230, +BEA_2017_Detail_Code,311300,NAICS_2017_Code,311313, +BEA_2017_Detail_Code,311300,NAICS_2017_Code,311314, +BEA_2017_Detail_Code,311300,NAICS_2017_Code,311340, +BEA_2017_Detail_Code,311300,NAICS_2017_Code,311351, +BEA_2017_Detail_Code,311300,NAICS_2017_Code,311352, +BEA_2017_Detail_Code,311410,NAICS_2017_Code,311411, +BEA_2017_Detail_Code,311410,NAICS_2017_Code,311412, +BEA_2017_Detail_Code,311420,NAICS_2017_Code,311421, +BEA_2017_Detail_Code,311420,NAICS_2017_Code,311422, +BEA_2017_Detail_Code,311420,NAICS_2017_Code,311423, +BEA_2017_Detail_Code,31151A,NAICS_2017_Code,311511, +BEA_2017_Detail_Code,31151A,NAICS_2017_Code,311512, +BEA_2017_Detail_Code,311513,NAICS_2017_Code,311513, +BEA_2017_Detail_Code,311514,NAICS_2017_Code,311514, +BEA_2017_Detail_Code,311520,NAICS_2017_Code,311520, +BEA_2017_Detail_Code,31161A,NAICS_2017_Code,311611, +BEA_2017_Detail_Code,31161A,NAICS_2017_Code,311612, +BEA_2017_Detail_Code,31161A,NAICS_2017_Code,311613, +BEA_2017_Detail_Code,311615,NAICS_2017_Code,311615, +BEA_2017_Detail_Code,311700,NAICS_2017_Code,311710, +BEA_2017_Detail_Code,311810,NAICS_2017_Code,311811, +BEA_2017_Detail_Code,311810,NAICS_2017_Code,311812, +BEA_2017_Detail_Code,311810,NAICS_2017_Code,311813, +BEA_2017_Detail_Code,3118A0,NAICS_2017_Code,311821, +BEA_2017_Detail_Code,3118A0,NAICS_2017_Code,311824, +BEA_2017_Detail_Code,3118A0,NAICS_2017_Code,311830, +BEA_2017_Detail_Code,311910,NAICS_2017_Code,311911, +BEA_2017_Detail_Code,311910,NAICS_2017_Code,311919, +BEA_2017_Detail_Code,311920,NAICS_2017_Code,311920, +BEA_2017_Detail_Code,311930,NAICS_2017_Code,311930, +BEA_2017_Detail_Code,311940,NAICS_2017_Code,311941, +BEA_2017_Detail_Code,311940,NAICS_2017_Code,311942, +BEA_2017_Detail_Code,311990,NAICS_2017_Code,311991, +BEA_2017_Detail_Code,311990,NAICS_2017_Code,311999, +BEA_2017_Detail_Code,312110,NAICS_2017_Code,312111, +BEA_2017_Detail_Code,312110,NAICS_2017_Code,312112, +BEA_2017_Detail_Code,312110,NAICS_2017_Code,312113, +BEA_2017_Detail_Code,312120,NAICS_2017_Code,312120, +BEA_2017_Detail_Code,312130,NAICS_2017_Code,312130, +BEA_2017_Detail_Code,312140,NAICS_2017_Code,312140, +BEA_2017_Detail_Code,312200,NAICS_2017_Code,312230, +BEA_2017_Detail_Code,313100,NAICS_2017_Code,313110, +BEA_2017_Detail_Code,313200,NAICS_2017_Code,313210, +BEA_2017_Detail_Code,313200,NAICS_2017_Code,313220, +BEA_2017_Detail_Code,313200,NAICS_2017_Code,313230, +BEA_2017_Detail_Code,313200,NAICS_2017_Code,313240, +BEA_2017_Detail_Code,313300,NAICS_2017_Code,313310, +BEA_2017_Detail_Code,313300,NAICS_2017_Code,313320, +BEA_2017_Detail_Code,314110,NAICS_2017_Code,314110, +BEA_2017_Detail_Code,314120,NAICS_2017_Code,314120, +BEA_2017_Detail_Code,314900,NAICS_2017_Code,314910, +BEA_2017_Detail_Code,314900,NAICS_2017_Code,314994, +BEA_2017_Detail_Code,314900,NAICS_2017_Code,314999, +BEA_2017_Detail_Code,315000,NAICS_2017_Code,315110, +BEA_2017_Detail_Code,315000,NAICS_2017_Code,315190, +BEA_2017_Detail_Code,315000,NAICS_2017_Code,315210, +BEA_2017_Detail_Code,315000,NAICS_2017_Code,315220, +BEA_2017_Detail_Code,315000,NAICS_2017_Code,315240, +BEA_2017_Detail_Code,315000,NAICS_2017_Code,315280, +BEA_2017_Detail_Code,315000,NAICS_2017_Code,315990, +BEA_2017_Detail_Code,316000,NAICS_2017_Code,316110, +BEA_2017_Detail_Code,316000,NAICS_2017_Code,316210, +BEA_2017_Detail_Code,316000,NAICS_2017_Code,316992, +BEA_2017_Detail_Code,316000,NAICS_2017_Code,316998, +BEA_2017_Detail_Code,321100,NAICS_2017_Code,321113, +BEA_2017_Detail_Code,321100,NAICS_2017_Code,321114, +BEA_2017_Detail_Code,321200,NAICS_2017_Code,321211, +BEA_2017_Detail_Code,321200,NAICS_2017_Code,321212, +BEA_2017_Detail_Code,321200,NAICS_2017_Code,321213, +BEA_2017_Detail_Code,321200,NAICS_2017_Code,321214, +BEA_2017_Detail_Code,321200,NAICS_2017_Code,321219, +BEA_2017_Detail_Code,321910,NAICS_2017_Code,321911, +BEA_2017_Detail_Code,321910,NAICS_2017_Code,321912, +BEA_2017_Detail_Code,321910,NAICS_2017_Code,321918, +BEA_2017_Detail_Code,3219A0,NAICS_2017_Code,321920, +BEA_2017_Detail_Code,3219A0,NAICS_2017_Code,321991, +BEA_2017_Detail_Code,3219A0,NAICS_2017_Code,321992, +BEA_2017_Detail_Code,3219A0,NAICS_2017_Code,321999, +BEA_2017_Detail_Code,322110,NAICS_2017_Code,322110, +BEA_2017_Detail_Code,322120,NAICS_2017_Code,322121, +BEA_2017_Detail_Code,322120,NAICS_2017_Code,322122, +BEA_2017_Detail_Code,322130,NAICS_2017_Code,322130, +BEA_2017_Detail_Code,322210,NAICS_2017_Code,322211, +BEA_2017_Detail_Code,322210,NAICS_2017_Code,322212, +BEA_2017_Detail_Code,322210,NAICS_2017_Code,322219, +BEA_2017_Detail_Code,322220,NAICS_2017_Code,322220, +BEA_2017_Detail_Code,322230,NAICS_2017_Code,322230, +BEA_2017_Detail_Code,322291,NAICS_2017_Code,322291, +BEA_2017_Detail_Code,322299,NAICS_2017_Code,322299, +BEA_2017_Detail_Code,323110,NAICS_2017_Code,323111, +BEA_2017_Detail_Code,323110,NAICS_2017_Code,323113, +BEA_2017_Detail_Code,323110,NAICS_2017_Code,323117, +BEA_2017_Detail_Code,323120,NAICS_2017_Code,323120, +BEA_2017_Detail_Code,324110,NAICS_2017_Code,324110, +BEA_2017_Detail_Code,324121,NAICS_2017_Code,324121, +BEA_2017_Detail_Code,324122,NAICS_2017_Code,324122, +BEA_2017_Detail_Code,324190,NAICS_2017_Code,324191, +BEA_2017_Detail_Code,324190,NAICS_2017_Code,324199, +BEA_2017_Detail_Code,325110,NAICS_2017_Code,325110, +BEA_2017_Detail_Code,325120,NAICS_2017_Code,325120, +BEA_2017_Detail_Code,325130,NAICS_2017_Code,325130, +BEA_2017_Detail_Code,325180,NAICS_2017_Code,325180, +BEA_2017_Detail_Code,325190,NAICS_2017_Code,325193, +BEA_2017_Detail_Code,325190,NAICS_2017_Code,325194, +BEA_2017_Detail_Code,325190,NAICS_2017_Code,325199, +BEA_2017_Detail_Code,325211,NAICS_2017_Code,325211, +BEA_2017_Detail_Code,3252A0,NAICS_2017_Code,325212, +BEA_2017_Detail_Code,3252A0,NAICS_2017_Code,325220, +BEA_2017_Detail_Code,325310,NAICS_2017_Code,325311, +BEA_2017_Detail_Code,325310,NAICS_2017_Code,325312, +BEA_2017_Detail_Code,325310,NAICS_2017_Code,325314, +BEA_2017_Detail_Code,325320,NAICS_2017_Code,325320, +BEA_2017_Detail_Code,325411,NAICS_2017_Code,325411, +BEA_2017_Detail_Code,325412,NAICS_2017_Code,325412, +BEA_2017_Detail_Code,325413,NAICS_2017_Code,325413, +BEA_2017_Detail_Code,325414,NAICS_2017_Code,325414, +BEA_2017_Detail_Code,325510,NAICS_2017_Code,325510, +BEA_2017_Detail_Code,325520,NAICS_2017_Code,325520, +BEA_2017_Detail_Code,325610,NAICS_2017_Code,325611, +BEA_2017_Detail_Code,325610,NAICS_2017_Code,325612, +BEA_2017_Detail_Code,325610,NAICS_2017_Code,325613, +BEA_2017_Detail_Code,325620,NAICS_2017_Code,325620, +BEA_2017_Detail_Code,325910,NAICS_2017_Code,325910, +BEA_2017_Detail_Code,3259A0,NAICS_2017_Code,325920, +BEA_2017_Detail_Code,3259A0,NAICS_2017_Code,325991, +BEA_2017_Detail_Code,3259A0,NAICS_2017_Code,325992, +BEA_2017_Detail_Code,3259A0,NAICS_2017_Code,325998, +BEA_2017_Detail_Code,326110,NAICS_2017_Code,326111, +BEA_2017_Detail_Code,326110,NAICS_2017_Code,326112, +BEA_2017_Detail_Code,326110,NAICS_2017_Code,326113, +BEA_2017_Detail_Code,326120,NAICS_2017_Code,326121, +BEA_2017_Detail_Code,326120,NAICS_2017_Code,326122, +BEA_2017_Detail_Code,326130,NAICS_2017_Code,326130, +BEA_2017_Detail_Code,326140,NAICS_2017_Code,326140, +BEA_2017_Detail_Code,326150,NAICS_2017_Code,326150, +BEA_2017_Detail_Code,326160,NAICS_2017_Code,326160, +BEA_2017_Detail_Code,326190,NAICS_2017_Code,326191, +BEA_2017_Detail_Code,326190,NAICS_2017_Code,326199, +BEA_2017_Detail_Code,326210,NAICS_2017_Code,326211, +BEA_2017_Detail_Code,326210,NAICS_2017_Code,326212, +BEA_2017_Detail_Code,326220,NAICS_2017_Code,326220, +BEA_2017_Detail_Code,326290,NAICS_2017_Code,326291, +BEA_2017_Detail_Code,326290,NAICS_2017_Code,326299, +BEA_2017_Detail_Code,327100,NAICS_2017_Code,327110, +BEA_2017_Detail_Code,327100,NAICS_2017_Code,327120, +BEA_2017_Detail_Code,327200,NAICS_2017_Code,327211, +BEA_2017_Detail_Code,327200,NAICS_2017_Code,327212, +BEA_2017_Detail_Code,327200,NAICS_2017_Code,327213, +BEA_2017_Detail_Code,327200,NAICS_2017_Code,327215, +BEA_2017_Detail_Code,327310,NAICS_2017_Code,327310, +BEA_2017_Detail_Code,327320,NAICS_2017_Code,327320, +BEA_2017_Detail_Code,327330,NAICS_2017_Code,327331, +BEA_2017_Detail_Code,327330,NAICS_2017_Code,327332, +BEA_2017_Detail_Code,327390,NAICS_2017_Code,327390, +BEA_2017_Detail_Code,327400,NAICS_2017_Code,327410, +BEA_2017_Detail_Code,327400,NAICS_2017_Code,327420, +BEA_2017_Detail_Code,327910,NAICS_2017_Code,327910, +BEA_2017_Detail_Code,327991,NAICS_2017_Code,327991, +BEA_2017_Detail_Code,327992,NAICS_2017_Code,327992, +BEA_2017_Detail_Code,327993,NAICS_2017_Code,327993, +BEA_2017_Detail_Code,327999,NAICS_2017_Code,327999, +BEA_2017_Detail_Code,331110,NAICS_2017_Code,331110, +BEA_2017_Detail_Code,331200,NAICS_2017_Code,331210, +BEA_2017_Detail_Code,331200,NAICS_2017_Code,331221, +BEA_2017_Detail_Code,331200,NAICS_2017_Code,331222, +BEA_2017_Detail_Code,331313,NAICS_2017_Code,331313, +BEA_2017_Detail_Code,331314,NAICS_2017_Code,331314, +BEA_2017_Detail_Code,33131B,NAICS_2017_Code,331315, +BEA_2017_Detail_Code,33131B,NAICS_2017_Code,331318, +BEA_2017_Detail_Code,331410,NAICS_2017_Code,331410, +BEA_2017_Detail_Code,331420,NAICS_2017_Code,331420, +BEA_2017_Detail_Code,331490,NAICS_2017_Code,331491, +BEA_2017_Detail_Code,331490,NAICS_2017_Code,331492, +BEA_2017_Detail_Code,331510,NAICS_2017_Code,331511, +BEA_2017_Detail_Code,331510,NAICS_2017_Code,331512, +BEA_2017_Detail_Code,331510,NAICS_2017_Code,331513, +BEA_2017_Detail_Code,331520,NAICS_2017_Code,331523, +BEA_2017_Detail_Code,331520,NAICS_2017_Code,331524, +BEA_2017_Detail_Code,331520,NAICS_2017_Code,331529, +BEA_2017_Detail_Code,33211A,NAICS_2017_Code,332111, +BEA_2017_Detail_Code,33211A,NAICS_2017_Code,332112, +BEA_2017_Detail_Code,332114,NAICS_2017_Code,332114, +BEA_2017_Detail_Code,33211A,NAICS_2017_Code,332117, +BEA_2017_Detail_Code,332119,NAICS_2017_Code,332119, +BEA_2017_Detail_Code,332200,NAICS_2017_Code,332215, +BEA_2017_Detail_Code,332200,NAICS_2017_Code,332216, +BEA_2017_Detail_Code,332310,NAICS_2017_Code,332311, +BEA_2017_Detail_Code,332310,NAICS_2017_Code,332312, +BEA_2017_Detail_Code,332310,NAICS_2017_Code,332313, +BEA_2017_Detail_Code,332320,NAICS_2017_Code,332321, +BEA_2017_Detail_Code,332320,NAICS_2017_Code,332322, +BEA_2017_Detail_Code,332320,NAICS_2017_Code,332323, +BEA_2017_Detail_Code,332410,NAICS_2017_Code,332410, +BEA_2017_Detail_Code,332420,NAICS_2017_Code,332420, +BEA_2017_Detail_Code,332430,NAICS_2017_Code,332431, +BEA_2017_Detail_Code,332430,NAICS_2017_Code,332439, +BEA_2017_Detail_Code,332500,NAICS_2017_Code,332510, +BEA_2017_Detail_Code,332600,NAICS_2017_Code,332613, +BEA_2017_Detail_Code,332600,NAICS_2017_Code,332618, +BEA_2017_Detail_Code,332710,NAICS_2017_Code,332710, +BEA_2017_Detail_Code,332720,NAICS_2017_Code,332721, +BEA_2017_Detail_Code,332720,NAICS_2017_Code,332722, +BEA_2017_Detail_Code,332800,NAICS_2017_Code,332811, +BEA_2017_Detail_Code,332800,NAICS_2017_Code,332812, +BEA_2017_Detail_Code,332800,NAICS_2017_Code,332813, +BEA_2017_Detail_Code,33291A,NAICS_2017_Code,332911, +BEA_2017_Detail_Code,33291A,NAICS_2017_Code,332912, +BEA_2017_Detail_Code,332913,NAICS_2017_Code,332913, +BEA_2017_Detail_Code,33291A,NAICS_2017_Code,332919, +BEA_2017_Detail_Code,332991,NAICS_2017_Code,332991, +BEA_2017_Detail_Code,33299A,NAICS_2017_Code,332992, +BEA_2017_Detail_Code,33299A,NAICS_2017_Code,332993, +BEA_2017_Detail_Code,33299A,NAICS_2017_Code,332994, +BEA_2017_Detail_Code,332996,NAICS_2017_Code,332996, +BEA_2017_Detail_Code,332999,NAICS_2017_Code,332999, +BEA_2017_Detail_Code,333111,NAICS_2017_Code,333111, +BEA_2017_Detail_Code,333112,NAICS_2017_Code,333112, +BEA_2017_Detail_Code,333120,NAICS_2017_Code,333120, +BEA_2017_Detail_Code,333130,NAICS_2017_Code,333131, +BEA_2017_Detail_Code,333130,NAICS_2017_Code,333132, +BEA_2017_Detail_Code,33329A,NAICS_2017_Code,333241, +BEA_2017_Detail_Code,333242,NAICS_2017_Code,333242, +BEA_2017_Detail_Code,33329A,NAICS_2017_Code,333243, +BEA_2017_Detail_Code,33329A,NAICS_2017_Code,333244, +BEA_2017_Detail_Code,33329A,NAICS_2017_Code,333249, +BEA_2017_Detail_Code,333314,NAICS_2017_Code,333314, +BEA_2017_Detail_Code,333316,NAICS_2017_Code,333316, +BEA_2017_Detail_Code,333318,NAICS_2017_Code,333318, +BEA_2017_Detail_Code,333413,NAICS_2017_Code,333413, +BEA_2017_Detail_Code,333414,NAICS_2017_Code,333414, +BEA_2017_Detail_Code,333415,NAICS_2017_Code,333415, +BEA_2017_Detail_Code,333511,NAICS_2017_Code,333511, +BEA_2017_Detail_Code,333514,NAICS_2017_Code,333514, +BEA_2017_Detail_Code,33351B,NAICS_2017_Code,333515, +BEA_2017_Detail_Code,333517,NAICS_2017_Code,333517, +BEA_2017_Detail_Code,33351B,NAICS_2017_Code,333519, +BEA_2017_Detail_Code,333611,NAICS_2017_Code,333611, +BEA_2017_Detail_Code,333612,NAICS_2017_Code,333612, +BEA_2017_Detail_Code,333613,NAICS_2017_Code,333613, +BEA_2017_Detail_Code,333618,NAICS_2017_Code,333618, +BEA_2017_Detail_Code,333912,NAICS_2017_Code,333912, +BEA_2017_Detail_Code,333914,NAICS_2017_Code,333914, +BEA_2017_Detail_Code,333920,NAICS_2017_Code,333921, +BEA_2017_Detail_Code,333920,NAICS_2017_Code,333922, +BEA_2017_Detail_Code,333920,NAICS_2017_Code,333923, +BEA_2017_Detail_Code,333920,NAICS_2017_Code,333924, +BEA_2017_Detail_Code,333991,NAICS_2017_Code,333991, +BEA_2017_Detail_Code,33399A,NAICS_2017_Code,333992, +BEA_2017_Detail_Code,333993,NAICS_2017_Code,333993, +BEA_2017_Detail_Code,333994,NAICS_2017_Code,333994, +BEA_2017_Detail_Code,33399B,NAICS_2017_Code,333995, +BEA_2017_Detail_Code,33399B,NAICS_2017_Code,333996, +BEA_2017_Detail_Code,33399A,NAICS_2017_Code,333997, +BEA_2017_Detail_Code,33399A,NAICS_2017_Code,333999, +BEA_2017_Detail_Code,334111,NAICS_2017_Code,334111, +BEA_2017_Detail_Code,334112,NAICS_2017_Code,334112, +BEA_2017_Detail_Code,334118,NAICS_2017_Code,334118, +BEA_2017_Detail_Code,334210,NAICS_2017_Code,334210, +BEA_2017_Detail_Code,334220,NAICS_2017_Code,334220, +BEA_2017_Detail_Code,334290,NAICS_2017_Code,334290, +BEA_2017_Detail_Code,334300,NAICS_2017_Code,334310, +BEA_2017_Detail_Code,33441A,NAICS_2017_Code,334412, +BEA_2017_Detail_Code,334413,NAICS_2017_Code,334413, +BEA_2017_Detail_Code,33441A,NAICS_2017_Code,334416, +BEA_2017_Detail_Code,33441A,NAICS_2017_Code,334417, +BEA_2017_Detail_Code,334418,NAICS_2017_Code,334418, +BEA_2017_Detail_Code,33441A,NAICS_2017_Code,334419, +BEA_2017_Detail_Code,334510,NAICS_2017_Code,334510, +BEA_2017_Detail_Code,334511,NAICS_2017_Code,334511, +BEA_2017_Detail_Code,334512,NAICS_2017_Code,334512, +BEA_2017_Detail_Code,334513,NAICS_2017_Code,334513, +BEA_2017_Detail_Code,334514,NAICS_2017_Code,334514, +BEA_2017_Detail_Code,334515,NAICS_2017_Code,334515, +BEA_2017_Detail_Code,334516,NAICS_2017_Code,334516, +BEA_2017_Detail_Code,334517,NAICS_2017_Code,334517, +BEA_2017_Detail_Code,33451A,NAICS_2017_Code,334519, +BEA_2017_Detail_Code,334610,NAICS_2017_Code,334613, +BEA_2017_Detail_Code,334610,NAICS_2017_Code,334614, +BEA_2017_Detail_Code,335110,NAICS_2017_Code,335110, +BEA_2017_Detail_Code,335120,NAICS_2017_Code,335121, +BEA_2017_Detail_Code,335120,NAICS_2017_Code,335122, +BEA_2017_Detail_Code,335120,NAICS_2017_Code,335129, +BEA_2017_Detail_Code,335210,NAICS_2017_Code,335210, +BEA_2017_Detail_Code,335220,NAICS_2017_Code,335220, +BEA_2017_Detail_Code,335311,NAICS_2017_Code,335311, +BEA_2017_Detail_Code,335312,NAICS_2017_Code,335312, +BEA_2017_Detail_Code,335313,NAICS_2017_Code,335313, +BEA_2017_Detail_Code,335314,NAICS_2017_Code,335314, +BEA_2017_Detail_Code,335911,NAICS_2017_Code,335911, +BEA_2017_Detail_Code,335912,NAICS_2017_Code,335912, +BEA_2017_Detail_Code,335920,NAICS_2017_Code,335921, +BEA_2017_Detail_Code,335920,NAICS_2017_Code,335929, +BEA_2017_Detail_Code,335930,NAICS_2017_Code,335931, +BEA_2017_Detail_Code,335930,NAICS_2017_Code,335932, +BEA_2017_Detail_Code,335991,NAICS_2017_Code,335991, +BEA_2017_Detail_Code,335999,NAICS_2017_Code,335999, +BEA_2017_Detail_Code,336111,NAICS_2017_Code,336111, +BEA_2017_Detail_Code,336112,NAICS_2017_Code,336112, +BEA_2017_Detail_Code,336120,NAICS_2017_Code,336120, +BEA_2017_Detail_Code,336211,NAICS_2017_Code,336211, +BEA_2017_Detail_Code,336212,NAICS_2017_Code,336212, +BEA_2017_Detail_Code,336213,NAICS_2017_Code,336213, +BEA_2017_Detail_Code,336214,NAICS_2017_Code,336214, +BEA_2017_Detail_Code,336310,NAICS_2017_Code,336310, +BEA_2017_Detail_Code,336320,NAICS_2017_Code,336320, +BEA_2017_Detail_Code,3363A0,NAICS_2017_Code,336330, +BEA_2017_Detail_Code,3363A0,NAICS_2017_Code,336340, +BEA_2017_Detail_Code,336350,NAICS_2017_Code,336350, +BEA_2017_Detail_Code,336360,NAICS_2017_Code,336360, +BEA_2017_Detail_Code,336370,NAICS_2017_Code,336370, +BEA_2017_Detail_Code,336390,NAICS_2017_Code,336390, +BEA_2017_Detail_Code,336411,NAICS_2017_Code,336411, +BEA_2017_Detail_Code,336412,NAICS_2017_Code,336412, +BEA_2017_Detail_Code,336413,NAICS_2017_Code,336413, +BEA_2017_Detail_Code,336414,NAICS_2017_Code,336414, +BEA_2017_Detail_Code,33641A,NAICS_2017_Code,336415, +BEA_2017_Detail_Code,33641A,NAICS_2017_Code,336419, +BEA_2017_Detail_Code,336500,NAICS_2017_Code,336510, +BEA_2017_Detail_Code,336611,NAICS_2017_Code,336611, +BEA_2017_Detail_Code,336612,NAICS_2017_Code,336612, +BEA_2017_Detail_Code,336991,NAICS_2017_Code,336991, +BEA_2017_Detail_Code,336992,NAICS_2017_Code,336992, +BEA_2017_Detail_Code,336999,NAICS_2017_Code,336999, +BEA_2017_Detail_Code,337110,NAICS_2017_Code,337110, +BEA_2017_Detail_Code,337121,NAICS_2017_Code,337121, +BEA_2017_Detail_Code,337122,NAICS_2017_Code,337122, +BEA_2017_Detail_Code,33712N,NAICS_2017_Code,337124, +BEA_2017_Detail_Code,33712N,NAICS_2017_Code,337125, +BEA_2017_Detail_Code,337127,NAICS_2017_Code,337127, +BEA_2017_Detail_Code,33721A,NAICS_2017_Code,337211, +BEA_2017_Detail_Code,33721A,NAICS_2017_Code,337212, +BEA_2017_Detail_Code,33721A,NAICS_2017_Code,337214, +BEA_2017_Detail_Code,337215,NAICS_2017_Code,337215, +BEA_2017_Detail_Code,337900,NAICS_2017_Code,337910, +BEA_2017_Detail_Code,337900,NAICS_2017_Code,337920, +BEA_2017_Detail_Code,339112,NAICS_2017_Code,339112, +BEA_2017_Detail_Code,339113,NAICS_2017_Code,339113, +BEA_2017_Detail_Code,339114,NAICS_2017_Code,339114, +BEA_2017_Detail_Code,339115,NAICS_2017_Code,339115, +BEA_2017_Detail_Code,339116,NAICS_2017_Code,339116, +BEA_2017_Detail_Code,339910,NAICS_2017_Code,339910, +BEA_2017_Detail_Code,339920,NAICS_2017_Code,339920, +BEA_2017_Detail_Code,339930,NAICS_2017_Code,339930, +BEA_2017_Detail_Code,339940,NAICS_2017_Code,339940, +BEA_2017_Detail_Code,339950,NAICS_2017_Code,339950, +BEA_2017_Detail_Code,339990,NAICS_2017_Code,339991, +BEA_2017_Detail_Code,339990,NAICS_2017_Code,339992, +BEA_2017_Detail_Code,339990,NAICS_2017_Code,339993, +BEA_2017_Detail_Code,339990,NAICS_2017_Code,339994, +BEA_2017_Detail_Code,339990,NAICS_2017_Code,339995, +BEA_2017_Detail_Code,339990,NAICS_2017_Code,339999, +BEA_2017_Detail_Code,423100,NAICS_2017_Code,423110, +BEA_2017_Detail_Code,423100,NAICS_2017_Code,423120, +BEA_2017_Detail_Code,423100,NAICS_2017_Code,423130, +BEA_2017_Detail_Code,423100,NAICS_2017_Code,423140, +BEA_2017_Detail_Code,423A00,NAICS_2017_Code,423210, +BEA_2017_Detail_Code,423A00,NAICS_2017_Code,423220, +BEA_2017_Detail_Code,423A00,NAICS_2017_Code,423310, +BEA_2017_Detail_Code,423A00,NAICS_2017_Code,423320, +BEA_2017_Detail_Code,423A00,NAICS_2017_Code,423330, +BEA_2017_Detail_Code,423A00,NAICS_2017_Code,423390, +BEA_2017_Detail_Code,423400,NAICS_2017_Code,423410, +BEA_2017_Detail_Code,423400,NAICS_2017_Code,423420, +BEA_2017_Detail_Code,423400,NAICS_2017_Code,423430, +BEA_2017_Detail_Code,423400,NAICS_2017_Code,423440, +BEA_2017_Detail_Code,423400,NAICS_2017_Code,423450, +BEA_2017_Detail_Code,423400,NAICS_2017_Code,423460, +BEA_2017_Detail_Code,423400,NAICS_2017_Code,423490, +BEA_2017_Detail_Code,423A00,NAICS_2017_Code,423510, +BEA_2017_Detail_Code,423A00,NAICS_2017_Code,423520, +BEA_2017_Detail_Code,423600,NAICS_2017_Code,423610, +BEA_2017_Detail_Code,423600,NAICS_2017_Code,423620, +BEA_2017_Detail_Code,423600,NAICS_2017_Code,423690, +BEA_2017_Detail_Code,423A00,NAICS_2017_Code,423710, +BEA_2017_Detail_Code,423A00,NAICS_2017_Code,423720, +BEA_2017_Detail_Code,423A00,NAICS_2017_Code,423730, +BEA_2017_Detail_Code,423A00,NAICS_2017_Code,423740, +BEA_2017_Detail_Code,423800,NAICS_2017_Code,423810, +BEA_2017_Detail_Code,423800,NAICS_2017_Code,423820, +BEA_2017_Detail_Code,423800,NAICS_2017_Code,423830, +BEA_2017_Detail_Code,423800,NAICS_2017_Code,423840, +BEA_2017_Detail_Code,423800,NAICS_2017_Code,423850, +BEA_2017_Detail_Code,423800,NAICS_2017_Code,423860, +BEA_2017_Detail_Code,423A00,NAICS_2017_Code,423910, +BEA_2017_Detail_Code,423A00,NAICS_2017_Code,423920, +BEA_2017_Detail_Code,423A00,NAICS_2017_Code,423930, +BEA_2017_Detail_Code,423A00,NAICS_2017_Code,423940, +BEA_2017_Detail_Code,423A00,NAICS_2017_Code,423990, +BEA_2017_Detail_Code,424A00,NAICS_2017_Code,424110, +BEA_2017_Detail_Code,424A00,NAICS_2017_Code,424120, +BEA_2017_Detail_Code,424A00,NAICS_2017_Code,424130, +BEA_2017_Detail_Code,424200,NAICS_2017_Code,424210, +BEA_2017_Detail_Code,424A00,NAICS_2017_Code,424310, +BEA_2017_Detail_Code,424A00,NAICS_2017_Code,424320, +BEA_2017_Detail_Code,424A00,NAICS_2017_Code,424330, +BEA_2017_Detail_Code,424A00,NAICS_2017_Code,424340, +BEA_2017_Detail_Code,424400,NAICS_2017_Code,424410, +BEA_2017_Detail_Code,424400,NAICS_2017_Code,424420, +BEA_2017_Detail_Code,424400,NAICS_2017_Code,424430, +BEA_2017_Detail_Code,424400,NAICS_2017_Code,424440, +BEA_2017_Detail_Code,424400,NAICS_2017_Code,424450, +BEA_2017_Detail_Code,424400,NAICS_2017_Code,424460, +BEA_2017_Detail_Code,424400,NAICS_2017_Code,424470, +BEA_2017_Detail_Code,424400,NAICS_2017_Code,424480, +BEA_2017_Detail_Code,424400,NAICS_2017_Code,424490, +BEA_2017_Detail_Code,424A00,NAICS_2017_Code,424510, +BEA_2017_Detail_Code,424A00,NAICS_2017_Code,424520, +BEA_2017_Detail_Code,424A00,NAICS_2017_Code,424590, +BEA_2017_Detail_Code,424A00,NAICS_2017_Code,424610, +BEA_2017_Detail_Code,424A00,NAICS_2017_Code,424690, +BEA_2017_Detail_Code,424700,NAICS_2017_Code,424710, +BEA_2017_Detail_Code,424700,NAICS_2017_Code,424720, +BEA_2017_Detail_Code,424A00,NAICS_2017_Code,424810, +BEA_2017_Detail_Code,424A00,NAICS_2017_Code,424820, +BEA_2017_Detail_Code,424A00,NAICS_2017_Code,424910, +BEA_2017_Detail_Code,424A00,NAICS_2017_Code,424920, +BEA_2017_Detail_Code,424A00,NAICS_2017_Code,424930, +BEA_2017_Detail_Code,424A00,NAICS_2017_Code,424940, +BEA_2017_Detail_Code,424A00,NAICS_2017_Code,424950, +BEA_2017_Detail_Code,424A00,NAICS_2017_Code,424990, +BEA_2017_Detail_Code,425000,NAICS_2017_Code,425110, +BEA_2017_Detail_Code,425000,NAICS_2017_Code,425120, +BEA_2017_Detail_Code,441000,NAICS_2017_Code,441110, +BEA_2017_Detail_Code,441000,NAICS_2017_Code,441120, +BEA_2017_Detail_Code,441000,NAICS_2017_Code,441210, +BEA_2017_Detail_Code,441000,NAICS_2017_Code,441222, +BEA_2017_Detail_Code,441000,NAICS_2017_Code,441228, +BEA_2017_Detail_Code,441000,NAICS_2017_Code,441310, +BEA_2017_Detail_Code,441000,NAICS_2017_Code,441320, +BEA_2017_Detail_Code,4B0000,NAICS_2017_Code,442110, +BEA_2017_Detail_Code,4B0000,NAICS_2017_Code,442210, +BEA_2017_Detail_Code,4B0000,NAICS_2017_Code,442291, +BEA_2017_Detail_Code,4B0000,NAICS_2017_Code,442299, +BEA_2017_Detail_Code,4B0000,NAICS_2017_Code,443141, +BEA_2017_Detail_Code,4B0000,NAICS_2017_Code,443142, +BEA_2017_Detail_Code,444000,NAICS_2017_Code,444110, +BEA_2017_Detail_Code,444000,NAICS_2017_Code,444120, +BEA_2017_Detail_Code,444000,NAICS_2017_Code,444130, +BEA_2017_Detail_Code,444000,NAICS_2017_Code,444190, +BEA_2017_Detail_Code,444000,NAICS_2017_Code,444210, +BEA_2017_Detail_Code,444000,NAICS_2017_Code,444220, +BEA_2017_Detail_Code,445000,NAICS_2017_Code,445110, +BEA_2017_Detail_Code,445000,NAICS_2017_Code,445120, +BEA_2017_Detail_Code,445000,NAICS_2017_Code,445210, +BEA_2017_Detail_Code,445000,NAICS_2017_Code,445220, +BEA_2017_Detail_Code,445000,NAICS_2017_Code,445230, +BEA_2017_Detail_Code,445000,NAICS_2017_Code,445291, +BEA_2017_Detail_Code,445000,NAICS_2017_Code,445292, +BEA_2017_Detail_Code,445000,NAICS_2017_Code,445299, +BEA_2017_Detail_Code,445000,NAICS_2017_Code,445310, +BEA_2017_Detail_Code,446000,NAICS_2017_Code,446110, +BEA_2017_Detail_Code,446000,NAICS_2017_Code,446120, +BEA_2017_Detail_Code,446000,NAICS_2017_Code,446130, +BEA_2017_Detail_Code,446000,NAICS_2017_Code,446191, +BEA_2017_Detail_Code,446000,NAICS_2017_Code,446199, +BEA_2017_Detail_Code,447000,NAICS_2017_Code,447110, +BEA_2017_Detail_Code,447000,NAICS_2017_Code,447190, +BEA_2017_Detail_Code,448000,NAICS_2017_Code,448110, +BEA_2017_Detail_Code,448000,NAICS_2017_Code,448120, +BEA_2017_Detail_Code,448000,NAICS_2017_Code,448130, +BEA_2017_Detail_Code,448000,NAICS_2017_Code,448140, +BEA_2017_Detail_Code,448000,NAICS_2017_Code,448150, +BEA_2017_Detail_Code,448000,NAICS_2017_Code,448190, +BEA_2017_Detail_Code,448000,NAICS_2017_Code,448210, +BEA_2017_Detail_Code,448000,NAICS_2017_Code,448310, +BEA_2017_Detail_Code,448000,NAICS_2017_Code,448320, +BEA_2017_Detail_Code,4B0000,NAICS_2017_Code,451110, +BEA_2017_Detail_Code,4B0000,NAICS_2017_Code,451120, +BEA_2017_Detail_Code,4B0000,NAICS_2017_Code,451130, +BEA_2017_Detail_Code,4B0000,NAICS_2017_Code,451140, +BEA_2017_Detail_Code,4B0000,NAICS_2017_Code,451211, +BEA_2017_Detail_Code,4B0000,NAICS_2017_Code,451212, +BEA_2017_Detail_Code,452000,NAICS_2017_Code,452210, +BEA_2017_Detail_Code,452000,NAICS_2017_Code,452311, +BEA_2017_Detail_Code,452000,NAICS_2017_Code,452319, +BEA_2017_Detail_Code,4B0000,NAICS_2017_Code,453110, +BEA_2017_Detail_Code,4B0000,NAICS_2017_Code,453210, +BEA_2017_Detail_Code,4B0000,NAICS_2017_Code,453220, +BEA_2017_Detail_Code,4B0000,NAICS_2017_Code,453310, +BEA_2017_Detail_Code,4B0000,NAICS_2017_Code,453910, +BEA_2017_Detail_Code,4B0000,NAICS_2017_Code,453920, +BEA_2017_Detail_Code,4B0000,NAICS_2017_Code,453930, +BEA_2017_Detail_Code,4B0000,NAICS_2017_Code,453991, +BEA_2017_Detail_Code,4B0000,NAICS_2017_Code,453998, +BEA_2017_Detail_Code,454000,NAICS_2017_Code,454110, +BEA_2017_Detail_Code,454000,NAICS_2017_Code,454210, +BEA_2017_Detail_Code,454000,NAICS_2017_Code,454310, +BEA_2017_Detail_Code,454000,NAICS_2017_Code,454390, +BEA_2017_Detail_Code,481000,NAICS_2017_Code,481111, +BEA_2017_Detail_Code,481000,NAICS_2017_Code,481112, +BEA_2017_Detail_Code,481000,NAICS_2017_Code,481211, +BEA_2017_Detail_Code,481000,NAICS_2017_Code,481212, +BEA_2017_Detail_Code,481000,NAICS_2017_Code,481219, +BEA_2017_Detail_Code,482000,NAICS_2017_Code,482111, +BEA_2017_Detail_Code,482000,NAICS_2017_Code,482112, +BEA_2017_Detail_Code,483000,NAICS_2017_Code,483111, +BEA_2017_Detail_Code,483000,NAICS_2017_Code,483112, +BEA_2017_Detail_Code,483000,NAICS_2017_Code,483113, +BEA_2017_Detail_Code,483000,NAICS_2017_Code,483114, +BEA_2017_Detail_Code,483000,NAICS_2017_Code,483211, +BEA_2017_Detail_Code,483000,NAICS_2017_Code,483212, +BEA_2017_Detail_Code,484000,NAICS_2017_Code,484110, +BEA_2017_Detail_Code,484000,NAICS_2017_Code,484121, +BEA_2017_Detail_Code,484000,NAICS_2017_Code,484122, +BEA_2017_Detail_Code,484000,NAICS_2017_Code,484210, +BEA_2017_Detail_Code,484000,NAICS_2017_Code,484220, +BEA_2017_Detail_Code,484000,NAICS_2017_Code,484230, +BEA_2017_Detail_Code,485000,NAICS_2017_Code,485111, +BEA_2017_Detail_Code,485000,NAICS_2017_Code,485112, +BEA_2017_Detail_Code,485000,NAICS_2017_Code,485113, +BEA_2017_Detail_Code,485000,NAICS_2017_Code,485119, +BEA_2017_Detail_Code,485000,NAICS_2017_Code,485210, +BEA_2017_Detail_Code,485000,NAICS_2017_Code,485310, +BEA_2017_Detail_Code,485000,NAICS_2017_Code,485320, +BEA_2017_Detail_Code,485000,NAICS_2017_Code,485410, +BEA_2017_Detail_Code,485000,NAICS_2017_Code,485510, +BEA_2017_Detail_Code,485000,NAICS_2017_Code,485991, +BEA_2017_Detail_Code,485000,NAICS_2017_Code,485999, +BEA_2017_Detail_Code,486000,NAICS_2017_Code,486110, +BEA_2017_Detail_Code,486000,NAICS_2017_Code,486210, +BEA_2017_Detail_Code,486000,NAICS_2017_Code,486910, +BEA_2017_Detail_Code,486000,NAICS_2017_Code,486990, +BEA_2017_Detail_Code,48A000,NAICS_2017_Code,487110, +BEA_2017_Detail_Code,48A000,NAICS_2017_Code,487210, +BEA_2017_Detail_Code,48A000,NAICS_2017_Code,487990, +BEA_2017_Detail_Code,48A000,NAICS_2017_Code,488111, +BEA_2017_Detail_Code,48A000,NAICS_2017_Code,488119, +BEA_2017_Detail_Code,48A000,NAICS_2017_Code,488190, +BEA_2017_Detail_Code,48A000,NAICS_2017_Code,488210, +BEA_2017_Detail_Code,48A000,NAICS_2017_Code,488310, +BEA_2017_Detail_Code,48A000,NAICS_2017_Code,488320, +BEA_2017_Detail_Code,48A000,NAICS_2017_Code,488330, +BEA_2017_Detail_Code,48A000,NAICS_2017_Code,488390, +BEA_2017_Detail_Code,48A000,NAICS_2017_Code,488410, +BEA_2017_Detail_Code,48A000,NAICS_2017_Code,488490, +BEA_2017_Detail_Code,48A000,NAICS_2017_Code,488510, +BEA_2017_Detail_Code,48A000,NAICS_2017_Code,488991, +BEA_2017_Detail_Code,48A000,NAICS_2017_Code,488999, +BEA_2017_Detail_Code,491000,NAICS_2017_Code,491110, +BEA_2017_Detail_Code,492000,NAICS_2017_Code,492110, +BEA_2017_Detail_Code,492000,NAICS_2017_Code,492210, +BEA_2017_Detail_Code,493000,NAICS_2017_Code,493110, +BEA_2017_Detail_Code,493000,NAICS_2017_Code,493120, +BEA_2017_Detail_Code,493000,NAICS_2017_Code,493130, +BEA_2017_Detail_Code,493000,NAICS_2017_Code,493190, +BEA_2017_Detail_Code,511110,NAICS_2017_Code,511110, +BEA_2017_Detail_Code,511120,NAICS_2017_Code,511120, +BEA_2017_Detail_Code,511130,NAICS_2017_Code,511130, +BEA_2017_Detail_Code,5111A0,NAICS_2017_Code,511140, +BEA_2017_Detail_Code,5111A0,NAICS_2017_Code,511191, +BEA_2017_Detail_Code,5111A0,NAICS_2017_Code,511199, +BEA_2017_Detail_Code,511200,NAICS_2017_Code,511210, +BEA_2017_Detail_Code,512100,NAICS_2017_Code,512110, +BEA_2017_Detail_Code,512100,NAICS_2017_Code,512120, +BEA_2017_Detail_Code,512100,NAICS_2017_Code,512131, +BEA_2017_Detail_Code,512100,NAICS_2017_Code,512132, +BEA_2017_Detail_Code,512100,NAICS_2017_Code,512191, +BEA_2017_Detail_Code,512100,NAICS_2017_Code,512199, +BEA_2017_Detail_Code,512200,NAICS_2017_Code,512230, +BEA_2017_Detail_Code,512200,NAICS_2017_Code,512240, +BEA_2017_Detail_Code,512200,NAICS_2017_Code,512250, +BEA_2017_Detail_Code,512200,NAICS_2017_Code,512290, +BEA_2017_Detail_Code,515100,NAICS_2017_Code,515111, +BEA_2017_Detail_Code,515100,NAICS_2017_Code,515112, +BEA_2017_Detail_Code,515100,NAICS_2017_Code,515120, +BEA_2017_Detail_Code,515200,NAICS_2017_Code,515210, +BEA_2017_Detail_Code,517110,NAICS_2017_Code,517311, +BEA_2017_Detail_Code,517210,NAICS_2017_Code,517312, +BEA_2017_Detail_Code,517A00,NAICS_2017_Code,517410, +BEA_2017_Detail_Code,517A00,NAICS_2017_Code,517911, +BEA_2017_Detail_Code,517A00,NAICS_2017_Code,517919, +BEA_2017_Detail_Code,518200,NAICS_2017_Code,518210, +BEA_2017_Detail_Code,5191A0,NAICS_2017_Code,519110, +BEA_2017_Detail_Code,5191A0,NAICS_2017_Code,519120, +BEA_2017_Detail_Code,519130,NAICS_2017_Code,519130, +BEA_2017_Detail_Code,5191A0,NAICS_2017_Code,519190, +BEA_2017_Detail_Code,52A000,NAICS_2017_Code,521110, +BEA_2017_Detail_Code,52A000,NAICS_2017_Code,522110, +BEA_2017_Detail_Code,52A000,NAICS_2017_Code,522120, +BEA_2017_Detail_Code,52A000,NAICS_2017_Code,522130, +BEA_2017_Detail_Code,52A000,NAICS_2017_Code,522190, +BEA_2017_Detail_Code,522A00,NAICS_2017_Code,522210, +BEA_2017_Detail_Code,522A00,NAICS_2017_Code,522220, +BEA_2017_Detail_Code,522A00,NAICS_2017_Code,522291, +BEA_2017_Detail_Code,522A00,NAICS_2017_Code,522292, +BEA_2017_Detail_Code,522A00,NAICS_2017_Code,522293, +BEA_2017_Detail_Code,522A00,NAICS_2017_Code,522294, +BEA_2017_Detail_Code,522A00,NAICS_2017_Code,522298, +BEA_2017_Detail_Code,522A00,NAICS_2017_Code,522310, +BEA_2017_Detail_Code,522A00,NAICS_2017_Code,522320, +BEA_2017_Detail_Code,522A00,NAICS_2017_Code,522390, +BEA_2017_Detail_Code,523A00,NAICS_2017_Code,523110, +BEA_2017_Detail_Code,523A00,NAICS_2017_Code,523120, +BEA_2017_Detail_Code,523A00,NAICS_2017_Code,523130, +BEA_2017_Detail_Code,523A00,NAICS_2017_Code,523140, +BEA_2017_Detail_Code,523A00,NAICS_2017_Code,523210, +BEA_2017_Detail_Code,523900,NAICS_2017_Code,523910, +BEA_2017_Detail_Code,523900,NAICS_2017_Code,523920, +BEA_2017_Detail_Code,523900,NAICS_2017_Code,523930, +BEA_2017_Detail_Code,523900,NAICS_2017_Code,523991, +BEA_2017_Detail_Code,523900,NAICS_2017_Code,523999, +BEA_2017_Detail_Code,524113,NAICS_2017_Code,524113, +BEA_2017_Detail_Code,5241XX,NAICS_2017_Code,524114, +BEA_2017_Detail_Code,5241XX,NAICS_2017_Code,524126, +BEA_2017_Detail_Code,5241XX,NAICS_2017_Code,524127, +BEA_2017_Detail_Code,5241XX,NAICS_2017_Code,524128, +BEA_2017_Detail_Code,5241XX,NAICS_2017_Code,524130, +BEA_2017_Detail_Code,524200,NAICS_2017_Code,524210, +BEA_2017_Detail_Code,524200,NAICS_2017_Code,524291, +BEA_2017_Detail_Code,524200,NAICS_2017_Code,524292, +BEA_2017_Detail_Code,524200,NAICS_2017_Code,524298, +BEA_2017_Detail_Code,525000,NAICS_2017_Code,525110, +BEA_2017_Detail_Code,525000,NAICS_2017_Code,525120, +BEA_2017_Detail_Code,525000,NAICS_2017_Code,525190, +BEA_2017_Detail_Code,525000,NAICS_2017_Code,525910, +BEA_2017_Detail_Code,525000,NAICS_2017_Code,525920, +BEA_2017_Detail_Code,525000,NAICS_2017_Code,525990, +BEA_2017_Detail_Code,531HSO,NAICS_2017_Code,531110, +BEA_2017_Detail_Code,531HST,NAICS_2017_Code,531110, +BEA_2017_Detail_Code,531ORE,NAICS_2017_Code,531120, +BEA_2017_Detail_Code,531ORE,NAICS_2017_Code,531130, +BEA_2017_Detail_Code,531ORE,NAICS_2017_Code,531190, +BEA_2017_Detail_Code,531ORE,NAICS_2017_Code,531210, +BEA_2017_Detail_Code,531ORE,NAICS_2017_Code,531311, +BEA_2017_Detail_Code,531ORE,NAICS_2017_Code,531312, +BEA_2017_Detail_Code,531ORE,NAICS_2017_Code,531320, +BEA_2017_Detail_Code,531ORE,NAICS_2017_Code,531390, +BEA_2017_Detail_Code,532100,NAICS_2017_Code,532111, +BEA_2017_Detail_Code,532100,NAICS_2017_Code,532112, +BEA_2017_Detail_Code,532100,NAICS_2017_Code,532120, +BEA_2017_Detail_Code,532A00,NAICS_2017_Code,532210, +BEA_2017_Detail_Code,532A00,NAICS_2017_Code,532281, +BEA_2017_Detail_Code,532A00,NAICS_2017_Code,532282, +BEA_2017_Detail_Code,532A00,NAICS_2017_Code,532283, +BEA_2017_Detail_Code,532A00,NAICS_2017_Code,532284, +BEA_2017_Detail_Code,532A00,NAICS_2017_Code,532289, +BEA_2017_Detail_Code,532A00,NAICS_2017_Code,532310, +BEA_2017_Detail_Code,532400,NAICS_2017_Code,532411, +BEA_2017_Detail_Code,532400,NAICS_2017_Code,532412, +BEA_2017_Detail_Code,532400,NAICS_2017_Code,532420, +BEA_2017_Detail_Code,532400,NAICS_2017_Code,532490, +BEA_2017_Detail_Code,533000,NAICS_2017_Code,533110, +BEA_2017_Detail_Code,541100,NAICS_2017_Code,541110, +BEA_2017_Detail_Code,541100,NAICS_2017_Code,541120, +BEA_2017_Detail_Code,541100,NAICS_2017_Code,541191, +BEA_2017_Detail_Code,541100,NAICS_2017_Code,541199, +BEA_2017_Detail_Code,541200,NAICS_2017_Code,541211, +BEA_2017_Detail_Code,541200,NAICS_2017_Code,541213, +BEA_2017_Detail_Code,541200,NAICS_2017_Code,541214, +BEA_2017_Detail_Code,541200,NAICS_2017_Code,541219, +BEA_2017_Detail_Code,541300,NAICS_2017_Code,541310, +BEA_2017_Detail_Code,541300,NAICS_2017_Code,541320, +BEA_2017_Detail_Code,541300,NAICS_2017_Code,541330, +BEA_2017_Detail_Code,541300,NAICS_2017_Code,541340, +BEA_2017_Detail_Code,541300,NAICS_2017_Code,541350, +BEA_2017_Detail_Code,541300,NAICS_2017_Code,541360, +BEA_2017_Detail_Code,541300,NAICS_2017_Code,541370, +BEA_2017_Detail_Code,541300,NAICS_2017_Code,541380, +BEA_2017_Detail_Code,541400,NAICS_2017_Code,541410, +BEA_2017_Detail_Code,541400,NAICS_2017_Code,541420, +BEA_2017_Detail_Code,541400,NAICS_2017_Code,541430, +BEA_2017_Detail_Code,541400,NAICS_2017_Code,541490, +BEA_2017_Detail_Code,541511,NAICS_2017_Code,541511, +BEA_2017_Detail_Code,541512,NAICS_2017_Code,541512, +BEA_2017_Detail_Code,54151A,NAICS_2017_Code,541513, +BEA_2017_Detail_Code,54151A,NAICS_2017_Code,541519, +BEA_2017_Detail_Code,541610,NAICS_2017_Code,541611, +BEA_2017_Detail_Code,541610,NAICS_2017_Code,541612, +BEA_2017_Detail_Code,541610,NAICS_2017_Code,541613, +BEA_2017_Detail_Code,541610,NAICS_2017_Code,541614, +BEA_2017_Detail_Code,541610,NAICS_2017_Code,541618, +BEA_2017_Detail_Code,5416A0,NAICS_2017_Code,541620, +BEA_2017_Detail_Code,5416A0,NAICS_2017_Code,541690, +BEA_2017_Detail_Code,541700,NAICS_2017_Code,541713, +BEA_2017_Detail_Code,541700,NAICS_2017_Code,541714, +BEA_2017_Detail_Code,541700,NAICS_2017_Code,541715, +BEA_2017_Detail_Code,541700,NAICS_2017_Code,541720, +BEA_2017_Detail_Code,541800,NAICS_2017_Code,541810, +BEA_2017_Detail_Code,541800,NAICS_2017_Code,541820, +BEA_2017_Detail_Code,541800,NAICS_2017_Code,541830, +BEA_2017_Detail_Code,541800,NAICS_2017_Code,541840, +BEA_2017_Detail_Code,541800,NAICS_2017_Code,541850, +BEA_2017_Detail_Code,541800,NAICS_2017_Code,541860, +BEA_2017_Detail_Code,541800,NAICS_2017_Code,541870, +BEA_2017_Detail_Code,541800,NAICS_2017_Code,541890, +BEA_2017_Detail_Code,5419A0,NAICS_2017_Code,541910, +BEA_2017_Detail_Code,541920,NAICS_2017_Code,541921, +BEA_2017_Detail_Code,541920,NAICS_2017_Code,541922, +BEA_2017_Detail_Code,5419A0,NAICS_2017_Code,541930, +BEA_2017_Detail_Code,541940,NAICS_2017_Code,541940, +BEA_2017_Detail_Code,5419A0,NAICS_2017_Code,541990, +BEA_2017_Detail_Code,550000,NAICS_2017_Code,551111, +BEA_2017_Detail_Code,550000,NAICS_2017_Code,551112, +BEA_2017_Detail_Code,550000,NAICS_2017_Code,551114, +BEA_2017_Detail_Code,561100,NAICS_2017_Code,561110, +BEA_2017_Detail_Code,561200,NAICS_2017_Code,561210, +BEA_2017_Detail_Code,561300,NAICS_2017_Code,561311, +BEA_2017_Detail_Code,561300,NAICS_2017_Code,561312, +BEA_2017_Detail_Code,561300,NAICS_2017_Code,561320, +BEA_2017_Detail_Code,561300,NAICS_2017_Code,561330, +BEA_2017_Detail_Code,561400,NAICS_2017_Code,561410, +BEA_2017_Detail_Code,561400,NAICS_2017_Code,561421, +BEA_2017_Detail_Code,561400,NAICS_2017_Code,561422, +BEA_2017_Detail_Code,561400,NAICS_2017_Code,561431, +BEA_2017_Detail_Code,561400,NAICS_2017_Code,561439, +BEA_2017_Detail_Code,561400,NAICS_2017_Code,561440, +BEA_2017_Detail_Code,561400,NAICS_2017_Code,561450, +BEA_2017_Detail_Code,561400,NAICS_2017_Code,561491, +BEA_2017_Detail_Code,561400,NAICS_2017_Code,561492, +BEA_2017_Detail_Code,561400,NAICS_2017_Code,561499, +BEA_2017_Detail_Code,561500,NAICS_2017_Code,561510, +BEA_2017_Detail_Code,561500,NAICS_2017_Code,561520, +BEA_2017_Detail_Code,561500,NAICS_2017_Code,561591, +BEA_2017_Detail_Code,561500,NAICS_2017_Code,561599, +BEA_2017_Detail_Code,561600,NAICS_2017_Code,561611, +BEA_2017_Detail_Code,561600,NAICS_2017_Code,561612, +BEA_2017_Detail_Code,561600,NAICS_2017_Code,561613, +BEA_2017_Detail_Code,561600,NAICS_2017_Code,561621, +BEA_2017_Detail_Code,561600,NAICS_2017_Code,561622, +BEA_2017_Detail_Code,561700,NAICS_2017_Code,561710, +BEA_2017_Detail_Code,561700,NAICS_2017_Code,561720, +BEA_2017_Detail_Code,561700,NAICS_2017_Code,561730, +BEA_2017_Detail_Code,561700,NAICS_2017_Code,561740, +BEA_2017_Detail_Code,561700,NAICS_2017_Code,561790, +BEA_2017_Detail_Code,561900,NAICS_2017_Code,561910, +BEA_2017_Detail_Code,561900,NAICS_2017_Code,561920, +BEA_2017_Detail_Code,561900,NAICS_2017_Code,561990, +BEA_2017_Detail_Code,562000,NAICS_2017_Code,562111, +BEA_2017_Detail_Code,562000,NAICS_2017_Code,562112, +BEA_2017_Detail_Code,562000,NAICS_2017_Code,562119, +BEA_2017_Detail_Code,562000,NAICS_2017_Code,562211, +BEA_2017_Detail_Code,562000,NAICS_2017_Code,562212, +BEA_2017_Detail_Code,562000,NAICS_2017_Code,562213, +BEA_2017_Detail_Code,562000,NAICS_2017_Code,562219, +BEA_2017_Detail_Code,562000,NAICS_2017_Code,562910, +BEA_2017_Detail_Code,562000,NAICS_2017_Code,562920, +BEA_2017_Detail_Code,562000,NAICS_2017_Code,562991, +BEA_2017_Detail_Code,562000,NAICS_2017_Code,562998, +BEA_2017_Detail_Code,611100,NAICS_2017_Code,611110, +BEA_2017_Detail_Code,611A00,NAICS_2017_Code,611210, +BEA_2017_Detail_Code,611A00,NAICS_2017_Code,611310, +BEA_2017_Detail_Code,611B00,NAICS_2017_Code,611410, +BEA_2017_Detail_Code,611B00,NAICS_2017_Code,611420, +BEA_2017_Detail_Code,611B00,NAICS_2017_Code,611430, +BEA_2017_Detail_Code,611B00,NAICS_2017_Code,611511, +BEA_2017_Detail_Code,611B00,NAICS_2017_Code,611512, +BEA_2017_Detail_Code,611B00,NAICS_2017_Code,611513, +BEA_2017_Detail_Code,611B00,NAICS_2017_Code,611519, +BEA_2017_Detail_Code,611B00,NAICS_2017_Code,611610, +BEA_2017_Detail_Code,611B00,NAICS_2017_Code,611620, +BEA_2017_Detail_Code,611B00,NAICS_2017_Code,611630, +BEA_2017_Detail_Code,611B00,NAICS_2017_Code,611691, +BEA_2017_Detail_Code,611B00,NAICS_2017_Code,611692, +BEA_2017_Detail_Code,611B00,NAICS_2017_Code,611699, +BEA_2017_Detail_Code,611B00,NAICS_2017_Code,611710, +BEA_2017_Detail_Code,621100,NAICS_2017_Code,621111, +BEA_2017_Detail_Code,621100,NAICS_2017_Code,621112, +BEA_2017_Detail_Code,621200,NAICS_2017_Code,621210, +BEA_2017_Detail_Code,621300,NAICS_2017_Code,621310, +BEA_2017_Detail_Code,621300,NAICS_2017_Code,621320, +BEA_2017_Detail_Code,621300,NAICS_2017_Code,621330, +BEA_2017_Detail_Code,621300,NAICS_2017_Code,621340, +BEA_2017_Detail_Code,621300,NAICS_2017_Code,621391, +BEA_2017_Detail_Code,621300,NAICS_2017_Code,621399, +BEA_2017_Detail_Code,621400,NAICS_2017_Code,621410, +BEA_2017_Detail_Code,621400,NAICS_2017_Code,621420, +BEA_2017_Detail_Code,621400,NAICS_2017_Code,621491, +BEA_2017_Detail_Code,621400,NAICS_2017_Code,621492, +BEA_2017_Detail_Code,621400,NAICS_2017_Code,621493, +BEA_2017_Detail_Code,621400,NAICS_2017_Code,621498, +BEA_2017_Detail_Code,621500,NAICS_2017_Code,621511, +BEA_2017_Detail_Code,621500,NAICS_2017_Code,621512, +BEA_2017_Detail_Code,621600,NAICS_2017_Code,621610, +BEA_2017_Detail_Code,621900,NAICS_2017_Code,621910, +BEA_2017_Detail_Code,621900,NAICS_2017_Code,621991, +BEA_2017_Detail_Code,621900,NAICS_2017_Code,621999, +BEA_2017_Detail_Code,622000,NAICS_2017_Code,622110, +BEA_2017_Detail_Code,622000,NAICS_2017_Code,622210, +BEA_2017_Detail_Code,622000,NAICS_2017_Code,622310, +BEA_2017_Detail_Code,623A00,NAICS_2017_Code,623110, +BEA_2017_Detail_Code,623B00,NAICS_2017_Code,623210, +BEA_2017_Detail_Code,623B00,NAICS_2017_Code,623220, +BEA_2017_Detail_Code,623A00,NAICS_2017_Code,623311, +BEA_2017_Detail_Code,623A00,NAICS_2017_Code,623312, +BEA_2017_Detail_Code,623B00,NAICS_2017_Code,623990, +BEA_2017_Detail_Code,624100,NAICS_2017_Code,624110, +BEA_2017_Detail_Code,624100,NAICS_2017_Code,624120, +BEA_2017_Detail_Code,624100,NAICS_2017_Code,624190, +BEA_2017_Detail_Code,624A00,NAICS_2017_Code,624210, +BEA_2017_Detail_Code,624A00,NAICS_2017_Code,624221, +BEA_2017_Detail_Code,624A00,NAICS_2017_Code,624229, +BEA_2017_Detail_Code,624A00,NAICS_2017_Code,624230, +BEA_2017_Detail_Code,624A00,NAICS_2017_Code,624310, +BEA_2017_Detail_Code,624400,NAICS_2017_Code,624410, +BEA_2017_Detail_Code,711100,NAICS_2017_Code,711110, +BEA_2017_Detail_Code,711100,NAICS_2017_Code,711120, +BEA_2017_Detail_Code,711100,NAICS_2017_Code,711130, +BEA_2017_Detail_Code,711100,NAICS_2017_Code,711190, +BEA_2017_Detail_Code,711200,NAICS_2017_Code,711211, +BEA_2017_Detail_Code,711200,NAICS_2017_Code,711212, +BEA_2017_Detail_Code,711200,NAICS_2017_Code,711219, +BEA_2017_Detail_Code,711A00,NAICS_2017_Code,711310, +BEA_2017_Detail_Code,711A00,NAICS_2017_Code,711320, +BEA_2017_Detail_Code,711A00,NAICS_2017_Code,711410, +BEA_2017_Detail_Code,711500,NAICS_2017_Code,711510, +BEA_2017_Detail_Code,712000,NAICS_2017_Code,712110, +BEA_2017_Detail_Code,712000,NAICS_2017_Code,712120, +BEA_2017_Detail_Code,712000,NAICS_2017_Code,712130, +BEA_2017_Detail_Code,712000,NAICS_2017_Code,712190, +BEA_2017_Detail_Code,713100,NAICS_2017_Code,713110, +BEA_2017_Detail_Code,713100,NAICS_2017_Code,713120, +BEA_2017_Detail_Code,713200,NAICS_2017_Code,713210, +BEA_2017_Detail_Code,713200,NAICS_2017_Code,713290, +BEA_2017_Detail_Code,713900,NAICS_2017_Code,713910, +BEA_2017_Detail_Code,713900,NAICS_2017_Code,713920, +BEA_2017_Detail_Code,713900,NAICS_2017_Code,713930, +BEA_2017_Detail_Code,713900,NAICS_2017_Code,713940, +BEA_2017_Detail_Code,713900,NAICS_2017_Code,713950, +BEA_2017_Detail_Code,713900,NAICS_2017_Code,713990, +BEA_2017_Detail_Code,721000,NAICS_2017_Code,721110, +BEA_2017_Detail_Code,721000,NAICS_2017_Code,721120, +BEA_2017_Detail_Code,721000,NAICS_2017_Code,721191, +BEA_2017_Detail_Code,721000,NAICS_2017_Code,721199, +BEA_2017_Detail_Code,721000,NAICS_2017_Code,721211, +BEA_2017_Detail_Code,721000,NAICS_2017_Code,721214, +BEA_2017_Detail_Code,721000,NAICS_2017_Code,721310, +BEA_2017_Detail_Code,722A00,NAICS_2017_Code,722310, +BEA_2017_Detail_Code,722A00,NAICS_2017_Code,722320, +BEA_2017_Detail_Code,722A00,NAICS_2017_Code,722330, +BEA_2017_Detail_Code,722A00,NAICS_2017_Code,722410, +BEA_2017_Detail_Code,722110,NAICS_2017_Code,722511, +BEA_2017_Detail_Code,722211,NAICS_2017_Code,722513, +BEA_2017_Detail_Code,722A00,NAICS_2017_Code,722514, +BEA_2017_Detail_Code,722A00,NAICS_2017_Code,722515, +BEA_2017_Detail_Code,811100,NAICS_2017_Code,811111, +BEA_2017_Detail_Code,811100,NAICS_2017_Code,811112, +BEA_2017_Detail_Code,811100,NAICS_2017_Code,811113, +BEA_2017_Detail_Code,811100,NAICS_2017_Code,811118, +BEA_2017_Detail_Code,811100,NAICS_2017_Code,811121, +BEA_2017_Detail_Code,811100,NAICS_2017_Code,811122, +BEA_2017_Detail_Code,811100,NAICS_2017_Code,811191, +BEA_2017_Detail_Code,811100,NAICS_2017_Code,811192, +BEA_2017_Detail_Code,811100,NAICS_2017_Code,811198, +BEA_2017_Detail_Code,811200,NAICS_2017_Code,811211, +BEA_2017_Detail_Code,811200,NAICS_2017_Code,811212, +BEA_2017_Detail_Code,811200,NAICS_2017_Code,811213, +BEA_2017_Detail_Code,811200,NAICS_2017_Code,811219, +BEA_2017_Detail_Code,811300,NAICS_2017_Code,811310, +BEA_2017_Detail_Code,811400,NAICS_2017_Code,811411, +BEA_2017_Detail_Code,811400,NAICS_2017_Code,811412, +BEA_2017_Detail_Code,811400,NAICS_2017_Code,811420, +BEA_2017_Detail_Code,811400,NAICS_2017_Code,811430, +BEA_2017_Detail_Code,811400,NAICS_2017_Code,811490, +BEA_2017_Detail_Code,812100,NAICS_2017_Code,812111, +BEA_2017_Detail_Code,812100,NAICS_2017_Code,812112, +BEA_2017_Detail_Code,812100,NAICS_2017_Code,812113, +BEA_2017_Detail_Code,812100,NAICS_2017_Code,812191, +BEA_2017_Detail_Code,812100,NAICS_2017_Code,812199, +BEA_2017_Detail_Code,812200,NAICS_2017_Code,812210, +BEA_2017_Detail_Code,812200,NAICS_2017_Code,812220, +BEA_2017_Detail_Code,812300,NAICS_2017_Code,812310, +BEA_2017_Detail_Code,812300,NAICS_2017_Code,812320, +BEA_2017_Detail_Code,812300,NAICS_2017_Code,812331, +BEA_2017_Detail_Code,812300,NAICS_2017_Code,812332, +BEA_2017_Detail_Code,812900,NAICS_2017_Code,812910, +BEA_2017_Detail_Code,812900,NAICS_2017_Code,812921, +BEA_2017_Detail_Code,812900,NAICS_2017_Code,812922, +BEA_2017_Detail_Code,812900,NAICS_2017_Code,812930, +BEA_2017_Detail_Code,812900,NAICS_2017_Code,812990, +BEA_2017_Detail_Code,813100,NAICS_2017_Code,813110, +BEA_2017_Detail_Code,813A00,NAICS_2017_Code,813211, +BEA_2017_Detail_Code,813A00,NAICS_2017_Code,813212, +BEA_2017_Detail_Code,813A00,NAICS_2017_Code,813219, +BEA_2017_Detail_Code,813A00,NAICS_2017_Code,813311, +BEA_2017_Detail_Code,813A00,NAICS_2017_Code,813312, +BEA_2017_Detail_Code,813A00,NAICS_2017_Code,813319, +BEA_2017_Detail_Code,813B00,NAICS_2017_Code,813410, +BEA_2017_Detail_Code,813B00,NAICS_2017_Code,813910, +BEA_2017_Detail_Code,813B00,NAICS_2017_Code,813920, +BEA_2017_Detail_Code,813B00,NAICS_2017_Code,813930, +BEA_2017_Detail_Code,813B00,NAICS_2017_Code,813940, +BEA_2017_Detail_Code,813B00,NAICS_2017_Code,813990, +BEA_2017_Detail_Code,814000,NAICS_2017_Code,814110, +BEA_2017_Detail_Code,GSLGO,NAICS_2017_Code,921110, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,921110, +BEA_2017_Detail_Code,GSLGO,NAICS_2017_Code,921120, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,921120, +BEA_2017_Detail_Code,GSLGO,NAICS_2017_Code,921130, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,921130, +BEA_2017_Detail_Code,GSLGO,NAICS_2017_Code,921140, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,921140, +BEA_2017_Detail_Code,GSLGO,NAICS_2017_Code,921150, +BEA_2017_Detail_Code,GSLGO,NAICS_2017_Code,921190, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,921190, +BEA_2017_Detail_Code,GSLGO,NAICS_2017_Code,922110, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,922110, +BEA_2017_Detail_Code,GSLGO,NAICS_2017_Code,922120, +BEA_2017_Detail_Code,S00102,NAICS_2017_Code,922120, +BEA_2017_Detail_Code,S00203,NAICS_2017_Code,922120, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,922120, +BEA_2017_Detail_Code,GSLGO,NAICS_2017_Code,922130, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,922130, +BEA_2017_Detail_Code,GSLGO,NAICS_2017_Code,922140, +BEA_2017_Detail_Code,S00102,NAICS_2017_Code,922140, +BEA_2017_Detail_Code,S00203,NAICS_2017_Code,922140, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,922140, +BEA_2017_Detail_Code,GSLGO,NAICS_2017_Code,922150, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,922150, +BEA_2017_Detail_Code,GSLGO,NAICS_2017_Code,922160, +BEA_2017_Detail_Code,S00203,NAICS_2017_Code,922160, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,922160, +BEA_2017_Detail_Code,GSLGO,NAICS_2017_Code,922190, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,922190, +BEA_2017_Detail_Code,GSLGE,NAICS_2017_Code,923110, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,923110, +BEA_2017_Detail_Code,GSLGH,NAICS_2017_Code,923120, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,923120, +BEA_2017_Detail_Code,GSLGO,NAICS_2017_Code,923130, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,923130, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,923140, +BEA_2017_Detail_Code,GSLGO,NAICS_2017_Code,924110, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,924110, +BEA_2017_Detail_Code,GSLGO,NAICS_2017_Code,924120, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,924120, +BEA_2017_Detail_Code,GSLGO,NAICS_2017_Code,925110, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,925110, +BEA_2017_Detail_Code,GSLGO,NAICS_2017_Code,925120, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,925120, +BEA_2017_Detail_Code,GSLGO,NAICS_2017_Code,926110, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,926110, +BEA_2017_Detail_Code,GSLGO,NAICS_2017_Code,926120, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,926120, +BEA_2017_Detail_Code,GSLGO,NAICS_2017_Code,926130, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,926130, +BEA_2017_Detail_Code,GSLGO,NAICS_2017_Code,926140, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,926140, +BEA_2017_Detail_Code,GSLGO,NAICS_2017_Code,926150, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,926150, +BEA_2017_Detail_Code,S00102,NAICS_2017_Code,927110, +BEA_2017_Detail_Code,S00500,NAICS_2017_Code,928110, +BEA_2017_Detail_Code,S00600,NAICS_2017_Code,928120, +BEA_2017_Detail_Code,F01000,NAICS_2017_Code,F01000, +BEA_2017_Detail_Code,S00101,NAICS_2017_Code,S00101, +BEA_2017_Detail_Code,S00201,NAICS_2017_Code,S00201, +BEA_2017_Detail_Code,S00202,NAICS_2017_Code,S00202, diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_BEA_2017_Summary.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_BEA_2017_Summary.csv new file mode 100644 index 000000000..a7c9ef8d3 --- /dev/null +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_BEA_2017_Summary.csv @@ -0,0 +1,1091 @@ +ActivitySourceName,Activity,SectorSourceName,Sector,SectorType +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111110, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111120, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111130, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111140, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111150, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111160, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111191, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111199, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111211, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111219, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111310, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111320, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111331, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111332, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111333, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111334, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111335, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111336, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111339, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111411, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111419, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111421, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111422, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111910, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111920, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111930, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111940, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111991, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111992, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,111998, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,112111, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,112112, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,112120, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,112130, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,112210, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,112310, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,112320, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,112330, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,112340, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,112390, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,112410, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,112420, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,112511, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,112512, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,112519, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,112910, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,112920, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,112930, +BEA_2017_Summary_Code,111CA,NAICS_2017_Code,112990, +BEA_2017_Summary_Code,113FF,NAICS_2017_Code,113110, +BEA_2017_Summary_Code,113FF,NAICS_2017_Code,113210, +BEA_2017_Summary_Code,113FF,NAICS_2017_Code,113310, +BEA_2017_Summary_Code,113FF,NAICS_2017_Code,114111, +BEA_2017_Summary_Code,113FF,NAICS_2017_Code,114112, +BEA_2017_Summary_Code,113FF,NAICS_2017_Code,114119, +BEA_2017_Summary_Code,113FF,NAICS_2017_Code,114210, +BEA_2017_Summary_Code,113FF,NAICS_2017_Code,115111, +BEA_2017_Summary_Code,113FF,NAICS_2017_Code,115112, +BEA_2017_Summary_Code,113FF,NAICS_2017_Code,115113, +BEA_2017_Summary_Code,113FF,NAICS_2017_Code,115114, +BEA_2017_Summary_Code,113FF,NAICS_2017_Code,115115, +BEA_2017_Summary_Code,113FF,NAICS_2017_Code,115116, +BEA_2017_Summary_Code,113FF,NAICS_2017_Code,115210, +BEA_2017_Summary_Code,113FF,NAICS_2017_Code,115310, +BEA_2017_Summary_Code,211,NAICS_2017_Code,211120, +BEA_2017_Summary_Code,211,NAICS_2017_Code,211130, +BEA_2017_Summary_Code,212,NAICS_2017_Code,212111, +BEA_2017_Summary_Code,212,NAICS_2017_Code,212112, +BEA_2017_Summary_Code,212,NAICS_2017_Code,212113, +BEA_2017_Summary_Code,212,NAICS_2017_Code,212210, +BEA_2017_Summary_Code,212,NAICS_2017_Code,212221, +BEA_2017_Summary_Code,212,NAICS_2017_Code,212222, +BEA_2017_Summary_Code,212,NAICS_2017_Code,212230, +BEA_2017_Summary_Code,212,NAICS_2017_Code,212291, +BEA_2017_Summary_Code,212,NAICS_2017_Code,212299, +BEA_2017_Summary_Code,212,NAICS_2017_Code,212311, +BEA_2017_Summary_Code,212,NAICS_2017_Code,212312, +BEA_2017_Summary_Code,212,NAICS_2017_Code,212313, +BEA_2017_Summary_Code,212,NAICS_2017_Code,212319, +BEA_2017_Summary_Code,212,NAICS_2017_Code,212321, +BEA_2017_Summary_Code,212,NAICS_2017_Code,212322, +BEA_2017_Summary_Code,212,NAICS_2017_Code,212324, +BEA_2017_Summary_Code,212,NAICS_2017_Code,212325, +BEA_2017_Summary_Code,212,NAICS_2017_Code,212391, +BEA_2017_Summary_Code,212,NAICS_2017_Code,212392, +BEA_2017_Summary_Code,212,NAICS_2017_Code,212393, +BEA_2017_Summary_Code,212,NAICS_2017_Code,212399, +BEA_2017_Summary_Code,213,NAICS_2017_Code,213111, +BEA_2017_Summary_Code,213,NAICS_2017_Code,213112, +BEA_2017_Summary_Code,213,NAICS_2017_Code,213113, +BEA_2017_Summary_Code,213,NAICS_2017_Code,213114, +BEA_2017_Summary_Code,213,NAICS_2017_Code,213115, +BEA_2017_Summary_Code,22,NAICS_2017_Code,221111, +BEA_2017_Summary_Code,22,NAICS_2017_Code,221112, +BEA_2017_Summary_Code,22,NAICS_2017_Code,221113, +BEA_2017_Summary_Code,22,NAICS_2017_Code,221114, +BEA_2017_Summary_Code,22,NAICS_2017_Code,221115, +BEA_2017_Summary_Code,22,NAICS_2017_Code,221116, +BEA_2017_Summary_Code,22,NAICS_2017_Code,221117, +BEA_2017_Summary_Code,22,NAICS_2017_Code,221118, +BEA_2017_Summary_Code,22,NAICS_2017_Code,221121, +BEA_2017_Summary_Code,22,NAICS_2017_Code,221122, +BEA_2017_Summary_Code,22,NAICS_2017_Code,221210, +BEA_2017_Summary_Code,22,NAICS_2017_Code,221310, +BEA_2017_Summary_Code,22,NAICS_2017_Code,221320, +BEA_2017_Summary_Code,22,NAICS_2017_Code,221330, +BEA_2017_Summary_Code,23,NAICS_2017_Code,236115, +BEA_2017_Summary_Code,23,NAICS_2017_Code,236116, +BEA_2017_Summary_Code,23,NAICS_2017_Code,236117, +BEA_2017_Summary_Code,23,NAICS_2017_Code,236118, +BEA_2017_Summary_Code,23,NAICS_2017_Code,236210, +BEA_2017_Summary_Code,23,NAICS_2017_Code,236220, +BEA_2017_Summary_Code,23,NAICS_2017_Code,237110, +BEA_2017_Summary_Code,23,NAICS_2017_Code,237120, +BEA_2017_Summary_Code,23,NAICS_2017_Code,237130, +BEA_2017_Summary_Code,23,NAICS_2017_Code,237210, +BEA_2017_Summary_Code,23,NAICS_2017_Code,237310, +BEA_2017_Summary_Code,23,NAICS_2017_Code,237990, +BEA_2017_Summary_Code,23,NAICS_2017_Code,238110, +BEA_2017_Summary_Code,23,NAICS_2017_Code,238120, +BEA_2017_Summary_Code,23,NAICS_2017_Code,238130, +BEA_2017_Summary_Code,23,NAICS_2017_Code,238140, +BEA_2017_Summary_Code,23,NAICS_2017_Code,238150, +BEA_2017_Summary_Code,23,NAICS_2017_Code,238160, +BEA_2017_Summary_Code,23,NAICS_2017_Code,238170, +BEA_2017_Summary_Code,23,NAICS_2017_Code,238190, +BEA_2017_Summary_Code,23,NAICS_2017_Code,238210, +BEA_2017_Summary_Code,23,NAICS_2017_Code,238220, +BEA_2017_Summary_Code,23,NAICS_2017_Code,238290, +BEA_2017_Summary_Code,23,NAICS_2017_Code,238310, +BEA_2017_Summary_Code,23,NAICS_2017_Code,238320, +BEA_2017_Summary_Code,23,NAICS_2017_Code,238330, +BEA_2017_Summary_Code,23,NAICS_2017_Code,238340, +BEA_2017_Summary_Code,23,NAICS_2017_Code,238350, +BEA_2017_Summary_Code,23,NAICS_2017_Code,238390, +BEA_2017_Summary_Code,23,NAICS_2017_Code,238910, +BEA_2017_Summary_Code,23,NAICS_2017_Code,238990, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311111, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311119, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311211, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311212, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311213, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311221, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311224, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311225, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311230, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311313, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311314, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311340, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311351, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311352, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311411, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311412, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311421, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311422, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311423, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311511, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311512, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311513, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311514, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311520, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311611, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311612, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311613, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311615, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311710, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311811, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311812, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311813, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311821, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311824, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311830, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311911, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311919, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311920, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311930, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311941, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311942, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311991, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,311999, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,312111, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,312112, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,312113, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,312120, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,312130, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,312140, +BEA_2017_Summary_Code,311FT,NAICS_2017_Code,312230, +BEA_2017_Summary_Code,313TT,NAICS_2017_Code,313110, +BEA_2017_Summary_Code,313TT,NAICS_2017_Code,313210, +BEA_2017_Summary_Code,313TT,NAICS_2017_Code,313220, +BEA_2017_Summary_Code,313TT,NAICS_2017_Code,313230, +BEA_2017_Summary_Code,313TT,NAICS_2017_Code,313240, +BEA_2017_Summary_Code,313TT,NAICS_2017_Code,313310, +BEA_2017_Summary_Code,313TT,NAICS_2017_Code,313320, +BEA_2017_Summary_Code,313TT,NAICS_2017_Code,314110, +BEA_2017_Summary_Code,313TT,NAICS_2017_Code,314120, +BEA_2017_Summary_Code,313TT,NAICS_2017_Code,314910, +BEA_2017_Summary_Code,313TT,NAICS_2017_Code,314994, +BEA_2017_Summary_Code,313TT,NAICS_2017_Code,314999, +BEA_2017_Summary_Code,315AL,NAICS_2017_Code,315110, +BEA_2017_Summary_Code,315AL,NAICS_2017_Code,315190, +BEA_2017_Summary_Code,315AL,NAICS_2017_Code,315210, +BEA_2017_Summary_Code,315AL,NAICS_2017_Code,315220, +BEA_2017_Summary_Code,315AL,NAICS_2017_Code,315240, +BEA_2017_Summary_Code,315AL,NAICS_2017_Code,315280, +BEA_2017_Summary_Code,315AL,NAICS_2017_Code,315990, +BEA_2017_Summary_Code,315AL,NAICS_2017_Code,316110, +BEA_2017_Summary_Code,315AL,NAICS_2017_Code,316210, +BEA_2017_Summary_Code,315AL,NAICS_2017_Code,316992, +BEA_2017_Summary_Code,315AL,NAICS_2017_Code,316998, +BEA_2017_Summary_Code,321,NAICS_2017_Code,321113, +BEA_2017_Summary_Code,321,NAICS_2017_Code,321114, +BEA_2017_Summary_Code,321,NAICS_2017_Code,321211, +BEA_2017_Summary_Code,321,NAICS_2017_Code,321212, +BEA_2017_Summary_Code,321,NAICS_2017_Code,321213, +BEA_2017_Summary_Code,321,NAICS_2017_Code,321214, +BEA_2017_Summary_Code,321,NAICS_2017_Code,321219, +BEA_2017_Summary_Code,321,NAICS_2017_Code,321911, +BEA_2017_Summary_Code,321,NAICS_2017_Code,321912, +BEA_2017_Summary_Code,321,NAICS_2017_Code,321918, +BEA_2017_Summary_Code,321,NAICS_2017_Code,321920, +BEA_2017_Summary_Code,321,NAICS_2017_Code,321991, +BEA_2017_Summary_Code,321,NAICS_2017_Code,321992, +BEA_2017_Summary_Code,321,NAICS_2017_Code,321999, +BEA_2017_Summary_Code,322,NAICS_2017_Code,322110, +BEA_2017_Summary_Code,322,NAICS_2017_Code,322121, +BEA_2017_Summary_Code,322,NAICS_2017_Code,322122, +BEA_2017_Summary_Code,322,NAICS_2017_Code,322130, +BEA_2017_Summary_Code,322,NAICS_2017_Code,322211, +BEA_2017_Summary_Code,322,NAICS_2017_Code,322212, +BEA_2017_Summary_Code,322,NAICS_2017_Code,322219, +BEA_2017_Summary_Code,322,NAICS_2017_Code,322220, +BEA_2017_Summary_Code,322,NAICS_2017_Code,322230, +BEA_2017_Summary_Code,322,NAICS_2017_Code,322291, +BEA_2017_Summary_Code,322,NAICS_2017_Code,322299, +BEA_2017_Summary_Code,323,NAICS_2017_Code,323111, +BEA_2017_Summary_Code,323,NAICS_2017_Code,323113, +BEA_2017_Summary_Code,323,NAICS_2017_Code,323117, +BEA_2017_Summary_Code,323,NAICS_2017_Code,323120, +BEA_2017_Summary_Code,324,NAICS_2017_Code,324110, +BEA_2017_Summary_Code,324,NAICS_2017_Code,324121, +BEA_2017_Summary_Code,324,NAICS_2017_Code,324122, +BEA_2017_Summary_Code,324,NAICS_2017_Code,324191, +BEA_2017_Summary_Code,324,NAICS_2017_Code,324199, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325110, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325120, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325130, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325180, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325193, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325194, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325199, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325211, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325212, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325220, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325311, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325312, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325314, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325320, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325411, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325412, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325413, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325414, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325510, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325520, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325611, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325612, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325613, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325620, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325910, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325920, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325991, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325992, +BEA_2017_Summary_Code,325,NAICS_2017_Code,325998, +BEA_2017_Summary_Code,326,NAICS_2017_Code,326111, +BEA_2017_Summary_Code,326,NAICS_2017_Code,326112, +BEA_2017_Summary_Code,326,NAICS_2017_Code,326113, +BEA_2017_Summary_Code,326,NAICS_2017_Code,326121, +BEA_2017_Summary_Code,326,NAICS_2017_Code,326122, +BEA_2017_Summary_Code,326,NAICS_2017_Code,326130, +BEA_2017_Summary_Code,326,NAICS_2017_Code,326140, +BEA_2017_Summary_Code,326,NAICS_2017_Code,326150, +BEA_2017_Summary_Code,326,NAICS_2017_Code,326160, +BEA_2017_Summary_Code,326,NAICS_2017_Code,326191, +BEA_2017_Summary_Code,326,NAICS_2017_Code,326199, +BEA_2017_Summary_Code,326,NAICS_2017_Code,326211, +BEA_2017_Summary_Code,326,NAICS_2017_Code,326212, +BEA_2017_Summary_Code,326,NAICS_2017_Code,326220, +BEA_2017_Summary_Code,326,NAICS_2017_Code,326291, +BEA_2017_Summary_Code,326,NAICS_2017_Code,326299, +BEA_2017_Summary_Code,327,NAICS_2017_Code,327110, +BEA_2017_Summary_Code,327,NAICS_2017_Code,327120, +BEA_2017_Summary_Code,327,NAICS_2017_Code,327211, +BEA_2017_Summary_Code,327,NAICS_2017_Code,327212, +BEA_2017_Summary_Code,327,NAICS_2017_Code,327213, +BEA_2017_Summary_Code,327,NAICS_2017_Code,327215, +BEA_2017_Summary_Code,327,NAICS_2017_Code,327310, +BEA_2017_Summary_Code,327,NAICS_2017_Code,327320, +BEA_2017_Summary_Code,327,NAICS_2017_Code,327331, +BEA_2017_Summary_Code,327,NAICS_2017_Code,327332, +BEA_2017_Summary_Code,327,NAICS_2017_Code,327390, +BEA_2017_Summary_Code,327,NAICS_2017_Code,327410, +BEA_2017_Summary_Code,327,NAICS_2017_Code,327420, +BEA_2017_Summary_Code,327,NAICS_2017_Code,327910, +BEA_2017_Summary_Code,327,NAICS_2017_Code,327991, +BEA_2017_Summary_Code,327,NAICS_2017_Code,327992, +BEA_2017_Summary_Code,327,NAICS_2017_Code,327993, +BEA_2017_Summary_Code,327,NAICS_2017_Code,327999, +BEA_2017_Summary_Code,331,NAICS_2017_Code,331110, +BEA_2017_Summary_Code,331,NAICS_2017_Code,331210, +BEA_2017_Summary_Code,331,NAICS_2017_Code,331221, +BEA_2017_Summary_Code,331,NAICS_2017_Code,331222, +BEA_2017_Summary_Code,331,NAICS_2017_Code,331313, +BEA_2017_Summary_Code,331,NAICS_2017_Code,331314, +BEA_2017_Summary_Code,331,NAICS_2017_Code,331315, +BEA_2017_Summary_Code,331,NAICS_2017_Code,331318, +BEA_2017_Summary_Code,331,NAICS_2017_Code,331410, +BEA_2017_Summary_Code,331,NAICS_2017_Code,331420, +BEA_2017_Summary_Code,331,NAICS_2017_Code,331491, +BEA_2017_Summary_Code,331,NAICS_2017_Code,331492, +BEA_2017_Summary_Code,331,NAICS_2017_Code,331511, +BEA_2017_Summary_Code,331,NAICS_2017_Code,331512, +BEA_2017_Summary_Code,331,NAICS_2017_Code,331513, +BEA_2017_Summary_Code,331,NAICS_2017_Code,331523, +BEA_2017_Summary_Code,331,NAICS_2017_Code,331524, +BEA_2017_Summary_Code,331,NAICS_2017_Code,331529, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332111, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332112, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332114, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332117, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332119, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332215, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332216, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332311, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332312, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332313, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332321, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332322, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332323, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332410, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332420, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332431, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332439, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332510, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332613, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332618, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332710, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332721, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332722, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332811, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332812, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332813, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332911, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332912, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332913, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332919, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332991, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332992, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332993, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332994, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332996, +BEA_2017_Summary_Code,332,NAICS_2017_Code,332999, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333111, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333112, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333120, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333131, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333132, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333241, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333242, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333243, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333244, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333249, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333314, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333316, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333318, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333413, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333414, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333415, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333511, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333514, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333515, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333517, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333519, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333611, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333612, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333613, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333618, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333912, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333914, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333921, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333922, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333923, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333924, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333991, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333992, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333993, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333994, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333995, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333996, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333997, +BEA_2017_Summary_Code,333,NAICS_2017_Code,333999, +BEA_2017_Summary_Code,334,NAICS_2017_Code,334111, +BEA_2017_Summary_Code,334,NAICS_2017_Code,334112, +BEA_2017_Summary_Code,334,NAICS_2017_Code,334118, +BEA_2017_Summary_Code,334,NAICS_2017_Code,334210, +BEA_2017_Summary_Code,334,NAICS_2017_Code,334220, +BEA_2017_Summary_Code,334,NAICS_2017_Code,334290, +BEA_2017_Summary_Code,334,NAICS_2017_Code,334310, +BEA_2017_Summary_Code,334,NAICS_2017_Code,334412, +BEA_2017_Summary_Code,334,NAICS_2017_Code,334413, +BEA_2017_Summary_Code,334,NAICS_2017_Code,334416, +BEA_2017_Summary_Code,334,NAICS_2017_Code,334417, +BEA_2017_Summary_Code,334,NAICS_2017_Code,334418, +BEA_2017_Summary_Code,334,NAICS_2017_Code,334419, +BEA_2017_Summary_Code,334,NAICS_2017_Code,334510, +BEA_2017_Summary_Code,334,NAICS_2017_Code,334511, +BEA_2017_Summary_Code,334,NAICS_2017_Code,334512, +BEA_2017_Summary_Code,334,NAICS_2017_Code,334513, +BEA_2017_Summary_Code,334,NAICS_2017_Code,334514, +BEA_2017_Summary_Code,334,NAICS_2017_Code,334515, +BEA_2017_Summary_Code,334,NAICS_2017_Code,334516, +BEA_2017_Summary_Code,334,NAICS_2017_Code,334517, +BEA_2017_Summary_Code,334,NAICS_2017_Code,334519, +BEA_2017_Summary_Code,334,NAICS_2017_Code,334613, +BEA_2017_Summary_Code,334,NAICS_2017_Code,334614, +BEA_2017_Summary_Code,335,NAICS_2017_Code,335110, +BEA_2017_Summary_Code,335,NAICS_2017_Code,335121, +BEA_2017_Summary_Code,335,NAICS_2017_Code,335122, +BEA_2017_Summary_Code,335,NAICS_2017_Code,335129, +BEA_2017_Summary_Code,335,NAICS_2017_Code,335210, +BEA_2017_Summary_Code,335,NAICS_2017_Code,335220, +BEA_2017_Summary_Code,335,NAICS_2017_Code,335311, +BEA_2017_Summary_Code,335,NAICS_2017_Code,335312, +BEA_2017_Summary_Code,335,NAICS_2017_Code,335313, +BEA_2017_Summary_Code,335,NAICS_2017_Code,335314, +BEA_2017_Summary_Code,335,NAICS_2017_Code,335911, +BEA_2017_Summary_Code,335,NAICS_2017_Code,335912, +BEA_2017_Summary_Code,335,NAICS_2017_Code,335921, +BEA_2017_Summary_Code,335,NAICS_2017_Code,335929, +BEA_2017_Summary_Code,335,NAICS_2017_Code,335931, +BEA_2017_Summary_Code,335,NAICS_2017_Code,335932, +BEA_2017_Summary_Code,335,NAICS_2017_Code,335991, +BEA_2017_Summary_Code,335,NAICS_2017_Code,335999, +BEA_2017_Summary_Code,3361MV,NAICS_2017_Code,336111, +BEA_2017_Summary_Code,3361MV,NAICS_2017_Code,336112, +BEA_2017_Summary_Code,3361MV,NAICS_2017_Code,336120, +BEA_2017_Summary_Code,3361MV,NAICS_2017_Code,336211, +BEA_2017_Summary_Code,3361MV,NAICS_2017_Code,336212, +BEA_2017_Summary_Code,3361MV,NAICS_2017_Code,336213, +BEA_2017_Summary_Code,3361MV,NAICS_2017_Code,336214, +BEA_2017_Summary_Code,3361MV,NAICS_2017_Code,336310, +BEA_2017_Summary_Code,3361MV,NAICS_2017_Code,336320, +BEA_2017_Summary_Code,3361MV,NAICS_2017_Code,336330, +BEA_2017_Summary_Code,3361MV,NAICS_2017_Code,336340, +BEA_2017_Summary_Code,3361MV,NAICS_2017_Code,336350, +BEA_2017_Summary_Code,3361MV,NAICS_2017_Code,336360, +BEA_2017_Summary_Code,3361MV,NAICS_2017_Code,336370, +BEA_2017_Summary_Code,3361MV,NAICS_2017_Code,336390, +BEA_2017_Summary_Code,3364OT,NAICS_2017_Code,336411, +BEA_2017_Summary_Code,3364OT,NAICS_2017_Code,336412, +BEA_2017_Summary_Code,3364OT,NAICS_2017_Code,336413, +BEA_2017_Summary_Code,3364OT,NAICS_2017_Code,336414, +BEA_2017_Summary_Code,3364OT,NAICS_2017_Code,336415, +BEA_2017_Summary_Code,3364OT,NAICS_2017_Code,336419, +BEA_2017_Summary_Code,3364OT,NAICS_2017_Code,336510, +BEA_2017_Summary_Code,3364OT,NAICS_2017_Code,336611, +BEA_2017_Summary_Code,3364OT,NAICS_2017_Code,336612, +BEA_2017_Summary_Code,3364OT,NAICS_2017_Code,336991, +BEA_2017_Summary_Code,3364OT,NAICS_2017_Code,336992, +BEA_2017_Summary_Code,3364OT,NAICS_2017_Code,336999, +BEA_2017_Summary_Code,337,NAICS_2017_Code,337110, +BEA_2017_Summary_Code,337,NAICS_2017_Code,337121, +BEA_2017_Summary_Code,337,NAICS_2017_Code,337122, +BEA_2017_Summary_Code,337,NAICS_2017_Code,337124, +BEA_2017_Summary_Code,337,NAICS_2017_Code,337125, +BEA_2017_Summary_Code,337,NAICS_2017_Code,337127, +BEA_2017_Summary_Code,337,NAICS_2017_Code,337211, +BEA_2017_Summary_Code,337,NAICS_2017_Code,337212, +BEA_2017_Summary_Code,337,NAICS_2017_Code,337214, +BEA_2017_Summary_Code,337,NAICS_2017_Code,337215, +BEA_2017_Summary_Code,337,NAICS_2017_Code,337910, +BEA_2017_Summary_Code,337,NAICS_2017_Code,337920, +BEA_2017_Summary_Code,339,NAICS_2017_Code,339112, +BEA_2017_Summary_Code,339,NAICS_2017_Code,339113, +BEA_2017_Summary_Code,339,NAICS_2017_Code,339114, +BEA_2017_Summary_Code,339,NAICS_2017_Code,339115, +BEA_2017_Summary_Code,339,NAICS_2017_Code,339116, +BEA_2017_Summary_Code,339,NAICS_2017_Code,339910, +BEA_2017_Summary_Code,339,NAICS_2017_Code,339920, +BEA_2017_Summary_Code,339,NAICS_2017_Code,339930, +BEA_2017_Summary_Code,339,NAICS_2017_Code,339940, +BEA_2017_Summary_Code,339,NAICS_2017_Code,339950, +BEA_2017_Summary_Code,339,NAICS_2017_Code,339991, +BEA_2017_Summary_Code,339,NAICS_2017_Code,339992, +BEA_2017_Summary_Code,339,NAICS_2017_Code,339993, +BEA_2017_Summary_Code,339,NAICS_2017_Code,339994, +BEA_2017_Summary_Code,339,NAICS_2017_Code,339995, +BEA_2017_Summary_Code,339,NAICS_2017_Code,339999, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423110, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423120, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423130, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423140, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423210, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423220, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423310, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423320, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423330, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423390, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423410, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423420, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423430, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423440, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423450, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423460, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423490, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423510, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423520, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423610, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423620, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423690, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423710, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423720, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423730, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423740, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423810, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423820, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423830, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423840, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423850, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423860, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423910, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423920, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423930, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423940, +BEA_2017_Summary_Code,42,NAICS_2017_Code,423990, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424110, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424120, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424130, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424210, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424310, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424320, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424330, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424340, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424410, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424420, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424430, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424440, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424450, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424460, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424470, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424480, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424490, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424510, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424520, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424590, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424610, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424690, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424710, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424720, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424810, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424820, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424910, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424920, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424930, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424940, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424950, +BEA_2017_Summary_Code,42,NAICS_2017_Code,424990, +BEA_2017_Summary_Code,42,NAICS_2017_Code,425110, +BEA_2017_Summary_Code,42,NAICS_2017_Code,425120, +BEA_2017_Summary_Code,441,NAICS_2017_Code,441110, +BEA_2017_Summary_Code,441,NAICS_2017_Code,441120, +BEA_2017_Summary_Code,441,NAICS_2017_Code,441210, +BEA_2017_Summary_Code,441,NAICS_2017_Code,441222, +BEA_2017_Summary_Code,441,NAICS_2017_Code,441228, +BEA_2017_Summary_Code,441,NAICS_2017_Code,441310, +BEA_2017_Summary_Code,441,NAICS_2017_Code,441320, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,442110, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,442210, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,442291, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,442299, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,443141, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,443142, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,444110, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,444120, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,444130, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,444190, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,444210, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,444220, +BEA_2017_Summary_Code,445,NAICS_2017_Code,445110, +BEA_2017_Summary_Code,445,NAICS_2017_Code,445120, +BEA_2017_Summary_Code,445,NAICS_2017_Code,445210, +BEA_2017_Summary_Code,445,NAICS_2017_Code,445220, +BEA_2017_Summary_Code,445,NAICS_2017_Code,445230, +BEA_2017_Summary_Code,445,NAICS_2017_Code,445291, +BEA_2017_Summary_Code,445,NAICS_2017_Code,445292, +BEA_2017_Summary_Code,445,NAICS_2017_Code,445299, +BEA_2017_Summary_Code,445,NAICS_2017_Code,445310, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,446110, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,446120, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,446130, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,446191, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,446199, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,447110, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,447190, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,448110, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,448120, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,448130, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,448140, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,448150, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,448190, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,448210, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,448310, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,448320, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,451110, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,451120, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,451130, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,451140, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,451211, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,451212, +BEA_2017_Summary_Code,452,NAICS_2017_Code,452210, +BEA_2017_Summary_Code,452,NAICS_2017_Code,452311, +BEA_2017_Summary_Code,452,NAICS_2017_Code,452319, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,453110, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,453210, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,453220, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,453310, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,453910, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,453920, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,453930, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,453991, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,453998, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,454110, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,454210, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,454310, +BEA_2017_Summary_Code,4A0,NAICS_2017_Code,454390, +BEA_2017_Summary_Code,481,NAICS_2017_Code,481111, +BEA_2017_Summary_Code,481,NAICS_2017_Code,481112, +BEA_2017_Summary_Code,481,NAICS_2017_Code,481211, +BEA_2017_Summary_Code,481,NAICS_2017_Code,481212, +BEA_2017_Summary_Code,481,NAICS_2017_Code,481219, +BEA_2017_Summary_Code,482,NAICS_2017_Code,482111, +BEA_2017_Summary_Code,482,NAICS_2017_Code,482112, +BEA_2017_Summary_Code,483,NAICS_2017_Code,483111, +BEA_2017_Summary_Code,483,NAICS_2017_Code,483112, +BEA_2017_Summary_Code,483,NAICS_2017_Code,483113, +BEA_2017_Summary_Code,483,NAICS_2017_Code,483114, +BEA_2017_Summary_Code,483,NAICS_2017_Code,483211, +BEA_2017_Summary_Code,483,NAICS_2017_Code,483212, +BEA_2017_Summary_Code,484,NAICS_2017_Code,484110, +BEA_2017_Summary_Code,484,NAICS_2017_Code,484121, +BEA_2017_Summary_Code,484,NAICS_2017_Code,484122, +BEA_2017_Summary_Code,484,NAICS_2017_Code,484210, +BEA_2017_Summary_Code,484,NAICS_2017_Code,484220, +BEA_2017_Summary_Code,484,NAICS_2017_Code,484230, +BEA_2017_Summary_Code,485,NAICS_2017_Code,485111, +BEA_2017_Summary_Code,485,NAICS_2017_Code,485112, +BEA_2017_Summary_Code,485,NAICS_2017_Code,485113, +BEA_2017_Summary_Code,485,NAICS_2017_Code,485119, +BEA_2017_Summary_Code,485,NAICS_2017_Code,485210, +BEA_2017_Summary_Code,485,NAICS_2017_Code,485310, +BEA_2017_Summary_Code,485,NAICS_2017_Code,485320, +BEA_2017_Summary_Code,485,NAICS_2017_Code,485410, +BEA_2017_Summary_Code,485,NAICS_2017_Code,485510, +BEA_2017_Summary_Code,485,NAICS_2017_Code,485991, +BEA_2017_Summary_Code,485,NAICS_2017_Code,485999, +BEA_2017_Summary_Code,486,NAICS_2017_Code,486110, +BEA_2017_Summary_Code,486,NAICS_2017_Code,486210, +BEA_2017_Summary_Code,486,NAICS_2017_Code,486910, +BEA_2017_Summary_Code,486,NAICS_2017_Code,486990, +BEA_2017_Summary_Code,487OS,NAICS_2017_Code,487110, +BEA_2017_Summary_Code,487OS,NAICS_2017_Code,487210, +BEA_2017_Summary_Code,487OS,NAICS_2017_Code,487990, +BEA_2017_Summary_Code,487OS,NAICS_2017_Code,488111, +BEA_2017_Summary_Code,487OS,NAICS_2017_Code,488119, +BEA_2017_Summary_Code,487OS,NAICS_2017_Code,488190, +BEA_2017_Summary_Code,487OS,NAICS_2017_Code,488210, +BEA_2017_Summary_Code,487OS,NAICS_2017_Code,488310, +BEA_2017_Summary_Code,487OS,NAICS_2017_Code,488320, +BEA_2017_Summary_Code,487OS,NAICS_2017_Code,488330, +BEA_2017_Summary_Code,487OS,NAICS_2017_Code,488390, +BEA_2017_Summary_Code,487OS,NAICS_2017_Code,488410, +BEA_2017_Summary_Code,487OS,NAICS_2017_Code,488490, +BEA_2017_Summary_Code,487OS,NAICS_2017_Code,488510, +BEA_2017_Summary_Code,487OS,NAICS_2017_Code,488991, +BEA_2017_Summary_Code,487OS,NAICS_2017_Code,488999, +BEA_2017_Summary_Code,GFE,NAICS_2017_Code,491110, +BEA_2017_Summary_Code,487OS,NAICS_2017_Code,492110, +BEA_2017_Summary_Code,487OS,NAICS_2017_Code,492210, +BEA_2017_Summary_Code,493,NAICS_2017_Code,493110, +BEA_2017_Summary_Code,493,NAICS_2017_Code,493120, +BEA_2017_Summary_Code,493,NAICS_2017_Code,493130, +BEA_2017_Summary_Code,493,NAICS_2017_Code,493190, +BEA_2017_Summary_Code,511,NAICS_2017_Code,511110, +BEA_2017_Summary_Code,511,NAICS_2017_Code,511120, +BEA_2017_Summary_Code,511,NAICS_2017_Code,511130, +BEA_2017_Summary_Code,511,NAICS_2017_Code,511140, +BEA_2017_Summary_Code,511,NAICS_2017_Code,511191, +BEA_2017_Summary_Code,511,NAICS_2017_Code,511199, +BEA_2017_Summary_Code,511,NAICS_2017_Code,511210, +BEA_2017_Summary_Code,512,NAICS_2017_Code,512110, +BEA_2017_Summary_Code,512,NAICS_2017_Code,512120, +BEA_2017_Summary_Code,512,NAICS_2017_Code,512131, +BEA_2017_Summary_Code,512,NAICS_2017_Code,512132, +BEA_2017_Summary_Code,512,NAICS_2017_Code,512191, +BEA_2017_Summary_Code,512,NAICS_2017_Code,512199, +BEA_2017_Summary_Code,512,NAICS_2017_Code,512230, +BEA_2017_Summary_Code,512,NAICS_2017_Code,512240, +BEA_2017_Summary_Code,512,NAICS_2017_Code,512250, +BEA_2017_Summary_Code,512,NAICS_2017_Code,512290, +BEA_2017_Summary_Code,513,NAICS_2017_Code,515111, +BEA_2017_Summary_Code,513,NAICS_2017_Code,515112, +BEA_2017_Summary_Code,513,NAICS_2017_Code,515120, +BEA_2017_Summary_Code,513,NAICS_2017_Code,515210, +BEA_2017_Summary_Code,513,NAICS_2017_Code,517311, +BEA_2017_Summary_Code,513,NAICS_2017_Code,517312, +BEA_2017_Summary_Code,513,NAICS_2017_Code,517410, +BEA_2017_Summary_Code,513,NAICS_2017_Code,517911, +BEA_2017_Summary_Code,513,NAICS_2017_Code,517919, +BEA_2017_Summary_Code,514,NAICS_2017_Code,518210, +BEA_2017_Summary_Code,514,NAICS_2017_Code,519110, +BEA_2017_Summary_Code,514,NAICS_2017_Code,519120, +BEA_2017_Summary_Code,514,NAICS_2017_Code,519130, +BEA_2017_Summary_Code,514,NAICS_2017_Code,519190, +BEA_2017_Summary_Code,521CI,NAICS_2017_Code,521110, +BEA_2017_Summary_Code,521CI,NAICS_2017_Code,522110, +BEA_2017_Summary_Code,521CI,NAICS_2017_Code,522120, +BEA_2017_Summary_Code,521CI,NAICS_2017_Code,522130, +BEA_2017_Summary_Code,521CI,NAICS_2017_Code,522190, +BEA_2017_Summary_Code,521CI,NAICS_2017_Code,522210, +BEA_2017_Summary_Code,521CI,NAICS_2017_Code,522220, +BEA_2017_Summary_Code,521CI,NAICS_2017_Code,522291, +BEA_2017_Summary_Code,521CI,NAICS_2017_Code,522292, +BEA_2017_Summary_Code,521CI,NAICS_2017_Code,522293, +BEA_2017_Summary_Code,521CI,NAICS_2017_Code,522294, +BEA_2017_Summary_Code,521CI,NAICS_2017_Code,522298, +BEA_2017_Summary_Code,521CI,NAICS_2017_Code,522310, +BEA_2017_Summary_Code,521CI,NAICS_2017_Code,522320, +BEA_2017_Summary_Code,521CI,NAICS_2017_Code,522390, +BEA_2017_Summary_Code,523,NAICS_2017_Code,523110, +BEA_2017_Summary_Code,523,NAICS_2017_Code,523120, +BEA_2017_Summary_Code,523,NAICS_2017_Code,523130, +BEA_2017_Summary_Code,523,NAICS_2017_Code,523140, +BEA_2017_Summary_Code,523,NAICS_2017_Code,523210, +BEA_2017_Summary_Code,523,NAICS_2017_Code,523910, +BEA_2017_Summary_Code,523,NAICS_2017_Code,523920, +BEA_2017_Summary_Code,523,NAICS_2017_Code,523930, +BEA_2017_Summary_Code,523,NAICS_2017_Code,523991, +BEA_2017_Summary_Code,523,NAICS_2017_Code,523999, +BEA_2017_Summary_Code,524,NAICS_2017_Code,524113, +BEA_2017_Summary_Code,524,NAICS_2017_Code,524114, +BEA_2017_Summary_Code,524,NAICS_2017_Code,524126, +BEA_2017_Summary_Code,524,NAICS_2017_Code,524127, +BEA_2017_Summary_Code,524,NAICS_2017_Code,524128, +BEA_2017_Summary_Code,524,NAICS_2017_Code,524130, +BEA_2017_Summary_Code,524,NAICS_2017_Code,524210, +BEA_2017_Summary_Code,524,NAICS_2017_Code,524291, +BEA_2017_Summary_Code,524,NAICS_2017_Code,524292, +BEA_2017_Summary_Code,524,NAICS_2017_Code,524298, +BEA_2017_Summary_Code,525,NAICS_2017_Code,525110, +BEA_2017_Summary_Code,525,NAICS_2017_Code,525120, +BEA_2017_Summary_Code,525,NAICS_2017_Code,525190, +BEA_2017_Summary_Code,525,NAICS_2017_Code,525910, +BEA_2017_Summary_Code,525,NAICS_2017_Code,525920, +BEA_2017_Summary_Code,525,NAICS_2017_Code,525990, +BEA_2017_Summary_Code,HS,NAICS_2017_Code,531110, +BEA_2017_Summary_Code,ORE,NAICS_2017_Code,531120, +BEA_2017_Summary_Code,ORE,NAICS_2017_Code,531130, +BEA_2017_Summary_Code,ORE,NAICS_2017_Code,531190, +BEA_2017_Summary_Code,ORE,NAICS_2017_Code,531210, +BEA_2017_Summary_Code,ORE,NAICS_2017_Code,531311, +BEA_2017_Summary_Code,ORE,NAICS_2017_Code,531312, +BEA_2017_Summary_Code,ORE,NAICS_2017_Code,531320, +BEA_2017_Summary_Code,ORE,NAICS_2017_Code,531390, +BEA_2017_Summary_Code,532RL,NAICS_2017_Code,532111, +BEA_2017_Summary_Code,532RL,NAICS_2017_Code,532112, +BEA_2017_Summary_Code,532RL,NAICS_2017_Code,532120, +BEA_2017_Summary_Code,532RL,NAICS_2017_Code,532210, +BEA_2017_Summary_Code,532RL,NAICS_2017_Code,532281, +BEA_2017_Summary_Code,532RL,NAICS_2017_Code,532282, +BEA_2017_Summary_Code,532RL,NAICS_2017_Code,532283, +BEA_2017_Summary_Code,532RL,NAICS_2017_Code,532284, +BEA_2017_Summary_Code,532RL,NAICS_2017_Code,532289, +BEA_2017_Summary_Code,532RL,NAICS_2017_Code,532310, +BEA_2017_Summary_Code,532RL,NAICS_2017_Code,532411, +BEA_2017_Summary_Code,532RL,NAICS_2017_Code,532412, +BEA_2017_Summary_Code,532RL,NAICS_2017_Code,532420, +BEA_2017_Summary_Code,532RL,NAICS_2017_Code,532490, +BEA_2017_Summary_Code,532RL,NAICS_2017_Code,533110, +BEA_2017_Summary_Code,5411,NAICS_2017_Code,541110, +BEA_2017_Summary_Code,5411,NAICS_2017_Code,541120, +BEA_2017_Summary_Code,5411,NAICS_2017_Code,541191, +BEA_2017_Summary_Code,5411,NAICS_2017_Code,541199, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541211, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541213, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541214, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541219, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541310, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541320, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541330, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541340, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541350, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541360, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541370, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541380, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541410, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541420, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541430, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541490, +BEA_2017_Summary_Code,5415,NAICS_2017_Code,541511, +BEA_2017_Summary_Code,5415,NAICS_2017_Code,541512, +BEA_2017_Summary_Code,5415,NAICS_2017_Code,541513, +BEA_2017_Summary_Code,5415,NAICS_2017_Code,541519, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541611, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541612, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541613, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541614, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541618, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541620, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541690, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541713, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541714, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541715, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541720, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541810, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541820, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541830, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541840, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541850, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541860, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541870, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541890, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541910, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541921, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541922, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541930, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541940, +BEA_2017_Summary_Code,5412OP,NAICS_2017_Code,541990, +BEA_2017_Summary_Code,55,NAICS_2017_Code,551111, +BEA_2017_Summary_Code,55,NAICS_2017_Code,551112, +BEA_2017_Summary_Code,55,NAICS_2017_Code,551114, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561110, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561210, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561311, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561312, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561320, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561330, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561410, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561421, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561422, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561431, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561439, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561440, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561450, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561491, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561492, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561499, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561510, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561520, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561591, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561599, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561611, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561612, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561613, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561621, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561622, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561710, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561720, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561730, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561740, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561790, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561910, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561920, +BEA_2017_Summary_Code,561,NAICS_2017_Code,561990, +BEA_2017_Summary_Code,562,NAICS_2017_Code,562111, +BEA_2017_Summary_Code,562,NAICS_2017_Code,562112, +BEA_2017_Summary_Code,562,NAICS_2017_Code,562119, +BEA_2017_Summary_Code,562,NAICS_2017_Code,562211, +BEA_2017_Summary_Code,562,NAICS_2017_Code,562212, +BEA_2017_Summary_Code,562,NAICS_2017_Code,562213, +BEA_2017_Summary_Code,562,NAICS_2017_Code,562219, +BEA_2017_Summary_Code,562,NAICS_2017_Code,562910, +BEA_2017_Summary_Code,562,NAICS_2017_Code,562920, +BEA_2017_Summary_Code,562,NAICS_2017_Code,562991, +BEA_2017_Summary_Code,562,NAICS_2017_Code,562998, +BEA_2017_Summary_Code,61,NAICS_2017_Code,611110, +BEA_2017_Summary_Code,61,NAICS_2017_Code,611210, +BEA_2017_Summary_Code,61,NAICS_2017_Code,611310, +BEA_2017_Summary_Code,61,NAICS_2017_Code,611410, +BEA_2017_Summary_Code,61,NAICS_2017_Code,611420, +BEA_2017_Summary_Code,61,NAICS_2017_Code,611430, +BEA_2017_Summary_Code,61,NAICS_2017_Code,611511, +BEA_2017_Summary_Code,61,NAICS_2017_Code,611512, +BEA_2017_Summary_Code,61,NAICS_2017_Code,611513, +BEA_2017_Summary_Code,61,NAICS_2017_Code,611519, +BEA_2017_Summary_Code,61,NAICS_2017_Code,611610, +BEA_2017_Summary_Code,61,NAICS_2017_Code,611620, +BEA_2017_Summary_Code,61,NAICS_2017_Code,611630, +BEA_2017_Summary_Code,61,NAICS_2017_Code,611691, +BEA_2017_Summary_Code,61,NAICS_2017_Code,611692, +BEA_2017_Summary_Code,61,NAICS_2017_Code,611699, +BEA_2017_Summary_Code,61,NAICS_2017_Code,611710, +BEA_2017_Summary_Code,621,NAICS_2017_Code,621111, +BEA_2017_Summary_Code,621,NAICS_2017_Code,621112, +BEA_2017_Summary_Code,621,NAICS_2017_Code,621210, +BEA_2017_Summary_Code,621,NAICS_2017_Code,621310, +BEA_2017_Summary_Code,621,NAICS_2017_Code,621320, +BEA_2017_Summary_Code,621,NAICS_2017_Code,621330, +BEA_2017_Summary_Code,621,NAICS_2017_Code,621340, +BEA_2017_Summary_Code,621,NAICS_2017_Code,621391, +BEA_2017_Summary_Code,621,NAICS_2017_Code,621399, +BEA_2017_Summary_Code,621,NAICS_2017_Code,621410, +BEA_2017_Summary_Code,621,NAICS_2017_Code,621420, +BEA_2017_Summary_Code,621,NAICS_2017_Code,621491, +BEA_2017_Summary_Code,621,NAICS_2017_Code,621492, +BEA_2017_Summary_Code,621,NAICS_2017_Code,621493, +BEA_2017_Summary_Code,621,NAICS_2017_Code,621498, +BEA_2017_Summary_Code,621,NAICS_2017_Code,621511, +BEA_2017_Summary_Code,621,NAICS_2017_Code,621512, +BEA_2017_Summary_Code,621,NAICS_2017_Code,621610, +BEA_2017_Summary_Code,621,NAICS_2017_Code,621910, +BEA_2017_Summary_Code,621,NAICS_2017_Code,621991, +BEA_2017_Summary_Code,621,NAICS_2017_Code,621999, +BEA_2017_Summary_Code,622,NAICS_2017_Code,622110, +BEA_2017_Summary_Code,622,NAICS_2017_Code,622210, +BEA_2017_Summary_Code,622,NAICS_2017_Code,622310, +BEA_2017_Summary_Code,623,NAICS_2017_Code,623110, +BEA_2017_Summary_Code,623,NAICS_2017_Code,623210, +BEA_2017_Summary_Code,623,NAICS_2017_Code,623220, +BEA_2017_Summary_Code,623,NAICS_2017_Code,623311, +BEA_2017_Summary_Code,623,NAICS_2017_Code,623312, +BEA_2017_Summary_Code,623,NAICS_2017_Code,623990, +BEA_2017_Summary_Code,624,NAICS_2017_Code,624110, +BEA_2017_Summary_Code,624,NAICS_2017_Code,624120, +BEA_2017_Summary_Code,624,NAICS_2017_Code,624190, +BEA_2017_Summary_Code,624,NAICS_2017_Code,624210, +BEA_2017_Summary_Code,624,NAICS_2017_Code,624221, +BEA_2017_Summary_Code,624,NAICS_2017_Code,624229, +BEA_2017_Summary_Code,624,NAICS_2017_Code,624230, +BEA_2017_Summary_Code,624,NAICS_2017_Code,624310, +BEA_2017_Summary_Code,624,NAICS_2017_Code,624410, +BEA_2017_Summary_Code,711AS,NAICS_2017_Code,711110, +BEA_2017_Summary_Code,711AS,NAICS_2017_Code,711120, +BEA_2017_Summary_Code,711AS,NAICS_2017_Code,711130, +BEA_2017_Summary_Code,711AS,NAICS_2017_Code,711190, +BEA_2017_Summary_Code,711AS,NAICS_2017_Code,711211, +BEA_2017_Summary_Code,711AS,NAICS_2017_Code,711212, +BEA_2017_Summary_Code,711AS,NAICS_2017_Code,711219, +BEA_2017_Summary_Code,711AS,NAICS_2017_Code,711310, +BEA_2017_Summary_Code,711AS,NAICS_2017_Code,711320, +BEA_2017_Summary_Code,711AS,NAICS_2017_Code,711410, +BEA_2017_Summary_Code,711AS,NAICS_2017_Code,711510, +BEA_2017_Summary_Code,711AS,NAICS_2017_Code,712110, +BEA_2017_Summary_Code,711AS,NAICS_2017_Code,712120, +BEA_2017_Summary_Code,711AS,NAICS_2017_Code,712130, +BEA_2017_Summary_Code,711AS,NAICS_2017_Code,712190, +BEA_2017_Summary_Code,713,NAICS_2017_Code,713110, +BEA_2017_Summary_Code,713,NAICS_2017_Code,713120, +BEA_2017_Summary_Code,713,NAICS_2017_Code,713210, +BEA_2017_Summary_Code,713,NAICS_2017_Code,713290, +BEA_2017_Summary_Code,713,NAICS_2017_Code,713910, +BEA_2017_Summary_Code,713,NAICS_2017_Code,713920, +BEA_2017_Summary_Code,713,NAICS_2017_Code,713930, +BEA_2017_Summary_Code,713,NAICS_2017_Code,713940, +BEA_2017_Summary_Code,713,NAICS_2017_Code,713950, +BEA_2017_Summary_Code,713,NAICS_2017_Code,713990, +BEA_2017_Summary_Code,721,NAICS_2017_Code,721110, +BEA_2017_Summary_Code,721,NAICS_2017_Code,721120, +BEA_2017_Summary_Code,721,NAICS_2017_Code,721191, +BEA_2017_Summary_Code,721,NAICS_2017_Code,721199, +BEA_2017_Summary_Code,721,NAICS_2017_Code,721211, +BEA_2017_Summary_Code,721,NAICS_2017_Code,721214, +BEA_2017_Summary_Code,721,NAICS_2017_Code,721310, +BEA_2017_Summary_Code,722,NAICS_2017_Code,722310, +BEA_2017_Summary_Code,722,NAICS_2017_Code,722320, +BEA_2017_Summary_Code,722,NAICS_2017_Code,722330, +BEA_2017_Summary_Code,722,NAICS_2017_Code,722410, +BEA_2017_Summary_Code,722,NAICS_2017_Code,722511, +BEA_2017_Summary_Code,722,NAICS_2017_Code,722513, +BEA_2017_Summary_Code,722,NAICS_2017_Code,722514, +BEA_2017_Summary_Code,722,NAICS_2017_Code,722515, +BEA_2017_Summary_Code,81,NAICS_2017_Code,811111, +BEA_2017_Summary_Code,81,NAICS_2017_Code,811112, +BEA_2017_Summary_Code,81,NAICS_2017_Code,811113, +BEA_2017_Summary_Code,81,NAICS_2017_Code,811118, +BEA_2017_Summary_Code,81,NAICS_2017_Code,811121, +BEA_2017_Summary_Code,81,NAICS_2017_Code,811122, +BEA_2017_Summary_Code,81,NAICS_2017_Code,811191, +BEA_2017_Summary_Code,81,NAICS_2017_Code,811192, +BEA_2017_Summary_Code,81,NAICS_2017_Code,811198, +BEA_2017_Summary_Code,81,NAICS_2017_Code,811211, +BEA_2017_Summary_Code,81,NAICS_2017_Code,811212, +BEA_2017_Summary_Code,81,NAICS_2017_Code,811213, +BEA_2017_Summary_Code,81,NAICS_2017_Code,811219, +BEA_2017_Summary_Code,81,NAICS_2017_Code,811310, +BEA_2017_Summary_Code,81,NAICS_2017_Code,811411, +BEA_2017_Summary_Code,81,NAICS_2017_Code,811412, +BEA_2017_Summary_Code,81,NAICS_2017_Code,811420, +BEA_2017_Summary_Code,81,NAICS_2017_Code,811430, +BEA_2017_Summary_Code,81,NAICS_2017_Code,811490, +BEA_2017_Summary_Code,81,NAICS_2017_Code,812111, +BEA_2017_Summary_Code,81,NAICS_2017_Code,812112, +BEA_2017_Summary_Code,81,NAICS_2017_Code,812113, +BEA_2017_Summary_Code,81,NAICS_2017_Code,812191, +BEA_2017_Summary_Code,81,NAICS_2017_Code,812199, +BEA_2017_Summary_Code,81,NAICS_2017_Code,812210, +BEA_2017_Summary_Code,81,NAICS_2017_Code,812220, +BEA_2017_Summary_Code,81,NAICS_2017_Code,812310, +BEA_2017_Summary_Code,81,NAICS_2017_Code,812320, +BEA_2017_Summary_Code,81,NAICS_2017_Code,812331, +BEA_2017_Summary_Code,81,NAICS_2017_Code,812332, +BEA_2017_Summary_Code,81,NAICS_2017_Code,812910, +BEA_2017_Summary_Code,81,NAICS_2017_Code,812921, +BEA_2017_Summary_Code,81,NAICS_2017_Code,812922, +BEA_2017_Summary_Code,81,NAICS_2017_Code,812930, +BEA_2017_Summary_Code,81,NAICS_2017_Code,812990, +BEA_2017_Summary_Code,81,NAICS_2017_Code,813110, +BEA_2017_Summary_Code,81,NAICS_2017_Code,813211, +BEA_2017_Summary_Code,81,NAICS_2017_Code,813212, +BEA_2017_Summary_Code,81,NAICS_2017_Code,813219, +BEA_2017_Summary_Code,81,NAICS_2017_Code,813311, +BEA_2017_Summary_Code,81,NAICS_2017_Code,813312, +BEA_2017_Summary_Code,81,NAICS_2017_Code,813319, +BEA_2017_Summary_Code,81,NAICS_2017_Code,813410, +BEA_2017_Summary_Code,81,NAICS_2017_Code,813910, +BEA_2017_Summary_Code,81,NAICS_2017_Code,813920, +BEA_2017_Summary_Code,81,NAICS_2017_Code,813930, +BEA_2017_Summary_Code,81,NAICS_2017_Code,813940, +BEA_2017_Summary_Code,81,NAICS_2017_Code,813990, +BEA_2017_Summary_Code,81,NAICS_2017_Code,814110, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,921110, +BEA_2017_Summary_Code,GSLG,NAICS_2017_Code,921110, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,921120, +BEA_2017_Summary_Code,GSLG,NAICS_2017_Code,921120, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,921130, +BEA_2017_Summary_Code,GSLG,NAICS_2017_Code,921130, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,921140, +BEA_2017_Summary_Code,GSLG,NAICS_2017_Code,921140, +BEA_2017_Summary_Code,GSLG,NAICS_2017_Code,921150, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,921190, +BEA_2017_Summary_Code,GSLG,NAICS_2017_Code,921190, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,922110, +BEA_2017_Summary_Code,GSLG,NAICS_2017_Code,922110, +BEA_2017_Summary_Code,GFE,NAICS_2017_Code,922120, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,922120, +BEA_2017_Summary_Code,GSLE,NAICS_2017_Code,922120, +BEA_2017_Summary_Code,GSLG,NAICS_2017_Code,922120, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,922130, +BEA_2017_Summary_Code,GSLG,NAICS_2017_Code,922130, +BEA_2017_Summary_Code,GFE,NAICS_2017_Code,922140, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,922140, +BEA_2017_Summary_Code,GSLE,NAICS_2017_Code,922140, +BEA_2017_Summary_Code,GSLG,NAICS_2017_Code,922140, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,922150, +BEA_2017_Summary_Code,GSLG,NAICS_2017_Code,922150, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,922160, +BEA_2017_Summary_Code,GSLE,NAICS_2017_Code,922160, +BEA_2017_Summary_Code,GSLG,NAICS_2017_Code,922160, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,922190, +BEA_2017_Summary_Code,GSLG,NAICS_2017_Code,922190, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,923110, +BEA_2017_Summary_Code,GSLG,NAICS_2017_Code,923110, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,923120, +BEA_2017_Summary_Code,GSLG,NAICS_2017_Code,923120, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,923130, +BEA_2017_Summary_Code,GSLG,NAICS_2017_Code,923130, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,923140, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,924110, +BEA_2017_Summary_Code,GSLG,NAICS_2017_Code,924110, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,924120, +BEA_2017_Summary_Code,GSLG,NAICS_2017_Code,924120, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,925110, +BEA_2017_Summary_Code,GSLG,NAICS_2017_Code,925110, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,925120, +BEA_2017_Summary_Code,GSLG,NAICS_2017_Code,925120, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,926110, +BEA_2017_Summary_Code,GSLG,NAICS_2017_Code,926110, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,926120, +BEA_2017_Summary_Code,GSLG,NAICS_2017_Code,926120, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,926130, +BEA_2017_Summary_Code,GSLG,NAICS_2017_Code,926130, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,926140, +BEA_2017_Summary_Code,GSLG,NAICS_2017_Code,926140, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,926150, +BEA_2017_Summary_Code,GSLG,NAICS_2017_Code,926150, +BEA_2017_Summary_Code,GFE,NAICS_2017_Code,927110, +BEA_2017_Summary_Code,GFGD,NAICS_2017_Code,928110, +BEA_2017_Summary_Code,GFGN,NAICS_2017_Code,928120, +BEA_2017_Summary_Code,F010,NAICS_2017_Code,F01000, +BEA_2017_Summary_Code,GFE,NAICS_2017_Code,S00101, +BEA_2017_Summary_Code,GSLE,NAICS_2017_Code,S00201, +BEA_2017_Summary_Code,GSLE,NAICS_2017_Code,S00202, diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA.py new file mode 100644 index 000000000..e661af1ee --- /dev/null +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA.py @@ -0,0 +1,39 @@ +# write_Crosswalk_BEA.py (scripts) +# !/usr/bin/env python3 +# coding=utf-8 + +""" +Create a crosswalk linking BEA to NAICS for any level + +""" +from flowsa.common import load_crosswalk +from flowsa.settings import datapath + + +def write_BEA_crosswalk(level='Detail', year=2012): + cw_load = load_crosswalk('BEA') if year == 2012 else load_crosswalk(f'BEA_{year}') + cw = cw_load[[f'BEA_{year}_{level}_Code', + f'NAICS_{year}_Code']].drop_duplicates().reset_index(drop=True) + # drop all rows with naics >6 + cw = cw[cw[f'NAICS_{year}_Code'].apply(lambda x: len(str(x)) == 6)].reset_index(drop=True) + + df = cw.rename(columns={f"NAICS_{year}_Code": "Sector", + f"BEA_{year}_{level}_Code":"Activity"}) + df['SectorSourceName'] = 'NAICS_{year}_Code' + df['ActivitySourceName'] = f'BEA_{year}_{level}_Code' + df.dropna(subset=["Sector"], inplace=True) + # assign sector type + df['SectorType'] = None + # sort df + df = df.sort_values(['Sector', 'Activity']) + # reset index + df.reset_index(drop=True, inplace=True) + # set order + df = df[['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector', 'SectorType']] + # save as csv + df.to_csv(datapath / "activitytosectormapping" / + f"NAICS_Crosswalk_BEA_{year}_{level}.csv", index=False) + +if __name__ == '__main__': + write_BEA_crosswalk('Detail', 2017) + write_BEA_crosswalk('Summary', 2017) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_2012.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_2012.py deleted file mode 100644 index f0a078c88..000000000 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_2012.py +++ /dev/null @@ -1,39 +0,0 @@ -# write_Crosswalk_BEA_2012.py (scripts) -# !/usr/bin/env python3 -# coding=utf-8 - -""" -Create a crosswalk linking BEA to NAICS for 2012 for any level - -""" -from flowsa.common import load_crosswalk -from flowsa.settings import datapath - - -def write_BEA_crosswalk(level='Detail'): - cw_load = load_crosswalk('BEA') - cw = cw_load[[f'BEA_2012_{level}_Code', - 'NAICS_2012_Code']].drop_duplicates().reset_index(drop=True) - # drop all rows with naics >6 - cw = cw[cw['NAICS_2012_Code'].apply(lambda x: len(str(x)) == 6)].reset_index(drop=True) - - df = cw.rename(columns={"NAICS_2012_Code": "Sector", - f"BEA_2012_{level}_Code":"Activity"}) - df['SectorSourceName'] = 'NAICS_2012_Code' - df['ActivitySourceName'] = f'BEA_2012_{level}_Code' - df.dropna(subset=["Sector"], inplace=True) - # assign sector type - df['SectorType'] = None - # sort df - df = df.sort_values(['Sector', 'Activity']) - # reset index - df.reset_index(drop=True, inplace=True) - # set order - df = df[['ActivitySourceName', 'Activity', 'SectorSourceName', 'Sector', 'SectorType']] - # save as csv - df.to_csv(datapath / "activitytosectormapping" / - f"NAICS_Crosswalk_BEA_2012_{level}.csv", index=False) - -if __name__ == '__main__': - write_BEA_crosswalk('Detail') - write_BEA_crosswalk('Summary') From c5a6cd674fcda38eedebbef70f0b19c26affecad Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 12 Oct 2023 16:31:31 -0400 Subject: [PATCH 1028/1127] fix typo --- scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA.py index e661af1ee..1ff0893a5 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA.py @@ -19,7 +19,7 @@ def write_BEA_crosswalk(level='Detail', year=2012): df = cw.rename(columns={f"NAICS_{year}_Code": "Sector", f"BEA_{year}_{level}_Code":"Activity"}) - df['SectorSourceName'] = 'NAICS_{year}_Code' + df['SectorSourceName'] = f'NAICS_{year}_Code' df['ActivitySourceName'] = f'BEA_{year}_{level}_Code' df.dropna(subset=["Sector"], inplace=True) # assign sector type From 932b414ce47ea3336eea15a33cd0a0e4007331d8 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 12 Oct 2023 16:36:59 -0400 Subject: [PATCH 1029/1127] add FBAs for Summary Supply and Use --- .../flowbyactivitymethods/BEA_Summary_Supply.yaml | 15 +++++++++++++++ .../BEA_Summary_Use_SUT.yaml | 15 +++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 flowsa/methods/flowbyactivitymethods/BEA_Summary_Supply.yaml create mode 100644 flowsa/methods/flowbyactivitymethods/BEA_Summary_Use_SUT.yaml diff --git a/flowsa/methods/flowbyactivitymethods/BEA_Summary_Supply.yaml b/flowsa/methods/flowbyactivitymethods/BEA_Summary_Supply.yaml new file mode 100644 index 000000000..74737a324 --- /dev/null +++ b/flowsa/methods/flowbyactivitymethods/BEA_Summary_Supply.yaml @@ -0,0 +1,15 @@ +author: U.S. Bureau of Economic Analysis +source_name: Summary Supply +source_url: 'https://www.bea.gov/industry/input-output-accounts-data#supplemental-estimate-tables' +original_data_download_date: '2023-10-12' +bib_id: BEA_Summary_Supply +format: csv +url: None +parse_response_fxn: !script_function:BEA bea_parse +years: + - 2017 + - 2018 + - 2019 + - 2020 + - 2021 + - 2022 diff --git a/flowsa/methods/flowbyactivitymethods/BEA_Summary_Use_SUT.yaml b/flowsa/methods/flowbyactivitymethods/BEA_Summary_Use_SUT.yaml new file mode 100644 index 000000000..8e5abf943 --- /dev/null +++ b/flowsa/methods/flowbyactivitymethods/BEA_Summary_Use_SUT.yaml @@ -0,0 +1,15 @@ +author: U.S. Bureau of Economic Analysis +source_name: Summary Use SUT +source_url: 'https://www.bea.gov/industry/input-output-accounts-data#supplemental-estimate-tables' +original_data_download_date: '2023-10-12' +bib_id: BEA_Summary_Use_SUT +format: csv +url: None +parse_response_fxn: !script_function:BEA bea_parse +years: + - 2017 + - 2018 + - 2019 + - 2020 + - 2021 + - 2022 From f6e8be0088bfe766082f6b8f5f1ca5bc8ba6d9d3 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 12 Oct 2023 16:44:52 -0400 Subject: [PATCH 1030/1127] add sources to source_catalog --- flowsa/data/source_catalog.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/flowsa/data/source_catalog.yaml b/flowsa/data/source_catalog.yaml index ef5207763..2371bee14 100644 --- a/flowsa/data/source_catalog.yaml +++ b/flowsa/data/source_catalog.yaml @@ -34,6 +34,30 @@ BEA_Summary_Use_PRO_BeforeRedef: - Money activity_schema: BEA_2012_Summary_Code sector_hierarchy: "flat" +BEA_Detail_Use_SUT: + data_format: FBA + class: + - Money + activity_schema: BEA_2017_Detail_Code + sector_hierarchy: "flat" +BEA_Detail_Supply: + data_format: FBA + class: + - Money + activity_schema: BEA_2017_Detail_Code + sector_hierarchy: "flat" +BEA_Summary_Use_SUT: + data_format: FBA + class: + - Money + activity_schema: BEA_2017_Summary_Code + sector_hierarchy: "flat" +BEA_Summary_Supply: + data_format: FBA + class: + - Money + activity_schema: BEA_2017_Summary_Code + sector_hierarchy: "flat" BEA_Marine_Bunker_Fuel: data_format: FBA class: From 5066722f08f09c5c8d0ab4c832d5b291da80a591 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 12 Oct 2023 16:45:09 -0400 Subject: [PATCH 1031/1127] add draft Detail Use FBS --- .../flowbysectormethods/Detail_Use_2018.yaml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/Detail_Use_2018.yaml diff --git a/flowsa/methods/flowbysectormethods/Detail_Use_2018.yaml b/flowsa/methods/flowbysectormethods/Detail_Use_2018.yaml new file mode 100644 index 000000000..e28dfd5a9 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/Detail_Use_2018.yaml @@ -0,0 +1,21 @@ +# This method disaggregates a Summary Use table for target use based on the +# best available Detail Use table + +industry_spec: + default: NAICS_6 ## <- Update to BEA Schema?? + # default: BEA_2012_Detail_Code +year: 2018 +target_naics_year: 2017 # <- this may not be working +geoscale: national + +source_names: + BEA_Summary_Use_SUT: + geoscale: national + year: 2018 + activity_to_sector_mapping: BEA_2017_Summary + attribution_method: proportional + attribution_source: + BEA_Detail_Use_SUT: + year: 2017 + activity_to_sector_mapping: BEA_2017_Detail + From b7bfe1066e48067003d018e324a365ffad8043aa Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 13 Oct 2023 15:27:43 -0400 Subject: [PATCH 1032/1127] add BEA detail spec --- .../BEA_detail_target.yaml | 33 +++++++++++++++++++ .../flowbysectormethods/Detail_Use_2018.yaml | 6 ++-- 2 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 flowsa/methods/flowbysectormethods/BEA_detail_target.yaml diff --git a/flowsa/methods/flowbysectormethods/BEA_detail_target.yaml b/flowsa/methods/flowbysectormethods/BEA_detail_target.yaml new file mode 100644 index 000000000..e58f2c2d9 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/BEA_detail_target.yaml @@ -0,0 +1,33 @@ +# This file can be used to set up target NAICS for a detail level model +# NAICS are targeted to enable 1:1 correspondence between NAICS and BEA +# Detail sectors + +# To use in a FBS method add +# !include:BEA_detail_target.yaml +# to the top of the method replacing the three parameters below + +industry_spec: + default: NAICS_3 + NAICS_4: ['111', '112', '212', '221', '311', '312', '313', '314', + '321', '327', '331', '332', '334', '336', '337', '423', + '424', '512', '515', '517', '518', '522', '523', '524', + '532', '541', '561', '611', '621', '623', '624', '711', + '713', '722', '811', '812', '813',] + NAICS_5: ['1111', '1121', '2122', '2123', '3112', '3114', '3115', + '3118', '3119', '3121', '3141', '3219', '3221', '3222', + '3231', '3241', '3251', '3253', '3255', '3256', '3259', + '3261', '3262', '3273', '3279', '3314', '3315', '3323', + '3324', '3327', '3331', '3339', '3342', '3346', '3351', + '3352', '3359', '3361', '3363', '3371', '3399', '5111', + '5112', '5191', '5416', '5419'] + NAICS_6: ['21311', '31111', '31122', '31151', '31161', '32229', + '32311', '32412', '32521', '32541', '32799', '33131', + '33141', '33211', '33291', '33299', '33311', '33324', + '33331', '33341', '33351', '33361', '33391', '33399', + '33411', '33441', '33451', '33522', '33531', '33591', + '33599', '33611', '33621', '33641', '33661', '33699', + '33712', '33721', '33911', '51731', '52411', '54151', + '72251', + '23', '92', 'F010'] + +target_sector_year: 2017 diff --git a/flowsa/methods/flowbysectormethods/Detail_Use_2018.yaml b/flowsa/methods/flowbysectormethods/Detail_Use_2018.yaml index e28dfd5a9..61e5d6b9d 100644 --- a/flowsa/methods/flowbysectormethods/Detail_Use_2018.yaml +++ b/flowsa/methods/flowbysectormethods/Detail_Use_2018.yaml @@ -1,9 +1,7 @@ # This method disaggregates a Summary Use table for target use based on the # best available Detail Use table -industry_spec: - default: NAICS_6 ## <- Update to BEA Schema?? - # default: BEA_2012_Detail_Code +!include:BEA_detail_target.yaml year: 2018 target_naics_year: 2017 # <- this may not be working geoscale: national @@ -18,4 +16,4 @@ source_names: BEA_Detail_Use_SUT: year: 2017 activity_to_sector_mapping: BEA_2017_Detail - + attribution_method: equal From c36623a9d1c1c37eb002c3827c5b9c74976324e0 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 13 Oct 2023 16:41:48 -0400 Subject: [PATCH 1033/1127] specify attribution on both SPB and SCB --- .../methods/flowbysectormethods/Detail_Use_2018.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/flowsa/methods/flowbysectormethods/Detail_Use_2018.yaml b/flowsa/methods/flowbysectormethods/Detail_Use_2018.yaml index 61e5d6b9d..a83b9d2d1 100644 --- a/flowsa/methods/flowbysectormethods/Detail_Use_2018.yaml +++ b/flowsa/methods/flowbysectormethods/Detail_Use_2018.yaml @@ -11,9 +11,20 @@ source_names: geoscale: national year: 2018 activity_to_sector_mapping: BEA_2017_Summary + # selection_fields: + # ActivityProducedBy: ['111CA', '113FF'] + # ActivityConsumedBy: ['111CA', '113FF'] attribution_method: proportional + attribute_on: ['SectorProducedBy', 'SectorConsumedBy'] attribution_source: BEA_Detail_Use_SUT: year: 2017 + # selection_fields: + # ActivityProducedBy: ['1111A0', '1111B0', '111200', '111300', '111400', + # '111900', '112120', '1121A0', '112300', '112A00', + # '113000', '114000', '115000'] + # ActivityConsumedBy: ['1111A0', '1111B0', '111200', '111300', '111400', + # '111900', '112120', '1121A0', '112300', '112A00', + # '113000', '114000', '115000'] activity_to_sector_mapping: BEA_2017_Detail attribution_method: equal From 746ed56986ec3a6202c8970cfb707bf6f1660144 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 13 Oct 2023 16:26:51 -0600 Subject: [PATCH 1034/1127] update the naics included in the 2017 crosssawlk and create a new 2017 sector-length crosswalk --- flowsa/data/NAICS_2017_Crosswalk.csv | 1160 ++++++++++++++++++++ flowsa/data/NAICS_Crosswalk_TimeSeries.csv | 238 ++-- scripts/writeNAICScrosswalk.py | 146 +-- 3 files changed, 1354 insertions(+), 190 deletions(-) create mode 100644 flowsa/data/NAICS_2017_Crosswalk.csv diff --git a/flowsa/data/NAICS_2017_Crosswalk.csv b/flowsa/data/NAICS_2017_Crosswalk.csv new file mode 100644 index 000000000..5b9c4cafe --- /dev/null +++ b/flowsa/data/NAICS_2017_Crosswalk.csv @@ -0,0 +1,1160 @@ +NAICS_2,NAICS_3,NAICS_4,NAICS_5,NAICS_6,NAICS_7 +11,111,1111,11111,111110, +11,111,1111,11112,111120,111120A +11,111,1111,11112,111120,111120B +11,111,1111,11112,111120,111120C +11,111,1111,11112,111120,111120D +11,111,1111,11112,111120,111120E +11,111,1111,11112,111120,111120F +11,111,1111,11112,111120,111120G +11,111,1111,11112,111120,111120H +11,111,1111,11113,111130,111130A +11,111,1111,11113,111130,111130B +11,111,1111,11113,111130,111130C +11,111,1111,11113,111130,111130D +11,111,1111,11113,111130,111130E +11,111,1111,11113,111130,111130G +11,111,1111,11113,111130,111130H +11,111,1111,11113,111130,111130I +11,111,1111,11113,111130,111130J +11,111,1111,11114,111140, +11,111,1111,11115,111150,111150A +11,111,1111,11115,111150,111150B +11,111,1111,11115,111150,111150C +11,111,1111,11116,111160, +11,111,1111,11119,111191, +11,111,1111,11119,111199,111199A +11,111,1111,11119,111199,111199B +11,111,1111,11119,111199,111199C +11,111,1111,11119,111199,111199D +11,111,1111,11119,111199,111199E +11,111,1111,11119,111199,111199F +11,111,1111,11119,111199,111199G +11,111,1111,11119,111199,111199H +11,111,1111,11119,111199,111199I +11,111,1111,11119,111199,111199J +11,111,1111,11119,111199,111199K +11,111,1112,11121,111211,111211A +11,111,1112,11121,111211,111211B +11,111,1112,11121,111219,111219A +11,111,1112,11121,111219,111219B +11,111,1112,11121,111219,111219C +11,111,1112,11121,111219,111219D +11,111,1112,11121,111219,111219E +11,111,1112,11121,111219,111219F +11,111,1112,11121,111219,111219G +11,111,1112,11121,111219,111219H +11,111,1112,11121,111219,111219I +11,111,1112,11121,111219,111219J +11,111,1112,11121,111219,111219K +11,111,1112,11121,111219,111219L +11,111,1112,11121,111219,111219M +11,111,1112,11121,111219,111219N +11,111,1112,11121,111219,111219P +11,111,1112,11121,111219,111219Q +11,111,1112,11121,111219,111219R +11,111,1112,11121,111219,111219T +11,111,1112,11121,111219,111219U +11,111,1112,11121,111219,111219V +11,111,1112,11121,111219,111219W +11,111,1112,11121,111219,111219X +11,111,1112,11121,111219,111219Y +11,111,1112,11121,111219,111219Z +11,111,1113,11131,111310, +11,111,1113,11132,111320, +11,111,1113,11133,111331, +11,111,1113,11133,111332, +11,111,1113,11133,111333, +11,111,1113,11133,111334, +11,111,1113,11133,111335, +11,111,1113,11133,111336, +11,111,1113,11133,111339, +11,111,1114,11141,111411, +11,111,1114,11141,111419, +11,111,1114,11142,111421,111421A +11,111,1114,11142,111421,111421B +11,111,1114,11142,111422, +11,111,1119,11191,111910, +11,111,1119,11192,111920, +11,111,1119,11193,111930,111930A +11,111,1119,11193,111930,111930B +11,111,1119,11194,111940,111940A +11,111,1119,11194,111940,111940B +11,111,1119,11199,111991,111991A +11,111,1119,11199,111991,111991B +11,111,1119,11199,111992, +11,111,1119,11199,111998,111998A +11,111,1119,11199,111998,111998B +11,111,1119,11199,111998,111998C +11,111,1119,11199,111998,111998D +11,111,1119,11199,111998,111998E +11,111,1119,11199,111998,111998F +11,111,1119,11199,111998,111998G +11,111,1119,11199,111998,111998H +11,111,1119,11199,111998,111998I +11,111,1119,11199,111998,111998J +11,111,1119,11199,111998,111998K +11,111,1119,11199,111998,111998L +11,111,1119,11199,111998,111998M +11,112,1121,11211,112111, +11,112,1121,11211,112112, +11,112,1121,11212,112120, +11,112,1121,11213,112130,112130A +11,112,1121,11213,112130,112130B +11,112,1122,11221,112210, +11,112,1123,11231,112310, +11,112,1123,11232,112320,112320A +11,112,1123,11232,112320,112320B +11,112,1123,11232,112320,112320C +11,112,1123,11233,112330, +11,112,1123,11234,112340, +11,112,1123,11239,112390,112390A +11,112,1123,11239,112390,112390B +11,112,1123,11239,112390,112390C +11,112,1123,11239,112390,112390D +11,112,1123,11239,112390,112390E +11,112,1123,11239,112390,112390F +11,112,1123,11239,112390,112390G +11,112,1123,11239,112390,112390H +11,112,1123,11239,112390,112390J +11,112,1123,11239,112390,112390K +11,112,1123,11239,112390,112390L +11,112,1123,11239,112390,112390M +11,112,1123,11239,112390,112390N +11,112,1124,11241,112410, +11,112,1124,11242,112420, +11,112,1125,11251,112511, +11,112,1125,11251,112512, +11,112,1125,11251,112519, +11,112,1129,11291,112910,112910A +11,112,1129,11291,112910,112910B +11,112,1129,11292,112920,112920A +11,112,1129,11292,112920,112920B +11,112,1129,11293,112930,112930A +11,112,1129,11293,112930,112930B +11,112,1129,11299,112990,112990A +11,112,1129,11299,112990,112990B +11,112,1129,11299,112990,112990C +11,112,1129,11299,112990,112990D +11,112,1129,11299,112990,112990E +11,112,1129,11299,112990,112990F +11,113,1131,11311,113110, +11,113,1132,11321,113210, +11,113,1133,11331,113310, +11,114,1141,11411,114111, +11,114,1141,11411,114112, +11,114,1141,11411,114119, +11,114,1142,11421,114210, +11,115,1151,11511,115111, +11,115,1151,11511,115112, +11,115,1151,11511,115113, +11,115,1151,11511,115114, +11,115,1151,11511,115115, +11,115,1151,11511,115116, +11,115,1152,11521,115210, +11,115,1153,11531,115310, +21,211,2111,21113,211130, +21,211,2111,21112,211120, +21,212,2121,21211,212111, +21,212,2121,21211,212112, +21,212,2121,21211,212113, +21,212,2122,21221,212210, +21,212,2122,21222,212221, +21,212,2122,21222,212222, +21,212,2122,21223,212230, +21,212,2122,21229,212291, +21,212,2122,21229,212299, +21,212,2123,21231,212311, +21,212,2123,21231,212312, +21,212,2123,21231,212313, +21,212,2123,21231,212319, +21,212,2123,21232,212321, +21,212,2123,21232,212322, +21,212,2123,21232,212324, +21,212,2123,21232,212325, +21,212,2123,21239,212391, +21,212,2123,21239,212392, +21,212,2123,21239,212393, +21,212,2123,21239,212399, +21,213,2131,21311,213111, +21,213,2131,21311,213112, +21,213,2131,21311,213113, +21,213,2131,21311,213114, +21,213,2131,21311,213115, +22,221,2211,22111,221111, +22,221,2211,22111,221112,221112A +22,221,2211,22111,221112,221112B +22,221,2211,22111,221112,221112C +22,221,2211,22111,221113, +22,221,2211,22111,221114, +22,221,2211,22111,221115, +22,221,2211,22111,221116, +22,221,2211,22111,221117, +22,221,2211,22111,221118, +22,221,2211,22112,221121, +22,221,2211,22112,221122, +22,221,2212,22121,221210, +22,221,2213,22131,221310, +22,221,2213,22132,221320, +22,221,2213,22133,221330, +23,236,2361,23611,236115, +23,236,2361,23611,236116, +23,236,2361,23611,236117, +23,236,2361,23611,236118, +23,236,2362,23621,236210, +23,236,2362,23622,236220, +23,237,2371,23711,237110, +23,237,2371,23712,237120, +23,237,2371,23713,237130, +23,237,2372,23721,237210, +23,237,2373,23731,237310, +23,237,2379,23799,237990, +23,238,2381,23811,238110, +23,238,2381,23812,238120, +23,238,2381,23813,238130, +23,238,2381,23814,238140, +23,238,2381,23815,238150, +23,238,2381,23816,238160, +23,238,2381,23817,238170, +23,238,2381,23819,238190, +23,238,2382,23821,238210, +23,238,2382,23822,238220, +23,238,2382,23829,238290, +23,238,2383,23831,238310, +23,238,2383,23832,238320, +23,238,2383,23833,238330, +23,238,2383,23834,238340, +23,238,2383,23835,238350, +23,238,2383,23839,238390, +23,238,2389,23891,238910, +23,238,2389,23899,238990, +31,311,3111,31111,311111, +31,311,3111,31111,311119, +31,311,3112,31121,311211, +31,311,3112,31121,311212, +31,311,3112,31121,311213, +31,311,3112,31122,311221, +31,311,3112,31122,311224, +31,311,3112,31122,311225, +31,311,3112,31123,311230, +31,311,3113,31131,311313, +31,311,3113,31131,311314, +31,311,3113,31134,311340, +31,311,3113,31135,311351, +31,311,3113,31135,311352, +31,311,3114,31141,311411, +31,311,3114,31141,311412, +31,311,3114,31142,311421, +31,311,3114,31142,311422, +31,311,3114,31142,311423, +31,311,3115,31151,311511, +31,311,3115,31151,311512, +31,311,3115,31151,311513, +31,311,3115,31151,311514, +31,311,3115,31152,311520, +31,311,3116,31161,311611, +31,311,3116,31161,311612, +31,311,3116,31161,311613, +31,311,3116,31161,311615, +31,311,3117,31171,311710, +31,311,3118,31181,311811, +31,311,3118,31181,311812, +31,311,3118,31181,311813, +31,311,3118,31182,311821, +31,311,3118,31182,311824, +31,311,3118,31183,311830, +31,311,3119,31191,311911, +31,311,3119,31191,311919, +31,311,3119,31192,311920, +31,311,3119,31193,311930, +31,311,3119,31194,311941, +31,311,3119,31194,311942, +31,311,3119,31199,311991, +31,311,3119,31199,311999, +31,312,3121,31211,312111, +31,312,3121,31211,312112, +31,312,3121,31211,312113, +31,312,3121,31212,312120, +31,312,3121,31213,312130, +31,312,3121,31214,312140, +31,312,3122,31223,312230, +31,313,3131,31311,313110, +31,313,3132,31321,313210, +31,313,3132,31322,313220, +31,313,3132,31323,313230, +31,313,3132,31324,313240, +31,313,3133,31331,313310, +31,313,3133,31332,313320, +31,314,3141,31411,314110, +31,314,3141,31412,314120, +31,314,3149,31491,314910, +31,314,3149,31499,314994, +31,314,3149,31499,314999, +31,315,3151,31511,315110, +31,315,3151,31519,315190, +31,315,3152,31521,315210, +31,315,3152,31522,315220, +31,315,3152,31524,315240, +31,315,3152,31528,315280, +31,315,3159,31599,315990, +31,316,3161,31611,316110, +31,316,3162,31621,316210, +31,316,3169,31699,316992, +31,316,3169,31699,316998, +32,321,3211,32111,321113, +32,321,3211,32111,321114, +32,321,3212,32121,321211, +32,321,3212,32121,321212, +32,321,3212,32121,321213, +32,321,3212,32121,321214, +32,321,3212,32121,321219, +32,321,3219,32191,321911, +32,321,3219,32191,321912, +32,321,3219,32191,321918, +32,321,3219,32192,321920, +32,321,3219,32199,321991, +32,321,3219,32199,321992, +32,321,3219,32199,321999, +32,322,3221,32211,322110, +32,322,3221,32212,322121, +32,322,3221,32212,322122, +32,322,3221,32213,322130, +32,322,3222,32221,322211, +32,322,3222,32221,322212, +32,322,3222,32221,322219, +32,322,3222,32222,322220, +32,322,3222,32223,322230, +32,322,3222,32229,322291, +32,322,3222,32229,322299, +32,323,3231,32311,323111, +32,323,3231,32311,323113, +32,323,3231,32311,323117, +32,323,3231,32312,323120, +32,324,3241,32411,324110, +32,324,3241,32412,324121, +32,324,3241,32412,324122, +32,324,3241,32419,324191, +32,324,3241,32419,324199, +32,325,3251,32511,325110, +32,325,3251,32512,325120, +32,325,3251,32513,325130, +32,325,3251,32518,325180, +32,325,3251,32519,325193, +32,325,3251,32519,325194, +32,325,3251,32519,325199, +32,325,3252,32521,325211, +32,325,3252,32521,325212, +32,325,3252,32522,325220, +32,325,3253,32531,325311, +32,325,3253,32531,325312, +32,325,3253,32531,325314, +32,325,3253,32532,325320, +32,325,3254,32541,325411, +32,325,3254,32541,325412, +32,325,3254,32541,325413, +32,325,3254,32541,325414, +32,325,3255,32551,325510, +32,325,3255,32552,325520, +32,325,3256,32561,325611, +32,325,3256,32561,325612, +32,325,3256,32561,325613, +32,325,3256,32562,325620, +32,325,3259,32591,325910, +32,325,3259,32592,325920, +32,325,3259,32599,325991, +32,325,3259,32599,325992, +32,325,3259,32599,325998, +32,326,3261,32611,326111, +32,326,3261,32611,326112, +32,326,3261,32611,326113, +32,326,3261,32612,326121, +32,326,3261,32612,326122, +32,326,3261,32613,326130, +32,326,3261,32614,326140, +32,326,3261,32615,326150, +32,326,3261,32616,326160, +32,326,3261,32619,326191, +32,326,3261,32619,326199, +32,326,3262,32621,326211, +32,326,3262,32621,326212, +32,326,3262,32622,326220, +32,326,3262,32629,326291, +32,326,3262,32629,326299, +32,327,3271,32711,327110, +32,327,3271,32712,327120, +32,327,3272,32721,327211, +32,327,3272,32721,327212, +32,327,3272,32721,327213, +32,327,3272,32721,327215, +32,327,3273,32731,327310, +32,327,3273,32732,327320, +32,327,3273,32733,327331, +32,327,3273,32733,327332, +32,327,3273,32739,327390, +32,327,3274,32741,327410, +32,327,3274,32742,327420, +32,327,3279,32791,327910, +32,327,3279,32799,327991, +32,327,3279,32799,327992, +32,327,3279,32799,327993, +32,327,3279,32799,327999, +33,331,3311,33111,331110, +33,331,3312,33121,331210, +33,331,3312,33122,331221, +33,331,3312,33122,331222, +33,331,3313,33131,331313, +33,331,3313,33131,331314, +33,331,3313,33131,331315, +33,331,3313,33131,331318, +33,331,3314,33141,331410, +33,331,3314,33142,331420, +33,331,3314,33149,331491, +33,331,3314,33149,331492, +33,331,3315,33151,331511, +33,331,3315,33151,331512, +33,331,3315,33151,331513, +33,331,3315,33152,331523, +33,331,3315,33152,331524, +33,331,3315,33152,331529, +33,332,3321,33211,332111, +33,332,3321,33211,332112, +33,332,3321,33211,332114, +33,332,3321,33211,332117, +33,332,3321,33211,332119, +33,332,3322,33221,332215, +33,332,3322,33221,332216, +33,332,3323,33231,332311, +33,332,3323,33231,332312, +33,332,3323,33231,332313, +33,332,3323,33232,332321, +33,332,3323,33232,332322, +33,332,3323,33232,332323, +33,332,3324,33241,332410, +33,332,3324,33242,332420, +33,332,3324,33243,332431, +33,332,3324,33243,332439, +33,332,3325,33251,332510, +33,332,3326,33261,332613, +33,332,3326,33261,332618, +33,332,3327,33271,332710, +33,332,3327,33272,332721, +33,332,3327,33272,332722, +33,332,3328,33281,332811, +33,332,3328,33281,332812, +33,332,3328,33281,332813, +33,332,3329,33291,332911, +33,332,3329,33291,332912, +33,332,3329,33291,332913, +33,332,3329,33291,332919, +33,332,3329,33299,332991, +33,332,3329,33299,332992, +33,332,3329,33299,332993, +33,332,3329,33299,332994, +33,332,3329,33299,332996, +33,332,3329,33299,332999, +33,333,3331,33311,333111, +33,333,3331,33311,333112, +33,333,3331,33312,333120, +33,333,3331,33313,333131, +33,333,3331,33313,333132, +33,333,3332,33324,333241, +33,333,3332,33324,333242, +33,333,3332,33324,333243, +33,333,3332,33324,333244, +33,333,3332,33324,333249, +33,333,3333,33331,333314, +33,333,3333,33331,333316, +33,333,3333,33331,333318, +33,333,3334,33341,333413, +33,333,3334,33341,333414, +33,333,3334,33341,333415, +33,333,3335,33351,333511, +33,333,3335,33351,333514, +33,333,3335,33351,333515, +33,333,3335,33351,333517, +33,333,3335,33351,333519, +33,333,3336,33361,333611, +33,333,3336,33361,333612, +33,333,3336,33361,333613, +33,333,3336,33361,333618, +33,333,3339,33391,333914, +33,333,3339,33391,333912, +33,333,3339,33392,333921, +33,333,3339,33392,333922, +33,333,3339,33392,333923, +33,333,3339,33392,333924, +33,333,3339,33399,333991, +33,333,3339,33399,333992, +33,333,3339,33399,333993, +33,333,3339,33399,333994, +33,333,3339,33399,333995, +33,333,3339,33399,333996, +33,333,3339,33399,333997, +33,333,3339,33399,333999, +33,334,3341,33411,334111, +33,334,3341,33411,334112, +33,334,3341,33411,334118, +33,334,3342,33421,334210, +33,334,3342,33422,334220, +33,334,3342,33429,334290, +33,334,3343,33431,334310, +33,334,3344,33441,334412, +33,334,3344,33441,334413, +33,334,3344,33441,334416, +33,334,3344,33441,334417, +33,334,3344,33441,334418, +33,334,3344,33441,334419, +33,334,3345,33451,334510, +33,334,3345,33451,334511, +33,334,3345,33451,334512, +33,334,3345,33451,334513, +33,334,3345,33451,334514, +33,334,3345,33451,334515, +33,334,3345,33451,334516, +33,334,3345,33451,334517, +33,334,3345,33451,334519, +33,334,3346,33461,334613, +33,334,3346,33461,334614, +33,335,3351,33511,335110, +33,335,3351,33512,335121, +33,335,3351,33512,335122, +33,335,3351,33512,335129, +33,335,3352,33521,335210, +33,335,3352,33522,335220, +33,335,3353,33531,335311, +33,335,3353,33531,335312, +33,335,3353,33531,335313, +33,335,3353,33531,335314, +33,335,3359,33591,335911, +33,335,3359,33591,335912, +33,335,3359,33592,335921, +33,335,3359,33592,335929, +33,335,3359,33593,335931, +33,335,3359,33593,335932, +33,335,3359,33599,335991, +33,335,3359,33599,335999, +33,336,3361,33611,336111, +33,336,3361,33611,336112, +33,336,3361,33612,336120, +33,336,3362,33621,336211, +33,336,3362,33621,336212, +33,336,3362,33621,336213, +33,336,3362,33621,336214, +33,336,3363,33631,336310, +33,336,3363,33632,336320, +33,336,3363,33633,336330, +33,336,3363,33634,336340, +33,336,3363,33635,336350, +33,336,3363,33636,336360, +33,336,3363,33637,336370, +33,336,3363,33639,336390, +33,336,3364,33641,336411, +33,336,3364,33641,336412, +33,336,3364,33641,336413, +33,336,3364,33641,336414, +33,336,3364,33641,336415, +33,336,3364,33641,336419, +33,336,3365,33651,336510, +33,336,3366,33661,336611, +33,336,3366,33661,336612, +33,336,3369,33699,336991, +33,336,3369,33699,336992, +33,336,3369,33699,336999, +33,337,3371,33711,337110, +33,337,3371,33712,337121, +33,337,3371,33712,337122, +33,337,3371,33712,337124, +33,337,3371,33712,337125, +33,337,3371,33712,337127, +33,337,3372,33721,337211, +33,337,3372,33721,337212, +33,337,3372,33721,337214, +33,337,3372,33721,337215, +33,337,3379,33791,337910, +33,337,3379,33792,337920, +33,339,3391,33911,339112, +33,339,3391,33911,339113, +33,339,3391,33911,339114, +33,339,3391,33911,339115, +33,339,3391,33911,339116, +33,339,3399,33991,339910, +33,339,3399,33992,339920, +33,339,3399,33993,339930, +33,339,3399,33994,339940, +33,339,3399,33995,339950, +33,339,3399,33999,339991, +33,339,3399,33999,339992, +33,339,3399,33999,339993, +33,339,3399,33999,339994, +33,339,3399,33999,339995, +33,339,3399,33999,339999, +42,423,4231,42311,423110, +42,423,4231,42312,423120, +42,423,4231,42313,423130, +42,423,4231,42314,423140, +42,423,4232,42321,423210, +42,423,4232,42322,423220, +42,423,4233,42331,423310, +42,423,4233,42332,423320, +42,423,4233,42333,423330, +42,423,4233,42339,423390, +42,423,4234,42341,423410, +42,423,4234,42342,423420, +42,423,4234,42343,423430, +42,423,4234,42344,423440, +42,423,4234,42345,423450, +42,423,4234,42346,423460, +42,423,4234,42349,423490, +42,423,4235,42351,423510, +42,423,4235,42352,423520, +42,423,4236,42361,423610, +42,423,4236,42362,423620, +42,423,4236,42369,423690, +42,423,4237,42371,423710, +42,423,4237,42372,423720, +42,423,4237,42373,423730, +42,423,4237,42374,423740, +42,423,4238,42381,423810, +42,423,4238,42382,423820, +42,423,4238,42383,423830, +42,423,4238,42384,423840, +42,423,4238,42385,423850, +42,423,4238,42386,423860, +42,423,4239,42391,423910, +42,423,4239,42392,423920, +42,423,4239,42393,423930, +42,423,4239,42394,423940, +42,423,4239,42399,423990, +42,424,4241,42411,424110, +42,424,4241,42412,424120, +42,424,4241,42413,424130, +42,424,4242,42421,424210, +42,424,4243,42431,424310, +42,424,4243,42432,424320, +42,424,4243,42433,424330, +42,424,4243,42434,424340, +42,424,4244,42441,424410, +42,424,4244,42442,424420, +42,424,4244,42443,424430, +42,424,4244,42444,424440, +42,424,4244,42445,424450, +42,424,4244,42446,424460, +42,424,4244,42447,424470, +42,424,4244,42448,424480, +42,424,4244,42449,424490, +42,424,4245,42451,424510, +42,424,4245,42452,424520, +42,424,4245,42459,424590, +42,424,4246,42461,424610, +42,424,4246,42469,424690, +42,424,4247,42471,424710, +42,424,4247,42472,424720, +42,424,4248,42481,424810, +42,424,4248,42482,424820, +42,424,4249,42491,424910, +42,424,4249,42492,424920, +42,424,4249,42493,424930, +42,424,4249,42494,424940, +42,424,4249,42495,424950, +42,424,4249,42499,424990, +42,425,4251,42511,425110, +42,425,4251,42512,425120, +44,441,4411,44111,441110, +44,441,4411,44112,441120, +44,441,4412,44121,441210, +44,441,4412,44122,441222, +44,441,4412,44122,441228, +44,441,4413,44131,441310, +44,441,4413,44132,441320, +44,442,4421,44211,442110, +44,442,4422,44221,442210, +44,442,4422,44229,442291, +44,442,4422,44229,442299, +44,443,4431,44314,443141, +44,443,4431,44314,443142, +44,444,4441,44411,444110, +44,444,4441,44412,444120, +44,444,4441,44413,444130, +44,444,4441,44419,444190, +44,444,4442,44421,444210, +44,444,4442,44422,444220, +44,445,4451,44511,445110, +44,445,4451,44512,445120, +44,445,4452,44521,445210, +44,445,4452,44522,445220, +44,445,4452,44523,445230, +44,445,4452,44529,445291, +44,445,4452,44529,445292, +44,445,4452,44529,445299, +44,445,4453,44531,445310, +44,446,4461,44611,446110, +44,446,4461,44612,446120, +44,446,4461,44613,446130, +44,446,4461,44619,446191, +44,446,4461,44619,446199, +44,447,4471,44711,447110, +44,447,4471,44719,447190, +44,448,4481,44811,448110, +44,448,4481,44812,448120, +44,448,4481,44813,448130, +44,448,4481,44814,448140, +44,448,4481,44815,448150, +44,448,4481,44819,448190, +44,448,4482,44821,448210, +44,448,4483,44831,448310, +44,448,4483,44832,448320, +45,451,4511,45111,451110, +45,451,4511,45112,451120, +45,451,4511,45113,451130, +45,451,4511,45114,451140, +45,451,4512,45121,451211, +45,451,4512,45121,451212, +45,452,4523,45231,452311, +45,452,4523,45231,452319, +45,452,4522,45221,452210, +45,453,4531,45311,453110, +45,453,4532,45321,453210, +45,453,4532,45322,453220, +45,453,4533,45331,453310, +45,453,4539,45391,453910, +45,453,4539,45392,453920, +45,453,4539,45393,453930, +45,453,4539,45399,453991, +45,453,4539,45399,453998, +45,454,4541,45411,454110, +45,454,4542,45421,454210, +45,454,4543,45431,454310, +45,454,4543,45439,454390, +48,481,4811,48111,481111, +48,481,4811,48111,481112, +48,481,4812,48121,481211, +48,481,4812,48121,481212, +48,481,4812,48121,481219, +48,482,4821,48211,482111, +48,482,4821,48211,482112, +48,483,4831,48311,483111, +48,483,4831,48311,483112, +48,483,4831,48311,483113, +48,483,4831,48311,483114, +48,483,4832,48321,483211, +48,483,4832,48321,483212, +48,484,4841,48411,484110, +48,484,4841,48412,484121, +48,484,4841,48412,484122, +48,484,4842,48421,484210, +48,484,4842,48422,484220, +48,484,4842,48423,484230, +48,485,4851,48511,485111, +48,485,4851,48511,485112, +48,485,4851,48511,485113, +48,485,4851,48511,485119, +48,485,4852,48521,485210, +48,485,4853,48531,485310, +48,485,4853,48532,485320, +48,485,4854,48541,485410, +48,485,4855,48551,485510, +48,485,4859,48599,485991, +48,485,4859,48599,485999, +48,486,4861,48611,486110, +48,486,4862,48621,486210, +48,486,4869,48691,486910, +48,486,4869,48699,486990, +48,487,4871,48711,487110, +48,487,4872,48721,487210, +48,487,4879,48799,487990, +48,488,4881,48811,488111, +48,488,4881,48811,488119, +48,488,4881,48819,488190, +48,488,4882,48821,488210, +48,488,4883,48831,488310, +48,488,4883,48832,488320, +48,488,4883,48833,488330, +48,488,4883,48839,488390, +48,488,4884,48841,488410, +48,488,4884,48849,488490, +48,488,4885,48851,488510, +48,488,4889,48899,488991, +48,488,4889,48899,488999, +49,491,4911,49111,491110, +49,492,4921,49211,492110, +49,492,4922,49221,492210, +49,493,4931,49311,493110, +49,493,4931,49312,493120, +49,493,4931,49313,493130, +49,493,4931,49319,493190, +51,511,5111,51111,511110, +51,511,5111,51112,511120, +51,511,5111,51113,511130, +51,511,5111,51114,511140, +51,511,5111,51119,511191, +51,511,5111,51119,511199, +51,511,5112,51121,511210, +51,512,5121,51211,512110, +51,512,5121,51212,512120, +51,512,5121,51213,512131, +51,512,5121,51213,512132, +51,512,5121,51219,512191, +51,512,5121,51219,512199, +51,512,5122,51225,512250, +51,512,5122,51223,512230, +51,512,5122,51224,512240, +51,512,5122,51229,512290, +51,515,5151,51511,515111, +51,515,5151,51511,515112, +51,515,5151,51512,515120, +51,515,5152,51521,515210, +51,517,5173,51731,517311, +51,517,5173,51731,517312, +51,517,5174,51741,517410, +51,517,5179,51791,517911, +51,517,5179,51791,517919, +51,518,5182,51821,518210, +51,519,5191,51911,519110, +51,519,5191,51912,519120, +51,519,5191,51913,519130, +51,519,5191,51919,519190, +52,521,5211,52111,521110, +52,522,5221,52211,522110, +52,522,5221,52212,522120, +52,522,5221,52213,522130, +52,522,5221,52219,522190, +52,522,5222,52221,522210, +52,522,5222,52222,522220, +52,522,5222,52229,522291, +52,522,5222,52229,522292, +52,522,5222,52229,522293, +52,522,5222,52229,522294, +52,522,5222,52229,522298, +52,522,5223,52231,522310, +52,522,5223,52232,522320, +52,522,5223,52239,522390, +52,523,5231,52311,523110, +52,523,5231,52312,523120, +52,523,5231,52313,523130, +52,523,5231,52314,523140, +52,523,5232,52321,523210, +52,523,5239,52391,523910, +52,523,5239,52392,523920, +52,523,5239,52393,523930, +52,523,5239,52399,523991, +52,523,5239,52399,523999, +52,524,5241,52411,524113, +52,524,5241,52411,524114, +52,524,5241,52412,524126, +52,524,5241,52412,524127, +52,524,5241,52412,524128, +52,524,5241,52413,524130, +52,524,5242,52421,524210, +52,524,5242,52429,524291, +52,524,5242,52429,524292, +52,524,5242,52429,524298, +52,525,5251,52511,525110, +52,525,5251,52512,525120, +52,525,5251,52519,525190, +52,525,5259,52591,525910, +52,525,5259,52592,525920, +52,525,5259,52599,525990, +53,531,5311,53111,531110, +53,531,5311,53112,531120, +53,531,5311,53113,531130, +53,531,5311,53119,531190, +53,531,5312,53121,531210, +53,531,5313,53131,531311, +53,531,5313,53131,531312, +53,531,5313,53132,531320, +53,531,5313,53139,531390, +53,532,5321,53211,532111, +53,532,5321,53211,532112, +53,532,5321,53212,532120, +53,532,5322,53221,532210, +53,532,5322,53228,532281, +53,532,5322,53228,532282, +53,532,5322,53228,532283, +53,532,5322,53228,532284, +53,532,5322,53228,532289, +53,532,5323,53231,532310, +53,532,5324,53241,532411, +53,532,5324,53241,532412, +53,532,5324,53242,532420, +53,532,5324,53249,532490, +53,533,5331,53311,533110, +54,541,5411,54111,541110, +54,541,5411,54112,541120, +54,541,5411,54119,541191, +54,541,5411,54119,541199, +54,541,5412,54121,541211, +54,541,5412,54121,541213, +54,541,5412,54121,541214, +54,541,5412,54121,541219, +54,541,5413,54131,541310, +54,541,5413,54132,541320, +54,541,5413,54133,541330, +54,541,5413,54134,541340, +54,541,5413,54135,541350, +54,541,5413,54136,541360, +54,541,5413,54137,541370, +54,541,5413,54138,541380, +54,541,5414,54141,541410, +54,541,5414,54142,541420, +54,541,5414,54143,541430, +54,541,5414,54149,541490, +54,541,5415,54151,541511, +54,541,5415,54151,541512, +54,541,5415,54151,541513, +54,541,5415,54151,541519, +54,541,5416,54161,541611, +54,541,5416,54161,541612, +54,541,5416,54161,541613, +54,541,5416,54161,541614, +54,541,5416,54161,541618, +54,541,5416,54162,541620, +54,541,5416,54169,541690, +54,541,5417,54171,541714, +54,541,5417,54171,541713, +54,541,5417,54171,541715, +54,541,5417,54172,541720, +54,541,5418,54181,541810, +54,541,5418,54182,541820, +54,541,5418,54183,541830, +54,541,5418,54184,541840, +54,541,5418,54185,541850, +54,541,5418,54186,541860, +54,541,5418,54187,541870, +54,541,5418,54189,541890, +54,541,5419,54191,541910, +54,541,5419,54192,541921, +54,541,5419,54192,541922, +54,541,5419,54193,541930, +54,541,5419,54194,541940, +54,541,5419,54199,541990, +55,551,5511,55111,551111, +55,551,5511,55111,551112, +55,551,5511,55111,551114, +56,561,5611,56111,561110, +56,561,5612,56121,561210, +56,561,5613,56131,561311, +56,561,5613,56131,561312, +56,561,5613,56132,561320, +56,561,5613,56133,561330, +56,561,5614,56141,561410, +56,561,5614,56142,561421, +56,561,5614,56142,561422, +56,561,5614,56143,561431, +56,561,5614,56143,561439, +56,561,5614,56144,561440, +56,561,5614,56145,561450, +56,561,5614,56149,561491, +56,561,5614,56149,561492, +56,561,5614,56149,561499, +56,561,5615,56151,561510, +56,561,5615,56152,561520, +56,561,5615,56159,561591, +56,561,5615,56159,561599, +56,561,5616,56161,561611, +56,561,5616,56161,561612, +56,561,5616,56161,561613, +56,561,5616,56162,561621, +56,561,5616,56162,561622, +56,561,5617,56171,561710, +56,561,5617,56172,561720, +56,561,5617,56173,561730, +56,561,5617,56174,561740, +56,561,5617,56179,561790, +56,561,5619,56191,561910, +56,561,5619,56192,561920, +56,561,5619,56199,561990, +56,562,5621,56211,562111, +56,562,5621,56211,562112, +56,562,5621,56211,562119, +56,562,5622,56221,562211, +56,562,5622,56221,562212,5622121 +56,562,5622,56221,562213, +56,562,5622,56221,562219,5622191 +56,562,5622,56221,562219,5622192 +56,562,5629,56291,562910, +56,562,5629,56292,562920,5629201 +56,562,5629,56292,562920,5629202 +56,562,5629,56292,562920,5629203 +56,562,5629,56299,562991, +56,562,5629,56299,562998, +61,611,6111,61111,611110, +61,611,6112,61121,611210, +61,611,6113,61131,611310, +61,611,6114,61141,611410, +61,611,6114,61142,611420, +61,611,6114,61143,611430, +61,611,6115,61151,611511, +61,611,6115,61151,611512, +61,611,6115,61151,611513, +61,611,6115,61151,611519, +61,611,6116,61161,611610, +61,611,6116,61162,611620, +61,611,6116,61163,611630, +61,611,6116,61169,611691, +61,611,6116,61169,611692, +61,611,6116,61169,611699, +61,611,6117,61171,611710, +62,621,6211,62111,621111, +62,621,6211,62111,621112, +62,621,6212,62121,621210, +62,621,6213,62131,621310, +62,621,6213,62132,621320, +62,621,6213,62133,621330, +62,621,6213,62134,621340, +62,621,6213,62139,621391, +62,621,6213,62139,621399, +62,621,6214,62141,621410, +62,621,6214,62142,621420, +62,621,6214,62149,621491, +62,621,6214,62149,621492, +62,621,6214,62149,621493, +62,621,6214,62149,621498, +62,621,6215,62151,621511, +62,621,6215,62151,621512, +62,621,6216,62161,621610, +62,621,6219,62191,621910, +62,621,6219,62199,621991, +62,621,6219,62199,621999, +62,622,6221,62211,622110, +62,622,6222,62221,622210, +62,622,6223,62231,622310, +62,623,6231,62311,623110, +62,623,6232,62321,623210, +62,623,6232,62322,623220, +62,623,6233,62331,623311, +62,623,6233,62331,623312, +62,623,6239,62399,623990, +62,624,6241,62411,624110, +62,624,6241,62412,624120, +62,624,6241,62419,624190, +62,624,6242,62421,624210, +62,624,6242,62422,624221, +62,624,6242,62422,624229, +62,624,6242,62423,624230, +62,624,6243,62431,624310, +62,624,6244,62441,624410, +71,711,7111,71111,711110, +71,711,7111,71112,711120, +71,711,7111,71113,711130, +71,711,7111,71119,711190, +71,711,7112,71121,711211, +71,711,7112,71121,711212, +71,711,7112,71121,711219, +71,711,7113,71131,711310, +71,711,7113,71132,711320, +71,711,7114,71141,711410, +71,711,7115,71151,711510, +71,712,7121,71211,712110, +71,712,7121,71212,712120, +71,712,7121,71213,712130, +71,712,7121,71219,712190, +71,713,7131,71311,713110, +71,713,7131,71312,713120, +71,713,7132,71321,713210, +71,713,7132,71329,713290, +71,713,7139,71391,713910, +71,713,7139,71392,713920, +71,713,7139,71393,713930, +71,713,7139,71394,713940, +71,713,7139,71395,713950, +71,713,7139,71399,713990, +72,721,7211,72111,721110, +72,721,7211,72112,721120, +72,721,7211,72119,721191, +72,721,7211,72119,721199, +72,721,7212,72121,721211, +72,721,7212,72121,721214, +72,721,7213,72131,721310, +72,722,7223,72231,722310, +72,722,7223,72232,722320, +72,722,7223,72233,722330, +72,722,7224,72241,722410, +72,722,7225,72251,722511, +72,722,7225,72251,722513, +72,722,7225,72251,722514, +72,722,7225,72251,722515, +81,811,8111,81111,811111, +81,811,8111,81111,811112, +81,811,8111,81111,811113, +81,811,8111,81111,811118, +81,811,8111,81112,811121, +81,811,8111,81112,811122, +81,811,8111,81119,811191, +81,811,8111,81119,811192, +81,811,8111,81119,811198, +81,811,8112,81121,811211, +81,811,8112,81121,811212, +81,811,8112,81121,811213, +81,811,8112,81121,811219, +81,811,8113,81131,811310, +81,811,8114,81141,811411, +81,811,8114,81141,811412, +81,811,8114,81142,811420, +81,811,8114,81143,811430, +81,811,8114,81149,811490, +81,812,8121,81211,812111, +81,812,8121,81211,812112, +81,812,8121,81211,812113, +81,812,8121,81219,812191, +81,812,8121,81219,812199, +81,812,8122,81221,812210, +81,812,8122,81222,812220, +81,812,8123,81231,812310, +81,812,8123,81232,812320, +81,812,8123,81233,812331, +81,812,8123,81233,812332, +81,812,8129,81291,812910, +81,812,8129,81292,812921, +81,812,8129,81292,812922, +81,812,8129,81293,812930, +81,812,8129,81299,812990, +81,813,8131,81311,813110, +81,813,8132,81321,813211, +81,813,8132,81321,813212, +81,813,8132,81321,813219, +81,813,8133,81331,813311, +81,813,8133,81331,813312, +81,813,8133,81331,813319, +81,813,8134,81341,813410, +81,813,8139,81391,813910, +81,813,8139,81392,813920, +81,813,8139,81393,813930, +81,813,8139,81394,813940, +81,813,8139,81399,813990, +81,814,8141,81411,814110, +92,921,9211,92111,921110, +92,921,9211,92112,921120, +92,921,9211,92113,921130, +92,921,9211,92114,921140, +92,921,9211,92115,921150, +92,921,9211,92119,921190, +92,922,9221,92211,922110, +92,922,9221,92212,922120, +92,922,9221,92213,922130, +92,922,9221,92214,922140, +92,922,9221,92215,922150, +92,922,9221,92216,922160, +92,922,9221,92219,922190, +92,923,9231,92311,923110, +92,923,9231,92312,923120, +92,923,9231,92313,923130, +92,923,9231,92314,923140, +92,924,9241,92411,924110, +92,924,9241,92412,924120, +92,925,9251,92511,925110, +92,925,9251,92512,925120, +92,926,9261,92611,926110, +92,926,9261,92612,926120, +92,926,9261,92613,926130, +92,926,9261,92614,926140, +92,926,9261,92615,926150, +92,927,9271,92711,927110, +92,928,9281,92811,928110, +92,928,9281,92812,928120, +F010,F010,F010,F01000,F01000, +F040,F040,F040,F04000,F04000, +F050,F050,F050,F05000,F05000, +S00101,S00101,S00101,S00101,S00101, +S00201,S00201,S00201,S00201,S00201, +S00202,S00202,S00202,S00202,S00202, +S00203,S00203,S00203,S00203,S00203, diff --git a/flowsa/data/NAICS_Crosswalk_TimeSeries.csv b/flowsa/data/NAICS_Crosswalk_TimeSeries.csv index cb303daf1..a10ab81f3 100644 --- a/flowsa/data/NAICS_Crosswalk_TimeSeries.csv +++ b/flowsa/data/NAICS_Crosswalk_TimeSeries.csv @@ -6,79 +6,79 @@ NAICS_2002_Code,NAICS_2007_Code,NAICS_2012_Code,NAICS_2017_Code 111110,111110,111110,111110 ,11112,11112,11112 111120,111120,111120,111120 -,,111120A, -,,111120B, -,,111120C, -,,111120D, -,,111120E, -,,111120F, -,,111120G, -,,111120H, +,,111120A,111120A +,,111120B,111120B +,,111120C,111120C +,,111120D,111120D +,,111120E,111120E +,,111120F,111120F +,,111120G,111120G +,,111120H,111120H ,11113,11113,11113 111130,111130,111130,111130 -,,111130A, -,,111130B, -,,111130C, -,,111130D, -,,111130E, -,,111130G, -,,111130H, -,,111130I, -,,111130J, +,,111130A,111130A +,,111130B,111130B +,,111130C,111130C +,,111130D,111130D +,,111130E,111130E +,,111130G,111130G +,,111130H,111130H +,,111130I,111130I +,,111130J,111130J ,11114,11114,11114 111140,111140,111140,111140 ,11115,11115,11115 111150,111150,111150,111150 -,,111150A, -,,111150B, -,,111150C, +,,111150A,111150A +,,111150B,111150B +,,111150C,111150C ,11116,11116,11116 111160,111160,111160,111160 ,11119,11119,11119 111191,111191,111191,111191 111199,111199,111199,111199 -,,111199A, -,,111199B, -,,111199C, -,,111199D, -,,111199E, -,,111199F, -,,111199G, -,,111199H, -,,111199I, -,,111199J, -,,111199K, +,,111199A,111199A +,,111199B,111199B +,,111199C,111199C +,,111199D,111199D +,,111199E,111199E +,,111199F,111199F +,,111199G,111199G +,,111199H,111199H +,,111199I,111199I +,,111199J,111199J +,,111199K,111199K ,1112,1112,1112 ,11121,11121,11121 111211,111211,111211,111211 111219,111211,111211,111211 -,,111211A, -,,111211B, +,,111211A,111211A +,,111211B,111211B 111219,111219,111219,111219 -,,111219A, -,,111219B, -,,111219C, -,,111219D, -,,111219E, -,,111219F, -,,111219G, -,,111219H, -,,111219I, -,,111219J, -,,111219K, -,,111219L, -,,111219M, -,,111219N, -,,111219P, -,,111219Q, -,,111219R, -,,111219T, -,,111219U, -,,111219V, -,,111219W, -,,111219X, -,,111219Y, -,,111219Z, +,,111219A,111219A +,,111219B,111219B +,,111219C,111219C +,,111219D,111219D +,,111219E,111219E +,,111219F,111219F +,,111219G,111219G +,,111219H,111219H +,,111219I,111219I +,,111219J,111219J +,,111219K,111219K +,,111219L,111219L +,,111219M,111219M +,,111219N,111219N +,,111219P,111219P +,,111219Q,111219Q +,,111219R,111219R +,,111219T,111219T +,,111219U,111219U +,,111219V,111219V +,,111219W,111219W +,,111219X,111219X +,,111219Y,111219Y +,,111219Z,111219Z ,1113,1113,1113 ,11131,11131,11131 111310,111310,111310,111310 @@ -98,8 +98,8 @@ NAICS_2002_Code,NAICS_2007_Code,NAICS_2012_Code,NAICS_2017_Code 111419,111419,111419,111419 ,11142,11142,11142 111421,111421,111421,111421 -,,111421A, -,,111421B, +,,111421A,111421A +,,111421B,111421B 111422,111422,111422,111422 ,1119,1119,1119 ,11191,11191,11191 @@ -108,31 +108,31 @@ NAICS_2002_Code,NAICS_2007_Code,NAICS_2012_Code,NAICS_2017_Code 111920,111920,111920,111920 ,11193,11193,11193 111930,111930,111930,111930 -,,111930A, -,,111930B, +,,111930A,111930A +,,111930B,111930B ,11194,11194,11194 111940,111940,111940,111940 -,,111940A, -,,111940B, +,,111940A,111940A +,,111940B,111940B ,11199,11199,11199 111991,111991,111991,111991 -,,111991A, -,,111991B, +,,111991A,111991A +,,111991B,111991B 111992,111992,111992,111992 111998,111998,111998,111998 -,,111998A, -,,111998B, -,,111998C, -,,111998D, -,,111998E, -,,111998F, -,,111998G, -,,111998H, -,,111998I, -,,111998J, -,,111998K, -,,111998L, -,,111998M, +,,111998A,111998A +,,111998B,111998B +,,111998C,111998C +,,111998D,111998D +,,111998E,111998E +,,111998F,111998F +,,111998G,111998G +,,111998H,111998H +,,111998I,111998I +,,111998J,111998J +,,111998K,111998K +,,111998L,111998L +,,111998M,111998M ,112,112,112 ,1121,1121,1121 ,11211,11211,11211 @@ -142,8 +142,8 @@ NAICS_2002_Code,NAICS_2007_Code,NAICS_2012_Code,NAICS_2017_Code 112120,112120,112120,112120 ,11213,11213,11213 112130,112130,112130,112130 -,,112130A, -,,112130B, +,,112130A,112130A +,,112130B,112130B ,1122,1122,1122 ,11221,11221,11221 112210,112210,112210,112210 @@ -152,28 +152,28 @@ NAICS_2002_Code,NAICS_2007_Code,NAICS_2012_Code,NAICS_2017_Code 112310,112310,112310,112310 ,11232,11232,11232 112320,112320,112320,112320 -,,112320A, -,,112320B, -,,112320C, +,,112320A,112320A +,,112320B,112320B +,,112320C,112320C ,11233,11233,11233 112330,112330,112330,112330 ,11234,11234,11234 112340,112340,112340,112340 ,11239,11239,11239 112390,112390,112390,112390 -,,112390A, -,,112390B, -,,112390C, -,,112390D, -,,112390E, -,,112390F, -,,112390G, -,,112390H, -,,112390J, -,,112390K, -,,112390L, -,,112390M, -,,112390N, +,,112390A,112390A +,,112390B,112390B +,,112390C,112390C +,,112390D,112390D +,,112390E,112390E +,,112390F,112390F +,,112390G,112390G +,,112390H,112390H +,,112390J,112390J +,,112390K,112390K +,,112390L,112390L +,,112390M,112390M +,,112390N,112390N ,1124,1124,1124 ,11241,11241,11241 112410,112410,112410,112410 @@ -188,24 +188,24 @@ NAICS_2002_Code,NAICS_2007_Code,NAICS_2012_Code,NAICS_2017_Code ,1129,1129,1129 ,11291,11291,11291 112910,112910,112910,112910 -,,112910A, -,,112910B, +,,112910A,112910A +,,112910B,112910B ,11292,11292,11292 112920,112920,112920,112920 -,,112920A, -,,112920B, +,,112920A,112920A +,,112920B,112920B ,11293,11293,11293 112930,112930,112930,112930 -,,112930A, -,,112930B, +,,112930A,112930A +,,112930B,112930B ,11299,11299,11299 112990,112990,112990,112990 -,,112990A, -,,112990B, -,,112990C, -,,112990D, -,,112990E, -,,112990F, +,,112990A,112990A +,,112990B,112990B +,,112990C,112990C +,,112990D,112990D +,,112990E,112990E +,,112990F,112990F ,113,113,113 ,1131,1131,1131 ,11311,11311,11311 @@ -296,9 +296,9 @@ NAICS_2002_Code,NAICS_2007_Code,NAICS_2012_Code,NAICS_2017_Code ,22111,22111,22111 221111,221111,221111,221111 221112,221112,221112,221112 -,,221112A, -,,221112B, -,,221112C, +,,221112A,221112A +,,221112B,221112B +,,221112C,221112C 221113,221113,221113,221113 221119,221119,221114,221114 221119,221119,221115,221115 @@ -2091,19 +2091,19 @@ NAICS_2002_Code,NAICS_2007_Code,NAICS_2012_Code,NAICS_2017_Code ,56221,56221,56221 562211,562211,562211,562211 562212,562212,562212,562212 -,,5622121, +,,5622121,5622121 562213,562213,562213,562213 562219,562219,562219,562219 -,,5622191, -,,5622192, +,,5622191,5622191 +,,5622192,5622192 ,5629,5629,5629 ,56291,56291,56291 562910,562910,562910,562910 ,56292,56292,56292 562920,562920,562920,562920 -,,5629201, -,,5629202, -,,5629203, +,,5629201,5629201 +,,5629202,5629202 +,,5629203,5629203 ,56299,56299,56299 562991,562991,562991,562991 562998,562998,562998,562998 @@ -2509,8 +2509,8 @@ NAICS_2002_Code,NAICS_2007_Code,NAICS_2012_Code,NAICS_2017_Code 928120,928120,928120,928120 ,F010,F010,F010 ,F01000,F01000,F01000 -,,F04000, -,,F05000, +,,F04000,F04000 +,,F05000,F05000 ,S00101,S00101,S00101 ,S00201,S00201,S00201 ,S00202,S00202,S00202 diff --git a/scripts/writeNAICScrosswalk.py b/scripts/writeNAICScrosswalk.py index 7148e64a4..ee7b504c2 100644 --- a/scripts/writeNAICScrosswalk.py +++ b/scripts/writeNAICScrosswalk.py @@ -57,7 +57,7 @@ def update_naics_crosswalk(): """ # read useeior master crosswalk, subset NAICS columns - naics_load = load_crosswalk('BEA') + naics_load = load_crosswalk('NAICS_to_BEA_Crosswalk') naics = naics_load[['NAICS_2007_Code', 'NAICS_2012_Code', 'NAICS_2017_Code' ]].drop_duplicates().reset_index(drop=True) # convert all rows to string @@ -116,6 +116,8 @@ def update_naics_crosswalk(): # sort df missing_naics_df = missing_naics_df.sort_values(['NAICS_2012_Code']) missing_naics_df = missing_naics_df.reset_index(drop=True) + # duplicate 2012 into 2017 schema + missing_naics_df['NAICS_2017_Code'] = missing_naics_df['NAICS_2012_Code'] # add missing naics to master naics crosswalk total_naics = pd.concat([naics, missing_naics_df], ignore_index=True) @@ -163,79 +165,81 @@ def merge_df_by_crosswalk_lengths(naics_cw, d, l): return naics_cw -def write_naics_2012_crosswalk(): +def write_annual_naics_crosswalk(): """ Create a NAICS 2 - 6 digit crosswalk :return: """ - # load the useeior mastercrosswalk subset to the naics timeseries - cw_load = load_crosswalk('sector_timeseries') - - # load BEA codes that will act as NAICS - house = load_crosswalk('household') - govt = load_crosswalk('government') - bea = pd.concat([house, govt], ignore_index=True).rename( - columns={'Code': 'NAICS_2012_Code', - 'NAICS_Level_to_Use_For': 'secLength'}) - bea = bea[['NAICS_2012_Code', 'secLength']] - - # extract naics 2012 code column and drop duplicates and empty cells - cw = cw_load[['NAICS_2012_Code']].drop_duplicates() - cw = cw[cw['NAICS_2012_Code'] != ''] - # also drop the existing household and government codes because not all - # inclusive and does not conform to NAICS length standards - cw = cw[~cw['NAICS_2012_Code'].str.startswith( - tuple(['F0', 'S0', '562B']))].reset_index(drop=True) - - # add column of sector length - cw['secLength'] = cw['NAICS_2012_Code'].apply( - lambda x: f"NAICS_{str(len(x))}") - # add bea codes subbing for NAICS - cw2 = pd.concat([cw, bea], ignore_index=True).drop_duplicates() - # return max string length - max_naics_length = cw['NAICS_2012_Code'].apply(lambda x: len(x)).max() - - # create dictionary of dataframes - d = dict(tuple(cw2.groupby('secLength'))) - - for k in d.keys(): - d[k].rename(columns=({'NAICS_2012_Code': k}), inplace=True) - - naics_cw = d['NAICS_2'] - for l in range(3, max_naics_length+1): - # first check that there are corresponding length - 1 sectors in the - # crosswalk, and if not, append the length-1 sectors to the previous - # run and rerun, drop government and household sectors - existing_sec_list = d[f'NAICS_{l-1}'][ - f'NAICS_{l-1}'].drop_duplicates().tolist() - df_sub = d[f'NAICS_{l}'].copy() - df_sub[f'NAICS_{l}'] = df_sub[f'NAICS_{l}'].str[:-1] - df_sub.rename(columns={f'NAICS_{l}': f'NAICS_{l - 1}'}, inplace=True) - df_sub['secLength'] = df_sub['secLength'].str.replace( - f"{l}", f"{l - 1}") - # drop household and gov codes - df_sub = df_sub[~df_sub[f'NAICS_{l - 1}'].str.startswith( - tuple(['F0', 'S0', '562B']))].drop_duplicates() - missing_sectors = df_sub[~df_sub[f'NAICS_{l - 1}'].isin( - existing_sec_list)] - - # if there are missing sectors at length l-1, append the missing - # sectors and rerun the previous crosswalk merge - if (len(missing_sectors) > 0) & (l > 3): - d[f'NAICS_{l - 1}'] = pd.concat( - [d[f'NAICS_{l - 1}'], missing_sectors], ignore_index=True) - # redo merge at length l-1 - naics_cw = merge_df_by_crosswalk_lengths(naics_cw, d, l - 1).drop( - columns=[f"NAICS_{l - 1}_y"]).drop_duplicates() - - naics_cw = merge_df_by_crosswalk_lengths(naics_cw, d, l) - - # drop seclength column - naics_cw = naics_cw.drop(columns='secLength') - # reorder - naics_cw = naics_cw.reindex(sorted(naics_cw.columns), axis=1) - # save as csv - naics_cw.to_csv(f"{datapath}/NAICS_2012_Crosswalk.csv", index=False) + for year in ['2012', '2017']: + # load the useeior mastercrosswalk subset to the naics timeseries + cw_load = load_crosswalk('NAICS_Crosswalk_TimeSeries') + + # load BEA codes that will act as NAICS + house = load_crosswalk('Household_SectorCodes') + govt = load_crosswalk('Government_SectorCodes') + bea = pd.concat([house, govt], ignore_index=True).rename( + columns={'Code': f'NAICS_{year}_Code', + 'NAICS_Level_to_Use_For': 'secLength'}) + bea = bea[[f'NAICS_{year}_Code', 'secLength']] + + # extract naics year code column and drop duplicates and empty cells + cw = cw_load[[f'NAICS_{year}_Code']].drop_duplicates() + cw = cw[cw[f'NAICS_{year}_Code'] != ''] + # also drop the existing household and government codes because not all + # inclusive and does not conform to NAICS length standards + cw = cw[~cw[f'NAICS_{year}_Code'].str.startswith( + tuple(['F0', 'S0', '562B']))].reset_index(drop=True) + + # add column of sector length + cw['secLength'] = cw[f'NAICS_{year}_Code'].apply( + lambda x: f"NAICS_{str(len(x))}") + # add bea codes subbing for NAICS + cw2 = pd.concat([cw, bea], ignore_index=True).drop_duplicates() + # return max string length + max_naics_length = cw[f'NAICS_{year}_Code'].apply(lambda x: len( + x)).max() + + # create dictionary of dataframes + d = dict(tuple(cw2.groupby('secLength'))) + + for k in d.keys(): + d[k].rename(columns=({f'NAICS_{year}_Code': k}), inplace=True) + + naics_cw = d['NAICS_2'] + for l in range(3, max_naics_length+1): + # first check that there are corresponding length - 1 sectors in the + # crosswalk, and if not, append the length-1 sectors to the previous + # run and rerun, drop government and household sectors + existing_sec_list = d[f'NAICS_{l-1}'][ + f'NAICS_{l-1}'].drop_duplicates().tolist() + df_sub = d[f'NAICS_{l}'].copy() + df_sub[f'NAICS_{l}'] = df_sub[f'NAICS_{l}'].str[:-1] + df_sub.rename(columns={f'NAICS_{l}': f'NAICS_{l - 1}'}, inplace=True) + df_sub['secLength'] = df_sub['secLength'].str.replace( + f"{l}", f"{l - 1}") + # drop household and gov codes + df_sub = df_sub[~df_sub[f'NAICS_{l - 1}'].str.startswith( + tuple(['F0', 'S0', '562B']))].drop_duplicates() + missing_sectors = df_sub[~df_sub[f'NAICS_{l - 1}'].isin( + existing_sec_list)] + + # if there are missing sectors at length l-1, append the missing + # sectors and rerun the previous crosswalk merge + if (len(missing_sectors) > 0) & (l > 3): + d[f'NAICS_{l - 1}'] = pd.concat( + [d[f'NAICS_{l - 1}'], missing_sectors], ignore_index=True) + # redo merge at length l-1 + naics_cw = merge_df_by_crosswalk_lengths(naics_cw, d, l - 1).drop( + columns=[f"NAICS_{l - 1}_y"]).drop_duplicates() + + naics_cw = merge_df_by_crosswalk_lengths(naics_cw, d, l) + + # drop seclength column + naics_cw = naics_cw.drop(columns='secLength') + # reorder + naics_cw = naics_cw.reindex(sorted(naics_cw.columns), axis=1) + # save as csv + naics_cw.to_csv(f"{datapath}/NAICS_{year}_Crosswalk.csv", index=False) def update_sector_name_df(): @@ -263,5 +267,5 @@ def update_sector_name_df(): if __name__ == '__main__': update_naics_crosswalk() - write_naics_2012_crosswalk() + write_annual_naics_crosswalk() update_sector_name_df() From d61c1b560c7aa19f48a1d8de75f7b0b920c90ce6 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 13 Oct 2023 16:34:11 -0600 Subject: [PATCH 1035/1127] require 'target_naics_year' for functions mapping activities to sectors, don't set default to 2012 --- flowsa/data_source_scripts/BLS_QCEW.py | 6 ++++-- flowsa/data_source_scripts/USDA_ERS_MLU.py | 6 ++++-- flowsa/flowby.py | 10 ++++++---- flowsa/flowbyactivity.py | 6 ++++-- flowsa/flowbyclean.py | 6 ++++-- flowsa/flowbysector.py | 7 +++++-- flowsa/naics.py | 6 +++--- 7 files changed, 30 insertions(+), 17 deletions(-) diff --git a/flowsa/data_source_scripts/BLS_QCEW.py b/flowsa/data_source_scripts/BLS_QCEW.py index 25f243b1c..78b6bde6f 100644 --- a/flowsa/data_source_scripts/BLS_QCEW.py +++ b/flowsa/data_source_scripts/BLS_QCEW.py @@ -167,8 +167,10 @@ def clean_qcew(fba: FlowByActivity, **kwargs): .reset_index(drop=True) ) - target_naics = set(industry_spec_key(fba.config['industry_spec']) - .target_naics) + target_naics = set( + industry_spec_key(fba.config['industry_spec'], + fba.config['target_naics_year']) + .target_naics) filtered = ( fixed .assign(ActivityProducedBy=fixed.ActivityProducedBy.mask( diff --git a/flowsa/data_source_scripts/USDA_ERS_MLU.py b/flowsa/data_source_scripts/USDA_ERS_MLU.py index c8af384ac..f41a94bae 100644 --- a/flowsa/data_source_scripts/USDA_ERS_MLU.py +++ b/flowsa/data_source_scripts/USDA_ERS_MLU.py @@ -127,7 +127,8 @@ def allocate_usda_ers_mlu_land_in_urban_areas( # set new group_id column df_fha = df_fha.assign(group_id=range(4, len(df_fha) + 4)) # map to target sectors - naics_key = industry_spec_key(fba.config['industry_spec']) + naics_key = industry_spec_key(fba.config['industry_spec'], + fba.config['target_naics_year']) df_fha = (df_fha .merge(naics_key, how='left', left_on='NAICS_2012_Code', right_on='source_naics') @@ -258,7 +259,8 @@ def allocate_usda_ers_mlu_land_in_rural_transportation_areas( # set new group_id column df_fha = df_fha.assign(group_id=range(2, len(df_fha) + 2)) # map to target sectors - naics_key = industry_spec_key(fba.config['industry_spec']) + naics_key = industry_spec_key(fba.config['industry_spec'], + fba.config['tareg_naics_year']) df_fha = (df_fha .merge(naics_key, how='left', left_on='NAICS_2012_Code', right_on='source_naics') diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 5aa9e2bf9..9e71a85d6 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -664,7 +664,9 @@ def attribute_flows_to_sectors( elif self.config['data_format'] in ['FBA', 'FBS_outside_flowsa']: fb: 'FlowByActivity' = ( grouped - .map_to_sectors(external_config_path=external_config_path) + .map_to_sectors( + target_year=self.config['target_naics_year'], + external_config_path=external_config_path) .function_socket('clean_fba_w_sec', attr=self.config, method=self.config) @@ -1288,7 +1290,7 @@ def division_attribution( ) def equally_attribute(self: 'FB') -> 'FB': - ''' + """ This function takes a FlowByActivity dataset with SectorProducedBy and SectorConsumedBy columns already added and attributes flows from any activity which is mapped to multiple industries/sectors equally across @@ -1313,9 +1315,9 @@ def equally_attribute(self: 'FB') -> 'FB': primary sector is the (only) non-null value out of SectorProducedBy or SectorConsumedBy). If necessary, flow amounts are further (equally) subdivided based on the secondary sector. - ''' + """ naics_key = naics.map_target_sectors_to_less_aggregated_sectors( - self.config['industry_spec']) + self.config['industry_spec'], self.config['target_naics_year']) fba = self.add_primary_secondary_columns('Sector') diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index 22793210b..e2d985d45 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -360,7 +360,7 @@ def convert_to_geoscale( def map_to_sectors( self: 'FlowByActivity', - target_year: Literal[2002, 2007, 2012, 2017] = 2012, + target_year: Literal[2002, 2007, 2012, 2017], external_config_path: str = None ) -> 'FlowByActivity': """ @@ -389,7 +389,9 @@ def map_to_sectors( define_parentincompletechild_descendants, \ drop_parentincompletechild_descendants - naics_key = naics.industry_spec_key(self.config['industry_spec']) + naics_key = naics.industry_spec_key(self.config['industry_spec'], + self.config['target_naics_year'] + ) activity_schema = self.config['activity_schema'] if isinstance( self.config['activity_schema'], str) else self.config.get( diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index ae8a6438f..b7de15b3c 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -200,7 +200,8 @@ def estimate_suppressed_sectors_equal_attribution( log.info('Estimating suppressed data by equally attributing parent to ' 'child sectors.') - naics_key = map_source_sectors_to_more_aggregated_sectors() + naics_key = map_source_sectors_to_more_aggregated_sectors( + year=fba.config['target_naics_year']) # forward fill naics_key = naics_key.T.ffill().T @@ -208,7 +209,8 @@ def estimate_suppressed_sectors_equal_attribution( # determine if there are any 1:1 parent:child sectors that are missing, # if so, add them (true for usda_coa_cropland_naics df) - cw_melt = map_source_sectors_to_less_aggregated_sectors() + cw_melt = map_source_sectors_to_less_aggregated_sectors( + fba.config['target_naics_year']) cw_melt = cw_melt.assign(count=(cw_melt .groupby(['source_naics', 'SectorLength']) ['source_naics'] diff --git a/flowsa/flowbysector.py b/flowsa/flowbysector.py index 70ee4feac..e42cf49ef 100644 --- a/flowsa/flowbysector.py +++ b/flowsa/flowbysector.py @@ -221,7 +221,8 @@ def sector_aggregation(self, industry_spec=None): """ if industry_spec is None: industry_spec = self.config['industry_spec'] - naics_key = naics.industry_spec_key(industry_spec) + naics_key = naics.industry_spec_key(industry_spec, self.config[ + 'target_naics_year']) fbs = self for direction in ['ProducedBy', 'ConsumedBy']: @@ -294,7 +295,9 @@ def convert_industry_spec( return fb_at_source_naics fb_at_target_naics = ( fb_at_source_naics - .merge(naics.industry_spec_key(industry_spec), + .merge(naics.industry_spec_key( + industry_spec, fb_at_source_naics.config[ + 'target_naics_year']), how='left', left_on='SectorProducedBy', right_on='source_naics') .assign( diff --git a/flowsa/naics.py b/flowsa/naics.py index 8d79b68d6..d8e18ec07 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -80,7 +80,7 @@ def industry_spec_key( def map_target_sectors_to_less_aggregated_sectors( industry_spec: dict, - year: Literal[2002, 2007, 2012, 2017] = 2012 + year: Literal[2002, 2007, 2012, 2017] ) -> pd.DataFrame: """ Map target NAICS to all possible other sector lengths @@ -125,7 +125,7 @@ def map_target_sectors_to_less_aggregated_sectors( def map_source_sectors_to_more_aggregated_sectors( - year: Literal[2002, 2007, 2012, 2017] = 2012 + year: Literal[2002, 2007, 2012, 2017] ) -> pd.DataFrame: """ Map source NAICS to all possible other sector lengths @@ -161,7 +161,7 @@ def map_source_sectors_to_more_aggregated_sectors( def map_source_sectors_to_less_aggregated_sectors( - year: Literal[2002, 2007, 2012, 2017] = 2012 + year: Literal[2002, 2007, 2012, 2017] ) -> pd.DataFrame: """ Map source NAICS to all possible other sector lengths From b839ddfb1ddd6d25794d5e4ccf37e1d61c69db33 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 13 Oct 2023 16:38:09 -0600 Subject: [PATCH 1036/1127] new fxn return_naics_crosswalk() to load naics sector length crosswalk based on year --- flowsa/naics.py | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/flowsa/naics.py b/flowsa/naics.py index d8e18ec07..f9d24a21d 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -5,14 +5,28 @@ from flowsa.flowsa_log import vlog, log from . import (common, settings) -naics_crosswalk = pd.read_csv( - settings.datapath / 'NAICS_2012_Crosswalk.csv', dtype='object' -) + +def return_naics_crosswalk( + year: Literal[2012, 2017] +) -> pd.DataFrame: + """ + Load a naics crosswalk for 2012 or 2017 codes + + :param industry_spec: + :param year: + :return: + """ + + crosswalk = f'NAICS_{year}_Crosswalk' + + naics_crosswalk = common.load_crosswalk(crosswalk) + + return naics_crosswalk def industry_spec_key( industry_spec: dict, - year: Literal[2002, 2007, 2012, 2017] = 2012 + year: Literal[2002, 2007, 2012, 2017] # Year of NAICS code ) -> pd.DataFrame: """ Provides a key for mapping any set of NAICS codes to a given industry @@ -48,8 +62,9 @@ def industry_spec_key( key (with the root dictionary being applied to all codes). """ - naics = naics_crosswalk.assign( - target_naics=naics_crosswalk[industry_spec['default']]) + naics = return_naics_crosswalk(year) + naics = naics.assign( + target_naics=naics[industry_spec['default']]) for level, industries in industry_spec.items(): if level not in ['default', 'non_naics']: naics['target_naics'] = naics['target_naics'].mask( @@ -86,9 +101,9 @@ def map_target_sectors_to_less_aggregated_sectors( Map target NAICS to all possible other sector lengths flat hierarchy """ - - naics = naics_crosswalk.assign( - target_naics=naics_crosswalk[industry_spec['default']]) + naics = return_naics_crosswalk(year) + naics = naics.assign( + target_naics=naics[industry_spec['default']]) for level, industries in industry_spec.items(): if level not in ['default', 'non_naics']: naics['target_naics'] = naics['target_naics'].mask( @@ -131,6 +146,8 @@ def map_source_sectors_to_more_aggregated_sectors( Map source NAICS to all possible other sector lengths parent-childhierarchy """ + naics_crosswalk = return_naics_crosswalk(year) + naics = [] for n in naics_crosswalk.columns.values.tolist(): naics_sub = naics_crosswalk.assign(source_naics=naics_crosswalk[n]) @@ -167,6 +184,8 @@ def map_source_sectors_to_less_aggregated_sectors( Map source NAICS to all possible other sector lengths parent-childhierarchy """ + naics_crosswalk = return_naics_crosswalk(year) + naics = [] for n in naics_crosswalk.columns.values.tolist(): naics_sub = naics_crosswalk.assign(source_naics=naics_crosswalk[n]) From 7752e663fb27b850fe2118777e8d1e1e58f57a9c Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 13 Oct 2023 16:38:50 -0600 Subject: [PATCH 1037/1127] use full crosswalk names instead of shorthand version --- flowsa/common.py | 25 ++++++++----------- flowsa/data_source_scripts/StatCan_IWS_MI.py | 2 +- flowsa/data_source_scripts/USDA_ERS_MLU.py | 2 +- flowsa/datavisualization.py | 2 +- flowsa/flowbyactivity.py | 2 +- flowsa/flowbyfunctions.py | 2 +- flowsa/naics.py | 6 ++--- flowsa/sectormapping.py | 4 +-- .../write_Crosswalk_BEA.py | 3 ++- .../write_Crosswalk_BEA_Make_Table.py | 2 +- .../write_Crosswalk_Blackhurst_IO.py | 2 +- .../write_Crosswalk_EPA_REI.py | 2 +- 12 files changed, 26 insertions(+), 28 deletions(-) diff --git a/flowsa/common.py b/flowsa/common.py index acc827b27..7be39fda3 100644 --- a/flowsa/common.py +++ b/flowsa/common.py @@ -68,27 +68,24 @@ def load_env_file_key(env_file, key): def load_crosswalk(crosswalk_name): """ - Load NAICS crosswalk between the years 2007, 2012, 2017 + Used to load the crosswalks: + + 'NAICS_Crosswalk_TimeSeries', 'NAICS_2012_Crosswalk', + 'Sector_2012_Names', 'Household_SectorCodes', 'Government_SectorCodes', + 'NAICS_to_BEA_Crosswalk', 'NAICS_to_BEA_Crosswalk_2017' + + as a dataframe + :return: df, NAICS crosswalk over the years """ - cw_dict = {'sector_timeseries': 'NAICS_Crosswalk_TimeSeries', - 'sector_length': 'NAICS_2012_Crosswalk', - 'sector_name': 'Sector_2012_Names', - 'household': 'Household_SectorCodes', - 'government': 'Government_SectorCodes', - 'BEA': 'NAICS_to_BEA_Crosswalk', - 'BEA_2017': 'NAICS_to_BEA_Crosswalk_2017', - } - - fn = cw_dict.get(crosswalk_name) + cw = pd.read_csv(datapath / f'{crosswalk_name}.csv', dtype="str") - cw = pd.read_csv(datapath / f'{fn}.csv', dtype="str") return cw def load_sector_length_cw_melt(): - cw_load = load_crosswalk('sector_length') + cw_load = load_crosswalk('NAICS_2012_Crosswalk') cw_melt = cw_load.melt(var_name="SectorLength", value_name='Sector' ).drop_duplicates().reset_index(drop=True) cw_melt = cw_melt.dropna().reset_index(drop=True) @@ -107,7 +104,7 @@ def return_bea_codes_used_as_naics(): :return: list of BEA codes used as NAICS """ cw_list = [] - for cw in ['household', 'government']: + for cw in ['Household_SectorCodes', 'Government_SectorCodes']: df = load_crosswalk(cw) cw_list.append(df) # concat data into single dataframe diff --git a/flowsa/data_source_scripts/StatCan_IWS_MI.py b/flowsa/data_source_scripts/StatCan_IWS_MI.py index 9a3c42d3f..4ee15ebe5 100644 --- a/flowsa/data_source_scripts/StatCan_IWS_MI.py +++ b/flowsa/data_source_scripts/StatCan_IWS_MI.py @@ -150,7 +150,7 @@ def convert_statcan_data_to_US_water_use(df, attr, download_FBA_if_missing): flowclass='Money', download_FBA_if_missing=download_FBA_if_missing) # load bea crosswalk - cw_load = load_crosswalk('BEA') + cw_load = load_crosswalk('NAICS_to_BEA_Crosswalk') cw = cw_load[['BEA_2012_Detail_Code', 'NAICS_2012_Code']].drop_duplicates() cw = cw[cw['NAICS_2012_Code'].apply( lambda x: len(str(x)) == 3)].drop_duplicates().reset_index(drop=True) diff --git a/flowsa/data_source_scripts/USDA_ERS_MLU.py b/flowsa/data_source_scripts/USDA_ERS_MLU.py index f41a94bae..f00441bc1 100644 --- a/flowsa/data_source_scripts/USDA_ERS_MLU.py +++ b/flowsa/data_source_scripts/USDA_ERS_MLU.py @@ -343,7 +343,7 @@ def allocate_usda_ers_mlu_other_land( rural_res = get_area_of_rural_land_occupied_by_houses_2013() # household codes - household = load_crosswalk('household') + household = load_crosswalk('Household_SectorCodes') household = household['Code'].drop_duplicates().tolist() # if it is state data, take weighted avg using land area diff --git a/flowsa/datavisualization.py b/flowsa/datavisualization.py index 07e793563..f04fa134b 100644 --- a/flowsa/datavisualization.py +++ b/flowsa/datavisualization.py @@ -50,7 +50,7 @@ def addSectorNames(df, BEA=False, mappingfile=None): cw = pd.read_csv(mappingfile) cw = cw.rename(columns={'Abrv_Name': 'SectorName'}) else: - cw = load_crosswalk('sector_name') + cw = load_crosswalk('Sector_2012_Names') cw['SectorName'] = cw['NAICS_2012_Code'].map(str) + ' (' + cw[ 'NAICS_2012_Name'] + ')' cw = cw.rename(columns={'NAICS_2012_Code': 'Sector'}) diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index e2d985d45..579674138 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -426,7 +426,7 @@ def map_to_sectors( 'activity columns directly to sector columns') # load master crosswalk - cw = common.load_crosswalk('sector_timeseries') + cw = common.load_crosswalk('NAICS_Crosswalk_TimeSeries') sectors = (cw[[f"NAICS_{self.config['target_naics_year']}_Code"]] .drop_duplicates() .dropna() diff --git a/flowsa/flowbyfunctions.py b/flowsa/flowbyfunctions.py index 36d759eb3..d79c02bd9 100644 --- a/flowsa/flowbyfunctions.py +++ b/flowsa/flowbyfunctions.py @@ -173,7 +173,7 @@ def remove_parent_sectors_from_crosswalk(cw_load, sector_list): # df = df.reset_index(drop=True) # # # load naics length crosswwalk -# cw_load = load_crosswalk('sector_length') +# cw_load = load_crosswalk('NAICS_2012_Crosswalk') # # remove any parent sectors of sectors identified as those that should # # not be aggregated # if sectors_to_exclude_from_agg is not None: diff --git a/flowsa/naics.py b/flowsa/naics.py index f9d24a21d..36cee140f 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -287,7 +287,7 @@ def melt_naics_crosswalk(): """ # load the mastercroswalk and subset by sectorsourcename, # save values to list - cw_load = common.load_crosswalk('sector_timeseries') + cw_load = common.load_crosswalk('NAICS_Crosswalk_TimeSeries') # create melt table of possible 2007 and 2017 naics that can # be mapped to 2012 @@ -330,10 +330,10 @@ def convert_naics_year(df_load, targetsectorsourcename, sectorsourcename): # load the mastercrosswalk and subset by sectorsourcename, # save values to list if targetsectorsourcename == sectorsourcename: - cw_load = common.load_crosswalk('sector_timeseries')[[ + cw_load = common.load_crosswalk('NAICS_Crosswalk_TimeSeries')[[ targetsectorsourcename]] else: - cw_load = common.load_crosswalk('sector_timeseries')[[ + cw_load = common.load_crosswalk('NAICS_Crosswalk_TimeSeries')[[ targetsectorsourcename, sectorsourcename]] cw = cw_load[targetsectorsourcename].drop_duplicates().tolist() diff --git a/flowsa/sectormapping.py b/flowsa/sectormapping.py index f72b3f7f8..f23cd0de5 100644 --- a/flowsa/sectormapping.py +++ b/flowsa/sectormapping.py @@ -180,7 +180,7 @@ def map_to_BEA_sectors(fbs_load, region, io_level, year): mapping_col = 'BEA_2012_Detail_Code' # Prepare NAICS:BEA mapping file - mapping = (load_crosswalk('BEA') + mapping = (load_crosswalk('NAICS_to_BEA_Crosswalk') .rename(columns={mapping_col: 'BEA', 'NAICS_2012_Code': 'Sector'})) mapping = (mapping.drop( @@ -243,7 +243,7 @@ def get_BEA_industry_output(region, io_level, year): # If needed, aggregate from detial to summary if region == 'national' and io_level == 'summary': - bea_mapping = (load_crosswalk('BEA') + bea_mapping = (load_crosswalk('NAICS_to_BEA_Crosswalk') [['BEA_2012_Detail_Code','BEA_2012_Summary_Code']] .drop_duplicates() .rename(columns={'BEA_2012_Detail_Code': 'BEA'})) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA.py index 1ff0893a5..cd3f673cf 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA.py @@ -11,7 +11,8 @@ def write_BEA_crosswalk(level='Detail', year=2012): - cw_load = load_crosswalk('BEA') if year == 2012 else load_crosswalk(f'BEA_{year}') + cw_load = load_crosswalk('NAICS_to_BEA_Crosswalk') if year == 2012 else \ + load_crosswalk(f'Naics_to_BEA_Crosswalk_{year}') cw = cw_load[[f'BEA_{year}_{level}_Code', f'NAICS_{year}_Code']].drop_duplicates().reset_index(drop=True) # drop all rows with naics >6 diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_Make_Table.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_Make_Table.py index 96654f840..d4fcb8231 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_Make_Table.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_Make_Table.py @@ -18,7 +18,7 @@ def assign_naics(df_load): :param df_load: df, a FlowByActivity subset that contains unique activity names :return: df with assigned Sector columns """ - cw_load = load_crosswalk('BEA') + cw_load = load_crosswalk('NAICS_to_BEA_Crosswalk') cw = cw_load[['BEA_2012_Detail_Code', 'NAICS_2012_Code']].drop_duplicates().reset_index(drop=True) # drop all rows with naics >6 diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Blackhurst_IO.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Blackhurst_IO.py index 599d4aa0e..76ebaded9 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Blackhurst_IO.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Blackhurst_IO.py @@ -21,7 +21,7 @@ def assign_naics(df_load): :return: df with assigned Sector columns """ - cw_load = load_crosswalk('BEA') + cw_load = load_crosswalk('NAICS_to_BEA_Crosswalk') cw = cw_load[['BEA_2012_Detail_Code', 'NAICS_2012_Code']].drop_duplicates().reset_index(drop=True) # least aggregate level that applies is 5 digits diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_REI.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_REI.py index 9cfe6312d..6d784e5c7 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_REI.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_REI.py @@ -49,7 +49,7 @@ def assign_naics(df): dfb = df[~df['ActivityCode'].str.startswith('RS')].reset_index(drop=True) # load bea crosswalk - cw_load = load_crosswalk('BEA') + cw_load = load_crosswalk('NAICS_to_BEA_Crosswalk') cw = (cw_load[['BEA_2012_Detail_Code', 'NAICS_2012_Code']] .drop_duplicates() .dropna() From 9185b1a7b44a142b1f6cf3ba01dff3c6fc2eff99 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 16 Oct 2023 11:28:52 -0400 Subject: [PATCH 1038/1127] clean up validation log for custom attribution columns --- flowsa/flowby.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 9e71a85d6..b66644632 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1092,16 +1092,24 @@ def proportionally_attribute( unattributable = merged_with_denominator.query(f'denominator == 0 ') if not unattributable.empty: - log.warning( - 'Could not attribute activities %s in %s due to lack of ' - 'flows in attribution source %s for mapped sectors', - set(zip(unattributable.SectorProducedBy, - unattributable.SectorConsumedBy, - unattributable.Location)), + vlog.warning( + 'Could not attribute activities in %s due to lack of ' + 'flows in attribution source %s for %s. ' + 'See validation_log for details.', unattributable.full_name, - other.full_name + other.full_name, + sorted(set(zip(unattributable.SectorProducedBy, + unattributable.SectorConsumedBy))) ) - + vlog.debug( + 'Unattributed activities: \n {}'.format( + unattributable + .drop(columns=schema.dq_fields + + ['LocationSystem', 'SectorSourceName', 'FlowType', + 'ProducedBySectorType', 'ConsumedBySectorType', + 'denominator', 'Suppressed'], + errors='ignore') + .to_string())) fb = ( non_zero_denominator .assign(FlowAmount=lambda x: (x.FlowAmount From cf8bd943d9e738d1ee6093e257d756a5109eeb26 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 16 Oct 2023 11:31:17 -0400 Subject: [PATCH 1039/1127] fix attribute_on cols, add industries to drop to avoid unnecessary warnings --- .../flowbysectormethods/Detail_Use_2018.yaml | 38 +++++++++++++------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Detail_Use_2018.yaml b/flowsa/methods/flowbysectormethods/Detail_Use_2018.yaml index a83b9d2d1..5b3248e7b 100644 --- a/flowsa/methods/flowbysectormethods/Detail_Use_2018.yaml +++ b/flowsa/methods/flowbysectormethods/Detail_Use_2018.yaml @@ -3,7 +3,7 @@ !include:BEA_detail_target.yaml year: 2018 -target_naics_year: 2017 # <- this may not be working +target_naics_year: 2017 geoscale: national source_names: @@ -11,20 +11,34 @@ source_names: geoscale: national year: 2018 activity_to_sector_mapping: BEA_2017_Summary - # selection_fields: - # ActivityProducedBy: ['111CA', '113FF'] - # ActivityConsumedBy: ['111CA', '113FF'] + primary_action_type: Consumed # speeds processing + + # Drop unneeded codes + exclusion_fields: + ActivityProducedBy: ['T00OSUB', 'T00OTOP', 'T00SUB', 'T00TOP', 'T018', + 'V001', 'V003', 'VABAS', 'VAPRO', 'T005', + 'Other', 'Used'] + ActivityConsumedBy: ['F010', 'F02E', 'F02N', 'F02R', 'F02S', + 'F030', 'F040', 'F06C', 'F06E', 'F06N', 'F06S', 'F07C', 'F07E', + 'F07N', 'F07S', 'F10C', 'F10E', 'F10N', 'F10S', + 'T001', 'T019'] attribution_method: proportional - attribute_on: ['SectorProducedBy', 'SectorConsumedBy'] + attribute_on: ['PrimarySector', 'SecondarySector'] attribution_source: BEA_Detail_Use_SUT: year: 2017 - # selection_fields: - # ActivityProducedBy: ['1111A0', '1111B0', '111200', '111300', '111400', - # '111900', '112120', '1121A0', '112300', '112A00', - # '113000', '114000', '115000'] - # ActivityConsumedBy: ['1111A0', '1111B0', '111200', '111300', '111400', - # '111900', '112120', '1121A0', '112300', '112A00', - # '113000', '114000', '115000'] activity_to_sector_mapping: BEA_2017_Detail + primary_action_type: Consumed # speeds processing + + # Drop unneeded codes + exclusion_fields: + ActivityConsumedBy: ['T001', 'F01000', 'F02E00', 'F02N00', 'F02R00', + 'F02S00', 'F03000', 'F04000', 'F06C00', 'F06E00', + 'F06N00', 'F06S00', 'F07C00', 'F07E00', 'F07N00', + 'F07S00', 'F10C00', 'F10E00', 'F10N00', 'F10S00', + 'T019'] + ActivityProducedBy: ['T005', 'V00100', 'T00OTOP', 'V00300', 'VABAS', + 'T018', 'T00TOP', 'T00SUB', 'VAPRO', + 'S00300', 'S00401', 'S00402'] # Noncomparable imports, Scrap, Used, + attribution_method: equal From 265db4ae8f08ec60d46042a187c160373dca9b10 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 16 Oct 2023 12:07:30 -0400 Subject: [PATCH 1040/1127] update method notes --- flowsa/methods/flowbysectormethods/BEA_detail_target.yaml | 2 ++ flowsa/methods/flowbysectormethods/Detail_Use_2018.yaml | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/BEA_detail_target.yaml b/flowsa/methods/flowbysectormethods/BEA_detail_target.yaml index e58f2c2d9..c35eb74b3 100644 --- a/flowsa/methods/flowbysectormethods/BEA_detail_target.yaml +++ b/flowsa/methods/flowbysectormethods/BEA_detail_target.yaml @@ -31,3 +31,5 @@ industry_spec: '23', '92', 'F010'] target_sector_year: 2017 +# This schema was created for 2017 NAICS but should also work for the schema +# for the 2012 tables using 2012 NAICS diff --git a/flowsa/methods/flowbysectormethods/Detail_Use_2018.yaml b/flowsa/methods/flowbysectormethods/Detail_Use_2018.yaml index 5b3248e7b..c206ef6ca 100644 --- a/flowsa/methods/flowbysectormethods/Detail_Use_2018.yaml +++ b/flowsa/methods/flowbysectormethods/Detail_Use_2018.yaml @@ -1,15 +1,16 @@ # This method disaggregates a Summary Use table for target use based on the -# best available Detail Use table +# 2017 Detail Use table. The resulting tables do not reflect valid balanced +# Use tables !include:BEA_detail_target.yaml -year: 2018 +year: &summary_year 2018 target_naics_year: 2017 geoscale: national source_names: BEA_Summary_Use_SUT: geoscale: national - year: 2018 + year: *summary_year activity_to_sector_mapping: BEA_2017_Summary primary_action_type: Consumed # speeds processing From bb1eaf5f8efd0e8bf2fe13b87464e03021011289 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 16 Oct 2023 13:25:40 -0400 Subject: [PATCH 1041/1127] fix typo in key --- flowsa/methods/flowbysectormethods/BEA_detail_target.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/methods/flowbysectormethods/BEA_detail_target.yaml b/flowsa/methods/flowbysectormethods/BEA_detail_target.yaml index c35eb74b3..cfb9c4bec 100644 --- a/flowsa/methods/flowbysectormethods/BEA_detail_target.yaml +++ b/flowsa/methods/flowbysectormethods/BEA_detail_target.yaml @@ -30,6 +30,6 @@ industry_spec: '72251', '23', '92', 'F010'] -target_sector_year: 2017 +target_naics_year: 2017 # This schema was created for 2017 NAICS but should also work for the schema # for the 2012 tables using 2012 NAICS From fe3211511a79cf345e9fd294b60019dc75994618 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 16 Oct 2023 11:46:01 -0600 Subject: [PATCH 1042/1127] in melt_naics_crosswalk() do not assume target sector year is 2012 --- flowsa/naics.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/flowsa/naics.py b/flowsa/naics.py index 36cee140f..c6ee37f4f 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -279,39 +279,42 @@ def check_if_sectors_are_naics(df_load, crosswalk_list, column_headers): return non_sectors -def melt_naics_crosswalk(): +def melt_naics_crosswalk(targetsectorsourcename): """ Create a melt version of the naics 07 to 17 crosswalk to map naics to naics 2012 + :param targetsectorsourcename: str, the target sector year, such as + "NAICS_2012_Code" :return: df, naics crosswalk melted """ + # load the mastercroswalk and subset by sectorsourcename, # save values to list cw_load = common.load_crosswalk('NAICS_Crosswalk_TimeSeries') - # create melt table of possible 2007 and 2017 naics that can - # be mapped to 2012 + # create melt table of possible naics from other years that can + # be mapped to target naics year cw_melt = cw_load.melt( - id_vars='NAICS_2012_Code', var_name='NAICS_year', value_name='NAICS') + id_vars=targetsectorsourcename, var_name='NAICS_year', value_name='NAICS') # drop the naics year because not relevant for replacement purposes cw_replacement = cw_melt.dropna(how='any') cw_replacement = cw_replacement[ - ['NAICS_2012_Code', 'NAICS']].drop_duplicates() + [targetsectorsourcename, 'NAICS']].drop_duplicates() # drop rows where contents are equal cw_replacement = cw_replacement[ - cw_replacement['NAICS_2012_Code'] != cw_replacement['NAICS']] + cw_replacement[targetsectorsourcename] != cw_replacement['NAICS']] # drop rows where length > 6 - cw_replacement = cw_replacement[cw_replacement['NAICS_2012_Code'].apply( + cw_replacement = cw_replacement[cw_replacement[targetsectorsourcename].apply( lambda x: len(x) < 7)].reset_index(drop=True) - # order by naics 2012 + # order by naics target tear cw_replacement = cw_replacement.sort_values( - ['NAICS', 'NAICS_2012_Code']).reset_index(drop=True) + ['NAICS', targetsectorsourcename]).reset_index(drop=True) # create allocation ratios by determining number of - # NAICS 2012 to other naics when not a 1:1 ratio + # NAICS year to other naics when not a 1:1 ratio cw_replacement_2 = cw_replacement.assign( naics_count=cw_replacement.groupby( - ['NAICS'])['NAICS_2012_Code'].transform('count')) + ['NAICS'])[targetsectorsourcename].transform('count')) cw_replacement_2 = cw_replacement_2.assign( allocation_ratio=1/cw_replacement_2['naics_count']) @@ -338,7 +341,7 @@ def convert_naics_year(df_load, targetsectorsourcename, sectorsourcename): cw = cw_load[targetsectorsourcename].drop_duplicates().tolist() # load melted crosswalk - cw_melt = melt_naics_crosswalk() + cw_melt = melt_naics_crosswalk(targetsectorsourcename) # drop the count column cw_melt = cw_melt.drop(columns='naics_count') From b5f08917eedcdaa5a7f1a2cd585723217b29b386 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 16 Oct 2023 13:48:49 -0400 Subject: [PATCH 1043/1127] fix metadata access for FBS as attribution source --- flowsa/metadata.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/flowsa/metadata.py b/flowsa/metadata.py index 45978b486..fead482c3 100644 --- a/flowsa/metadata.py +++ b/flowsa/metadata.py @@ -135,10 +135,8 @@ def return_fbs_method_data(source_name, config): source = list(attr_dict.keys())[0] # Check first for cached source if source in config.get('sources_to_cache', ()): - year = (config.get('sources_to_cache') - .get(source) - .get('year', v.get('year')) - ) + source_dict = config.get('sources_to_cache')[source] + year = source_dict.get('year', v.get('year')) else: year = attr_dict[source].get('year', v.get('year')) except AttributeError: @@ -146,7 +144,7 @@ def return_fbs_method_data(source_name, config): year = None if source in attr_source_meta.keys(): continue - cat = (get_catalog_info(source)['data_format'] + cat = (get_catalog_info(source).get('data_format', 'FBS') .replace('FBS', 'FlowBySector') .replace('FBA', 'FlowByActivity')) From b4f48046a83ea9876d86329109b072f5afdb4bc3 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 16 Oct 2023 13:50:50 -0400 Subject: [PATCH 1044/1127] pass config as kwarg through to load_yaml_dict to enable generation of FBS within another FBS method; to use deepcopy, convert method_config_keys from `dict_keys` to `set` --- flowsa/common.py | 10 +++++++--- flowsa/flowbysector.py | 14 +++++++++----- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/flowsa/common.py b/flowsa/common.py index 7be39fda3..e561efdbd 100644 --- a/flowsa/common.py +++ b/flowsa/common.py @@ -10,6 +10,7 @@ import yaml import pandas as pd import numpy as np +from copy import deepcopy from dotenv import load_dotenv import flowsa.flowsa_yaml as flowsa_yaml import flowsa.exceptions @@ -113,7 +114,7 @@ def return_bea_codes_used_as_naics(): return code_list -def load_yaml_dict(filename, flowbytype=None, filepath=None): +def load_yaml_dict(filename, flowbytype=None, filepath=None, **kwargs): """ Load the information in a yaml file, from source_catalog, or FBA, or FBS files @@ -156,8 +157,11 @@ def load_yaml_dict(filename, flowbytype=None, filepath=None): with open(yaml_path, 'r', encoding='utf-8') as f: config = flowsa_yaml.load(f, filepath) except FileNotFoundError: - raise flowsa.exceptions.FlowsaMethodNotFoundError( - method_type=flowbytype, method=filename) + if 'config' in kwargs: + return deepcopy(kwargs['config']) + else: + raise flowsa.exceptions.FlowsaMethodNotFoundError( + method_type=flowbytype, method=filename) return config diff --git a/flowsa/flowbysector.py b/flowsa/flowbysector.py index e42cf49ef..138004033 100644 --- a/flowsa/flowbysector.py +++ b/flowsa/flowbysector.py @@ -99,7 +99,7 @@ def getFlowBySector( flowby_generator = ( lambda x=method, y=external_config_path, z=download_sources_ok: - cls.generateFlowBySector(x, y, z) + cls.generateFlowBySector(x, y, z, config=config) ) return super()._getFlowBy( file_metadata=file_metadata, @@ -117,6 +117,7 @@ def generateFlowBySector( method: str, external_config_path: str = None, download_sources_ok: bool = settings.DEFAULT_DOWNLOAD_IF_MISSING, + **kwargs ) -> 'FlowBySector': ''' Generates a FlowBySector dataset. @@ -126,10 +127,13 @@ def generateFlowBySector( :param download_fba_ok: bool, optional. Whether to attempt to download source data FlowByActivity files from EPA server rather than generating them. + :kwargs: keyword arguments to pass to load_yaml_dict(). Possible kwargs + include config. ''' log.info('Beginning FlowBySector generation for %s', method) method_config = common.load_yaml_dict(method, 'FBS', - external_config_path) + external_config_path, + **kwargs) # Cache one or more sources by attaching to method_config to_cache = method_config.pop('sources_to_cache', {}) @@ -144,7 +148,7 @@ def generateFlowBySector( name=source_name, config={ **method_config, - 'method_config_keys': method_config.keys(), + 'method_config_keys': set(method_config.keys()), **get_catalog_info(source_name), **config }, @@ -165,7 +169,7 @@ def generateFlowBySector( name=source_name, config={ **method_config, - 'method_config_keys': method_config.keys(), + 'method_config_keys': set(method_config.keys()), **get_catalog_info(source_name), **config }, @@ -206,7 +210,7 @@ def generateFlowBySector( reset_log_file(method, meta) metadata.write_metadata(source_name=method, config=common.load_yaml_dict( - method, 'FBS', external_config_path), + method, 'FBS', external_config_path, **kwargs), fb_meta=meta, category='FlowBySector') From 7f4d963d74ecbe4b61577c96e7777f941b552474 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 16 Oct 2023 13:53:18 -0400 Subject: [PATCH 1045/1127] rename Detail_Use for more flexible application --- .../{Detail_Use_2018.yaml => Detail_Use.yaml} | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) rename flowsa/methods/flowbysectormethods/{Detail_Use_2018.yaml => Detail_Use.yaml} (81%) diff --git a/flowsa/methods/flowbysectormethods/Detail_Use_2018.yaml b/flowsa/methods/flowbysectormethods/Detail_Use.yaml similarity index 81% rename from flowsa/methods/flowbysectormethods/Detail_Use_2018.yaml rename to flowsa/methods/flowbysectormethods/Detail_Use.yaml index c206ef6ca..e5a70bfb4 100644 --- a/flowsa/methods/flowbysectormethods/Detail_Use_2018.yaml +++ b/flowsa/methods/flowbysectormethods/Detail_Use.yaml @@ -2,11 +2,24 @@ # 2017 Detail Use table. The resulting tables do not reflect valid balanced # Use tables +# The full FBS for any year can be cached using: +# sources_to_cache: +# Detail_Use_2019: +# !include:Detail_Use.yaml +# year: *year +# source_names: +# BEA_Summary_Use_SUT: +# !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT +# year: *year + !include:BEA_detail_target.yaml year: &summary_year 2018 target_naics_year: 2017 geoscale: national +data_format: FBS +activity_schema: NAICS_2017_Code # <- necessary? (long term just look at the FBS) + source_names: BEA_Summary_Use_SUT: geoscale: national @@ -25,7 +38,7 @@ source_names: 'T001', 'T019'] attribution_method: proportional attribute_on: ['PrimarySector', 'SecondarySector'] - attribution_source: + attribution_source: BEA_Detail_Use_SUT: year: 2017 activity_to_sector_mapping: BEA_2017_Detail @@ -40,6 +53,6 @@ source_names: 'T019'] ActivityProducedBy: ['T005', 'V00100', 'T00OTOP', 'V00300', 'VABAS', 'T018', 'T00TOP', 'T00SUB', 'VAPRO', - 'S00300', 'S00401', 'S00402'] # Noncomparable imports, Scrap, Used, + 'S00300', 'S00401', 'S00402'] # Noncomparable imports, Scrap, Used attribution_method: equal From ff74b46adb64be33a66e94e4cfcc2e82a63c8906 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Mon, 16 Oct 2023 12:41:48 -0600 Subject: [PATCH 1046/1127] check FBS sector source year if using FBS as attribution source - convert to target year if necessary --- flowsa/flowby.py | 8 +++++++- flowsa/naics.py | 6 ++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index b66644632..4c729f915 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -673,7 +673,13 @@ def attribute_flows_to_sectors( .rename(columns={'SourceName': 'MetaSources'}) ) elif self.config['data_format'] in ['FBS']: - fb = grouped.sector_aggregation() # convert to proper industry spec. + # ensure sector year of loaded FBS matches target sector year + fb = naics.convert_naics_year( + grouped, + f"NAICS_{self.config['target_naics_year']}_Code", + grouped['SectorSourceName'][0]) + # convert to proper industry spec. + fb = fb.sector_aggregation() # subset the fb configuration so it only includes the # attribution_method currently being assessed - rather than all diff --git a/flowsa/naics.py b/flowsa/naics.py index c6ee37f4f..2d903c2f8 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -271,10 +271,11 @@ def check_if_sectors_are_naics(df_load, crosswalk_list, column_headers): ns_list = pd.concat(non_sectors_list, sort=False, ignore_index=True) # print the NonSectors non_sectors = ns_list['NonSectors'].drop_duplicates().tolist() - vlog.debug('There are sectors that are not NAICS 2012 Codes') + vlog.debug('There are sectors that are not target NAICS Codes') vlog.debug(non_sectors) else: - log.info('Sectors do not require conversion') + log.info('Sectors are all in the target NAICS year and do not require ' + 'conversion') return non_sectors @@ -336,6 +337,7 @@ def convert_naics_year(df_load, targetsectorsourcename, sectorsourcename): cw_load = common.load_crosswalk('NAICS_Crosswalk_TimeSeries')[[ targetsectorsourcename]] else: + log.info(f"Converting {sectorsourcename} to {targetsectorsourcename}") cw_load = common.load_crosswalk('NAICS_Crosswalk_TimeSeries')[[ targetsectorsourcename, sectorsourcename]] cw = cw_load[targetsectorsourcename].drop_duplicates().tolist() From 67d48353003fd45a6cfdb8ee00f385cc92facf3f Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 16 Oct 2023 15:03:07 -0400 Subject: [PATCH 1047/1127] update implementation of new use tables for CAP_HAP; add 2020 FBS, drop old state FBS --- .../CAP_HAP_Nonpoint_2017.yaml | 25 ++-- .../CAP_HAP_Nonpoint_2020.yaml | 70 +++++++++++ .../CAP_HAP_Nonroad_2017.yaml | 17 ++- .../CAP_HAP_Nonroad_2020.yaml | 32 +++++ .../CAP_HAP_Onroad_2017.yaml | 17 ++- .../CAP_HAP_Onroad_2020.yaml | 31 +++++ .../CAP_HAP_national_2017_m1.yaml | 3 +- .../CAP_HAP_national_2020_m1.yaml | 48 ++----- .../CAP_HAP_state_2014.yaml | 118 ------------------ .../CAP_HAP_state_2017.yaml | 118 ------------------ .../CAP_HAP_state_2020.yaml | 118 ------------------ .../CAP_HAP_state_2020_m1.yaml | 27 ++++ 12 files changed, 195 insertions(+), 429 deletions(-) create mode 100644 flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2020.yaml create mode 100644 flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2020.yaml create mode 100644 flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2020.yaml delete mode 100644 flowsa/methods/flowbysectormethods/CAP_HAP_state_2014.yaml delete mode 100644 flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml delete mode 100644 flowsa/methods/flowbysectormethods/CAP_HAP_state_2020.yaml create mode 100644 flowsa/methods/flowbysectormethods/CAP_HAP_state_2020_m1.yaml diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2017.yaml index c0d281e33..83a05fbef 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2017.yaml @@ -2,25 +2,22 @@ # method in CAP_HAP_common. This state level method is at the detail level. # This FBS is for the Nonpoint portion ONLY -industry_spec: - default: NAICS_6 +!include:BEA_detail_target.yaml target_naics_year: 2012 geoscale: state _emission_year: &year 2017 _attribution_sources: - BEA_Detail_Use_PRO_BeforeRedef: &bea - # UPDATE_BEA_2017_DETAIL: &bea - year: 2012 + BEA_Detail_Use_SUT: &bea + year: *year geoscale: national - activity_to_sector_mapping: BEA_2012_Detail - # activity_to_sector_mapping: BEA_2017_Detail + activity_to_sector_mapping: BEA_2017_Detail attribution_method: proportional attribution_source: - Employment_national_2012: + Employment_national_2017: data_format: FBS - year: 2012 + year: *year sources_to_cache: EIA_MECS_Energy: @@ -43,7 +40,7 @@ source_names: mobile_and_fuel_storage: !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:mobile_and_fuel_storage attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: + BEA_Detail_Use_SUT: <<: *bea selection_fields: ActivityProducedBy: {'324110': ''} # Petroleum @@ -51,7 +48,7 @@ source_names: fertilizers: !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:fertilizers attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: + BEA_Detail_Use_SUT: <<: *bea selection_fields: ActivityProducedBy: {'325310': ''} # Fertilizers @@ -59,7 +56,7 @@ source_names: pesticides: !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:pesticides attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: + BEA_Detail_Use_SUT: <<: *bea selection_fields: ActivityProducedBy: {'325320': ''} # Pesticides @@ -68,12 +65,12 @@ source_names: !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:output_allocation attribution_source: BEA_Detail_GrossOutput_IO: - year: 2017 + year: *year geoscale: national activity_to_sector_mapping: BEA_2012_Detail attribution_method: proportional attribution_source: Employment_national_2017: data_format: FBS - year: 2017 + year: *year diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2020.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2020.yaml new file mode 100644 index 000000000..287a8b81d --- /dev/null +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2020.yaml @@ -0,0 +1,70 @@ +# This is the 2020 target year method for CAP_HAP which builds off the generic +# method in CAP_HAP_common. This state level method is at the detail level. +# This FBS is for the Nonpoint portion ONLY + +!include:BEA_detail_target.yaml +target_naics_year: 2012 +geoscale: state + +_emission_year: &year 2020 + +sources_to_cache: + Detail_Use_2020: + !include:Detail_Use.yaml + year: *year + source_names: + BEA_Summary_Use_SUT: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + year: *year + + EIA_MECS_Energy: + !include:CAP_HAP_common.yaml:sources_to_cache:EIA_MECS_Energy_state + year: 2018 + attribution_source: + Employment_state_2018: # Update to MECS year + geoscale: national # Uses national at this stage prior to attributing to states + year: 2018 + clean_source: Employment_state_2018 + +source_names: + EPA_NEI_Nonpoint: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint + year: *year + activity_sets: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets + + # Update some activities with correct BEA year + mobile_and_fuel_storage: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:mobile_and_fuel_storage + attribution_source: + Detail_Use_2020: + selection_fields: + SectorProducedBy: {'32411': ''} # Petroleum + + fertilizers: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:fertilizers + attribution_source: + Detail_Use_2020: + selection_fields: + SectorProducedBy: {'32531': ''} # Fertilizers + + pesticides: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:pesticides + attribution_source: + Detail_Use_2020: + selection_fields: + SectorProducedBy: {'32532': ''} # Pesticides + + output_allocation: # Gross Output + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:output_allocation + attribution_source: + BEA_Detail_GrossOutput_IO: + year: *year + geoscale: national + activity_to_sector_mapping: BEA_2012_Detail + attribution_method: proportional + attribution_source: + Employment_national_2020: + data_format: FBS + year: *year + diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2017.yaml index ddea6cd32..654da493b 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2017.yaml @@ -2,25 +2,22 @@ # method in CAP_HAP_common. This state level method is at the detail level. # This FBS is for the Nonroad portion ONLY -industry_spec: - default: NAICS_6 +!include:BEA_detail_target.yaml target_naics_year: 2012 geoscale: state _emission_year: &year 2017 _attribution_sources: - BEA_Detail_Use_PRO_BeforeRedef: &bea - # UPDATE_BEA_2017_DETAIL: &bea - year: 2012 + BEA_Detail_Use_SUT: &bea + year: *year geoscale: national - activity_to_sector_mapping: BEA_2012_Detail - # activity_to_sector_mapping: BEA_2017_Detail + activity_to_sector_mapping: BEA_2017_Detail attribution_method: proportional attribution_source: - Employment_national_2012: + Employment_national_2017: data_format: FBS - year: 2012 + year: *year source_names: EPA_NEI_Nonroad: @@ -31,7 +28,7 @@ source_names: offroad_vehicles_equipment: !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad:activity_sets:offroad_vehicles_equipment attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: + BEA_Detail_Use_SUT: <<: *bea selection_fields: ActivityProducedBy: {'324110': ''} # Petroleum diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2020.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2020.yaml new file mode 100644 index 000000000..666f6f1e1 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2020.yaml @@ -0,0 +1,32 @@ +# This is the 2020 target year method for CAP_HAP which builds off the generic +# method in CAP_HAP_common. This state level method is at the detail level. +# This FBS is for the Nonroad portion ONLY + +!include:BEA_detail_target.yaml +target_naics_year: 2012 +geoscale: state + +_emission_year: &year 2020 + +sources_to_cache: + Detail_Use_2020: + !include:Detail_Use.yaml + year: *year + source_names: + BEA_Summary_Use_SUT: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + year: *year + +source_names: + EPA_NEI_Nonroad: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad + year: *year + activity_sets: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad:activity_sets + offroad_vehicles_equipment: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad:activity_sets:offroad_vehicles_equipment + attribution_source: + Detail_Use_2020: + selection_fields: + SectorProducedBy: {'32411': ''} # Petroleum + diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2017.yaml index 8637d7cc3..d4ca5eccd 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2017.yaml @@ -2,25 +2,22 @@ # method in CAP_HAP_common. This state level method is at the detail level. # This FBS is for the Onroad portion ONLY -industry_spec: - default: NAICS_6 +!include:BEA_detail_target.yaml target_naics_year: 2012 geoscale: state _emission_year: &year 2017 _attribution_sources: - BEA_Detail_Use_PRO_BeforeRedef: &bea - # UPDATE_BEA_2017_DETAIL: &bea - year: 2012 + BEA_Detail_Use_SUT: &bea + year: *year geoscale: national - activity_to_sector_mapping: BEA_2012_Detail - # activity_to_sector_mapping: BEA_2017_Detail + activity_to_sector_mapping: BEA_2017_Detail attribution_method: proportional attribution_source: - Employment_national_2012: + Employment_national_2017: data_format: FBS - year: 2012 + year: *year source_names: EPA_NEI_Onroad: @@ -31,7 +28,7 @@ source_names: onroad_vehicles_gas_stations: !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad:activity_sets:onroad_vehicles_gas_stations attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: + BEA_Detail_Use_SUT: <<: *bea selection_fields: ActivityProducedBy: {'324110': ''} # Petroleum diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2020.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2020.yaml new file mode 100644 index 000000000..28fe22b4f --- /dev/null +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2020.yaml @@ -0,0 +1,31 @@ +# This is the 2020 target year method for CAP_HAP which builds off the generic +# method in CAP_HAP_common. This state level method is at the detail level. +# This FBS is for the Onroad portion ONLY + +!include:BEA_detail_target.yaml +target_naics_year: 2012 +geoscale: state + +_emission_year: &year 2020 + +sources_to_cache: + Detail_Use_2020: + !include:Detail_Use.yaml + year: *year + source_names: + BEA_Summary_Use_SUT: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + year: *year + +source_names: + EPA_NEI_Onroad: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad + year: *year + activity_sets: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad:activity_sets + onroad_vehicles_gas_stations: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad:activity_sets:onroad_vehicles_gas_stations + attribution_source: + Detail_Use_2020: + selection_fields: + SectorProducedBy: {'32411': ''} # Petroleum diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m1.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m1.yaml index 0bbbd25dd..2f09b1477 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m1.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m1.yaml @@ -1,8 +1,7 @@ # This is the 2017 target year method for National detail models # It aggregates the state detail models -industry_spec: - default: NAICS_6 +!include:BEA_detail_target.yaml target_naics_year: 2012 geoscale: national diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2020_m1.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2020_m1.yaml index b1b5d826e..fb2bb8b9c 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2020_m1.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2020_m1.yaml @@ -1,54 +1,24 @@ -# This is the 2020 target year method for CAP_HAP which builds off the generic -# method in CAP_HAP_common +# This is the 2020 target year method for National detail models +# It aggregates the state detail models -industry_spec: - default: NAICS_6 +!include:BEA_detail_target.yaml target_naics_year: 2012 geoscale: national _emission_year: &year 2020 -sources_to_cache: - EIA_MECS_Energy: - !include:CAP_HAP_common.yaml:sources_to_cache:EIA_MECS_Energy - year: 2018 - attribution_source: - Employment_national_2018: - data_format: FBS - year: 2018 - source_names: - EPA_NEI_Nonpoint: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint + CAP_HAP_Nonpoint_2020: # detail state model year: *year - activity_sets: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets - output_allocation: # Gross Output - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv output_allocation - attribution_method: proportional - attribution_source: - BEA_Detail_GrossOutput_IO: - year: 2020 - geoscale: national - activity_to_sector_mapping: BEA_2012_Detail - selection_fields: - Class: Money - FlowName: Gross Output - attribution_method: proportional - attribution_source: - Employment_national_2020: - data_format: FBS - year: 2020 - + data_format: FBS - EPA_NEI_Nonroad: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad + CAP_HAP_Nonroad_2020: # detail state model year: *year + data_format: FBS - EPA_NEI_Onroad: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad + CAP_HAP_Onroad_2020: # detail state model year: *year + data_format: FBS stewiFBS: !include:CAP_HAP_common.yaml:source_names:stewiFBS diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2014.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2014.yaml deleted file mode 100644 index 170bbed2d..000000000 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2014.yaml +++ /dev/null @@ -1,118 +0,0 @@ -## Method for CAPs and HAPs for states is similar to CAP_HAP for national model -# but uses summary level target and stateio economic data for allocation -# allocation for fuel use is TBD -# Note that EPA_Nonpoint already used some state level allocations for ag-related -# emissions - - -!include:USEEIO_summary_target.yaml -target_naics_year: 2012 -geoscale: state -_emission_year: &year 2014 - -sources_to_cache: - EIA_MECS_Energy: - !include:CAP_HAP_common.yaml:sources_to_cache:EIA_MECS_Energy_state - year: 2014 - attribution_source: - Employment_state_2014: # Update to MECS year - geoscale: national - year: 2014 - clean_source: Employment_state_2014 - -_attribution_sources: - stateio: &stateio - year: *year - geoscale: state - activity_to_sector_mapping: BEA_2012_Summary - exclusion_fields: - ActivityConsumedBy: ['F030', 'F040', 'F050', 'F051', - 'F02E', 'F06E', 'F07E', 'F10E'] - attribution_method: equal - ## No attribution supplied (will use equal) because target level for - ## modeling is BEA summary level. - -source_names: - EPA_NEI_Nonpoint: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint - year: *year - - # Update some activity sets from Common to use stateior instead of BEA - activity_sets: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets - mobile_and_fuel_storage: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv mobile_and_fuel_storage - attribution_method: proportional - attribution_source: - stateio_Use_Summary: - <<: *stateio - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum 324110 - - fertilizers: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv fertilizers - attribution_method: proportional - attribution_source: - stateio_Use_Summary: - <<: *stateio - selection_fields: - ActivityProducedBy: {'325': ''} # Fertilizers 325310 - - pesticides: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:pesticides - attribution_source: - stateio_Use_Summary: - <<: *stateio - selection_fields: - ActivityProducedBy: {'325': ''} # Pesticides 325320 - - output_allocation: # Gross Output - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv output_allocation - attribution_method: proportional - attribution_source: - stateio_Industry_GO: - <<: *stateio - selection_fields: - Class: Money - - EPA_NEI_Nonroad: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad - year: *year - # Update some activity sets from Common to use stateior instead of BEA - activity_sets: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad:activity_sets - offroad_vehicles_equipment: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonroad_asets.csv offroad_vehicles_equipment - attribution_method: proportional - attribution_source: - stateio_Use_Summary: - <<: *stateio - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum 324110 - - EPA_NEI_Onroad: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad - year: *year - # Update some activity sets from Common to use stateior instead of BEA - activity_sets: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad:activity_sets - onroad_vehicles_gas_stations: - selection_fields: - PrimaryActivity: !from_index:NEI_Onroad_asets.csv onroad_vehicles_gas_stations - attribution_method: proportional - attribution_source: - stateio_Use_Summary: - <<: *stateio - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum 324110 - - stewiFBS: - !include:CAP_HAP_common.yaml:source_names:stewiFBS - inventory_dict: - NEI: *year - TRI: *year - local_inventory_name: NEI_TRI_air_2014 diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml deleted file mode 100644 index cc3826cd8..000000000 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2017.yaml +++ /dev/null @@ -1,118 +0,0 @@ -## Method for CAPs and HAPs for states is similar to CAP_HAP for national model -# but uses summary level target and stateio economic data for allocation -# allocation for fuel use is TBD -# Note that EPA_Nonpoint already used some state level allocations for ag-related -# emissions - - -!include:USEEIO_summary_target.yaml -target_naics_year: 2012 -geoscale: state -_emission_year: &year 2017 - -sources_to_cache: - EIA_MECS_Energy: - !include:CAP_HAP_common.yaml:sources_to_cache:EIA_MECS_Energy_state - year: 2018 - attribution_source: - Employment_state_2018: # Update to MECS year - geoscale: national - year: 2018 - clean_source: Employment_state_2018 - -_attribution_sources: - stateio: &stateio - year: *year - geoscale: state - activity_to_sector_mapping: BEA_2012_Summary - exclusion_fields: - ActivityConsumedBy: ['F030', 'F040', 'F050', 'F051', - 'F02E', 'F06E', 'F07E', 'F10E'] - attribution_method: equal - ## No attribution supplied (will use equal) because target level for - ## modeling is BEA summary level. - -source_names: - EPA_NEI_Nonpoint: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint - year: *year - - # Update some activity sets from Common to use stateior instead of BEA - activity_sets: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets - mobile_and_fuel_storage: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv mobile_and_fuel_storage - attribution_method: proportional - attribution_source: - stateio_Use_Summary: - <<: *stateio - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum 324110 - - fertilizers: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv fertilizers - attribution_method: proportional - attribution_source: - stateio_Use_Summary: - <<: *stateio - selection_fields: - ActivityProducedBy: {'325': ''} # Fertilizers 325310 - - pesticides: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:pesticides - attribution_source: - stateio_Use_Summary: - <<: *stateio - selection_fields: - ActivityProducedBy: {'325': ''} # Pesticides 325320 - - output_allocation: # Gross Output - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv output_allocation - attribution_method: proportional - attribution_source: - stateio_Industry_GO: - <<: *stateio - selection_fields: - Class: Money - - EPA_NEI_Nonroad: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad - year: *year - # Update some activity sets from Common to use stateior instead of BEA - activity_sets: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad:activity_sets - offroad_vehicles_equipment: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonroad_asets.csv offroad_vehicles_equipment - attribution_method: proportional - attribution_source: - stateio_Use_Summary: - <<: *stateio - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum 324110 - - EPA_NEI_Onroad: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad - year: *year - # Update some activity sets from Common to use stateior instead of BEA - activity_sets: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad:activity_sets - onroad_vehicles_gas_stations: - selection_fields: - PrimaryActivity: !from_index:NEI_Onroad_asets.csv onroad_vehicles_gas_stations - attribution_method: proportional - attribution_source: - stateio_Use_Summary: - <<: *stateio - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum 324110 - - stewiFBS: - !include:CAP_HAP_common.yaml:source_names:stewiFBS - inventory_dict: - NEI: *year - TRI: *year - local_inventory_name: NEI_TRI_air_2017 diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2020.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2020.yaml deleted file mode 100644 index aae0a66df..000000000 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2020.yaml +++ /dev/null @@ -1,118 +0,0 @@ -## Method for CAPs and HAPs for states is similar to CAP_HAP for national model -# but uses summary level target and stateio economic data for allocation -# allocation for fuel use is TBD -# Note that EPA_Nonpoint already used some state level allocations for ag-related -# emissions - - -!include:USEEIO_summary_target.yaml -target_naics_year: 2012 -geoscale: state -_emission_year: &year 2020 - -sources_to_cache: - EIA_MECS_Energy: - !include:CAP_HAP_common.yaml:sources_to_cache:EIA_MECS_Energy_state - year: 2018 - attribution_source: - Employment_state_2018: # Update to MECS year - geoscale: national - year: 2018 - clean_source: Employment_state_2018 - -_attribution_sources: - stateio: &stateio - year: *year - geoscale: state - activity_to_sector_mapping: BEA_2012_Summary - exclusion_fields: - ActivityConsumedBy: ['F030', 'F040', 'F050', 'F051', - 'F02E', 'F06E', 'F07E', 'F10E'] - attribution_method: equal - ## No attribution supplied (will use equal) because target level for - ## modeling is BEA summary level. - -source_names: - EPA_NEI_Nonpoint: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint - year: *year - - # Update some activity sets from Common to use stateior instead of BEA - activity_sets: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets - mobile_and_fuel_storage: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv mobile_and_fuel_storage - attribution_method: proportional - attribution_source: - stateio_Use_Summary: - <<: *stateio - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum 324110 - - fertilizers: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv fertilizers - attribution_method: proportional - attribution_source: - stateio_Use_Summary: - <<: *stateio - selection_fields: - ActivityProducedBy: {'325': ''} # Fertilizers 325310 - - pesticides: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:pesticides - attribution_source: - stateio_Use_Summary: - <<: *stateio - selection_fields: - ActivityProducedBy: {'325': ''} # Pesticides 325320 - - output_allocation: # Gross Output - selection_fields: - PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv output_allocation - attribution_method: proportional - attribution_source: - stateio_Industry_GO: - <<: *stateio - selection_fields: - Class: Money - - EPA_NEI_Nonroad: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad - year: *year - # Update some activity sets from Common to use stateior instead of BEA - activity_sets: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad:activity_sets - offroad_vehicles_equipment: - selection_fields: - PrimaryActivity: !from_index:NEI_Nonroad_asets.csv offroad_vehicles_equipment - attribution_method: proportional - attribution_source: - stateio_Use_Summary: - <<: *stateio - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum 324110 - - EPA_NEI_Onroad: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad - year: *year - # Update some activity sets from Common to use stateior instead of BEA - activity_sets: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad:activity_sets - onroad_vehicles_gas_stations: - selection_fields: - PrimaryActivity: !from_index:NEI_Onroad_asets.csv onroad_vehicles_gas_stations - attribution_method: proportional - attribution_source: - stateio_Use_Summary: - <<: *stateio - selection_fields: - ActivityProducedBy: {'324': ''} # Petroleum 324110 - - stewiFBS: - !include:CAP_HAP_common.yaml:source_names:stewiFBS - inventory_dict: - NEI: *year - TRI: *year - local_inventory_name: NEI_TRI_air_2020 diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2020_m1.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2020_m1.yaml new file mode 100644 index 000000000..f93ccd098 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2020_m1.yaml @@ -0,0 +1,27 @@ +# This is the 2020 target year method for Summary state models +# It aggregates the detail models to the summary level + +!include:USEEIO_summary_target.yaml +target_naics_year: 2012 +geoscale: state +_emission_year: &year 2020 + +source_names: + CAP_HAP_Nonpoint_2020: # detail state model + year: *year + data_format: FBS + + CAP_HAP_Nonroad_2020: # detail state model + year: *year + data_format: FBS + + CAP_HAP_Onroad_2020: # detail state model + year: *year + data_format: FBS + + stewiFBS: + !include:CAP_HAP_common.yaml:source_names:stewiFBS + inventory_dict: + NEI: *year + TRI: *year + local_inventory_name: NEI_TRI_air_2020 From 5d826f47630f97528e5f7a8a451e0340886ee640 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 17 Oct 2023 10:12:30 -0400 Subject: [PATCH 1048/1127] update `map_to_BEA_sectors` to work for BEA data with both SPB and SCB --- flowsa/sectormapping.py | 56 +++++++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/flowsa/sectormapping.py b/flowsa/sectormapping.py index f23cd0de5..0e64140b7 100644 --- a/flowsa/sectormapping.py +++ b/flowsa/sectormapping.py @@ -196,21 +196,45 @@ def map_to_BEA_sectors(fbs_load, region, io_level, year): ['Sector','Location']).Output.transform('sum') # Update and allocate to sectors - fbs = (fbs_load.merge( - mapping.drop_duplicates(subset='Sector', keep=False), - how='left', - on='Sector')) - fbs = fbs.merge(dup.drop(columns='Output'), - how='left', on=['Sector', 'Location'], - suffixes=(None, '_y')) - fbs['Allocation'] = fbs['Allocation'].fillna(1) - fbs['BEA'] = fbs['BEA'].fillna(fbs['BEA_y']) - fbs['FlowAmount'] = fbs['FlowAmount'] * fbs['Allocation'] + ## For FBS with both SPB and SCB, map sequentially + if set(['SectorProducedBy', 'SectorConsumedBy']).issubset(fbs_load.columns): + fbs = fbs_load.copy() + for col in ['SectorProducedBy', 'SectorConsumedBy']: + fbs = (fbs.merge( + mapping.drop_duplicates(subset='Sector', keep=False), + how='left', + left_on=col, + right_on='Sector')) + fbs = fbs.merge(dup.drop(columns='Output'), + how='left', + left_on=[col, 'Location'], + right_on=['Sector', 'Location'], + suffixes=(None, '_y')) + fbs['Allocation'] = fbs['Allocation'].fillna(1) + fbs['BEA'] = fbs['BEA'].fillna(fbs['BEA_y']) + fbs['FlowAmount'] = fbs['FlowAmount'] * fbs['Allocation'] + fbs = (fbs + .drop(columns=[col, 'BEA_y', 'Allocation', 'Sector', 'Sector_y']) + .rename(columns={'BEA': col}) + ) + fbs = fbs.dropna(subset=['SectorProducedBy', 'SectorConsumedBy']) + + else: + fbs = (fbs_load.merge( + mapping.drop_duplicates(subset='Sector', keep=False), + how='left', + on='Sector')) + fbs = fbs.merge(dup.drop(columns='Output'), + how='left', on=['Sector', 'Location'], + suffixes=(None, '_y')) + fbs['Allocation'] = fbs['Allocation'].fillna(1) + fbs['BEA'] = fbs['BEA'].fillna(fbs['BEA_y']) + fbs['FlowAmount'] = fbs['FlowAmount'] * fbs['Allocation'] + fbs = fbs.rename(columns={'BEA':'Sector'}) fbs = (fbs.drop(columns=dq_fields + - ['Sector', 'SectorSourceName', - 'BEA_y', 'Allocation'], errors='ignore') - .rename(columns={'BEA':'Sector'})) + ['SectorSourceName', + 'BEA_y', 'Allocation'], errors='ignore')) if (abs(1-(sum(fbs['FlowAmount']) / sum(fbs_load['FlowAmount'])))) > 0.005: @@ -315,3 +339,9 @@ def append_material_code(df, v, attr): df = df.drop(columns=['Material', 'Abbr']) return df + +if __name__ == "__main__": + df = flowsa.sectormapping.map_to_BEA_sectors( + flowsa.getFlowBySector('GHG_national_2019_m1') + .rename(columns={'SectorProducedBy':'Sector'}), + region='national', io_level='summary', year='2019') From 7c4e0bbd0c05365c06d97028e3e43d6c3690ae69 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 17 Oct 2023 10:12:47 -0400 Subject: [PATCH 1049/1127] apply attribution metadata even if no activity sets --- flowsa/metadata.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/flowsa/metadata.py b/flowsa/metadata.py index fead482c3..66281676c 100644 --- a/flowsa/metadata.py +++ b/flowsa/metadata.py @@ -123,7 +123,11 @@ def return_fbs_method_data(source_name, config): # create dictionary of allocation datasets for different activities activities = v.get('activity_sets') if activities is None: - continue + if 'attribution_source' in v: + # for single attribution with no activity sets + activities = {'activity': v.copy()} + else: + continue # initiate nested dictionary attr_source_meta = {} # subset activity data and allocate to sector From abcbf350545cce6ccda68eb8e3ec5a8287a89c9b Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 17 Oct 2023 10:18:18 -0400 Subject: [PATCH 1050/1127] drop unnecessary import statement --- flowsa/sectormapping.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/flowsa/sectormapping.py b/flowsa/sectormapping.py index 0e64140b7..27f32a69b 100644 --- a/flowsa/sectormapping.py +++ b/flowsa/sectormapping.py @@ -170,8 +170,6 @@ def map_to_BEA_sectors(fbs_load, region, io_level, year): :param io_level: str, 'summary' or 'detail' :param year: year for industry output """ - from flowsa.sectormapping import get_activitytosector_mapping - bea = get_BEA_industry_output(region, io_level, year) if io_level == 'summary': From d9590a196dfe757259ae37b40d0c187b200b8726 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 17 Oct 2023 11:23:50 -0600 Subject: [PATCH 1051/1127] in load_prepare_attribution_source(), convert NAICS year if necessary to target year - used for cached sources loaded from a seperate yaml --- flowsa/flowby.py | 25 ++++++++++++++++++++----- flowsa/flowbyactivity.py | 5 ++--- flowsa/naics.py | 7 +++++-- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 4c729f915..115c8917c 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -674,12 +674,15 @@ def attribute_flows_to_sectors( ) elif self.config['data_format'] in ['FBS']: # ensure sector year of loaded FBS matches target sector year - fb = naics.convert_naics_year( - grouped, - f"NAICS_{self.config['target_naics_year']}_Code", - grouped['SectorSourceName'][0]) + if f"NAICS_{self.config['target_naics_year']}_Code" != \ + grouped['SectorSourceName'][0]: + grouped = naics.convert_naics_year( + grouped, + f"NAICS_{self.config['target_naics_year']}_Code", + grouped['SectorSourceName'][0], + dfname=self.full_name) # convert to proper industry spec. - fb = fb.sector_aggregation() + fb = grouped.sector_aggregation() # subset the fb configuration so it only includes the # attribution_method currently being assessed - rather than all @@ -907,6 +910,18 @@ def load_prepare_attribution_source( download_sources_ok=download_sources_ok ).prepare_fbs(download_sources_ok=download_sources_ok) + # if the attribution sectorsourcename does not match the FBS method + # target year, convert. This can be the case for a cached data + # source that is loaded from a secondary yaml (see CAP_HAP cached + # source "Detail_Use_Year" + if attribution_fbs['SectorSourceName'][0] != \ + f"NAICS_{self.config['target_naics_year']}_Code": + attribution_fbs = naics.convert_naics_year( + attribution_fbs, + f"NAICS_{self.config['target_naics_year']}_Code", + attribution_fbs['SectorSourceName'][0], + attribution_fbs.full_name) + return attribution_fbs def harmonize_geoscale( diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index 579674138..4bf797395 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -414,12 +414,11 @@ def map_to_sectors( # if activity schema does not match target naics year, # convert sectors to target sectors if activity_schema != f"NAICS_{self.config['target_naics_year']}_Code": - log.info(f"Converting {activity_schema} to NAICS" - f"_{self.config['target_naics_year']}_Code") self = naics.convert_naics_year( self, f"NAICS_{self.config['target_naics_year']}_Code", - activity_schema) + activity_schema, + self.full_name) if self.config.get('sector_hierarchy') == 'parent-completeChild': log.info('NAICS are a mix of parent-completeChild, assigning ' diff --git a/flowsa/naics.py b/flowsa/naics.py index 2d903c2f8..d1605a352 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -322,11 +322,13 @@ def melt_naics_crosswalk(targetsectorsourcename): return cw_replacement_2 -def convert_naics_year(df_load, targetsectorsourcename, sectorsourcename): +def convert_naics_year(df_load, targetsectorsourcename, sectorsourcename, + dfname): """ Replace any non sectors with sectors. :param df_load: df with sector columns or sector-like activities :param sectorsourcename: str, sector source name (ex. NAICS_2012_Code) + :param dfname: str, name of data source :return: df, with non-sectors replaced with sectors """ # todo: update this function to work better with recursive method @@ -337,7 +339,8 @@ def convert_naics_year(df_load, targetsectorsourcename, sectorsourcename): cw_load = common.load_crosswalk('NAICS_Crosswalk_TimeSeries')[[ targetsectorsourcename]] else: - log.info(f"Converting {sectorsourcename} to {targetsectorsourcename}") + log.info(f"Converting {sectorsourcename} to " + f"{targetsectorsourcename} in {dfname}") cw_load = common.load_crosswalk('NAICS_Crosswalk_TimeSeries')[[ targetsectorsourcename, sectorsourcename]] cw = cw_load[targetsectorsourcename].drop_duplicates().tolist() From 25ce7fe1a173fa1b470e6878b0f5455fba09d9d9 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 17 Oct 2023 11:40:15 -0600 Subject: [PATCH 1052/1127] clarify log statement naics year --- flowsa/flowbyactivity.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index 4bf797395..90e56cc1f 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -616,8 +616,8 @@ def map_to_sectors( .drop_duplicates() ) - log.info('Mapping activities in %s to NAICS codes using ' - 'crosswalk', self.full_name) + log.info(f"Mapping activities in {self.full_name} to NAICS" + f"_{self.config['target_naics_year']}_Code using crosswalk") fba_w_naics = self for direction in ['ProducedBy', 'ConsumedBy']: fba_w_naics = ( From 435a5dd31606ae9a5f6d5def8a378c8203f3fa80 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Tue, 17 Oct 2023 11:40:56 -0600 Subject: [PATCH 1053/1127] include new parameter for convert_naics_year() --- flowsa/data_source_scripts/stewiFBS.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flowsa/data_source_scripts/stewiFBS.py b/flowsa/data_source_scripts/stewiFBS.py index 70f737314..9a9bb36c6 100644 --- a/flowsa/data_source_scripts/stewiFBS.py +++ b/flowsa/data_source_scripts/stewiFBS.py @@ -325,7 +325,8 @@ def prepare_stewi_fbs(df_load, config) -> 'FlowBySector': .assign(ActivityConsumedBy=np.nan) .pipe(convert_naics_year, f"NAICS_{config['target_naics_year']}_Code", - activity_schema) + activity_schema, + config.get('full_name')) .assign(FlowType=lambda x: np.where( x['SourceName']=='RCRAInfo', 'WASTE_FLOW', 'ELEMENTARY_FLOW')) From 0147f9ad79ee96d26894f5fbe48f84f52109e3f7 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 18 Oct 2023 12:05:04 -0600 Subject: [PATCH 1054/1127] temp add develop branches back to backpull 2.0 branch into develop/state ghgi --- requirements.txt | 6 +++--- setup.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/requirements.txt b/requirements.txt index 71c0b0fa9..7a3b5c6e9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git#egg=fedelemflowlist -git+https://github.com/USEPA/esupy.git#egg=esupy -git+https://github.com/USEPA/standardizedinventories.git#egg=StEWI +git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git@develop#egg=fedelemflowlist +git+https://github.com/USEPA/esupy.git@develop#egg=esupy +git+https://github.com/USEPA/standardizedinventories.git@develop#egg=StEWI appdirs >= 1.4.3 # Storing user data bibtexparser>=1.2.0 # Generates bibtex kaleido == 0.1.0.post1; platform_system == "Windows" # export plotly.py figures as static images diff --git a/setup.py b/setup.py index 2d2ba627f..93798c315 100644 --- a/setup.py +++ b/setup.py @@ -12,9 +12,9 @@ include_package_data=True, python_requires=">=3.9", install_requires=[ - 'fedelemflowlist @ git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git#egg=fedelemflowlist', - 'esupy @ git+https://github.com/USEPA/esupy.git#egg=esupy', - 'StEWI @ git+https://github.com/USEPA/standardizedinventories.git#egg=StEWI', + 'fedelemflowlist @ git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git@develop#egg=fedelemflowlist', + 'esupy @ git+https://github.com/USEPA/esupy.git@develop#egg=esupy', + 'StEWI @ git+https://github.com/USEPA/standardizedinventories.git@develop#egg=StEWI', 'appdirs>=1.4.3', 'bibtexparser>=1.2.0', "kaleido==0.1.0.post1;platform_system=='Windows'", From 7d144934c3cf8e8e658566e44adf841f102cfa34 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 18 Oct 2023 12:33:46 -0600 Subject: [PATCH 1055/1127] drop develop from package requirements --- requirements.txt | 6 +++--- setup.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/requirements.txt b/requirements.txt index 7a3b5c6e9..71c0b0fa9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git@develop#egg=fedelemflowlist -git+https://github.com/USEPA/esupy.git@develop#egg=esupy -git+https://github.com/USEPA/standardizedinventories.git@develop#egg=StEWI +git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git#egg=fedelemflowlist +git+https://github.com/USEPA/esupy.git#egg=esupy +git+https://github.com/USEPA/standardizedinventories.git#egg=StEWI appdirs >= 1.4.3 # Storing user data bibtexparser>=1.2.0 # Generates bibtex kaleido == 0.1.0.post1; platform_system == "Windows" # export plotly.py figures as static images diff --git a/setup.py b/setup.py index 93798c315..2d2ba627f 100644 --- a/setup.py +++ b/setup.py @@ -12,9 +12,9 @@ include_package_data=True, python_requires=">=3.9", install_requires=[ - 'fedelemflowlist @ git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git@develop#egg=fedelemflowlist', - 'esupy @ git+https://github.com/USEPA/esupy.git@develop#egg=esupy', - 'StEWI @ git+https://github.com/USEPA/standardizedinventories.git@develop#egg=StEWI', + 'fedelemflowlist @ git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git#egg=fedelemflowlist', + 'esupy @ git+https://github.com/USEPA/esupy.git#egg=esupy', + 'StEWI @ git+https://github.com/USEPA/standardizedinventories.git#egg=StEWI', 'appdirs>=1.4.3', 'bibtexparser>=1.2.0', "kaleido==0.1.0.post1;platform_system=='Windows'", From e81dd0f0a7946430d31413c3a5bc6a3fbe1d930a Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 19 Oct 2023 09:00:51 -0400 Subject: [PATCH 1056/1127] fix quotation mark issue --- flowsa/flowbyactivity.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index 27ca10062..5af12a446 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -204,9 +204,10 @@ def map_to_fedefl_list( f'{list(mapping.TargetUnit.unique())} by mapping to ' f'federal elementary flow list') if any(mapped_fba.mapped == 'left_only'): - log.warning(f"Some units not standardized by mapping to federal " - f"elementary flows list: " - f"{list(mapped_fba.query('mapped == left_only').Unit.unique())}") + log.warning('Some units not standardized by mapping to federal ' + 'elementary flows list: %s', + list(mapped_fba + .query('mapped == "left_only"').Unit.unique())) return mapped_fba.drop(columns='mapped') From ff6e670616f361c3a94f9766d449b6cbdb4a2ace Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 19 Oct 2023 09:52:17 -0400 Subject: [PATCH 1057/1127] update 2020 GHG fbs to use Detail_Use tables --- .../GHG_national_2020_m1.yaml | 133 ++++++++--- .../GHG_national_2020_m2.yaml | 189 ++++++++++++++- .../GHG_national_m1_common.yaml | 165 ++++++------- .../GHG_national_m2_common.yaml | 225 ++++++++---------- 4 files changed, 458 insertions(+), 254 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml index e29f4dea5..2a044c71b 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml @@ -13,11 +13,54 @@ _industrial_allocation_dict: &industrial_dict year: *mecs_year ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table +sources_to_cache: + Detail_Use_2020: + !include:Detail_Use.yaml + year: *ghgi_year + source_names: + BEA_Summary_Use_SUT: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + year: *ghgi_year + source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + electric_power: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power + attribution_source: + Detail_Use_2020: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power:attribution_source:Detail_Use_YEAR + liming: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming + attribution_source: + Detail_Use_2020: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming:attribution_source:Detail_Use_YEAR + urea: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea + attribution_source: + Detail_Use_2020: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea:attribution_source:Detail_Use_YEAR + urea_fertilizer: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer + attribution_source: + Detail_Use_2020: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer:attribution_source:Detail_Use_YEAR + carbonate_use: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use + attribution_source: + Detail_Use_2020: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use:attribution_source:Detail_Use_YEAR + nitrous_oxide_use: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use + attribution_source: + Detail_Use_2020: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use:attribution_source:Detail_Use_YEAR + + "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year @@ -59,8 +102,8 @@ source_names: petroleum_fuels: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + BEA_Summary_Use_SUT: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:BEA_Summary_Use_SUT year: *ghgi_year "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion @@ -71,45 +114,41 @@ source_names: petroleum_fuels_diesel: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + BEA_Summary_Use_SUT: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:BEA_Summary_Use_SUT year: *ghgi_year petroleum_fuels_gasoline: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + BEA_Summary_Use_SUT: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:BEA_Summary_Use_SUT year: *ghgi_year - construction_and_mining: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2020: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:Detail_Use_YEAR farm_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2020: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:Detail_Use_YEAR other_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + BEA_Summary_Use_SUT: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:BEA_Summary_Use_SUT year: *ghgi_year alt_fuel_on_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2020: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:Detail_Use_YEAR "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 @@ -125,6 +164,24 @@ source_names: "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets + refrigerants: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants + attribution_source: + Detail_Use_2020: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants:attribution_source:Detail_Use_YEAR + air_conditioning: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning + attribution_source: + Detail_Use_2020: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning:attribution_source:Detail_Use_YEAR + foams: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams + attribution_source: + Detail_Use_2020: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams:attribution_source:Detail_Use_YEAR + "EPA_GHGI_T_A_97": # HFCs from Transportation !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 @@ -155,8 +212,8 @@ source_names: transportation_lubricants: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + BEA_Summary_Use_SUT: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:BEA_Summary_Use_SUT year: *ghgi_year @@ -167,12 +224,17 @@ source_names: clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS and BEA year for some activity_sets !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + + non_manufacturing_coal: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal + attribution_source: + Detail_Use_2020: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal:attribution_source:Detail_Use_YEAR non_manufacturing_natural_gas: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2020: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:Detail_Use_YEAR coal_manufacturing_co2: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 @@ -190,8 +252,8 @@ source_names: petroleum: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + BEA_Summary_Use_SUT: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:BEA_Summary_Use_SUT year: *ghgi_year "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion @@ -201,18 +263,29 @@ source_names: activity_sets: # Update EIA_MECS and BEA year for some activity_sets !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + electric_power: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power + attribution_source: + Detail_Use_2020: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power:attribution_source:Detail_Use_YEAR + fuel_oil: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:BEA_Summary_Use_PRO_BeforeRedef + BEA_Summary_Use_SUT: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:BEA_Summary_Use_SUT year: *ghgi_year + natural_gas_nonmanufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2020: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:Detail_Use_YEAR + coal_nonmanufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing + attribution_source: + Detail_Use_2020: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing:attribution_source:Detail_Use_YEAR coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml index 17d2ab09b..bedf18d4f 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml @@ -9,6 +9,15 @@ ghgi_year: &ghgi_year 2020 mecs_year: &mecs_year 2018 usgs_year: &usgs_year 2019 # 2020 FBA not yet available +sources_to_cache: + Detail_Use_2020: + !include:Detail_Use.yaml + year: *ghgi_year + source_names: + BEA_Summary_Use_SUT: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + year: *ghgi_year + source_names: GHG_national_2020_m1: # National Summary model !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1 @@ -16,47 +25,215 @@ source_names: activity_sets: # Update MECS year for some activity sets !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets + liming: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:liming + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:liming:attribution_source:Detail_Use_YEAR + + urea: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea:attribution_source:Detail_Use_YEAR + + urea_fertilizer: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer:attribution_source:Detail_Use_YEAR + + carbonate_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use:attribution_source:Detail_Use_YEAR + + nitrous_oxide_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use:attribution_source:Detail_Use_YEAR + + fertilizer_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use:attribution_source:Detail_Use_YEAR + + petroleum_fuels: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels:attribution_source:Detail_Use_YEAR + + petroleum_fuels_diesel: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel:attribution_source:Detail_Use_YEAR + + petroleum_fuels_gasoline: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline:attribution_source:Detail_Use_YEAR + + construction_and_mining: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining:attribution_source:Detail_Use_YEAR + + farm_non_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road:attribution_source:Detail_Use_YEAR + + other_non_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:other_non_road + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:other_non_road:attribution_source:Detail_Use_YEAR + + alt_fuel_on_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road:attribution_source:Detail_Use_YEAR + + non_manufacturing_coal: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal:attribution_source:Detail_Use_YEAR + + non_manufacturing_natural_gas: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas:attribution_source:Detail_Use_YEAR + coal_manufacturing_co2: # Industrial Coal for Manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + + petroleum: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum:attribution_source:Detail_Use_YEAR + + electric_power: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power:attribution_source:Detail_Use_YEAR + + fuel_oil: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil:attribution_source:Detail_Use_YEAR + + natural_gas_nonmanufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing:attribution_source:Detail_Use_YEAR + + coal_nonmanufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing:attribution_source:Detail_Use_YEAR coal_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR ng_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR petroleum_neu: # consumed petroleum products !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR natural_gas_neu: # consumed nat gas to chemical plants !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + + transportation_lubricants: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants:attribution_source:Detail_Use_YEAR + + refrigerants: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants:attribution_source:Detail_Use_YEAR + + air_conditioning: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:air_conditioning + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:air_conditioning:attribution_source:Detail_Use_YEAR + + foams: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:foams + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:foams:attribution_source:Detail_Use_YEAR + + magnesium: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium + attribution_source: + Detail_Use_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium:attribution_source:Detail_Use_YEAR EPA_GHGI_T_2_1: #U.S. GHG emissions !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml index 8a278ed8e..89dc434f7 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml @@ -5,42 +5,30 @@ !include:USEEIO_summary_target.yaml -year: &ghg_year 2016 +# year: &ghgi_year 2016 target_naics_year: 2012 geoscale: national -_mecs_year: &mecs_year 2018 +mecs_year: &mecs_year 2018 _attribution_sources: - BEA: &bea_summary - year: *ghg_year - activity_to_sector_mapping: BEA_2012_Summary + BEA_Summary_Use_SUT: &bea_summary + # year: *ghgi_year + activity_to_sector_mapping: BEA_2017_Summary # selection_fields: # ActivityProducedBy: {'324': ''} # Petroleum 324110 exclusion_fields: # Avoid unnecessary warnings about not being mapped to sectors - ActivityConsumedBy: ['F030', 'F040', 'F050', 'F051', - 'F02E', 'F06E', 'F07E', 'F10E', - 'Total Commodity Output', - 'Total Final Uses (GDP)', - 'Total Intermediate'] - ActivityProducedBy: ['Total Commodity Output'] + ActivityConsumedBy: ['F010', 'F02E', 'F02N', 'F02R', 'F02S', + 'F030', 'F040', 'F06C', 'F06E', 'F06N', 'F06S', 'F07C', 'F07E', + 'F07N', 'F07S', 'F10C', 'F10E', 'F10N', 'F10S', + 'T001', 'T019'] + ActivityProducedBy: ['T00OSUB', 'T00OTOP', 'T00SUB', 'T00TOP', 'T018', + 'V001', 'V003', 'VABAS', 'VAPRO', 'T005', + 'Other', 'Used'] attribution_method: equal ## No attribution supplied (will use equal) because target level for ## modeling is BEA summary level. - BEA_detail: &bea_detail - year: 2012 - activity_to_sector_mapping: BEA_2012_Detail - # selection_fields: - # ActivityProducedBy: {'324': ''} # Petroleum 324110 - exclusion_fields: # Avoid unnecessary warnings about not being mapped to sectors - ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', - 'F06E00', 'F07E00', 'F10E00', - 'T001', 'T004', 'T007'] - ActivityProducedBy: ['T007'] - attribution_method: equal - - EIA_MECS_Energy: &mecs_energy year: *mecs_year selection_fields: &mecs_energy_default_selection @@ -56,11 +44,19 @@ _attribution_sources: estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy # attribution_method: proportional # attribution_source: # Include in main method - # BEA_Summary_Use_PRO_BeforeRedef: + # BEA_Summary_Use_SUT: # <<: *bea_summary # selection_fields: # ActivityProducedBy: {'XXXXX': ''} +sources_to_cache: + Detail_Use_YEAR: ## Update year + !include:Detail_Use.yaml + # year: *ghgi_year + source_names: + BEA_Summary_Use_SUT: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + # year: *ghgi_year source_names: EPA_GHGI_T_2_1: #U.S. GHG emissions @@ -109,16 +105,18 @@ source_names: Electric Power Sector: Electric Power #CO2 attribution_method: proportional attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea_detail - primary_action_type: Produced + Detail_Use_YEAR: ## Update year UPDATE TO USE MAKE TABLE selection_fields: - ActivityConsumedBy: {'221100': ''} # Electricity + SectorConsumedBy: {'2211': ''} # Electricity (221100) liming: selection_fields: PrimaryActivity: Liming #CO2 - attribution_method: equal + attribution_method: proportional + attribution_source: + Detail_Use_YEAR: ## Update year + selection_fields: + SectorProducedBy: {'3274': ''} # Lime (327400) urea: selection_fields: @@ -126,25 +124,27 @@ source_names: - Urea Consumption for Non-Agricultural Purposes #CO2 attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea_detail + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'325310': ''} # Chemicals (325310) + SectorProducedBy: {'32531': ''} # Fertilizers (325310) urea_fertilizer: selection_fields: PrimaryActivity: Urea Fertilization #CO2 - attribution_method: equal + attribution_method: proportional + attribution_source: + Detail_Use_YEAR: ## Update year + selection_fields: + SectorProducedBy: {'32531': ''} # Fertilizers (325310) carbonate_use: selection_fields: PrimaryActivity: Other Process Uses of Carbonates #CO2 attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea_detail + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + SectorProducedBy: {'32518': ''} # Other Basic Inorganic Chemicals (325180) lead: selection_fields: @@ -156,10 +156,9 @@ source_names: PrimaryActivity: N2O from Product Uses #N2O attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea_detail + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'325120': ''} # Industrial gases + SectorProducedBy: {'32512': ''} # Industrial gases (325120) ## Fossil Fuels @@ -308,7 +307,7 @@ source_names: Light-Duty Trucks Gasoline: Light-Duty Trucks attribution_method: proportional attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: + BEA_Summary_Use_SUT: <<: *bea_summary selection_fields: ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) @@ -341,7 +340,7 @@ source_names: Medium- and Heavy-Duty Trucks Diesel On-Road: Medium- and Heavy-Duty Trucks - Distillate Fuel Oil attribution_method: proportional attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: + BEA_Summary_Use_SUT: <<: *bea_summary selection_fields: ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) @@ -353,7 +352,7 @@ source_names: Light-Duty Trucks Gasoline On-Road: Light-Duty Trucks attribution_method: proportional attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: + BEA_Summary_Use_SUT: <<: *bea_summary selection_fields: ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) @@ -363,27 +362,25 @@ source_names: PrimaryActivity: Construction/Mining Equipment Non-Road attribution_method: proportional attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea_summary + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'333': ''} # purchases of construction/mining equipment (333120) + SectorProducedBy: {'33312': ''} # purchases of construction/mining equipment (333120) farm_non_road: #this set is allocated by purchases of farm machinery selection_fields: PrimaryActivity: Agricultural Equipment Non-Road attribution_method: proportional attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea_summary + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'333': ''} # purchases of farm machinery (333111) + SectorProducedBy: {'333111': ''} # purchases of farm machinery (333111) other_non_road: #this set is allocated by purchases of petroleum refining selection_fields: PrimaryActivity: Other Non-Road attribution_method: proportional attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: + BEA_Summary_Use_SUT: <<: *bea_summary selection_fields: ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) @@ -394,10 +391,9 @@ source_names: All activities Alternative Fuel On-Road: Alternative Fuel On-Road attribution_method: proportional attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea_summary + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'22': ''} # purchases of natural gas (221200) + SectorProducedBy: {'2212': ''} # purchases of natural gas (221200) EPA_GHGI_T_3_15: *mobile #N2O from mobile combustion duplicates method for CH4 @@ -424,10 +420,9 @@ source_names: Industrial Other Coal Industrial: Coal Industrial attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea_detail + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal (212100) non_manufacturing_natural_gas: # Applies to non-manufacturing sectors like ag and mining selection_fields: @@ -436,10 +431,9 @@ source_names: - Natural Gas Industrial attribution_method: proportional attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea_summary + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'22': ''} # purchases of natural gas (221200) + SectorProducedBy: {'2212': ''} # purchases of natural gas (221200) coal_manufacturing_co2: # Industrial Coal for Manufacturing selection_fields: @@ -455,7 +449,7 @@ source_names: - Coal - Coke and Breeze # attribution_source: TODO do we need attribution of MECS data? - # BEA_Summary_Use_PRO_BeforeRedef: + # BEA_Summary_Use_SUT: # <<: *bea_summary # selection_fields: # ActivityProducedBy: {'212100': ''} # purchases of coal @@ -472,7 +466,7 @@ source_names: <<: *mecs_energy_default_selection FlowName: Natural Gas # attribution_source: - # BEA_Summary_Use_PRO_BeforeRedef: + # BEA_Summary_Use_SUT: # <<: *bea_summary # selection_fields: # ActivityProducedBy: {'221200': ''} # purchases of natural gas @@ -484,7 +478,7 @@ source_names: - Total Petroleum Industrial attribution_method: proportional attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: + BEA_Summary_Use_SUT: <<: *bea_summary selection_fields: ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) @@ -518,11 +512,9 @@ source_names: Wood Electric Power: Wood Electric Power attribution_method: proportional attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea_detail - primary_action_type: Produced + Detail_Use_YEAR: ## Update year UPDATE TO USE MAKE TABLE selection_fields: - ActivityConsumedBy: {'221100': ''} # Electricity + SectorConsumedBy: {'2211': ''} # Electricity (221100) fuel_oil: selection_fields: @@ -531,7 +523,7 @@ source_names: - Fuel Oil Industrial attribution_method: proportional attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: + BEA_Summary_Use_SUT: <<: *bea_summary selection_fields: ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) @@ -545,20 +537,18 @@ source_names: Natural Gas Industrial: Natural Gas Industrial attribution_method: proportional attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - <<: *bea_summary + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'22': ''} # purchases of natural gas (221200) + SectorProducedBy: {'2212': ''} # purchases of natural gas (221200) coal_nonmanufacturing: selection_fields: PrimaryActivity: Coal Industrial attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea_detail + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal (212100) coal_manufacturing: selection_fields: @@ -571,7 +561,7 @@ source_names: <<: *mecs_energy_default_selection FlowName: Coal # attribution_source: - # BEA_Summary_Use_PRO_BeforeRedef: + # BEA_Summary_Use_SUT: # <<: *bea_summary # selection_fields: # ActivityProducedBy: {'212100': ''} # purchases of coal @@ -589,7 +579,7 @@ source_names: <<: *mecs_energy_default_selection FlowName: Natural Gas # attribution_source: - # BEA_Summary_Use_PRO_BeforeRedef: + # BEA_Summary_Use_SUT: # <<: *bea_summary # selection_fields: # ActivityProducedBy: {'221200': ''} # purchases of natural gas @@ -652,7 +642,7 @@ source_names: - Distillate Fuel Oil - Hydrocarbon Gas Liquids, excluding natural gasoline # attribution_source: - # BEA_Summary_Use_PRO_BeforeRedef: + # BEA_Summary_Use_SUT: # <<: *bea_summary # selection_fields: # ActivityProducedBy: {'324110': ''} # purchases of refineries @@ -669,7 +659,7 @@ source_names: FlowName: Natural Gas Unit: Trillion Btu # attribution_source: - # BEA_Summary_Use_PRO_BeforeRedef: + # BEA_Summary_Use_SUT: # <<: *bea_summary # selection_fields: # ActivityProducedBy: {'221200': ''} # purchases of natural gas @@ -679,7 +669,7 @@ source_names: PrimaryActivity: Transportation Lubricants attribution_method: proportional attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: + BEA_Summary_Use_SUT: <<: *bea_summary selection_fields: ActivityProducedBy: {'324': ''} # use of petroleum products (324110) @@ -722,10 +712,9 @@ source_names: - Industrial Process Refrigeration attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea_detail + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'333415': ''} # Air conditioning equipment + SectorProducedBy: {'333415': ''} # Air conditioning equipment air_conditioning: selection_fields: @@ -733,10 +722,9 @@ source_names: - Commercial Stationary Air Conditioning attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea_detail + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'333415': ''} # Air conditioning equipment + SectorProducedBy: {'333415': ''} # Air conditioning equipment foams: selection_fields: @@ -744,12 +732,11 @@ source_names: - Foams attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea_detail + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: - '326140': '' # Polystyrene foam - '326150': '' # Urethane and other foam + SectorProducedBy: + '32614': '' # Polystyrene foam (326140) + '32615': '' # Urethane and other foam (326150) EPA_GHGI_T_A_97: # HFCs from Transportation diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml index 17447ca61..79be7eefd 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml @@ -5,24 +5,12 @@ # the exisiting summary level national FBS (method 1), except where Direct attribution # is available at the detail level and uses the GHGI as the primary source -industry_spec: - default: NAICS_6 -year: &ghgi_year 2019 +!include:BEA_detail_target.yaml +# year: &ghgi_year 2019 target_naics_year: 2012 geoscale: national attribution_sources: - _BEA: &bea - year: 2012 - activity_to_sector_mapping: BEA_2012_Detail - exclusion_fields: - # Drop irrelevant final demand and total sectors - ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', - 'F06E00', 'F07E00', 'F10E00', - 'T001', 'T004', 'T007'] - ActivityProducedBy: ['T007'] - attribution_method: equal - _mecs_energy: EIA_MECS_Energy: &mecs_energy # year: *mecs_year # override this with mecs year @@ -39,10 +27,9 @@ attribution_sources: estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy attribution_method: proportional # attribution_source: # Include in main method - # BEA_Detail_Use_PRO_BeforeRedef: - # <<: *bea + # Detail_Use_YEAR: ## Update year # selection_fields: - # ActivityProducedBy: {'XXXXX': ''} + # SectorProducedBy: {'XXXXX': ''} _cropland_allocation: &cropland_allocation USDA_CoA_Cropland: @@ -70,46 +57,74 @@ attribution_sources: FlowName: FARM OPERATIONS estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution +sources_to_cache: + Detail_Use_YEAR: ## Update year + !include:Detail_Use.yaml + # year: *ghgi_year + source_names: + BEA_Summary_Use_SUT: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + # year: *ghgi_year + source_names: GHG_national_m1: # National Summary model data_format: FBS # year: *ghgi_year activity_sets: ## Table 2.1 + # electricity_transmission handled directly from EPA_GHGI_T_2_1 + electric_power_co2: selection_fields: MetaSources: 'EPA_GHGI_T_2_1.electric_power' attribution_method: equal + liming: + selection_fields: + MetaSources: 'EPA_GHGI_T_2_1.liming' + attribution_method: proportional + attribution_source: + Detail_Use_YEAR: ## Update year + selection_fields: + SectorProducedBy: {'3274': ''} # Lime (327400) + urea: selection_fields: MetaSources: 'EPA_GHGI_T_2_1.urea' attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year + selection_fields: + SectorProducedBy: {'32531': ''} # Fertilizers (325310) + + urea_fertilizer: + selection_fields: + MetaSources: 'EPA_GHGI_T_2_1.urea_fertilizer' + attribution_method: proportional + attribution_source: + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'32531': ''} # Fertilizers (325310) carbonate_use: selection_fields: MetaSources: 'EPA_GHGI_T_2_1.carbonate_use' attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + SectorProducedBy: {'32518': ''} # Other Basic Inorganic Chemicals (325180) + + # lead handled directly from EPA_GHGI_T_2_1 nitrous_oxide_use: selection_fields: MetaSources: 'EPA_GHGI_T_2_1.nitrous_oxide_use' attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'325120': ''} # Industrial gases + SectorProducedBy: {'32512': ''} # Industrial gases (325120) fertilizer_use: # allocated based on fertilizer use @@ -119,10 +134,9 @@ source_names: - 'EPA_GHGI_T_5_18.fertilizer_use' attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'32531': ''} # Fertilizers (325310) cropland: # allocated based on USDA land area harvested selection_fields: @@ -143,10 +157,9 @@ source_names: MetaSources: 'EPA_GHGI_T_3_13.petroleum_fuels' attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products (324110) petroleum_fuels_diesel: selection_fields: @@ -155,10 +168,9 @@ source_names: - 'EPA_GHGI_T_3_15.petroleum_fuels_diesel' attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products (324110) petroleum_fuels_gasoline: selection_fields: @@ -167,10 +179,9 @@ source_names: - 'EPA_GHGI_T_3_15.petroleum_fuels_gasoline' attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products (324110) construction_and_mining: #this set is allocated by purchases of construction equipment selection_fields: @@ -179,10 +190,9 @@ source_names: - 'EPA_GHGI_T_3_15.construction_and_mining' attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment + SectorProducedBy: {'33312': ''} # purchases of construction/mining equipment (333120) farm_non_road: #this set is allocated by purchases of farm machinery selection_fields: @@ -191,10 +201,9 @@ source_names: - 'EPA_GHGI_T_3_15.farm_non_road' attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'333111': ''} # purchases of farm machinery + SectorProducedBy: {'333111': ''} # purchases of farm machinery (333111) other_non_road: #this set is allocated by purchases of petroleum refining selection_fields: @@ -203,10 +212,9 @@ source_names: - 'EPA_GHGI_T_3_15.other_non_road' attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products (324110) alt_fuel_on_road: #this set is allocated by purchases of natural gas selection_fields: @@ -215,10 +223,9 @@ source_names: - 'EPA_GHGI_T_3_15.alt_fuel_on_road' attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas (221200) non_manufacturing_coal: selection_fields: @@ -234,10 +241,9 @@ source_names: - 'EPA_GHGI_T_A_13.non_manufacturing_coal' attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal (212100) non_manufacturing_natural_gas: # Applies to non-manufacturing sectors like ag and mining selection_fields: @@ -253,10 +259,9 @@ source_names: - 'EPA_GHGI_T_A_13.non_manufacturing_natural_gas' attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas (221200) coal_manufacturing_co2: # Industrial Coal for Manufacturing selection_fields: @@ -280,10 +285,9 @@ source_names: - Coal - Coke and Breeze attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal (212100) natural_gas_manufacturing: # Industrial Natural Gas for manufacturing selection_fields: @@ -305,10 +309,9 @@ source_names: <<: *mecs_energy_default_selection FlowName: Natural Gas attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas (221200) petroleum: # Petroleum selection_fields: @@ -324,10 +327,9 @@ source_names: - 'EPA_GHGI_T_A_13.petroleum' attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products (324110) electric_power: selection_fields: @@ -336,10 +338,9 @@ source_names: - 'EPA_GHGI_T_3_9.electric_power' attribution_method: proportional attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year UPDATE TO USE MAKE TABLE selection_fields: - ActivityConsumedBy: {'221100': ''} # Electricity + SectorConsumedBy: {'2211': ''} # Electricity (221100) fuel_oil: selection_fields: MetaSources: @@ -347,10 +348,9 @@ source_names: - 'EPA_GHGI_T_3_9.fuel_oil' attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products (324110) natural_gas_nonmanufacturing: # Commercial Natural gas selection_fields: @@ -359,10 +359,9 @@ source_names: - 'EPA_GHGI_T_3_9.natural_gas_nonmanufacturing' attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas (221200) coal_nonmanufacturing: selection_fields: @@ -371,10 +370,9 @@ source_names: - 'EPA_GHGI_T_3_9.coal_nonmanufacturing' attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal (212100) coal_manufacturing: selection_fields: @@ -389,10 +387,9 @@ source_names: <<: *mecs_energy_default_selection FlowName: Coal attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal (212100) ng_manufacturing: selection_fields: @@ -407,10 +404,9 @@ source_names: <<: *mecs_energy_default_selection FlowName: Natural Gas attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas (221200) petroleum_neu: # consumed petroleum products selection_fields: @@ -429,10 +425,9 @@ source_names: - Distillate Fuel Oil - Hydrocarbon Gas Liquids, excluding natural gasoline attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refineries + SectorProducedBy: {'32411': ''} # purchases of refinery products (324110) natural_gas_neu: # consumed nat gas to chemical plants selection_fields: @@ -448,10 +443,9 @@ source_names: FlowName: Natural Gas Unit: Trillion Btu attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas (221200) transportation_lubricants: selection_fields: @@ -460,10 +454,9 @@ source_names: - 'EPA_GHGI_T_3_22b.transportation_lubricants' attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'324110': ''} # use of petroleum products + SectorProducedBy: {'32411': ''} # purchases of refinery products (324110) refrigerants: @@ -471,42 +464,39 @@ source_names: MetaSources: 'EPA_GHGI_T_4_102.refrigerants' attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'333415': ''} # Air conditioning equipment + SectorProducedBy: {'333415': ''} # Air conditioning equipment air_conditioning: selection_fields: MetaSources: 'EPA_GHGI_T_4_102.air_conditioning' attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'333415': ''} # Air conditioning equipment + SectorProducedBy: {'333415': ''} # Air conditioning equipment foams: selection_fields: MetaSources: 'EPA_GHGI_T_4_102.foams' attribution_method: proportional attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: - '326140': '' # Polystyrene foam - '326150': '' # Urethane and other foam + SectorProducedBy: + '32614': '' # Polystyrene foam (326140) + '32615': '' # Urethane and other foam (326150) + magnesium: selection_fields: MetaSources: 'EPA_GHGI_T_4_86' attribution_method: proportional attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea + Detail_Use_YEAR: ## Update year UPDATE TO USE GROSS OUTPUT selection_fields: - ActivityConsumedBy: {T008: ''} # Total Output + SectorConsumedBy: {'T008': ''} # Total Output ## For tables requiring direct attribution, reattribute the original GHGI @@ -520,29 +510,6 @@ source_names: electricity_transmission: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electricity_transmission - # replace equal attribution in summary model - liming: - selection_fields: - PrimaryActivity: Liming #CO2 - attribution_method: proportional - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'327400': ''} # Lime - - # replace equal attribution in summary model - urea_fertilizer: - selection_fields: - PrimaryActivity: - - Urea Fertilization #CO2 - attribution_method: proportional - attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea - selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers - # replace equal attribution in summary model lead: selection_fields: From e45eb1eeb77369d64c0c9ea31bcecf40268039d4 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 19 Oct 2023 09:47:24 -0600 Subject: [PATCH 1058/1127] don't specify group_id because need diff ids for each location - therefore reset group_id at end of each land activity set attribution. Adds validation fxn specific to land attribution --- flowsa/data_source_scripts/USDA_ERS_MLU.py | 141 ++++++++++++++------- 1 file changed, 93 insertions(+), 48 deletions(-) diff --git a/flowsa/data_source_scripts/USDA_ERS_MLU.py b/flowsa/data_source_scripts/USDA_ERS_MLU.py index f00441bc1..a67fa81e1 100644 --- a/flowsa/data_source_scripts/USDA_ERS_MLU.py +++ b/flowsa/data_source_scripts/USDA_ERS_MLU.py @@ -88,6 +88,53 @@ def mlu_parse(*, df_list, source, year, **_): return dfm3 +def attribute_transportation_sector_fees_to_target_sectors(fba, sector_col): + """ + Equally attribute highway fees to all the sectors the fees are mapped to + :param fba: + :param sector_col: + :return: + """ + fha_dict = get_transportation_sectors_based_on_FHA_fees() + df_fha = pd.DataFrame.from_dict(fha_dict, orient='index') + # map to target sectors + naics_key = industry_spec_key(fba.config['industry_spec'], + fba.config['target_naics_year']) + df_fha = (df_fha + .merge(naics_key, how='left', left_on='NAICS_2012_Code', + right_on='source_naics') + .drop(columns=['source_naics']) + .rename(columns={'target_naics': sector_col}) + ) + # equally attribute the shareoffees to all mapped sectors + df_fha2 = (df_fha + .assign(count=lambda x: x.groupby('NAICS_2012_Code')['NAICS_2012_Code'].transform('count')) + .assign(ShareOfFees=lambda x: x['ShareOfFees']/x['count']) + .drop(columns=['NAICS_2012_Code', 'count']) + ) + return df_fha2 + + +def validate_land_attribution(fba, attributed_fba): + """ + Function specific to validating the land attribution methods, as data + is dropped + :param fba: + :param attributed_fba: + :return: + """ + fbsum = (fba[['group_id', 'group_total']] + .drop_duplicates())['group_total'].sum() + attsum = attributed_fba['FlowAmount'].sum() + percent_change = round(((attsum - fbsum)/fbsum)*100,3) + if percent_change == 0: + log.info(f"No change in {fba.full_name} FlowAmount after " + "attribution.") + else: + log.warning(f"Percent change in {fba.full_name} after " + f"attribution is {percent_change}%") + + def allocate_usda_ers_mlu_land_in_urban_areas( fba: FlowByActivity, **_) -> FlowByActivity: """ @@ -122,19 +169,8 @@ def allocate_usda_ers_mlu_land_in_urban_areas( mecs = _['attr']['cache']['EIA_MECS_Land'] # load the federal highway administration fees dictionary - fha_dict = get_transportation_sectors_based_on_FHA_fees() - df_fha = pd.DataFrame.from_dict(fha_dict, orient='index') - # set new group_id column - df_fha = df_fha.assign(group_id=range(4, len(df_fha) + 4)) - # map to target sectors - naics_key = industry_spec_key(fba.config['industry_spec'], - fba.config['target_naics_year']) - df_fha = (df_fha - .merge(naics_key, how='left', left_on='NAICS_2012_Code', - right_on='source_naics') - .drop(columns=['NAICS_2012_Code', 'source_naics']) - .rename(columns={'target_naics': sector_col}) - ) + df_fha = attribute_transportation_sector_fees_to_target_sectors( + fba, sector_col) # calculate total residential area from the American Housing Survey residential_land_area = get_area_of_urban_land_occupied_by_houses_2013() @@ -150,15 +186,12 @@ def allocate_usda_ers_mlu_land_in_urban_areas( ) else: df_residential = df_residential.assign(FlowAmount=residential_land_area) - df_residential['group_id'] = 0 # make an assumption about the percent of urban area that is open space openspace_multiplier = get_open_space_fraction_of_urban_area() df_openspace = fba[fba[sector_col] == '712190'] df_openspace = df_openspace.assign( FlowAmount=df_openspace['FlowAmount'] * openspace_multiplier) - # reset gorup_id - df_openspace['group_id'] = 1 # sum all uses of urban area that are NOT transportation # first concat dfs for residential, openspace, commercial, @@ -186,8 +219,6 @@ def allocate_usda_ers_mlu_land_in_urban_areas( df_airport = df_transport[df_transport[sector_col] == '488119'] df_airport = df_airport.assign( FlowAmount=df_airport['FlowAmount'] * airport_multiplier) - # reset gorup_id - df_airport['group_id'] = 2 # make an assumption about the percent of urban transport # area used by railroads @@ -195,8 +226,6 @@ def allocate_usda_ers_mlu_land_in_urban_areas( df_railroad = df_transport[df_transport[sector_col] == '482112'] df_railroad = df_railroad.assign( FlowAmount=df_railroad['FlowAmount'] * railroad_multiplier) - # reset gorup_id - df_railroad['group_id'] = 3 # further allocate the remaining urban transportation area using # Federal Highway Administration fees @@ -210,7 +239,7 @@ def allocate_usda_ers_mlu_land_in_urban_areas( df_highway = df_transport.merge(air_rail_area_sum, how='left') df_highway = df_highway.assign( FlowAmount=df_highway['FlowAmount'] - df_highway['AirRail']) - df_highway.drop(columns=['AirRail', 'group_id'], inplace=True) + df_highway.drop(columns=['AirRail'], inplace=True) # add fed highway administration fees df_highway2 = df_highway.merge(df_fha, how='left') @@ -224,8 +253,20 @@ def allocate_usda_ers_mlu_land_in_urban_areas( [df_residential, df_openspace, df_airport, df_railroad, df_highway2], ignore_index=True, sort=False).reset_index(drop=True) - return allocated_urban_areas_df.drop(columns=['rurl_res', 'total_area'], - errors='ignore') + # reset the group id and the group_total + allocated_urban_areas_df = ( + allocated_urban_areas_df + .drop(columns=['group_id', 'group_total', 'rurl_res', 'total_area'], + errors='ignore') + .reset_index(drop=True).reset_index() + .rename(columns={'index': 'group_id'}) + .assign(group_total=allocated_urban_areas_df.FlowAmount) + ) + + # calculate the percent change in df caused by attribution + validate_land_attribution(fba, allocated_urban_areas_df) + + return allocated_urban_areas_df def allocate_usda_ers_mlu_land_in_rural_transportation_areas( @@ -254,19 +295,8 @@ def allocate_usda_ers_mlu_land_in_rural_transportation_areas( sector_col = 'SectorConsumedBy' # load the federal highway administration fees dictionary - fha_dict = get_transportation_sectors_based_on_FHA_fees() - df_fha = pd.DataFrame.from_dict(fha_dict, orient='index') - # set new group_id column - df_fha = df_fha.assign(group_id=range(2, len(df_fha) + 2)) - # map to target sectors - naics_key = industry_spec_key(fba.config['industry_spec'], - fba.config['tareg_naics_year']) - df_fha = (df_fha - .merge(naics_key, how='left', left_on='NAICS_2012_Code', - right_on='source_naics') - .drop(columns=['NAICS_2012_Code', 'source_naics']) - .rename(columns={'target_naics': sector_col}) - ) + df_fha = attribute_transportation_sector_fees_to_target_sectors( + fba, sector_col) # make an assumption about the percent of rural transport # area used by airports @@ -281,8 +311,6 @@ def allocate_usda_ers_mlu_land_in_rural_transportation_areas( df_railroad = fba[fba[sector_col] == '482112'] df_railroad = df_railroad.assign( FlowAmount=df_railroad['FlowAmount'] * railroad_multiplier) - # reset gorup_id - df_railroad['group_id'] = 1 # further allocate the remaining urban transportation area # using Federal Highway Administration fees @@ -298,7 +326,7 @@ def allocate_usda_ers_mlu_land_in_rural_transportation_areas( df_highway = fba.merge(air_rail_area_sum, how='left') df_highway = df_highway.assign( FlowAmount=df_highway['FlowAmount'] - df_highway['AirRail']) - df_highway.drop(columns=['AirRail', 'group_id'], inplace=True) + df_highway.drop(columns=['AirRail'], inplace=True) # add fed highway administration fees df_highway2 = df_highway.merge(df_fha, how='left') @@ -311,6 +339,18 @@ def allocate_usda_ers_mlu_land_in_rural_transportation_areas( allocated_rural_trans = pd.concat( [df_airport, df_railroad, df_highway2], sort=False, ignore_index=True) + # reset the group id and the group_total + allocated_rural_trans = ( + allocated_rural_trans + .drop(columns=['group_id', 'group_total']) + .reset_index(drop=True).reset_index() + .rename(columns={'index': 'group_id'}) + .assign(group_total=allocated_rural_trans.FlowAmount) + ) + + # calculate the percent change in df caused by attribution + validate_land_attribution(fba, allocated_rural_trans) + return allocated_rural_trans @@ -348,17 +388,22 @@ def allocate_usda_ers_mlu_other_land( # if it is state data, take weighted avg using land area if fba.config['geoscale'] == 'state': - fba = (fba - .assign(rural_res=rural_res, - total_area=fba['FlowAmount'].sum(), - FlowAmount=lambda x: x['FlowAmount']/x[ + fba2 = (fba + .assign(rural_res=rural_res, + total_area=fba['FlowAmount'].sum(), + FlowAmount=lambda x: x['FlowAmount']/x[ 'total_area'] * x['rural_res'] - ) - ) + ) + ) # in df, where sector is a personal expenditure value, and # location = 00000, replace with rural res value elif fba.config['geoscale'] == 'national': - fba['FlowAmount'] = np.where(fba['SectorConsumedBy'].isin(household), - rural_res, fba['FlowAmount']) + fba2 = fba.assign(FlowAmount=np.where(fba['SectorConsumedBy'].isin( + household), rural_res, fba['FlowAmount'])) + else: + log.error('Geograpic level is not supported - function is written ' + 'for state and national levels.') + + validate_land_attribution(fba, fba2) - return fba.drop(columns=['rural_res', 'total_area'], errors='ignore') + return fba2.drop(columns=['rural_res', 'total_area'], errors='ignore') From db1bd25a730b0db6e82ff9738ec5a68747c274be Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 19 Oct 2023 12:59:35 -0400 Subject: [PATCH 1059/1127] for cached attribution sources, `prepare_fbs()` during `load_prepare_attribution_source()` in order to access `select_by_fields()`; grab higher level config to replace that in the attribution config; when replacing an activity with blanks, assign as na to avoid errors later --- flowsa/flowby.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index d7da73609..599b1ee51 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -521,6 +521,11 @@ def select_by_fields( errors='ignore') .reset_index(drop=True) ) + # Reset blank values to nan + for k in replace_dict.keys(): + if all(replaced_fb[k] == ''): + replaced_fb[k] = np.nan + return replaced_fb def aggregate_flowby( @@ -564,7 +569,9 @@ def aggregate_flowby( if c not in ['FlowAmount', *columns_to_average, *columns_to_group_by]]) - + if len(self) == 0: + log.warning('Error, dataframe is empty') + return self aggregated = ( fb .assign(**{f'_{c}_weighted': fb[c] * fb.FlowAmount @@ -860,7 +867,7 @@ def activity_sets(self) -> List['FB']: return child_df_list def load_prepare_attribution_source( - self: 'FlowByActivity', + self: FB, attribution_config=None, download_sources_ok: bool = True ) -> 'FlowBySector': @@ -880,9 +887,14 @@ def load_prepare_attribution_source( attribution_fbs.config = { **{k: attribution_fbs.config[k] for k in attribution_fbs.config['method_config_keys']}, + **{k: v for k, v in self.config.items() + if k in self.config['method_config_keys']}, **get_catalog_info(name), - **config + **config, + 'data_format': 'FBS' } + attribution_fbs = attribution_fbs.prepare_fbs( + download_sources_ok=download_sources_ok) else: attribution_fbs = get_flowby_from_config( name=name, From f86de26cda2b30b4d89a2f7d997be8cfc76edfa2 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 19 Oct 2023 14:45:10 -0400 Subject: [PATCH 1060/1127] use detail use table in all cases instead of summary table --- .../GHG_national_2020_m1.yaml | 35 +++++------- .../GHG_national_m1_common.yaml | 55 +++++-------------- 2 files changed, 29 insertions(+), 61 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml index 2a044c71b..d95a28ecb 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml @@ -102,9 +102,8 @@ source_names: petroleum_fuels: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels attribution_source: - BEA_Summary_Use_SUT: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:BEA_Summary_Use_SUT - year: *ghgi_year + Detail_Use_2020: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:Detail_Use_2020 "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 @@ -114,16 +113,14 @@ source_names: petroleum_fuels_diesel: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel attribution_source: - BEA_Summary_Use_SUT: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:BEA_Summary_Use_SUT - year: *ghgi_year + Detail_Use_2020: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:Detail_Use_YEAR petroleum_fuels_gasoline: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline attribution_source: - BEA_Summary_Use_SUT: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:BEA_Summary_Use_SUT - year: *ghgi_year + Detail_Use_2020: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:Detail_Use_YEAR construction_and_mining: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining @@ -140,9 +137,8 @@ source_names: other_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road attribution_source: - BEA_Summary_Use_SUT: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:BEA_Summary_Use_SUT - year: *ghgi_year + Detail_Use_2020: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:Detail_Use_YEAR alt_fuel_on_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road @@ -212,9 +208,8 @@ source_names: transportation_lubricants: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants attribution_source: - BEA_Summary_Use_SUT: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:BEA_Summary_Use_SUT - year: *ghgi_year + Detail_Use_2020: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:Detail_Use_YEAR ### Major CO2 Sources @@ -252,9 +247,8 @@ source_names: petroleum: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum attribution_source: - BEA_Summary_Use_SUT: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:BEA_Summary_Use_SUT - year: *ghgi_year + Detail_Use_2020: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:Detail_Use_YEAR "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 @@ -272,9 +266,8 @@ source_names: fuel_oil: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil attribution_source: - BEA_Summary_Use_SUT: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:BEA_Summary_Use_SUT - year: *ghgi_year + Detail_Use_2020: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:Detail_Use_YEAR natural_gas_nonmanufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml index 89dc434f7..9c3a2ac02 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml @@ -12,23 +12,6 @@ geoscale: national mecs_year: &mecs_year 2018 _attribution_sources: - BEA_Summary_Use_SUT: &bea_summary - # year: *ghgi_year - activity_to_sector_mapping: BEA_2017_Summary - # selection_fields: - # ActivityProducedBy: {'324': ''} # Petroleum 324110 - exclusion_fields: # Avoid unnecessary warnings about not being mapped to sectors - ActivityConsumedBy: ['F010', 'F02E', 'F02N', 'F02R', 'F02S', - 'F030', 'F040', 'F06C', 'F06E', 'F06N', 'F06S', 'F07C', 'F07E', - 'F07N', 'F07S', 'F10C', 'F10E', 'F10N', 'F10S', - 'T001', 'T019'] - ActivityProducedBy: ['T00OSUB', 'T00OTOP', 'T00SUB', 'T00TOP', 'T018', - 'V001', 'V003', 'VABAS', 'VAPRO', 'T005', - 'Other', 'Used'] - attribution_method: equal - ## No attribution supplied (will use equal) because target level for - ## modeling is BEA summary level. - EIA_MECS_Energy: &mecs_energy year: *mecs_year selection_fields: &mecs_energy_default_selection @@ -307,11 +290,9 @@ source_names: Light-Duty Trucks Gasoline: Light-Duty Trucks attribution_method: proportional attribution_source: - BEA_Summary_Use_SUT: - <<: *bea_summary + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) - + SectorProducedBy: {'32411': ''} # purchases of refinery products (324110) EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion fedefl_mapping: GHGI @@ -340,10 +321,9 @@ source_names: Medium- and Heavy-Duty Trucks Diesel On-Road: Medium- and Heavy-Duty Trucks - Distillate Fuel Oil attribution_method: proportional attribution_source: - BEA_Summary_Use_SUT: - <<: *bea_summary + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) + SectorProducedBy: {'32411': ''} # purchases of refinery products (324110) petroleum_fuels_gasoline: selection_fields: @@ -352,10 +332,9 @@ source_names: Light-Duty Trucks Gasoline On-Road: Light-Duty Trucks attribution_method: proportional attribution_source: - BEA_Summary_Use_SUT: - <<: *bea_summary + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) + SectorProducedBy: {'32411': ''} # purchases of refinery products (324110) construction_and_mining: #this set is allocated by purchases of construction equipment selection_fields: @@ -380,10 +359,9 @@ source_names: PrimaryActivity: Other Non-Road attribution_method: proportional attribution_source: - BEA_Summary_Use_SUT: - <<: *bea_summary + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) + SectorProducedBy: {'32411': ''} # purchases of refinery products (324110) alt_fuel_on_road: #this set is allocated by purchases of natural gas selection_fields: @@ -478,10 +456,9 @@ source_names: - Total Petroleum Industrial attribution_method: proportional attribution_source: - BEA_Summary_Use_SUT: - <<: *bea_summary + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) + SectorProducedBy: {'32411': ''} # purchases of refinery products (324110) EPA_GHGI_T_3_8: &stationary_combustion # CH4 emissions from stationary combustion @@ -512,7 +489,7 @@ source_names: Wood Electric Power: Wood Electric Power attribution_method: proportional attribution_source: - Detail_Use_YEAR: ## Update year UPDATE TO USE MAKE TABLE + Detail_Use_YEAR: ## Update year UPDATE TO USE SUPPLY TABLE selection_fields: SectorConsumedBy: {'2211': ''} # Electricity (221100) @@ -523,10 +500,9 @@ source_names: - Fuel Oil Industrial attribution_method: proportional attribution_source: - BEA_Summary_Use_SUT: - <<: *bea_summary + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'324': ''} # purchases of refinery products (324110) + SectorProducedBy: {'32411': ''} # purchases of refinery products (324110) natural_gas_nonmanufacturing: # Commercial Natural gas selection_fields: @@ -669,10 +645,9 @@ source_names: PrimaryActivity: Transportation Lubricants attribution_method: proportional attribution_source: - BEA_Summary_Use_SUT: - <<: *bea_summary + Detail_Use_YEAR: ## Update year selection_fields: - ActivityProducedBy: {'324': ''} # use of petroleum products (324110) + SectorProducedBy: {'32411': ''} # purchases of refinery products (324110) ## Other Emissions EPA_GHGI_T_4_50: # HFCs from HCFC-22 production From f23a70cb17d0528ad8ea6d51b9ea6a9914774e2e Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 19 Oct 2023 14:49:53 -0400 Subject: [PATCH 1061/1127] add Detail Supply table and use for electric power --- .../flowbysectormethods/Detail_Supply.yaml | 48 +++++++++++++++++++ .../GHG_national_2020_m1.yaml | 16 +++++-- .../GHG_national_m1_common.yaml | 12 ++++- 3 files changed, 70 insertions(+), 6 deletions(-) create mode 100644 flowsa/methods/flowbysectormethods/Detail_Supply.yaml diff --git a/flowsa/methods/flowbysectormethods/Detail_Supply.yaml b/flowsa/methods/flowbysectormethods/Detail_Supply.yaml new file mode 100644 index 000000000..90f58d705 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/Detail_Supply.yaml @@ -0,0 +1,48 @@ +# This method disaggregates a Summary Supply table for target use based on the +# 2017 Detail Supply table. The resulting tables do not reflect valid balanced +# Supply tables + +# The full FBS for any year can be cached using: +# sources_to_cache: +# Detail_Supply_2019: +# !include:Detail_Supply.yaml +# year: *year +# source_names: +# BEA_Summary_Supply: +# !include:Detail_Supply.yaml:source_names:BEA_Summary_Supply +# year: *year + +!include:BEA_detail_target.yaml +year: &summary_year 2018 +target_naics_year: 2017 +geoscale: national + +data_format: FBS +activity_schema: NAICS_2017_Code # <- necessary? (long term just look at the FBS) + +source_names: + BEA_Summary_Supply: + geoscale: national + year: *summary_year + activity_to_sector_mapping: BEA_2017_Summary + primary_action_type: Consumed # speeds processing + + # Drop unneeded codes + exclusion_fields: + ActivityProducedBy: ['MADJ', 'MCIF', 'MDTY', 'SUB', 'T007', 'T013', + 'T014', 'T015', 'T016', 'TOP', 'Trade', 'Trans'] + ActivityConsumedBy: ['Other', 'Used', 'T017'] + attribution_method: proportional + attribute_on: ['PrimarySector', 'SecondarySector'] + attribution_source: + BEA_Detail_Supply: + year: 2017 + activity_to_sector_mapping: BEA_2017_Detail + primary_action_type: Consumed # speeds processing + + # Drop unneeded codes + exclusion_fields: + ActivityConsumedBy: ['T017', 'S00300', 'S00401', 'S00402', 'S00900'] + ActivityProducedBy: ['MADJ', 'MCIF', 'MDTY', 'SUB', 'T007', 'T013', + 'T014', 'T015', 'T016', 'TOP', 'TRADE', 'TRANS'] + attribution_method: equal diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml index d95a28ecb..85caad5a7 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml @@ -22,6 +22,14 @@ sources_to_cache: !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT year: *ghgi_year + Detail_Supply_2020: + !include:Detail_Supply.yaml + year: *ghgi_year + source_names: + BEA_Summary_Supply: + !include:Detail_Supply.yaml:source_names:BEA_Summary_Supply + year: *ghgi_year + source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 @@ -31,8 +39,8 @@ source_names: electric_power: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power attribution_source: - Detail_Use_2020: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power:attribution_source:Detail_Use_YEAR + Detail_Supply_2020: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR liming: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming attribution_source: @@ -260,8 +268,8 @@ source_names: electric_power: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power attribution_source: - Detail_Use_2020: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power:attribution_source:Detail_Use_YEAR + Detail_Supply_2020: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR fuel_oil: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml index 9c3a2ac02..1ae5ff829 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml @@ -41,6 +41,14 @@ sources_to_cache: !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT # year: *ghgi_year + Detail_Supply_2020: + !include:Detail_Supply.yaml + # year: *ghgi_year + source_names: + BEA_Summary_Supply: + !include:Detail_Supply.yaml:source_names:BEA_Summary_Supply + # year: *ghgi_year + source_names: EPA_GHGI_T_2_1: #U.S. GHG emissions # year: # override this @@ -88,7 +96,7 @@ source_names: Electric Power Sector: Electric Power #CO2 attribution_method: proportional attribution_source: - Detail_Use_YEAR: ## Update year UPDATE TO USE MAKE TABLE + Detail_Supply_YEAR: ## Update year selection_fields: SectorConsumedBy: {'2211': ''} # Electricity (221100) @@ -489,7 +497,7 @@ source_names: Wood Electric Power: Wood Electric Power attribution_method: proportional attribution_source: - Detail_Use_YEAR: ## Update year UPDATE TO USE SUPPLY TABLE + Detail_Supply_YEAR: ## Update year selection_fields: SectorConsumedBy: {'2211': ''} # Electricity (221100) From 498af0d54211f762c68ca600979e4e577653f4d0 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 19 Oct 2023 14:50:23 -0400 Subject: [PATCH 1062/1127] avoid repeated selection_fields operations; skip if not needed --- flowsa/flowby.py | 2 +- flowsa/flowbyactivity.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 599b1ee51..76807b1c7 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -458,7 +458,7 @@ def select_by_fields( selection_fields = (selection_fields or self.config.get('selection_fields')) - if selection_fields is None: + if selection_fields is None or selection_fields == 'null': return self selection_fields = {k: [v] if not isinstance(v, (list, dict)) else v diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index 5af12a446..0ff1fcf78 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -708,7 +708,7 @@ def prepare_fbs( .select_by_fields() .function_socket('estimate_suppressed') .select_by_fields(selection_fields=self.config.get( - 'selection_fields_after_data_suppression_estimation')) + 'selection_fields_after_data_suppression_estimation', 'null')) .convert_units_and_flows() # and also map to flow lists .function_socket('clean_fba') .convert_to_geoscale() From 71432a32d8dbd1b91ccab370415a7aaa08a6609c Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 19 Oct 2023 16:08:44 -0400 Subject: [PATCH 1063/1127] fix typo --- flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml index 85caad5a7..5cd4a56c0 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml @@ -111,7 +111,7 @@ source_names: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels attribution_source: Detail_Use_2020: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:Detail_Use_2020 + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:Detail_Use_YEAR "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 From 4ab1d826959dd2d0165c443450b8cc99d680b89a Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 19 Oct 2023 16:08:58 -0400 Subject: [PATCH 1064/1127] avoid ValueError when merging on column of nan --- flowsa/flowbysector.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flowsa/flowbysector.py b/flowsa/flowbysector.py index 197f87cd2..c897eedf1 100644 --- a/flowsa/flowbysector.py +++ b/flowsa/flowbysector.py @@ -232,6 +232,8 @@ def sector_aggregation(self, industry_spec=None): fbs = self for direction in ['ProducedBy', 'ConsumedBy']: + if fbs[f'Sector{direction}'].isna().all(): + continue fbs = ( fbs .rename(columns={f'Sector{direction}': 'source_naics'}) From 34ddebfe78a64c363cae35fded2d005d1bb62dd5 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 19 Oct 2023 17:06:59 -0400 Subject: [PATCH 1065/1127] add supply table to GHG m2 --- .../GHG_national_2020_m2.yaml | 16 ++++++++++++---- .../GHG_national_m2_common.yaml | 18 ++++++++++++++---- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml index bedf18d4f..8618b399f 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml @@ -18,6 +18,14 @@ sources_to_cache: !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT year: *ghgi_year + Detail_Supply_2020: + !include:Detail_Supply.yaml + year: *ghgi_year + source_names: + BEA_Summary_Supply: + !include:Detail_Supply.yaml:source_names:BEA_Summary_Supply + year: *ghgi_year + source_names: GHG_national_2020_m1: # National Summary model !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1 @@ -144,8 +152,8 @@ source_names: electric_power: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power attribution_source: - Detail_Use_2020: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power:attribution_source:Detail_Use_YEAR + Detail_Supply_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR fuel_oil: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil @@ -232,8 +240,8 @@ source_names: magnesium: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium attribution_source: - Detail_Use_2020: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium:attribution_source:Detail_Use_YEAR + Detail_Supply_2020: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium:attribution_source:Detail_Supply_YEAR EPA_GHGI_T_2_1: #U.S. GHG emissions !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml index 79be7eefd..b82e283ec 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml @@ -66,6 +66,14 @@ sources_to_cache: !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT # year: *ghgi_year + Detail_Supply_2020: + !include:Detail_Supply.yaml + # year: *ghgi_year + source_names: + BEA_Summary_Supply: + !include:Detail_Supply.yaml:source_names:BEA_Summary_Supply + # year: *ghgi_year + source_names: GHG_national_m1: # National Summary model data_format: FBS @@ -338,7 +346,7 @@ source_names: - 'EPA_GHGI_T_3_9.electric_power' attribution_method: proportional attribution_source: - Detail_Use_YEAR: ## Update year UPDATE TO USE MAKE TABLE + Detail_Supply_YEAR: ## Update year selection_fields: SectorConsumedBy: {'2211': ''} # Electricity (221100) fuel_oil: @@ -494,10 +502,12 @@ source_names: MetaSources: 'EPA_GHGI_T_4_86' attribution_method: proportional attribution_source: - Detail_Use_YEAR: ## Update year UPDATE TO USE GROSS OUTPUT + Detail_Supply_YEAR: ## Update year selection_fields: - SectorConsumedBy: {'T008': ''} # Total Output - + SectorProducedBy: # Mapped magnesium sectors + '33141': '' + '33149': '' + '33152': '' ## For tables requiring direct attribution, reattribute the original GHGI EPA_GHGI_T_2_1: #U.S. GHG emissions From bcf666c922762f81acb67a01fdf98cd7a7274f24 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 19 Oct 2023 15:50:10 -0600 Subject: [PATCH 1066/1127] update sectorsourcename naics year after converting --- flowsa/naics.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flowsa/naics.py b/flowsa/naics.py index d1605a352..34798d8ba 100644 --- a/flowsa/naics.py +++ b/flowsa/naics.py @@ -382,6 +382,8 @@ def convert_naics_year(df_load, targetsectorsourcename, sectorsourcename, df = df.drop( columns=[targetsectorsourcename, 'NAICS', 'allocation_ratio']) log.info(f'Replaced NAICS with {targetsectorsourcename}') + # replace the sector year in the sectorsourcename column + df['SectorSourceName'] = targetsectorsourcename # check if there are any sectors that are not in # the target sector crosswalk and if so, drop those sectors From 9f39bfec08f70ab6612e8c01d39704e99bb6afa2 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 19 Oct 2023 15:50:58 -0600 Subject: [PATCH 1067/1127] drop second naics year conversion now that cached df updated to use FBS config --- flowsa/flowby.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 76807b1c7..6b041c268 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -906,18 +906,6 @@ def load_prepare_attribution_source( download_sources_ok=download_sources_ok ).prepare_fbs(download_sources_ok=download_sources_ok) - # if the attribution sectorsourcename does not match the FBS method - # target year, convert. This can be the case for a cached data - # source that is loaded from a secondary yaml (see CAP_HAP cached - # source "Detail_Use_Year" - if attribution_fbs['SectorSourceName'][0] != \ - f"NAICS_{self.config['target_naics_year']}_Code": - attribution_fbs = naics.convert_naics_year( - attribution_fbs, - f"NAICS_{self.config['target_naics_year']}_Code", - attribution_fbs['SectorSourceName'][0], - attribution_fbs.full_name) - return attribution_fbs def harmonize_geoscale( From 040521ef71619d4422854c4d68d29084e97b18bd Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 19 Oct 2023 16:41:52 -0600 Subject: [PATCH 1068/1127] rename naics_to_bea_crosswalk to naics_to_bea_crosswalk_2012 --- flowsa/common.py | 2 +- ...CS_to_BEA_Crosswalk.csv => NAICS_to_BEA_Crosswalk_2012.csv} | 0 flowsa/data_source_scripts/StatCan_IWS_MI.py | 2 +- scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA.py | 3 +-- .../write_Crosswalk_BEA_Make_Table.py | 2 +- .../FlowByActivity_Crosswalks/write_Crosswalk_Blackhurst_IO.py | 2 +- scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_REI.py | 2 +- scripts/writeNAICScrosswalk.py | 2 +- 8 files changed, 7 insertions(+), 8 deletions(-) rename flowsa/data/{NAICS_to_BEA_Crosswalk.csv => NAICS_to_BEA_Crosswalk_2012.csv} (100%) diff --git a/flowsa/common.py b/flowsa/common.py index 7674a996d..305f27395 100644 --- a/flowsa/common.py +++ b/flowsa/common.py @@ -74,7 +74,7 @@ def load_crosswalk(crosswalk_name): 'NAICS_Crosswalk_TimeSeries', 'NAICS_2012_Crosswalk', 'Sector_2012_Names', 'Household_SectorCodes', 'Government_SectorCodes', - 'NAICS_to_BEA_Crosswalk', 'NAICS_to_BEA_Crosswalk_2017' + 'NAICS_to_BEA_Crosswalk_2012', 'NAICS_to_BEA_Crosswalk_2017' as a dataframe diff --git a/flowsa/data/NAICS_to_BEA_Crosswalk.csv b/flowsa/data/NAICS_to_BEA_Crosswalk_2012.csv similarity index 100% rename from flowsa/data/NAICS_to_BEA_Crosswalk.csv rename to flowsa/data/NAICS_to_BEA_Crosswalk_2012.csv diff --git a/flowsa/data_source_scripts/StatCan_IWS_MI.py b/flowsa/data_source_scripts/StatCan_IWS_MI.py index 4ee15ebe5..68991ca4f 100644 --- a/flowsa/data_source_scripts/StatCan_IWS_MI.py +++ b/flowsa/data_source_scripts/StatCan_IWS_MI.py @@ -150,7 +150,7 @@ def convert_statcan_data_to_US_water_use(df, attr, download_FBA_if_missing): flowclass='Money', download_FBA_if_missing=download_FBA_if_missing) # load bea crosswalk - cw_load = load_crosswalk('NAICS_to_BEA_Crosswalk') + cw_load = load_crosswalk('NAICS_to_BEA_Crosswalk_2012') cw = cw_load[['BEA_2012_Detail_Code', 'NAICS_2012_Code']].drop_duplicates() cw = cw[cw['NAICS_2012_Code'].apply( lambda x: len(str(x)) == 3)].drop_duplicates().reset_index(drop=True) diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA.py index cd3f673cf..b876d1949 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA.py @@ -11,8 +11,7 @@ def write_BEA_crosswalk(level='Detail', year=2012): - cw_load = load_crosswalk('NAICS_to_BEA_Crosswalk') if year == 2012 else \ - load_crosswalk(f'Naics_to_BEA_Crosswalk_{year}') + cw_load = load_crosswalk(f'Naics_to_BEA_Crosswalk_{year}') cw = cw_load[[f'BEA_{year}_{level}_Code', f'NAICS_{year}_Code']].drop_duplicates().reset_index(drop=True) # drop all rows with naics >6 diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_Make_Table.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_Make_Table.py index d4fcb8231..1bc3fbc4c 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_Make_Table.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_BEA_Make_Table.py @@ -18,7 +18,7 @@ def assign_naics(df_load): :param df_load: df, a FlowByActivity subset that contains unique activity names :return: df with assigned Sector columns """ - cw_load = load_crosswalk('NAICS_to_BEA_Crosswalk') + cw_load = load_crosswalk('NAICS_to_BEA_Crosswalk_2012') cw = cw_load[['BEA_2012_Detail_Code', 'NAICS_2012_Code']].drop_duplicates().reset_index(drop=True) # drop all rows with naics >6 diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Blackhurst_IO.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Blackhurst_IO.py index 76ebaded9..f5d5fda9c 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Blackhurst_IO.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_Blackhurst_IO.py @@ -21,7 +21,7 @@ def assign_naics(df_load): :return: df with assigned Sector columns """ - cw_load = load_crosswalk('NAICS_to_BEA_Crosswalk') + cw_load = load_crosswalk('NAICS_to_BEA_Crosswalk_2012') cw = cw_load[['BEA_2012_Detail_Code', 'NAICS_2012_Code']].drop_duplicates().reset_index(drop=True) # least aggregate level that applies is 5 digits diff --git a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_REI.py b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_REI.py index 6d784e5c7..f5ddd26fe 100644 --- a/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_REI.py +++ b/scripts/FlowByActivity_Crosswalks/write_Crosswalk_EPA_REI.py @@ -49,7 +49,7 @@ def assign_naics(df): dfb = df[~df['ActivityCode'].str.startswith('RS')].reset_index(drop=True) # load bea crosswalk - cw_load = load_crosswalk('NAICS_to_BEA_Crosswalk') + cw_load = load_crosswalk('NAICS_to_BEA_Crosswalk_2012') cw = (cw_load[['BEA_2012_Detail_Code', 'NAICS_2012_Code']] .drop_duplicates() .dropna() diff --git a/scripts/writeNAICScrosswalk.py b/scripts/writeNAICScrosswalk.py index d49e6d9f2..3b4b3ade5 100644 --- a/scripts/writeNAICScrosswalk.py +++ b/scripts/writeNAICScrosswalk.py @@ -57,7 +57,7 @@ def update_naics_crosswalk(): """ # read useeior master crosswalk, subset NAICS columns - naics_load = load_crosswalk('NAICS_to_BEA_Crosswalk') + naics_load = load_crosswalk('NAICS_to_BEA_Crosswalk_2012') naics = naics_load[['NAICS_2007_Code', 'NAICS_2012_Code', 'NAICS_2017_Code' ]].drop_duplicates().reset_index(drop=True) # convert all rows to string From d13fd1e2063b968aa62b7b8f3842de42208cf23b Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 19 Oct 2023 16:49:00 -0600 Subject: [PATCH 1069/1127] update map_to_bea_sectors() to make target bea year flexible and address duplicated 'Sector' col when FBS is collapsed, determine NAICS year from FBS --- flowsa/sectormapping.py | 46 +++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/flowsa/sectormapping.py b/flowsa/sectormapping.py index b9548f3b4..4c98e374f 100644 --- a/flowsa/sectormapping.py +++ b/flowsa/sectormapping.py @@ -161,26 +161,34 @@ def map_fbs_flows(fbs, from_fba_source, v, **kwargs): return fbs_mapped, mapping_files -def map_to_BEA_sectors(fbs_load, region, io_level, year): +def map_to_BEA_sectors(fbs_load, region, io_level, output_year, + bea_year=2012): """ Map FBS sectors from NAICS to BEA, allocating by gross industry output. :param fbs_load: df completed FlowBySector collapsed to single 'Sector' :param region: str, 'state' or 'national' :param io_level: str, 'summary' or 'detail' - :param year: year for industry output + :param output_year: year for industry output + :param bea_year: 2012 or 2017 + """ - bea = get_BEA_industry_output(region, io_level, year) + + bea = get_BEA_industry_output(region, io_level, output_year, bea_year) if io_level == 'summary': - mapping_col = 'BEA_2012_Summary_Code' + mapping_col = f'BEA_{bea_year}_Summary_Code' elif io_level == 'detail': - mapping_col = 'BEA_2012_Detail_Code' + mapping_col = f'BEA_{bea_year}_Detail_Code' + + # determine naics year in df + naics_year = fbs_load['SectorSourceName'][0].split( + "_", 1)[1].split("_", 1)[0] # Prepare NAICS:BEA mapping file - mapping = (load_crosswalk('NAICS_to_BEA_Crosswalk') + mapping = (load_crosswalk(f'NAICS_to_BEA_Crosswalk_{bea_year}') .rename(columns={mapping_col: 'BEA', - 'NAICS_2012_Code': 'Sector'})) + f'NAICS_{naics_year}_Code': 'Sector'})) mapping = (mapping.drop( columns=mapping.columns.difference(['Sector','BEA'])) .drop_duplicates(ignore_index=True) @@ -228,10 +236,10 @@ def map_to_BEA_sectors(fbs_load, region, io_level, year): fbs['Allocation'] = fbs['Allocation'].fillna(1) fbs['BEA'] = fbs['BEA'].fillna(fbs['BEA_y']) fbs['FlowAmount'] = fbs['FlowAmount'] * fbs['Allocation'] - fbs = fbs.rename(columns={'BEA':'Sector'}) + fbs = fbs.assign(Sector=fbs['BEA']) fbs = (fbs.drop(columns=dq_fields + - ['SectorSourceName', + ['SectorSourceName', 'BEA', 'BEA_y', 'Allocation'], errors='ignore')) if (abs(1-(sum(fbs['FlowAmount']) / @@ -241,12 +249,13 @@ def map_to_BEA_sectors(fbs_load, region, io_level, year): return fbs -def get_BEA_industry_output(region, io_level, year): +def get_BEA_industry_output(region, io_level, output_year, bea_year=2012): """ Get FlowByActivity for industry output from state or national datasets :param region: str, 'state' or 'national' :param io_level: str, 'summary' or 'detail' - :param year: year for industry output + :param output_year: year for industry output + :param bea_year: 2012 or 2017 """ if region == 'state': fba = 'stateio_Industry_GO' @@ -256,22 +265,23 @@ def get_BEA_industry_output(region, io_level, year): fba = 'BEA_Detail_GrossOutput_IO' # Get output by BEA sector - bea = flowsa.flowbyactivity.getFlowByActivity(fba, year) + bea = flowsa.flowbyactivity.getFlowByActivity(fba, output_year) bea = ( bea.drop(columns=bea.columns.difference( ['FlowAmount','ActivityProducedBy','Location'])) .rename(columns={'FlowAmount':'Output', 'ActivityProducedBy': 'BEA'})) - # If needed, aggregate from detial to summary + # If needed, aggregate from detail to summary if region == 'national' and io_level == 'summary': - bea_mapping = (load_crosswalk('NAICS_to_BEA_Crosswalk') - [['BEA_2012_Detail_Code','BEA_2012_Summary_Code']] + bea_mapping = (load_crosswalk(f'NAICS_to_BEA_Crosswalk_{bea_year}') + [[f'BEA_{bea_year}_Detail_Code', + f'BEA_{bea_year}_Summary_Code']] .drop_duplicates() - .rename(columns={'BEA_2012_Detail_Code': 'BEA'})) + .rename(columns={f'BEA_{bea_year}_Detail_Code': 'BEA'})) bea = (bea.merge(bea_mapping, how='left', on='BEA') .drop(columns=['BEA']) - .rename(columns={'BEA_2012_Summary_Code': 'BEA'})) + .rename(columns={f'BEA_{bea_year}_Summary_Code': 'BEA'})) bea = (bea.groupby(['BEA','Location']).agg({'Output': 'sum'}) .reset_index()) @@ -342,4 +352,4 @@ def append_material_code(df, v, attr): df = flowsa.sectormapping.map_to_BEA_sectors( flowsa.getFlowBySector('GHG_national_2019_m1') .rename(columns={'SectorProducedBy':'Sector'}), - region='national', io_level='summary', year='2019') + region='national', io_level='summary', output_year='2019') From 1c59acc3dbfe74b80a2cfb87f14e9d1fe1aec02b Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 20 Oct 2023 10:14:51 -0400 Subject: [PATCH 1070/1127] do not use residential ODS directly from state inventory; align with national --- .../activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv | 2 +- .../methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv | 2 +- flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index 142e36ec0..a69bc1716 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -266,7 +266,7 @@ EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product u EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,31,,ods_substitutes EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,32,,ods_substitutes EPA_State_GHGI,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,NAICS_2012_Code,33,,ods_substitutes -EPA_State_GHGI,Residential - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Residential,NAICS_2012_Code,F010,,direct_ods +EPA_State_GHGI,Residential - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Residential,NAICS_2012_Code,F010,,ods_substitutes EPA_State_GHGI,Transportation - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Transportation,NAICS_2012_Code,48,,ods_transportation EPA_State_GHGI,Transportation - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Transportation,NAICS_2012_Code,F010,,ods_transportation EPA_State_GHGI,Industry - Adipic Acid Production - Chemical Industry,NAICS_2012_Code,32519,,direct diff --git a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv index f6e101d59..587ae4507 100644 --- a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv @@ -99,7 +99,7 @@ transport_nonroad,Transportation - Mobile Combustion - Fossil Fuel Combustion - transport_nonroad,Transportation - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other,negative emissions; align with 'Transportation - Mobile Combustion - Fossil Fuel Combustion - Petroleum - Non-Highway' to avoid double counting ods_substitutes,Commercial - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Commercial,EPA_GHGI_T_4_102 ods_substitutes,Industry - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Industry,EPA_GHGI_T_4_102 -direct_ods,Residential - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Residential,EPA_GHGI_T_4_102 +ods_substitutes,Residential - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Residential,EPA_GHGI_T_4_102 ods_transportation,Transportation - Substitution of Ozone Depleting Substances - Product uses as substitutes for ODS - ODS Subst Transportation,EPA_GHGI_T_4_102 direct,Industry - Adipic Acid Production - Chemical Industry,EPA_GHGI_T_2_1 direct,Industry - Ammonia Production - Chemical Industry,EPA_GHGI_T_2_1 diff --git a/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml index 669b44234..3f3719ad1 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml @@ -35,7 +35,7 @@ source_names: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct attribution_method: direct direct_ods: - # replicates direct attribution from EPA_GHGI_T_4_102.households + # heat transfer fluids selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv direct_ods exclusion_fields: @@ -547,6 +547,7 @@ source_names: ods_substitutes: selection_fields: MetaSources: + - 'EPA_GHGI_T_4_102.households' - 'EPA_GHGI_T_4_102.refrigerants' - 'EPA_GHGI_T_4_102.air_conditioning' - 'EPA_GHGI_T_4_102.foams' From 9ab2a370da243519c59538cfef7e0630bcaf0a65 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 20 Oct 2023 10:43:11 -0400 Subject: [PATCH 1071/1127] add activity set comments --- .../methods/flowbysectormethods/GHG_national_m1_common.yaml | 6 +++--- .../methods/flowbysectormethods/GHG_national_m2_common.yaml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml index 1ae5ff829..c99af1279 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml @@ -305,7 +305,7 @@ source_names: EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion fedefl_mapping: GHGI activity_sets: - direct_gasoline: + direct_gasoline: # empty in some years (<0.05 MMT CO2eq) selection_fields: PrimaryActivity: Motorcycles Gasoline On-Road: Motorcycles @@ -372,7 +372,7 @@ source_names: SectorProducedBy: {'32411': ''} # purchases of refinery products (324110) alt_fuel_on_road: #this set is allocated by purchases of natural gas - selection_fields: + selection_fields: # empty in some years (<0.05 MMT CO2eq) PrimaryActivity: All activities Alternative Fuel On-Road: Alternative Fuel On-Road attribution_method: proportional @@ -525,7 +525,7 @@ source_names: selection_fields: SectorProducedBy: {'2212': ''} # purchases of natural gas (221200) - coal_nonmanufacturing: + coal_nonmanufacturing: # empty in some years (i.e., all coal consumption for manufacturing) selection_fields: PrimaryActivity: Coal Industrial attribution_method: proportional diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml index b82e283ec..f81e18eec 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml @@ -371,7 +371,7 @@ source_names: selection_fields: SectorProducedBy: {'2212': ''} # purchases of natural gas (221200) - coal_nonmanufacturing: + coal_nonmanufacturing: # empty in some years (i.e., all coal consumption for manufacturing) selection_fields: MetaSources: - 'EPA_GHGI_T_3_8.coal_nonmanufacturing' @@ -569,7 +569,7 @@ source_names: EPA_GHGI_T_3_14: &mobile #CH4 from mobile combustion fedefl_mapping: GHGI activity_sets: - direct_gasoline: + direct_gasoline: # empty in some years (<0.05 MMT CO2eq) !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:direct_gasoline direct_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:direct_non_road From c69d9f7382545fb8143af5cfe5fb9c0ca547797c Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 20 Oct 2023 13:22:28 -0400 Subject: [PATCH 1072/1127] fix StoneCrushed url --- .../methods/flowbyactivitymethods/USGS_MYB_StoneCrushed.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/methods/flowbyactivitymethods/USGS_MYB_StoneCrushed.yaml b/flowsa/methods/flowbyactivitymethods/USGS_MYB_StoneCrushed.yaml index 2d1c40534..958faefb2 100644 --- a/flowsa/methods/flowbyactivitymethods/USGS_MYB_StoneCrushed.yaml +++ b/flowsa/methods/flowbyactivitymethods/USGS_MYB_StoneCrushed.yaml @@ -1,12 +1,12 @@ # Downloads and parses CSV from USGS StoneCrushed Statistics and Information on an annual basis. --- source_name: USGS Mineral Yearbook Stone Crushed -citable_url: https://pubs.usgs.gov/myb/vol1/2018/myb1-2018-zeolites.xlsx +citable_url: https://d9-wret.s3.us-west-2.amazonaws.com/assets/palladium/production/s3fs-public/media/files/myb1-2019-stonec-adv.xlsx date_generated: '2021-03-26' years_available: 2014-2018 format: xls url: - base_url: https://pubs.usgs.gov/myb/vol1/2018/myb1-2018-zeolites.xlsx + base_url: https://d9-wret.s3.us-west-2.amazonaws.com/assets/palladium/production/s3fs-public/media/files/myb1-2019-stonec-adv.xlsx url_replace_fxn: !script_function:USGS_MYB usgs_myb_url_helper call_response_fxn: !script_function:USGS_MYB usgs_stonecr_call parse_response_fxn: !script_function:USGS_MYB usgs_stonecr_parse From 1037c86cfb3d9ede453f80f7eefa9142a5d19fb8 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 20 Oct 2023 13:57:49 -0400 Subject: [PATCH 1073/1127] fix error in target sectors related to 5241* and 325* --- flowsa/methods/flowbysectormethods/BEA_detail_target.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/BEA_detail_target.yaml b/flowsa/methods/flowbysectormethods/BEA_detail_target.yaml index cfb9c4bec..b1992fe73 100644 --- a/flowsa/methods/flowbysectormethods/BEA_detail_target.yaml +++ b/flowsa/methods/flowbysectormethods/BEA_detail_target.yaml @@ -19,9 +19,9 @@ industry_spec: '3261', '3262', '3273', '3279', '3314', '3315', '3323', '3324', '3327', '3331', '3339', '3342', '3346', '3351', '3352', '3359', '3361', '3363', '3371', '3399', '5111', - '5112', '5191', '5416', '5419'] + '5112', '5191', '5241', '5416', '5419'] NAICS_6: ['21311', '31111', '31122', '31151', '31161', '32229', - '32311', '32412', '32521', '32541', '32799', '33131', + '32311', '32412', '3252', '3254', '32799', '33131', '33141', '33211', '33291', '33299', '33311', '33324', '33331', '33341', '33351', '33361', '33391', '33399', '33411', '33441', '33451', '33522', '33531', '33591', From 09619a550f5fd326312779d2a48f539fb0c922d2 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 20 Oct 2023 14:51:08 -0400 Subject: [PATCH 1074/1127] update GHG methods for 2017-2019 --- .../GHG_national_2017_m1.yaml | 149 +++++++++---- .../GHG_national_2017_m2.yaml | 197 +++++++++++++++++- .../GHG_national_2018_m1.yaml | 149 +++++++++---- .../GHG_national_2018_m2.yaml | 197 +++++++++++++++++- .../GHG_national_2019_m1.yaml | 148 +++++++++---- .../GHG_national_2019_m2.yaml | 197 +++++++++++++++++- .../GHG_national_2020_m1.yaml | 5 +- 7 files changed, 905 insertions(+), 137 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml index 6a865ee28..a64e88334 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml @@ -13,11 +13,60 @@ _industrial_allocation_dict: &industrial_dict year: *mecs_year ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table +sources_to_cache: + Detail_Use_2017: + !include:Detail_Use.yaml + year: *ghgi_year + source_names: + BEA_Summary_Use_SUT: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + year: *ghgi_year + + Detail_Supply_2017: + !include:Detail_Supply.yaml + year: *ghgi_year + source_names: + BEA_Summary_Supply: + !include:Detail_Supply.yaml:source_names:BEA_Summary_Supply + year: *ghgi_year + source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year - + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + electric_power: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power + attribution_source: + Detail_Supply_2017: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR + liming: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming + attribution_source: + Detail_Use_2017: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming:attribution_source:Detail_Use_YEAR + urea: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea + attribution_source: + Detail_Use_2017: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea:attribution_source:Detail_Use_YEAR + urea_fertilizer: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer + attribution_source: + Detail_Use_2017: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer:attribution_source:Detail_Use_YEAR + carbonate_use: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use + attribution_source: + Detail_Use_2017: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use:attribution_source:Detail_Use_YEAR + nitrous_oxide_use: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use + attribution_source: + Detail_Use_2017: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use:attribution_source:Detail_Use_YEAR + "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year @@ -51,6 +100,7 @@ source_names: "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 year: *ghgi_year @@ -59,9 +109,8 @@ source_names: petroleum_fuels: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2017: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:Detail_Use_YEAR "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 @@ -71,45 +120,38 @@ source_names: petroleum_fuels_diesel: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2017: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:Detail_Use_YEAR petroleum_fuels_gasoline: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - + Detail_Use_2017: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:Detail_Use_YEAR construction_and_mining: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2017: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:Detail_Use_YEAR farm_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2017: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:Detail_Use_YEAR other_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2017: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:Detail_Use_YEAR alt_fuel_on_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2017: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:Detail_Use_YEAR "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 @@ -125,6 +167,24 @@ source_names: "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets + refrigerants: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants + attribution_source: + Detail_Use_2017: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants:attribution_source:Detail_Use_YEAR + air_conditioning: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning + attribution_source: + Detail_Use_2017: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning:attribution_source:Detail_Use_YEAR + foams: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams + attribution_source: + Detail_Use_2017: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams:attribution_source:Detail_Use_YEAR + "EPA_GHGI_T_A_97": # HFCs from Transportation !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 @@ -155,10 +215,8 @@ source_names: transportation_lubricants: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - + Detail_Use_2017: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:Detail_Use_YEAR ### Major CO2 Sources "EPA_GHGI_T_A_8": # CO2 emissions from stationary combustion. This table number varies by GHG year. @@ -167,12 +225,16 @@ source_names: clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS and BEA year for some activity_sets !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + non_manufacturing_coal: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal + attribution_source: + Detail_Use_2017: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal:attribution_source:Detail_Use_YEAR non_manufacturing_natural_gas: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2017: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:Detail_Use_YEAR coal_manufacturing_co2: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 @@ -190,9 +252,8 @@ source_names: petroleum: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2017: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:Detail_Use_YEAR "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 @@ -201,18 +262,28 @@ source_names: activity_sets: # Update EIA_MECS and BEA year for some activity_sets !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + electric_power: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power + attribution_source: + Detail_Supply_2017: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR + fuel_oil: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2017: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:Detail_Use_YEAR + natural_gas_nonmanufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2017: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:Detail_Use_YEAR + coal_nonmanufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing + attribution_source: + Detail_Use_2017: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing:attribution_source:Detail_Use_YEAR coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2017_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2017_m2.yaml index 9f332f3ca..a22ec8684 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2017_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2017_m2.yaml @@ -8,6 +8,24 @@ ghgi_year: &ghgi_year 2017 mecs_year: &mecs_year 2018 + +sources_to_cache: + Detail_Use_2017: + !include:Detail_Use.yaml + year: *ghgi_year + source_names: + BEA_Summary_Use_SUT: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + year: *ghgi_year + + Detail_Supply_2017: + !include:Detail_Supply.yaml + year: *ghgi_year + source_names: + BEA_Summary_Supply: + !include:Detail_Supply.yaml:source_names:BEA_Summary_Supply + year: *ghgi_year + source_names: GHG_national_2017_m1: # National Summary model !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1 @@ -15,48 +33,215 @@ source_names: activity_sets: # Update MECS year for some activity sets !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets + liming: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:liming + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:liming:attribution_source:Detail_Use_YEAR + + urea: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea:attribution_source:Detail_Use_YEAR + + urea_fertilizer: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer:attribution_source:Detail_Use_YEAR + + carbonate_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use:attribution_source:Detail_Use_YEAR + + nitrous_oxide_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use:attribution_source:Detail_Use_YEAR + + fertilizer_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use:attribution_source:Detail_Use_YEAR + + petroleum_fuels: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels:attribution_source:Detail_Use_YEAR + + petroleum_fuels_diesel: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel:attribution_source:Detail_Use_YEAR + + petroleum_fuels_gasoline: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline:attribution_source:Detail_Use_YEAR + + construction_and_mining: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining:attribution_source:Detail_Use_YEAR + + farm_non_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road:attribution_source:Detail_Use_YEAR + + other_non_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:other_non_road + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:other_non_road:attribution_source:Detail_Use_YEAR + + alt_fuel_on_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road:attribution_source:Detail_Use_YEAR + + non_manufacturing_coal: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal:attribution_source:Detail_Use_YEAR + + non_manufacturing_natural_gas: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas:attribution_source:Detail_Use_YEAR + coal_manufacturing_co2: # Industrial Coal for Manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + + petroleum: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum:attribution_source:Detail_Use_YEAR + + electric_power: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power + attribution_source: + Detail_Supply_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR + + fuel_oil: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil:attribution_source:Detail_Use_YEAR + + natural_gas_nonmanufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing:attribution_source:Detail_Use_YEAR + + coal_nonmanufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing:attribution_source:Detail_Use_YEAR coal_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR ng_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR petroleum_neu: # consumed petroleum products !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR natural_gas_neu: # consumed nat gas to chemical plants !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + transportation_lubricants: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants:attribution_source:Detail_Use_YEAR + + refrigerants: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants:attribution_source:Detail_Use_YEAR + + air_conditioning: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:air_conditioning + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:air_conditioning:attribution_source:Detail_Use_YEAR + + foams: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:foams + attribution_source: + Detail_Use_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:foams:attribution_source:Detail_Use_YEAR + + magnesium: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium + attribution_source: + Detail_Supply_2017: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium:attribution_source:Detail_Supply_YEAR EPA_GHGI_T_2_1: #U.S. GHG emissions !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml index bfa753c74..2737d0740 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml @@ -13,11 +13,60 @@ _industrial_allocation_dict: &industrial_dict year: *mecs_year ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table +sources_to_cache: + Detail_Use_2018: + !include:Detail_Use.yaml + year: *ghgi_year + source_names: + BEA_Summary_Use_SUT: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + year: *ghgi_year + + Detail_Supply_2018: + !include:Detail_Supply.yaml + year: *ghgi_year + source_names: + BEA_Summary_Supply: + !include:Detail_Supply.yaml:source_names:BEA_Summary_Supply + year: *ghgi_year + source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year - + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + electric_power: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power + attribution_source: + Detail_Supply_2018: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR + liming: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming + attribution_source: + Detail_Use_2018: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming:attribution_source:Detail_Use_YEAR + urea: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea + attribution_source: + Detail_Use_2018: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea:attribution_source:Detail_Use_YEAR + urea_fertilizer: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer + attribution_source: + Detail_Use_2018: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer:attribution_source:Detail_Use_YEAR + carbonate_use: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use + attribution_source: + Detail_Use_2018: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use:attribution_source:Detail_Use_YEAR + nitrous_oxide_use: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use + attribution_source: + Detail_Use_2018: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use:attribution_source:Detail_Use_YEAR + "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year @@ -51,6 +100,7 @@ source_names: "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 year: *ghgi_year @@ -59,9 +109,8 @@ source_names: petroleum_fuels: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2018: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:Detail_Use_YEAR "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 @@ -71,45 +120,38 @@ source_names: petroleum_fuels_diesel: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2018: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:Detail_Use_YEAR petroleum_fuels_gasoline: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - + Detail_Use_2018: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:Detail_Use_YEAR construction_and_mining: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2018: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:Detail_Use_YEAR farm_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2018: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:Detail_Use_YEAR other_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2018: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:Detail_Use_YEAR alt_fuel_on_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2018: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:Detail_Use_YEAR "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 @@ -125,6 +167,24 @@ source_names: "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets + refrigerants: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants + attribution_source: + Detail_Use_2018: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants:attribution_source:Detail_Use_YEAR + air_conditioning: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning + attribution_source: + Detail_Use_2018: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning:attribution_source:Detail_Use_YEAR + foams: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams + attribution_source: + Detail_Use_2018: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams:attribution_source:Detail_Use_YEAR + "EPA_GHGI_T_A_97": # HFCs from Transportation !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 @@ -155,10 +215,8 @@ source_names: transportation_lubricants: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - + Detail_Use_2018: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:Detail_Use_YEAR ### Major CO2 Sources "EPA_GHGI_T_A_7": # CO2 emissions from stationary combustion. This table number varies by GHG year. @@ -167,12 +225,16 @@ source_names: clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS and BEA year for some activity_sets !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + non_manufacturing_coal: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal + attribution_source: + Detail_Use_2018: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal:attribution_source:Detail_Use_YEAR non_manufacturing_natural_gas: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2018: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:Detail_Use_YEAR coal_manufacturing_co2: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 @@ -190,9 +252,8 @@ source_names: petroleum: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2018: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:Detail_Use_YEAR "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 @@ -201,18 +262,28 @@ source_names: activity_sets: # Update EIA_MECS and BEA year for some activity_sets !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + electric_power: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power + attribution_source: + Detail_Supply_2018: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR + fuel_oil: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2018: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:Detail_Use_YEAR + natural_gas_nonmanufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2018: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:Detail_Use_YEAR + coal_nonmanufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing + attribution_source: + Detail_Use_2018: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing:attribution_source:Detail_Use_YEAR coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2018_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2018_m2.yaml index 92207d5ed..ad3e4d2c3 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2018_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2018_m2.yaml @@ -8,6 +8,24 @@ ghgi_year: &ghgi_year 2018 mecs_year: &mecs_year 2018 + +sources_to_cache: + Detail_Use_2018: + !include:Detail_Use.yaml + year: *ghgi_year + source_names: + BEA_Summary_Use_SUT: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + year: *ghgi_year + + Detail_Supply_2018: + !include:Detail_Supply.yaml + year: *ghgi_year + source_names: + BEA_Summary_Supply: + !include:Detail_Supply.yaml:source_names:BEA_Summary_Supply + year: *ghgi_year + source_names: GHG_national_2018_m1: # National Summary model !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1 @@ -15,48 +33,215 @@ source_names: activity_sets: # Update MECS year for some activity sets !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets + liming: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:liming + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:liming:attribution_source:Detail_Use_YEAR + + urea: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea:attribution_source:Detail_Use_YEAR + + urea_fertilizer: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer:attribution_source:Detail_Use_YEAR + + carbonate_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use:attribution_source:Detail_Use_YEAR + + nitrous_oxide_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use:attribution_source:Detail_Use_YEAR + + fertilizer_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use:attribution_source:Detail_Use_YEAR + + petroleum_fuels: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels:attribution_source:Detail_Use_YEAR + + petroleum_fuels_diesel: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel:attribution_source:Detail_Use_YEAR + + petroleum_fuels_gasoline: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline:attribution_source:Detail_Use_YEAR + + construction_and_mining: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining:attribution_source:Detail_Use_YEAR + + farm_non_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road:attribution_source:Detail_Use_YEAR + + other_non_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:other_non_road + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:other_non_road:attribution_source:Detail_Use_YEAR + + alt_fuel_on_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road:attribution_source:Detail_Use_YEAR + + non_manufacturing_coal: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal:attribution_source:Detail_Use_YEAR + + non_manufacturing_natural_gas: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas:attribution_source:Detail_Use_YEAR + coal_manufacturing_co2: # Industrial Coal for Manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + + petroleum: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum:attribution_source:Detail_Use_YEAR + + electric_power: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power + attribution_source: + Detail_Supply_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR + + fuel_oil: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil:attribution_source:Detail_Use_YEAR + + natural_gas_nonmanufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing:attribution_source:Detail_Use_YEAR + + coal_nonmanufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing:attribution_source:Detail_Use_YEAR coal_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR ng_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR petroleum_neu: # consumed petroleum products !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR natural_gas_neu: # consumed nat gas to chemical plants !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + transportation_lubricants: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants:attribution_source:Detail_Use_YEAR + + refrigerants: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants:attribution_source:Detail_Use_YEAR + + air_conditioning: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:air_conditioning + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:air_conditioning:attribution_source:Detail_Use_YEAR + + foams: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:foams + attribution_source: + Detail_Use_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:foams:attribution_source:Detail_Use_YEAR + + magnesium: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium + attribution_source: + Detail_Supply_2018: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium:attribution_source:Detail_Supply_YEAR EPA_GHGI_T_2_1: #U.S. GHG emissions !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml index 64bd70d4d..513cad076 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml @@ -13,11 +13,60 @@ _industrial_allocation_dict: &industrial_dict year: *mecs_year ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table +sources_to_cache: + Detail_Use_2019: + !include:Detail_Use.yaml + year: *ghgi_year + source_names: + BEA_Summary_Use_SUT: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + year: *ghgi_year + + Detail_Supply_2019: + !include:Detail_Supply.yaml + year: *ghgi_year + source_names: + BEA_Summary_Supply: + !include:Detail_Supply.yaml:source_names:BEA_Summary_Supply + year: *ghgi_year + source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year - + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + electric_power: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power + attribution_source: + Detail_Supply_2019: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR + liming: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming + attribution_source: + Detail_Use_2019: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming:attribution_source:Detail_Use_YEAR + urea: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea + attribution_source: + Detail_Use_2019: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea:attribution_source:Detail_Use_YEAR + urea_fertilizer: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer + attribution_source: + Detail_Use_2019: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer:attribution_source:Detail_Use_YEAR + carbonate_use: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use + attribution_source: + Detail_Use_2019: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use:attribution_source:Detail_Use_YEAR + nitrous_oxide_use: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use + attribution_source: + Detail_Use_2019: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use:attribution_source:Detail_Use_YEAR + "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year @@ -51,6 +100,7 @@ source_names: "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 year: *ghgi_year @@ -59,9 +109,8 @@ source_names: petroleum_fuels: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2019: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:Detail_Use_YEAR "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 @@ -71,45 +120,38 @@ source_names: petroleum_fuels_diesel: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2019: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:Detail_Use_YEAR petroleum_fuels_gasoline: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - + Detail_Use_2019: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:Detail_Use_YEAR construction_and_mining: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2019: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:Detail_Use_YEAR farm_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2019: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:Detail_Use_YEAR other_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2019: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:Detail_Use_YEAR alt_fuel_on_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2019: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:Detail_Use_YEAR "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 @@ -125,6 +167,24 @@ source_names: "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets + refrigerants: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants + attribution_source: + Detail_Use_2019: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants:attribution_source:Detail_Use_YEAR + air_conditioning: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning + attribution_source: + Detail_Use_2019: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning:attribution_source:Detail_Use_YEAR + foams: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams + attribution_source: + Detail_Use_2019: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams:attribution_source:Detail_Use_YEAR + "EPA_GHGI_T_A_97": # HFCs from Transportation !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 @@ -155,9 +215,8 @@ source_names: transportation_lubricants: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2019: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:Detail_Use_YEAR ### Major CO2 Sources @@ -167,12 +226,16 @@ source_names: clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS and BEA year for some activity_sets !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + non_manufacturing_coal: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal + attribution_source: + Detail_Use_2019: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal:attribution_source:Detail_Use_YEAR non_manufacturing_natural_gas: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2019: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:Detail_Use_YEAR coal_manufacturing_co2: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 @@ -190,9 +253,8 @@ source_names: petroleum: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2019: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:Detail_Use_YEAR "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 @@ -201,18 +263,28 @@ source_names: activity_sets: # Update EIA_MECS and BEA year for some activity_sets !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + electric_power: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power + attribution_source: + Detail_Supply_2019: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR + fuel_oil: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2019: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:Detail_Use_YEAR + natural_gas_nonmanufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2019: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:Detail_Use_YEAR + coal_nonmanufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing + attribution_source: + Detail_Use_2019: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing:attribution_source:Detail_Use_YEAR coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml index 264ac66df..b9608b652 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml @@ -8,6 +8,24 @@ ghgi_year: &ghgi_year 2019 mecs_year: &mecs_year 2018 + +sources_to_cache: + Detail_Use_2019: + !include:Detail_Use.yaml + year: *ghgi_year + source_names: + BEA_Summary_Use_SUT: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + year: *ghgi_year + + Detail_Supply_2019: + !include:Detail_Supply.yaml + year: *ghgi_year + source_names: + BEA_Summary_Supply: + !include:Detail_Supply.yaml:source_names:BEA_Summary_Supply + year: *ghgi_year + source_names: GHG_national_2019_m1: # National Summary model !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1 @@ -15,48 +33,215 @@ source_names: activity_sets: # Update MECS year for some activity sets !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets + liming: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:liming + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:liming:attribution_source:Detail_Use_YEAR + + urea: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea:attribution_source:Detail_Use_YEAR + + urea_fertilizer: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer:attribution_source:Detail_Use_YEAR + + carbonate_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use:attribution_source:Detail_Use_YEAR + + nitrous_oxide_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use:attribution_source:Detail_Use_YEAR + + fertilizer_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use:attribution_source:Detail_Use_YEAR + + petroleum_fuels: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels:attribution_source:Detail_Use_YEAR + + petroleum_fuels_diesel: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel:attribution_source:Detail_Use_YEAR + + petroleum_fuels_gasoline: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline:attribution_source:Detail_Use_YEAR + + construction_and_mining: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining:attribution_source:Detail_Use_YEAR + + farm_non_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road:attribution_source:Detail_Use_YEAR + + other_non_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:other_non_road + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:other_non_road:attribution_source:Detail_Use_YEAR + + alt_fuel_on_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road:attribution_source:Detail_Use_YEAR + + non_manufacturing_coal: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal:attribution_source:Detail_Use_YEAR + + non_manufacturing_natural_gas: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas:attribution_source:Detail_Use_YEAR + coal_manufacturing_co2: # Industrial Coal for Manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + + petroleum: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum:attribution_source:Detail_Use_YEAR + + electric_power: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power + attribution_source: + Detail_Supply_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR + + fuel_oil: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil:attribution_source:Detail_Use_YEAR + + natural_gas_nonmanufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing:attribution_source:Detail_Use_YEAR + + coal_nonmanufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing:attribution_source:Detail_Use_YEAR coal_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR ng_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR petroleum_neu: # consumed petroleum products !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR natural_gas_neu: # consumed nat gas to chemical plants !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + transportation_lubricants: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants:attribution_source:Detail_Use_YEAR + + refrigerants: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants:attribution_source:Detail_Use_YEAR + + air_conditioning: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:air_conditioning + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:air_conditioning:attribution_source:Detail_Use_YEAR + + foams: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:foams + attribution_source: + Detail_Use_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:foams:attribution_source:Detail_Use_YEAR + + magnesium: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium + attribution_source: + Detail_Supply_2019: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium:attribution_source:Detail_Supply_YEAR EPA_GHGI_T_2_1: #U.S. GHG emissions !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml index 5cd4a56c0..afd2a2505 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml @@ -1,6 +1,6 @@ # This is a 2020 target year specific implementation of GHG_national_m1 # This is a Summary level model -# All parameters add year specific data when needed to implement for 2019 +# All parameters add year specific data when needed to implement for 2020 # GHGI FBA table names match the 2022 GHGI Report # MECS year is 2018 @@ -67,8 +67,6 @@ source_names: Detail_Use_2020: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use:attribution_source:Detail_Use_YEAR - - "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year @@ -102,6 +100,7 @@ source_names: "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 year: *ghgi_year From a6ebbaa85e551310b0af072e09f632671be98b6a Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 20 Oct 2023 15:22:12 -0400 Subject: [PATCH 1075/1127] add 2015-2016 GHG methods --- .../GHG_national_2015_m1.yaml | 147 +++++++++---- .../GHG_national_2015_m2.yaml | 197 +++++++++++++++++- .../GHG_national_2016_m1.yaml | 147 +++++++++---- .../GHG_national_2016_m2.yaml | 197 +++++++++++++++++- 4 files changed, 600 insertions(+), 88 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml index 17bca8fa0..4d3b1ceda 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml @@ -13,10 +13,59 @@ _industrial_allocation_dict: &industrial_dict year: *mecs_year ghg_fba: 'EPA_GHGI_T_A_11' # 2014 Table +sources_to_cache: + Detail_Use_2015: + !include:Detail_Use.yaml + year: *ghgi_year + source_names: + BEA_Summary_Use_SUT: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + year: *ghgi_year + + Detail_Supply_2015: + !include:Detail_Supply.yaml + year: *ghgi_year + source_names: + BEA_Summary_Supply: + !include:Detail_Supply.yaml:source_names:BEA_Summary_Supply + year: *ghgi_year + source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + electric_power: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power + attribution_source: + Detail_Supply_2015: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR + liming: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming + attribution_source: + Detail_Use_2015: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming:attribution_source:Detail_Use_YEAR + urea: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea + attribution_source: + Detail_Use_2015: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea:attribution_source:Detail_Use_YEAR + urea_fertilizer: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer + attribution_source: + Detail_Use_2015: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer:attribution_source:Detail_Use_YEAR + carbonate_use: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use + attribution_source: + Detail_Use_2015: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use:attribution_source:Detail_Use_YEAR + nitrous_oxide_use: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use + attribution_source: + Detail_Use_2015: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use:attribution_source:Detail_Use_YEAR "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 @@ -51,6 +100,7 @@ source_names: "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 year: *ghgi_year @@ -59,9 +109,8 @@ source_names: petroleum_fuels: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2015: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:Detail_Use_YEAR "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 @@ -71,45 +120,38 @@ source_names: petroleum_fuels_diesel: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2015: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:Detail_Use_YEAR petroleum_fuels_gasoline: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - + Detail_Use_2015: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:Detail_Use_YEAR construction_and_mining: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2015: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:Detail_Use_YEAR farm_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2015: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:Detail_Use_YEAR other_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2015: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:Detail_Use_YEAR alt_fuel_on_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2015: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:Detail_Use_YEAR "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 @@ -125,6 +167,24 @@ source_names: "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets + refrigerants: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants + attribution_source: + Detail_Use_2015: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants:attribution_source:Detail_Use_YEAR + air_conditioning: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning + attribution_source: + Detail_Use_2015: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning:attribution_source:Detail_Use_YEAR + foams: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams + attribution_source: + Detail_Use_2015: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams:attribution_source:Detail_Use_YEAR + "EPA_GHGI_T_A_97": # HFCs from Transportation !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 @@ -155,10 +215,8 @@ source_names: transportation_lubricants: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - + Detail_Use_2015: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:Detail_Use_YEAR ### Major CO2 Sources "EPA_GHGI_T_A_10": # CO2 emissions from stationary combustion. This table number varies by GHG year. @@ -167,12 +225,16 @@ source_names: clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS and BEA year for some activity_sets !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + non_manufacturing_coal: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal + attribution_source: + Detail_Use_2015: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal:attribution_source:Detail_Use_YEAR non_manufacturing_natural_gas: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2015: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:Detail_Use_YEAR coal_manufacturing_co2: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 @@ -190,9 +252,8 @@ source_names: petroleum: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2015: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:Detail_Use_YEAR "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 @@ -201,18 +262,28 @@ source_names: activity_sets: # Update EIA_MECS and BEA year for some activity_sets !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + electric_power: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power + attribution_source: + Detail_Supply_2015: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR + fuel_oil: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2015: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:Detail_Use_YEAR + natural_gas_nonmanufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2015: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:Detail_Use_YEAR + coal_nonmanufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing + attribution_source: + Detail_Use_2015: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing:attribution_source:Detail_Use_YEAR coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2015_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2015_m2.yaml index 79a78eac9..90e29be14 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2015_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2015_m2.yaml @@ -8,6 +8,24 @@ ghgi_year: &ghgi_year 2015 mecs_year: &mecs_year 2014 + +sources_to_cache: + Detail_Use_2015: + !include:Detail_Use.yaml + year: *ghgi_year + source_names: + BEA_Summary_Use_SUT: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + year: *ghgi_year + + Detail_Supply_2015: + !include:Detail_Supply.yaml + year: *ghgi_year + source_names: + BEA_Summary_Supply: + !include:Detail_Supply.yaml:source_names:BEA_Summary_Supply + year: *ghgi_year + source_names: GHG_national_2015_m1: # National Summary model !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1 @@ -15,48 +33,215 @@ source_names: activity_sets: # Update MECS year for some activity sets !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets + liming: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:liming + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:liming:attribution_source:Detail_Use_YEAR + + urea: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea:attribution_source:Detail_Use_YEAR + + urea_fertilizer: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer:attribution_source:Detail_Use_YEAR + + carbonate_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use:attribution_source:Detail_Use_YEAR + + nitrous_oxide_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use:attribution_source:Detail_Use_YEAR + + fertilizer_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use:attribution_source:Detail_Use_YEAR + + petroleum_fuels: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels:attribution_source:Detail_Use_YEAR + + petroleum_fuels_diesel: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel:attribution_source:Detail_Use_YEAR + + petroleum_fuels_gasoline: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline:attribution_source:Detail_Use_YEAR + + construction_and_mining: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining:attribution_source:Detail_Use_YEAR + + farm_non_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road:attribution_source:Detail_Use_YEAR + + other_non_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:other_non_road + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:other_non_road:attribution_source:Detail_Use_YEAR + + alt_fuel_on_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road:attribution_source:Detail_Use_YEAR + + non_manufacturing_coal: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal:attribution_source:Detail_Use_YEAR + + non_manufacturing_natural_gas: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas:attribution_source:Detail_Use_YEAR + coal_manufacturing_co2: # Industrial Coal for Manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + + petroleum: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum:attribution_source:Detail_Use_YEAR + + electric_power: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power + attribution_source: + Detail_Supply_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR + + fuel_oil: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil:attribution_source:Detail_Use_YEAR + + natural_gas_nonmanufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing:attribution_source:Detail_Use_YEAR + + coal_nonmanufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing:attribution_source:Detail_Use_YEAR coal_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR ng_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR petroleum_neu: # consumed petroleum products !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR natural_gas_neu: # consumed nat gas to chemical plants !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + transportation_lubricants: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants:attribution_source:Detail_Use_YEAR + + refrigerants: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants:attribution_source:Detail_Use_YEAR + + air_conditioning: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:air_conditioning + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:air_conditioning:attribution_source:Detail_Use_YEAR + + foams: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:foams + attribution_source: + Detail_Use_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:foams:attribution_source:Detail_Use_YEAR + + magnesium: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium + attribution_source: + Detail_Supply_2015: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium:attribution_source:Detail_Supply_YEAR EPA_GHGI_T_2_1: #U.S. GHG emissions !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml index 548d160ea..3e87906b9 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml @@ -13,10 +13,59 @@ _industrial_allocation_dict: &industrial_dict year: *mecs_year ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table +sources_to_cache: + Detail_Use_2016: + !include:Detail_Use.yaml + year: *ghgi_year + source_names: + BEA_Summary_Use_SUT: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + year: *ghgi_year + + Detail_Supply_2016: + !include:Detail_Supply.yaml + year: *ghgi_year + source_names: + BEA_Summary_Supply: + !include:Detail_Supply.yaml:source_names:BEA_Summary_Supply + year: *ghgi_year + source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + electric_power: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power + attribution_source: + Detail_Supply_2016: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR + liming: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming + attribution_source: + Detail_Use_2016: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming:attribution_source:Detail_Use_YEAR + urea: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea + attribution_source: + Detail_Use_2016: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea:attribution_source:Detail_Use_YEAR + urea_fertilizer: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer + attribution_source: + Detail_Use_2016: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer:attribution_source:Detail_Use_YEAR + carbonate_use: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use + attribution_source: + Detail_Use_2016: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use:attribution_source:Detail_Use_YEAR + nitrous_oxide_use: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use + attribution_source: + Detail_Use_2016: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use:attribution_source:Detail_Use_YEAR "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 @@ -51,6 +100,7 @@ source_names: "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 year: *ghgi_year @@ -59,9 +109,8 @@ source_names: petroleum_fuels: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2016: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:Detail_Use_YEAR "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 @@ -71,45 +120,38 @@ source_names: petroleum_fuels_diesel: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2016: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:Detail_Use_YEAR petroleum_fuels_gasoline: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - + Detail_Use_2016: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:Detail_Use_YEAR construction_and_mining: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2016: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:Detail_Use_YEAR farm_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2016: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:Detail_Use_YEAR other_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2016: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:Detail_Use_YEAR alt_fuel_on_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2016: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:Detail_Use_YEAR "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 @@ -125,6 +167,24 @@ source_names: "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets + refrigerants: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants + attribution_source: + Detail_Use_2016: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants:attribution_source:Detail_Use_YEAR + air_conditioning: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning + attribution_source: + Detail_Use_2016: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning:attribution_source:Detail_Use_YEAR + foams: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams + attribution_source: + Detail_Use_2016: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams:attribution_source:Detail_Use_YEAR + "EPA_GHGI_T_A_97": # HFCs from Transportation !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 @@ -155,10 +215,8 @@ source_names: transportation_lubricants: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - + Detail_Use_2016: + !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:Detail_Use_YEAR ### Major CO2 Sources "EPA_GHGI_T_A_9": # CO2 emissions from stationary combustion. This table number varies by GHG year. @@ -167,12 +225,16 @@ source_names: clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS and BEA year for some activity_sets !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + non_manufacturing_coal: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal + attribution_source: + Detail_Use_2016: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal:attribution_source:Detail_Use_YEAR non_manufacturing_natural_gas: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2016: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:Detail_Use_YEAR coal_manufacturing_co2: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 @@ -190,9 +252,8 @@ source_names: petroleum: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2016: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:Detail_Use_YEAR "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 @@ -201,18 +262,28 @@ source_names: activity_sets: # Update EIA_MECS and BEA year for some activity_sets !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + electric_power: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power + attribution_source: + Detail_Supply_2016: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR + fuel_oil: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2016: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:Detail_Use_YEAR + natural_gas_nonmanufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + Detail_Use_2016: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:Detail_Use_YEAR + coal_nonmanufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing + attribution_source: + Detail_Use_2016: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing:attribution_source:Detail_Use_YEAR coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2016_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2016_m2.yaml index 602285838..de55f40d2 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2016_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2016_m2.yaml @@ -8,6 +8,24 @@ ghgi_year: &ghgi_year 2016 mecs_year: &mecs_year 2018 + +sources_to_cache: + Detail_Use_2016: + !include:Detail_Use.yaml + year: *ghgi_year + source_names: + BEA_Summary_Use_SUT: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + year: *ghgi_year + + Detail_Supply_2016: + !include:Detail_Supply.yaml + year: *ghgi_year + source_names: + BEA_Summary_Supply: + !include:Detail_Supply.yaml:source_names:BEA_Summary_Supply + year: *ghgi_year + source_names: GHG_national_2016_m1: # National Summary model !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1 @@ -15,48 +33,215 @@ source_names: activity_sets: # Update MECS year for some activity sets !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets + liming: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:liming + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:liming:attribution_source:Detail_Use_YEAR + + urea: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea:attribution_source:Detail_Use_YEAR + + urea_fertilizer: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer:attribution_source:Detail_Use_YEAR + + carbonate_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use:attribution_source:Detail_Use_YEAR + + nitrous_oxide_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use:attribution_source:Detail_Use_YEAR + + fertilizer_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use:attribution_source:Detail_Use_YEAR + + petroleum_fuels: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels:attribution_source:Detail_Use_YEAR + + petroleum_fuels_diesel: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel:attribution_source:Detail_Use_YEAR + + petroleum_fuels_gasoline: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline:attribution_source:Detail_Use_YEAR + + construction_and_mining: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining:attribution_source:Detail_Use_YEAR + + farm_non_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road:attribution_source:Detail_Use_YEAR + + other_non_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:other_non_road + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:other_non_road:attribution_source:Detail_Use_YEAR + + alt_fuel_on_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road:attribution_source:Detail_Use_YEAR + + non_manufacturing_coal: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal:attribution_source:Detail_Use_YEAR + + non_manufacturing_natural_gas: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas:attribution_source:Detail_Use_YEAR + coal_manufacturing_co2: # Industrial Coal for Manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + + petroleum: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum:attribution_source:Detail_Use_YEAR + + electric_power: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power + attribution_source: + Detail_Supply_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR + + fuel_oil: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil:attribution_source:Detail_Use_YEAR + + natural_gas_nonmanufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing:attribution_source:Detail_Use_YEAR + + coal_nonmanufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing:attribution_source:Detail_Use_YEAR coal_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR ng_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR petroleum_neu: # consumed petroleum products !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR natural_gas_neu: # consumed nat gas to chemical plants !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + transportation_lubricants: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants:attribution_source:Detail_Use_YEAR + + refrigerants: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants:attribution_source:Detail_Use_YEAR + + air_conditioning: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:air_conditioning + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:air_conditioning:attribution_source:Detail_Use_YEAR + + foams: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:foams + attribution_source: + Detail_Use_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:foams:attribution_source:Detail_Use_YEAR + + magnesium: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium + attribution_source: + Detail_Supply_2016: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium:attribution_source:Detail_Supply_YEAR EPA_GHGI_T_2_1: #U.S. GHG emissions !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 From 8e7970fb7adb2cd618fafe85f9e29717705ebdd4 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 20 Oct 2023 15:46:17 -0400 Subject: [PATCH 1076/1127] fix error in USGS lead year --- .../flowbysectormethods/GHG_national_2017_m2.yaml | 9 +++++++++ .../flowbysectormethods/GHG_national_2018_m2.yaml | 9 +++++++++ .../flowbysectormethods/GHG_national_2019_m2.yaml | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2017_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2017_m2.yaml index a22ec8684..d53a7834d 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2017_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2017_m2.yaml @@ -246,6 +246,15 @@ source_names: EPA_GHGI_T_2_1: #U.S. GHG emissions !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year + activity_sets: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + lead: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead + attribution_source: + USGS_MYB_Lead: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead + year: *ghgi_year + EPA_GHGI_T_3_68: #CH4 from Natural Gas Systems !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2018_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2018_m2.yaml index ad3e4d2c3..8c0498a35 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2018_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2018_m2.yaml @@ -246,6 +246,15 @@ source_names: EPA_GHGI_T_2_1: #U.S. GHG emissions !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year + activity_sets: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + lead: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead + attribution_source: + USGS_MYB_Lead: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead + year: *ghgi_year + EPA_GHGI_T_3_68: #CH4 from Natural Gas Systems !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml index b9608b652..41aa5fe4c 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml @@ -246,6 +246,15 @@ source_names: EPA_GHGI_T_2_1: #U.S. GHG emissions !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year + activity_sets: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + lead: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead + attribution_source: + USGS_MYB_Lead: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead + year: *ghgi_year + EPA_GHGI_T_3_68: #CH4 from Natural Gas Systems !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year From 609be4c15e293c3376718449253b34ba3de9d254 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 23 Oct 2023 12:55:29 -0400 Subject: [PATCH 1077/1127] for data years prior to 2017, use BEA FBAs for make and use (2012) --- .../GHG_national_2015_m1.yaml | 182 +++++++++------ .../GHG_national_2015_m2.yaml | 215 +++++++++++------- .../GHG_national_2016_m1.yaml | 182 +++++++++------ .../GHG_national_2016_m2.yaml | 215 +++++++++++------- .../GHG_national_m1_common.yaml | 4 +- .../GHG_national_m2_common.yaml | 4 +- 6 files changed, 514 insertions(+), 288 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml index 4d3b1ceda..4068a5d97 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml @@ -13,22 +13,17 @@ _industrial_allocation_dict: &industrial_dict year: *mecs_year ghg_fba: 'EPA_GHGI_T_A_11' # 2014 Table -sources_to_cache: - Detail_Use_2015: - !include:Detail_Use.yaml - year: *ghgi_year - source_names: - BEA_Summary_Use_SUT: - !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT - year: *ghgi_year - - Detail_Supply_2015: - !include:Detail_Supply.yaml - year: *ghgi_year - source_names: - BEA_Summary_Supply: - !include:Detail_Supply.yaml:source_names:BEA_Summary_Supply - year: *ghgi_year +_attribution_sources: + BEA: &bea # 2012 Make and Use tables + year: 2012 + activity_to_sector_mapping: BEA_2012_Detail + exclusion_fields: + # Drop irrelevant final demand and total sectors + ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', + 'F06E00', 'F07E00', 'F10E00', + 'T001', 'T004', 'T007'] + ActivityProducedBy: ['T007'] + attribution_method: equal source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions @@ -39,33 +34,50 @@ source_names: electric_power: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power attribution_source: - Detail_Supply_2015: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR + BEA_Detail_Make_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity + liming: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming attribution_source: - Detail_Use_2015: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'327400': ''} # Lime + urea: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea attribution_source: - Detail_Use_2015: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + urea_fertilizer: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer attribution_source: - Detail_Use_2015: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + carbonate_use: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use attribution_source: - Detail_Use_2015: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + nitrous_oxide_use: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use attribution_source: - Detail_Use_2015: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325120': ''} # Industrial gases "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 @@ -109,8 +121,10 @@ source_names: petroleum_fuels: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels attribution_source: - Detail_Use_2015: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 @@ -120,38 +134,50 @@ source_names: petroleum_fuels_diesel: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel attribution_source: - Detail_Use_2015: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products petroleum_fuels_gasoline: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline attribution_source: - Detail_Use_2015: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products construction_and_mining: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining attribution_source: - Detail_Use_2015: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment farm_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road attribution_source: - Detail_Use_2015: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333111': ''} # purchases of farm machinery other_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road attribution_source: - Detail_Use_2015: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products alt_fuel_on_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road attribution_source: - Detail_Use_2015: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 @@ -172,18 +198,28 @@ source_names: refrigerants: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants attribution_source: - Detail_Use_2015: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment + air_conditioning: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning attribution_source: - Detail_Use_2015: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment + foams: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams attribution_source: - Detail_Use_2015: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: + '326140': '' # Polystyrene foam + '326150': '' # Urethane and other foam "EPA_GHGI_T_A_97": # HFCs from Transportation @@ -215,8 +251,10 @@ source_names: transportation_lubricants: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants attribution_source: - Detail_Use_2015: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # use of petroleum products ### Major CO2 Sources "EPA_GHGI_T_A_10": # CO2 emissions from stationary combustion. This table number varies by GHG year. @@ -228,13 +266,18 @@ source_names: non_manufacturing_coal: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal attribution_source: - Detail_Use_2015: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal + non_manufacturing_natural_gas: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas attribution_source: - Detail_Use_2015: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas coal_manufacturing_co2: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 @@ -252,8 +295,10 @@ source_names: petroleum: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum attribution_source: - Detail_Use_2015: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 @@ -265,25 +310,34 @@ source_names: electric_power: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power attribution_source: - Detail_Supply_2015: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR + BEA_Detail_Make_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity fuel_oil: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil attribution_source: - Detail_Use_2015: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products natural_gas_nonmanufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing attribution_source: - Detail_Use_2015: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + coal_nonmanufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing attribution_source: - Detail_Use_2015: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2015_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2015_m2.yaml index 90e29be14..1d1ac8a39 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2015_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2015_m2.yaml @@ -9,22 +9,17 @@ ghgi_year: &ghgi_year 2015 mecs_year: &mecs_year 2014 -sources_to_cache: - Detail_Use_2015: - !include:Detail_Use.yaml - year: *ghgi_year - source_names: - BEA_Summary_Use_SUT: - !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT - year: *ghgi_year - - Detail_Supply_2015: - !include:Detail_Supply.yaml - year: *ghgi_year - source_names: - BEA_Summary_Supply: - !include:Detail_Supply.yaml:source_names:BEA_Summary_Supply - year: *ghgi_year +_attribution_sources: + BEA: &bea # 2012 Make and Use tables + year: 2012 + activity_to_sector_mapping: BEA_2012_Detail + exclusion_fields: + # Drop irrelevant final demand and total sectors + ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', + 'F06E00', 'F07E00', 'F10E00', + 'T001', 'T004', 'T007'] + ActivityProducedBy: ['T007'] + attribution_method: equal source_names: GHG_national_2015_m1: # National Summary model @@ -36,92 +31,122 @@ source_names: liming: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:liming attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:liming:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'327400': ''} # Lime urea: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers urea_fertilizer: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers carbonate_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals nitrous_oxide_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325120': ''} # Industrial gases fertilizer_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers petroleum_fuels: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products petroleum_fuels_diesel: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products petroleum_fuels_gasoline: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products construction_and_mining: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment farm_non_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333111': ''} # purchases of farm machinery other_non_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:other_non_road attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:other_non_road:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products alt_fuel_on_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas non_manufacturing_coal: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal non_manufacturing_natural_gas: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas coal_manufacturing_co2: # Industrial Coal for Manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 @@ -130,8 +155,10 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing @@ -140,38 +167,50 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas petroleum: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products electric_power: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power attribution_source: - Detail_Supply_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR + BEA_Detail_Make_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity fuel_oil: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products natural_gas_nonmanufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas coal_nonmanufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal coal_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing @@ -180,8 +219,10 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal ng_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing @@ -190,8 +231,10 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas petroleum_neu: # consumed petroleum products !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu @@ -200,8 +243,10 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products natural_gas_neu: # consumed nat gas to chemical plants !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu @@ -210,38 +255,52 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas transportation_lubricants: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products refrigerants: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment air_conditioning: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:air_conditioning attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:air_conditioning:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment foams: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:foams attribution_source: - Detail_Use_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:foams:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: + '326140': '' # Polystyrene foam + '326150': '' # Urethane and other foam magnesium: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium attribution_source: - Detail_Supply_2015: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium:attribution_source:Detail_Supply_YEAR + BEA_Detail_Make_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {T008: ''} # Total Output EPA_GHGI_T_2_1: #U.S. GHG emissions !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml index 3e87906b9..377014aa8 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml @@ -13,22 +13,17 @@ _industrial_allocation_dict: &industrial_dict year: *mecs_year ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table -sources_to_cache: - Detail_Use_2016: - !include:Detail_Use.yaml - year: *ghgi_year - source_names: - BEA_Summary_Use_SUT: - !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT - year: *ghgi_year - - Detail_Supply_2016: - !include:Detail_Supply.yaml - year: *ghgi_year - source_names: - BEA_Summary_Supply: - !include:Detail_Supply.yaml:source_names:BEA_Summary_Supply - year: *ghgi_year +_attribution_sources: + BEA: &bea # 2012 Make and Use tables + year: 2012 + activity_to_sector_mapping: BEA_2012_Detail + exclusion_fields: + # Drop irrelevant final demand and total sectors + ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', + 'F06E00', 'F07E00', 'F10E00', + 'T001', 'T004', 'T007'] + ActivityProducedBy: ['T007'] + attribution_method: equal source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions @@ -39,33 +34,50 @@ source_names: electric_power: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power attribution_source: - Detail_Supply_2016: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR + BEA_Detail_Make_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity + liming: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming attribution_source: - Detail_Use_2016: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'327400': ''} # Lime + urea: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea attribution_source: - Detail_Use_2016: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + urea_fertilizer: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer attribution_source: - Detail_Use_2016: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + carbonate_use: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use attribution_source: - Detail_Use_2016: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + nitrous_oxide_use: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use attribution_source: - Detail_Use_2016: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325120': ''} # Industrial gases "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 @@ -109,8 +121,10 @@ source_names: petroleum_fuels: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels attribution_source: - Detail_Use_2016: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 @@ -120,38 +134,50 @@ source_names: petroleum_fuels_diesel: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel attribution_source: - Detail_Use_2016: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products petroleum_fuels_gasoline: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline attribution_source: - Detail_Use_2016: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products construction_and_mining: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining attribution_source: - Detail_Use_2016: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment farm_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road attribution_source: - Detail_Use_2016: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333111': ''} # purchases of farm machinery other_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road attribution_source: - Detail_Use_2016: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products alt_fuel_on_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road attribution_source: - Detail_Use_2016: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 @@ -172,18 +198,28 @@ source_names: refrigerants: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants attribution_source: - Detail_Use_2016: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment + air_conditioning: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning attribution_source: - Detail_Use_2016: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment + foams: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams attribution_source: - Detail_Use_2016: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: + '326140': '' # Polystyrene foam + '326150': '' # Urethane and other foam "EPA_GHGI_T_A_97": # HFCs from Transportation @@ -215,8 +251,10 @@ source_names: transportation_lubricants: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants attribution_source: - Detail_Use_2016: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # use of petroleum products ### Major CO2 Sources "EPA_GHGI_T_A_9": # CO2 emissions from stationary combustion. This table number varies by GHG year. @@ -228,13 +266,18 @@ source_names: non_manufacturing_coal: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal attribution_source: - Detail_Use_2016: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal + non_manufacturing_natural_gas: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas attribution_source: - Detail_Use_2016: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas coal_manufacturing_co2: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 @@ -252,8 +295,10 @@ source_names: petroleum: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum attribution_source: - Detail_Use_2016: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 @@ -265,25 +310,34 @@ source_names: electric_power: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power attribution_source: - Detail_Supply_2016: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR + BEA_Detail_Make_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity fuel_oil: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil attribution_source: - Detail_Use_2016: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products natural_gas_nonmanufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing attribution_source: - Detail_Use_2016: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + coal_nonmanufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing attribution_source: - Detail_Use_2016: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2016_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2016_m2.yaml index de55f40d2..8ef42136e 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2016_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2016_m2.yaml @@ -9,22 +9,17 @@ ghgi_year: &ghgi_year 2016 mecs_year: &mecs_year 2018 -sources_to_cache: - Detail_Use_2016: - !include:Detail_Use.yaml - year: *ghgi_year - source_names: - BEA_Summary_Use_SUT: - !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT - year: *ghgi_year - - Detail_Supply_2016: - !include:Detail_Supply.yaml - year: *ghgi_year - source_names: - BEA_Summary_Supply: - !include:Detail_Supply.yaml:source_names:BEA_Summary_Supply - year: *ghgi_year +_attribution_sources: + BEA: &bea # 2012 Make and Use tables + year: 2012 + activity_to_sector_mapping: BEA_2012_Detail + exclusion_fields: + # Drop irrelevant final demand and total sectors + ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', + 'F06E00', 'F07E00', 'F10E00', + 'T001', 'T004', 'T007'] + ActivityProducedBy: ['T007'] + attribution_method: equal source_names: GHG_national_2016_m1: # National Summary model @@ -36,92 +31,122 @@ source_names: liming: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:liming attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:liming:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'327400': ''} # Lime urea: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers urea_fertilizer: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers carbonate_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals nitrous_oxide_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325120': ''} # Industrial gases fertilizer_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers petroleum_fuels: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products petroleum_fuels_diesel: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products petroleum_fuels_gasoline: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products construction_and_mining: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment farm_non_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333111': ''} # purchases of farm machinery other_non_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:other_non_road attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:other_non_road:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products alt_fuel_on_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas non_manufacturing_coal: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal non_manufacturing_natural_gas: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas coal_manufacturing_co2: # Industrial Coal for Manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 @@ -130,8 +155,10 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing @@ -140,38 +167,50 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas petroleum: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products electric_power: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power attribution_source: - Detail_Supply_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR + BEA_Detail_Make_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity fuel_oil: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products natural_gas_nonmanufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas coal_nonmanufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal coal_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing @@ -180,8 +219,10 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal ng_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing @@ -190,8 +231,10 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas petroleum_neu: # consumed petroleum products !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu @@ -200,8 +243,10 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products natural_gas_neu: # consumed nat gas to chemical plants !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu @@ -210,38 +255,52 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas transportation_lubricants: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products refrigerants: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment air_conditioning: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:air_conditioning attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:air_conditioning:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment foams: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:foams attribution_source: - Detail_Use_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:foams:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: + '326140': '' # Polystyrene foam + '326150': '' # Urethane and other foam magnesium: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium attribution_source: - Detail_Supply_2016: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium:attribution_source:Detail_Supply_YEAR + BEA_Detail_Make_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {T008: ''} # Total Output EPA_GHGI_T_2_1: #U.S. GHG emissions !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml index c99af1279..f74c01f31 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml @@ -32,7 +32,7 @@ _attribution_sources: # selection_fields: # ActivityProducedBy: {'XXXXX': ''} -sources_to_cache: +_sources_to_cache: Detail_Use_YEAR: ## Update year !include:Detail_Use.yaml # year: *ghgi_year @@ -41,7 +41,7 @@ sources_to_cache: !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT # year: *ghgi_year - Detail_Supply_2020: + Detail_Supply_YEAR: !include:Detail_Supply.yaml # year: *ghgi_year source_names: diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml index f81e18eec..62121c1e9 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml @@ -57,7 +57,7 @@ attribution_sources: FlowName: FARM OPERATIONS estimate_suppressed: !clean_function:flowbyclean estimate_suppressed_sectors_equal_attribution -sources_to_cache: +_sources_to_cache: Detail_Use_YEAR: ## Update year !include:Detail_Use.yaml # year: *ghgi_year @@ -66,7 +66,7 @@ sources_to_cache: !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT # year: *ghgi_year - Detail_Supply_2020: + Detail_Supply_YEAR: !include:Detail_Supply.yaml # year: *ghgi_year source_names: From 341e9f743bf737929efaaeeecbc82df8277460c0 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 23 Oct 2023 13:08:20 -0400 Subject: [PATCH 1078/1127] fix missing USGS year --- .../flowbysectormethods/GHG_national_2015_m2.yaml | 9 +++++++++ .../flowbysectormethods/GHG_national_2016_m2.yaml | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2015_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2015_m2.yaml index 1d1ac8a39..a145432a6 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2015_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2015_m2.yaml @@ -305,6 +305,15 @@ source_names: EPA_GHGI_T_2_1: #U.S. GHG emissions !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year + activity_sets: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + lead: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead + attribution_source: + USGS_MYB_Lead: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead + year: *ghgi_year + EPA_GHGI_T_3_68: #CH4 from Natural Gas Systems !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2016_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2016_m2.yaml index 8ef42136e..316d0067b 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2016_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2016_m2.yaml @@ -305,6 +305,15 @@ source_names: EPA_GHGI_T_2_1: #U.S. GHG emissions !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year + activity_sets: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + lead: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead + attribution_source: + USGS_MYB_Lead: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead + year: *ghgi_year + EPA_GHGI_T_3_68: #CH4 from Natural Gas Systems !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year From 48eac93bc109ed7b5c6ae6953e08a24488edfa38 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 23 Oct 2023 13:08:36 -0400 Subject: [PATCH 1079/1127] update 2012-2014 GHG FBS --- .../GHG_national_2012_m1.yaml | 201 +++++++++--- .../GHG_national_2012_m2.yaml | 292 ++++++++++++++++-- .../GHG_national_2013_m1.yaml | 201 +++++++++--- .../GHG_national_2013_m2.yaml | 292 ++++++++++++++++-- .../GHG_national_2014_m1.yaml | 201 +++++++++--- .../GHG_national_2014_m2.yaml | 292 ++++++++++++++++-- 6 files changed, 1305 insertions(+), 174 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml index e1f516534..3862cd8a5 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml @@ -13,10 +13,71 @@ _industrial_allocation_dict: &industrial_dict year: *mecs_year ghg_fba: 'EPA_GHGI_T_A_11' # 2014 Table +_attribution_sources: + BEA: &bea # 2012 Make and Use tables + year: 2012 + activity_to_sector_mapping: BEA_2012_Detail + exclusion_fields: + # Drop irrelevant final demand and total sectors + ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', + 'F06E00', 'F07E00', 'F10E00', + 'T001', 'T004', 'T007'] + ActivityProducedBy: ['T007'] + attribution_method: equal + source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + electric_power: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power + attribution_source: + BEA_Detail_Make_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity + + liming: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'327400': ''} # Lime + + urea: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + + urea_fertilizer: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + + carbonate_use: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + + nitrous_oxide_use: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325120': ''} # Industrial gases "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 @@ -51,6 +112,7 @@ source_names: "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 year: *ghgi_year @@ -59,9 +121,10 @@ source_names: petroleum_fuels: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 @@ -71,45 +134,50 @@ source_names: petroleum_fuels_diesel: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products petroleum_fuels_gasoline: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products construction_and_mining: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment farm_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333111': ''} # purchases of farm machinery other_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products alt_fuel_on_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 @@ -125,6 +193,34 @@ source_names: "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets + refrigerants: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment + + air_conditioning: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment + + foams: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: + '326140': '' # Polystyrene foam + '326150': '' # Urethane and other foam + "EPA_GHGI_T_A_97": # HFCs from Transportation !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 @@ -155,10 +251,10 @@ source_names: transportation_lubricants: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # use of petroleum products ### Major CO2 Sources "EPA_GHGI_T_A_13": # CO2 emissions from stationary combustion. This table number varies by GHG year. @@ -167,12 +263,21 @@ source_names: clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS and BEA year for some activity_sets !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + non_manufacturing_coal: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal + non_manufacturing_natural_gas: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas coal_manufacturing_co2: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 @@ -190,9 +295,10 @@ source_names: petroleum: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 @@ -201,18 +307,37 @@ source_names: activity_sets: # Update EIA_MECS and BEA year for some activity_sets !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + electric_power: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power + attribution_source: + BEA_Detail_Make_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity + fuel_oil: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + natural_gas_nonmanufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + coal_nonmanufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2012_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2012_m2.yaml index a4a40c91f..301b2bca6 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2012_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2012_m2.yaml @@ -9,6 +9,18 @@ ghgi_year: &ghgi_year 2012 mecs_year: &mecs_year 2014 coa_year: &coa_year 2012 +_attribution_sources: + BEA: &bea # 2012 Make and Use tables + year: 2012 + activity_to_sector_mapping: BEA_2012_Detail + exclusion_fields: + # Drop irrelevant final demand and total sectors + ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', + 'F06E00', 'F07E00', 'F10E00', + 'T001', 'T004', 'T007'] + ActivityProducedBy: ['T007'] + attribution_method: equal + source_names: GHG_national_2012_m1: # National Summary model !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1 @@ -16,70 +28,310 @@ source_names: activity_sets: # Update MECS and CoA year for some activity sets !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets - cropland: # allocated based on USDA land area harvested - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:cropland + liming: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:liming attribution_source: - USDA_CoA_Cropland: - !include:GHG_national_m2_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland - year: *coa_year - attribution_source: - USDA_CoA_Cropland_NAICS: - !include:GHG_national_m2_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland:attribution_source:USDA_CoA_Cropland_NAICS - year: *coa_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'327400': ''} # Lime - pasture: # allocated based on USDA Animal operation land (acres) - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:pasture + urea: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea attribution_source: - USDA_CoA_Cropland_NAICS: - !include:GHG_national_m2_common.yaml:attribution_sources:_animal_land_allocation:USDA_CoA_Cropland_NAICS - year: *coa_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + + urea_fertilizer: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + + carbonate_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + + nitrous_oxide_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325120': ''} # Industrial gases + + fertilizer_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + + petroleum_fuels: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + petroleum_fuels_diesel: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + petroleum_fuels_gasoline: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + construction_and_mining: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment + + farm_non_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333111': ''} # purchases of farm machinery + + other_non_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:other_non_road + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + alt_fuel_on_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + non_manufacturing_coal: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal + + non_manufacturing_natural_gas: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas coal_manufacturing_co2: # Industrial Coal for Manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + petroleum: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + electric_power: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power + attribution_source: + BEA_Detail_Make_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity + + fuel_oil: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + natural_gas_nonmanufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + coal_nonmanufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal coal_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal ng_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas petroleum_neu: # consumed petroleum products !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products natural_gas_neu: # consumed nat gas to chemical plants !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + transportation_lubricants: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + refrigerants: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment + + air_conditioning: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:air_conditioning + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment + + foams: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:foams + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: + '326140': '' # Polystyrene foam + '326150': '' # Urethane and other foam + + magnesium: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium + attribution_source: + BEA_Detail_Make_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {T008: ''} # Total Output + + cropland: # allocated based on USDA land area harvested + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:cropland + attribution_source: + USDA_CoA_Cropland: + !include:GHG_national_m2_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland + year: *coa_year + attribution_source: + USDA_CoA_Cropland_NAICS: + !include:GHG_national_m2_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland:attribution_source:USDA_CoA_Cropland_NAICS + year: *coa_year + + pasture: # allocated based on USDA Animal operation land (acres) + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:pasture + attribution_source: + USDA_CoA_Cropland_NAICS: + !include:GHG_national_m2_common.yaml:attribution_sources:_animal_land_allocation:USDA_CoA_Cropland_NAICS + year: *coa_year EPA_GHGI_T_2_1: #U.S. GHG emissions !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year + activity_sets: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + lead: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead + attribution_source: + USGS_MYB_Lead: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead + year: *ghgi_year + EPA_GHGI_T_3_68: #CH4 from Natural Gas Systems !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml index 6a62bc018..deeff8841 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml @@ -13,10 +13,71 @@ _industrial_allocation_dict: &industrial_dict year: *mecs_year ghg_fba: 'EPA_GHGI_T_A_11' # 2014 Table +_attribution_sources: + BEA: &bea # 2012 Make and Use tables + year: 2012 + activity_to_sector_mapping: BEA_2012_Detail + exclusion_fields: + # Drop irrelevant final demand and total sectors + ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', + 'F06E00', 'F07E00', 'F10E00', + 'T001', 'T004', 'T007'] + ActivityProducedBy: ['T007'] + attribution_method: equal + source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + electric_power: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power + attribution_source: + BEA_Detail_Make_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity + + liming: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'327400': ''} # Lime + + urea: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + + urea_fertilizer: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + + carbonate_use: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + + nitrous_oxide_use: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325120': ''} # Industrial gases "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 @@ -51,6 +112,7 @@ source_names: "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 year: *ghgi_year @@ -59,9 +121,10 @@ source_names: petroleum_fuels: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 @@ -71,45 +134,50 @@ source_names: petroleum_fuels_diesel: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products petroleum_fuels_gasoline: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products construction_and_mining: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment farm_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333111': ''} # purchases of farm machinery other_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products alt_fuel_on_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 @@ -125,6 +193,34 @@ source_names: "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets + refrigerants: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment + + air_conditioning: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment + + foams: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: + '326140': '' # Polystyrene foam + '326150': '' # Urethane and other foam + "EPA_GHGI_T_A_97": # HFCs from Transportation !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 @@ -155,10 +251,10 @@ source_names: transportation_lubricants: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # use of petroleum products ### Major CO2 Sources "EPA_GHGI_T_A_12": # CO2 emissions from stationary combustion. This table number varies by GHG year. @@ -167,12 +263,21 @@ source_names: clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS and BEA year for some activity_sets !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + non_manufacturing_coal: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal + non_manufacturing_natural_gas: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas coal_manufacturing_co2: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 @@ -190,9 +295,10 @@ source_names: petroleum: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 @@ -201,18 +307,37 @@ source_names: activity_sets: # Update EIA_MECS and BEA year for some activity_sets !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + electric_power: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power + attribution_source: + BEA_Detail_Make_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity + fuel_oil: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + natural_gas_nonmanufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + coal_nonmanufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2013_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2013_m2.yaml index 96317a8bf..cc9d69f66 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2013_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2013_m2.yaml @@ -9,6 +9,18 @@ ghgi_year: &ghgi_year 2013 mecs_year: &mecs_year 2014 coa_year: &coa_year 2012 +_attribution_sources: + BEA: &bea # 2012 Make and Use tables + year: 2012 + activity_to_sector_mapping: BEA_2012_Detail + exclusion_fields: + # Drop irrelevant final demand and total sectors + ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', + 'F06E00', 'F07E00', 'F10E00', + 'T001', 'T004', 'T007'] + ActivityProducedBy: ['T007'] + attribution_method: equal + source_names: GHG_national_2013_m1: # National Summary model !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1 @@ -16,70 +28,310 @@ source_names: activity_sets: # Update MECS and CoA year for some activity sets !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets - cropland: # allocated based on USDA land area harvested - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:cropland + liming: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:liming attribution_source: - USDA_CoA_Cropland: - !include:GHG_national_m2_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland - year: *coa_year - attribution_source: - USDA_CoA_Cropland_NAICS: - !include:GHG_national_m2_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland:attribution_source:USDA_CoA_Cropland_NAICS - year: *coa_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'327400': ''} # Lime - pasture: # allocated based on USDA Animal operation land (acres) - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:pasture + urea: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea attribution_source: - USDA_CoA_Cropland_NAICS: - !include:GHG_national_m2_common.yaml:attribution_sources:_animal_land_allocation:USDA_CoA_Cropland_NAICS - year: *coa_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + + urea_fertilizer: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + + carbonate_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + + nitrous_oxide_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325120': ''} # Industrial gases + + fertilizer_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + + petroleum_fuels: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + petroleum_fuels_diesel: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + petroleum_fuels_gasoline: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + construction_and_mining: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment + + farm_non_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333111': ''} # purchases of farm machinery + + other_non_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:other_non_road + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + alt_fuel_on_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + non_manufacturing_coal: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal + + non_manufacturing_natural_gas: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas coal_manufacturing_co2: # Industrial Coal for Manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + petroleum: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + electric_power: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power + attribution_source: + BEA_Detail_Make_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity + + fuel_oil: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + natural_gas_nonmanufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + coal_nonmanufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal coal_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal ng_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas petroleum_neu: # consumed petroleum products !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products natural_gas_neu: # consumed nat gas to chemical plants !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + transportation_lubricants: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + refrigerants: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment + + air_conditioning: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:air_conditioning + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment + + foams: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:foams + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: + '326140': '' # Polystyrene foam + '326150': '' # Urethane and other foam + + magnesium: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium + attribution_source: + BEA_Detail_Make_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {T008: ''} # Total Output + + cropland: # allocated based on USDA land area harvested + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:cropland + attribution_source: + USDA_CoA_Cropland: + !include:GHG_national_m2_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland + year: *coa_year + attribution_source: + USDA_CoA_Cropland_NAICS: + !include:GHG_national_m2_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland:attribution_source:USDA_CoA_Cropland_NAICS + year: *coa_year + + pasture: # allocated based on USDA Animal operation land (acres) + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:pasture + attribution_source: + USDA_CoA_Cropland_NAICS: + !include:GHG_national_m2_common.yaml:attribution_sources:_animal_land_allocation:USDA_CoA_Cropland_NAICS + year: *coa_year EPA_GHGI_T_2_1: #U.S. GHG emissions !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year + activity_sets: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + lead: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead + attribution_source: + USGS_MYB_Lead: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead + year: *ghgi_year + EPA_GHGI_T_3_68: #CH4 from Natural Gas Systems !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml index 7b4a64483..93f4587f0 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml @@ -13,10 +13,71 @@ _industrial_allocation_dict: &industrial_dict year: *mecs_year ghg_fba: 'EPA_GHGI_T_A_11' # 2014 Table +_attribution_sources: + BEA: &bea # 2012 Make and Use tables + year: 2012 + activity_to_sector_mapping: BEA_2012_Detail + exclusion_fields: + # Drop irrelevant final demand and total sectors + ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', + 'F06E00', 'F07E00', 'F10E00', + 'T001', 'T004', 'T007'] + ActivityProducedBy: ['T007'] + attribution_method: equal + source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + electric_power: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power + attribution_source: + BEA_Detail_Make_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity + + liming: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'327400': ''} # Lime + + urea: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + + urea_fertilizer: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + + carbonate_use: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + + nitrous_oxide_use: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325120': ''} # Industrial gases "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 @@ -51,6 +112,7 @@ source_names: "EPA_GHGI_T_5_18": #Indirect N2O emissions from agricultural soils !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_5_18 year: *ghgi_year + "EPA_GHGI_T_3_13": #CO2 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13 year: *ghgi_year @@ -59,9 +121,10 @@ source_names: petroleum_fuels: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 @@ -71,45 +134,50 @@ source_names: petroleum_fuels_diesel: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products petroleum_fuels_gasoline: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products construction_and_mining: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment farm_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333111': ''} # purchases of farm machinery other_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products alt_fuel_on_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 @@ -125,6 +193,34 @@ source_names: "EPA_GHGI_T_4_102": # HFCs and PFCs from ODS Substitutes !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102 year: *ghgi_year + activity_sets: # Update BEA year for some activity_sets + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets + refrigerants: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment + + air_conditioning: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment + + foams: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: + '326140': '' # Polystyrene foam + '326150': '' # Urethane and other foam + "EPA_GHGI_T_A_97": # HFCs from Transportation !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_A_97 @@ -155,10 +251,10 @@ source_names: transportation_lubricants: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year - + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # use of petroleum products ### Major CO2 Sources "EPA_GHGI_T_A_11": # CO2 emissions from stationary combustion. This table number varies by GHG year. @@ -167,12 +263,21 @@ source_names: clean_parameter: *industrial_dict activity_sets: # Update EIA_MECS and BEA year for some activity_sets !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets + non_manufacturing_coal: + !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal + non_manufacturing_natural_gas: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas coal_manufacturing_co2: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 @@ -190,9 +295,10 @@ source_names: petroleum: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 @@ -201,18 +307,37 @@ source_names: activity_sets: # Update EIA_MECS and BEA year for some activity_sets !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets + electric_power: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power + attribution_source: + BEA_Detail_Make_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity + fuel_oil: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + natural_gas_nonmanufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing attribution_source: - BEA_Summary_Use_PRO_BeforeRedef: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:BEA_Summary_Use_PRO_BeforeRedef - year: *ghgi_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + coal_nonmanufacturing: + !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2014_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2014_m2.yaml index e776fb1a4..571cd802d 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2014_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2014_m2.yaml @@ -9,6 +9,18 @@ ghgi_year: &ghgi_year 2014 mecs_year: &mecs_year 2014 coa_year: &coa_year 2012 +_attribution_sources: + BEA: &bea # 2012 Make and Use tables + year: 2012 + activity_to_sector_mapping: BEA_2012_Detail + exclusion_fields: + # Drop irrelevant final demand and total sectors + ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', + 'F06E00', 'F07E00', 'F10E00', + 'T001', 'T004', 'T007'] + ActivityProducedBy: ['T007'] + attribution_method: equal + source_names: GHG_national_2014_m1: # National Summary model !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1 @@ -16,70 +28,310 @@ source_names: activity_sets: # Update MECS and CoA year for some activity sets !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets - cropland: # allocated based on USDA land area harvested - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:cropland + liming: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:liming attribution_source: - USDA_CoA_Cropland: - !include:GHG_national_m2_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland - year: *coa_year - attribution_source: - USDA_CoA_Cropland_NAICS: - !include:GHG_national_m2_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland:attribution_source:USDA_CoA_Cropland_NAICS - year: *coa_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'327400': ''} # Lime - pasture: # allocated based on USDA Animal operation land (acres) - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:pasture + urea: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea attribution_source: - USDA_CoA_Cropland_NAICS: - !include:GHG_national_m2_common.yaml:attribution_sources:_animal_land_allocation:USDA_CoA_Cropland_NAICS - year: *coa_year + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + + urea_fertilizer: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + + carbonate_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + + nitrous_oxide_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325120': ''} # Industrial gases + + fertilizer_use: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + + petroleum_fuels: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + petroleum_fuels_diesel: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + petroleum_fuels_gasoline: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + construction_and_mining: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment + + farm_non_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333111': ''} # purchases of farm machinery + + other_non_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:other_non_road + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + alt_fuel_on_road: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + non_manufacturing_coal: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal + + non_manufacturing_natural_gas: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas coal_manufacturing_co2: # Industrial Coal for Manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + petroleum: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + electric_power: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power + attribution_source: + BEA_Detail_Make_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity + + fuel_oil: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + natural_gas_nonmanufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + + coal_nonmanufacturing: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal coal_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal ng_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas petroleum_neu: # consumed petroleum products !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products natural_gas_neu: # consumed nat gas to chemical plants !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu attribution_source: EIA_MECS_Energy: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy - year: *mecs_year + year: *mecs_year + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + transportation_lubricants: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products + + refrigerants: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment + + air_conditioning: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:air_conditioning + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment + + foams: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:foams + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + <<: *bea + selection_fields: + ActivityProducedBy: + '326140': '' # Polystyrene foam + '326150': '' # Urethane and other foam + + magnesium: + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium + attribution_source: + BEA_Detail_Make_BeforeRedef: + <<: *bea + selection_fields: + ActivityConsumedBy: {T008: ''} # Total Output + + cropland: # allocated based on USDA land area harvested + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:cropland + attribution_source: + USDA_CoA_Cropland: + !include:GHG_national_m2_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland + year: *coa_year + attribution_source: + USDA_CoA_Cropland_NAICS: + !include:GHG_national_m2_common.yaml:attribution_sources:_cropland_allocation:USDA_CoA_Cropland:attribution_source:USDA_CoA_Cropland_NAICS + year: *coa_year + + pasture: # allocated based on USDA Animal operation land (acres) + !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:pasture + attribution_source: + USDA_CoA_Cropland_NAICS: + !include:GHG_national_m2_common.yaml:attribution_sources:_animal_land_allocation:USDA_CoA_Cropland_NAICS + year: *coa_year EPA_GHGI_T_2_1: #U.S. GHG emissions !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 year: *ghgi_year + activity_sets: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets + lead: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead + attribution_source: + USGS_MYB_Lead: + !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:lead:attribution_source:USGS_MYB_Lead + year: *ghgi_year + EPA_GHGI_T_3_68: #CH4 from Natural Gas Systems !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_3_68 year: *ghgi_year From 8b62f34221c128356649726754a5b46ae8aa4144 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 23 Oct 2023 14:44:50 -0400 Subject: [PATCH 1080/1127] drop loading config for simply accessing an FBS, see #389 --- flowsa/flowbysector.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flowsa/flowbysector.py b/flowsa/flowbysector.py index c897eedf1..d81643960 100644 --- a/flowsa/flowbysector.py +++ b/flowsa/flowbysector.py @@ -92,12 +92,12 @@ def return_FBS( ''' file_metadata = metadata.set_fb_meta(method, 'FlowBySector') - if config is None: - try: - config = common.load_yaml_dict(method, 'FBS', - external_config_path) - except exceptions.FlowsaMethodNotFoundError: - config = {} + # if config is None: + # try: + # config = common.load_yaml_dict(method, 'FBS', + # external_config_path) + # except exceptions.FlowsaMethodNotFoundError: + # config = {} flowby_generator = ( lambda x=method, y=external_config_path, z=download_sources_ok: From 22026036842a1ca155cc04a2ec52ab32d089639a Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 23 Oct 2023 15:51:06 -0400 Subject: [PATCH 1081/1127] ensure special sectors are in the NAICS 2017 BEA cw --- flowsa/data/NAICS_to_BEA_Crosswalk_2017.csv | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/flowsa/data/NAICS_to_BEA_Crosswalk_2017.csv b/flowsa/data/NAICS_to_BEA_Crosswalk_2017.csv index c6ba49ded..ef74002e4 100644 --- a/flowsa/data/NAICS_to_BEA_Crosswalk_2017.csv +++ b/flowsa/data/NAICS_to_BEA_Crosswalk_2017.csv @@ -4062,11 +4062,11 @@ G,GFGD,S00500,92811,92811 G,GFGD,S00500,928110,928110 G,GFGN,S00600,92812,92812 G,GFGN,S00600,928120,928120 -F010,F010,F01000,F010,NA -F010,F010,F01000,F01000,NA -G,GFE,S00101,S00101,NA -G,GSLE,S00201,S00201,NA -G,GSLE,S00202,S00202,NA +F010,F010,F01000,F010,F010 +F010,F010,F01000,F01000,F01000 +G,GFE,S00101,S00101,S00101 +G,GSLE,S00201,S00201,S00201 +G,GSLE,S00202,S00202,S00202 42,42,4200ID,NA,NA F020,F02E,F02E00,NA,NA F020,F02N,F02N00,NA,NA From c408987014b60628a6b9d1cc1386f338977d1d3d Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 23 Oct 2023 16:15:31 -0400 Subject: [PATCH 1082/1127] fixes to stackBarChart related to changes in sector_aggregation --- flowsa/datavisualization.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/flowsa/datavisualization.py b/flowsa/datavisualization.py index 8e978fdc8..99d9d226d 100644 --- a/flowsa/datavisualization.py +++ b/flowsa/datavisualization.py @@ -176,7 +176,7 @@ def stackedBarChart(df, # if the df provided is a string, load the fbs method, otherwise use the # df provided if (type(df)) == str: - df = flowsa.FlowBySector.return_FBS(df) + df = flowsa.flowbysector.FlowBySector.return_FBS(df) if generalize_AttributionSources: df['AttributionSources'] = np.where( @@ -188,10 +188,14 @@ def stackedBarChart(df, for k, v in selection_fields.items(): df = df[df[k].str.startswith(tuple(v))] - df = flowsa.flowbysector.FlowBySector(df) + df = flowsa.flowbysector.FlowBySector(df.reset_index(drop=True)) # agg sectors for data visualization if industry_spec is not None: df.config['industry_spec'] = industry_spec + # determine naics year in df + df.config['target_naics_year'] = df['SectorSourceName'][0].split( + "_", 1)[1].split("_", 1)[0] + df = df.sector_aggregation() df = flowsa.flowbyfunctions.collapse_fbs_sectors(df) From 08a742d17e1e88bf2da9ffe3c95e1b5e0a67aab3 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 24 Oct 2023 13:02:56 -0400 Subject: [PATCH 1083/1127] rename Detail_Use -> Detail_Use_SUT --- flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2020.yaml | 4 ++-- flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2020.yaml | 4 ++-- flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2020.yaml | 4 ++-- .../{Detail_Use.yaml => Detail_Use_SUT.yaml} | 4 ++-- flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml | 4 ++-- flowsa/methods/flowbysectormethods/GHG_national_2017_m2.yaml | 4 ++-- flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml | 4 ++-- flowsa/methods/flowbysectormethods/GHG_national_2018_m2.yaml | 4 ++-- flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml | 4 ++-- flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml | 4 ++-- flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml | 4 ++-- flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml | 4 ++-- .../methods/flowbysectormethods/GHG_national_m1_common.yaml | 4 ++-- .../methods/flowbysectormethods/GHG_national_m2_common.yaml | 4 ++-- 14 files changed, 28 insertions(+), 28 deletions(-) rename flowsa/methods/flowbysectormethods/{Detail_Use.yaml => Detail_Use_SUT.yaml} (95%) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2020.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2020.yaml index 287a8b81d..8b61d4115 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2020.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2020.yaml @@ -10,11 +10,11 @@ _emission_year: &year 2020 sources_to_cache: Detail_Use_2020: - !include:Detail_Use.yaml + !include:Detail_Use_SUT.yaml year: *year source_names: BEA_Summary_Use_SUT: - !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + !include:Detail_Use_SUT.yaml:source_names:BEA_Summary_Use_SUT year: *year EIA_MECS_Energy: diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2020.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2020.yaml index 666f6f1e1..ee5e82cb7 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2020.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2020.yaml @@ -10,11 +10,11 @@ _emission_year: &year 2020 sources_to_cache: Detail_Use_2020: - !include:Detail_Use.yaml + !include:Detail_Use_SUT.yaml year: *year source_names: BEA_Summary_Use_SUT: - !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + !include:Detail_Use_SUT.yaml:source_names:BEA_Summary_Use_SUT year: *year source_names: diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2020.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2020.yaml index 28fe22b4f..e5ed60926 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2020.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2020.yaml @@ -10,11 +10,11 @@ _emission_year: &year 2020 sources_to_cache: Detail_Use_2020: - !include:Detail_Use.yaml + !include:Detail_Use_SUT.yaml year: *year source_names: BEA_Summary_Use_SUT: - !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + !include:Detail_Use_SUT.yaml:source_names:BEA_Summary_Use_SUT year: *year source_names: diff --git a/flowsa/methods/flowbysectormethods/Detail_Use.yaml b/flowsa/methods/flowbysectormethods/Detail_Use_SUT.yaml similarity index 95% rename from flowsa/methods/flowbysectormethods/Detail_Use.yaml rename to flowsa/methods/flowbysectormethods/Detail_Use_SUT.yaml index e5a70bfb4..714c1d745 100644 --- a/flowsa/methods/flowbysectormethods/Detail_Use.yaml +++ b/flowsa/methods/flowbysectormethods/Detail_Use_SUT.yaml @@ -5,11 +5,11 @@ # The full FBS for any year can be cached using: # sources_to_cache: # Detail_Use_2019: -# !include:Detail_Use.yaml +# !include:Detail_Use_SUT.yaml # year: *year # source_names: # BEA_Summary_Use_SUT: -# !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT +# !include:Detail_Use_SUT.yaml:source_names:BEA_Summary_Use_SUT # year: *year !include:BEA_detail_target.yaml diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml index a64e88334..15abcc9ad 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml @@ -15,11 +15,11 @@ _industrial_allocation_dict: &industrial_dict sources_to_cache: Detail_Use_2017: - !include:Detail_Use.yaml + !include:Detail_Use_SUT.yaml year: *ghgi_year source_names: BEA_Summary_Use_SUT: - !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + !include:Detail_Use_SUT.yaml:source_names:BEA_Summary_Use_SUT year: *ghgi_year Detail_Supply_2017: diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2017_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2017_m2.yaml index d53a7834d..d3eee534f 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2017_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2017_m2.yaml @@ -11,11 +11,11 @@ mecs_year: &mecs_year 2018 sources_to_cache: Detail_Use_2017: - !include:Detail_Use.yaml + !include:Detail_Use_SUT.yaml year: *ghgi_year source_names: BEA_Summary_Use_SUT: - !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + !include:Detail_Use_SUT.yaml:source_names:BEA_Summary_Use_SUT year: *ghgi_year Detail_Supply_2017: diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml index 2737d0740..773d8dd02 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2018_m1.yaml @@ -15,11 +15,11 @@ _industrial_allocation_dict: &industrial_dict sources_to_cache: Detail_Use_2018: - !include:Detail_Use.yaml + !include:Detail_Use_SUT.yaml year: *ghgi_year source_names: BEA_Summary_Use_SUT: - !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + !include:Detail_Use_SUT.yaml:source_names:BEA_Summary_Use_SUT year: *ghgi_year Detail_Supply_2018: diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2018_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2018_m2.yaml index 8c0498a35..0c70230fc 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2018_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2018_m2.yaml @@ -11,11 +11,11 @@ mecs_year: &mecs_year 2018 sources_to_cache: Detail_Use_2018: - !include:Detail_Use.yaml + !include:Detail_Use_SUT.yaml year: *ghgi_year source_names: BEA_Summary_Use_SUT: - !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + !include:Detail_Use_SUT.yaml:source_names:BEA_Summary_Use_SUT year: *ghgi_year Detail_Supply_2018: diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml index 513cad076..e1ff46a7b 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2019_m1.yaml @@ -15,11 +15,11 @@ _industrial_allocation_dict: &industrial_dict sources_to_cache: Detail_Use_2019: - !include:Detail_Use.yaml + !include:Detail_Use_SUT.yaml year: *ghgi_year source_names: BEA_Summary_Use_SUT: - !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + !include:Detail_Use_SUT.yaml:source_names:BEA_Summary_Use_SUT year: *ghgi_year Detail_Supply_2019: diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml index 41aa5fe4c..2a156f203 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml @@ -11,11 +11,11 @@ mecs_year: &mecs_year 2018 sources_to_cache: Detail_Use_2019: - !include:Detail_Use.yaml + !include:Detail_Use_SUT.yaml year: *ghgi_year source_names: BEA_Summary_Use_SUT: - !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + !include:Detail_Use_SUT.yaml:source_names:BEA_Summary_Use_SUT year: *ghgi_year Detail_Supply_2019: diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml index afd2a2505..d903f72f2 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2020_m1.yaml @@ -15,11 +15,11 @@ _industrial_allocation_dict: &industrial_dict sources_to_cache: Detail_Use_2020: - !include:Detail_Use.yaml + !include:Detail_Use_SUT.yaml year: *ghgi_year source_names: BEA_Summary_Use_SUT: - !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + !include:Detail_Use_SUT.yaml:source_names:BEA_Summary_Use_SUT year: *ghgi_year Detail_Supply_2020: diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml index 8618b399f..592760b5d 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml @@ -11,11 +11,11 @@ usgs_year: &usgs_year 2019 # 2020 FBA not yet available sources_to_cache: Detail_Use_2020: - !include:Detail_Use.yaml + !include:Detail_Use_SUT.yaml year: *ghgi_year source_names: BEA_Summary_Use_SUT: - !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + !include:Detail_Use_SUT.yaml:source_names:BEA_Summary_Use_SUT year: *ghgi_year Detail_Supply_2020: diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml index f74c01f31..66771ae47 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m1_common.yaml @@ -34,11 +34,11 @@ _attribution_sources: _sources_to_cache: Detail_Use_YEAR: ## Update year - !include:Detail_Use.yaml + !include:Detail_Use_SUT.yaml # year: *ghgi_year source_names: BEA_Summary_Use_SUT: - !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + !include:Detail_Use_SUT.yaml:source_names:BEA_Summary_Use_SUT # year: *ghgi_year Detail_Supply_YEAR: diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml index 62121c1e9..11cc5c105 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml @@ -59,11 +59,11 @@ attribution_sources: _sources_to_cache: Detail_Use_YEAR: ## Update year - !include:Detail_Use.yaml + !include:Detail_Use_SUT.yaml # year: *ghgi_year source_names: BEA_Summary_Use_SUT: - !include:Detail_Use.yaml:source_names:BEA_Summary_Use_SUT + !include:Detail_Use_SUT.yaml:source_names:BEA_Summary_Use_SUT # year: *ghgi_year Detail_Supply_YEAR: From edb29b0601377cbc1547e14682505543114aa7b4 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 24 Oct 2023 15:42:43 -0400 Subject: [PATCH 1084/1127] create and apply Detail Make and Use from old schema for 2013-2016 --- .../flowbysectormethods/Detail_Make.yaml | 46 +++++ .../flowbysectormethods/Detail_Use.yaml | 59 ++++++ .../GHG_national_2013_m1.yaml | 151 +++++++------- .../GHG_national_2013_m2.yaml | 184 ++++++++--------- .../GHG_national_2014_m1.yaml | 151 +++++++------- .../GHG_national_2014_m2.yaml | 184 ++++++++--------- .../GHG_national_2015_m1.yaml | 153 +++++++------- .../GHG_national_2015_m2.yaml | 186 ++++++++---------- .../GHG_national_2016_m1.yaml | 153 +++++++------- .../GHG_national_2016_m2.yaml | 186 ++++++++---------- 10 files changed, 693 insertions(+), 760 deletions(-) create mode 100644 flowsa/methods/flowbysectormethods/Detail_Make.yaml create mode 100644 flowsa/methods/flowbysectormethods/Detail_Use.yaml diff --git a/flowsa/methods/flowbysectormethods/Detail_Make.yaml b/flowsa/methods/flowbysectormethods/Detail_Make.yaml new file mode 100644 index 000000000..0d88303ec --- /dev/null +++ b/flowsa/methods/flowbysectormethods/Detail_Make.yaml @@ -0,0 +1,46 @@ +# This method disaggregates a Summary Make table for target use based on the +# 2012 Detail Make table. The resulting tables do not reflect valid balanced +# Make tables + +# The full FBS for any year can be cached using: +# sources_to_cache: +# Detail_Make_2015: +# !include:Detail_Make.yaml +# year: *year +# source_names: +# BEA_Summary_Make_BeforeRedef: +# !include:Detail_Use.yaml:source_names:BEA_Summary_Use_PRO_BeforeRedef +# year: *year + +!include:BEA_detail_target.yaml +year: &summary_year 2015 +target_naics_year: 2012 +geoscale: national + +data_format: FBS +activity_schema: NAICS_2012_Code # <- necessary? (long term just look at the FBS) + +source_names: + BEA_Summary_Make_BeforeRedef: + geoscale: national + year: *summary_year + activity_to_sector_mapping: BEA_2012_Summary + primary_action_type: Consumed # speeds processing + # Drop unneeded codes + exclusion_fields: + exclusion_fields: + ActivityConsumedBy: ['Other', 'Used', 'Total Industry Output'] + ActivityProducedBy: ['Total Commodity Output'] + attribution_method: proportional + attribute_on: ['PrimarySector', 'SecondarySector'] + attribution_source: + BEA_Detail_Make_BeforeRedef: + year: 2012 + activity_to_sector_mapping: BEA_2012_Detail + primary_action_type: Consumed # speeds processing + # Drop unneeded codes + exclusion_fields: + ActivityConsumedBy: ['S00300', 'S00401', 'S00402', # Noncomparable imports, Scrap, Used + 'T008'] + ActivityProducedBy: ['T007'] + attribution_method: equal diff --git a/flowsa/methods/flowbysectormethods/Detail_Use.yaml b/flowsa/methods/flowbysectormethods/Detail_Use.yaml new file mode 100644 index 000000000..321b105f6 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/Detail_Use.yaml @@ -0,0 +1,59 @@ +# This method disaggregates a Summary Use table for target use based on the +# 2012 Detail Use table. The resulting tables do not reflect valid balanced +# Use tables + +# The full FBS for any year can be cached using: +# sources_to_cache: +# Detail_Use_2015: +# !include:Detail_Use.yaml +# year: *year +# source_names: +# BEA_Summary_Use_PRO_BeforeRedef: +# !include:Detail_Use.yaml:source_names:BEA_Summary_Use_PRO_BeforeRedef +# year: *year + +!include:BEA_detail_target.yaml +year: &summary_year 2015 +target_naics_year: 2012 +geoscale: national + +data_format: FBS +activity_schema: NAICS_2012_Code # <- necessary? (long term just look at the FBS) + +source_names: + BEA_Summary_Use_PRO_BeforeRedef: + geoscale: national + year: *summary_year + activity_to_sector_mapping: BEA_2012_Summary + primary_action_type: Consumed # speeds processing + # Drop unneeded codes + exclusion_fields: + exclusion_fields: + ActivityConsumedBy: ['F010', 'F02E', 'F02N', 'F02R', 'F02S', 'F030', + 'F040', 'F050', 'F051', 'F06C', 'F06E', 'F06N', 'F06S', + 'F07C', 'F07E', 'F07N', 'F07S', 'F10C', 'F10E', + 'F10N', 'F10S', + 'Total Commodity Output', 'Total Final Uses (GDP)', + 'Total Intermediate'] + ActivityProducedBy: ['Total Industry Output', 'Total Value Added', + 'Total Intermediate', 'V001', 'V002', 'V003', + 'Other', 'Used'] + attribution_method: proportional + attribute_on: ['PrimarySector', 'SecondarySector'] + attribution_source: + BEA_Detail_Use_PRO_BeforeRedef: + year: 2012 + activity_to_sector_mapping: BEA_2012_Detail + primary_action_type: Consumed # speeds processing + # Drop unneeded codes + exclusion_fields: + ActivityConsumedBy: ['F01000', 'F02E00', 'F02N00', 'F02R00', 'F02S00', + 'F03000', 'F04000', 'F05000', 'F06C00', 'F06E00', + 'F06N00', 'F06S00', 'F07C00', 'F07E00', 'F07N00', + 'F07S00', 'F10C00', 'F10E00', 'F10N00', 'F10S00', + 'T001', 'T004', 'T007'] + ActivityProducedBy: ['T005', 'T006', 'T008', + 'V00100', 'V00200', 'V00300', + 'S00300', 'S00401', 'S00402', # Noncomparable imports, Scrap, Used + ] + attribution_method: equal diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml index deeff8841..a3a466d11 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2013_m1.yaml @@ -13,17 +13,22 @@ _industrial_allocation_dict: &industrial_dict year: *mecs_year ghg_fba: 'EPA_GHGI_T_A_11' # 2014 Table -_attribution_sources: - BEA: &bea # 2012 Make and Use tables - year: 2012 - activity_to_sector_mapping: BEA_2012_Detail - exclusion_fields: - # Drop irrelevant final demand and total sectors - ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', - 'F06E00', 'F07E00', 'F10E00', - 'T001', 'T004', 'T007'] - ActivityProducedBy: ['T007'] - attribution_method: equal +sources_to_cache: + Detail_Use_2013: + !include:Detail_Use.yaml + year: *ghgi_year + source_names: + BEA_Summary_Use_PRO_BeforeRedef: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + Detail_Make_2013: + !include:Detail_Make.yaml + year: *ghgi_year + source_names: + BEA_Summary_Make_BeforeRedef: + !include:Detail_Make.yaml:source_names:BEA_Summary_Make_BeforeRedef + year: *ghgi_year source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions @@ -34,50 +39,44 @@ source_names: electric_power: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea + Detail_Make_2013: selection_fields: - ActivityConsumedBy: {'221100': ''} # Electricity + SectorConsumedBy: {'2211': ''} # Electricity liming: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'327400': ''} # Lime + SectorProducedBy: {'3274': ''} # Lime urea: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'32531': ''} # Fertilizers urea_fertilizer: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'32531': ''} # Fertilizers carbonate_use: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + SectorProducedBy: {'32518': ''} # Other Basic Inorganic Chemicals nitrous_oxide_use: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'325120': ''} # Industrial gases + SectorProducedBy: {'32512': ''} # Industrial gases "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 @@ -121,10 +120,9 @@ source_names: petroleum_fuels: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 @@ -134,50 +132,44 @@ source_names: petroleum_fuels_diesel: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products petroleum_fuels_gasoline: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products construction_and_mining: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment + SectorProducedBy: {'33312': ''} # purchases of construction/mining equipment farm_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'333111': ''} # purchases of farm machinery + SectorProducedBy: {'333111': ''} # purchases of farm machinery other_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products alt_fuel_on_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 @@ -198,28 +190,25 @@ source_names: refrigerants: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'333415': ''} # Air conditioning equipment + SectorProducedBy: {'333415': ''} # Air conditioning equipment air_conditioning: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'333415': ''} # Air conditioning equipment + SectorProducedBy: {'333415': ''} # Air conditioning equipment foams: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: - '326140': '' # Polystyrene foam - '326150': '' # Urethane and other foam + SectorProducedBy: + '32614': '' # Polystyrene foam + '32615': '' # Urethane and other foam "EPA_GHGI_T_A_97": # HFCs from Transportation @@ -251,10 +240,9 @@ source_names: transportation_lubricants: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'324110': ''} # use of petroleum products + SectorProducedBy: {'32411': ''} # use of petroleum products ### Major CO2 Sources "EPA_GHGI_T_A_12": # CO2 emissions from stationary combustion. This table number varies by GHG year. @@ -266,18 +254,16 @@ source_names: non_manufacturing_coal: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal non_manufacturing_natural_gas: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas coal_manufacturing_co2: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 @@ -295,10 +281,9 @@ source_names: petroleum: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 @@ -310,34 +295,30 @@ source_names: electric_power: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea + Detail_Make_2013: selection_fields: - ActivityConsumedBy: {'221100': ''} # Electricity + SectorConsumedBy: {'2211': ''} # Electricity fuel_oil: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products natural_gas_nonmanufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas coal_nonmanufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2013_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2013_m2.yaml index cc9d69f66..7ac9ddffb 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2013_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2013_m2.yaml @@ -9,17 +9,22 @@ ghgi_year: &ghgi_year 2013 mecs_year: &mecs_year 2014 coa_year: &coa_year 2012 -_attribution_sources: - BEA: &bea # 2012 Make and Use tables - year: 2012 - activity_to_sector_mapping: BEA_2012_Detail - exclusion_fields: - # Drop irrelevant final demand and total sectors - ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', - 'F06E00', 'F07E00', 'F10E00', - 'T001', 'T004', 'T007'] - ActivityProducedBy: ['T007'] - attribution_method: equal +sources_to_cache: + Detail_Use_2013: + !include:Detail_Use.yaml + year: *ghgi_year + source_names: + BEA_Summary_Use_PRO_BeforeRedef: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + Detail_Make_2013: + !include:Detail_Make.yaml + year: *ghgi_year + source_names: + BEA_Summary_Make_BeforeRedef: + !include:Detail_Make.yaml:source_names:BEA_Summary_Make_BeforeRedef + year: *ghgi_year source_names: GHG_national_2013_m1: # National Summary model @@ -31,122 +36,107 @@ source_names: liming: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:liming attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'327400': ''} # Lime + SectorProducedBy: {'327400': ''} # Lime urea: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'325310': ''} # Fertilizers urea_fertilizer: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'325310': ''} # Fertilizers carbonate_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + SectorProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals nitrous_oxide_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'325120': ''} # Industrial gases + SectorProducedBy: {'325120': ''} # Industrial gases fertilizer_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'325310': ''} # Fertilizers petroleum_fuels: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products petroleum_fuels_diesel: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products petroleum_fuels_gasoline: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products construction_and_mining: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment + SectorProducedBy: {'333120': ''} # purchases of construction/mining equipment farm_non_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'333111': ''} # purchases of farm machinery + SectorProducedBy: {'333111': ''} # purchases of farm machinery other_non_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:other_non_road attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products alt_fuel_on_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'221200': ''} # purchases of natural gas non_manufacturing_coal: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'212100': ''} # purchases of coal non_manufacturing_natural_gas: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'221200': ''} # purchases of natural gas coal_manufacturing_co2: # Industrial Coal for Manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 @@ -155,10 +145,9 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'212100': ''} # purchases of coal natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing @@ -167,50 +156,44 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'221200': ''} # purchases of natural gas petroleum: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products electric_power: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea + Detail_Make_2013: selection_fields: ActivityConsumedBy: {'221100': ''} # Electricity fuel_oil: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products natural_gas_nonmanufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'221200': ''} # purchases of natural gas coal_nonmanufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'212100': ''} # purchases of coal coal_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing @@ -219,10 +202,9 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'212100': ''} # purchases of coal ng_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing @@ -231,10 +213,9 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'221200': ''} # purchases of natural gas petroleum_neu: # consumed petroleum products !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu @@ -243,10 +224,9 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products natural_gas_neu: # consumed nat gas to chemical plants !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu @@ -255,52 +235,48 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'221200': ''} # purchases of natural gas transportation_lubricants: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products refrigerants: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'333415': ''} # Air conditioning equipment + SectorProducedBy: {'333415': ''} # Air conditioning equipment air_conditioning: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:air_conditioning attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: {'333415': ''} # Air conditioning equipment + SectorProducedBy: {'333415': ''} # Air conditioning equipment foams: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:foams attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2013: selection_fields: - ActivityProducedBy: + SectorProducedBy: '326140': '' # Polystyrene foam '326150': '' # Urethane and other foam magnesium: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea - selection_fields: - ActivityConsumedBy: {T008: ''} # Total Output + BEA_Detail_GrossOutput_IO: + year: *ghgi_year + geoscale: national + activity_to_sector_mapping: BEA_2012_Detail + attribution_method: equal cropland: # allocated based on USDA land area harvested !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:cropland diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml index 93f4587f0..f9b7dc23a 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2014_m1.yaml @@ -13,17 +13,22 @@ _industrial_allocation_dict: &industrial_dict year: *mecs_year ghg_fba: 'EPA_GHGI_T_A_11' # 2014 Table -_attribution_sources: - BEA: &bea # 2012 Make and Use tables - year: 2012 - activity_to_sector_mapping: BEA_2012_Detail - exclusion_fields: - # Drop irrelevant final demand and total sectors - ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', - 'F06E00', 'F07E00', 'F10E00', - 'T001', 'T004', 'T007'] - ActivityProducedBy: ['T007'] - attribution_method: equal +sources_to_cache: + Detail_Use_2014: + !include:Detail_Use.yaml + year: *ghgi_year + source_names: + BEA_Summary_Use_PRO_BeforeRedef: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + Detail_Make_2014: + !include:Detail_Make.yaml + year: *ghgi_year + source_names: + BEA_Summary_Make_BeforeRedef: + !include:Detail_Make.yaml:source_names:BEA_Summary_Make_BeforeRedef + year: *ghgi_year source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions @@ -34,50 +39,44 @@ source_names: electric_power: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea + Detail_Make_2014: selection_fields: - ActivityConsumedBy: {'221100': ''} # Electricity + SectorConsumedBy: {'2211': ''} # Electricity liming: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'327400': ''} # Lime + SectorProducedBy: {'3274': ''} # Lime urea: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'32531': ''} # Fertilizers urea_fertilizer: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'32531': ''} # Fertilizers carbonate_use: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + SectorProducedBy: {'32518': ''} # Other Basic Inorganic Chemicals nitrous_oxide_use: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'325120': ''} # Industrial gases + SectorProducedBy: {'32512': ''} # Industrial gases "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 @@ -121,10 +120,9 @@ source_names: petroleum_fuels: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 @@ -134,50 +132,44 @@ source_names: petroleum_fuels_diesel: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products petroleum_fuels_gasoline: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products construction_and_mining: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment + SectorProducedBy: {'33312': ''} # purchases of construction/mining equipment farm_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'333111': ''} # purchases of farm machinery + SectorProducedBy: {'333111': ''} # purchases of farm machinery other_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products alt_fuel_on_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 @@ -198,28 +190,25 @@ source_names: refrigerants: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'333415': ''} # Air conditioning equipment + SectorProducedBy: {'333415': ''} # Air conditioning equipment air_conditioning: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'333415': ''} # Air conditioning equipment + SectorProducedBy: {'333415': ''} # Air conditioning equipment foams: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: - '326140': '' # Polystyrene foam - '326150': '' # Urethane and other foam + SectorProducedBy: + '32614': '' # Polystyrene foam + '32615': '' # Urethane and other foam "EPA_GHGI_T_A_97": # HFCs from Transportation @@ -251,10 +240,9 @@ source_names: transportation_lubricants: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'324110': ''} # use of petroleum products + SectorProducedBy: {'32411': ''} # use of petroleum products ### Major CO2 Sources "EPA_GHGI_T_A_11": # CO2 emissions from stationary combustion. This table number varies by GHG year. @@ -266,18 +254,16 @@ source_names: non_manufacturing_coal: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal non_manufacturing_natural_gas: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas coal_manufacturing_co2: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 @@ -295,10 +281,9 @@ source_names: petroleum: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 @@ -310,34 +295,30 @@ source_names: electric_power: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea + Detail_Make_2014: selection_fields: - ActivityConsumedBy: {'221100': ''} # Electricity + SectorConsumedBy: {'2211': ''} # Electricity fuel_oil: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products natural_gas_nonmanufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas coal_nonmanufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2014_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2014_m2.yaml index 571cd802d..5509ebc04 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2014_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2014_m2.yaml @@ -9,17 +9,22 @@ ghgi_year: &ghgi_year 2014 mecs_year: &mecs_year 2014 coa_year: &coa_year 2012 -_attribution_sources: - BEA: &bea # 2012 Make and Use tables - year: 2012 - activity_to_sector_mapping: BEA_2012_Detail - exclusion_fields: - # Drop irrelevant final demand and total sectors - ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', - 'F06E00', 'F07E00', 'F10E00', - 'T001', 'T004', 'T007'] - ActivityProducedBy: ['T007'] - attribution_method: equal +sources_to_cache: + Detail_Use_2014: + !include:Detail_Use.yaml + year: *ghgi_year + source_names: + BEA_Summary_Use_PRO_BeforeRedef: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + Detail_Make_2014: + !include:Detail_Make.yaml + year: *ghgi_year + source_names: + BEA_Summary_Make_BeforeRedef: + !include:Detail_Make.yaml:source_names:BEA_Summary_Make_BeforeRedef + year: *ghgi_year source_names: GHG_national_2014_m1: # National Summary model @@ -31,122 +36,107 @@ source_names: liming: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:liming attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'327400': ''} # Lime + SectorProducedBy: {'327400': ''} # Lime urea: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'325310': ''} # Fertilizers urea_fertilizer: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'325310': ''} # Fertilizers carbonate_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + SectorProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals nitrous_oxide_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'325120': ''} # Industrial gases + SectorProducedBy: {'325120': ''} # Industrial gases fertilizer_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'325310': ''} # Fertilizers petroleum_fuels: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products petroleum_fuels_diesel: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products petroleum_fuels_gasoline: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products construction_and_mining: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment + SectorProducedBy: {'333120': ''} # purchases of construction/mining equipment farm_non_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'333111': ''} # purchases of farm machinery + SectorProducedBy: {'333111': ''} # purchases of farm machinery other_non_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:other_non_road attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products alt_fuel_on_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'221200': ''} # purchases of natural gas non_manufacturing_coal: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'212100': ''} # purchases of coal non_manufacturing_natural_gas: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'221200': ''} # purchases of natural gas coal_manufacturing_co2: # Industrial Coal for Manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 @@ -155,10 +145,9 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'212100': ''} # purchases of coal natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing @@ -167,50 +156,44 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'221200': ''} # purchases of natural gas petroleum: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products electric_power: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea + Detail_Make_2014: selection_fields: ActivityConsumedBy: {'221100': ''} # Electricity fuel_oil: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products natural_gas_nonmanufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'221200': ''} # purchases of natural gas coal_nonmanufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'212100': ''} # purchases of coal coal_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing @@ -219,10 +202,9 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'212100': ''} # purchases of coal ng_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing @@ -231,10 +213,9 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'221200': ''} # purchases of natural gas petroleum_neu: # consumed petroleum products !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu @@ -243,10 +224,9 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products natural_gas_neu: # consumed nat gas to chemical plants !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu @@ -255,52 +235,48 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'221200': ''} # purchases of natural gas transportation_lubricants: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products refrigerants: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'333415': ''} # Air conditioning equipment + SectorProducedBy: {'333415': ''} # Air conditioning equipment air_conditioning: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:air_conditioning attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: {'333415': ''} # Air conditioning equipment + SectorProducedBy: {'333415': ''} # Air conditioning equipment foams: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:foams attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2014: selection_fields: - ActivityProducedBy: + SectorProducedBy: '326140': '' # Polystyrene foam '326150': '' # Urethane and other foam magnesium: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea - selection_fields: - ActivityConsumedBy: {T008: ''} # Total Output + BEA_Detail_GrossOutput_IO: + year: *ghgi_year + geoscale: national + activity_to_sector_mapping: BEA_2012_Detail + attribution_method: equal cropland: # allocated based on USDA land area harvested !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:cropland diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml index 4068a5d97..7575db394 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2015_m1.yaml @@ -13,17 +13,22 @@ _industrial_allocation_dict: &industrial_dict year: *mecs_year ghg_fba: 'EPA_GHGI_T_A_11' # 2014 Table -_attribution_sources: - BEA: &bea # 2012 Make and Use tables - year: 2012 - activity_to_sector_mapping: BEA_2012_Detail - exclusion_fields: - # Drop irrelevant final demand and total sectors - ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', - 'F06E00', 'F07E00', 'F10E00', - 'T001', 'T004', 'T007'] - ActivityProducedBy: ['T007'] - attribution_method: equal +sources_to_cache: + Detail_Use_2015: + !include:Detail_Use.yaml + year: *ghgi_year + source_names: + BEA_Summary_Use_PRO_BeforeRedef: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + Detail_Make_2015: + !include:Detail_Make.yaml + year: *ghgi_year + source_names: + BEA_Summary_Make_BeforeRedef: + !include:Detail_Make.yaml:source_names:BEA_Summary_Make_BeforeRedef + year: *ghgi_year source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions @@ -34,50 +39,44 @@ source_names: electric_power: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea + Detail_Make_2015: selection_fields: - ActivityConsumedBy: {'221100': ''} # Electricity + SectorConsumedBy: {'2211': ''} # Electricity liming: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'327400': ''} # Lime + SectorProducedBy: {'3274': ''} # Lime urea: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'32531': ''} # Fertilizers urea_fertilizer: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'32531': ''} # Fertilizers carbonate_use: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + SectorProducedBy: {'32518': ''} # Other Basic Inorganic Chemicals nitrous_oxide_use: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'325120': ''} # Industrial gases + SectorProducedBy: {'32512': ''} # Industrial gases "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 @@ -121,10 +120,9 @@ source_names: petroleum_fuels: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 @@ -134,50 +132,44 @@ source_names: petroleum_fuels_diesel: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products petroleum_fuels_gasoline: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products construction_and_mining: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment + SectorProducedBy: {'33312': ''} # purchases of construction/mining equipment farm_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'333111': ''} # purchases of farm machinery + SectorProducedBy: {'333111': ''} # purchases of farm machinery other_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products alt_fuel_on_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 @@ -198,28 +190,25 @@ source_names: refrigerants: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'333415': ''} # Air conditioning equipment + SectorProducedBy: {'333415': ''} # Air conditioning equipment air_conditioning: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'333415': ''} # Air conditioning equipment + SectorProducedBy: {'333415': ''} # Air conditioning equipment foams: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: - '326140': '' # Polystyrene foam - '326150': '' # Urethane and other foam + SectorProducedBy: + '32614': '' # Polystyrene foam + '32615': '' # Urethane and other foam "EPA_GHGI_T_A_97": # HFCs from Transportation @@ -251,10 +240,9 @@ source_names: transportation_lubricants: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'324110': ''} # use of petroleum products + SectorProducedBy: {'32411': ''} # use of petroleum products ### Major CO2 Sources "EPA_GHGI_T_A_10": # CO2 emissions from stationary combustion. This table number varies by GHG year. @@ -266,18 +254,16 @@ source_names: non_manufacturing_coal: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal non_manufacturing_natural_gas: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas coal_manufacturing_co2: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 @@ -295,10 +281,9 @@ source_names: petroleum: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 @@ -310,34 +295,30 @@ source_names: electric_power: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea + Detail_Make_2015: selection_fields: - ActivityConsumedBy: {'221100': ''} # Electricity - + SectorConsumedBy: {'2211': ''} # Electricity + fuel_oil: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products natural_gas_nonmanufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas coal_nonmanufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2015_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2015_m2.yaml index a145432a6..c0b3f4f6d 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2015_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2015_m2.yaml @@ -9,144 +9,134 @@ ghgi_year: &ghgi_year 2015 mecs_year: &mecs_year 2014 -_attribution_sources: - BEA: &bea # 2012 Make and Use tables - year: 2012 - activity_to_sector_mapping: BEA_2012_Detail - exclusion_fields: - # Drop irrelevant final demand and total sectors - ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', - 'F06E00', 'F07E00', 'F10E00', - 'T001', 'T004', 'T007'] - ActivityProducedBy: ['T007'] - attribution_method: equal +sources_to_cache: + Detail_Use_2015: + !include:Detail_Use.yaml + year: *ghgi_year + source_names: + BEA_Summary_Use_PRO_BeforeRedef: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + Detail_Make_2015: + !include:Detail_Make.yaml + year: *ghgi_year + source_names: + BEA_Summary_Make_BeforeRedef: + !include:Detail_Make.yaml:source_names:BEA_Summary_Make_BeforeRedef + year: *ghgi_year source_names: GHG_national_2015_m1: # National Summary model !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1 year: *ghgi_year - activity_sets: # Update MECS year for some activity sets + activity_sets: # Update MECS and CoA year for some activity sets !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets liming: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:liming attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'327400': ''} # Lime + SectorProducedBy: {'327400': ''} # Lime urea: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'325310': ''} # Fertilizers urea_fertilizer: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'325310': ''} # Fertilizers carbonate_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + SectorProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals nitrous_oxide_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'325120': ''} # Industrial gases + SectorProducedBy: {'325120': ''} # Industrial gases fertilizer_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'325310': ''} # Fertilizers petroleum_fuels: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products petroleum_fuels_diesel: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products petroleum_fuels_gasoline: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products construction_and_mining: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment + SectorProducedBy: {'333120': ''} # purchases of construction/mining equipment farm_non_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'333111': ''} # purchases of farm machinery + SectorProducedBy: {'333111': ''} # purchases of farm machinery other_non_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:other_non_road attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products alt_fuel_on_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'221200': ''} # purchases of natural gas non_manufacturing_coal: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'212100': ''} # purchases of coal non_manufacturing_natural_gas: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'221200': ''} # purchases of natural gas coal_manufacturing_co2: # Industrial Coal for Manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 @@ -155,10 +145,9 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'212100': ''} # purchases of coal natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing @@ -167,50 +156,44 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'221200': ''} # purchases of natural gas petroleum: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products electric_power: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea + Detail_Make_2015: selection_fields: ActivityConsumedBy: {'221100': ''} # Electricity fuel_oil: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products natural_gas_nonmanufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'221200': ''} # purchases of natural gas coal_nonmanufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'212100': ''} # purchases of coal coal_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing @@ -219,10 +202,9 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'212100': ''} # purchases of coal ng_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing @@ -231,10 +213,9 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'221200': ''} # purchases of natural gas petroleum_neu: # consumed petroleum products !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu @@ -243,10 +224,9 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products natural_gas_neu: # consumed nat gas to chemical plants !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu @@ -255,52 +235,48 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'221200': ''} # purchases of natural gas transportation_lubricants: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products refrigerants: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'333415': ''} # Air conditioning equipment + SectorProducedBy: {'333415': ''} # Air conditioning equipment air_conditioning: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:air_conditioning attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: {'333415': ''} # Air conditioning equipment + SectorProducedBy: {'333415': ''} # Air conditioning equipment foams: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:foams attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2015: selection_fields: - ActivityProducedBy: + SectorProducedBy: '326140': '' # Polystyrene foam '326150': '' # Urethane and other foam magnesium: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea - selection_fields: - ActivityConsumedBy: {T008: ''} # Total Output + BEA_Detail_GrossOutput_IO: + year: *ghgi_year + geoscale: national + activity_to_sector_mapping: BEA_2012_Detail + attribution_method: equal EPA_GHGI_T_2_1: #U.S. GHG emissions !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml index 377014aa8..2d47f43bf 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2016_m1.yaml @@ -13,17 +13,22 @@ _industrial_allocation_dict: &industrial_dict year: *mecs_year ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table -_attribution_sources: - BEA: &bea # 2012 Make and Use tables - year: 2012 - activity_to_sector_mapping: BEA_2012_Detail - exclusion_fields: - # Drop irrelevant final demand and total sectors - ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', - 'F06E00', 'F07E00', 'F10E00', - 'T001', 'T004', 'T007'] - ActivityProducedBy: ['T007'] - attribution_method: equal +sources_to_cache: + Detail_Use_2016: + !include:Detail_Use.yaml + year: *ghgi_year + source_names: + BEA_Summary_Use_PRO_BeforeRedef: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + Detail_Make_2016: + !include:Detail_Make.yaml + year: *ghgi_year + source_names: + BEA_Summary_Make_BeforeRedef: + !include:Detail_Make.yaml:source_names:BEA_Summary_Make_BeforeRedef + year: *ghgi_year source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions @@ -34,50 +39,44 @@ source_names: electric_power: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea + Detail_Make_2016: selection_fields: - ActivityConsumedBy: {'221100': ''} # Electricity + SectorConsumedBy: {'2211': ''} # Electricity liming: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'327400': ''} # Lime + SectorProducedBy: {'3274': ''} # Lime urea: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'32531': ''} # Fertilizers urea_fertilizer: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'32531': ''} # Fertilizers carbonate_use: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + SectorProducedBy: {'32518': ''} # Other Basic Inorganic Chemicals nitrous_oxide_use: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'325120': ''} # Industrial gases + SectorProducedBy: {'32512': ''} # Industrial gases "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 @@ -121,10 +120,9 @@ source_names: petroleum_fuels: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 @@ -134,50 +132,44 @@ source_names: petroleum_fuels_diesel: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products petroleum_fuels_gasoline: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products construction_and_mining: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment + SectorProducedBy: {'33312': ''} # purchases of construction/mining equipment farm_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'333111': ''} # purchases of farm machinery + SectorProducedBy: {'333111': ''} # purchases of farm machinery other_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products alt_fuel_on_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 @@ -198,28 +190,25 @@ source_names: refrigerants: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'333415': ''} # Air conditioning equipment + SectorProducedBy: {'333415': ''} # Air conditioning equipment air_conditioning: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'333415': ''} # Air conditioning equipment + SectorProducedBy: {'333415': ''} # Air conditioning equipment foams: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: - '326140': '' # Polystyrene foam - '326150': '' # Urethane and other foam + SectorProducedBy: + '32614': '' # Polystyrene foam + '32615': '' # Urethane and other foam "EPA_GHGI_T_A_97": # HFCs from Transportation @@ -251,10 +240,9 @@ source_names: transportation_lubricants: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'324110': ''} # use of petroleum products + SectorProducedBy: {'32411': ''} # use of petroleum products ### Major CO2 Sources "EPA_GHGI_T_A_9": # CO2 emissions from stationary combustion. This table number varies by GHG year. @@ -266,18 +254,16 @@ source_names: non_manufacturing_coal: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal non_manufacturing_natural_gas: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas coal_manufacturing_co2: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 @@ -295,10 +281,9 @@ source_names: petroleum: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 @@ -310,34 +295,30 @@ source_names: electric_power: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea + Detail_Make_2016: selection_fields: - ActivityConsumedBy: {'221100': ''} # Electricity - + SectorConsumedBy: {'2211': ''} # Electricity + fuel_oil: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products natural_gas_nonmanufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas coal_nonmanufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2016_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2016_m2.yaml index 316d0067b..70d9ab23e 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2016_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2016_m2.yaml @@ -9,144 +9,134 @@ ghgi_year: &ghgi_year 2016 mecs_year: &mecs_year 2018 -_attribution_sources: - BEA: &bea # 2012 Make and Use tables - year: 2012 - activity_to_sector_mapping: BEA_2012_Detail - exclusion_fields: - # Drop irrelevant final demand and total sectors - ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', - 'F06E00', 'F07E00', 'F10E00', - 'T001', 'T004', 'T007'] - ActivityProducedBy: ['T007'] - attribution_method: equal +sources_to_cache: + Detail_Use_2016: + !include:Detail_Use.yaml + year: *ghgi_year + source_names: + BEA_Summary_Use_PRO_BeforeRedef: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_PRO_BeforeRedef + year: *ghgi_year + + Detail_Make_2016: + !include:Detail_Make.yaml + year: *ghgi_year + source_names: + BEA_Summary_Make_BeforeRedef: + !include:Detail_Make.yaml:source_names:BEA_Summary_Make_BeforeRedef + year: *ghgi_year source_names: GHG_national_2016_m1: # National Summary model !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1 year: *ghgi_year - activity_sets: # Update MECS year for some activity sets + activity_sets: # Update MECS and CoA year for some activity sets !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets liming: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:liming attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'327400': ''} # Lime + SectorProducedBy: {'327400': ''} # Lime urea: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'325310': ''} # Fertilizers urea_fertilizer: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'325310': ''} # Fertilizers carbonate_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + SectorProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals nitrous_oxide_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'325120': ''} # Industrial gases + SectorProducedBy: {'325120': ''} # Industrial gases fertilizer_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'325310': ''} # Fertilizers petroleum_fuels: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products petroleum_fuels_diesel: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products petroleum_fuels_gasoline: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products construction_and_mining: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment + SectorProducedBy: {'333120': ''} # purchases of construction/mining equipment farm_non_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'333111': ''} # purchases of farm machinery + SectorProducedBy: {'333111': ''} # purchases of farm machinery other_non_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:other_non_road attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products alt_fuel_on_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'221200': ''} # purchases of natural gas non_manufacturing_coal: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'212100': ''} # purchases of coal non_manufacturing_natural_gas: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'221200': ''} # purchases of natural gas coal_manufacturing_co2: # Industrial Coal for Manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 @@ -155,10 +145,9 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'212100': ''} # purchases of coal natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing @@ -167,50 +156,44 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'221200': ''} # purchases of natural gas petroleum: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products electric_power: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea + Detail_Make_2016: selection_fields: ActivityConsumedBy: {'221100': ''} # Electricity fuel_oil: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products natural_gas_nonmanufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'221200': ''} # purchases of natural gas coal_nonmanufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'212100': ''} # purchases of coal coal_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing @@ -219,10 +202,9 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'212100': ''} # purchases of coal ng_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing @@ -231,10 +213,9 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'221200': ''} # purchases of natural gas petroleum_neu: # consumed petroleum products !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu @@ -243,10 +224,9 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products natural_gas_neu: # consumed nat gas to chemical plants !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu @@ -255,52 +235,48 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'221200': ''} # purchases of natural gas transportation_lubricants: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'324110': ''} # purchases of refinery products refrigerants: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'333415': ''} # Air conditioning equipment + SectorProducedBy: {'333415': ''} # Air conditioning equipment air_conditioning: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:air_conditioning attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: {'333415': ''} # Air conditioning equipment + SectorProducedBy: {'333415': ''} # Air conditioning equipment foams: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:foams attribution_source: - BEA_Detail_Use_PRO_BeforeRedef: - <<: *bea + Detail_Use_2016: selection_fields: - ActivityProducedBy: + SectorProducedBy: '326140': '' # Polystyrene foam '326150': '' # Urethane and other foam magnesium: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea - selection_fields: - ActivityConsumedBy: {T008: ''} # Total Output + BEA_Detail_GrossOutput_IO: + year: *ghgi_year + geoscale: national + activity_to_sector_mapping: BEA_2012_Detail + attribution_method: equal EPA_GHGI_T_2_1: #U.S. GHG emissions !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 From edf89f2292fe40b5db2da6178c5b726c148893eb Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 24 Oct 2023 16:17:12 -0400 Subject: [PATCH 1085/1127] use annual gross output directly for magnesium --- .../flowbysectormethods/GHG_national_2012_m2.yaml | 9 +++++---- .../flowbysectormethods/GHG_national_2017_m2.yaml | 7 +++++-- .../flowbysectormethods/GHG_national_2018_m2.yaml | 7 +++++-- .../flowbysectormethods/GHG_national_2019_m2.yaml | 7 +++++-- .../flowbysectormethods/GHG_national_2020_m2.yaml | 7 +++++-- .../flowbysectormethods/GHG_national_m2_common.yaml | 11 +++++------ 6 files changed, 30 insertions(+), 18 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2012_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2012_m2.yaml index 301b2bca6..230c82c5c 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2012_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2012_m2.yaml @@ -297,10 +297,11 @@ source_names: magnesium: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium attribution_source: - BEA_Detail_Make_BeforeRedef: - <<: *bea - selection_fields: - ActivityConsumedBy: {T008: ''} # Total Output + BEA_Detail_GrossOutput_IO: + year: *ghgi_year + geoscale: national + activity_to_sector_mapping: BEA_2012_Detail + attribution_method: equal cropland: # allocated based on USDA land area harvested !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:cropland diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2017_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2017_m2.yaml index d3eee534f..f7574e51f 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2017_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2017_m2.yaml @@ -240,8 +240,11 @@ source_names: magnesium: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium attribution_source: - Detail_Supply_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium:attribution_source:Detail_Supply_YEAR + BEA_Detail_GrossOutput_IO: + year: *ghgi_year + geoscale: national + activity_to_sector_mapping: BEA_2012_Detail + attribution_method: equal EPA_GHGI_T_2_1: #U.S. GHG emissions !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2018_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2018_m2.yaml index 0c70230fc..1ec83bc0d 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2018_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2018_m2.yaml @@ -240,8 +240,11 @@ source_names: magnesium: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium attribution_source: - Detail_Supply_2018: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium:attribution_source:Detail_Supply_YEAR + BEA_Detail_GrossOutput_IO: + year: *ghgi_year + geoscale: national + activity_to_sector_mapping: BEA_2012_Detail + attribution_method: equal EPA_GHGI_T_2_1: #U.S. GHG emissions !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml index 2a156f203..7d1d07db4 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2019_m2.yaml @@ -240,8 +240,11 @@ source_names: magnesium: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium attribution_source: - Detail_Supply_2019: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium:attribution_source:Detail_Supply_YEAR + BEA_Detail_GrossOutput_IO: + year: *ghgi_year + geoscale: national + activity_to_sector_mapping: BEA_2012_Detail + attribution_method: equal EPA_GHGI_T_2_1: #U.S. GHG emissions !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml index 592760b5d..0f1dc625a 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2020_m2.yaml @@ -240,8 +240,11 @@ source_names: magnesium: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium attribution_source: - Detail_Supply_2020: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium:attribution_source:Detail_Supply_YEAR + BEA_Detail_GrossOutput_IO: + year: *ghgi_year + geoscale: national + activity_to_sector_mapping: BEA_2012_Detail + attribution_method: equal EPA_GHGI_T_2_1: #U.S. GHG emissions !include:GHG_national_m2_common.yaml:source_names:EPA_GHGI_T_2_1 diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml index 11cc5c105..091bb3be4 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml @@ -502,12 +502,11 @@ source_names: MetaSources: 'EPA_GHGI_T_4_86' attribution_method: proportional attribution_source: - Detail_Supply_YEAR: ## Update year - selection_fields: - SectorProducedBy: # Mapped magnesium sectors - '33141': '' - '33149': '' - '33152': '' + BEA_Detail_GrossOutput_IO: + # year: *ghgi_year + geoscale: national + activity_to_sector_mapping: BEA_2012_Detail + attribution_method: equal ## For tables requiring direct attribution, reattribute the original GHGI EPA_GHGI_T_2_1: #U.S. GHG emissions From 54af00cd735615674c9c9c7d7f50dc52857b82d6 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 24 Oct 2023 16:27:02 -0400 Subject: [PATCH 1086/1127] replace Detail FBS with FBAs for 2017 --- .../GHG_national_2017_m1.yaml | 184 +++++++++------ .../GHG_national_2017_m2.yaml | 209 +++++++++++------- 2 files changed, 252 insertions(+), 141 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml index 15abcc9ad..4e60e7bd7 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml @@ -13,22 +13,17 @@ _industrial_allocation_dict: &industrial_dict year: *mecs_year ghg_fba: 'EPA_GHGI_T_A_7' # 2018 Table -sources_to_cache: - Detail_Use_2017: - !include:Detail_Use_SUT.yaml - year: *ghgi_year - source_names: - BEA_Summary_Use_SUT: - !include:Detail_Use_SUT.yaml:source_names:BEA_Summary_Use_SUT - year: *ghgi_year - - Detail_Supply_2017: - !include:Detail_Supply.yaml - year: *ghgi_year - source_names: - BEA_Summary_Supply: - !include:Detail_Supply.yaml:source_names:BEA_Summary_Supply - year: *ghgi_year +_attribution_sources: + BEA: &bea # 2017 Make and Use tables + year: 2017 + activity_to_sector_mapping: BEA_2017_Detail + exclusion_fields: + # Drop irrelevant final demand and total sectors + ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', + 'F06E00', 'F07E00', 'F10E00', + 'T001', 'T004', 'T007'] + ActivityProducedBy: ['T007'] + attribution_method: equal source_names: "EPA_GHGI_T_2_1": #U.S. GHG emissions @@ -39,33 +34,50 @@ source_names: electric_power: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power attribution_source: - Detail_Supply_2017: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR + BEA_Detail_Supply: + <<: *bea + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity + liming: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming attribution_source: - Detail_Use_2017: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:liming:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'327400': ''} # Lime + urea: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea attribution_source: - Detail_Use_2017: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + urea_fertilizer: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer attribution_source: - Detail_Use_2017: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:urea_fertilizer:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + carbonate_use: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use attribution_source: - Detail_Use_2017: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:carbonate_use:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + nitrous_oxide_use: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use attribution_source: - Detail_Use_2017: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_2_1:activity_sets:nitrous_oxide_use:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'325120': ''} # Industrial gases "EPA_GHGI_T_3_68": #CH4 from Natural Gas Systems !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_68 @@ -109,8 +121,10 @@ source_names: petroleum_fuels: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels attribution_source: - Detail_Use_2017: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_13:activity_sets:petroleum_fuels:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products "EPA_GHGI_T_3_14": &T_3_14 #CH4 from mobile combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14 @@ -120,38 +134,50 @@ source_names: petroleum_fuels_diesel: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel attribution_source: - Detail_Use_2017: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_diesel:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products petroleum_fuels_gasoline: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline attribution_source: - Detail_Use_2017: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:petroleum_fuels_gasoline:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products construction_and_mining: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining attribution_source: - Detail_Use_2017: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:construction_and_mining:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment farm_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road attribution_source: - Detail_Use_2017: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:farm_non_road:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'333111': ''} # purchases of farm machinery other_non_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road attribution_source: - Detail_Use_2017: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:other_non_road:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products alt_fuel_on_road: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road attribution_source: - Detail_Use_2017: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_14:activity_sets:alt_fuel_on_road:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas "EPA_GHGI_T_3_15": *T_3_14 #N2O from mobile combustion duplicates method for CH4 @@ -172,18 +198,28 @@ source_names: refrigerants: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants attribution_source: - Detail_Use_2017: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:refrigerants:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment + air_conditioning: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning attribution_source: - Detail_Use_2017: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:air_conditioning:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment + foams: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams attribution_source: - Detail_Use_2017: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_4_102:activity_sets:foams:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: + '326140': '' # Polystyrene foam + '326150': '' # Urethane and other foam "EPA_GHGI_T_A_97": # HFCs from Transportation @@ -215,8 +251,10 @@ source_names: transportation_lubricants: !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants attribution_source: - Detail_Use_2017: - !include:GHG_national_m1_common.yaml:source_names:GHGI_nonenergy_fossil_fuel_emissions:activity_sets:transportation_lubricants:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # use of petroleum products ### Major CO2 Sources "EPA_GHGI_T_A_8": # CO2 emissions from stationary combustion. This table number varies by GHG year. @@ -228,13 +266,18 @@ source_names: non_manufacturing_coal: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal attribution_source: - Detail_Use_2017: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_coal:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal + non_manufacturing_natural_gas: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas attribution_source: - Detail_Use_2017: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:non_manufacturing_natural_gas:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas coal_manufacturing_co2: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:coal_manufacturing_co2 @@ -252,8 +295,10 @@ source_names: petroleum: !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum attribution_source: - Detail_Use_2017: - !include:GHG_national_m1_common.yaml:source_names:GHGI_CO2_stationary_combustion:activity_sets:petroleum:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products "EPA_GHGI_T_3_8": &T_3_8 # CH4 emissions from stationary combustion !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8 @@ -265,25 +310,34 @@ source_names: electric_power: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power attribution_source: - Detail_Supply_2017: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR - + BEA_Detail_Supply: + <<: *bea + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity + fuel_oil: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil attribution_source: - Detail_Use_2017: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:fuel_oil:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products natural_gas_nonmanufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing attribution_source: - Detail_Use_2017: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:natural_gas_nonmanufacturing:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas + coal_nonmanufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing attribution_source: - Detail_Use_2017: - !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_nonmanufacturing:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal coal_manufacturing: !include:GHG_national_m1_common.yaml:source_names:EPA_GHGI_T_3_8:activity_sets:coal_manufacturing diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2017_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2017_m2.yaml index f7574e51f..06efa0709 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2017_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2017_m2.yaml @@ -9,22 +9,17 @@ ghgi_year: &ghgi_year 2017 mecs_year: &mecs_year 2018 -sources_to_cache: - Detail_Use_2017: - !include:Detail_Use_SUT.yaml - year: *ghgi_year - source_names: - BEA_Summary_Use_SUT: - !include:Detail_Use_SUT.yaml:source_names:BEA_Summary_Use_SUT - year: *ghgi_year - - Detail_Supply_2017: - !include:Detail_Supply.yaml - year: *ghgi_year - source_names: - BEA_Summary_Supply: - !include:Detail_Supply.yaml:source_names:BEA_Summary_Supply - year: *ghgi_year +_attribution_sources: + BEA: &bea # 2017 Make and Use tables + year: 2017 + activity_to_sector_mapping: BEA_2017_Detail + exclusion_fields: + # Drop irrelevant final demand and total sectors + ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', + 'F06E00', 'F07E00', 'F10E00', + 'T001', 'T004', 'T007'] + ActivityProducedBy: ['T007'] + attribution_method: equal source_names: GHG_national_2017_m1: # National Summary model @@ -36,92 +31,122 @@ source_names: liming: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:liming attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:liming:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'327400': ''} # Lime urea: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers urea_fertilizer: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers carbonate_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals nitrous_oxide_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'325120': ''} # Industrial gases fertilizer_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers petroleum_fuels: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products petroleum_fuels_diesel: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products petroleum_fuels_gasoline: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products construction_and_mining: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'333120': ''} # purchases of construction/mining equipment farm_non_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'333111': ''} # purchases of farm machinery other_non_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:other_non_road attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:other_non_road:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products alt_fuel_on_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas non_manufacturing_coal: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal non_manufacturing_natural_gas: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas coal_manufacturing_co2: # Industrial Coal for Manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 @@ -130,8 +155,10 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing @@ -140,38 +167,50 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas petroleum: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products electric_power: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power attribution_source: - Detail_Supply_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power:attribution_source:Detail_Supply_YEAR + BEA_Detail_Supply: + <<: *bea + selection_fields: + ActivityConsumedBy: {'221100': ''} # Electricity fuel_oil: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products natural_gas_nonmanufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas coal_nonmanufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal coal_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing @@ -180,8 +219,10 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'212100': ''} # purchases of coal ng_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing @@ -190,8 +231,10 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas petroleum_neu: # consumed petroleum products !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu @@ -200,8 +243,10 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products natural_gas_neu: # consumed nat gas to chemical plants !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu @@ -210,32 +255,44 @@ source_names: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy year: *mecs_year attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu:attribution_source:EIA_MECS_Energy:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'221200': ''} # purchases of natural gas transportation_lubricants: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # purchases of refinery products refrigerants: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment air_conditioning: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:air_conditioning attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:air_conditioning:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'333415': ''} # Air conditioning equipment foams: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:foams attribution_source: - Detail_Use_2017: - !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:foams:attribution_source:Detail_Use_YEAR + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: + '326140': '' # Polystyrene foam + '326150': '' # Urethane and other foam magnesium: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium From 44378caa5f1a15cd665a2d76addec5d112cbc830 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 24 Oct 2023 20:29:46 -0400 Subject: [PATCH 1087/1127] fix error in sector codes --- .../GHG_national_2013_m2.yaml | 56 +++++++++---------- .../GHG_national_2014_m2.yaml | 56 +++++++++---------- .../GHG_national_2015_m2.yaml | 56 +++++++++---------- .../GHG_national_2016_m2.yaml | 56 +++++++++---------- 4 files changed, 112 insertions(+), 112 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2013_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2013_m2.yaml index 7ac9ddffb..218ce8877 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2013_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2013_m2.yaml @@ -38,70 +38,70 @@ source_names: attribution_source: Detail_Use_2013: selection_fields: - SectorProducedBy: {'327400': ''} # Lime + SectorProducedBy: {'3274': ''} # Lime urea: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea attribution_source: Detail_Use_2013: selection_fields: - SectorProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'32531': ''} # Fertilizers urea_fertilizer: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer attribution_source: Detail_Use_2013: selection_fields: - SectorProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'32531': ''} # Fertilizers carbonate_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use attribution_source: Detail_Use_2013: selection_fields: - SectorProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + SectorProducedBy: {'32518': ''} # Other Basic Inorganic Chemicals nitrous_oxide_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use attribution_source: Detail_Use_2013: selection_fields: - SectorProducedBy: {'325120': ''} # Industrial gases + SectorProducedBy: {'32512': ''} # Industrial gases fertilizer_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use attribution_source: Detail_Use_2013: selection_fields: - SectorProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'32531': ''} # Fertilizers petroleum_fuels: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels attribution_source: Detail_Use_2013: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products petroleum_fuels_diesel: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel attribution_source: Detail_Use_2013: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products petroleum_fuels_gasoline: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline attribution_source: Detail_Use_2013: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products construction_and_mining: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining attribution_source: Detail_Use_2013: selection_fields: - SectorProducedBy: {'333120': ''} # purchases of construction/mining equipment + SectorProducedBy: {'33312': ''} # purchases of construction/mining equipment farm_non_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road @@ -115,28 +115,28 @@ source_names: attribution_source: Detail_Use_2013: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products alt_fuel_on_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road attribution_source: Detail_Use_2013: selection_fields: - SectorProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas non_manufacturing_coal: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal attribution_source: Detail_Use_2013: selection_fields: - SectorProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal non_manufacturing_natural_gas: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas attribution_source: Detail_Use_2013: selection_fields: - SectorProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas coal_manufacturing_co2: # Industrial Coal for Manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 @@ -147,7 +147,7 @@ source_names: attribution_source: Detail_Use_2013: selection_fields: - SectorProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing @@ -158,42 +158,42 @@ source_names: attribution_source: Detail_Use_2013: selection_fields: - SectorProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas petroleum: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum attribution_source: Detail_Use_2013: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products electric_power: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power attribution_source: Detail_Make_2013: selection_fields: - ActivityConsumedBy: {'221100': ''} # Electricity + SectorConsumedBy: {'2211': ''} # Electricity fuel_oil: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil attribution_source: Detail_Use_2013: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products natural_gas_nonmanufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing attribution_source: Detail_Use_2013: selection_fields: - SectorProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas coal_nonmanufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing attribution_source: Detail_Use_2013: selection_fields: - SectorProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal coal_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing @@ -204,7 +204,7 @@ source_names: attribution_source: Detail_Use_2013: selection_fields: - SectorProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal ng_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing @@ -215,7 +215,7 @@ source_names: attribution_source: Detail_Use_2013: selection_fields: - SectorProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas petroleum_neu: # consumed petroleum products !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu @@ -226,7 +226,7 @@ source_names: attribution_source: Detail_Use_2013: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products natural_gas_neu: # consumed nat gas to chemical plants !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu @@ -237,14 +237,14 @@ source_names: attribution_source: Detail_Use_2013: selection_fields: - SectorProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas transportation_lubricants: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants attribution_source: Detail_Use_2013: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products refrigerants: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants @@ -266,8 +266,8 @@ source_names: Detail_Use_2013: selection_fields: SectorProducedBy: - '326140': '' # Polystyrene foam - '326150': '' # Urethane and other foam + '32614': '' # Polystyrene foam + '32615': '' # Urethane and other foam magnesium: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2014_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2014_m2.yaml index 5509ebc04..7a902418d 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2014_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2014_m2.yaml @@ -38,70 +38,70 @@ source_names: attribution_source: Detail_Use_2014: selection_fields: - SectorProducedBy: {'327400': ''} # Lime + SectorProducedBy: {'3274': ''} # Lime urea: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea attribution_source: Detail_Use_2014: selection_fields: - SectorProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'32531': ''} # Fertilizers urea_fertilizer: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer attribution_source: Detail_Use_2014: selection_fields: - SectorProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'32531': ''} # Fertilizers carbonate_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use attribution_source: Detail_Use_2014: selection_fields: - SectorProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + SectorProducedBy: {'32518': ''} # Other Basic Inorganic Chemicals nitrous_oxide_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use attribution_source: Detail_Use_2014: selection_fields: - SectorProducedBy: {'325120': ''} # Industrial gases + SectorProducedBy: {'32512': ''} # Industrial gases fertilizer_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use attribution_source: Detail_Use_2014: selection_fields: - SectorProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'32531': ''} # Fertilizers petroleum_fuels: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels attribution_source: Detail_Use_2014: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products petroleum_fuels_diesel: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel attribution_source: Detail_Use_2014: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products petroleum_fuels_gasoline: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline attribution_source: Detail_Use_2014: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products construction_and_mining: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining attribution_source: Detail_Use_2014: selection_fields: - SectorProducedBy: {'333120': ''} # purchases of construction/mining equipment + SectorProducedBy: {'33312': ''} # purchases of construction/mining equipment farm_non_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road @@ -115,28 +115,28 @@ source_names: attribution_source: Detail_Use_2014: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products alt_fuel_on_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road attribution_source: Detail_Use_2014: selection_fields: - SectorProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas non_manufacturing_coal: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal attribution_source: Detail_Use_2014: selection_fields: - SectorProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal non_manufacturing_natural_gas: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas attribution_source: Detail_Use_2014: selection_fields: - SectorProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas coal_manufacturing_co2: # Industrial Coal for Manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 @@ -147,7 +147,7 @@ source_names: attribution_source: Detail_Use_2014: selection_fields: - SectorProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing @@ -158,42 +158,42 @@ source_names: attribution_source: Detail_Use_2014: selection_fields: - SectorProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas petroleum: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum attribution_source: Detail_Use_2014: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products electric_power: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power attribution_source: Detail_Make_2014: selection_fields: - ActivityConsumedBy: {'221100': ''} # Electricity + SectorConsumedBy: {'2211': ''} # Electricity fuel_oil: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil attribution_source: Detail_Use_2014: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products natural_gas_nonmanufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing attribution_source: Detail_Use_2014: selection_fields: - SectorProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas coal_nonmanufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing attribution_source: Detail_Use_2014: selection_fields: - SectorProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal coal_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing @@ -204,7 +204,7 @@ source_names: attribution_source: Detail_Use_2014: selection_fields: - SectorProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal ng_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing @@ -215,7 +215,7 @@ source_names: attribution_source: Detail_Use_2014: selection_fields: - SectorProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas petroleum_neu: # consumed petroleum products !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu @@ -226,7 +226,7 @@ source_names: attribution_source: Detail_Use_2014: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products natural_gas_neu: # consumed nat gas to chemical plants !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu @@ -237,14 +237,14 @@ source_names: attribution_source: Detail_Use_2014: selection_fields: - SectorProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas transportation_lubricants: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants attribution_source: Detail_Use_2014: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products refrigerants: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants @@ -266,8 +266,8 @@ source_names: Detail_Use_2014: selection_fields: SectorProducedBy: - '326140': '' # Polystyrene foam - '326150': '' # Urethane and other foam + '32614': '' # Polystyrene foam + '32615': '' # Urethane and other foam magnesium: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2015_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2015_m2.yaml index c0b3f4f6d..38785c7f0 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2015_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2015_m2.yaml @@ -38,70 +38,70 @@ source_names: attribution_source: Detail_Use_2015: selection_fields: - SectorProducedBy: {'327400': ''} # Lime + SectorProducedBy: {'3274': ''} # Lime urea: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea attribution_source: Detail_Use_2015: selection_fields: - SectorProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'32531': ''} # Fertilizers urea_fertilizer: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer attribution_source: Detail_Use_2015: selection_fields: - SectorProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'32531': ''} # Fertilizers carbonate_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use attribution_source: Detail_Use_2015: selection_fields: - SectorProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + SectorProducedBy: {'32518': ''} # Other Basic Inorganic Chemicals nitrous_oxide_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use attribution_source: Detail_Use_2015: selection_fields: - SectorProducedBy: {'325120': ''} # Industrial gases + SectorProducedBy: {'32512': ''} # Industrial gases fertilizer_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use attribution_source: Detail_Use_2015: selection_fields: - SectorProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'32531': ''} # Fertilizers petroleum_fuels: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels attribution_source: Detail_Use_2015: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products petroleum_fuels_diesel: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel attribution_source: Detail_Use_2015: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products petroleum_fuels_gasoline: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline attribution_source: Detail_Use_2015: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products construction_and_mining: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining attribution_source: Detail_Use_2015: selection_fields: - SectorProducedBy: {'333120': ''} # purchases of construction/mining equipment + SectorProducedBy: {'33312': ''} # purchases of construction/mining equipment farm_non_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road @@ -115,28 +115,28 @@ source_names: attribution_source: Detail_Use_2015: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products alt_fuel_on_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road attribution_source: Detail_Use_2015: selection_fields: - SectorProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas non_manufacturing_coal: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal attribution_source: Detail_Use_2015: selection_fields: - SectorProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal non_manufacturing_natural_gas: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas attribution_source: Detail_Use_2015: selection_fields: - SectorProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas coal_manufacturing_co2: # Industrial Coal for Manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 @@ -147,7 +147,7 @@ source_names: attribution_source: Detail_Use_2015: selection_fields: - SectorProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing @@ -158,42 +158,42 @@ source_names: attribution_source: Detail_Use_2015: selection_fields: - SectorProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas petroleum: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum attribution_source: Detail_Use_2015: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products electric_power: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power attribution_source: Detail_Make_2015: selection_fields: - ActivityConsumedBy: {'221100': ''} # Electricity + SectorConsumedBy: {'2211': ''} # Electricity fuel_oil: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil attribution_source: Detail_Use_2015: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products natural_gas_nonmanufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing attribution_source: Detail_Use_2015: selection_fields: - SectorProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas coal_nonmanufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing attribution_source: Detail_Use_2015: selection_fields: - SectorProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal coal_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing @@ -204,7 +204,7 @@ source_names: attribution_source: Detail_Use_2015: selection_fields: - SectorProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal ng_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing @@ -215,7 +215,7 @@ source_names: attribution_source: Detail_Use_2015: selection_fields: - SectorProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas petroleum_neu: # consumed petroleum products !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu @@ -226,7 +226,7 @@ source_names: attribution_source: Detail_Use_2015: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products natural_gas_neu: # consumed nat gas to chemical plants !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu @@ -237,14 +237,14 @@ source_names: attribution_source: Detail_Use_2015: selection_fields: - SectorProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas transportation_lubricants: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants attribution_source: Detail_Use_2015: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products refrigerants: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants @@ -266,8 +266,8 @@ source_names: Detail_Use_2015: selection_fields: SectorProducedBy: - '326140': '' # Polystyrene foam - '326150': '' # Urethane and other foam + '32614': '' # Polystyrene foam + '32615': '' # Urethane and other foam magnesium: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2016_m2.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2016_m2.yaml index 70d9ab23e..2b8520869 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2016_m2.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2016_m2.yaml @@ -38,70 +38,70 @@ source_names: attribution_source: Detail_Use_2016: selection_fields: - SectorProducedBy: {'327400': ''} # Lime + SectorProducedBy: {'3274': ''} # Lime urea: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea attribution_source: Detail_Use_2016: selection_fields: - SectorProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'32531': ''} # Fertilizers urea_fertilizer: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:urea_fertilizer attribution_source: Detail_Use_2016: selection_fields: - SectorProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'32531': ''} # Fertilizers carbonate_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:carbonate_use attribution_source: Detail_Use_2016: selection_fields: - SectorProducedBy: {'325180': ''} # Other Basic Inorganic Chemicals + SectorProducedBy: {'32518': ''} # Other Basic Inorganic Chemicals nitrous_oxide_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:nitrous_oxide_use attribution_source: Detail_Use_2016: selection_fields: - SectorProducedBy: {'325120': ''} # Industrial gases + SectorProducedBy: {'32512': ''} # Industrial gases fertilizer_use: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fertilizer_use attribution_source: Detail_Use_2016: selection_fields: - SectorProducedBy: {'325310': ''} # Fertilizers + SectorProducedBy: {'32531': ''} # Fertilizers petroleum_fuels: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels attribution_source: Detail_Use_2016: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products petroleum_fuels_diesel: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_diesel attribution_source: Detail_Use_2016: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products petroleum_fuels_gasoline: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_fuels_gasoline attribution_source: Detail_Use_2016: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products construction_and_mining: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:construction_and_mining attribution_source: Detail_Use_2016: selection_fields: - SectorProducedBy: {'333120': ''} # purchases of construction/mining equipment + SectorProducedBy: {'33312': ''} # purchases of construction/mining equipment farm_non_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:farm_non_road @@ -115,28 +115,28 @@ source_names: attribution_source: Detail_Use_2016: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products alt_fuel_on_road: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:alt_fuel_on_road attribution_source: Detail_Use_2016: selection_fields: - SectorProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas non_manufacturing_coal: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_coal attribution_source: Detail_Use_2016: selection_fields: - SectorProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal non_manufacturing_natural_gas: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:non_manufacturing_natural_gas attribution_source: Detail_Use_2016: selection_fields: - SectorProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas coal_manufacturing_co2: # Industrial Coal for Manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing_co2 @@ -147,7 +147,7 @@ source_names: attribution_source: Detail_Use_2016: selection_fields: - SectorProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal natural_gas_manufacturing: # Industrial Natural Gas for manufacturing !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_manufacturing @@ -158,42 +158,42 @@ source_names: attribution_source: Detail_Use_2016: selection_fields: - SectorProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas petroleum: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum attribution_source: Detail_Use_2016: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products electric_power: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:electric_power attribution_source: Detail_Make_2016: selection_fields: - ActivityConsumedBy: {'221100': ''} # Electricity + SectorConsumedBy: {'2211': ''} # Electricity fuel_oil: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:fuel_oil attribution_source: Detail_Use_2016: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products natural_gas_nonmanufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_nonmanufacturing attribution_source: Detail_Use_2016: selection_fields: - SectorProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas coal_nonmanufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_nonmanufacturing attribution_source: Detail_Use_2016: selection_fields: - SectorProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal coal_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:coal_manufacturing @@ -204,7 +204,7 @@ source_names: attribution_source: Detail_Use_2016: selection_fields: - SectorProducedBy: {'212100': ''} # purchases of coal + SectorProducedBy: {'2121': ''} # purchases of coal ng_manufacturing: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:ng_manufacturing @@ -215,7 +215,7 @@ source_names: attribution_source: Detail_Use_2016: selection_fields: - SectorProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas petroleum_neu: # consumed petroleum products !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:petroleum_neu @@ -226,7 +226,7 @@ source_names: attribution_source: Detail_Use_2016: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products natural_gas_neu: # consumed nat gas to chemical plants !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:natural_gas_neu @@ -237,14 +237,14 @@ source_names: attribution_source: Detail_Use_2016: selection_fields: - SectorProducedBy: {'221200': ''} # purchases of natural gas + SectorProducedBy: {'2212': ''} # purchases of natural gas transportation_lubricants: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:transportation_lubricants attribution_source: Detail_Use_2016: selection_fields: - SectorProducedBy: {'324110': ''} # purchases of refinery products + SectorProducedBy: {'32411': ''} # purchases of refinery products refrigerants: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:refrigerants @@ -266,8 +266,8 @@ source_names: Detail_Use_2016: selection_fields: SectorProducedBy: - '326140': '' # Polystyrene foam - '326150': '' # Urethane and other foam + '32614': '' # Polystyrene foam + '32615': '' # Urethane and other foam magnesium: !include:GHG_national_m2_common.yaml:source_names:GHG_national_m1:activity_sets:magnesium From adb160f779f49276e5d18066e240eaf134bbd690 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 25 Oct 2023 09:35:37 -0400 Subject: [PATCH 1088/1127] due to 8b62f34, need to re-attach config to FBS --- flowsa/validation.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/flowsa/validation.py b/flowsa/validation.py index 7050986ad..b071d75aa 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -12,7 +12,7 @@ from flowsa.flowbysector import FlowBySector from flowsa.flowbyfunctions import aggregator, collapse_fbs_sectors from flowsa.flowsa_log import log, vlog -from flowsa.common import fba_activity_fields +from flowsa.common import fba_activity_fields, load_yaml_dict from flowsa.location import US_FIPS from flowsa.schema import dq_fields @@ -318,6 +318,10 @@ def compare_national_state_fbs(dataname=None, year=None, method=None, # load state level target sectors - assumption state will always be # equal or more aggregated than national + if state.config == {}: + state.config = load_yaml_dict(s, 'FBS') + if national.config == {}: + national.config = load_yaml_dict(n, 'FBS') state_target = state.config['industry_spec'] groupby_fields = ['Flowable','Context','SectorProducedBy', 'SectorConsumedBy', From 1fc4a718f7d3bd9e183b61f1740f0ba2e59ecf63 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Wed, 25 Oct 2023 09:55:52 -0600 Subject: [PATCH 1089/1127] test on Python 3.12 --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 3e375069f..54878dc89 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -31,7 +31,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - py-version: ['3.9', '3.10', '3.11'] + py-version: ['3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v3 From 9d02d3bc59dac1bf594033130ce2e06cf597b770 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 26 Oct 2023 09:59:03 -0400 Subject: [PATCH 1090/1127] don't exclude households from Use table FBS, needed for attribution --- flowsa/methods/flowbysectormethods/Detail_Use.yaml | 4 ++-- flowsa/methods/flowbysectormethods/Detail_Use_SUT.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/Detail_Use.yaml b/flowsa/methods/flowbysectormethods/Detail_Use.yaml index 321b105f6..41e6ac96b 100644 --- a/flowsa/methods/flowbysectormethods/Detail_Use.yaml +++ b/flowsa/methods/flowbysectormethods/Detail_Use.yaml @@ -29,7 +29,7 @@ source_names: # Drop unneeded codes exclusion_fields: exclusion_fields: - ActivityConsumedBy: ['F010', 'F02E', 'F02N', 'F02R', 'F02S', 'F030', + ActivityConsumedBy: ['F02E', 'F02N', 'F02R', 'F02S', 'F030', 'F040', 'F050', 'F051', 'F06C', 'F06E', 'F06N', 'F06S', 'F07C', 'F07E', 'F07N', 'F07S', 'F10C', 'F10E', 'F10N', 'F10S', @@ -47,7 +47,7 @@ source_names: primary_action_type: Consumed # speeds processing # Drop unneeded codes exclusion_fields: - ActivityConsumedBy: ['F01000', 'F02E00', 'F02N00', 'F02R00', 'F02S00', + ActivityConsumedBy: ['F02E00', 'F02N00', 'F02R00', 'F02S00', 'F03000', 'F04000', 'F05000', 'F06C00', 'F06E00', 'F06N00', 'F06S00', 'F07C00', 'F07E00', 'F07N00', 'F07S00', 'F10C00', 'F10E00', 'F10N00', 'F10S00', diff --git a/flowsa/methods/flowbysectormethods/Detail_Use_SUT.yaml b/flowsa/methods/flowbysectormethods/Detail_Use_SUT.yaml index 714c1d745..2dd0f701f 100644 --- a/flowsa/methods/flowbysectormethods/Detail_Use_SUT.yaml +++ b/flowsa/methods/flowbysectormethods/Detail_Use_SUT.yaml @@ -32,7 +32,7 @@ source_names: ActivityProducedBy: ['T00OSUB', 'T00OTOP', 'T00SUB', 'T00TOP', 'T018', 'V001', 'V003', 'VABAS', 'VAPRO', 'T005', 'Other', 'Used'] - ActivityConsumedBy: ['F010', 'F02E', 'F02N', 'F02R', 'F02S', + ActivityConsumedBy: ['F02E', 'F02N', 'F02R', 'F02S', 'F030', 'F040', 'F06C', 'F06E', 'F06N', 'F06S', 'F07C', 'F07E', 'F07N', 'F07S', 'F10C', 'F10E', 'F10N', 'F10S', 'T001', 'T019'] @@ -46,7 +46,7 @@ source_names: # Drop unneeded codes exclusion_fields: - ActivityConsumedBy: ['T001', 'F01000', 'F02E00', 'F02N00', 'F02R00', + ActivityConsumedBy: ['T001', 'F02E00', 'F02N00', 'F02R00', 'F02S00', 'F03000', 'F04000', 'F06C00', 'F06E00', 'F06N00', 'F06S00', 'F07C00', 'F07E00', 'F07N00', 'F07S00', 'F10C00', 'F10E00', 'F10N00', 'F10S00', From 0f07f2b3af0ff16a3c25a6229f3b9c613e8c97c2 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 26 Oct 2023 14:38:35 -0600 Subject: [PATCH 1091/1127] drop duplicate sector 2012 name files and add sector 2017 name csv --- flowsa/data/Sector_2012_Names.csv | 373 +++++++++++++++ ...S_2012_Names.csv => Sector_2017_Names.csv} | 451 ++++++++++++++++-- scripts/writeNAICScrosswalk.py | 93 +++- 3 files changed, 851 insertions(+), 66 deletions(-) rename flowsa/data/{NAICS_2012_Names.csv => Sector_2017_Names.csv} (79%) diff --git a/flowsa/data/Sector_2012_Names.csv b/flowsa/data/Sector_2012_Names.csv index b587f648e..1fad191f1 100644 --- a/flowsa/data/Sector_2012_Names.csv +++ b/flowsa/data/Sector_2012_Names.csv @@ -280,293 +280,656 @@ NAICS_2012_Code,NAICS_2012_Name 311,Food Manufacturing 3111,Animal Food Manufacturing 31111,Animal Food Manufacturing +311111,Dog and Cat Food Manufacturing 311119,Other Animal Food Manufacturing 3112,Grain and Oilseed Milling 31121,Flour Milling and Malt Manufacturing +311211,Flour Milling +311212,Rice Milling +311213,Malt Manufacturing 31122,Starch and Vegetable Fats and Oils Manufacturing +311221,Wet Corn Milling +311224,Soybean and Other Oilseed Processing +311225,Fats and Oils Refining and Blending 31123,Breakfast Cereal Manufacturing +311230,Breakfast Cereal Manufacturing 3113,Sugar and Confectionery Product Manufacturing 31131,Sugar Manufacturing +311313,Beet Sugar Manufacturing +311314,Cane Sugar Manufacturing 31134,Nonchocolate Confectionery Manufacturing +311340,Nonchocolate Confectionery Manufacturing 31135,Chocolate and Confectionery Manufacturing +311351,Chocolate and Confectionery Manufacturing from Cacao Beans +311352,Confectionery Manufacturing from Purchased Chocolate 3114,Fruit and Vegetable Preserving and Specialty Food Manufacturing 31141,Frozen Food Manufacturing +311411,"Frozen Fruit, Juice, and Vegetable Manufacturing" +311412,Frozen Specialty Food Manufacturing 31142,"Fruit and Vegetable Canning, Pickling, and Drying" +311421,Fruit and Vegetable Canning +311422,Specialty Canning +311423,Dried and Dehydrated Food Manufacturing 3115,Dairy Product Manufacturing 31151,Dairy Product (except Frozen) Manufacturing +311511,Fluid Milk Manufacturing +311512,Creamery Butter Manufacturing +311513,Cheese Manufacturing +311514,"Dry, Condensed, and Evaporated Dairy Product Manufacturing" 31152,Ice Cream and Frozen Dessert Manufacturing +311520,Ice Cream and Frozen Dessert Manufacturing 3116,Animal Slaughtering and Processing 31161,Animal Slaughtering and Processing +311611,Animal (except Poultry) Slaughtering +311612,Meat Processed from Carcasses +311613,Rendering and Meat Byproduct Processing +311615,Poultry Processing 3117,Seafood Product Preparation and Packaging 31171,Seafood Product Preparation and Packaging +311710,Seafood Product Preparation and Packaging 3118,Bakeries and Tortilla Manufacturing 31181,Bread and Bakery Product Manufacturing +311811,Retail Bakeries +311812,Commercial Bakeries +311813,"Frozen Cakes, Pies, and Other Pastries Manufacturing" 31182,"Cookie, Cracker, and Pasta Manufacturing" +311821,Cookie and Cracker Manufacturing +311824,"Dry Pasta, Dough, and Flour Mixes Manufacturing from Purchased Flour" 31183,Tortilla Manufacturing +311830,Tortilla Manufacturing 3119,Other Food Manufacturing 31191,Snack Food Manufacturing +311911,Roasted Nuts and Peanut Butter Manufacturing +311919,Other Snack Food Manufacturing 31192,Coffee and Tea Manufacturing +311920,Coffee and Tea Manufacturing 31193,Flavoring Syrup and Concentrate Manufacturing +311930,Flavoring Syrup and Concentrate Manufacturing 31194,Seasoning and Dressing Manufacturing +311941,"Mayonnaise, Dressing, and Other Prepared Sauce Manufacturing" +311942,Spice and Extract Manufacturing 31199,All Other Food Manufacturing +311991,Perishable Prepared Food Manufacturing +311999,All Other Miscellaneous Food Manufacturing 312,Beverage and Tobacco Product Manufacturing 3121,Beverage Manufacturing 31211,Soft Drink and Ice Manufacturing +312111,Soft Drink Manufacturing +312112,Bottled Water Manufacturing +312113,Ice Manufacturing 31212,Breweries +312120,Breweries 31213,Wineries +312130,Wineries 31214,Distilleries +312140,Distilleries 3122,Tobacco Manufacturing 31223,Tobacco Manufacturing +312230,Tobacco Manufacturing 313,Textile Mills 3131,"Fiber, Yarn, and Thread Mills" 31311,"Fiber, Yarn, and Thread Mills" +313110,"Fiber, Yarn, and Thread Mills" 3132,Fabric Mills 31321,Broadwoven Fabric Mills +313210,Broadwoven Fabric Mills 31322,Narrow Fabric Mills and Schiffli Machine Embroidery +313220,Narrow Fabric Mills and Schiffli Machine Embroidery 31323,Nonwoven Fabric Mills +313230,Nonwoven Fabric Mills 31324,Knit Fabric Mills +313240,Knit Fabric Mills 3133,Textile and Fabric Finishing and Fabric Coating Mills 31331,Textile and Fabric Finishing Mills +313310,Textile and Fabric Finishing Mills 31332,Fabric Coating Mills +313320,Fabric Coating Mills 314,Textile Product Mills 3141,Textile Furnishings Mills 31411,Carpet and Rug Mills +314110,Carpet and Rug Mills 31412,Curtain and Linen Mills +314120,Curtain and Linen Mills 3149,Other Textile Product Mills 31491,Textile Bag and Canvas Mills +314910,Textile Bag and Canvas Mills 31499,All Other Textile Product Mills +314994,"Rope, Cordage, Twine, Tire Cord, and Tire Fabric Mills" +314999,All Other Miscellaneous Textile Product Mills 315,Apparel Manufacturing 3151,Apparel Knitting Mills 31511,Hosiery and Sock Mills +315110,Hosiery and Sock Mills 31519,Other Apparel Knitting Mills +315190,Other Apparel Knitting Mills 3152,Cut and Sew Apparel Manufacturing 31521,Cut and Sew Apparel Contractors +315210,Cut and Sew Apparel Contractors 31522,Men’s and Boys’ Cut and Sew Apparel Manufacturing +315220,Men’s and Boys’ Cut and Sew Apparel Manufacturing 31524,"Women’s, Girls’, and Infants’ Cut and Sew Apparel Manufacturing" +315240,"Women’s, Girls’, and Infants’ Cut and Sew Apparel Manufacturing" 31528,Other Cut and Sew Apparel Manufacturing +315280,Other Cut and Sew Apparel Manufacturing 3159,Apparel Accessories and Other Apparel Manufacturing 31599,Apparel Accessories and Other Apparel Manufacturing +315990,Apparel Accessories and Other Apparel Manufacturing 316,Leather and Allied Product Manufacturing 3161,Leather and Hide Tanning and Finishing 31611,Leather and Hide Tanning and Finishing +316110,Leather and Hide Tanning and Finishing 3162,Footwear Manufacturing 31621,Footwear Manufacturing +316210,Footwear Manufacturing 3169,Other Leather and Allied Product Manufacturing 31699,Other Leather and Allied Product Manufacturing +316992,Women's Handbag and Purse Manufacturing +316998,All Other Leather Good and Allied Product Manufacturing 32,Manufacturing 321,Wood Product Manufacturing 3211,Sawmills and Wood Preservation 32111,Sawmills and Wood Preservation +321113,Sawmills +321114,Wood Preservation 3212,"Veneer, Plywood, and Engineered Wood Product Manufacturing" 32121,"Veneer, Plywood, and Engineered Wood Product Manufacturing" +321211,Hardwood Veneer and Plywood Manufacturing +321212,Softwood Veneer and Plywood Manufacturing +321213,Engineered Wood Member (except Truss) Manufacturing +321214,Truss Manufacturing +321219,Reconstituted Wood Product Manufacturing 3219,Other Wood Product Manufacturing 32191,Millwork +321911,Wood Window and Door Manufacturing +321912,"Cut Stock, Resawing Lumber, and Planing" +321918,Other Millwork (including Flooring) 32192,Wood Container and Pallet Manufacturing +321920,Wood Container and Pallet Manufacturing 32199,All Other Wood Product Manufacturing +321991,Manufactured Home (Mobile Home) Manufacturing +321992,Prefabricated Wood Building Manufacturing +321999,All Other Miscellaneous Wood Product Manufacturing 322,Paper Manufacturing 3221,"Pulp, Paper, and Paperboard Mills" 32211,Pulp Mills +322110,Pulp Mills 32212,Paper Mills +322121,Paper (except Newsprint) Mills +322122,Newsprint Mills 32213,Paperboard Mills +322130,Paperboard Mills 3222,Converted Paper Product Manufacturing 32221,Paperboard Container Manufacturing +322211,Corrugated and Solid Fiber Box Manufacturing +322212,Folding Paperboard Box Manufacturing +322219,Other Paperboard Container Manufacturing 32222,Paper Bag and Coated and Treated Paper Manufacturing +322220,Paper Bag and Coated and Treated Paper Manufacturing 32223,Stationery Product Manufacturing +322230,Stationery Product Manufacturing 32229,Other Converted Paper Product Manufacturing +322291,Sanitary Paper Product Manufacturing +322299,All Other Converted Paper Product Manufacturing 323,Printing and Related Support Activities 3231,Printing and Related Support Activities 32311,Printing +323111,Commercial Printing (except Screen and Books) +323113,Commercial Screen Printing +323117,Books Printing 32312,Support Activities for Printing +323120,Support Activities for Printing 324,Petroleum and Coal Products Manufacturing 3241,Petroleum and Coal Products Manufacturing 32411,Petroleum Refineries +324110,Petroleum Refineries 32412,"Asphalt Paving, Roofing, and Saturated Materials Manufacturing" +324121,Asphalt Paving Mixture and Block Manufacturing +324122,Asphalt Shingle and Coating Materials Manufacturing 32419,Other Petroleum and Coal Products Manufacturing +324191,Petroleum Lubricating Oil and Grease Manufacturing +324199,All Other Petroleum and Coal Products Manufacturing 325,Chemical Manufacturing 3251,Basic Chemical Manufacturing 32511,Petrochemical Manufacturing +325110,Petrochemical Manufacturing 32512,Industrial Gas Manufacturing +325120,Industrial Gas Manufacturing 32513,Synthetic Dye and Pigment Manufacturing +325130,Synthetic Dye and Pigment Manufacturing 32518,Other Basic Inorganic Chemical Manufacturing +325180,Other Basic Inorganic Chemical Manufacturing 32519,Other Basic Organic Chemical Manufacturing +325193,Ethyl Alcohol Manufacturing +325194,"Cyclic Crude, Intermediate, and Gum and Wood Chemical Manufacturing" +325199,All Other Basic Organic Chemical Manufacturing 3252,"Resin, Synthetic Rubber, and Artificial Synthetic Fibers and Filaments Manufacturing" 32521,Resin and Synthetic Rubber Manufacturing +325211,Plastics Material and Resin Manufacturing +325212,Synthetic Rubber Manufacturing 32522,Artificial and Synthetic Fibers and Filaments Manufacturing +325220,Artificial and Synthetic Fibers and Filaments Manufacturing 3253,"Pesticide, Fertilizer, and Other Agricultural Chemical Manufacturing" 32531,Fertilizer Manufacturing +325311,Nitrogenous Fertilizer Manufacturing +325312,Phosphatic Fertilizer Manufacturing +325314,Fertilizer (Mixing Only) Manufacturing 32532,Pesticide and Other Agricultural Chemical Manufacturing +325320,Pesticide and Other Agricultural Chemical Manufacturing 3254,Pharmaceutical and Medicine Manufacturing 32541,Pharmaceutical and Medicine Manufacturing +325411,Medicinal and Botanical Manufacturing +325412,Pharmaceutical Preparation Manufacturing +325413,In-Vitro Diagnostic Substance Manufacturing +325414,Biological Product (except Diagnostic) Manufacturing 3255,"Paint, Coating, and Adhesive Manufacturing" 32551,Paint and Coating Manufacturing +325510,Paint and Coating Manufacturing 32552,Adhesive Manufacturing +325520,Adhesive Manufacturing 3256,"Soap, Cleaning Compound, and Toilet Preparation Manufacturing" 32561,Soap and Cleaning Compound Manufacturing +325611,Soap and Other Detergent Manufacturing +325612,Polish and Other Sanitation Good Manufacturing +325613,Surface Active Agent Manufacturing 32562,Toilet Preparation Manufacturing +325620,Toilet Preparation Manufacturing 3259,Other Chemical Product and Preparation Manufacturing 32591,Printing Ink Manufacturing +325910,Printing Ink Manufacturing 32592,Explosives Manufacturing +325920,Explosives Manufacturing 32599,All Other Chemical Product and Preparation Manufacturing +325991,Custom Compounding of Purchased Resins +325992,"Photographic Film, Paper, Plate, and Chemical Manufacturing" +325998,All Other Miscellaneous Chemical Product and Preparation Manufacturing 326,Plastics and Rubber Products Manufacturing 3261,Plastics Product Manufacturing 32611,Plastics Packaging Materials and Unlaminated Film and Sheet Manufacturing +326111,Plastics Bag and Pouch Manufacturing +326112,Plastics Packaging Film and Sheet (including Laminated) Manufacturing +326113,Unlaminated Plastics Film and Sheet (except Packaging) Manufacturing 32612,"Plastics Pipe, Pipe Fitting, and Unlaminated Profile Shape Manufacturing" +326121,Unlaminated Plastics Profile Shape Manufacturing +326122,Plastics Pipe and Pipe Fitting Manufacturing 32613,"Laminated Plastics Plate, Sheet (except Packaging), and Shape Manufacturing" +326130,"Laminated Plastics Plate, Sheet (except Packaging), and Shape Manufacturing" 32614,Polystyrene Foam Product Manufacturing +326140,Polystyrene Foam Product Manufacturing 32615,Urethane and Other Foam Product (except Polystyrene) Manufacturing +326150,Urethane and Other Foam Product (except Polystyrene) Manufacturing 32616,Plastics Bottle Manufacturing +326160,Plastics Bottle Manufacturing 32619,Other Plastics Product Manufacturing +326191,Plastics Plumbing Fixture Manufacturing +326199,All Other Plastics Product Manufacturing 3262,Rubber Product Manufacturing 32621,Tire Manufacturing +326211,Tire Manufacturing (except Retreading) +326212,Tire Retreading 32622,Rubber and Plastics Hoses and Belting Manufacturing +326220,Rubber and Plastics Hoses and Belting Manufacturing 32629,Other Rubber Product Manufacturing +326291,Rubber Product Manufacturing for Mechanical Use +326299,All Other Rubber Product Manufacturing 327,Nonmetallic Mineral Product Manufacturing 3271,Clay Product and Refractory Manufacturing 32711,"Pottery, Ceramics, and Plumbing Fixture Manufacturing" +327110,"Pottery, Ceramics, and Plumbing Fixture Manufacturing" 32712,Clay Building Material and Refractories Manufacturing +327120,Clay Building Material and Refractories Manufacturing 3272,Glass and Glass Product Manufacturing 32721,Glass and Glass Product Manufacturing +327211,Flat Glass Manufacturing +327212,Other Pressed and Blown Glass and Glassware Manufacturing +327213,Glass Container Manufacturing +327215,Glass Product Manufacturing Made of Purchased Glass 3273,Cement and Concrete Product Manufacturing 32731,Cement Manufacturing +327310,Cement Manufacturing 32732,Ready-Mix Concrete Manufacturing +327320,Ready-Mix Concrete Manufacturing 32733,"Concrete Pipe, Brick, and Block Manufacturing" +327331,Concrete Block and Brick Manufacturing +327332,Concrete Pipe Manufacturing 32739,Other Concrete Product Manufacturing +327390,Other Concrete Product Manufacturing 3274,Lime and Gypsum Product Manufacturing 32741,Lime Manufacturing +327410,Lime Manufacturing 32742,Gypsum Product Manufacturing +327420,Gypsum Product Manufacturing 3279,Other Nonmetallic Mineral Product Manufacturing 32791,Abrasive Product Manufacturing +327910,Abrasive Product Manufacturing 32799,All Other Nonmetallic Mineral Product Manufacturing +327991,Cut Stone and Stone Product Manufacturing +327992,Ground or Treated Mineral and Earth Manufacturing +327993,Mineral Wool Manufacturing +327999,All Other Miscellaneous Nonmetallic Mineral Product Manufacturing 33,Manufacturing 331,Primary Metal Manufacturing 3311,Iron and Steel Mills and Ferroalloy Manufacturing 33111,Iron and Steel Mills and Ferroalloy Manufacturing +331110,Iron and Steel Mills and Ferroalloy Manufacturing 3312,Steel Product Manufacturing from Purchased Steel 33121,Iron and Steel Pipe and Tube Manufacturing from Purchased Steel +331210,Iron and Steel Pipe and Tube Manufacturing from Purchased Steel 33122,Rolling and Drawing of Purchased Steel +331221,Rolled Steel Shape Manufacturing +331222,Steel Wire Drawing 3313,Alumina and Aluminum Production and Processing 33131,Alumina and Aluminum Production and Processing +331313,Alumina Refining and Primary Aluminum Production +331314,Secondary Smelting and Alloying of Aluminum +331315,"Aluminum Sheet, Plate, and Foil Manufacturing" +331318,"Other Aluminum Rolling, Drawing, and Extruding" 3314,Nonferrous Metal (except Aluminum) Production and Processing 33141,Nonferrous Metal (except Aluminum) Smelting and Refining +331410,Nonferrous Metal (except Aluminum) Smelting and Refining 33142,"Copper Rolling, Drawing, Extruding, and Alloying" +331420,"Copper Rolling, Drawing, Extruding, and Alloying" 33149,"Nonferrous Metal (except Copper and Aluminum) Rolling, Drawing, Extruding, and Alloying" +331491,"Nonferrous Metal (except Copper and Aluminum) Rolling, Drawing, and Extruding" +331492,"Secondary Smelting, Refining, and Alloying of Nonferrous Metal (except Copper and Aluminum)" 3315,Foundries 33151,Ferrous Metal Foundries +331511,Iron Foundries +331512,Steel Investment Foundries +331513,Steel Foundries (except Investment) 33152,Nonferrous Metal Foundries +331523,Nonferrous Metal Die-Casting Foundries +331524,Aluminum Foundries (except Die-Casting) +331529,Other Nonferrous Metal Foundries (except Die-Casting) 332,Fabricated Metal Product Manufacturing 3321,Forging and Stamping 33211,Forging and Stamping +332111,Iron and Steel Forging +332112,Nonferrous Forging +332114,Custom Roll Forming +332117,Powder Metallurgy Part Manufacturing +332119,"Metal Crown, Closure, and Other Metal Stamping (except Automotive)" 3322,Cutlery and Handtool Manufacturing 33221,Cutlery and Handtool Manufacturing +332215,"Metal Kitchen Cookware, Utensil, Cutlery, and Flatware (except Precious) Manufacturing" +332216,Saw Blade and Handtool Manufacturing 3323,Architectural and Structural Metals Manufacturing 33231,Plate Work and Fabricated Structural Product Manufacturing +332311,Prefabricated Metal Building and Component Manufacturing +332312,Fabricated Structural Metal Manufacturing +332313,Plate Work Manufacturing 33232,Ornamental and Architectural Metal Products Manufacturing +332321,Metal Window and Door Manufacturing +332322,Sheet Metal Work Manufacturing +332323,Ornamental and Architectural Metal Work Manufacturing 3324,"Boiler, Tank, and Shipping Container Manufacturing" 33241,Power Boiler and Heat Exchanger Manufacturing +332410,Power Boiler and Heat Exchanger Manufacturing 33242,Metal Tank (Heavy Gauge) Manufacturing +332420,Metal Tank (Heavy Gauge) Manufacturing 33243,"Metal Can, Box, and Other Metal Container (Light Gauge) Manufacturing" +332431,Metal Can Manufacturing +332439,Other Metal Container Manufacturing 3325,Hardware Manufacturing 33251,Hardware Manufacturing +332510,Hardware Manufacturing 3326,Spring and Wire Product Manufacturing 33261,Spring and Wire Product Manufacturing +332613,Spring Manufacturing +332618,Other Fabricated Wire Product Manufacturing 3327,"Machine Shops; Turned Product; and Screw, Nut, and Bolt Manufacturing" 33271,Machine Shops +332710,Machine Shops 33272,"Turned Product and Screw, Nut, and Bolt Manufacturing" +332721,Precision Turned Product Manufacturing +332722,"Bolt, Nut, Screw, Rivet, and Washer Manufacturing" 3328,"Coating, Engraving, Heat Treating, and Allied Activities" 33281,"Coating, Engraving, Heat Treating, and Allied Activities" +332811,Metal Heat Treating +332812,"Metal Coating, Engraving (except Jewelry and Silverware), and Allied Services to Manufacturers" +332813,"Electroplating, Plating, Polishing, Anodizing, and Coloring" 3329,Other Fabricated Metal Product Manufacturing 33291,Metal Valve Manufacturing +332911,Industrial Valve Manufacturing +332912,Fluid Power Valve and Hose Fitting Manufacturing +332913,Plumbing Fixture Fitting and Trim Manufacturing +332919,Other Metal Valve and Pipe Fitting Manufacturing 33299,All Other Fabricated Metal Product Manufacturing +332991,Ball and Roller Bearing Manufacturing +332992,Small Arms Ammunition Manufacturing +332993,Ammunition (except Small Arms) Manufacturing +332994,"Small Arms, Ordnance, and Ordnance Accessories Manufacturing" +332996,Fabricated Pipe and Pipe Fitting Manufacturing +332999,All Other Miscellaneous Fabricated Metal Product Manufacturing 333,Machinery Manufacturing 3331,"Agriculture, Construction, and Mining Machinery Manufacturing" 33311,Agricultural Implement Manufacturing +333111,Farm Machinery and Equipment Manufacturing +333112,Lawn and Garden Tractor and Home Lawn and Garden Equipment Manufacturing 33312,Construction Machinery Manufacturing +333120,Construction Machinery Manufacturing 33313,Mining and Oil and Gas Field Machinery Manufacturing +333131,Mining Machinery and Equipment Manufacturing +333132,Oil and Gas Field Machinery and Equipment Manufacturing 3332,Industrial Machinery Manufacturing 33324,Industrial Machinery Manufacturing +333241,Food Product Machinery Manufacturing +333242,Semiconductor Machinery Manufacturing +333243,"Sawmill, Woodworking, and Paper Machinery Manufacturing" +333244,Printing Machinery and Equipment Manufacturing +333249,Other Industrial Machinery Manufacturing 3333,Commercial and Service Industry Machinery Manufacturing 33331,Commercial and Service Industry Machinery Manufacturing +333314,Optical Instrument and Lens Manufacturing +333316,Photographic and Photocopying Equipment Manufacturing +333318,Other Commercial and Service Industry Machinery Manufacturing 3334,"Ventilation, Heating, Air-Conditioning, and Commercial Refrigeration Equipment Manufacturing" 33341,"Ventilation, Heating, Air-Conditioning, and Commercial Refrigeration Equipment Manufacturing" +333413,Industrial and Commercial Fan and Blower and Air Purification Equipment Manufacturing +333414,Heating Equipment (except Warm Air Furnaces) Manufacturing +333415,Air-Conditioning and Warm Air Heating Equipment and Commercial and Industrial Refrigeration Equipment Manufacturing 3335,Metalworking Machinery Manufacturing 33351,Metalworking Machinery Manufacturing +333511,Industrial Mold Manufacturing +333514,"Special Die and Tool, Die Set, Jig, and Fixture Manufacturing" +333515,Cutting Tool and Machine Tool Accessory Manufacturing +333517,Machine Tool Manufacturing +333519,Rolling Mill and Other Metalworking Machinery Manufacturing 3336,"Engine, Turbine, and Power Transmission Equipment Manufacturing" 33361,"Engine, Turbine, and Power Transmission Equipment Manufacturing" +333611,Turbine and Turbine Generator Set Units Manufacturing +333612,"Speed Changer, Industrial High-Speed Drive, and Gear Manufacturing" +333613,Mechanical Power Transmission Equipment Manufacturing +333618,Other Engine Equipment Manufacturing 3339,Other General Purpose Machinery Manufacturing 33391,Pump and Compressor Manufacturing +333911,Pump and Pumping Equipment Manufacturing +333912,Air and Gas Compressor Manufacturing +333913,Measuring and Dispensing Pump Manufacturing 33392,Material Handling Equipment Manufacturing +333921,Elevator and Moving Stairway Manufacturing +333922,Conveyor and Conveying Equipment Manufacturing +333923,"Overhead Traveling Crane, Hoist, and Monorail System Manufacturing" +333924,"Industrial Truck, Tractor, Trailer, and Stacker Machinery Manufacturing" 33399,All Other General Purpose Machinery Manufacturing +333991,Power-Driven Handtool Manufacturing +333992,Welding and Soldering Equipment Manufacturing +333993,Packaging Machinery Manufacturing +333994,Industrial Process Furnace and Oven Manufacturing +333995,Fluid Power Cylinder and Actuator Manufacturing +333996,Fluid Power Pump and Motor Manufacturing +333997,Scale and Balance Manufacturing +333999,All Other Miscellaneous General Purpose Machinery Manufacturing 334,Computer and Electronic Product Manufacturing 3341,Computer and Peripheral Equipment Manufacturing 33411,Computer and Peripheral Equipment Manufacturing +334111,Electronic Computer Manufacturing +334112,Computer Storage Device Manufacturing +334118,Computer Terminal and Other Computer Peripheral Equipment Manufacturing 3342,Communications Equipment Manufacturing 33421,Telephone Apparatus Manufacturing +334210,Telephone Apparatus Manufacturing 33422,Radio and Television Broadcasting and Wireless Communications Equipment Manufacturing +334220,Radio and Television Broadcasting and Wireless Communications Equipment Manufacturing 33429,Other Communications Equipment Manufacturing +334290,Other Communications Equipment Manufacturing 3343,Audio and Video Equipment Manufacturing 33431,Audio and Video Equipment Manufacturing +334310,Audio and Video Equipment Manufacturing 3344,Semiconductor and Other Electronic Component Manufacturing 33441,Semiconductor and Other Electronic Component Manufacturing +334412,Bare Printed Circuit Board Manufacturing +334413,Semiconductor and Related Device Manufacturing +334416,"Capacitor, Resistor, Coil, Transformer, and Other Inductor Manufacturing" +334417,Electronic Connector Manufacturing +334418,Printed Circuit Assembly (Electronic Assembly) Manufacturing +334419,Other Electronic Component Manufacturing 3345,"Navigational, Measuring, Electromedical, and Control Instruments Manufacturing" 33451,"Navigational, Measuring, Electromedical, and Control Instruments Manufacturing" +334510,Electromedical and Electrotherapeutic Apparatus Manufacturing +334511,"Search, Detection, Navigation, Guidance, Aeronautical, and Nautical System and Instrument Manufacturing" +334512,"Automatic Environmental Control Manufacturing for Residential, Commercial, and Appliance Use" +334513,"Instruments and Related Products Manufacturing for Measuring, Displaying, and Controlling Industrial Process Variables" +334514,Totalizing Fluid Meter and Counting Device Manufacturing +334515,Instrument Manufacturing for Measuring and Testing Electricity and Electrical Signals +334516,Analytical Laboratory Instrument Manufacturing +334517,Irradiation Apparatus Manufacturing +334519,Other Measuring and Controlling Device Manufacturing 3346,Manufacturing and Reproducing Magnetic and Optical Media 33461,Manufacturing and Reproducing Magnetic and Optical Media +334613,Blank Magnetic and Optical Recording Media Manufacturing +334614,"Software and Other Prerecorded Compact Disc, Tape, and Record Reproducing" 335,"Electrical Equipment, Appliance, and Component Manufacturing" 3351,Electric Lighting Equipment Manufacturing 33511,Electric Lamp Bulb and Part Manufacturing +335110,Electric Lamp Bulb and Part Manufacturing 33512,Lighting Fixture Manufacturing +335121,Residential Electric Lighting Fixture Manufacturing +335122,"Commercial, Industrial, and Institutional Electric Lighting Fixture Manufacturing" +335129,Other Lighting Equipment Manufacturing 3352,Household Appliance Manufacturing 33521,Small Electrical Appliance Manufacturing +335210,Small Electrical Appliance Manufacturing 33522,Major Appliance Manufacturing +335221,Household Cooking Appliance Manufacturing +335222,Household Refrigerator and Home Freezer Manufacturing +335224,Household Laundry Equipment Manufacturing +335228,Other Major Household Appliance Manufacturing 3353,Electrical Equipment Manufacturing 33531,Electrical Equipment Manufacturing +335311,"Power, Distribution, and Specialty Transformer Manufacturing" +335312,Motor and Generator Manufacturing +335313,Switchgear and Switchboard Apparatus Manufacturing +335314,Relay and Industrial Control Manufacturing 3359,Other Electrical Equipment and Component Manufacturing 33591,Battery Manufacturing +335911,Storage Battery Manufacturing +335912,Primary Battery Manufacturing 33592,Communication and Energy Wire and Cable Manufacturing +335921,Fiber Optic Cable Manufacturing +335929,Other Communication and Energy Wire Manufacturing 33593,Wiring Device Manufacturing +335931,Current-Carrying Wiring Device Manufacturing +335932,Noncurrent-Carrying Wiring Device Manufacturing 33599,All Other Electrical Equipment and Component Manufacturing +335991,Carbon and Graphite Product Manufacturing +335999,All Other Miscellaneous Electrical Equipment and Component Manufacturing 336,Transportation Equipment Manufacturing 3361,Motor Vehicle Manufacturing 33611,Automobile and Light Duty Motor Vehicle Manufacturing +336111,Automobile Manufacturing +336112,Light Truck and Utility Vehicle Manufacturing 33612,Heavy Duty Truck Manufacturing +336120,Heavy Duty Truck Manufacturing 3362,Motor Vehicle Body and Trailer Manufacturing 33621,Motor Vehicle Body and Trailer Manufacturing +336211,Motor Vehicle Body Manufacturing +336212,Truck Trailer Manufacturing +336213,Motor Home Manufacturing +336214,Travel Trailer and Camper Manufacturing 3363,Motor Vehicle Parts Manufacturing 33631,Motor Vehicle Gasoline Engine and Engine Parts Manufacturing +336310,Motor Vehicle Gasoline Engine and Engine Parts Manufacturing 33632,Motor Vehicle Electrical and Electronic Equipment Manufacturing +336320,Motor Vehicle Electrical and Electronic Equipment Manufacturing 33633,Motor Vehicle Steering and Suspension Components (except Spring) Manufacturing +336330,Motor Vehicle Steering and Suspension Components (except Spring) Manufacturing 33634,Motor Vehicle Brake System Manufacturing +336340,Motor Vehicle Brake System Manufacturing 33635,Motor Vehicle Transmission and Power Train Parts Manufacturing +336350,Motor Vehicle Transmission and Power Train Parts Manufacturing 33636,Motor Vehicle Seating and Interior Trim Manufacturing +336360,Motor Vehicle Seating and Interior Trim Manufacturing 33637,Motor Vehicle Metal Stamping +336370,Motor Vehicle Metal Stamping 33639,Other Motor Vehicle Parts Manufacturing +336390,Other Motor Vehicle Parts Manufacturing 3364,Aerospace Product and Parts Manufacturing 33641,Aerospace Product and Parts Manufacturing +336411,Aircraft Manufacturing +336412,Aircraft Engine and Engine Parts Manufacturing +336413,Other Aircraft Parts and Auxiliary Equipment Manufacturing +336414,Guided Missile and Space Vehicle Manufacturing +336415,Guided Missile and Space Vehicle Propulsion Unit and Propulsion Unit Parts Manufacturing +336419,Other Guided Missile and Space Vehicle Parts and Auxiliary Equipment Manufacturing 3365,Railroad Rolling Stock Manufacturing 33651,Railroad Rolling Stock Manufacturing +336510,Railroad Rolling Stock Manufacturing 3366,Ship and Boat Building 33661,Ship and Boat Building +336611,Ship Building and Repairing +336612,Boat Building 3369,Other Transportation Equipment Manufacturing 33699,Other Transportation Equipment Manufacturing +336991,"Motorcycle, Bicycle, and Parts Manufacturing" +336992,"Military Armored Vehicle, Tank, and Tank Component Manufacturing" +336999,All Other Transportation Equipment Manufacturing 337,Furniture and Related Product Manufacturing 3371,Household and Institutional Furniture and Kitchen Cabinet Manufacturing 33711,Wood Kitchen Cabinet and Countertop Manufacturing +337110,Wood Kitchen Cabinet and Countertop Manufacturing 33712,Household and Institutional Furniture Manufacturing +337121,Upholstered Household Furniture Manufacturing +337122,Nonupholstered Wood Household Furniture Manufacturing +337124,Metal Household Furniture Manufacturing +337125,Household Furniture (except Wood and Metal) Manufacturing +337127,Institutional Furniture Manufacturing 3372,Office Furniture (including Fixtures) Manufacturing 33721,Office Furniture (including Fixtures) Manufacturing +337211,Wood Office Furniture Manufacturing +337212,Custom Architectural Woodwork and Millwork Manufacturing +337214,Office Furniture (except Wood) Manufacturing +337215,"Showcase, Partition, Shelving, and Locker Manufacturing" 3379,Other Furniture Related Product Manufacturing 33791,Mattress Manufacturing +337910,Mattress Manufacturing 33792,Blind and Shade Manufacturing +337920,Blind and Shade Manufacturing 339,Miscellaneous Manufacturing 3391,Medical Equipment and Supplies Manufacturing 33911,Medical Equipment and Supplies Manufacturing +339112,Surgical and Medical Instrument Manufacturing +339113,Surgical Appliance and Supplies Manufacturing +339114,Dental Equipment and Supplies Manufacturing +339115,Ophthalmic Goods Manufacturing +339116,Dental Laboratories 3399,Other Miscellaneous Manufacturing 33991,Jewelry and Silverware Manufacturing +339910,Jewelry and Silverware Manufacturing 33992,Sporting and Athletic Goods Manufacturing +339920,Sporting and Athletic Goods Manufacturing 33993,"Doll, Toy, and Game Manufacturing" +339930,"Doll, Toy, and Game Manufacturing" 33994,Office Supplies (except Paper) Manufacturing +339940,Office Supplies (except Paper) Manufacturing 33995,Sign Manufacturing +339950,Sign Manufacturing 33999,All Other Miscellaneous Manufacturing +339991,"Gasket, Packing, and Sealing Device Manufacturing" +339992,Musical Instrument Manufacturing +339993,"Fastener, Button, Needle, and Pin Manufacturing" +339994,"Broom, Brush, and Mop Manufacturing" +339995,Burial Casket Manufacturing +339999,All Other Miscellaneous Manufacturing 42,Wholesale Trade 423,"Merchant Wholesalers, Durable Goods" 4231,Motor Vehicle and Motor Vehicle Parts and Supplies Merchant Wholesalers @@ -1853,3 +2216,13 @@ NAICS_2012_Code,NAICS_2012_Name 928110,National Security 92812,International Affairs 928120,International Affairs +F010,Personal Consumption Expeditures +F01000,Personal Consumption Expeditures +F040,Exports of goods and services +F04000,Exports of goods and services +F050,Imports of goods and services +F05000,Imports of goods and services +S00101,Federal electric utilities +S00201,State and local government passenger transit +S00202,State and local government electric utilities +S00203,Other state and local government enterprises diff --git a/flowsa/data/NAICS_2012_Names.csv b/flowsa/data/Sector_2017_Names.csv similarity index 79% rename from flowsa/data/NAICS_2012_Names.csv rename to flowsa/data/Sector_2017_Names.csv index 8f0f3baab..36e18591f 100644 --- a/flowsa/data/NAICS_2012_Names.csv +++ b/flowsa/data/Sector_2017_Names.csv @@ -1,4 +1,4 @@ -NAICS_2012_Code,NAICS_2012_Name +NAICS_2017_Code,NAICS_2017_Name 11,"Agriculture, Forestry, Fishing and Hunting" 111,Crop Production 1111,Oilseed and Grain Farming @@ -133,9 +133,10 @@ NAICS_2012_Code,NAICS_2012_Name 21,"Mining, Quarrying, and Oil and Gas Extraction" 211,Oil and Gas Extraction 2111,Oil and Gas Extraction -21111,Oil and Gas Extraction -211111,Crude Petroleum and Natural Gas Extraction -211112,Natural Gas Liquid Extraction +21112,Crude Petroleum Extraction +211120,Crude Petroleum Extraction +21113,Natural Gas Extraction +211130,Natural Gas Extraction 212,Mining (except Oil and Gas) 2121,Coal Mining 21211,Coal Mining @@ -149,8 +150,7 @@ NAICS_2012_Code,NAICS_2012_Name 212221,Gold Ore Mining 212222,Silver Ore Mining 21223,"Copper, Nickel, Lead, and Zinc Mining" -212231,Lead Ore and Zinc Ore Mining -212234,Copper Ore and Nickel Ore Mining +212230,"Copper, Nickel, Lead, and Zinc Mining" 21229,Other Metal Ore Mining 212291,Uranium-Radium-Vanadium Ore Mining 212299,All Other Metal Ore Mining @@ -280,292 +280,652 @@ NAICS_2012_Code,NAICS_2012_Name 311,Food Manufacturing 3111,Animal Food Manufacturing 31111,Animal Food Manufacturing +311111,Dog and Cat Food Manufacturing +311119,Other Animal Food Manufacturing 3112,Grain and Oilseed Milling 31121,Flour Milling and Malt Manufacturing +311211,Flour Milling +311212,Rice Milling +311213,Malt Manufacturing 31122,Starch and Vegetable Fats and Oils Manufacturing +311221,Wet Corn Milling +311224,Soybean and Other Oilseed Processing +311225,Fats and Oils Refining and Blending 31123,Breakfast Cereal Manufacturing +311230,Breakfast Cereal Manufacturing 3113,Sugar and Confectionery Product Manufacturing 31131,Sugar Manufacturing +311313,Beet Sugar Manufacturing +311314,Cane Sugar Manufacturing 31134,Nonchocolate Confectionery Manufacturing +311340,Nonchocolate Confectionery Manufacturing 31135,Chocolate and Confectionery Manufacturing +311351,Chocolate and Confectionery Manufacturing from Cacao Beans +311352,Confectionery Manufacturing from Purchased Chocolate 3114,Fruit and Vegetable Preserving and Specialty Food Manufacturing 31141,Frozen Food Manufacturing +311411,"Frozen Fruit, Juice, and Vegetable Manufacturing" +311412,Frozen Specialty Food Manufacturing 31142,"Fruit and Vegetable Canning, Pickling, and Drying" +311421,Fruit and Vegetable Canning +311422,Specialty Canning +311423,Dried and Dehydrated Food Manufacturing 3115,Dairy Product Manufacturing 31151,Dairy Product (except Frozen) Manufacturing +311511,Fluid Milk Manufacturing +311512,Creamery Butter Manufacturing +311513,Cheese Manufacturing +311514,"Dry, Condensed, and Evaporated Dairy Product Manufacturing" 31152,Ice Cream and Frozen Dessert Manufacturing +311520,Ice Cream and Frozen Dessert Manufacturing 3116,Animal Slaughtering and Processing 31161,Animal Slaughtering and Processing +311611,Animal (except Poultry) Slaughtering +311612,Meat Processed from Carcasses +311613,Rendering and Meat Byproduct Processing +311615,Poultry Processing 3117,Seafood Product Preparation and Packaging 31171,Seafood Product Preparation and Packaging +311710,Seafood Product Preparation and Packaging 3118,Bakeries and Tortilla Manufacturing 31181,Bread and Bakery Product Manufacturing +311811,Retail Bakeries +311812,Commercial Bakeries +311813,"Frozen Cakes, Pies, and Other Pastries Manufacturing" 31182,"Cookie, Cracker, and Pasta Manufacturing" +311821,Cookie and Cracker Manufacturing +311824,"Dry Pasta, Dough, and Flour Mixes Manufacturing from Purchased Flour" 31183,Tortilla Manufacturing +311830,Tortilla Manufacturing 3119,Other Food Manufacturing 31191,Snack Food Manufacturing +311911,Roasted Nuts and Peanut Butter Manufacturing +311919,Other Snack Food Manufacturing 31192,Coffee and Tea Manufacturing +311920,Coffee and Tea Manufacturing 31193,Flavoring Syrup and Concentrate Manufacturing +311930,Flavoring Syrup and Concentrate Manufacturing 31194,Seasoning and Dressing Manufacturing +311941,"Mayonnaise, Dressing, and Other Prepared Sauce Manufacturing" +311942,Spice and Extract Manufacturing 31199,All Other Food Manufacturing +311991,Perishable Prepared Food Manufacturing +311999,All Other Miscellaneous Food Manufacturing 312,Beverage and Tobacco Product Manufacturing 3121,Beverage Manufacturing 31211,Soft Drink and Ice Manufacturing +312111,Soft Drink Manufacturing +312112,Bottled Water Manufacturing +312113,Ice Manufacturing 31212,Breweries +312120,Breweries 31213,Wineries +312130,Wineries 31214,Distilleries +312140,Distilleries 3122,Tobacco Manufacturing 31223,Tobacco Manufacturing +312230,Tobacco Manufacturing 313,Textile Mills 3131,"Fiber, Yarn, and Thread Mills" 31311,"Fiber, Yarn, and Thread Mills" +313110,"Fiber, Yarn, and Thread Mills" 3132,Fabric Mills 31321,Broadwoven Fabric Mills +313210,Broadwoven Fabric Mills 31322,Narrow Fabric Mills and Schiffli Machine Embroidery +313220,Narrow Fabric Mills and Schiffli Machine Embroidery 31323,Nonwoven Fabric Mills +313230,Nonwoven Fabric Mills 31324,Knit Fabric Mills +313240,Knit Fabric Mills 3133,Textile and Fabric Finishing and Fabric Coating Mills 31331,Textile and Fabric Finishing Mills +313310,Textile and Fabric Finishing Mills 31332,Fabric Coating Mills +313320,Fabric Coating Mills 314,Textile Product Mills 3141,Textile Furnishings Mills 31411,Carpet and Rug Mills +314110,Carpet and Rug Mills 31412,Curtain and Linen Mills +314120,Curtain and Linen Mills 3149,Other Textile Product Mills 31491,Textile Bag and Canvas Mills +314910,Textile Bag and Canvas Mills 31499,All Other Textile Product Mills +314994,"Rope, Cordage, Twine, Tire Cord, and Tire Fabric Mills" +314999,All Other Miscellaneous Textile Product Mills 315,Apparel Manufacturing 3151,Apparel Knitting Mills 31511,Hosiery and Sock Mills +315110,Hosiery and Sock Mills 31519,Other Apparel Knitting Mills +315190,Other Apparel Knitting Mills 3152,Cut and Sew Apparel Manufacturing 31521,Cut and Sew Apparel Contractors +315210,Cut and Sew Apparel Contractors 31522,Men’s and Boys’ Cut and Sew Apparel Manufacturing +315220,Men’s and Boys’ Cut and Sew Apparel Manufacturing 31524,"Women’s, Girls’, and Infants’ Cut and Sew Apparel Manufacturing" +315240,"Women’s, Girls’, and Infants’ Cut and Sew Apparel Manufacturing" 31528,Other Cut and Sew Apparel Manufacturing +315280,Other Cut and Sew Apparel Manufacturing 3159,Apparel Accessories and Other Apparel Manufacturing 31599,Apparel Accessories and Other Apparel Manufacturing +315990,Apparel Accessories and Other Apparel Manufacturing 316,Leather and Allied Product Manufacturing 3161,Leather and Hide Tanning and Finishing 31611,Leather and Hide Tanning and Finishing +316110,Leather and Hide Tanning and Finishing 3162,Footwear Manufacturing 31621,Footwear Manufacturing +316210,Footwear Manufacturing 3169,Other Leather and Allied Product Manufacturing 31699,Other Leather and Allied Product Manufacturing +316992,Women's Handbag and Purse Manufacturing +316998,All Other Leather Good and Allied Product Manufacturing 32,Manufacturing 321,Wood Product Manufacturing 3211,Sawmills and Wood Preservation 32111,Sawmills and Wood Preservation +321113,Sawmills +321114,Wood Preservation 3212,"Veneer, Plywood, and Engineered Wood Product Manufacturing" 32121,"Veneer, Plywood, and Engineered Wood Product Manufacturing" +321211,Hardwood Veneer and Plywood Manufacturing +321212,Softwood Veneer and Plywood Manufacturing +321213,Engineered Wood Member (except Truss) Manufacturing +321214,Truss Manufacturing +321219,Reconstituted Wood Product Manufacturing 3219,Other Wood Product Manufacturing 32191,Millwork +321911,Wood Window and Door Manufacturing +321912,"Cut Stock, Resawing Lumber, and Planing" +321918,Other Millwork (including Flooring) 32192,Wood Container and Pallet Manufacturing +321920,Wood Container and Pallet Manufacturing 32199,All Other Wood Product Manufacturing +321991,Manufactured Home (Mobile Home) Manufacturing +321992,Prefabricated Wood Building Manufacturing +321999,All Other Miscellaneous Wood Product Manufacturing 322,Paper Manufacturing 3221,"Pulp, Paper, and Paperboard Mills" 32211,Pulp Mills +322110,Pulp Mills 32212,Paper Mills +322121,Paper (except Newsprint) Mills +322122,Newsprint Mills 32213,Paperboard Mills +322130,Paperboard Mills 3222,Converted Paper Product Manufacturing 32221,Paperboard Container Manufacturing +322211,Corrugated and Solid Fiber Box Manufacturing +322212,Folding Paperboard Box Manufacturing +322219,Other Paperboard Container Manufacturing 32222,Paper Bag and Coated and Treated Paper Manufacturing +322220,Paper Bag and Coated and Treated Paper Manufacturing 32223,Stationery Product Manufacturing +322230,Stationery Product Manufacturing 32229,Other Converted Paper Product Manufacturing +322291,Sanitary Paper Product Manufacturing +322299,All Other Converted Paper Product Manufacturing 323,Printing and Related Support Activities 3231,Printing and Related Support Activities 32311,Printing +323111,Commercial Printing (except Screen and Books) +323113,Commercial Screen Printing +323117,Books Printing 32312,Support Activities for Printing +323120,Support Activities for Printing 324,Petroleum and Coal Products Manufacturing 3241,Petroleum and Coal Products Manufacturing 32411,Petroleum Refineries +324110,Petroleum Refineries 32412,"Asphalt Paving, Roofing, and Saturated Materials Manufacturing" +324121,Asphalt Paving Mixture and Block Manufacturing +324122,Asphalt Shingle and Coating Materials Manufacturing 32419,Other Petroleum and Coal Products Manufacturing +324191,Petroleum Lubricating Oil and Grease Manufacturing +324199,All Other Petroleum and Coal Products Manufacturing 325,Chemical Manufacturing 3251,Basic Chemical Manufacturing 32511,Petrochemical Manufacturing +325110,Petrochemical Manufacturing 32512,Industrial Gas Manufacturing +325120,Industrial Gas Manufacturing 32513,Synthetic Dye and Pigment Manufacturing +325130,Synthetic Dye and Pigment Manufacturing 32518,Other Basic Inorganic Chemical Manufacturing +325180,Other Basic Inorganic Chemical Manufacturing 32519,Other Basic Organic Chemical Manufacturing -3252,"Resin, Synthetic Rubber, and Artificial Synthetic Fibers and Filaments Manufacturing" +325193,Ethyl Alcohol Manufacturing +325194,"Cyclic Crude, Intermediate, and Gum and Wood Chemical Manufacturing" +325199,All Other Basic Organic Chemical Manufacturing +3252,"Resin, Synthetic Rubber, and Artificial and Synthetic Fibers and Filaments Manufacturing" 32521,Resin and Synthetic Rubber Manufacturing +325211,Plastics Material and Resin Manufacturing +325212,Synthetic Rubber Manufacturing 32522,Artificial and Synthetic Fibers and Filaments Manufacturing +325220,Artificial and Synthetic Fibers and Filaments Manufacturing 3253,"Pesticide, Fertilizer, and Other Agricultural Chemical Manufacturing" 32531,Fertilizer Manufacturing +325311,Nitrogenous Fertilizer Manufacturing +325312,Phosphatic Fertilizer Manufacturing +325314,Fertilizer (Mixing Only) Manufacturing 32532,Pesticide and Other Agricultural Chemical Manufacturing +325320,Pesticide and Other Agricultural Chemical Manufacturing 3254,Pharmaceutical and Medicine Manufacturing 32541,Pharmaceutical and Medicine Manufacturing +325411,Medicinal and Botanical Manufacturing +325412,Pharmaceutical Preparation Manufacturing +325413,In-Vitro Diagnostic Substance Manufacturing +325414,Biological Product (except Diagnostic) Manufacturing 3255,"Paint, Coating, and Adhesive Manufacturing" 32551,Paint and Coating Manufacturing +325510,Paint and Coating Manufacturing 32552,Adhesive Manufacturing +325520,Adhesive Manufacturing 3256,"Soap, Cleaning Compound, and Toilet Preparation Manufacturing" 32561,Soap and Cleaning Compound Manufacturing +325611,Soap and Other Detergent Manufacturing +325612,Polish and Other Sanitation Good Manufacturing +325613,Surface Active Agent Manufacturing 32562,Toilet Preparation Manufacturing +325620,Toilet Preparation Manufacturing 3259,Other Chemical Product and Preparation Manufacturing 32591,Printing Ink Manufacturing +325910,Printing Ink Manufacturing 32592,Explosives Manufacturing +325920,Explosives Manufacturing 32599,All Other Chemical Product and Preparation Manufacturing +325991,Custom Compounding of Purchased Resins +325992,"Photographic Film, Paper, Plate, and Chemical Manufacturing" +325998,All Other Miscellaneous Chemical Product and Preparation Manufacturing 326,Plastics and Rubber Products Manufacturing 3261,Plastics Product Manufacturing 32611,Plastics Packaging Materials and Unlaminated Film and Sheet Manufacturing +326111,Plastics Bag and Pouch Manufacturing +326112,Plastics Packaging Film and Sheet (including Laminated) Manufacturing +326113,Unlaminated Plastics Film and Sheet (except Packaging) Manufacturing 32612,"Plastics Pipe, Pipe Fitting, and Unlaminated Profile Shape Manufacturing" +326121,Unlaminated Plastics Profile Shape Manufacturing +326122,Plastics Pipe and Pipe Fitting Manufacturing 32613,"Laminated Plastics Plate, Sheet (except Packaging), and Shape Manufacturing" +326130,"Laminated Plastics Plate, Sheet (except Packaging), and Shape Manufacturing" 32614,Polystyrene Foam Product Manufacturing +326140,Polystyrene Foam Product Manufacturing 32615,Urethane and Other Foam Product (except Polystyrene) Manufacturing +326150,Urethane and Other Foam Product (except Polystyrene) Manufacturing 32616,Plastics Bottle Manufacturing +326160,Plastics Bottle Manufacturing 32619,Other Plastics Product Manufacturing +326191,Plastics Plumbing Fixture Manufacturing +326199,All Other Plastics Product Manufacturing 3262,Rubber Product Manufacturing 32621,Tire Manufacturing +326211,Tire Manufacturing (except Retreading) +326212,Tire Retreading 32622,Rubber and Plastics Hoses and Belting Manufacturing +326220,Rubber and Plastics Hoses and Belting Manufacturing 32629,Other Rubber Product Manufacturing +326291,Rubber Product Manufacturing for Mechanical Use +326299,All Other Rubber Product Manufacturing 327,Nonmetallic Mineral Product Manufacturing 3271,Clay Product and Refractory Manufacturing 32711,"Pottery, Ceramics, and Plumbing Fixture Manufacturing" +327110,"Pottery, Ceramics, and Plumbing Fixture Manufacturing" 32712,Clay Building Material and Refractories Manufacturing +327120,Clay Building Material and Refractories Manufacturing 3272,Glass and Glass Product Manufacturing 32721,Glass and Glass Product Manufacturing +327211,Flat Glass Manufacturing +327212,Other Pressed and Blown Glass and Glassware Manufacturing +327213,Glass Container Manufacturing +327215,Glass Product Manufacturing Made of Purchased Glass 3273,Cement and Concrete Product Manufacturing 32731,Cement Manufacturing +327310,Cement Manufacturing 32732,Ready-Mix Concrete Manufacturing +327320,Ready-Mix Concrete Manufacturing 32733,"Concrete Pipe, Brick, and Block Manufacturing" +327331,Concrete Block and Brick Manufacturing +327332,Concrete Pipe Manufacturing 32739,Other Concrete Product Manufacturing +327390,Other Concrete Product Manufacturing 3274,Lime and Gypsum Product Manufacturing 32741,Lime Manufacturing +327410,Lime Manufacturing 32742,Gypsum Product Manufacturing +327420,Gypsum Product Manufacturing 3279,Other Nonmetallic Mineral Product Manufacturing 32791,Abrasive Product Manufacturing +327910,Abrasive Product Manufacturing 32799,All Other Nonmetallic Mineral Product Manufacturing +327991,Cut Stone and Stone Product Manufacturing +327992,Ground or Treated Mineral and Earth Manufacturing +327993,Mineral Wool Manufacturing +327999,All Other Miscellaneous Nonmetallic Mineral Product Manufacturing 33,Manufacturing 331,Primary Metal Manufacturing 3311,Iron and Steel Mills and Ferroalloy Manufacturing 33111,Iron and Steel Mills and Ferroalloy Manufacturing +331110,Iron and Steel Mills and Ferroalloy Manufacturing 3312,Steel Product Manufacturing from Purchased Steel 33121,Iron and Steel Pipe and Tube Manufacturing from Purchased Steel +331210,Iron and Steel Pipe and Tube Manufacturing from Purchased Steel 33122,Rolling and Drawing of Purchased Steel +331221,Rolled Steel Shape Manufacturing +331222,Steel Wire Drawing 3313,Alumina and Aluminum Production and Processing 33131,Alumina and Aluminum Production and Processing +331313,Alumina Refining and Primary Aluminum Production +331314,Secondary Smelting and Alloying of Aluminum +331315,"Aluminum Sheet, Plate, and Foil Manufacturing" +331318,"Other Aluminum Rolling, Drawing, and Extruding" 3314,Nonferrous Metal (except Aluminum) Production and Processing 33141,Nonferrous Metal (except Aluminum) Smelting and Refining +331410,Nonferrous Metal (except Aluminum) Smelting and Refining 33142,"Copper Rolling, Drawing, Extruding, and Alloying" +331420,"Copper Rolling, Drawing, Extruding, and Alloying" 33149,"Nonferrous Metal (except Copper and Aluminum) Rolling, Drawing, Extruding, and Alloying" +331491,"Nonferrous Metal (except Copper and Aluminum) Rolling, Drawing, and Extruding" +331492,"Secondary Smelting, Refining, and Alloying of Nonferrous Metal (except Copper and Aluminum)" 3315,Foundries 33151,Ferrous Metal Foundries +331511,Iron Foundries +331512,Steel Investment Foundries +331513,Steel Foundries (except Investment) 33152,Nonferrous Metal Foundries +331523,Nonferrous Metal Die-Casting Foundries +331524,Aluminum Foundries (except Die-Casting) +331529,Other Nonferrous Metal Foundries (except Die-Casting) 332,Fabricated Metal Product Manufacturing 3321,Forging and Stamping 33211,Forging and Stamping +332111,Iron and Steel Forging +332112,Nonferrous Forging +332114,Custom Roll Forming +332117,Powder Metallurgy Part Manufacturing +332119,"Metal Crown, Closure, and Other Metal Stamping (except Automotive)" 3322,Cutlery and Handtool Manufacturing 33221,Cutlery and Handtool Manufacturing +332215,"Metal Kitchen Cookware, Utensil, Cutlery, and Flatware (except Precious) Manufacturing" +332216,Saw Blade and Handtool Manufacturing 3323,Architectural and Structural Metals Manufacturing 33231,Plate Work and Fabricated Structural Product Manufacturing +332311,Prefabricated Metal Building and Component Manufacturing +332312,Fabricated Structural Metal Manufacturing +332313,Plate Work Manufacturing 33232,Ornamental and Architectural Metal Products Manufacturing +332321,Metal Window and Door Manufacturing +332322,Sheet Metal Work Manufacturing +332323,Ornamental and Architectural Metal Work Manufacturing 3324,"Boiler, Tank, and Shipping Container Manufacturing" 33241,Power Boiler and Heat Exchanger Manufacturing +332410,Power Boiler and Heat Exchanger Manufacturing 33242,Metal Tank (Heavy Gauge) Manufacturing +332420,Metal Tank (Heavy Gauge) Manufacturing 33243,"Metal Can, Box, and Other Metal Container (Light Gauge) Manufacturing" +332431,Metal Can Manufacturing +332439,Other Metal Container Manufacturing 3325,Hardware Manufacturing 33251,Hardware Manufacturing +332510,Hardware Manufacturing 3326,Spring and Wire Product Manufacturing 33261,Spring and Wire Product Manufacturing +332613,Spring Manufacturing +332618,Other Fabricated Wire Product Manufacturing 3327,"Machine Shops; Turned Product; and Screw, Nut, and Bolt Manufacturing" 33271,Machine Shops +332710,Machine Shops 33272,"Turned Product and Screw, Nut, and Bolt Manufacturing" +332721,Precision Turned Product Manufacturing +332722,"Bolt, Nut, Screw, Rivet, and Washer Manufacturing" 3328,"Coating, Engraving, Heat Treating, and Allied Activities" 33281,"Coating, Engraving, Heat Treating, and Allied Activities" +332811,Metal Heat Treating +332812,"Metal Coating, Engraving (except Jewelry and Silverware), and Allied Services to Manufacturers" +332813,"Electroplating, Plating, Polishing, Anodizing, and Coloring" 3329,Other Fabricated Metal Product Manufacturing 33291,Metal Valve Manufacturing +332911,Industrial Valve Manufacturing +332912,Fluid Power Valve and Hose Fitting Manufacturing +332913,Plumbing Fixture Fitting and Trim Manufacturing +332919,Other Metal Valve and Pipe Fitting Manufacturing 33299,All Other Fabricated Metal Product Manufacturing +332991,Ball and Roller Bearing Manufacturing +332992,Small Arms Ammunition Manufacturing +332993,Ammunition (except Small Arms) Manufacturing +332994,"Small Arms, Ordnance, and Ordnance Accessories Manufacturing" +332996,Fabricated Pipe and Pipe Fitting Manufacturing +332999,All Other Miscellaneous Fabricated Metal Product Manufacturing 333,Machinery Manufacturing 3331,"Agriculture, Construction, and Mining Machinery Manufacturing" 33311,Agricultural Implement Manufacturing +333111,Farm Machinery and Equipment Manufacturing +333112,Lawn and Garden Tractor and Home Lawn and Garden Equipment Manufacturing 33312,Construction Machinery Manufacturing +333120,Construction Machinery Manufacturing 33313,Mining and Oil and Gas Field Machinery Manufacturing +333131,Mining Machinery and Equipment Manufacturing +333132,Oil and Gas Field Machinery and Equipment Manufacturing 3332,Industrial Machinery Manufacturing 33324,Industrial Machinery Manufacturing +333241,Food Product Machinery Manufacturing +333242,Semiconductor Machinery Manufacturing +333243,"Sawmill, Woodworking, and Paper Machinery Manufacturing" +333244,Printing Machinery and Equipment Manufacturing +333249,Other Industrial Machinery Manufacturing 3333,Commercial and Service Industry Machinery Manufacturing 33331,Commercial and Service Industry Machinery Manufacturing +333314,Optical Instrument and Lens Manufacturing +333316,Photographic and Photocopying Equipment Manufacturing +333318,Other Commercial and Service Industry Machinery Manufacturing 3334,"Ventilation, Heating, Air-Conditioning, and Commercial Refrigeration Equipment Manufacturing" 33341,"Ventilation, Heating, Air-Conditioning, and Commercial Refrigeration Equipment Manufacturing" +333413,Industrial and Commercial Fan and Blower and Air Purification Equipment Manufacturing +333414,Heating Equipment (except Warm Air Furnaces) Manufacturing +333415,Air-Conditioning and Warm Air Heating Equipment and Commercial and Industrial Refrigeration Equipment Manufacturing 3335,Metalworking Machinery Manufacturing 33351,Metalworking Machinery Manufacturing +333511,Industrial Mold Manufacturing +333514,"Special Die and Tool, Die Set, Jig, and Fixture Manufacturing" +333515,Cutting Tool and Machine Tool Accessory Manufacturing +333517,Machine Tool Manufacturing +333519,Rolling Mill and Other Metalworking Machinery Manufacturing 3336,"Engine, Turbine, and Power Transmission Equipment Manufacturing" 33361,"Engine, Turbine, and Power Transmission Equipment Manufacturing" +333611,Turbine and Turbine Generator Set Units Manufacturing +333612,"Speed Changer, Industrial High-Speed Drive, and Gear Manufacturing" +333613,Mechanical Power Transmission Equipment Manufacturing +333618,Other Engine Equipment Manufacturing 3339,Other General Purpose Machinery Manufacturing 33391,Pump and Compressor Manufacturing +333912,Air and Gas Compressor Manufacturing +333914,"Measuring, Dispensing, and Other Pumping Equipment Manufacturing" 33392,Material Handling Equipment Manufacturing +333921,Elevator and Moving Stairway Manufacturing +333922,Conveyor and Conveying Equipment Manufacturing +333923,"Overhead Traveling Crane, Hoist, and Monorail System Manufacturing" +333924,"Industrial Truck, Tractor, Trailer, and Stacker Machinery Manufacturing" 33399,All Other General Purpose Machinery Manufacturing +333991,Power-Driven Handtool Manufacturing +333992,Welding and Soldering Equipment Manufacturing +333993,Packaging Machinery Manufacturing +333994,Industrial Process Furnace and Oven Manufacturing +333995,Fluid Power Cylinder and Actuator Manufacturing +333996,Fluid Power Pump and Motor Manufacturing +333997,Scale and Balance Manufacturing +333999,All Other Miscellaneous General Purpose Machinery Manufacturing 334,Computer and Electronic Product Manufacturing 3341,Computer and Peripheral Equipment Manufacturing 33411,Computer and Peripheral Equipment Manufacturing +334111,Electronic Computer Manufacturing +334112,Computer Storage Device Manufacturing +334118,Computer Terminal and Other Computer Peripheral Equipment Manufacturing 3342,Communications Equipment Manufacturing 33421,Telephone Apparatus Manufacturing +334210,Telephone Apparatus Manufacturing 33422,Radio and Television Broadcasting and Wireless Communications Equipment Manufacturing +334220,Radio and Television Broadcasting and Wireless Communications Equipment Manufacturing 33429,Other Communications Equipment Manufacturing +334290,Other Communications Equipment Manufacturing 3343,Audio and Video Equipment Manufacturing 33431,Audio and Video Equipment Manufacturing +334310,Audio and Video Equipment Manufacturing 3344,Semiconductor and Other Electronic Component Manufacturing 33441,Semiconductor and Other Electronic Component Manufacturing +334412,Bare Printed Circuit Board Manufacturing +334413,Semiconductor and Related Device Manufacturing +334416,"Capacitor, Resistor, Coil, Transformer, and Other Inductor Manufacturing" +334417,Electronic Connector Manufacturing +334418,Printed Circuit Assembly (Electronic Assembly) Manufacturing +334419,Other Electronic Component Manufacturing 3345,"Navigational, Measuring, Electromedical, and Control Instruments Manufacturing" 33451,"Navigational, Measuring, Electromedical, and Control Instruments Manufacturing" +334510,Electromedical and Electrotherapeutic Apparatus Manufacturing +334511,"Search, Detection, Navigation, Guidance, Aeronautical, and Nautical System and Instrument Manufacturing" +334512,"Automatic Environmental Control Manufacturing for Residential, Commercial, and Appliance Use" +334513,"Instruments and Related Products Manufacturing for Measuring, Displaying, and Controlling Industrial Process Variables" +334514,Totalizing Fluid Meter and Counting Device Manufacturing +334515,Instrument Manufacturing for Measuring and Testing Electricity and Electrical Signals +334516,Analytical Laboratory Instrument Manufacturing +334517,Irradiation Apparatus Manufacturing +334519,Other Measuring and Controlling Device Manufacturing 3346,Manufacturing and Reproducing Magnetic and Optical Media 33461,Manufacturing and Reproducing Magnetic and Optical Media +334613,Blank Magnetic and Optical Recording Media Manufacturing +334614,"Software and Other Prerecorded Compact Disc, Tape, and Record Reproducing" 335,"Electrical Equipment, Appliance, and Component Manufacturing" 3351,Electric Lighting Equipment Manufacturing 33511,Electric Lamp Bulb and Part Manufacturing +335110,Electric Lamp Bulb and Part Manufacturing 33512,Lighting Fixture Manufacturing +335121,Residential Electric Lighting Fixture Manufacturing +335122,"Commercial, Industrial, and Institutional Electric Lighting Fixture Manufacturing" +335129,Other Lighting Equipment Manufacturing 3352,Household Appliance Manufacturing 33521,Small Electrical Appliance Manufacturing -33522,Major Appliance Manufacturing +335210,Small Electrical Appliance Manufacturing +33522,Major Household Appliance Manufacturing +335220,Major Household Appliance Manufacturing 3353,Electrical Equipment Manufacturing 33531,Electrical Equipment Manufacturing +335311,"Power, Distribution, and Specialty Transformer Manufacturing" +335312,Motor and Generator Manufacturing +335313,Switchgear and Switchboard Apparatus Manufacturing +335314,Relay and Industrial Control Manufacturing 3359,Other Electrical Equipment and Component Manufacturing 33591,Battery Manufacturing +335911,Storage Battery Manufacturing +335912,Primary Battery Manufacturing 33592,Communication and Energy Wire and Cable Manufacturing +335921,Fiber Optic Cable Manufacturing +335929,Other Communication and Energy Wire Manufacturing 33593,Wiring Device Manufacturing +335931,Current-Carrying Wiring Device Manufacturing +335932,Noncurrent-Carrying Wiring Device Manufacturing 33599,All Other Electrical Equipment and Component Manufacturing +335991,Carbon and Graphite Product Manufacturing +335999,All Other Miscellaneous Electrical Equipment and Component Manufacturing 336,Transportation Equipment Manufacturing 3361,Motor Vehicle Manufacturing 33611,Automobile and Light Duty Motor Vehicle Manufacturing +336111,Automobile Manufacturing +336112,Light Truck and Utility Vehicle Manufacturing 33612,Heavy Duty Truck Manufacturing +336120,Heavy Duty Truck Manufacturing 3362,Motor Vehicle Body and Trailer Manufacturing 33621,Motor Vehicle Body and Trailer Manufacturing +336211,Motor Vehicle Body Manufacturing +336212,Truck Trailer Manufacturing +336213,Motor Home Manufacturing +336214,Travel Trailer and Camper Manufacturing 3363,Motor Vehicle Parts Manufacturing 33631,Motor Vehicle Gasoline Engine and Engine Parts Manufacturing +336310,Motor Vehicle Gasoline Engine and Engine Parts Manufacturing 33632,Motor Vehicle Electrical and Electronic Equipment Manufacturing +336320,Motor Vehicle Electrical and Electronic Equipment Manufacturing 33633,Motor Vehicle Steering and Suspension Components (except Spring) Manufacturing +336330,Motor Vehicle Steering and Suspension Components (except Spring) Manufacturing 33634,Motor Vehicle Brake System Manufacturing +336340,Motor Vehicle Brake System Manufacturing 33635,Motor Vehicle Transmission and Power Train Parts Manufacturing +336350,Motor Vehicle Transmission and Power Train Parts Manufacturing 33636,Motor Vehicle Seating and Interior Trim Manufacturing +336360,Motor Vehicle Seating and Interior Trim Manufacturing 33637,Motor Vehicle Metal Stamping +336370,Motor Vehicle Metal Stamping 33639,Other Motor Vehicle Parts Manufacturing +336390,Other Motor Vehicle Parts Manufacturing 3364,Aerospace Product and Parts Manufacturing 33641,Aerospace Product and Parts Manufacturing +336411,Aircraft Manufacturing +336412,Aircraft Engine and Engine Parts Manufacturing +336413,Other Aircraft Parts and Auxiliary Equipment Manufacturing +336414,Guided Missile and Space Vehicle Manufacturing +336415,Guided Missile and Space Vehicle Propulsion Unit and Propulsion Unit Parts Manufacturing +336419,Other Guided Missile and Space Vehicle Parts and Auxiliary Equipment Manufacturing 3365,Railroad Rolling Stock Manufacturing 33651,Railroad Rolling Stock Manufacturing +336510,Railroad Rolling Stock Manufacturing 3366,Ship and Boat Building 33661,Ship and Boat Building +336611,Ship Building and Repairing +336612,Boat Building 3369,Other Transportation Equipment Manufacturing 33699,Other Transportation Equipment Manufacturing +336991,"Motorcycle, Bicycle, and Parts Manufacturing" +336992,"Military Armored Vehicle, Tank, and Tank Component Manufacturing" +336999,All Other Transportation Equipment Manufacturing 337,Furniture and Related Product Manufacturing 3371,Household and Institutional Furniture and Kitchen Cabinet Manufacturing 33711,Wood Kitchen Cabinet and Countertop Manufacturing +337110,Wood Kitchen Cabinet and Countertop Manufacturing 33712,Household and Institutional Furniture Manufacturing +337121,Upholstered Household Furniture Manufacturing +337122,Nonupholstered Wood Household Furniture Manufacturing +337124,Metal Household Furniture Manufacturing +337125,Household Furniture (except Wood and Metal) Manufacturing +337127,Institutional Furniture Manufacturing 3372,Office Furniture (including Fixtures) Manufacturing 33721,Office Furniture (including Fixtures) Manufacturing +337211,Wood Office Furniture Manufacturing +337212,Custom Architectural Woodwork and Millwork Manufacturing +337214,Office Furniture (except Wood) Manufacturing +337215,"Showcase, Partition, Shelving, and Locker Manufacturing" 3379,Other Furniture Related Product Manufacturing 33791,Mattress Manufacturing +337910,Mattress Manufacturing 33792,Blind and Shade Manufacturing +337920,Blind and Shade Manufacturing 339,Miscellaneous Manufacturing 3391,Medical Equipment and Supplies Manufacturing 33911,Medical Equipment and Supplies Manufacturing +339112,Surgical and Medical Instrument Manufacturing +339113,Surgical Appliance and Supplies Manufacturing +339114,Dental Equipment and Supplies Manufacturing +339115,Ophthalmic Goods Manufacturing +339116,Dental Laboratories 3399,Other Miscellaneous Manufacturing 33991,Jewelry and Silverware Manufacturing +339910,Jewelry and Silverware Manufacturing 33992,Sporting and Athletic Goods Manufacturing +339920,Sporting and Athletic Goods Manufacturing 33993,"Doll, Toy, and Game Manufacturing" +339930,"Doll, Toy, and Game Manufacturing" 33994,Office Supplies (except Paper) Manufacturing +339940,Office Supplies (except Paper) Manufacturing 33995,Sign Manufacturing +339950,Sign Manufacturing 33999,All Other Miscellaneous Manufacturing +339991,"Gasket, Packing, and Sealing Device Manufacturing" +339992,Musical Instrument Manufacturing +339993,"Fastener, Button, Needle, and Pin Manufacturing" +339994,"Broom, Brush, and Mop Manufacturing" +339995,Burial Casket Manufacturing +339999,All Other Miscellaneous Manufacturing 42,Wholesale Trade 423,"Merchant Wholesalers, Durable Goods" 4231,Motor Vehicle and Motor Vehicle Parts and Supplies Merchant Wholesalers @@ -854,15 +1214,13 @@ NAICS_2012_Code,NAICS_2012_Name 451211,Book Stores 451212,News Dealers and Newsstands 452,General Merchandise Stores -4521,Department Stores -45211,Department Stores -452111,Department Stores (except Discount Department Stores) -452112,Discount Department Stores -4529,Other General Merchandise Stores -45291,Warehouse Clubs and Supercenters -452910,Warehouse Clubs and Supercenters -45299,All Other General Merchandise Stores -452990,All Other General Merchandise Stores +4522,Department Stores +45221,Department Stores +452210,Department Stores +4523,"General Merchandise Stores, including Warehouse Clubs and Supercenters" +45231,"General Merchandise Stores, including Warehouse Clubs and Supercenters" +452311,Warehouse Clubs and Supercenters +452319,All Other General Merchandise Stores 453,Miscellaneous Store Retailers 4531,Florists 45311,Florists @@ -888,9 +1246,7 @@ NAICS_2012_Code,NAICS_2012_Name 454,Nonstore Retailers 4541,Electronic Shopping and Mail-Order Houses 45411,Electronic Shopping and Mail-Order Houses -454111,Electronic Shopping -454112,Electronic Auctions -454113,Mail-Order Houses +454110,Electronic Shopping and Mail-Order Houses 4542,Vending Machine Operators 45421,Vending Machine Operators 454210,Vending Machine Operators @@ -1070,14 +1426,12 @@ NAICS_2012_Code,NAICS_2012_Name 512191,Teleproduction and Other Postproduction Services 512199,Other Motion Picture and Video Industries 5122,Sound Recording Industries -51221,Record Production -512210,Record Production -51222,Integrated Record Production/Distribution -512220,Integrated Record Production/Distribution 51223,Music Publishers 512230,Music Publishers 51224,Sound Recording Studios 512240,Sound Recording Studios +51225,Record Production and Distribution +512250,Record Production and Distribution 51229,Other Sound Recording Industries 512290,Other Sound Recording Industries 515,Broadcasting (except Internet) @@ -1091,12 +1445,10 @@ NAICS_2012_Code,NAICS_2012_Name 51521,Cable and Other Subscription Programming 515210,Cable and Other Subscription Programming 517,Telecommunications -5171,Wired Telecommunications Carriers -51711,Wired Telecommunications Carriers -517110,Wired Telecommunications Carriers -5172,Wireless Telecommunications Carriers (except Satellite) -51721,Wireless Telecommunications Carriers (except Satellite) -517210,Wireless Telecommunications Carriers (except Satellite) +5173,Wired and Wireless Telecommunications Carriers +51731,Wired and Wireless Telecommunications Carriers +517311,Wired Telecommunications Carriers +517312,Wireless Telecommunications Carriers (except Satellite) 5174,Satellite Telecommunications 51741,Satellite Telecommunications 517410,Satellite Telecommunications @@ -1239,14 +1591,12 @@ NAICS_2012_Code,NAICS_2012_Name 5322,Consumer Goods Rental 53221,Consumer Electronics and Appliances Rental 532210,Consumer Electronics and Appliances Rental -53222,Formal Wear and Costume Rental -532220,Formal Wear and Costume Rental -53223,Video Tape and Disc Rental -532230,Video Tape and Disc Rental -53229,Other Consumer Goods Rental -532291,Home Health Equipment Rental -532292,Recreational Goods Rental -532299,All Other Consumer Goods Rental +53228,Other Consumer Goods Rental +532281,Formal Wear and Costume Rental +532282,Video Tape and Disc Rental +532283,Home Health Equipment Rental +532284,Recreational Goods Rental +532289,All Other Consumer Goods Rental 5323,General Rental Centers 53231,General Rental Centers 532310,General Rental Centers @@ -1323,8 +1673,9 @@ NAICS_2012_Code,NAICS_2012_Name 541690,Other Scientific and Technical Consulting Services 5417,Scientific Research and Development Services 54171,"Research and Development in the Physical, Engineering, and Life Sciences" -541711,Research and Development in Biotechnology -541712,"Research and Development in the Physical, Engineering, and Life Sciences (except Biotechnology)" +541713,Research and Development in Nanotechnology +541714,Research and Development in Biotechnology (except Nanobiotechnology) +541715,"Research and Development in the Physical, Engineering, and Life Sciences (except Nanotechnology and Biotechnology)" 54172,Research and Development in the Social Sciences and Humanities 541720,Research and Development in the Social Sciences and Humanities 5418,"Advertising, Public Relations, and Related Services" @@ -1440,13 +1791,17 @@ NAICS_2012_Code,NAICS_2012_Name 56221,Waste Treatment and Disposal 562211,Hazardous Waste Treatment and Disposal 562212,Solid Waste Landfill +5622121,MSW Landfill 562213,Solid Waste Combustors and Incinerators 562219,Other Nonhazardous Waste Treatment and Disposal +5622191,Codigestion/Anaerobic Digestion +5622192,Composting/Aerobic Processes 5629,Remediation and Other Waste Management Services 56291,Remediation Services 562910,Remediation Services 56292,Materials Recovery Facilities 562920,Materials Recovery Facilities +5629201,MSW Recycling 56299,All Other Waste Management Services 562991,Septic Tank and Related Services 562998,All Other Miscellaneous Waste Management Services @@ -1655,9 +2010,9 @@ NAICS_2012_Code,NAICS_2012_Name 72121,RV (Recreational Vehicle) Parks and Recreational Camps 721211,RV (Recreational Vehicle) Parks and Campgrounds 721214,Recreational and Vacation Camps (except Campgrounds) -7213,Rooming and Boarding Houses -72131,Rooming and Boarding Houses -721310,Rooming and Boarding Houses +7213,"Rooming and Boarding Houses, Dormitories, and Workers' Camps" +72131,"Rooming and Boarding Houses, Dormitories, and Workers' Camps" +721310,"Rooming and Boarding Houses, Dormitories, and Workers' Camps" 722,Food Services and Drinking Places 7223,Special Food Services 72231,Food Service Contractors @@ -1848,3 +2203,13 @@ NAICS_2012_Code,NAICS_2012_Name 928110,National Security 92812,International Affairs 928120,International Affairs +F010,Personal Consumption Expeditures +F01000,Personal Consumption Expeditures +F040,Exports of goods and services +F04000,Exports of goods and services +F050,Imports of goods and services +F05000,Imports of goods and services +S00101,Federal electric utilities +S00201,State and local government passenger transit +S00202,State and local government electric utilities +S00203,Other state and local government enterprises diff --git a/scripts/writeNAICScrosswalk.py b/scripts/writeNAICScrosswalk.py index 3b4b3ade5..6d3803aad 100644 --- a/scripts/writeNAICScrosswalk.py +++ b/scripts/writeNAICScrosswalk.py @@ -13,7 +13,7 @@ import glob - +import re import numpy as np import pandas as pd @@ -242,30 +242,77 @@ def write_annual_naics_crosswalk(): naics_cw.to_csv(f"{datapath}/NAICS_{year}_Crosswalk.csv", index=False) -def update_sector_name_df(): - """Update list of naics names with added sectors""" - sectors = pd.read_csv(f'{datapath}/NAICS_2012_Names.csv', dtype=str) - - # dictionary of new sector names - new_sectors = pd.DataFrame( - {"NAICS_2012_Code": ['5622191', - '5622192', - '5622121', - '5629201', - '311119' - ], - "NAICS_2012_Name": ['Codigestion/Anaerobic Digestion', - 'Composting/Aerobic Processes', - 'MSW Landfill', - 'MSW Recycling', - 'Other Animal Food Manufacturing' - ]}) - df = pd.concat([sectors, new_sectors]) - df = df.sort_values("NAICS_2012_Code") - df.to_csv(f'{datapath}/Sector_2012_Names.csv', index=False) +def write_sector_name_crosswalk(): + """ + Generate csv for NAICS 2012 and NAICS 2017 codes for the names of + sectors, include additional non-official sector codes/names + :return: + """ + # import census defined NAICS + cols_2012 = ['index', 'NAICS_2012_Code', 'NAICS_2012_Name'] + naics_2012 = pd.read_excel( + "https://www.census.gov/naics/2012NAICS/2-digit_2012_Codes.xls", + names=cols_2012, skiprows=[0], dtype=str)[['NAICS_2012_Code', + 'NAICS_2012_Name']] + + cols_2017 = ['NAICS_2017_Code', 'NAICS_2017_Name', + 'NAICS_2017_Description'] + naics_2017 = pd.read_excel( + "https://www.census.gov/naics/2017NAICS/2017_NAICS_Descriptions.xlsx", + names=cols_2017, dtype=str)[['NAICS_2017_Code', 'NAICS_2017_Name']] + + # for loop through years to add unoffical NAICS and split hyphenated + # sectors + for y in ['2012', '2017']: + # dictionary of new sector names + new_sectors = pd.DataFrame( + {f"NAICS_{y}_Code": ['5622191', + '5622192', + '5622121', + '5629201', + '311119' + ], + f"NAICS_{y}_Name": ['Codigestion/Anaerobic Digestion', + 'Composting/Aerobic Processes', + 'MSW Landfill', + 'MSW Recycling', + 'Other Animal Food Manufacturing' + ]}) + + # add new sector names to offical sector names + df = pd.concat([vars()[f'naics_{y}'], new_sectors]) + # # strip whitespaces + df[f"NAICS_{y}_Name"] = df[f"NAICS_{y}_Name"].str.rstrip() + # strip superscripts + df[f"NAICS_{y}_Name"] = ( + df[f"NAICS_{y}_Name"] + .apply(lambda x: re.sub(r"(?<=[a-z])[A-Z]+$", "", x)) + .apply(lambda x: re.sub(r"(?<=[)])[A-Z]+$", "", x)) + ) + # split and add names for hyphenated sectors + df[f"NAICS_{y}_Code"] = df[f"NAICS_{y}_Code"].str.split( + '\s*-\s*').apply(lambda x: list(range(int(x[0]), int(x[-1]) + 1))) + df = df.explode(f"NAICS_{y}_Code") + df[f"NAICS_{y}_Code"] = df[f"NAICS_{y}_Code"].astype(str) + # load household and gov sectors - do this after explode because + # household and gov sectors contain letters + for s in ["Government", "Household"]: + cw = (load_crosswalk(f"{s}_SectorCodes")[['Code', 'Name']] + .rename(columns={"Code": f"NAICS_{y}_Code", + "Name": f"NAICS_{y}_Name"}) + .drop_duplicates() + ) + df = pd.concat([df, cw]) + # sort and save csv + df = (df + .sort_values(f"NAICS_{y}_Code") + .drop_duplicates() + .reset_index(drop=True) + ) + df.to_csv(f'{datapath}/Sector_{y}_Names.csv', index=False) if __name__ == '__main__': update_naics_crosswalk() write_annual_naics_crosswalk() - update_sector_name_df() + write_sector_name_crosswalk() From bb663ea68a5a41b64d6e74a25dda32e6e43a61a0 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 26 Oct 2023 21:36:49 -0400 Subject: [PATCH 1092/1127] fix typo preventing abbreviations for DC --- flowsa/location.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flowsa/location.py b/flowsa/location.py index 448f759a2..3f51a4018 100644 --- a/flowsa/location.py +++ b/flowsa/location.py @@ -88,7 +88,9 @@ def get_state_FIPS(year='2015', abbrev=False): fips = fips.drop_duplicates(subset='State') fips = fips[fips['State'].notnull()] if abbrev: - fips['State'] = fips['State'].str.title().replace(us_state_abbrev) + fips['State'] = (fips['State'].str.title() + .replace(us_state_abbrev) + .replace({'District Of Columbia': 'DC'})) return fips From cb65ee0938422e9764aa73e7e0c493347309b7cb Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 26 Oct 2023 21:39:39 -0400 Subject: [PATCH 1093/1127] expand options for FBSScatterPlot --- examples/generate_data_visualization.py | 13 ++- flowsa/datavisualization.py | 109 +++++++++++++++++++++--- 2 files changed, 103 insertions(+), 19 deletions(-) diff --git a/examples/generate_data_visualization.py b/examples/generate_data_visualization.py index 696c89032..1114b2bde 100644 --- a/examples/generate_data_visualization.py +++ b/examples/generate_data_visualization.py @@ -8,7 +8,6 @@ Generate plots to explore Flow-By-Sector model outputs """ -import flowsa import flowsa.datavisualization as dv from flowsa.settings import plotoutputpath import matplotlib.pyplot as plt @@ -39,12 +38,12 @@ method_dict = {'National Employment 2015': 'Employment_national_2015', 'National Employment 2018': 'Employment_national_2018'} -flowsa.FBSscatterplot(method_dict, plottype, - sector_length_display=sector_length_display, - sectors_to_include=sectors, - plot_title='Comparison of 2015 and 2018 Employment ' - 'for Mining Sectors' - ) +dv.FBSscatterplot(method_dict, plottype, + sector_length_display=sector_length_display, + sectors_to_include=sectors, + plot_title=('Comparison of 2015 and 2018 Employment ' + 'for Mining Sectors') + ) # Can manually adjust the figure pop up before saving plt.savefig(plotoutputpath / "mining_employment_comp.png", dpi=300) diff --git a/flowsa/datavisualization.py b/flowsa/datavisualization.py index 99d9d226d..a0055c73f 100644 --- a/flowsa/datavisualization.py +++ b/flowsa/datavisualization.py @@ -13,7 +13,7 @@ from plotly.subplots import make_subplots import flowsa import flowsa.flowbysector -from flowsa.common import load_crosswalk +from flowsa.common import load_crosswalk, load_yaml_dict # todo: need to update fxn to use new sector_aggregation - datavis not # currently working # from flowsa.flowbyfunctions import sector_aggregation @@ -70,8 +70,17 @@ def addSectorNames(df, BEA=False, mappingfile=None): return df -def FBSscatterplot(method_dict, plottype, sector_length_display=None, - sectors_to_include=None, plot_title=None): +def FBSscatterplot(method_dict, + plottype, + sector_length_display=None, + sectors_to_include=None, + impact_cat=None, + industry_spec=None, + sector_names=True, + legend_by_state=False, + legend_title='Flow-By-Sector Method', + axis_title=None, + plot_title=None): """ Plot the results of FBS models. Graphic can either be a faceted scatterplot or a method comparison @@ -83,6 +92,14 @@ def FBSscatterplot(method_dict, plottype, sector_length_display=None, dataframe :param sectors_to_include: list, sectors to include in output. Sectors are subset by all sectors that "start with" the values in this list + :param impact_cat: str, name of impact category to apply and aggregate on + impacts (e.g.: 'Global warming'). Use 'None' to aggregate by flow + :param industry_spec, dict e.g. {'default': 'NAICS_3', + 'NAICS_4': ['112', '113'], + 'NAICS_6': ['1129']} + :param sector_names: bool, True to include sector names in axis + :param legend_by_state: bool, True to show results by state + :param axis_title: str :return: graphic displaying results of FBS models """ @@ -96,17 +113,80 @@ def FBSscatterplot(method_dict, plottype, sector_length_display=None, df_list.append(dfm) df = pd.concat(df_list, ignore_index=True) + if industry_spec is not None: + # In order to reassign the industry spec, need to create and attach + # the method config for subsequent functions to work + df = flowsa.flowbysector.FlowBySector(df.reset_index(drop=True), + config=load_yaml_dict(method, 'FBS')) + # agg sectors for data visualization + df.config['industry_spec'] = industry_spec + # determine naics year in df + df.config['target_naics_year'] = df['SectorSourceName'][0].split( + "_", 1)[1].split("_", 1)[0] + + # Temporarily revert back to having both SPB and SCB, needed for + # sector_aggregation() + df = (df.rename(columns={'Sector':'SectorProducedBy'}) + .assign(SectorConsumedBy= np.nan)) + df = (df.sector_aggregation() + .rename(columns={'SectorProducedBy':'Sector'}) + .drop(columns='SectorConsumedBy')) + + if legend_by_state: + df = (df.merge(flowsa.location.get_state_FIPS(abbrev=True), + how='left', + left_on='Location', + right_on='FIPS') + .drop(columns='methodname') + .rename(columns={'State':'methodname'})) + + if impact_cat: + if type(impact_cat)==str: + imp_method = 'TRACI2.1' + indicator = impact_cat + else: + imp_method = list(impact_cat.keys())[0] + indicator = list(impact_cat.values())[0] + try: + import lciafmt + df_impacts = ( + lciafmt.apply_lcia_method(df, imp_method) + .rename(columns={'FlowAmount': 'InvAmount', + 'Impact': 'FlowAmount'})) + # Handle special case of kg CO2e units not being converted but + # should stay in the df + fl = df.query('FlowUUID not in @df_impacts.FlowUUID') + df_impacts = df_impacts.query('Indicator == @indicator') + ind_units = set(df_impacts['Indicator unit']) + # fl = fl.query('Unit in @ind_units') + fl = fl.query('Unit == "kg CO2e"').assign(Unit = 'kg') + df = pd.concat([df_impacts, fl], ignore_index=True) + if len(df) == 0: + log.exception(f'Impact category: {indicator} not found') + return + except ImportError: + log.exception('lciafmt not installed') + return + except AttributeError: + log.exception('check lciafmt branch') + return + df = convert_units_for_graphics(df) + # subset df if sectors_to_include is not None: df = df[df['Sector'].str.startswith(tuple(sectors_to_include))] if sector_length_display is None: - sector_length_display = df['Sector'].apply(lambda x: x.str.len()).max() + sector_length_display = df['Sector'].apply(lambda x: len(x)).max() df['Sector'] = df['Sector'].apply(lambda x: x[0:sector_length_display]) df2 = df.groupby(['methodname', 'Sector', 'Unit'], as_index=False).agg({"FlowAmount": sum}) - # load crosswalk and add names - df3 = addSectorNames(df2) + if sector_names: + # load crosswalk and add names + df2 = addSectorNames(df2) + y_axis = "SectorName" + else: + y_axis = "Sector" sns.set_style("whitegrid") @@ -117,10 +197,12 @@ def FBSscatterplot(method_dict, plottype, sector_length_display=None, title = "" if plottype == 'facet_graph': - g = sns.FacetGrid(df3, col="methodname", + if not axis_title: + axis_title = 'Flow Amount' + g = sns.FacetGrid(df2, col="methodname", sharex=False, aspect=1.5, margin_titles=False) - g.map_dataframe(sns.scatterplot, x="FlowAmount", y="SectorName") - g.set_axis_labels("Flow Amount", "") + g.map_dataframe(sns.scatterplot, x="FlowAmount", y=y_axis) + g.set_axis_labels(axis_title, "") g.set_titles(col_template="{col_name}") # adjust overall graphic title if plot_title is not None: @@ -129,15 +211,18 @@ def FBSscatterplot(method_dict, plottype, sector_length_display=None, g.tight_layout() elif plottype == 'method_comparison': - g = sns.relplot(data=df3, x="FlowAmount", y="SectorName", + if not axis_title: + axis_title = f"Flow Amount ({df2['Unit'][0]})" + g = sns.relplot(data=df2, x="FlowAmount", y=y_axis, hue="methodname", alpha=0.7, style="methodname", palette="colorblind", aspect=1.5 ).set(title=title) - g._legend.set_title('Flow-By-Sector Method') - g.set_axis_labels(f"Flow Amount ({df3['Unit'][0]})", "") + g._legend.set_title(legend_title) + g.set_axis_labels(axis_title, "") g.tight_layout() + return g def customwrap(s, width=30): return "
".join(textwrap.wrap(s, width=width)) From cf0cbe57626721b0eeaf814eb6f9432848575fbf Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 27 Oct 2023 12:53:56 -0400 Subject: [PATCH 1094/1127] fix error with reassigning mobile ag emissions (CO2) causing negative values for some states --- .../NAICS_Crosswalk_EPA_StateGHGI.csv | 8 ++++---- flowsa/data_source_scripts/EPA_StateGHGI.py | 11 +++++++++++ flowsa/flowbyactivity.py | 1 + .../flowbysectoractivitysets/EPA_StateGHGI_asets.csv | 2 +- .../flowbysectormethods/GHG_state_m1_common.yaml | 1 + 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv index a69bc1716..351aefd7b 100644 --- a/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv +++ b/flowsa/data/activitytosectormapping/NAICS_Crosswalk_EPA_StateGHGI.csv @@ -328,10 +328,10 @@ EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combusti EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,31,,use_table_pet EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,32,,use_table_pet EPA_State_GHGI,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,NAICS_2012_Code,33,,use_table_pet -EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,111,,tbd -EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,112,,tbd -EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,113,,tbd -EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,114,,tbd +EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,111,,use_table_pet +EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,112,,use_table_pet +EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,113,,use_table_pet +EPA_State_GHGI,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,NAICS_2012_Code,114,,use_table_pet EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,NAICS_2012_Code,211,,transport_nonroad_construction EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,NAICS_2012_Code,212,,transport_nonroad_construction EPA_State_GHGI,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,NAICS_2012_Code,213111,,transport_nonroad_construction diff --git a/flowsa/data_source_scripts/EPA_StateGHGI.py b/flowsa/data_source_scripts/EPA_StateGHGI.py index fa06d47cd..daa48854d 100644 --- a/flowsa/data_source_scripts/EPA_StateGHGI.py +++ b/flowsa/data_source_scripts/EPA_StateGHGI.py @@ -10,6 +10,7 @@ import flowsa.flowbyactivity from flowsa.flowbyactivity import FlowByActivity +from flowsa.flowbysector import FlowBySector from flowsa.flowsa_log import log from flowsa.location import apply_county_FIPS from flowsa.flowbyfunctions import assign_fips_location_system @@ -216,6 +217,16 @@ def allocate_industrial_combustion(fba: FlowByActivity, **_) -> FlowByActivity: return fba +def drop_negative_values(fbs: FlowBySector, **_) -> FlowBySector: + ## In some cases, after handling adjustments for reassigning emissions in + ## the StateGHGI, sectors can have negative emissions after aggregating by + ## sector. Remove these negative values so that that state does not get + ## any emissions from that sector. clean_fbs_after_aggregation fxn + fbs = fbs.query('FlowAmount >= 0').reset_index(drop=True) + + return fbs + + if __name__ == '__main__': import flowsa flowsa.generateflowbyactivity.main(source='EPA_StateGHGI', year='2017') diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index 0ff1fcf78..1aa285c77 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -716,6 +716,7 @@ def prepare_fbs( download_sources_ok=download_sources_ok) # recursive call to prepare_fbs .drop(columns=['ActivityProducedBy', 'ActivityConsumedBy']) .aggregate_flowby() + .function_socket('clean_fbs_after_aggregation') ) def activity_sets(self) -> List['FlowByActivity']: diff --git a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv index 587ae4507..c0b32af1f 100644 --- a/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/EPA_StateGHGI_asets.csv @@ -147,7 +147,7 @@ direct,Industry - Wastewater Treatment - Wastewater Treatment and Discharge - In direct,Commercial - Wastewater Treatment - Wastewater Treatment and Discharge - Domestic,EPA_GHGI_T_2_1 transport_nonroad_ag,Agriculture - Mobile Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,EPA_GHGI_T_3_14 use_table_pet,Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Agriculture - Mobile Agricultural Equipment,negative emissions; align with 'Industry - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Industrial - Petroleum' to avoid double counting -tbd,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,EPA_GHGI_T_3_13 +use_table_pet,Agriculture - CO2 from Fossil Fuel Combustion - Fossil Fuel Combustion - Mobile Agricultural Equipment,"EPA_GHGI_T_A_14 (CO2 is included in Industrial/Commerical, not Mobile transport)" transport_nonroad_construction,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Construction,EPA_GHGI_T_3_14 temp_drop,Electric Power Industry - Other Process Uses of Carbonates - Mineral Industry, transport_nonroad_other,Industry - Mobile Combustion - Fossil Fuel Combustion - Mobile Non-Highway Other, diff --git a/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml b/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml index 3f3719ad1..03891a98c 100644 --- a/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_state_m1_common.yaml @@ -482,6 +482,7 @@ source_names: fedefl_mapping: GHGI selection_fields: PrimaryActivity: !from_index:EPA_StateGHGI_asets.csv use_table_pet + clean_fbs_after_aggregation: !script_function:EPA_StateGHGI drop_negative_values stationary_ch4_n2o: selection_fields: From a38fa0863cf118db4e59a8f5d33b19400796f2b3 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 27 Oct 2023 17:13:24 -0400 Subject: [PATCH 1095/1127] specify geoscale for use table to avoid it being overwritten by NEI FBS config --- flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2020.yaml | 3 +++ flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2020.yaml | 1 + flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2020.yaml | 1 + flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml | 3 +++ 4 files changed, 8 insertions(+) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2020.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2020.yaml index 8b61d4115..797ca8cad 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2020.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2020.yaml @@ -38,6 +38,7 @@ source_names: !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:mobile_and_fuel_storage attribution_source: Detail_Use_2020: + geoscale: national selection_fields: SectorProducedBy: {'32411': ''} # Petroleum @@ -45,6 +46,7 @@ source_names: !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:fertilizers attribution_source: Detail_Use_2020: + geoscale: national selection_fields: SectorProducedBy: {'32531': ''} # Fertilizers @@ -52,6 +54,7 @@ source_names: !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:pesticides attribution_source: Detail_Use_2020: + geoscale: national selection_fields: SectorProducedBy: {'32532': ''} # Pesticides diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2020.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2020.yaml index ee5e82cb7..5c74225ca 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2020.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2020.yaml @@ -27,6 +27,7 @@ source_names: !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad:activity_sets:offroad_vehicles_equipment attribution_source: Detail_Use_2020: + geoscale: national selection_fields: SectorProducedBy: {'32411': ''} # Petroleum diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2020.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2020.yaml index e5ed60926..056a09d97 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2020.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2020.yaml @@ -27,5 +27,6 @@ source_names: !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad:activity_sets:onroad_vehicles_gas_stations attribution_source: Detail_Use_2020: + geoscale: national selection_fields: SectorProducedBy: {'32411': ''} # Petroleum diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml index 27958d132..2dda415b7 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_common.yaml @@ -12,6 +12,8 @@ sources_to_cache: Description: - Table 2.2 - Table 3.2 + exclusion_fields: + ActivityConsumedBy: '31-33' estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy attribution_method: proportional # attribution_source: @@ -30,6 +32,7 @@ sources_to_cache: - Table 3.2 exclusion_fields: Location: '00000' + ActivityConsumedBy: '31-33' estimate_suppressed: !script_function:EIA_MECS estimate_suppressed_mecs_energy attribution_method: proportional attribution_source: # Required to attribute a few sectors to full target sector level From 33151300928d8a1c558a5a006431ab9247143522 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 27 Oct 2023 17:13:40 -0400 Subject: [PATCH 1096/1127] drop irrelevant sectors --- .../methods/flowbysectormethods/CAP_HAP_Nonpoint_2017.yaml | 6 ++++++ .../methods/flowbysectormethods/CAP_HAP_Nonroad_2017.yaml | 6 ++++++ flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2017.yaml | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2017.yaml index 83a05fbef..bee68ac0b 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2017.yaml @@ -13,6 +13,12 @@ _attribution_sources: year: *year geoscale: national activity_to_sector_mapping: BEA_2017_Detail + exclusion_fields: + # Drop irrelevant final demand and total sectors + ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', + 'F06E00', 'F07E00', 'F10E00', + 'T001', 'T004', 'T007'] + ActivityProducedBy: ['T007'] attribution_method: proportional attribution_source: Employment_national_2017: diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2017.yaml index 654da493b..29fe22149 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2017.yaml @@ -13,6 +13,12 @@ _attribution_sources: year: *year geoscale: national activity_to_sector_mapping: BEA_2017_Detail + exclusion_fields: + # Drop irrelevant final demand and total sectors + ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', + 'F06E00', 'F07E00', 'F10E00', + 'T001', 'T004', 'T007'] + ActivityProducedBy: ['T007'] attribution_method: proportional attribution_source: Employment_national_2017: diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2017.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2017.yaml index d4ca5eccd..96d4def32 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2017.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2017.yaml @@ -13,6 +13,12 @@ _attribution_sources: year: *year geoscale: national activity_to_sector_mapping: BEA_2017_Detail + exclusion_fields: + # Drop irrelevant final demand and total sectors + ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', + 'F06E00', 'F07E00', 'F10E00', + 'T001', 'T004', 'T007'] + ActivityProducedBy: ['T007'] attribution_method: proportional attribution_source: Employment_national_2017: From 04bb82cf143938c74cd944a86b40841660e474fe Mon Sep 17 00:00:00 2001 From: Ben Young Date: Sat, 28 Oct 2023 10:12:57 -0400 Subject: [PATCH 1097/1127] update activity_to_source_naics_crosswalk to correct NAICS year prior to applying to fba --- flowsa/flowbyactivity.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index 1aa285c77..c1633cfde 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -558,6 +558,21 @@ def map_to_sectors( activity_to_source_naics_crosswalk['Activity'].isin( activities_in_fba)] + if source_year != target_year: + log.info('Using NAICS time series/crosswalk to map NAICS ' + 'codes from NAICS year %s to NAICS year %s.', + source_year, target_year) + activity_to_source_naics_crosswalk = ( + activity_to_source_naics_crosswalk + .merge(naics.year_crosswalk(source_year, target_year), + how='left', + left_on='Sector', + right_on='source_naics') + .assign(**{'Sector': lambda x: x.target_naics}) + .drop(columns=['source_naics', 'target_naics']) + .assign(SectorSourceName=f'NAICS_{target_year}_Code') + ) + log.info('Converting NAICS codes in crosswalk to desired ' 'industry/sector aggregation structure.') if self.config.get('sector_hierarchy') == 'parent-completeChild': @@ -637,21 +652,6 @@ def map_to_sectors( errors='ignore') ) - if source_year != target_year: - log.info('Using NAICS time series/crosswalk to map NAICS ' - 'codes from NAICS year %s to NAICS year %s.', - source_year, target_year) - for direction in ['ProducedBy', 'ConsumedBy']: - fba_w_naics = ( - fba_w_naics - .merge(naics.year_crosswalk(source_year, target_year), - how='left', - left_on=f'Sector{direction}', - right_on='source_naics') - .assign(**{f'Sector{direction}': lambda x: x.target_naics}) - .drop(columns=['source_naics', 'target_naics']) - ) - # warn if any activities are not mapped to sectors not_mapped = fba_w_naics[fba_w_naics[['SectorProducedBy', 'SectorConsumedBy']].isna().all(1)] From d6ec5876b56933bebeb4f75820cae1174957e974 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 30 Oct 2023 12:48:16 -0400 Subject: [PATCH 1098/1127] add 2014 CAP HAP methods --- .../CAP_HAP_Nonpoint_2014.yaml | 73 +++++++++++++++++++ .../CAP_HAP_Nonroad_2014.yaml | 33 +++++++++ .../CAP_HAP_Onroad_2014.yaml | 32 ++++++++ .../CAP_HAP_national_2014_m1.yaml | 28 +++++++ .../CAP_HAP_state_2014_m1.yaml | 27 +++++++ 5 files changed, 193 insertions(+) create mode 100644 flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2014.yaml create mode 100644 flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2014.yaml create mode 100644 flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2014.yaml create mode 100644 flowsa/methods/flowbysectormethods/CAP_HAP_national_2014_m1.yaml create mode 100644 flowsa/methods/flowbysectormethods/CAP_HAP_state_2014_m1.yaml diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2014.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2014.yaml new file mode 100644 index 000000000..0557dee4f --- /dev/null +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonpoint_2014.yaml @@ -0,0 +1,73 @@ +# This is the 2014 target year method for CAP_HAP which builds off the generic +# method in CAP_HAP_common. This state level method is at the detail level. +# This FBS is for the Nonpoint portion ONLY + +!include:BEA_detail_target.yaml +target_naics_year: 2012 +geoscale: state + +_emission_year: &year 2014 + +sources_to_cache: + Detail_Use_2014: + !include:Detail_Use.yaml + year: *year + source_names: + BEA_Summary_Use_PRO_BeforeRedef: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_PRO_BeforeRedef + year: *year + + EIA_MECS_Energy: + !include:CAP_HAP_common.yaml:sources_to_cache:EIA_MECS_Energy_state + year: 2014 + attribution_source: + Employment_state_2014: # Update to MECS year + geoscale: national # Uses national at this stage prior to attributing to states + year: 2014 + clean_source: Employment_state_2014 + +source_names: + EPA_NEI_Nonpoint: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint + year: *year + activity_sets: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets + + # Update some activities with correct BEA year + mobile_and_fuel_storage: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:mobile_and_fuel_storage + attribution_source: + Detail_Use_2014: + geoscale: national + selection_fields: + SectorProducedBy: {'32411': ''} # Petroleum + + fertilizers: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:fertilizers + attribution_source: + Detail_Use_2014: + geoscale: national + selection_fields: + SectorProducedBy: {'32531': ''} # Fertilizers + + pesticides: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:pesticides + attribution_source: + Detail_Use_2014: + geoscale: national + selection_fields: + SectorProducedBy: {'32532': ''} # Pesticides + + output_allocation: # Gross Output + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:output_allocation + attribution_source: + BEA_Detail_GrossOutput_IO: + year: *year + geoscale: national + activity_to_sector_mapping: BEA_2012_Detail + attribution_method: proportional + attribution_source: + Employment_national_2014: + data_format: FBS + year: *year + diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2014.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2014.yaml new file mode 100644 index 000000000..af51ec803 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2014.yaml @@ -0,0 +1,33 @@ +# This is the 2014 target year method for CAP_HAP which builds off the generic +# method in CAP_HAP_common. This state level method is at the detail level. +# This FBS is for the Nonroad portion ONLY + +!include:BEA_detail_target.yaml +target_naics_year: 2012 +geoscale: state + +_emission_year: &year 2014 + +sources_to_cache: + Detail_Use_2014: + !include:Detail_Use.yaml + year: *year + source_names: + BEA_Summary_Use_PRO_BeforeRedef: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_PRO_BeforeRedef + year: *year + +source_names: + EPA_NEI_Nonroad: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad + year: *year + activity_sets: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad:activity_sets + offroad_vehicles_equipment: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad:activity_sets:offroad_vehicles_equipment + attribution_source: + Detail_Use_2014: + geoscale: national + selection_fields: + SectorProducedBy: {'32411': ''} # Petroleum + diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2014.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2014.yaml new file mode 100644 index 000000000..9d6c2f1b9 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_Onroad_2014.yaml @@ -0,0 +1,32 @@ +# This is the 2014 target year method for CAP_HAP which builds off the generic +# method in CAP_HAP_common. This state level method is at the detail level. +# This FBS is for the Onroad portion ONLY + +!include:BEA_detail_target.yaml +target_naics_year: 2012 +geoscale: state + +_emission_year: &year 2014 + +sources_to_cache: + Detail_Use_2014: + !include:Detail_Use.yaml + year: *year + source_names: + BEA_Summary_Use_PRO_BeforeRedef: + !include:Detail_Use.yaml:source_names:BEA_Summary_Use_PRO_BeforeRedef + year: *year + +source_names: + EPA_NEI_Onroad: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad + year: *year + activity_sets: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad:activity_sets + onroad_vehicles_gas_stations: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad:activity_sets:onroad_vehicles_gas_stations + attribution_source: + Detail_Use_2014: + geoscale: national + selection_fields: + SectorProducedBy: {'32411': ''} # Petroleum diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2014_m1.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2014_m1.yaml new file mode 100644 index 000000000..fe7ce6d2d --- /dev/null +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2014_m1.yaml @@ -0,0 +1,28 @@ +# This is the 2014 target year method for National detail models +# It aggregates the state detail models + +!include:BEA_detail_target.yaml +target_naics_year: 2012 +geoscale: national + +_emission_year: &year 2014 + +source_names: + CAP_HAP_Nonpoint_2014: # detail state model + year: *year + data_format: FBS + + CAP_HAP_Nonroad_2014: # detail state model + year: *year + data_format: FBS + + CAP_HAP_Onroad_2014: # detail state model + year: *year + data_format: FBS + + stewiFBS: + !include:CAP_HAP_common.yaml:source_names:stewiFBS + inventory_dict: + NEI: *year + TRI: *year + local_inventory_name: NEI_TRI_air_2014 diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2014_m1.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2014_m1.yaml new file mode 100644 index 000000000..08db3eda0 --- /dev/null +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2014_m1.yaml @@ -0,0 +1,27 @@ +# This is the 2014 target year method for Summary state models +# It aggregates the detail models to the summary level + +!include:USEEIO_summary_target.yaml +target_naics_year: 2012 +geoscale: state +_emission_year: &year 2014 + +source_names: + CAP_HAP_Nonpoint_2014: # detail state model + year: *year + data_format: FBS + + CAP_HAP_Nonroad_2014: # detail state model + year: *year + data_format: FBS + + CAP_HAP_Onroad_2014: # detail state model + year: *year + data_format: FBS + + stewiFBS: + !include:CAP_HAP_common.yaml:source_names:stewiFBS + inventory_dict: + NEI: *year + TRI: *year + local_inventory_name: NEI_TRI_air_2014 From 992b1756838bdc6c8af86861faa9efeb93038447 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 30 Oct 2023 21:20:26 -0400 Subject: [PATCH 1099/1127] revise access to activity crosswalks from external sources --- flowsa/sectormapping.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/flowsa/sectormapping.py b/flowsa/sectormapping.py index 4c98e374f..269f2639c 100644 --- a/flowsa/sectormapping.py +++ b/flowsa/sectormapping.py @@ -7,6 +7,7 @@ import os.path import pandas as pd import numpy as np +from pathlib import Path from esupy.mapping import apply_flow_mapping import flowsa import flowsa.flowbyactivity @@ -29,13 +30,12 @@ def get_activitytosector_mapping(source, fbsconfigpath=None): # if FBS method file loaded from outside the flowsa directory, check if # there is also a crosswalk if fbsconfigpath is not None: - external_mappingpath = (f"{os.path.dirname(fbsconfigpath)}" - "/activitytosectormapping/") - if os.path.exists(external_mappingpath): + external_mappingpath = Path(fbsconfigpath).parent / "activitytosectormapping" + if external_mappingpath.exists(): activity_mapping_source_name = get_flowsa_base_name( external_mappingpath, mapfn, 'csv') - if os.path.isfile(f"{external_mappingpath}" - f"{activity_mapping_source_name}.csv"): + if (external_mappingpath / + f"{activity_mapping_source_name}.csv").is_file(): log.info(f"Loading {activity_mapping_source_name}.csv " f"from {external_mappingpath}") crosswalkpath = external_mappingpath From 1cd2ec3460eb62ba05e47bf082039e84d30cd834 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 30 Oct 2023 21:21:09 -0400 Subject: [PATCH 1100/1127] add additional warning for geoscales with lost data --- flowsa/flowby.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 6b041c268..4ea6737a5 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -1038,10 +1038,11 @@ def proportionally_attribute( f' {sorted(set(unattributable[f"{rank}Sector"]))}. ' f'See validation_log for details.') if other_geoscale.aggregation_level < 5: - # if other_geoscale < 5: vlog.warning('This can occur when combining datasets ' 'at a sub-national level when activities ' 'do not align for some locations.') + vlog.warning(f'{other.full_name} is at geoscale ' + f'{other_geoscale}. Is that correct?') vlog.debug( 'Unattributed activities: \n {}'.format( unattributable @@ -1100,8 +1101,8 @@ def proportionally_attribute( 'See validation_log for details.', unattributable.full_name, other.full_name, - sorted(set(zip(unattributable.SectorProducedBy, - unattributable.SectorConsumedBy))) + sorted(set(zip(unattributable.SectorProducedBy.fillna('N/A'), + unattributable.SectorConsumedBy.fillna('N/A')))) ) vlog.debug( 'Unattributed activities: \n {}'.format( From 15bdf732745d6152bfb06b002602ed59778b8d2e Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 31 Oct 2023 15:54:53 -0400 Subject: [PATCH 1101/1127] `move compare_single_FBS_against_remote` to validation.py --- flowsa/validation.py | 31 +++++++++++++++++++++++++ tests/test_FBS_against_remote.py | 2 +- tests/test_single_FBS.py | 39 ++++++-------------------------- 3 files changed, 39 insertions(+), 33 deletions(-) diff --git a/flowsa/validation.py b/flowsa/validation.py index b071d75aa..f0270cdd1 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -7,6 +7,7 @@ import pandas as pd import numpy as np +from esupy.processed_data_mgmt import download_from_remote import flowsa import flowsa.flowbysector from flowsa.flowbysector import FlowBySector @@ -14,7 +15,9 @@ from flowsa.flowsa_log import log, vlog from flowsa.common import fba_activity_fields, load_yaml_dict from flowsa.location import US_FIPS +from flowsa.metadata import set_fb_meta from flowsa.schema import dq_fields +from flowsa.settings import paths, diffpath def calculate_flowamount_diff_between_dfs(dfa_load, dfb_load): @@ -280,6 +283,34 @@ def compare_FBS(df1, df2, ignore_metasources=False): return df_m +def compare_single_FBS_against_remote(m, outdir=diffpath, + run_single=False): + """Action function to compare a generated FBS with that in remote""" + downloaded = download_from_remote(set_fb_meta(m, "FlowBySector"), + paths) + if not downloaded: + if run_single: + # Run a single file even if no comparison available + FlowBySector.generateFlowBySector( + method=m, download_sources_ok=True) + else: + print(f"{m} not found in remote server. Skipping...") + return + print("--------------------------------\n" + f"Method: {m}\n" + "--------------------------------") + df = compare_FBS_results(m, m, ignore_metasources=True, + compare_to_remote=True) + df.rename(columns = {'FlowAmount_fbs1': 'FlowAmount_remote', + 'FlowAmount_fbs2': 'FlowAmount_HEAD'}, + inplace=True) + if len(df) > 0: + print(f"Saving differences in {m} to csv") + df.to_csv(f"{outdir}/{m}_diff.csv", index=False) + else: + print(f"***No differences found in {m}***") + + def compare_national_state_fbs(dataname=None, year=None, method=None, nationalname=None, statename=None, compare_metasources=False): diff --git a/tests/test_FBS_against_remote.py b/tests/test_FBS_against_remote.py index 8a0ac4fe4..d35cba27d 100644 --- a/tests/test_FBS_against_remote.py +++ b/tests/test_FBS_against_remote.py @@ -10,7 +10,7 @@ from flowsa.flowbysector import FlowBySector from flowsa.common import check_method_status, seeAvailableFlowByModels from flowsa.settings import diffpath -from tests.test_single_FBS import compare_single_FBS_against_remote +from flowsa.validation import compare_single_FBS_against_remote @pytest.mark.skip(reason="Perform targeted test for compare_FBS on PR") diff --git a/tests/test_single_FBS.py b/tests/test_single_FBS.py index b98c50c87..218de6ff5 100644 --- a/tests/test_single_FBS.py +++ b/tests/test_single_FBS.py @@ -3,39 +3,15 @@ """ import pytest import os -from flowsa.flowbysector import FlowBySector -from flowsa.metadata import set_fb_meta -from flowsa.settings import paths, diffpath -from flowsa.validation import compare_FBS_results -from esupy.processed_data_mgmt import download_from_remote +from flowsa.settings import diffpath +from flowsa.validation import compare_single_FBS_against_remote @pytest.mark.skip(reason="Perform targeted test on manual trigger") -def compare_single_FBS_against_remote(m, outdir=diffpath, - run_single=False): - downloaded = download_from_remote(set_fb_meta(m, "FlowBySector"), - paths) - if not downloaded: - if run_single: - # Run a single file even if no comparison available - FlowBySector.generateFlowBySector( - method=m, download_sources_ok=True) - else: - print(f"{m} not found in remote server. Skipping...") - return - print("--------------------------------\n" - f"Method: {m}\n" - "--------------------------------") - df = compare_FBS_results(m, m, ignore_metasources=True, - compare_to_remote=True) - df.rename(columns = {'FlowAmount_fbs1': 'FlowAmount_remote', - 'FlowAmount_fbs2': 'FlowAmount_HEAD'}, - inplace=True) - if len(df) > 0: - print(f"Saving differences in {m} to csv") - df.to_csv(f"{outdir}/{m}_diff.csv", index=False) - else: - print(f"***No differences found in {m}***") +def test_against_remote(m, run_single=False): + compare_single_FBS_against_remote(m, + outdir=diffpath, + run_single=False) if __name__ == "__main__": @@ -48,5 +24,4 @@ def compare_single_FBS_against_remote(m, outdir=diffpath, if not os.path.exists(outdir): os.mkdir(outdir) - compare_single_FBS_against_remote(m=args['method'], - run_single=True) + test_against_remote(m=args['method'], run_single=True) From b30ef45a71063907867698d88618f968f9ed9926 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 31 Oct 2023 16:06:25 -0400 Subject: [PATCH 1102/1127] refine model testing with new fbs methods --- flowsa/common.py | 2 +- tests/test_FBS_against_remote.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/flowsa/common.py b/flowsa/common.py index 305f27395..b77d09e3f 100644 --- a/flowsa/common.py +++ b/flowsa/common.py @@ -346,7 +346,7 @@ def seeAvailableFlowByModels(flowbytype, print_method=True): fb_names = [os.path.splitext(f)[0] for f in fb_dir if f.endswith('.yaml')] # further reduce list of file names by excluding common and summary_target - exclude = ["_common", "_summary_target"] + exclude = ["_common", "_target"] fb_names = [f for f in fb_names if all(s not in f for s in exclude)] if flowbytype == 'FBA': diff --git a/tests/test_FBS_against_remote.py b/tests/test_FBS_against_remote.py index d35cba27d..198a11899 100644 --- a/tests/test_FBS_against_remote.py +++ b/tests/test_FBS_against_remote.py @@ -24,6 +24,7 @@ def test_FBS_against_remote(only_run_m=None): os.mkdir(outdir) models = pd.DataFrame(seeAvailableFlowByModels("FBS", print_method=False)) models['year'] = models[0].str.extract('.*(\d{4})', expand = False) + models = models.dropna() models['model'] = models.apply(lambda x: x[0].split(x['year']), axis=1).str[0] m_last_two = models[0].str.slice(start=-2) From d2a6ae8d1f89fae2566c0281b29facb4cd7f0900 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 1 Nov 2023 14:53:30 -0400 Subject: [PATCH 1103/1127] for consistency, align electric power from 2.1 with 3.8 and 3.9, no change in result, see #390 --- .../methods/flowbysectormethods/GHG_national_m2_common.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml index 091bb3be4..9de49d37c 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_m2_common.yaml @@ -81,11 +81,6 @@ source_names: activity_sets: ## Table 2.1 # electricity_transmission handled directly from EPA_GHGI_T_2_1 - - electric_power_co2: - selection_fields: - MetaSources: 'EPA_GHGI_T_2_1.electric_power' - attribution_method: equal liming: selection_fields: @@ -342,6 +337,7 @@ source_names: electric_power: selection_fields: MetaSources: + - 'EPA_GHGI_T_2_1.electric_power' - 'EPA_GHGI_T_3_8.electric_power' - 'EPA_GHGI_T_3_9.electric_power' attribution_method: proportional From a8c59292b6e02d1b67c7959aa19c8d6180e6ea6d Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 1 Nov 2023 15:20:38 -0400 Subject: [PATCH 1104/1127] add more BEA codes to exclude to avoid warnings --- .../methods/flowbysectormethods/GHG_national_2012_m1.yaml | 2 +- .../methods/flowbysectormethods/GHG_national_2017_m1.yaml | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml index 3862cd8a5..6b9ad7f28 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2012_m1.yaml @@ -20,7 +20,7 @@ _attribution_sources: exclusion_fields: # Drop irrelevant final demand and total sectors ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', - 'F06E00', 'F07E00', 'F10E00', + 'F06E00', 'F07E00', 'F10E00', 'F02R00', 'T001', 'T004', 'T007'] ActivityProducedBy: ['T007'] attribution_method: equal diff --git a/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml b/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml index 4e60e7bd7..cbea0e0c7 100644 --- a/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml +++ b/flowsa/methods/flowbysectormethods/GHG_national_2017_m1.yaml @@ -20,9 +20,10 @@ _attribution_sources: exclusion_fields: # Drop irrelevant final demand and total sectors ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', - 'F06E00', 'F07E00', 'F10E00', - 'T001', 'T004', 'T007'] - ActivityProducedBy: ['T007'] + 'F06E00', 'F07E00', 'F10E00', 'F02R00', + 'T001', 'T004', 'T007', 'T019'] + ActivityProducedBy: ['T007', 'T013', 'T015', 'T016', 'TOP', + 'MCIF'] attribution_method: equal source_names: From 2f1c75ad43303a34c63b6769907cd3d6fa1109ed Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 2 Nov 2023 10:25:07 -0400 Subject: [PATCH 1105/1127] allow generating FBS remotely even if not on data commons --- tests/test_single_FBS.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_single_FBS.py b/tests/test_single_FBS.py index 218de6ff5..d5426dfb9 100644 --- a/tests/test_single_FBS.py +++ b/tests/test_single_FBS.py @@ -8,10 +8,10 @@ @pytest.mark.skip(reason="Perform targeted test on manual trigger") -def test_against_remote(m, run_single=False): +def test_against_remote(m): compare_single_FBS_against_remote(m, outdir=diffpath, - run_single=False) + run_single=True) if __name__ == "__main__": @@ -24,4 +24,4 @@ def test_against_remote(m, run_single=False): if not os.path.exists(outdir): os.mkdir(outdir) - test_against_remote(m=args['method'], run_single=True) + test_against_remote(m=args['method']) From 86fd0e6c0121e73fdda073b2d1befdc528d9e06b Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 2 Nov 2023 10:49:26 -0400 Subject: [PATCH 1106/1127] :heavy_check_mark: drop 3.12 from testing until dependencies have been updated (pyarrow) --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 54878dc89..3e375069f 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -31,7 +31,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - py-version: ['3.9', '3.10', '3.11', '3.12'] + py-version: ['3.9', '3.10', '3.11'] steps: - uses: actions/checkout@v3 From 8863e54668775baed86268ecfd1021258a545ace Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 2 Nov 2023 10:49:40 -0400 Subject: [PATCH 1107/1127] fix validation fxn key error --- flowsa/validation.py | 1 + 1 file changed, 1 insertion(+) diff --git a/flowsa/validation.py b/flowsa/validation.py index f0270cdd1..b174c1779 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -260,6 +260,7 @@ def compare_FBS(df1, df2, ignore_metasources=False): for c in ['SectorSourceName']: df1 = df1.drop(columns=c, errors='ignore') df2 = df2.drop(columns=c, errors='ignore') + merge_cols = [x for x in merge_cols if x != c] # check units # compare_df_units(df1, df2) df_m = pd.DataFrame( From e220e8d2b48014b9af61bf93fa7ba850e1e9fd8d Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 2 Nov 2023 20:23:25 -0600 Subject: [PATCH 1108/1127] when creating FBA activity sets, do not subset the data by "select_by_fields" as our method would call this function twice. Instead create a second activity set df that is subset to validate methods --- flowsa/flowbyactivity.py | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index c1633cfde..1bf7306c6 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -688,7 +688,8 @@ def prepare_fbs( return ( pd.concat([ fba.prepare_fbs( - external_config_path=external_config_path, download_sources_ok=download_sources_ok) + external_config_path=external_config_path, + download_sources_ok=download_sources_ok) for fba in ( self .select_by_fields() @@ -750,6 +751,16 @@ def activity_sets(self) -> List['FlowByActivity']: parent_fba .add_full_name( f'{parent_fba.full_name}{NAME_SEP_CHAR}{activity_set}') + ) + + # create additional df where activity set is subset by selection + # fields to validate that the df is broken into activity sets + # correctly and account for any situations where an activity is + # assigned to multiple activity sets. Do not want to subset the + # activity sets yet, as the process of subsetting and + # attributing the data is achieved in prepare_fbs + child_fba_validation = ( + child_fba .select_by_fields( selection_fields=activity_config.get('selection_fields'), exclusion_fields=activity_config.get('exclusion_fields')) @@ -758,24 +769,23 @@ def activity_sets(self) -> List['FlowByActivity']: child_fba.config = {**parent_config, **activity_config} child_fba = child_fba.assign(SourceName=child_fba.full_name) - if set(child_fba.row) & assigned_rows: + if set(child_fba_validation.row) & assigned_rows: log.critical( 'Some rows from %s assigned to multiple activity ' - 'sets. This will lead to double-counting:\n%s', + 'sets. This might lead to double-counting:\n%s', parent_fba.full_name, - child_fba.query( - f'row in {list(set(child_fba.row) & assigned_rows)}' + child_fba_validation.query( + f'row in {list(set(child_fba_validation.row) & assigned_rows)}' ) ) - # raise ValueError('Some rows in multiple activity sets') - assigned_rows.update(child_fba.row) - if ((not child_fba.empty) and - len(child_fba.query('FlowAmount != 0')) > 0): + assigned_rows.update(child_fba_validation.row) + if ((not child_fba_validation.empty) and + len(child_fba_validation.query('FlowAmount != 0')) > 0): child_fba_list.append(child_fba.drop(columns='row')) else: log.error(f'Activity set {child_fba.full_name} is empty. ' - 'Check activity set definition!') + f'Check activity set definition!') if set(parent_fba.row) - assigned_rows: log.warning('Some rows from %s not assigned to an activity ' From 14c84e0cafaa641a5c29899b465c762df444cdcb Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 2 Nov 2023 20:26:18 -0600 Subject: [PATCH 1109/1127] option in aggregate_flowby to aggregate data if rate/ratio, default is false --- flowsa/data_source_scripts/USGS_NWIS_WU.py | 3 ++- flowsa/flowby.py | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/flowsa/data_source_scripts/USGS_NWIS_WU.py b/flowsa/data_source_scripts/USGS_NWIS_WU.py index 6c430baf7..b5db767d3 100644 --- a/flowsa/data_source_scripts/USGS_NWIS_WU.py +++ b/flowsa/data_source_scripts/USGS_NWIS_WU.py @@ -549,7 +549,8 @@ def check_golf_and_crop_irrigation_totals(df_load: FlowByActivity): group_cols = list(df.select_dtypes(include=['object', 'int']).columns) df_w_missing_crop2 = df_w_missing_crop.aggregate_flowby( - retain_zeros=True, columns_to_group_by=group_cols) + retain_zeros=True, columns_to_group_by=group_cols, + aggregate_ratios=True) # validate results - the differences should all be 0 df_check = subset_and_merge_irrigation_types(df_w_missing_crop2) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 4ea6737a5..1b92fa066 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -532,7 +532,8 @@ def aggregate_flowby( self: FB, columns_to_group_by: List[str] = None, columns_to_average: List[str] = None, - retain_zeros: bool = False + retain_zeros: bool = False, + aggregate_ratios: bool =False ) -> FB: """ Aggregates (sums) FlowBy 'FlowAmount' column based on group_by_columns @@ -547,7 +548,8 @@ def aggregate_flowby( :return: FlowBy, with aggregated columns """ # if units are rates or ratios, do not aggregate - if self['Unit'].str.contains('/').any(): + if (self['Unit'].str.contains('/').any()) and (aggregate_ratios + is False): log.info(f"At least one row is a rate or ratio with units " f"{self['Unit'].unique().tolist()}, returning df " f"without aggregating") From d80d288fffd31114c6eef959f53349d46e668c02 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 3 Nov 2023 10:03:26 -0600 Subject: [PATCH 1110/1127] Revert "when creating FBA activity sets, do not subset the data by "select_by_fields" as our method would call this function twice. Instead create a second activity set df that is subset to validate methods" This reverts commit e220e8d2b48014b9af61bf93fa7ba850e1e9fd8d. --- flowsa/flowbyactivity.py | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index 1bf7306c6..c1633cfde 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -688,8 +688,7 @@ def prepare_fbs( return ( pd.concat([ fba.prepare_fbs( - external_config_path=external_config_path, - download_sources_ok=download_sources_ok) + external_config_path=external_config_path, download_sources_ok=download_sources_ok) for fba in ( self .select_by_fields() @@ -751,16 +750,6 @@ def activity_sets(self) -> List['FlowByActivity']: parent_fba .add_full_name( f'{parent_fba.full_name}{NAME_SEP_CHAR}{activity_set}') - ) - - # create additional df where activity set is subset by selection - # fields to validate that the df is broken into activity sets - # correctly and account for any situations where an activity is - # assigned to multiple activity sets. Do not want to subset the - # activity sets yet, as the process of subsetting and - # attributing the data is achieved in prepare_fbs - child_fba_validation = ( - child_fba .select_by_fields( selection_fields=activity_config.get('selection_fields'), exclusion_fields=activity_config.get('exclusion_fields')) @@ -769,23 +758,24 @@ def activity_sets(self) -> List['FlowByActivity']: child_fba.config = {**parent_config, **activity_config} child_fba = child_fba.assign(SourceName=child_fba.full_name) - if set(child_fba_validation.row) & assigned_rows: + if set(child_fba.row) & assigned_rows: log.critical( 'Some rows from %s assigned to multiple activity ' - 'sets. This might lead to double-counting:\n%s', + 'sets. This will lead to double-counting:\n%s', parent_fba.full_name, - child_fba_validation.query( - f'row in {list(set(child_fba_validation.row) & assigned_rows)}' + child_fba.query( + f'row in {list(set(child_fba.row) & assigned_rows)}' ) ) + # raise ValueError('Some rows in multiple activity sets') - assigned_rows.update(child_fba_validation.row) - if ((not child_fba_validation.empty) and - len(child_fba_validation.query('FlowAmount != 0')) > 0): + assigned_rows.update(child_fba.row) + if ((not child_fba.empty) and + len(child_fba.query('FlowAmount != 0')) > 0): child_fba_list.append(child_fba.drop(columns='row')) else: log.error(f'Activity set {child_fba.full_name} is empty. ' - f'Check activity set definition!') + 'Check activity set definition!') if set(parent_fba.row) - assigned_rows: log.warning('Some rows from %s not assigned to an activity ' From 45f47480266dc6e4c524626d644a15e67e79a076 Mon Sep 17 00:00:00 2001 From: "Ben Young (ERG)" <44471635+bl-young@users.noreply.github.com> Date: Fri, 3 Nov 2023 12:07:31 -0400 Subject: [PATCH 1111/1127] skip `select_by_fields` when using activity_sets (#392) * skip select_by_fields when using activity_sets * add skip_select_by parameter to `select_by_fields()` --- flowsa/flowby.py | 5 ++++- flowsa/flowbyactivity.py | 12 ++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/flowsa/flowby.py b/flowsa/flowby.py index 1b92fa066..4e2b76252 100644 --- a/flowsa/flowby.py +++ b/flowsa/flowby.py @@ -394,7 +394,8 @@ def convert_fips_to_geoscale( def select_by_fields( self: FB, selection_fields: dict = None, - exclusion_fields: dict = None + exclusion_fields: dict = None, + skip_select_by: bool = False, ) -> FB: ''' Filter the calling FlowBy dataset according to the 'selection_fields' @@ -436,6 +437,8 @@ def select_by_fields( Similarly, can use 'exclusion_fields' to remove particular data in the same manner. ''' + if skip_select_by: + return self exclusion_fields = (exclusion_fields or self.config.get('exclusion_fields', {})) exclusion_fields = {k: [v] if not isinstance(v, (list, dict)) else v diff --git a/flowsa/flowbyactivity.py b/flowsa/flowbyactivity.py index c1633cfde..4458cd2cd 100644 --- a/flowsa/flowbyactivity.py +++ b/flowsa/flowbyactivity.py @@ -678,7 +678,8 @@ def map_to_sectors( def prepare_fbs( self: 'FlowByActivity', external_config_path: str = None, - download_sources_ok: bool = True + download_sources_ok: bool = True, + skip_select_by: bool = False, ) -> 'FlowBySector': from flowsa.flowbysector import FlowBySector @@ -688,7 +689,9 @@ def prepare_fbs( return ( pd.concat([ fba.prepare_fbs( - external_config_path=external_config_path, download_sources_ok=download_sources_ok) + external_config_path=external_config_path, + download_sources_ok=download_sources_ok, + skip_select_by=True) for fba in ( self .select_by_fields() @@ -705,9 +708,10 @@ def prepare_fbs( return FlowBySector( self .function_socket('clean_fba_before_mapping') - .select_by_fields() + .select_by_fields(skip_select_by=skip_select_by) .function_socket('estimate_suppressed') - .select_by_fields(selection_fields=self.config.get( + .select_by_fields(skip_select_by=skip_select_by, + selection_fields=self.config.get( 'selection_fields_after_data_suppression_estimation', 'null')) .convert_units_and_flows() # and also map to flow lists .function_socket('clean_fba') From 9e89044125e6c7336115612e5ff37a29384105fb Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 3 Nov 2023 12:10:19 -0400 Subject: [PATCH 1112/1127] update CAP_HAP_m2 to align with m1 --- .../CAP_HAP_national_2017_m2.yaml | 80 ++++++++++++++++--- 1 file changed, 70 insertions(+), 10 deletions(-) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m2.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m2.yaml index 5d9c8a0d1..ef52823b6 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m2.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2017_m2.yaml @@ -1,21 +1,39 @@ # This method replicates m1 but incorporates more detailed secondary contexts # e.g. urban/rural and stack height for flows -industry_spec: - default: NAICS_6 + +!include:BEA_detail_target.yaml target_naics_year: 2012 geoscale: national _emission_year: &year 2017 +_attribution_sources: + BEA_Detail_Use_SUT: &bea + year: *year + geoscale: national + activity_to_sector_mapping: BEA_2017_Detail + exclusion_fields: + # Drop irrelevant final demand and total sectors + ActivityConsumedBy: ['F03000', 'F04000', 'F05000', 'F02E00', + 'F06E00', 'F07E00', 'F10E00', + 'T001', 'T004', 'T007'] + ActivityProducedBy: ['T007'] + attribution_method: proportional + attribution_source: + Employment_national_2017: + data_format: FBS + year: *year + sources_to_cache: EIA_MECS_Energy: - !include:CAP_HAP_common.yaml:sources_to_cache:EIA_MECS_Energy + !include:CAP_HAP_common.yaml:sources_to_cache:EIA_MECS_Energy_state year: 2018 attribution_source: - Employment_national_2018: - data_format: FBS + Employment_state_2018: + geoscale: national # Uses national at this stage prior to attributing to states year: 2018 + clean_source: Employment_state_2018 source_names: EPA_NEI_Nonpoint: @@ -24,33 +42,75 @@ source_names: year: *year activity_sets: !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets + + # Update some activities with correct BEA year + mobile_and_fuel_storage: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:mobile_and_fuel_storage + attribution_source: + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # Petroleum + + fertilizers: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:fertilizers + attribution_source: + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'325310': ''} # Fertilizers + + pesticides: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonpoint:activity_sets:pesticides + attribution_source: + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'325320': ''} # Pesticides + output_allocation: # Gross Output selection_fields: PrimaryActivity: !from_index:NEI_Nonpoint_asets.csv output_allocation attribution_method: proportional attribution_source: BEA_Detail_GrossOutput_IO: - year: 2017 + year: *year geoscale: national activity_to_sector_mapping: BEA_2012_Detail - selection_fields: - Class: Money - FlowName: Gross Output attribution_method: proportional attribution_source: Employment_national_2017: data_format: FBS - year: 2017 + year: *year EPA_NEI_Nonroad: !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad apply_urban_rural: True year: *year + activity_sets: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad:activity_sets + offroad_vehicles_equipment: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad:activity_sets:offroad_vehicles_equipment + attribution_source: + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # Petroleum EPA_NEI_Onroad: !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad apply_urban_rural: True year: *year + activity_sets: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad:activity_sets + onroad_vehicles_gas_stations: + !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Onroad:activity_sets:onroad_vehicles_gas_stations + attribution_source: + BEA_Detail_Use_SUT: + <<: *bea + selection_fields: + ActivityProducedBy: {'324110': ''} # Petroleum + stewiFBS: !include:CAP_HAP_common.yaml:source_names:stewiFBS From e5d5da4c154aea80f4d1a410a2380e48ac1816a8 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 3 Nov 2023 12:41:43 -0400 Subject: [PATCH 1113/1127] skip CAP_HAP_m2 in actions --- flowsa/methods/method_status.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flowsa/methods/method_status.yaml b/flowsa/methods/method_status.yaml index c0750c4d6..c57cd0a6e 100644 --- a/flowsa/methods/method_status.yaml +++ b/flowsa/methods/method_status.yaml @@ -87,4 +87,7 @@ EPA_NEI_Nonpoint: Status: Max retries exceeded with url - Certificate verify failed Type: SSLError - +# Flow By Sectors +CAP_HAP_national_m2: + Active: True + Status: During action causes memory error; too long From ea115eb5b422fafaf5cf107a02b99966ecb51432 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 3 Nov 2023 13:03:09 -0400 Subject: [PATCH 1114/1127] :checkmark: move test_FBS_methods to its own build and skip some duplicative methods --- .github/workflows/python-app.yml | 25 ++++++++++++++++++++++++ tests/test_FBS_methods.py | 33 ++++++++++++++++++++++++++++++++ tests/test_examples.py | 13 ------------- 3 files changed, 58 insertions(+), 13 deletions(-) create mode 100644 tests/test_FBS_methods.py diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 3e375069f..833f4502a 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -62,3 +62,28 @@ jobs: - name: Test with pytest run: | pytest --doctest-modules -m "not generate_fbs" + + FBS_method_testing: + runs-on: macos-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: "3.10" + + - name: Update pip & install testing pkgs + run: | + python -VV + python -m pip install --upgrade pip setuptools wheel + pip install pytest pytest-cov flake8 + + # install package & dependencies + - name: Install package and dependencies + run: | + pip install . + + - name: Test FBS config + run: | + python tests/test_FBS_methods.py diff --git a/tests/test_FBS_methods.py b/tests/test_FBS_methods.py new file mode 100644 index 000000000..d019b6346 --- /dev/null +++ b/tests/test_FBS_methods.py @@ -0,0 +1,33 @@ +""" +Test FBS method yaml during github action for succesful loading +""" +import pytest +from flowsa.common import check_method_status, load_yaml_dict, \ + seeAvailableFlowByModels + + +@pytest.mark.skip(reason="Perform targeted action for test_FBS_methods") +def test_FBS_methods(): + """Test succesful loading of FBS yaml files, skip files know to cause + errors""" + method_status = check_method_status() + for m in seeAvailableFlowByModels("FBS", print_method=False): + if method_status.get(m) is not None: + print(f"{m} skipped due to " + f"{method_status.get(m).get('Status', 'Unknown')}") + continue + elif any(s in m for s in ( + 'GHG_national_2013', + 'GHG_national_2014', + 'GHG_national_2015', + 'GHG_national_2018', + 'GHG_national_2019', + )): + # Skip select methods to expedite testing + continue + print(f"Testing method: {m}") + load_yaml_dict(m, flowbytype='FBS') + + +if __name__ == "__main__": + test_FBS_methods() diff --git a/tests/test_examples.py b/tests/test_examples.py index 2b3969010..a4887f9ef 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -33,16 +33,3 @@ def test_get_flows_by_sector(): # todo: reinstate after modifying bib function for recursive method # def test_write_bibliography(): # flowsa.writeFlowBySectorBibliography('Water_national_2015_m1') - - -def test_FBS_methods(): - """Test succesful loading of FBS yaml files, skip files know to cause - errors""" - method_status = check_method_status() - for m in seeAvailableFlowByModels("FBS", print_method=False): - print(f"Testing method: {m}") - if method_status.get(m) is not None: - print(f"{m} skipped due to " - f"{method_status.get(m).get('Status', 'Unknown')}") - continue - load_yaml_dict(m, flowbytype='FBS') From ac1b4c7f4943947893f6feaf8d3fe1afa7379069 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 3 Nov 2023 14:05:49 -0400 Subject: [PATCH 1115/1127] fix 2017_m2 method status; add additional methods w/ errors --- flowsa/methods/method_status.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/flowsa/methods/method_status.yaml b/flowsa/methods/method_status.yaml index c57cd0a6e..d89af79c3 100644 --- a/flowsa/methods/method_status.yaml +++ b/flowsa/methods/method_status.yaml @@ -88,6 +88,14 @@ EPA_NEI_Nonpoint: Type: SSLError # Flow By Sectors -CAP_HAP_national_m2: +CAP_HAP_national_2017_m2: Active: True Status: During action causes memory error; too long + +CAP_HAP_Nonroad_2014: + Active: True + Status: During action causes memory error; too long + +CAP_HAP_national_2014_m1: + Active: True + Status: Issue with CAP_HAP_Nonroad_2014 prevents method completion From 878dc9844e84473e76f2073e897932dcf9b4b092 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 9 Nov 2023 11:56:29 -0700 Subject: [PATCH 1116/1127] subset the bls_qcew activity set to only include naics codes - drop the non-naics bls publishes --- .../BLS_QCEW_asets.csv | 284 ------------------ .../write_FBS_activity_set_BLS_QCEW.py | 14 +- 2 files changed, 12 insertions(+), 286 deletions(-) diff --git a/flowsa/methods/flowbysectoractivitysets/BLS_QCEW_asets.csv b/flowsa/methods/flowbysectoractivitysets/BLS_QCEW_asets.csv index 061c8b201..3f16a8f3c 100644 --- a/flowsa/methods/flowbysectoractivitysets/BLS_QCEW_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/BLS_QCEW_asets.csv @@ -1,19 +1,4 @@ activity_set,name,note -qcew,10, -qcew,101, -qcew,1011, -qcew,1012, -qcew,1013, -qcew,102, -qcew,1021, -qcew,1022, -qcew,1023, -qcew,1024, -qcew,1025, -qcew,1026, -qcew,1027, -qcew,1028, -qcew,1029, qcew,11, qcew,111, qcew,1111, @@ -208,7 +193,6 @@ qcew,221115, qcew,221116, qcew,221117, qcew,221118, -qcew,221119, qcew,22112, qcew,221121, qcew,221122, @@ -255,66 +239,27 @@ qcew,237990, qcew,238, qcew,2381, qcew,23811, -qcew,238111, -qcew,238112, qcew,23812, -qcew,238121, -qcew,238122, qcew,23813, -qcew,238131, -qcew,238132, qcew,23814, -qcew,238141, -qcew,238142, qcew,23815, -qcew,238151, -qcew,238152, qcew,23816, -qcew,238161, -qcew,238162, qcew,23817, -qcew,238171, -qcew,238172, qcew,23819, -qcew,238191, -qcew,238192, qcew,2382, qcew,23821, -qcew,238211, -qcew,238212, qcew,23822, -qcew,238221, -qcew,238222, qcew,23829, -qcew,238291, -qcew,238292, qcew,2383, qcew,23831, -qcew,238311, -qcew,238312, qcew,23832, -qcew,238321, -qcew,238322, qcew,23833, -qcew,238331, -qcew,238332, qcew,23834, -qcew,238341, -qcew,238342, qcew,23835, -qcew,238351, -qcew,238352, qcew,23839, -qcew,238391, -qcew,238392, qcew,2389, qcew,23891, -qcew,238911, -qcew,238912, qcew,23899, -qcew,238991, -qcew,238992, -qcew,31-33, qcew,311, qcew,3111, qcew,31111, @@ -327,22 +272,14 @@ qcew,311212, qcew,311213, qcew,31122, qcew,311221, -qcew,311222, -qcew,311223, qcew,311224, qcew,311225, qcew,31123, qcew,311230, qcew,3113, qcew,31131, -qcew,311311, -qcew,311312, qcew,311313, qcew,311314, -qcew,31132, -qcew,311320, -qcew,31133, -qcew,311330, qcew,31134, qcew,311340, qcew,31135, @@ -373,8 +310,6 @@ qcew,311615, qcew,3117, qcew,31171, qcew,311710, -qcew,311711, -qcew,311712, qcew,3118, qcew,31181, qcew,311811, @@ -382,8 +317,6 @@ qcew,311812, qcew,311813, qcew,31182, qcew,311821, -qcew,311822, -qcew,311823, qcew,311824, qcew,31183, qcew,311830, @@ -414,38 +347,24 @@ qcew,312130, qcew,31214, qcew,312140, qcew,3122, -qcew,31221, -qcew,312210, -qcew,31222, -qcew,312221, -qcew,312229, qcew,31223, qcew,312230, qcew,313, qcew,3131, qcew,31311, qcew,313110, -qcew,313111, -qcew,313112, -qcew,313113, qcew,3132, qcew,31321, qcew,313210, qcew,31322, qcew,313220, -qcew,313221, -qcew,313222, qcew,31323, qcew,313230, qcew,31324, qcew,313240, -qcew,313241, -qcew,313249, qcew,3133, qcew,31331, qcew,313310, -qcew,313311, -qcew,313312, qcew,31332, qcew,313320, qcew,314, @@ -454,62 +373,30 @@ qcew,31411, qcew,314110, qcew,31412, qcew,314120, -qcew,314121, -qcew,314129, qcew,3149, qcew,31491, qcew,314910, -qcew,314911, -qcew,314912, qcew,31499, -qcew,314991, -qcew,314992, qcew,314994, qcew,314999, qcew,315, qcew,3151, qcew,31511, qcew,315110, -qcew,315111, -qcew,315119, qcew,31519, qcew,315190, -qcew,315191, -qcew,315192, qcew,3152, qcew,31521, qcew,315210, -qcew,315211, -qcew,315212, qcew,31522, qcew,315220, -qcew,315221, -qcew,315222, -qcew,315223, -qcew,315224, -qcew,315225, -qcew,315228, -qcew,31523, -qcew,315231, -qcew,315232, -qcew,315233, -qcew,315234, -qcew,315239, qcew,31524, qcew,315240, qcew,31528, qcew,315280, -qcew,31529, -qcew,315291, -qcew,315292, -qcew,315299, qcew,3159, qcew,31599, qcew,315990, -qcew,315991, -qcew,315992, -qcew,315993, -qcew,315999, qcew,316, qcew,3161, qcew,31611, @@ -517,18 +404,10 @@ qcew,316110, qcew,3162, qcew,31621, qcew,316210, -qcew,316211, -qcew,316212, -qcew,316213, -qcew,316214, -qcew,316219, qcew,3169, qcew,31699, -qcew,316991, qcew,316992, -qcew,316993, qcew,316998, -qcew,316999, qcew,321, qcew,3211, qcew,32111, @@ -565,43 +444,22 @@ qcew,3222, qcew,32221, qcew,322211, qcew,322212, -qcew,322213, -qcew,322214, -qcew,322215, qcew,322219, qcew,32222, qcew,322220, -qcew,322221, -qcew,322222, -qcew,322223, -qcew,322224, -qcew,322225, -qcew,322226, qcew,32223, qcew,322230, -qcew,322231, -qcew,322232, -qcew,322233, qcew,32229, qcew,322291, qcew,322299, qcew,323, qcew,3231, qcew,32311, -qcew,323110, qcew,323111, -qcew,323112, qcew,323113, -qcew,323114, -qcew,323115, -qcew,323116, qcew,323117, -qcew,323118, -qcew,323119, qcew,32312, qcew,323120, -qcew,323121, -qcew,323122, qcew,324, qcew,3241, qcew,32411, @@ -620,16 +478,9 @@ qcew,32512, qcew,325120, qcew,32513, qcew,325130, -qcew,325131, -qcew,325132, qcew,32518, qcew,325180, -qcew,325181, -qcew,325182, -qcew,325188, qcew,32519, -qcew,325191, -qcew,325192, qcew,325193, qcew,325194, qcew,325199, @@ -639,8 +490,6 @@ qcew,325211, qcew,325212, qcew,32522, qcew,325220, -qcew,325221, -qcew,325222, qcew,3253, qcew,32531, qcew,325311, @@ -694,7 +543,6 @@ qcew,32616, qcew,326160, qcew,32619, qcew,326191, -qcew,326192, qcew,326199, qcew,3262, qcew,32621, @@ -709,16 +557,8 @@ qcew,327, qcew,3271, qcew,32711, qcew,327110, -qcew,327111, -qcew,327112, -qcew,327113, qcew,32712, qcew,327120, -qcew,327121, -qcew,327122, -qcew,327123, -qcew,327124, -qcew,327125, qcew,3272, qcew,32721, qcew,327211, @@ -752,8 +592,6 @@ qcew,331, qcew,3311, qcew,33111, qcew,331110, -qcew,331111, -qcew,331112, qcew,3312, qcew,33121, qcew,331210, @@ -762,24 +600,15 @@ qcew,331221, qcew,331222, qcew,3313, qcew,33131, -qcew,331311, -qcew,331312, qcew,331313, qcew,331314, qcew,331315, -qcew,331316, qcew,331318, -qcew,331319, qcew,3314, qcew,33141, qcew,331410, -qcew,331411, -qcew,331419, qcew,33142, qcew,331420, -qcew,331421, -qcew,331422, -qcew,331423, qcew,33149, qcew,331491, qcew,331492, @@ -789,12 +618,8 @@ qcew,331511, qcew,331512, qcew,331513, qcew,33152, -qcew,331521, -qcew,331522, qcew,331523, qcew,331524, -qcew,331525, -qcew,331528, qcew,331529, qcew,332, qcew,3321, @@ -802,16 +627,10 @@ qcew,33211, qcew,332111, qcew,332112, qcew,332114, -qcew,332115, -qcew,332116, qcew,332117, qcew,332119, qcew,3322, qcew,33221, -qcew,332211, -qcew,332212, -qcew,332213, -qcew,332214, qcew,332215, qcew,332216, qcew,3323, @@ -836,8 +655,6 @@ qcew,33251, qcew,332510, qcew,3326, qcew,33261, -qcew,332611, -qcew,332612, qcew,332613, qcew,332618, qcew,3327, @@ -862,10 +679,7 @@ qcew,332991, qcew,332992, qcew,332993, qcew,332994, -qcew,332995, qcew,332996, -qcew,332997, -qcew,332998, qcew,332999, qcew,333, qcew,3331, @@ -878,50 +692,28 @@ qcew,33313, qcew,333131, qcew,333132, qcew,3332, -qcew,33321, -qcew,333210, -qcew,33322, -qcew,333220, qcew,33324, qcew,333241, qcew,333242, qcew,333243, qcew,333244, qcew,333249, -qcew,33329, -qcew,333291, -qcew,333292, -qcew,333293, -qcew,333294, -qcew,333295, -qcew,333298, qcew,3333, qcew,33331, -qcew,333311, -qcew,333312, -qcew,333313, qcew,333314, -qcew,333315, qcew,333316, qcew,333318, -qcew,333319, qcew,3334, qcew,33341, -qcew,333411, -qcew,333412, qcew,333413, qcew,333414, qcew,333415, qcew,3335, qcew,33351, qcew,333511, -qcew,333512, -qcew,333513, qcew,333514, qcew,333515, -qcew,333516, qcew,333517, -qcew,333518, qcew,333519, qcew,3336, qcew,33361, @@ -954,9 +746,7 @@ qcew,3341, qcew,33411, qcew,334111, qcew,334112, -qcew,334113, qcew,334118, -qcew,334119, qcew,3342, qcew,33421, qcew,334210, @@ -969,11 +759,8 @@ qcew,33431, qcew,334310, qcew,3344, qcew,33441, -qcew,334411, qcew,334412, qcew,334413, -qcew,334414, -qcew,334415, qcew,334416, qcew,334417, qcew,334418, @@ -988,12 +775,9 @@ qcew,334514, qcew,334515, qcew,334516, qcew,334517, -qcew,334518, qcew,334519, qcew,3346, qcew,33461, -qcew,334611, -qcew,334612, qcew,334613, qcew,334614, qcew,335, @@ -1007,8 +791,6 @@ qcew,335129, qcew,3352, qcew,33521, qcew,335210, -qcew,335211, -qcew,335212, qcew,33522, qcew,335220, qcew,335221, @@ -1050,12 +832,8 @@ qcew,336214, qcew,3363, qcew,33631, qcew,336310, -qcew,336311, -qcew,336312, qcew,33632, qcew,336320, -qcew,336321, -qcew,336322, qcew,33633, qcew,336330, qcew,33634, @@ -1068,8 +846,6 @@ qcew,33637, qcew,336370, qcew,33639, qcew,336390, -qcew,336391, -qcew,336399, qcew,3364, qcew,33641, qcew,336411, @@ -1100,7 +876,6 @@ qcew,337122, qcew,337124, qcew,337125, qcew,337127, -qcew,337129, qcew,3372, qcew,33721, qcew,337211, @@ -1115,7 +890,6 @@ qcew,337920, qcew,339, qcew,3391, qcew,33911, -qcew,339111, qcew,339112, qcew,339113, qcew,339114, @@ -1124,22 +898,12 @@ qcew,339116, qcew,3399, qcew,33991, qcew,339910, -qcew,339911, -qcew,339912, -qcew,339913, -qcew,339914, qcew,33992, qcew,339920, qcew,33993, qcew,339930, -qcew,339931, -qcew,339932, qcew,33994, qcew,339940, -qcew,339941, -qcew,339942, -qcew,339943, -qcew,339944, qcew,33995, qcew,339950, qcew,33999, @@ -1314,7 +1078,6 @@ qcew,42511, qcew,425110, qcew,42512, qcew,425120, -qcew,44-45, qcew,441, qcew,4411, qcew,44111, @@ -1325,10 +1088,8 @@ qcew,4412, qcew,44121, qcew,441210, qcew,44122, -qcew,441221, qcew,441222, qcew,441228, -qcew,441229, qcew,4413, qcew,44131, qcew,441310, @@ -1346,13 +1107,6 @@ qcew,442291, qcew,442299, qcew,443, qcew,4431, -qcew,44311, -qcew,443111, -qcew,443112, -qcew,44312, -qcew,443120, -qcew,44313, -qcew,443130, qcew,44314, qcew,443141, qcew,443142, @@ -1444,8 +1198,6 @@ qcew,4512, qcew,45121, qcew,451211, qcew,451212, -qcew,45122, -qcew,451220, qcew,452, qcew,4521, qcew,45211, @@ -1498,12 +1250,8 @@ qcew,454210, qcew,4543, qcew,45431, qcew,454310, -qcew,454311, -qcew,454312, -qcew,454319, qcew,45439, qcew,454390, -qcew,48-49, qcew,481, qcew,4811, qcew,48111, @@ -1695,10 +1443,6 @@ qcew,515120, qcew,5152, qcew,51521, qcew,515210, -qcew,516, -qcew,5161, -qcew,51611, -qcew,516110, qcew,517, qcew,5171, qcew,51711, @@ -1706,29 +1450,18 @@ qcew,517110, qcew,5172, qcew,51721, qcew,517210, -qcew,517211, -qcew,517212, qcew,5173, qcew,51731, -qcew,517310, qcew,517311, qcew,517312, qcew,5174, qcew,51741, qcew,517410, -qcew,5175, -qcew,51751, -qcew,517510, qcew,5179, qcew,51791, -qcew,517910, qcew,517911, qcew,517919, qcew,518, -qcew,5181, -qcew,51811, -qcew,518111, -qcew,518112, qcew,5182, qcew,51821, qcew,518210, @@ -1829,8 +1562,6 @@ qcew,52591, qcew,525910, qcew,52592, qcew,525920, -qcew,52593, -qcew,525930, qcew,52599, qcew,525990, qcew,53, @@ -1953,7 +1684,6 @@ qcew,54169, qcew,541690, qcew,5417, qcew,54171, -qcew,541710, qcew,541711, qcew,541712, qcew,541713, @@ -2007,7 +1737,6 @@ qcew,56121, qcew,561210, qcew,5613, qcew,56131, -qcew,561310, qcew,561311, qcew,561312, qcew,56132, @@ -2294,14 +2023,6 @@ qcew,7213, qcew,72131, qcew,721310, qcew,722, -qcew,7221, -qcew,72211, -qcew,722110, -qcew,7222, -qcew,72221, -qcew,722211, -qcew,722212, -qcew,722213, qcew,7223, qcew,72231, qcew,722310, @@ -2491,8 +2212,3 @@ qcew,92811, qcew,928110, qcew,92812, qcew,928120, -qcew,99, -qcew,999, -qcew,9999, -qcew,99999, -qcew,999999, diff --git a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLS_QCEW.py b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLS_QCEW.py index 689bd7839..3a0becf08 100644 --- a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLS_QCEW.py +++ b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLS_QCEW.py @@ -7,8 +7,8 @@ """ import pandas as pd -import flowsa import flowsa.flowbyactivity +from flowsa.common import load_sector_length_cw_melt from flowsa.settings import flowbysectoractivitysetspath datasource = 'BLS_QCEW' @@ -35,5 +35,15 @@ # drop duplicates and save df df3 = df2.drop_duplicates() df3 = df3.sort_values(['activity_set', 'name']).reset_index(drop=True) - df3.to_csv(f"{flowbysectoractivitysetspath}/{datasource}_asets.csv", + + # subset the bls qcew data to only include true NAICS + naics_list = pd.DataFrame() + for y in ['2012', '2017']: + cw = load_sector_length_cw_melt(year=y) + naics_list = pd.concat([naics_list, cw], ignore_index=True) + naics_list = naics_list['Sector'].drop_duplicates().values.tolist() + + df4 = df3[df3['name'].isin(naics_list)] + + df4.to_csv(f"{flowbysectoractivitysetspath}/{datasource}_asets.csv", index=False) From 95f7321394e8bfe8276b6cbb0ea81d5acfdb0736 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 9 Nov 2023 11:59:10 -0700 Subject: [PATCH 1117/1127] modify estimate_suppressed_sectors_equal_attribution() so rows of data aren't dropped when merged --- flowsa/flowbyclean.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index abe8b3c4a..9d63c16f2 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -230,11 +230,7 @@ def estimate_suppressed_sectors_equal_attribution( .drop_duplicates() # duplicates if multiple generations of 1:1 ) - fba3 = (fba - .merge(fba2, indicator=True, how='outer') - .query('_merge!="both"') - .drop('_merge', axis=1) - ) + fba3 = fba.merge(fba2, how='outer') fba3 = (fba3 .assign(Unattributed=fba3.FlowAmount.copy(), From 33438d53e107bafe91852739b87da33dfe7df4b9 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 9 Nov 2023 13:02:19 -0700 Subject: [PATCH 1118/1127] Revert "subset the bls_qcew activity set to only include naics codes - drop the non-naics bls publishes" This reverts commit 878dc9844e84473e76f2073e897932dcf9b4b092. --- .../BLS_QCEW_asets.csv | 284 ++++++++++++++++++ .../write_FBS_activity_set_BLS_QCEW.py | 14 +- 2 files changed, 286 insertions(+), 12 deletions(-) diff --git a/flowsa/methods/flowbysectoractivitysets/BLS_QCEW_asets.csv b/flowsa/methods/flowbysectoractivitysets/BLS_QCEW_asets.csv index 3f16a8f3c..061c8b201 100644 --- a/flowsa/methods/flowbysectoractivitysets/BLS_QCEW_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/BLS_QCEW_asets.csv @@ -1,4 +1,19 @@ activity_set,name,note +qcew,10, +qcew,101, +qcew,1011, +qcew,1012, +qcew,1013, +qcew,102, +qcew,1021, +qcew,1022, +qcew,1023, +qcew,1024, +qcew,1025, +qcew,1026, +qcew,1027, +qcew,1028, +qcew,1029, qcew,11, qcew,111, qcew,1111, @@ -193,6 +208,7 @@ qcew,221115, qcew,221116, qcew,221117, qcew,221118, +qcew,221119, qcew,22112, qcew,221121, qcew,221122, @@ -239,27 +255,66 @@ qcew,237990, qcew,238, qcew,2381, qcew,23811, +qcew,238111, +qcew,238112, qcew,23812, +qcew,238121, +qcew,238122, qcew,23813, +qcew,238131, +qcew,238132, qcew,23814, +qcew,238141, +qcew,238142, qcew,23815, +qcew,238151, +qcew,238152, qcew,23816, +qcew,238161, +qcew,238162, qcew,23817, +qcew,238171, +qcew,238172, qcew,23819, +qcew,238191, +qcew,238192, qcew,2382, qcew,23821, +qcew,238211, +qcew,238212, qcew,23822, +qcew,238221, +qcew,238222, qcew,23829, +qcew,238291, +qcew,238292, qcew,2383, qcew,23831, +qcew,238311, +qcew,238312, qcew,23832, +qcew,238321, +qcew,238322, qcew,23833, +qcew,238331, +qcew,238332, qcew,23834, +qcew,238341, +qcew,238342, qcew,23835, +qcew,238351, +qcew,238352, qcew,23839, +qcew,238391, +qcew,238392, qcew,2389, qcew,23891, +qcew,238911, +qcew,238912, qcew,23899, +qcew,238991, +qcew,238992, +qcew,31-33, qcew,311, qcew,3111, qcew,31111, @@ -272,14 +327,22 @@ qcew,311212, qcew,311213, qcew,31122, qcew,311221, +qcew,311222, +qcew,311223, qcew,311224, qcew,311225, qcew,31123, qcew,311230, qcew,3113, qcew,31131, +qcew,311311, +qcew,311312, qcew,311313, qcew,311314, +qcew,31132, +qcew,311320, +qcew,31133, +qcew,311330, qcew,31134, qcew,311340, qcew,31135, @@ -310,6 +373,8 @@ qcew,311615, qcew,3117, qcew,31171, qcew,311710, +qcew,311711, +qcew,311712, qcew,3118, qcew,31181, qcew,311811, @@ -317,6 +382,8 @@ qcew,311812, qcew,311813, qcew,31182, qcew,311821, +qcew,311822, +qcew,311823, qcew,311824, qcew,31183, qcew,311830, @@ -347,24 +414,38 @@ qcew,312130, qcew,31214, qcew,312140, qcew,3122, +qcew,31221, +qcew,312210, +qcew,31222, +qcew,312221, +qcew,312229, qcew,31223, qcew,312230, qcew,313, qcew,3131, qcew,31311, qcew,313110, +qcew,313111, +qcew,313112, +qcew,313113, qcew,3132, qcew,31321, qcew,313210, qcew,31322, qcew,313220, +qcew,313221, +qcew,313222, qcew,31323, qcew,313230, qcew,31324, qcew,313240, +qcew,313241, +qcew,313249, qcew,3133, qcew,31331, qcew,313310, +qcew,313311, +qcew,313312, qcew,31332, qcew,313320, qcew,314, @@ -373,30 +454,62 @@ qcew,31411, qcew,314110, qcew,31412, qcew,314120, +qcew,314121, +qcew,314129, qcew,3149, qcew,31491, qcew,314910, +qcew,314911, +qcew,314912, qcew,31499, +qcew,314991, +qcew,314992, qcew,314994, qcew,314999, qcew,315, qcew,3151, qcew,31511, qcew,315110, +qcew,315111, +qcew,315119, qcew,31519, qcew,315190, +qcew,315191, +qcew,315192, qcew,3152, qcew,31521, qcew,315210, +qcew,315211, +qcew,315212, qcew,31522, qcew,315220, +qcew,315221, +qcew,315222, +qcew,315223, +qcew,315224, +qcew,315225, +qcew,315228, +qcew,31523, +qcew,315231, +qcew,315232, +qcew,315233, +qcew,315234, +qcew,315239, qcew,31524, qcew,315240, qcew,31528, qcew,315280, +qcew,31529, +qcew,315291, +qcew,315292, +qcew,315299, qcew,3159, qcew,31599, qcew,315990, +qcew,315991, +qcew,315992, +qcew,315993, +qcew,315999, qcew,316, qcew,3161, qcew,31611, @@ -404,10 +517,18 @@ qcew,316110, qcew,3162, qcew,31621, qcew,316210, +qcew,316211, +qcew,316212, +qcew,316213, +qcew,316214, +qcew,316219, qcew,3169, qcew,31699, +qcew,316991, qcew,316992, +qcew,316993, qcew,316998, +qcew,316999, qcew,321, qcew,3211, qcew,32111, @@ -444,22 +565,43 @@ qcew,3222, qcew,32221, qcew,322211, qcew,322212, +qcew,322213, +qcew,322214, +qcew,322215, qcew,322219, qcew,32222, qcew,322220, +qcew,322221, +qcew,322222, +qcew,322223, +qcew,322224, +qcew,322225, +qcew,322226, qcew,32223, qcew,322230, +qcew,322231, +qcew,322232, +qcew,322233, qcew,32229, qcew,322291, qcew,322299, qcew,323, qcew,3231, qcew,32311, +qcew,323110, qcew,323111, +qcew,323112, qcew,323113, +qcew,323114, +qcew,323115, +qcew,323116, qcew,323117, +qcew,323118, +qcew,323119, qcew,32312, qcew,323120, +qcew,323121, +qcew,323122, qcew,324, qcew,3241, qcew,32411, @@ -478,9 +620,16 @@ qcew,32512, qcew,325120, qcew,32513, qcew,325130, +qcew,325131, +qcew,325132, qcew,32518, qcew,325180, +qcew,325181, +qcew,325182, +qcew,325188, qcew,32519, +qcew,325191, +qcew,325192, qcew,325193, qcew,325194, qcew,325199, @@ -490,6 +639,8 @@ qcew,325211, qcew,325212, qcew,32522, qcew,325220, +qcew,325221, +qcew,325222, qcew,3253, qcew,32531, qcew,325311, @@ -543,6 +694,7 @@ qcew,32616, qcew,326160, qcew,32619, qcew,326191, +qcew,326192, qcew,326199, qcew,3262, qcew,32621, @@ -557,8 +709,16 @@ qcew,327, qcew,3271, qcew,32711, qcew,327110, +qcew,327111, +qcew,327112, +qcew,327113, qcew,32712, qcew,327120, +qcew,327121, +qcew,327122, +qcew,327123, +qcew,327124, +qcew,327125, qcew,3272, qcew,32721, qcew,327211, @@ -592,6 +752,8 @@ qcew,331, qcew,3311, qcew,33111, qcew,331110, +qcew,331111, +qcew,331112, qcew,3312, qcew,33121, qcew,331210, @@ -600,15 +762,24 @@ qcew,331221, qcew,331222, qcew,3313, qcew,33131, +qcew,331311, +qcew,331312, qcew,331313, qcew,331314, qcew,331315, +qcew,331316, qcew,331318, +qcew,331319, qcew,3314, qcew,33141, qcew,331410, +qcew,331411, +qcew,331419, qcew,33142, qcew,331420, +qcew,331421, +qcew,331422, +qcew,331423, qcew,33149, qcew,331491, qcew,331492, @@ -618,8 +789,12 @@ qcew,331511, qcew,331512, qcew,331513, qcew,33152, +qcew,331521, +qcew,331522, qcew,331523, qcew,331524, +qcew,331525, +qcew,331528, qcew,331529, qcew,332, qcew,3321, @@ -627,10 +802,16 @@ qcew,33211, qcew,332111, qcew,332112, qcew,332114, +qcew,332115, +qcew,332116, qcew,332117, qcew,332119, qcew,3322, qcew,33221, +qcew,332211, +qcew,332212, +qcew,332213, +qcew,332214, qcew,332215, qcew,332216, qcew,3323, @@ -655,6 +836,8 @@ qcew,33251, qcew,332510, qcew,3326, qcew,33261, +qcew,332611, +qcew,332612, qcew,332613, qcew,332618, qcew,3327, @@ -679,7 +862,10 @@ qcew,332991, qcew,332992, qcew,332993, qcew,332994, +qcew,332995, qcew,332996, +qcew,332997, +qcew,332998, qcew,332999, qcew,333, qcew,3331, @@ -692,28 +878,50 @@ qcew,33313, qcew,333131, qcew,333132, qcew,3332, +qcew,33321, +qcew,333210, +qcew,33322, +qcew,333220, qcew,33324, qcew,333241, qcew,333242, qcew,333243, qcew,333244, qcew,333249, +qcew,33329, +qcew,333291, +qcew,333292, +qcew,333293, +qcew,333294, +qcew,333295, +qcew,333298, qcew,3333, qcew,33331, +qcew,333311, +qcew,333312, +qcew,333313, qcew,333314, +qcew,333315, qcew,333316, qcew,333318, +qcew,333319, qcew,3334, qcew,33341, +qcew,333411, +qcew,333412, qcew,333413, qcew,333414, qcew,333415, qcew,3335, qcew,33351, qcew,333511, +qcew,333512, +qcew,333513, qcew,333514, qcew,333515, +qcew,333516, qcew,333517, +qcew,333518, qcew,333519, qcew,3336, qcew,33361, @@ -746,7 +954,9 @@ qcew,3341, qcew,33411, qcew,334111, qcew,334112, +qcew,334113, qcew,334118, +qcew,334119, qcew,3342, qcew,33421, qcew,334210, @@ -759,8 +969,11 @@ qcew,33431, qcew,334310, qcew,3344, qcew,33441, +qcew,334411, qcew,334412, qcew,334413, +qcew,334414, +qcew,334415, qcew,334416, qcew,334417, qcew,334418, @@ -775,9 +988,12 @@ qcew,334514, qcew,334515, qcew,334516, qcew,334517, +qcew,334518, qcew,334519, qcew,3346, qcew,33461, +qcew,334611, +qcew,334612, qcew,334613, qcew,334614, qcew,335, @@ -791,6 +1007,8 @@ qcew,335129, qcew,3352, qcew,33521, qcew,335210, +qcew,335211, +qcew,335212, qcew,33522, qcew,335220, qcew,335221, @@ -832,8 +1050,12 @@ qcew,336214, qcew,3363, qcew,33631, qcew,336310, +qcew,336311, +qcew,336312, qcew,33632, qcew,336320, +qcew,336321, +qcew,336322, qcew,33633, qcew,336330, qcew,33634, @@ -846,6 +1068,8 @@ qcew,33637, qcew,336370, qcew,33639, qcew,336390, +qcew,336391, +qcew,336399, qcew,3364, qcew,33641, qcew,336411, @@ -876,6 +1100,7 @@ qcew,337122, qcew,337124, qcew,337125, qcew,337127, +qcew,337129, qcew,3372, qcew,33721, qcew,337211, @@ -890,6 +1115,7 @@ qcew,337920, qcew,339, qcew,3391, qcew,33911, +qcew,339111, qcew,339112, qcew,339113, qcew,339114, @@ -898,12 +1124,22 @@ qcew,339116, qcew,3399, qcew,33991, qcew,339910, +qcew,339911, +qcew,339912, +qcew,339913, +qcew,339914, qcew,33992, qcew,339920, qcew,33993, qcew,339930, +qcew,339931, +qcew,339932, qcew,33994, qcew,339940, +qcew,339941, +qcew,339942, +qcew,339943, +qcew,339944, qcew,33995, qcew,339950, qcew,33999, @@ -1078,6 +1314,7 @@ qcew,42511, qcew,425110, qcew,42512, qcew,425120, +qcew,44-45, qcew,441, qcew,4411, qcew,44111, @@ -1088,8 +1325,10 @@ qcew,4412, qcew,44121, qcew,441210, qcew,44122, +qcew,441221, qcew,441222, qcew,441228, +qcew,441229, qcew,4413, qcew,44131, qcew,441310, @@ -1107,6 +1346,13 @@ qcew,442291, qcew,442299, qcew,443, qcew,4431, +qcew,44311, +qcew,443111, +qcew,443112, +qcew,44312, +qcew,443120, +qcew,44313, +qcew,443130, qcew,44314, qcew,443141, qcew,443142, @@ -1198,6 +1444,8 @@ qcew,4512, qcew,45121, qcew,451211, qcew,451212, +qcew,45122, +qcew,451220, qcew,452, qcew,4521, qcew,45211, @@ -1250,8 +1498,12 @@ qcew,454210, qcew,4543, qcew,45431, qcew,454310, +qcew,454311, +qcew,454312, +qcew,454319, qcew,45439, qcew,454390, +qcew,48-49, qcew,481, qcew,4811, qcew,48111, @@ -1443,6 +1695,10 @@ qcew,515120, qcew,5152, qcew,51521, qcew,515210, +qcew,516, +qcew,5161, +qcew,51611, +qcew,516110, qcew,517, qcew,5171, qcew,51711, @@ -1450,18 +1706,29 @@ qcew,517110, qcew,5172, qcew,51721, qcew,517210, +qcew,517211, +qcew,517212, qcew,5173, qcew,51731, +qcew,517310, qcew,517311, qcew,517312, qcew,5174, qcew,51741, qcew,517410, +qcew,5175, +qcew,51751, +qcew,517510, qcew,5179, qcew,51791, +qcew,517910, qcew,517911, qcew,517919, qcew,518, +qcew,5181, +qcew,51811, +qcew,518111, +qcew,518112, qcew,5182, qcew,51821, qcew,518210, @@ -1562,6 +1829,8 @@ qcew,52591, qcew,525910, qcew,52592, qcew,525920, +qcew,52593, +qcew,525930, qcew,52599, qcew,525990, qcew,53, @@ -1684,6 +1953,7 @@ qcew,54169, qcew,541690, qcew,5417, qcew,54171, +qcew,541710, qcew,541711, qcew,541712, qcew,541713, @@ -1737,6 +2007,7 @@ qcew,56121, qcew,561210, qcew,5613, qcew,56131, +qcew,561310, qcew,561311, qcew,561312, qcew,56132, @@ -2023,6 +2294,14 @@ qcew,7213, qcew,72131, qcew,721310, qcew,722, +qcew,7221, +qcew,72211, +qcew,722110, +qcew,7222, +qcew,72221, +qcew,722211, +qcew,722212, +qcew,722213, qcew,7223, qcew,72231, qcew,722310, @@ -2212,3 +2491,8 @@ qcew,92811, qcew,928110, qcew,92812, qcew,928120, +qcew,99, +qcew,999, +qcew,9999, +qcew,99999, +qcew,999999, diff --git a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLS_QCEW.py b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLS_QCEW.py index 3a0becf08..689bd7839 100644 --- a/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLS_QCEW.py +++ b/scripts/FlowBySector_Activity_Sets/write_FBS_activity_set_BLS_QCEW.py @@ -7,8 +7,8 @@ """ import pandas as pd +import flowsa import flowsa.flowbyactivity -from flowsa.common import load_sector_length_cw_melt from flowsa.settings import flowbysectoractivitysetspath datasource = 'BLS_QCEW' @@ -35,15 +35,5 @@ # drop duplicates and save df df3 = df2.drop_duplicates() df3 = df3.sort_values(['activity_set', 'name']).reset_index(drop=True) - - # subset the bls qcew data to only include true NAICS - naics_list = pd.DataFrame() - for y in ['2012', '2017']: - cw = load_sector_length_cw_melt(year=y) - naics_list = pd.concat([naics_list, cw], ignore_index=True) - naics_list = naics_list['Sector'].drop_duplicates().values.tolist() - - df4 = df3[df3['name'].isin(naics_list)] - - df4.to_csv(f"{flowbysectoractivitysetspath}/{datasource}_asets.csv", + df3.to_csv(f"{flowbysectoractivitysetspath}/{datasource}_asets.csv", index=False) From b268823542265c4b31f4dbd230a52913e2821699 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 9 Nov 2023 13:03:25 -0700 Subject: [PATCH 1119/1127] modify load_sector_length_cw_melt() to depend on NAICS year --- flowsa/common.py | 4 ++-- flowsa/validation.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/flowsa/common.py b/flowsa/common.py index b77d09e3f..c527fa2ee 100644 --- a/flowsa/common.py +++ b/flowsa/common.py @@ -86,8 +86,8 @@ def load_crosswalk(crosswalk_name): return cw -def load_sector_length_cw_melt(): - cw_load = load_crosswalk('NAICS_2012_Crosswalk') +def load_sector_length_cw_melt(year='2012'): + cw_load = load_crosswalk(f'NAICS_{year}_Crosswalk') cw_melt = cw_load.melt(var_name="SectorLength", value_name='Sector' ).drop_duplicates().reset_index(drop=True) cw_melt = cw_melt.dropna().reset_index(drop=True) diff --git a/flowsa/validation.py b/flowsa/validation.py index b174c1779..956562677 100644 --- a/flowsa/validation.py +++ b/flowsa/validation.py @@ -127,7 +127,7 @@ def compare_summation_at_sector_lengths_between_two_dfs(df1, df2): if 'ActivityProducedBy' in df1.columns: col = 'Activity' - cw = load_sector_length_cw_melt() + cw = load_sector_length_cw_melt(year=df1.config['target_naics_year']) agg_cols = list(df2.select_dtypes(include=['object', 'int']).columns) + \ ['SectorProducedByLength', 'SectorConsumedByLength'] From 6e96a289268cb35a0d5d29537f6db4c8a7d21fa7 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Thu, 9 Nov 2023 13:03:44 -0700 Subject: [PATCH 1120/1127] add comment --- flowsa/flowbyclean.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flowsa/flowbyclean.py b/flowsa/flowbyclean.py index 9d63c16f2..f13d936a0 100644 --- a/flowsa/flowbyclean.py +++ b/flowsa/flowbyclean.py @@ -229,7 +229,8 @@ def estimate_suppressed_sectors_equal_attribution( .query(f"~{col}.isna()") .drop_duplicates() # duplicates if multiple generations of 1:1 ) - + # merge the two dfs - add the child sectors to original df when there is + # only single parent:child fba3 = fba.merge(fba2, how='outer') fba3 = (fba3 From f61320defaa64cfa7417035383e8c3b0740a6362 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Mon, 13 Nov 2023 21:49:59 -0500 Subject: [PATCH 1121/1127] convert to geoscale early for NEI --- flowsa/data_source_scripts/EPA_NEI.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/flowsa/data_source_scripts/EPA_NEI.py b/flowsa/data_source_scripts/EPA_NEI.py index fb955ddca..f4d3c8a03 100644 --- a/flowsa/data_source_scripts/EPA_NEI.py +++ b/flowsa/data_source_scripts/EPA_NEI.py @@ -201,6 +201,11 @@ def clean_NEI_fba(fba: FlowByActivity, **_) -> FlowByActivity: new_fba = FlowByActivity(fba) for attr in attributes_to_save: setattr(new_fba, attr, attributes_to_save[attr]) + # to reduce the file size of the FBA and avoid memory errors, consolidate + # to geoscale (i.e., state) early on + print(f'length: {len(new_fba)}') + new_fba = new_fba.convert_to_geoscale() + print(f'new length: {len(new_fba)}') return new_fba From 200c4fe0a69dd5d0a40788a98152e20dfc3cf99e Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 14 Nov 2023 10:28:16 -0500 Subject: [PATCH 1122/1127] split activity sets into multiples --- flowsa/data_source_scripts/EPA_NEI.py | 5 - .../NEI_Nonroad_asets.csv | 362 +++++++++--------- .../CAP_HAP_Nonroad_2014.yaml | 48 ++- 3 files changed, 225 insertions(+), 190 deletions(-) diff --git a/flowsa/data_source_scripts/EPA_NEI.py b/flowsa/data_source_scripts/EPA_NEI.py index f4d3c8a03..fb955ddca 100644 --- a/flowsa/data_source_scripts/EPA_NEI.py +++ b/flowsa/data_source_scripts/EPA_NEI.py @@ -201,11 +201,6 @@ def clean_NEI_fba(fba: FlowByActivity, **_) -> FlowByActivity: new_fba = FlowByActivity(fba) for attr in attributes_to_save: setattr(new_fba, attr, attributes_to_save[attr]) - # to reduce the file size of the FBA and avoid memory errors, consolidate - # to geoscale (i.e., state) early on - print(f'length: {len(new_fba)}') - new_fba = new_fba.convert_to_geoscale() - print(f'new length: {len(new_fba)}') return new_fba diff --git a/flowsa/methods/flowbysectoractivitysets/NEI_Nonroad_asets.csv b/flowsa/methods/flowbysectoractivitysets/NEI_Nonroad_asets.csv index 1dc90ad9c..83811e56b 100644 --- a/flowsa/methods/flowbysectoractivitysets/NEI_Nonroad_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/NEI_Nonroad_asets.csv @@ -74,184 +74,184 @@ direct_allocation,2282020005,"Recreational equipment, lawn and garden" direct_allocation,2282020010,"Recreational equipment, lawn and garden" direct_allocation,2265004050,"Recreational equipment, lawn and garden" direct_allocation,2270010010,Oil and gas equipement -offroad_vehicles_equipment,2260005022,Agricultural off-highway vehicles -offroad_vehicles_equipment,2265005022,Agricultural off-highway vehicles -offroad_vehicles_equipment,2267005022,Agricultural off-highway vehicles -offroad_vehicles_equipment,2268005022,Agricultural off-highway vehicles -offroad_vehicles_equipment,2270005022,Agricultural off-highway vehicles -offroad_vehicles_equipment,2260005035,Agricultural off-highway vehicles -offroad_vehicles_equipment,2265005010,Agricultural off-highway vehicles -offroad_vehicles_equipment,2265005015,Agricultural off-highway vehicles -offroad_vehicles_equipment,2265005020,Agricultural off-highway vehicles -offroad_vehicles_equipment,2265005025,Agricultural off-highway vehicles -offroad_vehicles_equipment,2265005030,Agricultural off-highway vehicles -offroad_vehicles_equipment,2265005035,Agricultural off-highway vehicles -offroad_vehicles_equipment,2265005040,Agricultural off-highway vehicles -offroad_vehicles_equipment,2265005045,Agricultural off-highway vehicles -offroad_vehicles_equipment,2265005055,Agricultural off-highway vehicles -offroad_vehicles_equipment,2265005060,Agricultural off-highway vehicles -offroad_vehicles_equipment,2267005055,Agricultural off-highway vehicles -offroad_vehicles_equipment,2267005060,Agricultural off-highway vehicles -offroad_vehicles_equipment,2268005055,Agricultural off-highway vehicles -offroad_vehicles_equipment,2268005060,Agricultural off-highway vehicles -offroad_vehicles_equipment,2270005010,Agricultural off-highway vehicles -offroad_vehicles_equipment,2270005015,Agricultural off-highway vehicles -offroad_vehicles_equipment,2270005020,Agricultural off-highway vehicles -offroad_vehicles_equipment,2270005025,Agricultural off-highway vehicles -offroad_vehicles_equipment,2270005030,Agricultural off-highway vehicles -offroad_vehicles_equipment,2270005035,Agricultural off-highway vehicles -offroad_vehicles_equipment,2270005040,Agricultural off-highway vehicles -offroad_vehicles_equipment,2270005045,Agricultural off-highway vehicles -offroad_vehicles_equipment,2270005055,Agricultural off-highway vehicles -offroad_vehicles_equipment,2270005060,Agricultural off-highway vehicles -offroad_vehicles_equipment,2260002022,Construction equipment -offroad_vehicles_equipment,2265002022,Construction equipment -offroad_vehicles_equipment,2267002022,Construction equipment -offroad_vehicles_equipment,2268002022,Construction equipment -offroad_vehicles_equipment,2270002022,Construction equipment -offroad_vehicles_equipment,2260003022,Industrial off-highway vehicles -offroad_vehicles_equipment,2265003022,Industrial off-highway vehicles -offroad_vehicles_equipment,2265003060,Industrial off-highway vehicles -offroad_vehicles_equipment,2265010010,Industrial off-highway vehicles -offroad_vehicles_equipment,2267003022,Industrial off-highway vehicles -offroad_vehicles_equipment,2268003022,Industrial off-highway vehicles -offroad_vehicles_equipment,2268003060,Industrial off-highway vehicles -offroad_vehicles_equipment,2268010010,Industrial off-highway vehicles -offroad_vehicles_equipment,2270003022,Industrial off-highway vehicles -offroad_vehicles_equipment,2270003060,Industrial off-highway vehicles -offroad_vehicles_equipment,2260003030,Industrial off-highway vehicles -offroad_vehicles_equipment,2260003040,Industrial off-highway vehicles -offroad_vehicles_equipment,2265003010,Industrial off-highway vehicles -offroad_vehicles_equipment,2265003020,Industrial off-highway vehicles -offroad_vehicles_equipment,2265003030,Industrial off-highway vehicles -offroad_vehicles_equipment,2265003040,Industrial off-highway vehicles -offroad_vehicles_equipment,2265003050,Industrial off-highway vehicles -offroad_vehicles_equipment,2265003070,Industrial off-highway vehicles -offroad_vehicles_equipment,2267003010,Industrial off-highway vehicles -offroad_vehicles_equipment,2267003020,Industrial off-highway vehicles -offroad_vehicles_equipment,2267003030,Industrial off-highway vehicles -offroad_vehicles_equipment,2267003040,Industrial off-highway vehicles -offroad_vehicles_equipment,2267003050,Industrial off-highway vehicles -offroad_vehicles_equipment,2267003070,Industrial off-highway vehicles -offroad_vehicles_equipment,2268003020,Industrial off-highway vehicles -offroad_vehicles_equipment,2268003030,Industrial off-highway vehicles -offroad_vehicles_equipment,2268003040,Industrial off-highway vehicles -offroad_vehicles_equipment,2268003070,Industrial off-highway vehicles -offroad_vehicles_equipment,2270003010,Industrial off-highway vehicles -offroad_vehicles_equipment,2270003020,Industrial off-highway vehicles -offroad_vehicles_equipment,2270003030,Industrial off-highway vehicles -offroad_vehicles_equipment,2270003040,Industrial off-highway vehicles -offroad_vehicles_equipment,2270003050,Industrial off-highway vehicles -offroad_vehicles_equipment,2270003070,Industrial off-highway vehicles -offroad_vehicles_equipment,2260007022,Logging equipment -offroad_vehicles_equipment,2265007022,Logging equipment -offroad_vehicles_equipment,2267007022,Logging equipment -offroad_vehicles_equipment,2268007022,Logging equipment -offroad_vehicles_equipment,2270007022,Logging equipment -offroad_vehicles_equipment,2260007005,Logging equipment -offroad_vehicles_equipment,2265007010,Logging equipment -offroad_vehicles_equipment,2265007015,Logging equipment -offroad_vehicles_equipment,2270007015,Logging equipment -offroad_vehicles_equipment,2270007010,Logging equipment -offroad_vehicles_equipment,2270009010,Mining equipment -offroad_vehicles_equipment,2260002006,Construction and mining equipment -offroad_vehicles_equipment,2260002009,Construction and mining equipment -offroad_vehicles_equipment,2260002021,Construction and mining equipment -offroad_vehicles_equipment,2260002027,Construction and mining equipment -offroad_vehicles_equipment,2260002039,Construction and mining equipment -offroad_vehicles_equipment,2260002054,Construction and mining equipment -offroad_vehicles_equipment,2265002003,Construction and mining equipment -offroad_vehicles_equipment,2265002006,Construction and mining equipment -offroad_vehicles_equipment,2265002009,Construction and mining equipment -offroad_vehicles_equipment,2265002015,Construction and mining equipment -offroad_vehicles_equipment,2265002021,Construction and mining equipment -offroad_vehicles_equipment,2265002024,Construction and mining equipment -offroad_vehicles_equipment,2265002027,Construction and mining equipment -offroad_vehicles_equipment,2265002030,Construction and mining equipment -offroad_vehicles_equipment,2265002033,Construction and mining equipment -offroad_vehicles_equipment,2265002039,Construction and mining equipment -offroad_vehicles_equipment,2265002042,Construction and mining equipment -offroad_vehicles_equipment,2265002045,Construction and mining equipment -offroad_vehicles_equipment,2265002054,Construction and mining equipment -offroad_vehicles_equipment,2265002057,Construction and mining equipment -offroad_vehicles_equipment,2265002060,Construction and mining equipment -offroad_vehicles_equipment,2265002066,Construction and mining equipment -offroad_vehicles_equipment,2265002072,Construction and mining equipment -offroad_vehicles_equipment,2265002078,Construction and mining equipment -offroad_vehicles_equipment,2265002081,Construction and mining equipment -offroad_vehicles_equipment,2267002003,Construction and mining equipment -offroad_vehicles_equipment,2267002015,Construction and mining equipment -offroad_vehicles_equipment,2267002021,Construction and mining equipment -offroad_vehicles_equipment,2267002024,Construction and mining equipment -offroad_vehicles_equipment,2267002030,Construction and mining equipment -offroad_vehicles_equipment,2267002033,Construction and mining equipment -offroad_vehicles_equipment,2267002039,Construction and mining equipment -offroad_vehicles_equipment,2267002045,Construction and mining equipment -offroad_vehicles_equipment,2267002054,Construction and mining equipment -offroad_vehicles_equipment,2267002057,Construction and mining equipment -offroad_vehicles_equipment,2267002060,Construction and mining equipment -offroad_vehicles_equipment,2267002066,Construction and mining equipment -offroad_vehicles_equipment,2267002072,Construction and mining equipment -offroad_vehicles_equipment,2267002081,Construction and mining equipment -offroad_vehicles_equipment,2268002081,Construction and mining equipment -offroad_vehicles_equipment,2270002003,Construction and mining equipment -offroad_vehicles_equipment,2270002006,Construction and mining equipment -offroad_vehicles_equipment,2270002009,Construction and mining equipment -offroad_vehicles_equipment,2270002015,Construction and mining equipment -offroad_vehicles_equipment,2270002018,Construction and mining equipment -offroad_vehicles_equipment,2270002021,Construction and mining equipment -offroad_vehicles_equipment,2270002024,Construction and mining equipment -offroad_vehicles_equipment,2270002027,Construction and mining equipment -offroad_vehicles_equipment,2270002030,Construction and mining equipment -offroad_vehicles_equipment,2270002033,Construction and mining equipment -offroad_vehicles_equipment,2270002036,Construction and mining equipment -offroad_vehicles_equipment,2270002039,Construction and mining equipment -offroad_vehicles_equipment,2270002042,Construction and mining equipment -offroad_vehicles_equipment,2270002045,Construction and mining equipment -offroad_vehicles_equipment,2270002048,Construction and mining equipment -offroad_vehicles_equipment,2270002051,Construction and mining equipment -offroad_vehicles_equipment,2270002054,Construction and mining equipment -offroad_vehicles_equipment,2270002057,Construction and mining equipment -offroad_vehicles_equipment,2270002060,Construction and mining equipment -offroad_vehicles_equipment,2270002066,Construction and mining equipment -offroad_vehicles_equipment,2270002069,Construction and mining equipment -offroad_vehicles_equipment,2270002072,Construction and mining equipment -offroad_vehicles_equipment,2270002075,Construction and mining equipment -offroad_vehicles_equipment,2270002078,Construction and mining equipment -offroad_vehicles_equipment,2270002081,Construction and mining equipment -offroad_vehicles_equipment,2285002015,Railroad maintenance -offroad_vehicles_equipment,2285004015,Railroad maintenance -offroad_vehicles_equipment,2285006015,Railroad maintenance -offroad_vehicles_equipment,2260006022,Commercial Equipment -offroad_vehicles_equipment,2265006022,Commercial Equipment -offroad_vehicles_equipment,2267006022,Commercial Equipment -offroad_vehicles_equipment,2268006022,Commercial Equipment -offroad_vehicles_equipment,2270006022,Commercial Equipment -offroad_vehicles_equipment,2260006005,Commercial Equipment -offroad_vehicles_equipment,2260006010,Commercial Equipment -offroad_vehicles_equipment,2260006015,Commercial Equipment -offroad_vehicles_equipment,2260006035,Commercial Equipment -offroad_vehicles_equipment,2265006005,Commercial Equipment -offroad_vehicles_equipment,2265006010,Commercial Equipment -offroad_vehicles_equipment,2265006015,Commercial Equipment -offroad_vehicles_equipment,2265006025,Commercial Equipment -offroad_vehicles_equipment,2265006030,Commercial Equipment -offroad_vehicles_equipment,2265006035,Commercial Equipment -offroad_vehicles_equipment,2267006005,Commercial Equipment -offroad_vehicles_equipment,2267006010,Commercial Equipment -offroad_vehicles_equipment,2267006015,Commercial Equipment -offroad_vehicles_equipment,2267006025,Commercial Equipment -offroad_vehicles_equipment,2267006030,Commercial Equipment -offroad_vehicles_equipment,2267006035,Commercial Equipment -offroad_vehicles_equipment,2268006005,Commercial Equipment -offroad_vehicles_equipment,2268006010,Commercial Equipment -offroad_vehicles_equipment,2268006015,Commercial Equipment -offroad_vehicles_equipment,2268006020,Commercial Equipment -offroad_vehicles_equipment,2270006005,Commercial Equipment -offroad_vehicles_equipment,2270006010,Commercial Equipment -offroad_vehicles_equipment,2270006015,Commercial Equipment -offroad_vehicles_equipment,2270006025,Commercial Equipment -offroad_vehicles_equipment,2270006030,Commercial Equipment -offroad_vehicles_equipment,2270006035,Commercial Equipment -offroad_vehicles_equipment,2268006035,Commercial Equipment -offroad_vehicles_equipment,2270006020,Commercial Equipment +offroad_vehicles_equipment_a,2260005022,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2265005022,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2267005022,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2268005022,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2270005022,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2260005035,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2265005010,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2265005015,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2265005020,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2265005025,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2265005030,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2265005035,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2265005040,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2265005045,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2265005055,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2265005060,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2267005055,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2267005060,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2268005055,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2268005060,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2270005010,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2270005015,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2270005020,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2270005025,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2270005030,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2270005035,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2270005040,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2270005045,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2270005055,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2270005060,Agricultural off-highway vehicles +offroad_vehicles_equipment_a,2260002022,Construction equipment +offroad_vehicles_equipment_a,2265002022,Construction equipment +offroad_vehicles_equipment_a,2267002022,Construction equipment +offroad_vehicles_equipment_a,2268002022,Construction equipment +offroad_vehicles_equipment_a,2270002022,Construction equipment +offroad_vehicles_equipment_b,2260003022,Industrial off-highway vehicles +offroad_vehicles_equipment_b,2265003022,Industrial off-highway vehicles +offroad_vehicles_equipment_b,2265003060,Industrial off-highway vehicles +offroad_vehicles_equipment_b,2265010010,Industrial off-highway vehicles +offroad_vehicles_equipment_b,2267003022,Industrial off-highway vehicles +offroad_vehicles_equipment_b,2268003022,Industrial off-highway vehicles +offroad_vehicles_equipment_b,2268003060,Industrial off-highway vehicles +offroad_vehicles_equipment_b,2268010010,Industrial off-highway vehicles +offroad_vehicles_equipment_b,2270003022,Industrial off-highway vehicles +offroad_vehicles_equipment_b,2270003060,Industrial off-highway vehicles +offroad_vehicles_equipment_b,2260003030,Industrial off-highway vehicles +offroad_vehicles_equipment_b,2260003040,Industrial off-highway vehicles +offroad_vehicles_equipment_b,2265003010,Industrial off-highway vehicles +offroad_vehicles_equipment_b,2265003020,Industrial off-highway vehicles +offroad_vehicles_equipment_b,2265003030,Industrial off-highway vehicles +offroad_vehicles_equipment_b,2265003040,Industrial off-highway vehicles +offroad_vehicles_equipment_b,2265003050,Industrial off-highway vehicles +offroad_vehicles_equipment_b,2265003070,Industrial off-highway vehicles +offroad_vehicles_equipment_b,2267003010,Industrial off-highway vehicles +offroad_vehicles_equipment_e,2267003020,Industrial off-highway vehicles +offroad_vehicles_equipment_e,2267003030,Industrial off-highway vehicles +offroad_vehicles_equipment_e,2267003040,Industrial off-highway vehicles +offroad_vehicles_equipment_e,2267003050,Industrial off-highway vehicles +offroad_vehicles_equipment_e,2267003070,Industrial off-highway vehicles +offroad_vehicles_equipment_e,2268003020,Industrial off-highway vehicles +offroad_vehicles_equipment_e,2268003030,Industrial off-highway vehicles +offroad_vehicles_equipment_e,2268003040,Industrial off-highway vehicles +offroad_vehicles_equipment_e,2268003070,Industrial off-highway vehicles +offroad_vehicles_equipment_e,2270003010,Industrial off-highway vehicles +offroad_vehicles_equipment_e,2270003020,Industrial off-highway vehicles +offroad_vehicles_equipment_e,2270003030,Industrial off-highway vehicles +offroad_vehicles_equipment_e,2270003040,Industrial off-highway vehicles +offroad_vehicles_equipment_e,2270003050,Industrial off-highway vehicles +offroad_vehicles_equipment_e,2270003070,Industrial off-highway vehicles +offroad_vehicles_equipment_c,2260007022,Logging equipment +offroad_vehicles_equipment_c,2265007022,Logging equipment +offroad_vehicles_equipment_c,2267007022,Logging equipment +offroad_vehicles_equipment_c,2268007022,Logging equipment +offroad_vehicles_equipment_c,2270007022,Logging equipment +offroad_vehicles_equipment_c,2260007005,Logging equipment +offroad_vehicles_equipment_c,2265007010,Logging equipment +offroad_vehicles_equipment_c,2265007015,Logging equipment +offroad_vehicles_equipment_c,2270007015,Logging equipment +offroad_vehicles_equipment_c,2270007010,Logging equipment +offroad_vehicles_equipment_c,2270009010,Mining equipment +offroad_vehicles_equipment_c,2260002006,Construction and mining equipment +offroad_vehicles_equipment_c,2260002009,Construction and mining equipment +offroad_vehicles_equipment_c,2260002021,Construction and mining equipment +offroad_vehicles_equipment_c,2260002027,Construction and mining equipment +offroad_vehicles_equipment_c,2260002039,Construction and mining equipment +offroad_vehicles_equipment_c,2260002054,Construction and mining equipment +offroad_vehicles_equipment_c,2265002003,Construction and mining equipment +offroad_vehicles_equipment_c,2265002006,Construction and mining equipment +offroad_vehicles_equipment_c,2265002009,Construction and mining equipment +offroad_vehicles_equipment_c,2265002015,Construction and mining equipment +offroad_vehicles_equipment_c,2265002021,Construction and mining equipment +offroad_vehicles_equipment_c,2265002024,Construction and mining equipment +offroad_vehicles_equipment_c,2265002027,Construction and mining equipment +offroad_vehicles_equipment_c,2265002030,Construction and mining equipment +offroad_vehicles_equipment_c,2265002033,Construction and mining equipment +offroad_vehicles_equipment_c,2265002039,Construction and mining equipment +offroad_vehicles_equipment_c,2265002042,Construction and mining equipment +offroad_vehicles_equipment_c,2265002045,Construction and mining equipment +offroad_vehicles_equipment_c,2265002054,Construction and mining equipment +offroad_vehicles_equipment_c,2265002057,Construction and mining equipment +offroad_vehicles_equipment_c,2265002060,Construction and mining equipment +offroad_vehicles_equipment_c,2265002066,Construction and mining equipment +offroad_vehicles_equipment_c,2265002072,Construction and mining equipment +offroad_vehicles_equipment_c,2265002078,Construction and mining equipment +offroad_vehicles_equipment_c,2265002081,Construction and mining equipment +offroad_vehicles_equipment_c,2267002003,Construction and mining equipment +offroad_vehicles_equipment_c,2267002015,Construction and mining equipment +offroad_vehicles_equipment_c,2267002021,Construction and mining equipment +offroad_vehicles_equipment_c,2267002024,Construction and mining equipment +offroad_vehicles_equipment_c,2267002030,Construction and mining equipment +offroad_vehicles_equipment_c,2267002033,Construction and mining equipment +offroad_vehicles_equipment_c,2267002039,Construction and mining equipment +offroad_vehicles_equipment_c,2267002045,Construction and mining equipment +offroad_vehicles_equipment_c,2267002054,Construction and mining equipment +offroad_vehicles_equipment_c,2267002057,Construction and mining equipment +offroad_vehicles_equipment_c,2267002060,Construction and mining equipment +offroad_vehicles_equipment_c,2267002066,Construction and mining equipment +offroad_vehicles_equipment_c,2267002072,Construction and mining equipment +offroad_vehicles_equipment_c,2267002081,Construction and mining equipment +offroad_vehicles_equipment_c,2268002081,Construction and mining equipment +offroad_vehicles_equipment_c,2270002003,Construction and mining equipment +offroad_vehicles_equipment_c,2270002006,Construction and mining equipment +offroad_vehicles_equipment_c,2270002009,Construction and mining equipment +offroad_vehicles_equipment_c,2270002015,Construction and mining equipment +offroad_vehicles_equipment_c,2270002018,Construction and mining equipment +offroad_vehicles_equipment_c,2270002021,Construction and mining equipment +offroad_vehicles_equipment_c,2270002024,Construction and mining equipment +offroad_vehicles_equipment_c,2270002027,Construction and mining equipment +offroad_vehicles_equipment_c,2270002030,Construction and mining equipment +offroad_vehicles_equipment_c,2270002033,Construction and mining equipment +offroad_vehicles_equipment_c,2270002036,Construction and mining equipment +offroad_vehicles_equipment_c,2270002039,Construction and mining equipment +offroad_vehicles_equipment_c,2270002042,Construction and mining equipment +offroad_vehicles_equipment_c,2270002045,Construction and mining equipment +offroad_vehicles_equipment_c,2270002048,Construction and mining equipment +offroad_vehicles_equipment_c,2270002051,Construction and mining equipment +offroad_vehicles_equipment_c,2270002054,Construction and mining equipment +offroad_vehicles_equipment_c,2270002057,Construction and mining equipment +offroad_vehicles_equipment_c,2270002060,Construction and mining equipment +offroad_vehicles_equipment_c,2270002066,Construction and mining equipment +offroad_vehicles_equipment_c,2270002069,Construction and mining equipment +offroad_vehicles_equipment_c,2270002072,Construction and mining equipment +offroad_vehicles_equipment_c,2270002075,Construction and mining equipment +offroad_vehicles_equipment_c,2270002078,Construction and mining equipment +offroad_vehicles_equipment_c,2270002081,Construction and mining equipment +offroad_vehicles_equipment_c,2285002015,Railroad maintenance +offroad_vehicles_equipment_c,2285004015,Railroad maintenance +offroad_vehicles_equipment_c,2285006015,Railroad maintenance +offroad_vehicles_equipment_d,2260006022,Commercial Equipment +offroad_vehicles_equipment_d,2265006022,Commercial Equipment +offroad_vehicles_equipment_d,2267006022,Commercial Equipment +offroad_vehicles_equipment_d,2268006022,Commercial Equipment +offroad_vehicles_equipment_d,2270006022,Commercial Equipment +offroad_vehicles_equipment_d,2260006005,Commercial Equipment +offroad_vehicles_equipment_d,2260006010,Commercial Equipment +offroad_vehicles_equipment_d,2260006015,Commercial Equipment +offroad_vehicles_equipment_d,2260006035,Commercial Equipment +offroad_vehicles_equipment_d,2265006005,Commercial Equipment +offroad_vehicles_equipment_d,2265006010,Commercial Equipment +offroad_vehicles_equipment_d,2265006015,Commercial Equipment +offroad_vehicles_equipment_d,2265006025,Commercial Equipment +offroad_vehicles_equipment_d,2265006030,Commercial Equipment +offroad_vehicles_equipment_d,2265006035,Commercial Equipment +offroad_vehicles_equipment_d,2267006005,Commercial Equipment +offroad_vehicles_equipment_d,2267006010,Commercial Equipment +offroad_vehicles_equipment_d,2267006015,Commercial Equipment +offroad_vehicles_equipment_d,2267006025,Commercial Equipment +offroad_vehicles_equipment_d,2267006030,Commercial Equipment +offroad_vehicles_equipment_d,2267006035,Commercial Equipment +offroad_vehicles_equipment_d,2268006005,Commercial Equipment +offroad_vehicles_equipment_d,2268006010,Commercial Equipment +offroad_vehicles_equipment_d,2268006015,Commercial Equipment +offroad_vehicles_equipment_d,2268006020,Commercial Equipment +offroad_vehicles_equipment_d,2270006005,Commercial Equipment +offroad_vehicles_equipment_d,2270006010,Commercial Equipment +offroad_vehicles_equipment_d,2270006015,Commercial Equipment +offroad_vehicles_equipment_d,2270006025,Commercial Equipment +offroad_vehicles_equipment_d,2270006030,Commercial Equipment +offroad_vehicles_equipment_d,2270006035,Commercial Equipment +offroad_vehicles_equipment_d,2268006035,Commercial Equipment +offroad_vehicles_equipment_d,2270006020,Commercial Equipment diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2014.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2014.yaml index af51ec803..940fd4c54 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2014.yaml @@ -22,12 +22,52 @@ source_names: !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad year: *year activity_sets: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad:activity_sets - offroad_vehicles_equipment: - !include:CAP_HAP_common.yaml:source_names:EPA_NEI_Nonroad:activity_sets:offroad_vehicles_equipment + direct_allocation: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonroad_asets.csv direct_allocation + attribution_method: direct + offroad_vehicles_equipment_a: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonroad_asets.csv offroad_vehicles_equipment_a + attribution_method: proportional + attribution_source: + Detail_Use_2014: + geoscale: national + selection_fields: + SectorProducedBy: {'32411': ''} # Petroleum + offroad_vehicles_equipment_b: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonroad_asets.csv offroad_vehicles_equipment_b + attribution_method: proportional + attribution_source: + Detail_Use_2014: + geoscale: national + selection_fields: + SectorProducedBy: {'32411': ''} # Petroleum + offroad_vehicles_equipment_c: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonroad_asets.csv offroad_vehicles_equipment_c + attribution_method: proportional + attribution_source: + Detail_Use_2014: + geoscale: national + selection_fields: + SectorProducedBy: {'32411': ''} # Petroleum + offroad_vehicles_equipment_d: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonroad_asets.csv offroad_vehicles_equipment_d + attribution_method: proportional + attribution_source: + Detail_Use_2014: + geoscale: national + selection_fields: + SectorProducedBy: {'32411': ''} # Petroleum + offroad_vehicles_equipment_e: + selection_fields: + PrimaryActivity: !from_index:NEI_Nonroad_asets.csv offroad_vehicles_equipment_e + attribution_method: proportional attribution_source: Detail_Use_2014: geoscale: national selection_fields: SectorProducedBy: {'32411': ''} # Petroleum - From 9048c84e96a091071331cb5db64bf16bd4df4f8a Mon Sep 17 00:00:00 2001 From: Ben Young Date: Tue, 14 Nov 2023 11:10:20 -0500 Subject: [PATCH 1123/1127] replicate activity sets so can be called a single time for 2017 and 2020 --- .../NEI_Nonroad_asets.csv | 181 ++++++++++++++++++ 1 file changed, 181 insertions(+) diff --git a/flowsa/methods/flowbysectoractivitysets/NEI_Nonroad_asets.csv b/flowsa/methods/flowbysectoractivitysets/NEI_Nonroad_asets.csv index 83811e56b..93a4469be 100644 --- a/flowsa/methods/flowbysectoractivitysets/NEI_Nonroad_asets.csv +++ b/flowsa/methods/flowbysectoractivitysets/NEI_Nonroad_asets.csv @@ -74,6 +74,187 @@ direct_allocation,2282020005,"Recreational equipment, lawn and garden" direct_allocation,2282020010,"Recreational equipment, lawn and garden" direct_allocation,2265004050,"Recreational equipment, lawn and garden" direct_allocation,2270010010,Oil and gas equipement +offroad_vehicles_equipment,2260005022,Agricultural off-highway vehicles +offroad_vehicles_equipment,2265005022,Agricultural off-highway vehicles +offroad_vehicles_equipment,2267005022,Agricultural off-highway vehicles +offroad_vehicles_equipment,2268005022,Agricultural off-highway vehicles +offroad_vehicles_equipment,2270005022,Agricultural off-highway vehicles +offroad_vehicles_equipment,2260005035,Agricultural off-highway vehicles +offroad_vehicles_equipment,2265005010,Agricultural off-highway vehicles +offroad_vehicles_equipment,2265005015,Agricultural off-highway vehicles +offroad_vehicles_equipment,2265005020,Agricultural off-highway vehicles +offroad_vehicles_equipment,2265005025,Agricultural off-highway vehicles +offroad_vehicles_equipment,2265005030,Agricultural off-highway vehicles +offroad_vehicles_equipment,2265005035,Agricultural off-highway vehicles +offroad_vehicles_equipment,2265005040,Agricultural off-highway vehicles +offroad_vehicles_equipment,2265005045,Agricultural off-highway vehicles +offroad_vehicles_equipment,2265005055,Agricultural off-highway vehicles +offroad_vehicles_equipment,2265005060,Agricultural off-highway vehicles +offroad_vehicles_equipment,2267005055,Agricultural off-highway vehicles +offroad_vehicles_equipment,2267005060,Agricultural off-highway vehicles +offroad_vehicles_equipment,2268005055,Agricultural off-highway vehicles +offroad_vehicles_equipment,2268005060,Agricultural off-highway vehicles +offroad_vehicles_equipment,2270005010,Agricultural off-highway vehicles +offroad_vehicles_equipment,2270005015,Agricultural off-highway vehicles +offroad_vehicles_equipment,2270005020,Agricultural off-highway vehicles +offroad_vehicles_equipment,2270005025,Agricultural off-highway vehicles +offroad_vehicles_equipment,2270005030,Agricultural off-highway vehicles +offroad_vehicles_equipment,2270005035,Agricultural off-highway vehicles +offroad_vehicles_equipment,2270005040,Agricultural off-highway vehicles +offroad_vehicles_equipment,2270005045,Agricultural off-highway vehicles +offroad_vehicles_equipment,2270005055,Agricultural off-highway vehicles +offroad_vehicles_equipment,2270005060,Agricultural off-highway vehicles +offroad_vehicles_equipment,2260002022,Construction equipment +offroad_vehicles_equipment,2265002022,Construction equipment +offroad_vehicles_equipment,2267002022,Construction equipment +offroad_vehicles_equipment,2268002022,Construction equipment +offroad_vehicles_equipment,2270002022,Construction equipment +offroad_vehicles_equipment,2260003022,Industrial off-highway vehicles +offroad_vehicles_equipment,2265003022,Industrial off-highway vehicles +offroad_vehicles_equipment,2265003060,Industrial off-highway vehicles +offroad_vehicles_equipment,2265010010,Industrial off-highway vehicles +offroad_vehicles_equipment,2267003022,Industrial off-highway vehicles +offroad_vehicles_equipment,2268003022,Industrial off-highway vehicles +offroad_vehicles_equipment,2268003060,Industrial off-highway vehicles +offroad_vehicles_equipment,2268010010,Industrial off-highway vehicles +offroad_vehicles_equipment,2270003022,Industrial off-highway vehicles +offroad_vehicles_equipment,2270003060,Industrial off-highway vehicles +offroad_vehicles_equipment,2260003030,Industrial off-highway vehicles +offroad_vehicles_equipment,2260003040,Industrial off-highway vehicles +offroad_vehicles_equipment,2265003010,Industrial off-highway vehicles +offroad_vehicles_equipment,2265003020,Industrial off-highway vehicles +offroad_vehicles_equipment,2265003030,Industrial off-highway vehicles +offroad_vehicles_equipment,2265003040,Industrial off-highway vehicles +offroad_vehicles_equipment,2265003050,Industrial off-highway vehicles +offroad_vehicles_equipment,2265003070,Industrial off-highway vehicles +offroad_vehicles_equipment,2267003010,Industrial off-highway vehicles +offroad_vehicles_equipment,2267003020,Industrial off-highway vehicles +offroad_vehicles_equipment,2267003030,Industrial off-highway vehicles +offroad_vehicles_equipment,2267003040,Industrial off-highway vehicles +offroad_vehicles_equipment,2267003050,Industrial off-highway vehicles +offroad_vehicles_equipment,2267003070,Industrial off-highway vehicles +offroad_vehicles_equipment,2268003020,Industrial off-highway vehicles +offroad_vehicles_equipment,2268003030,Industrial off-highway vehicles +offroad_vehicles_equipment,2268003040,Industrial off-highway vehicles +offroad_vehicles_equipment,2268003070,Industrial off-highway vehicles +offroad_vehicles_equipment,2270003010,Industrial off-highway vehicles +offroad_vehicles_equipment,2270003020,Industrial off-highway vehicles +offroad_vehicles_equipment,2270003030,Industrial off-highway vehicles +offroad_vehicles_equipment,2270003040,Industrial off-highway vehicles +offroad_vehicles_equipment,2270003050,Industrial off-highway vehicles +offroad_vehicles_equipment,2270003070,Industrial off-highway vehicles +offroad_vehicles_equipment,2260007022,Logging equipment +offroad_vehicles_equipment,2265007022,Logging equipment +offroad_vehicles_equipment,2267007022,Logging equipment +offroad_vehicles_equipment,2268007022,Logging equipment +offroad_vehicles_equipment,2270007022,Logging equipment +offroad_vehicles_equipment,2260007005,Logging equipment +offroad_vehicles_equipment,2265007010,Logging equipment +offroad_vehicles_equipment,2265007015,Logging equipment +offroad_vehicles_equipment,2270007015,Logging equipment +offroad_vehicles_equipment,2270007010,Logging equipment +offroad_vehicles_equipment,2270009010,Mining equipment +offroad_vehicles_equipment,2260002006,Construction and mining equipment +offroad_vehicles_equipment,2260002009,Construction and mining equipment +offroad_vehicles_equipment,2260002021,Construction and mining equipment +offroad_vehicles_equipment,2260002027,Construction and mining equipment +offroad_vehicles_equipment,2260002039,Construction and mining equipment +offroad_vehicles_equipment,2260002054,Construction and mining equipment +offroad_vehicles_equipment,2265002003,Construction and mining equipment +offroad_vehicles_equipment,2265002006,Construction and mining equipment +offroad_vehicles_equipment,2265002009,Construction and mining equipment +offroad_vehicles_equipment,2265002015,Construction and mining equipment +offroad_vehicles_equipment,2265002021,Construction and mining equipment +offroad_vehicles_equipment,2265002024,Construction and mining equipment +offroad_vehicles_equipment,2265002027,Construction and mining equipment +offroad_vehicles_equipment,2265002030,Construction and mining equipment +offroad_vehicles_equipment,2265002033,Construction and mining equipment +offroad_vehicles_equipment,2265002039,Construction and mining equipment +offroad_vehicles_equipment,2265002042,Construction and mining equipment +offroad_vehicles_equipment,2265002045,Construction and mining equipment +offroad_vehicles_equipment,2265002054,Construction and mining equipment +offroad_vehicles_equipment,2265002057,Construction and mining equipment +offroad_vehicles_equipment,2265002060,Construction and mining equipment +offroad_vehicles_equipment,2265002066,Construction and mining equipment +offroad_vehicles_equipment,2265002072,Construction and mining equipment +offroad_vehicles_equipment,2265002078,Construction and mining equipment +offroad_vehicles_equipment,2265002081,Construction and mining equipment +offroad_vehicles_equipment,2267002003,Construction and mining equipment +offroad_vehicles_equipment,2267002015,Construction and mining equipment +offroad_vehicles_equipment,2267002021,Construction and mining equipment +offroad_vehicles_equipment,2267002024,Construction and mining equipment +offroad_vehicles_equipment,2267002030,Construction and mining equipment +offroad_vehicles_equipment,2267002033,Construction and mining equipment +offroad_vehicles_equipment,2267002039,Construction and mining equipment +offroad_vehicles_equipment,2267002045,Construction and mining equipment +offroad_vehicles_equipment,2267002054,Construction and mining equipment +offroad_vehicles_equipment,2267002057,Construction and mining equipment +offroad_vehicles_equipment,2267002060,Construction and mining equipment +offroad_vehicles_equipment,2267002066,Construction and mining equipment +offroad_vehicles_equipment,2267002072,Construction and mining equipment +offroad_vehicles_equipment,2267002081,Construction and mining equipment +offroad_vehicles_equipment,2268002081,Construction and mining equipment +offroad_vehicles_equipment,2270002003,Construction and mining equipment +offroad_vehicles_equipment,2270002006,Construction and mining equipment +offroad_vehicles_equipment,2270002009,Construction and mining equipment +offroad_vehicles_equipment,2270002015,Construction and mining equipment +offroad_vehicles_equipment,2270002018,Construction and mining equipment +offroad_vehicles_equipment,2270002021,Construction and mining equipment +offroad_vehicles_equipment,2270002024,Construction and mining equipment +offroad_vehicles_equipment,2270002027,Construction and mining equipment +offroad_vehicles_equipment,2270002030,Construction and mining equipment +offroad_vehicles_equipment,2270002033,Construction and mining equipment +offroad_vehicles_equipment,2270002036,Construction and mining equipment +offroad_vehicles_equipment,2270002039,Construction and mining equipment +offroad_vehicles_equipment,2270002042,Construction and mining equipment +offroad_vehicles_equipment,2270002045,Construction and mining equipment +offroad_vehicles_equipment,2270002048,Construction and mining equipment +offroad_vehicles_equipment,2270002051,Construction and mining equipment +offroad_vehicles_equipment,2270002054,Construction and mining equipment +offroad_vehicles_equipment,2270002057,Construction and mining equipment +offroad_vehicles_equipment,2270002060,Construction and mining equipment +offroad_vehicles_equipment,2270002066,Construction and mining equipment +offroad_vehicles_equipment,2270002069,Construction and mining equipment +offroad_vehicles_equipment,2270002072,Construction and mining equipment +offroad_vehicles_equipment,2270002075,Construction and mining equipment +offroad_vehicles_equipment,2270002078,Construction and mining equipment +offroad_vehicles_equipment,2270002081,Construction and mining equipment +offroad_vehicles_equipment,2285002015,Railroad maintenance +offroad_vehicles_equipment,2285004015,Railroad maintenance +offroad_vehicles_equipment,2285006015,Railroad maintenance +offroad_vehicles_equipment,2260006022,Commercial Equipment +offroad_vehicles_equipment,2265006022,Commercial Equipment +offroad_vehicles_equipment,2267006022,Commercial Equipment +offroad_vehicles_equipment,2268006022,Commercial Equipment +offroad_vehicles_equipment,2270006022,Commercial Equipment +offroad_vehicles_equipment,2260006005,Commercial Equipment +offroad_vehicles_equipment,2260006010,Commercial Equipment +offroad_vehicles_equipment,2260006015,Commercial Equipment +offroad_vehicles_equipment,2260006035,Commercial Equipment +offroad_vehicles_equipment,2265006005,Commercial Equipment +offroad_vehicles_equipment,2265006010,Commercial Equipment +offroad_vehicles_equipment,2265006015,Commercial Equipment +offroad_vehicles_equipment,2265006025,Commercial Equipment +offroad_vehicles_equipment,2265006030,Commercial Equipment +offroad_vehicles_equipment,2265006035,Commercial Equipment +offroad_vehicles_equipment,2267006005,Commercial Equipment +offroad_vehicles_equipment,2267006010,Commercial Equipment +offroad_vehicles_equipment,2267006015,Commercial Equipment +offroad_vehicles_equipment,2267006025,Commercial Equipment +offroad_vehicles_equipment,2267006030,Commercial Equipment +offroad_vehicles_equipment,2267006035,Commercial Equipment +offroad_vehicles_equipment,2268006005,Commercial Equipment +offroad_vehicles_equipment,2268006010,Commercial Equipment +offroad_vehicles_equipment,2268006015,Commercial Equipment +offroad_vehicles_equipment,2268006020,Commercial Equipment +offroad_vehicles_equipment,2270006005,Commercial Equipment +offroad_vehicles_equipment,2270006010,Commercial Equipment +offroad_vehicles_equipment,2270006015,Commercial Equipment +offroad_vehicles_equipment,2270006025,Commercial Equipment +offroad_vehicles_equipment,2270006030,Commercial Equipment +offroad_vehicles_equipment,2270006035,Commercial Equipment +offroad_vehicles_equipment,2268006035,Commercial Equipment +offroad_vehicles_equipment,2270006020,Commercial Equipment offroad_vehicles_equipment_a,2260005022,Agricultural off-highway vehicles offroad_vehicles_equipment_a,2265005022,Agricultural off-highway vehicles offroad_vehicles_equipment_a,2267005022,Agricultural off-highway vehicles From 2d01dfc4a6111ee9d3208be599a878c17f266803 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 15 Nov 2023 16:30:09 -0500 Subject: [PATCH 1124/1127] add back in convert to geoscale --- flowsa/data_source_scripts/EPA_NEI.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flowsa/data_source_scripts/EPA_NEI.py b/flowsa/data_source_scripts/EPA_NEI.py index fb955ddca..d5f2b50df 100644 --- a/flowsa/data_source_scripts/EPA_NEI.py +++ b/flowsa/data_source_scripts/EPA_NEI.py @@ -201,6 +201,9 @@ def clean_NEI_fba(fba: FlowByActivity, **_) -> FlowByActivity: new_fba = FlowByActivity(fba) for attr in attributes_to_save: setattr(new_fba, attr, attributes_to_save[attr]) + # to reduce the file size of the FBA and avoid memory errors, consolidate + # to geoscale (i.e., state) early on + new_fba = new_fba.convert_to_geoscale() return new_fba From 48007cc8bda5a5928d6c4ccd05402c03d58a15e3 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 15 Nov 2023 21:44:24 -0500 Subject: [PATCH 1125/1127] Rename MetaSources for 2014 CAP HAP methods --- .../flowbysectormethods/CAP_HAP_Nonroad_2014.yaml | 2 ++ .../flowbysectormethods/CAP_HAP_national_2014_m1.yaml | 9 +++++++++ .../flowbysectormethods/CAP_HAP_state_2014_m1.yaml | 9 +++++++++ 3 files changed, 20 insertions(+) diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2014.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2014.yaml index 940fd4c54..b326dab0a 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2014.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_Nonroad_2014.yaml @@ -26,6 +26,8 @@ source_names: selection_fields: PrimaryActivity: !from_index:NEI_Nonroad_asets.csv direct_allocation attribution_method: direct + # These activity sets are broken out into multiple sections to avoid + # MemoryErrors offroad_vehicles_equipment_a: selection_fields: PrimaryActivity: !from_index:NEI_Nonroad_asets.csv offroad_vehicles_equipment_a diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2014_m1.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2014_m1.yaml index fe7ce6d2d..d1dddbdc3 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_national_2014_m1.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_national_2014_m1.yaml @@ -15,6 +15,15 @@ source_names: CAP_HAP_Nonroad_2014: # detail state model year: *year data_format: FBS + # Rename MetaSources + selection_fields: + MetaSources: + 'EPA_NEI_Nonroad.direct_allocation': 'EPA_NEI_Nonroad.direct_allocation' + 'EPA_NEI_Nonroad.offroad_vehicles_equipment_a': 'EPA_NEI_Nonroad.offroad_vehicles_equipment' + 'EPA_NEI_Nonroad.offroad_vehicles_equipment_b': 'EPA_NEI_Nonroad.offroad_vehicles_equipment' + 'EPA_NEI_Nonroad.offroad_vehicles_equipment_c': 'EPA_NEI_Nonroad.offroad_vehicles_equipment' + 'EPA_NEI_Nonroad.offroad_vehicles_equipment_d': 'EPA_NEI_Nonroad.offroad_vehicles_equipment' + 'EPA_NEI_Nonroad.offroad_vehicles_equipment_e': 'EPA_NEI_Nonroad.offroad_vehicles_equipment' CAP_HAP_Onroad_2014: # detail state model year: *year diff --git a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2014_m1.yaml b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2014_m1.yaml index 08db3eda0..3a3618a00 100644 --- a/flowsa/methods/flowbysectormethods/CAP_HAP_state_2014_m1.yaml +++ b/flowsa/methods/flowbysectormethods/CAP_HAP_state_2014_m1.yaml @@ -14,6 +14,15 @@ source_names: CAP_HAP_Nonroad_2014: # detail state model year: *year data_format: FBS + # Rename MetaSources + selection_fields: + MetaSources: + 'EPA_NEI_Nonroad.direct_allocation': 'EPA_NEI_Nonroad.direct_allocation' + 'EPA_NEI_Nonroad.offroad_vehicles_equipment_a': 'EPA_NEI_Nonroad.offroad_vehicles_equipment' + 'EPA_NEI_Nonroad.offroad_vehicles_equipment_b': 'EPA_NEI_Nonroad.offroad_vehicles_equipment' + 'EPA_NEI_Nonroad.offroad_vehicles_equipment_c': 'EPA_NEI_Nonroad.offroad_vehicles_equipment' + 'EPA_NEI_Nonroad.offroad_vehicles_equipment_d': 'EPA_NEI_Nonroad.offroad_vehicles_equipment' + 'EPA_NEI_Nonroad.offroad_vehicles_equipment_e': 'EPA_NEI_Nonroad.offroad_vehicles_equipment' CAP_HAP_Onroad_2014: # detail state model year: *year From 2d7865d3f1630d64e2b49a56b6bae443464e7eb6 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 17 Nov 2023 08:49:26 -0700 Subject: [PATCH 1126/1127] update README code for FBA and FBS examples --- README.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 13db6421e..ec7625708 100644 --- a/README.md +++ b/README.md @@ -23,16 +23,16 @@ created in FLOWSA are the environmental inputs to ## Usage ### Flow-By-Activity (FBA) Datasets Flow-By-Activity datasets are formatted tables from a variety of sources. -They are largely unchanged from the original data source, with the -exception of formatting. A list of available FBA datasets can be found in +They are largely unchanged from the original data source, except for +formatting. A list of available FBA datasets can be found in the [Wiki](https://github.com/USEPA/flowsa/wiki/Available-Data#flow-by-activity-datasets). `import flowsa` \ -Return list of all availble FBA datasets, including years +Return list of all available FBA datasets, including years `flowsa.seeAvailableFlowByModels('FBA')` \ Generate and return pandas dataframe for 2014 Energy Information Administration (EIA) Manufacturing Energy Consumption Survey (MECS) land use \ -`fba = getFlowByActivity(datasource="EIA_MECS_Land", year=2014)` +`fba = flowsa.getFlowByActivity(datasource="EIA_MECS_Land", year=2014)` ### Flow-By-Sector (FBS) Datasets Flow-By-Sector datasets are tables of environmental and other data @@ -41,14 +41,18 @@ FBS datasets can be found in the [Wiki](https://github.com/USEPA/flowsa/wiki/Available-Data#flow-by-sector-datasets). `import flowsa` \ -Return list of all available FBS datasets, including years +Return list of all available FBS datasets `flowsa.seeAvailableFlowByModels('FBS')` \ Generate and return pandas dataframe for national water withdrawals attributed to 6-digit sectors. Download all required FBA datasets from Data Commons. \ -`fbs_water = getFlowBySector('Water_national_2015_m1', +`fbs = flowsa.getFlowBySector('Water_national_2015_m1', download_FBAs_if_missing=True)` +### Examples +Additional example code can be found in the [examples](https://github. +com/USEPA/flowsa/tree/master/examples) folder. + ## Installation `pip install git+https://github.com/USEPA/flowsa.git@vX.X.X#egg=flowsa` From 5644e7a93828c873ae45066f98b1bc0d4fde2f82 Mon Sep 17 00:00:00 2001 From: catherinebirney Date: Fri, 17 Nov 2023 14:07:54 -0700 Subject: [PATCH 1127/1127] add datavis functions to flowsa _init_ and update example stackedbarcharts --- examples/generate_data_visualization.py | 38 ++++++++++++++++--------- flowsa/__init__.py | 3 +- flowsa/datavisualization.py | 20 ------------- 3 files changed, 27 insertions(+), 34 deletions(-) diff --git a/examples/generate_data_visualization.py b/examples/generate_data_visualization.py index 1114b2bde..ecfddb9a2 100644 --- a/examples/generate_data_visualization.py +++ b/examples/generate_data_visualization.py @@ -8,12 +8,12 @@ Generate plots to explore Flow-By-Sector model outputs """ -import flowsa.datavisualization as dv +import flowsa from flowsa.settings import plotoutputpath import matplotlib.pyplot as plt -########## Produce facet graph of resources associated with cropland sectors ########## +### Produce facet graph of resources associated with livestock sectors ### sectors = ['112'] sector_length_display = 6 plottype = 'facet_graph' @@ -22,7 +22,7 @@ 'Employment 2017': 'Employment_national_2017'} -dv.FBSscatterplot(method_dict, plottype, +flowsa.FBSscatterplot(method_dict, plottype, sector_length_display=sector_length_display, sectors_to_include=sectors, plot_title='Direct Resource Use for Livestock' @@ -31,14 +31,14 @@ plt.savefig(plotoutputpath / "livestock_resource_use.png", dpi=300) -########## Compare the results between water method 1 and method 2 ########## +### Compare the results between national employment for 2015 and 2018 ### sectors = ['21'] sector_length_display = 6 plottype = 'method_comparison' method_dict = {'National Employment 2015': 'Employment_national_2015', 'National Employment 2018': 'Employment_national_2018'} -dv.FBSscatterplot(method_dict, plottype, +flowsa.FBSscatterplot(method_dict, plottype, sector_length_display=sector_length_display, sectors_to_include=sectors, plot_title=('Comparison of 2015 and 2018 Employment ' @@ -48,17 +48,29 @@ plt.savefig(plotoutputpath / "mining_employment_comp.png", dpi=300) -####### GHG Bar Chart ############ +### GHG Bar Chart ### # Option 1 - GHG emissions by GHG -dv.stackedBarChart('GHG_national_2018_m1', - selection_fields={'SectorProducedBy': ['111110', '112120', '325312']}, - filename='GHGEmissions') +flowsa.stackedBarChart('GHG_national_2018_m1', + generalize_AttributionSources=True, + selection_fields={'SectorProducedBy': ['111', '324'], + 'Flowable': ['Carbon dioxide', + 'Methane']}, + industry_spec={'default': 'NAICS_3'}, + filename='GHG_national_2018_m1_emissions_barchart', + axis_title='Emissions (MMT CO2e)' + ) # Option 2 - specify indicator, much have LCIAformatter installed # https://github.com/USEPA/LCIAformatter -dv.stackedBarChart('GHG_national_2018_m1', impact_cat='Global warming', - selection_fields={'SectorProducedBy': ['111110', '112120', '325312']}, - filename='GHGEmissionsGlobalWarming') +flowsa.stackedBarChart('GHG_national_2018_m1', + generalize_AttributionSources=True, + impact_cat="Global warming", + selection_fields={'SectorProducedBy': ['111', '324'], + 'Flowable': ['Carbon dioxide']}, + industry_spec={'default': 'NAICS_3'}, + filename='GHG_national_2018_m1_CO2_barchart', + axis_title='Global Warming Potential (MMT CO2e)' + ) # todo: will update the sankey code for recursive method post v2.0 release @@ -83,7 +95,7 @@ # 1: {'x': [.51, 0.99], 'y': [.12, .88]} # } # -# dv.generateSankeyDiagram( +# flowsa.generateSankeyDiagram( # methodnames, # target_sector_level=target_sector_level, # target_subset_sector_level=target_subset_sector_level, diff --git a/flowsa/__init__.py b/flowsa/__init__.py index 78ee18246..f9a15550e 100644 --- a/flowsa/__init__.py +++ b/flowsa/__init__.py @@ -19,6 +19,7 @@ from flowsa.common import seeAvailableFlowByModels from flowsa.flowbyactivity import getFlowByActivity from flowsa.flowbysector import getFlowBySector, collapse_FlowBySector +from flowsa.datavisualization import (FBSscatterplot, stackedBarChart, + plot_state_coefficients) # from flowsa.bibliography import writeFlowBySectorBibliography -# from flowsa.datavisualization import generateFBSplot diff --git a/flowsa/datavisualization.py b/flowsa/datavisualization.py index a0055c73f..d0c18ad55 100644 --- a/flowsa/datavisualization.py +++ b/flowsa/datavisualization.py @@ -774,23 +774,3 @@ def convert_units_for_graphics(df): # log.info(f'Saving file to {plotoutputpath / filename}.svg') # fig.write_image(plotoutputpath / f"{filename}.svg", # width=width, height=height) - -# todo: revise data vis fxns for recursive method -# def generateFBSplot(method_dict, plottype, sector_length_display=None, -# sectors_to_include=None, plot_title=None): -# """ -# Plot the results of FBS models. Graphic can either be a faceted -# scatterplot or a method comparison -# :param method_dict: dictionary, key is the label, value is the FBS -# methodname -# :param plottype: str, 'facet_graph' or 'method_comparison' -# :param sector_length_display: numeric, sector length by which to -# aggregate, default is 'None' which returns the max sector length in a -# dataframe -# :param sectors_to_include: list, sectors to include in output. Sectors -# are subset by all sectors that "start with" the values in this list -# :return: graphic displaying results of FBS models -# """ -# -# FBSscatterplot(method_dict, plottype, sector_length_display, -# sectors_to_include, plot_title)